HP3000-L Archives

November 2004, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Johan Harmsen <[log in to unmask]>
Reply To:
Johan Harmsen <[log in to unmask]>
Date:
Wed, 10 Nov 2004 08:35:53 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (56 lines)
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 *

ATOM RSS1 RSS2