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

  1. From: colas@ploum.inria.fr (Colas Nahaboo)
  2. Newsgroups: alt.sources
  3. Subject: Pcal 2.4: Pcal 2.3 additions (patch included)
  4. Message-ID: <8689@mirsa.inria.fr>
  5. Date: 2 Oct 90 15:41:15 GMT
  6.  
  7. This is my addition to the neat Pcal program, so whoever wants to maintain
  8. it, please apply this patch, since the original author has lost access to the
  9. net...
  10.  
  11. In most non English speaking countries, the week begins on a Monday, not
  12. a Sunday. This patch adds a compilation flag START_MONDAY to pcal to make it
  13. print calendars this way. (this is a compilation flag, not an option, since
  14. it is a cultural country-wide default). In fact you can type 
  15.     make pcal    (to create english pcal)
  16.     make pcalm    (to create monday-staring version)
  17.  
  18. Apply this patch to the posted 2.3 to create pcal 2.4
  19.  
  20. diff -c -r -N ./Makefile ../pcal-2.4/Makefile
  21. *** ./Makefile  Tue Oct  2 15:23:53 1990
  22. --- ../pcal-2.4/Makefile        Tue Oct  2 16:30:36 1990
  23. ***************
  24. *** 1,14 ****
  25. ! #
  26.   MANDIR=/usr1/jad/man                  # must change this
  27.  
  28.   pcal: pcal.c pcalinit.h
  29.         $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcal pcal.c
  30.  
  31.   pcalinit: pcalinit.c
  32.         $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalinit pcalinit.c
  33.  
  34.   pcalinit.h: pcalinit pcalinit.ps
  35.         pcalinit pcalinit.ps pcalinit.h
  36.  
  37.   man:  pcal.man
  38.         nroff -man pcal.man > pcal.1
  39. --- 1,25 ----
  40. ! # pcal is the english version
  41. ! # pcalm starts the week on Mondays
  42.   MANDIR=/usr1/jad/man                  # must change this
  43.  
  44.   pcal: pcal.c pcalinit.h
  45.         $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcal pcal.c
  46.  
  47. + pcalm: pcal.c pcalinitm.h
  48. +       $(CC) -DSTART_MONDAY  $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalm pcal.c
  49. +
  50.   pcalinit: pcalinit.c
  51.         $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalinit pcalinit.c
  52.  
  53.   pcalinit.h: pcalinit pcalinit.ps
  54.         pcalinit pcalinit.ps pcalinit.h
  55. +
  56. + pcalinitm.h: pcalinit pcalinitm.ps
  57. +       pcalinit pcalinitm.ps pcalinitm.h
  58. +
  59. + pcalinitm.ps: pcalinit.ps
  60. +       sed -e '1,$$s/% 1 sub % 0--Monday/1 sub % 0--Monday/' < pcalinit.ps \
  61. +               > pcalinitm.ps
  62.  
  63.   man:  pcal.man
  64.         nroff -man pcal.man > pcal.1
  65. diff -c -r -N ./ReadMe ../pcal-2.4/ReadMe
  66. *** ./ReadMe    Tue Oct  2 15:23:54 1990
  67. --- ../pcal-2.4/ReadMe  Tue Oct  2 16:28:00 1990
  68. ***************
  69. *** 1,3 ****
  70. --- 1,10 ----
  71. + Version 2.4 Colas Nahaboo (colas@mirsa.inria.fr) added the possibility to
  72. +       produce non-english calendars (week staring on mondays) as program
  73. +       pcalm
  74. +
  75. +       "make" will produce pcal (starts on sunday)
  76. +       "make pcalm" will produce pcalm (starts on monday)
  77. +
  78.   Version 2.3 (2.2 was not released to alt.sources) merges the following
  79. changes
  80. :
  81.  
  82.         Joe Brownlee added a mechanism by which notes can be specified in
  83. diff -c -r -N ./pcal.c ../pcal-2.4/pcal.c
  84. *** ./pcal.c    Tue Oct  2 15:24:01 1990
  85. --- ../pcal-2.4/pcal.c  Tue Oct  2 16:25:15 1990
  86. ***************
  87. *** 16,21 ****
  88. --- 16,24 ----
  89.    *
  90.    * Revision history:
  91.    *
  92. +  *      2.4     colas   10/01/90        Week can start on monday
  93. +  *                                    (pcalm program)
  94. +  *
  95.    *    2.3     jwz     09/18/90        Added moon routines
  96.    *
  97.    *    2.2     AWR     09/17/90        revise logic of parse(); new usage
  98. ***************
  99. *** 360,366 ****
  100. --- 363,373 ----
  101.    */
  102.  
  103.   char default_color[7] = {             /* -b, -g */
  104. + #ifdef START_MONDAY
  105. +       BLACK, BLACK, BLACK, BLACK, BLACK, GRAY, GRAY   /* cf. COLOR_MSG */
  106. + #else
  107.         GRAY, BLACK, BLACK, BLACK, BLACK, BLACK, GRAY   /* cf. COLOR_MSG */
  108. + #endif
  109.         };
  110.  
  111.   int datefile_type = SYS_DATEFILE;     /* -e, -f */
  112. ***************
  113. *** 392,399 ****
  114. --- 399,411 ----
  115.         };
  116.  
  117.   static char *days[7] = {
  118. + #ifndef START_MONDAY
  119.         "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
  120.         "Saturday"
  121. + #else
  122. +       "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
  123. +       "Saturday", "Sunday"
  124. + #endif
  125.         };
  126.  
  127.   /* preprocessor tokens - must be in same order as PP_XXXXX (cf. pp_token())
  128. */
  129. diff -c -r -N ./pcalinit.ps ../pcal-2.4/pcalinit.ps
  130. *** ./pcalinit.ps       Tue Oct  2 15:24:05 1990
  131. --- ../pcal-2.4/pcalinit.ps     Tue Oct  2 16:32:23 1990
  132. ***************
  133. *** 197,202 ****
  134. --- 197,203 ----
  135.                 /off exch off add def
  136.         } for
  137.         off 7 mod               % 0--Sunday, 1--monday, etc.
  138. +       % 1 sub % 0--Monday
  139.   } def
  140.  
  141.  
  142.  
  143. -- 
  144. Colas Nahaboo, Bull Research France -- Koala Project -- GWM X11 Window Manager
  145. Internet: colas@mirsa.inria.fr, Phone: (33) 93.65.77.70, Fax: (33) 93 65 77 66
  146. INRIA - Sophia Antipolis, 2004, rte des Lucioles, 06565 Valbonne Cedex, FRANCE
  147.