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.3 (2.11BSD GTE) 1996/3/22
   7:  */
   8: 
   9: #include <stdio.h>
  10: #include <ctype.h>
  11: #include <errno.h>
  12: #include <string.h>
  13: #include <pwd.h>
  14: #include <grp.h>
  15: #include <sys/param.h>
  16: #include <sys/dir.h>
  17: #include <sys/stat.h>
  18: #include <sys/time.h>
  19: #include <netinet/in.h>
  20: 
  21: /*
  22:  * The version number should be changed whenever the protocol changes.
  23:  */
  24: #define VERSION  3
  25: 
  26:     /* defines for yacc */
  27: #define EQUAL   1
  28: #define LP  2
  29: #define RP  3
  30: #define SM  4
  31: #define ARROW   5
  32: #define COLON   6
  33: #define DCOLON  7
  34: #define NAME    8
  35: #define STRING  9
  36: #define INSTALL 10
  37: #define NOTIFY  11
  38: #define EXCEPT  12
  39: #define PATTERN 13
  40: #define SPECIAL 14
  41: #define OPTION  15
  42: 
  43:     /* lexical definitions */
  44: #define QUOTE   0200        /* used internally for quoted characters */
  45: #define TRIM    0177        /* Mask to strip quote bit */
  46: 
  47:     /* table sizes */
  48: #define HASHSIZE    1021
  49: #define INMAX   3500
  50: 
  51:     /* option flags */
  52: #define VERIFY  0x1
  53: #define WHOLE   0x2
  54: #define YOUNGER 0x4
  55: #define COMPARE 0x8
  56: #define REMOVE  0x10
  57: #define FOLLOW  0x20
  58: #define IGNLNKS 0x40
  59: 
  60:     /* expand type definitions */
  61: #define E_VARS  0x1
  62: #define E_SHELL 0x2
  63: #define E_TILDE 0x4
  64: #define E_ALL   0x7
  65: 
  66:     /* actions for lookup() */
  67: #define LOOKUP  0
  68: #define INSERT  1
  69: #define REPLACE 2
  70: 
  71: #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
  72: 
  73: #define ALLOC(x) (struct x *) malloc(sizeof(struct x))
  74: 
  75: struct namelist {   /* for making lists of strings */
  76:     char    *n_name;
  77:     struct  namelist *n_next;
  78: };
  79: 
  80: struct subcmd {
  81:     short   sc_type;    /* type - INSTALL,NOTIFY,EXCEPT,SPECIAL */
  82:     short   sc_options;
  83:     char    *sc_name;
  84:     struct  namelist *sc_args;
  85:     struct  subcmd *sc_next;
  86: };
  87: 
  88: struct cmd {
  89:     int c_type;     /* type - ARROW,DCOLON */
  90:     char    *c_name;    /* hostname or time stamp file name */
  91:     char    *c_label;   /* label for partial update */
  92:     struct  namelist *c_files;
  93:     struct  subcmd *c_cmds;
  94:     struct  cmd *c_next;
  95: };
  96: 
  97: struct linkbuf {
  98:     ino_t   inum;
  99:     dev_t   devnum;
 100:     int count;
 101:     char    *pathname;
 102:     char    *target;
 103:     struct  linkbuf *nextp;
 104: };
 105: 
 106: extern int debug;       /* debugging flag */
 107: extern int nflag;       /* NOP flag, don't execute commands */
 108: extern int qflag;       /* Quiet. don't print messages */
 109: extern int options;     /* global options */
 110: 
 111: extern int nerrs;       /* number of errors seen */
 112: extern int rem;         /* remote file descriptor */
 113: extern int iamremote;       /* acting as remote server */
 114: extern char tempfile[];     /* file name for logging changes */
 115: extern struct linkbuf *ihead;   /* list of files with more than one link */
 116: extern struct passwd *pw;   /* pointer to static area used by getpwent */
 117: extern struct group *gr;    /* pointer to static area used by getgrent */
 118: extern char host[];     /* host name of master copy */
 119: extern char buf[];      /* general purpose buffer */
 120: 
 121: char *makestr();
 122: struct namelist *makenl();
 123: struct subcmd *makesubcmd();
 124: struct namelist *lookup();
 125: struct namelist *expand();
 126: char *exptilde();
 127: char *malloc();

Defined struct's

cmd defined in line 88; used 14 times
linkbuf defined in line 97; used 18 times
namelist defined in line 75; used 74 times
subcmd defined in line 80; used 36 times

Defined macros

ALLOC defined in line 73; used 5 times
ARROW defined in line 31; used 5 times
COLON defined in line 32; used 4 times
DCOLON defined in line 33; used 5 times
EQUAL defined in line 27; used 3 times
EXCEPT defined in line 38; used 6 times
E_ALL defined in line 64; used 5 times
E_SHELL defined in line 62; used 2 times
E_TILDE defined in line 63; used 4 times
E_VARS defined in line 61; used 8 times
HASHSIZE defined in line 48; used 2 times
INMAX defined in line 49; used 3 times
INSERT defined in line 68; used 3 times
INSTALL defined in line 36; used 6 times
ISDIR defined in line 71; used 4 times
LOOKUP defined in line 67; used 2 times
LP defined in line 28; used 3 times
NAME defined in line 34; used 12 times
NOTIFY defined in line 37; used 6 times
OPTION defined in line 41; used 10 times
PATTERN defined in line 39; used 5 times
QUOTE defined in line 44; used 2 times
REPLACE defined in line 69; used 1 times
RP defined in line 29; used 3 times
SM defined in line 30; used 7 times
SPECIAL defined in line 40; used 5 times
STRING defined in line 35; used 4 times
TRIM defined in line 45; used 9 times
VERSION defined in line 24; used 3 times
WHOLE defined in line 53; used 5 times

Usage of this include

Last modified: 1996-03-23
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4068
Valid CSS Valid XHTML 1.0 Strict