| 1 | use crate::object::*; |
| 2 | use std::ffi::c_int; |
| 3 | use std::ptr::addr_of_mut; |
| 4 | |
| 5 | #[cfg_attr(windows, link(name = "pythonXY"))] |
| 6 | extern "C" { |
| 7 | pub static mut PySeqIter_Type: PyTypeObject; |
| 8 | pub static mut PyCallIter_Type: PyTypeObject; |
| 9 | } |
| 10 | |
| 11 | #[inline] |
| 12 | pub unsafe fn PySeqIter_Check(op: *mut PyObject) -> c_int { |
| 13 | (Py_TYPE(op) == addr_of_mut!(PySeqIter_Type)) as c_int |
| 14 | } |
| 15 | |
| 16 | extern "C" { |
| 17 | #[cfg_attr(PyPy, link_name = "PyPySeqIter_New")] |
| 18 | pub fn PySeqIter_New(arg1: *mut PyObject) -> *mut PyObject; |
| 19 | } |
| 20 | |
| 21 | #[inline] |
| 22 | pub unsafe fn PyCallIter_Check(op: *mut PyObject) -> c_int { |
| 23 | (Py_TYPE(op) == addr_of_mut!(PyCallIter_Type)) as c_int |
| 24 | } |
| 25 | |
| 26 | extern "C" { |
| 27 | #[cfg_attr(PyPy, link_name = "PyPyCallIter_New")] |
| 28 | pub fn PyCallIter_New(arg1: *mut PyObject, arg2: *mut PyObject) -> *mut PyObject; |
| 29 | } |