1: /*
   2:  * Copyright (c) 1980 Regents of the University of California.
   3:  * All rights reserved.  The Berkeley software License Agreement
   4:  * specifies the terms and conditions for redistribution.
   5:  *
   6:  *	@(#)dump.h	5.3 (Berkeley) 5/23/86
   7:  */
   8: 
   9: #define NI      16
  10: #define MAXINOPB    (MAXBSIZE / sizeof(struct dinode))
  11: #define MAXNINDIR   (MAXBSIZE / sizeof(daddr_t))
  12: 
  13: #include <stdio.h>
  14: #include <ctype.h>
  15: #include <sys/param.h>
  16: #include <sys/stat.h>
  17: #include <sys/fs.h>
  18: #include <sys/inode.h>
  19: #include <protocols/dumprestore.h>
  20: #include <sys/dir.h>
  21: #include <utmp.h>
  22: #include <sys/time.h>
  23: #include <signal.h>
  24: #include <fstab.h>
  25: 
  26: #define MWORD(m,i)  (m[(unsigned)(i-1)/NBBY])
  27: #define MBIT(i)     (1<<((unsigned)(i-1)%NBBY))
  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: int msiz;
  33: char    *clrmap;
  34: char    *dirmap;
  35: char    *nodmap;
  36: 
  37: /*
  38:  *	All calculations done in 0.1" units!
  39:  */
  40: 
  41: char    *disk;      /* name of the disk file */
  42: char    *tape;      /* name of the tape file */
  43: char    *increm;    /* name of the file containing incremental information*/
  44: char    *temp;      /* name of the file for doing rewrite of increm */
  45: char    lastincno;  /* increment number of previous dump */
  46: char    incno;      /* increment number */
  47: int uflag;      /* update flag */
  48: int fi;     /* disk file descriptor */
  49: int to;     /* tape file descriptor */
  50: int pipeout;    /* true => output to standard output */
  51: ino_t   ino;        /* current inumber; used globally */
  52: int nsubdir;
  53: int newtape;    /* new tape flag */
  54: int nadded;     /* number of added sub directories */
  55: int dadded;     /* directory added flag */
  56: int density;    /* density in 0.1" units */
  57: long    tsize;      /* tape size in 0.1" units */
  58: long    esize;      /* estimated tape size, blocks */
  59: long    asize;      /* number of 0.1" units written on current tape */
  60: int etapes;     /* estimated number of tapes */
  61: 
  62: int notify;     /* notify operator flag */
  63: int blockswritten;  /* number of blocks written on current tape */
  64: int tapeno;     /* current tape number */
  65: time_t  tstart_writing; /* when started writing the first tape block */
  66: char    *processname;
  67: struct fs *sblock;  /* the file system super block */
  68: char    buf[MAXBSIZE];
  69: 
  70: char    *ctime();
  71: char    *prdate();
  72: long    atol();
  73: int mark();
  74: int add();
  75: int dirdump();
  76: int dump();
  77: int tapsrec();
  78: int dmpspc();
  79: int dsrch();
  80: int nullf();
  81: char    *getsuffix();
  82: char    *rawname();
  83: struct dinode *getino();
  84: 
  85: int interrupt();        /* in case operator bangs on console */
  86: 
  87: #define HOUR    (60L*60L)
  88: #define DAY (24L*HOUR)
  89: #define YEAR    (365L*DAY)
  90: 
  91: /*
  92:  *	Exit status codes
  93:  */
  94: #define X_FINOK     0   /* normal exit */
  95: #define X_REWRITE   2   /* restart writing from the check point */
  96: #define X_ABORT     3   /* abort all of dump; don't attempt checkpointing*/
  97: 
  98: #define NINCREM "/etc/dumpdates"    /*new format incremental info*/
  99: #define TEMP    "/etc/dtmp"     /*output temp file*/
 100: 
 101: #define TAPE    "/dev/rmt8"     /* default tape device */
 102: #define DISK    "/dev/rrp1g"        /* default disk */
 103: #define OPGRENT "operator"      /* group entry to notify */
 104: #define DIALUP  "ttyd"          /* prefix for dialups */
 105: 
 106: struct  fstab   *fstabsearch(); /* search in fs_file and fs_spec */
 107: 
 108: /*
 109:  *	The contents of the file NINCREM is maintained both on
 110:  *	a linked list, and then (eventually) arrayified.
 111:  */
 112: struct  idates {
 113:     char    id_name[MAXNAMLEN+3];
 114:     char    id_incno;
 115:     time_t  id_ddate;
 116: };
 117: struct  itime{
 118:     struct  idates  it_value;
 119:     struct  itime   *it_next;
 120: };
 121: struct  itime   *ithead;    /* head of the list version */
 122: int nidates;        /* number of records (might be zero) */
 123: int idates_in;      /* we have read the increment file */
 124: struct  idates  **idatev;   /* the arrayfied version */
 125: #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
 126: 
 127: /*
 128:  *	We catch these interrupts
 129:  */
 130: int sighup();
 131: int sigquit();
 132: int sigill();
 133: int sigtrap();
 134: int sigfpe();
 135: int sigkill();
 136: int sigbus();
 137: int sigsegv();
 138: int sigsys();
 139: int sigalrm();
 140: int sigterm();

Defined variables

asize defined in line 59; used 4 times
blockswritten defined in line 63; used 4 times
clrmap defined in line 33; used 4 times
dadded defined in line 55; used 4 times
density defined in line 56; used 9 times
dirmap defined in line 34; used 6 times
etapes defined in line 60; used 5 times
fi defined in line 48; used 6 times
idates_in defined in line 123; used 2 times
idatev defined in line 124; used 8 times
incno defined in line 46; used 8 times
increm defined in line 43; used 7 times
ithead defined in line 121; used 4 times
lastincno defined in line 45; used 3 times
nadded defined in line 54; used 3 times
newtape defined in line 53; used 3 times
nidates defined in line 122; used 8 times
nodmap defined in line 35; used 13 times
notify defined in line 62; used 4 times
nsubdir defined in line 52; used 3 times
pipeout defined in line 50; used 8 times
processname defined in line 66; never used
sblock defined in line 67; used 44 times
tape defined in line 42; used 16 times
tapeno defined in line 64; used 8 times
temp defined in line 44; used 1 times
to defined in line 49; used 6 times
tsize defined in line 57; used 10 times
uflag defined in line 47; used 3 times

Defined struct's

idates defined in line 112; used 30 times
itime defined in line 117; used 12 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 6 times
DAY defined in line 88; used 2 times
DIALUP defined in line 104; used 2 times
DISK defined in line 102; used 1 times
HOUR defined in line 87; used 1 times
  • in line 88
ITITERATE defined in line 125; used 4 times
MAXINOPB defined in line 10; used 1 times
MAXNINDIR defined in line 11; used 2 times
MBIT defined in line 27; used 3 times
MWORD defined in line 26; used 3 times
NI defined in line 9; never used
NINCREM defined in line 98; used 1 times
OPGRENT defined in line 103; used 2 times
TAPE defined in line 101; used 1 times
TEMP defined in line 99; used 1 times
X_ABORT defined in line 96; used 7 times
X_FINOK defined in line 94; used 3 times
X_REWRITE defined in line 95; used 2 times
YEAR defined in line 89; never used

Usage of this include

Last modified: 1986-05-23
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1599
Valid CSS Valid XHTML 1.0 Strict