summaryrefslogtreecommitdiff
path: root/src/filename_list.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2018-02-09 14:39:42 +0000
committerAlbrecht Schlosser <albrechts.fltk@online.de>2018-02-09 14:39:42 +0000
commit52ae3582a2c7bb437df33c0a30bfd5a01d6c5282 (patch)
tree4f532a97ab0a6a1c2f96454290bc8803ee022f1f /src/filename_list.cxx
parent30dad6a4aa2b94fe91783160c86abc75f9dc9e23 (diff)
Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32". Replace "WIN32" in text and documentation with "Windows". Replace "MSWindows" with "Windows". To do: README.Windows.txt (and maybe other documentation as well) needs updates. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/filename_list.cxx')
-rw-r--r--src/filename_list.cxx54
1 files changed, 28 insertions, 26 deletions
diff --git a/src/filename_list.cxx b/src/filename_list.cxx
index cd1f1d4df..262b79974 100644
--- a/src/filename_list.cxx
+++ b/src/filename_list.cxx
@@ -3,7 +3,7 @@
//
// Filename list routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2010 by Bill Spitzak and others.
+// Copyright 1998-2018 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -36,33 +36,35 @@ int fl_casealphasort(struct dirent **a, struct dirent **b) {
/**
- Portable and const-correct wrapper for the scandir() function.
- For each file in that directory a "dirent" structure is created.
- The only portable thing about a dirent is that dirent.d_name is the nul-terminated file name.
- An pointers array to these dirent's is created and a pointer to the array is returned in *list.
- The number of entries is given as a return value.
- If there is an error reading the directory a number less than zero is returned,
- and errno has the reason; errno does not work under WIN32.
+ Portable and const-correct wrapper for the scandir() function.
- \b Include:
- \code
- #include <FL/filename.H>
- \endcode
+ For each file in that directory a "dirent" structure is created.
+ The only portable thing about a dirent is that dirent.d_name is the
+ nul-terminated file name. A pointers array to these dirent's is created
+ and a pointer to the array is returned in *list.
+ The number of entries is given as a return value.
+ If there is an error reading the directory a number less than zero is
+ returned, and errno has the reason; errno does not work under Windows.
- \param[in] d the name of the directory to list. It does not matter if it has a trailing slash.
- \param[out] list table containing the resulting directory listing
- \param[in] sort sorting functor:
- - fl_alphasort: The files are sorted in ascending alphabetical order;
- upper and lowercase letters are compared according to their ASCII ordering uppercase before lowercase.
- - fl_casealphasort: The files are sorted in ascending alphabetical order;
- upper and lowercase letters are compared equally case is not significant.
- - fl_casenumericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made
- to put unpadded numbers in consecutive order; upper and lowercase letters
- are compared equally case is not significant.
- - fl_numericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made
- to put unpadded numbers in consecutive order; upper and lowercase letters are compared
- according to their ASCII ordering - uppercase before lowercase.
- \return the number of entries if no error, a negative value otherwise.
+ \b Include:
+ \code
+ #include <FL/filename.H>
+ \endcode
+
+ \param[in] d the name of the directory to list. It does not matter if it has a trailing slash.
+ \param[out] list table containing the resulting directory listing
+ \param[in] sort sorting functor:
+ - fl_alphasort: The files are sorted in ascending alphabetical order;
+ upper and lowercase letters are compared according to their ASCII ordering uppercase before lowercase.
+ - fl_casealphasort: The files are sorted in ascending alphabetical order;
+ upper and lowercase letters are compared equally case is not significant.
+ - fl_casenumericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made
+ to put unpadded numbers in consecutive order; upper and lowercase letters
+ are compared equally case is not significant.
+ - fl_numericsort: The files are sorted in ascending "alphanumeric" order, where an attempt is made
+ to put unpadded numbers in consecutive order; upper and lowercase letters are compared
+ according to their ASCII ordering - uppercase before lowercase.
+ \return the number of entries if no error, a negative value otherwise.
*/
int fl_filename_list(const char *d, dirent ***list, Fl_File_Sort_F *sort) {
return Fl::system_driver()->filename_list(d, list, sort);