| 1 | /* defs.h 4.5 83/10/20 */ |
| 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 | |
| 15 | #define MAILCMD "/usr/lib/sendmail -oi -t" |
| 16 | |
| 17 | /* defines for yacc */ |
| 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 |
| 30 | |
| 31 | /* lexical definitions */ |
| 32 | #define QUOTE 0200 /* used internally for quoted characters */ |
| 33 | #define TRIM 0177 /* Mask to strip quote bit */ |
| 34 | |
| 35 | /* table sizes */ |
| 36 | #define HASHSIZE 1021 |
| 37 | #define INMAX 3500 |
| 38 | #define NCARGS 10240 |
| 39 | #define GAVSIZ NCARGS / 6 |
| 40 | #define NSTAMPS 15 |
| 41 | |
| 42 | /* option flags */ |
| 43 | #define VERIFY 0x1 |
| 44 | #define WHOLE 0x2 |
| 45 | #define YOUNGER 0x4 |
| 46 | #define STRIP 0x8 |
| 47 | #define REMOVE 0x10 |
| 48 | |
| 49 | #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR) |
| 50 | |
| 51 | #define ALLOC(x) (struct x *) malloc(sizeof(struct x)) |
| 52 | |
| 53 | struct block { |
| 54 | short b_type; |
| 55 | short b_options; |
| 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 */ |
| 64 | extern int options; /* global options */ |
| 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 */ |
| 71 | extern char tmpfile[]; /* file name for logging changes */ |
| 72 | extern char host[]; /* host name of master copy */ |
| 73 | extern char *rhost; /* host name of remote being updated */ |
| 74 | extern struct block *except; /* list of files to exclude */ |
| 75 | extern char buf[]; /* general purpose buffer */ |
| 76 | extern int errno; /* system error number */ |
| 77 | extern char *sys_errlist[]; |
| 78 | |
| 79 | struct block *lookup(); |
| 80 | struct block *makeblock(); |
| 81 | struct block *expand(); |
| 82 | char *malloc(); |
| 83 | char *rindex(); |
| 84 | char *index(); |