File indexing completed on 2025-01-18 10:06:40
0001 #ifndef Py_LIMITED_API
0002 #ifndef Py_CONTEXT_H
0003 #define Py_CONTEXT_H
0004 #ifdef __cplusplus
0005 extern "C" {
0006 #endif
0007
0008 PyAPI_DATA(PyTypeObject) PyContext_Type;
0009 typedef struct _pycontextobject PyContext;
0010
0011 PyAPI_DATA(PyTypeObject) PyContextVar_Type;
0012 typedef struct _pycontextvarobject PyContextVar;
0013
0014 PyAPI_DATA(PyTypeObject) PyContextToken_Type;
0015 typedef struct _pycontexttokenobject PyContextToken;
0016
0017
0018 #define PyContext_CheckExact(o) Py_IS_TYPE((o), &PyContext_Type)
0019 #define PyContextVar_CheckExact(o) Py_IS_TYPE((o), &PyContextVar_Type)
0020 #define PyContextToken_CheckExact(o) Py_IS_TYPE((o), &PyContextToken_Type)
0021
0022
0023 PyAPI_FUNC(PyObject *) PyContext_New(void);
0024 PyAPI_FUNC(PyObject *) PyContext_Copy(PyObject *);
0025 PyAPI_FUNC(PyObject *) PyContext_CopyCurrent(void);
0026
0027 PyAPI_FUNC(int) PyContext_Enter(PyObject *);
0028 PyAPI_FUNC(int) PyContext_Exit(PyObject *);
0029
0030
0031
0032
0033
0034
0035 PyAPI_FUNC(PyObject *) PyContextVar_New(
0036 const char *name, PyObject *default_value);
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 PyAPI_FUNC(int) PyContextVar_Get(
0055 PyObject *var, PyObject *default_value, PyObject **value);
0056
0057
0058
0059
0060
0061 PyAPI_FUNC(PyObject *) PyContextVar_Set(PyObject *var, PyObject *value);
0062
0063
0064
0065
0066
0067 PyAPI_FUNC(int) PyContextVar_Reset(PyObject *var, PyObject *token);
0068
0069
0070
0071 PyAPI_FUNC(PyObject *) _PyContext_NewHamtForTests(void);
0072
0073
0074 #ifdef __cplusplus
0075 }
0076 #endif
0077 #endif
0078 #endif