diff options
author | Steve Dower <steve.dower@microsoft.com> | 2019-05-23 15:45:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-23 15:45:22 (GMT) |
commit | b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184 (patch) | |
tree | 5370a2a075707cb0b37ce135cad6ffe23da424c4 /Include/internal | |
parent | e788057a9188ff37e232729815dfda2529079420 (diff) | |
download | cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.zip cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.tar.gz cpython-b82e17e626f7b1cd98aada0b1ebb65cb9f8fb184.tar.bz2 |
bpo-36842: Implement PEP 578 (GH-12613)
Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
Diffstat (limited to 'Include/internal')
-rw-r--r-- | Include/internal/pycore_pystate.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h index 1561328..ef1d8a0 100644 --- a/Include/internal/pycore_pystate.h +++ b/Include/internal/pycore_pystate.h @@ -9,8 +9,10 @@ extern "C" { #endif #include "cpython/coreconfig.h" +#include "fileobject.h" #include "pystate.h" #include "pythread.h" +#include "sysmodule.h" #include "pycore_gil.h" /* _gil_runtime_state */ #include "pycore_pathconfig.h" @@ -131,6 +133,8 @@ struct _is { uint64_t tstate_next_unique_id; struct _warnings_runtime_state warnings; + + PyObject *audit_hooks; }; PyAPI_FUNC(struct _is*) _PyInterpreterState_LookUpID(PY_INT64_T); @@ -154,6 +158,13 @@ struct _xidregitem { struct _xidregitem *next; }; +/* runtime audit hook state */ + +typedef struct _Py_AuditHookEntry { + struct _Py_AuditHookEntry *next; + Py_AuditHookFunction hookCFunction; + void *userData; +} _Py_AuditHookEntry; /* GIL state */ @@ -224,6 +235,11 @@ typedef struct pyruntimestate { struct _gilstate_runtime_state gilstate; _PyPreConfig preconfig; + + Py_OpenCodeHookFunction open_code_hook; + void *open_code_userdata; + _Py_AuditHookEntry *audit_hook_head; + // XXX Consolidate globals found via the check-c-globals script. } _PyRuntimeState; |