use system defaults
[unix-history] / usr / src / sbin / dump / dump.h
CommitLineData
10d665ef 1/*
a98111df 2 * "@(#)dump.h 1.10 (Berkeley) %G%"
10d665ef 3 */
b6407c9d 4#define NI 16
b6407c9d
KM
5#define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
6#define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
10d665ef
BJ
7
8#include <stdio.h>
9#include <ctype.h>
1d9b1ad2
SL
10#include <sys/param.h>
11#include <sys/stat.h>
12#include <sys/fs.h>
13#include <sys/inode.h>
14#include <dumprestor.h>
38f6cf09 15#include <dir.h>
10d665ef
BJ
16#include <utmp.h>
17#include <time.h>
18#include <signal.h>
10d665ef
BJ
19#include <fstab.h>
20
b6407c9d
KM
21#define MWORD(m,i) (m[(unsigned)(i-1)/NBBY])
22#define MBIT(i) (1<<((unsigned)(i-1)%NBBY))
10d665ef
BJ
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
b6407c9d
KM
27int msiz;
28char *clrmap;
29char *dirmap;
30char *nodmap;
10d665ef
BJ
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*/
a98111df
SL
39char *temp; /* name of the file for doing rewrite of increm */
40char lastincno; /* increment number of previous dump */
10d665ef
BJ
41char incno; /* increment number */
42int uflag; /* update flag */
43int fi; /* disk file descriptor */
44int to; /* tape file descriptor */
a47b7e40 45int pipeout; /* true => output to standard output */
10d665ef
BJ
46ino_t ino; /* current inumber; used globally */
47int nsubdir;
48int newtape; /* new tape flag */
49int nadded; /* number of added sub directories */
50int dadded; /* directory added flag */
51int density; /* density in 0.1" units */
52long tsize; /* tape size in 0.1" units */
53long esize; /* estimated tape size, blocks */
54long asize; /* number of 0.1" units written on current tape */
55int etapes; /* estimated number of tapes */
56
57int notify; /* notify operator flag */
58int blockswritten; /* number of blocks written on current tape */
59int tapeno; /* current tape number */
60time_t tstart_writing; /* when started writing the first tape block */
61char *processname;
b6407c9d
KM
62struct fs *sblock; /* the file system super block */
63char buf[MAXBSIZE];
10d665ef
BJ
64
65char *ctime();
66char *prdate();
67long atol();
68int mark();
69int add();
70int dump();
71int tapsrec();
72int dmpspc();
73int dsrch();
74int nullf();
75char *getsuffix();
76char *rawname();
003a2a9e 77struct dinode *getino();
10d665ef
BJ
78
79int 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
10d665ef 92#define NINCREM "/etc/dumpdates" /*new format incremental info*/
a98111df 93#define TEMP "/etc/dtmp" /*output temp file*/
10d665ef
BJ
94
95#define TAPE "/dev/rmt8" /* default tape device */
96#define DISK "/dev/rrp1g" /* default disk */
97#define OPGRENT "operator" /* group entry to notify */
98#define DIALUP "ttyd" /* prefix for dialups */
99
10d665ef 100struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
10d665ef
BJ
101
102/*
103 * The contents of the file NINCREM is maintained both on
104 * a linked list, and then (eventually) arrayified.
105 */
38f6cf09
KM
106struct idates {
107 char id_name[MAXNAMLEN+3];
108 char id_incno;
109 time_t id_ddate;
110};
10d665ef
BJ
111struct itime{
112 struct idates it_value;
113 struct itime *it_next;
114};
115struct itime *ithead; /* head of the list version */
116int nidates; /* number of records (might be zero) */
117int idates_in; /* we have read the increment file */
118struct 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 */
124int sighup();
125int sigquit();
126int sigill();
127int sigtrap();
128int sigfpe();
129int sigkill();
130int sigbus();
131int sigsegv();
132int sigsys();
133int sigalrm();
134int sigterm();