aboutsummaryrefslogtreecommitdiff
path: root/manual/filesys.texi
diff options
context:
space:
mode:
Diffstat (limited to 'manual/filesys.texi')
-rw-r--r--manual/filesys.texi11
1 files changed, 8 insertions, 3 deletions
diff --git a/manual/filesys.texi b/manual/filesys.texi
index afe072c..5ddd8a2 100644
--- a/manual/filesys.texi
+++ b/manual/filesys.texi
@@ -455,8 +455,8 @@ value are selected.
Finally the entries in the @var{namelist} are sorted using the user
supplied function @var{cmp}. The arguments of the @var{cmp} function
are of type @code{struct dirent **}. I.e., one cannot directly use the
-@code{strcmp} or @code{strcoll} function; see the function
-@code{alphasort} below.
+@code{strcmp} or @code{strcoll} function; see the functions
+@code{alphasort} and @code{versionsort} below.
The return value of the function gives the number of entries placed in
@var{namelist}. If it is @code{-1} an error occurred and the global
@@ -465,7 +465,7 @@ variable @code{errno} contains more information on the error.
As said above the fourth argument to the @code{scandir} function must be
a pointer to a sorting function. For the convenience of the programmer
-the GNU C library contains an implementation of a function which is very
+the GNU C library contains implementations of functions which are very
helpful for this purpose.
@deftypefun int alphasort (const void *@var{a}, const void *@var{b})
@@ -478,6 +478,11 @@ Return value of is less than, equal to, or greater than zero depending
on the order of the two entries @var{a} and @var{b}.
@end deftypefun
+@deftypefun int versionsort (const void *@var{a}, const void *@var{b})
+The @code{versionsort} function is like @code{alphasort}, excepted that it
+uses the @code{strverscmp} function internally.
+@end deftypefun
+
@node Simple Directory Lister Mark II
@subsection Simple Program to List a Directory, Mark II