2 * File types as returned by find_files()
7 Copyright (C) 2000-2003 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,
34 #define NAMELEN(dirent) (strlen((dirent)->d_name))
47 #define MODE_RALL (S_IRUSR|S_IRGRP|S_IROTH)
52 #include "lib/fnmatch.h"
57 #ifndef HAVE_READDIR_R
58 int readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result);
63 * Status codes returned by create_file()
65 #define CF_SKIP 1 /* skip file (not newer or something) */
66 #define CF_ERROR 2 /* error creating file */
67 #define CF_EXTRACT 3 /* file created, data to extract */
68 #define CF_CREATED 4 /* file created, no data to extract */
71 /* Options saved in "flag" of ff packet */
72 #define FO_MD5 0x001 /* Do MD5 checksum */
73 #define FO_GZIP 0x002 /* Do Zlib compression */
74 #define FO_NO_RECURSION 0x004 /* no recursion in directories */
75 #define FO_MULTIFS 0x008 /* multiple file systems */
76 #define FO_SPARSE 0x010 /* do sparse file checking */
77 #define FO_IF_NEWER 0x020 /* replace if newer */
78 #define FO_NOREPLACE 0x040 /* never replace */
79 #define FO_READFIFO 0x080 /* read data from fifo */
80 #define FO_SHA1 0x100 /* Do SHA1 checksum */
83 * Options saved in "options" of include list
84 * These are now directly jammed into ff->flags, so the above
85 * FO_xxx options may be used
87 * ***FIXME*** replace all OPT_xxx with FO_xxx or vise-versa
89 #define OPT_compute_MD5 0x01 /* compute MD5 of file's data */
90 #define OPT_GZIP_compression 0x02 /* use GZIP compression */
91 #define OPT_no_recursion 0x04 /* no recursion in directories */
92 #define OPT_multifs 0x08 /* multiple file systems */
93 #define OPT_sparse 0x10 /* do sparse file checking */
94 #define OPT_replace_if_newer 0x20 /* replace file if newer */
95 #define OPT_never_replace 0x40 /* never replace */
96 #define OPT_read_fifo 0x80 /* read data from fifo (named pipe) */
97 #define OPT_compute_SHA1 0x100 /* compute SHA1 of file's data */
100 struct s_included_file {
101 struct s_included_file *next;
102 int options; /* backup options */
103 int level; /* compression level */
104 int len; /* length of fname */
105 int pattern; /* set if pattern */
106 char VerifyOpts[20]; /* Options for verify */
110 struct s_excluded_file {
111 struct s_excluded_file *next;
119 * Definition of the find_files packet passed as the
120 * first argument to the find_files callback subroutine.
122 typedef struct s_ff {
123 char *fname; /* filename */
124 char *link; /* link if file linked */
125 POOLMEM *sys_fname; /* system filename */
126 struct stat statp; /* stat packet */
127 uint32_t FileIndex; /* FileIndex of this file */
128 uint32_t LinkFI; /* FileIndex of main hard linked file */
129 struct f_link *linked; /* Set if we are hard linked */
130 int type; /* FT_ type from above */
131 int flags; /* control flags */
132 int ff_errno; /* errno */
133 int incremental; /* do incremental save */
134 BFILE bfd; /* Bacula file descriptor */
135 time_t save_time; /* start of incremental time */
136 int mtime_only; /* incremental on mtime_only */
137 int dereference; /* follow links */
138 int GZIP_level; /* compression level */
139 int atime_preserve; /* preserve access times */
140 int null_output_device; /* using null output device */
142 struct s_included_file *included_files_list;
143 struct s_excluded_file *excluded_files_list;
144 struct s_excluded_file *excluded_paths_list;
146 struct f_link *linklist; /* hard linked files */
152 #endif /* __FILES_H */