summaryrefslogtreecommitdiff
path: root/libc/misc/dirent/alphasort.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-03-19 23:22:41 +0000
committerEric Andersen <andersen@codepoet.org>2001-03-19 23:22:41 +0000
commit4cc6f73f6773de51a26309ec1bf75ea8ce12a2ee (patch)
treeb4a1bdcbc2e185883ae03d8a856b839ad2413eb5 /libc/misc/dirent/alphasort.c
parent8bdc62b0890760ebe6ddd70f2841b5136fbf7cb0 (diff)
Add in alphasort (working fine) and scandir (just a stub for now).
-Erik
Diffstat (limited to 'libc/misc/dirent/alphasort.c')
-rw-r--r--libc/misc/dirent/alphasort.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/misc/dirent/alphasort.c b/libc/misc/dirent/alphasort.c
new file mode 100644
index 000000000..f0ff0497a
--- /dev/null
+++ b/libc/misc/dirent/alphasort.c
@@ -0,0 +1,10 @@
+#include <string.h>
+#include "dirstream.h"
+
+int alphasort(const __ptr_t __e1, const __ptr_t __e2)
+{
+ const struct dirent *a = __e1;
+ const struct dirent *b = __e2;
+ return (strcmp(a->d_name, b->d_name));
+}
+