5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
13 /* TODO - "except that a function is called after any previously registered
14 functions that had already been called at the time it was registered.
17 /* TODO: 32 is guaranteed. This should be dynamic but ATM gives problems
20 #define NUMBER_OF_SLOTS 40
22 void (*_PDCLIB_regstack[ NUMBER_OF_SLOTS ])( void ) = { _PDCLIB_closeall };
23 size_t _PDCLIB_regptr = NUMBER_OF_SLOTS;
25 void exit( int status )
27 while ( _PDCLIB_regptr < NUMBER_OF_SLOTS )
29 _PDCLIB_regstack[ _PDCLIB_regptr++ ]();
37 #include <_PDCLIB_test.h>
41 /* Unwinding of regstack tested in atexit(). */