#include "Python.h"
#include "pycore_call.h"
#include "pycore_context.h"
#include "pycore_freelist.h"
#include "pycore_gc.h"
#include "pycore_hamt.h"
#include "pycore_initconfig.h"
#include "pycore_object.h"
#include "pycore_pyerrors.h"
#include "pycore_pystate.h"
#include "clinic/context.c.h"
#define ENSURE_Context(o, err_ret) …
#define ENSURE_ContextVar(o, err_ret) …
#define ENSURE_ContextToken(o, err_ret) …
static PyContext *
context_new_empty(void);
static PyContext *
context_new_from_vars(PyHamtObject *vars);
static inline PyContext *
context_get(void);
static PyContextToken *
token_new(PyContext *ctx, PyContextVar *var, PyObject *val);
static PyContextVar *
contextvar_new(PyObject *name, PyObject *def);
static int
contextvar_set(PyContextVar *var, PyObject *val);
static int
contextvar_del(PyContextVar *var);
PyObject *
_PyContext_NewHamtForTests(void)
{ … }
PyObject *
PyContext_New(void)
{ … }
PyObject *
PyContext_Copy(PyObject * octx)
{ … }
PyObject *
PyContext_CopyCurrent(void)
{ … }
static const char *
context_event_name(PyContextEvent event) { … }
static void
notify_context_watchers(PyThreadState *ts, PyContextEvent event, PyObject *ctx)
{ … }
int
PyContext_AddWatcher(PyContext_WatchCallback callback)
{ … }
int
PyContext_ClearWatcher(int watcher_id)
{ … }
static inline void
context_switched(PyThreadState *ts)
{ … }
static int
_PyContext_Enter(PyThreadState *ts, PyObject *octx)
{ … }
int
PyContext_Enter(PyObject *octx)
{ … }
static int
_PyContext_Exit(PyThreadState *ts, PyObject *octx)
{ … }
int
PyContext_Exit(PyObject *octx)
{ … }
PyObject *
PyContextVar_New(const char *name, PyObject *def)
{ … }
int
PyContextVar_Get(PyObject *ovar, PyObject *def, PyObject **val)
{ … }
PyObject *
PyContextVar_Set(PyObject *ovar, PyObject *val)
{ … }
int
PyContextVar_Reset(PyObject *ovar, PyObject *otok)
{ … }
static inline PyContext *
_context_alloc(void)
{ … }
static PyContext *
context_new_empty(void)
{ … }
static PyContext *
context_new_from_vars(PyHamtObject *vars)
{ … }
static inline PyContext *
context_get(void)
{ … }
static int
context_check_key_type(PyObject *key)
{ … }
static PyObject *
context_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
context_tp_clear(PyContext *self)
{ … }
static int
context_tp_traverse(PyContext *self, visitproc visit, void *arg)
{ … }
static void
context_tp_dealloc(PyContext *self)
{ … }
static PyObject *
context_tp_iter(PyContext *self)
{ … }
static PyObject *
context_tp_richcompare(PyObject *v, PyObject *w, int op)
{ … }
static Py_ssize_t
context_tp_len(PyContext *self)
{ … }
static PyObject *
context_tp_subscript(PyContext *self, PyObject *key)
{ … }
static int
context_tp_contains(PyContext *self, PyObject *key)
{ … }
static PyObject *
_contextvars_Context_get_impl(PyContext *self, PyObject *key,
PyObject *default_value)
{ … }
static PyObject *
_contextvars_Context_items_impl(PyContext *self)
{ … }
static PyObject *
_contextvars_Context_keys_impl(PyContext *self)
{ … }
static PyObject *
_contextvars_Context_values_impl(PyContext *self)
{ … }
static PyObject *
_contextvars_Context_copy_impl(PyContext *self)
{ … }
static PyObject *
context_run(PyContext *self, PyObject *const *args,
Py_ssize_t nargs, PyObject *kwnames)
{ … }
static PyMethodDef PyContext_methods[] = …;
static PySequenceMethods PyContext_as_sequence = …;
static PyMappingMethods PyContext_as_mapping = …;
PyTypeObject PyContext_Type = …;
static int
contextvar_set(PyContextVar *var, PyObject *val)
{ … }
static int
contextvar_del(PyContextVar *var)
{ … }
static Py_hash_t
contextvar_generate_hash(void *addr, PyObject *name)
{ … }
static PyContextVar *
contextvar_new(PyObject *name, PyObject *def)
{ … }
static PyObject *
contextvar_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
contextvar_tp_clear(PyContextVar *self)
{ … }
static int
contextvar_tp_traverse(PyContextVar *self, visitproc visit, void *arg)
{ … }
static void
contextvar_tp_dealloc(PyContextVar *self)
{ … }
static Py_hash_t
contextvar_tp_hash(PyContextVar *self)
{ … }
static PyObject *
contextvar_tp_repr(PyContextVar *self)
{ … }
static PyObject *
_contextvars_ContextVar_get_impl(PyContextVar *self, PyObject *default_value)
{ … }
static PyObject *
_contextvars_ContextVar_set(PyContextVar *self, PyObject *value)
{ … }
static PyObject *
_contextvars_ContextVar_reset(PyContextVar *self, PyObject *token)
{ … }
static PyMemberDef PyContextVar_members[] = …;
static PyMethodDef PyContextVar_methods[] = …;
PyTypeObject PyContextVar_Type = …;
static PyObject * get_token_missing(void);
static PyObject *
token_tp_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{ … }
static int
token_tp_clear(PyContextToken *self)
{ … }
static int
token_tp_traverse(PyContextToken *self, visitproc visit, void *arg)
{ … }
static void
token_tp_dealloc(PyContextToken *self)
{ … }
static PyObject *
token_tp_repr(PyContextToken *self)
{ … }
static PyObject *
token_get_var(PyContextToken *self, void *Py_UNUSED(ignored))
{ … }
static PyObject *
token_get_old_value(PyContextToken *self, void *Py_UNUSED(ignored))
{ … }
static PyGetSetDef PyContextTokenType_getsetlist[] = …;
static PyMethodDef PyContextTokenType_methods[] = …;
PyTypeObject PyContextToken_Type = …;
static PyContextToken *
token_new(PyContext *ctx, PyContextVar *var, PyObject *val)
{ … }
static PyObject *
context_token_missing_tp_repr(PyObject *self)
{ … }
static void
context_token_missing_tp_dealloc(_PyContextTokenMissing *Py_UNUSED(self))
{ … }
PyTypeObject _PyContextTokenMissing_Type = …;
static PyObject *
get_token_missing(void)
{ … }
PyStatus
_PyContext_Init(PyInterpreterState *interp)
{ … }