8#ifndef __LIBDRAGON_DIR_H
9#define __LIBDRAGON_DIR_H
172bool dir_fnmatch(
const char *pattern,
const char *fullpath);
int(* dir_walk_callback_t)(const char *fn, dir_t *dir, void *data)
Callback function for directory walking.
Definition dir.h:121
bool dir_fnmatch(const char *pattern, const char *fullpath)
Check if a filename matches a pattern.
Definition dir.c:165
int dir_walk(const char *path, dir_walk_callback_t cb, void *data)
Walk a directory tree.
Definition dir.c:14
int dir_glob(const char *pattern, const char *path, dir_walk_callback_t cb, void *data)
Glob a directory tree using a pattern.
Definition dir.c:170
int dir_findnext(const char *const path, dir_t *dir)
Find the next file in a directory.
Definition system.c:1341
@ DIR_WALK_ERROR
Error walking the directory (errno will be set)
Definition dir.h:93
@ DIR_WALK_SKIPDIR
Do not recurse within the current directory.
Definition dir.h:95
@ DIR_WALK_GOUP
Stop walking the current directory, return up one level.
Definition dir.h:96
@ DIR_WALK_CONTINUE
Continue walking.
Definition dir.h:94
@ DIR_WALK_ABORT
Abort walking and exit immediately.
Definition dir.h:92
int dir_findfirst(const char *const path, dir_t *dir)
Find the first file in a directory.
Definition system.c:1315
int64_t d_size
Size of the file.
Definition dir.h:50
uint32_t d_cookie
Opaque cookie used to continue walking.
Definition dir.h:52
int d_type
The type of the directory entry. See DT_REG and DT_DIR.
Definition dir.h:41
Directory entry structure.
Definition dir.h:37