home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-04 | 51.0 KB | 1,734 lines |
- *** ../prev/french.h Thu Aug 26 10:49:49 1993
- --- ./french.h Tue Sep 28 12:35:38 1993
- ***************
- *** 361,367 ****
- fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- #endif
- #ifdef ISOLATIN1
- ! fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
- fprintf(ErrFp, " -r D\351sactiver les instructions RUN\n");
- --- 361,367 ----
- fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- #endif
- #ifdef ISOLATIN1
- ! fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [*r\351p\351tition]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
- fprintf(ErrFp, " -r D\351sactiver les instructions RUN\n");
- ***************
- *** 387,394 ****
- fprintf(ErrFp, " -kcmd Ex\351cuter 'cmd' pour les rappels de type MSG\n");
- fprintf(ErrFp, " -g[d[d]] Trier les rappels par date et heure avant lancement\n");
- fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n\n");
- #else /* ISOLATIN1 */
- ! fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
- fprintf(ErrFp, " -r Desactiver les instructions RUN\n");
- --- 387,395 ----
- fprintf(ErrFp, " -kcmd Ex\351cuter 'cmd' pour les rappels de type MSG\n");
- fprintf(ErrFp, " -g[d[d]] Trier les rappels par date et heure avant lancement\n");
- fprintf(ErrFp, " -ivar=val Initialiser var \340 val et conserver var\n\n");
- + fprintf(ErrFp, " -m Commencer le calendrier avec lundi plutot que dimanche");
- #else /* ISOLATIN1 */
- ! fprintf(ErrFp, "\nUtilisation: remind [options] fichier [date] [*repetition]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Afficher la prochaine occurence des rappels en format simple\n");
- fprintf(ErrFp, " -r Desactiver les instructions RUN\n");
- ***************
- *** 414,419 ****
- --- 415,421 ----
- fprintf(ErrFp, " -kcmd Executer 'cmd' pour les rappels de type MSG\n");
- fprintf(ErrFp, " -g[d[d]] Trier les rappels par date et heure avant lancement\n");
- fprintf(ErrFp, " -ivar=val Initialiser var a val et conserver var\n\n");
- + fprintf(ErrFp, " -m Commencer le calendrier avec lundi plutot que dimanche");
- #endif /* ISOLATIN1 */
- exit(1);
- }
- *** ../prev/funcs.c Thu Aug 19 16:58:12 1993
- --- ./funcs.c Tue Sep 28 16:45:33 1993
- ***************
- *** 81,86 ****
- --- 81,89 ----
- PRIVATE int FMin ARGS ((void));
- PRIVATE int FMinute ARGS ((void));
- PRIVATE int FMinsfromutc ARGS ((void));
- + PRIVATE int FMoondate ARGS ((void));
- + PRIVATE int FMoonphase ARGS ((void));
- + PRIVATE int FMoontime ARGS ((void));
- PRIVATE int FMon ARGS ((void));
- PRIVATE int FMonnum ARGS ((void));
- PRIVATE int FOrd ARGS ((void));
- ***************
- *** 87,92 ****
- --- 90,97 ----
- PRIVATE int FOstype ARGS ((void));
- PRIVATE int FPlural ARGS ((void));
- PRIVATE int FSgn ARGS ((void));
- + PRIVATE int FPsmoon ARGS ((void));
- + PRIVATE int FPsshade ARGS ((void));
- PRIVATE int FShell ARGS ((void));
- PRIVATE int FStrlen ARGS ((void));
- PRIVATE int FSubstr ARGS ((void));
- ***************
- *** 196,205 ****
- --- 201,215 ----
- { "minute", 1, 1, FMinute },
- { "mon", 1, 1, FMon },
- { "monnum", 1, 1, FMonnum },
- + { "moondate", 1, 3, FMoondate },
- + { "moonphase", 0, 2, FMoonphase },
- + { "moontime", 1, 3, FMoontime },
- { "now", 0, 0, FNow },
- { "ord", 1, 1, FOrd },
- { "ostype", 0, 0, FOstype },
- { "plural", 1, 3, FPlural },
- + { "psmoon", 1, 2, FPsmoon},
- + { "psshade", 1, 1, FPsshade},
- { "realtoday", 0, 0, FRealtoday },
- { "sgn", 1, 1, FSgn },
- { "shell", 1, 1, FShell },
- ***************
- *** 2044,2046 ****
- --- 2054,2250 ----
-
- return OK;
- }
- +
- + /***************************************************************/
- + /* */
- + /* FPsshade */
- + /* */
- + /* Canned PostScript code for shading a calendar square */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int FPsshade(void)
- + #else
- + static int FPsshade()
- + #endif
- + {
- + char psbuff[256];
- + char *s = psbuff;
- + if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
- + if (ARG(0).v.val < 0) return E_2LOW;
- + if (ARG(0).v.val > 100) return E_2HIGH;
- +
- + sprintf(s, "/_A LineWidth 2 div def ");
- + s += strlen(s);
- + sprintf(s, "_A _A moveto ");
- + s += strlen(s);
- + sprintf(s, "BoxWidth _A sub _A lineto BoxWidth _A sub BoxHeight _A sub lineto ");
- + s += strlen(s);
- + sprintf(s, "_A BoxHeight _A sub lineto closepath %d 100 div setgray fill 0.0 setgray", ARG(0).v.val);
- + return RetStrVal(psbuff);
- + }
- +
- + /***************************************************************/
- + /* */
- + /* FPsmoon */
- + /* */
- + /* Canned PostScript code for generating moon phases */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int FPsmoon(void)
- + #else
- + static int FPsmoon()
- + #endif
- + {
- + char psbuff[256];
- + char sizebuf[30];
- + char *s = psbuff;
- + if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
- + if (ARG(0).v.val < 0) return E_2LOW;
- + if (ARG(0).v.val > 3) return E_2HIGH;
- + if (Nargs > 1) {
- + if (ARG(1).type != INT_TYPE) return E_BAD_TYPE;
- + if (ARG(1).v.val <= 0) return E_2LOW;
- + sprintf(sizebuf, "%d", ARG(1).v.val);
- + } else {
- + strcpy(sizebuf, "DaySize 2 div");
- + }
- +
- + sprintf(s, "gsave 0 setgray newpath Border %s add BoxHeight Border sub %s sub",
- + sizebuf, sizebuf);
- + s += strlen(s);
- + sprintf(s, " %s 0 360 arc closepath", sizebuf);
- + s += strlen(s);
- + switch(ARG(0).v.val) {
- + case 0:
- + sprintf(s, " fill grestore");
- + break;
- +
- + case 2:
- + sprintf(s, " stroke grestore");
- + break;
- +
- + case 1:
- + sprintf(s, " stroke");
- + s += strlen(s);
- + sprintf(s, " newpath Border %s add BoxHeight Border sub %s sub",
- + sizebuf, sizebuf);
- + s += strlen(s);
- + sprintf(s, " %s 90 270 arc closepath fill grestore", sizebuf);
- + break;
- +
- + default:
- + sprintf(s, " stroke");
- + s += strlen(s);
- + sprintf(s, " newpath Border %s add BoxHeight Border sub %s sub",
- + sizebuf, sizebuf);
- + s += strlen(s);
- + sprintf(s, " %s 270 90 arc closepath fill grestore", sizebuf);
- + break;
- + }
- + return RetStrVal(psbuff);
- + }
- +
- + /***************************************************************/
- + /* */
- + /* FMoonphase */
- + /* */
- + /* Phase of moon for specified date/time. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PRIVATE int FMoonphase(void)
- + #else
- + static int FMoonphase()
- + #endif
- + {
- + int date, time;
- +
- + switch(Nargs) {
- + case 0:
- + date = JulianToday;
- + time = 0;
- + break;
- + case 1:
- + if (ARG(0).type != DATE_TYPE) return E_BAD_TYPE;
- + date = ARG(0).v.val;
- + time = 0;
- + break;
- + case 2:
- + if (ARG(0).type != DATE_TYPE && ARG(1).type != TIM_TYPE) return E_BAD_TYPE;
- + date = ARG(0).v.val;
- + time = ARG(1).v.val;
- + break;
- +
- + default: return E_SWERR;
- + }
- +
- + RetVal.type = INT_TYPE;
- + RetVal.v.val = MoonPhase(date, time);
- + return OK;
- + }
- +
- + /***************************************************************/
- + /* */
- + /* FMoondate */
- + /* */
- + /* Hunt for next occurrence of specified moon phase */
- + /* */
- + /***************************************************************/
- + PRIVATE int MoonStuff ARGS ((int want_time));
- + #ifdef HAVE_PROTOS
- + PRIVATE int FMoondate(void)
- + #else
- + static int FMoondate()
- + #endif
- + {
- + return MoonStuff(0);
- + }
- +
- + #ifdef HAVE_PROTOS
- + PRIVATE int FMoontime(void)
- + #else
- + static int FMoontime()
- + #endif
- + {
- + return MoonStuff(1);
- + }
- +
- + #ifdef HAVE_PROTOS
- + PRIVATE int MoonStuff(int want_time)
- + #else
- + static int MoonStuff(want_time)
- + int want_time;
- + #endif
- + {
- + int startdate, starttim;
- + int d, t;
- +
- + startdate = JulianToday;
- + starttim = 0;
- +
- + if (ARG(0).type != INT_TYPE) return E_BAD_TYPE;
- + if (ARG(0).v.val < 0) return E_2LOW;
- + if (ARG(0).v.val > 3) return E_2HIGH;
- + if (Nargs >= 2) {
- + if (ARG(1).type != DATE_TYPE) return E_BAD_TYPE;
- + startdate = ARG(1).v.val;
- + if (Nargs >= 3) {
- + if (ARG(2).type != TIM_TYPE) return E_BAD_TYPE;
- + starttim = ARG(2).v.val;
- + }
- + }
- +
- + HuntPhase(startdate, starttim, ARG(0).v.val, &d, &t);
- + if (want_time) {
- + RetVal.type = TIM_TYPE;
- + RetVal.v.val = t;
- + } else {
- + RetVal.type = DATE_TYPE;
- + RetVal.v.val = d;
- + }
- + return OK;
- + }
- +
- +
- *** ../prev/globals.h Thu Aug 19 15:46:05 1993
- --- ./globals.h Tue Sep 28 10:56:14 1993
- ***************
- *** 39,44 ****
- --- 39,46 ----
- EXTERN INIT( int DebugFlag, 0);
- EXTERN INIT( int DoCalendar, 0);
- EXTERN INIT( int DoSimpleCalendar, 0);
- + EXTERN INIT( int MondayFirst, 0);
- + EXTERN INIT( int Iterations, 1);
- EXTERN INIT( int PsCal, 0);
- EXTERN INIT( int CalWidth, 80);
- EXTERN INIT( int CalWeeks, 0);
- ***************
- *** 86,91 ****
- --- 88,94 ----
- EXTERN INIT( int LongDeg, LON_DEG);
- EXTERN INIT( int LongMin, LON_MIN);
- EXTERN INIT( int LongSec, LON_SEC);
- + EXTERN INIT( char *Location, LOCATION);
-
- /* UTC calculation stuff */
- EXTERN INIT( int MinsFromUTC, 0);
- ***************
- *** 96,101 ****
- --- 99,106 ----
- EXTERN INIT( int FormWidth, 72);
- EXTERN INIT( int FirstIndent, 0);
- EXTERN INIT( int SubsIndent, 0);
- + EXTERN INIT( char *EndSent, ".?!");
- + EXTERN INIT( char *EndSentIg, "\"')]}>");
-
- /* We need the language stuff here... */
-
- *** ../prev/init.c Fri Aug 20 11:46:29 1993
- --- ./init.c Tue Sep 28 11:03:50 1993
- ***************
- *** 66,71 ****
- --- 66,72 ----
- * by non-root, changes environment but not effective uid.
- * -kcmd = Run 'cmd' for MSG-type reminders instead of printing to stdout
- * -iVAR=EXPR = Initialize and preserve VAR.
- + * -m = Start calendar with Monday instead of Sunday.
- * A minus sign alone indicates to take input from stdin
- *
- **************************************************************/
- ***************
- *** 104,115 ****
- {
- char *arg;
- int i;
- ! int y, m, d;
- Token tok;
-
- y = NO_YR;
- m = NO_MON;
- d = NO_DAY;
-
- RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
- if (RealToday < 0) {
- --- 105,117 ----
- {
- char *arg;
- int i;
- ! int y, m, d, rep;
- Token tok;
-
- y = NO_YR;
- m = NO_MON;
- d = NO_DAY;
- + rep = NO_REP;
-
- RealToday = SystemDate(&CurYear, &CurMon, &CurDay);
- if (RealToday < 0) {
- ***************
- *** 162,167 ****
- --- 164,174 ----
- RunDisabled = 1;
- break;
-
- + case 'm':
- + case 'M':
- + MondayFirst = 1;
- + break;
- +
- case 'o':
- case 'O':
- IgnoreOnce = 1;
- ***************
- *** 358,369 ****
- else y = tok.val;
- break;
-
- default: Usage();
- }
- }
-
- /* Must supply date in the form: day, mon, yr OR mon, yr */
- ! if (m == NO_MON || y == NO_YR) Usage();
- if (d == NO_DAY) d=1;
- if (d > DaysInMonth(m, y)) {
- fprintf(ErrFp, BadDate);
- --- 365,394 ----
- else y = tok.val;
- break;
-
- + case T_Rep:
- + rep = tok.val;
- + break;
- +
- default: Usage();
- }
- }
-
- + if (rep > 0) {
- + Iterations = rep;
- + DontQueue = 1;
- + Daemon = 0;
- + }
- +
- /* Must supply date in the form: day, mon, yr OR mon, yr */
- ! if (m == NO_MON || y == NO_YR) {
- ! if (rep == NO_REP) Usage();
- ! else if (m != NO_MON || y != NO_YR) Usage();
- ! else {
- ! m = CurMon;
- ! y = CurYear;
- ! if (d == NO_DAY) d = CurDay;
- ! }
- ! }
- if (d == NO_DAY) d=1;
- if (d > DaysInMonth(m, y)) {
- fprintf(ErrFp, BadDate);
- ***************
- *** 404,410 ****
- #ifdef BETA
- fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- #endif
- ! fprintf(ErrFp, "Usage: remind [options] filename [date]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
- fprintf(ErrFp, " -r Disable RUN directives\n");
- --- 429,435 ----
- #ifdef BETA
- fprintf(ErrFp, ">>>> BETA VERSION <<<<\n");
- #endif
- ! fprintf(ErrFp, "Usage: remind [options] filename [date] [*rep]\n");
- fprintf(ErrFp, "Options:\n");
- fprintf(ErrFp, " -n Output next occurrence of reminders in simple format\n");
- fprintf(ErrFp, " -r Disable RUN directives\n");
- ***************
- *** 430,435 ****
- --- 455,461 ----
- fprintf(ErrFp, " -kcmd Run 'cmd' for MSG-type reminders\n");
- fprintf(ErrFp, " -g[d[d]] Sort reminders by date and time before issuing\n");
- fprintf(ErrFp, " -ivar=val Initialize var to val and preserve var\n");
- + fprintf(ErrFp, " -m Start calendar with Monday rather than Sunday\n");
- exit(1);
- }
- #endif /* L_USAGE_OVERRIDE */
- ***************
- *** 560,570 ****
- }
-
- if (*varname == '$') {
- ! if (val.type != INT_TYPE) {
- ! fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[E_BAD_TYPE]);
- ! return;
- ! }
- ! r=SetSysVar(varname+1, val.v.val);
- if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
- return;
- }
- --- 586,592 ----
- }
-
- if (*varname == '$') {
- ! r=SetSysVar(varname+1, &val);
- if (r) fprintf(ErrFp, ErrMsg[M_I_OPTION], ErrMsg[r]);
- return;
- }
- *** ../prev/lnk.msc Mon Jun 28 12:30:12 1993
- --- ./lnk.msc Mon Sep 20 14:59:42 1993
- ***************
- *** 8,13 ****
- --- 8,14 ----
- hbcal.obj +
- init.obj +
- main.obj +
- + moon.obj +
- omit.obj +
- sort.obj +
- token.obj +
- *** ../prev/lnk.tc Mon Jun 28 12:30:13 1993
- --- ./lnk.tc Mon Sep 20 14:59:34 1993
- ***************
- *** 9,14 ****
- --- 9,15 ----
- hbcal.obj
- init.obj
- main.obj
- + moon.obj
- omit.obj
- sort.obj
- token.obj
- *** ../prev/main.c Wed Aug 25 13:06:26 1993
- --- ./main.c Tue Sep 28 16:50:30 1993
- ***************
- *** 80,86 ****
-
- /* The very first thing to do is to set up ErrFp to be stderr */
- ErrFp = stderr;
- !
- /* Set up global vars */
- ArgC = argc;
- ArgV = argv;
- --- 80,86 ----
-
- /* The very first thing to do is to set up ErrFp to be stderr */
- ErrFp = stderr;
- !
- /* Set up global vars */
- ArgC = argc;
- ArgV = argv;
- ***************
- *** 92,147 ****
- }
-
- /* Not doing a calendar. Do the regular remind loop */
- ! DoReminders();
-
- ! if (DebugFlag & DB_DUMP_VARS) {
- ! DumpVarTable();
- ! DumpSysVarByName(NULL);
- ! }
-
- ! if (!Hush) {
- ! if (DestroyOmitContexts())
- ! Eprint("%s", E_PUSH_NOPOP);
- #ifdef HAVE_QUEUED
- ! if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
- ! else
- ! if (!Daemon && !NextMode && !NumTriggered) printf(ErrMsg[M_QUEUED],
- ! NumQueued);
- #else
- ! if (!NextMode && !NumTriggered) printf("%s\n", ErrMsg[E_NOREMINDERS]);
- #endif
- ! }
-
- /* If it's MS-DOS or OS2, reset the file access date */
- #if defined(__MSDOS__) || defined(OS2)
- ! if (!UseStdin && (RealToday == JulianToday))
- ! SetAccessDate(InitialFile, RealToday);
- #endif
-
- /* If there are sorted reminders, handle them */
- ! if (SortByDate) IssueSortedReminders();
-
- /* If there are any background reminders queued up, handle them */
- #ifdef HAVE_QUEUED
- ! if (NumQueued || Daemon) {
-
- ! if (DontFork) {
- ! HandleQueuedReminders();
- ! return 0;
- ! } else {
- ! pid = fork();
- ! if (pid == 0) {
- ! HandleQueuedReminders();
- ! return 0;
- ! }
- ! if (pid == -1) {
- ! fprintf(ErrFp, "%s", ErrMsg[E_CANTFORK]);
- ! return 1;
- ! }
- }
- - }
- #endif
- !
- return 0;
- }
-
- --- 92,157 ----
- }
-
- /* Not doing a calendar. Do the regular remind loop */
- ! ShouldCache = (Iterations > 1);
-
- ! while (Iterations--) {
- ! DoReminders();
-
- ! if (DebugFlag & DB_DUMP_VARS) {
- ! DumpVarTable();
- ! DumpSysVarByName(NULL);
- ! }
- !
- ! if (!Hush) {
- ! if (DestroyOmitContexts())
- ! Eprint("%s", E_PUSH_NOPOP);
- #ifdef HAVE_QUEUED
- ! if (!Daemon && !NextMode && !NumTriggered && !NumQueued) printf("%s\n", ErrMsg[E_NOREMINDERS]);
- ! else
- ! if (!Daemon && !NextMode && !NumTriggered) printf(ErrMsg[M_QUEUED],
- ! NumQueued);
- #else
- ! if (!NextMode && !NumTriggered) printf("%s\n", ErrMsg[E_NOREMINDERS]);
- #endif
- ! }
-
- /* If it's MS-DOS or OS2, reset the file access date */
- #if defined(__MSDOS__) || defined(OS2)
- ! if (!UseStdin && (RealToday == JulianToday))
- ! SetAccessDate(InitialFile, RealToday);
- #endif
-
- /* If there are sorted reminders, handle them */
- ! if (SortByDate) IssueSortedReminders();
-
- /* If there are any background reminders queued up, handle them */
- #ifdef HAVE_QUEUED
- ! if (NumQueued || Daemon) {
-
- ! if (DontFork) {
- ! HandleQueuedReminders();
- ! return 0;
- ! } else {
- ! pid = fork();
- ! if (pid == 0) {
- ! HandleQueuedReminders();
- ! return 0;
- ! }
- ! if (pid == -1) {
- ! fprintf(ErrFp, "%s", ErrMsg[E_CANTFORK]);
- ! return 1;
- ! }
- ! }
- }
- #endif
- ! if (Iterations) {
- ! ClearGlobalOmits();
- ! DestroyOmitContexts();
- ! DestroyVars(0);
- ! NumTriggered = 0;
- ! JulianToday++;
- ! }
- ! }
- return 0;
- }
-
- ***************
- *** 213,219 ****
- case T_Else: r=DoElse(&p); break;
- case T_EndIf: r=DoEndif(&p); break;
- case T_Include: r=DoInclude(&p); break;
- ! case T_Exit: exit(99); break;
- case T_Set: r=DoSet(&p); break;
- case T_Fset: r=DoFset(&p); break;
- case T_UnSet: r=DoUnset(&p); break;
- --- 223,230 ----
- case T_Else: r=DoElse(&p); break;
- case T_EndIf: r=DoEndif(&p); break;
- case T_Include: r=DoInclude(&p); break;
- ! case T_Exit: DoExit(&p); break;
- ! case T_Flush: r=DoFlush(&p); break;
- case T_Set: r=DoSet(&p); break;
- case T_Fset: r=DoFset(&p); break;
- case T_UnSet: r=DoUnset(&p); break;
- ***************
- *** 239,246 ****
- r=DoRem(&p);
- break;
- }
- -
-
- /* If we don't recognize the command, do a REM by default */
- /* Note: Since the parser hasn't been used yet, we don't */
- /* need to destroy it here. */
- --- 250,257 ----
- r=DoRem(&p);
- break;
- }
-
- +
- /* If we don't recognize the command, do a REM by default */
- /* Note: Since the parser hasn't been used yet, we don't */
- /* need to destroy it here. */
- ***************
- *** 306,318 ****
- int y400 = (y2 / 400) - (y1 / 400); /* ... but do count multiples of 400 */
-
- int try_jul= 365 * (try_yr-BASE) + y4 - y100 + y400;
- !
- while (try_jul > jul) {
- try_yr--;
- try_jul -= DaysInYear(try_yr);
- }
- jul -= try_jul;
- !
- t = DaysInMonth(try_mon, try_yr);
- while (jul >= t) {
- jul -= t;
- --- 317,329 ----
- int y400 = (y2 / 400) - (y1 / 400); /* ... but do count multiples of 400 */
-
- int try_jul= 365 * (try_yr-BASE) + y4 - y100 + y400;
- !
- while (try_jul > jul) {
- try_yr--;
- try_jul -= DaysInYear(try_yr);
- }
- jul -= try_jul;
- !
- t = DaysInMonth(try_mon, try_yr);
- while (jul >= t) {
- jul -= t;
- ***************
- *** 436,442 ****
- {
- int c, err;
- int len = 0;
- !
- *out = 0;
-
- c = ParseChar(p, &err, 0);
- --- 447,453 ----
- {
- int c, err;
- int len = 0;
- !
- *out = 0;
-
- c = ParseChar(p, &err, 0);
- ***************
- *** 480,486 ****
- {
- int c, err;
- int len = 0;
- !
- *out = 0;
-
- c = ParseChar(p, &err, 0);
- --- 491,497 ----
- {
- int c, err;
- int len = 0;
- !
- *out = 0;
-
- c = ParseChar(p, &err, 0);
- ***************
- *** 566,572 ****
- #ifndef HAVE_STDARG
- char *fmt;
- #endif
- !
- /* Check if more than one error msg. from this line */
- if (!FreshLine && !ShowAllErrors) return;
-
- --- 577,583 ----
- #ifndef HAVE_STDARG
- char *fmt;
- #endif
- !
- /* Check if more than one error msg. from this line */
- if (!FreshLine && !ShowAllErrors) return;
-
- ***************
- *** 679,685 ****
- strcpy(TPushBuffer, tok);
- strcat(TPushBuffer, " "); /* Separate the pushed token from the next
- token */
- !
- }
-
- /***************************************************************/
- --- 690,696 ----
- strcpy(TPushBuffer, tok);
- strcat(TPushBuffer, " "); /* Separate the pushed token from the next
- token */
- !
- }
-
- /***************************************************************/
- ***************
- *** 779,785 ****
- if ( (r = EvaluateExpr(p, &v)) ) {
- syndrome = IF_TRUE | BEFORE_ELSE;
- Eprint("%s", ErrMsg[r]);
- ! } else
- if ( (v.type != STR_TYPE && v.v.val) ||
- (v.type == STR_TYPE && strcmp(v.v.str, "")) )
- syndrome = IF_TRUE | BEFORE_ELSE;
- --- 790,796 ----
- if ( (r = EvaluateExpr(p, &v)) ) {
- syndrome = IF_TRUE | BEFORE_ELSE;
- Eprint("%s", ErrMsg[r]);
- ! } else
- if ( (v.type != STR_TYPE && v.v.val) ||
- (v.type == STR_TYPE && strcmp(v.v.str, "")) )
- syndrome = IF_TRUE | BEFORE_ELSE;
- ***************
- *** 877,883 ****
- return OK;
- }
-
- !
- /***************************************************************/
- /* */
- /* ShouldIgnoreLine - given the current state of the IF */
- --- 888,894 ----
- return OK;
- }
-
- !
- /***************************************************************/
- /* */
- /* ShouldIgnoreLine - given the current state of the IF */
- ***************
- *** 943,949 ****
- {
- int err;
- int ch;
- ! int val=1;
-
- while(1) {
- ch = ParseChar(p, &err, 0);
- --- 954,960 ----
- {
- int err;
- int ch;
- ! int val=1;
-
- while(1) {
- ch = ParseChar(p, &err, 0);
- ***************
- *** 965,971 ****
- case '-':
- val = 0;
- break;
- !
- case 'e':
- case 'E':
- if (val) DebugFlag |= DB_ECHO_LINE;
- --- 976,982 ----
- case '-':
- val = 0;
- break;
- !
- case 'e':
- case 'E':
- if (val) DebugFlag |= DB_ECHO_LINE;
- ***************
- *** 1072,1077 ****
- --- 1083,1129 ----
-
- /***************************************************************/
- /* */
- + /* DoFlush */
- + /* */
- + /* Flush stdout and stderr */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC int DoFlush(ParsePtr p)
- + #else
- + int DoFlush(p)
- + ParsePtr p;
- + #endif
- + {
- + fflush(stdout);
- + fflush(stderr);
- + return VerifyEoln(p);
- + }
- +
- + /***************************************************************/
- + /* */
- + /* DoExit */
- + /* */
- + /* Handle the EXIT command. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC void DoExit(ParsePtr p)
- + #else
- + void DoExit(p)
- + ParsePtr p;
- + #endif
- + {
- + int r;
- + Value v;
- +
- + r = EvaluateExpr(p, &v);
- + if (r || v.type != INT_TYPE) exit(99);
- + exit(v.v.val);
- + }
- +
- + /***************************************************************/
- + /* */
- /* DoErrMsg */
- /* */
- /* Issue an error message under program control. */
- ***************
- *** 1091,1097 ****
-
- t.typ = MSG_TYPE;
- tt.ttime = SystemTime() / 60;
- ! if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) )
- return r;
- s = SubstBuffer;
- while (isspace(*s)) s++;
- --- 1143,1149 ----
-
- t.typ = MSG_TYPE;
- tt.ttime = SystemTime() / 60;
- ! if ( (r=DoSubst(p, SubstBuffer, &t, &tt, JulianToday, NORMAL_MODE)) )
- return r;
- s = SubstBuffer;
- while (isspace(*s)) s++;
- ***************
- *** 1112,1118 ****
- on the specified weekday. For example, FoldArray[0][2] is a
- non-leapyear beginning on Wednesday, and FoldArray[1][5] is a
- leapyear beginning on Saturday. Used to fold back dates which
- ! are too high for the standard Unix representation.
- NOTE: This implies that you cannot set BASE > 2001!!!!! */
- static int FoldArray[2][7] = {
- {2001, 2002, 2003, 2009, 2010, 2005, 2006},
- --- 1164,1170 ----
- on the specified weekday. For example, FoldArray[0][2] is a
- non-leapyear beginning on Wednesday, and FoldArray[1][5] is a
- leapyear beginning on Saturday. Used to fold back dates which
- ! are too high for the standard Unix representation.
- NOTE: This implies that you cannot set BASE > 2001!!!!! */
- static int FoldArray[2][7] = {
- {2001, 2002, 2003, 2009, 2010, 2005, 2006},
- ***************
- *** 1168,1174 ****
- (loc_t - utc_t) / 60 ); /* Should use difftime */
- #else
- if (mins) *mins = (int) ((utc_t - loc_t) / 60);
- ! #endif
- if (isdst) *isdst = temp->tm_isdst;
- return 0;
- }
- --- 1220,1226 ----
- (loc_t - utc_t) / 60 ); /* Should use difftime */
- #else
- if (mins) *mins = (int) ((utc_t - loc_t) / 60);
- ! #endif
- if (isdst) *isdst = temp->tm_isdst;
- return 0;
- }
- ***************
- *** 1180,1189 ****
- /* Write a string to standard output, formatting it as a */
- /* paragraph according to the FirstIndent, FormWidth and */
- /* SubsIndent variables. Spaces are gobbled. Double-spaces */
- ! /* are inserted after periods. As a special case, if the */
- ! /* last char in s is '\n', an extra newline is emitted. */
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- PUBLIC void FillParagraph(char *s)
- #else
- --- 1232,1245 ----
- /* Write a string to standard output, formatting it as a */
- /* paragraph according to the FirstIndent, FormWidth and */
- /* SubsIndent variables. Spaces are gobbled. Double-spaces */
- ! /* are inserted after '.', '?' and '!'. Newlines in the */
- ! /* source are treated as paragraph breaks. */
- /* */
- /***************************************************************/
- +
- + /* A macro safe ONLY if used with arg with no side effects! */
- + #define ISBLANK(c) (isspace(c) && (c) != '\n')
- +
- #ifdef HAVE_PROTOS
- PUBLIC void FillParagraph(char *s)
- #else
- ***************
- *** 1194,1199 ****
- --- 1250,1256 ----
-
- int line = 0;
- int i, j;
- + int doublespace = 1;
- int pendspace;
- int len;
- char *t;
- ***************
- *** 1203,1214 ****
- if (!s || !*s) return;
-
- /* Skip leading spaces */
- ! while(isspace(*s)) s++;
-
- /* Start formatting */
- while(1) {
- if (!*s) {
- ! if (*(s-1) == '\n') putchar('\n');
- return;
- }
- /* Over here, we're at the beginning of a line. Emit the correct
- --- 1260,1280 ----
- if (!s || !*s) return;
-
- /* Skip leading spaces */
- ! while(ISBLANK(*s)) s++;
-
- /* Start formatting */
- while(1) {
- +
- + /* If it's a carriage return, output it and start new paragraph */
- + if (*s == '\n') {
- + putchar('\n');
- + s++;
- + line = 0;
- + while(ISBLANK(*s)) s++;
- + continue;
- + }
- if (!*s) {
- ! putchar('\n');
- return;
- }
- /* Over here, we're at the beginning of a line. Emit the correct
- ***************
- *** 1222,1234 ****
-
- /* Emit words until the next one won't fit */
- while(1) {
- ! while(isspace(*s)) s++;
- t = s;
- while(*s && !isspace(*s)) s++;
- len = s - t;
- if (!len) {
- putchar('\n');
- - if (*(s-1) == '\n') putchar('\n');
- return;
- }
- if (!pendspace || len+pendspace <= roomleft) {
- --- 1288,1300 ----
-
- /* Emit words until the next one won't fit */
- while(1) {
- ! while(ISBLANK(*s)) s++;
- ! if (*s == '\n') break;
- t = s;
- while(*s && !isspace(*s)) s++;
- len = s - t;
- if (!len) {
- putchar('\n');
- return;
- }
- if (!pendspace || len+pendspace <= roomleft) {
- ***************
- *** 1235,1240 ****
- --- 1301,1308 ----
- for (i=0; i<pendspace; i++) putchar(' ');
- while(t < s) {
- putchar(*t);
- + if (strchr(EndSent, *t)) doublespace = 2;
- + else if (!strchr(EndSentIg, *t)) doublespace = 1;
- t++;
- }
- } else {
- ***************
- *** 1243,1250 ****
- line++;
- break;
- }
- ! pendspace = (*(t-1) == '.') ? 2 : 1;
- ! roomleft -= len+pendspace;
- }
- }
- }
- --- 1311,1318 ----
- line++;
- break;
- }
- ! roomleft -= len+doublespace;
- ! pendspace = doublespace;
- }
- }
- }
- ***************
- *** 1266,1272 ****
- long guess = time((long *) NULL);
- struct tm g;
- int diff;
- !
- g = *gmtime (&guess);
- while ((diff = year - g.tm_year) > 0)
- {
- --- 1334,1340 ----
- long guess = time((long *) NULL);
- struct tm g;
- int diff;
- !
- g = *gmtime (&guess);
- while ((diff = year - g.tm_year) > 0)
- {
- ***************
- *** 1323,1325 ****
- --- 1391,1458 ----
- return (clock);
- }
- #endif /* NEED_TIMEGM */
- +
- + /***************************************************************/
- + /* */
- + /* LocalToUTC */
- + /* */
- + /* Convert a local date/time to a UTC date/time. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC void LocalToUTC(int locdate, int loctime, int *utcdate, int *utctime)
- + #else
- + void LocalToUTC(locdate, loctime, utcdate, utctime)
- + int locdate, loctime, *utcdate, *utctime;
- + #endif
- + {
- + int diff;
- + int dummy;
- +
- + if (!CalculateUTC || !CalcMinsFromUTC(locdate, loctime, &diff, &dummy))
- + diff=MinsFromUTC;
- +
- + loctime -= MinsFromUTC;
- + if (loctime < 0) {
- + loctime += 1440;
- + locdate--;
- + } else if (loctime >= 1440) {
- + loctime -= 1440;
- + locdate++;
- + }
- + *utcdate = locdate;
- + *utctime = loctime;
- + }
- +
- + /***************************************************************/
- + /* */
- + /* UTCToLocal */
- + /* */
- + /* Convert a UTC date/time to a local date/time. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC void UTCToLocal(int utcdate, int utctime, int *locdate, int *loctime)
- + #else
- + void UTCToLocal(utcdate, utctime, locdate, loctime)
- + int utcdate, utctime, *locdate, *loctime;
- + #endif
- + {
- + int diff;
- + int dummy;
- +
- + /* Hack -- not quite right when DST changes. */
- + if (!CalculateUTC || !CalcMinsFromUTC(utcdate, utctime, &diff, &dummy))
- + diff=MinsFromUTC;
- +
- + utctime += MinsFromUTC;
- + if (utctime < 0) {
- + utctime += 1440;
- + utcdate--;
- + } else if (utctime >= 1440) {
- + utctime -= 1440;
- + utcdate++;
- + }
- + *locdate = utcdate;
- + *loctime = utctime;
- + }
- *** ../prev/makefile.msc Mon Jun 28 12:30:11 1993
- --- ./makefile.msc Thu Sep 30 15:50:35 1993
- ***************
- *** 2,12 ****
-
- OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
- globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
- ! utils.obj var.obj sort.obj hbcal.obj
-
- DEFINES= /D__MSDOS__ /D__MSC__
-
- ! MODEL= /AS
-
- calendar.obj: calendar.c
- cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
- --- 2,12 ----
-
- OBJS= calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
- globals.obj init.obj main.obj omit.obj token.obj trigger.obj userfns.obj \
- ! utils.obj var.obj sort.obj hbcal.obj moon.obj
-
- DEFINES= /D__MSDOS__ /D__MSC__
-
- ! MODEL= /AM
-
- calendar.obj: calendar.c
- cl /c $(DEFINES) $(MODEL) /Focalendar.obj calendar.c
- ***************
- *** 40,45 ****
- --- 40,48 ----
-
- main.obj: main.c
- cl /c $(DEFINES) $(MODEL) /Fomain.obj main.c
- +
- + moon.obj: moon.c
- + cl /c $(DEFINES) $(MODEL) /Fomoon.obj moon.c
-
- omit.obj: omit.c
- cl /c $(DEFINES) $(MODEL) /Foomit.obj omit.c
- *** ../prev/makefile.os2 Wed Aug 18 11:13:19 1993
- --- ./makefile.os2 Mon Sep 20 15:00:08 1993
- ***************
- *** 25,31 ****
- # YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
- # in config.h; then, you should be able to type 'make'.
- #-----------------------------------------------------------------------------
- ! VERSION= 03.00.08
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- lang.h english.h german.h dutch.h finish.h french.h norwgian.h
- --- 25,31 ----
- # YOU SHOULDN'T EDIT ANYTHING BELOW HERE. You may want to change some things
- # in config.h; then, you should be able to type 'make'.
- #-----------------------------------------------------------------------------
- ! VERSION= 03.00.09
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- lang.h english.h german.h dutch.h finish.h french.h norwgian.h
- ***************
- *** 35,41 ****
- LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
-
- SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
- ! main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
-
- MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
- remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- --- 35,41 ----
- LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
-
- SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
- ! main.c moon.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
-
- MANIFEST= README.UNIX README.DOS COPYRIGHT $(HDRS) $(SRCS) Makefile rem rem.1 \
- remind.1 remind-all.csh remind-all.sh test.rem test-rem test.cmp makefile.tc \
- ***************
- *** 77,82 ****
- --- 77,83 ----
- globals$O: globals.c config.h types.h globals.h err.h lang.h
- init$O: init.c $(STDHDRS) expr.h version.h
- main$O: main.c $(STDHDRS) expr.h
- + moon$O: moon.c $(STDHDRS)
- omit$O: omit.c $(STDHDRS)
- sort$O: sort.c $(STDHDRS)
- token$O: token.c $(STDHDRS)
- *** ../prev/makefile.tc Wed Aug 18 11:13:06 1993
- --- ./makefile.tc Thu Sep 30 15:50:25 1993
- ***************
- *** 1,6 ****
- # Makefile for REMIND for Turbo C for MSDOS
-
- ! VERSION= 03.00.08
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
- --- 1,6 ----
- # Makefile for REMIND for Turbo C for MSDOS
-
- ! VERSION= 03.00.09
-
- HDRS= config.h err.h expr.h globals.h protos.h types.h version.h \
- lang.h english.h german.h dutch.h finnish.h french.h norwgian.h
- ***************
- *** 10,16 ****
- LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
-
- SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
- ! main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
-
- OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
- globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
- --- 10,16 ----
- LANGHDRS= english.h german.h dutch.h finnish.h french.h norwgian.h
-
- SRCS= calendar.c dorem.c dosubst.c expr.c files.c funcs.c globals.c init.c \
- ! moon.c main.c omit.c sort.c token.c trigger.c userfns.c utils.c var.c hbcal.c
-
- OBJS=calendar.obj dorem.obj dosubst.obj expr.obj files.obj funcs.obj \
- globals.obj init.obj main.obj omit.obj sort.obj token.obj trigger.obj \
- ***************
- *** 31,37 ****
- tcc -erem2ps.exe rem2ps.obj
-
- .c.obj:
- ! tcc -A -w-pia -c -O -ms {$< }
-
- rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
-
- --- 31,37 ----
- tcc -erem2ps.exe rem2ps.obj
-
- .c.obj:
- ! tcc -A -w-pia -c -O -mm {$< }
-
- rem2ps.obj: rem2ps.c rem2ps.h config.h lang.h
-
- ***************
- *** 52,57 ****
- --- 52,59 ----
- init.obj: init.c $(STDHDRS) expr.h version.h
-
- main.obj: main.c $(STDHDRS) expr.h
- +
- + moon.obj: moon.c $(STDHDRS) expr.h
-
- omit.obj: omit.c $(STDHDRS)
-
- *** ../prev/protos.h Wed Aug 18 12:52:08 1993
- --- ./protos.h Mon Sep 20 16:53:13 1993
- ***************
- *** 29,34 ****
- --- 29,36 ----
- void ProduceCalendar ARGS ((void));
- char *SimpleTime ARGS ((int tim, char *out));
- int DoRem ARGS ((ParsePtr p));
- + int DoFlush ARGS ((ParsePtr p));
- + void DoExit ARGS ((ParsePtr p));
- int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim));
- int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul));
- int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul));
- ***************
- *** 103,109 ****
- int DoUnset ARGS ((Parser *p));
- int DoDump ARGS ((ParsePtr p));
- void DumpVarTable ARGS ((void));
- ! void DestroyVars ARGS ((void));
- int PreserveVar ARGS ((char *name));
- int DoPreserve ARGS ((Parser *p));
- int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
- --- 105,111 ----
- int DoUnset ARGS ((Parser *p));
- int DoDump ARGS ((ParsePtr p));
- void DumpVarTable ARGS ((void));
- ! void DestroyVars ARGS ((int all));
- int PreserveVar ARGS ((char *name));
- int DoPreserve ARGS ((Parser *p));
- int DoSatRemind ARGS ((Trigger *trig, TimeTrig *tim, ParsePtr p));
- ***************
- *** 126,132 ****
- int GetNextHebrewDate ARGS((int julstart, int hm, int hd, int yahr, int adarbehave, int *ans));
- int ComputeJahr ARGS ((int y, int m, int d, int *ans));
- int GetSysVar ARGS ((const char *name, Value *val));
- ! int SetSysVar ARGS ((const char *name, int value));
- void DumpSysVarByName ARGS ((const char *name));
- int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
- void FillParagraph ARGS ((char *s));
- --- 128,138 ----
- int GetNextHebrewDate ARGS((int julstart, int hm, int hd, int yahr, int adarbehave, int *ans));
- int ComputeJahr ARGS ((int y, int m, int d, int *ans));
- int GetSysVar ARGS ((const char *name, Value *val));
- ! int SetSysVar ARGS ((const char *name, Value *val));
- void DumpSysVarByName ARGS ((const char *name));
- int CalcMinsFromUTC ARGS ((int jul, int tim, int *mins, int *isdst));
- void FillParagraph ARGS ((char *s));
- + void LocalToUTC ARGS ((int locdate, int loctime, int *utcdate, int *utctime));
- + void UTCToLocal ARGS ((int utcdate, int utctime, int *locdate, int *loctime));
- + int MoonPhase ARGS ((int date, int time));
- + void HuntPhase ARGS ((int startdate, int starttim, int phas, int *date, int *time));
- *** ../prev/rem2ps.1 Wed Jul 28 10:22:25 1993
- --- ./rem2ps.1 Thu Sep 30 15:23:25 1993
- ***************
- *** 1,4 ****
- ! .TH REM2PS 1 "8 January 1993"
- .UC4
- .SH NAME
- rem2ps \- draw a PostScript calendar from Remind output
- --- 1,4 ----
- ! .TH REM2PS 1 "30 September 1993"
- .UC4
- .SH NAME
- rem2ps \- draw a PostScript calendar from Remind output
- ***************
- *** 10,15 ****
- --- 10,18 ----
- draws a calendar) to the standard output.
- .SH OPTIONS
- .TP
- + .B \-n
- + Produce a calendar whose first column is Monday (rather than Sunday.)
- + .TP
- .B \-p file
- Include the contents of \fIfile\fR in the PostScript prologue. This
- allows you to define procedures, variables etc. which can be used
- ***************
- *** 20,30 ****
- Produce the calendar in landscape mode rather than the default
- portrait mode.
- .TP
- ! .B \-c
- ! Do not generate small calendars for the next and previous months. By
- ! default, these small calendars are generated and placed on the main
- ! calendar.
- .TP
- .B \-i
- Use ISO 8859-1 standard encoding for the PostScript fonts. If you do
- not use this option, the default encoding is used.
- --- 23,53 ----
- Produce the calendar in landscape mode rather than the default
- portrait mode.
- .TP
- ! \fB\-c\fR[\fIn\fR]
- ! If \fIn\fR is omitted, disables the small calendars for next and previous
- ! months which are normally generated. If \fIn\fR is supplied, it can range
- ! from 0 to 3, with the following meanings:
- ! .RS
- .TP
- + .B 0
- + Disable small calendars
- + .TP
- + .B 1
- + Place the small calendars at the bottom-right if there is room; otherwise,
- + place them at the top-left.
- + .TP
- + .B 2
- + Place the small calendars at the top-left if there is room; otherwise,
- + place them at the bottom-right.
- + .TP
- + .B 3
- + Place the previous month's small calendar at the top-left and the next
- + month's at the bottom-right if there is room; otherwise, follow \fIn\fR=1.
- + A moment's thought reveals that an option which splits the calendars if
- + there is room and otherwise follows \fIn\fR=2 yields the same results as
- + \fIn\fR=3.
- + .RE
- + .TP
- .B \-i
- Use ISO 8859-1 standard encoding for the PostScript fonts. If you do
- not use this option, the default encoding is used.
- ***************
- *** 90,97 ****
- option will display the compiled-in default.
- .RE
- .TP
- ! \fB\-f\fR[\fBshed\fR] \fIfont\fR
- ! Set the font for the small calendar, the calendar headings, the calendar
- entries, and the day numbers, respectively. \fIFont\fR must be the
- name of a valid PostScript font. The default fonts are equivalent to
- specifying:
- --- 113,121 ----
- option will display the compiled-in default.
- .RE
- .TP
- ! \fB\-f\fR[\fBtshed\fR] \fIfont\fR
- ! Set the font for the calendar title,
- ! the small calendars, the day-of-week headings, the calendar
- entries, and the day numbers, respectively. \fIFont\fR must be the
- name of a valid PostScript font. The default fonts are equivalent to
- specifying:
- ***************
- *** 98,104 ****
- .RS
- .PP
- .nf
- ! -fhes Helvetica -fd Helvetica-BoldOblique
- .fi
- .PP
- In other words, the heading, entry and small-calendar fonts are set
- --- 122,128 ----
- .RS
- .PP
- .nf
- ! -ftshe Helvetica -fd Helvetica-BoldOblique
- .fi
- .PP
- In other words, the heading, entry and small-calendar fonts are set
- ***************
- *** 106,120 ****
- Helvetica-BoldOblique.
- .RE
- .TP
- ! \fB\-s\fR[\fBhed\fR] \fIsize\fR
- ! Set the size (in points) of the text for the the calendar headings,
- ! the calendar entries, and the day numbers, respectively. \fISize\fR
- ! must be a decimal number. The default sizes are equivalent to
- ! specifying:
- .RS
- .PP
- .nf
- ! -sdh 14 -se 8
- .fi
- .PP
- In other words, the heading and day numbers are 14-point fonts, and the
- --- 130,144 ----
- Helvetica-BoldOblique.
- .RE
- .TP
- ! \fB\-s\fR[\fBthed\fR] \fIsize\fR
- ! Set the size (in points) of the text for the the calendar title,
- ! day-of-week headings, the calendar entries, and the day numbers,
- ! respectively. \fISize\fR must be a decimal number. The default sizes
- ! are equivalent to specifying:
- .RS
- .PP
- .nf
- ! -sthd 14 -se 8
- .fi
- .PP
- In other words, the heading and day numbers are 14-point fonts, and the
- ***************
- *** 185,195 ****
- of the regular calendar entry area. The space from here to the top
- of the box is used only to draw the day number.
- .TP
- ! /DayFont, /EntryFont, /SmallFont and /HeadFont
- ! The fonts used to draw the day numbers, the calendar entries, the small
- ! calendars, and the month and day headings, respectively.
- .TP
- ! DaySize, EntrySize and HeadSize
- The sizes of the above fonts. (The size of the small calendar font
- is \fInot\fR defined here.) For example, if you wanted to print
- the Hebrew date next to the regular day number in the calendar, use:
- --- 209,220 ----
- of the regular calendar entry area. The space from here to the top
- of the box is used only to draw the day number.
- .TP
- ! /DayFont, /TitleFont, /EntryFont, /SmallFont and /HeadFont
- ! The fonts used to draw the day numbers, the month and year title,
- ! the calendar entries, the small
- ! calendars, and the day-of-week headings, respectively.
- .TP
- ! DaySize, TitleSize, EntrySize and HeadSize
- The sizes of the above fonts. (The size of the small calendar font
- is \fInot\fR defined here.) For example, if you wanted to print
- the Hebrew date next to the regular day number in the calendar, use:
- *** ../prev/rem2ps.c Wed Jul 28 10:15:11 1993
- --- ./rem2ps.c Tue Sep 28 12:33:59 1993
- ***************
- *** 43,48 ****
- --- 43,59 ----
-
- char Days[]=L_DAYINIT;
-
- + char *SmallCalLoc[] = {
- + "",
- + "bt",
- + "tb",
- + "sbt",
- + };
- +
- + #define NUMSMALL (sizeof(SmallCalLoc)/sizeof(SmallCalLoc[0]))
- + char *SmallLocation;
- + int SmallCol1, SmallCol2;
- +
- PageType Pages[] =
- {
- {"Letter", 612, 792}, /* 8.5 x 11 in. */
- ***************
- *** 78,83 ****
- --- 89,95 ----
- char LineBuffer[LINELEN];
-
- char *HeadFont="Helvetica";
- + char *TitleFont="Helvetica";
- char *DayFont="Helvetica-BoldOblique";
- char *EntryFont="Helvetica";
- char *SmallFont="Helvetica";
- ***************
- *** 84,89 ****
- --- 96,102 ----
- char *LineWidth = "1";
-
- char *HeadSize="14";
- + char *TitleSize="14";
- char *DaySize="14";
- char *EntrySize="8";
- char *BorderSize = "6";
- ***************
- *** 96,102 ****
- int MaxDay;
- int DayNum;
- int WkDayNum;
- !
- int LeftMarg, RightMarg, TopMarg, BotMarg;
- int FillPage;
-
- --- 109,116 ----
- int MaxDay;
- int DayNum;
- int WkDayNum;
- ! int FirstWkDay;
- ! int MondayFirst;
- int LeftMarg, RightMarg, TopMarg, BotMarg;
- int FillPage;
-
- ***************
- *** 104,113 ****
- void Usage ARGS ((char *s));
- void DoPsCal ARGS ((void));
- int DoQueuedPs ARGS ((void));
- ! void DoSmallCal ARGS((char *m, int days, int first, int col));
- void WriteProlog ARGS ((void));
- void WriteCalEntry ARGS ((void));
- void WriteOneEntry ARGS ((char *s));
-
- /***************************************************************/
- /* */
- --- 118,128 ----
- void Usage ARGS ((char *s));
- void DoPsCal ARGS ((void));
- int DoQueuedPs ARGS ((void));
- ! void DoSmallCal ARGS((char *m, int days, int first, int col, int which));
- void WriteProlog ARGS ((void));
- void WriteCalEntry ARGS ((void));
- void WriteOneEntry ARGS ((char *s));
- + void GetSmallLocations ARGS ((void));
-
- /***************************************************************/
- /* */
- ***************
- *** 165,177 ****
- int days, wkday, prevdays, nextdays;
- int sfirst;
- int i;
- - int smallcol = 0; /* Stop GCC from complaining about uninit var */
- int is_ps;
- CalEntry *c, *d;
-
- printf("%%%%Page: %d %d\n", validfile, validfile);
- /* Read the month and year name, followed by # days in month and 1st day of
- ! month */
- gets(LineBuffer);
- sscanf(LineBuffer, "%s %s %d %d", month, year, &days, &wkday);
- gets(LineBuffer);
- --- 180,191 ----
- int days, wkday, prevdays, nextdays;
- int sfirst;
- int i;
- int is_ps;
- CalEntry *c, *d;
-
- printf("%%%%Page: %d %d\n", validfile, validfile);
- /* Read the month and year name, followed by # days in month and 1st day of
- ! month, followed by the MondayFirst flag */
- gets(LineBuffer);
- sscanf(LineBuffer, "%s %s %d %d", month, year, &days, &wkday);
- gets(LineBuffer);
- ***************
- *** 179,184 ****
- --- 193,199 ----
- gets(LineBuffer);
- sscanf(LineBuffer, "%s %d", nextm, &nextdays);
- MaxDay = days;
- + FirstWkDay = wkday;
-
- /* Emit PostScript to do the heading */
- if (!PortraitMode) printf("XSIZE 0 translate 90 rotate\n");
- ***************
- *** 197,207 ****
- printf("/MinBoxSize ytop MinY sub 5 div def\n");
- }
-
- ! /* If wkday >= 2, then do the small calendars at the top. */
- ! if (wkday >=2 && !NoSmallCal) {
- ! smallcol = 0;
- ! printf("/ysmall ytop def\n");
- ! }
-
- /* Do each entry */
-
- --- 212,218 ----
- printf("/MinBoxSize ytop MinY sub 5 div def\n");
- }
-
- ! printf("/ysmalltop ytop def\n");
-
- /* Do each entry */
-
- ***************
- *** 262,278 ****
- }
-
- /* If wkday < 2, set ysmall. If necessary (only for feb) increase cal size. */
- ! if (wkday < 2 && !NoSmallCal) {
- ! smallcol = 5;
- ! printf("/ysmall ylast def\n");
- ! if (days == 28 && wkday == 0) {
- ! printf("/ysmall ymin def /ymin ysmall MinBoxSize sub def\n");
- ! printf("MinX ymin MaxX ymin L\n");
- ! }
- ! }
- !
-
- /* Now draw the vertical lines */
- for (i=0; i<=7; i++) {
- printf("%d xincr mul MinX add ymin %d xincr mul MinX add topy L\n",
- i, i);
- --- 273,282 ----
- }
-
- /* If wkday < 2, set ysmall. If necessary (only for feb) increase cal size. */
- ! printf("/ysmallbot ylast def\n");
-
- /* Now draw the vertical lines */
- + GetSmallLocations();
- for (i=0; i<=7; i++) {
- printf("%d xincr mul MinX add ymin %d xincr mul MinX add topy L\n",
- i, i);
- ***************
- *** 282,291 ****
- if (!NoSmallCal) {
- sfirst = wkday - (prevdays % 7);
- if (sfirst < 0) sfirst += 7;
- ! DoSmallCal(prevm, prevdays, sfirst, smallcol);
- sfirst = wkday + (days % 7);
- if (sfirst >6) sfirst -= 7;
- ! DoSmallCal(nextm, nextdays, sfirst, smallcol+1);
- }
- /* Do it! */
- printf("showpage\n");
- --- 286,295 ----
- if (!NoSmallCal) {
- sfirst = wkday - (prevdays % 7);
- if (sfirst < 0) sfirst += 7;
- ! DoSmallCal(prevm, prevdays, sfirst, SmallCol1, 1);
- sfirst = wkday + (days % 7);
- if (sfirst >6) sfirst -= 7;
- ! DoSmallCal(nextm, nextdays, sfirst, SmallCol2, 2);
- }
- /* Do it! */
- printf("showpage\n");
- ***************
- *** 322,332 ****
- /* Write the document structuring stuff */
- printf("%%!PS-Adobe-\n");
- printf("%%%%DocumentFonts: %s", HeadFont);
- ! if (strcmp(HeadFont, DayFont)) printf(" %s", DayFont);
- if (strcmp(EntryFont, HeadFont) &&
- strcmp(EntryFont, DayFont)) printf(" %s", EntryFont);
- if (!NoSmallCal && strcmp(SmallFont, HeadFont) &&
-