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.1 (Berkeley) 6/5/85
   7:  */
   8: 
   9: #define NI  16
  10: #define DIRPB   (BSIZE/sizeof(struct direct))
  11: 
  12: #include <stdio.h>
  13: #include <ctype.h>
  14: #include <fstab.h>
  15: #include <signal.h>
  16: #include <utmp.h>
  17: #include "include.4.1/sys/param.h"
  18: #include "include.4.1/sys/stat.h"
  19: #include "include.4.1/sys/filsys.h"
  20: #include "include.4.1/sys/ino.h"
  21: #include "include.4.1/sys/inode.h"
  22: #include "include.4.1/sys/fblk.h"
  23: #include "include.4.1/sys/dir.h"
  24: #include "include.4.1/time.h"
  25: #include "include.4.1/dumprestor.h"
  26: 
  27: #define MWORD(m,i)  (m[(unsigned)(i-1)/MLEN])
  28: #define MBIT(i)     (1<<((unsigned)(i-1)%MLEN))
  29: #define BIS(i,w)    (MWORD(w,i) |=  MBIT(i))
  30: #define BIC(i,w)    (MWORD(w,i) &= ~MBIT(i))
  31: #define BIT(i,w)    (MWORD(w,i) & MBIT(i))
  32: 
  33: short   clrmap[MSIZ];
  34: short   dirmap[MSIZ];
  35: short   nodmap[MSIZ];
  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    pipeout;    /* true => output to standard output */
  44: char    *increm;    /* name of the file containing incremental information*/
  45: char    incno;      /* increment number */
  46: int uflag;      /* update flag */
  47: int fi;     /* disk file descriptor */
  48: int to;     /* tape file descriptor */
  49: ino_t   ino;        /* current inumber; used globally */
  50: int nsubdir;
  51: int newtape;    /* new tape flag */
  52: int nadded;     /* number of added sub directories */
  53: int dadded;     /* directory added flag */
  54: int density;    /* density in 0.1" units */
  55: long    tsize;      /* tape size in 0.1" units */
  56: long    esize;      /* estimated tape size, blocks */
  57: long    asize;      /* number of 0.1" units written on current tape */
  58: int etapes;     /* estimated number of tapes */
  59: 
  60: int notify;     /* notify operator flag */
  61: int blockswritten;  /* number of blocks written on current tape */
  62: int tapeno;     /* current tape number */
  63: time_t  tstart_writing; /* when started writing the first tape block */
  64: char    *processname;
  65: 
  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/rrp1g"        /* default disk */
 102: #define OPGRENT "operator"      /* group entry to notify */
 103: #define DIALUP  "ttyd"          /* prefix for dialups */
 104: 
 105: struct  fstab   *fstabsearch(); /* search in fs_file and fs_spec */
 106: 
 107: /*
 108:  *	The contents of the file NINCREM is maintained both on
 109:  *	a linked list, and then (eventually) arrayified.
 110:  */
 111: struct  itime{
 112:     struct  idates  it_value;
 113:     struct  itime   *it_next;
 114: };
 115: struct  itime   *ithead;    /* head of the list version */
 116: int nidates;        /* number of records (might be zero) */
 117: int idates_in;      /* we have read the increment file */
 118: struct  idates  **idatev;   /* the arrayfied version */
 119: #define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
 120: 
 121: /*
 122:  *	We catch these interrupts
 123:  */
 124: int sighup();
 125: int sigquit();
 126: int sigill();
 127: int sigtrap();
 128: int sigfpe();
 129: int sigkill();
 130: int sigbus();
 131: int sigsegv();
 132: int sigsys();
 133: int sigalrm();
 134: int sigterm();

Defined variables

asize defined in line 57; used 5 times
dadded defined in line 53; used 4 times
density defined in line 54; used 3 times
etapes defined in line 58; used 4 times
fi defined in line 47; used 4 times
idates_in defined in line 117; used 2 times
idatev defined in line 118; used 6 times
incno defined in line 45; used 9 times
increm defined in line 44; used 5 times
ino defined in line 49; used 15 times
ithead defined in line 115; used 4 times
nidates defined in line 116; used 8 times
nodmap defined in line 35; used 10 times
notify defined in line 60; used 4 times
nsubdir defined in line 50; used 3 times
pipeout defined in line 43; used 7 times
processname defined in line 64; used 1 times
tape defined in line 42; used 7 times
tapeno defined in line 62; used 10 times
to defined in line 48; used 7 times
uflag defined in line 46; used 3 times

Defined struct's

itime defined in line 111; used 12 times

Defined macros

BIC defined in line 30; used 2 times
BIS defined in line 29; used 4 times
BIT defined in line 31; 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
MBIT defined in line 28; used 3 times
MWORD defined in line 27; 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
YEAR defined in line 83; never used

Usage of this include

Last modified: 1985-06-05
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1809
Valid CSS Valid XHTML 1.0 Strict