standardize sccs keyword lines
[unix-history] / usr / src / old / dump.4.1 / dump.h
CommitLineData
10d665ef 1/*
b33b7ff3 2 * "@(#)dump.h 1.3 (Berkeley) %G%"
10d665ef
BJ
3 */
4#define NI 16
5#define DIRPB (BSIZE/sizeof(struct direct))
6
7#include <stdio.h>
8#include <ctype.h>
b33b7ff3
SL
9#include <fstab.h>
10#include <signal.h>
11#include <utmp.h>
778e0301
KM
12#include "include.4.1/sys/param.h"
13#include "include.4.1/sys/stat.h"
14#include "include.4.1/sys/filsys.h"
15#include "include.4.1/sys/ino.h"
16#include "include.4.1/sys/inode.h"
17#include "include.4.1/sys/fblk.h"
18#include "include.4.1/sys/dir.h"
778e0301 19#include "include.4.1/time.h"
778e0301 20#include "include.4.1/dumprestor.h"
10d665ef
BJ
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 */
778e0301 38char pipeout; /* true => output to standard output */
10d665ef
BJ
39char *increm; /* name of the file containing incremental information*/
40char incno; /* increment number */
41int uflag; /* update flag */
42int fi; /* disk file descriptor */
43int to; /* tape file descriptor */
44ino_t ino; /* current inumber; used globally */
45int nsubdir;
46int newtape; /* new tape flag */
47int nadded; /* number of added sub directories */
48int dadded; /* directory added flag */
49int density; /* density in 0.1" units */
50long tsize; /* tape size in 0.1" units */
51long esize; /* estimated tape size, blocks */
52long asize; /* number of 0.1" units written on current tape */
53int etapes; /* estimated number of tapes */
54
55int notify; /* notify operator flag */
56int blockswritten; /* number of blocks written on current tape */
57int tapeno; /* current tape number */
58time_t tstart_writing; /* when started writing the first tape block */
59char *processname;
60
61char *ctime();
62char *prdate();
63long atol();
64int mark();
65int add();
66int dump();
67int tapsrec();
68int dmpspc();
69int dsrch();
70int nullf();
71char *getsuffix();
72char *rawname();
73
74int interrupt(); /* in case operator bangs on console */
75
76#define HOUR (60L*60L)
77#define DAY (24L*HOUR)
78#define YEAR (365L*DAY)
79
80/*
81 * Exit status codes
82 */
83#define X_FINOK 1 /* normal exit */
84#define X_REWRITE 2 /* restart writing from the check point */
85#define X_ABORT 3 /* abort all of dump; don't attempt checkpointing*/
86
87#ifdef DEBUG
88#define OINCREM "./ddate" /*old format incremental info*/
89#define NINCREM "./dumpdates" /*new format incremental info*/
90#else not DEBUG
91#define OINCREM "/etc/ddate" /*old format incremental info*/
92#define NINCREM "/etc/dumpdates" /*new format incremental info*/
93#endif
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 */
106struct itime{
107 struct idates it_value;
108 struct itime *it_next;
109};
110struct itime *ithead; /* head of the list version */
111int nidates; /* number of records (might be zero) */
112int idates_in; /* we have read the increment file */
113struct idates **idatev; /* the arrayfied version */
114#define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
115
116/*
117 * We catch these interrupts
118 */
119int sighup();
120int sigquit();
121int sigill();
122int sigtrap();
123int sigfpe();
124int sigkill();
125int sigbus();
126int sigsegv();
127int sigsys();
128int sigalrm();
129int sigterm();