home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume18 / geneal / part01 / dlists.c < prev    next >
C/C++ Source or Header  |  1989-03-08  |  1KB  |  68 lines

  1. /* dlists.c - generate date lists for various things
  2.  *
  3.  *  4.Jan.88  jimmc  Initial definition
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include "geneal.h"
  8.  
  9. extern char *convertidate();
  10.  
  11. int
  12. bdlist1(sdate,name,idate)
  13. char *sdate;
  14. char *name;
  15. int idate;
  16. {
  17.     char *cnvdate;
  18.  
  19.     if (idate>0)
  20.         cnvdate = convertidate(idate);
  21.     else
  22.         cnvdate = sdate;
  23.     fprintf(outfp,"    %-24s%s\n", cnvdate, name);
  24.     return 0;
  25. }
  26.  
  27. int
  28. bdlist(idcount,idlist)
  29. int idcount;        /* number of entries in idlist */
  30. int *idlist;        /* array of id numbesr */
  31. {
  32.     int i;
  33.     char *bdate, *name;
  34.  
  35.     dsortinit();
  36.     for (i=0; i<idcount; i++) {
  37.         bdate = fgstr(idlist[i],"B");
  38.         name = fgfname(idlist[i]);
  39.         if (bdate&&bdate[0] || name&&name[0])
  40.             dsortadd(bdate,name);
  41.     }
  42.  
  43.     fprintf(outfp,"                     BIRTHDAYS\n\n");
  44.     dsortenum(bdlist1);
  45. }
  46.  
  47. int
  48. annlist(idcount,idlist)
  49. int idcount;        /* number of entries in idlist */
  50. int *idlist;        /* array of id numbesr */
  51. {
  52.     int i;
  53.     char *bdate, *name;
  54.  
  55.     dsortinit();
  56.     for (i=0; i<idcount; i++) {
  57.         bdate = fgstr(idlist[i],"M");
  58.         name = fglpname(idlist[i]);
  59.         if (bdate&&bdate[0] || name&&name[0])
  60.             dsortadd(bdate,name);
  61.     }
  62.  
  63.     fprintf(outfp,"                     ANNIVERSARIES\n\n");
  64.     dsortenum(bdlist1);
  65. }
  66.  
  67. /* end */
  68.