pyo3_ffi/cpython/
complexobject.rs1use crate::PyObject;
2use std::os::raw::c_double;
3
4#[repr(C)]
5#[derive(Copy, Clone)]
6pub struct Py_complex {
7 pub real: c_double,
8 pub imag: c_double,
9}
10
11#[repr(C)]
20pub struct PyComplexObject {
21 pub ob_base: PyObject,
22 pub cval: Py_complex,
23}
24
25extern "C" {
26 #[cfg_attr(PyPy, link_name = "PyPyComplex_FromCComplex")]
27 pub fn PyComplex_FromCComplex(v: Py_complex) -> *mut PyObject;
28 #[cfg_attr(PyPy, link_name = "PyPyComplex_AsCComplex")]
29 pub fn PyComplex_AsCComplex(op: *mut PyObject) -> Py_complex;
30}