home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-10-04 | 41.1 KB | 1,205 lines |
- strcmp(SmallFont, DayFont) &&
- strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
- putchar('\n');
- printf("%%%%Creator: Rem2PS\n");
- --- 326,340 ----
- /* Write the document structuring stuff */
- printf("%%!PS-Adobe-\n");
- printf("%%%%DocumentFonts: %s", HeadFont);
- ! if (strcmp(TitleFont, HeadFont)) printf(" %s", TitleFont);
- ! if (strcmp(TitleFont, DayFont) &&
- ! strcmp(HeadFont, DayFont)) printf(" %s", DayFont);
- if (strcmp(EntryFont, HeadFont) &&
- + strcmp(TitleFont, EntryFont) &&
- strcmp(EntryFont, DayFont)) printf(" %s", EntryFont);
- if (!NoSmallCal && strcmp(SmallFont, HeadFont) &&
- strcmp(SmallFont, DayFont) &&
- + strcmp(TitleFont, SmallFont) &&
- strcmp(SmallFont, EntryFont)) printf(" %s", SmallFont);
- putchar('\n');
- printf("%%%%Creator: Rem2PS\n");
- ***************
- *** 335,343 ****
- printf("%%%%EndComments\n");
-
- for (i=0; PSProlog1[i]; i++) puts(PSProlog1[i]);
- ! printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n",
- ! L_SUNDAY, L_MONDAY, L_TUESDAY, L_WEDNESDAY,
- ! L_THURSDAY, L_FRIDAY, L_SATURDAY);
- for (i=0; PSProlog2[i]; i++) puts(PSProlog2[i]);
-
- printf("/HeadFont /%s %s\n", HeadFont, isostuff);
- --- 343,356 ----
- printf("%%%%EndComments\n");
-
- for (i=0; PSProlog1[i]; i++) puts(PSProlog1[i]);
- ! if (!MondayFirst)
- ! printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n",
- ! L_SUNDAY, L_MONDAY, L_TUESDAY, L_WEDNESDAY,
- ! L_THURSDAY, L_FRIDAY, L_SATURDAY);
- ! else
- ! printf("[(%s) (%s) (%s) (%s) (%s) (%s) (%s)]\n",
- ! L_MONDAY, L_TUESDAY, L_WEDNESDAY,
- ! L_THURSDAY, L_FRIDAY, L_SATURDAY, L_SUNDAY);
- for (i=0; PSProlog2[i]; i++) puts(PSProlog2[i]);
-
- printf("/HeadFont /%s %s\n", HeadFont, isostuff);
- ***************
- *** 344,352 ****
- --- 357,367 ----
- if (!NoSmallCal) printf("/SmallFont /%s %s\n", SmallFont, isostuff);
- printf("/DayFont /%s %s\n", DayFont, isostuff);
- printf("/EntryFont /%s %s\n", EntryFont, isostuff);
- + printf("/TitleFont /%s %s\n", TitleFont, isostuff);
- printf("/HeadSize %s def\n", HeadSize);
- printf("/DaySize %s def\n", DaySize);
- printf("/EntrySize %s def\n", EntrySize);
- + printf("/TitleSize %s def\n", TitleSize);
- printf("/XSIZE %d def\n", CurPage->xsize);
- printf("/MinX %d def\n", LeftMarg);
- printf("/MinY %d def\n", BotMarg);
- ***************
- *** 402,408 ****
-
- /* Move to appropriate location */
- printf("/CAL%d {\n", CurDay);
- ! printf("Border ytop %d xincr mul MinX add xincr\n", WkDayNum);
-
- /* Set up the text array */
- printf("[\n");
- --- 417,426 ----
-
- /* Move to appropriate location */
- printf("/CAL%d {\n", CurDay);
- ! if (!MondayFirst)
- ! printf("Border ytop %d xincr mul MinX add xincr\n", WkDayNum);
- ! else
- ! printf("Border ytop %d xincr mul MinX add xincr\n", (WkDayNum ? WkDayNum-1 : 6));
-
- /* Set up the text array */
- printf("[\n");
- ***************
- *** 427,437 ****
- printf("/y exch def y ymin lt {/ymin y def} if\n");
- printf("} def\n");
-
- ! /* If WkDayNum is a Sunday, move to next row. Also handle the queued
- ! PS and PSFILE reminders */
- ! if (WkDayNum == 6 || CurDay == MaxDay) {
- HadQPS = 0;
- ! begin = CurDay - WkDayNum;
- if (begin < 1) begin = 1;
- end = CurDay;
- for (i=begin; i<=end; i++) {
- --- 445,457 ----
- printf("/y exch def y ymin lt {/ymin y def} if\n");
- printf("} def\n");
-
- ! /* If WkDayNum is a Sunday or Monday, depending on MondayFirst,
- ! move to next row. Also handle the queued PS and PSFILE reminders */
- ! if ((!MondayFirst && WkDayNum == 6) ||
- ! (MondayFirst && WkDayNum == 0) || CurDay == MaxDay) {
- HadQPS = 0;
- ! if (MondayFirst) begin = CurDay - (WkDayNum ? WkDayNum-1 : 6);
- ! else begin = CurDay - WkDayNum;
- if (begin < 1) begin = 1;
- end = CurDay;
- for (i=begin; i<=end; i++) {
- ***************
- *** 533,538 ****
- --- 553,560 ----
- BotMarg = 36;
- UseISO = 0;
- FillPage = 0;
- + MondayFirst = 0;
- + SmallLocation = "bt";
-
- for(j=0; j<32; j++) PsEntries[i] = NULL;
-
- ***************
- *** 545,550 ****
- --- 567,577 ----
- if (*s++ != '-') Usage("Options must begin with '-'");
-
- switch(*s++) {
- +
- + case 'n':
- + MondayFirst = 1;
- + break;
- +
- case 'p':
- if (i == argc) Usage("Prologue filename must be supplied");
- UserProlog = argv[i++];
- ***************
- *** 558,564 ****
- case 'h': HeadSize = t; break;
- case 'e': EntrySize = t; break;
- case 'd': DaySize = t; break;
- ! default: Usage("Size must specify h, e, or d");
- }
- }
- break;
- --- 585,592 ----
- case 'h': HeadSize = t; break;
- case 'e': EntrySize = t; break;
- case 'd': DaySize = t; break;
- ! case 't': TitleSize = t; break;
- ! default: Usage("Size must specify h, t, e, or d");
- }
- }
- break;
- ***************
- *** 572,578 ****
- case 'e': EntryFont = t; break;
- case 'd': DayFont = t; break;
- case 's': SmallFont = t; break;
- ! default: Usage("Font must specify s, h, e, or d");
- }
- }
- break;
- --- 600,607 ----
- case 'e': EntryFont = t; break;
- case 'd': DayFont = t; break;
- case 's': SmallFont = t; break;
- ! case 't': TitleFont = t; break;
- ! default: Usage("Font must specify s, h, t, e, or d");
- }
- }
- break;
- ***************
- *** 627,633 ****
-
- case 'i': UseISO = 1; break;
-
- ! case 'c': NoSmallCal = 1; break;
-
- case 'e': FillPage = 1; break;
-
- --- 656,673 ----
-
- case 'i': UseISO = 1; break;
-
- ! case 'c': j=(*s);
- ! if (!j) {
- ! SmallLocation = SmallCalLoc[0];
- ! } else {
- ! j -= '0';
- ! if (j>=0 && j<NUMSMALL) {
- ! SmallLocation = SmallCalLoc[j];
- ! } else {
- ! SmallLocation = SmallCalLoc[0];
- ! }
- ! }
- ! break;
-
- case 'e': FillPage = 1; break;
-
- ***************
- *** 655,671 ****
- fprintf(stderr, "Options:\n\n");
- fprintf(stderr, "-p file Include user-supplied PostScript code in prologue\n");
- fprintf(stderr, "-l Do calendar in landscape mode\n");
- ! fprintf(stderr, "-c Do NOT generate small calendars for previous\n");
- fprintf(stderr, " and next month\n");
- fprintf(stderr, "-i Use ISO 8859-1 encoding in PostScript output\n");
- fprintf(stderr, "-m media Set page size (eg, Letter, Legal, A4.) Case sensitive!\n");
- fprintf(stderr, " (Default page size is %s)\n", DefaultPage[0].name);
- ! fprintf(stderr, "-f[shed] font Set font for small cal, hdr, cal entries and/or day numbers\n");
- ! fprintf(stderr, "-s[hed] size Set size for header, calendar entries and/or day numbers\n");
- fprintf(stderr, "-b size Set border size for calendar entries\n");
- fprintf(stderr, "-t size Set line thickness\n");
- fprintf(stderr, "-e Make calendar fill entire page\n");
- fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
- exit(1);
- }
-
- --- 695,712 ----
- fprintf(stderr, "Options:\n\n");
- fprintf(stderr, "-p file Include user-supplied PostScript code in prologue\n");
- fprintf(stderr, "-l Do calendar in landscape mode\n");
- ! fprintf(stderr, "-c[n] Control small calendars: 0=none; 1=bt; 2=tb; 3=sbt\n");
- fprintf(stderr, " and next month\n");
- fprintf(stderr, "-i Use ISO 8859-1 encoding in PostScript output\n");
- fprintf(stderr, "-m media Set page size (eg, Letter, Legal, A4.) Case sensitive!\n");
- fprintf(stderr, " (Default page size is %s)\n", DefaultPage[0].name);
- ! fprintf(stderr, "-f[shted] font Set font for small cal, hdr, title, cal entries, day numbers\n");
- ! fprintf(stderr, "-s[hted] size Set size for header, title, calendar entries and/or day numbers\n");
- fprintf(stderr, "-b size Set border size for calendar entries\n");
- fprintf(stderr, "-t size Set line thickness\n");
- fprintf(stderr, "-e Make calendar fill entire page\n");
- fprintf(stderr, "-o[lrtb] marg Specify left, right, top and bottom margins\n");
- + fprintf(stderr, "-n Start calendar with Monday rather than Sunday\n");
- exit(1);
- }
-
- ***************
- *** 676,692 ****
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! void DoSmallCal(char *m, int days, int first, int col)
- #else
- ! void DoSmallCal(m, days, first, col)
- char *m;
- int days, first, col;
- #endif
- {
- /* Do the small calendar */
- ! int i;
- int row = 2;
-
- /* Figure out the font size */
-
- printf("/SmallFontSize MinBoxSize Border sub Border sub 8 div 2 sub def\n");
- --- 717,737 ----
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! void DoSmallCal(char *m, int days, int first, int col, int which)
- #else
- ! void DoSmallCal(m, days, first, col, which)
- char *m;
- int days, first, col;
- #endif
- {
- /* Do the small calendar */
- ! int i, j;
- int row = 2;
-
- + if (MondayFirst) {
- + first--;
- + if (first < 0) first = 6;
- + }
- /* Figure out the font size */
-
- printf("/SmallFontSize MinBoxSize Border sub Border sub 8 div 2 sub def\n");
- ***************
- *** 703,716 ****
- printf("gsave\n");
-
- /* Move origin to upper-left hand corner of appropriate box */
- ! printf("%d xincr mul MinX add ysmall translate\n", col);
-
- /* Print the month */
- printf("SmallWidth 7 mul (%s) stringwidth pop sub 2 div Border add Border neg SmallFontSize sub moveto (%s) show\n", m, m);
-
- /* Print the days of the week */
- ! for (i=0; i<7; i++)
- ! printf("Border %d SmallWidth mul add Border neg SmallFontSize sub SmallFontSize sub 2 sub moveto (%c) show\n", i, Days[i]);
-
- /* Now do the days of the month */
- for (i=1; i<=days; i++) {
- --- 748,764 ----
- printf("gsave\n");
-
- /* Move origin to upper-left hand corner of appropriate box */
- ! printf("%d xincr mul MinX add ysmall%d translate\n", col, which);
-
- /* Print the month */
- printf("SmallWidth 7 mul (%s) stringwidth pop sub 2 div Border add Border neg SmallFontSize sub moveto (%s) show\n", m, m);
-
- /* Print the days of the week */
- ! for (i=0; i<7; i++) {
- ! if (MondayFirst) j=(i+1)%7;
- ! else j=i;
- ! printf("Border %d SmallWidth mul add Border neg SmallFontSize sub SmallFontSize sub 2 sub moveto (%c) show\n", i, Days[j]);
- ! }
-
- /* Now do the days of the month */
- for (i=1; i<=days; i++) {
- ***************
- *** 744,750 ****
- int fnoff;
- char buffer[LINELEN];
-
- ! begin = CurDay - WkDayNum;
- wd = 0;
- while (begin < 1) begin++, wd++;
- end = CurDay;
- --- 792,799 ----
- int fnoff;
- char buffer[LINELEN];
-
- ! if (!MondayFirst) begin = CurDay - WkDayNum;
- ! else begin = CurDay - (WkDayNum ? WkDayNum-1 : 6);
- wd = 0;
- while (begin < 1) begin++, wd++;
- end = CurDay;
- ***************
- *** 795,797 ****
- --- 844,916 ----
- }
- return HadPS;
- }
- +
- + /***************************************************************/
- + /* */
- + /* GetSmallLocations */
- + /* */
- + /* Set up the locations for the small calendars. */
- + /* */
- + /***************************************************************/
- + #ifdef HAVE_PROTOS
- + PUBLIC void GetSmallLocations(void)
- + #else
- + void GetSmallLocations()
- + #endif
- + {
- + char c;
- + char *s = SmallLocation;
- + int colfirst, collast;
- +
- + /* Figure out the first and last columns */
- + colfirst = FirstWkDay;
- + collast = (FirstWkDay+MaxDay-1) % 7;
- + if (MondayFirst) {
- + colfirst = colfirst ? colfirst - 1 : 6;
- + collast = collast ? collast - 1 : 6;
- + }
- + NoSmallCal = 0;
- +
- + while((c = *s++) != 0) {
- + switch(c) {
- + case 'b':
- + /* Adjust Feb. if we want it on the bottom */
- + if (MaxDay == 28 && colfirst == 0) {
- + printf("/ysmallbot ymin def /ymin ysmallbot MinBoxSize sub def\n");
- + printf("MinX ymin MaxX ymin L\n");
- + printf("/ysmall1 ysmallbot def /ysmall2 ysmallbot def\n");
- + SmallCol1 = 5;
- + SmallCol2 = 6;
- + return;
- + }
- + if (collast <= 4) {
- + printf("/ysmall1 ysmallbot def /ysmall2 ysmallbot def\n");
- + SmallCol1 = 5;
- + SmallCol2 = 6;
- + return;
- + }
- + break;
- +
- + case 't':
- + if (colfirst >= 2) {
- + printf("/ysmall1 ysmalltop def /ysmall2 ysmalltop def\n");
- + SmallCol1 = 0;
- + SmallCol2 = 1;
- + return;
- + }
- + break;
- +
- + case 's':
- + if (colfirst >= 1 && collast<=5) {
- + printf("/ysmall1 ysmalltop def /ysmall2 ysmallbot def\n");
- + SmallCol1 = 0;
- + SmallCol2 = 6;
- + return;
- + }
- + break;
- + }
- + }
- + NoSmallCal = 1;
- + return;
- + }
- +
- *** ../prev/rem2ps.h Mon Jun 28 12:30:22 1993
- --- ./rem2ps.h Tue Sep 28 16:53:52 1993
- ***************
- *** 64,80 ****
- "/doheading",
- "{",
- " /monthyr exch def",
- ! " ",
- ! " /HeadFont findfont",
- ! " HeadSize scalefont setfont ",
- " monthyr stringwidth",
- ! " pop",
- " 2 div MaxX MinX add 2 div exch sub /x exch def",
- ! " MaxY HeadSize 1.5 mul sub /y exch def",
- " newpath x y moveto monthyr show",
- ! " y HeadSize 0.5 mul sub /y exch def",
- " MinX y MaxX y L",
- " /topy y def",
- "% Do the days of the week",
- " MaxX MinX sub 7 div /xincr exch def",
- " /x MinX def",
- --- 64,82 ----
- "/doheading",
- "{",
- " /monthyr exch def",
- ! "",
- ! " /TitleFont findfont",
- ! " TitleSize scalefont setfont",
- " monthyr stringwidth",
- ! " /hgt exch def",
- " 2 div MaxX MinX add 2 div exch sub /x exch def",
- ! " MaxY Border sub TitleSize sub /y exch def",
- " newpath x y moveto monthyr show",
- ! " newpath x y moveto monthyr false charpath flattenpath pathbbox",
- ! " pop pop Border sub /y exch def pop",
- " MinX y MaxX y L",
- " /topy y def",
- + " /HeadFont findfont HeadSize scalefont setfont",
- "% Do the days of the week",
- " MaxX MinX sub 7 div /xincr exch def",
- " /x MinX def",
- ***************
- *** 143,149 ****
- " /curline () def",
- " /len word length def",
- " /Fcount len 1 sub def",
- ! " ",
- " {",
- " word 0 Fcount getinterval stringwidth pop width le",
- " {exit} if",
- --- 145,151 ----
- " /curline () def",
- " /len word length def",
- " /Fcount len 1 sub def",
- ! "",
- " {",
- " word 0 Fcount getinterval stringwidth pop width le",
- " {exit} if",
- *** ../prev/remind.1 Thu Aug 26 10:58:39 1993
- --- ./remind.1 Thu Sep 30 15:25:03 1993
- ***************
- *** 1,4 ****
- ! .TH REMIND 1 "14 April 1993"
- .UC 4
- .SH NAME
- remind \- a sophisticated reminder service
- --- 1,4 ----
- ! .TH REMIND 1 "30 September 1993"
- .UC 4
- .SH NAME
- remind \- a sophisticated reminder service
- ***************
- *** 59,64 ****
- --- 59,70 ----
- \fBrem2ps\fR program, which creates a PostScript calendar. For this
- option, \fIn\fR cannot start with "+"; it must specify a number of months.
- .TP
- + .B \-m
- + The \fB\-m\fR option causes the \fB\-c\fR option to produce a calendar whose
- + first column is Monday rather than Sunday. (This conforms to the international
- + standard.) It does \fInot\fR, however, affect the \fB\-p\fR or \fB\-s\fR
- + options.
- + .TP
- .B \-v
- The \fB\-v\fR option makes the output of \fBRemind\fR slightly more verbose.
- .TP
- ***************
- *** 202,207 ****
- --- 208,220 ----
- it, rather than the actual system date, as its notion of "today."
- This lets you create calendars for future months, or test to see
- how your reminders will be triggered in the future.
- + .PP
- + In addition, as part of the \fIdate\fR component, you can supply a
- + \fIrepeat\fR parameter, which has the form *\fInum\fR. This causes
- + \fBRemind\fR to be run \fInum\fR times, with the date incrementing
- + on each iteration. You may have to enclose the parameter in quotes
- + to avoid shell expansion. See the subsection "Repeated Execution"
- + in the section "Calendar Mode" for more information.
- .SH REMINDER FILES
- .PP
- \fBRemind\fR uses scripts to control its operation. The commands
- ***************
- *** 281,287 ****
- reminders - they are \fB$FirstIndent\fR, \fB$SubsIndent\fR and
- \fB$FormWidth\fR. They are discussed in the section "System Variables."
- The \fBMSF\fR keyword causes the spacing of your reminder to be altered -
- ! extra spaces are discarded, and two spaces are placed after periods.
- .PP
- A \fBRUN\fR-type
- reminder also passes the \fIbody\fR through the substitution filter, but
- --- 294,306 ----
- reminders - they are \fB$FirstIndent\fR, \fB$SubsIndent\fR and
- \fB$FormWidth\fR. They are discussed in the section "System Variables."
- The \fBMSF\fR keyword causes the spacing of your reminder to be altered -
- ! extra spaces are discarded, and two spaces are placed after periods and
- ! other characters, as specified by the system variables \fB$EndSent\fR and
- ! \fB$EndSentIg\fR. Note that if the body of the reminder includes
- ! newline characters (placed there with the %_ sequence), then the newlines
- ! are treated as the beginnings of new paragraphs, and the \fB$FirstIndent\fR
- ! indentation is used for the next line. You can use two consecutive
- ! newlines to have spaced paragraphs emitted from a single reminder body.
- .PP
- A \fBRUN\fR-type
- reminder also passes the \fIbody\fR through the substitution filter, but
- ***************
- *** 291,297 ****
- .PP
- A \fBPS\fR or \fBPSFILE\fR-type reminder is used to pass PostScript code
- directly to the printer when producing PostScript calendars. This can
- ! be used to shade certain calendar entries, include graphics in the calendar,
- or almost any other purpose you can think of. You
- should not use these types of reminders unless you are an expert PostScript
- programmer. The \fBPS\fR and \fBPSFILE\fR reminders are ignored unless
- --- 310,317 ----
- .PP
- A \fBPS\fR or \fBPSFILE\fR-type reminder is used to pass PostScript code
- directly to the printer when producing PostScript calendars. This can
- ! be used to shade certain calendar entries (see the psshade() function),
- ! include graphics in the calendar,
- or almost any other purpose you can think of. You
- should not use these types of reminders unless you are an expert PostScript
- programmer. The \fBPS\fR and \fBPSFILE\fR reminders are ignored unless
- ***************
- *** 1468,1483 ****
- version 03.00.07 of \fBRemind\fR.
- .PP
- All system variables begin with a dollar sign '$'. They can be used
- ! in \fBSET\fR commands and expressions just as regular variables can. However,
- ! system variables always hold values of type \fBINT\fR. In addition,
- ! some system variables cannot be modified, and you cannot create new
- ! system variables. System variables can be initialized on the command
- ! line with the \fB\-i\fR option, but you may need to quote them to avoid
- ! having the shell interpret the dollar sign. System variable names are
- ! not case-sensitive.
- .PP
- The following system variables are defined. Those marked
- "read-only" cannot be changed with the \fBSET\fR command.
- .TP
- .B $CalcUTC
- If 1 (the default), then \fBRemind\fR uses C library functions
- --- 1488,1505 ----
- version 03.00.07 of \fBRemind\fR.
- .PP
- All system variables begin with a dollar sign '$'. They can be used
- ! in \fBSET\fR commands and expressions just as regular variables can.
- ! All system variables always hold values of a specified type. In
- ! addition, some system variables cannot be modified, and you cannot
- ! create new system variables. System variables can be initialized on
- ! the command line with the \fB\-i\fR option, but you may need to quote
- ! them to avoid having the shell interpret the dollar sign. System
- ! variable names are not case-sensitive.
- .PP
- The following system variables are defined. Those marked
- "read-only" cannot be changed with the \fBSET\fR command.
- + All system variables hold values of type \fBINT\fR, unless otherwise
- + specified.
- .TP
- .B $CalcUTC
- If 1 (the default), then \fBRemind\fR uses C library functions
- ***************
- *** 1506,1511 ****
- --- 1528,1556 ----
- If non-zero, then the \fB\-q\fR option was supplied on the command line.
- For the MS-DOS version, always contains 1.
- .TP
- + .B $EndSent (STRING type)
- + Contains a list of characters which end a sentence. The \fBMSF\fR
- + keyword inserts two spaces after these characters. Initially,
- + \fB$EndSent\fR is set to ".!?" (period, exclamation mark, and
- + question mark.)
- + .TP
- + .B $EndSentIg (STRING type)
- + Contains a list of characters which should be ignored when \fBMSF\fR
- + decides whether or not to place two spaces after a sentence. Initially,
- + is set to "'>)]}"+CHAR(34) (single-quote, greater-than, right
- + parenthesis, right bracket, right brace, and double-quote.)
- + .PP
- + .RS
- + For example, the default values work as follows:
- + .PP
- + .nf
- + MSF He said, "Huh! (Two spaces will follow this.)" Yup.
- + .fi
- + .PP
- + because the final parenthesis and quote are ignored (for the purposes
- + of spacing) when they follow a period.
- + .RE
- + .TP
- .B $FirstIndent
- The number of spaces by which to indent the first line of a \fBMSF\fR-type
- reminder. The default is 0.
- ***************
- *** 1545,1550 ****
- --- 1590,1601 ----
- are positive; southern ones are negative. For southern latitudes, all
- three components should be negative.
- .TP
- + .B $Location (STRING type)
- + This is a string specifying the name of your location. It is usually
- + the name of your town or city. It can be set to whatever you like,
- + but good style indicates that it should be kept consistent with
- + the latitude and longitude system variables.
- + .TP
- .B $LongDeg, $LongMin, $LongSec
- These specify the longitude of your location. \fB$LongDeg\fR can
- range from -180 to 180. Western longitudes are positive; eastern
- ***************
- *** 1907,1912 ****
- --- 1958,2005 ----
- Returns an \fBINT\fR from 1 to 12, representing the month component of
- \fIdate\fR.
- .TP
- + .B "moondate(i_phase [,d_date [,t_time]])"
- + This function returns the date of the first occurrence of the phase
- + \fIphase\fR of the moon on or after \fIdate\fR and \fItime\fR.
- + \fIPhase\fR can range from 0 to 3, with 0 signifying new moon, 1 first
- + quarter, 2 full moon, and 3 third quarter. If \fIdate\fR is omitted,
- + it defaults to \fBtoday()\fR. If \fItime\fR is omitted, it defaults
- + to midnight.
- + .RS
- + .PP
- + For example, the following returns the date of the next full moon:
- + .PP
- + .nf
- + SET fullmoon moondate(2)
- + .fi
- + .PP
- + .RE
- + .TP
- + .B "moontime(i_phase [,d_date [,t_time]])"
- + This function returns the time of the first occurrence of the phase
- + \fIphase\fR of the moon on or after \fIdate\fR and \fItime\fR.
- + \fIPhase\fR can range from 0 to 3, with 0 signifying new moon, 1 first
- + quarter, 2 full moon, and 3 third quarter. If \fIdate\fR is omitted,
- + it defaults to \fBtoday()\fR. If \fItime\fR is omitted, it defaults
- + to midnight. \fBMoontime()\fR is intended to be used in conjunction
- + with \fBmoondate()\fR. Don't take the time too seriously - it's only
- + accurate to within 15-20 minutes.
- + .RS
- + .PP
- + For example, the following returns the date and time of the next full moon:
- + .PP
- + .nf
- + MSG Next full moon at [moontime(2)] on [moondate(2)]
- + .fi
- + .PP
- + .RE
- + .TP
- + .B moonphase([d_date [,t_time]])
- + This function returns the phase of the moon on \fIdate\fR and \fItime\fR,
- + which default to \fBtoday()\fR and midnight, respectively. The returned
- + value is an integer from 0 to 359, representing the phase of the moon
- + in degrees. 0 is a new moon, 180 is a full moon, 90 is first-quarter, etc.
- + .TP
- .B now()
- Returns the current system time, as a \fBTIME\fR type.
- .TP
- ***************
- *** 1931,1936 ****
- --- 2024,2064 ----
- \fIstr2\fR otherwise.
- .RE
- .TP
- + .B psmoon(i_phase [,i_size])
- + Returns a \fBSTRING\fR consisting of PostScript code to draw a moon
- + in the upper-left hand corner of the calendar box. \fIPhase\fR specifies
- + the phase of the moon, and is 0 (new moon), 1 (first quarter), 2 (full moon)
- + or 3 (third quarter). If \fIsize\fR is specified, it controls the radius of
- + the moon in PostScript units (1/72 inch.) If it is not specified, the size
- + of the day-number font is used.
- + .PP
- + .RS
- + For example, the following four lines place moon symbols on the PostScript
- + calendar:
- + .PP
- + .nf
- + REM [trigger(moondate(0))] PS [psmoon(0)]
- + REM [trigger(moondate(1))] PS [psmoon(1)]
- + REM [trigger(moondate(2))] PS [psmoon(2)]
- + REM [trigger(moondate(3))] PS [psmoon(3)]
- + .fi
- + .PP
- + .RE
- + .TP
- + .B psshade(i_num)
- + Returns a \fBSTRING\fR which consists of PostScript commands to
- + shade a calendar box. \fINum\fR can range from 0 (completely black)
- + to 100 (completely white.) Here's an example of how to use this:
- + .RS
- + .PP
- + .nf
- + REM Sat Sun PS [psshade(95)]
- + .fi
- + .PP
- + The above command emits PostScript code to lightly shade the boxes
- + for Saturday and Sunday in a PostScript calendar.
- + .RE
- + .TP
- .B realtoday()
- Returns the date as provided by the operating system. This is in contrast to
- \fBRemind\fR's concept of "today", which may be changed if it is running
- ***************
- *** 2460,2465 ****
- --- 2588,2605 ----
- timed reminders are discarded. If you are in calendar mode
- (described next), then the calendar processing is aborted.
- .PP
- + If you supply an \fBINT\fR-type expression after the \fBEXIT\fR command,
- + it is returned to the calling program as the exit status. Otherwise,
- + an exit status of 99 is returned.
- + .PP
- + .B THE FLUSH COMMAND
- + .PP
- + This command simply consists of the word \fBFLUSH\fR on a line by
- + itself. The command flushes the standard output and standard error
- + streams used by \fBRemind\fR. This is not terribly useful to most
- + people, but may be useful if you run \fBRemind\fR as a subprocess of
- + another program, and want to use pipes for communication.
- + .PP
- .SH CALENDAR MODE
- .PP
- If you supply the \fB\-c\fR, \fB\-s\fR or \fB\-p\fR
- ***************
- *** 2561,2566 ****
- --- 2701,2728 ----
- places the time of timed reminders in the calendar according to the
- \fB\-b\fR command-line option.
- .PP
- + .B REPEATED EXECUTION
- + .PP
- + If you supply a \fIrepeat\fR parameter on the command line,
- + and do not use the \fB\-c\fR, \fB\-p\fR, or \fB\-s\fR options, \fBRemind\fR
- + operates in a similar manner to calendar mode. It repeatedly executes
- + the reminder script, incrementing \fBtoday()\fR with each iteration.
- + The same rules about preserving variables and function definitions
- + apply. Note that using \fIrepeat\fR on the command line also enables
- + the \fB\-q\fR option and disables any \fB\-z\fR option.
- + As an example, if you want to see how \fBRemind\fR
- + will behave for the next week, you can type:
- + .PP
- + .nf
- + remind .reminders '*7'
- + .fi
- + .PP
- + If you want to print the dates of the next 1000 days, use:
- + .PP
- + .nf
- + (echo 'banner %'; echo 'msg [today()]%') | remind - '*1000'
- + .fi
- + .PP
- .SH INITIALIZING VARIABLES ON THE COMMAND LINE
- .PP
- The \fB\-i\fR option is used to initialize variables on the \fBRemind\fR
- ***************
- *** 2640,2650 ****
- 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:
- --- 2802,2813 ----
- 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, /TitleFont and /HeadFont
- The fonts used to draw the day numbers, the calendar entries, the small
- ! calendars, the calendar title (month, year)
- ! and the day-of-the-week headings, respectively.
- .TP
- ! DaySize, EntrySize, TitleSize 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:
- ***************
- *** 3144,3150 ****
- versions of \fBRemind\fR prior to 03.00.01.
- .SH AUTHOR
- .PP
- ! David F. Skoll
- .SH BUGS
- .PP
- There's no good reason why read-only system variables are not
- --- 3307,3316 ----
- versions of \fBRemind\fR prior to 03.00.01.
- .SH AUTHOR
- .PP
- ! David F. Skoll wrote \fBRemind\fR. The moon code was copied largely verbatim
- ! from "moontool" by John Walker. The Hebrew calendar support was taken
- ! from "hdate" by Amos Shapir. The authors of the language files are
- ! listed in the header file "lang.h" which comes with \fBRemind\fR.
- .SH BUGS
- .PP
- There's no good reason why read-only system variables are not
- *** ../prev/sort.c Thu Aug 19 16:12:01 1993
- --- ./sort.c Tue Aug 31 16:28:20 1993
- ***************
- *** 182,187 ****
- --- 182,188 ----
- free(cur);
- cur = next;
- }
- + SortedQueue = NULL;
- }
- /***************************************************************/
- /* */
- *** ../prev/test.cmp Thu Aug 19 17:06:48 1993
- --- ./test.cmp Tue Aug 31 13:22:46 1993
- ***************
- *** 631,637 ****
- "a05" + "6" => "a056"
- value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
- set a058 version()
- ! version() => "03.00.08"
- set a059 wkday(today())
- today() => 1991/02/16
- wkday(1991/02/16) => "Saturday"
- --- 631,637 ----
- "a05" + "6" => "a056"
- value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH"
- set a058 version()
- ! version() => "03.00.09"
- set a059 wkday(today())
- today() => 1991/02/16
- wkday(1991/02/16) => "Saturday"
- ***************
- *** 772,778 ****
- a048 "foo"
- a067 "INT"
- a039 "February"
- ! a058 "03.00.08"
- a077 "1992 92
- "
- a049 21
- --- 772,778 ----
- a048 "foo"
- a067 "INT"
- a039 "February"
- ! a058 "03.00.09"
- a077 "1992 92
- "
- a049 21
- *** ../prev/token.c Tue Aug 3 12:29:05 1993
- --- ./token.c Fri Sep 3 11:50:53 1993
- ***************
- *** 57,62 ****
- --- 57,63 ----
- { "errmsg", 6, T_ErrMsg, 0 },
- { "exit", 4, T_Exit, 0 },
- { "february", 3, T_Month, 1 },
- + { "flush", 5, T_Flush, 0 },
- { "friday", 3, T_WkDay, 4 },
- { "fset", 4, T_Fset, 0 },
- { "if", 2, T_If, 0 },
- *** ../prev/types.h Tue Aug 3 12:28:45 1993
- --- ./types.h Fri Sep 3 11:50:48 1993
- ***************
- *** 126,132 ****
- T_Clr,
- T_Debug,
- T_Dumpvars,
- ! T_Scanfrom
- };
-
- /* The structure of a token */
- --- 126,133 ----
- T_Clr,
- T_Debug,
- T_Dumpvars,
- ! T_Scanfrom,
- ! T_Flush
- };
-
- /* The structure of a token */
- *** ../prev/var.c Thu Aug 19 16:40:40 1993
- --- ./var.c Tue Sep 28 16:16:07 1993
- ***************
- *** 12,17 ****
- --- 12,18 ----
-
- #include "config.h"
- #include <stdio.h>
- + #include <string.h>
- #ifdef HAVE_STDLIB_H
- #include <stdlib.h>
- #endif
- ***************
- *** 218,228 ****
- r = EvaluateExpr(p, &v);
- if (r) return r;
-
- ! if (*TokBuffer == '$') {
- ! if (v.type != INT_TYPE) return E_BAD_TYPE;
- ! return SetSysVar(TokBuffer+1, v.v.val);
- ! }
- ! return SetVar(TokBuffer, &v);
- }
-
- /***************************************************************/
- --- 219,226 ----
- r = EvaluateExpr(p, &v);
- if (r) return r;
-
- ! if (*TokBuffer == '$') return SetSysVar(TokBuffer+1, &v);
- ! else return SetVar(TokBuffer, &v);
- }
-
- /***************************************************************/
- ***************
- *** 331,343 ****
- /* DestroyVars */
- /* */
- /* Free all the memory used by variables, but don't delete */
- ! /* preserved variables. */
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC void DestroyVars(void)
- #else
- ! void DestroyVars()
- #endif
- {
- int i;
- --- 329,342 ----
- /* DestroyVars */
- /* */
- /* Free all the memory used by variables, but don't delete */
- ! /* preserved variables unless ALL is non-zero. */
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC void DestroyVars(int all)
- #else
- ! void DestroyVars(all)
- ! int all;
- #endif
- {
- int i;
- ***************
- *** 348,354 ****
- VHashTbl[i] = NULL;
- prev = NULL;
- while(v) {
- ! if (!v->preserve) {
- DestroyValue(&(v->v));
- next = v->next;
- free(v);
- --- 347,353 ----
- VHashTbl[i] = NULL;
- prev = NULL;
- while(v) {
- ! if (all || !v->preserve) {
- DestroyValue(&(v->v));
- next = v->next;
- free(v);
- ***************
- *** 431,472 ****
- typedef struct {
- char *name;
- char modifiable;
- ! int *value;
- int min;
- int max;
- } SysVar;
-
- ! #define NO_CONSTRAINT 4532
- /* All of the system variables sorted alphabetically */
- static SysVar SysVarArr[] = {
- ! /* name modifiable value min max */
- ! { "CalcUTC", 1, &CalculateUTC, 0, 1 },
- ! { "CalMode", 0, &DoCalendar, 0, 0 },
- ! { "Daemon", 0, &Daemon, 0, 0 },
- ! { "DontFork", 0, &DontFork, 0, 0 },
- ! { "DontQueue", 0, &DontQueue, 0, 0 },
- ! { "DontTrigAts", 0, &DontIssueAts, 0, 0 },
- ! { "FirstIndent", 1, &FirstIndent, 0, 132 },
- ! { "FoldYear", 1, &FoldYear, 0, 1 },
- ! { "FormWidth", 1, &FormWidth, 20, 132 },
- ! { "HushMode", 0, &Hush, 0, 0 },
- ! { "IgnoreOnce", 0, &IgnoreOnce, 0, 0 },
- ! { "InfDelta", 0, &InfiniteDelta, 0, 0 },
- ! { "LatDeg", 1, &LatDeg, -90, 90 },
- ! { "LatMin", 1, &LatMin, -59, 59 },
- ! { "LatSec", 1, &LatSec, -59, 59 },
- ! { "LongDeg", 1, &LongDeg, -180, 180 },
- ! { "LongMin", 1, &LongMin, -59, 59 },
- ! { "LongSec", 1, &LongSec, -59, 59 },
- ! { "MaxSatIter", 1, &MaxSatIter, 10, NO_CONSTRAINT },
- ! { "MinsFromUTC", 1, &MinsFromUTC, -13*60, 13*60 },
- ! { "NextMode", 0, &NextMode, 0, 0 },
- ! { "NumQueued", 0, &NumQueued, 0, 0 },
- ! { "NumTrig", 0, &NumTriggered, 0, 0 },
- ! { "PSCal", 0, &PsCal, 0, 0 },
- ! { "RunOff", 0, &RunDisabled, 0, 0 },
- ! { "SimpleCal", 0, &DoSimpleCalendar, 0, 0 },
- ! { "SubsIndent", 1, &SubsIndent, 0, 132}
- };
-
- #define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
- --- 430,480 ----
- typedef struct {
- char *name;
- char modifiable;
- ! int type;
- ! void *value;
- int min;
- int max;
- } SysVar;
-
- ! /* If the type of a sys variable is STR_TYPE, then min is redefined
- ! to be a flag indicating whether or not the value has been malloc'd. */
- ! #define been_malloced min
- !
- ! /* Flag for no min/max constraint */
- ! #define ANY 4532
- /* All of the system variables sorted alphabetically */
- static SysVar SysVarArr[] = {
- ! /* name mod type value min/mal max */
- ! { "CalcUTC", 1, INT_TYPE, &CalculateUTC, 0, 1 },
- ! { "CalMode", 0, INT_TYPE, &DoCalendar, 0, 0 },
- ! { "Daemon", 0, INT_TYPE, &Daemon, 0, 0 },
- ! { "DontFork", 0, INT_TYPE, &DontFork, 0, 0 },
- ! { "DontQueue", 0, INT_TYPE, &DontQueue, 0, 0 },
- ! { "DontTrigAts", 0, INT_TYPE, &DontIssueAts, 0, 0 },
- ! { "EndSent", 1, STR_TYPE, &EndSent, 0, 0 },
- ! { "EndSentIg", 1, STR_TYPE, &EndSentIg, 0, 0 },
- ! { "FirstIndent", 1, INT_TYPE, &FirstIndent, 0, 132 },
- ! { "FoldYear", 1, INT_TYPE, &FoldYear, 0, 1 },
- ! { "FormWidth", 1, INT_TYPE, &FormWidth, 20, 132 },
- ! { "HushMode", 0, INT_TYPE, &Hush, 0, 0 },
- ! { "IgnoreOnce", 0, INT_TYPE, &IgnoreOnce, 0, 0 },
- ! { "InfDelta", 0, INT_TYPE, &InfiniteDelta, 0, 0 },
- ! { "LatDeg", 1, INT_TYPE, &LatDeg, -90, 90 },
- ! { "LatMin", 1, INT_TYPE, &LatMin, -59, 59 },
- ! { "LatSec", 1, INT_TYPE, &LatSec, -59, 59 },
- ! { "Location", 1, STR_TYPE, &Location, 0, 0 },
- ! { "LongDeg", 1, INT_TYPE, &LongDeg, -180, 180 },
- ! { "LongMin", 1, INT_TYPE, &LongMin, -59, 59 },
- ! { "LongSec", 1, INT_TYPE, &LongSec, -59, 59 },
- ! { "MaxSatIter", 1, INT_TYPE, &MaxSatIter, 10, ANY },
- ! { "MinsFromUTC", 1, INT_TYPE, &MinsFromUTC, -13*60, 13*60 },
- ! { "NextMode", 0, INT_TYPE, &NextMode, 0, 0 },
- ! { "NumQueued", 0, INT_TYPE, &NumQueued, 0, 0 },
- ! { "NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 },
- ! { "PSCal", 0, INT_TYPE, &PsCal, 0, 0 },
- ! { "RunOff", 0, INT_TYPE, &RunDisabled, 0, 0 },
- ! { "SimpleCal", 0, INT_TYPE, &DoSimpleCalendar, 0, 0 },
- ! { "SubsIndent", 1, INT_TYPE, &SubsIndent, 0, 132}
- };
-
- #define NUMSYSVARS ( sizeof(SysVarArr) / sizeof(SysVar) )
- ***************
- *** 480,501 ****
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC int SetSysVar(const char *name, int value)
- #else
- int SetSysVar(name, value)
- char *name;
- ! int value;
- #endif
- {
- SysVar *v = FindSysVar(name);
- if (!v) return E_NOSUCH_VAR;
- if (!v->modifiable) {
- Eprint("%s: '$%s'", ErrMsg[E_CANT_MODIFY], name);
- return E_CANT_MODIFY;
- }
- ! if (v->max != NO_CONSTRAINT && value > v->max) return E_2HIGH;
- ! if (v->min != NO_CONSTRAINT && value < v->min) return E_2LOW;
- ! *(v->value) = value;
- return OK;
- }
-
- --- 488,519 ----
- /* */
- /***************************************************************/
- #ifdef HAVE_PROTOS
- ! PUBLIC int SetSysVar(const char *name, Value *value)
- #else
- int SetSysVar(name, value)
- char *name;
- ! Value *value;
- #endif
- {
- SysVar *v = FindSysVar(name);
- if (!v) return E_NOSUCH_VAR;
- + if (v->type != value->type) return E_BAD_TYPE;
- if (!v->modifiable) {
- Eprint("%s: '$%s'", ErrMsg[E_CANT_MODIFY], name);
- return E_CANT_MODIFY;
- }
- !
- ! /* If it's a string variable, special measures must be taken */
- ! if (v->type == STR_TYPE) {
- ! if (v->been_malloced) free(*((char **)(v->value)));
- ! v->been_malloced = 1;
- ! *((char **) v->value) = value->v.str;
- ! value->type = ERR_TYPE; /* So that it's not accidentally freed */
- ! } else {
- ! if (v->max != ANY && value->v.val > v->max) return E_2HIGH;
- ! if (v->min != ANY && value->v.val < v->min) return E_2LOW;
- ! *((int *)v->value) = value->v.val;
- ! }
- return OK;
- }
-
- ***************
- *** 516,525 ****
- {
- SysVar *v = FindSysVar(name);
-
- ! val->type = INT_TYPE;
- ! val->v.val = 0;
- if (!v) return E_NOSUCH_VAR;
- ! val->v.val = *(v->value);
- return OK;
- }
-
- --- 534,548 ----
- {
- SysVar *v = FindSysVar(name);
-
- ! val->type = ERR_TYPE;
- if (!v) return E_NOSUCH_VAR;
- ! if (v->type == STR_TYPE) {
- ! val->v.str = StrDup(*((char **) v->value));
- ! if (!val->v.str) return E_NO_MEM;
- ! } else {
- ! val->v.val = *((int *) v->value);
- ! }
- ! val->type = v->type;
- return OK;
- }
-
- ***************
- *** 603,615 ****
- if (name) strcat(buffer, name); else strcat(buffer, v->name);
- fprintf(ErrFp, "%*s ", VAR_NAME_LEN, buffer);
- if (v) {
- ! if (!v->modifiable) fprintf(ErrFp, "%d\n", *v->value);
- ! else {
- ! fprintf(ErrFp, "%-10d ", *v->value);
- ! if (v->min == NO_CONSTRAINT) fprintf(ErrFp, "(-Inf, ");
- ! else fprintf(ErrFp, "[%d, ", v->min);
- ! if (v->max == NO_CONSTRAINT) fprintf(ErrFp, "Inf)\n");
- ! else fprintf(ErrFp, "%d]\n", v->max);
- }
- } else fprintf(ErrFp, "%s\n", UNDEF);
-
- --- 626,648 ----
- if (name) strcat(buffer, name); else strcat(buffer, v->name);
- fprintf(ErrFp, "%*s ", VAR_NAME_LEN, buffer);
- if (v) {
- ! if (v->type == STR_TYPE) {
- ! char *s = *((char **)v->value);
- ! int y;
- ! putc('"', ErrFp);
- ! for (y=0; y<MAX_PRT_LEN && *s; y++) putc(*s++, ErrFp);
- ! putc('"', ErrFp);
- ! if (*s) fprintf(ErrFp, "...");
- ! putc('\n', ErrFp);
- ! } else {
- ! if (!v->modifiable) fprintf(ErrFp, "%d\n", *((int *)v->value));
- ! else {
- ! fprintf(ErrFp, "%-10d ", *((int *)v->value));
- ! if (v->min == ANY) fprintf(ErrFp, "(-Inf, ");
- ! else fprintf(ErrFp, "[%d, ", v->min);
- ! if (v->max == ANY) fprintf(ErrFp, "Inf)\n");
- ! else fprintf(ErrFp, "%d]\n", v->max);
- ! }
- }
- } else fprintf(ErrFp, "%s\n", UNDEF);
-
-