26typedef struct as_dir_s {
34 DIR* dir = opendir(directory);
46 dir->
dir = opendir(directory);
47 return dir->
dir != NULL;
50static inline const char*
57 return dir->
entry->d_name;
68#define WIN32_LEAN_AND_MEAN
71typedef struct as_dir_s {
80 DWORD attr = GetFileAttributesA(directory);
81 return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY);
87 dir->hFind = FindFirstFileA(directory, &dir->
dir);
89 if (dir->hFind == INVALID_HANDLE_VALUE) {
97static inline const char*
100 const char* entry = dir->
entry;
106 if (FindNextFileA(dir->hFind, &dir->
dir) && dir->
dir.cFileName[0]) {
118 FindClose(dir->hFind);
static void as_dir_close(as_dir *dir)
static const char * as_dir_read(as_dir *dir)
static bool as_dir_exists(const char *directory)
static bool as_dir_open(as_dir *dir, const char *directory)