2 * File types as returned by find_files()
7 Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker
9 This program is free software; you can redistribute it and/or
10 modify it under the terms of the GNU General Public License as
11 published by the Free Software Foundation; either version 2 of
12 the License, or (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 General Public License for more details.
19 You should have received a copy of the GNU General Public
20 License along with this program; if not, write to the Free
21 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
31 #define NAMELEN(dirent) (strlen((dirent)->d_name))
36 #define MODE_RALL (S_IRUSR|S_IRGRP|S_IROTH)
38 #define DEFAULT_NAMEBUF_LEN 150 /* default filename buffer length */
43 #include "lib/fnmatch.h"
50 * NOTE!!! These go on the tape, so don't change them. If
51 * need be, add to them.
53 #define FT_LNKSAVED 1 /* hard link to file already saved */
54 #define FT_REGE 2 /* Regular file but empty */
55 #define FT_REG 3 /* Regular file */
56 #define FT_LNK 4 /* Soft Link */
57 #define FT_DIR 5 /* Directory */
58 #define FT_SPEC 6 /* Special file -- chr, blk, fifo, sock */
59 #define FT_NOACCESS 7 /* Not able to access */
60 #define FT_NOFOLLOW 8 /* Could not follow link */
61 #define FT_NOSTAT 9 /* Could not stat file */
62 #define FT_NOCHG 10 /* Incremental option, file not changed */
63 #define FT_DIRNOCHG 11 /* Incremental option, directory not changed */
64 #define FT_ISARCH 12 /* Trying to save archive file */
65 #define FT_NORECURSE 13 /* No recursion into directory */
66 #define FT_NOFSCHG 14 /* Different file system, prohibited */
67 #define FT_NOOPEN 15 /* Could not open directory */
69 /* Options saved in "flag" of ff packet */
70 #define FO_MD5 0x01 /* Do MD5 checksum */
71 #define FO_GZIP 0x02 /* Do Zlib compression */
72 #define FO_NO_RECURSION 0x04 /* no recursion in directories */
73 #define FO_MULTIFS 0x08 /* multiple file systems */
74 #define FO_SPARSE 0x10 /* do sparse file checking */
75 #define FO_IF_NEWER 0x20 /* replace if newer */
76 #define FO_NOREPLACE 0x40 /* never replace */
78 /* Options saved in "options" of include list */
79 /* ****FIXME**** replace OPT_ flags with FO_ */
80 #define OPT_compute_MD5 0x01 /* compute MD5 of file's data */
81 #define OPT_GZIP_compression 0x02 /* use GZIP compression */
82 #define OPT_no_recursion 0x04 /* no recursion in directories */
83 #define OPT_multifs 0x08 /* multiple file systems */
84 #define OPT_sparse 0x10 /* do sparse file checking */
85 #define OPT_replace_if_newer 0x20 /* replace file if newer */
86 #define OPT_never_replace 0x40 /* never replace */
89 struct s_included_file {
90 struct s_included_file *next;
91 int options; /* backup options */
92 int level; /* compression level */
93 int len; /* length of fname */
94 int pattern; /* set if pattern */
95 char VerifyOpts[20]; /* Options for verify */
99 struct s_excluded_file {
100 struct s_excluded_file *next;
107 * Definition of the find_files packet passed as the
108 * first argument to the find_files callback subroutine.
111 char *fname; /* filename */
112 char *link; /* link if file linked */
113 POOLMEM *sys_fname; /* system filename */
114 struct stat statp; /* stat packet */
115 int type; /* FT_ type from above */
116 int fid; /* file id if opened */
117 int flags; /* control flags */
118 int ff_errno; /* errno */
119 int incremental; /* do incremental save */
120 time_t save_time; /* start of incremental time */
121 int no_recursion; /* do not recurse into sub directories */
122 int mtime_only; /* incremental on mtime_only */
123 int dereference; /* follow links */
124 int compute_MD5; /* compute MD5 checksum */
125 int GZIP_compression; /* compress the file */
126 int GZIP_level; /* compression level */
127 int one_file_system; /* do not traverse file systems */
128 int atime_preserve; /* preserve access times */
129 int null_output_device; /* using null output device */
131 struct s_included_file *included_files_list;
132 struct s_excluded_file *excluded_files_list;
133 struct s_excluded_file *excluded_paths_list;
135 struct f_link *linklist; /* hard linked files */
140 #endif /* __FILES_H */