use crate::PyThreadState;
use crate::{PyFrameObject, PyInterpreterState, PyObject};
use std::ffi::c_int;
pub type Py_tracefunc = unsafe extern "C" fn(
obj: *mut PyObject,
frame: *mut PyFrameObject,
what: c_int,
arg: *mut PyObject,
) -> c_int;
pub const PyTrace_CALL: c_int = 0;
pub const PyTrace_EXCEPTION: c_int = 1;
pub const PyTrace_LINE: c_int = 2;
pub const PyTrace_RETURN: c_int = 3;
pub const PyTrace_C_CALL: c_int = 4;
pub const PyTrace_C_EXCEPTION: c_int = 5;
pub const PyTrace_C_RETURN: c_int = 6;
pub const PyTrace_OPCODE: c_int = 7;
#[cfg(not(Py_3_14))]
#[repr(C)]
#[derive(Clone, Copy)]
pub(crate) struct _PyErr_StackItem {
exc_value: *mut PyObject,
previous_item: *mut _PyErr_StackItem,
}
extern_libpython! {
#[cfg(Py_3_13)]
pub fn PyThreadState_GetUnchecked() -> *mut PyThreadState;
#[cfg(not(Py_3_13))]
pub(crate) fn _PyThreadState_UncheckedGet() -> *mut PyThreadState;
pub fn PyThreadState_EnterTracing(state: *mut PyThreadState);
pub fn PyThreadState_LeaveTracing(state: *mut PyThreadState);
pub fn PyGILState_Check() -> c_int;
pub fn PyInterpreterState_Main() -> *mut PyInterpreterState;
pub fn PyInterpreterState_Head() -> *mut PyInterpreterState;
pub fn PyInterpreterState_Next(interp: *mut PyInterpreterState) -> *mut PyInterpreterState;
pub fn PyInterpreterState_ThreadHead(interp: *mut PyInterpreterState) -> *mut PyThreadState;
pub fn PyThreadState_Next(tstate: *mut PyThreadState) -> *mut PyThreadState;
pub fn PyThreadState_DeleteCurrent();
}