mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	 08faf0016e
			
		
	
	
		08faf0016e
		
			
		
	
	
	
	
		
			
			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
		
	
	
	
		
			548 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			548 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #ifndef Py_INTERNAL_SYSMODULE_H
 | |
| #define Py_INTERNAL_SYSMODULE_H
 | |
| #ifdef __cplusplus
 | |
| extern "C" {
 | |
| #endif
 | |
| 
 | |
| #ifndef Py_BUILD_CORE
 | |
| #  error "this header requires Py_BUILD_CORE define"
 | |
| #endif
 | |
| 
 | |
| PyAPI_FUNC(int) _PySys_Audit(
 | |
|     PyThreadState *tstate,
 | |
|     const char *event,
 | |
|     const char *argFormat,
 | |
|     ...);
 | |
| 
 | |
| /* We want minimal exposure of this function, so use extern rather than
 | |
|    PyAPI_FUNC() to not export the symbol. */
 | |
| extern void _PySys_ClearAuditHooks(PyThreadState *tstate);
 | |
| 
 | |
| #ifdef __cplusplus
 | |
| }
 | |
| #endif
 | |
| #endif /* !Py_INTERNAL_SYSMODULE_H */
 |