home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume1 / 8712 / 15 / alphasort.c next >
Encoding:
C/C++ Source or Header  |  1990-07-13  |  425 b   |  21 lines

  1. /*
  2. **  ALPHASORT
  3. **  Trivial sorting predicate for scandir; puts entries in alphabetical order.
  4. */
  5. #include <sys/types.h>
  6. #include <sys/dir.h>
  7. #ifdef    RCSID
  8. static char RCS[] = "$Header: alphasort.c,v 1.1 87/12/29 21:35:59 rsalz Exp $";
  9. #endif    /* RCSID */
  10.  
  11. /* A convenient shorthand. */
  12. typedef struct direct     ENTRY;
  13.  
  14. int
  15. alphasort(d1, d2)
  16.     ENTRY    **d1;
  17.     ENTRY    **d2;
  18. {
  19.     return(strcmp(d1[0]->d_name, d2[0]->d_name));
  20. }
  21.