home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1452 < 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: <1421@sud509.ed.ray.com>
  5. Date: 11 Jun 90 19:10:08 GMT
  6.  
  7.  
  8. Some follow-up observations about the version(s) of Pcal I posted recently:
  9.  
  10.     1) In order for the "holidays in gray" feature to work correctly, the
  11.        holidays must appear in order in the 'calendar' file.  The following
  12.        version of find_holidays() removes that restriction:
  13.  
  14. find_holidays(m)
  15. int m;
  16. {
  17.     register int day;
  18.     unsigned long holidays = 0;
  19.  
  20.     /* sort holidays by setting bits in flag word */
  21.     for (day = getday(m, TRUE); day != 0; day = getday(m, FALSE))
  22.         if (day & HOLIDAY)
  23.             holidays |= 1 << (day & ~HOLIDAY);
  24.  
  25.     PRT("/holidays [");    /* start definition of list */
  26.     for (day = 1; day <= 31; day++)
  27.         if (holidays & (1 << day))
  28.             PRT(" %d", day);
  29.     PRT(" 99 ] def\n");    /* terminate with dummy entry */
  30. }
  31.  
  32.     2) The VMS patch I posted is unnecessarily complex; the function
  33.        trnlog() is not necessary.  The VMS file system will succesfully
  34.        translate "SYS$LOGIN:" for you.
  35.  
  36. Andrew W. Rogers
  37.