diff options
author | David Chisnall <theraven@FreeBSD.org> | 2014-04-02 16:07:48 +0000 |
---|---|---|
committer | David Chisnall <theraven@FreeBSD.org> | 2014-04-02 16:07:48 +0000 |
commit | 46cdc14062f7b52d86bd3791220019ebc8c9c120 (patch) | |
tree | 6b79951e49825ea224053fd3b29a53481afa5e00 /lib/libc/gen/scandir.3 | |
parent | cfc4b56b571f75e9b13eda2756bbd72a0c187a7a (diff) |
Add support for some block functions that come from OS X. These are
intended to build with any C compiler.
Reviewed by: pfg
MFC after: 3 weeks
Notes
Notes:
svn path=/head/; revision=264042
Diffstat (limited to 'lib/libc/gen/scandir.3')
-rw-r--r-- | lib/libc/gen/scandir.3 | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/libc/gen/scandir.3 b/lib/libc/gen/scandir.3 index b3e0a7e19554..eaba7547fed3 100644 --- a/lib/libc/gen/scandir.3 +++ b/lib/libc/gen/scandir.3 @@ -42,6 +42,8 @@ .Ft int .Fn scandir "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\*(rp\*(lpconst struct dirent *\*(rp" "int \*(lp*compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" .Ft int +.Fn scandir_b "const char *dirname" "struct dirent ***namelist" "int \*(lp*select\^(rp\*(lpconst struct dirent *\*(rp" "int \*(lp^compar\*(rp\*(lpconst struct dirent **, const struct dirent **\*(rp" +.Ft int .Fn alphasort "const struct dirent **d1" "const struct dirent **d2" .Sh DESCRIPTION The @@ -87,6 +89,15 @@ argument to sort the array alphabetically using The memory allocated for the array can be deallocated with .Xr free 3 , by freeing each pointer in the array and then the array itself. +.Pp +The +.Fn scandir_b +function behaves in the same way as +.Fn scandir , +but takes blocks as arguments instead of function pointers and calls +.Fn qsort_b +rather than +.Fn qsort . .Sh DIAGNOSTICS Returns \-1 if the directory cannot be opened for reading or if .Xr malloc 3 |