Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:42

0001 #ifndef Py_INTERNAL_ATEXIT_H
0002 #define Py_INTERNAL_ATEXIT_H
0003 #ifdef __cplusplus
0004 extern "C" {
0005 #endif
0006 
0007 #ifndef Py_BUILD_CORE
0008 #  error "this header requires Py_BUILD_CORE define"
0009 #endif
0010 
0011 
0012 //###############
0013 // runtime atexit
0014 
0015 typedef void (*atexit_callbackfunc)(void);
0016 
0017 struct _atexit_runtime_state {
0018     PyThread_type_lock mutex;
0019 #define NEXITFUNCS 32
0020     atexit_callbackfunc callbacks[NEXITFUNCS];
0021     int ncallbacks;
0022 };
0023 
0024 
0025 //###################
0026 // interpreter atexit
0027 
0028 struct atexit_callback;
0029 typedef struct atexit_callback {
0030     atexit_datacallbackfunc func;
0031     void *data;
0032     struct atexit_callback *next;
0033 } atexit_callback;
0034 
0035 typedef struct {
0036     PyObject *func;
0037     PyObject *args;
0038     PyObject *kwargs;
0039 } atexit_py_callback;
0040 
0041 struct atexit_state {
0042     atexit_callback *ll_callbacks;
0043     atexit_callback *last_ll_callback;
0044 
0045     // XXX The rest of the state could be moved to the atexit module state
0046     // and a low-level callback added for it during module exec.
0047     // For the moment we leave it here.
0048     atexit_py_callback **callbacks;
0049     int ncallbacks;
0050     int callback_len;
0051 };
0052 
0053 
0054 #ifdef __cplusplus
0055 }
0056 #endif
0057 #endif /* !Py_INTERNAL_ATEXIT_H */