1: /*
2: * Copyright (c) 1983 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)defs.h 5.2 (Berkeley) 3/20/86
7: */
8:
9: #include <stdio.h>
10: #include <ctype.h>
11: #include <errno.h>
12: #include <pwd.h>
13: #include <grp.h>
14: #include <sys/param.h>
15: #include <sys/dir.h>
16: #include <sys/stat.h>
17: #include <sys/time.h>
18: #include <netinet/in.h>
19:
20: /*
21: * The version number should be changed whenever the protocol changes.
22: */
23: #define VERSION 3
24:
25: #define MAILCMD "/usr/lib/sendmail -oi -t"
26:
27: /* defines for yacc */
28: #define EQUAL 1
29: #define LP 2
30: #define RP 3
31: #define SM 4
32: #define ARROW 5
33: #define COLON 6
34: #define DCOLON 7
35: #define NAME 8
36: #define STRING 9
37: #define INSTALL 10
38: #define NOTIFY 11
39: #define EXCEPT 12
40: #define PATTERN 13
41: #define SPECIAL 14
42: #define OPTION 15
43:
44: /* lexical definitions */
45: #define QUOTE 0200 /* used internally for quoted characters */
46: #define TRIM 0177 /* Mask to strip quote bit */
47:
48: /* table sizes */
49: #define HASHSIZE 1021
50: #define INMAX 3500
51:
52: /* option flags */
53: #define VERIFY 0x1
54: #define WHOLE 0x2
55: #define YOUNGER 0x4
56: #define COMPARE 0x8
57: #define REMOVE 0x10
58: #define FOLLOW 0x20
59: #define IGNLNKS 0x40
60:
61: /* expand type definitions */
62: #define E_VARS 0x1
63: #define E_SHELL 0x2
64: #define E_TILDE 0x4
65: #define E_ALL 0x7
66:
67: /* actions for lookup() */
68: #define LOOKUP 0
69: #define INSERT 1
70: #define REPLACE 2
71:
72: #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
73:
74: #define ALLOC(x) (struct x *) malloc(sizeof(struct x))
75:
76: struct namelist { /* for making lists of strings */
77: char *n_name;
78: struct namelist *n_next;
79: };
80:
81: struct subcmd {
82: short sc_type; /* type - INSTALL,NOTIFY,EXCEPT,SPECIAL */
83: short sc_options;
84: char *sc_name;
85: struct namelist *sc_args;
86: struct subcmd *sc_next;
87: };
88:
89: struct cmd {
90: int c_type; /* type - ARROW,DCOLON */
91: char *c_name; /* hostname or time stamp file name */
92: char *c_label; /* label for partial update */
93: struct namelist *c_files;
94: struct subcmd *c_cmds;
95: struct cmd *c_next;
96: };
97:
98: struct linkbuf {
99: ino_t inum;
100: dev_t devnum;
101: int count;
102: char pathname[BUFSIZ];
103: char target[BUFSIZ];
104: struct linkbuf *nextp;
105: };
106:
107: extern int debug; /* debugging flag */
108: extern int nflag; /* NOP flag, don't execute commands */
109: extern int qflag; /* Quiet. don't print messages */
110: extern int options; /* global options */
111:
112: extern int nerrs; /* number of errors seen */
113: extern int rem; /* remote file descriptor */
114: extern int iamremote; /* acting as remote server */
115: extern char tmpfile[]; /* file name for logging changes */
116: extern struct linkbuf *ihead; /* list of files with more than one link */
117: extern struct passwd *pw; /* pointer to static area used by getpwent */
118: extern struct group *gr; /* pointer to static area used by getgrent */
119: extern char host[]; /* host name of master copy */
120: extern char buf[]; /* general purpose buffer */
121: extern int errno; /* system error number */
122: extern char *sys_errlist[];
123:
124: char *makestr();
125: struct namelist *makenl();
126: struct subcmd *makesubcmd();
127: struct namelist *lookup();
128: struct namelist *expand();
129: char *exptilde();
130: char *malloc();
131: char *rindex();
132: char *index();
Defined struct's
cmd
defined in line
89; used 14 times
namelist
defined in line
76; used 74 times
- in line 78(2),
85(2),
93(2),
125-128(6)
- in /usr/src/ucb/rdist/docmd.c line
35(2),
86-90(4),
295-300(4),
451(2),
526-529(4),
544(2)
- in /usr/src/ucb/rdist/expand.c line
48-53(6),
111(2)
- in /usr/src/ucb/rdist/gram.y line
16(2),
41(2),
110(2),
133(2),
336-340(4),
386(2),
442-446(4)
- in /usr/src/ucb/rdist/lookup.c line
20(2),
33-34(4),
92-96(4)
- in /usr/src/ucb/rdist/main.c line
198-203(6),
250(2)
subcmd
defined in line
81; used 36 times
- in line 86(2),
94(2),
126(2)
- in /usr/src/ucb/rdist/docmd.c line
20(2),
88-91(4),
297-299(4),
543(2)
- in /usr/src/ucb/rdist/gram.y line
17(2),
40(2),
337(2),
388(2),
459(2),
465(2)
- in /usr/src/ucb/rdist/main.c line
201(2)
- in /usr/src/ucb/rdist/server.c line
259(2),
266(2)
Defined macros
ALLOC
defined in line
74; used 5 times
ARROW
defined in line
32; used 5 times
COLON
defined in line
33; used 4 times
EQUAL
defined in line
28; used 3 times
E_ALL
defined in line
65; used 5 times
INMAX
defined in line
50; used 3 times
ISDIR
defined in line
72; used 4 times
LP
defined in line
29; used 3 times
NAME
defined in line
35; used 12 times
OPTION
defined in line
42; used 10 times
QUOTE
defined in line
45; used 2 times
RP
defined in line
30; used 3 times
SM
defined in line
31; used 7 times
TRIM
defined in line
46; used 9 times
VERIFY
defined in line
53; used 17 times
- in /usr/src/ucb/rdist/docmd.c line
322,
351,
458
- in /usr/src/ucb/rdist/gram.y line
283
- in /usr/src/ucb/rdist/main.c line
105-107(2),
129
- in /usr/src/ucb/rdist/server.c line
198,
297,
394,
460,
713,
786,
858,
1063,
1185,
1350
WHOLE
defined in line
54; used 5 times
Usage of this include