Article View: comp.lang.postscript
Article #641Patch to PCAL PostScript calendar program
From: Ken Keirnan
Date: Sat, 01 Jul 1989 16:50
Date: Sat, 01 Jul 1989 16:50
79 lines
2112 bytes
2112 bytes
The following patch for PCAL (pcal.c) was sent to me by Terry Weissman
(weissman@wsl.dec.com). The patch fixes PostScript output for calendar
file strings containing parentheses (I forgot those darn backslashes).
Thanks again to Terry for the fixes.
Ken Keirnan
*** OLDpcal.c Sat Jul 1 08:40:45 1989
--- pcal.c Sat Jul 1 09:06:17 1989
***************
*** 5,10
#define PRT (void)printf
#define FPR (void)fprintf
char *words[100]; /* maximum number of words on a line */
char lbuf[512]; /* maximum line size */
--- 5,11 -----
#define PRT (void)printf
#define FPR (void)fprintf
+ #define PUT (void)putchar
char *words[100]; /* maximum number of words on a line */
char lbuf[512]; /* maximum line size */
***************
*** 353,359
pmonth(m)
int m;
{
! register char **s;
register oldday = -1;
register day;
--- 354,360 -----
pmonth(m)
int m;
{
! register char **s, *ptr;
register oldday = -1;
register day;
***************
*** 380,388
oldday = day;
} else
PRT("(.p)\n");
! for (s = words; *s; s++)
! PRT("(%s)\n", *s);
!
} while (day = getday(m));
PRT("] daytext\n");
PRT("showpage\n");
--- 381,395 -----
oldday = day;
} else
PRT("(.p)\n");
! for (s = words; *s; s++) {
! PUT('(');
! for (ptr = *s; *ptr; ptr++) {
! if (*ptr == '(' || *ptr == ')')
! PUT('\\');
! PUT(*ptr);
! }
! PRT(")\n");
! }
} while (day = getday(m));
PRT("] daytext\n");
PRT("showpage\n");
--
Ken Keirnan - Pacific Bell - {att,bellcore,sun,ames,pyramid}!pacbell!pbhyf!kjk
San Ramon, California kjk@pbhyf.PacBell.COM
Technical Details
Message-ID:
<5698@pbhyf.PacBell.COM>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!apple!bionet!ames!pacbell!pbhyf!kjkShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!usc!apple!bionet!ames!pacbell!pbhyf!kjk From: kjk@PacBell.COM (Ken Keirnan) Newsgroups: comp.lang.postscript Subject: Patch to PCAL PostScript calendar program Message-ID: <5698@pbhyf.PacBell.COM> Date: 1 Jul 89 16:50:47 GMT Reply-To: kjk@PacBell.COM (Ken Keirnan) Organization: Pacific * Bell, San Ramon, CA Lines: 79