Skip to main content

pyo3_ffi/
iterobject.rs

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