summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-07 15:10:30 +0000
committerManolo Gouy <Manolo>2016-04-07 15:10:30 +0000
commit23a60edb44d264887a398eef1b6346f8f24737e2 (patch)
treeae6920a8b002dd26240f560d61df84888ba3b4a5 /src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
parent406fcaf3053b2d8d9c8ea677c59667a7ec43a556 (diff)
Rewrite filename_list.cxx under the driver model.
One more platform-dependent type is necessary: struct dirent Create a new header file, FL/platform_types.h, to define all types whose definition is platform-dependent. This file is for C because it is included by scandir_XXX.c git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11550 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index 46bd9dc78..9a0c25d4d 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -39,6 +39,12 @@ static wchar_t *mbwbuf = NULL;
static wchar_t *wbuf = NULL;
static wchar_t *wbuf1 = NULL;
+extern "C" {
+ int fl_scandir(const char *dirname, struct dirent ***namelist,
+ int (*select)(struct dirent *),
+ int (*compar)(struct dirent **, struct dirent **));
+}
+
/**
Creates a driver that manages all screen and display related calls.
@@ -429,6 +435,13 @@ int Fl_WinAPI_System_Driver::clocale_printf(FILE *output, const char *format, va
return retval;
}
+int Fl_WinAPI_System_Driver::filename_list(const char *d, dirent ***list, int (*sort)(struct dirent **, struct dirent **) ) {
+ // For Windows we have a special scandir implementation that uses
+ // the Win32 "wide" functions for lookup, avoiding the code page mess
+ // entirely. It also fixes up the trailing '/'.
+ return fl_scandir(d, list, 0, sort);
+}
+
//
// End of "$Id$".
//