diff options
Diffstat (limited to 'Include')
-rw-r--r-- | Include/cpython/interpreteridobject.h | 11 | ||||
-rw-r--r-- | Include/cpython/pylifecycle.h | 4 | ||||
-rw-r--r-- | Include/cpython/pystate.h | 1 | ||||
-rw-r--r-- | Include/internal/pycore_interp.h | 3 | ||||
-rw-r--r-- | Include/internal/pycore_interp_id.h | 28 | ||||
-rw-r--r-- | Include/interpreteridobject.h | 17 |
6 files changed, 33 insertions, 31 deletions
diff --git a/Include/cpython/interpreteridobject.h b/Include/cpython/interpreteridobject.h new file mode 100644 index 0000000..4ab9ad5 --- /dev/null +++ b/Include/cpython/interpreteridobject.h @@ -0,0 +1,11 @@ +#ifndef Py_CPYTHON_INTERPRETERIDOBJECT_H +# error "this header file must not be included directly" +#endif + +/* Interpreter ID Object */ + +PyAPI_DATA(PyTypeObject) PyInterpreterID_Type; + +PyAPI_FUNC(PyObject *) PyInterpreterID_New(int64_t); +PyAPI_FUNC(PyObject *) PyInterpreterState_GetIDObject(PyInterpreterState *); +PyAPI_FUNC(PyInterpreterState *) PyInterpreterID_LookUp(PyObject *); diff --git a/Include/cpython/pylifecycle.h b/Include/cpython/pylifecycle.h index a78cec9..d425a23 100644 --- a/Include/cpython/pylifecycle.h +++ b/Include/cpython/pylifecycle.h @@ -77,3 +77,7 @@ typedef struct { PyAPI_FUNC(PyStatus) Py_NewInterpreterFromConfig( PyThreadState **tstate_p, const PyInterpreterConfig *config); + +typedef void (*atexit_datacallbackfunc)(void *); +PyAPI_FUNC(int) PyUnstable_AtExit( + PyInterpreterState *, atexit_datacallbackfunc, void *); diff --git a/Include/cpython/pystate.h b/Include/cpython/pystate.h index 4254110..30de4ee 100644 --- a/Include/cpython/pystate.h +++ b/Include/cpython/pystate.h @@ -8,6 +8,7 @@ PyAPI_FUNC(int) _PyInterpreterState_RequiresIDRef(PyInterpreterState *); PyAPI_FUNC(void) _PyInterpreterState_RequireIDRef(PyInterpreterState *, int); +PyAPI_FUNC(PyObject *) PyUnstable_InterpreterState_GetMainModule(PyInterpreterState *); /* State unique per thread */ diff --git a/Include/internal/pycore_interp.h b/Include/internal/pycore_interp.h index 522ce4a..bd6a9f2 100644 --- a/Include/internal/pycore_interp.h +++ b/Include/internal/pycore_interp.h @@ -238,9 +238,6 @@ extern int _PyInterpreterState_IDInitref(PyInterpreterState *); extern int _PyInterpreterState_IDIncref(PyInterpreterState *); extern void _PyInterpreterState_IDDecref(PyInterpreterState *); -// Export for '_xxsubinterpreters' shared extension -PyAPI_FUNC(PyObject*) _PyInterpreterState_GetMainModule(PyInterpreterState *); - extern const PyConfig* _PyInterpreterState_GetConfig(PyInterpreterState *interp); /* Get a copy of the current interpreter configuration. diff --git a/Include/internal/pycore_interp_id.h b/Include/internal/pycore_interp_id.h deleted file mode 100644 index 8c6f831..0000000 --- a/Include/internal/pycore_interp_id.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Interpreter ID Object */ - -#ifndef Py_INTERNAL_INTERPRETERIDOBJECT_H -#define Py_INTERNAL_INTERPRETERIDOBJECT_H -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef Py_BUILD_CORE -# error "this header requires Py_BUILD_CORE define" -#endif - -// Export for '_xxsubinterpreters' shared extension -PyAPI_DATA(PyTypeObject) _PyInterpreterID_Type; - -// Export for '_xxsubinterpreters' shared extension -PyAPI_FUNC(PyObject*) _PyInterpreterID_New(int64_t); - -// Export for '_xxinterpchannels' shared extension -PyAPI_FUNC(PyObject*) _PyInterpreterState_GetIDObject(PyInterpreterState *); - -// Export for '_testinternalcapi' shared extension -PyAPI_FUNC(PyInterpreterState*) _PyInterpreterID_LookUp(PyObject *); - -#ifdef __cplusplus -} -#endif -#endif // !Py_INTERNAL_INTERPRETERIDOBJECT_H diff --git a/Include/interpreteridobject.h b/Include/interpreteridobject.h new file mode 100644 index 0000000..8432632 --- /dev/null +++ b/Include/interpreteridobject.h @@ -0,0 +1,17 @@ +#ifndef Py_INTERPRETERIDOBJECT_H +#define Py_INTERPRETERIDOBJECT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef Py_LIMITED_API +# define Py_CPYTHON_INTERPRETERIDOBJECT_H +# include "cpython/interpreteridobject.h" +# undef Py_CPYTHON_INTERPRETERIDOBJECT_H +#endif + +#ifdef __cplusplus +} +#endif +#endif /* !Py_INTERPRETERIDOBJECT_H */ |