mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 14:59:20 +02:00
Don't sort SPECIALs ahead of normal reminders. Allow all SPECIALs to include
times; back-ends can use or ignore them as they see fit.
This commit is contained in:
@@ -41,7 +41,6 @@ typedef struct cal_entry {
|
|||||||
|
|
||||||
/* Global variables */
|
/* Global variables */
|
||||||
static CalEntry *CalColumn[7];
|
static CalEntry *CalColumn[7];
|
||||||
static CalEntry *CalPs[7];
|
|
||||||
|
|
||||||
static int ColSpaces;
|
static int ColSpaces;
|
||||||
|
|
||||||
@@ -588,7 +587,6 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
int r;
|
int r;
|
||||||
int jul;
|
int jul;
|
||||||
CalEntry *CurCol = CalColumn[col];
|
CalEntry *CurCol = CalColumn[col];
|
||||||
CalEntry *CurPs = CalPs[col];
|
|
||||||
CalEntry *e;
|
CalEntry *e;
|
||||||
char *s, *s2;
|
char *s, *s2;
|
||||||
DynamicBuffer buf, obuf, pre_buf;
|
DynamicBuffer buf, obuf, pre_buf;
|
||||||
@@ -780,44 +778,20 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
}
|
}
|
||||||
e->lineno = LineNo;
|
e->lineno = LineNo;
|
||||||
|
|
||||||
/* Ugly hack... SPECIAL COLOR and SPECIAL HTML are not treated
|
if (trig.typ == PASSTHRU_TYPE) {
|
||||||
as "passthru" to preserve ordering and make them behave like
|
|
||||||
a MSG-type reminder */
|
|
||||||
|
|
||||||
if (trig.typ == PASSTHRU_TYPE &&
|
|
||||||
strcmp(trig.passthru, "COLOR") &&
|
|
||||||
strcmp(trig.passthru, "HTML")) {
|
|
||||||
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
||||||
e->pos = e->passthru;
|
|
||||||
if (!strcmp(trig.passthru, "PostScript") ||
|
|
||||||
!strcmp(trig.passthru, "PSFile")) {
|
|
||||||
e->time = NO_TIME;
|
|
||||||
} else {
|
|
||||||
if (jul == JulianToday) {
|
|
||||||
e->time = tim.ttime;
|
|
||||||
} else {
|
|
||||||
e->time = NO_TIME;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
e->next = CurPs;
|
|
||||||
CalPs[col] = e;
|
|
||||||
SortCol(&CalPs[col]);
|
|
||||||
} else {
|
} else {
|
||||||
if (trig.typ == PASSTHRU_TYPE) {
|
e->passthru[0] = 0;
|
||||||
StrnCpy(e->passthru, trig.passthru, PASSTHRU_LEN);
|
|
||||||
} else {
|
|
||||||
e->passthru[0] = 0;
|
|
||||||
}
|
|
||||||
e->pos = e->text;
|
|
||||||
if (jul == JulianToday) {
|
|
||||||
e->time = tim.ttime;
|
|
||||||
} else {
|
|
||||||
e->time = NO_TIME;
|
|
||||||
}
|
|
||||||
e->next = CurCol;
|
|
||||||
CalColumn[col] = e;
|
|
||||||
SortCol(&CalColumn[col]);
|
|
||||||
}
|
}
|
||||||
|
e->pos = e->text;
|
||||||
|
if (jul == JulianToday) {
|
||||||
|
e->time = tim.ttime;
|
||||||
|
} else {
|
||||||
|
e->time = NO_TIME;
|
||||||
|
}
|
||||||
|
e->next = CurCol;
|
||||||
|
CalColumn[col] = e;
|
||||||
|
SortCol(&CalColumn[col]);
|
||||||
}
|
}
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
@@ -831,44 +805,11 @@ static int DoCalRem(ParsePtr p, int col)
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
static void WriteSimpleEntries(int col, int jul)
|
static void WriteSimpleEntries(int col, int jul)
|
||||||
{
|
{
|
||||||
CalEntry *e = CalPs[col];
|
CalEntry *e = CalColumn[col];
|
||||||
CalEntry *n;
|
CalEntry *n;
|
||||||
int y, m, d;
|
int y, m, d;
|
||||||
|
|
||||||
/* Do all the PASSTHRU entries first, if any */
|
|
||||||
FromJulian(jul, &y, &m, &d);
|
FromJulian(jul, &y, &m, &d);
|
||||||
while(e) {
|
|
||||||
if (e->passthru) {
|
|
||||||
if (!strcmp(e->passthru, "PostScript") ||
|
|
||||||
!strcmp(e->passthru, "PSFile")) {
|
|
||||||
e->duration = NO_TIME;
|
|
||||||
e->time = NO_TIME;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
|
|
||||||
printf("%04d/%02d/%02d ", y, m+1, d);
|
|
||||||
printf("%s %s ", e->passthru, e->tag);
|
|
||||||
if (e->duration != NO_TIME) {
|
|
||||||
printf("%d ", e->duration);
|
|
||||||
} else {
|
|
||||||
printf("* ");
|
|
||||||
}
|
|
||||||
if (e->time != NO_TIME) {
|
|
||||||
printf("%d ", e->time);
|
|
||||||
} else {
|
|
||||||
printf("* ");
|
|
||||||
}
|
|
||||||
printf("%s\n", e->text);
|
|
||||||
free(e->text);
|
|
||||||
free(e->filename);
|
|
||||||
n = e->next;
|
|
||||||
free(e);
|
|
||||||
e = n;
|
|
||||||
}
|
|
||||||
CalPs[col] = NULL;
|
|
||||||
|
|
||||||
e = CalColumn[col];
|
|
||||||
while(e) {
|
while(e) {
|
||||||
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
|
if (DoPrefixLineNo) printf("# fileinfo %d %s\n", e->lineno, e->filename);
|
||||||
printf("%04d/%02d/%02d", y, m+1, d);
|
printf("%04d/%02d/%02d", y, m+1, d);
|
||||||
|
|||||||
@@ -889,21 +889,21 @@ September 30
|
|||||||
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
|
2007/08/20 COLOR * * 825 6 7 8 1:45pm Mooo!
|
||||||
2007/08/20 * * * * 18 NonOmit-1
|
2007/08/20 * * * * 18 NonOmit-1
|
||||||
2007/08/20 * * * * 12 NonOmit-2
|
2007/08/20 * * * * 12 NonOmit-2
|
||||||
2007/08/21 PostScript * * * (wookie) show
|
2007/08/21 PostScript * * 115 (wookie) show
|
||||||
2007/08/21 * * * * 19 NonOmit-1
|
2007/08/21 * * * * 19 NonOmit-1
|
||||||
2007/08/21 * * * * 13 NonOmit-2
|
2007/08/21 * * * * 13 NonOmit-2
|
||||||
2007/08/22 PostScript * * * (cabbage) show
|
|
||||||
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
|
2007/08/22 COLOR * * * 0 0 255 Blue Wednesday
|
||||||
2007/08/22 * * * * 20 NonOmit-1
|
2007/08/22 * * * * 20 NonOmit-1
|
||||||
2007/08/22 * * * * 14 NonOmit-2
|
2007/08/22 * * * * 14 NonOmit-2
|
||||||
|
2007/08/22 PostScript * * * (cabbage) show
|
||||||
2007/08/23 blort * * 1004 snoo glup
|
2007/08/23 blort * * 1004 snoo glup
|
||||||
2007/08/23 COLOR * * * 255 0 0 Red Thursday
|
2007/08/23 COLOR * * * 255 0 0 Red Thursday
|
||||||
2007/08/23 * * * * 21 NonOmit-1
|
2007/08/23 * * * * 21 NonOmit-1
|
||||||
2007/08/23 * * * * 15 NonOmit-2
|
2007/08/23 * * * * 15 NonOmit-2
|
||||||
2007/08/24 SHADE * * * 0 255 0
|
2007/08/24 SHADE * * * 0 255 0
|
||||||
2007/08/24 blort * * * gulp wookie
|
|
||||||
2007/08/24 * * * * 22 NonOmit-1
|
2007/08/24 * * * * 22 NonOmit-1
|
||||||
2007/08/24 * * * * 16 NonOmit-2
|
2007/08/24 * * * * 16 NonOmit-2
|
||||||
|
2007/08/24 blort * * * gulp wookie
|
||||||
2007/08/25 * * * * 23 NonOmit-1
|
2007/08/25 * * * * 23 NonOmit-1
|
||||||
2007/08/25 * * * * 17 NonOmit-2
|
2007/08/25 * * * * 17 NonOmit-2
|
||||||
2007/08/26 * * * * 24 NonOmit-1
|
2007/08/26 * * * * 24 NonOmit-1
|
||||||
|
|||||||
Reference in New Issue
Block a user