From c5c23c3e27ab765c8df28088fbec5f41b89bb8b8 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 11 Dec 2024 00:12:20 -0500 Subject: Add ZixDirEntryVisitFunc Although this type is only used once in the API, define it to avoid the complicated syntax of inline function pointer parameters, which confuses both people and clang-format. --- src/posix/filesystem_posix.c | 8 +++----- src/win32/filesystem_win32.c | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/posix/filesystem_posix.c b/src/posix/filesystem_posix.c index 7553916..2ee323a 100644 --- a/src/posix/filesystem_posix.c +++ b/src/posix/filesystem_posix.c @@ -300,11 +300,9 @@ zix_remove(const char* const path) } void -zix_dir_for_each(const char* const path, - void* const data, - void (*const f)(const char* path, - const char* name, - void* data)) +zix_dir_for_each(const char* const path, + void* const data, + const ZixDirEntryVisitFunc f) { DIR* dir = opendir(path); if (dir) { diff --git a/src/win32/filesystem_win32.c b/src/win32/filesystem_win32.c index 196818b..235ee0f 100644 --- a/src/win32/filesystem_win32.c +++ b/src/win32/filesystem_win32.c @@ -172,11 +172,9 @@ zix_remove(const char* const path) } void -zix_dir_for_each(const char* const path, - void* const data, - void (*const f)(const char* path, - const char* name, - void* data)) +zix_dir_for_each(const char* const path, + void* const data, + const ZixDirEntryVisitFunc f) { static const TCHAR* const dot = TEXT("."); static const TCHAR* const dotdot = TEXT(".."); -- cgit v1.2.1