aboutsummaryrefslogtreecommitdiff
path: root/src/intrcheck.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intrcheck.c')
-rw-r--r--src/intrcheck.c94
1 files changed, 47 insertions, 47 deletions
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 <MacHeaders>
#include <signal.h>
@@ -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 <console.h>.
- 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 <console.h>.
+ 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 */