home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / IO / EADSORT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  489 b   |  22 lines

  1. /* eadsort.c (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes */
  2.  
  3. #define INCL_DOSFILEMGR
  4. #include <os2.h>
  5. #include <stdlib.h>
  6. #include <string.h>
  7. #include <errno.h>
  8. #include <sys/ead.h>
  9. #include "ea.h"
  10.  
  11. static int _ead_compare (const void *x1, const void *x2)
  12. {
  13.   return (strcmp ((*((PFEA2 *)x1))->szName, ((*(PFEA2 *)x2))->szName));
  14. }
  15.  
  16.  
  17. void _ead_sort (_ead ead)
  18. {
  19.   if (ead->count >= 2)
  20.     qsort (ead->index, ead->count, sizeof (ead->index[0]), _ead_compare);
  21. }
  22.