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
linkbuf defined in line 98; used 18 times
namelist defined in line 76; used 74 times
subcmd defined in line 81; used 36 times

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
DCOLON defined in line 34; used 5 times
EQUAL defined in line 28; used 3 times
EXCEPT defined in line 39; used 6 times
E_ALL defined in line 65; used 5 times
E_SHELL defined in line 63; used 2 times
E_TILDE defined in line 64; used 4 times
E_VARS defined in line 62; used 8 times
HASHSIZE defined in line 49; used 2 times
INMAX defined in line 50; used 3 times
INSERT defined in line 69; used 3 times
INSTALL defined in line 37; used 6 times
ISDIR defined in line 72; used 4 times
LOOKUP defined in line 68; used 2 times
LP defined in line 29; used 3 times
MAILCMD defined in line 25; used 2 times
NAME defined in line 35; used 12 times
NOTIFY defined in line 38; used 6 times
OPTION defined in line 42; used 10 times
PATTERN defined in line 40; used 5 times
QUOTE defined in line 45; used 2 times
REPLACE defined in line 70; used 1 times
RP defined in line 30; used 3 times
SM defined in line 31; used 7 times
SPECIAL defined in line 41; used 5 times
STRING defined in line 36; used 4 times
TRIM defined in line 46; used 9 times
VERSION defined in line 23; used 3 times
WHOLE defined in line 54; used 5 times

Usage of this include

Last modified: 1986-03-21
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1502
Valid CSS Valid XHTML 1.0 Strict