home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_02_10
/
2n10067a
< prev
next >
Wrap
Text File
|
1991-07-17
|
1KB
|
46 lines
/* -------------------------------------------------------
LISTING 2
File: testbrk.c
This is the test driver for the routines in
breakout.asm.
Author: David Burki
------------------------------------------------------- */
#include <stdio.h>
// define far a pointer to a void function
typedef void (far *PFV)();
// function prototypes
void insure(PFV);
void interrupt far pre_termination(void);
void cancel(void);
/* -------------------------------------------------------
function which performs any necessary clean-up before
terminating the application
------------------------------------------------------- */
void interrupt far pre_termination()
{
printf("\nIn the pre-termination function\npress any key\n");
getch();
exit(1);
}
// test driver main function
main()
{
// register the cancel function so exit will call it
atexit(cancel);
// install the breakout tool
insure((PFV)pre_termination);
// a never ending loop
for(;;)
;
}