home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_200
/
272_01
/
onexit.doc
< prev
next >
Wrap
Text File
|
1987-07-17
|
1KB
|
45 lines
NAME
onexit -- install a common exit routine
SYNOPSIS
void onexit(addr);
int *addr; address of function to call
DESCRIPTION
This function is used to install a function into the
common_exit routine. It may be used to provide a means
of insuring that one or more operations are performed before
a program exit. Note that the installed routine is ONLY
called if common_exit() is called to invoke it. Doing
a standard exit() will NOT call the installed routine.
EXAMPLE
int ticks;
main() {
installtick(&ticks); /* install realtime counter */
onexit(&removetick); /* insure it is uninstalled later */
..
..
..
aabort(); /* this will invoke removetick() */
}
N.B.:
Any function in this Library which does an exit will
call common_exit. This includes (but may not be limited to):
error() aabort() badext()
eraok() exit2dos() cant()
This function is found in SMDLx.LIB for the Datalight Compiler.