1 // 2 // dir.h 3 // 4 // Oliver Fromme <olli@fromme.com> 5 // @(#)$Id: dir.h,v 1.1 1998/12/04 09:04:38 olli Exp $ 6 // 7 8 #ifndef HAVE_DIR_H 9 #define HAVE_DIR_H 10 11 static const char cvsid_dir_h[] 12 = "@(#)$Id: dir.h,v 1.1 1998/12/04 09:04:38 olli Exp $"; 13 14 #include <sys/types.h> 15 #include <sys/stat.h> 16 17 #ifndef ACCESSPERMS 18 #define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ 19 #endif 20 21 #ifndef ALLPERMS 22 #define ALLPERMS (S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO) 23 #endif 24 25 // 26 // Struct for storing remote file information. 27 // 28 // Supported file modes (also see mknod(2) and stat(2)): 29 // S_IFREG regular file 30 // S_IFDIR directory 31 // S_IFLNK symbolic link 32 // Special devices and fifos are not supported (they are ignored). 33 // Hardlinks are not supported (they are treated as separate files). 34 // 35 // The mode variable also contains access permissions, provided that 36 // we have been able to parse them (otherwise the OFLAG_BADPERM flag 37 // is set, see below). 38 // 39 40 #define OFLAG_LEXISTS 0x0001 // file exists locally (for statistics) 41 #define OFLAG_EXCLUDE 0x0002 // exclude directory if empty 42 #define OFLAG_BADPERM 0x0004 // permissions are invalid, so don't use them 43 44 typedef struct { 45 off_t size; // files/links: size, dirs: number of entries 46 char *name; // file name 47 void *data; // files: NULL, links: *char, dirs: omifile[] 48 mode_t mode; // see above 49 time_t mtime; // last modification time (UTC) 50 time_t tprec; // precision of mtime (max. deviation) in seconds 51 short flags; // see above 52 } omifile; 53 54 int parse_lslr (char *cptr, omifile *omidir, char *root); 55 void free_tree (omifile *omidir); 56 void debug_tree (char *rootname, omifile *omiroot); 57 58 #endif // HAVE_DIR_H 59 60 //-- 61