1use crate::object::*;
2#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
3use libc::FILE;
4#[cfg(all(not(PyPy), any(Py_LIMITED_API, not(Py_3_10))))]
5use std::os::raw::c_char;
6use std::os::raw::c_int;
7
8extern "C" {
9 #[cfg(all(Py_LIMITED_API, not(PyPy)))]
10 pub fn Py_CompileString(string: *const c_char, p: *const c_char, s: c_int) -> *mut PyObject;
11
12 #[cfg_attr(PyPy, link_name = "PyPyErr_Print")]
13 pub fn PyErr_Print();
14 #[cfg_attr(PyPy, link_name = "PyPyErr_PrintEx")]
15 pub fn PyErr_PrintEx(arg1: c_int);
16 #[cfg_attr(PyPy, link_name = "PyPyErr_Display")]
17 pub fn PyErr_Display(arg1: *mut PyObject, arg2: *mut PyObject, arg3: *mut PyObject);
18
19 #[cfg(Py_3_12)]
20 pub fn PyErr_DisplayException(exc: *mut PyObject);
21}
22
23// skipped PyOS_InputHook
24
25pub const PYOS_STACK_MARGIN: c_int = 2048;
26
27// skipped PyOS_CheckStack under Microsoft C
28
29#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
30opaque_struct!(_mod);
31
32#[cfg(not(any(PyPy, Py_3_10)))]
33opaque_struct!(symtable);
34#[cfg(not(any(PyPy, Py_3_10)))]
35opaque_struct!(_node);
36
37#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
38#[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
39#[inline]
40pub unsafe fn PyParser_SimpleParseString(s: *const c_char, b: c_int) -> *mut _node {
41 #[allow(deprecated)]
42 crate::PyParser_SimpleParseStringFlags(s, b, 0)
43}
44
45#[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
46#[cfg_attr(Py_3_9, deprecated(note = "Python 3.9"))]
47#[inline]
48pub unsafe fn PyParser_SimpleParseFile(fp: *mut FILE, s: *const c_char, b: c_int) -> *mut _node {
49 #[allow(deprecated)]
50 crate::PyParser_SimpleParseFileFlags(fp, s, b, 0)
51}
52
53extern "C" {
54 #[cfg(not(any(PyPy, Py_3_10)))]
55 pub fn Py_SymtableString(
56 str: *const c_char,
57 filename: *const c_char,
58 start: c_int,
59 ) -> *mut symtable;
60 #[cfg(not(any(PyPy, Py_LIMITED_API, Py_3_10)))]
61 pub fn Py_SymtableStringObject(
62 str: *const c_char,
63 filename: *mut PyObject,
64 start: c_int,
65 ) -> *mut symtable;
66}
67