Commit | Line | Data |
---|---|---|
e8109cf8 | 1 | /* defs.h 4.7 83/11/01 */ |
ca9611a8 RC |
2 | |
3 | #include <stdio.h> | |
4 | #include <ctype.h> | |
5 | #include <errno.h> | |
6 | #include <pwd.h> | |
7 | #include <grp.h> | |
8 | #include <signal.h> | |
9 | #include <sys/types.h> | |
10 | #include <sys/dir.h> | |
11 | #include <sys/stat.h> | |
12 | #include <sys/time.h> | |
13 | #include <netinet/in.h> | |
14 | ||
3024eb6f | 15 | #define MAILCMD "/usr/lib/sendmail -oi -t" |
ca9611a8 RC |
16 | |
17 | /* defines for yacc */ | |
d1dee8e8 RC |
18 | #define EQUAL 1 |
19 | #define LP 2 | |
20 | #define RP 3 | |
21 | #define SM 4 | |
22 | #define ARROW 5 | |
23 | #define DCOLON 6 | |
24 | #define NAME 7 | |
25 | #define INSTALL 8 | |
26 | #define NOTIFY 9 | |
27 | #define EXCEPT 10 | |
28 | #define OPTION 11 | |
29 | #define VAR 12 | |
82572cb6 RC |
30 | |
31 | /* lexical definitions */ | |
32 | #define QUOTE 0200 /* used internally for quoted characters */ | |
33 | #define TRIM 0177 /* Mask to strip quote bit */ | |
ca9611a8 RC |
34 | |
35 | /* table sizes */ | |
d1dee8e8 RC |
36 | #define HASHSIZE 1021 |
37 | #define INMAX 3500 | |
38 | #define NCARGS 10240 | |
39 | #define GAVSIZ NCARGS / 6 | |
40 | #define NSTAMPS 15 | |
82572cb6 | 41 | |
3024eb6f | 42 | /* option flags */ |
d1dee8e8 RC |
43 | #define VERIFY 0x1 |
44 | #define WHOLE 0x2 | |
45 | #define YOUNGER 0x4 | |
024fde5b | 46 | #define COMPARE 0x8 |
e8109cf8 | 47 | #define REMOVE 0x10 |
d1dee8e8 RC |
48 | |
49 | #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR) | |
ca9611a8 RC |
50 | |
51 | #define ALLOC(x) (struct x *) malloc(sizeof(struct x)) | |
52 | ||
53 | struct block { | |
3024eb6f RC |
54 | short b_type; |
55 | short b_options; | |
ca9611a8 RC |
56 | char *b_name; |
57 | struct block *b_next; | |
58 | struct block *b_args; | |
59 | }; | |
60 | ||
61 | extern int debug; /* debugging flag */ | |
62 | extern int nflag; /* NOP flag, don't execute commands */ | |
63 | extern int qflag; /* Quiet. don't print messages */ | |
f7770429 | 64 | extern int options; /* global options */ |
ca9611a8 RC |
65 | |
66 | extern int errs; /* number of errors seen */ | |
67 | extern int rem; /* remote file descriptor */ | |
68 | extern int iamremote; /* acting as remote server */ | |
69 | extern int filec; /* number of files to update */ | |
70 | extern char **filev; /* list of files/directories to update */ | |
82572cb6 | 71 | extern char tmpfile[]; /* file name for logging changes */ |
e8109cf8 RC |
72 | extern struct passwd *pw; /* pointer to static area used by getpwent */ |
73 | extern struct group *gr; /* pointer to static area used by getgrent */ | |
ca9611a8 RC |
74 | extern char host[]; /* host name of master copy */ |
75 | extern char *rhost; /* host name of remote being updated */ | |
76 | extern struct block *except; /* list of files to exclude */ | |
77 | extern char buf[]; /* general purpose buffer */ | |
78 | extern int errno; /* system error number */ | |
79 | extern char *sys_errlist[]; | |
80 | ||
81 | struct block *lookup(); | |
82572cb6 | 82 | struct block *makeblock(); |
ca9611a8 | 83 | struct block *expand(); |
3024eb6f | 84 | char *malloc(); |
ca9611a8 | 85 | char *rindex(); |
82572cb6 | 86 | char *index(); |