Changeset View
Changeset View
Standalone View
Standalone View
include/glob.h
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
struct stat; | struct stat; | ||||
typedef struct { | typedef struct { | ||||
size_t gl_pathc; /* Count of total paths so far. */ | size_t gl_pathc; /* Count of total paths so far. */ | ||||
size_t gl_matchc; /* Count of paths matching pattern. */ | size_t gl_matchc; /* Count of paths matching pattern. */ | ||||
size_t gl_offs; /* Reserved at beginning of gl_pathv. */ | size_t gl_offs; /* Reserved at beginning of gl_pathv. */ | ||||
int gl_flags; /* Copy of flags parameter to glob. */ | int gl_flags; /* Copy of flags parameter to glob. */ | ||||
char **gl_pathv; /* List of paths matching pattern. */ | char **gl_pathv; /* List of paths matching pattern. */ | ||||
/* Copy of errfunc parameter to glob. */ | /* Copy of errfunc/errblock parameter to | ||||
glob/glob_b.*/ | |||||
union { | |||||
int (*gl_errfunc)(const char *, int); | int (*gl_errfunc)(const char *, int); | ||||
void *gl_errblk; | |||||
}; | |||||
/* | /* | ||||
* Alternate filesystem access methods for glob; replacement | * Alternate filesystem access methods for glob; replacement | ||||
* versions of closedir(3), readdir(3), opendir(3), stat(2) | * versions of closedir(3), readdir(3), opendir(3), stat(2) | ||||
* and lstat(2). | * and lstat(2). | ||||
*/ | */ | ||||
void (*gl_closedir)(void *); | void (*gl_closedir)(void *); | ||||
struct dirent *(*gl_readdir)(void *); | struct dirent *(*gl_readdir)(void *); | ||||
Show All 23 Lines | |||||
#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ | #define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ | ||||
#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ | #define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ | ||||
#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ | #define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ | ||||
#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ | #define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ | ||||
#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ | #define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ | ||||
#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ | #define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ | ||||
#define GLOB_LIMIT 0x1000 /* limit number of returned paths */ | #define GLOB_LIMIT 0x1000 /* limit number of returned paths */ | ||||
#define _GLOB_ERRBLK 0x80000000 /* (private) err callback is block */ | |||||
/* source compatibility, these are the old names */ | /* source compatibility, these are the old names */ | ||||
#define GLOB_MAXPATH GLOB_LIMIT | #define GLOB_MAXPATH GLOB_LIMIT | ||||
#define GLOB_ABEND GLOB_ABORTED | #define GLOB_ABEND GLOB_ABORTED | ||||
#endif /* __BSD_VISIBLE */ | #endif /* __BSD_VISIBLE */ | ||||
__BEGIN_DECLS | __BEGIN_DECLS | ||||
int glob(const char * __restrict, int, | int glob(const char * __restrict, int, | ||||
int (*)(const char *, int), glob_t * __restrict); | int (*)(const char *, int), glob_t * __restrict); | ||||
#ifdef __BLOCKS__ | |||||
int glob_b(const char * __restrict, int, | |||||
int (^)(const char *, int), glob_t * __restrict); | |||||
#endif /* __BLOCKS__ */ | |||||
void globfree(glob_t *); | void globfree(glob_t *); | ||||
__END_DECLS | __END_DECLS | ||||
#endif /* !_GLOB_H_ */ | #endif /* !_GLOB_H_ */ |