more neumonic names; get rid of unnecessary global names
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 1 Mar 1991 10:52:23 +0000 (02:52 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Fri, 1 Mar 1991 10:52:23 +0000 (02:52 -0800)
SCCS-vsn: sbin/dump/dump.h 5.10

usr/src/sbin/dump/dump.h

index dee73ed..9ea2a34 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)dump.h      5.9 (Berkeley) %G%
+ *     @(#)dump.h      5.10 (Berkeley) %G%
  */
 
 #define        NI              16
  */
 
 #define        NI              16
 #include <string.h>
 #include <ctype.h>
 
 #include <string.h>
 #include <ctype.h>
 
-#define        MWORD(m,i)      (m[(unsigned)(i-1)/NBBY])
-#define        MBIT(i)         (1<<((unsigned)(i-1)%NBBY))
-#define        BIS(i,w)        (MWORD(w,i) |=  MBIT(i))
-#define        BIC(i,w)        (MWORD(w,i) &= ~MBIT(i))
-#define        BIT(i,w)        (MWORD(w,i) & MBIT(i))
-
-int    msiz;
-char   *clrmap;
-char   *dirmap;
-char   *nodmap;
+/*
+ * Dump maps used to describe what is to be dumped.
+ */
+int    mapsize;        /* size of the state maps */
+char   *usedinomap;    /* map of allocated inodes */
+char   *dumpdirmap;    /* map of directories to be dumped */
+char   *dumpinomap;    /* map of files to be dumped */
+/*
+ * Map manipulation macros.
+ */
+#define        SETINO(ino, map) \
+       map[(u_int)((ino) - 1) / NBBY] |=  1 << ((u_int)((ino) - 1) % NBBY)
+#define        CLRINO(ino, map) \
+       map[(u_int)((ino) - 1) / NBBY] &=  ~(1 << ((u_int)((ino) - 1) % NBBY))
+#define        TSTINO(ino, map) \
+       (map[(u_int)((ino) - 1) / NBBY] &  (1 << ((u_int)((ino) - 1) % NBBY)))
 
 /*
  *     All calculations done in 0.1" units!
  */
 
 /*
  *     All calculations done in 0.1" units!
  */
-
 char   *disk;          /* name of the disk file */
 char   *tape;          /* name of the tape file */
 char   *disk;          /* name of the disk file */
 char   *tape;          /* name of the tape file */
-char   *increm;        /* name of the file containing incremental information*/
-char   *temp;          /* name of the file for doing rewrite of increm */
-char   lastincno;      /* increment number of previous dump */
-char   incno;          /* increment number */
+char   *dumpdates;     /* name of the file containing dump date information*/
+char   *temp;          /* name of the file for doing rewrite of dumpdates */
+char   lastlevel;      /* dump level of previous dump */
+char   level;          /* dump level of this dump */
 int    uflag;          /* update flag */
 int    uflag;          /* update flag */
-int    fi;             /* disk file descriptor */
-int    to;             /* tape file descriptor */
+int    diskfd;         /* disk file descriptor */
+int    tapefd;         /* tape file descriptor */
 int    pipeout;        /* true => output to standard output */
 int    pipeout;        /* true => output to standard output */
-ino_t  ino;            /* current inumber; used globally */
-int    nsubdir;
+ino_t  curino;         /* current inumber; used globally */
 int    newtape;        /* new tape flag */
 int    newtape;        /* new tape flag */
-int    nadded;         /* number of added sub directories */
-int    dadded;         /* directory added flag */
 int    density;        /* density in 0.1" units */
 int    density;        /* density in 0.1" units */
+long   tapesize;       /* estimated tape size, blocks */
 long   tsize;          /* tape size in 0.1" units */
 long   tsize;          /* tape size in 0.1" units */
-long   esize;          /* estimated tape size, blocks */
 long   asize;          /* number of 0.1" units written on current tape */
 int    etapes;         /* estimated number of tapes */
 
 long   asize;          /* number of 0.1" units written on current tape */
 int    etapes;         /* estimated number of tapes */
 
@@ -66,7 +68,7 @@ int   blockswritten;  /* number of blocks written on current tape */
 int    tapeno;         /* current tape number */
 time_t tstart_writing; /* when started writing the first tape block */
 char   *processname;
 int    tapeno;         /* current tape number */
 time_t tstart_writing; /* when started writing the first tape block */
 char   *processname;
-struct fs *sblock;     /* the file system super block */
+struct fs *sblock;     /* the file system super block */
 char   buf[MAXBSIZE];
 long   dev_bsize;      /* block size of underlying disk device */
 int    dev_bshift;     /* log2(dev_bsize) */
 char   buf[MAXBSIZE];
 long   dev_bsize;      /* block size of underlying disk device */
 int    dev_bshift;     /* log2(dev_bsize) */
@@ -82,35 +84,31 @@ void        set_operators();
 void   timeest();
 
 /* mapping rouintes */
 void   timeest();
 
 /* mapping rouintes */
-void   est();
-void   bmapest();
-void   pass();
-void   mark();
-void   add();
+long   blockest();
+int    mapfiles();
+int    mapdirs();
 
 /* file dumping routines */
 void   dirdump();
 
 /* file dumping routines */
 void   dirdump();
-void   dump();
 void   blksout();
 void   blksout();
-void   bitmap();
-void   spclrec();
+void   dumpmap();
+void   writeheader();
 void   bread();
 
 /* tape writing routines */
 int    alloctape();
 void   bread();
 
 /* tape writing routines */
 int    alloctape();
-void   taprec();
-void   dmpblk();
-void   tflush();
+void   writerec();
+void   dumpblock();
+void   flushtape();
 void   trewind();
 void   close_rewind();
 void   trewind();
 void   close_rewind();
-void   otape();
+void   startnewtape();
 
 void   dumpabort();
 void   Exit();
 void   getfstab();
 void   quit();
 
 
 void   dumpabort();
 void   Exit();
 void   getfstab();
 void   quit();
 
-char   *prdate();
 char   *rawname();
 struct dinode *getino();
 
 char   *rawname();
 struct dinode *getino();
 
@@ -136,23 +134,24 @@ struct    fstab   *fstabsearch(); /* search in fs_file and fs_spec */
  *     The contents of the file _PATH_DUMPDATES is maintained both on
  *     a linked list, and then (eventually) arrayified.
  */
  *     The contents of the file _PATH_DUMPDATES is maintained both on
  *     a linked list, and then (eventually) arrayified.
  */
-struct idates {
-       char    id_name[MAXNAMLEN+3];
-       char    id_incno;
-       time_t  id_ddate;
+struct dumpdates {
+       char    dd_name[MAXNAMLEN+3];
+       char    dd_level;
+       time_t  dd_ddate;
 };
 };
-struct itime {
-       struct  idates  it_value;
-       struct  itime   *it_next;
+struct dumptime {
+       struct  dumpdates dt_value;
+       struct  dumptime *dt_next;
 };
 };
-struct itime   *ithead;        /* head of the list version */
-int    nidates;                /* number of records (might be zero) */
-int    idates_in;              /* we have read the increment file */
-struct idates  **idatev;       /* the arrayfied version */
-void   inititimes();
-void   getitime();
-void   putitime();
-#define        ITITERATE(i, ip) for (ip = idatev[i = 0]; i < nidates; ip = idatev[++i])
+struct dumptime *dthead;       /* head of the list version */
+int    nddates;                /* number of records (might be zero) */
+int    ddates_in;              /* we have read the increment file */
+struct dumpdates **ddatev;     /* the arrayfied version */
+void   initdumptimes();
+void   getdumptime();
+void   putdumptime();
+#define        ITITERATE(i, ddp) \
+       for (ddp = ddatev[i = 0]; i < nddates; ddp = ddatev[++i])
 
 /*
  *     We catch these interrupts
 
 /*
  *     We catch these interrupts