1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 #ifndef CRONIE_MACROS_H
23 #define CRONIE_MACROS_H
24
25 #ifdef HAVE_LIMITS_H
26 #include <limits.h>
27 #endif
28
29
30
31
32
33
34 #define TRUE 1
35 #define FALSE 0
36
37 #define OK 0
38
39 #define ERR (-1)
40
41
42 #ifndef DEBUGGING
43 #define DEBUGGING FALSE
44 #endif
45
46 #define INIT_PID 1
47 #define READ_PIPE 0
48 #define WRITE_PIPE 1
49 #define STDIN 0
50 #define STDOUT 1
51 #define STDERR 2
52 #define ERROR_EXIT 1
53 #define OK_EXIT 0
54 #define MAX_FNAME PATH_MAX
55 #define MAX_COMMAND 131072
56 #define MAX_ENVSTR 131072
57 #define MAX_TEMPSTR 131072
58 #define MAX_UNAME 256
59 #define ROOT_UID 0
60 #define ROOT_USER "root"
61
62
63
64
65 #define DEXT 0x0001
66 #define DSCH 0x0002
67 #define DPROC 0x0004
68 #define DPARS 0x0008
69 #define DLOAD 0x0010
70 #define DMISC 0x0020
71 #define DTEST 0x0040
72
73 #define PPC_NULL ((const char **)NULL)
74
75 #ifndef MAXHOSTNAMELEN
76 #define MAXHOSTNAMELEN 64
77 #endif
78
79 #define Skip_Blanks(c, f) \
80 while (c == '\t' || c == ' ') \
81 c = get_char(f);
82
83 #define Skip_Nonblanks(c, f) \
84 while (c!='\t' && c!=' ' && c!='\n' && c != EOF) \
85 c = get_char(f);
86
87 #if DEBUGGING
88 # define Debug(mask, message) \
89 if ((DebugFlags & (mask)) != 0) \
90 printf message
91 #else
92 # define Debug(mask, message) \
93 ()
94 #endif
95
96 #define MkUpper(ch) (islower(ch) ? toupper(ch) : ch)
97 #define Set_LineNum(ln) {Debug(DPARS|DEXT,("linenum=%d\n",ln)); \
98 LineNumber = ln; \
99 }
100
101 #ifdef HAVE_STRUCT_TM_TM_GMTOFF
102 #define get_gmtoff(c, t) ((t)->tm_gmtoff)
103 #endif
104
105 #define SECONDS_PER_MINUTE 60
106 #define SECONDS_PER_HOUR 3600
107
108 #define FIRST_MINUTE 0
109 #define LAST_MINUTE 59
110 #define MINUTE_COUNT (LAST_MINUTE - FIRST_MINUTE + 1)
111
112 #define FIRST_HOUR 0
113 #define LAST_HOUR 23
114 #define HOUR_COUNT (LAST_HOUR - FIRST_HOUR + 1)
115
116 #define FIRST_DOM 1
117 #define LAST_DOM 31
118 #define DOM_COUNT (LAST_DOM - FIRST_DOM + 1)
119
120 #define FIRST_MONTH 1
121 #define LAST_MONTH 12
122 #define MONTH_COUNT (LAST_MONTH - FIRST_MONTH + 1)
123
124
125 #define FIRST_DOW 0
126 #define LAST_DOW 7
127 #define DOW_COUNT (LAST_DOW - FIRST_DOW + 1)
128
129
130
131
132
133
134
135 #include <fcntl.h>
136 #ifndef O_NOFOLLOW
137 #define O_NOFOLLOW 0
138 #endif
139
140 #endif