feat(dirent): directory iteration
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if VLIBC_LEVEL_GE(2)
|
||||
|
||||
/*
|
||||
* alphasort (todo 24, XSI): the scandir comparator that orders entries by
|
||||
* strcmp on their names. Receives two pointers to the array's struct
|
||||
* dirent pointers.
|
||||
*/
|
||||
int
|
||||
alphasort(const struct dirent **a, const struct dirent **b)
|
||||
{
|
||||
return strcmp((*a)->d_name, (*b)->d_name);
|
||||
}
|
||||
|
||||
#endif /* VLIBC_LEVEL_GE(2) */
|
||||
Reference in New Issue
Block a user