get rid of unused variables
[unix-history] / usr / src / sbin / dump / 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 *
55497429 6 * @(#)dump.h 5.8 (Berkeley) %G%
76797561 7 */
080a6cff 8
b6407c9d 9#define NI 16
b6407c9d
KM
10#define MAXINOPB (MAXBSIZE / sizeof(struct dinode))
11#define MAXNINDIR (MAXBSIZE / sizeof(daddr_t))
10d665ef 12
1d9b1ad2
SL
13#include <sys/param.h>
14#include <sys/stat.h>
02af009e 15#include <ufs/fs.h>
55497429 16#include <ufs/dinode.h>
29df8dcd 17#include <protocols/dumprestore.h>
55497429 18#include <ufs/dir.h>
10d665ef 19#include <utmp.h>
7abf8d65 20#include <sys/signal.h>
10d665ef 21#include <fstab.h>
7abf8d65
KB
22#include <stdio.h>
23#include <ctype.h>
10d665ef 24
b6407c9d
KM
25#define MWORD(m,i) (m[(unsigned)(i-1)/NBBY])
26#define MBIT(i) (1<<((unsigned)(i-1)%NBBY))
10d665ef
BJ
27#define BIS(i,w) (MWORD(w,i) |= MBIT(i))
28#define BIC(i,w) (MWORD(w,i) &= ~MBIT(i))
29#define BIT(i,w) (MWORD(w,i) & MBIT(i))
30
b6407c9d
KM
31int msiz;
32char *clrmap;
33char *dirmap;
34char *nodmap;
10d665ef
BJ
35
36/*
37 * All calculations done in 0.1" units!
38 */
39
40char *disk; /* name of the disk file */
41char *tape; /* name of the tape file */
42char *increm; /* name of the file containing incremental information*/
a98111df
SL
43char *temp; /* name of the file for doing rewrite of increm */
44char lastincno; /* increment number of previous dump */
10d665ef
BJ
45char incno; /* increment number */
46int uflag; /* update flag */
47int fi; /* disk file descriptor */
48int to; /* tape file descriptor */
a47b7e40 49int pipeout; /* true => output to standard output */
10d665ef
BJ
50ino_t ino; /* current inumber; used globally */
51int nsubdir;
52int newtape; /* new tape flag */
53int nadded; /* number of added sub directories */
54int dadded; /* directory added flag */
55int density; /* density in 0.1" units */
56long tsize; /* tape size in 0.1" units */
57long esize; /* estimated tape size, blocks */
58long asize; /* number of 0.1" units written on current tape */
59int etapes; /* estimated number of tapes */
60
61int notify; /* notify operator flag */
62int blockswritten; /* number of blocks written on current tape */
63int tapeno; /* current tape number */
64time_t tstart_writing; /* when started writing the first tape block */
65char *processname;
b6407c9d
KM
66struct fs *sblock; /* the file system super block */
67char buf[MAXBSIZE];
72e64d31 68long dev_bsize;
10d665ef
BJ
69
70char *ctime();
71char *prdate();
72long atol();
73int mark();
74int add();
7b0c1d85 75int dirdump();
10d665ef
BJ
76int dump();
77int tapsrec();
78int dmpspc();
79int dsrch();
80int nullf();
81char *getsuffix();
82char *rawname();
003a2a9e 83struct dinode *getino();
10d665ef
BJ
84
85int interrupt(); /* in case operator bangs on console */
86
87#define HOUR (60L*60L)
88#define DAY (24L*HOUR)
89#define YEAR (365L*DAY)
90
91/*
92 * Exit status codes
93 */
8e319182 94#define X_FINOK 0 /* normal exit */
10d665ef
BJ
95#define X_REWRITE 2 /* restart writing from the check point */
96#define X_ABORT 3 /* abort all of dump; don't attempt checkpointing*/
97
10d665ef
BJ
98#define OPGRENT "operator" /* group entry to notify */
99#define DIALUP "ttyd" /* prefix for dialups */
100
10d665ef 101struct fstab *fstabsearch(); /* search in fs_file and fs_spec */
10d665ef
BJ
102
103/*
2e433f8d 104 * The contents of the file _PATH_DUMPDATES is maintained both on
10d665ef
BJ
105 * a linked list, and then (eventually) arrayified.
106 */
38f6cf09
KM
107struct idates {
108 char id_name[MAXNAMLEN+3];
109 char id_incno;
110 time_t id_ddate;
111};
10d665ef
BJ
112struct itime{
113 struct idates it_value;
114 struct itime *it_next;
115};
116struct itime *ithead; /* head of the list version */
117int nidates; /* number of records (might be zero) */
118int idates_in; /* we have read the increment file */
119struct idates **idatev; /* the arrayfied version */
120#define ITITERATE(i, ip) for (i = 0,ip = idatev[0]; i < nidates; i++, ip = idatev[i])
121
122/*
123 * We catch these interrupts
124 */
125int sighup();
126int sigquit();
127int sigill();
128int sigtrap();
129int sigfpe();
130int sigkill();
131int sigbus();
132int sigsegv();
133int sigsys();
134int sigalrm();
135int sigterm();