#include <glob.h>
glob.h
(!_POSIX_C_SOURCE || _DARWIN_C_SOURCE)
structglob_t
| size_t | gl_pathc | Count of total paths so far. |
| int | gl_matchc | Count of paths matching pattern. |
| size_t | gl_offs | Reserved at beginning of gl_pathv. |
| int | gl_flags | Copy of flags parameter to glob. |
| char ** | gl_pathv | List of paths matching pattern. |
| void (*)(void *) | gl_closedir | Alternate filesystem access methods for glob; replacement versions of closedir(3), readdir(3), opendir(3), stat(2) and lstat(2). |
| struct dirent *(*)(void *) | gl_readdir | |
| void *(*)(const char *) | gl_opendir | |
| int (*)(const char *, struct stat *) | gl_lstat | |
| int (*)(const char *, struct stat *) | gl_stat |
typedefglob_t
typedef struct glob_t glob_t;
macroGLOB_APPEND
Believed to have been introduced in 1003.2-1992
#define GLOB_APPEND 0x0001
Append to output from previous call.
macroGLOB_ABEND
#define GLOB_ABEND GLOB_ABORTED
functionglob
__DARWIN_INODE64(glob) int glob(const char * __restrict, int, int (*)(const char *, int), glob_t * __restrict)
man page · June 23, 2025
glob(3) — generate pathnames matching a patternfunctionglob_b
__DARWIN_INODE64(glob_b) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2) int glob_b( const char * __restrict, int, int (^)(const char *, int) __glob_noescape, glob_t * __restrict )
man page · June 23, 2025
glob_b(3) — generate pathnames matching a patternfunctionglobfree
void globfree(glob_t *)
man page · June 23, 2025
globfree(3) — generate pathnames matching a pattern