1use crate::object::PyObject;
2use std::os::raw::{c_char, c_int};
3
4pub const PY_STDIOTEXTMODE: &str = "b";
5
6extern "C" {
7 pub fn PyFile_FromFd(
8 arg1: c_int,
9 arg2: *const c_char,
10 arg3: *const c_char,
11 arg4: c_int,
12 arg5: *const c_char,
13 arg6: *const c_char,
14 arg7: *const c_char,
15 arg8: c_int,
16 ) -> *mut PyObject;
17 #[cfg_attr(PyPy, link_name = "PyPyFile_GetLine")]
18 pub fn PyFile_GetLine(arg1: *mut PyObject, arg2: c_int) -> *mut PyObject;
19 #[cfg_attr(PyPy, link_name = "PyPyFile_WriteObject")]
20 pub fn PyFile_WriteObject(arg1: *mut PyObject, arg2: *mut PyObject, arg3: c_int) -> c_int;
21 #[cfg_attr(PyPy, link_name = "PyPyFile_WriteString")]
22 pub fn PyFile_WriteString(arg1: *const c_char, arg2: *mut PyObject) -> c_int;
23 #[cfg_attr(PyPy, link_name = "PyPyFile_AsFileDescriptor")]
24 pub fn PyObject_AsFileDescriptor(arg1: *mut PyObject) -> c_int;
25}
26
27#[cfg_attr(windows, link(name = "pythonXY"))]
28extern "C" {
29 #[deprecated(note = "Python 3.12")]
30 pub static mut Py_FileSystemDefaultEncoding: *const c_char;
31 #[deprecated(note = "Python 3.12")]
32 pub static mut Py_FileSystemDefaultEncodeErrors: *const c_char;
33 #[deprecated(note = "Python 3.12")]
34 pub static mut Py_HasFileSystemDefaultEncoding: c_int;
35 // skipped 3.12-deprecated Py_UTF8Mode
36}
37
38// skipped _PyIsSelectable_fd
39