[alt.sources] Pcal 2.4: Pcal 2.3 additions

colas@ploum.inria.fr (Colas Nahaboo) (10/02/90)

This is my addition to the neat Pcal program, so whoever wants to maintain
it, please apply this patch, since the original author has lost access to the
net...

In most non English speaking countries, the week begins on a Monday, not
a Sunday. This patch adds a compilation flag START_MONDAY to pcal to make it
print calendars this way. (this is a compilation flag, not an option, since
it is a cultural country-wide default). In fact you can type 
	make pcal	(to create english pcal)
	make pcalm	(to create monday-staring version)

Apply this patch to the posted 2.3 to create pcal 2.4

diff -c -r -N ./Makefile ../pcal-2.4/Makefile
*** ./Makefile  Tue Oct  2 15:23:53 1990
--- ../pcal-2.4/Makefile        Tue Oct  2 16:30:36 1990
***************
*** 1,14 ****
! #
  MANDIR=/usr1/jad/man                  # must change this

  pcal: pcal.c pcalinit.h
        $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcal pcal.c

  pcalinit: pcalinit.c
        $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalinit pcalinit.c

  pcalinit.h: pcalinit pcalinit.ps
        pcalinit pcalinit.ps pcalinit.h

  man:  pcal.man
        nroff -man pcal.man > pcal.1
--- 1,25 ----
! # pcal is the english version
! # pcalm starts the week on Mondays
  MANDIR=/usr1/jad/man                  # must change this

  pcal: pcal.c pcalinit.h
        $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcal pcal.c

+ pcalm: pcal.c pcalinitm.h
+       $(CC) -DSTART_MONDAY  $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalm pcal.c
+
  pcalinit: pcalinit.c
        $(CC) $(CFLAGS) $(LDFLAGS) $(COPTS) -o pcalinit pcalinit.c

  pcalinit.h: pcalinit pcalinit.ps
        pcalinit pcalinit.ps pcalinit.h
+
+ pcalinitm.h: pcalinit pcalinitm.ps
+       pcalinit pcalinitm.ps pcalinitm.h
+
+ pcalinitm.ps: pcalinit.ps
+       sed -e '1,$$s/% 1 sub % 0--Monday/1 sub % 0--Monday/' < pcalinit.ps \
+               > pcalinitm.ps

  man:  pcal.man
        nroff -man pcal.man > pcal.1
diff -c -r -N ./ReadMe ../pcal-2.4/ReadMe
*** ./ReadMe    Tue Oct  2 15:23:54 1990
--- ../pcal-2.4/ReadMe  Tue Oct  2 16:28:00 1990
***************
*** 1,3 ****
--- 1,10 ----
+ Version 2.4 Colas Nahaboo (colas@mirsa.inria.fr) added the possibility to
+       produce non-english calendars (week staring on mondays) as program
+       pcalm
+
+       "make" will produce pcal (starts on sunday)
+       "make pcalm" will produce pcalm (starts on monday)
+
  Version 2.3 (2.2 was not released to alt.sources) merges the following
changes
:

        Joe Brownlee added a mechanism by which notes can be specified in
diff -c -r -N ./pcal.c ../pcal-2.4/pcal.c
*** ./pcal.c    Tue Oct  2 15:24:01 1990
--- ../pcal-2.4/pcal.c  Tue Oct  2 16:25:15 1990
***************
*** 16,21 ****
--- 16,24 ----
   *
   * Revision history:
   *
+  *      2.4     colas   10/01/90        Week can start on monday
+  *                                    (pcalm program)
+  *
   *    2.3     jwz     09/18/90        Added moon routines
   *
   *    2.2     AWR     09/17/90        revise logic of parse(); new usage
***************
*** 360,366 ****
--- 363,373 ----
   */

  char default_color[7] = {             /* -b, -g */
+ #ifdef START_MONDAY
+       BLACK, BLACK, BLACK, BLACK, BLACK, GRAY, GRAY   /* cf. COLOR_MSG */
+ #else
        GRAY, BLACK, BLACK, BLACK, BLACK, BLACK, GRAY   /* cf. COLOR_MSG */
+ #endif
        };

  int datefile_type = SYS_DATEFILE;     /* -e, -f */
***************
*** 392,399 ****
--- 399,411 ----
        };

  static char *days[7] = {
+ #ifndef START_MONDAY
        "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
        "Saturday"
+ #else
+       "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
+       "Saturday", "Sunday"
+ #endif
        };

  /* preprocessor tokens - must be in same order as PP_XXXXX (cf. pp_token())
*/
diff -c -r -N ./pcalinit.ps ../pcal-2.4/pcalinit.ps
*** ./pcalinit.ps       Tue Oct  2 15:24:05 1990
--- ../pcal-2.4/pcalinit.ps     Tue Oct  2 16:32:23 1990
***************
*** 197,202 ****
--- 197,203 ----
                /off exch off add def
        } for
        off 7 mod               % 0--Sunday, 1--monday, etc.
+       % 1 sub % 0--Monday
  } def



-- 
Colas Nahaboo, Bull Research France -- Koala Project -- GWM X11 Window Manager
Internet: colas@mirsa.inria.fr, Phone: (33) 93.65.77.70, Fax: (33) 93 65 77 66
INRIA - Sophia Antipolis, 2004, rte des Lucioles, 06565 Valbonne Cedex, FRANCE

jbr0@cbnews.att.com (joseph.a.brownlee) (10/03/90)

In article <8689@mirsa.inria.fr>, colas@ploum.inria.fr (Colas Nahaboo) writes:
> This is my addition to the neat Pcal program, so whoever wants to maintain
> it, please apply this patch, since the original author has lost access to the
> net...

I believe Andrew lost access before he could let everyone know that I'll be
maintaining pcal from here on.  Mail suggestions, patches, features, etc. to
me at the address shown below.

-- 
   -      _   Joe Brownlee, Analysts International Corp. @ AT&T Network Systems
  /_\  @ / `  471 E Broad St, Suite 1610, Columbus, Ohio 43215   (614) 860-7461
 /   \ | \_,  E-mail: jbr@cblph.att.com     Who pays attention to what _I_ say?
 "Scotty, we need warp drive in 3 minutes or we're all dead!" --- James T. Kirk