home *** CD-ROM | disk | FTP | other *** search
/ back2roots/padua / padua.7z / padua / uucp / auucp+-1.02 / fuucp_plus_src.lzh / uucico / test.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-11-21  |  503 b   |  33 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5.  
  6. int my_cmp(char **a, char **b)
  7. {
  8.   return stricmp(*a, *b);
  9. }
  10.  
  11. void main(void)
  12. {
  13.   static char names[3000];
  14.   static char *pointers[300];
  15.  
  16.   int count;
  17.   int i;
  18.  
  19.   count = getfnl("#?", names, sizeof(names), 0);
  20.   if(count > 0)
  21.   {
  22.     if(strbpl(pointers, 300, names) != count)
  23.       exit(10);
  24.  
  25.     qsort((char *)pointers, count, sizeof(*pointers), my_cmp);
  26.  
  27.     i = 0;
  28.  
  29.     while(i < count)
  30.       fprintf(stdout, "%s\n", pointers[i++]);
  31.   }
  32. }
  33.