summaryrefslogtreecommitdiffstats
path: root/src/filesystem.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-11-12 17:54:30 -0500
committerDavid Robillard <d@drobilla.net>2022-11-16 10:22:55 -0500
commit07a05e6edbf20016836a7c47d8cb8102fbfed86b (patch)
tree58b8a82b7b07eff50c2c86cf03a63a86b0266c7a /src/filesystem.c
parenta9323d9ccb4a1dccaf5c62bfc7db0c22c9011c61 (diff)
downloadlilv-07a05e6edbf20016836a7c47d8cb8102fbfed86b.tar.gz
lilv-07a05e6edbf20016836a7c47d8cb8102fbfed86b.tar.bz2
lilv-07a05e6edbf20016836a7c47d8cb8102fbfed86b.zip
Use zix_dir_for_each()
Diffstat (limited to 'src/filesystem.c')
-rw-r--r--src/filesystem.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/filesystem.c b/src/filesystem.c
index 584eaad..734e258 100644
--- a/src/filesystem.c
+++ b/src/filesystem.c
@@ -9,13 +9,6 @@
#include "zix/filesystem.h"
#include "zix/path.h"
-#ifdef _WIN32
-# include <io.h>
-# include <windows.h>
-#else
-# include <dirent.h>
-#endif
-
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
@@ -147,41 +140,6 @@ lilv_path_filename(const char* path)
return ret;
}
-void
-lilv_dir_for_each(const char* path,
- void* data,
- void (*f)(const char* path, const char* name, void* data))
-{
-#ifdef _WIN32
-
- char* pat = zix_path_join(NULL, path, "*");
- WIN32_FIND_DATA fd;
- HANDLE fh = FindFirstFile(pat, &fd);
- if (fh != INVALID_HANDLE_VALUE) {
- do {
- if (strcmp(fd.cFileName, ".") && strcmp(fd.cFileName, "..")) {
- f(path, fd.cFileName, data);
- }
- } while (FindNextFile(fh, &fd));
- }
- FindClose(fh);
- free(pat);
-
-#else
-
- DIR* dir = opendir(path);
- if (dir) {
- for (struct dirent* entry = NULL; (entry = readdir(dir));) {
- if (strcmp(entry->d_name, ".") && strcmp(entry->d_name, "..")) {
- f(path, entry->d_name, data);
- }
- }
- closedir(dir);
- }
-
-#endif
-}
-
char*
lilv_create_temporary_directory(const char* pattern)
{