-
Notifications
You must be signed in to change notification settings - Fork 800
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
added missing ffi functions for `PyFrameObject` but without | ||
including unstable API from python 3.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,50 @@ | ||
#[allow(unused_imports)] | ||
use crate::object::PyObject; | ||
#[cfg(not(GraalPy))] | ||
#[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))] | ||
use crate::PyCodeObject; | ||
#[cfg(not(Py_LIMITED_API))] | ||
use crate::PyFrameObject; | ||
use std::os::raw::c_int; | ||
#[allow(unused_imports)] | ||
use std::os::raw::{c_char, c_int}; | ||
|
||
#[cfg(Py_LIMITED_API)] | ||
opaque_struct!(PyFrameObject); | ||
|
||
// skipped _PyInterpreterFrame from Include/cpython/pyframe.h | ||
|
||
extern "C" { | ||
pub fn PyFrame_GetLineNumber(f: *mut PyFrameObject) -> c_int; | ||
pub fn PyFrame_GetLineNumber(frame: *mut PyFrameObject) -> c_int; | ||
|
||
#[cfg(Py_3_9)] | ||
pub fn PyFrame_GetBack(frame: *mut PyFrameObject) -> *mut PyFrameObject; | ||
|
||
#[cfg(not(GraalPy))] | ||
#[cfg(any(Py_3_10, all(Py_3_9, not(Py_LIMITED_API))))] | ||
pub fn PyFrame_GetCode(f: *mut PyFrameObject) -> *mut PyCodeObject; | ||
pub fn PyFrame_GetCode(frame: *mut PyFrameObject) -> *mut PyCodeObject; | ||
|
||
#[cfg(Py_3_11)] | ||
pub fn PyFrame_GetGenerator(frame: *mut PyFrameObject) -> *mut PyObject; | ||
|
||
#[cfg(Py_3_11)] | ||
pub fn PyFrame_GetBuiltins(frame: *mut PyFrameObject) -> *mut PyObject; | ||
|
||
#[cfg(Py_3_11)] | ||
pub fn PyFrame_GetLocals(frame: *mut PyFrameObject) -> *mut PyObject; | ||
|
||
#[cfg(Py_3_11)] | ||
pub fn PyFrame_GetGlobals(frame: *mut PyFrameObject) -> *mut PyObject; | ||
|
||
#[cfg(Py_3_11)] | ||
pub fn PyFrame_GetLasti(frame: *mut PyFrameObject) -> c_int; | ||
|
||
#[cfg(Py_3_12)] | ||
pub fn PyFrame_GetVar(frame: *mut PyFrameObject, name: *mut PyObject) -> *mut PyObject; | ||
|
||
#[cfg(Py_3_12)] | ||
pub fn PyFrame_GetVarString(frame: *mut PyFrameObject, name: *mut c_char) -> *mut PyObject; | ||
|
||
// skipped PyUnstable_InterpreterFrame_GetCode from Include/cpython/pyframe.h | ||
// skipped PyUnstable_InterpreterFrame_GetLasti from Include/cpython/pyframe.h | ||
// skipped PyUnstable_InterpreterFrame_GetLine from Include/cpython/pyframe.h | ||
} |