python27_sys/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#![no_std]
#![allow(
    non_camel_case_types,
    non_upper_case_globals,
    non_snake_case,
    unused_parens,
    clippy::missing_safety_doc,
    clippy::transmute_ptr_to_ptr,
    clippy::unused_unit,
    clippy::identity_op
)]

// Macro for marking parts of the Python headers as ignored.
macro_rules! ignore {
    ( $( $_tokens:tt )* ) => {};
}

pub use crate::boolobject::*;
pub use crate::bufferobject::*;
pub use crate::bytearrayobject::*;
pub use crate::bytesobject::*;
pub use crate::cellobject::*;
pub use crate::ceval::*;
pub use crate::classobject::*;
pub use crate::cobject::*;
pub use crate::code::*;
pub use crate::compile::*;
pub use crate::complexobject::*;
pub use crate::descrobject::*;
pub use crate::dictobject::*;
pub use crate::enumobject::*;
pub use crate::eval::*;
pub use crate::fileobject::*;
pub use crate::floatobject::*;
pub use crate::frameobject::PyFrameObject;
pub use crate::funcobject::*;
pub use crate::genobject::*;
pub use crate::import::*;
pub use crate::intobject::*;
pub use crate::iterobject::*;
pub use crate::listobject::*;
pub use crate::longobject::*;
pub use crate::marshal::*;
pub use crate::memoryobject::*;
pub use crate::methodobject::*;
pub use crate::modsupport::*;
pub use crate::moduleobject::*;
pub use crate::object::*;
pub use crate::objectabstract::*;
pub use crate::objimpl::*;
pub use crate::pyarena::*;
pub use crate::pycapsule::*;
pub use crate::pydebug::*;
pub use crate::pyerrors::*;
pub use crate::pymem::*;
pub use crate::pyport::*;
pub use crate::pystate::PyGILState_STATE::*;
pub use crate::pystate::*;
pub use crate::pythonrun::*;
pub use crate::rangeobject::*;
pub use crate::setobject::*;
pub use crate::sliceobject::*;
pub use crate::stringobject::*;
pub use crate::structmember::PyMemberDef;
pub use crate::sysmodule::*;
pub use crate::traceback::*;
pub use crate::tupleobject::*;
#[cfg(py_sys_config = "Py_USING_UNICODE")]
pub use crate::unicodeobject::*;
pub use crate::warnings::*;
pub use crate::weakrefobject::*;

mod pyport;

mod pymem;

mod object;

mod objimpl;

mod pydebug;

// TODO: incomplete
#[cfg(py_sys_config = "Py_USING_UNICODE")]
mod unicodeobject;

mod intobject;

mod boolobject;

mod longobject;

mod floatobject;

mod complexobject;

mod rangeobject;

mod stringobject;

mod memoryobject;

mod bufferobject;

mod bytesobject;

mod bytearrayobject;

mod tupleobject;

mod listobject;

mod dictobject;

mod enumobject;

mod setobject;

mod methodobject;

mod moduleobject;

mod funcobject;

mod classobject;

mod fileobject;

mod cobject;

mod pycapsule;

mod traceback;

mod sliceobject;

mod cellobject;

mod iterobject;

mod genobject;

mod descrobject;

mod warnings;

mod weakrefobject;

// TODO: incomplete
// mod codecs;

mod pyerrors;

mod pystate;

mod pyarena;

mod modsupport;

mod pythonrun;

mod ceval;

mod sysmodule;

// TODO: incomplete
// mod intrcheck;

mod import;

mod objectabstract;

mod code;

mod compile;

mod eval;

mod marshal;

// TODO: incomplete
// mod pyctype;

// TODO: incomplete
// mod pystrtod;

// TODO: incomplete
// mod pystrcmp;

// TODO: incomplete
// mod dtoa;

// TODO: incomplete
// mod pyfpe;

// Additional headers that are not exported by Python.h

pub mod structmember;

pub mod frameobject;

pub const Py_single_input: libc::c_int = 256;

pub const Py_file_input: libc::c_int = 257;

pub const Py_eval_input: libc::c_int = 258;

#[cfg(not(py_sys_config = "Py_USING_UNICODE"))]
#[inline(always)]
pub fn PyUnicode_Check(op: *mut PyObject) -> libc::c_int {
    0
}

#[cfg(not(py_sys_config = "Py_USING_UNICODE"))]
#[inline(always)]
pub fn PyUnicode_CheckExact(op: *mut PyObject) -> libc::c_int {
    0
}