read entire distfile and sort entries by host.
[unix-history] / usr / src / usr.bin / rdist / defs.h
index 0d03930..ab6c9c4 100644 (file)
@@ -1,4 +1,4 @@
-/*     defs.h  4.9     83/11/29        */
+/*     defs.h  4.10    84/02/09        */
 
 #include <stdio.h>
 #include <ctype.h>
 
 #include <stdio.h>
 #include <ctype.h>
@@ -13,7 +13,7 @@
 #include <netinet/in.h>
 
 /*
 #include <netinet/in.h>
 
 /*
- * The version number should be changed whenever the protocols change.
+ * The version number should be changed whenever the protocol changes.
  */
 #define VERSION         2
 
  */
 #define VERSION         2
 
@@ -33,7 +33,6 @@
 #define EXCEPT 11
 #define SPECIAL        12
 #define OPTION 13
 #define EXCEPT 11
 #define SPECIAL        12
 #define OPTION 13
-#define VAR    14
 
        /* lexical definitions */
 #define        QUOTE   0200            /* used internally for quoted characters */
 
        /* lexical definitions */
 #define        QUOTE   0200            /* used internally for quoted characters */
@@ -44,7 +43,6 @@
 #define INMAX  3500
 #define NCARGS 10240
 #define GAVSIZ NCARGS / 6
 #define INMAX  3500
 #define NCARGS 10240
 #define GAVSIZ NCARGS / 6
-#define NSTAMPS        15
 
        /* option flags */
 #define VERIFY 0x1
 
        /* option flags */
 #define VERIFY 0x1
 #define E_TILDE        0x4
 #define E_ALL  0x7
 
 #define E_TILDE        0x4
 #define E_ALL  0x7
 
+       /* actions for lookup() */
+#define LOOKUP 0
+#define INSERT 1
+#define REPLACE        2
+
 #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
 
 #define ALLOC(x) (struct x *) malloc(sizeof(struct x))
 
 #define ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
 
 #define ALLOC(x) (struct x *) malloc(sizeof(struct x))
 
-struct block {
-       short   b_type;
-       short   b_options;
-       char    *b_name;
-       struct  block *b_next;
-       struct  block *b_args;
+struct namelist {      /* for making lists of strings */
+       char    *n_name;
+       struct  namelist *n_next;
+};
+
+struct subcmd {
+       short   sc_type;        /* type - INSTALL,NOTIFY,EXCEPT,SPECIAL */
+       short   sc_options;
+       char    *sc_name;
+       struct  namelist *sc_args;
+       struct  subcmd *sc_next;
 };
 
 };
 
+struct cmd {
+       int     c_type;         /* type - ARROW,DCOLON */
+       char    *c_name;        /* hostname or time stamp file name */
+       struct  namelist *c_files;
+       struct  subcmd *c_cmds;
+       struct  cmd *c_next;
+};
+       
 extern int debug;              /* debugging flag */
 extern int nflag;              /* NOP flag, don't execute commands */
 extern int qflag;              /* Quiet. don't print messages */
 extern int options;            /* global options */
 
 extern int debug;              /* debugging flag */
 extern int nflag;              /* NOP flag, don't execute commands */
 extern int qflag;              /* Quiet. don't print messages */
 extern int options;            /* global options */
 
-extern int errs;               /* number of errors seen */
+extern int nerrs;              /* number of errors seen */
 extern int rem;                        /* remote file descriptor */
 extern int iamremote;          /* acting as remote server */
 extern int filec;              /* number of files to update */
 extern int rem;                        /* remote file descriptor */
 extern int iamremote;          /* acting as remote server */
 extern int filec;              /* number of files to update */
@@ -86,14 +102,16 @@ extern struct passwd *pw;  /* pointer to static area used by getpwent */
 extern struct group *gr;       /* pointer to static area used by getgrent */
 extern char host[];            /* host name of master copy */
 extern char *rhost;            /* host name of remote being updated */
 extern struct group *gr;       /* pointer to static area used by getgrent */
 extern char host[];            /* host name of master copy */
 extern char *rhost;            /* host name of remote being updated */
-extern struct block *except;   /* list of files to exclude */
+extern struct namelist *except;        /* list of files to exclude */
 extern char buf[];             /* general purpose buffer */
 extern int errno;              /* system error number */
 extern char *sys_errlist[];
 
 extern char buf[];             /* general purpose buffer */
 extern int errno;              /* system error number */
 extern char *sys_errlist[];
 
-struct block *lookup();
-struct block *makeblock();
-struct block *expand();
+char *makestr();
+struct namelist *makenl();
+struct subcmd *makesubcmd();
+struct namelist *lookup();
+struct namelist *expand();
 char *exptilde();
 char *malloc();
 char *rindex();
 char *exptilde();
 char *malloc();
 char *rindex();