date and time created 80/11/30 15:56:49 by root
[unix-history] / usr / src / old / dump.4.1 / dump.h
CommitLineData
10d665ef
BJ
1/*
2 * "@(#)dump.h 1.1 (Berkeley) %G%"
3 */
4#define NI 16
5#define DIRPB (BSIZE/sizeof(struct direct))
6
7#include <stdio.h>
8#include <ctype.h>
9#include <sys/param.h>
10#include <sys/stat.h>
11#include <sys/filsys.h>
12#include <sys/ino.h>
13#include <sys/inode.h>
14#include <sys/fblk.h>
15#include <sys/dir.h>
16#include <utmp.h>
17#include <time.h>
18#include <signal.h>
19#include <dumprestor.h>
20#include <fstab.h>
21
22#define MWORD(m,i) (m[(unsigned)(i-1)/MLEN])
23#define MBIT(i) (1<<((unsigned)(i-1)%MLEN))
24#define BIS(i,w) (MWORD(w,i) |= MBIT(i))
25#define BIC(i,w) (MWORD(w,i) &= ~MBIT(i))
26#define BIT(i,w) (MWORD(w,i) & MBIT(i))
27
28short clrmap[MSIZ];
29short dirmap[MSIZ];
30short nodmap[MSIZ];
31
32/*
33 * All calculations done in 0.1" units!
34 */
35
36char *disk; /* name of the disk file */
37char *tape; /* name of the tape file */
38char *increm; /* name of the file containing incremental information*/
39char incno; /* increment number */
40int uflag; /* update flag */
41int fi; /* disk file descriptor */
42int to; /* tape file descriptor */
43ino_t ino; /* current inumber; used globally */
44int nsubdir;
45int newtape; /* new tape flag */
46int nadded; /* number of added sub directories */
47int dadded; /* directory added flag */
48int density; /* density in 0.1" units */
49long tsize; /* tape size in 0.1" units */
50long esize; /* estimated tape size, blocks */
51long asize; /* number of 0.1" units written on current tape */
52int etapes; /* estimated number of tapes */
53
54int notify; /* notify operator flag */
55int blockswritten; /* number of blocks written on current tape */
56int tapeno; /* current tape number */
57time_t tstart_writing; /* when started writing the first tape block */
58char *processname;
59
60char *ctime();
61char *prdate();
62long atol();
63int mark();
64int add();
65int dump();
66int tapsrec();
67int dmpspc();
68int dsrch();
69int nullf();
70char *getsuffix();
71char *rawname();
72
73int 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
99#define MAXFSTAB 32
100struct fstab fstab[MAXFSTAB];
101struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
102int nfstab;
103
104/*
105 * The contents of the file NINCREM is maintained both on
106 * a linked list, and then (eventually) arrayified.
107 */
108struct itime{
109 struct idates it_value;
110 struct itime *it_next;
111};
112struct itime *ithead; /* head of the list version */
113int nidates; /* number of records (might be zero) */
114int idates_in; /* we have read the increment file */
115struct idates **idatev; /* the arrayfied version */
116#define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
117
118/*
119 * We catch these interrupts
120 */
121int sighup();
122int sigquit();
123int sigill();
124int sigtrap();
125int sigfpe();
126int sigkill();
127int sigbus();
128int sigsegv();
129int sigsys();
130int sigalrm();
131int sigterm();