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