pyo3_ffi/
iterobject.rs

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