fs.h (818B)
1 /* See LICENSE file for copyright and license details. */ 2 #include <sys/stat.h> 3 #include <sys/types.h> 4 5 struct history { 6 struct history *prev; 7 dev_t dev; 8 ino_t ino; 9 }; 10 11 struct recursor { 12 void (*fn)(const char *, struct stat *st, void *, struct recursor *); 13 struct history *hist; 14 int depth; 15 int maxdepth; 16 int follow; 17 int flags; 18 }; 19 20 enum { 21 SAMEDEV = 1 << 0, 22 DIRFIRST = 1 << 1, 23 SILENT = 1 << 2, 24 }; 25 26 extern int cp_aflag; 27 extern int cp_fflag; 28 extern int cp_pflag; 29 extern int cp_rflag; 30 extern int cp_vflag; 31 extern int cp_follow; 32 extern int cp_status; 33 34 extern int rm_fflag; 35 extern int rm_rflag; 36 extern int rm_status; 37 38 extern int recurse_status; 39 40 void recurse(const char *, void *, struct recursor *); 41 42 int cp(const char *, const char *, int); 43 void rm(const char *, struct stat *st, void *, struct recursor *);