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

Defined variables

asize defined in line 55; used 4 times
blockswritten defined in line 59; used 4 times
clrmap defined in line 32; used 4 times
dadded defined in line 51; used 4 times
density defined in line 52; used 3 times
dirmap defined in line 33; used 6 times
disk defined in line 40; used 15 times
etapes defined in line 56; used 4 times
fi defined in line 45; used 4 times
idates_in defined in line 115; used 2 times
idatev defined in line 116; used 6 times
incno defined in line 43; used 9 times
increm defined in line 42; used 5 times
ino defined in line 47; used 15 times
ithead defined in line 113; used 4 times
nadded defined in line 50; used 3 times
newtape defined in line 49; used 3 times
nidates defined in line 114; used 8 times
nodmap defined in line 34; used 10 times
notify defined in line 58; used 4 times
nsubdir defined in line 48; used 3 times
processname defined in line 62; used 1 times
tape defined in line 41; used 5 times
tapeno defined in line 60; used 10 times
to defined in line 46; used 7 times
tsize defined in line 53; used 7 times
tstart_writing defined in line 61; used 2 times
uflag defined in line 44; used 3 times

Defined struct's

itime defined in line 109; used 12 times
v7direct defined in line 4; used 2 times

Defined macros

BIC defined in line 29; used 2 times
BIS defined in line 28; used 4 times
BIT defined in line 30; used 4 times
DAY defined in line 82; used 2 times
DIALUP defined in line 103; used 2 times
DIRPB defined in line 10; used 2 times
DISK defined in line 101; used 1 times
HOUR defined in line 81; used 1 times
  • in line 82
ITITERATE defined in line 117; used 4 times
MBIT defined in line 27; used 3 times
MWORD defined in line 26; used 3 times
NI defined in line 9; used 3 times
NINCREM defined in line 97; used 4 times
OINCREM defined in line 96; used 1 times
OPGRENT defined in line 102; used 2 times
TAPE defined in line 100; used 1 times
X_FINOK defined in line 88; used 2 times
X_REWRITE defined in line 89; used 2 times
YEAR defined in line 83; never used

Usage of this include

Last modified: 1990-06-08
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4135
Valid CSS Valid XHTML 1.0 Strict