ack/lang/m2/libm2/halt.c

31 lines
340 B
C
Raw Normal View History

1988-01-25 16:14:48 +00:00
#define MAXPROCS 20
#include <m2_traps.h>
static int callindex;
static int (*proclist[MAXPROCS])();
_cleanup()
{
register int i;
for (i = 0; i < callindex; i++) {
(*proclist[i])();
}
}
CallAtEnd(p)
int (*p)();
{
if (callindex >= MAXPROCS) {
TRP(M2_ENDPROCS);
}
else {
proclist[callindex++] = p;
}
}
1987-05-13 14:36:45 +00:00
_halt()
{
exit(0);
}