BSD 4_3_Reno release
[unix-history] / usr / src / sbin / dump / dump.h
index 9f38755..7b7fa12 100644 (file)
@@ -1,32 +1,37 @@
 /*
 /*
- * "@(#)dump.h 1.3 (Berkeley) %G%"
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.  The Berkeley software License Agreement
+ * specifies the terms and conditions for redistribution.
+ *
+ *     @(#)dump.h      5.8 (Berkeley) 2/15/90
  */
  */
-#define        NI      16
-#define        DIRPB   (BSIZE/sizeof(struct direct))
 
 
-#include <stdio.h>
-#include <ctype.h>
-#include "../../h/param.h"
-#include "../../h/stat.h"
-#include "../../h/fs.h"
-#include "../../h/inode.h"
-#include "../../h/dir.h"
-#include "../../h/dumprestor.h"
+#define        NI              16
+#define MAXINOPB       (MAXBSIZE / sizeof(struct dinode))
+#define MAXNINDIR      (MAXBSIZE / sizeof(daddr_t))
+
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <ufs/fs.h>
+#include <ufs/dinode.h>
+#include <protocols/dumprestore.h>
+#include <ufs/dir.h>
 #include <utmp.h>
 #include <utmp.h>
-#include <time.h>
-#include <signal.h>
-int (*signal())();
+#include <sys/signal.h>
 #include <fstab.h>
 #include <fstab.h>
+#include <stdio.h>
+#include <ctype.h>
 
 
-#define        MWORD(m,i)      (m[(unsigned)(i-1)/MLEN])
-#define        MBIT(i)         (1<<((unsigned)(i-1)%MLEN))
+#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))
 
 #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))
 
-short  clrmap[MSIZ];
-short  dirmap[MSIZ];
-short  nodmap[MSIZ];
+int    msiz;
+char   *clrmap;
+char   *dirmap;
+char   *nodmap;
 
 /*
  *     All calculations done in 0.1" units!
 
 /*
  *     All calculations done in 0.1" units!
@@ -35,10 +40,13 @@ short       nodmap[MSIZ];
 char   *disk;          /* name of the disk file */
 char   *tape;          /* name of the tape file */
 char   *increm;        /* name of the file containing incremental information*/
 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 */
 int    uflag;          /* update flag */
 int    fi;             /* disk file descriptor */
 int    to;             /* tape file descriptor */
 char   incno;          /* increment number */
 int    uflag;          /* update flag */
 int    fi;             /* disk file descriptor */
 int    to;             /* tape file descriptor */
+int    pipeout;        /* true => output to standard output */
 ino_t  ino;            /* current inumber; used globally */
 int    nsubdir;
 int    newtape;        /* new tape flag */
 ino_t  ino;            /* current inumber; used globally */
 int    nsubdir;
 int    newtape;        /* new tape flag */
@@ -55,12 +63,16 @@ 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 */
+char   buf[MAXBSIZE];
+long   dev_bsize;
 
 char   *ctime();
 char   *prdate();
 long   atol();
 int    mark();
 int    add();
 
 char   *ctime();
 char   *prdate();
 long   atol();
 int    mark();
 int    add();
+int    dirdump();
 int    dump();
 int    tapsrec();
 int    dmpspc();
 int    dump();
 int    tapsrec();
 int    dmpspc();
@@ -79,32 +91,24 @@ int interrupt();            /* in case operator bangs on console */
 /*
  *     Exit status codes
  */
 /*
  *     Exit status codes
  */
-#define        X_FINOK         1       /* normal exit */
+#define        X_FINOK         0       /* normal exit */
 #define        X_REWRITE       2       /* restart writing from the check point */
 #define        X_ABORT         3       /* abort all of dump; don't attempt checkpointing*/
 
 #define        X_REWRITE       2       /* restart writing from the check point */
 #define        X_ABORT         3       /* abort all of dump; don't attempt checkpointing*/
 
-#ifdef DEBUG
-#define        OINCREM "./ddate"               /*old format incremental info*/
-#define        NINCREM "./dumpdates"           /*new format incremental info*/
-#else not DEBUG
-#define        OINCREM "/etc/ddate"            /*old format incremental info*/
-#define        NINCREM "/etc/dumpdates"        /*new format incremental info*/
-#endif
-
-#define        TAPE    "/dev/rmt8"             /* default tape device */
-#define        DISK    "/dev/rrp1g"            /* default disk */
 #define        OPGRENT "operator"              /* group entry to notify */
 #define DIALUP "ttyd"                  /* prefix for dialups */
 
 #define        OPGRENT "operator"              /* group entry to notify */
 #define DIALUP "ttyd"                  /* prefix for dialups */
 
-#define        MAXFSTAB                32
-struct fstab   fstab[MAXFSTAB];
 struct fstab   *fstabsearch(); /* search in fs_file and fs_spec */
 struct fstab   *fstabsearch(); /* search in fs_file and fs_spec */
-int    nfstab;
 
 /*
 
 /*
- *     The contents of the file NINCREM is maintained both on
+ *     The contents of the file _PATH_DUMPDATES is maintained both on
  *     a linked list, and then (eventually) arrayified.
  */
  *     a linked list, and then (eventually) arrayified.
  */
+struct idates {
+       char    id_name[MAXNAMLEN+3];
+       char    id_incno;
+       time_t  id_ddate;
+};
 struct itime{
        struct  idates  it_value;
        struct  itime   *it_next;
 struct itime{
        struct  idates  it_value;
        struct  itime   *it_next;