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