mirror of
https://github.com/python/cpython.git
synced 2026-01-31 11:42:19 +00:00
Add _PySys_Audit() function to the internal C API: similar to PySys_Audit(), but requires a mandatory tstate parameter. Cleanup sys_audit_tstate() code: remove code path for NULL tstate, since the function exits at entry if tstate is NULL. Remove also code path for NULL tstate->interp: should_audit() now ensures that it is not NULL (even if tstate->interp cannot be NULL in practice). PySys_AddAuditHook() now checks if tstate is not NULL to decide if tstate can be used or not, and tstate is set to NULL if the runtime is not initialized yet. Use _PySys_Audit() in sysmodule.c.
24 lines
575 B
C
24 lines
575 B
C
#ifndef Py_CPYTHON_SYSMODULE_H
|
|
# error "this header file must not be included directly"
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
PyAPI_FUNC(PyObject *) _PySys_GetObjectId(_Py_Identifier *key);
|
|
PyAPI_FUNC(int) _PySys_SetObjectId(_Py_Identifier *key, PyObject *);
|
|
|
|
PyAPI_FUNC(size_t) _PySys_GetSizeOf(PyObject *);
|
|
|
|
typedef int(*Py_AuditHookFunction)(const char *, PyObject *, void *);
|
|
|
|
PyAPI_FUNC(int) PySys_Audit(
|
|
const char *event,
|
|
const char *argFormat,
|
|
...);
|
|
PyAPI_FUNC(int) PySys_AddAuditHook(Py_AuditHookFunction, void*);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|