| 1 |
use crate::PyObject; |
| 2 |
use std::ffi::c_double; |
| 3 |
|
| 4 |
#[repr(C)] |
| 5 |
#[derive(Copy, Clone)] |
| 6 |
pub struct Py_complex { |
| 7 |
pub real: c_double, |
| 8 |
pub imag: c_double, |
| 9 |
} |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
#[repr(C)] |
| 20 |
pub struct PyComplexObject { |
| 21 |
pub ob_base: PyObject, |
| 22 |
pub cval: Py_complex, |
| 23 |
} |
| 24 |
|
| 25 |
extern "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 |
} |