home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Virtual Reality Zone
/
VRZONE.ISO
/
mac
/
PC
/
PCGLOVE
/
GLOVE
/
OBJGLV.ZIP
/
SRC
/
DEMO4B
/
STANDARD.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1992-10-31
|
524b
|
31 lines
#include "standard.hpp"
#define NUM_FUNCS 32
// Following is a work-alike to atexit().
atexit_t exit_funcs_tbl[NUM_FUNCS];
int numInserted = 0;
void reset_sub_exits()
{
numInserted = 0;
}
int sub_exit(atexit_t func)
{
// return (atexit(func));
/********/
if (numInserted == NUM_FUNCS) return -1;
exit_funcs_tbl[numInserted] = func;
numInserted ++;
return 0;
/********/
}
void sub_exit_funcs()
{
/*****/
int i;
for (i = numInserted - 1; i >= 0; i --) (exit_funcs_tbl[i])();
/*****/
}