added -r option to remove extra files.
[unix-history] / usr / src / usr.bin / rdist / defs.h
... / ...
CommitLineData
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
53struct 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
61extern int debug; /* debugging flag */
62extern int nflag; /* NOP flag, don't execute commands */
63extern int qflag; /* Quiet. don't print messages */
64extern int options; /* global options */
65
66extern int errs; /* number of errors seen */
67extern int rem; /* remote file descriptor */
68extern int iamremote; /* acting as remote server */
69extern int filec; /* number of files to update */
70extern char **filev; /* list of files/directories to update */
71extern char tmpfile[]; /* file name for logging changes */
72extern char host[]; /* host name of master copy */
73extern char *rhost; /* host name of remote being updated */
74extern struct block *except; /* list of files to exclude */
75extern char buf[]; /* general purpose buffer */
76extern int errno; /* system error number */
77extern char *sys_errlist[];
78
79struct block *lookup();
80struct block *makeblock();
81struct block *expand();
82char *malloc();
83char *rindex();
84char *index();