Skip to main content

pyforge_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    pub fn PySeqIter_New(arg1: *mut PyObject) -> *mut PyObject;
16}
17
18#[inline]
19pub unsafe fn PyCallIter_Check(op: *mut PyObject) -> c_int {
20    (Py_TYPE(op) == &raw mut PyCallIter_Type) as c_int
21}
22
23extern_libpython! {
24    pub fn PyCallIter_New(arg1: *mut PyObject, arg2: *mut PyObject) -> *mut PyObject;
25}