| 1 |
#[cfg(not(GraalPy))] |
| 2 |
use crate::object::*; |
| 3 |
#[cfg(not(GraalPy))] |
| 4 |
use crate::PyCodeObject; |
| 5 |
use crate::PyFrameObject; |
| 6 |
#[cfg(not(GraalPy))] |
| 7 |
use crate::PyThreadState; |
| 8 |
#[cfg(not(any(PyPy, GraalPy, Py_3_11)))] |
| 9 |
use std::ffi::c_char; |
| 10 |
use std::ffi::c_int; |
| 11 |
|
| 12 |
#[cfg(not(any(PyPy, GraalPy, Py_3_11)))] |
| 13 |
pub type PyFrameState = c_char; |
| 14 |
|
| 15 |
#[repr(C)] |
| 16 |
#[derive(Copy, Clone)] |
| 17 |
#[cfg(not(any(PyPy, GraalPy, Py_3_11)))] |
| 18 |
pub struct PyTryBlock { |
| 19 |
pub b_type: c_int, |
| 20 |
pub b_handler: c_int, |
| 21 |
pub b_level: c_int, |
| 22 |
} |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
extern "C" { |
| 29 |
#[cfg(not(GraalPy))] |
| 30 |
#[cfg_attr(PyPy, link_name = "PyPyFrame_New")] |
| 31 |
pub fn PyFrame_New( |
| 32 |
tstate: *mut PyThreadState, |
| 33 |
code: *mut PyCodeObject, |
| 34 |
globals: *mut PyObject, |
| 35 |
locals: *mut PyObject, |
| 36 |
) -> *mut PyFrameObject; |
| 37 |
|
| 38 |
|
| 39 |
pub fn PyFrame_BlockSetup(f: *mut PyFrameObject, _type: c_int, handler: c_int, level: c_int); |
| 40 |
#[cfg(not(any(PyPy, GraalPy, Py_3_11)))] |
| 41 |
pub fn PyFrame_BlockPop(f: *mut PyFrameObject) -> *mut PyTryBlock; |
| 42 |
|
| 43 |
pub fn PyFrame_LocalsToFast(f: *mut PyFrameObject, clear: c_int); |
| 44 |
pub fn PyFrame_FastToLocalsWithError(f: *mut PyFrameObject) -> c_int; |
| 45 |
pub fn PyFrame_FastToLocals(f: *mut PyFrameObject); |
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
#[cfg(not(Py_3_9))] |
| 50 |
pub fn PyFrame_ClearFreeList() -> c_int; |
| 51 |
} |