home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1449 < prev    next >
Internet Message Format  |  1990-12-28  |  1KB

  1. From: rogers@sud509.ed.ray.com (Andrew Rogers)
  2. Newsgroups: comp.lang.postscript,alt.sources
  3. Subject: Re: Pcal: postscript/c calendar printer
  4. Message-ID: <1418@sud509.ed.ray.com>
  5. Date: 11 Jun 90 16:40:43 GMT
  6.  
  7. Some follow-up observations about the version(s) of Pcal I posted recently:
  8.  
  9.     1) In order for the "holidays in gray" feature to work correctly, the
  10.        holidays must appear in order in the 'calendar' file.  The following
  11.        version of find_holidays() removes that restriction:
  12.  
  13. find_holidays(m, y)
  14. int m, y;
  15. {
  16.     register int day;
  17.     unsigned long holidays = 0;
  18.  
  19.     /* sort holidays by setting bits in flag word */
  20.     for (day = getday(m, y, TRUE); day != 0; day = getday(m, y, FALSE))
  21.         if (day & HOLIDAY)
  22.             holidays |= 1 << (day & ~HOLIDAY);
  23.  
  24.     PRT("/holidays [");    /* start definition of list */
  25.     for (day = 1; day <= 31; day++)
  26.         if (holidays & (1 << day))
  27.             PRT(" %d", day);
  28.     PRT(" 99 ] def\n");    /* terminate with dummy entry */
  29. }
  30.  
  31.     2) The VMS patch I posted is unnecessarily complex; the function
  32.        trnlog() is not necessary.  The VMS file system will succesfully
  33.        translate "SYS$LOGIN:" for you.
  34.  
  35. Andrew W. Rogers
  36.