1: /*
   2:  * "@(#)dump.h	1.2 (2.11BSD GTE) 12/6/94"
   3:  */
   4: #define NI  4   /* number of blocks of inodes per read */
   5: 
   6: #include <stdio.h>
   7: #include <ctype.h>
   8: #include <strings.h>
   9: #include <grp.h>
  10: #include <sys/param.h>
  11: #include <sys/stat.h>
  12: #include <sys/fs.h>
  13: #include <sys/inode.h>
  14: #include <sys/dir.h>
  15: #include <sys/time.h>
  16: #include <utmp.h>
  17: #include <protocols/dumprestor.h>
  18: #include <fstab.h>
  19: 
  20: #define MWORD(m,i)  (m[(unsigned)(i-1)/MLEN])
  21: #define MBIT(i)     (1<<((unsigned)(i-1)%MLEN))
  22: #define BIS(i,w)    (MWORD(w,i) |=  MBIT(i))
  23: #define BIC(i,w)    (MWORD(w,i) &= ~MBIT(i))
  24: #define BIT(i,w)    (MWORD(w,i) & MBIT(i))
  25: 
  26: short   clrmap[MSIZ];
  27: short   dirmap[MSIZ];
  28: short   nodmap[MSIZ];
  29: 
  30: /*
  31:  *	All calculations done in 0.1" units!
  32:  */
  33: 
  34: char    *disk;      /* name of the disk file */
  35: char    *tape;      /* name of the tape file */
  36: char    *increm;    /* name of the file containing incremental information*/
  37: char    incno;      /* increment number */
  38: int uflag;      /* update flag */
  39: int fi;     /* disk file descriptor */
  40: int to;     /* tape file descriptor */
  41: int pipeout;    /* true => output to standard output */
  42: ino_t   ino;        /* current inumber; used globally */
  43: int lastlevel;
  44: int nonodump;
  45: int nsubdir;
  46: int newtape;    /* new tape flag */
  47: int nadded;     /* number of added sub directories */
  48: int dadded;     /* directory added flag */
  49: u_short density;    /* density in 0.1" units */
  50: long    tsize;      /* tape size in 0.1" units */
  51: long    esize;      /* estimated tape size, blocks */
  52: long    asize;      /* number of 0.1" units written on current tape */
  53: int etapes;     /* estimated number of tapes */
  54: 
  55: int notify;     /* notify operator flag */
  56: long    blockswritten;  /* number of blocks written on current tape */
  57: int tapeno;     /* current tape number */
  58: time_t  tstart_writing; /* when started writing the first tape block */
  59: 
  60: time_t  time();
  61: off_t   lseek();
  62: char    *ctime();
  63: char    *prdate();
  64: long    atol();
  65: int mark();
  66: int add();
  67: int dump();
  68: int tapsrec();
  69: int dmpspc();
  70: int dsrch();
  71: int nullf();
  72: char    *rawname();
  73: 
  74: int interrupt();        /* in case operator bangs on console */
  75: 
  76: #define HOUR    (60L*60L)
  77: #define DAY (24L*HOUR)
  78: #define YEAR    (365L*DAY)
  79: 
  80: /*
  81:  *	Exit status codes
  82:  */
  83: #define X_FINOK     1   /* normal exit */
  84: #define X_REWRITE   2   /* restart writing from the check point */
  85: #define X_ABORT     3   /* abort all of dump; don't attempt checkpointing*/
  86: 
  87: #ifdef DEBUG
  88: #define OINCREM "./ddate"       /*old format incremental info*/
  89: #define NINCREM "./dumpdates"       /*new format incremental info*/
  90: #else not DEBUG
  91: #define OINCREM "/etc/ddate"        /*old format incremental info*/
  92: #define NINCREM "/etc/dumpdates"    /*new format incremental info*/
  93: #endif
  94: 
  95: #define TAPE    "/dev/rmt8"     /* default tape device */
  96: #define DISK    "/dev/rxp0a"        /* default disk */
  97: #define OPGRENT "operator"      /* group entry to notify */
  98: #define DIALUP  "ttyd"          /* prefix for dialups */
  99: 
 100: /*
 101:  *	The contents of the file NINCREM is maintained both on
 102:  *	a linked list, and then (eventually) arrayified.
 103:  */
 104: struct  itime{
 105:     struct  idates  it_value;
 106:     struct  itime   *it_next;
 107: };
 108: struct  itime   *ithead;    /* head of the list version */
 109: int nidates;        /* number of records (might be zero) */
 110: int idates_in;      /* we have read the increment file */
 111: struct  idates  **idatev;   /* the arrayfied version */
 112: #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
 113: 
 114: /*
 115:  *	We catch these interrupts
 116:  */
 117: int sighup();
 118: int sigquit();
 119: int sigill();
 120: int sigtrap();
 121: int sigfpe();
 122: int sigkill();
 123: int sigbus();
 124: int sigsegv();
 125: int sigsys();
 126: int sigalrm();
 127: int sigterm();

Defined variables

asize defined in line 52; used 4 times
blockswritten defined in line 56; used 4 times
clrmap defined in line 26; used 5 times
dadded defined in line 48; used 4 times
density defined in line 49; used 9 times
dirmap defined in line 27; used 8 times
etapes defined in line 53; used 4 times
idates_in defined in line 110; used 2 times
idatev defined in line 111; used 6 times
incno defined in line 37; used 9 times
increm defined in line 36; used 5 times
ino defined in line 42; used 16 times
ithead defined in line 108; used 4 times
lastlevel defined in line 43; used 4 times
nadded defined in line 47; used 3 times
newtape defined in line 46; used 3 times
nidates defined in line 109; used 8 times
nodmap defined in line 28; used 11 times
nonodump defined in line 44; used 2 times
notify defined in line 55; used 4 times
nsubdir defined in line 45; used 3 times
pipeout defined in line 41; used 8 times
tape defined in line 35; used 18 times
tapeno defined in line 57; used 7 times
to defined in line 40; used 5 times
tsize defined in line 50; used 7 times
uflag defined in line 38; used 3 times

Defined struct's

itime defined in line 104; used 10 times

Defined macros

BIC defined in line 23; used 2 times
BIS defined in line 22; used 4 times
BIT defined in line 24; used 4 times
DAY defined in line 77; used 2 times
DIALUP defined in line 98; used 2 times
DISK defined in line 96; never used
HOUR defined in line 76; used 1 times
  • in line 77
ITITERATE defined in line 112; used 4 times
MBIT defined in line 21; used 3 times
MWORD defined in line 20; used 3 times
NI defined in line 4; used 3 times
NINCREM defined in line 92; used 2 times
OINCREM defined in line 91; never used
OPGRENT defined in line 97; used 2 times
TAPE defined in line 95; used 1 times
X_ABORT defined in line 85; used 15 times
X_FINOK defined in line 83; used 3 times
X_REWRITE defined in line 84; used 2 times
YEAR defined in line 78; never used

Usage of this include

Last modified: 1994-12-07
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 149
Valid CSS Valid XHTML 1.0 Strict