Debian Codegraph @

restore/restore_globals.h

raw symbols SCIP
1 #pragma once
2
3 #include "config.h" // IWYU pragma: keep
4
5 #include "common/shared_globals.h" // IWYU pragma: keep
6
7 #include <limits.h>
8 #include <stdio.h>
9 #include <sys/types.h>
10 #include "compat/include/protocols/dumprestore.h"
11
12 #define XATTR_MAXSIZE 4096
13 // 60 is the combined size of the direct and indirect block pointers in the inode.
14 #define INLINE_DATA_MAX_INODE_SIZE 60
15
16 /*
17 * The entry describes the next file available on the tape
18 */
19 struct context {
20 const char *name; /* name of file */
21 dump_ino_t ino; /* inumber of file */
22 struct new_bsd_inode *dip; /* pointer to inode */
23 char action; /* action being taken on this file */
24 };
25 #define USING 1 /* extracting from the tape */
26 #define SKIP 2 /* skipping */
27 #define UNKNOWN 3 /* disposition or starting point is unknown */
28
29 /*
30 * Flags
31 */
32 extern char *Afile; /* archive file */
33 extern int aflag; /* automatic volume increment */
34 extern int bflag; /* set input block size */
35 extern int cvtflag; /* convert from old to new tape format */
36 extern int hflag; /* restore heirarchies */
37 extern int Lflag; /* compare errors limit */
38 extern int mflag; /* restore by name instead of inode number */
39 extern int Nflag; /* do not write the disk */
40 extern int oflag; /* do restore permissions without asking */
41 extern int uflag; /* unlink symlink targets */
42 extern int Vflag; /* multi-volume on a single device like CDROM */
43 extern int yflag; /* always try to recover from tape errors */
44 extern int nullflag; /* \0 separated output in t mode */
45 extern int ufs2flag; /* tape is a FreeBSD UFS2 dump */
46 extern char* bot_script; /* beginning of tape script */
47
48 /*
49 * Global variables
50 */
51 extern dump_ino_t maxino; /* highest numbered inode in this file system */
52 extern long dumpnum; /* location of the dump on this tape */
53 extern long volno; /* current volume being read */
54 extern time_t dumptime; /* time that this dump begins */
55 extern time_t dumpdate; /* time that this dump was made */
56 extern char command; /* opration being performed */
57 extern FILE *terminal; /* file descriptor for the terminal input */
58 extern const char *tmpdir; /* name of temp directory */
59 extern int oldinofmt; /* reading tape with old format inodes */
60 extern int Bcvt; /* need byte swapping on inodes and dirs */
61 extern int compare_ignore_not_found;
62 /* used to compare incremental dumps, */
63 /* so messages about "not found" files */
64 /* isn't seen. */
65 extern int compare_errors; /* did we encounter any compare errors? */
66 extern char filesys[PATH_MAX];/* name of dumped filesystem */
67 extern int wdfd; /* original working directory */
68 extern int dirhash_size; /* size of the directory hash table */
69
70 #ifdef USE_QFA
71 extern FILE *gTapeposfp;
72 extern char gTps[255];
73 extern long gSeekstart;
74 extern int tapeposflag;
75 extern int gTapeposfd;
76 extern int createtapeposflag;
77 extern unsigned long qfadumpdate;
78 extern off_t curtapepos;
79 #endif
80
81 #ifdef TRANSSELINUX /*GAN6May06 SELinux MLS */
82 extern int transselinuxflag;
83 extern char *transselinuxarg;
84 #endif
85 extern char inline_data[INLINE_DATA_MAX_INODE_SIZE + XATTR_MAXSIZE];
86 extern int pipein; /* input is from a pipe */
87 extern struct context curfile;
88
89 /*
90 * Flags to setdirmodes.
91 */
92 #define FORCE 0x0001
93 #define FORCENO 0x0002
94
95 #define do_compare_error \
96 if (++compare_errors >= Lflag && Lflag) { \
97 printf("Compare errors limit reached, exiting...\n"); \
98 exit(2); \
99 }