3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
10 #include "_PDCLIB_io.h"
12 /* TODO - "except that a function is called after any previously registered
13 functions that had already been called at the time it was registered.
16 /* TODO: 32 is guaranteed. This should be dynamic but ATM gives problems
19 #define NUMBER_OF_SLOTS 40
21 void (*_PDCLIB_exitstack[ NUMBER_OF_SLOTS ])( void ) = { _PDCLIB_closeall };
22 size_t _PDCLIB_exitptr = NUMBER_OF_SLOTS;
24 void exit( int status )
26 while ( _PDCLIB_exitptr < NUMBER_OF_SLOTS )
28 _PDCLIB_exitstack[ _PDCLIB_exitptr++ ]();
36 #include "_PDCLIB_test.h"
40 /* Unwinding of regstack tested in atexit(). */