YAZ
5.34.0
|
File globbing (ala POSIX glob, but simpler) More...
Go to the source code of this file.
Macros | |
#define | YAZ_FILE_GLOB_FAIL_NOTEXIST 1 |
Typedefs | |
typedef struct glob_res * | yaz_glob_res_t |
file glob handle More... | |
Functions | |
int | yaz_file_glob (const char *pattern, yaz_glob_res_t *res) |
perform glob More... | |
int | yaz_file_glob2 (const char *pattern, yaz_glob_res_t *res, unsigned flags) |
perform glob (with flags) More... | |
void | yaz_file_globfree (yaz_glob_res_t *res) |
release glob result More... | |
const char * | yaz_file_glob_get_file (yaz_glob_res_t res, size_t idx) |
return resulting matching file More... | |
size_t | yaz_file_glob_get_num (yaz_glob_res_t res) |
return number of matching files More... | |
File globbing (ala POSIX glob, but simpler)
Definition in file file_glob.h.
#define YAZ_FILE_GLOB_FAIL_NOTEXIST 1 |
Definition at line 43 of file file_glob.h.
typedef struct glob_res* yaz_glob_res_t |
file glob handle
Definition at line 41 of file file_glob.h.
int yaz_file_glob | ( | const char * | pattern, |
yaz_glob_res_t * | res | ||
) |
perform glob
pattern | glob pattern file spec |
res | returned glob result |
0 | OK |
-1 | ERROR |
Definition at line 141 of file file_glob.c.
References yaz_file_glob2().
int yaz_file_glob2 | ( | const char * | pattern, |
yaz_glob_res_t * | res, | ||
unsigned | flags | ||
) |
perform glob (with flags)
pattern | glob pattern file spec |
res | returned glob result |
flags | YAZ_FILE_GLOB_.. flags |
0 | OK |
-1 | ERROR |
Definition at line 146 of file file_glob.c.
References glob_r(), nmem_create(), nmem_malloc(), and sort_them().
Referenced by config_include_src(), and yaz_file_glob().
const char* yaz_file_glob_get_file | ( | yaz_glob_res_t | res, |
size_t | idx | ||
) |
return resulting matching file
res | glob result |
idx | index 0=first, .. N-1 (where N is yaz_file_glob_get_num) |
Definition at line 173 of file file_glob.c.
References glob_res::entries, res_entry::file, and res_entry::next.
Referenced by config_include_src().
size_t yaz_file_glob_get_num | ( | yaz_glob_res_t | res | ) |
return number of matching files
res | glob result |
Definition at line 186 of file file_glob.c.
References glob_res::number_of_entries.
void yaz_file_globfree | ( | yaz_glob_res_t * | res | ) |
release glob result
res | pointer to glob result |
A value of *res == NULL is allowed. If *res != NULL, then res is set to NULL
Definition at line 163 of file file_glob.c.
References nmem_destroy().
Referenced by config_include_src().