fix from Bill Shannon.
[unix-history] / usr / src / old / dump.4.1 / dump.h
CommitLineData
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
27short clrmap[MSIZ];
28short dirmap[MSIZ];
29short nodmap[MSIZ];
30
31/*
32 * All calculations done in 0.1" units!
33 */
34
35char *disk; /* name of the disk file */
36char *tape; /* name of the tape file */
778e0301 37char pipeout; /* true => output to standard output */
10d665ef
BJ
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
10d665ef 99struct 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 */
105struct itime{
106 struct idates it_value;
107 struct itime *it_next;
108};
109struct itime *ithead; /* head of the list version */
110int nidates; /* number of records (might be zero) */
111int idates_in; /* we have read the increment file */
112struct 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 */
118int sighup();
119int sigquit();
120int sigill();
121int sigtrap();
122int sigfpe();
123int sigkill();
124int sigbus();
125int sigsegv();
126int sigsys();
127int sigalrm();
128int sigterm();