[net.lang.f77] Controlling User Interrupts in F77

benw@pyuxn.UUCP (B Weber) (01/27/84)

I put this request out quite some time ago on the net, but under a
different guise, so, here goes again...

We are converting an enormous amount of software from an old
dialect of fortran to UNIX F77 (USG 5.0, on VAX and 3B). The
old dialect has a user interrupt handler that allowed a local
jump to a label when an interrupt (e.g., the break key) was
pressed.  The syntax was something like onint(nnn), and when the
user pressed break anywhere in the routine, he/she whould jump
to statement label nnn.

UNIX, of course, allows you to trap a signal and call an integer
valued function with no arguments.  That allows you to go down one
level of subroutine, but you still come back to where you were in
the original routine.  We use the current interrupt routine to let
users stop what they are doing, for instance, a lengthy report, and
return to a prompt.

I think that the programs could eventually be rewritten to work with
the UNIX signal trapping, but we are under a tight deadline, the
current interrupt routine pervades the code and big bucks are at
stake.  A large rewrite is completely out of the question.  We have
tried using setjmp and longjmp as bandaids, but haven't gotten them
to work well with F77.  We've also considered writing all user
data out to a temporary file, restarting the program from the
beginning, and reading the data back in, but there are hundreds
and possibly thousands of pieces of data, and it's supposed to
be a fast on-line system.

Any ideas would be appreciated.  However, PLEASE don't send
responses saying we should rewrite it in C, lectures about
programming style, operating system portability, and the
like. I am not writing this from scratch...just trying to
get existing programs working on UNIX quickly.  As I said, I
posted a similar question to the net some time ago, and this
was the kind or response I got.


				Many thanks in advance,
				Ben Weber   pyuxn!benw
				AT&T Tech (WECo)
				6 Corporate Pl.
				Piscataway, NJ 08854