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