Index: dist/src/Include/pythonrun.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pythonrun.h,v retrieving revision 2.62 diff -c -r2.62 pythonrun.h *** dist/src/Include/pythonrun.h 13 Feb 2003 22:07:52 -0000 2.62 --- dist/src/Include/pythonrun.h 30 Apr 2003 22:04:13 -0000 *************** *** 75,80 **** --- 75,81 ---- PyAPI_FUNC(void) PyErr_Display(PyObject *, PyObject *, PyObject *); PyAPI_FUNC(int) Py_AtExit(void (*func)(void)); + PyAPI_FUNC(int) Py_AtInit(void (*func)(void)); PyAPI_FUNC(void) Py_Exit(int); Index: dist/src/Python/pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.193 diff -c -r2.193 pythonrun.c *** dist/src/Python/pythonrun.c 22 Apr 2003 11:18:00 -0000 2.193 --- dist/src/Python/pythonrun.c 30 Apr 2003 22:04:16 -0000 *************** *** 106,111 **** --- 106,135 ---- return flag; } + #define NINITFUNCS 32 + static void (*initfuncs[NINITFUNCS])(void); + static int ninitfuncs = 0; + + int Py_AtInit(void (*func)(void)) + { + if (ninitfuncs>= NINITFUNCS) + return -1; + if (!func) + return -1; + initfuncs[ninitfuncs++] = func; + return 0; + } + + static void initinitialize(void) + { + int i; + for(i=0;i

AltStyle によって変換されたページ (->オリジナル) /