From c2587c76f1b416cdbecb979e54941933246bf856 Mon Sep 17 00:00:00 2001 From: Skip Montanaro Date: Tue, 16 Feb 2021 20:14:16 -0600 Subject: starting over --- src/intrcheck.c | 94 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) (limited to 'src/intrcheck.c') diff --git a/src/intrcheck.c b/src/intrcheck.c index 8e2fb5b..8dbeb5f 100644 --- a/src/intrcheck.c +++ b/src/intrcheck.c @@ -2,12 +2,12 @@ Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. - All Rights Reserved + All Rights Reserved -Permission to use, copy, modify, and distribute this software and its -documentation for any purpose and without fee is hereby granted, +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that -both that copyright notice and this permission notice appear in +both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. @@ -36,12 +36,12 @@ initintr() int intrcheck() { - int interrupted = 0; - while (kbhit()) { - if (getch() == '\003') - interrupted = 1; - } - return interrupted; + int interrupted = 0; + while (kbhit()) { + if (getch() == '\003') + interrupted = 1; + } + return interrupted; } #define OK @@ -52,7 +52,7 @@ intrcheck() #ifdef THINK_C /* This is for THINK C 4.0. - For 3.0, you may have to remove the signal stuff. */ + For 3.0, you may have to remove the signal stuff. */ #include #include @@ -62,44 +62,44 @@ static int interrupted; static SIGTYPE intcatcher(sig) - int sig; + int sig; { - interrupted = 1; - signal(SIGINT, intcatcher); + interrupted = 1; + signal(SIGINT, intcatcher); } void initintr() { - if (signal(SIGINT, SIG_IGN) != SIG_IGN) - signal(SIGINT, intcatcher); + if (signal(SIGINT, SIG_IGN) != SIG_IGN) + signal(SIGINT, intcatcher); } int intrcheck() { - register EvQElPtr q; - - /* This is like THINK C 4.0's . - I'm not sure why FlushEvents must be called from asm{}. */ - for (q = (EvQElPtr)EventQueue.qHead; q; q = (EvQElPtr)q->qLink) { - if (q->evtQWhat == keyDown && - (char)q->evtQMessage == '.' && - (q->evtQModifiers & cmdKey) != 0) { - - asm { - moveq #keyDownMask,d0 - _FlushEvents - } - interrupted = 1; - break; - } - } - if (interrupted) { - interrupted = 0; - return 1; - } - return 0; + register EvQElPtr q; + + /* This is like THINK C 4.0's . + I'm not sure why FlushEvents must be called from asm{}. */ + for (q = (EvQElPtr)EventQueue.qHead; q; q = (EvQElPtr)q->qLink) { + if (q->evtQWhat == keyDown && + (char)q->evtQMessage == '.' && + (q->evtQModifiers & cmdKey) != 0) { + + asm { + moveq #keyDownMask,d0 + _FlushEvents + } + interrupted = 1; + break; + } + } + if (interrupted) { + interrupted = 0; + return 1; + } + return 0; } #define OK @@ -119,26 +119,26 @@ static int interrupted; static SIGTYPE intcatcher(sig) - int sig; + int sig; { - interrupted = 1; - signal(SIGINT, intcatcher); + interrupted = 1; + signal(SIGINT, intcatcher); } void initintr() { - if (signal(SIGINT, SIG_IGN) != SIG_IGN) - signal(SIGINT, intcatcher); + if (signal(SIGINT, SIG_IGN) != SIG_IGN) + signal(SIGINT, intcatcher); } int intrcheck() { - if (!interrupted) - return 0; - interrupted = 0; - return 1; + if (!interrupted) + return 0; + interrupted = 0; + return 1; } #endif /* !OK */ -- cgit v1.2.3