Subject: | |
From: | |
Reply To: | |
Date: | Wed, 10 Nov 2004 08:35:53 +0100 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
Hi John
Just as an example
# include <stdio.h>
# include <time.h>
# pragma intrinsic XCONTRAP
# pragma intrinsic RESETCONTROL
void dotrap(void)
{
int oldplabel;
time_t Time;
Time = time(NULL);
printf("<control-y>...%s", ctime(&Time));
XCONTRAP((int) dotrap, &oldplabel);
RESETCONTROL();
}
int main(int argc, char *argv[])
{
int oldplabel;
XCONTRAP((int) dotrap, &oldplabel);
sleep(60);
XCONTRAP(0, &oldplabel);
}
Note that pressing control-y resets the sleep to
sixty seconds every time, better not mix
intrinsic and c library functions
HTH
Johan
----- Original Message -----
From: "john pitman" <[log in to unmask]>
To: <[log in to unmask]>
Sent: Wednesday, 10 November, 2004 7:18
Subject: [HP3000-L] C code for ctrl-Y handling
> Does anybody have a sample they could pass on please??
>
> Can barely remember what SPL code looks like...much less C.
>
>
>
> TIA,
>
> jp
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|