add correct copyright notice...
[unix-history] / usr / src / old / dump.4.1 / dump.h
CommitLineData
76797561
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 *
6 * @(#)dump.h 5.1 (Berkeley) %G%
7 */
ebd1f727 8
10d665ef
BJ
9#define NI 16
10#define DIRPB (BSIZE/sizeof(struct direct))
11
12#include <stdio.h>
13#include <ctype.h>
b33b7ff3
SL
14#include <fstab.h>
15#include <signal.h>
16#include <utmp.h>
778e0301
KM
17#include "include.4.1/sys/param.h"
18#include "include.4.1/sys/stat.h"
19#include "include.4.1/sys/filsys.h"
20#include "include.4.1/sys/ino.h"
21#include "include.4.1/sys/inode.h"
22#include "include.4.1/sys/fblk.h"
23#include "include.4.1/sys/dir.h"
778e0301 24#include "include.4.1/time.h"
778e0301 25#include "include.4.1/dumprestor.h"
10d665ef
BJ
26
27#define MWORD(m,i) (m[(unsigned)(i-1)/MLEN])
28#define MBIT(i) (1<<((unsigned)(i-1)%MLEN))
29#define BIS(i,w) (MWORD(w,i) |= MBIT(i))
30#define BIC(i,w) (MWORD(w,i) &= ~MBIT(i))
31#define BIT(i,w) (MWORD(w,i) & MBIT(i))
32
33short clrmap[MSIZ];
34short dirmap[MSIZ];
35short nodmap[MSIZ];
36
37/*
38 * All calculations done in 0.1" units!
39 */
40
41char *disk; /* name of the disk file */
42char *tape; /* name of the tape file */
778e0301 43char pipeout; /* true => output to standard output */
10d665ef
BJ
44char *increm; /* name of the file containing incremental information*/
45char incno; /* increment number */
46int uflag; /* update flag */
47int fi; /* disk file descriptor */
48int to; /* tape file descriptor */
49ino_t ino; /* current inumber; used globally */
50int nsubdir;
51int newtape; /* new tape flag */
52int nadded; /* number of added sub directories */
53int dadded; /* directory added flag */
54int density; /* density in 0.1" units */
55long tsize; /* tape size in 0.1" units */
56long esize; /* estimated tape size, blocks */
57long asize; /* number of 0.1" units written on current tape */
58int etapes; /* estimated number of tapes */
59
60int notify; /* notify operator flag */
61int blockswritten; /* number of blocks written on current tape */
62int tapeno; /* current tape number */
63time_t tstart_writing; /* when started writing the first tape block */
64char *processname;
65
66char *ctime();
67char *prdate();
68long atol();
69int mark();
70int add();
71int dump();
72int tapsrec();
73int dmpspc();
74int dsrch();
75int nullf();
76char *getsuffix();
77char *rawname();
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
92#ifdef DEBUG
93#define OINCREM "./ddate" /*old format incremental info*/
94#define NINCREM "./dumpdates" /*new format incremental info*/
95#else not DEBUG
96#define OINCREM "/etc/ddate" /*old format incremental info*/
97#define NINCREM "/etc/dumpdates" /*new format incremental info*/
98#endif
99
100#define TAPE "/dev/rmt8" /* default tape device */
101#define DISK "/dev/rrp1g" /* default disk */
102#define OPGRENT "operator" /* group entry to notify */
103#define DIALUP "ttyd" /* prefix for dialups */
104
10d665ef 105struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
10d665ef
BJ
106
107/*
108 * The contents of the file NINCREM is maintained both on
109 * a linked list, and then (eventually) arrayified.
110 */
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();