From da1b5ed9a0dfa0ce16cba186d020961ebdc7cc69 Mon Sep 17 00:00:00 2001 From: dfs Date: Wed, 28 Sep 2005 02:39:11 +0000 Subject: [PATCH] Remove OS2_POPUP crap. --- docs/README.OS2 | 4 ++-- src/dorem.c | 61 ++----------------------------------------------- src/main.c | 16 +------------ src/protos.h | 18 +-------------- src/queue.c | 24 ++++++++----------- src/sort.c | 6 +---- 6 files changed, 17 insertions(+), 112 deletions(-) diff --git a/docs/README.OS2 b/docs/README.OS2 index 515a1549..222e7873 100644 --- a/docs/README.OS2 +++ b/docs/README.OS2 @@ -1,4 +1,4 @@ -$Id: README.OS2,v 1.4 2005-04-12 01:18:22 dfs Exp $ +$Id: README.OS2,v 1.5 2005-09-28 02:39:11 dfs Exp $ REMIND version 3.0 for OS/2 I DO NOT SUPPORT REMIND ON OS/2. THE OS/2 PORT HAS NOT BEEN MAINTAINED @@ -46,7 +46,7 @@ However, if you have problems, please contact me. RELEASE NOTES -- miscellaneous info that couldn't go anywhere else! -1. POPUP REMINDERS +1. POPUP REMINDERS -- NO LONGER WORK; CODE FOR THIS WAS REMOVED. If you define the symbol OS2_POPUP in the OS/2 Makefile, you get "full-screen popups" (as implemented by Russ Herman) for all MSG- diff --git a/src/dorem.c b/src/dorem.c index 29f51091..cf5bc663 100644 --- a/src/dorem.c +++ b/src/dorem.c @@ -13,7 +13,7 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: dorem.c,v 1.10 2005-04-12 01:49:45 dfs Exp $"; +static char const RCSID[] = "$Id: dorem.c,v 1.11 2005-09-28 02:39:14 dfs Exp $"; #include #include @@ -123,11 +123,7 @@ ParsePtr p; if (ShouldTriggerReminder(&trig, &tim, jul)) { -#ifdef OS2_POPUP - if ( (r=TriggerReminder(p, &trig, &tim, jul, 0)) ) -#else - if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) -#endif + if ( (r=TriggerReminder(p, &trig, &tim, jul)) ) { return r; } @@ -582,27 +578,13 @@ PRIVATE int ParseScanFrom(ParsePtr s, Trigger *t) /* */ /***************************************************************/ #ifdef HAVE_PROTOS -#ifdef OS2_POPUP -PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul, - int AsPopUp) -#else /* ! OS2_POPUP */ PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul) -#endif /* OS2_POPUP */ #else /* ! HAVE_PROTOS */ -#ifdef OS2_POPUP - int TriggerReminder(p, t, tim, jul, AsPopUp) - ParsePtr p; - Trigger *t; - TimeTrig *tim; - int jul; - int AsPopUp; -#else /* ! OS2_POPUP */ int TriggerReminder(p, t, tim, jul) ParsePtr p; Trigger *t; TimeTrig *tim; int jul; -#endif /* OS2_POPUP */ #endif /* HAVE_PROTOS */ { int r, y, m, d; @@ -624,14 +606,7 @@ PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul, if (!DoSubstFromString(DBufValue(&Banner), &buf, JulianToday, NO_TIME) && DBufLen(&buf)) { -#ifdef OS2_POPUP - if (AsPopUp) - PutlPopUp(DBufValue(&buf)); - else - printf("%s\n", DBufValue(&buf)); -#else printf("%s\n", DBufValue(&buf)); -#endif } DBufFree(&buf); } @@ -645,24 +620,9 @@ PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul, return OK; } FromJulian(jul, &y, &m, &d); -#ifdef OS2_POPUP - if (AsPopUp) { - char tmpBuf[64]; - sprintf(tmpBuf, "%04d%c%02d%c%02d %s", y, DATESEP, m+1, DATESEP, d, - SimpleTime(tim->ttime)); - StartPopUp(); - PutsPopUp(tmpBuf); - PutlPopUp(DBufValue(&buf)); - } - else - printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d, - SimpleTime(tim->ttime), - DBufValue(&buf)); -#else printf("%04d%c%02d%c%02d %s%s\n", y, DATESEP, m+1, DATESEP, d, SimpleTime(tim->ttime), DBufValue(&buf)); -#endif DBufFree(&buf); return OK; } @@ -723,29 +683,12 @@ PUBLIC int TriggerReminder(ParsePtr p, Trigger *t, TimeTrig *tim, int jul, if (MsgCommand) { DoMsgCommand(MsgCommand, DBufValue(&buf)); } else { -#ifdef OS2_POPUP - if (AsPopUp) - PutlPopUp(DBufValue(&buf)); - else - printf("%s", DBufValue(&buf)); -#else printf("%s", DBufValue(&buf)); -#endif } break; case MSF_TYPE: -#ifdef OS2_POPUP - if (AsPopUp) { - StartPopUp(); - FillParagraph(DBufValue(&buf), 1); - EndPopUp(); - } else { - FillParagraph(DBufValue(&buf), 0); - } -#else FillParagraph(DBufValue(&buf)); -#endif break; case RUN_TYPE: diff --git a/src/main.c b/src/main.c index 077bb5f8..840169b2 100644 --- a/src/main.c +++ b/src/main.c @@ -12,7 +12,7 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: main.c,v 1.11 2000-02-18 03:46:01 dfs Exp $"; +static char const RCSID[] = "$Id: main.c,v 1.12 2005-09-28 02:39:14 dfs Exp $"; #ifdef HAVE_STDLIB_H #include @@ -76,11 +76,7 @@ long timelocal ARGS((struct tm *tm)); /* Whooo... the putchar/Putchar/PutChar macros are a mess... my apologies... */ -#ifdef OS2_POPUP -#define Putchar(c) {if (AsPopUp) PutcPopUp(c); else putchar(c);} -#else #define Putchar(c) PutChar(c) -#endif /***************************************************************/ /***************************************************************/ @@ -1345,21 +1341,11 @@ int jul, tim, *mins, *isdst; #define ISBLANK(c) (isspace(c) && (c) != '\n') #ifdef HAVE_PROTOS -#ifdef OS2_POPUP -PUBLIC void FillParagraph(char *s, int AsPopUp) -#else PUBLIC void FillParagraph(char *s) -#endif -#else -#ifdef OS2_POPUP -void FillParagraph(s, AsPopUp) -char *s; -int AsPopUp; #else void FillParagraph(s) char *s; #endif -#endif { int line = 0; diff --git a/src/protos.h b/src/protos.h index e90d93b8..11ab1304 100644 --- a/src/protos.h +++ b/src/protos.h @@ -10,7 +10,7 @@ /* */ /***************************************************************/ -/* $Id: protos.h,v 1.8 2000-02-18 03:46:05 dfs Exp $ */ +/* $Id: protos.h,v 1.9 2005-09-28 02:39:14 dfs Exp $ */ #ifdef HAVE_PROTOS #define ARGS(x) x @@ -38,12 +38,7 @@ int DoRem ARGS ((ParsePtr p)); int DoFlush ARGS ((ParsePtr p)); void DoExit ARGS ((ParsePtr p)); int ParseRem ARGS ((ParsePtr s, Trigger *trig, TimeTrig *tim)); -#ifdef OS2_POPUP -int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul, - int AsPopUp)); -#else int TriggerReminder ARGS ((ParsePtr p, Trigger *t, TimeTrig *tim, int jul)); -#endif int ShouldTriggerReminder ARGS ((Trigger *t, TimeTrig *tim, int jul)); int DoSubst ARGS ((ParsePtr p, DynamicBuffer *dbuf, Trigger *t, TimeTrig *tt, int jul, int mode)); int DoSubstFromString ARGS ((char *source, DynamicBuffer *dbuf, int jul, int tim)); @@ -141,11 +136,7 @@ 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)); -#ifdef OS2_POPUP -void FillParagraph ARGS ((char *s, int AsPopUp)); -#else void FillParagraph ARGS ((char *s)); -#endif 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)); @@ -160,13 +151,6 @@ void GotSigInt ARGS ((void)); #if defined(__OS2__) int fork ARGS ((void)); -#if defined(OS2_POPUP) -void StartPopUp ARGS ((void)); -void EndPopUp ARGS ((void)); -int PutcPopUp ARGS ((int c)); -int PutlPopUp ARGS ((char *s)); -int PutsPopUp ARGS ((char *s)); -#endif #endif #ifdef BROKEN_PUTC diff --git a/src/queue.c b/src/queue.c index 8fcf4541..4bffa386 100644 --- a/src/queue.c +++ b/src/queue.c @@ -11,7 +11,7 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: queue.c,v 1.16 2000-06-26 14:44:07 dfs Exp $"; +static char const RCSID[] = "$Id: queue.c,v 1.17 2005-09-28 02:39:14 dfs Exp $"; /* Solaris needs this to get select() prototype */ #ifdef __sun__ @@ -180,9 +180,9 @@ void HandleQueuedReminders() Daemon = 0; } else FileModTime = StatBuf.st_mtime; } - + /* Initialize the queue - initialize all the entries time of issue */ - + while (q) { q->tt.nexttime = (int) (SystemTime(0)/60 - 1); q->tt.nexttime = CalculateNextTime(q); @@ -256,20 +256,16 @@ void HandleQueuedReminders() } /* Set up global variables so some functions like trigdate() - and trigtime() work correctly */ + and trigtime() work correctly */ LastTriggerDate = JulianToday; LastTriggerTime = q->tt.ttime; LastTrigValid = 1; -#ifdef OS2_POPUP - (void) TriggerReminder(&p, &trig, &q->tt, JulianToday, 1); -#else (void) TriggerReminder(&p, &trig, &q->tt, JulianToday); -#endif if (Daemon < 0) { printf("NOTE endreminder\n"); } fflush(stdout); - + /* Calculate the next trigger time */ q->tt.nexttime = CalculateNextTime(q); } @@ -278,7 +274,7 @@ void HandleQueuedReminders() #endif exit(0); } - + /***************************************************************/ /* */ @@ -312,7 +308,7 @@ QueuedRem *q; } if (delta == NO_DELTA) { if (tim < curtime) { - return NO_TIME; + return NO_TIME; } else { return tim; } @@ -347,12 +343,12 @@ static QueuedRem *FindNextReminder() if (!ans) ans = q; else if (q->tt.nexttime < ans->tt.nexttime) ans = q; } - + q = q->next; } return ans; } - + /***************************************************************/ /* */ @@ -455,7 +451,7 @@ QueuedRem *q; if (v.type == TIM_TYPE) { ThisTime = v.v.val; } else if (v.type == INT_TYPE) { - if (v.v.val > 0) + if (v.v.val > 0) ThisTime = q->tt.nexttime + v.v.val; else ThisTime = q->tt.ttime + v.v.val; diff --git a/src/sort.c b/src/sort.c index 945e02d0..808d20ba 100644 --- a/src/sort.c +++ b/src/sort.c @@ -11,7 +11,7 @@ /***************************************************************/ #include "config.h" -static char const RCSID[] = "$Id: sort.c,v 1.6 2000-02-18 03:46:09 dfs Exp $"; +static char const RCSID[] = "$Id: sort.c,v 1.7 2005-09-28 02:39:14 dfs Exp $"; #include #include @@ -173,11 +173,7 @@ void IssueSortedReminders() break; case MSF_TYPE: -#ifdef OS2_POPUP - FillParagraph(cur->text, 0); -#else FillParagraph(cur->text); -#endif break; case RUN_TYPE: