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