Changeset View
Changeset View
Standalone View
Standalone View
include/fts.h
Show All 38 Lines | typedef struct { | ||||
struct _ftsent *fts_cur; /* current node */ | struct _ftsent *fts_cur; /* current node */ | ||||
struct _ftsent *fts_child; /* linked list of children */ | struct _ftsent *fts_child; /* linked list of children */ | ||||
struct _ftsent **fts_array; /* sort array */ | struct _ftsent **fts_array; /* sort array */ | ||||
__dev_t fts_dev; /* starting device # */ | __dev_t fts_dev; /* starting device # */ | ||||
char *fts_path; /* path for this descent */ | char *fts_path; /* path for this descent */ | ||||
int fts_rfd; /* fd for root */ | int fts_rfd; /* fd for root */ | ||||
__size_t fts_pathlen; /* sizeof(path) */ | __size_t fts_pathlen; /* sizeof(path) */ | ||||
__size_t fts_nitems; /* elements in the sort array */ | __size_t fts_nitems; /* elements in the sort array */ | ||||
union { | |||||
int (*fts_compar) /* compare function */ | int (*fts_compar) /* compare function */ | ||||
(const struct _ftsent * const *, const struct _ftsent * const *); | (const struct _ftsent * const *, | ||||
const struct _ftsent * const *); | |||||
void *fts_compar_b; /* compare block */ | |||||
}; | |||||
#define FTS_COMFOLLOW 0x001 /* follow command line symlinks */ | #define FTS_COMFOLLOW 0x001 /* follow command line symlinks */ | ||||
#define FTS_LOGICAL 0x002 /* logical walk */ | #define FTS_LOGICAL 0x002 /* logical walk */ | ||||
#define FTS_NOCHDIR 0x004 /* don't change directories */ | #define FTS_NOCHDIR 0x004 /* don't change directories */ | ||||
#define FTS_NOSTAT 0x008 /* don't get stat info */ | #define FTS_NOSTAT 0x008 /* don't get stat info */ | ||||
#define FTS_PHYSICAL 0x010 /* physical walk */ | #define FTS_PHYSICAL 0x010 /* physical walk */ | ||||
#define FTS_SEEDOT 0x020 /* return dot and dot-dot */ | #define FTS_SEEDOT 0x020 /* return dot and dot-dot */ | ||||
#define FTS_XDEV 0x040 /* don't cross devices */ | #define FTS_XDEV 0x040 /* don't cross devices */ | ||||
#define FTS_WHITEOUT 0x080 /* return whiteout information */ | #define FTS_WHITEOUT 0x080 /* return whiteout information */ | ||||
#define FTS_OPTIONMASK 0x0ff /* valid user option mask */ | #define FTS_OPTIONMASK 0x0ff /* valid user option mask */ | ||||
#define FTS_NAMEONLY 0x100 /* (private) child names only */ | #define FTS_NAMEONLY 0x100 /* (private) child names only */ | ||||
#define FTS_STOP 0x200 /* (private) unrecoverable error */ | #define FTS_STOP 0x200 /* (private) unrecoverable error */ | ||||
#define FTS_COMPAR_B 0x400 /* (private) use block compare */ | |||||
int fts_options; /* fts_open options, global flags */ | int fts_options; /* fts_open options, global flags */ | ||||
void *fts_clientptr; /* thunk for sort function */ | void *fts_clientptr; /* thunk for sort function */ | ||||
} FTS; | } FTS; | ||||
typedef struct _ftsent { | typedef struct _ftsent { | ||||
struct _ftsent *fts_cycle; /* cycle node */ | struct _ftsent *fts_cycle; /* cycle node */ | ||||
struct _ftsent *fts_parent; /* parent directory */ | struct _ftsent *fts_parent; /* parent directory */ | ||||
struct _ftsent *fts_link; /* next file in directory */ | struct _ftsent *fts_link; /* next file in directory */ | ||||
▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
FTSENT *fts_children(FTS *, int); | FTSENT *fts_children(FTS *, int); | ||||
int fts_close(FTS *); | int fts_close(FTS *); | ||||
void *fts_get_clientptr(FTS *); | void *fts_get_clientptr(FTS *); | ||||
#define fts_get_clientptr(fts) ((fts)->fts_clientptr) | #define fts_get_clientptr(fts) ((fts)->fts_clientptr) | ||||
FTS *fts_get_stream(FTSENT *); | FTS *fts_get_stream(FTSENT *); | ||||
#define fts_get_stream(ftsent) ((ftsent)->fts_fts) | #define fts_get_stream(ftsent) ((ftsent)->fts_fts) | ||||
FTS *fts_open(char * const *, int, | FTS *fts_open(char * const *, int, | ||||
int (*)(const FTSENT * const *, const FTSENT * const *)); | int (*)(const FTSENT * const *, const FTSENT * const *)); | ||||
#ifdef __BLOCKS__ | |||||
FTS *fts_open_b(char * const *, int, | |||||
int (^)(const FTSENT * const *, const FTSENT * const *)); | |||||
#endif /* __BLOCKS__ */ | |||||
FTSENT *fts_read(FTS *); | FTSENT *fts_read(FTS *); | ||||
int fts_set(FTS *, FTSENT *, int); | int fts_set(FTS *, FTSENT *, int); | ||||
void fts_set_clientptr(FTS *, void *); | void fts_set_clientptr(FTS *, void *); | ||||
__END_DECLS | __END_DECLS | ||||
#endif /* !_FTS_H_ */ | #endif /* !_FTS_H_ */ |