# traceback.rs - source
Source of the Rust file `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/pyo3-0.13.2/src/ffi/traceback.rs`.
Keywords: rust, rustlang, rust-lang

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25

    use crate::ffi::object::*;
    use std::os::raw::c_int;

    extern "C" {
        #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Here")]
        pub fn PyTraceBack_Here(arg1: *mut crate::ffi::PyFrameObject) -> c_int;
        #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Print")]
        pub fn PyTraceBack_Print(arg1: *mut PyObject, arg2: *mut PyObject) -> c_int;
    }

    #[cfg_attr(windows, link(name = "pythonXY"))]
    extern "C" {
        #[cfg_attr(PyPy, link_name = "PyPyTraceBack_Type")]
        pub static mut PyTraceBack_Type: PyTypeObject;

        #[cfg(PyPy)]
        #[link_name = "PyPyTraceBack_Check"]
        pub fn PyTraceBack_Check(op: *mut PyObject) -> c_int;
    }

    #[inline]
    #[cfg(not(PyPy))]
    pub unsafe fn PyTraceBack_Check(op: *mut PyObject) -> c_int {
        (Py_TYPE(op) == &mut PyTraceBack_Type) as c_int
    }