-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmachdep.h
68 lines (51 loc) · 1.42 KB
/
machdep.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
/*****************************************************
*
* MSDOS stuff
*
*****************************************************/
#ifdef MSDOS
# include <ctype.h>
# include <string.h>
# include <malloc.h>
# define STRICMP(s1,s2) _stricmp (s1,s2)
# ifdef _WINDOWS
# define STRDUP(str) _strdup(str)
# else
# define STRDUP(str) strdup(str)
# endif
# define USERNAME getenv("LOGNAME")!=NULL?getenv("LOGNAME"):getenv("USER")!=NULL?getenv("USER"):"Unknown")
# define GETTIME(tm,str) strftime(str,15,"%X",tm)
# ifdef US_VERSION
# define GETDATE(tm,str) strftime(str,15,"%b %d %y",tm)
# else
# define GETDATE(tm,str) strftime(str,15,"%d %b %y",tm)
# endif
#else
/*****************************************************
*
* Unix stuff
*
*****************************************************/
# include <pwd.h>
# include <string.h>
# ifdef __STDC__
# include <unistd.h>
# endif
# define LPR "lpr -P " /* spooler with option to set name of printer */
# define STRICMP(s1,s2) strcasecmp(s1,s2)
# ifdef ultrix
# define STRDUP(str) strcpy(malloc(strlen(str)+1), str)
# else
# define STRDUP(str) strdup(str)
# endif
# define USERNAME ((getpwuid (getuid()))->pw_name)
# define GETTIME(tm,str) strftime(str,15,"%T",tm)
# ifdef US_VERSION
# define GETDATE(tm,str) strftime(str,15,"%h %d %y",tm)
# else
# define GETDATE(tm,str) strftime(str,15,"%d %h %y",tm)
# endif
#endif