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_quickexitstack[ NUMBER_OF_SLOTS ])( void ) = { 0 };
22 size_t _PDCLIB_quickexitptr = NUMBER_OF_SLOTS;
24 void quick_exit( int status )
26 while ( _PDCLIB_quickexitptr < NUMBER_OF_SLOTS )
28 _PDCLIB_quickexitstack[ _PDCLIB_quickexitptr++ ]();
36 #include "_PDCLIB_test.h"
40 /* Unwinding of regstack tested in at_quick_exit(). */