mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 06:18:47 +02:00
- Added TAG and DURATION clauses for communicating more information to
back-ends and eventually converting REMIND into a full-fledged scheduler. - Completely reworked the PS/PSFILE mechanism to use the more general SPECIAL mechanism for customizing output in REMIND back-ends. - Modified tkremind, rem2ps and www/rem2html to use new "SPECIAL" communication channel.
This commit is contained in:
11
WHATSNEW.30
11
WHATSNEW.30
@@ -1,5 +1,16 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* Version 3.0 Patch 18
|
||||
|
||||
+ MAJOR ENHANCEMENTS
|
||||
|
||||
- Added TAG and DURATION clauses for communicating more information to
|
||||
back-ends and eventually converting REMIND into a full-fledged
|
||||
scheduler.
|
||||
|
||||
- Completely reworked the PS/PSFILE mechanism to use the more
|
||||
general SPECIAL mechanism for customizing output in REMIND back-ends.
|
||||
|
||||
* Version 3.0 Patch 17
|
||||
|
||||
+ MINOR ENHANCEMENTS
|
||||
|
||||
25
calendar.c
25
calendar.c
@@ -10,7 +10,7 @@
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: calendar.c,v 1.5 1997-09-16 03:16:30 dfs Exp $";
|
||||
static char const RCSID[] = "$Id: calendar.c,v 1.6 1997-09-21 23:23:35 dfs Exp $";
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -681,10 +681,10 @@ int col;
|
||||
|
||||
/* Convert PS and PSF to PASSTHRU */
|
||||
if (trig.typ == PS_TYPE) {
|
||||
strcpy(trig.passthru, "PPPP");
|
||||
strcpy(trig.passthru, "PostScript");
|
||||
trig.typ = PASSTHRU_TYPE;
|
||||
} else if (trig.typ == PSF_TYPE) {
|
||||
strcpy(trig.passthru, "FFFF");
|
||||
strcpy(trig.passthru, "PSFile");
|
||||
trig.typ = PASSTHRU_TYPE;
|
||||
}
|
||||
if (!PsCal && trig.typ == PASSTHRU_TYPE) return OK;
|
||||
@@ -779,23 +779,14 @@ int col, jul;
|
||||
{
|
||||
CalEntry *e = CalPs[col];
|
||||
CalEntry *n;
|
||||
int y, m, d, i, j;
|
||||
int y, m, d;
|
||||
|
||||
/* Do all the PASSTHRU entries first, if any */
|
||||
FromJulian(jul, &y, &m, &d);
|
||||
while(e) {
|
||||
/* Print the PASSTHRU */
|
||||
j = 0;
|
||||
for(i=0; i<PASSTHRU_LEN; i++) {
|
||||
printf("%c", *(e->pos+j));
|
||||
if (*(e->pos+j+1)) {
|
||||
j++;
|
||||
} else {
|
||||
j=0;
|
||||
}
|
||||
}
|
||||
printf("%c%02d%c%02d ", DATESEP,
|
||||
printf("%04d%c%02d%c%02d ", y, DATESEP,
|
||||
m+1, DATESEP, d);
|
||||
printf("%s ", e->passthru);
|
||||
printf("%s ", e->tag);
|
||||
if (e->duration != NO_TIME) {
|
||||
printf("%d ", e->duration);
|
||||
@@ -817,8 +808,8 @@ int col, jul;
|
||||
|
||||
e = CalColumn[col];
|
||||
while(e) {
|
||||
printf("%04d%c%02d%c%02d ", y, DATESEP, m+1, DATESEP, d);
|
||||
printf("%s ", e->tag);
|
||||
printf("%04d%c%02d%c%02d", y, DATESEP, m+1, DATESEP, d);
|
||||
printf(" * %s ", e->tag);
|
||||
if (e->duration != NO_TIME) {
|
||||
printf("%d ", e->duration);
|
||||
} else {
|
||||
|
||||
4
config.h
4
config.h
@@ -11,7 +11,7 @@
|
||||
/* */
|
||||
/***************************************************************/
|
||||
|
||||
/* $Id: config.h,v 1.9 1997-09-16 03:16:31 dfs Exp $ */
|
||||
/* $Id: config.h,v 1.10 1997-09-21 23:23:36 dfs Exp $ */
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* LAT_DEG, LAT_MIN and LAT_SEC: Latitude of your location */
|
||||
@@ -273,7 +273,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TAG_LEN 32
|
||||
|
||||
#define PASSTHRU_LEN 4
|
||||
#define PASSTHRU_LEN 24
|
||||
|
||||
#define PUBLIC
|
||||
#define PRIVATE static
|
||||
|
||||
76
rem2ps.c
76
rem2ps.c
@@ -10,7 +10,7 @@
|
||||
/***************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
static char const RCSID[] = "$Id: rem2ps.c,v 1.8 1997-09-16 03:16:32 dfs Exp $";
|
||||
static char const RCSID[] = "$Id: rem2ps.c,v 1.9 1997-09-21 23:23:36 dfs Exp $";
|
||||
|
||||
#include "lang.h"
|
||||
#include <stdio.h>
|
||||
@@ -132,6 +132,7 @@ void WriteProlog ARGS ((void));
|
||||
void WriteCalEntry ARGS ((void));
|
||||
void WriteOneEntry ARGS ((char *s));
|
||||
void GetSmallLocations ARGS ((void));
|
||||
char *EatToken(char *in, char *out, int maxlen);
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
@@ -198,6 +199,7 @@ void DoPsCal()
|
||||
int is_ps;
|
||||
int firstcol;
|
||||
char *startOfBody;
|
||||
char passthru[PASSTHRU_LEN+1];
|
||||
|
||||
CalEntry *c, *d;
|
||||
|
||||
@@ -285,28 +287,25 @@ void DoPsCal()
|
||||
}
|
||||
c->next = NULL;
|
||||
|
||||
is_ps = ((LineBuffer[0] == 'F' &&
|
||||
LineBuffer[1] == 'F' &&
|
||||
LineBuffer[2] == 'F' &&
|
||||
LineBuffer[3] == 'F') ||
|
||||
(LineBuffer[0] == 'P' &&
|
||||
LineBuffer[1] == 'P' &&
|
||||
LineBuffer[2] == 'P' &&
|
||||
LineBuffer[3] == 'P'));
|
||||
|
||||
/* Skip the tag, duration and time */
|
||||
startOfBody = LineBuffer+10;
|
||||
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
|
||||
while(*startOfBody && !isspace(*startOfBody)) startOfBody++;
|
||||
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
|
||||
while(*startOfBody && !isspace(*startOfBody)) startOfBody++;
|
||||
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
|
||||
while(*startOfBody && !isspace(*startOfBody)) startOfBody++;
|
||||
while(*startOfBody && isspace(*startOfBody)) startOfBody++;
|
||||
|
||||
/* If no time, skip it */
|
||||
if (*startOfBody == '*') {
|
||||
startOfBody++;
|
||||
/* Eat the passthru */
|
||||
startOfBody = EatToken(startOfBody, passthru, PASSTHRU_LEN);
|
||||
|
||||
/* Eat the tag */
|
||||
startOfBody = EatToken(startOfBody, NULL, 0);
|
||||
|
||||
/* Eat the duration */
|
||||
startOfBody = EatToken(startOfBody, NULL, 0);
|
||||
|
||||
/* Eat the time */
|
||||
startOfBody = EatToken(startOfBody, NULL, 0);
|
||||
|
||||
is_ps = 0;
|
||||
if (!strcmp(passthru, "PostScript") ||
|
||||
!strcmp(passthru, "PSFile")) {
|
||||
is_ps = 1;
|
||||
}
|
||||
c->entry = malloc(strlen(startOfBody) + 1 + is_ps);
|
||||
if (!c->entry) {
|
||||
@@ -317,7 +316,11 @@ void DoPsCal()
|
||||
|
||||
if (is_ps) {
|
||||
/* Save the 'P' or 'F' flag */
|
||||
*(c->entry) = *LineBuffer;
|
||||
if (!strcmp(passthru, "PostScript")) {
|
||||
*(c->entry) = 'P';
|
||||
} else {
|
||||
*(c->entry) = 'F';
|
||||
}
|
||||
if (!PsEntries[DayNum]) PsEntries[DayNum] = c;
|
||||
else {
|
||||
d = PsEntries[DayNum];
|
||||
@@ -982,3 +985,34 @@ void GetSmallLocations()
|
||||
return;
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/* */
|
||||
/* EatToken */
|
||||
/* */
|
||||
/* Read a space-delimited token into an output buffer. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
#ifdef HAVE_PROTOS
|
||||
PUBLIC char *EatToken(char *in, char *out, int maxlen)
|
||||
#else
|
||||
char *EatToken(in, out, maxlen)
|
||||
char *in, *out;
|
||||
int maxlen;
|
||||
#endif
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
/* Skip space before token */
|
||||
while(*in && isspace(*in)) in++;
|
||||
|
||||
/* Eat the token */
|
||||
while(*in && !isspace(*in)) {
|
||||
if (i < maxlen) {
|
||||
if (out) *out++ = *in;
|
||||
i++;
|
||||
}
|
||||
in++;
|
||||
}
|
||||
if (out) *out = 0;
|
||||
return in;
|
||||
}
|
||||
|
||||
7
tkremind
7
tkremind
@@ -11,7 +11,7 @@
|
||||
#
|
||||
#--------------------------------------------------------------
|
||||
|
||||
# $Id: tkremind,v 1.12 1997-01-16 04:14:32 dfs Exp $
|
||||
# $Id: tkremind,v 1.13 1997-09-21 23:23:37 dfs Exp $
|
||||
|
||||
# the next line restarts using wish \
|
||||
exec wish "$0" "$@"
|
||||
@@ -276,7 +276,10 @@ proc FillCalWindow {} {
|
||||
CreateCalWindow $firstWkday $mondayFirst $daysInMonth $monthName $year $DayNames
|
||||
Status "Filling calendar entries..."
|
||||
while { [gets $file line] >= 0 } {
|
||||
if { [regexp {^([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9])(.*)} $line all year month day stuff] == 0 } {
|
||||
if { [regexp {^([0-9][0-9][0-9][0-9])/([0-9][0-9])/([0-9][0-9]) +([^ ]+) +[^ ]+ +[^ ]+ +[^ ]+(.*)} $line all year month day type stuff] == 0 } {
|
||||
continue
|
||||
}
|
||||
if { $type != "*"} {
|
||||
continue
|
||||
}
|
||||
set day [string trimleft $day 0]
|
||||
|
||||
10
www/rem2html
10
www/rem2html
@@ -2,7 +2,7 @@
|
||||
|
||||
# rem2html
|
||||
#
|
||||
# $Id: rem2html,v 1.3 1997-09-16 03:16:42 dfs Exp $
|
||||
# $Id: rem2html,v 1.4 1997-09-21 23:23:41 dfs Exp $
|
||||
#
|
||||
# A script to convert from the output of "remind -p" to Hyper-Text Markup
|
||||
# Language (HTML), the text format used in WWW documents. By default, it
|
||||
@@ -111,11 +111,11 @@ sub parse_input {
|
||||
@nextsc = split(" ");
|
||||
} else {
|
||||
last if /rem2(html|ps) end/;
|
||||
next unless m/^(....).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/;
|
||||
$type = $1;
|
||||
$msg = $7;
|
||||
next unless m/^(\d*).(\d*).(\d*)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s*(.*)$/;
|
||||
$type = $4;
|
||||
$msg = $8;
|
||||
$day = $3;
|
||||
next unless ($type eq "HTML" || ($type =~ /\d\d\d\d/));
|
||||
next unless ($type eq "HTML" || ($type eq "*"));
|
||||
if ($type eq "HTML") {
|
||||
$days[$day] .= "$msg ";
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user