home *** CD-ROM | disk | FTP | other *** search
- /*
- ** ALPHASORT
- ** Trivial sorting predicate for scandir; puts entries in alphabetical order.
- */
- #include <sys/types.h>
- #include <sys/dir.h>
- #ifdef RCSID
- static char RCS[] = "$Header: alphasort.c,v 1.1 87/12/29 21:35:59 rsalz Exp $";
- #endif /* RCSID */
-
- /* A convenient shorthand. */
- typedef struct direct ENTRY;
-
- int
- alphasort(d1, d2)
- ENTRY **d1;
- ENTRY **d2;
- {
- return(strcmp(d1[0]->d_name, d2[0]->d_name));
- }
-