|
|
1.1 ! root 1: /* defs.h - general definitions for idist stuff */ ! 2: ! 3: /* ! 4: * $Header: /f/osi/others/idist/RCS/defs.h,v 7.0 89/11/23 21:58:23 mrose Rel $ ! 5: * ! 6: * General definitions used in the server & client parts of the idist ! 7: * updating tools. This file not changed much from the original UCB rdist one. ! 8: * ! 9: * Julian Onions <[email protected]> ! 10: * Nottingham University Computer Science. ! 11: * ! 12: * ! 13: * $Log: defs.h,v $ ! 14: * Revision 7.0 89/11/23 21:58:23 mrose ! 15: * Release 6.0 ! 16: * ! 17: */ ! 18: ! 19: /* ! 20: * NOTICE ! 21: * ! 22: * Acquisition, use, and distribution of this module and related ! 23: * materials are subject to the restrictions of a license agreement. ! 24: * Consult the Preface in the User's Manual for the full terms of ! 25: * this agreement. ! 26: * ! 27: */ ! 28: ! 29: ! 30: /* ! 31: * Copyright (c) 1983 Regents of the University of California. ! 32: * All rights reserved. The Berkeley software License Agreement ! 33: * specifies the terms and conditions for redistribution. ! 34: * ! 35: * @(#)defs.h 5.2 (Berkeley) 3/20/86 ! 36: */ ! 37: ! 38: #include <stdio.h> ! 39: #include <ctype.h> ! 40: #include <errno.h> ! 41: #include <pwd.h> ! 42: #include <grp.h> ! 43: #include <sys/param.h> ! 44: #include <sys/dir.h> ! 45: #include <sys/stat.h> ! 46: #include <sys/time.h> ! 47: #include <netinet/in.h> ! 48: #include "manifest.h" ! 49: #include "tailor.h" ! 50: #include "general.h" ! 51: ! 52: /* ! 53: * The version number should be changed whenever the protocol changes. ! 54: */ ! 55: #define VERSION 1 ! 56: ! 57: #define MAILCMD "/usr/lib/sendmail -oi -t" ! 58: ! 59: /* defines for yacc */ ! 60: #define EQUAL 1 ! 61: #define LP 2 ! 62: #define RP 3 ! 63: #define SM 4 ! 64: #define ARROW 5 ! 65: #define COLON 6 ! 66: #define DCOLON 7 ! 67: #define NAME 8 ! 68: #define STRING 9 ! 69: #define INSTALL 10 ! 70: #define NOTIFY 11 ! 71: #define EXCEPT 12 ! 72: #define PATTERN 13 ! 73: #define SPECIAL 14 ! 74: #define OPTION 15 ! 75: ! 76: /* lexical definitions */ ! 77: #define QUOTE 0200 /* used internally for quoted characters */ ! 78: #define TRIM 0177 /* Mask to strip quote bit */ ! 79: ! 80: /* table sizes */ ! 81: #define HASHSIZE 1021 ! 82: #define INMAX 3500 ! 83: ! 84: /* option flags */ ! 85: #define VERIFY 0x1 ! 86: #define WHOLE 0x2 ! 87: #define YOUNGER 0x4 ! 88: #define COMPARE 0x8 ! 89: #define REMOVE 0x10 ! 90: #define FOLLOW 0x20 ! 91: #define IGNLNKS 0x40 ! 92: #ifdef UW ! 93: #define NOINSTALL 0x80 ! 94: #endif UW ! 95: #define QUERYM 0x100 ! 96: ! 97: /* expand type definitions */ ! 98: #define E_VARS 0x1 ! 99: #define E_SHELL 0x2 ! 100: #define E_TILDE 0x4 ! 101: #define E_ALL 0x7 ! 102: ! 103: /* actions for lookup() */ ! 104: #define LOOKUP 0 ! 105: #define INSERT 1 ! 106: #define REPLACE 2 ! 107: ! 108: #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR) ! 109: ! 110: #define ALLOC(x) (struct x *) malloc(sizeof(struct x)) ! 111: ! 112: #ifndef OK ! 113: #define OK 0 ! 114: #define NOTOK (-1) ! 115: #endif ! 116: ! 117: struct namelist { /* for making lists of strings */ ! 118: char *n_name; ! 119: struct namelist *n_next; ! 120: }; ! 121: ! 122: struct subcmd { ! 123: short sc_type; /* type - INSTALL,NOTIFY,EXCEPT,SPECIAL */ ! 124: short sc_options; ! 125: char *sc_name; ! 126: struct namelist *sc_args; ! 127: struct subcmd *sc_next; ! 128: }; ! 129: ! 130: struct cmd { ! 131: int c_type; /* type - ARROW,DCOLON */ ! 132: char *c_name; /* hostname or time stamp file name */ ! 133: char *c_label; /* label for partial update */ ! 134: struct namelist *c_files; ! 135: struct subcmd *c_cmds; ! 136: struct cmd *c_next; ! 137: }; ! 138: ! 139: struct linkbuf { ! 140: ino_t inum; ! 141: dev_t devnum; ! 142: int count; ! 143: char *pathname; ! 144: char *target; ! 145: struct linkbuf *nextp; ! 146: }; ! 147: ! 148: extern int debug; /* debugging flag */ ! 149: extern int nflag; /* NOP flag, don't execute commands */ ! 150: extern int qflag; /* Quiet. don't print messages */ ! 151: extern int options; /* global options */ ! 152: ! 153: extern int nerrs; /* number of errors seen */ ! 154: extern int iamremote; /* acting as remote server */ ! 155: extern char utmpfile[]; /* file name for logging changes */ ! 156: extern struct linkbuf *ihead; /* list of files with more than one link */ ! 157: extern struct passwd *pw; /* pointer to static area used by getpwent */ ! 158: extern struct group *gr; /* pointer to static area used by getgrent */ ! 159: extern char *host; /* host name of master copy */ ! 160: extern char homedir[]; /* home directory of current user */ ! 161: extern char user[]; /* the users name */ ! 162: extern int errno; /* system error number */ ! 163: extern char *sys_errlist[]; ! 164: extern char *myname; ! 165: ! 166: char *makestr(); ! 167: struct namelist *makenl(); ! 168: struct subcmd *makesubcmd(); ! 169: struct namelist *lookup(); ! 170: struct namelist *expand(); ! 171: char *exptilde(); ! 172: char *malloc(); ! 173: ! 174: void adios (), advise ();
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.