jpayne@69
|
1 /* Generated by Cython 3.0.11 */
|
jpayne@69
|
2
|
jpayne@69
|
3 /* BEGIN: Cython Metadata
|
jpayne@69
|
4 {
|
jpayne@69
|
5 "distutils": {
|
jpayne@69
|
6 "define_macros": [
|
jpayne@69
|
7 [
|
jpayne@69
|
8 "BUILDING_WHEEL",
|
jpayne@69
|
9 null
|
jpayne@69
|
10 ]
|
jpayne@69
|
11 ],
|
jpayne@69
|
12 "depends": [
|
jpayne@69
|
13 "/project/htslib/htslib/bgzf.h",
|
jpayne@69
|
14 "/project/htslib/htslib/cram.h",
|
jpayne@69
|
15 "/project/htslib/htslib/faidx.h",
|
jpayne@69
|
16 "/project/htslib/htslib/hfile.h",
|
jpayne@69
|
17 "/project/htslib/htslib/hts.h",
|
jpayne@69
|
18 "/project/htslib/htslib/kstring.h",
|
jpayne@69
|
19 "/project/htslib/htslib/sam.h",
|
jpayne@69
|
20 "/project/htslib/htslib/tbx.h",
|
jpayne@69
|
21 "/project/htslib/htslib/vcf.h",
|
jpayne@69
|
22 "/project/htslib/htslib/vcfutils.h",
|
jpayne@69
|
23 "/project/pysam/htslib_util.h",
|
jpayne@69
|
24 "/project/pysam/pysam_stream.h"
|
jpayne@69
|
25 ],
|
jpayne@69
|
26 "extra_compile_args": [
|
jpayne@69
|
27 "-Wno-unused",
|
jpayne@69
|
28 "-Wno-strict-prototypes",
|
jpayne@69
|
29 "-Wno-sign-compare",
|
jpayne@69
|
30 "-Wno-error=declaration-after-statement"
|
jpayne@69
|
31 ],
|
jpayne@69
|
32 "extra_link_args": [
|
jpayne@69
|
33 "-Wl,-rpath,$ORIGIN"
|
jpayne@69
|
34 ],
|
jpayne@69
|
35 "include_dirs": [
|
jpayne@69
|
36 "pysam",
|
jpayne@69
|
37 "/project/pysam",
|
jpayne@69
|
38 "/project/htslib",
|
jpayne@69
|
39 "/project/samtools",
|
jpayne@69
|
40 "/project/samtools/lz4",
|
jpayne@69
|
41 "/project/bcftools",
|
jpayne@69
|
42 "/project"
|
jpayne@69
|
43 ],
|
jpayne@69
|
44 "language": "c",
|
jpayne@69
|
45 "libraries": [
|
jpayne@69
|
46 "z",
|
jpayne@69
|
47 "lzma",
|
jpayne@69
|
48 "bz2",
|
jpayne@69
|
49 "z",
|
jpayne@69
|
50 "m",
|
jpayne@69
|
51 "curl",
|
jpayne@69
|
52 "crypto",
|
jpayne@69
|
53 "chtslib.cpython-37m-x86_64-linux-gnu",
|
jpayne@69
|
54 "cutils.cpython-37m-x86_64-linux-gnu"
|
jpayne@69
|
55 ],
|
jpayne@69
|
56 "library_dirs": [
|
jpayne@69
|
57 "/project/pysam",
|
jpayne@69
|
58 "/project",
|
jpayne@69
|
59 "build/lib.linux-x86_64-cpython-37/pysam",
|
jpayne@69
|
60 "build/lib.linux-x86_64-cpython-37/pysam",
|
jpayne@69
|
61 "build/lib.linux-x86_64-cpython-37/pysam",
|
jpayne@69
|
62 "build/lib.linux-x86_64-cpython-37/pysam",
|
jpayne@69
|
63 "build/lib.linux-x86_64-cpython-37/pysam",
|
jpayne@69
|
64 "build/lib.linux-x86_64-cpython-37/pysam"
|
jpayne@69
|
65 ],
|
jpayne@69
|
66 "name": "pysam.libcsamfile",
|
jpayne@69
|
67 "sources": [
|
jpayne@69
|
68 "pysam/libcsamfile.pyx"
|
jpayne@69
|
69 ]
|
jpayne@69
|
70 },
|
jpayne@69
|
71 "module_name": "pysam.libcsamfile"
|
jpayne@69
|
72 }
|
jpayne@69
|
73 END: Cython Metadata */
|
jpayne@69
|
74
|
jpayne@69
|
75 #ifndef PY_SSIZE_T_CLEAN
|
jpayne@69
|
76 #define PY_SSIZE_T_CLEAN
|
jpayne@69
|
77 #endif /* PY_SSIZE_T_CLEAN */
|
jpayne@69
|
78 #if defined(CYTHON_LIMITED_API) && 0
|
jpayne@69
|
79 #ifndef Py_LIMITED_API
|
jpayne@69
|
80 #if CYTHON_LIMITED_API+0 > 0x03030000
|
jpayne@69
|
81 #define Py_LIMITED_API CYTHON_LIMITED_API
|
jpayne@69
|
82 #else
|
jpayne@69
|
83 #define Py_LIMITED_API 0x03030000
|
jpayne@69
|
84 #endif
|
jpayne@69
|
85 #endif
|
jpayne@69
|
86 #endif
|
jpayne@69
|
87
|
jpayne@69
|
88 #include "Python.h"
|
jpayne@69
|
89
|
jpayne@69
|
90 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
91 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj)
|
jpayne@69
|
92 #else
|
jpayne@69
|
93 #define __Pyx_PyFloat_FromString(obj) PyFloat_FromString(obj, NULL)
|
jpayne@69
|
94 #endif
|
jpayne@69
|
95
|
jpayne@69
|
96
|
jpayne@69
|
97 #if PY_MAJOR_VERSION <= 2
|
jpayne@69
|
98 #define PyDict_GetItemWithError _PyDict_GetItemWithError
|
jpayne@69
|
99 #endif
|
jpayne@69
|
100
|
jpayne@69
|
101
|
jpayne@69
|
102 #if (PY_VERSION_HEX < 0x030700b1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030600)) && !defined(PyContextVar_Get)
|
jpayne@69
|
103 #define PyContextVar_Get(var, d, v) ((d) ? ((void)(var), Py_INCREF(d), (v)[0] = (d), 0) : ((v)[0] = NULL, 0) )
|
jpayne@69
|
104 #endif
|
jpayne@69
|
105
|
jpayne@69
|
106 #ifndef Py_PYTHON_H
|
jpayne@69
|
107 #error Python headers needed to compile C extensions, please install development version of Python.
|
jpayne@69
|
108 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
|
jpayne@69
|
109 #error Cython requires Python 2.7+ or Python 3.3+.
|
jpayne@69
|
110 #else
|
jpayne@69
|
111 #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
|
jpayne@69
|
112 #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
|
jpayne@69
|
113 #else
|
jpayne@69
|
114 #define __PYX_EXTRA_ABI_MODULE_NAME ""
|
jpayne@69
|
115 #endif
|
jpayne@69
|
116 #define CYTHON_ABI "3_0_11" __PYX_EXTRA_ABI_MODULE_NAME
|
jpayne@69
|
117 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
|
jpayne@69
|
118 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
|
jpayne@69
|
119 #define CYTHON_HEX_VERSION 0x03000BF0
|
jpayne@69
|
120 #define CYTHON_FUTURE_DIVISION 1
|
jpayne@69
|
121 #include <stddef.h>
|
jpayne@69
|
122 #ifndef offsetof
|
jpayne@69
|
123 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
|
jpayne@69
|
124 #endif
|
jpayne@69
|
125 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
|
jpayne@69
|
126 #ifndef __stdcall
|
jpayne@69
|
127 #define __stdcall
|
jpayne@69
|
128 #endif
|
jpayne@69
|
129 #ifndef __cdecl
|
jpayne@69
|
130 #define __cdecl
|
jpayne@69
|
131 #endif
|
jpayne@69
|
132 #ifndef __fastcall
|
jpayne@69
|
133 #define __fastcall
|
jpayne@69
|
134 #endif
|
jpayne@69
|
135 #endif
|
jpayne@69
|
136 #ifndef DL_IMPORT
|
jpayne@69
|
137 #define DL_IMPORT(t) t
|
jpayne@69
|
138 #endif
|
jpayne@69
|
139 #ifndef DL_EXPORT
|
jpayne@69
|
140 #define DL_EXPORT(t) t
|
jpayne@69
|
141 #endif
|
jpayne@69
|
142 #define __PYX_COMMA ,
|
jpayne@69
|
143 #ifndef HAVE_LONG_LONG
|
jpayne@69
|
144 #define HAVE_LONG_LONG
|
jpayne@69
|
145 #endif
|
jpayne@69
|
146 #ifndef PY_LONG_LONG
|
jpayne@69
|
147 #define PY_LONG_LONG LONG_LONG
|
jpayne@69
|
148 #endif
|
jpayne@69
|
149 #ifndef Py_HUGE_VAL
|
jpayne@69
|
150 #define Py_HUGE_VAL HUGE_VAL
|
jpayne@69
|
151 #endif
|
jpayne@69
|
152 #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
|
jpayne@69
|
153 #if defined(GRAALVM_PYTHON)
|
jpayne@69
|
154 /* For very preliminary testing purposes. Most variables are set the same as PyPy.
|
jpayne@69
|
155 The existence of this section does not imply that anything works or is even tested */
|
jpayne@69
|
156 #define CYTHON_COMPILING_IN_PYPY 0
|
jpayne@69
|
157 #define CYTHON_COMPILING_IN_CPYTHON 0
|
jpayne@69
|
158 #define CYTHON_COMPILING_IN_LIMITED_API 0
|
jpayne@69
|
159 #define CYTHON_COMPILING_IN_GRAAL 1
|
jpayne@69
|
160 #define CYTHON_COMPILING_IN_NOGIL 0
|
jpayne@69
|
161 #undef CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
162 #define CYTHON_USE_TYPE_SLOTS 0
|
jpayne@69
|
163 #undef CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
164 #define CYTHON_USE_TYPE_SPECS 0
|
jpayne@69
|
165 #undef CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
166 #define CYTHON_USE_PYTYPE_LOOKUP 0
|
jpayne@69
|
167 #if PY_VERSION_HEX < 0x03050000
|
jpayne@69
|
168 #undef CYTHON_USE_ASYNC_SLOTS
|
jpayne@69
|
169 #define CYTHON_USE_ASYNC_SLOTS 0
|
jpayne@69
|
170 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
|
jpayne@69
|
171 #define CYTHON_USE_ASYNC_SLOTS 1
|
jpayne@69
|
172 #endif
|
jpayne@69
|
173 #undef CYTHON_USE_PYLIST_INTERNALS
|
jpayne@69
|
174 #define CYTHON_USE_PYLIST_INTERNALS 0
|
jpayne@69
|
175 #undef CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
176 #define CYTHON_USE_UNICODE_INTERNALS 0
|
jpayne@69
|
177 #undef CYTHON_USE_UNICODE_WRITER
|
jpayne@69
|
178 #define CYTHON_USE_UNICODE_WRITER 0
|
jpayne@69
|
179 #undef CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
180 #define CYTHON_USE_PYLONG_INTERNALS 0
|
jpayne@69
|
181 #undef CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
182 #define CYTHON_AVOID_BORROWED_REFS 1
|
jpayne@69
|
183 #undef CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
184 #define CYTHON_ASSUME_SAFE_MACROS 0
|
jpayne@69
|
185 #undef CYTHON_UNPACK_METHODS
|
jpayne@69
|
186 #define CYTHON_UNPACK_METHODS 0
|
jpayne@69
|
187 #undef CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
188 #define CYTHON_FAST_THREAD_STATE 0
|
jpayne@69
|
189 #undef CYTHON_FAST_GIL
|
jpayne@69
|
190 #define CYTHON_FAST_GIL 0
|
jpayne@69
|
191 #undef CYTHON_METH_FASTCALL
|
jpayne@69
|
192 #define CYTHON_METH_FASTCALL 0
|
jpayne@69
|
193 #undef CYTHON_FAST_PYCALL
|
jpayne@69
|
194 #define CYTHON_FAST_PYCALL 0
|
jpayne@69
|
195 #ifndef CYTHON_PEP487_INIT_SUBCLASS
|
jpayne@69
|
196 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
|
jpayne@69
|
197 #endif
|
jpayne@69
|
198 #undef CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
199 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
jpayne@69
|
200 #undef CYTHON_USE_MODULE_STATE
|
jpayne@69
|
201 #define CYTHON_USE_MODULE_STATE 0
|
jpayne@69
|
202 #undef CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
203 #define CYTHON_USE_TP_FINALIZE 0
|
jpayne@69
|
204 #undef CYTHON_USE_DICT_VERSIONS
|
jpayne@69
|
205 #define CYTHON_USE_DICT_VERSIONS 0
|
jpayne@69
|
206 #undef CYTHON_USE_EXC_INFO_STACK
|
jpayne@69
|
207 #define CYTHON_USE_EXC_INFO_STACK 0
|
jpayne@69
|
208 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
jpayne@69
|
209 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
jpayne@69
|
210 #endif
|
jpayne@69
|
211 #undef CYTHON_USE_FREELISTS
|
jpayne@69
|
212 #define CYTHON_USE_FREELISTS 0
|
jpayne@69
|
213 #elif defined(PYPY_VERSION)
|
jpayne@69
|
214 #define CYTHON_COMPILING_IN_PYPY 1
|
jpayne@69
|
215 #define CYTHON_COMPILING_IN_CPYTHON 0
|
jpayne@69
|
216 #define CYTHON_COMPILING_IN_LIMITED_API 0
|
jpayne@69
|
217 #define CYTHON_COMPILING_IN_GRAAL 0
|
jpayne@69
|
218 #define CYTHON_COMPILING_IN_NOGIL 0
|
jpayne@69
|
219 #undef CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
220 #define CYTHON_USE_TYPE_SLOTS 0
|
jpayne@69
|
221 #ifndef CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
222 #define CYTHON_USE_TYPE_SPECS 0
|
jpayne@69
|
223 #endif
|
jpayne@69
|
224 #undef CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
225 #define CYTHON_USE_PYTYPE_LOOKUP 0
|
jpayne@69
|
226 #if PY_VERSION_HEX < 0x03050000
|
jpayne@69
|
227 #undef CYTHON_USE_ASYNC_SLOTS
|
jpayne@69
|
228 #define CYTHON_USE_ASYNC_SLOTS 0
|
jpayne@69
|
229 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
|
jpayne@69
|
230 #define CYTHON_USE_ASYNC_SLOTS 1
|
jpayne@69
|
231 #endif
|
jpayne@69
|
232 #undef CYTHON_USE_PYLIST_INTERNALS
|
jpayne@69
|
233 #define CYTHON_USE_PYLIST_INTERNALS 0
|
jpayne@69
|
234 #undef CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
235 #define CYTHON_USE_UNICODE_INTERNALS 0
|
jpayne@69
|
236 #undef CYTHON_USE_UNICODE_WRITER
|
jpayne@69
|
237 #define CYTHON_USE_UNICODE_WRITER 0
|
jpayne@69
|
238 #undef CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
239 #define CYTHON_USE_PYLONG_INTERNALS 0
|
jpayne@69
|
240 #undef CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
241 #define CYTHON_AVOID_BORROWED_REFS 1
|
jpayne@69
|
242 #undef CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
243 #define CYTHON_ASSUME_SAFE_MACROS 0
|
jpayne@69
|
244 #undef CYTHON_UNPACK_METHODS
|
jpayne@69
|
245 #define CYTHON_UNPACK_METHODS 0
|
jpayne@69
|
246 #undef CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
247 #define CYTHON_FAST_THREAD_STATE 0
|
jpayne@69
|
248 #undef CYTHON_FAST_GIL
|
jpayne@69
|
249 #define CYTHON_FAST_GIL 0
|
jpayne@69
|
250 #undef CYTHON_METH_FASTCALL
|
jpayne@69
|
251 #define CYTHON_METH_FASTCALL 0
|
jpayne@69
|
252 #undef CYTHON_FAST_PYCALL
|
jpayne@69
|
253 #define CYTHON_FAST_PYCALL 0
|
jpayne@69
|
254 #ifndef CYTHON_PEP487_INIT_SUBCLASS
|
jpayne@69
|
255 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
|
jpayne@69
|
256 #endif
|
jpayne@69
|
257 #if PY_VERSION_HEX < 0x03090000
|
jpayne@69
|
258 #undef CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
259 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
|
jpayne@69
|
260 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
|
jpayne@69
|
261 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
jpayne@69
|
262 #endif
|
jpayne@69
|
263 #undef CYTHON_USE_MODULE_STATE
|
jpayne@69
|
264 #define CYTHON_USE_MODULE_STATE 0
|
jpayne@69
|
265 #undef CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
266 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
|
jpayne@69
|
267 #undef CYTHON_USE_DICT_VERSIONS
|
jpayne@69
|
268 #define CYTHON_USE_DICT_VERSIONS 0
|
jpayne@69
|
269 #undef CYTHON_USE_EXC_INFO_STACK
|
jpayne@69
|
270 #define CYTHON_USE_EXC_INFO_STACK 0
|
jpayne@69
|
271 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
jpayne@69
|
272 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
jpayne@69
|
273 #endif
|
jpayne@69
|
274 #undef CYTHON_USE_FREELISTS
|
jpayne@69
|
275 #define CYTHON_USE_FREELISTS 0
|
jpayne@69
|
276 #elif defined(CYTHON_LIMITED_API)
|
jpayne@69
|
277 #ifdef Py_LIMITED_API
|
jpayne@69
|
278 #undef __PYX_LIMITED_VERSION_HEX
|
jpayne@69
|
279 #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
|
jpayne@69
|
280 #endif
|
jpayne@69
|
281 #define CYTHON_COMPILING_IN_PYPY 0
|
jpayne@69
|
282 #define CYTHON_COMPILING_IN_CPYTHON 0
|
jpayne@69
|
283 #define CYTHON_COMPILING_IN_LIMITED_API 1
|
jpayne@69
|
284 #define CYTHON_COMPILING_IN_GRAAL 0
|
jpayne@69
|
285 #define CYTHON_COMPILING_IN_NOGIL 0
|
jpayne@69
|
286 #undef CYTHON_CLINE_IN_TRACEBACK
|
jpayne@69
|
287 #define CYTHON_CLINE_IN_TRACEBACK 0
|
jpayne@69
|
288 #undef CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
289 #define CYTHON_USE_TYPE_SLOTS 0
|
jpayne@69
|
290 #undef CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
291 #define CYTHON_USE_TYPE_SPECS 1
|
jpayne@69
|
292 #undef CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
293 #define CYTHON_USE_PYTYPE_LOOKUP 0
|
jpayne@69
|
294 #undef CYTHON_USE_ASYNC_SLOTS
|
jpayne@69
|
295 #define CYTHON_USE_ASYNC_SLOTS 0
|
jpayne@69
|
296 #undef CYTHON_USE_PYLIST_INTERNALS
|
jpayne@69
|
297 #define CYTHON_USE_PYLIST_INTERNALS 0
|
jpayne@69
|
298 #undef CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
299 #define CYTHON_USE_UNICODE_INTERNALS 0
|
jpayne@69
|
300 #ifndef CYTHON_USE_UNICODE_WRITER
|
jpayne@69
|
301 #define CYTHON_USE_UNICODE_WRITER 0
|
jpayne@69
|
302 #endif
|
jpayne@69
|
303 #undef CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
304 #define CYTHON_USE_PYLONG_INTERNALS 0
|
jpayne@69
|
305 #ifndef CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
306 #define CYTHON_AVOID_BORROWED_REFS 0
|
jpayne@69
|
307 #endif
|
jpayne@69
|
308 #undef CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
309 #define CYTHON_ASSUME_SAFE_MACROS 0
|
jpayne@69
|
310 #undef CYTHON_UNPACK_METHODS
|
jpayne@69
|
311 #define CYTHON_UNPACK_METHODS 0
|
jpayne@69
|
312 #undef CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
313 #define CYTHON_FAST_THREAD_STATE 0
|
jpayne@69
|
314 #undef CYTHON_FAST_GIL
|
jpayne@69
|
315 #define CYTHON_FAST_GIL 0
|
jpayne@69
|
316 #undef CYTHON_METH_FASTCALL
|
jpayne@69
|
317 #define CYTHON_METH_FASTCALL 0
|
jpayne@69
|
318 #undef CYTHON_FAST_PYCALL
|
jpayne@69
|
319 #define CYTHON_FAST_PYCALL 0
|
jpayne@69
|
320 #ifndef CYTHON_PEP487_INIT_SUBCLASS
|
jpayne@69
|
321 #define CYTHON_PEP487_INIT_SUBCLASS 1
|
jpayne@69
|
322 #endif
|
jpayne@69
|
323 #undef CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
324 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
|
jpayne@69
|
325 #undef CYTHON_USE_MODULE_STATE
|
jpayne@69
|
326 #define CYTHON_USE_MODULE_STATE 1
|
jpayne@69
|
327 #ifndef CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
328 #define CYTHON_USE_TP_FINALIZE 0
|
jpayne@69
|
329 #endif
|
jpayne@69
|
330 #undef CYTHON_USE_DICT_VERSIONS
|
jpayne@69
|
331 #define CYTHON_USE_DICT_VERSIONS 0
|
jpayne@69
|
332 #undef CYTHON_USE_EXC_INFO_STACK
|
jpayne@69
|
333 #define CYTHON_USE_EXC_INFO_STACK 0
|
jpayne@69
|
334 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
jpayne@69
|
335 #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
jpayne@69
|
336 #endif
|
jpayne@69
|
337 #undef CYTHON_USE_FREELISTS
|
jpayne@69
|
338 #define CYTHON_USE_FREELISTS 0
|
jpayne@69
|
339 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
|
jpayne@69
|
340 #define CYTHON_COMPILING_IN_PYPY 0
|
jpayne@69
|
341 #define CYTHON_COMPILING_IN_CPYTHON 0
|
jpayne@69
|
342 #define CYTHON_COMPILING_IN_LIMITED_API 0
|
jpayne@69
|
343 #define CYTHON_COMPILING_IN_GRAAL 0
|
jpayne@69
|
344 #define CYTHON_COMPILING_IN_NOGIL 1
|
jpayne@69
|
345 #ifndef CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
346 #define CYTHON_USE_TYPE_SLOTS 1
|
jpayne@69
|
347 #endif
|
jpayne@69
|
348 #ifndef CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
349 #define CYTHON_USE_TYPE_SPECS 0
|
jpayne@69
|
350 #endif
|
jpayne@69
|
351 #undef CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
352 #define CYTHON_USE_PYTYPE_LOOKUP 0
|
jpayne@69
|
353 #ifndef CYTHON_USE_ASYNC_SLOTS
|
jpayne@69
|
354 #define CYTHON_USE_ASYNC_SLOTS 1
|
jpayne@69
|
355 #endif
|
jpayne@69
|
356 #ifndef CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
357 #define CYTHON_USE_PYLONG_INTERNALS 0
|
jpayne@69
|
358 #endif
|
jpayne@69
|
359 #undef CYTHON_USE_PYLIST_INTERNALS
|
jpayne@69
|
360 #define CYTHON_USE_PYLIST_INTERNALS 0
|
jpayne@69
|
361 #ifndef CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
362 #define CYTHON_USE_UNICODE_INTERNALS 1
|
jpayne@69
|
363 #endif
|
jpayne@69
|
364 #undef CYTHON_USE_UNICODE_WRITER
|
jpayne@69
|
365 #define CYTHON_USE_UNICODE_WRITER 0
|
jpayne@69
|
366 #ifndef CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
367 #define CYTHON_AVOID_BORROWED_REFS 0
|
jpayne@69
|
368 #endif
|
jpayne@69
|
369 #ifndef CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
370 #define CYTHON_ASSUME_SAFE_MACROS 1
|
jpayne@69
|
371 #endif
|
jpayne@69
|
372 #ifndef CYTHON_UNPACK_METHODS
|
jpayne@69
|
373 #define CYTHON_UNPACK_METHODS 1
|
jpayne@69
|
374 #endif
|
jpayne@69
|
375 #undef CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
376 #define CYTHON_FAST_THREAD_STATE 0
|
jpayne@69
|
377 #undef CYTHON_FAST_GIL
|
jpayne@69
|
378 #define CYTHON_FAST_GIL 0
|
jpayne@69
|
379 #ifndef CYTHON_METH_FASTCALL
|
jpayne@69
|
380 #define CYTHON_METH_FASTCALL 1
|
jpayne@69
|
381 #endif
|
jpayne@69
|
382 #undef CYTHON_FAST_PYCALL
|
jpayne@69
|
383 #define CYTHON_FAST_PYCALL 0
|
jpayne@69
|
384 #ifndef CYTHON_PEP487_INIT_SUBCLASS
|
jpayne@69
|
385 #define CYTHON_PEP487_INIT_SUBCLASS 1
|
jpayne@69
|
386 #endif
|
jpayne@69
|
387 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
388 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
jpayne@69
|
389 #endif
|
jpayne@69
|
390 #ifndef CYTHON_USE_MODULE_STATE
|
jpayne@69
|
391 #define CYTHON_USE_MODULE_STATE 0
|
jpayne@69
|
392 #endif
|
jpayne@69
|
393 #ifndef CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
394 #define CYTHON_USE_TP_FINALIZE 1
|
jpayne@69
|
395 #endif
|
jpayne@69
|
396 #undef CYTHON_USE_DICT_VERSIONS
|
jpayne@69
|
397 #define CYTHON_USE_DICT_VERSIONS 0
|
jpayne@69
|
398 #undef CYTHON_USE_EXC_INFO_STACK
|
jpayne@69
|
399 #define CYTHON_USE_EXC_INFO_STACK 0
|
jpayne@69
|
400 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
jpayne@69
|
401 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
jpayne@69
|
402 #endif
|
jpayne@69
|
403 #ifndef CYTHON_USE_FREELISTS
|
jpayne@69
|
404 #define CYTHON_USE_FREELISTS 0
|
jpayne@69
|
405 #endif
|
jpayne@69
|
406 #else
|
jpayne@69
|
407 #define CYTHON_COMPILING_IN_PYPY 0
|
jpayne@69
|
408 #define CYTHON_COMPILING_IN_CPYTHON 1
|
jpayne@69
|
409 #define CYTHON_COMPILING_IN_LIMITED_API 0
|
jpayne@69
|
410 #define CYTHON_COMPILING_IN_GRAAL 0
|
jpayne@69
|
411 #define CYTHON_COMPILING_IN_NOGIL 0
|
jpayne@69
|
412 #ifndef CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
413 #define CYTHON_USE_TYPE_SLOTS 1
|
jpayne@69
|
414 #endif
|
jpayne@69
|
415 #ifndef CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
416 #define CYTHON_USE_TYPE_SPECS 0
|
jpayne@69
|
417 #endif
|
jpayne@69
|
418 #ifndef CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
419 #define CYTHON_USE_PYTYPE_LOOKUP 1
|
jpayne@69
|
420 #endif
|
jpayne@69
|
421 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
422 #undef CYTHON_USE_ASYNC_SLOTS
|
jpayne@69
|
423 #define CYTHON_USE_ASYNC_SLOTS 0
|
jpayne@69
|
424 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
|
jpayne@69
|
425 #define CYTHON_USE_ASYNC_SLOTS 1
|
jpayne@69
|
426 #endif
|
jpayne@69
|
427 #ifndef CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
428 #define CYTHON_USE_PYLONG_INTERNALS 1
|
jpayne@69
|
429 #endif
|
jpayne@69
|
430 #ifndef CYTHON_USE_PYLIST_INTERNALS
|
jpayne@69
|
431 #define CYTHON_USE_PYLIST_INTERNALS 1
|
jpayne@69
|
432 #endif
|
jpayne@69
|
433 #ifndef CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
434 #define CYTHON_USE_UNICODE_INTERNALS 1
|
jpayne@69
|
435 #endif
|
jpayne@69
|
436 #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
|
jpayne@69
|
437 #undef CYTHON_USE_UNICODE_WRITER
|
jpayne@69
|
438 #define CYTHON_USE_UNICODE_WRITER 0
|
jpayne@69
|
439 #elif !defined(CYTHON_USE_UNICODE_WRITER)
|
jpayne@69
|
440 #define CYTHON_USE_UNICODE_WRITER 1
|
jpayne@69
|
441 #endif
|
jpayne@69
|
442 #ifndef CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
443 #define CYTHON_AVOID_BORROWED_REFS 0
|
jpayne@69
|
444 #endif
|
jpayne@69
|
445 #ifndef CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
446 #define CYTHON_ASSUME_SAFE_MACROS 1
|
jpayne@69
|
447 #endif
|
jpayne@69
|
448 #ifndef CYTHON_UNPACK_METHODS
|
jpayne@69
|
449 #define CYTHON_UNPACK_METHODS 1
|
jpayne@69
|
450 #endif
|
jpayne@69
|
451 #ifndef CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
452 #define CYTHON_FAST_THREAD_STATE 1
|
jpayne@69
|
453 #endif
|
jpayne@69
|
454 #ifndef CYTHON_FAST_GIL
|
jpayne@69
|
455 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
|
jpayne@69
|
456 #endif
|
jpayne@69
|
457 #ifndef CYTHON_METH_FASTCALL
|
jpayne@69
|
458 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
|
jpayne@69
|
459 #endif
|
jpayne@69
|
460 #ifndef CYTHON_FAST_PYCALL
|
jpayne@69
|
461 #define CYTHON_FAST_PYCALL 1
|
jpayne@69
|
462 #endif
|
jpayne@69
|
463 #ifndef CYTHON_PEP487_INIT_SUBCLASS
|
jpayne@69
|
464 #define CYTHON_PEP487_INIT_SUBCLASS 1
|
jpayne@69
|
465 #endif
|
jpayne@69
|
466 #if PY_VERSION_HEX < 0x03050000
|
jpayne@69
|
467 #undef CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
468 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
|
jpayne@69
|
469 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
|
jpayne@69
|
470 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
jpayne@69
|
471 #endif
|
jpayne@69
|
472 #ifndef CYTHON_USE_MODULE_STATE
|
jpayne@69
|
473 #define CYTHON_USE_MODULE_STATE 0
|
jpayne@69
|
474 #endif
|
jpayne@69
|
475 #if PY_VERSION_HEX < 0x030400a1
|
jpayne@69
|
476 #undef CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
477 #define CYTHON_USE_TP_FINALIZE 0
|
jpayne@69
|
478 #elif !defined(CYTHON_USE_TP_FINALIZE)
|
jpayne@69
|
479 #define CYTHON_USE_TP_FINALIZE 1
|
jpayne@69
|
480 #endif
|
jpayne@69
|
481 #if PY_VERSION_HEX < 0x030600B1
|
jpayne@69
|
482 #undef CYTHON_USE_DICT_VERSIONS
|
jpayne@69
|
483 #define CYTHON_USE_DICT_VERSIONS 0
|
jpayne@69
|
484 #elif !defined(CYTHON_USE_DICT_VERSIONS)
|
jpayne@69
|
485 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
|
jpayne@69
|
486 #endif
|
jpayne@69
|
487 #if PY_VERSION_HEX < 0x030700A3
|
jpayne@69
|
488 #undef CYTHON_USE_EXC_INFO_STACK
|
jpayne@69
|
489 #define CYTHON_USE_EXC_INFO_STACK 0
|
jpayne@69
|
490 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
|
jpayne@69
|
491 #define CYTHON_USE_EXC_INFO_STACK 1
|
jpayne@69
|
492 #endif
|
jpayne@69
|
493 #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
jpayne@69
|
494 #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
jpayne@69
|
495 #endif
|
jpayne@69
|
496 #ifndef CYTHON_USE_FREELISTS
|
jpayne@69
|
497 #define CYTHON_USE_FREELISTS 1
|
jpayne@69
|
498 #endif
|
jpayne@69
|
499 #endif
|
jpayne@69
|
500 #if !defined(CYTHON_FAST_PYCCALL)
|
jpayne@69
|
501 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
|
jpayne@69
|
502 #endif
|
jpayne@69
|
503 #if !defined(CYTHON_VECTORCALL)
|
jpayne@69
|
504 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
|
jpayne@69
|
505 #endif
|
jpayne@69
|
506 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
|
jpayne@69
|
507 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
508 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
509 #include "longintrepr.h"
|
jpayne@69
|
510 #endif
|
jpayne@69
|
511 #undef SHIFT
|
jpayne@69
|
512 #undef BASE
|
jpayne@69
|
513 #undef MASK
|
jpayne@69
|
514 #ifdef SIZEOF_VOID_P
|
jpayne@69
|
515 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
jpayne@69
|
516 #endif
|
jpayne@69
|
517 #endif
|
jpayne@69
|
518 #ifndef __has_attribute
|
jpayne@69
|
519 #define __has_attribute(x) 0
|
jpayne@69
|
520 #endif
|
jpayne@69
|
521 #ifndef __has_cpp_attribute
|
jpayne@69
|
522 #define __has_cpp_attribute(x) 0
|
jpayne@69
|
523 #endif
|
jpayne@69
|
524 #ifndef CYTHON_RESTRICT
|
jpayne@69
|
525 #if defined(__GNUC__)
|
jpayne@69
|
526 #define CYTHON_RESTRICT __restrict__
|
jpayne@69
|
527 #elif defined(_MSC_VER) && _MSC_VER >= 1400
|
jpayne@69
|
528 #define CYTHON_RESTRICT __restrict
|
jpayne@69
|
529 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
jpayne@69
|
530 #define CYTHON_RESTRICT restrict
|
jpayne@69
|
531 #else
|
jpayne@69
|
532 #define CYTHON_RESTRICT
|
jpayne@69
|
533 #endif
|
jpayne@69
|
534 #endif
|
jpayne@69
|
535 #ifndef CYTHON_UNUSED
|
jpayne@69
|
536 #if defined(__cplusplus)
|
jpayne@69
|
537 /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
|
jpayne@69
|
538 * but leads to warnings with -pedantic, since it is a C++17 feature */
|
jpayne@69
|
539 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
jpayne@69
|
540 #if __has_cpp_attribute(maybe_unused)
|
jpayne@69
|
541 #define CYTHON_UNUSED [[maybe_unused]]
|
jpayne@69
|
542 #endif
|
jpayne@69
|
543 #endif
|
jpayne@69
|
544 #endif
|
jpayne@69
|
545 #endif
|
jpayne@69
|
546 #ifndef CYTHON_UNUSED
|
jpayne@69
|
547 # if defined(__GNUC__)
|
jpayne@69
|
548 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
jpayne@69
|
549 # define CYTHON_UNUSED __attribute__ ((__unused__))
|
jpayne@69
|
550 # else
|
jpayne@69
|
551 # define CYTHON_UNUSED
|
jpayne@69
|
552 # endif
|
jpayne@69
|
553 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
|
jpayne@69
|
554 # define CYTHON_UNUSED __attribute__ ((__unused__))
|
jpayne@69
|
555 # else
|
jpayne@69
|
556 # define CYTHON_UNUSED
|
jpayne@69
|
557 # endif
|
jpayne@69
|
558 #endif
|
jpayne@69
|
559 #ifndef CYTHON_UNUSED_VAR
|
jpayne@69
|
560 # if defined(__cplusplus)
|
jpayne@69
|
561 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
|
jpayne@69
|
562 # else
|
jpayne@69
|
563 # define CYTHON_UNUSED_VAR(x) (void)(x)
|
jpayne@69
|
564 # endif
|
jpayne@69
|
565 #endif
|
jpayne@69
|
566 #ifndef CYTHON_MAYBE_UNUSED_VAR
|
jpayne@69
|
567 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
|
jpayne@69
|
568 #endif
|
jpayne@69
|
569 #ifndef CYTHON_NCP_UNUSED
|
jpayne@69
|
570 # if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
571 # define CYTHON_NCP_UNUSED
|
jpayne@69
|
572 # else
|
jpayne@69
|
573 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
|
jpayne@69
|
574 # endif
|
jpayne@69
|
575 #endif
|
jpayne@69
|
576 #ifndef CYTHON_USE_CPP_STD_MOVE
|
jpayne@69
|
577 #if defined(__cplusplus) && (\
|
jpayne@69
|
578 __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
|
jpayne@69
|
579 #define CYTHON_USE_CPP_STD_MOVE 1
|
jpayne@69
|
580 #else
|
jpayne@69
|
581 #define CYTHON_USE_CPP_STD_MOVE 0
|
jpayne@69
|
582 #endif
|
jpayne@69
|
583 #endif
|
jpayne@69
|
584 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
|
jpayne@69
|
585 #ifdef _MSC_VER
|
jpayne@69
|
586 #ifndef _MSC_STDINT_H_
|
jpayne@69
|
587 #if _MSC_VER < 1300
|
jpayne@69
|
588 typedef unsigned char uint8_t;
|
jpayne@69
|
589 typedef unsigned short uint16_t;
|
jpayne@69
|
590 typedef unsigned int uint32_t;
|
jpayne@69
|
591 #else
|
jpayne@69
|
592 typedef unsigned __int8 uint8_t;
|
jpayne@69
|
593 typedef unsigned __int16 uint16_t;
|
jpayne@69
|
594 typedef unsigned __int32 uint32_t;
|
jpayne@69
|
595 #endif
|
jpayne@69
|
596 #endif
|
jpayne@69
|
597 #if _MSC_VER < 1300
|
jpayne@69
|
598 #ifdef _WIN64
|
jpayne@69
|
599 typedef unsigned long long __pyx_uintptr_t;
|
jpayne@69
|
600 #else
|
jpayne@69
|
601 typedef unsigned int __pyx_uintptr_t;
|
jpayne@69
|
602 #endif
|
jpayne@69
|
603 #else
|
jpayne@69
|
604 #ifdef _WIN64
|
jpayne@69
|
605 typedef unsigned __int64 __pyx_uintptr_t;
|
jpayne@69
|
606 #else
|
jpayne@69
|
607 typedef unsigned __int32 __pyx_uintptr_t;
|
jpayne@69
|
608 #endif
|
jpayne@69
|
609 #endif
|
jpayne@69
|
610 #else
|
jpayne@69
|
611 #include <stdint.h>
|
jpayne@69
|
612 typedef uintptr_t __pyx_uintptr_t;
|
jpayne@69
|
613 #endif
|
jpayne@69
|
614 #ifndef CYTHON_FALLTHROUGH
|
jpayne@69
|
615 #if defined(__cplusplus)
|
jpayne@69
|
616 /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
|
jpayne@69
|
617 * but leads to warnings with -pedantic, since it is a C++17 feature */
|
jpayne@69
|
618 #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
jpayne@69
|
619 #if __has_cpp_attribute(fallthrough)
|
jpayne@69
|
620 #define CYTHON_FALLTHROUGH [[fallthrough]]
|
jpayne@69
|
621 #endif
|
jpayne@69
|
622 #endif
|
jpayne@69
|
623 #ifndef CYTHON_FALLTHROUGH
|
jpayne@69
|
624 #if __has_cpp_attribute(clang::fallthrough)
|
jpayne@69
|
625 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
|
jpayne@69
|
626 #elif __has_cpp_attribute(gnu::fallthrough)
|
jpayne@69
|
627 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
|
jpayne@69
|
628 #endif
|
jpayne@69
|
629 #endif
|
jpayne@69
|
630 #endif
|
jpayne@69
|
631 #ifndef CYTHON_FALLTHROUGH
|
jpayne@69
|
632 #if __has_attribute(fallthrough)
|
jpayne@69
|
633 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
|
jpayne@69
|
634 #else
|
jpayne@69
|
635 #define CYTHON_FALLTHROUGH
|
jpayne@69
|
636 #endif
|
jpayne@69
|
637 #endif
|
jpayne@69
|
638 #if defined(__clang__) && defined(__apple_build_version__)
|
jpayne@69
|
639 #if __apple_build_version__ < 7000000
|
jpayne@69
|
640 #undef CYTHON_FALLTHROUGH
|
jpayne@69
|
641 #define CYTHON_FALLTHROUGH
|
jpayne@69
|
642 #endif
|
jpayne@69
|
643 #endif
|
jpayne@69
|
644 #endif
|
jpayne@69
|
645 #ifdef __cplusplus
|
jpayne@69
|
646 template <typename T>
|
jpayne@69
|
647 struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
|
jpayne@69
|
648 #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
|
jpayne@69
|
649 #else
|
jpayne@69
|
650 #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
|
jpayne@69
|
651 #endif
|
jpayne@69
|
652 #if CYTHON_COMPILING_IN_PYPY == 1
|
jpayne@69
|
653 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
|
jpayne@69
|
654 #else
|
jpayne@69
|
655 #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
|
jpayne@69
|
656 #endif
|
jpayne@69
|
657 #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
|
jpayne@69
|
658
|
jpayne@69
|
659 #ifndef CYTHON_INLINE
|
jpayne@69
|
660 #if defined(__clang__)
|
jpayne@69
|
661 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
|
jpayne@69
|
662 #elif defined(__GNUC__)
|
jpayne@69
|
663 #define CYTHON_INLINE __inline__
|
jpayne@69
|
664 #elif defined(_MSC_VER)
|
jpayne@69
|
665 #define CYTHON_INLINE __inline
|
jpayne@69
|
666 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
jpayne@69
|
667 #define CYTHON_INLINE inline
|
jpayne@69
|
668 #else
|
jpayne@69
|
669 #define CYTHON_INLINE
|
jpayne@69
|
670 #endif
|
jpayne@69
|
671 #endif
|
jpayne@69
|
672
|
jpayne@69
|
673 #define __PYX_BUILD_PY_SSIZE_T "n"
|
jpayne@69
|
674 #define CYTHON_FORMAT_SSIZE_T "z"
|
jpayne@69
|
675 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
676 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
|
jpayne@69
|
677 #define __Pyx_DefaultClassType PyClass_Type
|
jpayne@69
|
678 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
|
jpayne@69
|
679 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
jpayne@69
|
680 #else
|
jpayne@69
|
681 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
|
jpayne@69
|
682 #define __Pyx_DefaultClassType PyType_Type
|
jpayne@69
|
683 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
684 static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
|
jpayne@69
|
685 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
|
jpayne@69
|
686 PyObject *fv, PyObject *cell, PyObject* fn,
|
jpayne@69
|
687 PyObject *name, int fline, PyObject *lnos) {
|
jpayne@69
|
688 PyObject *exception_table = NULL;
|
jpayne@69
|
689 PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
|
jpayne@69
|
690 #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
|
jpayne@69
|
691 PyObject *version_info;
|
jpayne@69
|
692 PyObject *py_minor_version = NULL;
|
jpayne@69
|
693 #endif
|
jpayne@69
|
694 long minor_version = 0;
|
jpayne@69
|
695 PyObject *type, *value, *traceback;
|
jpayne@69
|
696 PyErr_Fetch(&type, &value, &traceback);
|
jpayne@69
|
697 #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
|
jpayne@69
|
698 minor_version = 11;
|
jpayne@69
|
699 #else
|
jpayne@69
|
700 if (!(version_info = PySys_GetObject("version_info"))) goto end;
|
jpayne@69
|
701 if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
|
jpayne@69
|
702 minor_version = PyLong_AsLong(py_minor_version);
|
jpayne@69
|
703 Py_DECREF(py_minor_version);
|
jpayne@69
|
704 if (minor_version == -1 && PyErr_Occurred()) goto end;
|
jpayne@69
|
705 #endif
|
jpayne@69
|
706 if (!(types_module = PyImport_ImportModule("types"))) goto end;
|
jpayne@69
|
707 if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
|
jpayne@69
|
708 if (minor_version <= 7) {
|
jpayne@69
|
709 (void)p;
|
jpayne@69
|
710 result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
|
jpayne@69
|
711 c, n, v, fn, name, fline, lnos, fv, cell);
|
jpayne@69
|
712 } else if (minor_version <= 10) {
|
jpayne@69
|
713 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
|
jpayne@69
|
714 c, n, v, fn, name, fline, lnos, fv, cell);
|
jpayne@69
|
715 } else {
|
jpayne@69
|
716 if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
|
jpayne@69
|
717 result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
|
jpayne@69
|
718 c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
|
jpayne@69
|
719 }
|
jpayne@69
|
720 end:
|
jpayne@69
|
721 Py_XDECREF(code_type);
|
jpayne@69
|
722 Py_XDECREF(exception_table);
|
jpayne@69
|
723 Py_XDECREF(types_module);
|
jpayne@69
|
724 if (type) {
|
jpayne@69
|
725 PyErr_Restore(type, value, traceback);
|
jpayne@69
|
726 }
|
jpayne@69
|
727 return result;
|
jpayne@69
|
728 }
|
jpayne@69
|
729 #ifndef CO_OPTIMIZED
|
jpayne@69
|
730 #define CO_OPTIMIZED 0x0001
|
jpayne@69
|
731 #endif
|
jpayne@69
|
732 #ifndef CO_NEWLOCALS
|
jpayne@69
|
733 #define CO_NEWLOCALS 0x0002
|
jpayne@69
|
734 #endif
|
jpayne@69
|
735 #ifndef CO_VARARGS
|
jpayne@69
|
736 #define CO_VARARGS 0x0004
|
jpayne@69
|
737 #endif
|
jpayne@69
|
738 #ifndef CO_VARKEYWORDS
|
jpayne@69
|
739 #define CO_VARKEYWORDS 0x0008
|
jpayne@69
|
740 #endif
|
jpayne@69
|
741 #ifndef CO_ASYNC_GENERATOR
|
jpayne@69
|
742 #define CO_ASYNC_GENERATOR 0x0200
|
jpayne@69
|
743 #endif
|
jpayne@69
|
744 #ifndef CO_GENERATOR
|
jpayne@69
|
745 #define CO_GENERATOR 0x0020
|
jpayne@69
|
746 #endif
|
jpayne@69
|
747 #ifndef CO_COROUTINE
|
jpayne@69
|
748 #define CO_COROUTINE 0x0080
|
jpayne@69
|
749 #endif
|
jpayne@69
|
750 #elif PY_VERSION_HEX >= 0x030B0000
|
jpayne@69
|
751 static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
|
jpayne@69
|
752 PyObject *code, PyObject *c, PyObject* n, PyObject *v,
|
jpayne@69
|
753 PyObject *fv, PyObject *cell, PyObject* fn,
|
jpayne@69
|
754 PyObject *name, int fline, PyObject *lnos) {
|
jpayne@69
|
755 PyCodeObject *result;
|
jpayne@69
|
756 PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0);
|
jpayne@69
|
757 if (!empty_bytes) return NULL;
|
jpayne@69
|
758 result =
|
jpayne@69
|
759 #if PY_VERSION_HEX >= 0x030C0000
|
jpayne@69
|
760 PyUnstable_Code_NewWithPosOnlyArgs
|
jpayne@69
|
761 #else
|
jpayne@69
|
762 PyCode_NewWithPosOnlyArgs
|
jpayne@69
|
763 #endif
|
jpayne@69
|
764 (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
|
jpayne@69
|
765 Py_DECREF(empty_bytes);
|
jpayne@69
|
766 return result;
|
jpayne@69
|
767 }
|
jpayne@69
|
768 #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
769 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
|
jpayne@69
|
770 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
jpayne@69
|
771 #else
|
jpayne@69
|
772 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
|
jpayne@69
|
773 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
jpayne@69
|
774 #endif
|
jpayne@69
|
775 #endif
|
jpayne@69
|
776 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
|
jpayne@69
|
777 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
|
jpayne@69
|
778 #else
|
jpayne@69
|
779 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
|
jpayne@69
|
780 #endif
|
jpayne@69
|
781 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
|
jpayne@69
|
782 #define __Pyx_Py_Is(x, y) Py_Is(x, y)
|
jpayne@69
|
783 #else
|
jpayne@69
|
784 #define __Pyx_Py_Is(x, y) ((x) == (y))
|
jpayne@69
|
785 #endif
|
jpayne@69
|
786 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
|
jpayne@69
|
787 #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
|
jpayne@69
|
788 #else
|
jpayne@69
|
789 #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
|
jpayne@69
|
790 #endif
|
jpayne@69
|
791 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
|
jpayne@69
|
792 #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
|
jpayne@69
|
793 #else
|
jpayne@69
|
794 #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
|
jpayne@69
|
795 #endif
|
jpayne@69
|
796 #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
|
jpayne@69
|
797 #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
|
jpayne@69
|
798 #else
|
jpayne@69
|
799 #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
|
jpayne@69
|
800 #endif
|
jpayne@69
|
801 #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
|
jpayne@69
|
802 #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
803 #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
|
jpayne@69
|
804 #else
|
jpayne@69
|
805 #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
|
jpayne@69
|
806 #endif
|
jpayne@69
|
807 #ifndef CO_COROUTINE
|
jpayne@69
|
808 #define CO_COROUTINE 0x80
|
jpayne@69
|
809 #endif
|
jpayne@69
|
810 #ifndef CO_ASYNC_GENERATOR
|
jpayne@69
|
811 #define CO_ASYNC_GENERATOR 0x200
|
jpayne@69
|
812 #endif
|
jpayne@69
|
813 #ifndef Py_TPFLAGS_CHECKTYPES
|
jpayne@69
|
814 #define Py_TPFLAGS_CHECKTYPES 0
|
jpayne@69
|
815 #endif
|
jpayne@69
|
816 #ifndef Py_TPFLAGS_HAVE_INDEX
|
jpayne@69
|
817 #define Py_TPFLAGS_HAVE_INDEX 0
|
jpayne@69
|
818 #endif
|
jpayne@69
|
819 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
|
jpayne@69
|
820 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
|
jpayne@69
|
821 #endif
|
jpayne@69
|
822 #ifndef Py_TPFLAGS_HAVE_FINALIZE
|
jpayne@69
|
823 #define Py_TPFLAGS_HAVE_FINALIZE 0
|
jpayne@69
|
824 #endif
|
jpayne@69
|
825 #ifndef Py_TPFLAGS_SEQUENCE
|
jpayne@69
|
826 #define Py_TPFLAGS_SEQUENCE 0
|
jpayne@69
|
827 #endif
|
jpayne@69
|
828 #ifndef Py_TPFLAGS_MAPPING
|
jpayne@69
|
829 #define Py_TPFLAGS_MAPPING 0
|
jpayne@69
|
830 #endif
|
jpayne@69
|
831 #ifndef METH_STACKLESS
|
jpayne@69
|
832 #define METH_STACKLESS 0
|
jpayne@69
|
833 #endif
|
jpayne@69
|
834 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
|
jpayne@69
|
835 #ifndef METH_FASTCALL
|
jpayne@69
|
836 #define METH_FASTCALL 0x80
|
jpayne@69
|
837 #endif
|
jpayne@69
|
838 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
|
jpayne@69
|
839 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
|
jpayne@69
|
840 Py_ssize_t nargs, PyObject *kwnames);
|
jpayne@69
|
841 #else
|
jpayne@69
|
842 #if PY_VERSION_HEX >= 0x030d00A4
|
jpayne@69
|
843 # define __Pyx_PyCFunctionFast PyCFunctionFast
|
jpayne@69
|
844 # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
|
jpayne@69
|
845 #else
|
jpayne@69
|
846 # define __Pyx_PyCFunctionFast _PyCFunctionFast
|
jpayne@69
|
847 # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
|
jpayne@69
|
848 #endif
|
jpayne@69
|
849 #endif
|
jpayne@69
|
850 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
851 #define __Pyx_METH_FASTCALL METH_FASTCALL
|
jpayne@69
|
852 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
|
jpayne@69
|
853 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
|
jpayne@69
|
854 #else
|
jpayne@69
|
855 #define __Pyx_METH_FASTCALL METH_VARARGS
|
jpayne@69
|
856 #define __Pyx_PyCFunction_FastCall PyCFunction
|
jpayne@69
|
857 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
|
jpayne@69
|
858 #endif
|
jpayne@69
|
859 #if CYTHON_VECTORCALL
|
jpayne@69
|
860 #define __pyx_vectorcallfunc vectorcallfunc
|
jpayne@69
|
861 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
|
jpayne@69
|
862 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
|
jpayne@69
|
863 #elif CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
864 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
|
jpayne@69
|
865 size_t nargsf, PyObject *kwnames);
|
jpayne@69
|
866 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
|
jpayne@69
|
867 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
|
jpayne@69
|
868 #else
|
jpayne@69
|
869 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
|
jpayne@69
|
870 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
|
jpayne@69
|
871 #endif
|
jpayne@69
|
872 #if PY_MAJOR_VERSION >= 0x030900B1
|
jpayne@69
|
873 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
|
jpayne@69
|
874 #else
|
jpayne@69
|
875 #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
|
jpayne@69
|
876 #endif
|
jpayne@69
|
877 #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
|
jpayne@69
|
878 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
879 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
|
jpayne@69
|
880 #elif !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
881 #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
|
jpayne@69
|
882 #endif
|
jpayne@69
|
883 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
884 #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
|
jpayne@69
|
885 static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
|
jpayne@69
|
886 return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
|
jpayne@69
|
887 }
|
jpayne@69
|
888 #endif
|
jpayne@69
|
889 static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
|
jpayne@69
|
890 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
891 return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
|
jpayne@69
|
892 #else
|
jpayne@69
|
893 return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
|
jpayne@69
|
894 #endif
|
jpayne@69
|
895 }
|
jpayne@69
|
896 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
|
jpayne@69
|
897 #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
|
jpayne@69
|
898 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
|
jpayne@69
|
899 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
|
jpayne@69
|
900 #else
|
jpayne@69
|
901 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
|
jpayne@69
|
902 #define __Pyx_PyCMethod PyCMethod
|
jpayne@69
|
903 #endif
|
jpayne@69
|
904 #ifndef METH_METHOD
|
jpayne@69
|
905 #define METH_METHOD 0x200
|
jpayne@69
|
906 #endif
|
jpayne@69
|
907 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
|
jpayne@69
|
908 #define PyObject_Malloc(s) PyMem_Malloc(s)
|
jpayne@69
|
909 #define PyObject_Free(p) PyMem_Free(p)
|
jpayne@69
|
910 #define PyObject_Realloc(p) PyMem_Realloc(p)
|
jpayne@69
|
911 #endif
|
jpayne@69
|
912 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
913 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
|
jpayne@69
|
914 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
|
jpayne@69
|
915 #else
|
jpayne@69
|
916 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
|
jpayne@69
|
917 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
|
jpayne@69
|
918 #endif
|
jpayne@69
|
919 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
920 #define __Pyx_PyThreadState_Current PyThreadState_Get()
|
jpayne@69
|
921 #elif !CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
922 #define __Pyx_PyThreadState_Current PyThreadState_GET()
|
jpayne@69
|
923 #elif PY_VERSION_HEX >= 0x030d00A1
|
jpayne@69
|
924 #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
|
jpayne@69
|
925 #elif PY_VERSION_HEX >= 0x03060000
|
jpayne@69
|
926 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
|
jpayne@69
|
927 #elif PY_VERSION_HEX >= 0x03000000
|
jpayne@69
|
928 #define __Pyx_PyThreadState_Current PyThreadState_GET()
|
jpayne@69
|
929 #else
|
jpayne@69
|
930 #define __Pyx_PyThreadState_Current _PyThreadState_Current
|
jpayne@69
|
931 #endif
|
jpayne@69
|
932 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
933 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
|
jpayne@69
|
934 {
|
jpayne@69
|
935 void *result;
|
jpayne@69
|
936 result = PyModule_GetState(op);
|
jpayne@69
|
937 if (!result)
|
jpayne@69
|
938 Py_FatalError("Couldn't find the module state");
|
jpayne@69
|
939 return result;
|
jpayne@69
|
940 }
|
jpayne@69
|
941 #endif
|
jpayne@69
|
942 #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
|
jpayne@69
|
943 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
944 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
|
jpayne@69
|
945 #else
|
jpayne@69
|
946 #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
|
jpayne@69
|
947 #endif
|
jpayne@69
|
948 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
|
jpayne@69
|
949 #include "pythread.h"
|
jpayne@69
|
950 #define Py_tss_NEEDS_INIT 0
|
jpayne@69
|
951 typedef int Py_tss_t;
|
jpayne@69
|
952 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
|
jpayne@69
|
953 *key = PyThread_create_key();
|
jpayne@69
|
954 return 0;
|
jpayne@69
|
955 }
|
jpayne@69
|
956 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
|
jpayne@69
|
957 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
|
jpayne@69
|
958 *key = Py_tss_NEEDS_INIT;
|
jpayne@69
|
959 return key;
|
jpayne@69
|
960 }
|
jpayne@69
|
961 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
|
jpayne@69
|
962 PyObject_Free(key);
|
jpayne@69
|
963 }
|
jpayne@69
|
964 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
|
jpayne@69
|
965 return *key != Py_tss_NEEDS_INIT;
|
jpayne@69
|
966 }
|
jpayne@69
|
967 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
|
jpayne@69
|
968 PyThread_delete_key(*key);
|
jpayne@69
|
969 *key = Py_tss_NEEDS_INIT;
|
jpayne@69
|
970 }
|
jpayne@69
|
971 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
|
jpayne@69
|
972 return PyThread_set_key_value(*key, value);
|
jpayne@69
|
973 }
|
jpayne@69
|
974 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
|
jpayne@69
|
975 return PyThread_get_key_value(*key);
|
jpayne@69
|
976 }
|
jpayne@69
|
977 #endif
|
jpayne@69
|
978 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
979 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
980 #if PYPY_VERSION_NUM < 0x07030600
|
jpayne@69
|
981 #if defined(__cplusplus) && __cplusplus >= 201402L
|
jpayne@69
|
982 [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
|
jpayne@69
|
983 #elif defined(__GNUC__) || defined(__clang__)
|
jpayne@69
|
984 __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
|
jpayne@69
|
985 #elif defined(_MSC_VER)
|
jpayne@69
|
986 __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
|
jpayne@69
|
987 #endif
|
jpayne@69
|
988 static CYTHON_INLINE int PyGILState_Check(void) {
|
jpayne@69
|
989 return 0;
|
jpayne@69
|
990 }
|
jpayne@69
|
991 #else // PYPY_VERSION_NUM < 0x07030600
|
jpayne@69
|
992 #endif // PYPY_VERSION_NUM < 0x07030600
|
jpayne@69
|
993 #else
|
jpayne@69
|
994 static CYTHON_INLINE int PyGILState_Check(void) {
|
jpayne@69
|
995 PyThreadState * tstate = _PyThreadState_Current;
|
jpayne@69
|
996 return tstate && (tstate == PyGILState_GetThisThreadState());
|
jpayne@69
|
997 }
|
jpayne@69
|
998 #endif
|
jpayne@69
|
999 #endif
|
jpayne@69
|
1000 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
|
jpayne@69
|
1001 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
|
jpayne@69
|
1002 #else
|
jpayne@69
|
1003 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
|
jpayne@69
|
1004 #endif
|
jpayne@69
|
1005 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
|
jpayne@69
|
1006 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
|
jpayne@69
|
1007 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
|
jpayne@69
|
1008 #else
|
jpayne@69
|
1009 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
|
jpayne@69
|
1010 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
|
jpayne@69
|
1011 #endif
|
jpayne@69
|
1012 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
1013 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
|
jpayne@69
|
1014 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
|
jpayne@69
|
1015 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
|
jpayne@69
|
1016 if (res == NULL) PyErr_Clear();
|
jpayne@69
|
1017 return res;
|
jpayne@69
|
1018 }
|
jpayne@69
|
1019 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
|
jpayne@69
|
1020 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
|
jpayne@69
|
1021 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
|
jpayne@69
|
1022 #else
|
jpayne@69
|
1023 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
|
jpayne@69
|
1024 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
1025 return PyDict_GetItem(dict, name);
|
jpayne@69
|
1026 #else
|
jpayne@69
|
1027 PyDictEntry *ep;
|
jpayne@69
|
1028 PyDictObject *mp = (PyDictObject*) dict;
|
jpayne@69
|
1029 long hash = ((PyStringObject *) name)->ob_shash;
|
jpayne@69
|
1030 assert(hash != -1);
|
jpayne@69
|
1031 ep = (mp->ma_lookup)(mp, name, hash);
|
jpayne@69
|
1032 if (ep == NULL) {
|
jpayne@69
|
1033 return NULL;
|
jpayne@69
|
1034 }
|
jpayne@69
|
1035 return ep->me_value;
|
jpayne@69
|
1036 #endif
|
jpayne@69
|
1037 }
|
jpayne@69
|
1038 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
|
jpayne@69
|
1039 #endif
|
jpayne@69
|
1040 #if CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
1041 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
|
jpayne@69
|
1042 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
|
jpayne@69
|
1043 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
|
jpayne@69
|
1044 #else
|
jpayne@69
|
1045 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
|
jpayne@69
|
1046 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
|
jpayne@69
|
1047 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
|
jpayne@69
|
1048 #endif
|
jpayne@69
|
1049 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
1050 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
|
jpayne@69
|
1051 #else
|
jpayne@69
|
1052 #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
|
jpayne@69
|
1053 #endif
|
jpayne@69
|
1054 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
|
jpayne@69
|
1055 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
|
jpayne@69
|
1056 PyTypeObject *type = Py_TYPE((PyObject*)obj);\
|
jpayne@69
|
1057 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
|
jpayne@69
|
1058 PyObject_GC_Del(obj);\
|
jpayne@69
|
1059 Py_DECREF(type);\
|
jpayne@69
|
1060 }
|
jpayne@69
|
1061 #else
|
jpayne@69
|
1062 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
|
jpayne@69
|
1063 #endif
|
jpayne@69
|
1064 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
1065 #define CYTHON_PEP393_ENABLED 1
|
jpayne@69
|
1066 #define __Pyx_PyUnicode_READY(op) (0)
|
jpayne@69
|
1067 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
|
jpayne@69
|
1068 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
|
jpayne@69
|
1069 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
|
jpayne@69
|
1070 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
|
jpayne@69
|
1071 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
|
jpayne@69
|
1072 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
|
jpayne@69
|
1073 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
|
jpayne@69
|
1074 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
|
jpayne@69
|
1075 #define CYTHON_PEP393_ENABLED 1
|
jpayne@69
|
1076 #if PY_VERSION_HEX >= 0x030C0000
|
jpayne@69
|
1077 #define __Pyx_PyUnicode_READY(op) (0)
|
jpayne@69
|
1078 #else
|
jpayne@69
|
1079 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
|
jpayne@69
|
1080 0 : _PyUnicode_Ready((PyObject *)(op)))
|
jpayne@69
|
1081 #endif
|
jpayne@69
|
1082 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
|
jpayne@69
|
1083 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
|
jpayne@69
|
1084 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
|
jpayne@69
|
1085 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
|
jpayne@69
|
1086 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
|
jpayne@69
|
1087 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
|
jpayne@69
|
1088 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
|
jpayne@69
|
1089 #if PY_VERSION_HEX >= 0x030C0000
|
jpayne@69
|
1090 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
|
jpayne@69
|
1091 #else
|
jpayne@69
|
1092 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
|
jpayne@69
|
1093 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
|
jpayne@69
|
1094 #else
|
jpayne@69
|
1095 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
|
jpayne@69
|
1096 #endif
|
jpayne@69
|
1097 #endif
|
jpayne@69
|
1098 #else
|
jpayne@69
|
1099 #define CYTHON_PEP393_ENABLED 0
|
jpayne@69
|
1100 #define PyUnicode_1BYTE_KIND 1
|
jpayne@69
|
1101 #define PyUnicode_2BYTE_KIND 2
|
jpayne@69
|
1102 #define PyUnicode_4BYTE_KIND 4
|
jpayne@69
|
1103 #define __Pyx_PyUnicode_READY(op) (0)
|
jpayne@69
|
1104 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
|
jpayne@69
|
1105 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
|
jpayne@69
|
1106 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
|
jpayne@69
|
1107 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
|
jpayne@69
|
1108 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
|
jpayne@69
|
1109 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
|
jpayne@69
|
1110 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
|
jpayne@69
|
1111 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
|
jpayne@69
|
1112 #endif
|
jpayne@69
|
1113 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
1114 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
|
jpayne@69
|
1115 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
|
jpayne@69
|
1116 #else
|
jpayne@69
|
1117 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
|
jpayne@69
|
1118 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
|
jpayne@69
|
1119 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
|
jpayne@69
|
1120 #endif
|
jpayne@69
|
1121 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
1122 #if !defined(PyUnicode_DecodeUnicodeEscape)
|
jpayne@69
|
1123 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
|
jpayne@69
|
1124 #endif
|
jpayne@69
|
1125 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
|
jpayne@69
|
1126 #undef PyUnicode_Contains
|
jpayne@69
|
1127 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
|
jpayne@69
|
1128 #endif
|
jpayne@69
|
1129 #if !defined(PyByteArray_Check)
|
jpayne@69
|
1130 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
|
jpayne@69
|
1131 #endif
|
jpayne@69
|
1132 #if !defined(PyObject_Format)
|
jpayne@69
|
1133 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
|
jpayne@69
|
1134 #endif
|
jpayne@69
|
1135 #endif
|
jpayne@69
|
1136 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
|
jpayne@69
|
1137 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
|
jpayne@69
|
1138 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1139 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
|
jpayne@69
|
1140 #else
|
jpayne@69
|
1141 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
|
jpayne@69
|
1142 #endif
|
jpayne@69
|
1143 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
|
jpayne@69
|
1144 #define PyObject_ASCII(o) PyObject_Repr(o)
|
jpayne@69
|
1145 #endif
|
jpayne@69
|
1146 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1147 #define PyBaseString_Type PyUnicode_Type
|
jpayne@69
|
1148 #define PyStringObject PyUnicodeObject
|
jpayne@69
|
1149 #define PyString_Type PyUnicode_Type
|
jpayne@69
|
1150 #define PyString_Check PyUnicode_Check
|
jpayne@69
|
1151 #define PyString_CheckExact PyUnicode_CheckExact
|
jpayne@69
|
1152 #ifndef PyObject_Unicode
|
jpayne@69
|
1153 #define PyObject_Unicode PyObject_Str
|
jpayne@69
|
1154 #endif
|
jpayne@69
|
1155 #endif
|
jpayne@69
|
1156 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1157 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
|
jpayne@69
|
1158 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
|
jpayne@69
|
1159 #else
|
jpayne@69
|
1160 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
|
jpayne@69
|
1161 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
|
jpayne@69
|
1162 #endif
|
jpayne@69
|
1163 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
1164 #define __Pyx_PySequence_ListKeepNew(obj)\
|
jpayne@69
|
1165 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
|
jpayne@69
|
1166 #else
|
jpayne@69
|
1167 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
|
jpayne@69
|
1168 #endif
|
jpayne@69
|
1169 #ifndef PySet_CheckExact
|
jpayne@69
|
1170 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
|
jpayne@69
|
1171 #endif
|
jpayne@69
|
1172 #if PY_VERSION_HEX >= 0x030900A4
|
jpayne@69
|
1173 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
|
jpayne@69
|
1174 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
|
jpayne@69
|
1175 #else
|
jpayne@69
|
1176 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
|
jpayne@69
|
1177 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
|
jpayne@69
|
1178 #endif
|
jpayne@69
|
1179 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
1180 #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
|
jpayne@69
|
1181 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
|
jpayne@69
|
1182 #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
|
jpayne@69
|
1183 #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
|
jpayne@69
|
1184 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
|
jpayne@69
|
1185 #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
|
jpayne@69
|
1186 #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
|
jpayne@69
|
1187 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
|
jpayne@69
|
1188 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
|
jpayne@69
|
1189 #else
|
jpayne@69
|
1190 #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
|
jpayne@69
|
1191 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
|
jpayne@69
|
1192 #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
|
jpayne@69
|
1193 #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
|
jpayne@69
|
1194 #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
|
jpayne@69
|
1195 #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
|
jpayne@69
|
1196 #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
|
jpayne@69
|
1197 #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
|
jpayne@69
|
1198 #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
|
jpayne@69
|
1199 #endif
|
jpayne@69
|
1200 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
|
jpayne@69
|
1201 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
|
jpayne@69
|
1202 #else
|
jpayne@69
|
1203 static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
|
jpayne@69
|
1204 PyObject *module = PyImport_AddModule(name);
|
jpayne@69
|
1205 Py_XINCREF(module);
|
jpayne@69
|
1206 return module;
|
jpayne@69
|
1207 }
|
jpayne@69
|
1208 #endif
|
jpayne@69
|
1209 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1210 #define PyIntObject PyLongObject
|
jpayne@69
|
1211 #define PyInt_Type PyLong_Type
|
jpayne@69
|
1212 #define PyInt_Check(op) PyLong_Check(op)
|
jpayne@69
|
1213 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
|
jpayne@69
|
1214 #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
|
jpayne@69
|
1215 #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
|
jpayne@69
|
1216 #define PyInt_FromString PyLong_FromString
|
jpayne@69
|
1217 #define PyInt_FromUnicode PyLong_FromUnicode
|
jpayne@69
|
1218 #define PyInt_FromLong PyLong_FromLong
|
jpayne@69
|
1219 #define PyInt_FromSize_t PyLong_FromSize_t
|
jpayne@69
|
1220 #define PyInt_FromSsize_t PyLong_FromSsize_t
|
jpayne@69
|
1221 #define PyInt_AsLong PyLong_AsLong
|
jpayne@69
|
1222 #define PyInt_AS_LONG PyLong_AS_LONG
|
jpayne@69
|
1223 #define PyInt_AsSsize_t PyLong_AsSsize_t
|
jpayne@69
|
1224 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
|
jpayne@69
|
1225 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
|
jpayne@69
|
1226 #define PyNumber_Int PyNumber_Long
|
jpayne@69
|
1227 #else
|
jpayne@69
|
1228 #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
|
jpayne@69
|
1229 #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
|
jpayne@69
|
1230 #endif
|
jpayne@69
|
1231 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1232 #define PyBoolObject PyLongObject
|
jpayne@69
|
1233 #endif
|
jpayne@69
|
1234 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
1235 #ifndef PyUnicode_InternFromString
|
jpayne@69
|
1236 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
|
jpayne@69
|
1237 #endif
|
jpayne@69
|
1238 #endif
|
jpayne@69
|
1239 #if PY_VERSION_HEX < 0x030200A4
|
jpayne@69
|
1240 typedef long Py_hash_t;
|
jpayne@69
|
1241 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
|
jpayne@69
|
1242 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
|
jpayne@69
|
1243 #else
|
jpayne@69
|
1244 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
|
jpayne@69
|
1245 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
|
jpayne@69
|
1246 #endif
|
jpayne@69
|
1247 #if CYTHON_USE_ASYNC_SLOTS
|
jpayne@69
|
1248 #if PY_VERSION_HEX >= 0x030500B1
|
jpayne@69
|
1249 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
|
jpayne@69
|
1250 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
|
jpayne@69
|
1251 #else
|
jpayne@69
|
1252 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
|
jpayne@69
|
1253 #endif
|
jpayne@69
|
1254 #else
|
jpayne@69
|
1255 #define __Pyx_PyType_AsAsync(obj) NULL
|
jpayne@69
|
1256 #endif
|
jpayne@69
|
1257 #ifndef __Pyx_PyAsyncMethodsStruct
|
jpayne@69
|
1258 typedef struct {
|
jpayne@69
|
1259 unaryfunc am_await;
|
jpayne@69
|
1260 unaryfunc am_aiter;
|
jpayne@69
|
1261 unaryfunc am_anext;
|
jpayne@69
|
1262 } __Pyx_PyAsyncMethodsStruct;
|
jpayne@69
|
1263 #endif
|
jpayne@69
|
1264
|
jpayne@69
|
1265 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
|
jpayne@69
|
1266 #if !defined(_USE_MATH_DEFINES)
|
jpayne@69
|
1267 #define _USE_MATH_DEFINES
|
jpayne@69
|
1268 #endif
|
jpayne@69
|
1269 #endif
|
jpayne@69
|
1270 #include <math.h>
|
jpayne@69
|
1271 #ifdef NAN
|
jpayne@69
|
1272 #define __PYX_NAN() ((float) NAN)
|
jpayne@69
|
1273 #else
|
jpayne@69
|
1274 static CYTHON_INLINE float __PYX_NAN() {
|
jpayne@69
|
1275 float value;
|
jpayne@69
|
1276 memset(&value, 0xFF, sizeof(value));
|
jpayne@69
|
1277 return value;
|
jpayne@69
|
1278 }
|
jpayne@69
|
1279 #endif
|
jpayne@69
|
1280 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
|
jpayne@69
|
1281 #define __Pyx_truncl trunc
|
jpayne@69
|
1282 #else
|
jpayne@69
|
1283 #define __Pyx_truncl truncl
|
jpayne@69
|
1284 #endif
|
jpayne@69
|
1285
|
jpayne@69
|
1286 #define __PYX_MARK_ERR_POS(f_index, lineno) \
|
jpayne@69
|
1287 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
|
jpayne@69
|
1288 #define __PYX_ERR(f_index, lineno, Ln_error) \
|
jpayne@69
|
1289 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
|
jpayne@69
|
1290
|
jpayne@69
|
1291 #ifdef CYTHON_EXTERN_C
|
jpayne@69
|
1292 #undef __PYX_EXTERN_C
|
jpayne@69
|
1293 #define __PYX_EXTERN_C CYTHON_EXTERN_C
|
jpayne@69
|
1294 #elif defined(__PYX_EXTERN_C)
|
jpayne@69
|
1295 #ifdef _MSC_VER
|
jpayne@69
|
1296 #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
|
jpayne@69
|
1297 #else
|
jpayne@69
|
1298 #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
|
jpayne@69
|
1299 #endif
|
jpayne@69
|
1300 #else
|
jpayne@69
|
1301 #ifdef __cplusplus
|
jpayne@69
|
1302 #define __PYX_EXTERN_C extern "C"
|
jpayne@69
|
1303 #else
|
jpayne@69
|
1304 #define __PYX_EXTERN_C extern
|
jpayne@69
|
1305 #endif
|
jpayne@69
|
1306 #endif
|
jpayne@69
|
1307
|
jpayne@69
|
1308 #define __PYX_HAVE__pysam__libcsamfile
|
jpayne@69
|
1309 #define __PYX_HAVE_API__pysam__libcsamfile
|
jpayne@69
|
1310 /* Early includes */
|
jpayne@69
|
1311 #include <stdint.h>
|
jpayne@69
|
1312 #include <string.h>
|
jpayne@69
|
1313 #include <stdlib.h>
|
jpayne@69
|
1314 #include <stdio.h>
|
jpayne@69
|
1315 #include <stddef.h>
|
jpayne@69
|
1316 #include "pythread.h"
|
jpayne@69
|
1317
|
jpayne@69
|
1318 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
1319 #ifdef _MSC_VER
|
jpayne@69
|
1320 #pragma message ("This module uses CPython specific internals of 'array.array', which are not available in PyPy.")
|
jpayne@69
|
1321 #else
|
jpayne@69
|
1322 #warning This module uses CPython specific internals of 'array.array', which are not available in PyPy.
|
jpayne@69
|
1323 #endif
|
jpayne@69
|
1324 #endif
|
jpayne@69
|
1325
|
jpayne@69
|
1326 #include <sys/types.h>
|
jpayne@69
|
1327 #include "stdarg.h"
|
jpayne@69
|
1328 #include "htslib/kstring.h"
|
jpayne@69
|
1329 #include "htslib_util.h"
|
jpayne@69
|
1330 #include "htslib/hfile.h"
|
jpayne@69
|
1331 #include "htslib/bgzf.h"
|
jpayne@69
|
1332 #include "htslib/hts.h"
|
jpayne@69
|
1333 #include "htslib/sam.h"
|
jpayne@69
|
1334 #include "htslib/faidx.h"
|
jpayne@69
|
1335 #include "htslib/tbx.h"
|
jpayne@69
|
1336 #include "htslib/vcf.h"
|
jpayne@69
|
1337 #include "htslib/vcfutils.h"
|
jpayne@69
|
1338 #include "htslib/cram.h"
|
jpayne@69
|
1339 #include "pysam_stream.h"
|
jpayne@69
|
1340 #ifdef _OPENMP
|
jpayne@69
|
1341 #include <omp.h>
|
jpayne@69
|
1342 #endif /* _OPENMP */
|
jpayne@69
|
1343
|
jpayne@69
|
1344 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
|
jpayne@69
|
1345 #define CYTHON_WITHOUT_ASSERTIONS
|
jpayne@69
|
1346 #endif
|
jpayne@69
|
1347
|
jpayne@69
|
1348 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
|
jpayne@69
|
1349 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
|
jpayne@69
|
1350
|
jpayne@69
|
1351 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
|
jpayne@69
|
1352 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
|
jpayne@69
|
1353 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
|
jpayne@69
|
1354 #define __PYX_DEFAULT_STRING_ENCODING ""
|
jpayne@69
|
1355 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
|
jpayne@69
|
1356 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
jpayne@69
|
1357 #define __Pyx_uchar_cast(c) ((unsigned char)c)
|
jpayne@69
|
1358 #define __Pyx_long_cast(x) ((long)x)
|
jpayne@69
|
1359 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
|
jpayne@69
|
1360 (sizeof(type) < sizeof(Py_ssize_t)) ||\
|
jpayne@69
|
1361 (sizeof(type) > sizeof(Py_ssize_t) &&\
|
jpayne@69
|
1362 likely(v < (type)PY_SSIZE_T_MAX ||\
|
jpayne@69
|
1363 v == (type)PY_SSIZE_T_MAX) &&\
|
jpayne@69
|
1364 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
|
jpayne@69
|
1365 v == (type)PY_SSIZE_T_MIN))) ||\
|
jpayne@69
|
1366 (sizeof(type) == sizeof(Py_ssize_t) &&\
|
jpayne@69
|
1367 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
|
jpayne@69
|
1368 v == (type)PY_SSIZE_T_MAX))) )
|
jpayne@69
|
1369 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
|
jpayne@69
|
1370 return (size_t) i < (size_t) limit;
|
jpayne@69
|
1371 }
|
jpayne@69
|
1372 #if defined (__cplusplus) && __cplusplus >= 201103L
|
jpayne@69
|
1373 #include <cstdlib>
|
jpayne@69
|
1374 #define __Pyx_sst_abs(value) std::abs(value)
|
jpayne@69
|
1375 #elif SIZEOF_INT >= SIZEOF_SIZE_T
|
jpayne@69
|
1376 #define __Pyx_sst_abs(value) abs(value)
|
jpayne@69
|
1377 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
|
jpayne@69
|
1378 #define __Pyx_sst_abs(value) labs(value)
|
jpayne@69
|
1379 #elif defined (_MSC_VER)
|
jpayne@69
|
1380 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
|
jpayne@69
|
1381 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
jpayne@69
|
1382 #define __Pyx_sst_abs(value) llabs(value)
|
jpayne@69
|
1383 #elif defined (__GNUC__)
|
jpayne@69
|
1384 #define __Pyx_sst_abs(value) __builtin_llabs(value)
|
jpayne@69
|
1385 #else
|
jpayne@69
|
1386 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
|
jpayne@69
|
1387 #endif
|
jpayne@69
|
1388 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
|
jpayne@69
|
1389 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
|
jpayne@69
|
1390 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
jpayne@69
|
1391 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
|
jpayne@69
|
1392 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
|
jpayne@69
|
1393 #define __Pyx_PyBytes_FromString PyBytes_FromString
|
jpayne@69
|
1394 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
jpayne@69
|
1395 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
jpayne@69
|
1396 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
1397 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
|
jpayne@69
|
1398 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
jpayne@69
|
1399 #else
|
jpayne@69
|
1400 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
|
jpayne@69
|
1401 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
|
jpayne@69
|
1402 #endif
|
jpayne@69
|
1403 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
|
jpayne@69
|
1404 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
|
jpayne@69
|
1405 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
|
jpayne@69
|
1406 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
|
jpayne@69
|
1407 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
|
jpayne@69
|
1408 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
|
jpayne@69
|
1409 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
jpayne@69
|
1410 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
jpayne@69
|
1411 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
jpayne@69
|
1412 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
|
jpayne@69
|
1413 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
|
jpayne@69
|
1414 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
|
jpayne@69
|
1415 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
|
jpayne@69
|
1416 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
jpayne@69
|
1417 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
|
jpayne@69
|
1418 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
jpayne@69
|
1419 #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
|
jpayne@69
|
1420 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
jpayne@69
|
1421 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
|
jpayne@69
|
1422 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
|
jpayne@69
|
1423 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
|
jpayne@69
|
1424 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
|
jpayne@69
|
1425 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
|
jpayne@69
|
1426 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
|
jpayne@69
|
1427 #define __Pyx_PySequence_Tuple(obj)\
|
jpayne@69
|
1428 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
|
jpayne@69
|
1429 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
|
jpayne@69
|
1430 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
|
jpayne@69
|
1431 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
jpayne@69
|
1432 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
1433 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
|
jpayne@69
|
1434 #else
|
jpayne@69
|
1435 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
|
jpayne@69
|
1436 #endif
|
jpayne@69
|
1437 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
|
jpayne@69
|
1438 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1439 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
|
jpayne@69
|
1440 #else
|
jpayne@69
|
1441 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
|
jpayne@69
|
1442 #endif
|
jpayne@69
|
1443 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
1444 #if PY_VERSION_HEX >= 0x030C00A7
|
jpayne@69
|
1445 #ifndef _PyLong_SIGN_MASK
|
jpayne@69
|
1446 #define _PyLong_SIGN_MASK 3
|
jpayne@69
|
1447 #endif
|
jpayne@69
|
1448 #ifndef _PyLong_NON_SIZE_BITS
|
jpayne@69
|
1449 #define _PyLong_NON_SIZE_BITS 3
|
jpayne@69
|
1450 #endif
|
jpayne@69
|
1451 #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
|
jpayne@69
|
1452 #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
|
jpayne@69
|
1453 #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
|
jpayne@69
|
1454 #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
|
jpayne@69
|
1455 #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
|
jpayne@69
|
1456 #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
|
jpayne@69
|
1457 #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
|
jpayne@69
|
1458 #define __Pyx_PyLong_SignedDigitCount(x)\
|
jpayne@69
|
1459 ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
|
jpayne@69
|
1460 #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
|
jpayne@69
|
1461 #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
|
jpayne@69
|
1462 #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
|
jpayne@69
|
1463 #else
|
jpayne@69
|
1464 #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
|
jpayne@69
|
1465 #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
|
jpayne@69
|
1466 #endif
|
jpayne@69
|
1467 typedef Py_ssize_t __Pyx_compact_pylong;
|
jpayne@69
|
1468 typedef size_t __Pyx_compact_upylong;
|
jpayne@69
|
1469 #else
|
jpayne@69
|
1470 #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
|
jpayne@69
|
1471 #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
|
jpayne@69
|
1472 #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
|
jpayne@69
|
1473 #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
|
jpayne@69
|
1474 #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
|
jpayne@69
|
1475 #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
|
jpayne@69
|
1476 #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
|
jpayne@69
|
1477 #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
|
jpayne@69
|
1478 #define __Pyx_PyLong_CompactValue(x)\
|
jpayne@69
|
1479 ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
|
jpayne@69
|
1480 typedef sdigit __Pyx_compact_pylong;
|
jpayne@69
|
1481 typedef digit __Pyx_compact_upylong;
|
jpayne@69
|
1482 #endif
|
jpayne@69
|
1483 #if PY_VERSION_HEX >= 0x030C00A5
|
jpayne@69
|
1484 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
|
jpayne@69
|
1485 #else
|
jpayne@69
|
1486 #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
|
jpayne@69
|
1487 #endif
|
jpayne@69
|
1488 #endif
|
jpayne@69
|
1489 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
jpayne@69
|
1490 #include <string.h>
|
jpayne@69
|
1491 static int __Pyx_sys_getdefaultencoding_not_ascii;
|
jpayne@69
|
1492 static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
jpayne@69
|
1493 PyObject* sys;
|
jpayne@69
|
1494 PyObject* default_encoding = NULL;
|
jpayne@69
|
1495 PyObject* ascii_chars_u = NULL;
|
jpayne@69
|
1496 PyObject* ascii_chars_b = NULL;
|
jpayne@69
|
1497 const char* default_encoding_c;
|
jpayne@69
|
1498 sys = PyImport_ImportModule("sys");
|
jpayne@69
|
1499 if (!sys) goto bad;
|
jpayne@69
|
1500 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
|
jpayne@69
|
1501 Py_DECREF(sys);
|
jpayne@69
|
1502 if (!default_encoding) goto bad;
|
jpayne@69
|
1503 default_encoding_c = PyBytes_AsString(default_encoding);
|
jpayne@69
|
1504 if (!default_encoding_c) goto bad;
|
jpayne@69
|
1505 if (strcmp(default_encoding_c, "ascii") == 0) {
|
jpayne@69
|
1506 __Pyx_sys_getdefaultencoding_not_ascii = 0;
|
jpayne@69
|
1507 } else {
|
jpayne@69
|
1508 char ascii_chars[128];
|
jpayne@69
|
1509 int c;
|
jpayne@69
|
1510 for (c = 0; c < 128; c++) {
|
jpayne@69
|
1511 ascii_chars[c] = (char) c;
|
jpayne@69
|
1512 }
|
jpayne@69
|
1513 __Pyx_sys_getdefaultencoding_not_ascii = 1;
|
jpayne@69
|
1514 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
|
jpayne@69
|
1515 if (!ascii_chars_u) goto bad;
|
jpayne@69
|
1516 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
|
jpayne@69
|
1517 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
|
jpayne@69
|
1518 PyErr_Format(
|
jpayne@69
|
1519 PyExc_ValueError,
|
jpayne@69
|
1520 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
|
jpayne@69
|
1521 default_encoding_c);
|
jpayne@69
|
1522 goto bad;
|
jpayne@69
|
1523 }
|
jpayne@69
|
1524 Py_DECREF(ascii_chars_u);
|
jpayne@69
|
1525 Py_DECREF(ascii_chars_b);
|
jpayne@69
|
1526 }
|
jpayne@69
|
1527 Py_DECREF(default_encoding);
|
jpayne@69
|
1528 return 0;
|
jpayne@69
|
1529 bad:
|
jpayne@69
|
1530 Py_XDECREF(default_encoding);
|
jpayne@69
|
1531 Py_XDECREF(ascii_chars_u);
|
jpayne@69
|
1532 Py_XDECREF(ascii_chars_b);
|
jpayne@69
|
1533 return -1;
|
jpayne@69
|
1534 }
|
jpayne@69
|
1535 #endif
|
jpayne@69
|
1536 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
|
jpayne@69
|
1537 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
|
jpayne@69
|
1538 #else
|
jpayne@69
|
1539 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
jpayne@69
|
1540 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
jpayne@69
|
1541 #include <string.h>
|
jpayne@69
|
1542 static char* __PYX_DEFAULT_STRING_ENCODING;
|
jpayne@69
|
1543 static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
jpayne@69
|
1544 PyObject* sys;
|
jpayne@69
|
1545 PyObject* default_encoding = NULL;
|
jpayne@69
|
1546 char* default_encoding_c;
|
jpayne@69
|
1547 sys = PyImport_ImportModule("sys");
|
jpayne@69
|
1548 if (!sys) goto bad;
|
jpayne@69
|
1549 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
jpayne@69
|
1550 Py_DECREF(sys);
|
jpayne@69
|
1551 if (!default_encoding) goto bad;
|
jpayne@69
|
1552 default_encoding_c = PyBytes_AsString(default_encoding);
|
jpayne@69
|
1553 if (!default_encoding_c) goto bad;
|
jpayne@69
|
1554 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
|
jpayne@69
|
1555 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
|
jpayne@69
|
1556 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
|
jpayne@69
|
1557 Py_DECREF(default_encoding);
|
jpayne@69
|
1558 return 0;
|
jpayne@69
|
1559 bad:
|
jpayne@69
|
1560 Py_XDECREF(default_encoding);
|
jpayne@69
|
1561 return -1;
|
jpayne@69
|
1562 }
|
jpayne@69
|
1563 #endif
|
jpayne@69
|
1564 #endif
|
jpayne@69
|
1565
|
jpayne@69
|
1566
|
jpayne@69
|
1567 /* Test for GCC > 2.95 */
|
jpayne@69
|
1568 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
|
jpayne@69
|
1569 #define likely(x) __builtin_expect(!!(x), 1)
|
jpayne@69
|
1570 #define unlikely(x) __builtin_expect(!!(x), 0)
|
jpayne@69
|
1571 #else /* !__GNUC__ or GCC < 2.95 */
|
jpayne@69
|
1572 #define likely(x) (x)
|
jpayne@69
|
1573 #define unlikely(x) (x)
|
jpayne@69
|
1574 #endif /* __GNUC__ */
|
jpayne@69
|
1575 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
|
jpayne@69
|
1576
|
jpayne@69
|
1577 #if !CYTHON_USE_MODULE_STATE
|
jpayne@69
|
1578 static PyObject *__pyx_m = NULL;
|
jpayne@69
|
1579 #endif
|
jpayne@69
|
1580 static int __pyx_lineno;
|
jpayne@69
|
1581 static int __pyx_clineno = 0;
|
jpayne@69
|
1582 static const char * __pyx_cfilenm = __FILE__;
|
jpayne@69
|
1583 static const char *__pyx_filename;
|
jpayne@69
|
1584
|
jpayne@69
|
1585 /* #### Code section: filename_table ### */
|
jpayne@69
|
1586
|
jpayne@69
|
1587 static const char *__pyx_f[] = {
|
jpayne@69
|
1588 "<stringsource>",
|
jpayne@69
|
1589 "contextvars.pxd",
|
jpayne@69
|
1590 "array.pxd",
|
jpayne@69
|
1591 "pysam/libcsamfile.pyx",
|
jpayne@69
|
1592 "type.pxd",
|
jpayne@69
|
1593 "bool.pxd",
|
jpayne@69
|
1594 "complex.pxd",
|
jpayne@69
|
1595 "pysam/libchtslib.pxd",
|
jpayne@69
|
1596 "pysam/libcfaidx.pxd",
|
jpayne@69
|
1597 "pysam/libcalignedsegment.pxd",
|
jpayne@69
|
1598 "pysam/libcalignmentfile.pxd",
|
jpayne@69
|
1599 };
|
jpayne@69
|
1600 /* #### Code section: utility_code_proto_before_types ### */
|
jpayne@69
|
1601 /* ForceInitThreads.proto */
|
jpayne@69
|
1602 #ifndef __PYX_FORCE_INIT_THREADS
|
jpayne@69
|
1603 #define __PYX_FORCE_INIT_THREADS 0
|
jpayne@69
|
1604 #endif
|
jpayne@69
|
1605
|
jpayne@69
|
1606 /* #### Code section: numeric_typedefs ### */
|
jpayne@69
|
1607 /* #### Code section: complex_type_declarations ### */
|
jpayne@69
|
1608 /* #### Code section: type_declarations ### */
|
jpayne@69
|
1609
|
jpayne@69
|
1610 /*--- Type declarations ---*/
|
jpayne@69
|
1611 #ifndef _ARRAYARRAY_H
|
jpayne@69
|
1612 struct arrayobject;
|
jpayne@69
|
1613 typedef struct arrayobject arrayobject;
|
jpayne@69
|
1614 #endif
|
jpayne@69
|
1615 struct __pyx_obj_5pysam_10libchtslib_HTSFile;
|
jpayne@69
|
1616 struct __pyx_obj_5pysam_9libcfaidx_FastaFile;
|
jpayne@69
|
1617 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy;
|
jpayne@69
|
1618 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord;
|
jpayne@69
|
1619 struct __pyx_obj_5pysam_9libcfaidx_FastxFile;
|
jpayne@69
|
1620 struct __pyx_obj_5pysam_9libcfaidx_FastqFile;
|
jpayne@69
|
1621 struct __pyx_obj_5pysam_9libcfaidx_Fastafile;
|
jpayne@69
|
1622 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment;
|
jpayne@69
|
1623 struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn;
|
jpayne@69
|
1624 struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead;
|
jpayne@69
|
1625 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader;
|
jpayne@69
|
1626 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile;
|
jpayne@69
|
1627 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow;
|
jpayne@69
|
1628 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion;
|
jpayne@69
|
1629 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead;
|
jpayne@69
|
1630 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll;
|
jpayne@69
|
1631 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs;
|
jpayne@69
|
1632 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection;
|
jpayne@69
|
1633 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn;
|
jpayne@69
|
1634 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion;
|
jpayne@69
|
1635 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs;
|
jpayne@69
|
1636 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll;
|
jpayne@69
|
1637 struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads;
|
jpayne@69
|
1638 struct __pyx_obj_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
1639 struct __pyx_obj_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
1640 struct __pyx_opt_args_7cpython_11contextvars_get_value;
|
jpayne@69
|
1641 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default;
|
jpayne@69
|
1642
|
jpayne@69
|
1643 /* "cpython/contextvars.pxd":112
|
jpayne@69
|
1644 *
|
jpayne@69
|
1645 *
|
jpayne@69
|
1646 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
|
jpayne@69
|
1647 * """Return a new reference to the value of the context variable,
|
jpayne@69
|
1648 * or the default value of the context variable,
|
jpayne@69
|
1649 */
|
jpayne@69
|
1650 struct __pyx_opt_args_7cpython_11contextvars_get_value {
|
jpayne@69
|
1651 int __pyx_n;
|
jpayne@69
|
1652 PyObject *default_value;
|
jpayne@69
|
1653 };
|
jpayne@69
|
1654
|
jpayne@69
|
1655 /* "cpython/contextvars.pxd":129
|
jpayne@69
|
1656 *
|
jpayne@69
|
1657 *
|
jpayne@69
|
1658 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
|
jpayne@69
|
1659 * """Return a new reference to the value of the context variable,
|
jpayne@69
|
1660 * or the provided default value if no such value was found.
|
jpayne@69
|
1661 */
|
jpayne@69
|
1662 struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default {
|
jpayne@69
|
1663 int __pyx_n;
|
jpayne@69
|
1664 PyObject *default_value;
|
jpayne@69
|
1665 };
|
jpayne@69
|
1666 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array;
|
jpayne@69
|
1667 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array;
|
jpayne@69
|
1668
|
jpayne@69
|
1669 /* "pysam/libcfaidx.pxd":50
|
jpayne@69
|
1670 * cdef cython.str to_string(self)
|
jpayne@69
|
1671 * cdef cython.str tostring(self)
|
jpayne@69
|
1672 * cpdef array.array get_quality_array(self, int offset=*) # <<<<<<<<<<<<<<
|
jpayne@69
|
1673 *
|
jpayne@69
|
1674 *
|
jpayne@69
|
1675 */
|
jpayne@69
|
1676 struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array {
|
jpayne@69
|
1677 int __pyx_n;
|
jpayne@69
|
1678 int offset;
|
jpayne@69
|
1679 };
|
jpayne@69
|
1680
|
jpayne@69
|
1681 /* "pysam/libcfaidx.pxd":60
|
jpayne@69
|
1682 * cdef cython.str to_string(self)
|
jpayne@69
|
1683 * cdef cython.str tostring(self)
|
jpayne@69
|
1684 * cpdef array.array get_quality_array(self, int offset=*) # <<<<<<<<<<<<<<
|
jpayne@69
|
1685 *
|
jpayne@69
|
1686 * cdef class FastxFile:
|
jpayne@69
|
1687 */
|
jpayne@69
|
1688 struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array {
|
jpayne@69
|
1689 int __pyx_n;
|
jpayne@69
|
1690 int offset;
|
jpayne@69
|
1691 };
|
jpayne@69
|
1692 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_set_tag;
|
jpayne@69
|
1693 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_get_tag;
|
jpayne@69
|
1694 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_tostring;
|
jpayne@69
|
1695
|
jpayne@69
|
1696 /* "pysam/libcalignedsegment.pxd":31
|
jpayne@69
|
1697 *
|
jpayne@69
|
1698 * from pysam.libcalignmentfile cimport AlignmentFile, AlignmentHeader
|
jpayne@69
|
1699 * ctypedef AlignmentFile AlignmentFile_t # <<<<<<<<<<<<<<
|
jpayne@69
|
1700 *
|
jpayne@69
|
1701 *
|
jpayne@69
|
1702 */
|
jpayne@69
|
1703 typedef struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *__pyx_t_5pysam_18libcalignedsegment_AlignmentFile_t;
|
jpayne@69
|
1704
|
jpayne@69
|
1705 /* "pysam/libcalignedsegment.pxd":51
|
jpayne@69
|
1706 * # add an alignment tag with value to the AlignedSegment
|
jpayne@69
|
1707 * # an existing tag of the same name will be replaced.
|
jpayne@69
|
1708 * cpdef set_tag(self, tag, value, value_type=?, replace=?) # <<<<<<<<<<<<<<
|
jpayne@69
|
1709 *
|
jpayne@69
|
1710 * # get an alignment tag from the AlignedSegment
|
jpayne@69
|
1711 */
|
jpayne@69
|
1712 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_set_tag {
|
jpayne@69
|
1713 int __pyx_n;
|
jpayne@69
|
1714 PyObject *value_type;
|
jpayne@69
|
1715 PyObject *replace;
|
jpayne@69
|
1716 };
|
jpayne@69
|
1717
|
jpayne@69
|
1718 /* "pysam/libcalignedsegment.pxd":54
|
jpayne@69
|
1719 *
|
jpayne@69
|
1720 * # get an alignment tag from the AlignedSegment
|
jpayne@69
|
1721 * cpdef get_tag(self, tag, with_value_type=?) # <<<<<<<<<<<<<<
|
jpayne@69
|
1722 *
|
jpayne@69
|
1723 * # return true if tag exists
|
jpayne@69
|
1724 */
|
jpayne@69
|
1725 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_get_tag {
|
jpayne@69
|
1726 int __pyx_n;
|
jpayne@69
|
1727 PyObject *with_value_type;
|
jpayne@69
|
1728 };
|
jpayne@69
|
1729
|
jpayne@69
|
1730 /* "pysam/libcalignedsegment.pxd":63
|
jpayne@69
|
1731 *
|
jpayne@69
|
1732 * # returns a valid sam alignment string (deprecated)
|
jpayne@69
|
1733 * cpdef tostring(self, htsfile=*) # <<<<<<<<<<<<<<
|
jpayne@69
|
1734 *
|
jpayne@69
|
1735 *
|
jpayne@69
|
1736 */
|
jpayne@69
|
1737 struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_tostring {
|
jpayne@69
|
1738 int __pyx_n;
|
jpayne@69
|
1739 PyObject *htsfile;
|
jpayne@69
|
1740 };
|
jpayne@69
|
1741 struct __pyx_t_5pysam_17libcalignmentfile___iterdata;
|
jpayne@69
|
1742 typedef struct __pyx_t_5pysam_17libcalignmentfile___iterdata __pyx_t_5pysam_17libcalignmentfile___iterdata;
|
jpayne@69
|
1743 struct __pyx_opt_args_5pysam_17libcalignmentfile_14IteratorColumn__setup_iterator;
|
jpayne@69
|
1744
|
jpayne@69
|
1745 /* "pysam/libcalignmentfile.pxd":25
|
jpayne@69
|
1746 * # Utility types
|
jpayne@69
|
1747 *
|
jpayne@69
|
1748 * ctypedef struct __iterdata: # <<<<<<<<<<<<<<
|
jpayne@69
|
1749 * htsFile * htsfile
|
jpayne@69
|
1750 * bam_hdr_t * header
|
jpayne@69
|
1751 */
|
jpayne@69
|
1752 struct __pyx_t_5pysam_17libcalignmentfile___iterdata {
|
jpayne@69
|
1753 htsFile *htsfile;
|
jpayne@69
|
1754 bam_hdr_t *header;
|
jpayne@69
|
1755 hts_itr_t *iter;
|
jpayne@69
|
1756 faidx_t *fastafile;
|
jpayne@69
|
1757 int tid;
|
jpayne@69
|
1758 char *seq;
|
jpayne@69
|
1759 int seq_len;
|
jpayne@69
|
1760 int min_mapping_quality;
|
jpayne@69
|
1761 int flag_require;
|
jpayne@69
|
1762 int flag_filter;
|
jpayne@69
|
1763 int compute_baq;
|
jpayne@69
|
1764 int redo_baq;
|
jpayne@69
|
1765 int ignore_orphans;
|
jpayne@69
|
1766 int adjust_capq_threshold;
|
jpayne@69
|
1767 };
|
jpayne@69
|
1768
|
jpayne@69
|
1769 /* "pysam/libcalignmentfile.pxd":121
|
jpayne@69
|
1770 * cdef int cnext(self)
|
jpayne@69
|
1771 * cdef char * get_sequence(self)
|
jpayne@69
|
1772 * cdef _setup_iterator(self, # <<<<<<<<<<<<<<
|
jpayne@69
|
1773 * int tid,
|
jpayne@69
|
1774 * int start,
|
jpayne@69
|
1775 */
|
jpayne@69
|
1776 struct __pyx_opt_args_5pysam_17libcalignmentfile_14IteratorColumn__setup_iterator {
|
jpayne@69
|
1777 int __pyx_n;
|
jpayne@69
|
1778 int multiple_iterators;
|
jpayne@69
|
1779 };
|
jpayne@69
|
1780
|
jpayne@69
|
1781 /* "pysam/libchtslib.pxd":2706
|
jpayne@69
|
1782 *
|
jpayne@69
|
1783 *
|
jpayne@69
|
1784 * cdef class HTSFile(object): # <<<<<<<<<<<<<<
|
jpayne@69
|
1785 * cdef htsFile *htsfile # pointer to htsFile structure
|
jpayne@69
|
1786 * cdef int64_t start_offset # BGZF offset of first record
|
jpayne@69
|
1787 */
|
jpayne@69
|
1788 struct __pyx_obj_5pysam_10libchtslib_HTSFile {
|
jpayne@69
|
1789 PyObject_HEAD
|
jpayne@69
|
1790 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtab;
|
jpayne@69
|
1791 htsFile *htsfile;
|
jpayne@69
|
1792 int64_t start_offset;
|
jpayne@69
|
1793 PyObject *filename;
|
jpayne@69
|
1794 PyObject *mode;
|
jpayne@69
|
1795 PyObject *threads;
|
jpayne@69
|
1796 PyObject *index_filename;
|
jpayne@69
|
1797 int is_stream;
|
jpayne@69
|
1798 int is_remote;
|
jpayne@69
|
1799 int duplicate_filehandle;
|
jpayne@69
|
1800 };
|
jpayne@69
|
1801
|
jpayne@69
|
1802
|
jpayne@69
|
1803 /* "pysam/libcfaidx.pxd":38
|
jpayne@69
|
1804 * int * dret)
|
jpayne@69
|
1805 *
|
jpayne@69
|
1806 * cdef class FastaFile: # <<<<<<<<<<<<<<
|
jpayne@69
|
1807 * cdef bint is_remote
|
jpayne@69
|
1808 * cdef object _filename, _references, _lengths, reference2length
|
jpayne@69
|
1809 */
|
jpayne@69
|
1810 struct __pyx_obj_5pysam_9libcfaidx_FastaFile {
|
jpayne@69
|
1811 PyObject_HEAD
|
jpayne@69
|
1812 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile *__pyx_vtab;
|
jpayne@69
|
1813 int is_remote;
|
jpayne@69
|
1814 PyObject *_filename;
|
jpayne@69
|
1815 PyObject *_references;
|
jpayne@69
|
1816 PyObject *_lengths;
|
jpayne@69
|
1817 PyObject *reference2length;
|
jpayne@69
|
1818 faidx_t *fastafile;
|
jpayne@69
|
1819 };
|
jpayne@69
|
1820
|
jpayne@69
|
1821
|
jpayne@69
|
1822 /* "pysam/libcfaidx.pxd":46
|
jpayne@69
|
1823 *
|
jpayne@69
|
1824 *
|
jpayne@69
|
1825 * cdef class FastqProxy: # <<<<<<<<<<<<<<
|
jpayne@69
|
1826 * cdef kseq_t * _delegate
|
jpayne@69
|
1827 * cdef cython.str to_string(self)
|
jpayne@69
|
1828 */
|
jpayne@69
|
1829 struct __pyx_obj_5pysam_9libcfaidx_FastqProxy {
|
jpayne@69
|
1830 PyObject_HEAD
|
jpayne@69
|
1831 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *__pyx_vtab;
|
jpayne@69
|
1832 kseq_t *_delegate;
|
jpayne@69
|
1833 };
|
jpayne@69
|
1834
|
jpayne@69
|
1835
|
jpayne@69
|
1836 /* "pysam/libcfaidx.pxd":53
|
jpayne@69
|
1837 *
|
jpayne@69
|
1838 *
|
jpayne@69
|
1839 * cdef class FastxRecord: # <<<<<<<<<<<<<<
|
jpayne@69
|
1840 * """
|
jpayne@69
|
1841 * Python container for pysam.libcfaidx.FastqProxy with persistence.
|
jpayne@69
|
1842 */
|
jpayne@69
|
1843 struct __pyx_obj_5pysam_9libcfaidx_FastxRecord {
|
jpayne@69
|
1844 PyObject_HEAD
|
jpayne@69
|
1845 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *__pyx_vtab;
|
jpayne@69
|
1846 PyObject *comment;
|
jpayne@69
|
1847 PyObject *quality;
|
jpayne@69
|
1848 PyObject *sequence;
|
jpayne@69
|
1849 PyObject *name;
|
jpayne@69
|
1850 };
|
jpayne@69
|
1851
|
jpayne@69
|
1852
|
jpayne@69
|
1853 /* "pysam/libcfaidx.pxd":62
|
jpayne@69
|
1854 * cpdef array.array get_quality_array(self, int offset=*)
|
jpayne@69
|
1855 *
|
jpayne@69
|
1856 * cdef class FastxFile: # <<<<<<<<<<<<<<
|
jpayne@69
|
1857 * cdef object _filename
|
jpayne@69
|
1858 * cdef BGZF * fastqfile
|
jpayne@69
|
1859 */
|
jpayne@69
|
1860 struct __pyx_obj_5pysam_9libcfaidx_FastxFile {
|
jpayne@69
|
1861 PyObject_HEAD
|
jpayne@69
|
1862 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile *__pyx_vtab;
|
jpayne@69
|
1863 PyObject *_filename;
|
jpayne@69
|
1864 BGZF *fastqfile;
|
jpayne@69
|
1865 kseq_t *entry;
|
jpayne@69
|
1866 int persist;
|
jpayne@69
|
1867 int is_remote;
|
jpayne@69
|
1868 };
|
jpayne@69
|
1869
|
jpayne@69
|
1870
|
jpayne@69
|
1871 /* "pysam/libcfaidx.pxd":74
|
jpayne@69
|
1872 *
|
jpayne@69
|
1873 * # Compatibility Layer for pysam 0.8.1
|
jpayne@69
|
1874 * cdef class FastqFile(FastxFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
1875 * pass
|
jpayne@69
|
1876 *
|
jpayne@69
|
1877 */
|
jpayne@69
|
1878 struct __pyx_obj_5pysam_9libcfaidx_FastqFile {
|
jpayne@69
|
1879 struct __pyx_obj_5pysam_9libcfaidx_FastxFile __pyx_base;
|
jpayne@69
|
1880 };
|
jpayne@69
|
1881
|
jpayne@69
|
1882
|
jpayne@69
|
1883 /* "pysam/libcfaidx.pxd":79
|
jpayne@69
|
1884 *
|
jpayne@69
|
1885 * # Compatibility Layer for pysam < 0.8
|
jpayne@69
|
1886 * cdef class Fastafile(FastaFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
1887 * pass
|
jpayne@69
|
1888 *
|
jpayne@69
|
1889 */
|
jpayne@69
|
1890 struct __pyx_obj_5pysam_9libcfaidx_Fastafile {
|
jpayne@69
|
1891 struct __pyx_obj_5pysam_9libcfaidx_FastaFile __pyx_base;
|
jpayne@69
|
1892 };
|
jpayne@69
|
1893
|
jpayne@69
|
1894
|
jpayne@69
|
1895 /* "pysam/libcalignedsegment.pxd":35
|
jpayne@69
|
1896 *
|
jpayne@69
|
1897 * # Note: need to declare all C fields and methods here
|
jpayne@69
|
1898 * cdef class AlignedSegment: # <<<<<<<<<<<<<<
|
jpayne@69
|
1899 *
|
jpayne@69
|
1900 * # object that this AlignedSegment represents
|
jpayne@69
|
1901 */
|
jpayne@69
|
1902 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment {
|
jpayne@69
|
1903 PyObject_HEAD
|
jpayne@69
|
1904 struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment *__pyx_vtab;
|
jpayne@69
|
1905 bam1_t *_delegate;
|
jpayne@69
|
1906 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
|
jpayne@69
|
1907 PyObject *cache_query_qualities;
|
jpayne@69
|
1908 PyObject *cache_query_alignment_qualities;
|
jpayne@69
|
1909 PyObject *cache_query_sequence;
|
jpayne@69
|
1910 PyObject *cache_query_alignment_sequence;
|
jpayne@69
|
1911 };
|
jpayne@69
|
1912
|
jpayne@69
|
1913
|
jpayne@69
|
1914 /* "pysam/libcalignedsegment.pxd":66
|
jpayne@69
|
1915 *
|
jpayne@69
|
1916 *
|
jpayne@69
|
1917 * cdef class PileupColumn: # <<<<<<<<<<<<<<
|
jpayne@69
|
1918 * cdef const bam_pileup1_t ** plp
|
jpayne@69
|
1919 * cdef int tid
|
jpayne@69
|
1920 */
|
jpayne@69
|
1921 struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn {
|
jpayne@69
|
1922 PyObject_HEAD
|
jpayne@69
|
1923 bam_pileup1_t const **plp;
|
jpayne@69
|
1924 int tid;
|
jpayne@69
|
1925 int pos;
|
jpayne@69
|
1926 int n_pu;
|
jpayne@69
|
1927 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
|
jpayne@69
|
1928 uint32_t min_base_quality;
|
jpayne@69
|
1929 kstring_t buf;
|
jpayne@69
|
1930 char *reference_sequence;
|
jpayne@69
|
1931 };
|
jpayne@69
|
1932
|
jpayne@69
|
1933
|
jpayne@69
|
1934 /* "pysam/libcalignedsegment.pxd":76
|
jpayne@69
|
1935 * cdef char * reference_sequence
|
jpayne@69
|
1936 *
|
jpayne@69
|
1937 * cdef class PileupRead: # <<<<<<<<<<<<<<
|
jpayne@69
|
1938 * cdef int32_t _qpos
|
jpayne@69
|
1939 * cdef AlignedSegment _alignment
|
jpayne@69
|
1940 */
|
jpayne@69
|
1941 struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead {
|
jpayne@69
|
1942 PyObject_HEAD
|
jpayne@69
|
1943 int32_t _qpos;
|
jpayne@69
|
1944 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *_alignment;
|
jpayne@69
|
1945 int _indel;
|
jpayne@69
|
1946 int _level;
|
jpayne@69
|
1947 uint32_t _is_del;
|
jpayne@69
|
1948 uint32_t _is_head;
|
jpayne@69
|
1949 uint32_t _is_tail;
|
jpayne@69
|
1950 uint32_t _is_refskip;
|
jpayne@69
|
1951 };
|
jpayne@69
|
1952
|
jpayne@69
|
1953
|
jpayne@69
|
1954 /* "pysam/libcalignmentfile.pxd":42
|
jpayne@69
|
1955 *
|
jpayne@69
|
1956 *
|
jpayne@69
|
1957 * cdef class AlignmentHeader(object): # <<<<<<<<<<<<<<
|
jpayne@69
|
1958 * cdef bam_hdr_t *ptr
|
jpayne@69
|
1959 *
|
jpayne@69
|
1960 */
|
jpayne@69
|
1961 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader {
|
jpayne@69
|
1962 PyObject_HEAD
|
jpayne@69
|
1963 bam_hdr_t *ptr;
|
jpayne@69
|
1964 };
|
jpayne@69
|
1965
|
jpayne@69
|
1966
|
jpayne@69
|
1967 /* "pysam/libcalignmentfile.pxd":45
|
jpayne@69
|
1968 * cdef bam_hdr_t *ptr
|
jpayne@69
|
1969 *
|
jpayne@69
|
1970 * cdef class AlignmentFile(HTSFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
1971 * cdef readonly object reference_filename
|
jpayne@69
|
1972 * cdef readonly AlignmentHeader header
|
jpayne@69
|
1973 */
|
jpayne@69
|
1974 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile {
|
jpayne@69
|
1975 struct __pyx_obj_5pysam_10libchtslib_HTSFile __pyx_base;
|
jpayne@69
|
1976 PyObject *reference_filename;
|
jpayne@69
|
1977 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
|
jpayne@69
|
1978 hts_idx_t *index;
|
jpayne@69
|
1979 bam1_t *b;
|
jpayne@69
|
1980 };
|
jpayne@69
|
1981
|
jpayne@69
|
1982
|
jpayne@69
|
1983 /* "pysam/libcalignmentfile.pxd":62
|
jpayne@69
|
1984 *
|
jpayne@69
|
1985 *
|
jpayne@69
|
1986 * cdef class IteratorRow: # <<<<<<<<<<<<<<
|
jpayne@69
|
1987 * cdef int retval
|
jpayne@69
|
1988 * cdef bam1_t * b
|
jpayne@69
|
1989 */
|
jpayne@69
|
1990 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow {
|
jpayne@69
|
1991 PyObject_HEAD
|
jpayne@69
|
1992 int retval;
|
jpayne@69
|
1993 bam1_t *b;
|
jpayne@69
|
1994 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *samfile;
|
jpayne@69
|
1995 htsFile *htsfile;
|
jpayne@69
|
1996 hts_idx_t *index;
|
jpayne@69
|
1997 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
|
jpayne@69
|
1998 int owns_samfile;
|
jpayne@69
|
1999 };
|
jpayne@69
|
2000
|
jpayne@69
|
2001
|
jpayne@69
|
2002 /* "pysam/libcalignmentfile.pxd":72
|
jpayne@69
|
2003 *
|
jpayne@69
|
2004 *
|
jpayne@69
|
2005 * cdef class IteratorRowRegion(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2006 * cdef hts_itr_t * iter
|
jpayne@69
|
2007 * cdef bam1_t * getCurrent(self)
|
jpayne@69
|
2008 */
|
jpayne@69
|
2009 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion {
|
jpayne@69
|
2010 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
|
jpayne@69
|
2011 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion *__pyx_vtab;
|
jpayne@69
|
2012 hts_itr_t *iter;
|
jpayne@69
|
2013 };
|
jpayne@69
|
2014
|
jpayne@69
|
2015
|
jpayne@69
|
2016 /* "pysam/libcalignmentfile.pxd":78
|
jpayne@69
|
2017 *
|
jpayne@69
|
2018 *
|
jpayne@69
|
2019 * cdef class IteratorRowHead(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2020 * cdef int max_rows
|
jpayne@69
|
2021 * cdef int current_row
|
jpayne@69
|
2022 */
|
jpayne@69
|
2023 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead {
|
jpayne@69
|
2024 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
|
jpayne@69
|
2025 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead *__pyx_vtab;
|
jpayne@69
|
2026 int max_rows;
|
jpayne@69
|
2027 int current_row;
|
jpayne@69
|
2028 };
|
jpayne@69
|
2029
|
jpayne@69
|
2030
|
jpayne@69
|
2031 /* "pysam/libcalignmentfile.pxd":85
|
jpayne@69
|
2032 *
|
jpayne@69
|
2033 *
|
jpayne@69
|
2034 * cdef class IteratorRowAll(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2035 * cdef bam1_t * getCurrent(self)
|
jpayne@69
|
2036 * cdef int cnext(self)
|
jpayne@69
|
2037 */
|
jpayne@69
|
2038 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll {
|
jpayne@69
|
2039 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
|
jpayne@69
|
2040 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll *__pyx_vtab;
|
jpayne@69
|
2041 };
|
jpayne@69
|
2042
|
jpayne@69
|
2043
|
jpayne@69
|
2044 /* "pysam/libcalignmentfile.pxd":90
|
jpayne@69
|
2045 *
|
jpayne@69
|
2046 *
|
jpayne@69
|
2047 * cdef class IteratorRowAllRefs(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2048 * cdef int tid
|
jpayne@69
|
2049 * cdef IteratorRowRegion rowiter
|
jpayne@69
|
2050 */
|
jpayne@69
|
2051 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs {
|
jpayne@69
|
2052 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
|
jpayne@69
|
2053 int tid;
|
jpayne@69
|
2054 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *rowiter;
|
jpayne@69
|
2055 };
|
jpayne@69
|
2056
|
jpayne@69
|
2057
|
jpayne@69
|
2058 /* "pysam/libcalignmentfile.pxd":95
|
jpayne@69
|
2059 *
|
jpayne@69
|
2060 *
|
jpayne@69
|
2061 * cdef class IteratorRowSelection(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2062 * cdef int current_pos
|
jpayne@69
|
2063 * cdef positions
|
jpayne@69
|
2064 */
|
jpayne@69
|
2065 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection {
|
jpayne@69
|
2066 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow __pyx_base;
|
jpayne@69
|
2067 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection *__pyx_vtab;
|
jpayne@69
|
2068 int current_pos;
|
jpayne@69
|
2069 PyObject *positions;
|
jpayne@69
|
2070 };
|
jpayne@69
|
2071
|
jpayne@69
|
2072
|
jpayne@69
|
2073 /* "pysam/libcalignmentfile.pxd":102
|
jpayne@69
|
2074 *
|
jpayne@69
|
2075 *
|
jpayne@69
|
2076 * cdef class IteratorColumn: # <<<<<<<<<<<<<<
|
jpayne@69
|
2077 *
|
jpayne@69
|
2078 * # result of the last plbuf_push
|
jpayne@69
|
2079 */
|
jpayne@69
|
2080 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn {
|
jpayne@69
|
2081 PyObject_HEAD
|
jpayne@69
|
2082 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn *__pyx_vtab;
|
jpayne@69
|
2083 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *iter;
|
jpayne@69
|
2084 int tid;
|
jpayne@69
|
2085 int pos;
|
jpayne@69
|
2086 int n_plp;
|
jpayne@69
|
2087 uint32_t min_base_quality;
|
jpayne@69
|
2088 bam_pileup1_t const *plp;
|
jpayne@69
|
2089 bam_mplp_t pileup_iter;
|
jpayne@69
|
2090 __pyx_t_5pysam_17libcalignmentfile___iterdata iterdata;
|
jpayne@69
|
2091 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *samfile;
|
jpayne@69
|
2092 struct __pyx_obj_5pysam_9libcfaidx_FastaFile *fastafile;
|
jpayne@69
|
2093 PyObject *stepper;
|
jpayne@69
|
2094 int max_depth;
|
jpayne@69
|
2095 int ignore_overlaps;
|
jpayne@69
|
2096 };
|
jpayne@69
|
2097
|
jpayne@69
|
2098
|
jpayne@69
|
2099 /* "pysam/libcalignmentfile.pxd":134
|
jpayne@69
|
2100 *
|
jpayne@69
|
2101 *
|
jpayne@69
|
2102 * cdef class IteratorColumnRegion(IteratorColumn): # <<<<<<<<<<<<<<
|
jpayne@69
|
2103 * cdef int start
|
jpayne@69
|
2104 * cdef int stop
|
jpayne@69
|
2105 */
|
jpayne@69
|
2106 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion {
|
jpayne@69
|
2107 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
|
jpayne@69
|
2108 int start;
|
jpayne@69
|
2109 int stop;
|
jpayne@69
|
2110 int truncate;
|
jpayne@69
|
2111 };
|
jpayne@69
|
2112
|
jpayne@69
|
2113
|
jpayne@69
|
2114 /* "pysam/libcalignmentfile.pxd":140
|
jpayne@69
|
2115 *
|
jpayne@69
|
2116 *
|
jpayne@69
|
2117 * cdef class IteratorColumnAllRefs(IteratorColumn): # <<<<<<<<<<<<<<
|
jpayne@69
|
2118 * pass
|
jpayne@69
|
2119 *
|
jpayne@69
|
2120 */
|
jpayne@69
|
2121 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs {
|
jpayne@69
|
2122 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
|
jpayne@69
|
2123 };
|
jpayne@69
|
2124
|
jpayne@69
|
2125
|
jpayne@69
|
2126 /* "pysam/libcalignmentfile.pxd":144
|
jpayne@69
|
2127 *
|
jpayne@69
|
2128 *
|
jpayne@69
|
2129 * cdef class IteratorColumnAll(IteratorColumn): # <<<<<<<<<<<<<<
|
jpayne@69
|
2130 * pass
|
jpayne@69
|
2131 *
|
jpayne@69
|
2132 */
|
jpayne@69
|
2133 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll {
|
jpayne@69
|
2134 struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
|
jpayne@69
|
2135 };
|
jpayne@69
|
2136
|
jpayne@69
|
2137
|
jpayne@69
|
2138 /* "pysam/libcalignmentfile.pxd":148
|
jpayne@69
|
2139 *
|
jpayne@69
|
2140 *
|
jpayne@69
|
2141 * cdef class IndexedReads: # <<<<<<<<<<<<<<
|
jpayne@69
|
2142 * cdef AlignmentFile samfile
|
jpayne@69
|
2143 * cdef htsFile * htsfile
|
jpayne@69
|
2144 */
|
jpayne@69
|
2145 struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads {
|
jpayne@69
|
2146 PyObject_HEAD
|
jpayne@69
|
2147 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *samfile;
|
jpayne@69
|
2148 htsFile *htsfile;
|
jpayne@69
|
2149 PyObject *index;
|
jpayne@69
|
2150 int owns_samfile;
|
jpayne@69
|
2151 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader *header;
|
jpayne@69
|
2152 };
|
jpayne@69
|
2153
|
jpayne@69
|
2154
|
jpayne@69
|
2155 /* "pysam/libcsamfile.pxd":10
|
jpayne@69
|
2156 * from pysam.libchtslib cimport *
|
jpayne@69
|
2157 *
|
jpayne@69
|
2158 * cdef class AlignedRead(AlignedSegment): # <<<<<<<<<<<<<<
|
jpayne@69
|
2159 * pass
|
jpayne@69
|
2160 *
|
jpayne@69
|
2161 */
|
jpayne@69
|
2162 struct __pyx_obj_5pysam_11libcsamfile_AlignedRead {
|
jpayne@69
|
2163 struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment __pyx_base;
|
jpayne@69
|
2164 };
|
jpayne@69
|
2165
|
jpayne@69
|
2166
|
jpayne@69
|
2167 /* "pysam/libcsamfile.pxd":13
|
jpayne@69
|
2168 * pass
|
jpayne@69
|
2169 *
|
jpayne@69
|
2170 * cdef class Samfile(AlignmentFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
2171 * pass
|
jpayne@69
|
2172 *
|
jpayne@69
|
2173 */
|
jpayne@69
|
2174 struct __pyx_obj_5pysam_11libcsamfile_Samfile {
|
jpayne@69
|
2175 struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile __pyx_base;
|
jpayne@69
|
2176 };
|
jpayne@69
|
2177
|
jpayne@69
|
2178
|
jpayne@69
|
2179
|
jpayne@69
|
2180 /* "pysam/libchtslib.pxd":2706
|
jpayne@69
|
2181 *
|
jpayne@69
|
2182 *
|
jpayne@69
|
2183 * cdef class HTSFile(object): # <<<<<<<<<<<<<<
|
jpayne@69
|
2184 * cdef htsFile *htsfile # pointer to htsFile structure
|
jpayne@69
|
2185 * cdef int64_t start_offset # BGZF offset of first record
|
jpayne@69
|
2186 */
|
jpayne@69
|
2187
|
jpayne@69
|
2188 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile {
|
jpayne@69
|
2189 htsFile *(*_open_htsfile)(struct __pyx_obj_5pysam_10libchtslib_HTSFile *);
|
jpayne@69
|
2190 };
|
jpayne@69
|
2191 static struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile *__pyx_vtabptr_5pysam_10libchtslib_HTSFile;
|
jpayne@69
|
2192
|
jpayne@69
|
2193
|
jpayne@69
|
2194 /* "pysam/libcfaidx.pxd":38
|
jpayne@69
|
2195 * int * dret)
|
jpayne@69
|
2196 *
|
jpayne@69
|
2197 * cdef class FastaFile: # <<<<<<<<<<<<<<
|
jpayne@69
|
2198 * cdef bint is_remote
|
jpayne@69
|
2199 * cdef object _filename, _references, _lengths, reference2length
|
jpayne@69
|
2200 */
|
jpayne@69
|
2201
|
jpayne@69
|
2202 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile {
|
jpayne@69
|
2203 char *(*_fetch)(struct __pyx_obj_5pysam_9libcfaidx_FastaFile *, char *, int, int, int *);
|
jpayne@69
|
2204 };
|
jpayne@69
|
2205 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile *__pyx_vtabptr_5pysam_9libcfaidx_FastaFile;
|
jpayne@69
|
2206
|
jpayne@69
|
2207
|
jpayne@69
|
2208 /* "pysam/libcfaidx.pxd":46
|
jpayne@69
|
2209 *
|
jpayne@69
|
2210 *
|
jpayne@69
|
2211 * cdef class FastqProxy: # <<<<<<<<<<<<<<
|
jpayne@69
|
2212 * cdef kseq_t * _delegate
|
jpayne@69
|
2213 * cdef cython.str to_string(self)
|
jpayne@69
|
2214 */
|
jpayne@69
|
2215
|
jpayne@69
|
2216 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy {
|
jpayne@69
|
2217 PyObject *(*to_string)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *);
|
jpayne@69
|
2218 PyObject *(*tostring)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *);
|
jpayne@69
|
2219 arrayobject *(*get_quality_array)(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_10FastqProxy_get_quality_array *__pyx_optional_args);
|
jpayne@69
|
2220 };
|
jpayne@69
|
2221 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy *__pyx_vtabptr_5pysam_9libcfaidx_FastqProxy;
|
jpayne@69
|
2222
|
jpayne@69
|
2223
|
jpayne@69
|
2224 /* "pysam/libcfaidx.pxd":53
|
jpayne@69
|
2225 *
|
jpayne@69
|
2226 *
|
jpayne@69
|
2227 * cdef class FastxRecord: # <<<<<<<<<<<<<<
|
jpayne@69
|
2228 * """
|
jpayne@69
|
2229 * Python container for pysam.libcfaidx.FastqProxy with persistence.
|
jpayne@69
|
2230 */
|
jpayne@69
|
2231
|
jpayne@69
|
2232 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord {
|
jpayne@69
|
2233 PyObject *(*to_string)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *);
|
jpayne@69
|
2234 PyObject *(*tostring)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *);
|
jpayne@69
|
2235 arrayobject *(*get_quality_array)(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_9libcfaidx_11FastxRecord_get_quality_array *__pyx_optional_args);
|
jpayne@69
|
2236 };
|
jpayne@69
|
2237 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord *__pyx_vtabptr_5pysam_9libcfaidx_FastxRecord;
|
jpayne@69
|
2238
|
jpayne@69
|
2239
|
jpayne@69
|
2240 /* "pysam/libcfaidx.pxd":62
|
jpayne@69
|
2241 * cpdef array.array get_quality_array(self, int offset=*)
|
jpayne@69
|
2242 *
|
jpayne@69
|
2243 * cdef class FastxFile: # <<<<<<<<<<<<<<
|
jpayne@69
|
2244 * cdef object _filename
|
jpayne@69
|
2245 * cdef BGZF * fastqfile
|
jpayne@69
|
2246 */
|
jpayne@69
|
2247
|
jpayne@69
|
2248 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile {
|
jpayne@69
|
2249 kseq_t *(*getCurrent)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *);
|
jpayne@69
|
2250 int (*cnext)(struct __pyx_obj_5pysam_9libcfaidx_FastxFile *);
|
jpayne@69
|
2251 };
|
jpayne@69
|
2252 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile *__pyx_vtabptr_5pysam_9libcfaidx_FastxFile;
|
jpayne@69
|
2253
|
jpayne@69
|
2254
|
jpayne@69
|
2255 /* "pysam/libcfaidx.pxd":74
|
jpayne@69
|
2256 *
|
jpayne@69
|
2257 * # Compatibility Layer for pysam 0.8.1
|
jpayne@69
|
2258 * cdef class FastqFile(FastxFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
2259 * pass
|
jpayne@69
|
2260 *
|
jpayne@69
|
2261 */
|
jpayne@69
|
2262
|
jpayne@69
|
2263 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile {
|
jpayne@69
|
2264 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile __pyx_base;
|
jpayne@69
|
2265 };
|
jpayne@69
|
2266 static struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile *__pyx_vtabptr_5pysam_9libcfaidx_FastqFile;
|
jpayne@69
|
2267
|
jpayne@69
|
2268
|
jpayne@69
|
2269 /* "pysam/libcfaidx.pxd":79
|
jpayne@69
|
2270 *
|
jpayne@69
|
2271 * # Compatibility Layer for pysam < 0.8
|
jpayne@69
|
2272 * cdef class Fastafile(FastaFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
2273 * pass
|
jpayne@69
|
2274 *
|
jpayne@69
|
2275 */
|
jpayne@69
|
2276
|
jpayne@69
|
2277 struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile {
|
jpayne@69
|
2278 struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile __pyx_base;
|
jpayne@69
|
2279 };
|
jpayne@69
|
2280 static struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile *__pyx_vtabptr_5pysam_9libcfaidx_Fastafile;
|
jpayne@69
|
2281
|
jpayne@69
|
2282
|
jpayne@69
|
2283 /* "pysam/libcalignedsegment.pxd":35
|
jpayne@69
|
2284 *
|
jpayne@69
|
2285 * # Note: need to declare all C fields and methods here
|
jpayne@69
|
2286 * cdef class AlignedSegment: # <<<<<<<<<<<<<<
|
jpayne@69
|
2287 *
|
jpayne@69
|
2288 * # object that this AlignedSegment represents
|
jpayne@69
|
2289 */
|
jpayne@69
|
2290
|
jpayne@69
|
2291 struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment {
|
jpayne@69
|
2292 PyObject *(*set_tag)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, PyObject *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_set_tag *__pyx_optional_args);
|
jpayne@69
|
2293 PyObject *(*get_tag)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_get_tag *__pyx_optional_args);
|
jpayne@69
|
2294 PyObject *(*has_tag)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, PyObject *, int __pyx_skip_dispatch);
|
jpayne@69
|
2295 PyObject *(*to_string)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, int __pyx_skip_dispatch);
|
jpayne@69
|
2296 PyObject *(*tostring)(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, int __pyx_skip_dispatch, struct __pyx_opt_args_5pysam_18libcalignedsegment_14AlignedSegment_tostring *__pyx_optional_args);
|
jpayne@69
|
2297 };
|
jpayne@69
|
2298 static struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment *__pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment;
|
jpayne@69
|
2299
|
jpayne@69
|
2300
|
jpayne@69
|
2301 /* "pysam/libcalignmentfile.pxd":45
|
jpayne@69
|
2302 * cdef bam_hdr_t *ptr
|
jpayne@69
|
2303 *
|
jpayne@69
|
2304 * cdef class AlignmentFile(HTSFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
2305 * cdef readonly object reference_filename
|
jpayne@69
|
2306 * cdef readonly AlignmentHeader header
|
jpayne@69
|
2307 */
|
jpayne@69
|
2308
|
jpayne@69
|
2309 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile {
|
jpayne@69
|
2310 struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile __pyx_base;
|
jpayne@69
|
2311 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *);
|
jpayne@69
|
2312 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *);
|
jpayne@69
|
2313 int (*write)(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile *, struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment *, int __pyx_skip_dispatch);
|
jpayne@69
|
2314 };
|
jpayne@69
|
2315 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile *__pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile;
|
jpayne@69
|
2316
|
jpayne@69
|
2317
|
jpayne@69
|
2318 /* "pysam/libcalignmentfile.pxd":72
|
jpayne@69
|
2319 *
|
jpayne@69
|
2320 *
|
jpayne@69
|
2321 * cdef class IteratorRowRegion(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2322 * cdef hts_itr_t * iter
|
jpayne@69
|
2323 * cdef bam1_t * getCurrent(self)
|
jpayne@69
|
2324 */
|
jpayne@69
|
2325
|
jpayne@69
|
2326 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion {
|
jpayne@69
|
2327 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *);
|
jpayne@69
|
2328 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion *);
|
jpayne@69
|
2329 };
|
jpayne@69
|
2330 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowRegion;
|
jpayne@69
|
2331
|
jpayne@69
|
2332
|
jpayne@69
|
2333 /* "pysam/libcalignmentfile.pxd":78
|
jpayne@69
|
2334 *
|
jpayne@69
|
2335 *
|
jpayne@69
|
2336 * cdef class IteratorRowHead(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2337 * cdef int max_rows
|
jpayne@69
|
2338 * cdef int current_row
|
jpayne@69
|
2339 */
|
jpayne@69
|
2340
|
jpayne@69
|
2341 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead {
|
jpayne@69
|
2342 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead *);
|
jpayne@69
|
2343 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead *);
|
jpayne@69
|
2344 };
|
jpayne@69
|
2345 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowHead;
|
jpayne@69
|
2346
|
jpayne@69
|
2347
|
jpayne@69
|
2348 /* "pysam/libcalignmentfile.pxd":85
|
jpayne@69
|
2349 *
|
jpayne@69
|
2350 *
|
jpayne@69
|
2351 * cdef class IteratorRowAll(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2352 * cdef bam1_t * getCurrent(self)
|
jpayne@69
|
2353 * cdef int cnext(self)
|
jpayne@69
|
2354 */
|
jpayne@69
|
2355
|
jpayne@69
|
2356 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll {
|
jpayne@69
|
2357 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll *);
|
jpayne@69
|
2358 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll *);
|
jpayne@69
|
2359 };
|
jpayne@69
|
2360 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowAll;
|
jpayne@69
|
2361
|
jpayne@69
|
2362
|
jpayne@69
|
2363 /* "pysam/libcalignmentfile.pxd":95
|
jpayne@69
|
2364 *
|
jpayne@69
|
2365 *
|
jpayne@69
|
2366 * cdef class IteratorRowSelection(IteratorRow): # <<<<<<<<<<<<<<
|
jpayne@69
|
2367 * cdef int current_pos
|
jpayne@69
|
2368 * cdef positions
|
jpayne@69
|
2369 */
|
jpayne@69
|
2370
|
jpayne@69
|
2371 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection {
|
jpayne@69
|
2372 bam1_t *(*getCurrent)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection *);
|
jpayne@69
|
2373 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection *);
|
jpayne@69
|
2374 };
|
jpayne@69
|
2375 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowSelection;
|
jpayne@69
|
2376
|
jpayne@69
|
2377
|
jpayne@69
|
2378 /* "pysam/libcalignmentfile.pxd":102
|
jpayne@69
|
2379 *
|
jpayne@69
|
2380 *
|
jpayne@69
|
2381 * cdef class IteratorColumn: # <<<<<<<<<<<<<<
|
jpayne@69
|
2382 *
|
jpayne@69
|
2383 * # result of the last plbuf_push
|
jpayne@69
|
2384 */
|
jpayne@69
|
2385
|
jpayne@69
|
2386 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn {
|
jpayne@69
|
2387 int (*cnext)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
|
jpayne@69
|
2388 char *(*get_sequence)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
|
jpayne@69
|
2389 PyObject *(*_setup_iterator)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *, int, int, int, struct __pyx_opt_args_5pysam_17libcalignmentfile_14IteratorColumn__setup_iterator *__pyx_optional_args);
|
jpayne@69
|
2390 PyObject *(*_setup_raw_rest_iterator)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
|
jpayne@69
|
2391 PyObject *(*reset)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *, PyObject *, PyObject *, PyObject *);
|
jpayne@69
|
2392 PyObject *(*_free_pileup_iter)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
|
jpayne@69
|
2393 char *(*getSequence)(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn *);
|
jpayne@69
|
2394 };
|
jpayne@69
|
2395 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumn;
|
jpayne@69
|
2396
|
jpayne@69
|
2397
|
jpayne@69
|
2398 /* "pysam/libcalignmentfile.pxd":134
|
jpayne@69
|
2399 *
|
jpayne@69
|
2400 *
|
jpayne@69
|
2401 * cdef class IteratorColumnRegion(IteratorColumn): # <<<<<<<<<<<<<<
|
jpayne@69
|
2402 * cdef int start
|
jpayne@69
|
2403 * cdef int stop
|
jpayne@69
|
2404 */
|
jpayne@69
|
2405
|
jpayne@69
|
2406 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnRegion {
|
jpayne@69
|
2407 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
|
jpayne@69
|
2408 };
|
jpayne@69
|
2409 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnRegion *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnRegion;
|
jpayne@69
|
2410
|
jpayne@69
|
2411
|
jpayne@69
|
2412 /* "pysam/libcalignmentfile.pxd":140
|
jpayne@69
|
2413 *
|
jpayne@69
|
2414 *
|
jpayne@69
|
2415 * cdef class IteratorColumnAllRefs(IteratorColumn): # <<<<<<<<<<<<<<
|
jpayne@69
|
2416 * pass
|
jpayne@69
|
2417 *
|
jpayne@69
|
2418 */
|
jpayne@69
|
2419
|
jpayne@69
|
2420 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAllRefs {
|
jpayne@69
|
2421 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
|
jpayne@69
|
2422 };
|
jpayne@69
|
2423 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAllRefs *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAllRefs;
|
jpayne@69
|
2424
|
jpayne@69
|
2425
|
jpayne@69
|
2426 /* "pysam/libcalignmentfile.pxd":144
|
jpayne@69
|
2427 *
|
jpayne@69
|
2428 *
|
jpayne@69
|
2429 * cdef class IteratorColumnAll(IteratorColumn): # <<<<<<<<<<<<<<
|
jpayne@69
|
2430 * pass
|
jpayne@69
|
2431 *
|
jpayne@69
|
2432 */
|
jpayne@69
|
2433
|
jpayne@69
|
2434 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAll {
|
jpayne@69
|
2435 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn __pyx_base;
|
jpayne@69
|
2436 };
|
jpayne@69
|
2437 static struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAll *__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAll;
|
jpayne@69
|
2438
|
jpayne@69
|
2439
|
jpayne@69
|
2440 /* "pysam/libcsamfile.pyx":31
|
jpayne@69
|
2441 *
|
jpayne@69
|
2442 *
|
jpayne@69
|
2443 * cdef class AlignedRead(AlignedSegment): # <<<<<<<<<<<<<<
|
jpayne@69
|
2444 * '''Deprecated alternative for :class:`~pysam.AlignedSegment`
|
jpayne@69
|
2445 *
|
jpayne@69
|
2446 */
|
jpayne@69
|
2447
|
jpayne@69
|
2448 struct __pyx_vtabstruct_5pysam_11libcsamfile_AlignedRead {
|
jpayne@69
|
2449 struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment __pyx_base;
|
jpayne@69
|
2450 };
|
jpayne@69
|
2451 static struct __pyx_vtabstruct_5pysam_11libcsamfile_AlignedRead *__pyx_vtabptr_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
2452
|
jpayne@69
|
2453
|
jpayne@69
|
2454 /* "pysam/libcsamfile.pyx":23
|
jpayne@69
|
2455 *
|
jpayne@69
|
2456 *
|
jpayne@69
|
2457 * cdef class Samfile(AlignmentFile): # <<<<<<<<<<<<<<
|
jpayne@69
|
2458 * '''Deprecated alternative for :class:`~pysam.AlignmentFile`
|
jpayne@69
|
2459 *
|
jpayne@69
|
2460 */
|
jpayne@69
|
2461
|
jpayne@69
|
2462 struct __pyx_vtabstruct_5pysam_11libcsamfile_Samfile {
|
jpayne@69
|
2463 struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile __pyx_base;
|
jpayne@69
|
2464 };
|
jpayne@69
|
2465 static struct __pyx_vtabstruct_5pysam_11libcsamfile_Samfile *__pyx_vtabptr_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
2466 /* #### Code section: utility_code_proto ### */
|
jpayne@69
|
2467
|
jpayne@69
|
2468 /* --- Runtime support code (head) --- */
|
jpayne@69
|
2469 /* Refnanny.proto */
|
jpayne@69
|
2470 #ifndef CYTHON_REFNANNY
|
jpayne@69
|
2471 #define CYTHON_REFNANNY 0
|
jpayne@69
|
2472 #endif
|
jpayne@69
|
2473 #if CYTHON_REFNANNY
|
jpayne@69
|
2474 typedef struct {
|
jpayne@69
|
2475 void (*INCREF)(void*, PyObject*, Py_ssize_t);
|
jpayne@69
|
2476 void (*DECREF)(void*, PyObject*, Py_ssize_t);
|
jpayne@69
|
2477 void (*GOTREF)(void*, PyObject*, Py_ssize_t);
|
jpayne@69
|
2478 void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
|
jpayne@69
|
2479 void* (*SetupContext)(const char*, Py_ssize_t, const char*);
|
jpayne@69
|
2480 void (*FinishContext)(void**);
|
jpayne@69
|
2481 } __Pyx_RefNannyAPIStruct;
|
jpayne@69
|
2482 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
|
jpayne@69
|
2483 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
|
jpayne@69
|
2484 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
|
jpayne@69
|
2485 #ifdef WITH_THREAD
|
jpayne@69
|
2486 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
|
jpayne@69
|
2487 if (acquire_gil) {\
|
jpayne@69
|
2488 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
jpayne@69
|
2489 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
|
jpayne@69
|
2490 PyGILState_Release(__pyx_gilstate_save);\
|
jpayne@69
|
2491 } else {\
|
jpayne@69
|
2492 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
|
jpayne@69
|
2493 }
|
jpayne@69
|
2494 #define __Pyx_RefNannyFinishContextNogil() {\
|
jpayne@69
|
2495 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
jpayne@69
|
2496 __Pyx_RefNannyFinishContext();\
|
jpayne@69
|
2497 PyGILState_Release(__pyx_gilstate_save);\
|
jpayne@69
|
2498 }
|
jpayne@69
|
2499 #else
|
jpayne@69
|
2500 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
|
jpayne@69
|
2501 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
|
jpayne@69
|
2502 #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
|
jpayne@69
|
2503 #endif
|
jpayne@69
|
2504 #define __Pyx_RefNannyFinishContextNogil() {\
|
jpayne@69
|
2505 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
jpayne@69
|
2506 __Pyx_RefNannyFinishContext();\
|
jpayne@69
|
2507 PyGILState_Release(__pyx_gilstate_save);\
|
jpayne@69
|
2508 }
|
jpayne@69
|
2509 #define __Pyx_RefNannyFinishContext()\
|
jpayne@69
|
2510 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
|
jpayne@69
|
2511 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
jpayne@69
|
2512 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
jpayne@69
|
2513 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
jpayne@69
|
2514 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
jpayne@69
|
2515 #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
|
jpayne@69
|
2516 #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
|
jpayne@69
|
2517 #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
|
jpayne@69
|
2518 #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
|
jpayne@69
|
2519 #else
|
jpayne@69
|
2520 #define __Pyx_RefNannyDeclarations
|
jpayne@69
|
2521 #define __Pyx_RefNannySetupContext(name, acquire_gil)
|
jpayne@69
|
2522 #define __Pyx_RefNannyFinishContextNogil()
|
jpayne@69
|
2523 #define __Pyx_RefNannyFinishContext()
|
jpayne@69
|
2524 #define __Pyx_INCREF(r) Py_INCREF(r)
|
jpayne@69
|
2525 #define __Pyx_DECREF(r) Py_DECREF(r)
|
jpayne@69
|
2526 #define __Pyx_GOTREF(r)
|
jpayne@69
|
2527 #define __Pyx_GIVEREF(r)
|
jpayne@69
|
2528 #define __Pyx_XINCREF(r) Py_XINCREF(r)
|
jpayne@69
|
2529 #define __Pyx_XDECREF(r) Py_XDECREF(r)
|
jpayne@69
|
2530 #define __Pyx_XGOTREF(r)
|
jpayne@69
|
2531 #define __Pyx_XGIVEREF(r)
|
jpayne@69
|
2532 #endif
|
jpayne@69
|
2533 #define __Pyx_Py_XDECREF_SET(r, v) do {\
|
jpayne@69
|
2534 PyObject *tmp = (PyObject *) r;\
|
jpayne@69
|
2535 r = v; Py_XDECREF(tmp);\
|
jpayne@69
|
2536 } while (0)
|
jpayne@69
|
2537 #define __Pyx_XDECREF_SET(r, v) do {\
|
jpayne@69
|
2538 PyObject *tmp = (PyObject *) r;\
|
jpayne@69
|
2539 r = v; __Pyx_XDECREF(tmp);\
|
jpayne@69
|
2540 } while (0)
|
jpayne@69
|
2541 #define __Pyx_DECREF_SET(r, v) do {\
|
jpayne@69
|
2542 PyObject *tmp = (PyObject *) r;\
|
jpayne@69
|
2543 r = v; __Pyx_DECREF(tmp);\
|
jpayne@69
|
2544 } while (0)
|
jpayne@69
|
2545 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
|
jpayne@69
|
2546 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
|
jpayne@69
|
2547
|
jpayne@69
|
2548 /* PyErrExceptionMatches.proto */
|
jpayne@69
|
2549 #if CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
2550 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
|
jpayne@69
|
2551 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
|
jpayne@69
|
2552 #else
|
jpayne@69
|
2553 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
|
jpayne@69
|
2554 #endif
|
jpayne@69
|
2555
|
jpayne@69
|
2556 /* PyThreadStateGet.proto */
|
jpayne@69
|
2557 #if CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
2558 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
|
jpayne@69
|
2559 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
|
jpayne@69
|
2560 #if PY_VERSION_HEX >= 0x030C00A6
|
jpayne@69
|
2561 #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
|
jpayne@69
|
2562 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
|
jpayne@69
|
2563 #else
|
jpayne@69
|
2564 #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
|
jpayne@69
|
2565 #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
|
jpayne@69
|
2566 #endif
|
jpayne@69
|
2567 #else
|
jpayne@69
|
2568 #define __Pyx_PyThreadState_declare
|
jpayne@69
|
2569 #define __Pyx_PyThreadState_assign
|
jpayne@69
|
2570 #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
|
jpayne@69
|
2571 #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
|
jpayne@69
|
2572 #endif
|
jpayne@69
|
2573
|
jpayne@69
|
2574 /* PyErrFetchRestore.proto */
|
jpayne@69
|
2575 #if CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
2576 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
|
jpayne@69
|
2577 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
|
jpayne@69
|
2578 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
|
jpayne@69
|
2579 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
|
jpayne@69
|
2580 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
|
jpayne@69
|
2581 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
|
jpayne@69
|
2582 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
|
jpayne@69
|
2583 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
|
jpayne@69
|
2584 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
|
jpayne@69
|
2585 #else
|
jpayne@69
|
2586 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
jpayne@69
|
2587 #endif
|
jpayne@69
|
2588 #else
|
jpayne@69
|
2589 #define __Pyx_PyErr_Clear() PyErr_Clear()
|
jpayne@69
|
2590 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
jpayne@69
|
2591 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
|
jpayne@69
|
2592 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
|
jpayne@69
|
2593 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
|
jpayne@69
|
2594 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
|
jpayne@69
|
2595 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
|
jpayne@69
|
2596 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
|
jpayne@69
|
2597 #endif
|
jpayne@69
|
2598
|
jpayne@69
|
2599 /* PyObjectGetAttrStr.proto */
|
jpayne@69
|
2600 #if CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
2601 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
|
jpayne@69
|
2602 #else
|
jpayne@69
|
2603 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
|
jpayne@69
|
2604 #endif
|
jpayne@69
|
2605
|
jpayne@69
|
2606 /* PyObjectGetAttrStrNoError.proto */
|
jpayne@69
|
2607 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
|
jpayne@69
|
2608
|
jpayne@69
|
2609 /* GetBuiltinName.proto */
|
jpayne@69
|
2610 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
|
jpayne@69
|
2611
|
jpayne@69
|
2612 /* TupleAndListFromArray.proto */
|
jpayne@69
|
2613 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
2614 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
|
jpayne@69
|
2615 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
|
jpayne@69
|
2616 #endif
|
jpayne@69
|
2617
|
jpayne@69
|
2618 /* IncludeStringH.proto */
|
jpayne@69
|
2619 #include <string.h>
|
jpayne@69
|
2620
|
jpayne@69
|
2621 /* BytesEquals.proto */
|
jpayne@69
|
2622 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
|
jpayne@69
|
2623
|
jpayne@69
|
2624 /* UnicodeEquals.proto */
|
jpayne@69
|
2625 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
|
jpayne@69
|
2626
|
jpayne@69
|
2627 /* fastcall.proto */
|
jpayne@69
|
2628 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
2629 #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
|
jpayne@69
|
2630 #elif CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
2631 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
|
jpayne@69
|
2632 #else
|
jpayne@69
|
2633 #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
|
jpayne@69
|
2634 #endif
|
jpayne@69
|
2635 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
2636 #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
|
jpayne@69
|
2637 #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
|
jpayne@69
|
2638 #else
|
jpayne@69
|
2639 #define __Pyx_Arg_NewRef_VARARGS(arg) arg
|
jpayne@69
|
2640 #define __Pyx_Arg_XDECREF_VARARGS(arg)
|
jpayne@69
|
2641 #endif
|
jpayne@69
|
2642 #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
|
jpayne@69
|
2643 #define __Pyx_KwValues_VARARGS(args, nargs) NULL
|
jpayne@69
|
2644 #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
|
jpayne@69
|
2645 #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
|
jpayne@69
|
2646 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
2647 #define __Pyx_Arg_FASTCALL(args, i) args[i]
|
jpayne@69
|
2648 #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
|
jpayne@69
|
2649 #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
|
jpayne@69
|
2650 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
|
jpayne@69
|
2651 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
jpayne@69
|
2652 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
|
jpayne@69
|
2653 #else
|
jpayne@69
|
2654 #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
|
jpayne@69
|
2655 #endif
|
jpayne@69
|
2656 #define __Pyx_Arg_NewRef_FASTCALL(arg) arg /* no-op, __Pyx_Arg_FASTCALL is direct and this needs
|
jpayne@69
|
2657 to have the same reference counting */
|
jpayne@69
|
2658 #define __Pyx_Arg_XDECREF_FASTCALL(arg)
|
jpayne@69
|
2659 #else
|
jpayne@69
|
2660 #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
|
jpayne@69
|
2661 #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
|
jpayne@69
|
2662 #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
|
jpayne@69
|
2663 #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
|
jpayne@69
|
2664 #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
|
jpayne@69
|
2665 #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
|
jpayne@69
|
2666 #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
|
jpayne@69
|
2667 #endif
|
jpayne@69
|
2668 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
2669 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
|
jpayne@69
|
2670 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
|
jpayne@69
|
2671 #else
|
jpayne@69
|
2672 #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
|
jpayne@69
|
2673 #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
|
jpayne@69
|
2674 #endif
|
jpayne@69
|
2675
|
jpayne@69
|
2676 /* RaiseArgTupleInvalid.proto */
|
jpayne@69
|
2677 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
|
jpayne@69
|
2678 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
|
jpayne@69
|
2679
|
jpayne@69
|
2680 /* KeywordStringCheck.proto */
|
jpayne@69
|
2681 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
|
jpayne@69
|
2682
|
jpayne@69
|
2683 /* Profile.proto */
|
jpayne@69
|
2684 #ifndef CYTHON_PROFILE
|
jpayne@69
|
2685 #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
2686 #define CYTHON_PROFILE 0
|
jpayne@69
|
2687 #else
|
jpayne@69
|
2688 #define CYTHON_PROFILE 1
|
jpayne@69
|
2689 #endif
|
jpayne@69
|
2690 #endif
|
jpayne@69
|
2691 #ifndef CYTHON_TRACE_NOGIL
|
jpayne@69
|
2692 #define CYTHON_TRACE_NOGIL 0
|
jpayne@69
|
2693 #else
|
jpayne@69
|
2694 #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
|
jpayne@69
|
2695 #define CYTHON_TRACE 1
|
jpayne@69
|
2696 #endif
|
jpayne@69
|
2697 #endif
|
jpayne@69
|
2698 #ifndef CYTHON_TRACE
|
jpayne@69
|
2699 #define CYTHON_TRACE 0
|
jpayne@69
|
2700 #endif
|
jpayne@69
|
2701 #if CYTHON_TRACE
|
jpayne@69
|
2702 #undef CYTHON_PROFILE_REUSE_FRAME
|
jpayne@69
|
2703 #endif
|
jpayne@69
|
2704 #ifndef CYTHON_PROFILE_REUSE_FRAME
|
jpayne@69
|
2705 #define CYTHON_PROFILE_REUSE_FRAME 0
|
jpayne@69
|
2706 #endif
|
jpayne@69
|
2707 #if CYTHON_PROFILE || CYTHON_TRACE
|
jpayne@69
|
2708 #include "compile.h"
|
jpayne@69
|
2709 #include "frameobject.h"
|
jpayne@69
|
2710 #include "traceback.h"
|
jpayne@69
|
2711 #if PY_VERSION_HEX >= 0x030b00a6
|
jpayne@69
|
2712 #ifndef Py_BUILD_CORE
|
jpayne@69
|
2713 #define Py_BUILD_CORE 1
|
jpayne@69
|
2714 #endif
|
jpayne@69
|
2715 #include "internal/pycore_frame.h"
|
jpayne@69
|
2716 #endif
|
jpayne@69
|
2717 #if CYTHON_PROFILE_REUSE_FRAME
|
jpayne@69
|
2718 #define CYTHON_FRAME_MODIFIER static
|
jpayne@69
|
2719 #define CYTHON_FRAME_DEL(frame)
|
jpayne@69
|
2720 #else
|
jpayne@69
|
2721 #define CYTHON_FRAME_MODIFIER
|
jpayne@69
|
2722 #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
|
jpayne@69
|
2723 #endif
|
jpayne@69
|
2724 #define __Pyx_TraceDeclarations\
|
jpayne@69
|
2725 static PyCodeObject *__pyx_frame_code = NULL;\
|
jpayne@69
|
2726 CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
|
jpayne@69
|
2727 int __Pyx_use_tracing = 0;
|
jpayne@69
|
2728 #define __Pyx_TraceFrameInit(codeobj)\
|
jpayne@69
|
2729 if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
|
jpayne@69
|
2730 #if PY_VERSION_HEX >= 0x030b00a2
|
jpayne@69
|
2731 #if PY_VERSION_HEX >= 0x030C00b1
|
jpayne@69
|
2732 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
|
jpayne@69
|
2733 ((!(check_tracing) || !(tstate)->tracing) &&\
|
jpayne@69
|
2734 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
|
jpayne@69
|
2735 #else
|
jpayne@69
|
2736 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
|
jpayne@69
|
2737 (unlikely((tstate)->cframe->use_tracing) &&\
|
jpayne@69
|
2738 (!(check_tracing) || !(tstate)->tracing) &&\
|
jpayne@69
|
2739 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
|
jpayne@69
|
2740 #endif
|
jpayne@69
|
2741 #define __Pyx_EnterTracing(tstate) PyThreadState_EnterTracing(tstate)
|
jpayne@69
|
2742 #define __Pyx_LeaveTracing(tstate) PyThreadState_LeaveTracing(tstate)
|
jpayne@69
|
2743 #elif PY_VERSION_HEX >= 0x030a00b1
|
jpayne@69
|
2744 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
|
jpayne@69
|
2745 (unlikely((tstate)->cframe->use_tracing) &&\
|
jpayne@69
|
2746 (!(check_tracing) || !(tstate)->tracing) &&\
|
jpayne@69
|
2747 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
|
jpayne@69
|
2748 #define __Pyx_EnterTracing(tstate)\
|
jpayne@69
|
2749 do { tstate->tracing++; tstate->cframe->use_tracing = 0; } while (0)
|
jpayne@69
|
2750 #define __Pyx_LeaveTracing(tstate)\
|
jpayne@69
|
2751 do {\
|
jpayne@69
|
2752 tstate->tracing--;\
|
jpayne@69
|
2753 tstate->cframe->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
|
jpayne@69
|
2754 || tstate->c_profilefunc != NULL);\
|
jpayne@69
|
2755 } while (0)
|
jpayne@69
|
2756 #else
|
jpayne@69
|
2757 #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
|
jpayne@69
|
2758 (unlikely((tstate)->use_tracing) &&\
|
jpayne@69
|
2759 (!(check_tracing) || !(tstate)->tracing) &&\
|
jpayne@69
|
2760 (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
|
jpayne@69
|
2761 #define __Pyx_EnterTracing(tstate)\
|
jpayne@69
|
2762 do { tstate->tracing++; tstate->use_tracing = 0; } while (0)
|
jpayne@69
|
2763 #define __Pyx_LeaveTracing(tstate)\
|
jpayne@69
|
2764 do {\
|
jpayne@69
|
2765 tstate->tracing--;\
|
jpayne@69
|
2766 tstate->use_tracing = ((CYTHON_TRACE && tstate->c_tracefunc != NULL)\
|
jpayne@69
|
2767 || tstate->c_profilefunc != NULL);\
|
jpayne@69
|
2768 } while (0)
|
jpayne@69
|
2769 #endif
|
jpayne@69
|
2770 #ifdef WITH_THREAD
|
jpayne@69
|
2771 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
|
jpayne@69
|
2772 if (nogil) {\
|
jpayne@69
|
2773 if (CYTHON_TRACE_NOGIL) {\
|
jpayne@69
|
2774 PyThreadState *tstate;\
|
jpayne@69
|
2775 PyGILState_STATE state = PyGILState_Ensure();\
|
jpayne@69
|
2776 tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2777 if (__Pyx_IsTracing(tstate, 1, 1)) {\
|
jpayne@69
|
2778 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
|
jpayne@69
|
2779 }\
|
jpayne@69
|
2780 PyGILState_Release(state);\
|
jpayne@69
|
2781 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
|
jpayne@69
|
2782 }\
|
jpayne@69
|
2783 } else {\
|
jpayne@69
|
2784 PyThreadState* tstate = PyThreadState_GET();\
|
jpayne@69
|
2785 if (__Pyx_IsTracing(tstate, 1, 1)) {\
|
jpayne@69
|
2786 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
|
jpayne@69
|
2787 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
|
jpayne@69
|
2788 }\
|
jpayne@69
|
2789 }
|
jpayne@69
|
2790 #else
|
jpayne@69
|
2791 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
|
jpayne@69
|
2792 { PyThreadState* tstate = PyThreadState_GET();\
|
jpayne@69
|
2793 if (__Pyx_IsTracing(tstate, 1, 1)) {\
|
jpayne@69
|
2794 __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
|
jpayne@69
|
2795 if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
|
jpayne@69
|
2796 }\
|
jpayne@69
|
2797 }
|
jpayne@69
|
2798 #endif
|
jpayne@69
|
2799 #define __Pyx_TraceException()\
|
jpayne@69
|
2800 if (likely(!__Pyx_use_tracing)); else {\
|
jpayne@69
|
2801 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2802 if (__Pyx_IsTracing(tstate, 0, 1)) {\
|
jpayne@69
|
2803 __Pyx_EnterTracing(tstate);\
|
jpayne@69
|
2804 PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
|
jpayne@69
|
2805 if (exc_info) {\
|
jpayne@69
|
2806 if (CYTHON_TRACE && tstate->c_tracefunc)\
|
jpayne@69
|
2807 tstate->c_tracefunc(\
|
jpayne@69
|
2808 tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
|
jpayne@69
|
2809 tstate->c_profilefunc(\
|
jpayne@69
|
2810 tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
|
jpayne@69
|
2811 Py_DECREF(exc_info);\
|
jpayne@69
|
2812 }\
|
jpayne@69
|
2813 __Pyx_LeaveTracing(tstate);\
|
jpayne@69
|
2814 }\
|
jpayne@69
|
2815 }
|
jpayne@69
|
2816 static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
|
jpayne@69
|
2817 PyObject *type, *value, *traceback;
|
jpayne@69
|
2818 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
|
jpayne@69
|
2819 __Pyx_EnterTracing(tstate);
|
jpayne@69
|
2820 if (CYTHON_TRACE && tstate->c_tracefunc)
|
jpayne@69
|
2821 tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
|
jpayne@69
|
2822 if (tstate->c_profilefunc)
|
jpayne@69
|
2823 tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
|
jpayne@69
|
2824 CYTHON_FRAME_DEL(frame);
|
jpayne@69
|
2825 __Pyx_LeaveTracing(tstate);
|
jpayne@69
|
2826 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
|
jpayne@69
|
2827 }
|
jpayne@69
|
2828 #ifdef WITH_THREAD
|
jpayne@69
|
2829 #define __Pyx_TraceReturn(result, nogil)\
|
jpayne@69
|
2830 if (likely(!__Pyx_use_tracing)); else {\
|
jpayne@69
|
2831 if (nogil) {\
|
jpayne@69
|
2832 if (CYTHON_TRACE_NOGIL) {\
|
jpayne@69
|
2833 PyThreadState *tstate;\
|
jpayne@69
|
2834 PyGILState_STATE state = PyGILState_Ensure();\
|
jpayne@69
|
2835 tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2836 if (__Pyx_IsTracing(tstate, 0, 0)) {\
|
jpayne@69
|
2837 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
|
jpayne@69
|
2838 }\
|
jpayne@69
|
2839 PyGILState_Release(state);\
|
jpayne@69
|
2840 }\
|
jpayne@69
|
2841 } else {\
|
jpayne@69
|
2842 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2843 if (__Pyx_IsTracing(tstate, 0, 0)) {\
|
jpayne@69
|
2844 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
|
jpayne@69
|
2845 }\
|
jpayne@69
|
2846 }\
|
jpayne@69
|
2847 }
|
jpayne@69
|
2848 #else
|
jpayne@69
|
2849 #define __Pyx_TraceReturn(result, nogil)\
|
jpayne@69
|
2850 if (likely(!__Pyx_use_tracing)); else {\
|
jpayne@69
|
2851 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2852 if (__Pyx_IsTracing(tstate, 0, 0)) {\
|
jpayne@69
|
2853 __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
|
jpayne@69
|
2854 }\
|
jpayne@69
|
2855 }
|
jpayne@69
|
2856 #endif
|
jpayne@69
|
2857 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
|
jpayne@69
|
2858 static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
|
jpayne@69
|
2859 #else
|
jpayne@69
|
2860 #define __Pyx_TraceDeclarations
|
jpayne@69
|
2861 #define __Pyx_TraceFrameInit(codeobj)
|
jpayne@69
|
2862 #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
|
jpayne@69
|
2863 #define __Pyx_TraceException()
|
jpayne@69
|
2864 #define __Pyx_TraceReturn(result, nogil)
|
jpayne@69
|
2865 #endif
|
jpayne@69
|
2866 #if CYTHON_TRACE
|
jpayne@69
|
2867 static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
|
jpayne@69
|
2868 int ret;
|
jpayne@69
|
2869 PyObject *type, *value, *traceback;
|
jpayne@69
|
2870 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
|
jpayne@69
|
2871 __Pyx_PyFrame_SetLineNumber(frame, lineno);
|
jpayne@69
|
2872 __Pyx_EnterTracing(tstate);
|
jpayne@69
|
2873 ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
|
jpayne@69
|
2874 __Pyx_LeaveTracing(tstate);
|
jpayne@69
|
2875 if (likely(!ret)) {
|
jpayne@69
|
2876 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
|
jpayne@69
|
2877 } else {
|
jpayne@69
|
2878 Py_XDECREF(type);
|
jpayne@69
|
2879 Py_XDECREF(value);
|
jpayne@69
|
2880 Py_XDECREF(traceback);
|
jpayne@69
|
2881 }
|
jpayne@69
|
2882 return ret;
|
jpayne@69
|
2883 }
|
jpayne@69
|
2884 #ifdef WITH_THREAD
|
jpayne@69
|
2885 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
|
jpayne@69
|
2886 if (likely(!__Pyx_use_tracing)); else {\
|
jpayne@69
|
2887 if (nogil) {\
|
jpayne@69
|
2888 if (CYTHON_TRACE_NOGIL) {\
|
jpayne@69
|
2889 int ret = 0;\
|
jpayne@69
|
2890 PyThreadState *tstate;\
|
jpayne@69
|
2891 PyGILState_STATE state = __Pyx_PyGILState_Ensure();\
|
jpayne@69
|
2892 tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2893 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
|
jpayne@69
|
2894 ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
|
jpayne@69
|
2895 }\
|
jpayne@69
|
2896 __Pyx_PyGILState_Release(state);\
|
jpayne@69
|
2897 if (unlikely(ret)) goto_error;\
|
jpayne@69
|
2898 }\
|
jpayne@69
|
2899 } else {\
|
jpayne@69
|
2900 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2901 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
|
jpayne@69
|
2902 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
|
jpayne@69
|
2903 if (unlikely(ret)) goto_error;\
|
jpayne@69
|
2904 }\
|
jpayne@69
|
2905 }\
|
jpayne@69
|
2906 }
|
jpayne@69
|
2907 #else
|
jpayne@69
|
2908 #define __Pyx_TraceLine(lineno, nogil, goto_error)\
|
jpayne@69
|
2909 if (likely(!__Pyx_use_tracing)); else {\
|
jpayne@69
|
2910 PyThreadState* tstate = __Pyx_PyThreadState_Current;\
|
jpayne@69
|
2911 if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
|
jpayne@69
|
2912 int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
|
jpayne@69
|
2913 if (unlikely(ret)) goto_error;\
|
jpayne@69
|
2914 }\
|
jpayne@69
|
2915 }
|
jpayne@69
|
2916 #endif
|
jpayne@69
|
2917 #else
|
jpayne@69
|
2918 #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
|
jpayne@69
|
2919 #endif
|
jpayne@69
|
2920
|
jpayne@69
|
2921 /* RaiseException.proto */
|
jpayne@69
|
2922 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
|
jpayne@69
|
2923
|
jpayne@69
|
2924 /* RaiseDoubleKeywords.proto */
|
jpayne@69
|
2925 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
|
jpayne@69
|
2926
|
jpayne@69
|
2927 /* ParseKeywords.proto */
|
jpayne@69
|
2928 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
|
jpayne@69
|
2929 PyObject **argnames[],
|
jpayne@69
|
2930 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
|
jpayne@69
|
2931 const char* function_name);
|
jpayne@69
|
2932
|
jpayne@69
|
2933 /* CallNextTpTraverse.proto */
|
jpayne@69
|
2934 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
|
jpayne@69
|
2935
|
jpayne@69
|
2936 /* CallNextTpClear.proto */
|
jpayne@69
|
2937 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear);
|
jpayne@69
|
2938
|
jpayne@69
|
2939 /* TypeImport.proto */
|
jpayne@69
|
2940 #ifndef __PYX_HAVE_RT_ImportType_proto_3_0_11
|
jpayne@69
|
2941 #define __PYX_HAVE_RT_ImportType_proto_3_0_11
|
jpayne@69
|
2942 #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
jpayne@69
|
2943 #include <stdalign.h>
|
jpayne@69
|
2944 #endif
|
jpayne@69
|
2945 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || __cplusplus >= 201103L
|
jpayne@69
|
2946 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) alignof(s)
|
jpayne@69
|
2947 #else
|
jpayne@69
|
2948 #define __PYX_GET_STRUCT_ALIGNMENT_3_0_11(s) sizeof(void*)
|
jpayne@69
|
2949 #endif
|
jpayne@69
|
2950 enum __Pyx_ImportType_CheckSize_3_0_11 {
|
jpayne@69
|
2951 __Pyx_ImportType_CheckSize_Error_3_0_11 = 0,
|
jpayne@69
|
2952 __Pyx_ImportType_CheckSize_Warn_3_0_11 = 1,
|
jpayne@69
|
2953 __Pyx_ImportType_CheckSize_Ignore_3_0_11 = 2
|
jpayne@69
|
2954 };
|
jpayne@69
|
2955 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject* module, const char *module_name, const char *class_name, size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size);
|
jpayne@69
|
2956 #endif
|
jpayne@69
|
2957
|
jpayne@69
|
2958 /* GetVTable.proto */
|
jpayne@69
|
2959 static void* __Pyx_GetVtable(PyTypeObject *type);
|
jpayne@69
|
2960
|
jpayne@69
|
2961 /* IncludeStructmemberH.proto */
|
jpayne@69
|
2962 #include <structmember.h>
|
jpayne@69
|
2963
|
jpayne@69
|
2964 /* FixUpExtensionType.proto */
|
jpayne@69
|
2965 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
2966 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
|
jpayne@69
|
2967 #endif
|
jpayne@69
|
2968
|
jpayne@69
|
2969 /* PyFunctionFastCall.proto */
|
jpayne@69
|
2970 #if CYTHON_FAST_PYCALL
|
jpayne@69
|
2971 #if !CYTHON_VECTORCALL
|
jpayne@69
|
2972 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
|
jpayne@69
|
2973 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
|
jpayne@69
|
2974 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
|
jpayne@69
|
2975 #endif
|
jpayne@69
|
2976 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
|
jpayne@69
|
2977 (sizeof(char [1 - 2*!(cond)]) - 1)
|
jpayne@69
|
2978 #ifndef Py_MEMBER_SIZE
|
jpayne@69
|
2979 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
|
jpayne@69
|
2980 #endif
|
jpayne@69
|
2981 #if !CYTHON_VECTORCALL
|
jpayne@69
|
2982 #if PY_VERSION_HEX >= 0x03080000
|
jpayne@69
|
2983 #include "frameobject.h"
|
jpayne@69
|
2984 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
2985 #ifndef Py_BUILD_CORE
|
jpayne@69
|
2986 #define Py_BUILD_CORE 1
|
jpayne@69
|
2987 #endif
|
jpayne@69
|
2988 #include "internal/pycore_frame.h"
|
jpayne@69
|
2989 #endif
|
jpayne@69
|
2990 #define __Pxy_PyFrame_Initialize_Offsets()
|
jpayne@69
|
2991 #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
|
jpayne@69
|
2992 #else
|
jpayne@69
|
2993 static size_t __pyx_pyframe_localsplus_offset = 0;
|
jpayne@69
|
2994 #include "frameobject.h"
|
jpayne@69
|
2995 #define __Pxy_PyFrame_Initialize_Offsets()\
|
jpayne@69
|
2996 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
|
jpayne@69
|
2997 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
|
jpayne@69
|
2998 #define __Pyx_PyFrame_GetLocalsplus(frame)\
|
jpayne@69
|
2999 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
|
jpayne@69
|
3000 #endif
|
jpayne@69
|
3001 #endif
|
jpayne@69
|
3002 #endif
|
jpayne@69
|
3003
|
jpayne@69
|
3004 /* PyObjectCall.proto */
|
jpayne@69
|
3005 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
3006 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
|
jpayne@69
|
3007 #else
|
jpayne@69
|
3008 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
|
jpayne@69
|
3009 #endif
|
jpayne@69
|
3010
|
jpayne@69
|
3011 /* PyObjectCallMethO.proto */
|
jpayne@69
|
3012 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
3013 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
|
jpayne@69
|
3014 #endif
|
jpayne@69
|
3015
|
jpayne@69
|
3016 /* PyObjectFastCall.proto */
|
jpayne@69
|
3017 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
|
jpayne@69
|
3018 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
|
jpayne@69
|
3019
|
jpayne@69
|
3020 /* PyObjectCallNoArg.proto */
|
jpayne@69
|
3021 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
|
jpayne@69
|
3022
|
jpayne@69
|
3023 /* PyObjectCallOneArg.proto */
|
jpayne@69
|
3024 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
|
jpayne@69
|
3025
|
jpayne@69
|
3026 /* PyObjectGetMethod.proto */
|
jpayne@69
|
3027 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
|
jpayne@69
|
3028
|
jpayne@69
|
3029 /* PyObjectCallMethod0.proto */
|
jpayne@69
|
3030 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
|
jpayne@69
|
3031
|
jpayne@69
|
3032 /* ValidateBasesTuple.proto */
|
jpayne@69
|
3033 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
3034 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
|
jpayne@69
|
3035 #endif
|
jpayne@69
|
3036
|
jpayne@69
|
3037 /* PyType_Ready.proto */
|
jpayne@69
|
3038 CYTHON_UNUSED static int __Pyx_PyType_Ready(PyTypeObject *t);
|
jpayne@69
|
3039
|
jpayne@69
|
3040 /* PyObject_GenericGetAttrNoDict.proto */
|
jpayne@69
|
3041 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
|
jpayne@69
|
3042 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
|
jpayne@69
|
3043 #else
|
jpayne@69
|
3044 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
|
jpayne@69
|
3045 #endif
|
jpayne@69
|
3046
|
jpayne@69
|
3047 /* PyObject_GenericGetAttr.proto */
|
jpayne@69
|
3048 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
|
jpayne@69
|
3049 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
|
jpayne@69
|
3050 #else
|
jpayne@69
|
3051 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
|
jpayne@69
|
3052 #endif
|
jpayne@69
|
3053
|
jpayne@69
|
3054 /* SetVTable.proto */
|
jpayne@69
|
3055 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
|
jpayne@69
|
3056
|
jpayne@69
|
3057 /* MergeVTables.proto */
|
jpayne@69
|
3058 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3059 static int __Pyx_MergeVtables(PyTypeObject *type);
|
jpayne@69
|
3060 #endif
|
jpayne@69
|
3061
|
jpayne@69
|
3062 /* SetupReduce.proto */
|
jpayne@69
|
3063 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3064 static int __Pyx_setup_reduce(PyObject* type_obj);
|
jpayne@69
|
3065 #endif
|
jpayne@69
|
3066
|
jpayne@69
|
3067 /* Import.proto */
|
jpayne@69
|
3068 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
|
jpayne@69
|
3069
|
jpayne@69
|
3070 /* ImportDottedModule.proto */
|
jpayne@69
|
3071 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
|
jpayne@69
|
3072 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
3073 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);
|
jpayne@69
|
3074 #endif
|
jpayne@69
|
3075
|
jpayne@69
|
3076 /* FetchSharedCythonModule.proto */
|
jpayne@69
|
3077 static PyObject *__Pyx_FetchSharedCythonABIModule(void);
|
jpayne@69
|
3078
|
jpayne@69
|
3079 /* FetchCommonType.proto */
|
jpayne@69
|
3080 #if !CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
3081 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
|
jpayne@69
|
3082 #else
|
jpayne@69
|
3083 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
|
jpayne@69
|
3084 #endif
|
jpayne@69
|
3085
|
jpayne@69
|
3086 /* PyMethodNew.proto */
|
jpayne@69
|
3087 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3088 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
|
jpayne@69
|
3089 PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
|
jpayne@69
|
3090 CYTHON_UNUSED_VAR(typ);
|
jpayne@69
|
3091 if (!self)
|
jpayne@69
|
3092 return __Pyx_NewRef(func);
|
jpayne@69
|
3093 typesModule = PyImport_ImportModule("types");
|
jpayne@69
|
3094 if (!typesModule) return NULL;
|
jpayne@69
|
3095 methodType = PyObject_GetAttrString(typesModule, "MethodType");
|
jpayne@69
|
3096 Py_DECREF(typesModule);
|
jpayne@69
|
3097 if (!methodType) return NULL;
|
jpayne@69
|
3098 result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
|
jpayne@69
|
3099 Py_DECREF(methodType);
|
jpayne@69
|
3100 return result;
|
jpayne@69
|
3101 }
|
jpayne@69
|
3102 #elif PY_MAJOR_VERSION >= 3
|
jpayne@69
|
3103 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
|
jpayne@69
|
3104 CYTHON_UNUSED_VAR(typ);
|
jpayne@69
|
3105 if (!self)
|
jpayne@69
|
3106 return __Pyx_NewRef(func);
|
jpayne@69
|
3107 return PyMethod_New(func, self);
|
jpayne@69
|
3108 }
|
jpayne@69
|
3109 #else
|
jpayne@69
|
3110 #define __Pyx_PyMethod_New PyMethod_New
|
jpayne@69
|
3111 #endif
|
jpayne@69
|
3112
|
jpayne@69
|
3113 /* PyVectorcallFastCallDict.proto */
|
jpayne@69
|
3114 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
3115 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
|
jpayne@69
|
3116 #endif
|
jpayne@69
|
3117
|
jpayne@69
|
3118 /* CythonFunctionShared.proto */
|
jpayne@69
|
3119 #define __Pyx_CyFunction_USED
|
jpayne@69
|
3120 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
|
jpayne@69
|
3121 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
|
jpayne@69
|
3122 #define __Pyx_CYFUNCTION_CCLASS 0x04
|
jpayne@69
|
3123 #define __Pyx_CYFUNCTION_COROUTINE 0x08
|
jpayne@69
|
3124 #define __Pyx_CyFunction_GetClosure(f)\
|
jpayne@69
|
3125 (((__pyx_CyFunctionObject *) (f))->func_closure)
|
jpayne@69
|
3126 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3127 #define __Pyx_CyFunction_GetClassObj(f)\
|
jpayne@69
|
3128 (((__pyx_CyFunctionObject *) (f))->func_classobj)
|
jpayne@69
|
3129 #else
|
jpayne@69
|
3130 #define __Pyx_CyFunction_GetClassObj(f)\
|
jpayne@69
|
3131 ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
|
jpayne@69
|
3132 #endif
|
jpayne@69
|
3133 #define __Pyx_CyFunction_SetClassObj(f, classobj)\
|
jpayne@69
|
3134 __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
|
jpayne@69
|
3135 #define __Pyx_CyFunction_Defaults(type, f)\
|
jpayne@69
|
3136 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
|
jpayne@69
|
3137 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
|
jpayne@69
|
3138 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
|
jpayne@69
|
3139 typedef struct {
|
jpayne@69
|
3140 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3141 PyObject_HEAD
|
jpayne@69
|
3142 PyObject *func;
|
jpayne@69
|
3143 #elif PY_VERSION_HEX < 0x030900B1
|
jpayne@69
|
3144 PyCFunctionObject func;
|
jpayne@69
|
3145 #else
|
jpayne@69
|
3146 PyCMethodObject func;
|
jpayne@69
|
3147 #endif
|
jpayne@69
|
3148 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
3149 __pyx_vectorcallfunc func_vectorcall;
|
jpayne@69
|
3150 #endif
|
jpayne@69
|
3151 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3152 PyObject *func_weakreflist;
|
jpayne@69
|
3153 #endif
|
jpayne@69
|
3154 PyObject *func_dict;
|
jpayne@69
|
3155 PyObject *func_name;
|
jpayne@69
|
3156 PyObject *func_qualname;
|
jpayne@69
|
3157 PyObject *func_doc;
|
jpayne@69
|
3158 PyObject *func_globals;
|
jpayne@69
|
3159 PyObject *func_code;
|
jpayne@69
|
3160 PyObject *func_closure;
|
jpayne@69
|
3161 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3162 PyObject *func_classobj;
|
jpayne@69
|
3163 #endif
|
jpayne@69
|
3164 void *defaults;
|
jpayne@69
|
3165 int defaults_pyobjects;
|
jpayne@69
|
3166 size_t defaults_size;
|
jpayne@69
|
3167 int flags;
|
jpayne@69
|
3168 PyObject *defaults_tuple;
|
jpayne@69
|
3169 PyObject *defaults_kwdict;
|
jpayne@69
|
3170 PyObject *(*defaults_getter)(PyObject *);
|
jpayne@69
|
3171 PyObject *func_annotations;
|
jpayne@69
|
3172 PyObject *func_is_coroutine;
|
jpayne@69
|
3173 } __pyx_CyFunctionObject;
|
jpayne@69
|
3174 #undef __Pyx_CyOrPyCFunction_Check
|
jpayne@69
|
3175 #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
|
jpayne@69
|
3176 #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
|
jpayne@69
|
3177 #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
|
jpayne@69
|
3178 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
|
jpayne@69
|
3179 #undef __Pyx_IsSameCFunction
|
jpayne@69
|
3180 #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
|
jpayne@69
|
3181 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
|
jpayne@69
|
3182 int flags, PyObject* qualname,
|
jpayne@69
|
3183 PyObject *closure,
|
jpayne@69
|
3184 PyObject *module, PyObject *globals,
|
jpayne@69
|
3185 PyObject* code);
|
jpayne@69
|
3186 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
|
jpayne@69
|
3187 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
|
jpayne@69
|
3188 size_t size,
|
jpayne@69
|
3189 int pyobjects);
|
jpayne@69
|
3190 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
|
jpayne@69
|
3191 PyObject *tuple);
|
jpayne@69
|
3192 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
|
jpayne@69
|
3193 PyObject *dict);
|
jpayne@69
|
3194 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
|
jpayne@69
|
3195 PyObject *dict);
|
jpayne@69
|
3196 static int __pyx_CyFunction_init(PyObject *module);
|
jpayne@69
|
3197 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
3198 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
|
jpayne@69
|
3199 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
|
jpayne@69
|
3200 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
|
jpayne@69
|
3201 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
|
jpayne@69
|
3202 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
3203 #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
|
jpayne@69
|
3204 #else
|
jpayne@69
|
3205 #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
|
jpayne@69
|
3206 #endif
|
jpayne@69
|
3207 #endif
|
jpayne@69
|
3208
|
jpayne@69
|
3209 /* CythonFunction.proto */
|
jpayne@69
|
3210 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
|
jpayne@69
|
3211 int flags, PyObject* qualname,
|
jpayne@69
|
3212 PyObject *closure,
|
jpayne@69
|
3213 PyObject *module, PyObject *globals,
|
jpayne@69
|
3214 PyObject* code);
|
jpayne@69
|
3215
|
jpayne@69
|
3216 /* PyDictVersioning.proto */
|
jpayne@69
|
3217 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
3218 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
|
jpayne@69
|
3219 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
|
jpayne@69
|
3220 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
|
jpayne@69
|
3221 (version_var) = __PYX_GET_DICT_VERSION(dict);\
|
jpayne@69
|
3222 (cache_var) = (value);
|
jpayne@69
|
3223 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
|
jpayne@69
|
3224 static PY_UINT64_T __pyx_dict_version = 0;\
|
jpayne@69
|
3225 static PyObject *__pyx_dict_cached_value = NULL;\
|
jpayne@69
|
3226 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
|
jpayne@69
|
3227 (VAR) = __pyx_dict_cached_value;\
|
jpayne@69
|
3228 } else {\
|
jpayne@69
|
3229 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
|
jpayne@69
|
3230 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
|
jpayne@69
|
3231 }\
|
jpayne@69
|
3232 }
|
jpayne@69
|
3233 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
|
jpayne@69
|
3234 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
|
jpayne@69
|
3235 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
|
jpayne@69
|
3236 #else
|
jpayne@69
|
3237 #define __PYX_GET_DICT_VERSION(dict) (0)
|
jpayne@69
|
3238 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
|
jpayne@69
|
3239 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
|
jpayne@69
|
3240 #endif
|
jpayne@69
|
3241
|
jpayne@69
|
3242 /* CLineInTraceback.proto */
|
jpayne@69
|
3243 #ifdef CYTHON_CLINE_IN_TRACEBACK
|
jpayne@69
|
3244 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
|
jpayne@69
|
3245 #else
|
jpayne@69
|
3246 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
|
jpayne@69
|
3247 #endif
|
jpayne@69
|
3248
|
jpayne@69
|
3249 /* CodeObjectCache.proto */
|
jpayne@69
|
3250 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3251 typedef struct {
|
jpayne@69
|
3252 PyCodeObject* code_object;
|
jpayne@69
|
3253 int code_line;
|
jpayne@69
|
3254 } __Pyx_CodeObjectCacheEntry;
|
jpayne@69
|
3255 struct __Pyx_CodeObjectCache {
|
jpayne@69
|
3256 int count;
|
jpayne@69
|
3257 int max_count;
|
jpayne@69
|
3258 __Pyx_CodeObjectCacheEntry* entries;
|
jpayne@69
|
3259 };
|
jpayne@69
|
3260 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
|
jpayne@69
|
3261 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
|
jpayne@69
|
3262 static PyCodeObject *__pyx_find_code_object(int code_line);
|
jpayne@69
|
3263 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
|
jpayne@69
|
3264 #endif
|
jpayne@69
|
3265
|
jpayne@69
|
3266 /* AddTraceback.proto */
|
jpayne@69
|
3267 static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
jpayne@69
|
3268 int py_line, const char *filename);
|
jpayne@69
|
3269
|
jpayne@69
|
3270 /* GCCDiagnostics.proto */
|
jpayne@69
|
3271 #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
jpayne@69
|
3272 #define __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
3273 #endif
|
jpayne@69
|
3274
|
jpayne@69
|
3275 /* ArrayAPI.proto */
|
jpayne@69
|
3276 #ifndef _ARRAYARRAY_H
|
jpayne@69
|
3277 #define _ARRAYARRAY_H
|
jpayne@69
|
3278 typedef struct arraydescr {
|
jpayne@69
|
3279 int typecode;
|
jpayne@69
|
3280 int itemsize;
|
jpayne@69
|
3281 PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
|
jpayne@69
|
3282 int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
|
jpayne@69
|
3283 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
3284 char *formats;
|
jpayne@69
|
3285 #endif
|
jpayne@69
|
3286 } arraydescr;
|
jpayne@69
|
3287 struct arrayobject {
|
jpayne@69
|
3288 PyObject_HEAD
|
jpayne@69
|
3289 Py_ssize_t ob_size;
|
jpayne@69
|
3290 union {
|
jpayne@69
|
3291 char *ob_item;
|
jpayne@69
|
3292 float *as_floats;
|
jpayne@69
|
3293 double *as_doubles;
|
jpayne@69
|
3294 int *as_ints;
|
jpayne@69
|
3295 unsigned int *as_uints;
|
jpayne@69
|
3296 unsigned char *as_uchars;
|
jpayne@69
|
3297 signed char *as_schars;
|
jpayne@69
|
3298 char *as_chars;
|
jpayne@69
|
3299 unsigned long *as_ulongs;
|
jpayne@69
|
3300 long *as_longs;
|
jpayne@69
|
3301 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
3302 unsigned long long *as_ulonglongs;
|
jpayne@69
|
3303 long long *as_longlongs;
|
jpayne@69
|
3304 #endif
|
jpayne@69
|
3305 short *as_shorts;
|
jpayne@69
|
3306 unsigned short *as_ushorts;
|
jpayne@69
|
3307 Py_UNICODE *as_pyunicodes;
|
jpayne@69
|
3308 void *as_voidptr;
|
jpayne@69
|
3309 } data;
|
jpayne@69
|
3310 Py_ssize_t allocated;
|
jpayne@69
|
3311 struct arraydescr *ob_descr;
|
jpayne@69
|
3312 PyObject *weakreflist;
|
jpayne@69
|
3313 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
3314 int ob_exports;
|
jpayne@69
|
3315 #endif
|
jpayne@69
|
3316 };
|
jpayne@69
|
3317 #ifndef NO_NEWARRAY_INLINE
|
jpayne@69
|
3318 static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
|
jpayne@69
|
3319 struct arraydescr *descr) {
|
jpayne@69
|
3320 arrayobject *op;
|
jpayne@69
|
3321 size_t nbytes;
|
jpayne@69
|
3322 if (size < 0) {
|
jpayne@69
|
3323 PyErr_BadInternalCall();
|
jpayne@69
|
3324 return NULL;
|
jpayne@69
|
3325 }
|
jpayne@69
|
3326 nbytes = size * descr->itemsize;
|
jpayne@69
|
3327 if (nbytes / descr->itemsize != (size_t)size) {
|
jpayne@69
|
3328 return PyErr_NoMemory();
|
jpayne@69
|
3329 }
|
jpayne@69
|
3330 op = (arrayobject *) type->tp_alloc(type, 0);
|
jpayne@69
|
3331 if (op == NULL) {
|
jpayne@69
|
3332 return NULL;
|
jpayne@69
|
3333 }
|
jpayne@69
|
3334 op->ob_descr = descr;
|
jpayne@69
|
3335 op->allocated = size;
|
jpayne@69
|
3336 op->weakreflist = NULL;
|
jpayne@69
|
3337 __Pyx_SET_SIZE(op, size);
|
jpayne@69
|
3338 if (size <= 0) {
|
jpayne@69
|
3339 op->data.ob_item = NULL;
|
jpayne@69
|
3340 }
|
jpayne@69
|
3341 else {
|
jpayne@69
|
3342 op->data.ob_item = PyMem_NEW(char, nbytes);
|
jpayne@69
|
3343 if (op->data.ob_item == NULL) {
|
jpayne@69
|
3344 Py_DECREF(op);
|
jpayne@69
|
3345 return PyErr_NoMemory();
|
jpayne@69
|
3346 }
|
jpayne@69
|
3347 }
|
jpayne@69
|
3348 return (PyObject *) op;
|
jpayne@69
|
3349 }
|
jpayne@69
|
3350 #else
|
jpayne@69
|
3351 PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
|
jpayne@69
|
3352 struct arraydescr *descr);
|
jpayne@69
|
3353 #endif
|
jpayne@69
|
3354 static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
|
jpayne@69
|
3355 void *items = (void*) self->data.ob_item;
|
jpayne@69
|
3356 PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
|
jpayne@69
|
3357 if (items == NULL) {
|
jpayne@69
|
3358 PyErr_NoMemory();
|
jpayne@69
|
3359 return -1;
|
jpayne@69
|
3360 }
|
jpayne@69
|
3361 self->data.ob_item = (char*) items;
|
jpayne@69
|
3362 __Pyx_SET_SIZE(self, n);
|
jpayne@69
|
3363 self->allocated = n;
|
jpayne@69
|
3364 return 0;
|
jpayne@69
|
3365 }
|
jpayne@69
|
3366 static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
|
jpayne@69
|
3367 void *items = (void*) self->data.ob_item;
|
jpayne@69
|
3368 Py_ssize_t newsize;
|
jpayne@69
|
3369 if (n < self->allocated && n*4 > self->allocated) {
|
jpayne@69
|
3370 __Pyx_SET_SIZE(self, n);
|
jpayne@69
|
3371 return 0;
|
jpayne@69
|
3372 }
|
jpayne@69
|
3373 newsize = n + (n / 2) + 1;
|
jpayne@69
|
3374 if (newsize <= n) {
|
jpayne@69
|
3375 PyErr_NoMemory();
|
jpayne@69
|
3376 return -1;
|
jpayne@69
|
3377 }
|
jpayne@69
|
3378 PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
|
jpayne@69
|
3379 if (items == NULL) {
|
jpayne@69
|
3380 PyErr_NoMemory();
|
jpayne@69
|
3381 return -1;
|
jpayne@69
|
3382 }
|
jpayne@69
|
3383 self->data.ob_item = (char*) items;
|
jpayne@69
|
3384 __Pyx_SET_SIZE(self, n);
|
jpayne@69
|
3385 self->allocated = newsize;
|
jpayne@69
|
3386 return 0;
|
jpayne@69
|
3387 }
|
jpayne@69
|
3388 #endif
|
jpayne@69
|
3389
|
jpayne@69
|
3390 /* CIntFromPy.proto */
|
jpayne@69
|
3391 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
|
jpayne@69
|
3392
|
jpayne@69
|
3393 /* FormatTypeName.proto */
|
jpayne@69
|
3394 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
3395 typedef PyObject *__Pyx_TypeName;
|
jpayne@69
|
3396 #define __Pyx_FMT_TYPENAME "%U"
|
jpayne@69
|
3397 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
|
jpayne@69
|
3398 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
|
jpayne@69
|
3399 #else
|
jpayne@69
|
3400 typedef const char *__Pyx_TypeName;
|
jpayne@69
|
3401 #define __Pyx_FMT_TYPENAME "%.200s"
|
jpayne@69
|
3402 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
|
jpayne@69
|
3403 #define __Pyx_DECREF_TypeName(obj)
|
jpayne@69
|
3404 #endif
|
jpayne@69
|
3405
|
jpayne@69
|
3406 /* CIntToPy.proto */
|
jpayne@69
|
3407 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
|
jpayne@69
|
3408
|
jpayne@69
|
3409 /* CIntFromPy.proto */
|
jpayne@69
|
3410 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
|
jpayne@69
|
3411
|
jpayne@69
|
3412 /* FastTypeChecks.proto */
|
jpayne@69
|
3413 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
3414 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
|
jpayne@69
|
3415 #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
|
jpayne@69
|
3416 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
|
jpayne@69
|
3417 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
|
jpayne@69
|
3418 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
|
jpayne@69
|
3419 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
|
jpayne@69
|
3420 #else
|
jpayne@69
|
3421 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
|
jpayne@69
|
3422 #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
|
jpayne@69
|
3423 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
|
jpayne@69
|
3424 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
|
jpayne@69
|
3425 #endif
|
jpayne@69
|
3426 #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
|
jpayne@69
|
3427 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
|
jpayne@69
|
3428
|
jpayne@69
|
3429 /* CheckBinaryVersion.proto */
|
jpayne@69
|
3430 static unsigned long __Pyx_get_runtime_version(void);
|
jpayne@69
|
3431 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
|
jpayne@69
|
3432
|
jpayne@69
|
3433 /* InitStrings.proto */
|
jpayne@69
|
3434 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
|
jpayne@69
|
3435
|
jpayne@69
|
3436 /* #### Code section: module_declarations ### */
|
jpayne@69
|
3437 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self); /* proto*/
|
jpayne@69
|
3438 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self); /* proto*/
|
jpayne@69
|
3439
|
jpayne@69
|
3440 /* Module declarations from "libc.stdint" */
|
jpayne@69
|
3441
|
jpayne@69
|
3442 /* Module declarations from "libc.string" */
|
jpayne@69
|
3443
|
jpayne@69
|
3444 /* Module declarations from "libc.stdlib" */
|
jpayne@69
|
3445
|
jpayne@69
|
3446 /* Module declarations from "libc.stdio" */
|
jpayne@69
|
3447
|
jpayne@69
|
3448 /* Module declarations from "cython" */
|
jpayne@69
|
3449
|
jpayne@69
|
3450 /* Module declarations from "cpython.version" */
|
jpayne@69
|
3451
|
jpayne@69
|
3452 /* Module declarations from "__builtin__" */
|
jpayne@69
|
3453
|
jpayne@69
|
3454 /* Module declarations from "cpython.type" */
|
jpayne@69
|
3455
|
jpayne@69
|
3456 /* Module declarations from "cpython.object" */
|
jpayne@69
|
3457
|
jpayne@69
|
3458 /* Module declarations from "cpython.ref" */
|
jpayne@69
|
3459
|
jpayne@69
|
3460 /* Module declarations from "cpython.exc" */
|
jpayne@69
|
3461
|
jpayne@69
|
3462 /* Module declarations from "cpython.module" */
|
jpayne@69
|
3463
|
jpayne@69
|
3464 /* Module declarations from "cpython.mem" */
|
jpayne@69
|
3465
|
jpayne@69
|
3466 /* Module declarations from "cpython.tuple" */
|
jpayne@69
|
3467
|
jpayne@69
|
3468 /* Module declarations from "cpython.list" */
|
jpayne@69
|
3469
|
jpayne@69
|
3470 /* Module declarations from "cpython.sequence" */
|
jpayne@69
|
3471
|
jpayne@69
|
3472 /* Module declarations from "cpython.mapping" */
|
jpayne@69
|
3473
|
jpayne@69
|
3474 /* Module declarations from "cpython.iterator" */
|
jpayne@69
|
3475
|
jpayne@69
|
3476 /* Module declarations from "cpython.number" */
|
jpayne@69
|
3477
|
jpayne@69
|
3478 /* Module declarations from "cpython.int" */
|
jpayne@69
|
3479
|
jpayne@69
|
3480 /* Module declarations from "__builtin__" */
|
jpayne@69
|
3481
|
jpayne@69
|
3482 /* Module declarations from "cpython.bool" */
|
jpayne@69
|
3483
|
jpayne@69
|
3484 /* Module declarations from "cpython.long" */
|
jpayne@69
|
3485
|
jpayne@69
|
3486 /* Module declarations from "cpython.float" */
|
jpayne@69
|
3487
|
jpayne@69
|
3488 /* Module declarations from "__builtin__" */
|
jpayne@69
|
3489
|
jpayne@69
|
3490 /* Module declarations from "cpython.complex" */
|
jpayne@69
|
3491
|
jpayne@69
|
3492 /* Module declarations from "cpython.string" */
|
jpayne@69
|
3493
|
jpayne@69
|
3494 /* Module declarations from "libc.stddef" */
|
jpayne@69
|
3495
|
jpayne@69
|
3496 /* Module declarations from "cpython.unicode" */
|
jpayne@69
|
3497
|
jpayne@69
|
3498 /* Module declarations from "cpython.pyport" */
|
jpayne@69
|
3499
|
jpayne@69
|
3500 /* Module declarations from "cpython.dict" */
|
jpayne@69
|
3501
|
jpayne@69
|
3502 /* Module declarations from "cpython.instance" */
|
jpayne@69
|
3503
|
jpayne@69
|
3504 /* Module declarations from "cpython.function" */
|
jpayne@69
|
3505
|
jpayne@69
|
3506 /* Module declarations from "cpython.method" */
|
jpayne@69
|
3507
|
jpayne@69
|
3508 /* Module declarations from "cpython.weakref" */
|
jpayne@69
|
3509
|
jpayne@69
|
3510 /* Module declarations from "cpython.getargs" */
|
jpayne@69
|
3511
|
jpayne@69
|
3512 /* Module declarations from "cpython.pythread" */
|
jpayne@69
|
3513
|
jpayne@69
|
3514 /* Module declarations from "cpython.pystate" */
|
jpayne@69
|
3515
|
jpayne@69
|
3516 /* Module declarations from "cpython.cobject" */
|
jpayne@69
|
3517
|
jpayne@69
|
3518 /* Module declarations from "cpython.oldbuffer" */
|
jpayne@69
|
3519
|
jpayne@69
|
3520 /* Module declarations from "cpython.set" */
|
jpayne@69
|
3521
|
jpayne@69
|
3522 /* Module declarations from "cpython.buffer" */
|
jpayne@69
|
3523
|
jpayne@69
|
3524 /* Module declarations from "cpython.bytes" */
|
jpayne@69
|
3525
|
jpayne@69
|
3526 /* Module declarations from "cpython.pycapsule" */
|
jpayne@69
|
3527
|
jpayne@69
|
3528 /* Module declarations from "cpython.contextvars" */
|
jpayne@69
|
3529
|
jpayne@69
|
3530 /* Module declarations from "cpython" */
|
jpayne@69
|
3531
|
jpayne@69
|
3532 /* Module declarations from "array" */
|
jpayne@69
|
3533
|
jpayne@69
|
3534 /* Module declarations from "cpython.array" */
|
jpayne@69
|
3535 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
|
jpayne@69
|
3536
|
jpayne@69
|
3537 /* Module declarations from "posix.types" */
|
jpayne@69
|
3538
|
jpayne@69
|
3539 /* Module declarations from "pysam.libchtslib" */
|
jpayne@69
|
3540
|
jpayne@69
|
3541 /* Module declarations from "pysam.libcfaidx" */
|
jpayne@69
|
3542
|
jpayne@69
|
3543 /* Module declarations from "pysam.libcalignedsegment" */
|
jpayne@69
|
3544
|
jpayne@69
|
3545 /* Module declarations from "pysam.libcalignmentfile" */
|
jpayne@69
|
3546
|
jpayne@69
|
3547 /* Module declarations from "pysam.libcsamfile" */
|
jpayne@69
|
3548 /* #### Code section: typeinfo ### */
|
jpayne@69
|
3549 /* #### Code section: before_global_var ### */
|
jpayne@69
|
3550 #define __Pyx_MODULE_NAME "pysam.libcsamfile"
|
jpayne@69
|
3551 extern int __pyx_module_is_main_pysam__libcsamfile;
|
jpayne@69
|
3552 int __pyx_module_is_main_pysam__libcsamfile = 0;
|
jpayne@69
|
3553
|
jpayne@69
|
3554 /* Implementation of "pysam.libcsamfile" */
|
jpayne@69
|
3555 /* #### Code section: global_var ### */
|
jpayne@69
|
3556 static PyObject *__pyx_builtin_TypeError;
|
jpayne@69
|
3557 static PyObject *__pyx_builtin_MemoryError;
|
jpayne@69
|
3558 /* #### Code section: string_decls ### */
|
jpayne@69
|
3559 static const char __pyx_k__5[] = "*";
|
jpayne@69
|
3560 static const char __pyx_k__8[] = "?";
|
jpayne@69
|
3561 static const char __pyx_k_gc[] = "gc";
|
jpayne@69
|
3562 static const char __pyx_k_os[] = "os";
|
jpayne@69
|
3563 static const char __pyx_k_re[] = "re";
|
jpayne@69
|
3564 static const char __pyx_k_all[] = "__all__";
|
jpayne@69
|
3565 static const char __pyx_k_sys[] = "sys";
|
jpayne@69
|
3566 static const char __pyx_k_main[] = "__main__";
|
jpayne@69
|
3567 static const char __pyx_k_name[] = "__name__";
|
jpayne@69
|
3568 static const char __pyx_k_self[] = "self";
|
jpayne@69
|
3569 static const char __pyx_k_spec[] = "__spec__";
|
jpayne@69
|
3570 static const char __pyx_k_test[] = "__test__";
|
jpayne@69
|
3571 static const char __pyx_k_types[] = "types";
|
jpayne@69
|
3572 static const char __pyx_k_ctypes[] = "ctypes";
|
jpayne@69
|
3573 static const char __pyx_k_enable[] = "enable";
|
jpayne@69
|
3574 static const char __pyx_k_import[] = "__import__";
|
jpayne@69
|
3575 static const char __pyx_k_reduce[] = "__reduce__";
|
jpayne@69
|
3576 static const char __pyx_k_struct[] = "struct";
|
jpayne@69
|
3577 static const char __pyx_k_Samfile[] = "Samfile";
|
jpayne@69
|
3578 static const char __pyx_k_disable[] = "disable";
|
jpayne@69
|
3579 static const char __pyx_k_getstate[] = "__getstate__";
|
jpayne@69
|
3580 static const char __pyx_k_platform[] = "platform";
|
jpayne@69
|
3581 static const char __pyx_k_setstate[] = "__setstate__";
|
jpayne@69
|
3582 static const char __pyx_k_tempfile[] = "tempfile";
|
jpayne@69
|
3583 static const char __pyx_k_warnings[] = "warnings";
|
jpayne@69
|
3584 static const char __pyx_k_TypeError[] = "TypeError";
|
jpayne@69
|
3585 static const char __pyx_k_isenabled[] = "isenabled";
|
jpayne@69
|
3586 static const char __pyx_k_itertools[] = "itertools";
|
jpayne@69
|
3587 static const char __pyx_k_pyx_state[] = "__pyx_state";
|
jpayne@69
|
3588 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
|
jpayne@69
|
3589 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
|
jpayne@69
|
3590 static const char __pyx_k_AlignedRead[] = "AlignedRead";
|
jpayne@69
|
3591 static const char __pyx_k_MemoryError[] = "MemoryError";
|
jpayne@69
|
3592 static const char __pyx_k_collections[] = "collections";
|
jpayne@69
|
3593 static const char __pyx_k_initializing[] = "_initializing";
|
jpayne@69
|
3594 static const char __pyx_k_is_coroutine[] = "_is_coroutine";
|
jpayne@69
|
3595 static const char __pyx_k_stringsource[] = "<stringsource>";
|
jpayne@69
|
3596 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
|
jpayne@69
|
3597 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
|
jpayne@69
|
3598 static const char __pyx_k_pysam_libcsamfile[] = "pysam.libcsamfile";
|
jpayne@69
|
3599 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
|
jpayne@69
|
3600 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
|
jpayne@69
|
3601 static const char __pyx_k_Samfile___reduce_cython[] = "Samfile.__reduce_cython__";
|
jpayne@69
|
3602 static const char __pyx_k_Samfile___setstate_cython[] = "Samfile.__setstate_cython__";
|
jpayne@69
|
3603 static const char __pyx_k_AlignedRead___reduce_cython[] = "AlignedRead.__reduce_cython__";
|
jpayne@69
|
3604 static const char __pyx_k_AlignedRead___setstate_cython[] = "AlignedRead.__setstate_cython__";
|
jpayne@69
|
3605 static const char __pyx_k_self__delegate_cannot_be_convert[] = "self._delegate cannot be converted to a Python object for pickling";
|
jpayne@69
|
3606 static const char __pyx_k_self_b_self_htsfile_self_index_c[] = "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling";
|
jpayne@69
|
3607 /* #### Code section: decls ### */
|
jpayne@69
|
3608 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
|
jpayne@69
|
3609 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
|
jpayne@69
|
3610 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self); /* proto */
|
jpayne@69
|
3611 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
|
jpayne@69
|
3612 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self); /* proto */
|
jpayne@69
|
3613 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
|
jpayne@69
|
3614 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
jpayne@69
|
3615 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_Samfile(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
|
jpayne@69
|
3616 /* #### Code section: late_includes ### */
|
jpayne@69
|
3617 /* #### Code section: module_state ### */
|
jpayne@69
|
3618 typedef struct {
|
jpayne@69
|
3619 PyObject *__pyx_d;
|
jpayne@69
|
3620 PyObject *__pyx_b;
|
jpayne@69
|
3621 PyObject *__pyx_cython_runtime;
|
jpayne@69
|
3622 PyObject *__pyx_empty_tuple;
|
jpayne@69
|
3623 PyObject *__pyx_empty_bytes;
|
jpayne@69
|
3624 PyObject *__pyx_empty_unicode;
|
jpayne@69
|
3625 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
3626 PyTypeObject *__pyx_CyFunctionType;
|
jpayne@69
|
3627 #endif
|
jpayne@69
|
3628 #ifdef __Pyx_FusedFunction_USED
|
jpayne@69
|
3629 PyTypeObject *__pyx_FusedFunctionType;
|
jpayne@69
|
3630 #endif
|
jpayne@69
|
3631 #ifdef __Pyx_Generator_USED
|
jpayne@69
|
3632 PyTypeObject *__pyx_GeneratorType;
|
jpayne@69
|
3633 #endif
|
jpayne@69
|
3634 #ifdef __Pyx_IterableCoroutine_USED
|
jpayne@69
|
3635 PyTypeObject *__pyx_IterableCoroutineType;
|
jpayne@69
|
3636 #endif
|
jpayne@69
|
3637 #ifdef __Pyx_Coroutine_USED
|
jpayne@69
|
3638 PyTypeObject *__pyx_CoroutineAwaitType;
|
jpayne@69
|
3639 #endif
|
jpayne@69
|
3640 #ifdef __Pyx_Coroutine_USED
|
jpayne@69
|
3641 PyTypeObject *__pyx_CoroutineType;
|
jpayne@69
|
3642 #endif
|
jpayne@69
|
3643 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3644 #endif
|
jpayne@69
|
3645 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3646 #endif
|
jpayne@69
|
3647 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3648 #endif
|
jpayne@69
|
3649 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3650 #endif
|
jpayne@69
|
3651 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3652 #endif
|
jpayne@69
|
3653 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3654 #endif
|
jpayne@69
|
3655 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3656 #endif
|
jpayne@69
|
3657 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3658 #endif
|
jpayne@69
|
3659 PyTypeObject *__pyx_ptype_7cpython_4type_type;
|
jpayne@69
|
3660 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3661 #endif
|
jpayne@69
|
3662 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3663 #endif
|
jpayne@69
|
3664 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3665 #endif
|
jpayne@69
|
3666 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3667 #endif
|
jpayne@69
|
3668 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3669 #endif
|
jpayne@69
|
3670 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3671 #endif
|
jpayne@69
|
3672 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3673 #endif
|
jpayne@69
|
3674 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3675 #endif
|
jpayne@69
|
3676 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3677 #endif
|
jpayne@69
|
3678 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3679 #endif
|
jpayne@69
|
3680 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3681 #endif
|
jpayne@69
|
3682 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3683 #endif
|
jpayne@69
|
3684 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3685 #endif
|
jpayne@69
|
3686 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3687 #endif
|
jpayne@69
|
3688 PyTypeObject *__pyx_ptype_7cpython_4bool_bool;
|
jpayne@69
|
3689 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3690 #endif
|
jpayne@69
|
3691 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3692 #endif
|
jpayne@69
|
3693 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3694 #endif
|
jpayne@69
|
3695 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3696 #endif
|
jpayne@69
|
3697 PyTypeObject *__pyx_ptype_7cpython_7complex_complex;
|
jpayne@69
|
3698 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3699 #endif
|
jpayne@69
|
3700 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3701 #endif
|
jpayne@69
|
3702 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3703 #endif
|
jpayne@69
|
3704 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3705 #endif
|
jpayne@69
|
3706 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3707 #endif
|
jpayne@69
|
3708 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3709 #endif
|
jpayne@69
|
3710 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3711 #endif
|
jpayne@69
|
3712 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3713 #endif
|
jpayne@69
|
3714 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3715 #endif
|
jpayne@69
|
3716 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3717 #endif
|
jpayne@69
|
3718 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3719 #endif
|
jpayne@69
|
3720 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3721 #endif
|
jpayne@69
|
3722 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3723 #endif
|
jpayne@69
|
3724 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3725 #endif
|
jpayne@69
|
3726 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3727 #endif
|
jpayne@69
|
3728 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3729 #endif
|
jpayne@69
|
3730 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3731 #endif
|
jpayne@69
|
3732 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3733 #endif
|
jpayne@69
|
3734 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3735 #endif
|
jpayne@69
|
3736 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3737 #endif
|
jpayne@69
|
3738 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3739 #endif
|
jpayne@69
|
3740 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3741 #endif
|
jpayne@69
|
3742 PyTypeObject *__pyx_ptype_7cpython_5array_array;
|
jpayne@69
|
3743 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3744 #endif
|
jpayne@69
|
3745 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3746 #endif
|
jpayne@69
|
3747 PyTypeObject *__pyx_ptype_5pysam_10libchtslib_HTSFile;
|
jpayne@69
|
3748 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3749 #endif
|
jpayne@69
|
3750 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastaFile;
|
jpayne@69
|
3751 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastqProxy;
|
jpayne@69
|
3752 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastxRecord;
|
jpayne@69
|
3753 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastxFile;
|
jpayne@69
|
3754 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_FastqFile;
|
jpayne@69
|
3755 PyTypeObject *__pyx_ptype_5pysam_9libcfaidx_Fastafile;
|
jpayne@69
|
3756 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3757 #endif
|
jpayne@69
|
3758 PyTypeObject *__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment;
|
jpayne@69
|
3759 PyTypeObject *__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn;
|
jpayne@69
|
3760 PyTypeObject *__pyx_ptype_5pysam_18libcalignedsegment_PileupRead;
|
jpayne@69
|
3761 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3762 #endif
|
jpayne@69
|
3763 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader;
|
jpayne@69
|
3764 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile;
|
jpayne@69
|
3765 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow;
|
jpayne@69
|
3766 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion;
|
jpayne@69
|
3767 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead;
|
jpayne@69
|
3768 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll;
|
jpayne@69
|
3769 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs;
|
jpayne@69
|
3770 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection;
|
jpayne@69
|
3771 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn;
|
jpayne@69
|
3772 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion;
|
jpayne@69
|
3773 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs;
|
jpayne@69
|
3774 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll;
|
jpayne@69
|
3775 PyTypeObject *__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads;
|
jpayne@69
|
3776 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3777 PyObject *__pyx_type_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
3778 PyObject *__pyx_type_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
3779 #endif
|
jpayne@69
|
3780 PyTypeObject *__pyx_ptype_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
3781 PyTypeObject *__pyx_ptype_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
3782 PyObject *__pyx_n_s_AlignedRead;
|
jpayne@69
|
3783 PyObject *__pyx_n_u_AlignedRead;
|
jpayne@69
|
3784 PyObject *__pyx_n_s_AlignedRead___reduce_cython;
|
jpayne@69
|
3785 PyObject *__pyx_n_s_AlignedRead___setstate_cython;
|
jpayne@69
|
3786 PyObject *__pyx_n_s_MemoryError;
|
jpayne@69
|
3787 PyObject *__pyx_n_s_Samfile;
|
jpayne@69
|
3788 PyObject *__pyx_n_u_Samfile;
|
jpayne@69
|
3789 PyObject *__pyx_n_s_Samfile___reduce_cython;
|
jpayne@69
|
3790 PyObject *__pyx_n_s_Samfile___setstate_cython;
|
jpayne@69
|
3791 PyObject *__pyx_n_s_TypeError;
|
jpayne@69
|
3792 PyObject *__pyx_n_s__5;
|
jpayne@69
|
3793 PyObject *__pyx_n_s__8;
|
jpayne@69
|
3794 PyObject *__pyx_n_s_all;
|
jpayne@69
|
3795 PyObject *__pyx_n_s_asyncio_coroutines;
|
jpayne@69
|
3796 PyObject *__pyx_n_s_cline_in_traceback;
|
jpayne@69
|
3797 PyObject *__pyx_n_s_collections;
|
jpayne@69
|
3798 PyObject *__pyx_n_s_ctypes;
|
jpayne@69
|
3799 PyObject *__pyx_kp_u_disable;
|
jpayne@69
|
3800 PyObject *__pyx_kp_u_enable;
|
jpayne@69
|
3801 PyObject *__pyx_kp_u_gc;
|
jpayne@69
|
3802 PyObject *__pyx_n_s_getstate;
|
jpayne@69
|
3803 PyObject *__pyx_n_s_import;
|
jpayne@69
|
3804 PyObject *__pyx_n_s_initializing;
|
jpayne@69
|
3805 PyObject *__pyx_n_s_is_coroutine;
|
jpayne@69
|
3806 PyObject *__pyx_kp_u_isenabled;
|
jpayne@69
|
3807 PyObject *__pyx_n_s_itertools;
|
jpayne@69
|
3808 PyObject *__pyx_n_s_main;
|
jpayne@69
|
3809 PyObject *__pyx_n_s_name;
|
jpayne@69
|
3810 PyObject *__pyx_n_s_os;
|
jpayne@69
|
3811 PyObject *__pyx_n_s_platform;
|
jpayne@69
|
3812 PyObject *__pyx_n_s_pysam_libcsamfile;
|
jpayne@69
|
3813 PyObject *__pyx_n_s_pyx_state;
|
jpayne@69
|
3814 PyObject *__pyx_n_s_pyx_vtable;
|
jpayne@69
|
3815 PyObject *__pyx_n_s_re;
|
jpayne@69
|
3816 PyObject *__pyx_n_s_reduce;
|
jpayne@69
|
3817 PyObject *__pyx_n_s_reduce_cython;
|
jpayne@69
|
3818 PyObject *__pyx_n_s_reduce_ex;
|
jpayne@69
|
3819 PyObject *__pyx_n_s_self;
|
jpayne@69
|
3820 PyObject *__pyx_kp_s_self__delegate_cannot_be_convert;
|
jpayne@69
|
3821 PyObject *__pyx_kp_s_self_b_self_htsfile_self_index_c;
|
jpayne@69
|
3822 PyObject *__pyx_n_s_setstate;
|
jpayne@69
|
3823 PyObject *__pyx_n_s_setstate_cython;
|
jpayne@69
|
3824 PyObject *__pyx_n_s_spec;
|
jpayne@69
|
3825 PyObject *__pyx_kp_s_stringsource;
|
jpayne@69
|
3826 PyObject *__pyx_n_s_struct;
|
jpayne@69
|
3827 PyObject *__pyx_n_s_sys;
|
jpayne@69
|
3828 PyObject *__pyx_n_s_tempfile;
|
jpayne@69
|
3829 PyObject *__pyx_n_s_test;
|
jpayne@69
|
3830 PyObject *__pyx_n_s_types;
|
jpayne@69
|
3831 PyObject *__pyx_n_s_warnings;
|
jpayne@69
|
3832 PyObject *__pyx_codeobj_;
|
jpayne@69
|
3833 PyObject *__pyx_tuple__6;
|
jpayne@69
|
3834 PyObject *__pyx_tuple__7;
|
jpayne@69
|
3835 PyObject *__pyx_codeobj__2;
|
jpayne@69
|
3836 PyObject *__pyx_codeobj__3;
|
jpayne@69
|
3837 PyObject *__pyx_codeobj__4;
|
jpayne@69
|
3838 } __pyx_mstate;
|
jpayne@69
|
3839
|
jpayne@69
|
3840 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3841 #ifdef __cplusplus
|
jpayne@69
|
3842 namespace {
|
jpayne@69
|
3843 extern struct PyModuleDef __pyx_moduledef;
|
jpayne@69
|
3844 } /* anonymous namespace */
|
jpayne@69
|
3845 #else
|
jpayne@69
|
3846 static struct PyModuleDef __pyx_moduledef;
|
jpayne@69
|
3847 #endif
|
jpayne@69
|
3848
|
jpayne@69
|
3849 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
|
jpayne@69
|
3850
|
jpayne@69
|
3851 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
|
jpayne@69
|
3852
|
jpayne@69
|
3853 #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
|
jpayne@69
|
3854 #else
|
jpayne@69
|
3855 static __pyx_mstate __pyx_mstate_global_static =
|
jpayne@69
|
3856 #ifdef __cplusplus
|
jpayne@69
|
3857 {};
|
jpayne@69
|
3858 #else
|
jpayne@69
|
3859 {0};
|
jpayne@69
|
3860 #endif
|
jpayne@69
|
3861 static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
|
jpayne@69
|
3862 #endif
|
jpayne@69
|
3863 /* #### Code section: module_state_clear ### */
|
jpayne@69
|
3864 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3865 static int __pyx_m_clear(PyObject *m) {
|
jpayne@69
|
3866 __pyx_mstate *clear_module_state = __pyx_mstate(m);
|
jpayne@69
|
3867 if (!clear_module_state) return 0;
|
jpayne@69
|
3868 Py_CLEAR(clear_module_state->__pyx_d);
|
jpayne@69
|
3869 Py_CLEAR(clear_module_state->__pyx_b);
|
jpayne@69
|
3870 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
|
jpayne@69
|
3871 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
|
jpayne@69
|
3872 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
|
jpayne@69
|
3873 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
|
jpayne@69
|
3874 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
3875 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
|
jpayne@69
|
3876 #endif
|
jpayne@69
|
3877 #ifdef __Pyx_FusedFunction_USED
|
jpayne@69
|
3878 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
|
jpayne@69
|
3879 #endif
|
jpayne@69
|
3880 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4type_type);
|
jpayne@69
|
3881 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_4bool_bool);
|
jpayne@69
|
3882 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_7complex_complex);
|
jpayne@69
|
3883 Py_CLEAR(clear_module_state->__pyx_ptype_7cpython_5array_array);
|
jpayne@69
|
3884 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile);
|
jpayne@69
|
3885 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastaFile);
|
jpayne@69
|
3886 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqProxy);
|
jpayne@69
|
3887 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxRecord);
|
jpayne@69
|
3888 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxFile);
|
jpayne@69
|
3889 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqFile);
|
jpayne@69
|
3890 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_9libcfaidx_Fastafile);
|
jpayne@69
|
3891 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment);
|
jpayne@69
|
3892 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn);
|
jpayne@69
|
3893 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupRead);
|
jpayne@69
|
3894 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader);
|
jpayne@69
|
3895 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile);
|
jpayne@69
|
3896 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow);
|
jpayne@69
|
3897 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion);
|
jpayne@69
|
3898 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead);
|
jpayne@69
|
3899 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll);
|
jpayne@69
|
3900 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs);
|
jpayne@69
|
3901 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection);
|
jpayne@69
|
3902 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn);
|
jpayne@69
|
3903 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion);
|
jpayne@69
|
3904 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs);
|
jpayne@69
|
3905 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll);
|
jpayne@69
|
3906 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads);
|
jpayne@69
|
3907 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_11libcsamfile_AlignedRead);
|
jpayne@69
|
3908 Py_CLEAR(clear_module_state->__pyx_type_5pysam_11libcsamfile_AlignedRead);
|
jpayne@69
|
3909 Py_CLEAR(clear_module_state->__pyx_ptype_5pysam_11libcsamfile_Samfile);
|
jpayne@69
|
3910 Py_CLEAR(clear_module_state->__pyx_type_5pysam_11libcsamfile_Samfile);
|
jpayne@69
|
3911 Py_CLEAR(clear_module_state->__pyx_n_s_AlignedRead);
|
jpayne@69
|
3912 Py_CLEAR(clear_module_state->__pyx_n_u_AlignedRead);
|
jpayne@69
|
3913 Py_CLEAR(clear_module_state->__pyx_n_s_AlignedRead___reduce_cython);
|
jpayne@69
|
3914 Py_CLEAR(clear_module_state->__pyx_n_s_AlignedRead___setstate_cython);
|
jpayne@69
|
3915 Py_CLEAR(clear_module_state->__pyx_n_s_MemoryError);
|
jpayne@69
|
3916 Py_CLEAR(clear_module_state->__pyx_n_s_Samfile);
|
jpayne@69
|
3917 Py_CLEAR(clear_module_state->__pyx_n_u_Samfile);
|
jpayne@69
|
3918 Py_CLEAR(clear_module_state->__pyx_n_s_Samfile___reduce_cython);
|
jpayne@69
|
3919 Py_CLEAR(clear_module_state->__pyx_n_s_Samfile___setstate_cython);
|
jpayne@69
|
3920 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
|
jpayne@69
|
3921 Py_CLEAR(clear_module_state->__pyx_n_s__5);
|
jpayne@69
|
3922 Py_CLEAR(clear_module_state->__pyx_n_s__8);
|
jpayne@69
|
3923 Py_CLEAR(clear_module_state->__pyx_n_s_all);
|
jpayne@69
|
3924 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
|
jpayne@69
|
3925 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
|
jpayne@69
|
3926 Py_CLEAR(clear_module_state->__pyx_n_s_collections);
|
jpayne@69
|
3927 Py_CLEAR(clear_module_state->__pyx_n_s_ctypes);
|
jpayne@69
|
3928 Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
|
jpayne@69
|
3929 Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
|
jpayne@69
|
3930 Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
|
jpayne@69
|
3931 Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
|
jpayne@69
|
3932 Py_CLEAR(clear_module_state->__pyx_n_s_import);
|
jpayne@69
|
3933 Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
|
jpayne@69
|
3934 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
|
jpayne@69
|
3935 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
|
jpayne@69
|
3936 Py_CLEAR(clear_module_state->__pyx_n_s_itertools);
|
jpayne@69
|
3937 Py_CLEAR(clear_module_state->__pyx_n_s_main);
|
jpayne@69
|
3938 Py_CLEAR(clear_module_state->__pyx_n_s_name);
|
jpayne@69
|
3939 Py_CLEAR(clear_module_state->__pyx_n_s_os);
|
jpayne@69
|
3940 Py_CLEAR(clear_module_state->__pyx_n_s_platform);
|
jpayne@69
|
3941 Py_CLEAR(clear_module_state->__pyx_n_s_pysam_libcsamfile);
|
jpayne@69
|
3942 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
|
jpayne@69
|
3943 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
|
jpayne@69
|
3944 Py_CLEAR(clear_module_state->__pyx_n_s_re);
|
jpayne@69
|
3945 Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
|
jpayne@69
|
3946 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
|
jpayne@69
|
3947 Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
|
jpayne@69
|
3948 Py_CLEAR(clear_module_state->__pyx_n_s_self);
|
jpayne@69
|
3949 Py_CLEAR(clear_module_state->__pyx_kp_s_self__delegate_cannot_be_convert);
|
jpayne@69
|
3950 Py_CLEAR(clear_module_state->__pyx_kp_s_self_b_self_htsfile_self_index_c);
|
jpayne@69
|
3951 Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
|
jpayne@69
|
3952 Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
|
jpayne@69
|
3953 Py_CLEAR(clear_module_state->__pyx_n_s_spec);
|
jpayne@69
|
3954 Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
|
jpayne@69
|
3955 Py_CLEAR(clear_module_state->__pyx_n_s_struct);
|
jpayne@69
|
3956 Py_CLEAR(clear_module_state->__pyx_n_s_sys);
|
jpayne@69
|
3957 Py_CLEAR(clear_module_state->__pyx_n_s_tempfile);
|
jpayne@69
|
3958 Py_CLEAR(clear_module_state->__pyx_n_s_test);
|
jpayne@69
|
3959 Py_CLEAR(clear_module_state->__pyx_n_s_types);
|
jpayne@69
|
3960 Py_CLEAR(clear_module_state->__pyx_n_s_warnings);
|
jpayne@69
|
3961 Py_CLEAR(clear_module_state->__pyx_codeobj_);
|
jpayne@69
|
3962 Py_CLEAR(clear_module_state->__pyx_tuple__6);
|
jpayne@69
|
3963 Py_CLEAR(clear_module_state->__pyx_tuple__7);
|
jpayne@69
|
3964 Py_CLEAR(clear_module_state->__pyx_codeobj__2);
|
jpayne@69
|
3965 Py_CLEAR(clear_module_state->__pyx_codeobj__3);
|
jpayne@69
|
3966 Py_CLEAR(clear_module_state->__pyx_codeobj__4);
|
jpayne@69
|
3967 return 0;
|
jpayne@69
|
3968 }
|
jpayne@69
|
3969 #endif
|
jpayne@69
|
3970 /* #### Code section: module_state_traverse ### */
|
jpayne@69
|
3971 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
3972 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
jpayne@69
|
3973 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
|
jpayne@69
|
3974 if (!traverse_module_state) return 0;
|
jpayne@69
|
3975 Py_VISIT(traverse_module_state->__pyx_d);
|
jpayne@69
|
3976 Py_VISIT(traverse_module_state->__pyx_b);
|
jpayne@69
|
3977 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
|
jpayne@69
|
3978 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
|
jpayne@69
|
3979 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
|
jpayne@69
|
3980 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
|
jpayne@69
|
3981 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
3982 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
|
jpayne@69
|
3983 #endif
|
jpayne@69
|
3984 #ifdef __Pyx_FusedFunction_USED
|
jpayne@69
|
3985 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
|
jpayne@69
|
3986 #endif
|
jpayne@69
|
3987 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4type_type);
|
jpayne@69
|
3988 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_4bool_bool);
|
jpayne@69
|
3989 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_7complex_complex);
|
jpayne@69
|
3990 Py_VISIT(traverse_module_state->__pyx_ptype_7cpython_5array_array);
|
jpayne@69
|
3991 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_10libchtslib_HTSFile);
|
jpayne@69
|
3992 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastaFile);
|
jpayne@69
|
3993 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqProxy);
|
jpayne@69
|
3994 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxRecord);
|
jpayne@69
|
3995 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastxFile);
|
jpayne@69
|
3996 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_FastqFile);
|
jpayne@69
|
3997 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_9libcfaidx_Fastafile);
|
jpayne@69
|
3998 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment);
|
jpayne@69
|
3999 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn);
|
jpayne@69
|
4000 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_18libcalignedsegment_PileupRead);
|
jpayne@69
|
4001 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader);
|
jpayne@69
|
4002 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile);
|
jpayne@69
|
4003 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow);
|
jpayne@69
|
4004 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion);
|
jpayne@69
|
4005 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead);
|
jpayne@69
|
4006 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll);
|
jpayne@69
|
4007 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs);
|
jpayne@69
|
4008 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection);
|
jpayne@69
|
4009 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn);
|
jpayne@69
|
4010 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion);
|
jpayne@69
|
4011 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs);
|
jpayne@69
|
4012 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll);
|
jpayne@69
|
4013 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads);
|
jpayne@69
|
4014 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_11libcsamfile_AlignedRead);
|
jpayne@69
|
4015 Py_VISIT(traverse_module_state->__pyx_type_5pysam_11libcsamfile_AlignedRead);
|
jpayne@69
|
4016 Py_VISIT(traverse_module_state->__pyx_ptype_5pysam_11libcsamfile_Samfile);
|
jpayne@69
|
4017 Py_VISIT(traverse_module_state->__pyx_type_5pysam_11libcsamfile_Samfile);
|
jpayne@69
|
4018 Py_VISIT(traverse_module_state->__pyx_n_s_AlignedRead);
|
jpayne@69
|
4019 Py_VISIT(traverse_module_state->__pyx_n_u_AlignedRead);
|
jpayne@69
|
4020 Py_VISIT(traverse_module_state->__pyx_n_s_AlignedRead___reduce_cython);
|
jpayne@69
|
4021 Py_VISIT(traverse_module_state->__pyx_n_s_AlignedRead___setstate_cython);
|
jpayne@69
|
4022 Py_VISIT(traverse_module_state->__pyx_n_s_MemoryError);
|
jpayne@69
|
4023 Py_VISIT(traverse_module_state->__pyx_n_s_Samfile);
|
jpayne@69
|
4024 Py_VISIT(traverse_module_state->__pyx_n_u_Samfile);
|
jpayne@69
|
4025 Py_VISIT(traverse_module_state->__pyx_n_s_Samfile___reduce_cython);
|
jpayne@69
|
4026 Py_VISIT(traverse_module_state->__pyx_n_s_Samfile___setstate_cython);
|
jpayne@69
|
4027 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
|
jpayne@69
|
4028 Py_VISIT(traverse_module_state->__pyx_n_s__5);
|
jpayne@69
|
4029 Py_VISIT(traverse_module_state->__pyx_n_s__8);
|
jpayne@69
|
4030 Py_VISIT(traverse_module_state->__pyx_n_s_all);
|
jpayne@69
|
4031 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
|
jpayne@69
|
4032 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
|
jpayne@69
|
4033 Py_VISIT(traverse_module_state->__pyx_n_s_collections);
|
jpayne@69
|
4034 Py_VISIT(traverse_module_state->__pyx_n_s_ctypes);
|
jpayne@69
|
4035 Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
|
jpayne@69
|
4036 Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
|
jpayne@69
|
4037 Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
|
jpayne@69
|
4038 Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
|
jpayne@69
|
4039 Py_VISIT(traverse_module_state->__pyx_n_s_import);
|
jpayne@69
|
4040 Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
|
jpayne@69
|
4041 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
|
jpayne@69
|
4042 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
|
jpayne@69
|
4043 Py_VISIT(traverse_module_state->__pyx_n_s_itertools);
|
jpayne@69
|
4044 Py_VISIT(traverse_module_state->__pyx_n_s_main);
|
jpayne@69
|
4045 Py_VISIT(traverse_module_state->__pyx_n_s_name);
|
jpayne@69
|
4046 Py_VISIT(traverse_module_state->__pyx_n_s_os);
|
jpayne@69
|
4047 Py_VISIT(traverse_module_state->__pyx_n_s_platform);
|
jpayne@69
|
4048 Py_VISIT(traverse_module_state->__pyx_n_s_pysam_libcsamfile);
|
jpayne@69
|
4049 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
|
jpayne@69
|
4050 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
|
jpayne@69
|
4051 Py_VISIT(traverse_module_state->__pyx_n_s_re);
|
jpayne@69
|
4052 Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
|
jpayne@69
|
4053 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
|
jpayne@69
|
4054 Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
|
jpayne@69
|
4055 Py_VISIT(traverse_module_state->__pyx_n_s_self);
|
jpayne@69
|
4056 Py_VISIT(traverse_module_state->__pyx_kp_s_self__delegate_cannot_be_convert);
|
jpayne@69
|
4057 Py_VISIT(traverse_module_state->__pyx_kp_s_self_b_self_htsfile_self_index_c);
|
jpayne@69
|
4058 Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
|
jpayne@69
|
4059 Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
|
jpayne@69
|
4060 Py_VISIT(traverse_module_state->__pyx_n_s_spec);
|
jpayne@69
|
4061 Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
|
jpayne@69
|
4062 Py_VISIT(traverse_module_state->__pyx_n_s_struct);
|
jpayne@69
|
4063 Py_VISIT(traverse_module_state->__pyx_n_s_sys);
|
jpayne@69
|
4064 Py_VISIT(traverse_module_state->__pyx_n_s_tempfile);
|
jpayne@69
|
4065 Py_VISIT(traverse_module_state->__pyx_n_s_test);
|
jpayne@69
|
4066 Py_VISIT(traverse_module_state->__pyx_n_s_types);
|
jpayne@69
|
4067 Py_VISIT(traverse_module_state->__pyx_n_s_warnings);
|
jpayne@69
|
4068 Py_VISIT(traverse_module_state->__pyx_codeobj_);
|
jpayne@69
|
4069 Py_VISIT(traverse_module_state->__pyx_tuple__6);
|
jpayne@69
|
4070 Py_VISIT(traverse_module_state->__pyx_tuple__7);
|
jpayne@69
|
4071 Py_VISIT(traverse_module_state->__pyx_codeobj__2);
|
jpayne@69
|
4072 Py_VISIT(traverse_module_state->__pyx_codeobj__3);
|
jpayne@69
|
4073 Py_VISIT(traverse_module_state->__pyx_codeobj__4);
|
jpayne@69
|
4074 return 0;
|
jpayne@69
|
4075 }
|
jpayne@69
|
4076 #endif
|
jpayne@69
|
4077 /* #### Code section: module_state_defines ### */
|
jpayne@69
|
4078 #define __pyx_d __pyx_mstate_global->__pyx_d
|
jpayne@69
|
4079 #define __pyx_b __pyx_mstate_global->__pyx_b
|
jpayne@69
|
4080 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
|
jpayne@69
|
4081 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
|
jpayne@69
|
4082 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
|
jpayne@69
|
4083 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
|
jpayne@69
|
4084 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
4085 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
|
jpayne@69
|
4086 #endif
|
jpayne@69
|
4087 #ifdef __Pyx_FusedFunction_USED
|
jpayne@69
|
4088 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
|
jpayne@69
|
4089 #endif
|
jpayne@69
|
4090 #ifdef __Pyx_Generator_USED
|
jpayne@69
|
4091 #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
|
jpayne@69
|
4092 #endif
|
jpayne@69
|
4093 #ifdef __Pyx_IterableCoroutine_USED
|
jpayne@69
|
4094 #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
|
jpayne@69
|
4095 #endif
|
jpayne@69
|
4096 #ifdef __Pyx_Coroutine_USED
|
jpayne@69
|
4097 #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
|
jpayne@69
|
4098 #endif
|
jpayne@69
|
4099 #ifdef __Pyx_Coroutine_USED
|
jpayne@69
|
4100 #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
|
jpayne@69
|
4101 #endif
|
jpayne@69
|
4102 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4103 #endif
|
jpayne@69
|
4104 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4105 #endif
|
jpayne@69
|
4106 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4107 #endif
|
jpayne@69
|
4108 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4109 #endif
|
jpayne@69
|
4110 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4111 #endif
|
jpayne@69
|
4112 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4113 #endif
|
jpayne@69
|
4114 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4115 #endif
|
jpayne@69
|
4116 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4117 #endif
|
jpayne@69
|
4118 #define __pyx_ptype_7cpython_4type_type __pyx_mstate_global->__pyx_ptype_7cpython_4type_type
|
jpayne@69
|
4119 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4120 #endif
|
jpayne@69
|
4121 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4122 #endif
|
jpayne@69
|
4123 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4124 #endif
|
jpayne@69
|
4125 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4126 #endif
|
jpayne@69
|
4127 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4128 #endif
|
jpayne@69
|
4129 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4130 #endif
|
jpayne@69
|
4131 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4132 #endif
|
jpayne@69
|
4133 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4134 #endif
|
jpayne@69
|
4135 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4136 #endif
|
jpayne@69
|
4137 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4138 #endif
|
jpayne@69
|
4139 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4140 #endif
|
jpayne@69
|
4141 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4142 #endif
|
jpayne@69
|
4143 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4144 #endif
|
jpayne@69
|
4145 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4146 #endif
|
jpayne@69
|
4147 #define __pyx_ptype_7cpython_4bool_bool __pyx_mstate_global->__pyx_ptype_7cpython_4bool_bool
|
jpayne@69
|
4148 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4149 #endif
|
jpayne@69
|
4150 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4151 #endif
|
jpayne@69
|
4152 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4153 #endif
|
jpayne@69
|
4154 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4155 #endif
|
jpayne@69
|
4156 #define __pyx_ptype_7cpython_7complex_complex __pyx_mstate_global->__pyx_ptype_7cpython_7complex_complex
|
jpayne@69
|
4157 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4158 #endif
|
jpayne@69
|
4159 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4160 #endif
|
jpayne@69
|
4161 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4162 #endif
|
jpayne@69
|
4163 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4164 #endif
|
jpayne@69
|
4165 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4166 #endif
|
jpayne@69
|
4167 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4168 #endif
|
jpayne@69
|
4169 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4170 #endif
|
jpayne@69
|
4171 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4172 #endif
|
jpayne@69
|
4173 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4174 #endif
|
jpayne@69
|
4175 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4176 #endif
|
jpayne@69
|
4177 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4178 #endif
|
jpayne@69
|
4179 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4180 #endif
|
jpayne@69
|
4181 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4182 #endif
|
jpayne@69
|
4183 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4184 #endif
|
jpayne@69
|
4185 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4186 #endif
|
jpayne@69
|
4187 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4188 #endif
|
jpayne@69
|
4189 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4190 #endif
|
jpayne@69
|
4191 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4192 #endif
|
jpayne@69
|
4193 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4194 #endif
|
jpayne@69
|
4195 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4196 #endif
|
jpayne@69
|
4197 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4198 #endif
|
jpayne@69
|
4199 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4200 #endif
|
jpayne@69
|
4201 #define __pyx_ptype_7cpython_5array_array __pyx_mstate_global->__pyx_ptype_7cpython_5array_array
|
jpayne@69
|
4202 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4203 #endif
|
jpayne@69
|
4204 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4205 #endif
|
jpayne@69
|
4206 #define __pyx_ptype_5pysam_10libchtslib_HTSFile __pyx_mstate_global->__pyx_ptype_5pysam_10libchtslib_HTSFile
|
jpayne@69
|
4207 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4208 #endif
|
jpayne@69
|
4209 #define __pyx_ptype_5pysam_9libcfaidx_FastaFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastaFile
|
jpayne@69
|
4210 #define __pyx_ptype_5pysam_9libcfaidx_FastqProxy __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastqProxy
|
jpayne@69
|
4211 #define __pyx_ptype_5pysam_9libcfaidx_FastxRecord __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastxRecord
|
jpayne@69
|
4212 #define __pyx_ptype_5pysam_9libcfaidx_FastxFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastxFile
|
jpayne@69
|
4213 #define __pyx_ptype_5pysam_9libcfaidx_FastqFile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_FastqFile
|
jpayne@69
|
4214 #define __pyx_ptype_5pysam_9libcfaidx_Fastafile __pyx_mstate_global->__pyx_ptype_5pysam_9libcfaidx_Fastafile
|
jpayne@69
|
4215 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4216 #endif
|
jpayne@69
|
4217 #define __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment __pyx_mstate_global->__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment
|
jpayne@69
|
4218 #define __pyx_ptype_5pysam_18libcalignedsegment_PileupColumn __pyx_mstate_global->__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn
|
jpayne@69
|
4219 #define __pyx_ptype_5pysam_18libcalignedsegment_PileupRead __pyx_mstate_global->__pyx_ptype_5pysam_18libcalignedsegment_PileupRead
|
jpayne@69
|
4220 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4221 #endif
|
jpayne@69
|
4222 #define __pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader
|
jpayne@69
|
4223 #define __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile
|
jpayne@69
|
4224 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRow __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow
|
jpayne@69
|
4225 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion
|
jpayne@69
|
4226 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead
|
jpayne@69
|
4227 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll
|
jpayne@69
|
4228 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs
|
jpayne@69
|
4229 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection
|
jpayne@69
|
4230 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn
|
jpayne@69
|
4231 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion
|
jpayne@69
|
4232 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs
|
jpayne@69
|
4233 #define __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll
|
jpayne@69
|
4234 #define __pyx_ptype_5pysam_17libcalignmentfile_IndexedReads __pyx_mstate_global->__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads
|
jpayne@69
|
4235 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
4236 #define __pyx_type_5pysam_11libcsamfile_AlignedRead __pyx_mstate_global->__pyx_type_5pysam_11libcsamfile_AlignedRead
|
jpayne@69
|
4237 #define __pyx_type_5pysam_11libcsamfile_Samfile __pyx_mstate_global->__pyx_type_5pysam_11libcsamfile_Samfile
|
jpayne@69
|
4238 #endif
|
jpayne@69
|
4239 #define __pyx_ptype_5pysam_11libcsamfile_AlignedRead __pyx_mstate_global->__pyx_ptype_5pysam_11libcsamfile_AlignedRead
|
jpayne@69
|
4240 #define __pyx_ptype_5pysam_11libcsamfile_Samfile __pyx_mstate_global->__pyx_ptype_5pysam_11libcsamfile_Samfile
|
jpayne@69
|
4241 #define __pyx_n_s_AlignedRead __pyx_mstate_global->__pyx_n_s_AlignedRead
|
jpayne@69
|
4242 #define __pyx_n_u_AlignedRead __pyx_mstate_global->__pyx_n_u_AlignedRead
|
jpayne@69
|
4243 #define __pyx_n_s_AlignedRead___reduce_cython __pyx_mstate_global->__pyx_n_s_AlignedRead___reduce_cython
|
jpayne@69
|
4244 #define __pyx_n_s_AlignedRead___setstate_cython __pyx_mstate_global->__pyx_n_s_AlignedRead___setstate_cython
|
jpayne@69
|
4245 #define __pyx_n_s_MemoryError __pyx_mstate_global->__pyx_n_s_MemoryError
|
jpayne@69
|
4246 #define __pyx_n_s_Samfile __pyx_mstate_global->__pyx_n_s_Samfile
|
jpayne@69
|
4247 #define __pyx_n_u_Samfile __pyx_mstate_global->__pyx_n_u_Samfile
|
jpayne@69
|
4248 #define __pyx_n_s_Samfile___reduce_cython __pyx_mstate_global->__pyx_n_s_Samfile___reduce_cython
|
jpayne@69
|
4249 #define __pyx_n_s_Samfile___setstate_cython __pyx_mstate_global->__pyx_n_s_Samfile___setstate_cython
|
jpayne@69
|
4250 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
|
jpayne@69
|
4251 #define __pyx_n_s__5 __pyx_mstate_global->__pyx_n_s__5
|
jpayne@69
|
4252 #define __pyx_n_s__8 __pyx_mstate_global->__pyx_n_s__8
|
jpayne@69
|
4253 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
|
jpayne@69
|
4254 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
|
jpayne@69
|
4255 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
|
jpayne@69
|
4256 #define __pyx_n_s_collections __pyx_mstate_global->__pyx_n_s_collections
|
jpayne@69
|
4257 #define __pyx_n_s_ctypes __pyx_mstate_global->__pyx_n_s_ctypes
|
jpayne@69
|
4258 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
|
jpayne@69
|
4259 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
|
jpayne@69
|
4260 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
|
jpayne@69
|
4261 #define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
|
jpayne@69
|
4262 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
|
jpayne@69
|
4263 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
|
jpayne@69
|
4264 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
|
jpayne@69
|
4265 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
|
jpayne@69
|
4266 #define __pyx_n_s_itertools __pyx_mstate_global->__pyx_n_s_itertools
|
jpayne@69
|
4267 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
|
jpayne@69
|
4268 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
|
jpayne@69
|
4269 #define __pyx_n_s_os __pyx_mstate_global->__pyx_n_s_os
|
jpayne@69
|
4270 #define __pyx_n_s_platform __pyx_mstate_global->__pyx_n_s_platform
|
jpayne@69
|
4271 #define __pyx_n_s_pysam_libcsamfile __pyx_mstate_global->__pyx_n_s_pysam_libcsamfile
|
jpayne@69
|
4272 #define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
|
jpayne@69
|
4273 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
|
jpayne@69
|
4274 #define __pyx_n_s_re __pyx_mstate_global->__pyx_n_s_re
|
jpayne@69
|
4275 #define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
|
jpayne@69
|
4276 #define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
|
jpayne@69
|
4277 #define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
|
jpayne@69
|
4278 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
|
jpayne@69
|
4279 #define __pyx_kp_s_self__delegate_cannot_be_convert __pyx_mstate_global->__pyx_kp_s_self__delegate_cannot_be_convert
|
jpayne@69
|
4280 #define __pyx_kp_s_self_b_self_htsfile_self_index_c __pyx_mstate_global->__pyx_kp_s_self_b_self_htsfile_self_index_c
|
jpayne@69
|
4281 #define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
|
jpayne@69
|
4282 #define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
|
jpayne@69
|
4283 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
|
jpayne@69
|
4284 #define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
|
jpayne@69
|
4285 #define __pyx_n_s_struct __pyx_mstate_global->__pyx_n_s_struct
|
jpayne@69
|
4286 #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
|
jpayne@69
|
4287 #define __pyx_n_s_tempfile __pyx_mstate_global->__pyx_n_s_tempfile
|
jpayne@69
|
4288 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
|
jpayne@69
|
4289 #define __pyx_n_s_types __pyx_mstate_global->__pyx_n_s_types
|
jpayne@69
|
4290 #define __pyx_n_s_warnings __pyx_mstate_global->__pyx_n_s_warnings
|
jpayne@69
|
4291 #define __pyx_codeobj_ __pyx_mstate_global->__pyx_codeobj_
|
jpayne@69
|
4292 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
|
jpayne@69
|
4293 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
|
jpayne@69
|
4294 #define __pyx_codeobj__2 __pyx_mstate_global->__pyx_codeobj__2
|
jpayne@69
|
4295 #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3
|
jpayne@69
|
4296 #define __pyx_codeobj__4 __pyx_mstate_global->__pyx_codeobj__4
|
jpayne@69
|
4297 /* #### Code section: module_code ### */
|
jpayne@69
|
4298
|
jpayne@69
|
4299 /* "cpython/complex.pxd":19
|
jpayne@69
|
4300 *
|
jpayne@69
|
4301 * @property
|
jpayne@69
|
4302 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<<
|
jpayne@69
|
4303 * return self.cval.real
|
jpayne@69
|
4304 *
|
jpayne@69
|
4305 */
|
jpayne@69
|
4306
|
jpayne@69
|
4307 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4real_real(PyComplexObject *__pyx_v_self) {
|
jpayne@69
|
4308 double __pyx_r;
|
jpayne@69
|
4309
|
jpayne@69
|
4310 /* "cpython/complex.pxd":20
|
jpayne@69
|
4311 * @property
|
jpayne@69
|
4312 * cdef inline double real(self) noexcept:
|
jpayne@69
|
4313 * return self.cval.real # <<<<<<<<<<<<<<
|
jpayne@69
|
4314 *
|
jpayne@69
|
4315 * @property
|
jpayne@69
|
4316 */
|
jpayne@69
|
4317 __pyx_r = __pyx_v_self->cval.real;
|
jpayne@69
|
4318 goto __pyx_L0;
|
jpayne@69
|
4319
|
jpayne@69
|
4320 /* "cpython/complex.pxd":19
|
jpayne@69
|
4321 *
|
jpayne@69
|
4322 * @property
|
jpayne@69
|
4323 * cdef inline double real(self) noexcept: # <<<<<<<<<<<<<<
|
jpayne@69
|
4324 * return self.cval.real
|
jpayne@69
|
4325 *
|
jpayne@69
|
4326 */
|
jpayne@69
|
4327
|
jpayne@69
|
4328 /* function exit code */
|
jpayne@69
|
4329 __pyx_L0:;
|
jpayne@69
|
4330 return __pyx_r;
|
jpayne@69
|
4331 }
|
jpayne@69
|
4332
|
jpayne@69
|
4333 /* "cpython/complex.pxd":23
|
jpayne@69
|
4334 *
|
jpayne@69
|
4335 * @property
|
jpayne@69
|
4336 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<<
|
jpayne@69
|
4337 * return self.cval.imag
|
jpayne@69
|
4338 *
|
jpayne@69
|
4339 */
|
jpayne@69
|
4340
|
jpayne@69
|
4341 static CYTHON_INLINE double __pyx_f_7cpython_7complex_7complex_4imag_imag(PyComplexObject *__pyx_v_self) {
|
jpayne@69
|
4342 double __pyx_r;
|
jpayne@69
|
4343
|
jpayne@69
|
4344 /* "cpython/complex.pxd":24
|
jpayne@69
|
4345 * @property
|
jpayne@69
|
4346 * cdef inline double imag(self) noexcept:
|
jpayne@69
|
4347 * return self.cval.imag # <<<<<<<<<<<<<<
|
jpayne@69
|
4348 *
|
jpayne@69
|
4349 * # PyTypeObject PyComplex_Type
|
jpayne@69
|
4350 */
|
jpayne@69
|
4351 __pyx_r = __pyx_v_self->cval.imag;
|
jpayne@69
|
4352 goto __pyx_L0;
|
jpayne@69
|
4353
|
jpayne@69
|
4354 /* "cpython/complex.pxd":23
|
jpayne@69
|
4355 *
|
jpayne@69
|
4356 * @property
|
jpayne@69
|
4357 * cdef inline double imag(self) noexcept: # <<<<<<<<<<<<<<
|
jpayne@69
|
4358 * return self.cval.imag
|
jpayne@69
|
4359 *
|
jpayne@69
|
4360 */
|
jpayne@69
|
4361
|
jpayne@69
|
4362 /* function exit code */
|
jpayne@69
|
4363 __pyx_L0:;
|
jpayne@69
|
4364 return __pyx_r;
|
jpayne@69
|
4365 }
|
jpayne@69
|
4366
|
jpayne@69
|
4367 /* "cpython/contextvars.pxd":112
|
jpayne@69
|
4368 *
|
jpayne@69
|
4369 *
|
jpayne@69
|
4370 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
|
jpayne@69
|
4371 * """Return a new reference to the value of the context variable,
|
jpayne@69
|
4372 * or the default value of the context variable,
|
jpayne@69
|
4373 */
|
jpayne@69
|
4374
|
jpayne@69
|
4375 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value *__pyx_optional_args) {
|
jpayne@69
|
4376 PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
|
jpayne@69
|
4377 PyObject *__pyx_v_value;
|
jpayne@69
|
4378 PyObject *__pyx_v_pyvalue = NULL;
|
jpayne@69
|
4379 PyObject *__pyx_r = NULL;
|
jpayne@69
|
4380 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4381 int __pyx_t_1;
|
jpayne@69
|
4382 int __pyx_t_2;
|
jpayne@69
|
4383 PyObject *__pyx_t_3 = NULL;
|
jpayne@69
|
4384 int __pyx_lineno = 0;
|
jpayne@69
|
4385 const char *__pyx_filename = NULL;
|
jpayne@69
|
4386 int __pyx_clineno = 0;
|
jpayne@69
|
4387 __Pyx_RefNannySetupContext("get_value", 1);
|
jpayne@69
|
4388 if (__pyx_optional_args) {
|
jpayne@69
|
4389 if (__pyx_optional_args->__pyx_n > 0) {
|
jpayne@69
|
4390 __pyx_v_default_value = __pyx_optional_args->default_value;
|
jpayne@69
|
4391 }
|
jpayne@69
|
4392 }
|
jpayne@69
|
4393
|
jpayne@69
|
4394 /* "cpython/contextvars.pxd":117
|
jpayne@69
|
4395 * or None if no such value or default was found.
|
jpayne@69
|
4396 * """
|
jpayne@69
|
4397 * cdef PyObject *value = NULL # <<<<<<<<<<<<<<
|
jpayne@69
|
4398 * PyContextVar_Get(var, NULL, &value)
|
jpayne@69
|
4399 * if value is NULL:
|
jpayne@69
|
4400 */
|
jpayne@69
|
4401 __pyx_v_value = NULL;
|
jpayne@69
|
4402
|
jpayne@69
|
4403 /* "cpython/contextvars.pxd":118
|
jpayne@69
|
4404 * """
|
jpayne@69
|
4405 * cdef PyObject *value = NULL
|
jpayne@69
|
4406 * PyContextVar_Get(var, NULL, &value) # <<<<<<<<<<<<<<
|
jpayne@69
|
4407 * if value is NULL:
|
jpayne@69
|
4408 * # context variable does not have a default
|
jpayne@69
|
4409 */
|
jpayne@69
|
4410 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, NULL, (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 118, __pyx_L1_error)
|
jpayne@69
|
4411
|
jpayne@69
|
4412 /* "cpython/contextvars.pxd":119
|
jpayne@69
|
4413 * cdef PyObject *value = NULL
|
jpayne@69
|
4414 * PyContextVar_Get(var, NULL, &value)
|
jpayne@69
|
4415 * if value is NULL: # <<<<<<<<<<<<<<
|
jpayne@69
|
4416 * # context variable does not have a default
|
jpayne@69
|
4417 * pyvalue = default_value
|
jpayne@69
|
4418 */
|
jpayne@69
|
4419 __pyx_t_2 = (__pyx_v_value == NULL);
|
jpayne@69
|
4420 if (__pyx_t_2) {
|
jpayne@69
|
4421
|
jpayne@69
|
4422 /* "cpython/contextvars.pxd":121
|
jpayne@69
|
4423 * if value is NULL:
|
jpayne@69
|
4424 * # context variable does not have a default
|
jpayne@69
|
4425 * pyvalue = default_value # <<<<<<<<<<<<<<
|
jpayne@69
|
4426 * else:
|
jpayne@69
|
4427 * # value or default value of context variable
|
jpayne@69
|
4428 */
|
jpayne@69
|
4429 __Pyx_INCREF(__pyx_v_default_value);
|
jpayne@69
|
4430 __pyx_v_pyvalue = __pyx_v_default_value;
|
jpayne@69
|
4431
|
jpayne@69
|
4432 /* "cpython/contextvars.pxd":119
|
jpayne@69
|
4433 * cdef PyObject *value = NULL
|
jpayne@69
|
4434 * PyContextVar_Get(var, NULL, &value)
|
jpayne@69
|
4435 * if value is NULL: # <<<<<<<<<<<<<<
|
jpayne@69
|
4436 * # context variable does not have a default
|
jpayne@69
|
4437 * pyvalue = default_value
|
jpayne@69
|
4438 */
|
jpayne@69
|
4439 goto __pyx_L3;
|
jpayne@69
|
4440 }
|
jpayne@69
|
4441
|
jpayne@69
|
4442 /* "cpython/contextvars.pxd":124
|
jpayne@69
|
4443 * else:
|
jpayne@69
|
4444 * # value or default value of context variable
|
jpayne@69
|
4445 * pyvalue = <object>value # <<<<<<<<<<<<<<
|
jpayne@69
|
4446 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
|
jpayne@69
|
4447 * return pyvalue
|
jpayne@69
|
4448 */
|
jpayne@69
|
4449 /*else*/ {
|
jpayne@69
|
4450 __pyx_t_3 = ((PyObject *)__pyx_v_value);
|
jpayne@69
|
4451 __Pyx_INCREF(__pyx_t_3);
|
jpayne@69
|
4452 __pyx_v_pyvalue = __pyx_t_3;
|
jpayne@69
|
4453 __pyx_t_3 = 0;
|
jpayne@69
|
4454
|
jpayne@69
|
4455 /* "cpython/contextvars.pxd":125
|
jpayne@69
|
4456 * # value or default value of context variable
|
jpayne@69
|
4457 * pyvalue = <object>value
|
jpayne@69
|
4458 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<<
|
jpayne@69
|
4459 * return pyvalue
|
jpayne@69
|
4460 *
|
jpayne@69
|
4461 */
|
jpayne@69
|
4462 Py_XDECREF(__pyx_v_value);
|
jpayne@69
|
4463 }
|
jpayne@69
|
4464 __pyx_L3:;
|
jpayne@69
|
4465
|
jpayne@69
|
4466 /* "cpython/contextvars.pxd":126
|
jpayne@69
|
4467 * pyvalue = <object>value
|
jpayne@69
|
4468 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
|
jpayne@69
|
4469 * return pyvalue # <<<<<<<<<<<<<<
|
jpayne@69
|
4470 *
|
jpayne@69
|
4471 *
|
jpayne@69
|
4472 */
|
jpayne@69
|
4473 __Pyx_XDECREF(__pyx_r);
|
jpayne@69
|
4474 __Pyx_INCREF(__pyx_v_pyvalue);
|
jpayne@69
|
4475 __pyx_r = __pyx_v_pyvalue;
|
jpayne@69
|
4476 goto __pyx_L0;
|
jpayne@69
|
4477
|
jpayne@69
|
4478 /* "cpython/contextvars.pxd":112
|
jpayne@69
|
4479 *
|
jpayne@69
|
4480 *
|
jpayne@69
|
4481 * cdef inline object get_value(var, default_value=None): # <<<<<<<<<<<<<<
|
jpayne@69
|
4482 * """Return a new reference to the value of the context variable,
|
jpayne@69
|
4483 * or the default value of the context variable,
|
jpayne@69
|
4484 */
|
jpayne@69
|
4485
|
jpayne@69
|
4486 /* function exit code */
|
jpayne@69
|
4487 __pyx_L1_error:;
|
jpayne@69
|
4488 __Pyx_XDECREF(__pyx_t_3);
|
jpayne@69
|
4489 __Pyx_AddTraceback("cpython.contextvars.get_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
4490 __pyx_r = 0;
|
jpayne@69
|
4491 __pyx_L0:;
|
jpayne@69
|
4492 __Pyx_XDECREF(__pyx_v_pyvalue);
|
jpayne@69
|
4493 __Pyx_XGIVEREF(__pyx_r);
|
jpayne@69
|
4494 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
4495 return __pyx_r;
|
jpayne@69
|
4496 }
|
jpayne@69
|
4497
|
jpayne@69
|
4498 /* "cpython/contextvars.pxd":129
|
jpayne@69
|
4499 *
|
jpayne@69
|
4500 *
|
jpayne@69
|
4501 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
|
jpayne@69
|
4502 * """Return a new reference to the value of the context variable,
|
jpayne@69
|
4503 * or the provided default value if no such value was found.
|
jpayne@69
|
4504 */
|
jpayne@69
|
4505
|
jpayne@69
|
4506 static CYTHON_INLINE PyObject *__pyx_f_7cpython_11contextvars_get_value_no_default(PyObject *__pyx_v_var, struct __pyx_opt_args_7cpython_11contextvars_get_value_no_default *__pyx_optional_args) {
|
jpayne@69
|
4507 PyObject *__pyx_v_default_value = ((PyObject *)Py_None);
|
jpayne@69
|
4508 PyObject *__pyx_v_value;
|
jpayne@69
|
4509 PyObject *__pyx_v_pyvalue = NULL;
|
jpayne@69
|
4510 PyObject *__pyx_r = NULL;
|
jpayne@69
|
4511 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4512 int __pyx_t_1;
|
jpayne@69
|
4513 PyObject *__pyx_t_2 = NULL;
|
jpayne@69
|
4514 int __pyx_lineno = 0;
|
jpayne@69
|
4515 const char *__pyx_filename = NULL;
|
jpayne@69
|
4516 int __pyx_clineno = 0;
|
jpayne@69
|
4517 __Pyx_RefNannySetupContext("get_value_no_default", 1);
|
jpayne@69
|
4518 if (__pyx_optional_args) {
|
jpayne@69
|
4519 if (__pyx_optional_args->__pyx_n > 0) {
|
jpayne@69
|
4520 __pyx_v_default_value = __pyx_optional_args->default_value;
|
jpayne@69
|
4521 }
|
jpayne@69
|
4522 }
|
jpayne@69
|
4523
|
jpayne@69
|
4524 /* "cpython/contextvars.pxd":135
|
jpayne@69
|
4525 * Ignores the default value of the context variable, if any.
|
jpayne@69
|
4526 * """
|
jpayne@69
|
4527 * cdef PyObject *value = NULL # <<<<<<<<<<<<<<
|
jpayne@69
|
4528 * PyContextVar_Get(var, <PyObject*>default_value, &value)
|
jpayne@69
|
4529 * # value of context variable or 'default_value'
|
jpayne@69
|
4530 */
|
jpayne@69
|
4531 __pyx_v_value = NULL;
|
jpayne@69
|
4532
|
jpayne@69
|
4533 /* "cpython/contextvars.pxd":136
|
jpayne@69
|
4534 * """
|
jpayne@69
|
4535 * cdef PyObject *value = NULL
|
jpayne@69
|
4536 * PyContextVar_Get(var, <PyObject*>default_value, &value) # <<<<<<<<<<<<<<
|
jpayne@69
|
4537 * # value of context variable or 'default_value'
|
jpayne@69
|
4538 * pyvalue = <object>value
|
jpayne@69
|
4539 */
|
jpayne@69
|
4540 __pyx_t_1 = PyContextVar_Get(__pyx_v_var, ((PyObject *)__pyx_v_default_value), (&__pyx_v_value)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(1, 136, __pyx_L1_error)
|
jpayne@69
|
4541
|
jpayne@69
|
4542 /* "cpython/contextvars.pxd":138
|
jpayne@69
|
4543 * PyContextVar_Get(var, <PyObject*>default_value, &value)
|
jpayne@69
|
4544 * # value of context variable or 'default_value'
|
jpayne@69
|
4545 * pyvalue = <object>value # <<<<<<<<<<<<<<
|
jpayne@69
|
4546 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
|
jpayne@69
|
4547 * return pyvalue
|
jpayne@69
|
4548 */
|
jpayne@69
|
4549 __pyx_t_2 = ((PyObject *)__pyx_v_value);
|
jpayne@69
|
4550 __Pyx_INCREF(__pyx_t_2);
|
jpayne@69
|
4551 __pyx_v_pyvalue = __pyx_t_2;
|
jpayne@69
|
4552 __pyx_t_2 = 0;
|
jpayne@69
|
4553
|
jpayne@69
|
4554 /* "cpython/contextvars.pxd":139
|
jpayne@69
|
4555 * # value of context variable or 'default_value'
|
jpayne@69
|
4556 * pyvalue = <object>value
|
jpayne@69
|
4557 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*' # <<<<<<<<<<<<<<
|
jpayne@69
|
4558 * return pyvalue
|
jpayne@69
|
4559 */
|
jpayne@69
|
4560 Py_XDECREF(__pyx_v_value);
|
jpayne@69
|
4561
|
jpayne@69
|
4562 /* "cpython/contextvars.pxd":140
|
jpayne@69
|
4563 * pyvalue = <object>value
|
jpayne@69
|
4564 * Py_XDECREF(value) # PyContextVar_Get() returned an owned reference as 'PyObject*'
|
jpayne@69
|
4565 * return pyvalue # <<<<<<<<<<<<<<
|
jpayne@69
|
4566 */
|
jpayne@69
|
4567 __Pyx_XDECREF(__pyx_r);
|
jpayne@69
|
4568 __Pyx_INCREF(__pyx_v_pyvalue);
|
jpayne@69
|
4569 __pyx_r = __pyx_v_pyvalue;
|
jpayne@69
|
4570 goto __pyx_L0;
|
jpayne@69
|
4571
|
jpayne@69
|
4572 /* "cpython/contextvars.pxd":129
|
jpayne@69
|
4573 *
|
jpayne@69
|
4574 *
|
jpayne@69
|
4575 * cdef inline object get_value_no_default(var, default_value=None): # <<<<<<<<<<<<<<
|
jpayne@69
|
4576 * """Return a new reference to the value of the context variable,
|
jpayne@69
|
4577 * or the provided default value if no such value was found.
|
jpayne@69
|
4578 */
|
jpayne@69
|
4579
|
jpayne@69
|
4580 /* function exit code */
|
jpayne@69
|
4581 __pyx_L1_error:;
|
jpayne@69
|
4582 __Pyx_XDECREF(__pyx_t_2);
|
jpayne@69
|
4583 __Pyx_AddTraceback("cpython.contextvars.get_value_no_default", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
4584 __pyx_r = 0;
|
jpayne@69
|
4585 __pyx_L0:;
|
jpayne@69
|
4586 __Pyx_XDECREF(__pyx_v_pyvalue);
|
jpayne@69
|
4587 __Pyx_XGIVEREF(__pyx_r);
|
jpayne@69
|
4588 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
4589 return __pyx_r;
|
jpayne@69
|
4590 }
|
jpayne@69
|
4591
|
jpayne@69
|
4592 /* "array.pxd":104
|
jpayne@69
|
4593 * __data_union data
|
jpayne@69
|
4594 *
|
jpayne@69
|
4595 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
|
jpayne@69
|
4596 * # This implementation of getbuffer is geared towards Cython
|
jpayne@69
|
4597 * # requirements, and does not yet fulfill the PEP.
|
jpayne@69
|
4598 */
|
jpayne@69
|
4599
|
jpayne@69
|
4600 /* Python wrapper */
|
jpayne@69
|
4601 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
|
jpayne@69
|
4602 CYTHON_UNUSED static int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
jpayne@69
|
4603 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
jpayne@69
|
4604 int __pyx_r;
|
jpayne@69
|
4605 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4606 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
jpayne@69
|
4607 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
|
jpayne@69
|
4608 __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
|
jpayne@69
|
4609
|
jpayne@69
|
4610 /* function exit code */
|
jpayne@69
|
4611 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
4612 return __pyx_r;
|
jpayne@69
|
4613 }
|
jpayne@69
|
4614
|
jpayne@69
|
4615 static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
|
jpayne@69
|
4616 PyObject *__pyx_v_item_count = NULL;
|
jpayne@69
|
4617 int __pyx_r;
|
jpayne@69
|
4618 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4619 PyObject *__pyx_t_1 = NULL;
|
jpayne@69
|
4620 char *__pyx_t_2;
|
jpayne@69
|
4621 int __pyx_t_3;
|
jpayne@69
|
4622 PyObject *__pyx_t_4 = NULL;
|
jpayne@69
|
4623 Py_ssize_t __pyx_t_5;
|
jpayne@69
|
4624 int __pyx_t_6;
|
jpayne@69
|
4625 char __pyx_t_7;
|
jpayne@69
|
4626 int __pyx_lineno = 0;
|
jpayne@69
|
4627 const char *__pyx_filename = NULL;
|
jpayne@69
|
4628 int __pyx_clineno = 0;
|
jpayne@69
|
4629 if (unlikely(__pyx_v_info == NULL)) {
|
jpayne@69
|
4630 PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
|
jpayne@69
|
4631 return -1;
|
jpayne@69
|
4632 }
|
jpayne@69
|
4633 __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
jpayne@69
|
4634 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
jpayne@69
|
4635 __Pyx_GIVEREF(__pyx_v_info->obj);
|
jpayne@69
|
4636
|
jpayne@69
|
4637 /* "array.pxd":109
|
jpayne@69
|
4638 * # In particular strided access is always provided regardless
|
jpayne@69
|
4639 * # of flags
|
jpayne@69
|
4640 * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
|
jpayne@69
|
4641 *
|
jpayne@69
|
4642 * info.suboffsets = NULL
|
jpayne@69
|
4643 */
|
jpayne@69
|
4644 __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __pyx_L1_error)
|
jpayne@69
|
4645 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
4646 __pyx_v_item_count = __pyx_t_1;
|
jpayne@69
|
4647 __pyx_t_1 = 0;
|
jpayne@69
|
4648
|
jpayne@69
|
4649 /* "array.pxd":111
|
jpayne@69
|
4650 * item_count = Py_SIZE(self)
|
jpayne@69
|
4651 *
|
jpayne@69
|
4652 * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
jpayne@69
|
4653 * info.buf = self.data.as_chars
|
jpayne@69
|
4654 * info.readonly = 0
|
jpayne@69
|
4655 */
|
jpayne@69
|
4656 __pyx_v_info->suboffsets = NULL;
|
jpayne@69
|
4657
|
jpayne@69
|
4658 /* "array.pxd":112
|
jpayne@69
|
4659 *
|
jpayne@69
|
4660 * info.suboffsets = NULL
|
jpayne@69
|
4661 * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
|
jpayne@69
|
4662 * info.readonly = 0
|
jpayne@69
|
4663 * info.ndim = 1
|
jpayne@69
|
4664 */
|
jpayne@69
|
4665 __pyx_t_2 = __pyx_v_self->data.as_chars;
|
jpayne@69
|
4666 __pyx_v_info->buf = __pyx_t_2;
|
jpayne@69
|
4667
|
jpayne@69
|
4668 /* "array.pxd":113
|
jpayne@69
|
4669 * info.suboffsets = NULL
|
jpayne@69
|
4670 * info.buf = self.data.as_chars
|
jpayne@69
|
4671 * info.readonly = 0 # <<<<<<<<<<<<<<
|
jpayne@69
|
4672 * info.ndim = 1
|
jpayne@69
|
4673 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
|
jpayne@69
|
4674 */
|
jpayne@69
|
4675 __pyx_v_info->readonly = 0;
|
jpayne@69
|
4676
|
jpayne@69
|
4677 /* "array.pxd":114
|
jpayne@69
|
4678 * info.buf = self.data.as_chars
|
jpayne@69
|
4679 * info.readonly = 0
|
jpayne@69
|
4680 * info.ndim = 1 # <<<<<<<<<<<<<<
|
jpayne@69
|
4681 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
|
jpayne@69
|
4682 * info.len = info.itemsize * item_count
|
jpayne@69
|
4683 */
|
jpayne@69
|
4684 __pyx_v_info->ndim = 1;
|
jpayne@69
|
4685
|
jpayne@69
|
4686 /* "array.pxd":115
|
jpayne@69
|
4687 * info.readonly = 0
|
jpayne@69
|
4688 * info.ndim = 1
|
jpayne@69
|
4689 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
|
jpayne@69
|
4690 * info.len = info.itemsize * item_count
|
jpayne@69
|
4691 *
|
jpayne@69
|
4692 */
|
jpayne@69
|
4693 __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
|
jpayne@69
|
4694 __pyx_v_info->itemsize = __pyx_t_3;
|
jpayne@69
|
4695
|
jpayne@69
|
4696 /* "array.pxd":116
|
jpayne@69
|
4697 * info.ndim = 1
|
jpayne@69
|
4698 * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
|
jpayne@69
|
4699 * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
|
jpayne@69
|
4700 *
|
jpayne@69
|
4701 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
|
jpayne@69
|
4702 */
|
jpayne@69
|
4703 __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 116, __pyx_L1_error)
|
jpayne@69
|
4704 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
4705 __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 116, __pyx_L1_error)
|
jpayne@69
|
4706 __Pyx_GOTREF(__pyx_t_4);
|
jpayne@69
|
4707 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
4708 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 116, __pyx_L1_error)
|
jpayne@69
|
4709 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
jpayne@69
|
4710 __pyx_v_info->len = __pyx_t_5;
|
jpayne@69
|
4711
|
jpayne@69
|
4712 /* "array.pxd":118
|
jpayne@69
|
4713 * info.len = info.itemsize * item_count
|
jpayne@69
|
4714 *
|
jpayne@69
|
4715 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
|
jpayne@69
|
4716 * if not info.shape:
|
jpayne@69
|
4717 * raise MemoryError()
|
jpayne@69
|
4718 */
|
jpayne@69
|
4719 __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
|
jpayne@69
|
4720
|
jpayne@69
|
4721 /* "array.pxd":119
|
jpayne@69
|
4722 *
|
jpayne@69
|
4723 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
|
jpayne@69
|
4724 * if not info.shape: # <<<<<<<<<<<<<<
|
jpayne@69
|
4725 * raise MemoryError()
|
jpayne@69
|
4726 * info.shape[0] = item_count # constant regardless of resizing
|
jpayne@69
|
4727 */
|
jpayne@69
|
4728 __pyx_t_6 = (!(__pyx_v_info->shape != 0));
|
jpayne@69
|
4729 if (unlikely(__pyx_t_6)) {
|
jpayne@69
|
4730
|
jpayne@69
|
4731 /* "array.pxd":120
|
jpayne@69
|
4732 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
|
jpayne@69
|
4733 * if not info.shape:
|
jpayne@69
|
4734 * raise MemoryError() # <<<<<<<<<<<<<<
|
jpayne@69
|
4735 * info.shape[0] = item_count # constant regardless of resizing
|
jpayne@69
|
4736 * info.strides = &info.itemsize
|
jpayne@69
|
4737 */
|
jpayne@69
|
4738 PyErr_NoMemory(); __PYX_ERR(2, 120, __pyx_L1_error)
|
jpayne@69
|
4739
|
jpayne@69
|
4740 /* "array.pxd":119
|
jpayne@69
|
4741 *
|
jpayne@69
|
4742 * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
|
jpayne@69
|
4743 * if not info.shape: # <<<<<<<<<<<<<<
|
jpayne@69
|
4744 * raise MemoryError()
|
jpayne@69
|
4745 * info.shape[0] = item_count # constant regardless of resizing
|
jpayne@69
|
4746 */
|
jpayne@69
|
4747 }
|
jpayne@69
|
4748
|
jpayne@69
|
4749 /* "array.pxd":121
|
jpayne@69
|
4750 * if not info.shape:
|
jpayne@69
|
4751 * raise MemoryError()
|
jpayne@69
|
4752 * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
|
jpayne@69
|
4753 * info.strides = &info.itemsize
|
jpayne@69
|
4754 *
|
jpayne@69
|
4755 */
|
jpayne@69
|
4756 __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L1_error)
|
jpayne@69
|
4757 (__pyx_v_info->shape[0]) = __pyx_t_5;
|
jpayne@69
|
4758
|
jpayne@69
|
4759 /* "array.pxd":122
|
jpayne@69
|
4760 * raise MemoryError()
|
jpayne@69
|
4761 * info.shape[0] = item_count # constant regardless of resizing
|
jpayne@69
|
4762 * info.strides = &info.itemsize # <<<<<<<<<<<<<<
|
jpayne@69
|
4763 *
|
jpayne@69
|
4764 * info.format = <char*> (info.shape + 1)
|
jpayne@69
|
4765 */
|
jpayne@69
|
4766 __pyx_v_info->strides = (&__pyx_v_info->itemsize);
|
jpayne@69
|
4767
|
jpayne@69
|
4768 /* "array.pxd":124
|
jpayne@69
|
4769 * info.strides = &info.itemsize
|
jpayne@69
|
4770 *
|
jpayne@69
|
4771 * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
|
jpayne@69
|
4772 * info.format[0] = self.ob_descr.typecode
|
jpayne@69
|
4773 * info.format[1] = 0
|
jpayne@69
|
4774 */
|
jpayne@69
|
4775 __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
|
jpayne@69
|
4776
|
jpayne@69
|
4777 /* "array.pxd":125
|
jpayne@69
|
4778 *
|
jpayne@69
|
4779 * info.format = <char*> (info.shape + 1)
|
jpayne@69
|
4780 * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
|
jpayne@69
|
4781 * info.format[1] = 0
|
jpayne@69
|
4782 * info.obj = self
|
jpayne@69
|
4783 */
|
jpayne@69
|
4784 __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
|
jpayne@69
|
4785 (__pyx_v_info->format[0]) = __pyx_t_7;
|
jpayne@69
|
4786
|
jpayne@69
|
4787 /* "array.pxd":126
|
jpayne@69
|
4788 * info.format = <char*> (info.shape + 1)
|
jpayne@69
|
4789 * info.format[0] = self.ob_descr.typecode
|
jpayne@69
|
4790 * info.format[1] = 0 # <<<<<<<<<<<<<<
|
jpayne@69
|
4791 * info.obj = self
|
jpayne@69
|
4792 *
|
jpayne@69
|
4793 */
|
jpayne@69
|
4794 (__pyx_v_info->format[1]) = 0;
|
jpayne@69
|
4795
|
jpayne@69
|
4796 /* "array.pxd":127
|
jpayne@69
|
4797 * info.format[0] = self.ob_descr.typecode
|
jpayne@69
|
4798 * info.format[1] = 0
|
jpayne@69
|
4799 * info.obj = self # <<<<<<<<<<<<<<
|
jpayne@69
|
4800 *
|
jpayne@69
|
4801 * def __releasebuffer__(self, Py_buffer* info):
|
jpayne@69
|
4802 */
|
jpayne@69
|
4803 __Pyx_INCREF((PyObject *)__pyx_v_self);
|
jpayne@69
|
4804 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
|
jpayne@69
|
4805 __Pyx_GOTREF(__pyx_v_info->obj);
|
jpayne@69
|
4806 __Pyx_DECREF(__pyx_v_info->obj);
|
jpayne@69
|
4807 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
jpayne@69
|
4808
|
jpayne@69
|
4809 /* "array.pxd":104
|
jpayne@69
|
4810 * __data_union data
|
jpayne@69
|
4811 *
|
jpayne@69
|
4812 * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
|
jpayne@69
|
4813 * # This implementation of getbuffer is geared towards Cython
|
jpayne@69
|
4814 * # requirements, and does not yet fulfill the PEP.
|
jpayne@69
|
4815 */
|
jpayne@69
|
4816
|
jpayne@69
|
4817 /* function exit code */
|
jpayne@69
|
4818 __pyx_r = 0;
|
jpayne@69
|
4819 goto __pyx_L0;
|
jpayne@69
|
4820 __pyx_L1_error:;
|
jpayne@69
|
4821 __Pyx_XDECREF(__pyx_t_1);
|
jpayne@69
|
4822 __Pyx_XDECREF(__pyx_t_4);
|
jpayne@69
|
4823 __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
4824 __pyx_r = -1;
|
jpayne@69
|
4825 if (__pyx_v_info->obj != NULL) {
|
jpayne@69
|
4826 __Pyx_GOTREF(__pyx_v_info->obj);
|
jpayne@69
|
4827 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
jpayne@69
|
4828 }
|
jpayne@69
|
4829 goto __pyx_L2;
|
jpayne@69
|
4830 __pyx_L0:;
|
jpayne@69
|
4831 if (__pyx_v_info->obj == Py_None) {
|
jpayne@69
|
4832 __Pyx_GOTREF(__pyx_v_info->obj);
|
jpayne@69
|
4833 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
|
jpayne@69
|
4834 }
|
jpayne@69
|
4835 __pyx_L2:;
|
jpayne@69
|
4836 __Pyx_XDECREF(__pyx_v_item_count);
|
jpayne@69
|
4837 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
4838 return __pyx_r;
|
jpayne@69
|
4839 }
|
jpayne@69
|
4840
|
jpayne@69
|
4841 /* "array.pxd":129
|
jpayne@69
|
4842 * info.obj = self
|
jpayne@69
|
4843 *
|
jpayne@69
|
4844 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
|
jpayne@69
|
4845 * PyObject_Free(info.shape)
|
jpayne@69
|
4846 *
|
jpayne@69
|
4847 */
|
jpayne@69
|
4848
|
jpayne@69
|
4849 /* Python wrapper */
|
jpayne@69
|
4850 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
|
jpayne@69
|
4851 CYTHON_UNUSED static void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
|
jpayne@69
|
4852 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
jpayne@69
|
4853 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4854 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
|
jpayne@69
|
4855 __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
|
jpayne@69
|
4856 __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
|
jpayne@69
|
4857
|
jpayne@69
|
4858 /* function exit code */
|
jpayne@69
|
4859 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
4860 }
|
jpayne@69
|
4861
|
jpayne@69
|
4862 static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
|
jpayne@69
|
4863
|
jpayne@69
|
4864 /* "array.pxd":130
|
jpayne@69
|
4865 *
|
jpayne@69
|
4866 * def __releasebuffer__(self, Py_buffer* info):
|
jpayne@69
|
4867 * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
|
jpayne@69
|
4868 *
|
jpayne@69
|
4869 * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
|
jpayne@69
|
4870 */
|
jpayne@69
|
4871 PyObject_Free(__pyx_v_info->shape);
|
jpayne@69
|
4872
|
jpayne@69
|
4873 /* "array.pxd":129
|
jpayne@69
|
4874 * info.obj = self
|
jpayne@69
|
4875 *
|
jpayne@69
|
4876 * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
|
jpayne@69
|
4877 * PyObject_Free(info.shape)
|
jpayne@69
|
4878 *
|
jpayne@69
|
4879 */
|
jpayne@69
|
4880
|
jpayne@69
|
4881 /* function exit code */
|
jpayne@69
|
4882 }
|
jpayne@69
|
4883
|
jpayne@69
|
4884 /* "array.pxd":141
|
jpayne@69
|
4885 *
|
jpayne@69
|
4886 *
|
jpayne@69
|
4887 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
|
jpayne@69
|
4888 * """ fast creation of a new array, given a template array.
|
jpayne@69
|
4889 * type will be same as template.
|
jpayne@69
|
4890 */
|
jpayne@69
|
4891
|
jpayne@69
|
4892 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
|
jpayne@69
|
4893 arrayobject *__pyx_v_op = 0;
|
jpayne@69
|
4894 arrayobject *__pyx_r = NULL;
|
jpayne@69
|
4895 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4896 PyObject *__pyx_t_1 = NULL;
|
jpayne@69
|
4897 int __pyx_t_2;
|
jpayne@69
|
4898 int __pyx_t_3;
|
jpayne@69
|
4899 int __pyx_lineno = 0;
|
jpayne@69
|
4900 const char *__pyx_filename = NULL;
|
jpayne@69
|
4901 int __pyx_clineno = 0;
|
jpayne@69
|
4902 __Pyx_RefNannySetupContext("clone", 1);
|
jpayne@69
|
4903
|
jpayne@69
|
4904 /* "array.pxd":145
|
jpayne@69
|
4905 * type will be same as template.
|
jpayne@69
|
4906 * if zero is true, new array will be initialized with zeroes."""
|
jpayne@69
|
4907 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
|
jpayne@69
|
4908 * if zero and op is not None:
|
jpayne@69
|
4909 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
|
jpayne@69
|
4910 */
|
jpayne@69
|
4911 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 145, __pyx_L1_error)
|
jpayne@69
|
4912 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
4913 __pyx_v_op = ((arrayobject *)__pyx_t_1);
|
jpayne@69
|
4914 __pyx_t_1 = 0;
|
jpayne@69
|
4915
|
jpayne@69
|
4916 /* "array.pxd":146
|
jpayne@69
|
4917 * if zero is true, new array will be initialized with zeroes."""
|
jpayne@69
|
4918 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
|
jpayne@69
|
4919 * if zero and op is not None: # <<<<<<<<<<<<<<
|
jpayne@69
|
4920 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
|
jpayne@69
|
4921 * return op
|
jpayne@69
|
4922 */
|
jpayne@69
|
4923 if (__pyx_v_zero) {
|
jpayne@69
|
4924 } else {
|
jpayne@69
|
4925 __pyx_t_2 = __pyx_v_zero;
|
jpayne@69
|
4926 goto __pyx_L4_bool_binop_done;
|
jpayne@69
|
4927 }
|
jpayne@69
|
4928 __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
|
jpayne@69
|
4929 __pyx_t_2 = __pyx_t_3;
|
jpayne@69
|
4930 __pyx_L4_bool_binop_done:;
|
jpayne@69
|
4931 if (__pyx_t_2) {
|
jpayne@69
|
4932
|
jpayne@69
|
4933 /* "array.pxd":147
|
jpayne@69
|
4934 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
|
jpayne@69
|
4935 * if zero and op is not None:
|
jpayne@69
|
4936 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
|
jpayne@69
|
4937 * return op
|
jpayne@69
|
4938 *
|
jpayne@69
|
4939 */
|
jpayne@69
|
4940 (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
|
jpayne@69
|
4941
|
jpayne@69
|
4942 /* "array.pxd":146
|
jpayne@69
|
4943 * if zero is true, new array will be initialized with zeroes."""
|
jpayne@69
|
4944 * cdef array op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
|
jpayne@69
|
4945 * if zero and op is not None: # <<<<<<<<<<<<<<
|
jpayne@69
|
4946 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
|
jpayne@69
|
4947 * return op
|
jpayne@69
|
4948 */
|
jpayne@69
|
4949 }
|
jpayne@69
|
4950
|
jpayne@69
|
4951 /* "array.pxd":148
|
jpayne@69
|
4952 * if zero and op is not None:
|
jpayne@69
|
4953 * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
|
jpayne@69
|
4954 * return op # <<<<<<<<<<<<<<
|
jpayne@69
|
4955 *
|
jpayne@69
|
4956 * cdef inline array copy(array self):
|
jpayne@69
|
4957 */
|
jpayne@69
|
4958 __Pyx_XDECREF((PyObject *)__pyx_r);
|
jpayne@69
|
4959 __Pyx_INCREF((PyObject *)__pyx_v_op);
|
jpayne@69
|
4960 __pyx_r = __pyx_v_op;
|
jpayne@69
|
4961 goto __pyx_L0;
|
jpayne@69
|
4962
|
jpayne@69
|
4963 /* "array.pxd":141
|
jpayne@69
|
4964 *
|
jpayne@69
|
4965 *
|
jpayne@69
|
4966 * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
|
jpayne@69
|
4967 * """ fast creation of a new array, given a template array.
|
jpayne@69
|
4968 * type will be same as template.
|
jpayne@69
|
4969 */
|
jpayne@69
|
4970
|
jpayne@69
|
4971 /* function exit code */
|
jpayne@69
|
4972 __pyx_L1_error:;
|
jpayne@69
|
4973 __Pyx_XDECREF(__pyx_t_1);
|
jpayne@69
|
4974 __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
4975 __pyx_r = 0;
|
jpayne@69
|
4976 __pyx_L0:;
|
jpayne@69
|
4977 __Pyx_XDECREF((PyObject *)__pyx_v_op);
|
jpayne@69
|
4978 __Pyx_XGIVEREF((PyObject *)__pyx_r);
|
jpayne@69
|
4979 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
4980 return __pyx_r;
|
jpayne@69
|
4981 }
|
jpayne@69
|
4982
|
jpayne@69
|
4983 /* "array.pxd":150
|
jpayne@69
|
4984 * return op
|
jpayne@69
|
4985 *
|
jpayne@69
|
4986 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
|
jpayne@69
|
4987 * """ make a copy of an array. """
|
jpayne@69
|
4988 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
|
jpayne@69
|
4989 */
|
jpayne@69
|
4990
|
jpayne@69
|
4991 static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
|
jpayne@69
|
4992 arrayobject *__pyx_v_op = 0;
|
jpayne@69
|
4993 arrayobject *__pyx_r = NULL;
|
jpayne@69
|
4994 __Pyx_RefNannyDeclarations
|
jpayne@69
|
4995 PyObject *__pyx_t_1 = NULL;
|
jpayne@69
|
4996 int __pyx_lineno = 0;
|
jpayne@69
|
4997 const char *__pyx_filename = NULL;
|
jpayne@69
|
4998 int __pyx_clineno = 0;
|
jpayne@69
|
4999 __Pyx_RefNannySetupContext("copy", 1);
|
jpayne@69
|
5000
|
jpayne@69
|
5001 /* "array.pxd":152
|
jpayne@69
|
5002 * cdef inline array copy(array self):
|
jpayne@69
|
5003 * """ make a copy of an array. """
|
jpayne@69
|
5004 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
|
jpayne@69
|
5005 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
|
jpayne@69
|
5006 * return op
|
jpayne@69
|
5007 */
|
jpayne@69
|
5008 __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 152, __pyx_L1_error)
|
jpayne@69
|
5009 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
5010 __pyx_v_op = ((arrayobject *)__pyx_t_1);
|
jpayne@69
|
5011 __pyx_t_1 = 0;
|
jpayne@69
|
5012
|
jpayne@69
|
5013 /* "array.pxd":153
|
jpayne@69
|
5014 * """ make a copy of an array. """
|
jpayne@69
|
5015 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
|
jpayne@69
|
5016 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
|
jpayne@69
|
5017 * return op
|
jpayne@69
|
5018 *
|
jpayne@69
|
5019 */
|
jpayne@69
|
5020 (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)));
|
jpayne@69
|
5021
|
jpayne@69
|
5022 /* "array.pxd":154
|
jpayne@69
|
5023 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
|
jpayne@69
|
5024 * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
|
jpayne@69
|
5025 * return op # <<<<<<<<<<<<<<
|
jpayne@69
|
5026 *
|
jpayne@69
|
5027 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
|
jpayne@69
|
5028 */
|
jpayne@69
|
5029 __Pyx_XDECREF((PyObject *)__pyx_r);
|
jpayne@69
|
5030 __Pyx_INCREF((PyObject *)__pyx_v_op);
|
jpayne@69
|
5031 __pyx_r = __pyx_v_op;
|
jpayne@69
|
5032 goto __pyx_L0;
|
jpayne@69
|
5033
|
jpayne@69
|
5034 /* "array.pxd":150
|
jpayne@69
|
5035 * return op
|
jpayne@69
|
5036 *
|
jpayne@69
|
5037 * cdef inline array copy(array self): # <<<<<<<<<<<<<<
|
jpayne@69
|
5038 * """ make a copy of an array. """
|
jpayne@69
|
5039 * cdef array op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
|
jpayne@69
|
5040 */
|
jpayne@69
|
5041
|
jpayne@69
|
5042 /* function exit code */
|
jpayne@69
|
5043 __pyx_L1_error:;
|
jpayne@69
|
5044 __Pyx_XDECREF(__pyx_t_1);
|
jpayne@69
|
5045 __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5046 __pyx_r = 0;
|
jpayne@69
|
5047 __pyx_L0:;
|
jpayne@69
|
5048 __Pyx_XDECREF((PyObject *)__pyx_v_op);
|
jpayne@69
|
5049 __Pyx_XGIVEREF((PyObject *)__pyx_r);
|
jpayne@69
|
5050 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5051 return __pyx_r;
|
jpayne@69
|
5052 }
|
jpayne@69
|
5053
|
jpayne@69
|
5054 /* "array.pxd":156
|
jpayne@69
|
5055 * return op
|
jpayne@69
|
5056 *
|
jpayne@69
|
5057 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
|
jpayne@69
|
5058 * """ efficient appending of new stuff of same type
|
jpayne@69
|
5059 * (e.g. of same array type)
|
jpayne@69
|
5060 */
|
jpayne@69
|
5061
|
jpayne@69
|
5062 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
|
jpayne@69
|
5063 Py_ssize_t __pyx_v_itemsize;
|
jpayne@69
|
5064 Py_ssize_t __pyx_v_origsize;
|
jpayne@69
|
5065 int __pyx_r;
|
jpayne@69
|
5066 int __pyx_t_1;
|
jpayne@69
|
5067 int __pyx_lineno = 0;
|
jpayne@69
|
5068 const char *__pyx_filename = NULL;
|
jpayne@69
|
5069 int __pyx_clineno = 0;
|
jpayne@69
|
5070
|
jpayne@69
|
5071 /* "array.pxd":160
|
jpayne@69
|
5072 * (e.g. of same array type)
|
jpayne@69
|
5073 * n: number of elements (not number of bytes!) """
|
jpayne@69
|
5074 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
|
jpayne@69
|
5075 * cdef Py_ssize_t origsize = Py_SIZE(self)
|
jpayne@69
|
5076 * resize_smart(self, origsize + n)
|
jpayne@69
|
5077 */
|
jpayne@69
|
5078 __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
|
jpayne@69
|
5079 __pyx_v_itemsize = __pyx_t_1;
|
jpayne@69
|
5080
|
jpayne@69
|
5081 /* "array.pxd":161
|
jpayne@69
|
5082 * n: number of elements (not number of bytes!) """
|
jpayne@69
|
5083 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
|
jpayne@69
|
5084 * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
|
jpayne@69
|
5085 * resize_smart(self, origsize + n)
|
jpayne@69
|
5086 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
|
jpayne@69
|
5087 */
|
jpayne@69
|
5088 __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
|
jpayne@69
|
5089
|
jpayne@69
|
5090 /* "array.pxd":162
|
jpayne@69
|
5091 * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
|
jpayne@69
|
5092 * cdef Py_ssize_t origsize = Py_SIZE(self)
|
jpayne@69
|
5093 * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
|
jpayne@69
|
5094 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
|
jpayne@69
|
5095 * return 0
|
jpayne@69
|
5096 */
|
jpayne@69
|
5097 __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(2, 162, __pyx_L1_error)
|
jpayne@69
|
5098
|
jpayne@69
|
5099 /* "array.pxd":163
|
jpayne@69
|
5100 * cdef Py_ssize_t origsize = Py_SIZE(self)
|
jpayne@69
|
5101 * resize_smart(self, origsize + n)
|
jpayne@69
|
5102 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
|
jpayne@69
|
5103 * return 0
|
jpayne@69
|
5104 *
|
jpayne@69
|
5105 */
|
jpayne@69
|
5106 (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
|
jpayne@69
|
5107
|
jpayne@69
|
5108 /* "array.pxd":164
|
jpayne@69
|
5109 * resize_smart(self, origsize + n)
|
jpayne@69
|
5110 * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
|
jpayne@69
|
5111 * return 0 # <<<<<<<<<<<<<<
|
jpayne@69
|
5112 *
|
jpayne@69
|
5113 * cdef inline int extend(array self, array other) except -1:
|
jpayne@69
|
5114 */
|
jpayne@69
|
5115 __pyx_r = 0;
|
jpayne@69
|
5116 goto __pyx_L0;
|
jpayne@69
|
5117
|
jpayne@69
|
5118 /* "array.pxd":156
|
jpayne@69
|
5119 * return op
|
jpayne@69
|
5120 *
|
jpayne@69
|
5121 * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
|
jpayne@69
|
5122 * """ efficient appending of new stuff of same type
|
jpayne@69
|
5123 * (e.g. of same array type)
|
jpayne@69
|
5124 */
|
jpayne@69
|
5125
|
jpayne@69
|
5126 /* function exit code */
|
jpayne@69
|
5127 __pyx_L1_error:;
|
jpayne@69
|
5128 __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5129 __pyx_r = -1;
|
jpayne@69
|
5130 __pyx_L0:;
|
jpayne@69
|
5131 return __pyx_r;
|
jpayne@69
|
5132 }
|
jpayne@69
|
5133
|
jpayne@69
|
5134 /* "array.pxd":166
|
jpayne@69
|
5135 * return 0
|
jpayne@69
|
5136 *
|
jpayne@69
|
5137 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
|
jpayne@69
|
5138 * """ extend array with data from another array; types must match. """
|
jpayne@69
|
5139 * if self.ob_descr.typecode != other.ob_descr.typecode:
|
jpayne@69
|
5140 */
|
jpayne@69
|
5141
|
jpayne@69
|
5142 static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
|
jpayne@69
|
5143 int __pyx_r;
|
jpayne@69
|
5144 int __pyx_t_1;
|
jpayne@69
|
5145 int __pyx_t_2;
|
jpayne@69
|
5146 int __pyx_lineno = 0;
|
jpayne@69
|
5147 const char *__pyx_filename = NULL;
|
jpayne@69
|
5148 int __pyx_clineno = 0;
|
jpayne@69
|
5149
|
jpayne@69
|
5150 /* "array.pxd":168
|
jpayne@69
|
5151 * cdef inline int extend(array self, array other) except -1:
|
jpayne@69
|
5152 * """ extend array with data from another array; types must match. """
|
jpayne@69
|
5153 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
|
jpayne@69
|
5154 * PyErr_BadArgument()
|
jpayne@69
|
5155 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
|
jpayne@69
|
5156 */
|
jpayne@69
|
5157 __pyx_t_1 = (__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode);
|
jpayne@69
|
5158 if (__pyx_t_1) {
|
jpayne@69
|
5159
|
jpayne@69
|
5160 /* "array.pxd":169
|
jpayne@69
|
5161 * """ extend array with data from another array; types must match. """
|
jpayne@69
|
5162 * if self.ob_descr.typecode != other.ob_descr.typecode:
|
jpayne@69
|
5163 * PyErr_BadArgument() # <<<<<<<<<<<<<<
|
jpayne@69
|
5164 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
|
jpayne@69
|
5165 *
|
jpayne@69
|
5166 */
|
jpayne@69
|
5167 __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 169, __pyx_L1_error)
|
jpayne@69
|
5168
|
jpayne@69
|
5169 /* "array.pxd":168
|
jpayne@69
|
5170 * cdef inline int extend(array self, array other) except -1:
|
jpayne@69
|
5171 * """ extend array with data from another array; types must match. """
|
jpayne@69
|
5172 * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
|
jpayne@69
|
5173 * PyErr_BadArgument()
|
jpayne@69
|
5174 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
|
jpayne@69
|
5175 */
|
jpayne@69
|
5176 }
|
jpayne@69
|
5177
|
jpayne@69
|
5178 /* "array.pxd":170
|
jpayne@69
|
5179 * if self.ob_descr.typecode != other.ob_descr.typecode:
|
jpayne@69
|
5180 * PyErr_BadArgument()
|
jpayne@69
|
5181 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
|
jpayne@69
|
5182 *
|
jpayne@69
|
5183 * cdef inline void zero(array self) noexcept:
|
jpayne@69
|
5184 */
|
jpayne@69
|
5185 __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(2, 170, __pyx_L1_error)
|
jpayne@69
|
5186 __pyx_r = __pyx_t_2;
|
jpayne@69
|
5187 goto __pyx_L0;
|
jpayne@69
|
5188
|
jpayne@69
|
5189 /* "array.pxd":166
|
jpayne@69
|
5190 * return 0
|
jpayne@69
|
5191 *
|
jpayne@69
|
5192 * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
|
jpayne@69
|
5193 * """ extend array with data from another array; types must match. """
|
jpayne@69
|
5194 * if self.ob_descr.typecode != other.ob_descr.typecode:
|
jpayne@69
|
5195 */
|
jpayne@69
|
5196
|
jpayne@69
|
5197 /* function exit code */
|
jpayne@69
|
5198 __pyx_L1_error:;
|
jpayne@69
|
5199 __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5200 __pyx_r = -1;
|
jpayne@69
|
5201 __pyx_L0:;
|
jpayne@69
|
5202 return __pyx_r;
|
jpayne@69
|
5203 }
|
jpayne@69
|
5204
|
jpayne@69
|
5205 /* "array.pxd":172
|
jpayne@69
|
5206 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
|
jpayne@69
|
5207 *
|
jpayne@69
|
5208 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<<
|
jpayne@69
|
5209 * """ set all elements of array to zero. """
|
jpayne@69
|
5210 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
|
jpayne@69
|
5211 */
|
jpayne@69
|
5212
|
jpayne@69
|
5213 static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
|
jpayne@69
|
5214
|
jpayne@69
|
5215 /* "array.pxd":174
|
jpayne@69
|
5216 * cdef inline void zero(array self) noexcept:
|
jpayne@69
|
5217 * """ set all elements of array to zero. """
|
jpayne@69
|
5218 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
|
jpayne@69
|
5219 */
|
jpayne@69
|
5220 (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
|
jpayne@69
|
5221
|
jpayne@69
|
5222 /* "array.pxd":172
|
jpayne@69
|
5223 * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
|
jpayne@69
|
5224 *
|
jpayne@69
|
5225 * cdef inline void zero(array self) noexcept: # <<<<<<<<<<<<<<
|
jpayne@69
|
5226 * """ set all elements of array to zero. """
|
jpayne@69
|
5227 * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
|
jpayne@69
|
5228 */
|
jpayne@69
|
5229
|
jpayne@69
|
5230 /* function exit code */
|
jpayne@69
|
5231 }
|
jpayne@69
|
5232
|
jpayne@69
|
5233 /* "(tree fragment)":1
|
jpayne@69
|
5234 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
5235 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5236 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5237 */
|
jpayne@69
|
5238
|
jpayne@69
|
5239 /* Python wrapper */
|
jpayne@69
|
5240 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5241 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5242 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5243 #else
|
jpayne@69
|
5244 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5245 #endif
|
jpayne@69
|
5246 ); /*proto*/
|
jpayne@69
|
5247 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_7Samfile___reduce_cython__, "Samfile.__reduce_cython__(self)");
|
jpayne@69
|
5248 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_7Samfile_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile___reduce_cython__};
|
jpayne@69
|
5249 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5250 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5251 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5252 #else
|
jpayne@69
|
5253 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5254 #endif
|
jpayne@69
|
5255 ) {
|
jpayne@69
|
5256 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5257 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
jpayne@69
|
5258 #endif
|
jpayne@69
|
5259 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
jpayne@69
|
5260 PyObject *__pyx_r = 0;
|
jpayne@69
|
5261 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5262 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
jpayne@69
|
5263 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5264 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
5265 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
jpayne@69
|
5266 #else
|
jpayne@69
|
5267 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
jpayne@69
|
5268 #endif
|
jpayne@69
|
5269 #endif
|
jpayne@69
|
5270 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
jpayne@69
|
5271 if (unlikely(__pyx_nargs > 0)) {
|
jpayne@69
|
5272 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
|
jpayne@69
|
5273 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
|
jpayne@69
|
5274 __pyx_r = __pyx_pf_5pysam_11libcsamfile_7Samfile___reduce_cython__(((struct __pyx_obj_5pysam_11libcsamfile_Samfile *)__pyx_v_self));
|
jpayne@69
|
5275
|
jpayne@69
|
5276 /* function exit code */
|
jpayne@69
|
5277 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5278 return __pyx_r;
|
jpayne@69
|
5279 }
|
jpayne@69
|
5280
|
jpayne@69
|
5281 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self) {
|
jpayne@69
|
5282 PyObject *__pyx_r = NULL;
|
jpayne@69
|
5283 __Pyx_TraceDeclarations
|
jpayne@69
|
5284 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5285 int __pyx_lineno = 0;
|
jpayne@69
|
5286 const char *__pyx_filename = NULL;
|
jpayne@69
|
5287 int __pyx_clineno = 0;
|
jpayne@69
|
5288 __Pyx_TraceFrameInit(__pyx_codeobj_)
|
jpayne@69
|
5289 __Pyx_RefNannySetupContext("__reduce_cython__", 1);
|
jpayne@69
|
5290 __Pyx_TraceCall("__reduce_cython__", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
|
jpayne@69
|
5291
|
jpayne@69
|
5292 /* "(tree fragment)":2
|
jpayne@69
|
5293 * def __reduce_cython__(self):
|
jpayne@69
|
5294 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
|
jpayne@69
|
5295 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5296 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5297 */
|
jpayne@69
|
5298 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_b_self_htsfile_self_index_c, 0, 0);
|
jpayne@69
|
5299 __PYX_ERR(0, 2, __pyx_L1_error)
|
jpayne@69
|
5300
|
jpayne@69
|
5301 /* "(tree fragment)":1
|
jpayne@69
|
5302 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
5303 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5304 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5305 */
|
jpayne@69
|
5306
|
jpayne@69
|
5307 /* function exit code */
|
jpayne@69
|
5308 __pyx_L1_error:;
|
jpayne@69
|
5309 __Pyx_AddTraceback("pysam.libcsamfile.Samfile.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5310 __pyx_r = NULL;
|
jpayne@69
|
5311 __Pyx_XGIVEREF(__pyx_r);
|
jpayne@69
|
5312 __Pyx_TraceReturn(__pyx_r, 0);
|
jpayne@69
|
5313 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5314 return __pyx_r;
|
jpayne@69
|
5315 }
|
jpayne@69
|
5316
|
jpayne@69
|
5317 /* "(tree fragment)":3
|
jpayne@69
|
5318 * def __reduce_cython__(self):
|
jpayne@69
|
5319 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5320 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
5321 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5322 */
|
jpayne@69
|
5323
|
jpayne@69
|
5324 /* Python wrapper */
|
jpayne@69
|
5325 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5326 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5327 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5328 #else
|
jpayne@69
|
5329 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5330 #endif
|
jpayne@69
|
5331 ); /*proto*/
|
jpayne@69
|
5332 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_7Samfile_2__setstate_cython__, "Samfile.__setstate_cython__(self, __pyx_state)");
|
jpayne@69
|
5333 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_7Samfile_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile_2__setstate_cython__};
|
jpayne@69
|
5334 static PyObject *__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5335 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5336 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5337 #else
|
jpayne@69
|
5338 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5339 #endif
|
jpayne@69
|
5340 ) {
|
jpayne@69
|
5341 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
|
jpayne@69
|
5342 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5343 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
jpayne@69
|
5344 #endif
|
jpayne@69
|
5345 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
jpayne@69
|
5346 PyObject* values[1] = {0};
|
jpayne@69
|
5347 int __pyx_lineno = 0;
|
jpayne@69
|
5348 const char *__pyx_filename = NULL;
|
jpayne@69
|
5349 int __pyx_clineno = 0;
|
jpayne@69
|
5350 PyObject *__pyx_r = 0;
|
jpayne@69
|
5351 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5352 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
|
jpayne@69
|
5353 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5354 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
5355 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
jpayne@69
|
5356 #else
|
jpayne@69
|
5357 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
jpayne@69
|
5358 #endif
|
jpayne@69
|
5359 #endif
|
jpayne@69
|
5360 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
jpayne@69
|
5361 {
|
jpayne@69
|
5362 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
|
jpayne@69
|
5363 if (__pyx_kwds) {
|
jpayne@69
|
5364 Py_ssize_t kw_args;
|
jpayne@69
|
5365 switch (__pyx_nargs) {
|
jpayne@69
|
5366 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
|
jpayne@69
|
5367 CYTHON_FALLTHROUGH;
|
jpayne@69
|
5368 case 0: break;
|
jpayne@69
|
5369 default: goto __pyx_L5_argtuple_error;
|
jpayne@69
|
5370 }
|
jpayne@69
|
5371 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
|
jpayne@69
|
5372 switch (__pyx_nargs) {
|
jpayne@69
|
5373 case 0:
|
jpayne@69
|
5374 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
|
jpayne@69
|
5375 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
jpayne@69
|
5376 kw_args--;
|
jpayne@69
|
5377 }
|
jpayne@69
|
5378 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
|
jpayne@69
|
5379 else goto __pyx_L5_argtuple_error;
|
jpayne@69
|
5380 }
|
jpayne@69
|
5381 if (unlikely(kw_args > 0)) {
|
jpayne@69
|
5382 const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
jpayne@69
|
5383 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error)
|
jpayne@69
|
5384 }
|
jpayne@69
|
5385 } else if (unlikely(__pyx_nargs != 1)) {
|
jpayne@69
|
5386 goto __pyx_L5_argtuple_error;
|
jpayne@69
|
5387 } else {
|
jpayne@69
|
5388 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
|
jpayne@69
|
5389 }
|
jpayne@69
|
5390 __pyx_v___pyx_state = values[0];
|
jpayne@69
|
5391 }
|
jpayne@69
|
5392 goto __pyx_L6_skip;
|
jpayne@69
|
5393 __pyx_L5_argtuple_error:;
|
jpayne@69
|
5394 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error)
|
jpayne@69
|
5395 __pyx_L6_skip:;
|
jpayne@69
|
5396 goto __pyx_L4_argument_unpacking_done;
|
jpayne@69
|
5397 __pyx_L3_error:;
|
jpayne@69
|
5398 {
|
jpayne@69
|
5399 Py_ssize_t __pyx_temp;
|
jpayne@69
|
5400 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
jpayne@69
|
5401 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
|
jpayne@69
|
5402 }
|
jpayne@69
|
5403 }
|
jpayne@69
|
5404 __Pyx_AddTraceback("pysam.libcsamfile.Samfile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5405 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5406 return NULL;
|
jpayne@69
|
5407 __pyx_L4_argument_unpacking_done:;
|
jpayne@69
|
5408 __pyx_r = __pyx_pf_5pysam_11libcsamfile_7Samfile_2__setstate_cython__(((struct __pyx_obj_5pysam_11libcsamfile_Samfile *)__pyx_v_self), __pyx_v___pyx_state);
|
jpayne@69
|
5409
|
jpayne@69
|
5410 /* function exit code */
|
jpayne@69
|
5411 {
|
jpayne@69
|
5412 Py_ssize_t __pyx_temp;
|
jpayne@69
|
5413 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
jpayne@69
|
5414 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
|
jpayne@69
|
5415 }
|
jpayne@69
|
5416 }
|
jpayne@69
|
5417 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5418 return __pyx_r;
|
jpayne@69
|
5419 }
|
jpayne@69
|
5420
|
jpayne@69
|
5421 static PyObject *__pyx_pf_5pysam_11libcsamfile_7Samfile_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_Samfile *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
|
jpayne@69
|
5422 PyObject *__pyx_r = NULL;
|
jpayne@69
|
5423 __Pyx_TraceDeclarations
|
jpayne@69
|
5424 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5425 int __pyx_lineno = 0;
|
jpayne@69
|
5426 const char *__pyx_filename = NULL;
|
jpayne@69
|
5427 int __pyx_clineno = 0;
|
jpayne@69
|
5428 __Pyx_TraceFrameInit(__pyx_codeobj__2)
|
jpayne@69
|
5429 __Pyx_RefNannySetupContext("__setstate_cython__", 1);
|
jpayne@69
|
5430 __Pyx_TraceCall("__setstate_cython__", __pyx_f[0], 3, 0, __PYX_ERR(0, 3, __pyx_L1_error));
|
jpayne@69
|
5431
|
jpayne@69
|
5432 /* "(tree fragment)":4
|
jpayne@69
|
5433 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5434 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5435 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
|
jpayne@69
|
5436 */
|
jpayne@69
|
5437 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_b_self_htsfile_self_index_c, 0, 0);
|
jpayne@69
|
5438 __PYX_ERR(0, 4, __pyx_L1_error)
|
jpayne@69
|
5439
|
jpayne@69
|
5440 /* "(tree fragment)":3
|
jpayne@69
|
5441 * def __reduce_cython__(self):
|
jpayne@69
|
5442 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5443 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
5444 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
5445 */
|
jpayne@69
|
5446
|
jpayne@69
|
5447 /* function exit code */
|
jpayne@69
|
5448 __pyx_L1_error:;
|
jpayne@69
|
5449 __Pyx_AddTraceback("pysam.libcsamfile.Samfile.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5450 __pyx_r = NULL;
|
jpayne@69
|
5451 __Pyx_XGIVEREF(__pyx_r);
|
jpayne@69
|
5452 __Pyx_TraceReturn(__pyx_r, 0);
|
jpayne@69
|
5453 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5454 return __pyx_r;
|
jpayne@69
|
5455 }
|
jpayne@69
|
5456
|
jpayne@69
|
5457 /* "(tree fragment)":1
|
jpayne@69
|
5458 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
5459 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5460 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5461 */
|
jpayne@69
|
5462
|
jpayne@69
|
5463 /* Python wrapper */
|
jpayne@69
|
5464 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5465 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5466 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5467 #else
|
jpayne@69
|
5468 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5469 #endif
|
jpayne@69
|
5470 ); /*proto*/
|
jpayne@69
|
5471 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_11AlignedRead___reduce_cython__, "AlignedRead.__reduce_cython__(self)");
|
jpayne@69
|
5472 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead___reduce_cython__};
|
jpayne@69
|
5473 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5474 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5475 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5476 #else
|
jpayne@69
|
5477 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5478 #endif
|
jpayne@69
|
5479 ) {
|
jpayne@69
|
5480 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5481 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
jpayne@69
|
5482 #endif
|
jpayne@69
|
5483 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
jpayne@69
|
5484 PyObject *__pyx_r = 0;
|
jpayne@69
|
5485 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5486 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
|
jpayne@69
|
5487 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5488 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
5489 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
jpayne@69
|
5490 #else
|
jpayne@69
|
5491 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
jpayne@69
|
5492 #endif
|
jpayne@69
|
5493 #endif
|
jpayne@69
|
5494 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
jpayne@69
|
5495 if (unlikely(__pyx_nargs > 0)) {
|
jpayne@69
|
5496 __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
|
jpayne@69
|
5497 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
|
jpayne@69
|
5498 __pyx_r = __pyx_pf_5pysam_11libcsamfile_11AlignedRead___reduce_cython__(((struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *)__pyx_v_self));
|
jpayne@69
|
5499
|
jpayne@69
|
5500 /* function exit code */
|
jpayne@69
|
5501 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5502 return __pyx_r;
|
jpayne@69
|
5503 }
|
jpayne@69
|
5504
|
jpayne@69
|
5505 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self) {
|
jpayne@69
|
5506 PyObject *__pyx_r = NULL;
|
jpayne@69
|
5507 __Pyx_TraceDeclarations
|
jpayne@69
|
5508 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5509 int __pyx_lineno = 0;
|
jpayne@69
|
5510 const char *__pyx_filename = NULL;
|
jpayne@69
|
5511 int __pyx_clineno = 0;
|
jpayne@69
|
5512 __Pyx_TraceFrameInit(__pyx_codeobj__3)
|
jpayne@69
|
5513 __Pyx_RefNannySetupContext("__reduce_cython__", 1);
|
jpayne@69
|
5514 __Pyx_TraceCall("__reduce_cython__", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
|
jpayne@69
|
5515
|
jpayne@69
|
5516 /* "(tree fragment)":2
|
jpayne@69
|
5517 * def __reduce_cython__(self):
|
jpayne@69
|
5518 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
|
jpayne@69
|
5519 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5520 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5521 */
|
jpayne@69
|
5522 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__delegate_cannot_be_convert, 0, 0);
|
jpayne@69
|
5523 __PYX_ERR(0, 2, __pyx_L1_error)
|
jpayne@69
|
5524
|
jpayne@69
|
5525 /* "(tree fragment)":1
|
jpayne@69
|
5526 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
5527 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5528 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5529 */
|
jpayne@69
|
5530
|
jpayne@69
|
5531 /* function exit code */
|
jpayne@69
|
5532 __pyx_L1_error:;
|
jpayne@69
|
5533 __Pyx_AddTraceback("pysam.libcsamfile.AlignedRead.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5534 __pyx_r = NULL;
|
jpayne@69
|
5535 __Pyx_XGIVEREF(__pyx_r);
|
jpayne@69
|
5536 __Pyx_TraceReturn(__pyx_r, 0);
|
jpayne@69
|
5537 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5538 return __pyx_r;
|
jpayne@69
|
5539 }
|
jpayne@69
|
5540
|
jpayne@69
|
5541 /* "(tree fragment)":3
|
jpayne@69
|
5542 * def __reduce_cython__(self):
|
jpayne@69
|
5543 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5544 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
5545 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5546 */
|
jpayne@69
|
5547
|
jpayne@69
|
5548 /* Python wrapper */
|
jpayne@69
|
5549 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5550 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5551 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5552 #else
|
jpayne@69
|
5553 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5554 #endif
|
jpayne@69
|
5555 ); /*proto*/
|
jpayne@69
|
5556 PyDoc_STRVAR(__pyx_doc_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__, "AlignedRead.__setstate_cython__(self, __pyx_state)");
|
jpayne@69
|
5557 static PyMethodDef __pyx_mdef_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__};
|
jpayne@69
|
5558 static PyObject *__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__(PyObject *__pyx_v_self,
|
jpayne@69
|
5559 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
5560 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
|
jpayne@69
|
5561 #else
|
jpayne@69
|
5562 PyObject *__pyx_args, PyObject *__pyx_kwds
|
jpayne@69
|
5563 #endif
|
jpayne@69
|
5564 ) {
|
jpayne@69
|
5565 CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
|
jpayne@69
|
5566 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5567 CYTHON_UNUSED Py_ssize_t __pyx_nargs;
|
jpayne@69
|
5568 #endif
|
jpayne@69
|
5569 CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
|
jpayne@69
|
5570 PyObject* values[1] = {0};
|
jpayne@69
|
5571 int __pyx_lineno = 0;
|
jpayne@69
|
5572 const char *__pyx_filename = NULL;
|
jpayne@69
|
5573 int __pyx_clineno = 0;
|
jpayne@69
|
5574 PyObject *__pyx_r = 0;
|
jpayne@69
|
5575 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5576 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
|
jpayne@69
|
5577 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
5578 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
5579 __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
|
jpayne@69
|
5580 #else
|
jpayne@69
|
5581 __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
|
jpayne@69
|
5582 #endif
|
jpayne@69
|
5583 #endif
|
jpayne@69
|
5584 __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
|
jpayne@69
|
5585 {
|
jpayne@69
|
5586 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
|
jpayne@69
|
5587 if (__pyx_kwds) {
|
jpayne@69
|
5588 Py_ssize_t kw_args;
|
jpayne@69
|
5589 switch (__pyx_nargs) {
|
jpayne@69
|
5590 case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
|
jpayne@69
|
5591 CYTHON_FALLTHROUGH;
|
jpayne@69
|
5592 case 0: break;
|
jpayne@69
|
5593 default: goto __pyx_L5_argtuple_error;
|
jpayne@69
|
5594 }
|
jpayne@69
|
5595 kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
|
jpayne@69
|
5596 switch (__pyx_nargs) {
|
jpayne@69
|
5597 case 0:
|
jpayne@69
|
5598 if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) {
|
jpayne@69
|
5599 (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
|
jpayne@69
|
5600 kw_args--;
|
jpayne@69
|
5601 }
|
jpayne@69
|
5602 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3, __pyx_L3_error)
|
jpayne@69
|
5603 else goto __pyx_L5_argtuple_error;
|
jpayne@69
|
5604 }
|
jpayne@69
|
5605 if (unlikely(kw_args > 0)) {
|
jpayne@69
|
5606 const Py_ssize_t kwd_pos_args = __pyx_nargs;
|
jpayne@69
|
5607 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(0, 3, __pyx_L3_error)
|
jpayne@69
|
5608 }
|
jpayne@69
|
5609 } else if (unlikely(__pyx_nargs != 1)) {
|
jpayne@69
|
5610 goto __pyx_L5_argtuple_error;
|
jpayne@69
|
5611 } else {
|
jpayne@69
|
5612 values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
|
jpayne@69
|
5613 }
|
jpayne@69
|
5614 __pyx_v___pyx_state = values[0];
|
jpayne@69
|
5615 }
|
jpayne@69
|
5616 goto __pyx_L6_skip;
|
jpayne@69
|
5617 __pyx_L5_argtuple_error:;
|
jpayne@69
|
5618 __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3, __pyx_L3_error)
|
jpayne@69
|
5619 __pyx_L6_skip:;
|
jpayne@69
|
5620 goto __pyx_L4_argument_unpacking_done;
|
jpayne@69
|
5621 __pyx_L3_error:;
|
jpayne@69
|
5622 {
|
jpayne@69
|
5623 Py_ssize_t __pyx_temp;
|
jpayne@69
|
5624 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
jpayne@69
|
5625 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
|
jpayne@69
|
5626 }
|
jpayne@69
|
5627 }
|
jpayne@69
|
5628 __Pyx_AddTraceback("pysam.libcsamfile.AlignedRead.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5629 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5630 return NULL;
|
jpayne@69
|
5631 __pyx_L4_argument_unpacking_done:;
|
jpayne@69
|
5632 __pyx_r = __pyx_pf_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__(((struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *)__pyx_v_self), __pyx_v___pyx_state);
|
jpayne@69
|
5633
|
jpayne@69
|
5634 /* function exit code */
|
jpayne@69
|
5635 {
|
jpayne@69
|
5636 Py_ssize_t __pyx_temp;
|
jpayne@69
|
5637 for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
|
jpayne@69
|
5638 __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
|
jpayne@69
|
5639 }
|
jpayne@69
|
5640 }
|
jpayne@69
|
5641 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5642 return __pyx_r;
|
jpayne@69
|
5643 }
|
jpayne@69
|
5644
|
jpayne@69
|
5645 static PyObject *__pyx_pf_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
|
jpayne@69
|
5646 PyObject *__pyx_r = NULL;
|
jpayne@69
|
5647 __Pyx_TraceDeclarations
|
jpayne@69
|
5648 __Pyx_RefNannyDeclarations
|
jpayne@69
|
5649 int __pyx_lineno = 0;
|
jpayne@69
|
5650 const char *__pyx_filename = NULL;
|
jpayne@69
|
5651 int __pyx_clineno = 0;
|
jpayne@69
|
5652 __Pyx_TraceFrameInit(__pyx_codeobj__4)
|
jpayne@69
|
5653 __Pyx_RefNannySetupContext("__setstate_cython__", 1);
|
jpayne@69
|
5654 __Pyx_TraceCall("__setstate_cython__", __pyx_f[0], 3, 0, __PYX_ERR(0, 3, __pyx_L1_error));
|
jpayne@69
|
5655
|
jpayne@69
|
5656 /* "(tree fragment)":4
|
jpayne@69
|
5657 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5658 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
5659 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling" # <<<<<<<<<<<<<<
|
jpayne@69
|
5660 */
|
jpayne@69
|
5661 __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self__delegate_cannot_be_convert, 0, 0);
|
jpayne@69
|
5662 __PYX_ERR(0, 4, __pyx_L1_error)
|
jpayne@69
|
5663
|
jpayne@69
|
5664 /* "(tree fragment)":3
|
jpayne@69
|
5665 * def __reduce_cython__(self):
|
jpayne@69
|
5666 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5667 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
5668 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
5669 */
|
jpayne@69
|
5670
|
jpayne@69
|
5671 /* function exit code */
|
jpayne@69
|
5672 __pyx_L1_error:;
|
jpayne@69
|
5673 __Pyx_AddTraceback("pysam.libcsamfile.AlignedRead.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
5674 __pyx_r = NULL;
|
jpayne@69
|
5675 __Pyx_XGIVEREF(__pyx_r);
|
jpayne@69
|
5676 __Pyx_TraceReturn(__pyx_r, 0);
|
jpayne@69
|
5677 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
5678 return __pyx_r;
|
jpayne@69
|
5679 }
|
jpayne@69
|
5680 static struct __pyx_vtabstruct_5pysam_11libcsamfile_AlignedRead __pyx_vtable_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
5681
|
jpayne@69
|
5682 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_AlignedRead(PyTypeObject *t, PyObject *a, PyObject *k) {
|
jpayne@69
|
5683 struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *p;
|
jpayne@69
|
5684 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment, tp_new, newfunc)(t, a, k);
|
jpayne@69
|
5685 if (unlikely(!o)) return 0;
|
jpayne@69
|
5686 p = ((struct __pyx_obj_5pysam_11libcsamfile_AlignedRead *)o);
|
jpayne@69
|
5687 p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment*)__pyx_vtabptr_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
5688 return o;
|
jpayne@69
|
5689 }
|
jpayne@69
|
5690
|
jpayne@69
|
5691 static int __pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead(PyObject *o, visitproc v, void *a) {
|
jpayne@69
|
5692 int e;
|
jpayne@69
|
5693 e = ((likely(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment)) ? ((__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_traverse) ? __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead)); if (e) return e;
|
jpayne@69
|
5694 return 0;
|
jpayne@69
|
5695 }
|
jpayne@69
|
5696
|
jpayne@69
|
5697 static int __pyx_tp_clear_5pysam_11libcsamfile_AlignedRead(PyObject *o) {
|
jpayne@69
|
5698 if (likely(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment)) { if (__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_clear) __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_11libcsamfile_AlignedRead);
|
jpayne@69
|
5699 return 0;
|
jpayne@69
|
5700 }
|
jpayne@69
|
5701
|
jpayne@69
|
5702 static PyMethodDef __pyx_methods_5pysam_11libcsamfile_AlignedRead[] = {
|
jpayne@69
|
5703 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead___reduce_cython__},
|
jpayne@69
|
5704 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_11AlignedRead_2__setstate_cython__},
|
jpayne@69
|
5705 {0, 0, 0, 0}
|
jpayne@69
|
5706 };
|
jpayne@69
|
5707 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
5708 static PyType_Slot __pyx_type_5pysam_11libcsamfile_AlignedRead_slots[] = {
|
jpayne@69
|
5709 {Py_tp_doc, (void *)PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignedSegment`\n\n Added for backwards compatibility with pysam <= 0.8.0\n ")},
|
jpayne@69
|
5710 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead},
|
jpayne@69
|
5711 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_11libcsamfile_AlignedRead},
|
jpayne@69
|
5712 {Py_tp_methods, (void *)__pyx_methods_5pysam_11libcsamfile_AlignedRead},
|
jpayne@69
|
5713 {Py_tp_new, (void *)__pyx_tp_new_5pysam_11libcsamfile_AlignedRead},
|
jpayne@69
|
5714 {0, 0},
|
jpayne@69
|
5715 };
|
jpayne@69
|
5716 static PyType_Spec __pyx_type_5pysam_11libcsamfile_AlignedRead_spec = {
|
jpayne@69
|
5717 "pysam.libcsamfile.AlignedRead",
|
jpayne@69
|
5718 sizeof(struct __pyx_obj_5pysam_11libcsamfile_AlignedRead),
|
jpayne@69
|
5719 0,
|
jpayne@69
|
5720 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
|
jpayne@69
|
5721 __pyx_type_5pysam_11libcsamfile_AlignedRead_slots,
|
jpayne@69
|
5722 };
|
jpayne@69
|
5723 #else
|
jpayne@69
|
5724
|
jpayne@69
|
5725 static PyTypeObject __pyx_type_5pysam_11libcsamfile_AlignedRead = {
|
jpayne@69
|
5726 PyVarObject_HEAD_INIT(0, 0)
|
jpayne@69
|
5727 "pysam.libcsamfile.""AlignedRead", /*tp_name*/
|
jpayne@69
|
5728 sizeof(struct __pyx_obj_5pysam_11libcsamfile_AlignedRead), /*tp_basicsize*/
|
jpayne@69
|
5729 0, /*tp_itemsize*/
|
jpayne@69
|
5730 0, /*tp_dealloc*/
|
jpayne@69
|
5731 #if PY_VERSION_HEX < 0x030800b4
|
jpayne@69
|
5732 0, /*tp_print*/
|
jpayne@69
|
5733 #endif
|
jpayne@69
|
5734 #if PY_VERSION_HEX >= 0x030800b4
|
jpayne@69
|
5735 0, /*tp_vectorcall_offset*/
|
jpayne@69
|
5736 #endif
|
jpayne@69
|
5737 0, /*tp_getattr*/
|
jpayne@69
|
5738 0, /*tp_setattr*/
|
jpayne@69
|
5739 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
5740 0, /*tp_compare*/
|
jpayne@69
|
5741 #endif
|
jpayne@69
|
5742 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
5743 0, /*tp_as_async*/
|
jpayne@69
|
5744 #endif
|
jpayne@69
|
5745 0, /*tp_repr*/
|
jpayne@69
|
5746 0, /*tp_as_number*/
|
jpayne@69
|
5747 0, /*tp_as_sequence*/
|
jpayne@69
|
5748 0, /*tp_as_mapping*/
|
jpayne@69
|
5749 0, /*tp_hash*/
|
jpayne@69
|
5750 0, /*tp_call*/
|
jpayne@69
|
5751 0, /*tp_str*/
|
jpayne@69
|
5752 0, /*tp_getattro*/
|
jpayne@69
|
5753 0, /*tp_setattro*/
|
jpayne@69
|
5754 0, /*tp_as_buffer*/
|
jpayne@69
|
5755 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
|
jpayne@69
|
5756 PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignedSegment`\n\n Added for backwards compatibility with pysam <= 0.8.0\n "), /*tp_doc*/
|
jpayne@69
|
5757 __pyx_tp_traverse_5pysam_11libcsamfile_AlignedRead, /*tp_traverse*/
|
jpayne@69
|
5758 __pyx_tp_clear_5pysam_11libcsamfile_AlignedRead, /*tp_clear*/
|
jpayne@69
|
5759 0, /*tp_richcompare*/
|
jpayne@69
|
5760 0, /*tp_weaklistoffset*/
|
jpayne@69
|
5761 0, /*tp_iter*/
|
jpayne@69
|
5762 0, /*tp_iternext*/
|
jpayne@69
|
5763 __pyx_methods_5pysam_11libcsamfile_AlignedRead, /*tp_methods*/
|
jpayne@69
|
5764 0, /*tp_members*/
|
jpayne@69
|
5765 0, /*tp_getset*/
|
jpayne@69
|
5766 0, /*tp_base*/
|
jpayne@69
|
5767 0, /*tp_dict*/
|
jpayne@69
|
5768 0, /*tp_descr_get*/
|
jpayne@69
|
5769 0, /*tp_descr_set*/
|
jpayne@69
|
5770 #if !CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
5771 0, /*tp_dictoffset*/
|
jpayne@69
|
5772 #endif
|
jpayne@69
|
5773 0, /*tp_init*/
|
jpayne@69
|
5774 0, /*tp_alloc*/
|
jpayne@69
|
5775 __pyx_tp_new_5pysam_11libcsamfile_AlignedRead, /*tp_new*/
|
jpayne@69
|
5776 0, /*tp_free*/
|
jpayne@69
|
5777 0, /*tp_is_gc*/
|
jpayne@69
|
5778 0, /*tp_bases*/
|
jpayne@69
|
5779 0, /*tp_mro*/
|
jpayne@69
|
5780 0, /*tp_cache*/
|
jpayne@69
|
5781 0, /*tp_subclasses*/
|
jpayne@69
|
5782 0, /*tp_weaklist*/
|
jpayne@69
|
5783 0, /*tp_del*/
|
jpayne@69
|
5784 0, /*tp_version_tag*/
|
jpayne@69
|
5785 #if PY_VERSION_HEX >= 0x030400a1
|
jpayne@69
|
5786 #if CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
5787 0, /*tp_finalize*/
|
jpayne@69
|
5788 #else
|
jpayne@69
|
5789 NULL, /*tp_finalize*/
|
jpayne@69
|
5790 #endif
|
jpayne@69
|
5791 #endif
|
jpayne@69
|
5792 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
jpayne@69
|
5793 0, /*tp_vectorcall*/
|
jpayne@69
|
5794 #endif
|
jpayne@69
|
5795 #if __PYX_NEED_TP_PRINT_SLOT == 1
|
jpayne@69
|
5796 0, /*tp_print*/
|
jpayne@69
|
5797 #endif
|
jpayne@69
|
5798 #if PY_VERSION_HEX >= 0x030C0000
|
jpayne@69
|
5799 0, /*tp_watched*/
|
jpayne@69
|
5800 #endif
|
jpayne@69
|
5801 #if PY_VERSION_HEX >= 0x030d00A4
|
jpayne@69
|
5802 0, /*tp_versions_used*/
|
jpayne@69
|
5803 #endif
|
jpayne@69
|
5804 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
jpayne@69
|
5805 0, /*tp_pypy_flags*/
|
jpayne@69
|
5806 #endif
|
jpayne@69
|
5807 };
|
jpayne@69
|
5808 #endif
|
jpayne@69
|
5809 static struct __pyx_vtabstruct_5pysam_11libcsamfile_Samfile __pyx_vtable_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
5810
|
jpayne@69
|
5811 static PyObject *__pyx_tp_new_5pysam_11libcsamfile_Samfile(PyTypeObject *t, PyObject *a, PyObject *k) {
|
jpayne@69
|
5812 struct __pyx_obj_5pysam_11libcsamfile_Samfile *p;
|
jpayne@69
|
5813 PyObject *o = __Pyx_PyType_GetSlot(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile, tp_new, newfunc)(t, a, k);
|
jpayne@69
|
5814 if (unlikely(!o)) return 0;
|
jpayne@69
|
5815 p = ((struct __pyx_obj_5pysam_11libcsamfile_Samfile *)o);
|
jpayne@69
|
5816 p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__pyx_vtabptr_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
5817 return o;
|
jpayne@69
|
5818 }
|
jpayne@69
|
5819
|
jpayne@69
|
5820 static int __pyx_tp_traverse_5pysam_11libcsamfile_Samfile(PyObject *o, visitproc v, void *a) {
|
jpayne@69
|
5821 int e;
|
jpayne@69
|
5822 e = ((likely(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile)) ? ((__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_traverse) ? __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5pysam_11libcsamfile_Samfile)); if (e) return e;
|
jpayne@69
|
5823 return 0;
|
jpayne@69
|
5824 }
|
jpayne@69
|
5825
|
jpayne@69
|
5826 static int __pyx_tp_clear_5pysam_11libcsamfile_Samfile(PyObject *o) {
|
jpayne@69
|
5827 if (likely(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile)) { if (__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_clear) __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5pysam_11libcsamfile_Samfile);
|
jpayne@69
|
5828 return 0;
|
jpayne@69
|
5829 }
|
jpayne@69
|
5830
|
jpayne@69
|
5831 static PyMethodDef __pyx_methods_5pysam_11libcsamfile_Samfile[] = {
|
jpayne@69
|
5832 {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile___reduce_cython__},
|
jpayne@69
|
5833 {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_5pysam_11libcsamfile_7Samfile_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_5pysam_11libcsamfile_7Samfile_2__setstate_cython__},
|
jpayne@69
|
5834 {0, 0, 0, 0}
|
jpayne@69
|
5835 };
|
jpayne@69
|
5836 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
5837 static PyType_Slot __pyx_type_5pysam_11libcsamfile_Samfile_slots[] = {
|
jpayne@69
|
5838 {Py_tp_doc, (void *)PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignmentFile`\n\n Added for backwards compatibility with pysam <= 0.8.0\n ")},
|
jpayne@69
|
5839 {Py_tp_traverse, (void *)__pyx_tp_traverse_5pysam_11libcsamfile_Samfile},
|
jpayne@69
|
5840 {Py_tp_clear, (void *)__pyx_tp_clear_5pysam_11libcsamfile_Samfile},
|
jpayne@69
|
5841 {Py_tp_methods, (void *)__pyx_methods_5pysam_11libcsamfile_Samfile},
|
jpayne@69
|
5842 {Py_tp_new, (void *)__pyx_tp_new_5pysam_11libcsamfile_Samfile},
|
jpayne@69
|
5843 {0, 0},
|
jpayne@69
|
5844 };
|
jpayne@69
|
5845 static PyType_Spec __pyx_type_5pysam_11libcsamfile_Samfile_spec = {
|
jpayne@69
|
5846 "pysam.libcsamfile.Samfile",
|
jpayne@69
|
5847 sizeof(struct __pyx_obj_5pysam_11libcsamfile_Samfile),
|
jpayne@69
|
5848 0,
|
jpayne@69
|
5849 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE,
|
jpayne@69
|
5850 __pyx_type_5pysam_11libcsamfile_Samfile_slots,
|
jpayne@69
|
5851 };
|
jpayne@69
|
5852 #else
|
jpayne@69
|
5853
|
jpayne@69
|
5854 static PyTypeObject __pyx_type_5pysam_11libcsamfile_Samfile = {
|
jpayne@69
|
5855 PyVarObject_HEAD_INIT(0, 0)
|
jpayne@69
|
5856 "pysam.libcsamfile.""Samfile", /*tp_name*/
|
jpayne@69
|
5857 sizeof(struct __pyx_obj_5pysam_11libcsamfile_Samfile), /*tp_basicsize*/
|
jpayne@69
|
5858 0, /*tp_itemsize*/
|
jpayne@69
|
5859 0, /*tp_dealloc*/
|
jpayne@69
|
5860 #if PY_VERSION_HEX < 0x030800b4
|
jpayne@69
|
5861 0, /*tp_print*/
|
jpayne@69
|
5862 #endif
|
jpayne@69
|
5863 #if PY_VERSION_HEX >= 0x030800b4
|
jpayne@69
|
5864 0, /*tp_vectorcall_offset*/
|
jpayne@69
|
5865 #endif
|
jpayne@69
|
5866 0, /*tp_getattr*/
|
jpayne@69
|
5867 0, /*tp_setattr*/
|
jpayne@69
|
5868 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
5869 0, /*tp_compare*/
|
jpayne@69
|
5870 #endif
|
jpayne@69
|
5871 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
5872 0, /*tp_as_async*/
|
jpayne@69
|
5873 #endif
|
jpayne@69
|
5874 0, /*tp_repr*/
|
jpayne@69
|
5875 0, /*tp_as_number*/
|
jpayne@69
|
5876 0, /*tp_as_sequence*/
|
jpayne@69
|
5877 0, /*tp_as_mapping*/
|
jpayne@69
|
5878 0, /*tp_hash*/
|
jpayne@69
|
5879 0, /*tp_call*/
|
jpayne@69
|
5880 0, /*tp_str*/
|
jpayne@69
|
5881 0, /*tp_getattro*/
|
jpayne@69
|
5882 0, /*tp_setattro*/
|
jpayne@69
|
5883 0, /*tp_as_buffer*/
|
jpayne@69
|
5884 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
|
jpayne@69
|
5885 PyDoc_STR("Deprecated alternative for :class:`~pysam.AlignmentFile`\n\n Added for backwards compatibility with pysam <= 0.8.0\n "), /*tp_doc*/
|
jpayne@69
|
5886 __pyx_tp_traverse_5pysam_11libcsamfile_Samfile, /*tp_traverse*/
|
jpayne@69
|
5887 __pyx_tp_clear_5pysam_11libcsamfile_Samfile, /*tp_clear*/
|
jpayne@69
|
5888 0, /*tp_richcompare*/
|
jpayne@69
|
5889 0, /*tp_weaklistoffset*/
|
jpayne@69
|
5890 0, /*tp_iter*/
|
jpayne@69
|
5891 0, /*tp_iternext*/
|
jpayne@69
|
5892 __pyx_methods_5pysam_11libcsamfile_Samfile, /*tp_methods*/
|
jpayne@69
|
5893 0, /*tp_members*/
|
jpayne@69
|
5894 0, /*tp_getset*/
|
jpayne@69
|
5895 0, /*tp_base*/
|
jpayne@69
|
5896 0, /*tp_dict*/
|
jpayne@69
|
5897 0, /*tp_descr_get*/
|
jpayne@69
|
5898 0, /*tp_descr_set*/
|
jpayne@69
|
5899 #if !CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
5900 0, /*tp_dictoffset*/
|
jpayne@69
|
5901 #endif
|
jpayne@69
|
5902 0, /*tp_init*/
|
jpayne@69
|
5903 0, /*tp_alloc*/
|
jpayne@69
|
5904 __pyx_tp_new_5pysam_11libcsamfile_Samfile, /*tp_new*/
|
jpayne@69
|
5905 0, /*tp_free*/
|
jpayne@69
|
5906 0, /*tp_is_gc*/
|
jpayne@69
|
5907 0, /*tp_bases*/
|
jpayne@69
|
5908 0, /*tp_mro*/
|
jpayne@69
|
5909 0, /*tp_cache*/
|
jpayne@69
|
5910 0, /*tp_subclasses*/
|
jpayne@69
|
5911 0, /*tp_weaklist*/
|
jpayne@69
|
5912 0, /*tp_del*/
|
jpayne@69
|
5913 0, /*tp_version_tag*/
|
jpayne@69
|
5914 #if PY_VERSION_HEX >= 0x030400a1
|
jpayne@69
|
5915 #if CYTHON_USE_TP_FINALIZE
|
jpayne@69
|
5916 0, /*tp_finalize*/
|
jpayne@69
|
5917 #else
|
jpayne@69
|
5918 NULL, /*tp_finalize*/
|
jpayne@69
|
5919 #endif
|
jpayne@69
|
5920 #endif
|
jpayne@69
|
5921 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
jpayne@69
|
5922 0, /*tp_vectorcall*/
|
jpayne@69
|
5923 #endif
|
jpayne@69
|
5924 #if __PYX_NEED_TP_PRINT_SLOT == 1
|
jpayne@69
|
5925 0, /*tp_print*/
|
jpayne@69
|
5926 #endif
|
jpayne@69
|
5927 #if PY_VERSION_HEX >= 0x030C0000
|
jpayne@69
|
5928 0, /*tp_watched*/
|
jpayne@69
|
5929 #endif
|
jpayne@69
|
5930 #if PY_VERSION_HEX >= 0x030d00A4
|
jpayne@69
|
5931 0, /*tp_versions_used*/
|
jpayne@69
|
5932 #endif
|
jpayne@69
|
5933 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
jpayne@69
|
5934 0, /*tp_pypy_flags*/
|
jpayne@69
|
5935 #endif
|
jpayne@69
|
5936 };
|
jpayne@69
|
5937 #endif
|
jpayne@69
|
5938
|
jpayne@69
|
5939 static PyMethodDef __pyx_methods[] = {
|
jpayne@69
|
5940 {0, 0, 0, 0}
|
jpayne@69
|
5941 };
|
jpayne@69
|
5942 #ifndef CYTHON_SMALL_CODE
|
jpayne@69
|
5943 #if defined(__clang__)
|
jpayne@69
|
5944 #define CYTHON_SMALL_CODE
|
jpayne@69
|
5945 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
jpayne@69
|
5946 #define CYTHON_SMALL_CODE __attribute__((cold))
|
jpayne@69
|
5947 #else
|
jpayne@69
|
5948 #define CYTHON_SMALL_CODE
|
jpayne@69
|
5949 #endif
|
jpayne@69
|
5950 #endif
|
jpayne@69
|
5951 /* #### Code section: pystring_table ### */
|
jpayne@69
|
5952
|
jpayne@69
|
5953 static int __Pyx_CreateStringTabAndInitStrings(void) {
|
jpayne@69
|
5954 __Pyx_StringTabEntry __pyx_string_tab[] = {
|
jpayne@69
|
5955 {&__pyx_n_s_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 0, 1, 1},
|
jpayne@69
|
5956 {&__pyx_n_u_AlignedRead, __pyx_k_AlignedRead, sizeof(__pyx_k_AlignedRead), 0, 1, 0, 1},
|
jpayne@69
|
5957 {&__pyx_n_s_AlignedRead___reduce_cython, __pyx_k_AlignedRead___reduce_cython, sizeof(__pyx_k_AlignedRead___reduce_cython), 0, 0, 1, 1},
|
jpayne@69
|
5958 {&__pyx_n_s_AlignedRead___setstate_cython, __pyx_k_AlignedRead___setstate_cython, sizeof(__pyx_k_AlignedRead___setstate_cython), 0, 0, 1, 1},
|
jpayne@69
|
5959 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
|
jpayne@69
|
5960 {&__pyx_n_s_Samfile, __pyx_k_Samfile, sizeof(__pyx_k_Samfile), 0, 0, 1, 1},
|
jpayne@69
|
5961 {&__pyx_n_u_Samfile, __pyx_k_Samfile, sizeof(__pyx_k_Samfile), 0, 1, 0, 1},
|
jpayne@69
|
5962 {&__pyx_n_s_Samfile___reduce_cython, __pyx_k_Samfile___reduce_cython, sizeof(__pyx_k_Samfile___reduce_cython), 0, 0, 1, 1},
|
jpayne@69
|
5963 {&__pyx_n_s_Samfile___setstate_cython, __pyx_k_Samfile___setstate_cython, sizeof(__pyx_k_Samfile___setstate_cython), 0, 0, 1, 1},
|
jpayne@69
|
5964 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
|
jpayne@69
|
5965 {&__pyx_n_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 1},
|
jpayne@69
|
5966 {&__pyx_n_s__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 0, 1, 1},
|
jpayne@69
|
5967 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
|
jpayne@69
|
5968 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
|
jpayne@69
|
5969 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
|
jpayne@69
|
5970 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
|
jpayne@69
|
5971 {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
|
jpayne@69
|
5972 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
|
jpayne@69
|
5973 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
|
jpayne@69
|
5974 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
|
jpayne@69
|
5975 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
|
jpayne@69
|
5976 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
|
jpayne@69
|
5977 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
|
jpayne@69
|
5978 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
|
jpayne@69
|
5979 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
|
jpayne@69
|
5980 {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
|
jpayne@69
|
5981 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
|
jpayne@69
|
5982 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
|
jpayne@69
|
5983 {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
|
jpayne@69
|
5984 {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
|
jpayne@69
|
5985 {&__pyx_n_s_pysam_libcsamfile, __pyx_k_pysam_libcsamfile, sizeof(__pyx_k_pysam_libcsamfile), 0, 0, 1, 1},
|
jpayne@69
|
5986 {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
|
jpayne@69
|
5987 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
|
jpayne@69
|
5988 {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
|
jpayne@69
|
5989 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
|
jpayne@69
|
5990 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
|
jpayne@69
|
5991 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
|
jpayne@69
|
5992 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
|
jpayne@69
|
5993 {&__pyx_kp_s_self__delegate_cannot_be_convert, __pyx_k_self__delegate_cannot_be_convert, sizeof(__pyx_k_self__delegate_cannot_be_convert), 0, 0, 1, 0},
|
jpayne@69
|
5994 {&__pyx_kp_s_self_b_self_htsfile_self_index_c, __pyx_k_self_b_self_htsfile_self_index_c, sizeof(__pyx_k_self_b_self_htsfile_self_index_c), 0, 0, 1, 0},
|
jpayne@69
|
5995 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
|
jpayne@69
|
5996 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
|
jpayne@69
|
5997 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
|
jpayne@69
|
5998 {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
|
jpayne@69
|
5999 {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
|
jpayne@69
|
6000 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
|
jpayne@69
|
6001 {&__pyx_n_s_tempfile, __pyx_k_tempfile, sizeof(__pyx_k_tempfile), 0, 0, 1, 1},
|
jpayne@69
|
6002 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
|
jpayne@69
|
6003 {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
|
jpayne@69
|
6004 {&__pyx_n_s_warnings, __pyx_k_warnings, sizeof(__pyx_k_warnings), 0, 0, 1, 1},
|
jpayne@69
|
6005 {0, 0, 0, 0, 0, 0, 0}
|
jpayne@69
|
6006 };
|
jpayne@69
|
6007 return __Pyx_InitStrings(__pyx_string_tab);
|
jpayne@69
|
6008 }
|
jpayne@69
|
6009 /* #### Code section: cached_builtins ### */
|
jpayne@69
|
6010 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
|
jpayne@69
|
6011 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
|
jpayne@69
|
6012 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 120, __pyx_L1_error)
|
jpayne@69
|
6013 return 0;
|
jpayne@69
|
6014 __pyx_L1_error:;
|
jpayne@69
|
6015 return -1;
|
jpayne@69
|
6016 }
|
jpayne@69
|
6017 /* #### Code section: cached_constants ### */
|
jpayne@69
|
6018
|
jpayne@69
|
6019 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
jpayne@69
|
6020 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6021 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
|
jpayne@69
|
6022
|
jpayne@69
|
6023 /* "(tree fragment)":1
|
jpayne@69
|
6024 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
6025 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
6026 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
6027 */
|
jpayne@69
|
6028 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6029 __Pyx_GOTREF(__pyx_tuple__6);
|
jpayne@69
|
6030 __Pyx_GIVEREF(__pyx_tuple__6);
|
jpayne@69
|
6031 __pyx_codeobj_ = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj_)) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6032
|
jpayne@69
|
6033 /* "(tree fragment)":3
|
jpayne@69
|
6034 * def __reduce_cython__(self):
|
jpayne@69
|
6035 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
6036 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
6037 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
6038 */
|
jpayne@69
|
6039 __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6040 __Pyx_GOTREF(__pyx_tuple__7);
|
jpayne@69
|
6041 __Pyx_GIVEREF(__pyx_tuple__7);
|
jpayne@69
|
6042 __pyx_codeobj__2 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__2)) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6043
|
jpayne@69
|
6044 /* "(tree fragment)":1
|
jpayne@69
|
6045 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
6046 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
6047 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
6048 */
|
jpayne@69
|
6049 __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6050
|
jpayne@69
|
6051 /* "(tree fragment)":3
|
jpayne@69
|
6052 * def __reduce_cython__(self):
|
jpayne@69
|
6053 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
6054 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
6055 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
6056 */
|
jpayne@69
|
6057 __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6058 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6059 return 0;
|
jpayne@69
|
6060 __pyx_L1_error:;
|
jpayne@69
|
6061 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6062 return -1;
|
jpayne@69
|
6063 }
|
jpayne@69
|
6064 /* #### Code section: init_constants ### */
|
jpayne@69
|
6065
|
jpayne@69
|
6066 static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
|
jpayne@69
|
6067 if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(3, 1, __pyx_L1_error);
|
jpayne@69
|
6068 return 0;
|
jpayne@69
|
6069 __pyx_L1_error:;
|
jpayne@69
|
6070 return -1;
|
jpayne@69
|
6071 }
|
jpayne@69
|
6072 /* #### Code section: init_globals ### */
|
jpayne@69
|
6073
|
jpayne@69
|
6074 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
|
jpayne@69
|
6075 return 0;
|
jpayne@69
|
6076 }
|
jpayne@69
|
6077 /* #### Code section: init_module ### */
|
jpayne@69
|
6078
|
jpayne@69
|
6079 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
|
jpayne@69
|
6080 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
|
jpayne@69
|
6081 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
|
jpayne@69
|
6082 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
|
jpayne@69
|
6083 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
|
jpayne@69
|
6084 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
|
jpayne@69
|
6085 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
|
jpayne@69
|
6086
|
jpayne@69
|
6087 static int __Pyx_modinit_global_init_code(void) {
|
jpayne@69
|
6088 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6089 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
|
jpayne@69
|
6090 /*--- Global init code ---*/
|
jpayne@69
|
6091 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6092 return 0;
|
jpayne@69
|
6093 }
|
jpayne@69
|
6094
|
jpayne@69
|
6095 static int __Pyx_modinit_variable_export_code(void) {
|
jpayne@69
|
6096 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6097 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
|
jpayne@69
|
6098 /*--- Variable export code ---*/
|
jpayne@69
|
6099 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6100 return 0;
|
jpayne@69
|
6101 }
|
jpayne@69
|
6102
|
jpayne@69
|
6103 static int __Pyx_modinit_function_export_code(void) {
|
jpayne@69
|
6104 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6105 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
|
jpayne@69
|
6106 /*--- Function export code ---*/
|
jpayne@69
|
6107 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6108 return 0;
|
jpayne@69
|
6109 }
|
jpayne@69
|
6110
|
jpayne@69
|
6111 static int __Pyx_modinit_type_init_code(void) {
|
jpayne@69
|
6112 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6113 PyObject *__pyx_t_1 = NULL;
|
jpayne@69
|
6114 PyObject *__pyx_t_2 = NULL;
|
jpayne@69
|
6115 PyObject *__pyx_t_3 = NULL;
|
jpayne@69
|
6116 int __pyx_lineno = 0;
|
jpayne@69
|
6117 const char *__pyx_filename = NULL;
|
jpayne@69
|
6118 int __pyx_clineno = 0;
|
jpayne@69
|
6119 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
|
jpayne@69
|
6120 /*--- Type init code ---*/
|
jpayne@69
|
6121 __pyx_t_1 = PyImport_ImportModule("pysam.libcalignedsegment"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6122 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6123 __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignedsegment", "AlignedSegment", sizeof(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_18libcalignedsegment_AlignedSegment),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6124 __pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment = (struct __pyx_vtabstruct_5pysam_18libcalignedsegment_AlignedSegment*)__Pyx_GetVtable(__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment); if (unlikely(!__pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6125 __pyx_vtabptr_5pysam_11libcsamfile_AlignedRead = &__pyx_vtable_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
6126 __pyx_vtable_5pysam_11libcsamfile_AlignedRead.__pyx_base = *__pyx_vtabptr_5pysam_18libcalignedsegment_AlignedSegment;
|
jpayne@69
|
6127 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
6128 __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6129 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6130 __pyx_ptype_5pysam_11libcsamfile_AlignedRead = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_11libcsamfile_AlignedRead_spec, __pyx_t_2);
|
jpayne@69
|
6131 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6132 if (unlikely(!__pyx_ptype_5pysam_11libcsamfile_AlignedRead)) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6133 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_11libcsamfile_AlignedRead_spec, __pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6134 #else
|
jpayne@69
|
6135 __pyx_ptype_5pysam_11libcsamfile_AlignedRead = &__pyx_type_5pysam_11libcsamfile_AlignedRead;
|
jpayne@69
|
6136 #endif
|
jpayne@69
|
6137 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6138 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_dealloc = __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment->tp_dealloc;
|
jpayne@69
|
6139 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_base = __pyx_ptype_5pysam_18libcalignedsegment_AlignedSegment;
|
jpayne@69
|
6140 #endif
|
jpayne@69
|
6141 #if !CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
6142 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6143 #endif
|
jpayne@69
|
6144 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
6145 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_print = 0;
|
jpayne@69
|
6146 #endif
|
jpayne@69
|
6147 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6148 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_dictoffset && __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_getattro == PyObject_GenericGetAttr)) {
|
jpayne@69
|
6149 __pyx_ptype_5pysam_11libcsamfile_AlignedRead->tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
jpayne@69
|
6150 }
|
jpayne@69
|
6151 #endif
|
jpayne@69
|
6152 if (__Pyx_SetVtable(__pyx_ptype_5pysam_11libcsamfile_AlignedRead, __pyx_vtabptr_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6153 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6154 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6155 #endif
|
jpayne@69
|
6156 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AlignedRead, (PyObject *) __pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6157 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6158 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_11libcsamfile_AlignedRead) < 0) __PYX_ERR(3, 31, __pyx_L1_error)
|
jpayne@69
|
6159 #endif
|
jpayne@69
|
6160 __pyx_t_2 = PyImport_ImportModule("pysam.libcalignmentfile"); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6161 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6162 __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile = __Pyx_ImportType_3_0_11(__pyx_t_2, "pysam.libcalignmentfile", "AlignmentFile", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6163 __pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_AlignmentFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6164 __pyx_vtabptr_5pysam_11libcsamfile_Samfile = &__pyx_vtable_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
6165 __pyx_vtable_5pysam_11libcsamfile_Samfile.__pyx_base = *__pyx_vtabptr_5pysam_17libcalignmentfile_AlignmentFile;
|
jpayne@69
|
6166 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
6167 __pyx_t_3 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6168 __Pyx_GOTREF(__pyx_t_3);
|
jpayne@69
|
6169 __pyx_ptype_5pysam_11libcsamfile_Samfile = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_5pysam_11libcsamfile_Samfile_spec, __pyx_t_3);
|
jpayne@69
|
6170 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
|
jpayne@69
|
6171 if (unlikely(!__pyx_ptype_5pysam_11libcsamfile_Samfile)) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6172 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_5pysam_11libcsamfile_Samfile_spec, __pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6173 #else
|
jpayne@69
|
6174 __pyx_ptype_5pysam_11libcsamfile_Samfile = &__pyx_type_5pysam_11libcsamfile_Samfile;
|
jpayne@69
|
6175 #endif
|
jpayne@69
|
6176 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6177 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_dealloc = __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile->tp_dealloc;
|
jpayne@69
|
6178 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_base = __pyx_ptype_5pysam_17libcalignmentfile_AlignmentFile;
|
jpayne@69
|
6179 #endif
|
jpayne@69
|
6180 #if !CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
6181 if (__Pyx_PyType_Ready(__pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6182 #endif
|
jpayne@69
|
6183 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
6184 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_print = 0;
|
jpayne@69
|
6185 #endif
|
jpayne@69
|
6186 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6187 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_5pysam_11libcsamfile_Samfile->tp_dictoffset && __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_getattro == PyObject_GenericGetAttr)) {
|
jpayne@69
|
6188 __pyx_ptype_5pysam_11libcsamfile_Samfile->tp_getattro = __Pyx_PyObject_GenericGetAttr;
|
jpayne@69
|
6189 }
|
jpayne@69
|
6190 #endif
|
jpayne@69
|
6191 if (__Pyx_SetVtable(__pyx_ptype_5pysam_11libcsamfile_Samfile, __pyx_vtabptr_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6192 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6193 if (__Pyx_MergeVtables(__pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6194 #endif
|
jpayne@69
|
6195 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Samfile, (PyObject *) __pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6196 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6197 if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_5pysam_11libcsamfile_Samfile) < 0) __PYX_ERR(3, 23, __pyx_L1_error)
|
jpayne@69
|
6198 #endif
|
jpayne@69
|
6199 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6200 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6201 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6202 return 0;
|
jpayne@69
|
6203 __pyx_L1_error:;
|
jpayne@69
|
6204 __Pyx_XDECREF(__pyx_t_1);
|
jpayne@69
|
6205 __Pyx_XDECREF(__pyx_t_2);
|
jpayne@69
|
6206 __Pyx_XDECREF(__pyx_t_3);
|
jpayne@69
|
6207 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6208 return -1;
|
jpayne@69
|
6209 }
|
jpayne@69
|
6210
|
jpayne@69
|
6211 static int __Pyx_modinit_type_import_code(void) {
|
jpayne@69
|
6212 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6213 PyObject *__pyx_t_1 = NULL;
|
jpayne@69
|
6214 int __pyx_lineno = 0;
|
jpayne@69
|
6215 const char *__pyx_filename = NULL;
|
jpayne@69
|
6216 int __pyx_clineno = 0;
|
jpayne@69
|
6217 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
|
jpayne@69
|
6218 /*--- Type import code ---*/
|
jpayne@69
|
6219 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
|
jpayne@69
|
6220 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6221 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
|
jpayne@69
|
6222 #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
|
jpayne@69
|
6223 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
|
jpayne@69
|
6224 #elif CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6225 sizeof(PyTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyTypeObject),
|
jpayne@69
|
6226 #else
|
jpayne@69
|
6227 sizeof(PyHeapTypeObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyHeapTypeObject),
|
jpayne@69
|
6228 #endif
|
jpayne@69
|
6229 __Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
|
jpayne@69
|
6230 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6231 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
|
jpayne@69
|
6232 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6233 __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyBoolObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
|
jpayne@69
|
6234 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6235 __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
|
jpayne@69
|
6236 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6237 __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType_3_0_11(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(PyComplexObject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
|
jpayne@69
|
6238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6239 __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 69, __pyx_L1_error)
|
jpayne@69
|
6240 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6241 __pyx_ptype_7cpython_5array_array = __Pyx_ImportType_3_0_11(__pyx_t_1, "array", "array", sizeof(arrayobject), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(arrayobject),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(2, 69, __pyx_L1_error)
|
jpayne@69
|
6242 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6243 __pyx_t_1 = PyImport_ImportModule("pysam.libchtslib"); if (unlikely(!__pyx_t_1)) __PYX_ERR(7, 2706, __pyx_L1_error)
|
jpayne@69
|
6244 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6245 __pyx_ptype_5pysam_10libchtslib_HTSFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libchtslib", "HTSFile", sizeof(struct __pyx_obj_5pysam_10libchtslib_HTSFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_10libchtslib_HTSFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_10libchtslib_HTSFile) __PYX_ERR(7, 2706, __pyx_L1_error)
|
jpayne@69
|
6246 __pyx_vtabptr_5pysam_10libchtslib_HTSFile = (struct __pyx_vtabstruct_5pysam_10libchtslib_HTSFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_10libchtslib_HTSFile); if (unlikely(!__pyx_vtabptr_5pysam_10libchtslib_HTSFile)) __PYX_ERR(7, 2706, __pyx_L1_error)
|
jpayne@69
|
6247 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6248 __pyx_t_1 = PyImport_ImportModule("pysam.libcfaidx"); if (unlikely(!__pyx_t_1)) __PYX_ERR(8, 38, __pyx_L1_error)
|
jpayne@69
|
6249 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6250 __pyx_ptype_5pysam_9libcfaidx_FastaFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastaFile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastaFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastaFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastaFile) __PYX_ERR(8, 38, __pyx_L1_error)
|
jpayne@69
|
6251 __pyx_vtabptr_5pysam_9libcfaidx_FastaFile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastaFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastaFile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastaFile)) __PYX_ERR(8, 38, __pyx_L1_error)
|
jpayne@69
|
6252 __pyx_ptype_5pysam_9libcfaidx_FastqProxy = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastqProxy", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastqProxy),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastqProxy) __PYX_ERR(8, 46, __pyx_L1_error)
|
jpayne@69
|
6253 __pyx_vtabptr_5pysam_9libcfaidx_FastqProxy = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqProxy*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastqProxy); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastqProxy)) __PYX_ERR(8, 46, __pyx_L1_error)
|
jpayne@69
|
6254 __pyx_ptype_5pysam_9libcfaidx_FastxRecord = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastxRecord", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastxRecord),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastxRecord) __PYX_ERR(8, 53, __pyx_L1_error)
|
jpayne@69
|
6255 __pyx_vtabptr_5pysam_9libcfaidx_FastxRecord = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxRecord*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastxRecord); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastxRecord)) __PYX_ERR(8, 53, __pyx_L1_error)
|
jpayne@69
|
6256 __pyx_ptype_5pysam_9libcfaidx_FastxFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastxFile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastxFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastxFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastxFile) __PYX_ERR(8, 62, __pyx_L1_error)
|
jpayne@69
|
6257 __pyx_vtabptr_5pysam_9libcfaidx_FastxFile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastxFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastxFile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastxFile)) __PYX_ERR(8, 62, __pyx_L1_error)
|
jpayne@69
|
6258 __pyx_ptype_5pysam_9libcfaidx_FastqFile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "FastqFile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_FastqFile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_FastqFile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_FastqFile) __PYX_ERR(8, 74, __pyx_L1_error)
|
jpayne@69
|
6259 __pyx_vtabptr_5pysam_9libcfaidx_FastqFile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_FastqFile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_FastqFile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_FastqFile)) __PYX_ERR(8, 74, __pyx_L1_error)
|
jpayne@69
|
6260 __pyx_ptype_5pysam_9libcfaidx_Fastafile = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcfaidx", "Fastafile", sizeof(struct __pyx_obj_5pysam_9libcfaidx_Fastafile), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_9libcfaidx_Fastafile),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_9libcfaidx_Fastafile) __PYX_ERR(8, 79, __pyx_L1_error)
|
jpayne@69
|
6261 __pyx_vtabptr_5pysam_9libcfaidx_Fastafile = (struct __pyx_vtabstruct_5pysam_9libcfaidx_Fastafile*)__Pyx_GetVtable(__pyx_ptype_5pysam_9libcfaidx_Fastafile); if (unlikely(!__pyx_vtabptr_5pysam_9libcfaidx_Fastafile)) __PYX_ERR(8, 79, __pyx_L1_error)
|
jpayne@69
|
6262 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6263 __pyx_t_1 = PyImport_ImportModule("pysam.libcalignedsegment"); if (unlikely(!__pyx_t_1)) __PYX_ERR(9, 66, __pyx_L1_error)
|
jpayne@69
|
6264 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6265 __pyx_ptype_5pysam_18libcalignedsegment_PileupColumn = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignedsegment", "PileupColumn", sizeof(struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_18libcalignedsegment_PileupColumn),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_18libcalignedsegment_PileupColumn) __PYX_ERR(9, 66, __pyx_L1_error)
|
jpayne@69
|
6266 __pyx_ptype_5pysam_18libcalignedsegment_PileupRead = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignedsegment", "PileupRead", sizeof(struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_18libcalignedsegment_PileupRead),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_18libcalignedsegment_PileupRead) __PYX_ERR(9, 76, __pyx_L1_error)
|
jpayne@69
|
6267 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6268 __pyx_t_1 = PyImport_ImportModule("pysam.libcalignmentfile"); if (unlikely(!__pyx_t_1)) __PYX_ERR(10, 42, __pyx_L1_error)
|
jpayne@69
|
6269 __Pyx_GOTREF(__pyx_t_1);
|
jpayne@69
|
6270 __pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "AlignmentHeader", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_AlignmentHeader),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_AlignmentHeader) __PYX_ERR(10, 42, __pyx_L1_error)
|
jpayne@69
|
6271 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRow = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRow", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRow),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRow) __PYX_ERR(10, 62, __pyx_L1_error)
|
jpayne@69
|
6272 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowRegion", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowRegion),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion) __PYX_ERR(10, 72, __pyx_L1_error)
|
jpayne@69
|
6273 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowRegion = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowRegion); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowRegion)) __PYX_ERR(10, 72, __pyx_L1_error)
|
jpayne@69
|
6274 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowHead", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowHead),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead) __PYX_ERR(10, 78, __pyx_L1_error)
|
jpayne@69
|
6275 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowHead = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowHead*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowHead); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowHead)) __PYX_ERR(10, 78, __pyx_L1_error)
|
jpayne@69
|
6276 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowAll", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAll),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll) __PYX_ERR(10, 85, __pyx_L1_error)
|
jpayne@69
|
6277 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowAll = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowAll*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAll); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowAll)) __PYX_ERR(10, 85, __pyx_L1_error)
|
jpayne@69
|
6278 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowAllRefs", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowAllRefs),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowAllRefs) __PYX_ERR(10, 90, __pyx_L1_error)
|
jpayne@69
|
6279 __pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorRowSelection", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorRowSelection),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection) __PYX_ERR(10, 95, __pyx_L1_error)
|
jpayne@69
|
6280 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowSelection = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorRowSelection*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorRowSelection); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorRowSelection)) __PYX_ERR(10, 95, __pyx_L1_error)
|
jpayne@69
|
6281 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumn", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumn),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn) __PYX_ERR(10, 102, __pyx_L1_error)
|
jpayne@69
|
6282 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumn = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumn*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumn); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumn)) __PYX_ERR(10, 102, __pyx_L1_error)
|
jpayne@69
|
6283 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumnRegion", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnRegion),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion) __PYX_ERR(10, 134, __pyx_L1_error)
|
jpayne@69
|
6284 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnRegion = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnRegion*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnRegion); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnRegion)) __PYX_ERR(10, 134, __pyx_L1_error)
|
jpayne@69
|
6285 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumnAllRefs", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAllRefs),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs) __PYX_ERR(10, 140, __pyx_L1_error)
|
jpayne@69
|
6286 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAllRefs = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAllRefs*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAllRefs); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAllRefs)) __PYX_ERR(10, 140, __pyx_L1_error)
|
jpayne@69
|
6287 __pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IteratorColumnAll", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IteratorColumnAll),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll) __PYX_ERR(10, 144, __pyx_L1_error)
|
jpayne@69
|
6288 __pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAll = (struct __pyx_vtabstruct_5pysam_17libcalignmentfile_IteratorColumnAll*)__Pyx_GetVtable(__pyx_ptype_5pysam_17libcalignmentfile_IteratorColumnAll); if (unlikely(!__pyx_vtabptr_5pysam_17libcalignmentfile_IteratorColumnAll)) __PYX_ERR(10, 144, __pyx_L1_error)
|
jpayne@69
|
6289 __pyx_ptype_5pysam_17libcalignmentfile_IndexedReads = __Pyx_ImportType_3_0_11(__pyx_t_1, "pysam.libcalignmentfile", "IndexedReads", sizeof(struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_5pysam_17libcalignmentfile_IndexedReads),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_5pysam_17libcalignmentfile_IndexedReads) __PYX_ERR(10, 148, __pyx_L1_error)
|
jpayne@69
|
6290 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
jpayne@69
|
6291 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6292 return 0;
|
jpayne@69
|
6293 __pyx_L1_error:;
|
jpayne@69
|
6294 __Pyx_XDECREF(__pyx_t_1);
|
jpayne@69
|
6295 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6296 return -1;
|
jpayne@69
|
6297 }
|
jpayne@69
|
6298
|
jpayne@69
|
6299 static int __Pyx_modinit_variable_import_code(void) {
|
jpayne@69
|
6300 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6301 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
|
jpayne@69
|
6302 /*--- Variable import code ---*/
|
jpayne@69
|
6303 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6304 return 0;
|
jpayne@69
|
6305 }
|
jpayne@69
|
6306
|
jpayne@69
|
6307 static int __Pyx_modinit_function_import_code(void) {
|
jpayne@69
|
6308 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6309 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
|
jpayne@69
|
6310 /*--- Function import code ---*/
|
jpayne@69
|
6311 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6312 return 0;
|
jpayne@69
|
6313 }
|
jpayne@69
|
6314
|
jpayne@69
|
6315
|
jpayne@69
|
6316 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
6317 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6318 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
|
jpayne@69
|
6319 static int __pyx_pymod_exec_libcsamfile(PyObject* module); /*proto*/
|
jpayne@69
|
6320 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
|
jpayne@69
|
6321 {Py_mod_create, (void*)__pyx_pymod_create},
|
jpayne@69
|
6322 {Py_mod_exec, (void*)__pyx_pymod_exec_libcsamfile},
|
jpayne@69
|
6323 {0, NULL}
|
jpayne@69
|
6324 };
|
jpayne@69
|
6325 #endif
|
jpayne@69
|
6326
|
jpayne@69
|
6327 #ifdef __cplusplus
|
jpayne@69
|
6328 namespace {
|
jpayne@69
|
6329 struct PyModuleDef __pyx_moduledef =
|
jpayne@69
|
6330 #else
|
jpayne@69
|
6331 static struct PyModuleDef __pyx_moduledef =
|
jpayne@69
|
6332 #endif
|
jpayne@69
|
6333 {
|
jpayne@69
|
6334 PyModuleDef_HEAD_INIT,
|
jpayne@69
|
6335 "libcsamfile",
|
jpayne@69
|
6336 0, /* m_doc */
|
jpayne@69
|
6337 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6338 0, /* m_size */
|
jpayne@69
|
6339 #elif CYTHON_USE_MODULE_STATE
|
jpayne@69
|
6340 sizeof(__pyx_mstate), /* m_size */
|
jpayne@69
|
6341 #else
|
jpayne@69
|
6342 -1, /* m_size */
|
jpayne@69
|
6343 #endif
|
jpayne@69
|
6344 __pyx_methods /* m_methods */,
|
jpayne@69
|
6345 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6346 __pyx_moduledef_slots, /* m_slots */
|
jpayne@69
|
6347 #else
|
jpayne@69
|
6348 NULL, /* m_reload */
|
jpayne@69
|
6349 #endif
|
jpayne@69
|
6350 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
6351 __pyx_m_traverse, /* m_traverse */
|
jpayne@69
|
6352 __pyx_m_clear, /* m_clear */
|
jpayne@69
|
6353 NULL /* m_free */
|
jpayne@69
|
6354 #else
|
jpayne@69
|
6355 NULL, /* m_traverse */
|
jpayne@69
|
6356 NULL, /* m_clear */
|
jpayne@69
|
6357 NULL /* m_free */
|
jpayne@69
|
6358 #endif
|
jpayne@69
|
6359 };
|
jpayne@69
|
6360 #ifdef __cplusplus
|
jpayne@69
|
6361 } /* anonymous namespace */
|
jpayne@69
|
6362 #endif
|
jpayne@69
|
6363 #endif
|
jpayne@69
|
6364
|
jpayne@69
|
6365 #ifndef CYTHON_NO_PYINIT_EXPORT
|
jpayne@69
|
6366 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
|
jpayne@69
|
6367 #elif PY_MAJOR_VERSION < 3
|
jpayne@69
|
6368 #ifdef __cplusplus
|
jpayne@69
|
6369 #define __Pyx_PyMODINIT_FUNC extern "C" void
|
jpayne@69
|
6370 #else
|
jpayne@69
|
6371 #define __Pyx_PyMODINIT_FUNC void
|
jpayne@69
|
6372 #endif
|
jpayne@69
|
6373 #else
|
jpayne@69
|
6374 #ifdef __cplusplus
|
jpayne@69
|
6375 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
|
jpayne@69
|
6376 #else
|
jpayne@69
|
6377 #define __Pyx_PyMODINIT_FUNC PyObject *
|
jpayne@69
|
6378 #endif
|
jpayne@69
|
6379 #endif
|
jpayne@69
|
6380
|
jpayne@69
|
6381
|
jpayne@69
|
6382 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
6383 __Pyx_PyMODINIT_FUNC initlibcsamfile(void) CYTHON_SMALL_CODE; /*proto*/
|
jpayne@69
|
6384 __Pyx_PyMODINIT_FUNC initlibcsamfile(void)
|
jpayne@69
|
6385 #else
|
jpayne@69
|
6386 __Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void) CYTHON_SMALL_CODE; /*proto*/
|
jpayne@69
|
6387 __Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void)
|
jpayne@69
|
6388 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6389 {
|
jpayne@69
|
6390 return PyModuleDef_Init(&__pyx_moduledef);
|
jpayne@69
|
6391 }
|
jpayne@69
|
6392 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
|
jpayne@69
|
6393 #if PY_VERSION_HEX >= 0x030700A1
|
jpayne@69
|
6394 static PY_INT64_T main_interpreter_id = -1;
|
jpayne@69
|
6395 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
|
jpayne@69
|
6396 if (main_interpreter_id == -1) {
|
jpayne@69
|
6397 main_interpreter_id = current_id;
|
jpayne@69
|
6398 return (unlikely(current_id == -1)) ? -1 : 0;
|
jpayne@69
|
6399 } else if (unlikely(main_interpreter_id != current_id))
|
jpayne@69
|
6400 #else
|
jpayne@69
|
6401 static PyInterpreterState *main_interpreter = NULL;
|
jpayne@69
|
6402 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
|
jpayne@69
|
6403 if (!main_interpreter) {
|
jpayne@69
|
6404 main_interpreter = current_interpreter;
|
jpayne@69
|
6405 } else if (unlikely(main_interpreter != current_interpreter))
|
jpayne@69
|
6406 #endif
|
jpayne@69
|
6407 {
|
jpayne@69
|
6408 PyErr_SetString(
|
jpayne@69
|
6409 PyExc_ImportError,
|
jpayne@69
|
6410 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
|
jpayne@69
|
6411 return -1;
|
jpayne@69
|
6412 }
|
jpayne@69
|
6413 return 0;
|
jpayne@69
|
6414 }
|
jpayne@69
|
6415 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6416 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
|
jpayne@69
|
6417 #else
|
jpayne@69
|
6418 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
|
jpayne@69
|
6419 #endif
|
jpayne@69
|
6420 {
|
jpayne@69
|
6421 PyObject *value = PyObject_GetAttrString(spec, from_name);
|
jpayne@69
|
6422 int result = 0;
|
jpayne@69
|
6423 if (likely(value)) {
|
jpayne@69
|
6424 if (allow_none || value != Py_None) {
|
jpayne@69
|
6425 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6426 result = PyModule_AddObject(module, to_name, value);
|
jpayne@69
|
6427 #else
|
jpayne@69
|
6428 result = PyDict_SetItemString(moddict, to_name, value);
|
jpayne@69
|
6429 #endif
|
jpayne@69
|
6430 }
|
jpayne@69
|
6431 Py_DECREF(value);
|
jpayne@69
|
6432 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
jpayne@69
|
6433 PyErr_Clear();
|
jpayne@69
|
6434 } else {
|
jpayne@69
|
6435 result = -1;
|
jpayne@69
|
6436 }
|
jpayne@69
|
6437 return result;
|
jpayne@69
|
6438 }
|
jpayne@69
|
6439 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
|
jpayne@69
|
6440 PyObject *module = NULL, *moddict, *modname;
|
jpayne@69
|
6441 CYTHON_UNUSED_VAR(def);
|
jpayne@69
|
6442 if (__Pyx_check_single_interpreter())
|
jpayne@69
|
6443 return NULL;
|
jpayne@69
|
6444 if (__pyx_m)
|
jpayne@69
|
6445 return __Pyx_NewRef(__pyx_m);
|
jpayne@69
|
6446 modname = PyObject_GetAttrString(spec, "name");
|
jpayne@69
|
6447 if (unlikely(!modname)) goto bad;
|
jpayne@69
|
6448 module = PyModule_NewObject(modname);
|
jpayne@69
|
6449 Py_DECREF(modname);
|
jpayne@69
|
6450 if (unlikely(!module)) goto bad;
|
jpayne@69
|
6451 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
6452 moddict = module;
|
jpayne@69
|
6453 #else
|
jpayne@69
|
6454 moddict = PyModule_GetDict(module);
|
jpayne@69
|
6455 if (unlikely(!moddict)) goto bad;
|
jpayne@69
|
6456 #endif
|
jpayne@69
|
6457 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
|
jpayne@69
|
6458 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
|
jpayne@69
|
6459 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
|
jpayne@69
|
6460 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
|
jpayne@69
|
6461 return module;
|
jpayne@69
|
6462 bad:
|
jpayne@69
|
6463 Py_XDECREF(module);
|
jpayne@69
|
6464 return NULL;
|
jpayne@69
|
6465 }
|
jpayne@69
|
6466
|
jpayne@69
|
6467
|
jpayne@69
|
6468 static CYTHON_SMALL_CODE int __pyx_pymod_exec_libcsamfile(PyObject *__pyx_pyinit_module)
|
jpayne@69
|
6469 #endif
|
jpayne@69
|
6470 #endif
|
jpayne@69
|
6471 {
|
jpayne@69
|
6472 int stringtab_initialized = 0;
|
jpayne@69
|
6473 #if CYTHON_USE_MODULE_STATE
|
jpayne@69
|
6474 int pystate_addmodule_run = 0;
|
jpayne@69
|
6475 #endif
|
jpayne@69
|
6476 __Pyx_TraceDeclarations
|
jpayne@69
|
6477 PyObject *__pyx_t_1 = NULL;
|
jpayne@69
|
6478 PyObject *__pyx_t_2 = NULL;
|
jpayne@69
|
6479 int __pyx_lineno = 0;
|
jpayne@69
|
6480 const char *__pyx_filename = NULL;
|
jpayne@69
|
6481 int __pyx_clineno = 0;
|
jpayne@69
|
6482 __Pyx_RefNannyDeclarations
|
jpayne@69
|
6483 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6484 if (__pyx_m) {
|
jpayne@69
|
6485 if (__pyx_m == __pyx_pyinit_module) return 0;
|
jpayne@69
|
6486 PyErr_SetString(PyExc_RuntimeError, "Module 'libcsamfile' has already been imported. Re-initialisation is not supported.");
|
jpayne@69
|
6487 return -1;
|
jpayne@69
|
6488 }
|
jpayne@69
|
6489 #elif PY_MAJOR_VERSION >= 3
|
jpayne@69
|
6490 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
|
jpayne@69
|
6491 #endif
|
jpayne@69
|
6492 /*--- Module creation code ---*/
|
jpayne@69
|
6493 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6494 __pyx_m = __pyx_pyinit_module;
|
jpayne@69
|
6495 Py_INCREF(__pyx_m);
|
jpayne@69
|
6496 #else
|
jpayne@69
|
6497 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
6498 __pyx_m = Py_InitModule4("libcsamfile", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
|
jpayne@69
|
6499 if (unlikely(!__pyx_m)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6500 #elif CYTHON_USE_MODULE_STATE
|
jpayne@69
|
6501 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6502 {
|
jpayne@69
|
6503 int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
|
jpayne@69
|
6504 __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "libcsamfile" pseudovariable */
|
jpayne@69
|
6505 if (unlikely((add_module_result < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6506 pystate_addmodule_run = 1;
|
jpayne@69
|
6507 }
|
jpayne@69
|
6508 #else
|
jpayne@69
|
6509 __pyx_m = PyModule_Create(&__pyx_moduledef);
|
jpayne@69
|
6510 if (unlikely(!__pyx_m)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6511 #endif
|
jpayne@69
|
6512 #endif
|
jpayne@69
|
6513 CYTHON_UNUSED_VAR(__pyx_t_1);
|
jpayne@69
|
6514 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6515 Py_INCREF(__pyx_d);
|
jpayne@69
|
6516 __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6517 __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6518 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6519 #if CYTHON_REFNANNY
|
jpayne@69
|
6520 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
jpayne@69
|
6521 if (!__Pyx_RefNanny) {
|
jpayne@69
|
6522 PyErr_Clear();
|
jpayne@69
|
6523 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
|
jpayne@69
|
6524 if (!__Pyx_RefNanny)
|
jpayne@69
|
6525 Py_FatalError("failed to import 'refnanny' module");
|
jpayne@69
|
6526 }
|
jpayne@69
|
6527 #endif
|
jpayne@69
|
6528 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void)", 0);
|
jpayne@69
|
6529 if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6530 #ifdef __Pxy_PyFrame_Initialize_Offsets
|
jpayne@69
|
6531 __Pxy_PyFrame_Initialize_Offsets();
|
jpayne@69
|
6532 #endif
|
jpayne@69
|
6533 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6534 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6535 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6536 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
6537 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6538 #endif
|
jpayne@69
|
6539 #ifdef __Pyx_FusedFunction_USED
|
jpayne@69
|
6540 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6541 #endif
|
jpayne@69
|
6542 #ifdef __Pyx_Coroutine_USED
|
jpayne@69
|
6543 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6544 #endif
|
jpayne@69
|
6545 #ifdef __Pyx_Generator_USED
|
jpayne@69
|
6546 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6547 #endif
|
jpayne@69
|
6548 #ifdef __Pyx_AsyncGen_USED
|
jpayne@69
|
6549 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6550 #endif
|
jpayne@69
|
6551 #ifdef __Pyx_StopAsyncIteration_USED
|
jpayne@69
|
6552 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6553 #endif
|
jpayne@69
|
6554 /*--- Library function declarations ---*/
|
jpayne@69
|
6555 /*--- Threads initialization code ---*/
|
jpayne@69
|
6556 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
|
jpayne@69
|
6557 PyEval_InitThreads();
|
jpayne@69
|
6558 #endif
|
jpayne@69
|
6559 /*--- Initialize various global constants etc. ---*/
|
jpayne@69
|
6560 if (__Pyx_InitConstants() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6561 stringtab_initialized = 1;
|
jpayne@69
|
6562 if (__Pyx_InitGlobals() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6563 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
|
jpayne@69
|
6564 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6565 #endif
|
jpayne@69
|
6566 if (__pyx_module_is_main_pysam__libcsamfile) {
|
jpayne@69
|
6567 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6568 }
|
jpayne@69
|
6569 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
6570 {
|
jpayne@69
|
6571 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6572 if (!PyDict_GetItemString(modules, "pysam.libcsamfile")) {
|
jpayne@69
|
6573 if (unlikely((PyDict_SetItemString(modules, "pysam.libcsamfile", __pyx_m) < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6574 }
|
jpayne@69
|
6575 }
|
jpayne@69
|
6576 #endif
|
jpayne@69
|
6577 /*--- Builtin init code ---*/
|
jpayne@69
|
6578 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6579 /*--- Constants init code ---*/
|
jpayne@69
|
6580 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6581 /*--- Global type/function init code ---*/
|
jpayne@69
|
6582 (void)__Pyx_modinit_global_init_code();
|
jpayne@69
|
6583 (void)__Pyx_modinit_variable_export_code();
|
jpayne@69
|
6584 (void)__Pyx_modinit_function_export_code();
|
jpayne@69
|
6585 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6586 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6587 (void)__Pyx_modinit_variable_import_code();
|
jpayne@69
|
6588 (void)__Pyx_modinit_function_import_code();
|
jpayne@69
|
6589 /*--- Execution code ---*/
|
jpayne@69
|
6590 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
|
jpayne@69
|
6591 if (__Pyx_patch_abc() < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6592 #endif
|
jpayne@69
|
6593 __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_libcsamfile(void)", __pyx_f[3], 1, 0, __PYX_ERR(3, 1, __pyx_L1_error));
|
jpayne@69
|
6594
|
jpayne@69
|
6595 /* "pysam/libcsamfile.pyx":4
|
jpayne@69
|
6596 * # cython: profile=True
|
jpayne@69
|
6597 * # adds doc-strings for sphinx
|
jpayne@69
|
6598 * import tempfile # <<<<<<<<<<<<<<
|
jpayne@69
|
6599 * import os
|
jpayne@69
|
6600 * import sys
|
jpayne@69
|
6601 */
|
jpayne@69
|
6602 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_tempfile, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4, __pyx_L1_error)
|
jpayne@69
|
6603 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6604 if (PyDict_SetItem(__pyx_d, __pyx_n_s_tempfile, __pyx_t_2) < 0) __PYX_ERR(3, 4, __pyx_L1_error)
|
jpayne@69
|
6605 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6606
|
jpayne@69
|
6607 /* "pysam/libcsamfile.pyx":5
|
jpayne@69
|
6608 * # adds doc-strings for sphinx
|
jpayne@69
|
6609 * import tempfile
|
jpayne@69
|
6610 * import os # <<<<<<<<<<<<<<
|
jpayne@69
|
6611 * import sys
|
jpayne@69
|
6612 * import types
|
jpayne@69
|
6613 */
|
jpayne@69
|
6614 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5, __pyx_L1_error)
|
jpayne@69
|
6615 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6616 if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(3, 5, __pyx_L1_error)
|
jpayne@69
|
6617 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6618
|
jpayne@69
|
6619 /* "pysam/libcsamfile.pyx":6
|
jpayne@69
|
6620 * import tempfile
|
jpayne@69
|
6621 * import os
|
jpayne@69
|
6622 * import sys # <<<<<<<<<<<<<<
|
jpayne@69
|
6623 * import types
|
jpayne@69
|
6624 * import itertools
|
jpayne@69
|
6625 */
|
jpayne@69
|
6626 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6, __pyx_L1_error)
|
jpayne@69
|
6627 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6628 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) __PYX_ERR(3, 6, __pyx_L1_error)
|
jpayne@69
|
6629 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6630
|
jpayne@69
|
6631 /* "pysam/libcsamfile.pyx":7
|
jpayne@69
|
6632 * import os
|
jpayne@69
|
6633 * import sys
|
jpayne@69
|
6634 * import types # <<<<<<<<<<<<<<
|
jpayne@69
|
6635 * import itertools
|
jpayne@69
|
6636 * import struct
|
jpayne@69
|
6637 */
|
jpayne@69
|
6638 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_types, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7, __pyx_L1_error)
|
jpayne@69
|
6639 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6640 if (PyDict_SetItem(__pyx_d, __pyx_n_s_types, __pyx_t_2) < 0) __PYX_ERR(3, 7, __pyx_L1_error)
|
jpayne@69
|
6641 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6642
|
jpayne@69
|
6643 /* "pysam/libcsamfile.pyx":8
|
jpayne@69
|
6644 * import sys
|
jpayne@69
|
6645 * import types
|
jpayne@69
|
6646 * import itertools # <<<<<<<<<<<<<<
|
jpayne@69
|
6647 * import struct
|
jpayne@69
|
6648 * import ctypes
|
jpayne@69
|
6649 */
|
jpayne@69
|
6650 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_itertools, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8, __pyx_L1_error)
|
jpayne@69
|
6651 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6652 if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_2) < 0) __PYX_ERR(3, 8, __pyx_L1_error)
|
jpayne@69
|
6653 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6654
|
jpayne@69
|
6655 /* "pysam/libcsamfile.pyx":9
|
jpayne@69
|
6656 * import types
|
jpayne@69
|
6657 * import itertools
|
jpayne@69
|
6658 * import struct # <<<<<<<<<<<<<<
|
jpayne@69
|
6659 * import ctypes
|
jpayne@69
|
6660 * import collections
|
jpayne@69
|
6661 */
|
jpayne@69
|
6662 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_struct, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9, __pyx_L1_error)
|
jpayne@69
|
6663 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6664 if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_2) < 0) __PYX_ERR(3, 9, __pyx_L1_error)
|
jpayne@69
|
6665 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6666
|
jpayne@69
|
6667 /* "pysam/libcsamfile.pyx":10
|
jpayne@69
|
6668 * import itertools
|
jpayne@69
|
6669 * import struct
|
jpayne@69
|
6670 * import ctypes # <<<<<<<<<<<<<<
|
jpayne@69
|
6671 * import collections
|
jpayne@69
|
6672 * import re
|
jpayne@69
|
6673 */
|
jpayne@69
|
6674 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_ctypes, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10, __pyx_L1_error)
|
jpayne@69
|
6675 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6676 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ctypes, __pyx_t_2) < 0) __PYX_ERR(3, 10, __pyx_L1_error)
|
jpayne@69
|
6677 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6678
|
jpayne@69
|
6679 /* "pysam/libcsamfile.pyx":11
|
jpayne@69
|
6680 * import struct
|
jpayne@69
|
6681 * import ctypes
|
jpayne@69
|
6682 * import collections # <<<<<<<<<<<<<<
|
jpayne@69
|
6683 * import re
|
jpayne@69
|
6684 * import platform
|
jpayne@69
|
6685 */
|
jpayne@69
|
6686 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_collections, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 11, __pyx_L1_error)
|
jpayne@69
|
6687 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6688 if (PyDict_SetItem(__pyx_d, __pyx_n_s_collections, __pyx_t_2) < 0) __PYX_ERR(3, 11, __pyx_L1_error)
|
jpayne@69
|
6689 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6690
|
jpayne@69
|
6691 /* "pysam/libcsamfile.pyx":12
|
jpayne@69
|
6692 * import ctypes
|
jpayne@69
|
6693 * import collections
|
jpayne@69
|
6694 * import re # <<<<<<<<<<<<<<
|
jpayne@69
|
6695 * import platform
|
jpayne@69
|
6696 * import warnings
|
jpayne@69
|
6697 */
|
jpayne@69
|
6698 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_re, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 12, __pyx_L1_error)
|
jpayne@69
|
6699 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6700 if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_2) < 0) __PYX_ERR(3, 12, __pyx_L1_error)
|
jpayne@69
|
6701 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6702
|
jpayne@69
|
6703 /* "pysam/libcsamfile.pyx":13
|
jpayne@69
|
6704 * import collections
|
jpayne@69
|
6705 * import re
|
jpayne@69
|
6706 * import platform # <<<<<<<<<<<<<<
|
jpayne@69
|
6707 * import warnings
|
jpayne@69
|
6708 * from cpython cimport PyErr_SetString, \
|
jpayne@69
|
6709 */
|
jpayne@69
|
6710 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_platform, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 13, __pyx_L1_error)
|
jpayne@69
|
6711 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6712 if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_2) < 0) __PYX_ERR(3, 13, __pyx_L1_error)
|
jpayne@69
|
6713 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6714
|
jpayne@69
|
6715 /* "pysam/libcsamfile.pyx":14
|
jpayne@69
|
6716 * import re
|
jpayne@69
|
6717 * import platform
|
jpayne@69
|
6718 * import warnings # <<<<<<<<<<<<<<
|
jpayne@69
|
6719 * from cpython cimport PyErr_SetString, \
|
jpayne@69
|
6720 * PyBytes_Check, \
|
jpayne@69
|
6721 */
|
jpayne@69
|
6722 __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_n_s_warnings, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 14, __pyx_L1_error)
|
jpayne@69
|
6723 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6724 if (PyDict_SetItem(__pyx_d, __pyx_n_s_warnings, __pyx_t_2) < 0) __PYX_ERR(3, 14, __pyx_L1_error)
|
jpayne@69
|
6725 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6726
|
jpayne@69
|
6727 /* "(tree fragment)":1
|
jpayne@69
|
6728 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
6729 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
6730 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
6731 */
|
jpayne@69
|
6732 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_7Samfile_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Samfile___reduce_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj_)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6733 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6734 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6735 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6736
|
jpayne@69
|
6737 /* "(tree fragment)":3
|
jpayne@69
|
6738 * def __reduce_cython__(self):
|
jpayne@69
|
6739 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
6740 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
6741 * raise TypeError, "self.b,self.htsfile,self.index cannot be converted to a Python object for pickling"
|
jpayne@69
|
6742 */
|
jpayne@69
|
6743 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_7Samfile_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Samfile___setstate_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj__2)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6744 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6745 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6746 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6747
|
jpayne@69
|
6748 /* "(tree fragment)":1
|
jpayne@69
|
6749 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
|
jpayne@69
|
6750 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
6751 * def __setstate_cython__(self, __pyx_state):
|
jpayne@69
|
6752 */
|
jpayne@69
|
6753 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_11AlignedRead_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AlignedRead___reduce_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6754 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6755 if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
jpayne@69
|
6756 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6757
|
jpayne@69
|
6758 /* "(tree fragment)":3
|
jpayne@69
|
6759 * def __reduce_cython__(self):
|
jpayne@69
|
6760 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
6761 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
|
jpayne@69
|
6762 * raise TypeError, "self._delegate cannot be converted to a Python object for pickling"
|
jpayne@69
|
6763 */
|
jpayne@69
|
6764 __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5pysam_11libcsamfile_11AlignedRead_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AlignedRead___setstate_cython, NULL, __pyx_n_s_pysam_libcsamfile, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6765 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6766 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
|
jpayne@69
|
6767 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6768
|
jpayne@69
|
6769 /* "pysam/libcsamfile.pyx":39
|
jpayne@69
|
6770 *
|
jpayne@69
|
6771 *
|
jpayne@69
|
6772 * __all__ = ['Samfile', 'AlignedRead'] # <<<<<<<<<<<<<<
|
jpayne@69
|
6773 *
|
jpayne@69
|
6774 *
|
jpayne@69
|
6775 */
|
jpayne@69
|
6776 __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 39, __pyx_L1_error)
|
jpayne@69
|
6777 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6778 __Pyx_INCREF(__pyx_n_u_Samfile);
|
jpayne@69
|
6779 __Pyx_GIVEREF(__pyx_n_u_Samfile);
|
jpayne@69
|
6780 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_Samfile)) __PYX_ERR(3, 39, __pyx_L1_error);
|
jpayne@69
|
6781 __Pyx_INCREF(__pyx_n_u_AlignedRead);
|
jpayne@69
|
6782 __Pyx_GIVEREF(__pyx_n_u_AlignedRead);
|
jpayne@69
|
6783 if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_u_AlignedRead)) __PYX_ERR(3, 39, __pyx_L1_error);
|
jpayne@69
|
6784 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_2) < 0) __PYX_ERR(3, 39, __pyx_L1_error)
|
jpayne@69
|
6785 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6786
|
jpayne@69
|
6787 /* "pysam/libcsamfile.pyx":1
|
jpayne@69
|
6788 * # cython: embedsignature=True # <<<<<<<<<<<<<<
|
jpayne@69
|
6789 * # cython: profile=True
|
jpayne@69
|
6790 * # adds doc-strings for sphinx
|
jpayne@69
|
6791 */
|
jpayne@69
|
6792 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6793 __Pyx_GOTREF(__pyx_t_2);
|
jpayne@69
|
6794 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(3, 1, __pyx_L1_error)
|
jpayne@69
|
6795 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
jpayne@69
|
6796 __Pyx_TraceReturn(Py_None, 0);
|
jpayne@69
|
6797
|
jpayne@69
|
6798 /*--- Wrapped vars code ---*/
|
jpayne@69
|
6799
|
jpayne@69
|
6800 goto __pyx_L0;
|
jpayne@69
|
6801 __pyx_L1_error:;
|
jpayne@69
|
6802 __Pyx_XDECREF(__pyx_t_2);
|
jpayne@69
|
6803 if (__pyx_m) {
|
jpayne@69
|
6804 if (__pyx_d && stringtab_initialized) {
|
jpayne@69
|
6805 __Pyx_AddTraceback("init pysam.libcsamfile", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
jpayne@69
|
6806 }
|
jpayne@69
|
6807 #if !CYTHON_USE_MODULE_STATE
|
jpayne@69
|
6808 Py_CLEAR(__pyx_m);
|
jpayne@69
|
6809 #else
|
jpayne@69
|
6810 Py_DECREF(__pyx_m);
|
jpayne@69
|
6811 if (pystate_addmodule_run) {
|
jpayne@69
|
6812 PyObject *tp, *value, *tb;
|
jpayne@69
|
6813 PyErr_Fetch(&tp, &value, &tb);
|
jpayne@69
|
6814 PyState_RemoveModule(&__pyx_moduledef);
|
jpayne@69
|
6815 PyErr_Restore(tp, value, tb);
|
jpayne@69
|
6816 }
|
jpayne@69
|
6817 #endif
|
jpayne@69
|
6818 } else if (!PyErr_Occurred()) {
|
jpayne@69
|
6819 PyErr_SetString(PyExc_ImportError, "init pysam.libcsamfile");
|
jpayne@69
|
6820 }
|
jpayne@69
|
6821 __pyx_L0:;
|
jpayne@69
|
6822 __Pyx_RefNannyFinishContext();
|
jpayne@69
|
6823 #if CYTHON_PEP489_MULTI_PHASE_INIT
|
jpayne@69
|
6824 return (__pyx_m != NULL) ? 0 : -1;
|
jpayne@69
|
6825 #elif PY_MAJOR_VERSION >= 3
|
jpayne@69
|
6826 return __pyx_m;
|
jpayne@69
|
6827 #else
|
jpayne@69
|
6828 return;
|
jpayne@69
|
6829 #endif
|
jpayne@69
|
6830 }
|
jpayne@69
|
6831 /* #### Code section: cleanup_globals ### */
|
jpayne@69
|
6832 /* #### Code section: cleanup_module ### */
|
jpayne@69
|
6833 /* #### Code section: main_method ### */
|
jpayne@69
|
6834 /* #### Code section: utility_code_pragmas ### */
|
jpayne@69
|
6835 #ifdef _MSC_VER
|
jpayne@69
|
6836 #pragma warning( push )
|
jpayne@69
|
6837 /* Warning 4127: conditional expression is constant
|
jpayne@69
|
6838 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
|
jpayne@69
|
6839 * compile-time, so this warning is not useful
|
jpayne@69
|
6840 */
|
jpayne@69
|
6841 #pragma warning( disable : 4127 )
|
jpayne@69
|
6842 #endif
|
jpayne@69
|
6843
|
jpayne@69
|
6844
|
jpayne@69
|
6845
|
jpayne@69
|
6846 /* #### Code section: utility_code_def ### */
|
jpayne@69
|
6847
|
jpayne@69
|
6848 /* --- Runtime support code --- */
|
jpayne@69
|
6849 /* Refnanny */
|
jpayne@69
|
6850 #if CYTHON_REFNANNY
|
jpayne@69
|
6851 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
|
jpayne@69
|
6852 PyObject *m = NULL, *p = NULL;
|
jpayne@69
|
6853 void *r = NULL;
|
jpayne@69
|
6854 m = PyImport_ImportModule(modname);
|
jpayne@69
|
6855 if (!m) goto end;
|
jpayne@69
|
6856 p = PyObject_GetAttrString(m, "RefNannyAPI");
|
jpayne@69
|
6857 if (!p) goto end;
|
jpayne@69
|
6858 r = PyLong_AsVoidPtr(p);
|
jpayne@69
|
6859 end:
|
jpayne@69
|
6860 Py_XDECREF(p);
|
jpayne@69
|
6861 Py_XDECREF(m);
|
jpayne@69
|
6862 return (__Pyx_RefNannyAPIStruct *)r;
|
jpayne@69
|
6863 }
|
jpayne@69
|
6864 #endif
|
jpayne@69
|
6865
|
jpayne@69
|
6866 /* PyErrExceptionMatches */
|
jpayne@69
|
6867 #if CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
6868 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
|
jpayne@69
|
6869 Py_ssize_t i, n;
|
jpayne@69
|
6870 n = PyTuple_GET_SIZE(tuple);
|
jpayne@69
|
6871 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
6872 for (i=0; i<n; i++) {
|
jpayne@69
|
6873 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
|
jpayne@69
|
6874 }
|
jpayne@69
|
6875 #endif
|
jpayne@69
|
6876 for (i=0; i<n; i++) {
|
jpayne@69
|
6877 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
|
jpayne@69
|
6878 }
|
jpayne@69
|
6879 return 0;
|
jpayne@69
|
6880 }
|
jpayne@69
|
6881 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
|
jpayne@69
|
6882 int result;
|
jpayne@69
|
6883 PyObject *exc_type;
|
jpayne@69
|
6884 #if PY_VERSION_HEX >= 0x030C00A6
|
jpayne@69
|
6885 PyObject *current_exception = tstate->current_exception;
|
jpayne@69
|
6886 if (unlikely(!current_exception)) return 0;
|
jpayne@69
|
6887 exc_type = (PyObject*) Py_TYPE(current_exception);
|
jpayne@69
|
6888 if (exc_type == err) return 1;
|
jpayne@69
|
6889 #else
|
jpayne@69
|
6890 exc_type = tstate->curexc_type;
|
jpayne@69
|
6891 if (exc_type == err) return 1;
|
jpayne@69
|
6892 if (unlikely(!exc_type)) return 0;
|
jpayne@69
|
6893 #endif
|
jpayne@69
|
6894 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
6895 Py_INCREF(exc_type);
|
jpayne@69
|
6896 #endif
|
jpayne@69
|
6897 if (unlikely(PyTuple_Check(err))) {
|
jpayne@69
|
6898 result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
|
jpayne@69
|
6899 } else {
|
jpayne@69
|
6900 result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
|
jpayne@69
|
6901 }
|
jpayne@69
|
6902 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
6903 Py_DECREF(exc_type);
|
jpayne@69
|
6904 #endif
|
jpayne@69
|
6905 return result;
|
jpayne@69
|
6906 }
|
jpayne@69
|
6907 #endif
|
jpayne@69
|
6908
|
jpayne@69
|
6909 /* PyErrFetchRestore */
|
jpayne@69
|
6910 #if CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
6911 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
|
jpayne@69
|
6912 #if PY_VERSION_HEX >= 0x030C00A6
|
jpayne@69
|
6913 PyObject *tmp_value;
|
jpayne@69
|
6914 assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
|
jpayne@69
|
6915 if (value) {
|
jpayne@69
|
6916 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
6917 if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
|
jpayne@69
|
6918 #endif
|
jpayne@69
|
6919 PyException_SetTraceback(value, tb);
|
jpayne@69
|
6920 }
|
jpayne@69
|
6921 tmp_value = tstate->current_exception;
|
jpayne@69
|
6922 tstate->current_exception = value;
|
jpayne@69
|
6923 Py_XDECREF(tmp_value);
|
jpayne@69
|
6924 Py_XDECREF(type);
|
jpayne@69
|
6925 Py_XDECREF(tb);
|
jpayne@69
|
6926 #else
|
jpayne@69
|
6927 PyObject *tmp_type, *tmp_value, *tmp_tb;
|
jpayne@69
|
6928 tmp_type = tstate->curexc_type;
|
jpayne@69
|
6929 tmp_value = tstate->curexc_value;
|
jpayne@69
|
6930 tmp_tb = tstate->curexc_traceback;
|
jpayne@69
|
6931 tstate->curexc_type = type;
|
jpayne@69
|
6932 tstate->curexc_value = value;
|
jpayne@69
|
6933 tstate->curexc_traceback = tb;
|
jpayne@69
|
6934 Py_XDECREF(tmp_type);
|
jpayne@69
|
6935 Py_XDECREF(tmp_value);
|
jpayne@69
|
6936 Py_XDECREF(tmp_tb);
|
jpayne@69
|
6937 #endif
|
jpayne@69
|
6938 }
|
jpayne@69
|
6939 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
jpayne@69
|
6940 #if PY_VERSION_HEX >= 0x030C00A6
|
jpayne@69
|
6941 PyObject* exc_value;
|
jpayne@69
|
6942 exc_value = tstate->current_exception;
|
jpayne@69
|
6943 tstate->current_exception = 0;
|
jpayne@69
|
6944 *value = exc_value;
|
jpayne@69
|
6945 *type = NULL;
|
jpayne@69
|
6946 *tb = NULL;
|
jpayne@69
|
6947 if (exc_value) {
|
jpayne@69
|
6948 *type = (PyObject*) Py_TYPE(exc_value);
|
jpayne@69
|
6949 Py_INCREF(*type);
|
jpayne@69
|
6950 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
6951 *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
|
jpayne@69
|
6952 Py_XINCREF(*tb);
|
jpayne@69
|
6953 #else
|
jpayne@69
|
6954 *tb = PyException_GetTraceback(exc_value);
|
jpayne@69
|
6955 #endif
|
jpayne@69
|
6956 }
|
jpayne@69
|
6957 #else
|
jpayne@69
|
6958 *type = tstate->curexc_type;
|
jpayne@69
|
6959 *value = tstate->curexc_value;
|
jpayne@69
|
6960 *tb = tstate->curexc_traceback;
|
jpayne@69
|
6961 tstate->curexc_type = 0;
|
jpayne@69
|
6962 tstate->curexc_value = 0;
|
jpayne@69
|
6963 tstate->curexc_traceback = 0;
|
jpayne@69
|
6964 #endif
|
jpayne@69
|
6965 }
|
jpayne@69
|
6966 #endif
|
jpayne@69
|
6967
|
jpayne@69
|
6968 /* PyObjectGetAttrStr */
|
jpayne@69
|
6969 #if CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
6970 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
|
jpayne@69
|
6971 PyTypeObject* tp = Py_TYPE(obj);
|
jpayne@69
|
6972 if (likely(tp->tp_getattro))
|
jpayne@69
|
6973 return tp->tp_getattro(obj, attr_name);
|
jpayne@69
|
6974 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
6975 if (likely(tp->tp_getattr))
|
jpayne@69
|
6976 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
|
jpayne@69
|
6977 #endif
|
jpayne@69
|
6978 return PyObject_GetAttr(obj, attr_name);
|
jpayne@69
|
6979 }
|
jpayne@69
|
6980 #endif
|
jpayne@69
|
6981
|
jpayne@69
|
6982 /* PyObjectGetAttrStrNoError */
|
jpayne@69
|
6983 #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
|
jpayne@69
|
6984 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
|
jpayne@69
|
6985 __Pyx_PyThreadState_declare
|
jpayne@69
|
6986 __Pyx_PyThreadState_assign
|
jpayne@69
|
6987 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
|
jpayne@69
|
6988 __Pyx_PyErr_Clear();
|
jpayne@69
|
6989 }
|
jpayne@69
|
6990 #endif
|
jpayne@69
|
6991 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
|
jpayne@69
|
6992 PyObject *result;
|
jpayne@69
|
6993 #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
|
jpayne@69
|
6994 (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
|
jpayne@69
|
6995 return result;
|
jpayne@69
|
6996 #else
|
jpayne@69
|
6997 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
|
jpayne@69
|
6998 PyTypeObject* tp = Py_TYPE(obj);
|
jpayne@69
|
6999 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
|
jpayne@69
|
7000 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
|
jpayne@69
|
7001 }
|
jpayne@69
|
7002 #endif
|
jpayne@69
|
7003 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
|
jpayne@69
|
7004 if (unlikely(!result)) {
|
jpayne@69
|
7005 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
|
jpayne@69
|
7006 }
|
jpayne@69
|
7007 return result;
|
jpayne@69
|
7008 #endif
|
jpayne@69
|
7009 }
|
jpayne@69
|
7010
|
jpayne@69
|
7011 /* GetBuiltinName */
|
jpayne@69
|
7012 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
|
jpayne@69
|
7013 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
|
jpayne@69
|
7014 if (unlikely(!result) && !PyErr_Occurred()) {
|
jpayne@69
|
7015 PyErr_Format(PyExc_NameError,
|
jpayne@69
|
7016 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
7017 "name '%U' is not defined", name);
|
jpayne@69
|
7018 #else
|
jpayne@69
|
7019 "name '%.200s' is not defined", PyString_AS_STRING(name));
|
jpayne@69
|
7020 #endif
|
jpayne@69
|
7021 }
|
jpayne@69
|
7022 return result;
|
jpayne@69
|
7023 }
|
jpayne@69
|
7024
|
jpayne@69
|
7025 /* TupleAndListFromArray */
|
jpayne@69
|
7026 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
7027 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
|
jpayne@69
|
7028 PyObject *v;
|
jpayne@69
|
7029 Py_ssize_t i;
|
jpayne@69
|
7030 for (i = 0; i < length; i++) {
|
jpayne@69
|
7031 v = dest[i] = src[i];
|
jpayne@69
|
7032 Py_INCREF(v);
|
jpayne@69
|
7033 }
|
jpayne@69
|
7034 }
|
jpayne@69
|
7035 static CYTHON_INLINE PyObject *
|
jpayne@69
|
7036 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
|
jpayne@69
|
7037 {
|
jpayne@69
|
7038 PyObject *res;
|
jpayne@69
|
7039 if (n <= 0) {
|
jpayne@69
|
7040 Py_INCREF(__pyx_empty_tuple);
|
jpayne@69
|
7041 return __pyx_empty_tuple;
|
jpayne@69
|
7042 }
|
jpayne@69
|
7043 res = PyTuple_New(n);
|
jpayne@69
|
7044 if (unlikely(res == NULL)) return NULL;
|
jpayne@69
|
7045 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
|
jpayne@69
|
7046 return res;
|
jpayne@69
|
7047 }
|
jpayne@69
|
7048 static CYTHON_INLINE PyObject *
|
jpayne@69
|
7049 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
|
jpayne@69
|
7050 {
|
jpayne@69
|
7051 PyObject *res;
|
jpayne@69
|
7052 if (n <= 0) {
|
jpayne@69
|
7053 return PyList_New(0);
|
jpayne@69
|
7054 }
|
jpayne@69
|
7055 res = PyList_New(n);
|
jpayne@69
|
7056 if (unlikely(res == NULL)) return NULL;
|
jpayne@69
|
7057 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
|
jpayne@69
|
7058 return res;
|
jpayne@69
|
7059 }
|
jpayne@69
|
7060 #endif
|
jpayne@69
|
7061
|
jpayne@69
|
7062 /* BytesEquals */
|
jpayne@69
|
7063 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
|
jpayne@69
|
7064 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
7065 return PyObject_RichCompareBool(s1, s2, equals);
|
jpayne@69
|
7066 #else
|
jpayne@69
|
7067 if (s1 == s2) {
|
jpayne@69
|
7068 return (equals == Py_EQ);
|
jpayne@69
|
7069 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
|
jpayne@69
|
7070 const char *ps1, *ps2;
|
jpayne@69
|
7071 Py_ssize_t length = PyBytes_GET_SIZE(s1);
|
jpayne@69
|
7072 if (length != PyBytes_GET_SIZE(s2))
|
jpayne@69
|
7073 return (equals == Py_NE);
|
jpayne@69
|
7074 ps1 = PyBytes_AS_STRING(s1);
|
jpayne@69
|
7075 ps2 = PyBytes_AS_STRING(s2);
|
jpayne@69
|
7076 if (ps1[0] != ps2[0]) {
|
jpayne@69
|
7077 return (equals == Py_NE);
|
jpayne@69
|
7078 } else if (length == 1) {
|
jpayne@69
|
7079 return (equals == Py_EQ);
|
jpayne@69
|
7080 } else {
|
jpayne@69
|
7081 int result;
|
jpayne@69
|
7082 #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
|
jpayne@69
|
7083 Py_hash_t hash1, hash2;
|
jpayne@69
|
7084 hash1 = ((PyBytesObject*)s1)->ob_shash;
|
jpayne@69
|
7085 hash2 = ((PyBytesObject*)s2)->ob_shash;
|
jpayne@69
|
7086 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
|
jpayne@69
|
7087 return (equals == Py_NE);
|
jpayne@69
|
7088 }
|
jpayne@69
|
7089 #endif
|
jpayne@69
|
7090 result = memcmp(ps1, ps2, (size_t)length);
|
jpayne@69
|
7091 return (equals == Py_EQ) ? (result == 0) : (result != 0);
|
jpayne@69
|
7092 }
|
jpayne@69
|
7093 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
|
jpayne@69
|
7094 return (equals == Py_NE);
|
jpayne@69
|
7095 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
|
jpayne@69
|
7096 return (equals == Py_NE);
|
jpayne@69
|
7097 } else {
|
jpayne@69
|
7098 int result;
|
jpayne@69
|
7099 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
|
jpayne@69
|
7100 if (!py_result)
|
jpayne@69
|
7101 return -1;
|
jpayne@69
|
7102 result = __Pyx_PyObject_IsTrue(py_result);
|
jpayne@69
|
7103 Py_DECREF(py_result);
|
jpayne@69
|
7104 return result;
|
jpayne@69
|
7105 }
|
jpayne@69
|
7106 #endif
|
jpayne@69
|
7107 }
|
jpayne@69
|
7108
|
jpayne@69
|
7109 /* UnicodeEquals */
|
jpayne@69
|
7110 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
|
jpayne@69
|
7111 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
7112 return PyObject_RichCompareBool(s1, s2, equals);
|
jpayne@69
|
7113 #else
|
jpayne@69
|
7114 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7115 PyObject* owned_ref = NULL;
|
jpayne@69
|
7116 #endif
|
jpayne@69
|
7117 int s1_is_unicode, s2_is_unicode;
|
jpayne@69
|
7118 if (s1 == s2) {
|
jpayne@69
|
7119 goto return_eq;
|
jpayne@69
|
7120 }
|
jpayne@69
|
7121 s1_is_unicode = PyUnicode_CheckExact(s1);
|
jpayne@69
|
7122 s2_is_unicode = PyUnicode_CheckExact(s2);
|
jpayne@69
|
7123 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7124 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
|
jpayne@69
|
7125 owned_ref = PyUnicode_FromObject(s2);
|
jpayne@69
|
7126 if (unlikely(!owned_ref))
|
jpayne@69
|
7127 return -1;
|
jpayne@69
|
7128 s2 = owned_ref;
|
jpayne@69
|
7129 s2_is_unicode = 1;
|
jpayne@69
|
7130 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
|
jpayne@69
|
7131 owned_ref = PyUnicode_FromObject(s1);
|
jpayne@69
|
7132 if (unlikely(!owned_ref))
|
jpayne@69
|
7133 return -1;
|
jpayne@69
|
7134 s1 = owned_ref;
|
jpayne@69
|
7135 s1_is_unicode = 1;
|
jpayne@69
|
7136 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
|
jpayne@69
|
7137 return __Pyx_PyBytes_Equals(s1, s2, equals);
|
jpayne@69
|
7138 }
|
jpayne@69
|
7139 #endif
|
jpayne@69
|
7140 if (s1_is_unicode & s2_is_unicode) {
|
jpayne@69
|
7141 Py_ssize_t length;
|
jpayne@69
|
7142 int kind;
|
jpayne@69
|
7143 void *data1, *data2;
|
jpayne@69
|
7144 if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
|
jpayne@69
|
7145 return -1;
|
jpayne@69
|
7146 length = __Pyx_PyUnicode_GET_LENGTH(s1);
|
jpayne@69
|
7147 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
|
jpayne@69
|
7148 goto return_ne;
|
jpayne@69
|
7149 }
|
jpayne@69
|
7150 #if CYTHON_USE_UNICODE_INTERNALS
|
jpayne@69
|
7151 {
|
jpayne@69
|
7152 Py_hash_t hash1, hash2;
|
jpayne@69
|
7153 #if CYTHON_PEP393_ENABLED
|
jpayne@69
|
7154 hash1 = ((PyASCIIObject*)s1)->hash;
|
jpayne@69
|
7155 hash2 = ((PyASCIIObject*)s2)->hash;
|
jpayne@69
|
7156 #else
|
jpayne@69
|
7157 hash1 = ((PyUnicodeObject*)s1)->hash;
|
jpayne@69
|
7158 hash2 = ((PyUnicodeObject*)s2)->hash;
|
jpayne@69
|
7159 #endif
|
jpayne@69
|
7160 if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
|
jpayne@69
|
7161 goto return_ne;
|
jpayne@69
|
7162 }
|
jpayne@69
|
7163 }
|
jpayne@69
|
7164 #endif
|
jpayne@69
|
7165 kind = __Pyx_PyUnicode_KIND(s1);
|
jpayne@69
|
7166 if (kind != __Pyx_PyUnicode_KIND(s2)) {
|
jpayne@69
|
7167 goto return_ne;
|
jpayne@69
|
7168 }
|
jpayne@69
|
7169 data1 = __Pyx_PyUnicode_DATA(s1);
|
jpayne@69
|
7170 data2 = __Pyx_PyUnicode_DATA(s2);
|
jpayne@69
|
7171 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
|
jpayne@69
|
7172 goto return_ne;
|
jpayne@69
|
7173 } else if (length == 1) {
|
jpayne@69
|
7174 goto return_eq;
|
jpayne@69
|
7175 } else {
|
jpayne@69
|
7176 int result = memcmp(data1, data2, (size_t)(length * kind));
|
jpayne@69
|
7177 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7178 Py_XDECREF(owned_ref);
|
jpayne@69
|
7179 #endif
|
jpayne@69
|
7180 return (equals == Py_EQ) ? (result == 0) : (result != 0);
|
jpayne@69
|
7181 }
|
jpayne@69
|
7182 } else if ((s1 == Py_None) & s2_is_unicode) {
|
jpayne@69
|
7183 goto return_ne;
|
jpayne@69
|
7184 } else if ((s2 == Py_None) & s1_is_unicode) {
|
jpayne@69
|
7185 goto return_ne;
|
jpayne@69
|
7186 } else {
|
jpayne@69
|
7187 int result;
|
jpayne@69
|
7188 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
|
jpayne@69
|
7189 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7190 Py_XDECREF(owned_ref);
|
jpayne@69
|
7191 #endif
|
jpayne@69
|
7192 if (!py_result)
|
jpayne@69
|
7193 return -1;
|
jpayne@69
|
7194 result = __Pyx_PyObject_IsTrue(py_result);
|
jpayne@69
|
7195 Py_DECREF(py_result);
|
jpayne@69
|
7196 return result;
|
jpayne@69
|
7197 }
|
jpayne@69
|
7198 return_eq:
|
jpayne@69
|
7199 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7200 Py_XDECREF(owned_ref);
|
jpayne@69
|
7201 #endif
|
jpayne@69
|
7202 return (equals == Py_EQ);
|
jpayne@69
|
7203 return_ne:
|
jpayne@69
|
7204 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7205 Py_XDECREF(owned_ref);
|
jpayne@69
|
7206 #endif
|
jpayne@69
|
7207 return (equals == Py_NE);
|
jpayne@69
|
7208 #endif
|
jpayne@69
|
7209 }
|
jpayne@69
|
7210
|
jpayne@69
|
7211 /* fastcall */
|
jpayne@69
|
7212 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
7213 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
|
jpayne@69
|
7214 {
|
jpayne@69
|
7215 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
|
jpayne@69
|
7216 for (i = 0; i < n; i++)
|
jpayne@69
|
7217 {
|
jpayne@69
|
7218 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
|
jpayne@69
|
7219 }
|
jpayne@69
|
7220 for (i = 0; i < n; i++)
|
jpayne@69
|
7221 {
|
jpayne@69
|
7222 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
|
jpayne@69
|
7223 if (unlikely(eq != 0)) {
|
jpayne@69
|
7224 if (unlikely(eq < 0)) return NULL;
|
jpayne@69
|
7225 return kwvalues[i];
|
jpayne@69
|
7226 }
|
jpayne@69
|
7227 }
|
jpayne@69
|
7228 return NULL;
|
jpayne@69
|
7229 }
|
jpayne@69
|
7230 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
|
jpayne@69
|
7231 CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
|
jpayne@69
|
7232 Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
|
jpayne@69
|
7233 PyObject *dict;
|
jpayne@69
|
7234 dict = PyDict_New();
|
jpayne@69
|
7235 if (unlikely(!dict))
|
jpayne@69
|
7236 return NULL;
|
jpayne@69
|
7237 for (i=0; i<nkwargs; i++) {
|
jpayne@69
|
7238 PyObject *key = PyTuple_GET_ITEM(kwnames, i);
|
jpayne@69
|
7239 if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
|
jpayne@69
|
7240 goto bad;
|
jpayne@69
|
7241 }
|
jpayne@69
|
7242 return dict;
|
jpayne@69
|
7243 bad:
|
jpayne@69
|
7244 Py_DECREF(dict);
|
jpayne@69
|
7245 return NULL;
|
jpayne@69
|
7246 }
|
jpayne@69
|
7247 #endif
|
jpayne@69
|
7248 #endif
|
jpayne@69
|
7249
|
jpayne@69
|
7250 /* RaiseArgTupleInvalid */
|
jpayne@69
|
7251 static void __Pyx_RaiseArgtupleInvalid(
|
jpayne@69
|
7252 const char* func_name,
|
jpayne@69
|
7253 int exact,
|
jpayne@69
|
7254 Py_ssize_t num_min,
|
jpayne@69
|
7255 Py_ssize_t num_max,
|
jpayne@69
|
7256 Py_ssize_t num_found)
|
jpayne@69
|
7257 {
|
jpayne@69
|
7258 Py_ssize_t num_expected;
|
jpayne@69
|
7259 const char *more_or_less;
|
jpayne@69
|
7260 if (num_found < num_min) {
|
jpayne@69
|
7261 num_expected = num_min;
|
jpayne@69
|
7262 more_or_less = "at least";
|
jpayne@69
|
7263 } else {
|
jpayne@69
|
7264 num_expected = num_max;
|
jpayne@69
|
7265 more_or_less = "at most";
|
jpayne@69
|
7266 }
|
jpayne@69
|
7267 if (exact) {
|
jpayne@69
|
7268 more_or_less = "exactly";
|
jpayne@69
|
7269 }
|
jpayne@69
|
7270 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7271 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
7272 func_name, more_or_less, num_expected,
|
jpayne@69
|
7273 (num_expected == 1) ? "" : "s", num_found);
|
jpayne@69
|
7274 }
|
jpayne@69
|
7275
|
jpayne@69
|
7276 /* KeywordStringCheck */
|
jpayne@69
|
7277 static int __Pyx_CheckKeywordStrings(
|
jpayne@69
|
7278 PyObject *kw,
|
jpayne@69
|
7279 const char* function_name,
|
jpayne@69
|
7280 int kw_allowed)
|
jpayne@69
|
7281 {
|
jpayne@69
|
7282 PyObject* key = 0;
|
jpayne@69
|
7283 Py_ssize_t pos = 0;
|
jpayne@69
|
7284 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
7285 if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
|
jpayne@69
|
7286 goto invalid_keyword;
|
jpayne@69
|
7287 return 1;
|
jpayne@69
|
7288 #else
|
jpayne@69
|
7289 if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
|
jpayne@69
|
7290 Py_ssize_t kwsize;
|
jpayne@69
|
7291 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
7292 kwsize = PyTuple_GET_SIZE(kw);
|
jpayne@69
|
7293 #else
|
jpayne@69
|
7294 kwsize = PyTuple_Size(kw);
|
jpayne@69
|
7295 if (kwsize < 0) return 0;
|
jpayne@69
|
7296 #endif
|
jpayne@69
|
7297 if (unlikely(kwsize == 0))
|
jpayne@69
|
7298 return 1;
|
jpayne@69
|
7299 if (!kw_allowed) {
|
jpayne@69
|
7300 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
7301 key = PyTuple_GET_ITEM(kw, 0);
|
jpayne@69
|
7302 #else
|
jpayne@69
|
7303 key = PyTuple_GetItem(kw, pos);
|
jpayne@69
|
7304 if (!key) return 0;
|
jpayne@69
|
7305 #endif
|
jpayne@69
|
7306 goto invalid_keyword;
|
jpayne@69
|
7307 }
|
jpayne@69
|
7308 #if PY_VERSION_HEX < 0x03090000
|
jpayne@69
|
7309 for (pos = 0; pos < kwsize; pos++) {
|
jpayne@69
|
7310 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
7311 key = PyTuple_GET_ITEM(kw, pos);
|
jpayne@69
|
7312 #else
|
jpayne@69
|
7313 key = PyTuple_GetItem(kw, pos);
|
jpayne@69
|
7314 if (!key) return 0;
|
jpayne@69
|
7315 #endif
|
jpayne@69
|
7316 if (unlikely(!PyUnicode_Check(key)))
|
jpayne@69
|
7317 goto invalid_keyword_type;
|
jpayne@69
|
7318 }
|
jpayne@69
|
7319 #endif
|
jpayne@69
|
7320 return 1;
|
jpayne@69
|
7321 }
|
jpayne@69
|
7322 while (PyDict_Next(kw, &pos, &key, 0)) {
|
jpayne@69
|
7323 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7324 if (unlikely(!PyString_Check(key)))
|
jpayne@69
|
7325 #endif
|
jpayne@69
|
7326 if (unlikely(!PyUnicode_Check(key)))
|
jpayne@69
|
7327 goto invalid_keyword_type;
|
jpayne@69
|
7328 }
|
jpayne@69
|
7329 if (!kw_allowed && unlikely(key))
|
jpayne@69
|
7330 goto invalid_keyword;
|
jpayne@69
|
7331 return 1;
|
jpayne@69
|
7332 invalid_keyword_type:
|
jpayne@69
|
7333 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7334 "%.200s() keywords must be strings", function_name);
|
jpayne@69
|
7335 return 0;
|
jpayne@69
|
7336 #endif
|
jpayne@69
|
7337 invalid_keyword:
|
jpayne@69
|
7338 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7339 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7340 "%.200s() got an unexpected keyword argument '%.200s'",
|
jpayne@69
|
7341 function_name, PyString_AsString(key));
|
jpayne@69
|
7342 #else
|
jpayne@69
|
7343 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7344 "%s() got an unexpected keyword argument '%U'",
|
jpayne@69
|
7345 function_name, key);
|
jpayne@69
|
7346 #endif
|
jpayne@69
|
7347 return 0;
|
jpayne@69
|
7348 }
|
jpayne@69
|
7349
|
jpayne@69
|
7350 /* Profile */
|
jpayne@69
|
7351 #if CYTHON_PROFILE
|
jpayne@69
|
7352 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
|
jpayne@69
|
7353 PyFrameObject** frame,
|
jpayne@69
|
7354 PyThreadState* tstate,
|
jpayne@69
|
7355 const char *funcname,
|
jpayne@69
|
7356 const char *srcfile,
|
jpayne@69
|
7357 int firstlineno) {
|
jpayne@69
|
7358 PyObject *type, *value, *traceback;
|
jpayne@69
|
7359 int retval;
|
jpayne@69
|
7360 if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
|
jpayne@69
|
7361 if (*code == NULL) {
|
jpayne@69
|
7362 *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
|
jpayne@69
|
7363 if (*code == NULL) return 0;
|
jpayne@69
|
7364 }
|
jpayne@69
|
7365 *frame = PyFrame_New(
|
jpayne@69
|
7366 tstate, /*PyThreadState *tstate*/
|
jpayne@69
|
7367 *code, /*PyCodeObject *code*/
|
jpayne@69
|
7368 __pyx_d, /*PyObject *globals*/
|
jpayne@69
|
7369 0 /*PyObject *locals*/
|
jpayne@69
|
7370 );
|
jpayne@69
|
7371 if (*frame == NULL) return 0;
|
jpayne@69
|
7372 if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
|
jpayne@69
|
7373 Py_INCREF(Py_None);
|
jpayne@69
|
7374 (*frame)->f_trace = Py_None;
|
jpayne@69
|
7375 }
|
jpayne@69
|
7376 #if PY_VERSION_HEX < 0x030400B1
|
jpayne@69
|
7377 } else {
|
jpayne@69
|
7378 (*frame)->f_tstate = tstate;
|
jpayne@69
|
7379 #endif
|
jpayne@69
|
7380 }
|
jpayne@69
|
7381 __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
|
jpayne@69
|
7382 retval = 1;
|
jpayne@69
|
7383 __Pyx_EnterTracing(tstate);
|
jpayne@69
|
7384 __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
|
jpayne@69
|
7385 #if CYTHON_TRACE
|
jpayne@69
|
7386 if (tstate->c_tracefunc)
|
jpayne@69
|
7387 retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
|
jpayne@69
|
7388 if (retval && tstate->c_profilefunc)
|
jpayne@69
|
7389 #endif
|
jpayne@69
|
7390 retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
|
jpayne@69
|
7391 __Pyx_LeaveTracing(tstate);
|
jpayne@69
|
7392 if (retval) {
|
jpayne@69
|
7393 __Pyx_ErrRestoreInState(tstate, type, value, traceback);
|
jpayne@69
|
7394 return __Pyx_IsTracing(tstate, 0, 0) && retval;
|
jpayne@69
|
7395 } else {
|
jpayne@69
|
7396 Py_XDECREF(type);
|
jpayne@69
|
7397 Py_XDECREF(value);
|
jpayne@69
|
7398 Py_XDECREF(traceback);
|
jpayne@69
|
7399 return -1;
|
jpayne@69
|
7400 }
|
jpayne@69
|
7401 }
|
jpayne@69
|
7402 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
|
jpayne@69
|
7403 PyCodeObject *py_code = 0;
|
jpayne@69
|
7404 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
7405 py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
|
jpayne@69
|
7406 if (likely(py_code)) {
|
jpayne@69
|
7407 py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
|
jpayne@69
|
7408 }
|
jpayne@69
|
7409 #else
|
jpayne@69
|
7410 PyObject *py_srcfile = 0;
|
jpayne@69
|
7411 PyObject *py_funcname = 0;
|
jpayne@69
|
7412 py_funcname = PyString_FromString(funcname);
|
jpayne@69
|
7413 if (unlikely(!py_funcname)) goto bad;
|
jpayne@69
|
7414 py_srcfile = PyString_FromString(srcfile);
|
jpayne@69
|
7415 if (unlikely(!py_srcfile)) goto bad;
|
jpayne@69
|
7416 py_code = PyCode_New(
|
jpayne@69
|
7417 0,
|
jpayne@69
|
7418 0,
|
jpayne@69
|
7419 0,
|
jpayne@69
|
7420 CO_OPTIMIZED | CO_NEWLOCALS,
|
jpayne@69
|
7421 __pyx_empty_bytes, /*PyObject *code,*/
|
jpayne@69
|
7422 __pyx_empty_tuple, /*PyObject *consts,*/
|
jpayne@69
|
7423 __pyx_empty_tuple, /*PyObject *names,*/
|
jpayne@69
|
7424 __pyx_empty_tuple, /*PyObject *varnames,*/
|
jpayne@69
|
7425 __pyx_empty_tuple, /*PyObject *freevars,*/
|
jpayne@69
|
7426 __pyx_empty_tuple, /*PyObject *cellvars,*/
|
jpayne@69
|
7427 py_srcfile, /*PyObject *filename,*/
|
jpayne@69
|
7428 py_funcname, /*PyObject *name,*/
|
jpayne@69
|
7429 firstlineno,
|
jpayne@69
|
7430 __pyx_empty_bytes /*PyObject *lnotab*/
|
jpayne@69
|
7431 );
|
jpayne@69
|
7432 bad:
|
jpayne@69
|
7433 Py_XDECREF(py_srcfile);
|
jpayne@69
|
7434 Py_XDECREF(py_funcname);
|
jpayne@69
|
7435 #endif
|
jpayne@69
|
7436 return py_code;
|
jpayne@69
|
7437 }
|
jpayne@69
|
7438 #endif
|
jpayne@69
|
7439
|
jpayne@69
|
7440 /* RaiseException */
|
jpayne@69
|
7441 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7442 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
jpayne@69
|
7443 __Pyx_PyThreadState_declare
|
jpayne@69
|
7444 CYTHON_UNUSED_VAR(cause);
|
jpayne@69
|
7445 Py_XINCREF(type);
|
jpayne@69
|
7446 if (!value || value == Py_None)
|
jpayne@69
|
7447 value = NULL;
|
jpayne@69
|
7448 else
|
jpayne@69
|
7449 Py_INCREF(value);
|
jpayne@69
|
7450 if (!tb || tb == Py_None)
|
jpayne@69
|
7451 tb = NULL;
|
jpayne@69
|
7452 else {
|
jpayne@69
|
7453 Py_INCREF(tb);
|
jpayne@69
|
7454 if (!PyTraceBack_Check(tb)) {
|
jpayne@69
|
7455 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7456 "raise: arg 3 must be a traceback or None");
|
jpayne@69
|
7457 goto raise_error;
|
jpayne@69
|
7458 }
|
jpayne@69
|
7459 }
|
jpayne@69
|
7460 if (PyType_Check(type)) {
|
jpayne@69
|
7461 #if CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
7462 if (!value) {
|
jpayne@69
|
7463 Py_INCREF(Py_None);
|
jpayne@69
|
7464 value = Py_None;
|
jpayne@69
|
7465 }
|
jpayne@69
|
7466 #endif
|
jpayne@69
|
7467 PyErr_NormalizeException(&type, &value, &tb);
|
jpayne@69
|
7468 } else {
|
jpayne@69
|
7469 if (value) {
|
jpayne@69
|
7470 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7471 "instance exception may not have a separate value");
|
jpayne@69
|
7472 goto raise_error;
|
jpayne@69
|
7473 }
|
jpayne@69
|
7474 value = type;
|
jpayne@69
|
7475 type = (PyObject*) Py_TYPE(type);
|
jpayne@69
|
7476 Py_INCREF(type);
|
jpayne@69
|
7477 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
|
jpayne@69
|
7478 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7479 "raise: exception class must be a subclass of BaseException");
|
jpayne@69
|
7480 goto raise_error;
|
jpayne@69
|
7481 }
|
jpayne@69
|
7482 }
|
jpayne@69
|
7483 __Pyx_PyThreadState_assign
|
jpayne@69
|
7484 __Pyx_ErrRestore(type, value, tb);
|
jpayne@69
|
7485 return;
|
jpayne@69
|
7486 raise_error:
|
jpayne@69
|
7487 Py_XDECREF(value);
|
jpayne@69
|
7488 Py_XDECREF(type);
|
jpayne@69
|
7489 Py_XDECREF(tb);
|
jpayne@69
|
7490 return;
|
jpayne@69
|
7491 }
|
jpayne@69
|
7492 #else
|
jpayne@69
|
7493 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
jpayne@69
|
7494 PyObject* owned_instance = NULL;
|
jpayne@69
|
7495 if (tb == Py_None) {
|
jpayne@69
|
7496 tb = 0;
|
jpayne@69
|
7497 } else if (tb && !PyTraceBack_Check(tb)) {
|
jpayne@69
|
7498 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7499 "raise: arg 3 must be a traceback or None");
|
jpayne@69
|
7500 goto bad;
|
jpayne@69
|
7501 }
|
jpayne@69
|
7502 if (value == Py_None)
|
jpayne@69
|
7503 value = 0;
|
jpayne@69
|
7504 if (PyExceptionInstance_Check(type)) {
|
jpayne@69
|
7505 if (value) {
|
jpayne@69
|
7506 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7507 "instance exception may not have a separate value");
|
jpayne@69
|
7508 goto bad;
|
jpayne@69
|
7509 }
|
jpayne@69
|
7510 value = type;
|
jpayne@69
|
7511 type = (PyObject*) Py_TYPE(value);
|
jpayne@69
|
7512 } else if (PyExceptionClass_Check(type)) {
|
jpayne@69
|
7513 PyObject *instance_class = NULL;
|
jpayne@69
|
7514 if (value && PyExceptionInstance_Check(value)) {
|
jpayne@69
|
7515 instance_class = (PyObject*) Py_TYPE(value);
|
jpayne@69
|
7516 if (instance_class != type) {
|
jpayne@69
|
7517 int is_subclass = PyObject_IsSubclass(instance_class, type);
|
jpayne@69
|
7518 if (!is_subclass) {
|
jpayne@69
|
7519 instance_class = NULL;
|
jpayne@69
|
7520 } else if (unlikely(is_subclass == -1)) {
|
jpayne@69
|
7521 goto bad;
|
jpayne@69
|
7522 } else {
|
jpayne@69
|
7523 type = instance_class;
|
jpayne@69
|
7524 }
|
jpayne@69
|
7525 }
|
jpayne@69
|
7526 }
|
jpayne@69
|
7527 if (!instance_class) {
|
jpayne@69
|
7528 PyObject *args;
|
jpayne@69
|
7529 if (!value)
|
jpayne@69
|
7530 args = PyTuple_New(0);
|
jpayne@69
|
7531 else if (PyTuple_Check(value)) {
|
jpayne@69
|
7532 Py_INCREF(value);
|
jpayne@69
|
7533 args = value;
|
jpayne@69
|
7534 } else
|
jpayne@69
|
7535 args = PyTuple_Pack(1, value);
|
jpayne@69
|
7536 if (!args)
|
jpayne@69
|
7537 goto bad;
|
jpayne@69
|
7538 owned_instance = PyObject_Call(type, args, NULL);
|
jpayne@69
|
7539 Py_DECREF(args);
|
jpayne@69
|
7540 if (!owned_instance)
|
jpayne@69
|
7541 goto bad;
|
jpayne@69
|
7542 value = owned_instance;
|
jpayne@69
|
7543 if (!PyExceptionInstance_Check(value)) {
|
jpayne@69
|
7544 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7545 "calling %R should have returned an instance of "
|
jpayne@69
|
7546 "BaseException, not %R",
|
jpayne@69
|
7547 type, Py_TYPE(value));
|
jpayne@69
|
7548 goto bad;
|
jpayne@69
|
7549 }
|
jpayne@69
|
7550 }
|
jpayne@69
|
7551 } else {
|
jpayne@69
|
7552 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7553 "raise: exception class must be a subclass of BaseException");
|
jpayne@69
|
7554 goto bad;
|
jpayne@69
|
7555 }
|
jpayne@69
|
7556 if (cause) {
|
jpayne@69
|
7557 PyObject *fixed_cause;
|
jpayne@69
|
7558 if (cause == Py_None) {
|
jpayne@69
|
7559 fixed_cause = NULL;
|
jpayne@69
|
7560 } else if (PyExceptionClass_Check(cause)) {
|
jpayne@69
|
7561 fixed_cause = PyObject_CallObject(cause, NULL);
|
jpayne@69
|
7562 if (fixed_cause == NULL)
|
jpayne@69
|
7563 goto bad;
|
jpayne@69
|
7564 } else if (PyExceptionInstance_Check(cause)) {
|
jpayne@69
|
7565 fixed_cause = cause;
|
jpayne@69
|
7566 Py_INCREF(fixed_cause);
|
jpayne@69
|
7567 } else {
|
jpayne@69
|
7568 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
7569 "exception causes must derive from "
|
jpayne@69
|
7570 "BaseException");
|
jpayne@69
|
7571 goto bad;
|
jpayne@69
|
7572 }
|
jpayne@69
|
7573 PyException_SetCause(value, fixed_cause);
|
jpayne@69
|
7574 }
|
jpayne@69
|
7575 PyErr_SetObject(type, value);
|
jpayne@69
|
7576 if (tb) {
|
jpayne@69
|
7577 #if PY_VERSION_HEX >= 0x030C00A6
|
jpayne@69
|
7578 PyException_SetTraceback(value, tb);
|
jpayne@69
|
7579 #elif CYTHON_FAST_THREAD_STATE
|
jpayne@69
|
7580 PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
jpayne@69
|
7581 PyObject* tmp_tb = tstate->curexc_traceback;
|
jpayne@69
|
7582 if (tb != tmp_tb) {
|
jpayne@69
|
7583 Py_INCREF(tb);
|
jpayne@69
|
7584 tstate->curexc_traceback = tb;
|
jpayne@69
|
7585 Py_XDECREF(tmp_tb);
|
jpayne@69
|
7586 }
|
jpayne@69
|
7587 #else
|
jpayne@69
|
7588 PyObject *tmp_type, *tmp_value, *tmp_tb;
|
jpayne@69
|
7589 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
|
jpayne@69
|
7590 Py_INCREF(tb);
|
jpayne@69
|
7591 PyErr_Restore(tmp_type, tmp_value, tb);
|
jpayne@69
|
7592 Py_XDECREF(tmp_tb);
|
jpayne@69
|
7593 #endif
|
jpayne@69
|
7594 }
|
jpayne@69
|
7595 bad:
|
jpayne@69
|
7596 Py_XDECREF(owned_instance);
|
jpayne@69
|
7597 return;
|
jpayne@69
|
7598 }
|
jpayne@69
|
7599 #endif
|
jpayne@69
|
7600
|
jpayne@69
|
7601 /* RaiseDoubleKeywords */
|
jpayne@69
|
7602 static void __Pyx_RaiseDoubleKeywordsError(
|
jpayne@69
|
7603 const char* func_name,
|
jpayne@69
|
7604 PyObject* kw_name)
|
jpayne@69
|
7605 {
|
jpayne@69
|
7606 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7607 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
7608 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
|
jpayne@69
|
7609 #else
|
jpayne@69
|
7610 "%s() got multiple values for keyword argument '%s'", func_name,
|
jpayne@69
|
7611 PyString_AsString(kw_name));
|
jpayne@69
|
7612 #endif
|
jpayne@69
|
7613 }
|
jpayne@69
|
7614
|
jpayne@69
|
7615 /* ParseKeywords */
|
jpayne@69
|
7616 static int __Pyx_ParseOptionalKeywords(
|
jpayne@69
|
7617 PyObject *kwds,
|
jpayne@69
|
7618 PyObject *const *kwvalues,
|
jpayne@69
|
7619 PyObject **argnames[],
|
jpayne@69
|
7620 PyObject *kwds2,
|
jpayne@69
|
7621 PyObject *values[],
|
jpayne@69
|
7622 Py_ssize_t num_pos_args,
|
jpayne@69
|
7623 const char* function_name)
|
jpayne@69
|
7624 {
|
jpayne@69
|
7625 PyObject *key = 0, *value = 0;
|
jpayne@69
|
7626 Py_ssize_t pos = 0;
|
jpayne@69
|
7627 PyObject*** name;
|
jpayne@69
|
7628 PyObject*** first_kw_arg = argnames + num_pos_args;
|
jpayne@69
|
7629 int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
|
jpayne@69
|
7630 while (1) {
|
jpayne@69
|
7631 Py_XDECREF(key); key = NULL;
|
jpayne@69
|
7632 Py_XDECREF(value); value = NULL;
|
jpayne@69
|
7633 if (kwds_is_tuple) {
|
jpayne@69
|
7634 Py_ssize_t size;
|
jpayne@69
|
7635 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
7636 size = PyTuple_GET_SIZE(kwds);
|
jpayne@69
|
7637 #else
|
jpayne@69
|
7638 size = PyTuple_Size(kwds);
|
jpayne@69
|
7639 if (size < 0) goto bad;
|
jpayne@69
|
7640 #endif
|
jpayne@69
|
7641 if (pos >= size) break;
|
jpayne@69
|
7642 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
7643 key = __Pyx_PySequence_ITEM(kwds, pos);
|
jpayne@69
|
7644 if (!key) goto bad;
|
jpayne@69
|
7645 #elif CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
7646 key = PyTuple_GET_ITEM(kwds, pos);
|
jpayne@69
|
7647 #else
|
jpayne@69
|
7648 key = PyTuple_GetItem(kwds, pos);
|
jpayne@69
|
7649 if (!key) goto bad;
|
jpayne@69
|
7650 #endif
|
jpayne@69
|
7651 value = kwvalues[pos];
|
jpayne@69
|
7652 pos++;
|
jpayne@69
|
7653 }
|
jpayne@69
|
7654 else
|
jpayne@69
|
7655 {
|
jpayne@69
|
7656 if (!PyDict_Next(kwds, &pos, &key, &value)) break;
|
jpayne@69
|
7657 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
7658 Py_INCREF(key);
|
jpayne@69
|
7659 #endif
|
jpayne@69
|
7660 }
|
jpayne@69
|
7661 name = first_kw_arg;
|
jpayne@69
|
7662 while (*name && (**name != key)) name++;
|
jpayne@69
|
7663 if (*name) {
|
jpayne@69
|
7664 values[name-argnames] = value;
|
jpayne@69
|
7665 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
7666 Py_INCREF(value);
|
jpayne@69
|
7667 Py_DECREF(key);
|
jpayne@69
|
7668 #endif
|
jpayne@69
|
7669 key = NULL;
|
jpayne@69
|
7670 value = NULL;
|
jpayne@69
|
7671 continue;
|
jpayne@69
|
7672 }
|
jpayne@69
|
7673 #if !CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
7674 Py_INCREF(key);
|
jpayne@69
|
7675 #endif
|
jpayne@69
|
7676 Py_INCREF(value);
|
jpayne@69
|
7677 name = first_kw_arg;
|
jpayne@69
|
7678 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7679 if (likely(PyString_Check(key))) {
|
jpayne@69
|
7680 while (*name) {
|
jpayne@69
|
7681 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
|
jpayne@69
|
7682 && _PyString_Eq(**name, key)) {
|
jpayne@69
|
7683 values[name-argnames] = value;
|
jpayne@69
|
7684 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
7685 value = NULL;
|
jpayne@69
|
7686 #endif
|
jpayne@69
|
7687 break;
|
jpayne@69
|
7688 }
|
jpayne@69
|
7689 name++;
|
jpayne@69
|
7690 }
|
jpayne@69
|
7691 if (*name) continue;
|
jpayne@69
|
7692 else {
|
jpayne@69
|
7693 PyObject*** argname = argnames;
|
jpayne@69
|
7694 while (argname != first_kw_arg) {
|
jpayne@69
|
7695 if ((**argname == key) || (
|
jpayne@69
|
7696 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
|
jpayne@69
|
7697 && _PyString_Eq(**argname, key))) {
|
jpayne@69
|
7698 goto arg_passed_twice;
|
jpayne@69
|
7699 }
|
jpayne@69
|
7700 argname++;
|
jpayne@69
|
7701 }
|
jpayne@69
|
7702 }
|
jpayne@69
|
7703 } else
|
jpayne@69
|
7704 #endif
|
jpayne@69
|
7705 if (likely(PyUnicode_Check(key))) {
|
jpayne@69
|
7706 while (*name) {
|
jpayne@69
|
7707 int cmp = (
|
jpayne@69
|
7708 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
jpayne@69
|
7709 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
|
jpayne@69
|
7710 #endif
|
jpayne@69
|
7711 PyUnicode_Compare(**name, key)
|
jpayne@69
|
7712 );
|
jpayne@69
|
7713 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
|
jpayne@69
|
7714 if (cmp == 0) {
|
jpayne@69
|
7715 values[name-argnames] = value;
|
jpayne@69
|
7716 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
7717 value = NULL;
|
jpayne@69
|
7718 #endif
|
jpayne@69
|
7719 break;
|
jpayne@69
|
7720 }
|
jpayne@69
|
7721 name++;
|
jpayne@69
|
7722 }
|
jpayne@69
|
7723 if (*name) continue;
|
jpayne@69
|
7724 else {
|
jpayne@69
|
7725 PyObject*** argname = argnames;
|
jpayne@69
|
7726 while (argname != first_kw_arg) {
|
jpayne@69
|
7727 int cmp = (**argname == key) ? 0 :
|
jpayne@69
|
7728 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
jpayne@69
|
7729 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
|
jpayne@69
|
7730 #endif
|
jpayne@69
|
7731 PyUnicode_Compare(**argname, key);
|
jpayne@69
|
7732 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
|
jpayne@69
|
7733 if (cmp == 0) goto arg_passed_twice;
|
jpayne@69
|
7734 argname++;
|
jpayne@69
|
7735 }
|
jpayne@69
|
7736 }
|
jpayne@69
|
7737 } else
|
jpayne@69
|
7738 goto invalid_keyword_type;
|
jpayne@69
|
7739 if (kwds2) {
|
jpayne@69
|
7740 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
|
jpayne@69
|
7741 } else {
|
jpayne@69
|
7742 goto invalid_keyword;
|
jpayne@69
|
7743 }
|
jpayne@69
|
7744 }
|
jpayne@69
|
7745 Py_XDECREF(key);
|
jpayne@69
|
7746 Py_XDECREF(value);
|
jpayne@69
|
7747 return 0;
|
jpayne@69
|
7748 arg_passed_twice:
|
jpayne@69
|
7749 __Pyx_RaiseDoubleKeywordsError(function_name, key);
|
jpayne@69
|
7750 goto bad;
|
jpayne@69
|
7751 invalid_keyword_type:
|
jpayne@69
|
7752 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7753 "%.200s() keywords must be strings", function_name);
|
jpayne@69
|
7754 goto bad;
|
jpayne@69
|
7755 invalid_keyword:
|
jpayne@69
|
7756 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
7757 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7758 "%.200s() got an unexpected keyword argument '%.200s'",
|
jpayne@69
|
7759 function_name, PyString_AsString(key));
|
jpayne@69
|
7760 #else
|
jpayne@69
|
7761 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7762 "%s() got an unexpected keyword argument '%U'",
|
jpayne@69
|
7763 function_name, key);
|
jpayne@69
|
7764 #endif
|
jpayne@69
|
7765 bad:
|
jpayne@69
|
7766 Py_XDECREF(key);
|
jpayne@69
|
7767 Py_XDECREF(value);
|
jpayne@69
|
7768 return -1;
|
jpayne@69
|
7769 }
|
jpayne@69
|
7770
|
jpayne@69
|
7771 /* CallNextTpTraverse */
|
jpayne@69
|
7772 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
|
jpayne@69
|
7773 PyTypeObject* type = Py_TYPE(obj);
|
jpayne@69
|
7774 traverseproc tp_traverse = NULL;
|
jpayne@69
|
7775 while (type && __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc) != current_tp_traverse)
|
jpayne@69
|
7776 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
|
jpayne@69
|
7777 while (type && (tp_traverse = __Pyx_PyType_GetSlot(type, tp_traverse, traverseproc)) == current_tp_traverse)
|
jpayne@69
|
7778 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
|
jpayne@69
|
7779 if (type && tp_traverse)
|
jpayne@69
|
7780 return tp_traverse(obj, v, a);
|
jpayne@69
|
7781 return 0;
|
jpayne@69
|
7782 }
|
jpayne@69
|
7783
|
jpayne@69
|
7784 /* CallNextTpClear */
|
jpayne@69
|
7785 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
|
jpayne@69
|
7786 PyTypeObject* type = Py_TYPE(obj);
|
jpayne@69
|
7787 inquiry tp_clear = NULL;
|
jpayne@69
|
7788 while (type && __Pyx_PyType_GetSlot(type, tp_clear, inquiry) != current_tp_clear)
|
jpayne@69
|
7789 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
|
jpayne@69
|
7790 while (type && (tp_clear = __Pyx_PyType_GetSlot(type, tp_clear, inquiry)) == current_tp_clear)
|
jpayne@69
|
7791 type = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
|
jpayne@69
|
7792 if (type && tp_clear)
|
jpayne@69
|
7793 tp_clear(obj);
|
jpayne@69
|
7794 }
|
jpayne@69
|
7795
|
jpayne@69
|
7796 /* TypeImport */
|
jpayne@69
|
7797 #ifndef __PYX_HAVE_RT_ImportType_3_0_11
|
jpayne@69
|
7798 #define __PYX_HAVE_RT_ImportType_3_0_11
|
jpayne@69
|
7799 static PyTypeObject *__Pyx_ImportType_3_0_11(PyObject *module, const char *module_name, const char *class_name,
|
jpayne@69
|
7800 size_t size, size_t alignment, enum __Pyx_ImportType_CheckSize_3_0_11 check_size)
|
jpayne@69
|
7801 {
|
jpayne@69
|
7802 PyObject *result = 0;
|
jpayne@69
|
7803 char warning[200];
|
jpayne@69
|
7804 Py_ssize_t basicsize;
|
jpayne@69
|
7805 Py_ssize_t itemsize;
|
jpayne@69
|
7806 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
7807 PyObject *py_basicsize;
|
jpayne@69
|
7808 PyObject *py_itemsize;
|
jpayne@69
|
7809 #endif
|
jpayne@69
|
7810 result = PyObject_GetAttrString(module, class_name);
|
jpayne@69
|
7811 if (!result)
|
jpayne@69
|
7812 goto bad;
|
jpayne@69
|
7813 if (!PyType_Check(result)) {
|
jpayne@69
|
7814 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
7815 "%.200s.%.200s is not a type object",
|
jpayne@69
|
7816 module_name, class_name);
|
jpayne@69
|
7817 goto bad;
|
jpayne@69
|
7818 }
|
jpayne@69
|
7819 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
7820 basicsize = ((PyTypeObject *)result)->tp_basicsize;
|
jpayne@69
|
7821 itemsize = ((PyTypeObject *)result)->tp_itemsize;
|
jpayne@69
|
7822 #else
|
jpayne@69
|
7823 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
|
jpayne@69
|
7824 if (!py_basicsize)
|
jpayne@69
|
7825 goto bad;
|
jpayne@69
|
7826 basicsize = PyLong_AsSsize_t(py_basicsize);
|
jpayne@69
|
7827 Py_DECREF(py_basicsize);
|
jpayne@69
|
7828 py_basicsize = 0;
|
jpayne@69
|
7829 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
|
jpayne@69
|
7830 goto bad;
|
jpayne@69
|
7831 py_itemsize = PyObject_GetAttrString(result, "__itemsize__");
|
jpayne@69
|
7832 if (!py_itemsize)
|
jpayne@69
|
7833 goto bad;
|
jpayne@69
|
7834 itemsize = PyLong_AsSsize_t(py_itemsize);
|
jpayne@69
|
7835 Py_DECREF(py_itemsize);
|
jpayne@69
|
7836 py_itemsize = 0;
|
jpayne@69
|
7837 if (itemsize == (Py_ssize_t)-1 && PyErr_Occurred())
|
jpayne@69
|
7838 goto bad;
|
jpayne@69
|
7839 #endif
|
jpayne@69
|
7840 if (itemsize) {
|
jpayne@69
|
7841 if (size % alignment) {
|
jpayne@69
|
7842 alignment = size % alignment;
|
jpayne@69
|
7843 }
|
jpayne@69
|
7844 if (itemsize < (Py_ssize_t)alignment)
|
jpayne@69
|
7845 itemsize = (Py_ssize_t)alignment;
|
jpayne@69
|
7846 }
|
jpayne@69
|
7847 if ((size_t)(basicsize + itemsize) < size) {
|
jpayne@69
|
7848 PyErr_Format(PyExc_ValueError,
|
jpayne@69
|
7849 "%.200s.%.200s size changed, may indicate binary incompatibility. "
|
jpayne@69
|
7850 "Expected %zd from C header, got %zd from PyObject",
|
jpayne@69
|
7851 module_name, class_name, size, basicsize+itemsize);
|
jpayne@69
|
7852 goto bad;
|
jpayne@69
|
7853 }
|
jpayne@69
|
7854 if (check_size == __Pyx_ImportType_CheckSize_Error_3_0_11 &&
|
jpayne@69
|
7855 ((size_t)basicsize > size || (size_t)(basicsize + itemsize) < size)) {
|
jpayne@69
|
7856 PyErr_Format(PyExc_ValueError,
|
jpayne@69
|
7857 "%.200s.%.200s size changed, may indicate binary incompatibility. "
|
jpayne@69
|
7858 "Expected %zd from C header, got %zd-%zd from PyObject",
|
jpayne@69
|
7859 module_name, class_name, size, basicsize, basicsize+itemsize);
|
jpayne@69
|
7860 goto bad;
|
jpayne@69
|
7861 }
|
jpayne@69
|
7862 else if (check_size == __Pyx_ImportType_CheckSize_Warn_3_0_11 && (size_t)basicsize > size) {
|
jpayne@69
|
7863 PyOS_snprintf(warning, sizeof(warning),
|
jpayne@69
|
7864 "%s.%s size changed, may indicate binary incompatibility. "
|
jpayne@69
|
7865 "Expected %zd from C header, got %zd from PyObject",
|
jpayne@69
|
7866 module_name, class_name, size, basicsize);
|
jpayne@69
|
7867 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
|
jpayne@69
|
7868 }
|
jpayne@69
|
7869 return (PyTypeObject *)result;
|
jpayne@69
|
7870 bad:
|
jpayne@69
|
7871 Py_XDECREF(result);
|
jpayne@69
|
7872 return NULL;
|
jpayne@69
|
7873 }
|
jpayne@69
|
7874 #endif
|
jpayne@69
|
7875
|
jpayne@69
|
7876 /* GetVTable */
|
jpayne@69
|
7877 static void* __Pyx_GetVtable(PyTypeObject *type) {
|
jpayne@69
|
7878 void* ptr;
|
jpayne@69
|
7879 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
7880 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
|
jpayne@69
|
7881 #else
|
jpayne@69
|
7882 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
|
jpayne@69
|
7883 #endif
|
jpayne@69
|
7884 if (!ob)
|
jpayne@69
|
7885 goto bad;
|
jpayne@69
|
7886 ptr = PyCapsule_GetPointer(ob, 0);
|
jpayne@69
|
7887 if (!ptr && !PyErr_Occurred())
|
jpayne@69
|
7888 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
|
jpayne@69
|
7889 Py_DECREF(ob);
|
jpayne@69
|
7890 return ptr;
|
jpayne@69
|
7891 bad:
|
jpayne@69
|
7892 Py_XDECREF(ob);
|
jpayne@69
|
7893 return NULL;
|
jpayne@69
|
7894 }
|
jpayne@69
|
7895
|
jpayne@69
|
7896 /* FixUpExtensionType */
|
jpayne@69
|
7897 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
7898 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
|
jpayne@69
|
7899 #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
7900 CYTHON_UNUSED_VAR(spec);
|
jpayne@69
|
7901 CYTHON_UNUSED_VAR(type);
|
jpayne@69
|
7902 #else
|
jpayne@69
|
7903 const PyType_Slot *slot = spec->slots;
|
jpayne@69
|
7904 while (slot && slot->slot && slot->slot != Py_tp_members)
|
jpayne@69
|
7905 slot++;
|
jpayne@69
|
7906 if (slot && slot->slot == Py_tp_members) {
|
jpayne@69
|
7907 int changed = 0;
|
jpayne@69
|
7908 #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
|
jpayne@69
|
7909 const
|
jpayne@69
|
7910 #endif
|
jpayne@69
|
7911 PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
|
jpayne@69
|
7912 while (memb && memb->name) {
|
jpayne@69
|
7913 if (memb->name[0] == '_' && memb->name[1] == '_') {
|
jpayne@69
|
7914 #if PY_VERSION_HEX < 0x030900b1
|
jpayne@69
|
7915 if (strcmp(memb->name, "__weaklistoffset__") == 0) {
|
jpayne@69
|
7916 assert(memb->type == T_PYSSIZET);
|
jpayne@69
|
7917 assert(memb->flags == READONLY);
|
jpayne@69
|
7918 type->tp_weaklistoffset = memb->offset;
|
jpayne@69
|
7919 changed = 1;
|
jpayne@69
|
7920 }
|
jpayne@69
|
7921 else if (strcmp(memb->name, "__dictoffset__") == 0) {
|
jpayne@69
|
7922 assert(memb->type == T_PYSSIZET);
|
jpayne@69
|
7923 assert(memb->flags == READONLY);
|
jpayne@69
|
7924 type->tp_dictoffset = memb->offset;
|
jpayne@69
|
7925 changed = 1;
|
jpayne@69
|
7926 }
|
jpayne@69
|
7927 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
7928 else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
|
jpayne@69
|
7929 assert(memb->type == T_PYSSIZET);
|
jpayne@69
|
7930 assert(memb->flags == READONLY);
|
jpayne@69
|
7931 #if PY_VERSION_HEX >= 0x030800b4
|
jpayne@69
|
7932 type->tp_vectorcall_offset = memb->offset;
|
jpayne@69
|
7933 #else
|
jpayne@69
|
7934 type->tp_print = (printfunc) memb->offset;
|
jpayne@69
|
7935 #endif
|
jpayne@69
|
7936 changed = 1;
|
jpayne@69
|
7937 }
|
jpayne@69
|
7938 #endif
|
jpayne@69
|
7939 #else
|
jpayne@69
|
7940 if ((0));
|
jpayne@69
|
7941 #endif
|
jpayne@69
|
7942 #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
7943 else if (strcmp(memb->name, "__module__") == 0) {
|
jpayne@69
|
7944 PyObject *descr;
|
jpayne@69
|
7945 assert(memb->type == T_OBJECT);
|
jpayne@69
|
7946 assert(memb->flags == 0 || memb->flags == READONLY);
|
jpayne@69
|
7947 descr = PyDescr_NewMember(type, memb);
|
jpayne@69
|
7948 if (unlikely(!descr))
|
jpayne@69
|
7949 return -1;
|
jpayne@69
|
7950 if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
|
jpayne@69
|
7951 Py_DECREF(descr);
|
jpayne@69
|
7952 return -1;
|
jpayne@69
|
7953 }
|
jpayne@69
|
7954 Py_DECREF(descr);
|
jpayne@69
|
7955 changed = 1;
|
jpayne@69
|
7956 }
|
jpayne@69
|
7957 #endif
|
jpayne@69
|
7958 }
|
jpayne@69
|
7959 memb++;
|
jpayne@69
|
7960 }
|
jpayne@69
|
7961 if (changed)
|
jpayne@69
|
7962 PyType_Modified(type);
|
jpayne@69
|
7963 }
|
jpayne@69
|
7964 #endif
|
jpayne@69
|
7965 return 0;
|
jpayne@69
|
7966 }
|
jpayne@69
|
7967 #endif
|
jpayne@69
|
7968
|
jpayne@69
|
7969 /* PyFunctionFastCall */
|
jpayne@69
|
7970 #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
|
jpayne@69
|
7971 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
|
jpayne@69
|
7972 PyObject *globals) {
|
jpayne@69
|
7973 PyFrameObject *f;
|
jpayne@69
|
7974 PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
jpayne@69
|
7975 PyObject **fastlocals;
|
jpayne@69
|
7976 Py_ssize_t i;
|
jpayne@69
|
7977 PyObject *result;
|
jpayne@69
|
7978 assert(globals != NULL);
|
jpayne@69
|
7979 /* XXX Perhaps we should create a specialized
|
jpayne@69
|
7980 PyFrame_New() that doesn't take locals, but does
|
jpayne@69
|
7981 take builtins without sanity checking them.
|
jpayne@69
|
7982 */
|
jpayne@69
|
7983 assert(tstate != NULL);
|
jpayne@69
|
7984 f = PyFrame_New(tstate, co, globals, NULL);
|
jpayne@69
|
7985 if (f == NULL) {
|
jpayne@69
|
7986 return NULL;
|
jpayne@69
|
7987 }
|
jpayne@69
|
7988 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
|
jpayne@69
|
7989 for (i = 0; i < na; i++) {
|
jpayne@69
|
7990 Py_INCREF(*args);
|
jpayne@69
|
7991 fastlocals[i] = *args++;
|
jpayne@69
|
7992 }
|
jpayne@69
|
7993 result = PyEval_EvalFrameEx(f,0);
|
jpayne@69
|
7994 ++tstate->recursion_depth;
|
jpayne@69
|
7995 Py_DECREF(f);
|
jpayne@69
|
7996 --tstate->recursion_depth;
|
jpayne@69
|
7997 return result;
|
jpayne@69
|
7998 }
|
jpayne@69
|
7999 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
|
jpayne@69
|
8000 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
|
jpayne@69
|
8001 PyObject *globals = PyFunction_GET_GLOBALS(func);
|
jpayne@69
|
8002 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
|
jpayne@69
|
8003 PyObject *closure;
|
jpayne@69
|
8004 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8005 PyObject *kwdefs;
|
jpayne@69
|
8006 #endif
|
jpayne@69
|
8007 PyObject *kwtuple, **k;
|
jpayne@69
|
8008 PyObject **d;
|
jpayne@69
|
8009 Py_ssize_t nd;
|
jpayne@69
|
8010 Py_ssize_t nk;
|
jpayne@69
|
8011 PyObject *result;
|
jpayne@69
|
8012 assert(kwargs == NULL || PyDict_Check(kwargs));
|
jpayne@69
|
8013 nk = kwargs ? PyDict_Size(kwargs) : 0;
|
jpayne@69
|
8014 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8015 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
|
jpayne@69
|
8016 return NULL;
|
jpayne@69
|
8017 }
|
jpayne@69
|
8018 #else
|
jpayne@69
|
8019 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
|
jpayne@69
|
8020 return NULL;
|
jpayne@69
|
8021 }
|
jpayne@69
|
8022 #endif
|
jpayne@69
|
8023 if (
|
jpayne@69
|
8024 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8025 co->co_kwonlyargcount == 0 &&
|
jpayne@69
|
8026 #endif
|
jpayne@69
|
8027 likely(kwargs == NULL || nk == 0) &&
|
jpayne@69
|
8028 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
|
jpayne@69
|
8029 if (argdefs == NULL && co->co_argcount == nargs) {
|
jpayne@69
|
8030 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
|
jpayne@69
|
8031 goto done;
|
jpayne@69
|
8032 }
|
jpayne@69
|
8033 else if (nargs == 0 && argdefs != NULL
|
jpayne@69
|
8034 && co->co_argcount == Py_SIZE(argdefs)) {
|
jpayne@69
|
8035 /* function called with no arguments, but all parameters have
|
jpayne@69
|
8036 a default value: use default values as arguments .*/
|
jpayne@69
|
8037 args = &PyTuple_GET_ITEM(argdefs, 0);
|
jpayne@69
|
8038 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
|
jpayne@69
|
8039 goto done;
|
jpayne@69
|
8040 }
|
jpayne@69
|
8041 }
|
jpayne@69
|
8042 if (kwargs != NULL) {
|
jpayne@69
|
8043 Py_ssize_t pos, i;
|
jpayne@69
|
8044 kwtuple = PyTuple_New(2 * nk);
|
jpayne@69
|
8045 if (kwtuple == NULL) {
|
jpayne@69
|
8046 result = NULL;
|
jpayne@69
|
8047 goto done;
|
jpayne@69
|
8048 }
|
jpayne@69
|
8049 k = &PyTuple_GET_ITEM(kwtuple, 0);
|
jpayne@69
|
8050 pos = i = 0;
|
jpayne@69
|
8051 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
|
jpayne@69
|
8052 Py_INCREF(k[i]);
|
jpayne@69
|
8053 Py_INCREF(k[i+1]);
|
jpayne@69
|
8054 i += 2;
|
jpayne@69
|
8055 }
|
jpayne@69
|
8056 nk = i / 2;
|
jpayne@69
|
8057 }
|
jpayne@69
|
8058 else {
|
jpayne@69
|
8059 kwtuple = NULL;
|
jpayne@69
|
8060 k = NULL;
|
jpayne@69
|
8061 }
|
jpayne@69
|
8062 closure = PyFunction_GET_CLOSURE(func);
|
jpayne@69
|
8063 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8064 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
|
jpayne@69
|
8065 #endif
|
jpayne@69
|
8066 if (argdefs != NULL) {
|
jpayne@69
|
8067 d = &PyTuple_GET_ITEM(argdefs, 0);
|
jpayne@69
|
8068 nd = Py_SIZE(argdefs);
|
jpayne@69
|
8069 }
|
jpayne@69
|
8070 else {
|
jpayne@69
|
8071 d = NULL;
|
jpayne@69
|
8072 nd = 0;
|
jpayne@69
|
8073 }
|
jpayne@69
|
8074 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8075 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
|
jpayne@69
|
8076 args, (int)nargs,
|
jpayne@69
|
8077 k, (int)nk,
|
jpayne@69
|
8078 d, (int)nd, kwdefs, closure);
|
jpayne@69
|
8079 #else
|
jpayne@69
|
8080 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
|
jpayne@69
|
8081 args, (int)nargs,
|
jpayne@69
|
8082 k, (int)nk,
|
jpayne@69
|
8083 d, (int)nd, closure);
|
jpayne@69
|
8084 #endif
|
jpayne@69
|
8085 Py_XDECREF(kwtuple);
|
jpayne@69
|
8086 done:
|
jpayne@69
|
8087 Py_LeaveRecursiveCall();
|
jpayne@69
|
8088 return result;
|
jpayne@69
|
8089 }
|
jpayne@69
|
8090 #endif
|
jpayne@69
|
8091
|
jpayne@69
|
8092 /* PyObjectCall */
|
jpayne@69
|
8093 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
8094 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
jpayne@69
|
8095 PyObject *result;
|
jpayne@69
|
8096 ternaryfunc call = Py_TYPE(func)->tp_call;
|
jpayne@69
|
8097 if (unlikely(!call))
|
jpayne@69
|
8098 return PyObject_Call(func, arg, kw);
|
jpayne@69
|
8099 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8100 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
jpayne@69
|
8101 return NULL;
|
jpayne@69
|
8102 #else
|
jpayne@69
|
8103 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
jpayne@69
|
8104 return NULL;
|
jpayne@69
|
8105 #endif
|
jpayne@69
|
8106 result = (*call)(func, arg, kw);
|
jpayne@69
|
8107 Py_LeaveRecursiveCall();
|
jpayne@69
|
8108 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
jpayne@69
|
8109 PyErr_SetString(
|
jpayne@69
|
8110 PyExc_SystemError,
|
jpayne@69
|
8111 "NULL result without error in PyObject_Call");
|
jpayne@69
|
8112 }
|
jpayne@69
|
8113 return result;
|
jpayne@69
|
8114 }
|
jpayne@69
|
8115 #endif
|
jpayne@69
|
8116
|
jpayne@69
|
8117 /* PyObjectCallMethO */
|
jpayne@69
|
8118 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
8119 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
|
jpayne@69
|
8120 PyObject *self, *result;
|
jpayne@69
|
8121 PyCFunction cfunc;
|
jpayne@69
|
8122 cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
|
jpayne@69
|
8123 self = __Pyx_CyOrPyCFunction_GET_SELF(func);
|
jpayne@69
|
8124 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8125 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
jpayne@69
|
8126 return NULL;
|
jpayne@69
|
8127 #else
|
jpayne@69
|
8128 if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
jpayne@69
|
8129 return NULL;
|
jpayne@69
|
8130 #endif
|
jpayne@69
|
8131 result = cfunc(self, arg);
|
jpayne@69
|
8132 Py_LeaveRecursiveCall();
|
jpayne@69
|
8133 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
jpayne@69
|
8134 PyErr_SetString(
|
jpayne@69
|
8135 PyExc_SystemError,
|
jpayne@69
|
8136 "NULL result without error in PyObject_Call");
|
jpayne@69
|
8137 }
|
jpayne@69
|
8138 return result;
|
jpayne@69
|
8139 }
|
jpayne@69
|
8140 #endif
|
jpayne@69
|
8141
|
jpayne@69
|
8142 /* PyObjectFastCall */
|
jpayne@69
|
8143 #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
8144 static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
|
jpayne@69
|
8145 PyObject *argstuple;
|
jpayne@69
|
8146 PyObject *result = 0;
|
jpayne@69
|
8147 size_t i;
|
jpayne@69
|
8148 argstuple = PyTuple_New((Py_ssize_t)nargs);
|
jpayne@69
|
8149 if (unlikely(!argstuple)) return NULL;
|
jpayne@69
|
8150 for (i = 0; i < nargs; i++) {
|
jpayne@69
|
8151 Py_INCREF(args[i]);
|
jpayne@69
|
8152 if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
|
jpayne@69
|
8153 }
|
jpayne@69
|
8154 result = __Pyx_PyObject_Call(func, argstuple, kwargs);
|
jpayne@69
|
8155 bad:
|
jpayne@69
|
8156 Py_DECREF(argstuple);
|
jpayne@69
|
8157 return result;
|
jpayne@69
|
8158 }
|
jpayne@69
|
8159 #endif
|
jpayne@69
|
8160 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
|
jpayne@69
|
8161 Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
|
jpayne@69
|
8162 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
8163 if (nargs == 0 && kwargs == NULL) {
|
jpayne@69
|
8164 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
|
jpayne@69
|
8165 return __Pyx_PyObject_CallMethO(func, NULL);
|
jpayne@69
|
8166 }
|
jpayne@69
|
8167 else if (nargs == 1 && kwargs == NULL) {
|
jpayne@69
|
8168 if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
|
jpayne@69
|
8169 return __Pyx_PyObject_CallMethO(func, args[0]);
|
jpayne@69
|
8170 }
|
jpayne@69
|
8171 #endif
|
jpayne@69
|
8172 #if PY_VERSION_HEX < 0x030800B1
|
jpayne@69
|
8173 #if CYTHON_FAST_PYCCALL
|
jpayne@69
|
8174 if (PyCFunction_Check(func)) {
|
jpayne@69
|
8175 if (kwargs) {
|
jpayne@69
|
8176 return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
|
jpayne@69
|
8177 } else {
|
jpayne@69
|
8178 return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
|
jpayne@69
|
8179 }
|
jpayne@69
|
8180 }
|
jpayne@69
|
8181 #if PY_VERSION_HEX >= 0x030700A1
|
jpayne@69
|
8182 if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
|
jpayne@69
|
8183 return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
|
jpayne@69
|
8184 }
|
jpayne@69
|
8185 #endif
|
jpayne@69
|
8186 #endif
|
jpayne@69
|
8187 #if CYTHON_FAST_PYCALL
|
jpayne@69
|
8188 if (PyFunction_Check(func)) {
|
jpayne@69
|
8189 return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
|
jpayne@69
|
8190 }
|
jpayne@69
|
8191 #endif
|
jpayne@69
|
8192 #endif
|
jpayne@69
|
8193 if (kwargs == NULL) {
|
jpayne@69
|
8194 #if CYTHON_VECTORCALL
|
jpayne@69
|
8195 #if PY_VERSION_HEX < 0x03090000
|
jpayne@69
|
8196 vectorcallfunc f = _PyVectorcall_Function(func);
|
jpayne@69
|
8197 #else
|
jpayne@69
|
8198 vectorcallfunc f = PyVectorcall_Function(func);
|
jpayne@69
|
8199 #endif
|
jpayne@69
|
8200 if (f) {
|
jpayne@69
|
8201 return f(func, args, (size_t)nargs, NULL);
|
jpayne@69
|
8202 }
|
jpayne@69
|
8203 #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
8204 if (__Pyx_CyFunction_CheckExact(func)) {
|
jpayne@69
|
8205 __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
|
jpayne@69
|
8206 if (f) return f(func, args, (size_t)nargs, NULL);
|
jpayne@69
|
8207 }
|
jpayne@69
|
8208 #endif
|
jpayne@69
|
8209 }
|
jpayne@69
|
8210 if (nargs == 0) {
|
jpayne@69
|
8211 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
|
jpayne@69
|
8212 }
|
jpayne@69
|
8213 #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
8214 return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
|
jpayne@69
|
8215 #else
|
jpayne@69
|
8216 return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
|
jpayne@69
|
8217 #endif
|
jpayne@69
|
8218 }
|
jpayne@69
|
8219
|
jpayne@69
|
8220 /* PyObjectCallNoArg */
|
jpayne@69
|
8221 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
|
jpayne@69
|
8222 PyObject *arg[2] = {NULL, NULL};
|
jpayne@69
|
8223 return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
|
jpayne@69
|
8224 }
|
jpayne@69
|
8225
|
jpayne@69
|
8226 /* PyObjectCallOneArg */
|
jpayne@69
|
8227 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
|
jpayne@69
|
8228 PyObject *args[2] = {NULL, arg};
|
jpayne@69
|
8229 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
|
jpayne@69
|
8230 }
|
jpayne@69
|
8231
|
jpayne@69
|
8232 /* PyObjectGetMethod */
|
jpayne@69
|
8233 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
|
jpayne@69
|
8234 PyObject *attr;
|
jpayne@69
|
8235 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
8236 __Pyx_TypeName type_name;
|
jpayne@69
|
8237 PyTypeObject *tp = Py_TYPE(obj);
|
jpayne@69
|
8238 PyObject *descr;
|
jpayne@69
|
8239 descrgetfunc f = NULL;
|
jpayne@69
|
8240 PyObject **dictptr, *dict;
|
jpayne@69
|
8241 int meth_found = 0;
|
jpayne@69
|
8242 assert (*method == NULL);
|
jpayne@69
|
8243 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
|
jpayne@69
|
8244 attr = __Pyx_PyObject_GetAttrStr(obj, name);
|
jpayne@69
|
8245 goto try_unpack;
|
jpayne@69
|
8246 }
|
jpayne@69
|
8247 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
|
jpayne@69
|
8248 return 0;
|
jpayne@69
|
8249 }
|
jpayne@69
|
8250 descr = _PyType_Lookup(tp, name);
|
jpayne@69
|
8251 if (likely(descr != NULL)) {
|
jpayne@69
|
8252 Py_INCREF(descr);
|
jpayne@69
|
8253 #if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
|
jpayne@69
|
8254 if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
|
jpayne@69
|
8255 #elif PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8256 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
8257 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
|
jpayne@69
|
8258 #else
|
jpayne@69
|
8259 if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
|
jpayne@69
|
8260 #endif
|
jpayne@69
|
8261 #else
|
jpayne@69
|
8262 #ifdef __Pyx_CyFunction_USED
|
jpayne@69
|
8263 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
|
jpayne@69
|
8264 #else
|
jpayne@69
|
8265 if (likely(PyFunction_Check(descr)))
|
jpayne@69
|
8266 #endif
|
jpayne@69
|
8267 #endif
|
jpayne@69
|
8268 {
|
jpayne@69
|
8269 meth_found = 1;
|
jpayne@69
|
8270 } else {
|
jpayne@69
|
8271 f = Py_TYPE(descr)->tp_descr_get;
|
jpayne@69
|
8272 if (f != NULL && PyDescr_IsData(descr)) {
|
jpayne@69
|
8273 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
|
jpayne@69
|
8274 Py_DECREF(descr);
|
jpayne@69
|
8275 goto try_unpack;
|
jpayne@69
|
8276 }
|
jpayne@69
|
8277 }
|
jpayne@69
|
8278 }
|
jpayne@69
|
8279 dictptr = _PyObject_GetDictPtr(obj);
|
jpayne@69
|
8280 if (dictptr != NULL && (dict = *dictptr) != NULL) {
|
jpayne@69
|
8281 Py_INCREF(dict);
|
jpayne@69
|
8282 attr = __Pyx_PyDict_GetItemStr(dict, name);
|
jpayne@69
|
8283 if (attr != NULL) {
|
jpayne@69
|
8284 Py_INCREF(attr);
|
jpayne@69
|
8285 Py_DECREF(dict);
|
jpayne@69
|
8286 Py_XDECREF(descr);
|
jpayne@69
|
8287 goto try_unpack;
|
jpayne@69
|
8288 }
|
jpayne@69
|
8289 Py_DECREF(dict);
|
jpayne@69
|
8290 }
|
jpayne@69
|
8291 if (meth_found) {
|
jpayne@69
|
8292 *method = descr;
|
jpayne@69
|
8293 return 1;
|
jpayne@69
|
8294 }
|
jpayne@69
|
8295 if (f != NULL) {
|
jpayne@69
|
8296 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
|
jpayne@69
|
8297 Py_DECREF(descr);
|
jpayne@69
|
8298 goto try_unpack;
|
jpayne@69
|
8299 }
|
jpayne@69
|
8300 if (likely(descr != NULL)) {
|
jpayne@69
|
8301 *method = descr;
|
jpayne@69
|
8302 return 0;
|
jpayne@69
|
8303 }
|
jpayne@69
|
8304 type_name = __Pyx_PyType_GetName(tp);
|
jpayne@69
|
8305 PyErr_Format(PyExc_AttributeError,
|
jpayne@69
|
8306 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8307 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
|
jpayne@69
|
8308 type_name, name);
|
jpayne@69
|
8309 #else
|
jpayne@69
|
8310 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
|
jpayne@69
|
8311 type_name, PyString_AS_STRING(name));
|
jpayne@69
|
8312 #endif
|
jpayne@69
|
8313 __Pyx_DECREF_TypeName(type_name);
|
jpayne@69
|
8314 return 0;
|
jpayne@69
|
8315 #else
|
jpayne@69
|
8316 attr = __Pyx_PyObject_GetAttrStr(obj, name);
|
jpayne@69
|
8317 goto try_unpack;
|
jpayne@69
|
8318 #endif
|
jpayne@69
|
8319 try_unpack:
|
jpayne@69
|
8320 #if CYTHON_UNPACK_METHODS
|
jpayne@69
|
8321 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
|
jpayne@69
|
8322 PyObject *function = PyMethod_GET_FUNCTION(attr);
|
jpayne@69
|
8323 Py_INCREF(function);
|
jpayne@69
|
8324 Py_DECREF(attr);
|
jpayne@69
|
8325 *method = function;
|
jpayne@69
|
8326 return 1;
|
jpayne@69
|
8327 }
|
jpayne@69
|
8328 #endif
|
jpayne@69
|
8329 *method = attr;
|
jpayne@69
|
8330 return 0;
|
jpayne@69
|
8331 }
|
jpayne@69
|
8332
|
jpayne@69
|
8333 /* PyObjectCallMethod0 */
|
jpayne@69
|
8334 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
|
jpayne@69
|
8335 PyObject *method = NULL, *result = NULL;
|
jpayne@69
|
8336 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
|
jpayne@69
|
8337 if (likely(is_method)) {
|
jpayne@69
|
8338 result = __Pyx_PyObject_CallOneArg(method, obj);
|
jpayne@69
|
8339 Py_DECREF(method);
|
jpayne@69
|
8340 return result;
|
jpayne@69
|
8341 }
|
jpayne@69
|
8342 if (unlikely(!method)) goto bad;
|
jpayne@69
|
8343 result = __Pyx_PyObject_CallNoArg(method);
|
jpayne@69
|
8344 Py_DECREF(method);
|
jpayne@69
|
8345 bad:
|
jpayne@69
|
8346 return result;
|
jpayne@69
|
8347 }
|
jpayne@69
|
8348
|
jpayne@69
|
8349 /* ValidateBasesTuple */
|
jpayne@69
|
8350 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
8351 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
|
jpayne@69
|
8352 Py_ssize_t i, n;
|
jpayne@69
|
8353 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
8354 n = PyTuple_GET_SIZE(bases);
|
jpayne@69
|
8355 #else
|
jpayne@69
|
8356 n = PyTuple_Size(bases);
|
jpayne@69
|
8357 if (n < 0) return -1;
|
jpayne@69
|
8358 #endif
|
jpayne@69
|
8359 for (i = 1; i < n; i++)
|
jpayne@69
|
8360 {
|
jpayne@69
|
8361 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
8362 PyObject *b0 = PySequence_GetItem(bases, i);
|
jpayne@69
|
8363 if (!b0) return -1;
|
jpayne@69
|
8364 #elif CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
8365 PyObject *b0 = PyTuple_GET_ITEM(bases, i);
|
jpayne@69
|
8366 #else
|
jpayne@69
|
8367 PyObject *b0 = PyTuple_GetItem(bases, i);
|
jpayne@69
|
8368 if (!b0) return -1;
|
jpayne@69
|
8369 #endif
|
jpayne@69
|
8370 PyTypeObject *b;
|
jpayne@69
|
8371 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8372 if (PyClass_Check(b0))
|
jpayne@69
|
8373 {
|
jpayne@69
|
8374 PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
|
jpayne@69
|
8375 PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
|
jpayne@69
|
8376 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
8377 Py_DECREF(b0);
|
jpayne@69
|
8378 #endif
|
jpayne@69
|
8379 return -1;
|
jpayne@69
|
8380 }
|
jpayne@69
|
8381 #endif
|
jpayne@69
|
8382 b = (PyTypeObject*) b0;
|
jpayne@69
|
8383 if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
|
jpayne@69
|
8384 {
|
jpayne@69
|
8385 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
|
jpayne@69
|
8386 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
8387 "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
|
jpayne@69
|
8388 __Pyx_DECREF_TypeName(b_name);
|
jpayne@69
|
8389 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
8390 Py_DECREF(b0);
|
jpayne@69
|
8391 #endif
|
jpayne@69
|
8392 return -1;
|
jpayne@69
|
8393 }
|
jpayne@69
|
8394 if (dictoffset == 0)
|
jpayne@69
|
8395 {
|
jpayne@69
|
8396 Py_ssize_t b_dictoffset = 0;
|
jpayne@69
|
8397 #if CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY
|
jpayne@69
|
8398 b_dictoffset = b->tp_dictoffset;
|
jpayne@69
|
8399 #else
|
jpayne@69
|
8400 PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
|
jpayne@69
|
8401 if (!py_b_dictoffset) goto dictoffset_return;
|
jpayne@69
|
8402 b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
|
jpayne@69
|
8403 Py_DECREF(py_b_dictoffset);
|
jpayne@69
|
8404 if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
|
jpayne@69
|
8405 #endif
|
jpayne@69
|
8406 if (b_dictoffset) {
|
jpayne@69
|
8407 {
|
jpayne@69
|
8408 __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
|
jpayne@69
|
8409 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
8410 "extension type '%.200s' has no __dict__ slot, "
|
jpayne@69
|
8411 "but base type '" __Pyx_FMT_TYPENAME "' has: "
|
jpayne@69
|
8412 "either add 'cdef dict __dict__' to the extension type "
|
jpayne@69
|
8413 "or add '__slots__ = [...]' to the base type",
|
jpayne@69
|
8414 type_name, b_name);
|
jpayne@69
|
8415 __Pyx_DECREF_TypeName(b_name);
|
jpayne@69
|
8416 }
|
jpayne@69
|
8417 #if !(CYTHON_USE_TYPE_SLOTS || CYTHON_COMPILING_IN_PYPY)
|
jpayne@69
|
8418 dictoffset_return:
|
jpayne@69
|
8419 #endif
|
jpayne@69
|
8420 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
8421 Py_DECREF(b0);
|
jpayne@69
|
8422 #endif
|
jpayne@69
|
8423 return -1;
|
jpayne@69
|
8424 }
|
jpayne@69
|
8425 }
|
jpayne@69
|
8426 #if CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
8427 Py_DECREF(b0);
|
jpayne@69
|
8428 #endif
|
jpayne@69
|
8429 }
|
jpayne@69
|
8430 return 0;
|
jpayne@69
|
8431 }
|
jpayne@69
|
8432 #endif
|
jpayne@69
|
8433
|
jpayne@69
|
8434 /* PyType_Ready */
|
jpayne@69
|
8435 static int __Pyx_PyType_Ready(PyTypeObject *t) {
|
jpayne@69
|
8436 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
|
jpayne@69
|
8437 (void)__Pyx_PyObject_CallMethod0;
|
jpayne@69
|
8438 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
8439 (void)__Pyx_validate_bases_tuple;
|
jpayne@69
|
8440 #endif
|
jpayne@69
|
8441 return PyType_Ready(t);
|
jpayne@69
|
8442 #else
|
jpayne@69
|
8443 int r;
|
jpayne@69
|
8444 PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
|
jpayne@69
|
8445 if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
|
jpayne@69
|
8446 return -1;
|
jpayne@69
|
8447 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
|
jpayne@69
|
8448 {
|
jpayne@69
|
8449 int gc_was_enabled;
|
jpayne@69
|
8450 #if PY_VERSION_HEX >= 0x030A00b1
|
jpayne@69
|
8451 gc_was_enabled = PyGC_Disable();
|
jpayne@69
|
8452 (void)__Pyx_PyObject_CallMethod0;
|
jpayne@69
|
8453 #else
|
jpayne@69
|
8454 PyObject *ret, *py_status;
|
jpayne@69
|
8455 PyObject *gc = NULL;
|
jpayne@69
|
8456 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
|
jpayne@69
|
8457 gc = PyImport_GetModule(__pyx_kp_u_gc);
|
jpayne@69
|
8458 #endif
|
jpayne@69
|
8459 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
|
jpayne@69
|
8460 if (unlikely(!gc)) return -1;
|
jpayne@69
|
8461 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
|
jpayne@69
|
8462 if (unlikely(!py_status)) {
|
jpayne@69
|
8463 Py_DECREF(gc);
|
jpayne@69
|
8464 return -1;
|
jpayne@69
|
8465 }
|
jpayne@69
|
8466 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
|
jpayne@69
|
8467 Py_DECREF(py_status);
|
jpayne@69
|
8468 if (gc_was_enabled > 0) {
|
jpayne@69
|
8469 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
|
jpayne@69
|
8470 if (unlikely(!ret)) {
|
jpayne@69
|
8471 Py_DECREF(gc);
|
jpayne@69
|
8472 return -1;
|
jpayne@69
|
8473 }
|
jpayne@69
|
8474 Py_DECREF(ret);
|
jpayne@69
|
8475 } else if (unlikely(gc_was_enabled == -1)) {
|
jpayne@69
|
8476 Py_DECREF(gc);
|
jpayne@69
|
8477 return -1;
|
jpayne@69
|
8478 }
|
jpayne@69
|
8479 #endif
|
jpayne@69
|
8480 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
|
jpayne@69
|
8481 #if PY_VERSION_HEX >= 0x030A0000
|
jpayne@69
|
8482 t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
|
jpayne@69
|
8483 #endif
|
jpayne@69
|
8484 #else
|
jpayne@69
|
8485 (void)__Pyx_PyObject_CallMethod0;
|
jpayne@69
|
8486 #endif
|
jpayne@69
|
8487 r = PyType_Ready(t);
|
jpayne@69
|
8488 #if PY_VERSION_HEX >= 0x03050000 && !defined(PYSTON_MAJOR_VERSION)
|
jpayne@69
|
8489 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
|
jpayne@69
|
8490 #if PY_VERSION_HEX >= 0x030A00b1
|
jpayne@69
|
8491 if (gc_was_enabled)
|
jpayne@69
|
8492 PyGC_Enable();
|
jpayne@69
|
8493 #else
|
jpayne@69
|
8494 if (gc_was_enabled) {
|
jpayne@69
|
8495 PyObject *tp, *v, *tb;
|
jpayne@69
|
8496 PyErr_Fetch(&tp, &v, &tb);
|
jpayne@69
|
8497 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
|
jpayne@69
|
8498 if (likely(ret || r == -1)) {
|
jpayne@69
|
8499 Py_XDECREF(ret);
|
jpayne@69
|
8500 PyErr_Restore(tp, v, tb);
|
jpayne@69
|
8501 } else {
|
jpayne@69
|
8502 Py_XDECREF(tp);
|
jpayne@69
|
8503 Py_XDECREF(v);
|
jpayne@69
|
8504 Py_XDECREF(tb);
|
jpayne@69
|
8505 r = -1;
|
jpayne@69
|
8506 }
|
jpayne@69
|
8507 }
|
jpayne@69
|
8508 Py_DECREF(gc);
|
jpayne@69
|
8509 #endif
|
jpayne@69
|
8510 }
|
jpayne@69
|
8511 #endif
|
jpayne@69
|
8512 return r;
|
jpayne@69
|
8513 #endif
|
jpayne@69
|
8514 }
|
jpayne@69
|
8515
|
jpayne@69
|
8516 /* PyObject_GenericGetAttrNoDict */
|
jpayne@69
|
8517 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
|
jpayne@69
|
8518 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
|
jpayne@69
|
8519 __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
|
jpayne@69
|
8520 PyErr_Format(PyExc_AttributeError,
|
jpayne@69
|
8521 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8522 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
|
jpayne@69
|
8523 type_name, attr_name);
|
jpayne@69
|
8524 #else
|
jpayne@69
|
8525 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
|
jpayne@69
|
8526 type_name, PyString_AS_STRING(attr_name));
|
jpayne@69
|
8527 #endif
|
jpayne@69
|
8528 __Pyx_DECREF_TypeName(type_name);
|
jpayne@69
|
8529 return NULL;
|
jpayne@69
|
8530 }
|
jpayne@69
|
8531 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
|
jpayne@69
|
8532 PyObject *descr;
|
jpayne@69
|
8533 PyTypeObject *tp = Py_TYPE(obj);
|
jpayne@69
|
8534 if (unlikely(!PyString_Check(attr_name))) {
|
jpayne@69
|
8535 return PyObject_GenericGetAttr(obj, attr_name);
|
jpayne@69
|
8536 }
|
jpayne@69
|
8537 assert(!tp->tp_dictoffset);
|
jpayne@69
|
8538 descr = _PyType_Lookup(tp, attr_name);
|
jpayne@69
|
8539 if (unlikely(!descr)) {
|
jpayne@69
|
8540 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
|
jpayne@69
|
8541 }
|
jpayne@69
|
8542 Py_INCREF(descr);
|
jpayne@69
|
8543 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8544 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
|
jpayne@69
|
8545 #endif
|
jpayne@69
|
8546 {
|
jpayne@69
|
8547 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
|
jpayne@69
|
8548 if (unlikely(f)) {
|
jpayne@69
|
8549 PyObject *res = f(descr, obj, (PyObject *)tp);
|
jpayne@69
|
8550 Py_DECREF(descr);
|
jpayne@69
|
8551 return res;
|
jpayne@69
|
8552 }
|
jpayne@69
|
8553 }
|
jpayne@69
|
8554 return descr;
|
jpayne@69
|
8555 }
|
jpayne@69
|
8556 #endif
|
jpayne@69
|
8557
|
jpayne@69
|
8558 /* PyObject_GenericGetAttr */
|
jpayne@69
|
8559 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
|
jpayne@69
|
8560 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
|
jpayne@69
|
8561 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
|
jpayne@69
|
8562 return PyObject_GenericGetAttr(obj, attr_name);
|
jpayne@69
|
8563 }
|
jpayne@69
|
8564 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
|
jpayne@69
|
8565 }
|
jpayne@69
|
8566 #endif
|
jpayne@69
|
8567
|
jpayne@69
|
8568 /* SetVTable */
|
jpayne@69
|
8569 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
|
jpayne@69
|
8570 PyObject *ob = PyCapsule_New(vtable, 0, 0);
|
jpayne@69
|
8571 if (unlikely(!ob))
|
jpayne@69
|
8572 goto bad;
|
jpayne@69
|
8573 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
8574 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
|
jpayne@69
|
8575 #else
|
jpayne@69
|
8576 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
|
jpayne@69
|
8577 #endif
|
jpayne@69
|
8578 goto bad;
|
jpayne@69
|
8579 Py_DECREF(ob);
|
jpayne@69
|
8580 return 0;
|
jpayne@69
|
8581 bad:
|
jpayne@69
|
8582 Py_XDECREF(ob);
|
jpayne@69
|
8583 return -1;
|
jpayne@69
|
8584 }
|
jpayne@69
|
8585
|
jpayne@69
|
8586 /* MergeVTables */
|
jpayne@69
|
8587 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
8588 static int __Pyx_MergeVtables(PyTypeObject *type) {
|
jpayne@69
|
8589 int i;
|
jpayne@69
|
8590 void** base_vtables;
|
jpayne@69
|
8591 __Pyx_TypeName tp_base_name;
|
jpayne@69
|
8592 __Pyx_TypeName base_name;
|
jpayne@69
|
8593 void* unknown = (void*)-1;
|
jpayne@69
|
8594 PyObject* bases = type->tp_bases;
|
jpayne@69
|
8595 int base_depth = 0;
|
jpayne@69
|
8596 {
|
jpayne@69
|
8597 PyTypeObject* base = type->tp_base;
|
jpayne@69
|
8598 while (base) {
|
jpayne@69
|
8599 base_depth += 1;
|
jpayne@69
|
8600 base = base->tp_base;
|
jpayne@69
|
8601 }
|
jpayne@69
|
8602 }
|
jpayne@69
|
8603 base_vtables = (void**) malloc(sizeof(void*) * (size_t)(base_depth + 1));
|
jpayne@69
|
8604 base_vtables[0] = unknown;
|
jpayne@69
|
8605 for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
|
jpayne@69
|
8606 void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
|
jpayne@69
|
8607 if (base_vtable != NULL) {
|
jpayne@69
|
8608 int j;
|
jpayne@69
|
8609 PyTypeObject* base = type->tp_base;
|
jpayne@69
|
8610 for (j = 0; j < base_depth; j++) {
|
jpayne@69
|
8611 if (base_vtables[j] == unknown) {
|
jpayne@69
|
8612 base_vtables[j] = __Pyx_GetVtable(base);
|
jpayne@69
|
8613 base_vtables[j + 1] = unknown;
|
jpayne@69
|
8614 }
|
jpayne@69
|
8615 if (base_vtables[j] == base_vtable) {
|
jpayne@69
|
8616 break;
|
jpayne@69
|
8617 } else if (base_vtables[j] == NULL) {
|
jpayne@69
|
8618 goto bad;
|
jpayne@69
|
8619 }
|
jpayne@69
|
8620 base = base->tp_base;
|
jpayne@69
|
8621 }
|
jpayne@69
|
8622 }
|
jpayne@69
|
8623 }
|
jpayne@69
|
8624 PyErr_Clear();
|
jpayne@69
|
8625 free(base_vtables);
|
jpayne@69
|
8626 return 0;
|
jpayne@69
|
8627 bad:
|
jpayne@69
|
8628 tp_base_name = __Pyx_PyType_GetName(type->tp_base);
|
jpayne@69
|
8629 base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
|
jpayne@69
|
8630 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
8631 "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
|
jpayne@69
|
8632 __Pyx_DECREF_TypeName(tp_base_name);
|
jpayne@69
|
8633 __Pyx_DECREF_TypeName(base_name);
|
jpayne@69
|
8634 free(base_vtables);
|
jpayne@69
|
8635 return -1;
|
jpayne@69
|
8636 }
|
jpayne@69
|
8637 #endif
|
jpayne@69
|
8638
|
jpayne@69
|
8639 /* SetupReduce */
|
jpayne@69
|
8640 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
8641 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
|
jpayne@69
|
8642 int ret;
|
jpayne@69
|
8643 PyObject *name_attr;
|
jpayne@69
|
8644 name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name);
|
jpayne@69
|
8645 if (likely(name_attr)) {
|
jpayne@69
|
8646 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
|
jpayne@69
|
8647 } else {
|
jpayne@69
|
8648 ret = -1;
|
jpayne@69
|
8649 }
|
jpayne@69
|
8650 if (unlikely(ret < 0)) {
|
jpayne@69
|
8651 PyErr_Clear();
|
jpayne@69
|
8652 ret = 0;
|
jpayne@69
|
8653 }
|
jpayne@69
|
8654 Py_XDECREF(name_attr);
|
jpayne@69
|
8655 return ret;
|
jpayne@69
|
8656 }
|
jpayne@69
|
8657 static int __Pyx_setup_reduce(PyObject* type_obj) {
|
jpayne@69
|
8658 int ret = 0;
|
jpayne@69
|
8659 PyObject *object_reduce = NULL;
|
jpayne@69
|
8660 PyObject *object_getstate = NULL;
|
jpayne@69
|
8661 PyObject *object_reduce_ex = NULL;
|
jpayne@69
|
8662 PyObject *reduce = NULL;
|
jpayne@69
|
8663 PyObject *reduce_ex = NULL;
|
jpayne@69
|
8664 PyObject *reduce_cython = NULL;
|
jpayne@69
|
8665 PyObject *setstate = NULL;
|
jpayne@69
|
8666 PyObject *setstate_cython = NULL;
|
jpayne@69
|
8667 PyObject *getstate = NULL;
|
jpayne@69
|
8668 #if CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
8669 getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate);
|
jpayne@69
|
8670 #else
|
jpayne@69
|
8671 getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_getstate);
|
jpayne@69
|
8672 if (!getstate && PyErr_Occurred()) {
|
jpayne@69
|
8673 goto __PYX_BAD;
|
jpayne@69
|
8674 }
|
jpayne@69
|
8675 #endif
|
jpayne@69
|
8676 if (getstate) {
|
jpayne@69
|
8677 #if CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
8678 object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_getstate);
|
jpayne@69
|
8679 #else
|
jpayne@69
|
8680 object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_n_s_getstate);
|
jpayne@69
|
8681 if (!object_getstate && PyErr_Occurred()) {
|
jpayne@69
|
8682 goto __PYX_BAD;
|
jpayne@69
|
8683 }
|
jpayne@69
|
8684 #endif
|
jpayne@69
|
8685 if (object_getstate != getstate) {
|
jpayne@69
|
8686 goto __PYX_GOOD;
|
jpayne@69
|
8687 }
|
jpayne@69
|
8688 }
|
jpayne@69
|
8689 #if CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
8690 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
|
jpayne@69
|
8691 #else
|
jpayne@69
|
8692 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
|
jpayne@69
|
8693 #endif
|
jpayne@69
|
8694 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
|
jpayne@69
|
8695 if (reduce_ex == object_reduce_ex) {
|
jpayne@69
|
8696 #if CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
8697 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
|
jpayne@69
|
8698 #else
|
jpayne@69
|
8699 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
|
jpayne@69
|
8700 #endif
|
jpayne@69
|
8701 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
|
jpayne@69
|
8702 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
|
jpayne@69
|
8703 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
|
jpayne@69
|
8704 if (likely(reduce_cython)) {
|
jpayne@69
|
8705 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
|
jpayne@69
|
8706 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
|
jpayne@69
|
8707 } else if (reduce == object_reduce || PyErr_Occurred()) {
|
jpayne@69
|
8708 goto __PYX_BAD;
|
jpayne@69
|
8709 }
|
jpayne@69
|
8710 setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
|
jpayne@69
|
8711 if (!setstate) PyErr_Clear();
|
jpayne@69
|
8712 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
|
jpayne@69
|
8713 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
|
jpayne@69
|
8714 if (likely(setstate_cython)) {
|
jpayne@69
|
8715 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
|
jpayne@69
|
8716 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
|
jpayne@69
|
8717 } else if (!setstate || PyErr_Occurred()) {
|
jpayne@69
|
8718 goto __PYX_BAD;
|
jpayne@69
|
8719 }
|
jpayne@69
|
8720 }
|
jpayne@69
|
8721 PyType_Modified((PyTypeObject*)type_obj);
|
jpayne@69
|
8722 }
|
jpayne@69
|
8723 }
|
jpayne@69
|
8724 goto __PYX_GOOD;
|
jpayne@69
|
8725 __PYX_BAD:
|
jpayne@69
|
8726 if (!PyErr_Occurred()) {
|
jpayne@69
|
8727 __Pyx_TypeName type_obj_name =
|
jpayne@69
|
8728 __Pyx_PyType_GetName((PyTypeObject*)type_obj);
|
jpayne@69
|
8729 PyErr_Format(PyExc_RuntimeError,
|
jpayne@69
|
8730 "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
|
jpayne@69
|
8731 __Pyx_DECREF_TypeName(type_obj_name);
|
jpayne@69
|
8732 }
|
jpayne@69
|
8733 ret = -1;
|
jpayne@69
|
8734 __PYX_GOOD:
|
jpayne@69
|
8735 #if !CYTHON_USE_PYTYPE_LOOKUP
|
jpayne@69
|
8736 Py_XDECREF(object_reduce);
|
jpayne@69
|
8737 Py_XDECREF(object_reduce_ex);
|
jpayne@69
|
8738 Py_XDECREF(object_getstate);
|
jpayne@69
|
8739 Py_XDECREF(getstate);
|
jpayne@69
|
8740 #endif
|
jpayne@69
|
8741 Py_XDECREF(reduce);
|
jpayne@69
|
8742 Py_XDECREF(reduce_ex);
|
jpayne@69
|
8743 Py_XDECREF(reduce_cython);
|
jpayne@69
|
8744 Py_XDECREF(setstate);
|
jpayne@69
|
8745 Py_XDECREF(setstate_cython);
|
jpayne@69
|
8746 return ret;
|
jpayne@69
|
8747 }
|
jpayne@69
|
8748 #endif
|
jpayne@69
|
8749
|
jpayne@69
|
8750 /* Import */
|
jpayne@69
|
8751 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
|
jpayne@69
|
8752 PyObject *module = 0;
|
jpayne@69
|
8753 PyObject *empty_dict = 0;
|
jpayne@69
|
8754 PyObject *empty_list = 0;
|
jpayne@69
|
8755 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8756 PyObject *py_import;
|
jpayne@69
|
8757 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
|
jpayne@69
|
8758 if (unlikely(!py_import))
|
jpayne@69
|
8759 goto bad;
|
jpayne@69
|
8760 if (!from_list) {
|
jpayne@69
|
8761 empty_list = PyList_New(0);
|
jpayne@69
|
8762 if (unlikely(!empty_list))
|
jpayne@69
|
8763 goto bad;
|
jpayne@69
|
8764 from_list = empty_list;
|
jpayne@69
|
8765 }
|
jpayne@69
|
8766 #endif
|
jpayne@69
|
8767 empty_dict = PyDict_New();
|
jpayne@69
|
8768 if (unlikely(!empty_dict))
|
jpayne@69
|
8769 goto bad;
|
jpayne@69
|
8770 {
|
jpayne@69
|
8771 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8772 if (level == -1) {
|
jpayne@69
|
8773 if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
|
jpayne@69
|
8774 module = PyImport_ImportModuleLevelObject(
|
jpayne@69
|
8775 name, __pyx_d, empty_dict, from_list, 1);
|
jpayne@69
|
8776 if (unlikely(!module)) {
|
jpayne@69
|
8777 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
|
jpayne@69
|
8778 goto bad;
|
jpayne@69
|
8779 PyErr_Clear();
|
jpayne@69
|
8780 }
|
jpayne@69
|
8781 }
|
jpayne@69
|
8782 level = 0;
|
jpayne@69
|
8783 }
|
jpayne@69
|
8784 #endif
|
jpayne@69
|
8785 if (!module) {
|
jpayne@69
|
8786 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8787 PyObject *py_level = PyInt_FromLong(level);
|
jpayne@69
|
8788 if (unlikely(!py_level))
|
jpayne@69
|
8789 goto bad;
|
jpayne@69
|
8790 module = PyObject_CallFunctionObjArgs(py_import,
|
jpayne@69
|
8791 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
|
jpayne@69
|
8792 Py_DECREF(py_level);
|
jpayne@69
|
8793 #else
|
jpayne@69
|
8794 module = PyImport_ImportModuleLevelObject(
|
jpayne@69
|
8795 name, __pyx_d, empty_dict, from_list, level);
|
jpayne@69
|
8796 #endif
|
jpayne@69
|
8797 }
|
jpayne@69
|
8798 }
|
jpayne@69
|
8799 bad:
|
jpayne@69
|
8800 Py_XDECREF(empty_dict);
|
jpayne@69
|
8801 Py_XDECREF(empty_list);
|
jpayne@69
|
8802 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8803 Py_XDECREF(py_import);
|
jpayne@69
|
8804 #endif
|
jpayne@69
|
8805 return module;
|
jpayne@69
|
8806 }
|
jpayne@69
|
8807
|
jpayne@69
|
8808 /* ImportDottedModule */
|
jpayne@69
|
8809 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8810 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
|
jpayne@69
|
8811 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
|
jpayne@69
|
8812 if (unlikely(PyErr_Occurred())) {
|
jpayne@69
|
8813 PyErr_Clear();
|
jpayne@69
|
8814 }
|
jpayne@69
|
8815 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
|
jpayne@69
|
8816 partial_name = name;
|
jpayne@69
|
8817 } else {
|
jpayne@69
|
8818 slice = PySequence_GetSlice(parts_tuple, 0, count);
|
jpayne@69
|
8819 if (unlikely(!slice))
|
jpayne@69
|
8820 goto bad;
|
jpayne@69
|
8821 sep = PyUnicode_FromStringAndSize(".", 1);
|
jpayne@69
|
8822 if (unlikely(!sep))
|
jpayne@69
|
8823 goto bad;
|
jpayne@69
|
8824 partial_name = PyUnicode_Join(sep, slice);
|
jpayne@69
|
8825 }
|
jpayne@69
|
8826 PyErr_Format(
|
jpayne@69
|
8827 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8828 PyExc_ImportError,
|
jpayne@69
|
8829 "No module named '%s'", PyString_AS_STRING(partial_name));
|
jpayne@69
|
8830 #else
|
jpayne@69
|
8831 #if PY_VERSION_HEX >= 0x030600B1
|
jpayne@69
|
8832 PyExc_ModuleNotFoundError,
|
jpayne@69
|
8833 #else
|
jpayne@69
|
8834 PyExc_ImportError,
|
jpayne@69
|
8835 #endif
|
jpayne@69
|
8836 "No module named '%U'", partial_name);
|
jpayne@69
|
8837 #endif
|
jpayne@69
|
8838 bad:
|
jpayne@69
|
8839 Py_XDECREF(sep);
|
jpayne@69
|
8840 Py_XDECREF(slice);
|
jpayne@69
|
8841 Py_XDECREF(partial_name);
|
jpayne@69
|
8842 return NULL;
|
jpayne@69
|
8843 }
|
jpayne@69
|
8844 #endif
|
jpayne@69
|
8845 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8846 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
|
jpayne@69
|
8847 PyObject *imported_module;
|
jpayne@69
|
8848 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
|
jpayne@69
|
8849 PyObject *modules = PyImport_GetModuleDict();
|
jpayne@69
|
8850 if (unlikely(!modules))
|
jpayne@69
|
8851 return NULL;
|
jpayne@69
|
8852 imported_module = __Pyx_PyDict_GetItemStr(modules, name);
|
jpayne@69
|
8853 Py_XINCREF(imported_module);
|
jpayne@69
|
8854 #else
|
jpayne@69
|
8855 imported_module = PyImport_GetModule(name);
|
jpayne@69
|
8856 #endif
|
jpayne@69
|
8857 return imported_module;
|
jpayne@69
|
8858 }
|
jpayne@69
|
8859 #endif
|
jpayne@69
|
8860 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
8861 static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
|
jpayne@69
|
8862 Py_ssize_t i, nparts;
|
jpayne@69
|
8863 nparts = PyTuple_GET_SIZE(parts_tuple);
|
jpayne@69
|
8864 for (i=1; i < nparts && module; i++) {
|
jpayne@69
|
8865 PyObject *part, *submodule;
|
jpayne@69
|
8866 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
8867 part = PyTuple_GET_ITEM(parts_tuple, i);
|
jpayne@69
|
8868 #else
|
jpayne@69
|
8869 part = PySequence_ITEM(parts_tuple, i);
|
jpayne@69
|
8870 #endif
|
jpayne@69
|
8871 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
|
jpayne@69
|
8872 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
|
jpayne@69
|
8873 Py_DECREF(part);
|
jpayne@69
|
8874 #endif
|
jpayne@69
|
8875 Py_DECREF(module);
|
jpayne@69
|
8876 module = submodule;
|
jpayne@69
|
8877 }
|
jpayne@69
|
8878 if (unlikely(!module)) {
|
jpayne@69
|
8879 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
|
jpayne@69
|
8880 }
|
jpayne@69
|
8881 return module;
|
jpayne@69
|
8882 }
|
jpayne@69
|
8883 #endif
|
jpayne@69
|
8884 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
|
jpayne@69
|
8885 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
8886 PyObject *module, *from_list, *star = __pyx_n_s__5;
|
jpayne@69
|
8887 CYTHON_UNUSED_VAR(parts_tuple);
|
jpayne@69
|
8888 from_list = PyList_New(1);
|
jpayne@69
|
8889 if (unlikely(!from_list))
|
jpayne@69
|
8890 return NULL;
|
jpayne@69
|
8891 Py_INCREF(star);
|
jpayne@69
|
8892 PyList_SET_ITEM(from_list, 0, star);
|
jpayne@69
|
8893 module = __Pyx_Import(name, from_list, 0);
|
jpayne@69
|
8894 Py_DECREF(from_list);
|
jpayne@69
|
8895 return module;
|
jpayne@69
|
8896 #else
|
jpayne@69
|
8897 PyObject *imported_module;
|
jpayne@69
|
8898 PyObject *module = __Pyx_Import(name, NULL, 0);
|
jpayne@69
|
8899 if (!parts_tuple || unlikely(!module))
|
jpayne@69
|
8900 return module;
|
jpayne@69
|
8901 imported_module = __Pyx__ImportDottedModule_Lookup(name);
|
jpayne@69
|
8902 if (likely(imported_module)) {
|
jpayne@69
|
8903 Py_DECREF(module);
|
jpayne@69
|
8904 return imported_module;
|
jpayne@69
|
8905 }
|
jpayne@69
|
8906 PyErr_Clear();
|
jpayne@69
|
8907 return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
|
jpayne@69
|
8908 #endif
|
jpayne@69
|
8909 }
|
jpayne@69
|
8910 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
|
jpayne@69
|
8911 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
|
jpayne@69
|
8912 PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
|
jpayne@69
|
8913 if (likely(module)) {
|
jpayne@69
|
8914 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
|
jpayne@69
|
8915 if (likely(spec)) {
|
jpayne@69
|
8916 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
|
jpayne@69
|
8917 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
|
jpayne@69
|
8918 Py_DECREF(spec);
|
jpayne@69
|
8919 spec = NULL;
|
jpayne@69
|
8920 }
|
jpayne@69
|
8921 Py_XDECREF(unsafe);
|
jpayne@69
|
8922 }
|
jpayne@69
|
8923 if (likely(!spec)) {
|
jpayne@69
|
8924 PyErr_Clear();
|
jpayne@69
|
8925 return module;
|
jpayne@69
|
8926 }
|
jpayne@69
|
8927 Py_DECREF(spec);
|
jpayne@69
|
8928 Py_DECREF(module);
|
jpayne@69
|
8929 } else if (PyErr_Occurred()) {
|
jpayne@69
|
8930 PyErr_Clear();
|
jpayne@69
|
8931 }
|
jpayne@69
|
8932 #endif
|
jpayne@69
|
8933 return __Pyx__ImportDottedModule(name, parts_tuple);
|
jpayne@69
|
8934 }
|
jpayne@69
|
8935
|
jpayne@69
|
8936 /* FetchSharedCythonModule */
|
jpayne@69
|
8937 static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
|
jpayne@69
|
8938 return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
|
jpayne@69
|
8939 }
|
jpayne@69
|
8940
|
jpayne@69
|
8941 /* FetchCommonType */
|
jpayne@69
|
8942 static int __Pyx_VerifyCachedType(PyObject *cached_type,
|
jpayne@69
|
8943 const char *name,
|
jpayne@69
|
8944 Py_ssize_t basicsize,
|
jpayne@69
|
8945 Py_ssize_t expected_basicsize) {
|
jpayne@69
|
8946 if (!PyType_Check(cached_type)) {
|
jpayne@69
|
8947 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
8948 "Shared Cython type %.200s is not a type object", name);
|
jpayne@69
|
8949 return -1;
|
jpayne@69
|
8950 }
|
jpayne@69
|
8951 if (basicsize != expected_basicsize) {
|
jpayne@69
|
8952 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
8953 "Shared Cython type %.200s has the wrong size, try recompiling",
|
jpayne@69
|
8954 name);
|
jpayne@69
|
8955 return -1;
|
jpayne@69
|
8956 }
|
jpayne@69
|
8957 return 0;
|
jpayne@69
|
8958 }
|
jpayne@69
|
8959 #if !CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
8960 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
|
jpayne@69
|
8961 PyObject* abi_module;
|
jpayne@69
|
8962 const char* object_name;
|
jpayne@69
|
8963 PyTypeObject *cached_type = NULL;
|
jpayne@69
|
8964 abi_module = __Pyx_FetchSharedCythonABIModule();
|
jpayne@69
|
8965 if (!abi_module) return NULL;
|
jpayne@69
|
8966 object_name = strrchr(type->tp_name, '.');
|
jpayne@69
|
8967 object_name = object_name ? object_name+1 : type->tp_name;
|
jpayne@69
|
8968 cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
|
jpayne@69
|
8969 if (cached_type) {
|
jpayne@69
|
8970 if (__Pyx_VerifyCachedType(
|
jpayne@69
|
8971 (PyObject *)cached_type,
|
jpayne@69
|
8972 object_name,
|
jpayne@69
|
8973 cached_type->tp_basicsize,
|
jpayne@69
|
8974 type->tp_basicsize) < 0) {
|
jpayne@69
|
8975 goto bad;
|
jpayne@69
|
8976 }
|
jpayne@69
|
8977 goto done;
|
jpayne@69
|
8978 }
|
jpayne@69
|
8979 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
|
jpayne@69
|
8980 PyErr_Clear();
|
jpayne@69
|
8981 if (PyType_Ready(type) < 0) goto bad;
|
jpayne@69
|
8982 if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
|
jpayne@69
|
8983 goto bad;
|
jpayne@69
|
8984 Py_INCREF(type);
|
jpayne@69
|
8985 cached_type = type;
|
jpayne@69
|
8986 done:
|
jpayne@69
|
8987 Py_DECREF(abi_module);
|
jpayne@69
|
8988 return cached_type;
|
jpayne@69
|
8989 bad:
|
jpayne@69
|
8990 Py_XDECREF(cached_type);
|
jpayne@69
|
8991 cached_type = NULL;
|
jpayne@69
|
8992 goto done;
|
jpayne@69
|
8993 }
|
jpayne@69
|
8994 #else
|
jpayne@69
|
8995 static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
|
jpayne@69
|
8996 PyObject *abi_module, *cached_type = NULL;
|
jpayne@69
|
8997 const char* object_name = strrchr(spec->name, '.');
|
jpayne@69
|
8998 object_name = object_name ? object_name+1 : spec->name;
|
jpayne@69
|
8999 abi_module = __Pyx_FetchSharedCythonABIModule();
|
jpayne@69
|
9000 if (!abi_module) return NULL;
|
jpayne@69
|
9001 cached_type = PyObject_GetAttrString(abi_module, object_name);
|
jpayne@69
|
9002 if (cached_type) {
|
jpayne@69
|
9003 Py_ssize_t basicsize;
|
jpayne@69
|
9004 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9005 PyObject *py_basicsize;
|
jpayne@69
|
9006 py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
|
jpayne@69
|
9007 if (unlikely(!py_basicsize)) goto bad;
|
jpayne@69
|
9008 basicsize = PyLong_AsSsize_t(py_basicsize);
|
jpayne@69
|
9009 Py_DECREF(py_basicsize);
|
jpayne@69
|
9010 py_basicsize = 0;
|
jpayne@69
|
9011 if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
|
jpayne@69
|
9012 #else
|
jpayne@69
|
9013 basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
|
jpayne@69
|
9014 #endif
|
jpayne@69
|
9015 if (__Pyx_VerifyCachedType(
|
jpayne@69
|
9016 cached_type,
|
jpayne@69
|
9017 object_name,
|
jpayne@69
|
9018 basicsize,
|
jpayne@69
|
9019 spec->basicsize) < 0) {
|
jpayne@69
|
9020 goto bad;
|
jpayne@69
|
9021 }
|
jpayne@69
|
9022 goto done;
|
jpayne@69
|
9023 }
|
jpayne@69
|
9024 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
|
jpayne@69
|
9025 PyErr_Clear();
|
jpayne@69
|
9026 CYTHON_UNUSED_VAR(module);
|
jpayne@69
|
9027 cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
|
jpayne@69
|
9028 if (unlikely(!cached_type)) goto bad;
|
jpayne@69
|
9029 if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
|
jpayne@69
|
9030 if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
|
jpayne@69
|
9031 done:
|
jpayne@69
|
9032 Py_DECREF(abi_module);
|
jpayne@69
|
9033 assert(cached_type == NULL || PyType_Check(cached_type));
|
jpayne@69
|
9034 return (PyTypeObject *) cached_type;
|
jpayne@69
|
9035 bad:
|
jpayne@69
|
9036 Py_XDECREF(cached_type);
|
jpayne@69
|
9037 cached_type = NULL;
|
jpayne@69
|
9038 goto done;
|
jpayne@69
|
9039 }
|
jpayne@69
|
9040 #endif
|
jpayne@69
|
9041
|
jpayne@69
|
9042 /* PyVectorcallFastCallDict */
|
jpayne@69
|
9043 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
9044 static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
|
jpayne@69
|
9045 {
|
jpayne@69
|
9046 PyObject *res = NULL;
|
jpayne@69
|
9047 PyObject *kwnames;
|
jpayne@69
|
9048 PyObject **newargs;
|
jpayne@69
|
9049 PyObject **kwvalues;
|
jpayne@69
|
9050 Py_ssize_t i, pos;
|
jpayne@69
|
9051 size_t j;
|
jpayne@69
|
9052 PyObject *key, *value;
|
jpayne@69
|
9053 unsigned long keys_are_strings;
|
jpayne@69
|
9054 Py_ssize_t nkw = PyDict_GET_SIZE(kw);
|
jpayne@69
|
9055 newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
|
jpayne@69
|
9056 if (unlikely(newargs == NULL)) {
|
jpayne@69
|
9057 PyErr_NoMemory();
|
jpayne@69
|
9058 return NULL;
|
jpayne@69
|
9059 }
|
jpayne@69
|
9060 for (j = 0; j < nargs; j++) newargs[j] = args[j];
|
jpayne@69
|
9061 kwnames = PyTuple_New(nkw);
|
jpayne@69
|
9062 if (unlikely(kwnames == NULL)) {
|
jpayne@69
|
9063 PyMem_Free(newargs);
|
jpayne@69
|
9064 return NULL;
|
jpayne@69
|
9065 }
|
jpayne@69
|
9066 kwvalues = newargs + nargs;
|
jpayne@69
|
9067 pos = i = 0;
|
jpayne@69
|
9068 keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
|
jpayne@69
|
9069 while (PyDict_Next(kw, &pos, &key, &value)) {
|
jpayne@69
|
9070 keys_are_strings &= Py_TYPE(key)->tp_flags;
|
jpayne@69
|
9071 Py_INCREF(key);
|
jpayne@69
|
9072 Py_INCREF(value);
|
jpayne@69
|
9073 PyTuple_SET_ITEM(kwnames, i, key);
|
jpayne@69
|
9074 kwvalues[i] = value;
|
jpayne@69
|
9075 i++;
|
jpayne@69
|
9076 }
|
jpayne@69
|
9077 if (unlikely(!keys_are_strings)) {
|
jpayne@69
|
9078 PyErr_SetString(PyExc_TypeError, "keywords must be strings");
|
jpayne@69
|
9079 goto cleanup;
|
jpayne@69
|
9080 }
|
jpayne@69
|
9081 res = vc(func, newargs, nargs, kwnames);
|
jpayne@69
|
9082 cleanup:
|
jpayne@69
|
9083 Py_DECREF(kwnames);
|
jpayne@69
|
9084 for (i = 0; i < nkw; i++)
|
jpayne@69
|
9085 Py_DECREF(kwvalues[i]);
|
jpayne@69
|
9086 PyMem_Free(newargs);
|
jpayne@69
|
9087 return res;
|
jpayne@69
|
9088 }
|
jpayne@69
|
9089 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
|
jpayne@69
|
9090 {
|
jpayne@69
|
9091 if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
|
jpayne@69
|
9092 return vc(func, args, nargs, NULL);
|
jpayne@69
|
9093 }
|
jpayne@69
|
9094 return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
|
jpayne@69
|
9095 }
|
jpayne@69
|
9096 #endif
|
jpayne@69
|
9097
|
jpayne@69
|
9098 /* CythonFunctionShared */
|
jpayne@69
|
9099 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9100 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
|
jpayne@69
|
9101 if (__Pyx_CyFunction_Check(func)) {
|
jpayne@69
|
9102 return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
|
jpayne@69
|
9103 } else if (PyCFunction_Check(func)) {
|
jpayne@69
|
9104 return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
|
jpayne@69
|
9105 }
|
jpayne@69
|
9106 return 0;
|
jpayne@69
|
9107 }
|
jpayne@69
|
9108 #else
|
jpayne@69
|
9109 static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
|
jpayne@69
|
9110 return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
|
jpayne@69
|
9111 }
|
jpayne@69
|
9112 #endif
|
jpayne@69
|
9113 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
|
jpayne@69
|
9114 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9115 __Pyx_Py_XDECREF_SET(
|
jpayne@69
|
9116 __Pyx_CyFunction_GetClassObj(f),
|
jpayne@69
|
9117 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
|
jpayne@69
|
9118 #else
|
jpayne@69
|
9119 __Pyx_Py_XDECREF_SET(
|
jpayne@69
|
9120 ((PyCMethodObject *) (f))->mm_class,
|
jpayne@69
|
9121 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
|
jpayne@69
|
9122 #endif
|
jpayne@69
|
9123 }
|
jpayne@69
|
9124 static PyObject *
|
jpayne@69
|
9125 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
|
jpayne@69
|
9126 {
|
jpayne@69
|
9127 CYTHON_UNUSED_VAR(closure);
|
jpayne@69
|
9128 if (unlikely(op->func_doc == NULL)) {
|
jpayne@69
|
9129 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9130 op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
|
jpayne@69
|
9131 if (unlikely(!op->func_doc)) return NULL;
|
jpayne@69
|
9132 #else
|
jpayne@69
|
9133 if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
|
jpayne@69
|
9134 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
9135 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
|
jpayne@69
|
9136 #else
|
jpayne@69
|
9137 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
|
jpayne@69
|
9138 #endif
|
jpayne@69
|
9139 if (unlikely(op->func_doc == NULL))
|
jpayne@69
|
9140 return NULL;
|
jpayne@69
|
9141 } else {
|
jpayne@69
|
9142 Py_INCREF(Py_None);
|
jpayne@69
|
9143 return Py_None;
|
jpayne@69
|
9144 }
|
jpayne@69
|
9145 #endif
|
jpayne@69
|
9146 }
|
jpayne@69
|
9147 Py_INCREF(op->func_doc);
|
jpayne@69
|
9148 return op->func_doc;
|
jpayne@69
|
9149 }
|
jpayne@69
|
9150 static int
|
jpayne@69
|
9151 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
|
jpayne@69
|
9152 {
|
jpayne@69
|
9153 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9154 if (value == NULL) {
|
jpayne@69
|
9155 value = Py_None;
|
jpayne@69
|
9156 }
|
jpayne@69
|
9157 Py_INCREF(value);
|
jpayne@69
|
9158 __Pyx_Py_XDECREF_SET(op->func_doc, value);
|
jpayne@69
|
9159 return 0;
|
jpayne@69
|
9160 }
|
jpayne@69
|
9161 static PyObject *
|
jpayne@69
|
9162 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
|
jpayne@69
|
9163 {
|
jpayne@69
|
9164 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9165 if (unlikely(op->func_name == NULL)) {
|
jpayne@69
|
9166 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9167 op->func_name = PyObject_GetAttrString(op->func, "__name__");
|
jpayne@69
|
9168 #elif PY_MAJOR_VERSION >= 3
|
jpayne@69
|
9169 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
|
jpayne@69
|
9170 #else
|
jpayne@69
|
9171 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
|
jpayne@69
|
9172 #endif
|
jpayne@69
|
9173 if (unlikely(op->func_name == NULL))
|
jpayne@69
|
9174 return NULL;
|
jpayne@69
|
9175 }
|
jpayne@69
|
9176 Py_INCREF(op->func_name);
|
jpayne@69
|
9177 return op->func_name;
|
jpayne@69
|
9178 }
|
jpayne@69
|
9179 static int
|
jpayne@69
|
9180 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
|
jpayne@69
|
9181 {
|
jpayne@69
|
9182 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9183 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
9184 if (unlikely(value == NULL || !PyUnicode_Check(value)))
|
jpayne@69
|
9185 #else
|
jpayne@69
|
9186 if (unlikely(value == NULL || !PyString_Check(value)))
|
jpayne@69
|
9187 #endif
|
jpayne@69
|
9188 {
|
jpayne@69
|
9189 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9190 "__name__ must be set to a string object");
|
jpayne@69
|
9191 return -1;
|
jpayne@69
|
9192 }
|
jpayne@69
|
9193 Py_INCREF(value);
|
jpayne@69
|
9194 __Pyx_Py_XDECREF_SET(op->func_name, value);
|
jpayne@69
|
9195 return 0;
|
jpayne@69
|
9196 }
|
jpayne@69
|
9197 static PyObject *
|
jpayne@69
|
9198 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
|
jpayne@69
|
9199 {
|
jpayne@69
|
9200 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9201 Py_INCREF(op->func_qualname);
|
jpayne@69
|
9202 return op->func_qualname;
|
jpayne@69
|
9203 }
|
jpayne@69
|
9204 static int
|
jpayne@69
|
9205 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
|
jpayne@69
|
9206 {
|
jpayne@69
|
9207 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9208 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
9209 if (unlikely(value == NULL || !PyUnicode_Check(value)))
|
jpayne@69
|
9210 #else
|
jpayne@69
|
9211 if (unlikely(value == NULL || !PyString_Check(value)))
|
jpayne@69
|
9212 #endif
|
jpayne@69
|
9213 {
|
jpayne@69
|
9214 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9215 "__qualname__ must be set to a string object");
|
jpayne@69
|
9216 return -1;
|
jpayne@69
|
9217 }
|
jpayne@69
|
9218 Py_INCREF(value);
|
jpayne@69
|
9219 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
|
jpayne@69
|
9220 return 0;
|
jpayne@69
|
9221 }
|
jpayne@69
|
9222 static PyObject *
|
jpayne@69
|
9223 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
|
jpayne@69
|
9224 {
|
jpayne@69
|
9225 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9226 if (unlikely(op->func_dict == NULL)) {
|
jpayne@69
|
9227 op->func_dict = PyDict_New();
|
jpayne@69
|
9228 if (unlikely(op->func_dict == NULL))
|
jpayne@69
|
9229 return NULL;
|
jpayne@69
|
9230 }
|
jpayne@69
|
9231 Py_INCREF(op->func_dict);
|
jpayne@69
|
9232 return op->func_dict;
|
jpayne@69
|
9233 }
|
jpayne@69
|
9234 static int
|
jpayne@69
|
9235 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
|
jpayne@69
|
9236 {
|
jpayne@69
|
9237 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9238 if (unlikely(value == NULL)) {
|
jpayne@69
|
9239 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9240 "function's dictionary may not be deleted");
|
jpayne@69
|
9241 return -1;
|
jpayne@69
|
9242 }
|
jpayne@69
|
9243 if (unlikely(!PyDict_Check(value))) {
|
jpayne@69
|
9244 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9245 "setting function's dictionary to a non-dict");
|
jpayne@69
|
9246 return -1;
|
jpayne@69
|
9247 }
|
jpayne@69
|
9248 Py_INCREF(value);
|
jpayne@69
|
9249 __Pyx_Py_XDECREF_SET(op->func_dict, value);
|
jpayne@69
|
9250 return 0;
|
jpayne@69
|
9251 }
|
jpayne@69
|
9252 static PyObject *
|
jpayne@69
|
9253 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
|
jpayne@69
|
9254 {
|
jpayne@69
|
9255 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9256 Py_INCREF(op->func_globals);
|
jpayne@69
|
9257 return op->func_globals;
|
jpayne@69
|
9258 }
|
jpayne@69
|
9259 static PyObject *
|
jpayne@69
|
9260 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
|
jpayne@69
|
9261 {
|
jpayne@69
|
9262 CYTHON_UNUSED_VAR(op);
|
jpayne@69
|
9263 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9264 Py_INCREF(Py_None);
|
jpayne@69
|
9265 return Py_None;
|
jpayne@69
|
9266 }
|
jpayne@69
|
9267 static PyObject *
|
jpayne@69
|
9268 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
|
jpayne@69
|
9269 {
|
jpayne@69
|
9270 PyObject* result = (op->func_code) ? op->func_code : Py_None;
|
jpayne@69
|
9271 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9272 Py_INCREF(result);
|
jpayne@69
|
9273 return result;
|
jpayne@69
|
9274 }
|
jpayne@69
|
9275 static int
|
jpayne@69
|
9276 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
|
jpayne@69
|
9277 int result = 0;
|
jpayne@69
|
9278 PyObject *res = op->defaults_getter((PyObject *) op);
|
jpayne@69
|
9279 if (unlikely(!res))
|
jpayne@69
|
9280 return -1;
|
jpayne@69
|
9281 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
9282 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
|
jpayne@69
|
9283 Py_INCREF(op->defaults_tuple);
|
jpayne@69
|
9284 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
|
jpayne@69
|
9285 Py_INCREF(op->defaults_kwdict);
|
jpayne@69
|
9286 #else
|
jpayne@69
|
9287 op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
|
jpayne@69
|
9288 if (unlikely(!op->defaults_tuple)) result = -1;
|
jpayne@69
|
9289 else {
|
jpayne@69
|
9290 op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
|
jpayne@69
|
9291 if (unlikely(!op->defaults_kwdict)) result = -1;
|
jpayne@69
|
9292 }
|
jpayne@69
|
9293 #endif
|
jpayne@69
|
9294 Py_DECREF(res);
|
jpayne@69
|
9295 return result;
|
jpayne@69
|
9296 }
|
jpayne@69
|
9297 static int
|
jpayne@69
|
9298 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
|
jpayne@69
|
9299 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9300 if (!value) {
|
jpayne@69
|
9301 value = Py_None;
|
jpayne@69
|
9302 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
|
jpayne@69
|
9303 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9304 "__defaults__ must be set to a tuple object");
|
jpayne@69
|
9305 return -1;
|
jpayne@69
|
9306 }
|
jpayne@69
|
9307 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
|
jpayne@69
|
9308 "currently affect the values used in function calls", 1);
|
jpayne@69
|
9309 Py_INCREF(value);
|
jpayne@69
|
9310 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
|
jpayne@69
|
9311 return 0;
|
jpayne@69
|
9312 }
|
jpayne@69
|
9313 static PyObject *
|
jpayne@69
|
9314 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
|
jpayne@69
|
9315 PyObject* result = op->defaults_tuple;
|
jpayne@69
|
9316 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9317 if (unlikely(!result)) {
|
jpayne@69
|
9318 if (op->defaults_getter) {
|
jpayne@69
|
9319 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
|
jpayne@69
|
9320 result = op->defaults_tuple;
|
jpayne@69
|
9321 } else {
|
jpayne@69
|
9322 result = Py_None;
|
jpayne@69
|
9323 }
|
jpayne@69
|
9324 }
|
jpayne@69
|
9325 Py_INCREF(result);
|
jpayne@69
|
9326 return result;
|
jpayne@69
|
9327 }
|
jpayne@69
|
9328 static int
|
jpayne@69
|
9329 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
|
jpayne@69
|
9330 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9331 if (!value) {
|
jpayne@69
|
9332 value = Py_None;
|
jpayne@69
|
9333 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
|
jpayne@69
|
9334 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9335 "__kwdefaults__ must be set to a dict object");
|
jpayne@69
|
9336 return -1;
|
jpayne@69
|
9337 }
|
jpayne@69
|
9338 PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
|
jpayne@69
|
9339 "currently affect the values used in function calls", 1);
|
jpayne@69
|
9340 Py_INCREF(value);
|
jpayne@69
|
9341 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
|
jpayne@69
|
9342 return 0;
|
jpayne@69
|
9343 }
|
jpayne@69
|
9344 static PyObject *
|
jpayne@69
|
9345 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
|
jpayne@69
|
9346 PyObject* result = op->defaults_kwdict;
|
jpayne@69
|
9347 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9348 if (unlikely(!result)) {
|
jpayne@69
|
9349 if (op->defaults_getter) {
|
jpayne@69
|
9350 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
|
jpayne@69
|
9351 result = op->defaults_kwdict;
|
jpayne@69
|
9352 } else {
|
jpayne@69
|
9353 result = Py_None;
|
jpayne@69
|
9354 }
|
jpayne@69
|
9355 }
|
jpayne@69
|
9356 Py_INCREF(result);
|
jpayne@69
|
9357 return result;
|
jpayne@69
|
9358 }
|
jpayne@69
|
9359 static int
|
jpayne@69
|
9360 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
|
jpayne@69
|
9361 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9362 if (!value || value == Py_None) {
|
jpayne@69
|
9363 value = NULL;
|
jpayne@69
|
9364 } else if (unlikely(!PyDict_Check(value))) {
|
jpayne@69
|
9365 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9366 "__annotations__ must be set to a dict object");
|
jpayne@69
|
9367 return -1;
|
jpayne@69
|
9368 }
|
jpayne@69
|
9369 Py_XINCREF(value);
|
jpayne@69
|
9370 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
|
jpayne@69
|
9371 return 0;
|
jpayne@69
|
9372 }
|
jpayne@69
|
9373 static PyObject *
|
jpayne@69
|
9374 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
|
jpayne@69
|
9375 PyObject* result = op->func_annotations;
|
jpayne@69
|
9376 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9377 if (unlikely(!result)) {
|
jpayne@69
|
9378 result = PyDict_New();
|
jpayne@69
|
9379 if (unlikely(!result)) return NULL;
|
jpayne@69
|
9380 op->func_annotations = result;
|
jpayne@69
|
9381 }
|
jpayne@69
|
9382 Py_INCREF(result);
|
jpayne@69
|
9383 return result;
|
jpayne@69
|
9384 }
|
jpayne@69
|
9385 static PyObject *
|
jpayne@69
|
9386 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
|
jpayne@69
|
9387 int is_coroutine;
|
jpayne@69
|
9388 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9389 if (op->func_is_coroutine) {
|
jpayne@69
|
9390 return __Pyx_NewRef(op->func_is_coroutine);
|
jpayne@69
|
9391 }
|
jpayne@69
|
9392 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
|
jpayne@69
|
9393 #if PY_VERSION_HEX >= 0x03050000
|
jpayne@69
|
9394 if (is_coroutine) {
|
jpayne@69
|
9395 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
|
jpayne@69
|
9396 fromlist = PyList_New(1);
|
jpayne@69
|
9397 if (unlikely(!fromlist)) return NULL;
|
jpayne@69
|
9398 Py_INCREF(marker);
|
jpayne@69
|
9399 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
9400 PyList_SET_ITEM(fromlist, 0, marker);
|
jpayne@69
|
9401 #else
|
jpayne@69
|
9402 if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
|
jpayne@69
|
9403 Py_DECREF(marker);
|
jpayne@69
|
9404 Py_DECREF(fromlist);
|
jpayne@69
|
9405 return NULL;
|
jpayne@69
|
9406 }
|
jpayne@69
|
9407 #endif
|
jpayne@69
|
9408 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
|
jpayne@69
|
9409 Py_DECREF(fromlist);
|
jpayne@69
|
9410 if (unlikely(!module)) goto ignore;
|
jpayne@69
|
9411 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
|
jpayne@69
|
9412 Py_DECREF(module);
|
jpayne@69
|
9413 if (likely(op->func_is_coroutine)) {
|
jpayne@69
|
9414 return __Pyx_NewRef(op->func_is_coroutine);
|
jpayne@69
|
9415 }
|
jpayne@69
|
9416 ignore:
|
jpayne@69
|
9417 PyErr_Clear();
|
jpayne@69
|
9418 }
|
jpayne@69
|
9419 #endif
|
jpayne@69
|
9420 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
|
jpayne@69
|
9421 return __Pyx_NewRef(op->func_is_coroutine);
|
jpayne@69
|
9422 }
|
jpayne@69
|
9423 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9424 static PyObject *
|
jpayne@69
|
9425 __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
|
jpayne@69
|
9426 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9427 return PyObject_GetAttrString(op->func, "__module__");
|
jpayne@69
|
9428 }
|
jpayne@69
|
9429 static int
|
jpayne@69
|
9430 __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
|
jpayne@69
|
9431 CYTHON_UNUSED_VAR(context);
|
jpayne@69
|
9432 return PyObject_SetAttrString(op->func, "__module__", value);
|
jpayne@69
|
9433 }
|
jpayne@69
|
9434 #endif
|
jpayne@69
|
9435 static PyGetSetDef __pyx_CyFunction_getsets[] = {
|
jpayne@69
|
9436 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
|
jpayne@69
|
9437 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
|
jpayne@69
|
9438 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
|
jpayne@69
|
9439 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
|
jpayne@69
|
9440 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
|
jpayne@69
|
9441 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
|
jpayne@69
|
9442 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
|
jpayne@69
|
9443 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
|
jpayne@69
|
9444 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
|
jpayne@69
|
9445 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
|
jpayne@69
|
9446 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
|
jpayne@69
|
9447 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
|
jpayne@69
|
9448 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
|
jpayne@69
|
9449 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
|
jpayne@69
|
9450 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
|
jpayne@69
|
9451 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
|
jpayne@69
|
9452 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
|
jpayne@69
|
9453 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
|
jpayne@69
|
9454 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9455 {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
|
jpayne@69
|
9456 #endif
|
jpayne@69
|
9457 {0, 0, 0, 0, 0}
|
jpayne@69
|
9458 };
|
jpayne@69
|
9459 static PyMemberDef __pyx_CyFunction_members[] = {
|
jpayne@69
|
9460 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9461 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
|
jpayne@69
|
9462 #endif
|
jpayne@69
|
9463 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
9464 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
|
jpayne@69
|
9465 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
9466 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
9467 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
|
jpayne@69
|
9468 #else
|
jpayne@69
|
9469 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9470 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
|
jpayne@69
|
9471 #endif
|
jpayne@69
|
9472 #endif
|
jpayne@69
|
9473 #endif
|
jpayne@69
|
9474 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9475 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
|
jpayne@69
|
9476 #else
|
jpayne@69
|
9477 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
|
jpayne@69
|
9478 #endif
|
jpayne@69
|
9479 #endif
|
jpayne@69
|
9480 {0, 0, 0, 0, 0}
|
jpayne@69
|
9481 };
|
jpayne@69
|
9482 static PyObject *
|
jpayne@69
|
9483 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
|
jpayne@69
|
9484 {
|
jpayne@69
|
9485 CYTHON_UNUSED_VAR(args);
|
jpayne@69
|
9486 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
9487 Py_INCREF(m->func_qualname);
|
jpayne@69
|
9488 return m->func_qualname;
|
jpayne@69
|
9489 #else
|
jpayne@69
|
9490 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
|
jpayne@69
|
9491 #endif
|
jpayne@69
|
9492 }
|
jpayne@69
|
9493 static PyMethodDef __pyx_CyFunction_methods[] = {
|
jpayne@69
|
9494 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
|
jpayne@69
|
9495 {0, 0, 0, 0}
|
jpayne@69
|
9496 };
|
jpayne@69
|
9497 #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9498 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
|
jpayne@69
|
9499 #else
|
jpayne@69
|
9500 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
|
jpayne@69
|
9501 #endif
|
jpayne@69
|
9502 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
|
jpayne@69
|
9503 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
|
jpayne@69
|
9504 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9505 PyCFunctionObject *cf = (PyCFunctionObject*) op;
|
jpayne@69
|
9506 #endif
|
jpayne@69
|
9507 if (unlikely(op == NULL))
|
jpayne@69
|
9508 return NULL;
|
jpayne@69
|
9509 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9510 op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
|
jpayne@69
|
9511 if (unlikely(!op->func)) return NULL;
|
jpayne@69
|
9512 #endif
|
jpayne@69
|
9513 op->flags = flags;
|
jpayne@69
|
9514 __Pyx_CyFunction_weakreflist(op) = NULL;
|
jpayne@69
|
9515 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9516 cf->m_ml = ml;
|
jpayne@69
|
9517 cf->m_self = (PyObject *) op;
|
jpayne@69
|
9518 #endif
|
jpayne@69
|
9519 Py_XINCREF(closure);
|
jpayne@69
|
9520 op->func_closure = closure;
|
jpayne@69
|
9521 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9522 Py_XINCREF(module);
|
jpayne@69
|
9523 cf->m_module = module;
|
jpayne@69
|
9524 #endif
|
jpayne@69
|
9525 op->func_dict = NULL;
|
jpayne@69
|
9526 op->func_name = NULL;
|
jpayne@69
|
9527 Py_INCREF(qualname);
|
jpayne@69
|
9528 op->func_qualname = qualname;
|
jpayne@69
|
9529 op->func_doc = NULL;
|
jpayne@69
|
9530 #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9531 op->func_classobj = NULL;
|
jpayne@69
|
9532 #else
|
jpayne@69
|
9533 ((PyCMethodObject*)op)->mm_class = NULL;
|
jpayne@69
|
9534 #endif
|
jpayne@69
|
9535 op->func_globals = globals;
|
jpayne@69
|
9536 Py_INCREF(op->func_globals);
|
jpayne@69
|
9537 Py_XINCREF(code);
|
jpayne@69
|
9538 op->func_code = code;
|
jpayne@69
|
9539 op->defaults_pyobjects = 0;
|
jpayne@69
|
9540 op->defaults_size = 0;
|
jpayne@69
|
9541 op->defaults = NULL;
|
jpayne@69
|
9542 op->defaults_tuple = NULL;
|
jpayne@69
|
9543 op->defaults_kwdict = NULL;
|
jpayne@69
|
9544 op->defaults_getter = NULL;
|
jpayne@69
|
9545 op->func_annotations = NULL;
|
jpayne@69
|
9546 op->func_is_coroutine = NULL;
|
jpayne@69
|
9547 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
9548 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
|
jpayne@69
|
9549 case METH_NOARGS:
|
jpayne@69
|
9550 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
|
jpayne@69
|
9551 break;
|
jpayne@69
|
9552 case METH_O:
|
jpayne@69
|
9553 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
|
jpayne@69
|
9554 break;
|
jpayne@69
|
9555 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
|
jpayne@69
|
9556 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
|
jpayne@69
|
9557 break;
|
jpayne@69
|
9558 case METH_FASTCALL | METH_KEYWORDS:
|
jpayne@69
|
9559 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
|
jpayne@69
|
9560 break;
|
jpayne@69
|
9561 case METH_VARARGS | METH_KEYWORDS:
|
jpayne@69
|
9562 __Pyx_CyFunction_func_vectorcall(op) = NULL;
|
jpayne@69
|
9563 break;
|
jpayne@69
|
9564 default:
|
jpayne@69
|
9565 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
|
jpayne@69
|
9566 Py_DECREF(op);
|
jpayne@69
|
9567 return NULL;
|
jpayne@69
|
9568 }
|
jpayne@69
|
9569 #endif
|
jpayne@69
|
9570 return (PyObject *) op;
|
jpayne@69
|
9571 }
|
jpayne@69
|
9572 static int
|
jpayne@69
|
9573 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
|
jpayne@69
|
9574 {
|
jpayne@69
|
9575 Py_CLEAR(m->func_closure);
|
jpayne@69
|
9576 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9577 Py_CLEAR(m->func);
|
jpayne@69
|
9578 #else
|
jpayne@69
|
9579 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
|
jpayne@69
|
9580 #endif
|
jpayne@69
|
9581 Py_CLEAR(m->func_dict);
|
jpayne@69
|
9582 Py_CLEAR(m->func_name);
|
jpayne@69
|
9583 Py_CLEAR(m->func_qualname);
|
jpayne@69
|
9584 Py_CLEAR(m->func_doc);
|
jpayne@69
|
9585 Py_CLEAR(m->func_globals);
|
jpayne@69
|
9586 Py_CLEAR(m->func_code);
|
jpayne@69
|
9587 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9588 #if PY_VERSION_HEX < 0x030900B1
|
jpayne@69
|
9589 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
|
jpayne@69
|
9590 #else
|
jpayne@69
|
9591 {
|
jpayne@69
|
9592 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
|
jpayne@69
|
9593 ((PyCMethodObject *) (m))->mm_class = NULL;
|
jpayne@69
|
9594 Py_XDECREF(cls);
|
jpayne@69
|
9595 }
|
jpayne@69
|
9596 #endif
|
jpayne@69
|
9597 #endif
|
jpayne@69
|
9598 Py_CLEAR(m->defaults_tuple);
|
jpayne@69
|
9599 Py_CLEAR(m->defaults_kwdict);
|
jpayne@69
|
9600 Py_CLEAR(m->func_annotations);
|
jpayne@69
|
9601 Py_CLEAR(m->func_is_coroutine);
|
jpayne@69
|
9602 if (m->defaults) {
|
jpayne@69
|
9603 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
|
jpayne@69
|
9604 int i;
|
jpayne@69
|
9605 for (i = 0; i < m->defaults_pyobjects; i++)
|
jpayne@69
|
9606 Py_XDECREF(pydefaults[i]);
|
jpayne@69
|
9607 PyObject_Free(m->defaults);
|
jpayne@69
|
9608 m->defaults = NULL;
|
jpayne@69
|
9609 }
|
jpayne@69
|
9610 return 0;
|
jpayne@69
|
9611 }
|
jpayne@69
|
9612 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
|
jpayne@69
|
9613 {
|
jpayne@69
|
9614 if (__Pyx_CyFunction_weakreflist(m) != NULL)
|
jpayne@69
|
9615 PyObject_ClearWeakRefs((PyObject *) m);
|
jpayne@69
|
9616 __Pyx_CyFunction_clear(m);
|
jpayne@69
|
9617 __Pyx_PyHeapTypeObject_GC_Del(m);
|
jpayne@69
|
9618 }
|
jpayne@69
|
9619 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
|
jpayne@69
|
9620 {
|
jpayne@69
|
9621 PyObject_GC_UnTrack(m);
|
jpayne@69
|
9622 __Pyx__CyFunction_dealloc(m);
|
jpayne@69
|
9623 }
|
jpayne@69
|
9624 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
|
jpayne@69
|
9625 {
|
jpayne@69
|
9626 Py_VISIT(m->func_closure);
|
jpayne@69
|
9627 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9628 Py_VISIT(m->func);
|
jpayne@69
|
9629 #else
|
jpayne@69
|
9630 Py_VISIT(((PyCFunctionObject*)m)->m_module);
|
jpayne@69
|
9631 #endif
|
jpayne@69
|
9632 Py_VISIT(m->func_dict);
|
jpayne@69
|
9633 Py_VISIT(m->func_name);
|
jpayne@69
|
9634 Py_VISIT(m->func_qualname);
|
jpayne@69
|
9635 Py_VISIT(m->func_doc);
|
jpayne@69
|
9636 Py_VISIT(m->func_globals);
|
jpayne@69
|
9637 Py_VISIT(m->func_code);
|
jpayne@69
|
9638 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9639 Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
|
jpayne@69
|
9640 #endif
|
jpayne@69
|
9641 Py_VISIT(m->defaults_tuple);
|
jpayne@69
|
9642 Py_VISIT(m->defaults_kwdict);
|
jpayne@69
|
9643 Py_VISIT(m->func_is_coroutine);
|
jpayne@69
|
9644 if (m->defaults) {
|
jpayne@69
|
9645 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
|
jpayne@69
|
9646 int i;
|
jpayne@69
|
9647 for (i = 0; i < m->defaults_pyobjects; i++)
|
jpayne@69
|
9648 Py_VISIT(pydefaults[i]);
|
jpayne@69
|
9649 }
|
jpayne@69
|
9650 return 0;
|
jpayne@69
|
9651 }
|
jpayne@69
|
9652 static PyObject*
|
jpayne@69
|
9653 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
|
jpayne@69
|
9654 {
|
jpayne@69
|
9655 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
9656 return PyUnicode_FromFormat("<cyfunction %U at %p>",
|
jpayne@69
|
9657 op->func_qualname, (void *)op);
|
jpayne@69
|
9658 #else
|
jpayne@69
|
9659 return PyString_FromFormat("<cyfunction %s at %p>",
|
jpayne@69
|
9660 PyString_AsString(op->func_qualname), (void *)op);
|
jpayne@69
|
9661 #endif
|
jpayne@69
|
9662 }
|
jpayne@69
|
9663 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
|
jpayne@69
|
9664 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9665 PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
|
jpayne@69
|
9666 PyObject *py_name = NULL;
|
jpayne@69
|
9667 PyCFunction meth;
|
jpayne@69
|
9668 int flags;
|
jpayne@69
|
9669 meth = PyCFunction_GetFunction(f);
|
jpayne@69
|
9670 if (unlikely(!meth)) return NULL;
|
jpayne@69
|
9671 flags = PyCFunction_GetFlags(f);
|
jpayne@69
|
9672 if (unlikely(flags < 0)) return NULL;
|
jpayne@69
|
9673 #else
|
jpayne@69
|
9674 PyCFunctionObject* f = (PyCFunctionObject*)func;
|
jpayne@69
|
9675 PyCFunction meth = f->m_ml->ml_meth;
|
jpayne@69
|
9676 int flags = f->m_ml->ml_flags;
|
jpayne@69
|
9677 #endif
|
jpayne@69
|
9678 Py_ssize_t size;
|
jpayne@69
|
9679 switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
|
jpayne@69
|
9680 case METH_VARARGS:
|
jpayne@69
|
9681 if (likely(kw == NULL || PyDict_Size(kw) == 0))
|
jpayne@69
|
9682 return (*meth)(self, arg);
|
jpayne@69
|
9683 break;
|
jpayne@69
|
9684 case METH_VARARGS | METH_KEYWORDS:
|
jpayne@69
|
9685 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
|
jpayne@69
|
9686 case METH_NOARGS:
|
jpayne@69
|
9687 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
|
jpayne@69
|
9688 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
9689 size = PyTuple_GET_SIZE(arg);
|
jpayne@69
|
9690 #else
|
jpayne@69
|
9691 size = PyTuple_Size(arg);
|
jpayne@69
|
9692 if (unlikely(size < 0)) return NULL;
|
jpayne@69
|
9693 #endif
|
jpayne@69
|
9694 if (likely(size == 0))
|
jpayne@69
|
9695 return (*meth)(self, NULL);
|
jpayne@69
|
9696 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9697 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
|
jpayne@69
|
9698 if (!py_name) return NULL;
|
jpayne@69
|
9699 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9700 "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
9701 py_name, size);
|
jpayne@69
|
9702 Py_DECREF(py_name);
|
jpayne@69
|
9703 #else
|
jpayne@69
|
9704 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9705 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
9706 f->m_ml->ml_name, size);
|
jpayne@69
|
9707 #endif
|
jpayne@69
|
9708 return NULL;
|
jpayne@69
|
9709 }
|
jpayne@69
|
9710 break;
|
jpayne@69
|
9711 case METH_O:
|
jpayne@69
|
9712 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
|
jpayne@69
|
9713 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
9714 size = PyTuple_GET_SIZE(arg);
|
jpayne@69
|
9715 #else
|
jpayne@69
|
9716 size = PyTuple_Size(arg);
|
jpayne@69
|
9717 if (unlikely(size < 0)) return NULL;
|
jpayne@69
|
9718 #endif
|
jpayne@69
|
9719 if (likely(size == 1)) {
|
jpayne@69
|
9720 PyObject *result, *arg0;
|
jpayne@69
|
9721 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
|
jpayne@69
|
9722 arg0 = PyTuple_GET_ITEM(arg, 0);
|
jpayne@69
|
9723 #else
|
jpayne@69
|
9724 arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
|
jpayne@69
|
9725 #endif
|
jpayne@69
|
9726 result = (*meth)(self, arg0);
|
jpayne@69
|
9727 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
|
jpayne@69
|
9728 Py_DECREF(arg0);
|
jpayne@69
|
9729 #endif
|
jpayne@69
|
9730 return result;
|
jpayne@69
|
9731 }
|
jpayne@69
|
9732 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9733 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
|
jpayne@69
|
9734 if (!py_name) return NULL;
|
jpayne@69
|
9735 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9736 "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
9737 py_name, size);
|
jpayne@69
|
9738 Py_DECREF(py_name);
|
jpayne@69
|
9739 #else
|
jpayne@69
|
9740 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9741 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
9742 f->m_ml->ml_name, size);
|
jpayne@69
|
9743 #endif
|
jpayne@69
|
9744 return NULL;
|
jpayne@69
|
9745 }
|
jpayne@69
|
9746 break;
|
jpayne@69
|
9747 default:
|
jpayne@69
|
9748 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
|
jpayne@69
|
9749 return NULL;
|
jpayne@69
|
9750 }
|
jpayne@69
|
9751 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9752 py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
|
jpayne@69
|
9753 if (!py_name) return NULL;
|
jpayne@69
|
9754 PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
|
jpayne@69
|
9755 py_name);
|
jpayne@69
|
9756 Py_DECREF(py_name);
|
jpayne@69
|
9757 #else
|
jpayne@69
|
9758 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
|
jpayne@69
|
9759 f->m_ml->ml_name);
|
jpayne@69
|
9760 #endif
|
jpayne@69
|
9761 return NULL;
|
jpayne@69
|
9762 }
|
jpayne@69
|
9763 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
jpayne@69
|
9764 PyObject *self, *result;
|
jpayne@69
|
9765 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
9766 self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
|
jpayne@69
|
9767 if (unlikely(!self) && PyErr_Occurred()) return NULL;
|
jpayne@69
|
9768 #else
|
jpayne@69
|
9769 self = ((PyCFunctionObject*)func)->m_self;
|
jpayne@69
|
9770 #endif
|
jpayne@69
|
9771 result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
|
jpayne@69
|
9772 return result;
|
jpayne@69
|
9773 }
|
jpayne@69
|
9774 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
|
jpayne@69
|
9775 PyObject *result;
|
jpayne@69
|
9776 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
|
jpayne@69
|
9777 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
9778 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
|
jpayne@69
|
9779 if (vc) {
|
jpayne@69
|
9780 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
9781 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
|
jpayne@69
|
9782 #else
|
jpayne@69
|
9783 (void) &__Pyx_PyVectorcall_FastCallDict;
|
jpayne@69
|
9784 return PyVectorcall_Call(func, args, kw);
|
jpayne@69
|
9785 #endif
|
jpayne@69
|
9786 }
|
jpayne@69
|
9787 #endif
|
jpayne@69
|
9788 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
|
jpayne@69
|
9789 Py_ssize_t argc;
|
jpayne@69
|
9790 PyObject *new_args;
|
jpayne@69
|
9791 PyObject *self;
|
jpayne@69
|
9792 #if CYTHON_ASSUME_SAFE_MACROS
|
jpayne@69
|
9793 argc = PyTuple_GET_SIZE(args);
|
jpayne@69
|
9794 #else
|
jpayne@69
|
9795 argc = PyTuple_Size(args);
|
jpayne@69
|
9796 if (unlikely(!argc) < 0) return NULL;
|
jpayne@69
|
9797 #endif
|
jpayne@69
|
9798 new_args = PyTuple_GetSlice(args, 1, argc);
|
jpayne@69
|
9799 if (unlikely(!new_args))
|
jpayne@69
|
9800 return NULL;
|
jpayne@69
|
9801 self = PyTuple_GetItem(args, 0);
|
jpayne@69
|
9802 if (unlikely(!self)) {
|
jpayne@69
|
9803 Py_DECREF(new_args);
|
jpayne@69
|
9804 #if PY_MAJOR_VERSION > 2
|
jpayne@69
|
9805 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9806 "unbound method %.200S() needs an argument",
|
jpayne@69
|
9807 cyfunc->func_qualname);
|
jpayne@69
|
9808 #else
|
jpayne@69
|
9809 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
9810 "unbound method needs an argument");
|
jpayne@69
|
9811 #endif
|
jpayne@69
|
9812 return NULL;
|
jpayne@69
|
9813 }
|
jpayne@69
|
9814 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
|
jpayne@69
|
9815 Py_DECREF(new_args);
|
jpayne@69
|
9816 } else {
|
jpayne@69
|
9817 result = __Pyx_CyFunction_Call(func, args, kw);
|
jpayne@69
|
9818 }
|
jpayne@69
|
9819 return result;
|
jpayne@69
|
9820 }
|
jpayne@69
|
9821 #if CYTHON_METH_FASTCALL
|
jpayne@69
|
9822 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
|
jpayne@69
|
9823 {
|
jpayne@69
|
9824 int ret = 0;
|
jpayne@69
|
9825 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
|
jpayne@69
|
9826 if (unlikely(nargs < 1)) {
|
jpayne@69
|
9827 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
|
jpayne@69
|
9828 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
|
jpayne@69
|
9829 return -1;
|
jpayne@69
|
9830 }
|
jpayne@69
|
9831 ret = 1;
|
jpayne@69
|
9832 }
|
jpayne@69
|
9833 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
|
jpayne@69
|
9834 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9835 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
|
jpayne@69
|
9836 return -1;
|
jpayne@69
|
9837 }
|
jpayne@69
|
9838 return ret;
|
jpayne@69
|
9839 }
|
jpayne@69
|
9840 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
|
jpayne@69
|
9841 {
|
jpayne@69
|
9842 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
|
jpayne@69
|
9843 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
|
jpayne@69
|
9844 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
9845 Py_ssize_t nargs = (Py_ssize_t)nargsf;
|
jpayne@69
|
9846 #else
|
jpayne@69
|
9847 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
jpayne@69
|
9848 #endif
|
jpayne@69
|
9849 PyObject *self;
|
jpayne@69
|
9850 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
|
jpayne@69
|
9851 case 1:
|
jpayne@69
|
9852 self = args[0];
|
jpayne@69
|
9853 args += 1;
|
jpayne@69
|
9854 nargs -= 1;
|
jpayne@69
|
9855 break;
|
jpayne@69
|
9856 case 0:
|
jpayne@69
|
9857 self = ((PyCFunctionObject*)cyfunc)->m_self;
|
jpayne@69
|
9858 break;
|
jpayne@69
|
9859 default:
|
jpayne@69
|
9860 return NULL;
|
jpayne@69
|
9861 }
|
jpayne@69
|
9862 if (unlikely(nargs != 0)) {
|
jpayne@69
|
9863 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9864 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
9865 def->ml_name, nargs);
|
jpayne@69
|
9866 return NULL;
|
jpayne@69
|
9867 }
|
jpayne@69
|
9868 return def->ml_meth(self, NULL);
|
jpayne@69
|
9869 }
|
jpayne@69
|
9870 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
|
jpayne@69
|
9871 {
|
jpayne@69
|
9872 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
|
jpayne@69
|
9873 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
|
jpayne@69
|
9874 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
9875 Py_ssize_t nargs = (Py_ssize_t)nargsf;
|
jpayne@69
|
9876 #else
|
jpayne@69
|
9877 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
jpayne@69
|
9878 #endif
|
jpayne@69
|
9879 PyObject *self;
|
jpayne@69
|
9880 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
|
jpayne@69
|
9881 case 1:
|
jpayne@69
|
9882 self = args[0];
|
jpayne@69
|
9883 args += 1;
|
jpayne@69
|
9884 nargs -= 1;
|
jpayne@69
|
9885 break;
|
jpayne@69
|
9886 case 0:
|
jpayne@69
|
9887 self = ((PyCFunctionObject*)cyfunc)->m_self;
|
jpayne@69
|
9888 break;
|
jpayne@69
|
9889 default:
|
jpayne@69
|
9890 return NULL;
|
jpayne@69
|
9891 }
|
jpayne@69
|
9892 if (unlikely(nargs != 1)) {
|
jpayne@69
|
9893 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
9894 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
jpayne@69
|
9895 def->ml_name, nargs);
|
jpayne@69
|
9896 return NULL;
|
jpayne@69
|
9897 }
|
jpayne@69
|
9898 return def->ml_meth(self, args[0]);
|
jpayne@69
|
9899 }
|
jpayne@69
|
9900 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
|
jpayne@69
|
9901 {
|
jpayne@69
|
9902 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
|
jpayne@69
|
9903 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
|
jpayne@69
|
9904 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
9905 Py_ssize_t nargs = (Py_ssize_t)nargsf;
|
jpayne@69
|
9906 #else
|
jpayne@69
|
9907 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
jpayne@69
|
9908 #endif
|
jpayne@69
|
9909 PyObject *self;
|
jpayne@69
|
9910 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
|
jpayne@69
|
9911 case 1:
|
jpayne@69
|
9912 self = args[0];
|
jpayne@69
|
9913 args += 1;
|
jpayne@69
|
9914 nargs -= 1;
|
jpayne@69
|
9915 break;
|
jpayne@69
|
9916 case 0:
|
jpayne@69
|
9917 self = ((PyCFunctionObject*)cyfunc)->m_self;
|
jpayne@69
|
9918 break;
|
jpayne@69
|
9919 default:
|
jpayne@69
|
9920 return NULL;
|
jpayne@69
|
9921 }
|
jpayne@69
|
9922 return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
|
jpayne@69
|
9923 }
|
jpayne@69
|
9924 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
|
jpayne@69
|
9925 {
|
jpayne@69
|
9926 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
|
jpayne@69
|
9927 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
|
jpayne@69
|
9928 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
|
jpayne@69
|
9929 #if CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
9930 Py_ssize_t nargs = (Py_ssize_t)nargsf;
|
jpayne@69
|
9931 #else
|
jpayne@69
|
9932 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
|
jpayne@69
|
9933 #endif
|
jpayne@69
|
9934 PyObject *self;
|
jpayne@69
|
9935 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
|
jpayne@69
|
9936 case 1:
|
jpayne@69
|
9937 self = args[0];
|
jpayne@69
|
9938 args += 1;
|
jpayne@69
|
9939 nargs -= 1;
|
jpayne@69
|
9940 break;
|
jpayne@69
|
9941 case 0:
|
jpayne@69
|
9942 self = ((PyCFunctionObject*)cyfunc)->m_self;
|
jpayne@69
|
9943 break;
|
jpayne@69
|
9944 default:
|
jpayne@69
|
9945 return NULL;
|
jpayne@69
|
9946 }
|
jpayne@69
|
9947 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
|
jpayne@69
|
9948 }
|
jpayne@69
|
9949 #endif
|
jpayne@69
|
9950 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
9951 static PyType_Slot __pyx_CyFunctionType_slots[] = {
|
jpayne@69
|
9952 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
|
jpayne@69
|
9953 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
|
jpayne@69
|
9954 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
|
jpayne@69
|
9955 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
|
jpayne@69
|
9956 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
|
jpayne@69
|
9957 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
|
jpayne@69
|
9958 {Py_tp_members, (void *)__pyx_CyFunction_members},
|
jpayne@69
|
9959 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
|
jpayne@69
|
9960 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
|
jpayne@69
|
9961 {0, 0},
|
jpayne@69
|
9962 };
|
jpayne@69
|
9963 static PyType_Spec __pyx_CyFunctionType_spec = {
|
jpayne@69
|
9964 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
|
jpayne@69
|
9965 sizeof(__pyx_CyFunctionObject),
|
jpayne@69
|
9966 0,
|
jpayne@69
|
9967 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
|
jpayne@69
|
9968 Py_TPFLAGS_METHOD_DESCRIPTOR |
|
jpayne@69
|
9969 #endif
|
jpayne@69
|
9970 #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
|
jpayne@69
|
9971 _Py_TPFLAGS_HAVE_VECTORCALL |
|
jpayne@69
|
9972 #endif
|
jpayne@69
|
9973 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
|
jpayne@69
|
9974 __pyx_CyFunctionType_slots
|
jpayne@69
|
9975 };
|
jpayne@69
|
9976 #else
|
jpayne@69
|
9977 static PyTypeObject __pyx_CyFunctionType_type = {
|
jpayne@69
|
9978 PyVarObject_HEAD_INIT(0, 0)
|
jpayne@69
|
9979 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
|
jpayne@69
|
9980 sizeof(__pyx_CyFunctionObject),
|
jpayne@69
|
9981 0,
|
jpayne@69
|
9982 (destructor) __Pyx_CyFunction_dealloc,
|
jpayne@69
|
9983 #if !CYTHON_METH_FASTCALL
|
jpayne@69
|
9984 0,
|
jpayne@69
|
9985 #elif CYTHON_BACKPORT_VECTORCALL
|
jpayne@69
|
9986 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
|
jpayne@69
|
9987 #else
|
jpayne@69
|
9988 offsetof(PyCFunctionObject, vectorcall),
|
jpayne@69
|
9989 #endif
|
jpayne@69
|
9990 0,
|
jpayne@69
|
9991 0,
|
jpayne@69
|
9992 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
9993 0,
|
jpayne@69
|
9994 #else
|
jpayne@69
|
9995 0,
|
jpayne@69
|
9996 #endif
|
jpayne@69
|
9997 (reprfunc) __Pyx_CyFunction_repr,
|
jpayne@69
|
9998 0,
|
jpayne@69
|
9999 0,
|
jpayne@69
|
10000 0,
|
jpayne@69
|
10001 0,
|
jpayne@69
|
10002 __Pyx_CyFunction_CallAsMethod,
|
jpayne@69
|
10003 0,
|
jpayne@69
|
10004 0,
|
jpayne@69
|
10005 0,
|
jpayne@69
|
10006 0,
|
jpayne@69
|
10007 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
|
jpayne@69
|
10008 Py_TPFLAGS_METHOD_DESCRIPTOR |
|
jpayne@69
|
10009 #endif
|
jpayne@69
|
10010 #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
|
jpayne@69
|
10011 _Py_TPFLAGS_HAVE_VECTORCALL |
|
jpayne@69
|
10012 #endif
|
jpayne@69
|
10013 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
|
jpayne@69
|
10014 0,
|
jpayne@69
|
10015 (traverseproc) __Pyx_CyFunction_traverse,
|
jpayne@69
|
10016 (inquiry) __Pyx_CyFunction_clear,
|
jpayne@69
|
10017 0,
|
jpayne@69
|
10018 #if PY_VERSION_HEX < 0x030500A0
|
jpayne@69
|
10019 offsetof(__pyx_CyFunctionObject, func_weakreflist),
|
jpayne@69
|
10020 #else
|
jpayne@69
|
10021 offsetof(PyCFunctionObject, m_weakreflist),
|
jpayne@69
|
10022 #endif
|
jpayne@69
|
10023 0,
|
jpayne@69
|
10024 0,
|
jpayne@69
|
10025 __pyx_CyFunction_methods,
|
jpayne@69
|
10026 __pyx_CyFunction_members,
|
jpayne@69
|
10027 __pyx_CyFunction_getsets,
|
jpayne@69
|
10028 0,
|
jpayne@69
|
10029 0,
|
jpayne@69
|
10030 __Pyx_PyMethod_New,
|
jpayne@69
|
10031 0,
|
jpayne@69
|
10032 offsetof(__pyx_CyFunctionObject, func_dict),
|
jpayne@69
|
10033 0,
|
jpayne@69
|
10034 0,
|
jpayne@69
|
10035 0,
|
jpayne@69
|
10036 0,
|
jpayne@69
|
10037 0,
|
jpayne@69
|
10038 0,
|
jpayne@69
|
10039 0,
|
jpayne@69
|
10040 0,
|
jpayne@69
|
10041 0,
|
jpayne@69
|
10042 0,
|
jpayne@69
|
10043 0,
|
jpayne@69
|
10044 0,
|
jpayne@69
|
10045 #if PY_VERSION_HEX >= 0x030400a1
|
jpayne@69
|
10046 0,
|
jpayne@69
|
10047 #endif
|
jpayne@69
|
10048 #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
|
jpayne@69
|
10049 0,
|
jpayne@69
|
10050 #endif
|
jpayne@69
|
10051 #if __PYX_NEED_TP_PRINT_SLOT
|
jpayne@69
|
10052 0,
|
jpayne@69
|
10053 #endif
|
jpayne@69
|
10054 #if PY_VERSION_HEX >= 0x030C0000
|
jpayne@69
|
10055 0,
|
jpayne@69
|
10056 #endif
|
jpayne@69
|
10057 #if PY_VERSION_HEX >= 0x030d00A4
|
jpayne@69
|
10058 0,
|
jpayne@69
|
10059 #endif
|
jpayne@69
|
10060 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
|
jpayne@69
|
10061 0,
|
jpayne@69
|
10062 #endif
|
jpayne@69
|
10063 };
|
jpayne@69
|
10064 #endif
|
jpayne@69
|
10065 static int __pyx_CyFunction_init(PyObject *module) {
|
jpayne@69
|
10066 #if CYTHON_USE_TYPE_SPECS
|
jpayne@69
|
10067 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
|
jpayne@69
|
10068 #else
|
jpayne@69
|
10069 CYTHON_UNUSED_VAR(module);
|
jpayne@69
|
10070 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
|
jpayne@69
|
10071 #endif
|
jpayne@69
|
10072 if (unlikely(__pyx_CyFunctionType == NULL)) {
|
jpayne@69
|
10073 return -1;
|
jpayne@69
|
10074 }
|
jpayne@69
|
10075 return 0;
|
jpayne@69
|
10076 }
|
jpayne@69
|
10077 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
|
jpayne@69
|
10078 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
jpayne@69
|
10079 m->defaults = PyObject_Malloc(size);
|
jpayne@69
|
10080 if (unlikely(!m->defaults))
|
jpayne@69
|
10081 return PyErr_NoMemory();
|
jpayne@69
|
10082 memset(m->defaults, 0, size);
|
jpayne@69
|
10083 m->defaults_pyobjects = pyobjects;
|
jpayne@69
|
10084 m->defaults_size = size;
|
jpayne@69
|
10085 return m->defaults;
|
jpayne@69
|
10086 }
|
jpayne@69
|
10087 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
|
jpayne@69
|
10088 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
jpayne@69
|
10089 m->defaults_tuple = tuple;
|
jpayne@69
|
10090 Py_INCREF(tuple);
|
jpayne@69
|
10091 }
|
jpayne@69
|
10092 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
|
jpayne@69
|
10093 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
jpayne@69
|
10094 m->defaults_kwdict = dict;
|
jpayne@69
|
10095 Py_INCREF(dict);
|
jpayne@69
|
10096 }
|
jpayne@69
|
10097 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
|
jpayne@69
|
10098 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
jpayne@69
|
10099 m->func_annotations = dict;
|
jpayne@69
|
10100 Py_INCREF(dict);
|
jpayne@69
|
10101 }
|
jpayne@69
|
10102
|
jpayne@69
|
10103 /* CythonFunction */
|
jpayne@69
|
10104 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
|
jpayne@69
|
10105 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
|
jpayne@69
|
10106 PyObject *op = __Pyx_CyFunction_Init(
|
jpayne@69
|
10107 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
|
jpayne@69
|
10108 ml, flags, qualname, closure, module, globals, code
|
jpayne@69
|
10109 );
|
jpayne@69
|
10110 if (likely(op)) {
|
jpayne@69
|
10111 PyObject_GC_Track(op);
|
jpayne@69
|
10112 }
|
jpayne@69
|
10113 return op;
|
jpayne@69
|
10114 }
|
jpayne@69
|
10115
|
jpayne@69
|
10116 /* PyDictVersioning */
|
jpayne@69
|
10117 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
10118 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
|
jpayne@69
|
10119 PyObject *dict = Py_TYPE(obj)->tp_dict;
|
jpayne@69
|
10120 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
|
jpayne@69
|
10121 }
|
jpayne@69
|
10122 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
|
jpayne@69
|
10123 PyObject **dictptr = NULL;
|
jpayne@69
|
10124 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
|
jpayne@69
|
10125 if (offset) {
|
jpayne@69
|
10126 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
10127 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
|
jpayne@69
|
10128 #else
|
jpayne@69
|
10129 dictptr = _PyObject_GetDictPtr(obj);
|
jpayne@69
|
10130 #endif
|
jpayne@69
|
10131 }
|
jpayne@69
|
10132 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
|
jpayne@69
|
10133 }
|
jpayne@69
|
10134 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
|
jpayne@69
|
10135 PyObject *dict = Py_TYPE(obj)->tp_dict;
|
jpayne@69
|
10136 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
|
jpayne@69
|
10137 return 0;
|
jpayne@69
|
10138 return obj_dict_version == __Pyx_get_object_dict_version(obj);
|
jpayne@69
|
10139 }
|
jpayne@69
|
10140 #endif
|
jpayne@69
|
10141
|
jpayne@69
|
10142 /* CLineInTraceback */
|
jpayne@69
|
10143 #ifndef CYTHON_CLINE_IN_TRACEBACK
|
jpayne@69
|
10144 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
|
jpayne@69
|
10145 PyObject *use_cline;
|
jpayne@69
|
10146 PyObject *ptype, *pvalue, *ptraceback;
|
jpayne@69
|
10147 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
10148 PyObject **cython_runtime_dict;
|
jpayne@69
|
10149 #endif
|
jpayne@69
|
10150 CYTHON_MAYBE_UNUSED_VAR(tstate);
|
jpayne@69
|
10151 if (unlikely(!__pyx_cython_runtime)) {
|
jpayne@69
|
10152 return c_line;
|
jpayne@69
|
10153 }
|
jpayne@69
|
10154 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
jpayne@69
|
10155 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
10156 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
|
jpayne@69
|
10157 if (likely(cython_runtime_dict)) {
|
jpayne@69
|
10158 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
|
jpayne@69
|
10159 use_cline, *cython_runtime_dict,
|
jpayne@69
|
10160 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
|
jpayne@69
|
10161 } else
|
jpayne@69
|
10162 #endif
|
jpayne@69
|
10163 {
|
jpayne@69
|
10164 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
|
jpayne@69
|
10165 if (use_cline_obj) {
|
jpayne@69
|
10166 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
|
jpayne@69
|
10167 Py_DECREF(use_cline_obj);
|
jpayne@69
|
10168 } else {
|
jpayne@69
|
10169 PyErr_Clear();
|
jpayne@69
|
10170 use_cline = NULL;
|
jpayne@69
|
10171 }
|
jpayne@69
|
10172 }
|
jpayne@69
|
10173 if (!use_cline) {
|
jpayne@69
|
10174 c_line = 0;
|
jpayne@69
|
10175 (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
|
jpayne@69
|
10176 }
|
jpayne@69
|
10177 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
|
jpayne@69
|
10178 c_line = 0;
|
jpayne@69
|
10179 }
|
jpayne@69
|
10180 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
jpayne@69
|
10181 return c_line;
|
jpayne@69
|
10182 }
|
jpayne@69
|
10183 #endif
|
jpayne@69
|
10184
|
jpayne@69
|
10185 /* CodeObjectCache */
|
jpayne@69
|
10186 #if !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
10187 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
|
jpayne@69
|
10188 int start = 0, mid = 0, end = count - 1;
|
jpayne@69
|
10189 if (end >= 0 && code_line > entries[end].code_line) {
|
jpayne@69
|
10190 return count;
|
jpayne@69
|
10191 }
|
jpayne@69
|
10192 while (start < end) {
|
jpayne@69
|
10193 mid = start + (end - start) / 2;
|
jpayne@69
|
10194 if (code_line < entries[mid].code_line) {
|
jpayne@69
|
10195 end = mid;
|
jpayne@69
|
10196 } else if (code_line > entries[mid].code_line) {
|
jpayne@69
|
10197 start = mid + 1;
|
jpayne@69
|
10198 } else {
|
jpayne@69
|
10199 return mid;
|
jpayne@69
|
10200 }
|
jpayne@69
|
10201 }
|
jpayne@69
|
10202 if (code_line <= entries[mid].code_line) {
|
jpayne@69
|
10203 return mid;
|
jpayne@69
|
10204 } else {
|
jpayne@69
|
10205 return mid + 1;
|
jpayne@69
|
10206 }
|
jpayne@69
|
10207 }
|
jpayne@69
|
10208 static PyCodeObject *__pyx_find_code_object(int code_line) {
|
jpayne@69
|
10209 PyCodeObject* code_object;
|
jpayne@69
|
10210 int pos;
|
jpayne@69
|
10211 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
|
jpayne@69
|
10212 return NULL;
|
jpayne@69
|
10213 }
|
jpayne@69
|
10214 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
jpayne@69
|
10215 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
|
jpayne@69
|
10216 return NULL;
|
jpayne@69
|
10217 }
|
jpayne@69
|
10218 code_object = __pyx_code_cache.entries[pos].code_object;
|
jpayne@69
|
10219 Py_INCREF(code_object);
|
jpayne@69
|
10220 return code_object;
|
jpayne@69
|
10221 }
|
jpayne@69
|
10222 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
|
jpayne@69
|
10223 int pos, i;
|
jpayne@69
|
10224 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
|
jpayne@69
|
10225 if (unlikely(!code_line)) {
|
jpayne@69
|
10226 return;
|
jpayne@69
|
10227 }
|
jpayne@69
|
10228 if (unlikely(!entries)) {
|
jpayne@69
|
10229 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
|
jpayne@69
|
10230 if (likely(entries)) {
|
jpayne@69
|
10231 __pyx_code_cache.entries = entries;
|
jpayne@69
|
10232 __pyx_code_cache.max_count = 64;
|
jpayne@69
|
10233 __pyx_code_cache.count = 1;
|
jpayne@69
|
10234 entries[0].code_line = code_line;
|
jpayne@69
|
10235 entries[0].code_object = code_object;
|
jpayne@69
|
10236 Py_INCREF(code_object);
|
jpayne@69
|
10237 }
|
jpayne@69
|
10238 return;
|
jpayne@69
|
10239 }
|
jpayne@69
|
10240 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
jpayne@69
|
10241 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
|
jpayne@69
|
10242 PyCodeObject* tmp = entries[pos].code_object;
|
jpayne@69
|
10243 entries[pos].code_object = code_object;
|
jpayne@69
|
10244 Py_DECREF(tmp);
|
jpayne@69
|
10245 return;
|
jpayne@69
|
10246 }
|
jpayne@69
|
10247 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
|
jpayne@69
|
10248 int new_max = __pyx_code_cache.max_count + 64;
|
jpayne@69
|
10249 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
|
jpayne@69
|
10250 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
|
jpayne@69
|
10251 if (unlikely(!entries)) {
|
jpayne@69
|
10252 return;
|
jpayne@69
|
10253 }
|
jpayne@69
|
10254 __pyx_code_cache.entries = entries;
|
jpayne@69
|
10255 __pyx_code_cache.max_count = new_max;
|
jpayne@69
|
10256 }
|
jpayne@69
|
10257 for (i=__pyx_code_cache.count; i>pos; i--) {
|
jpayne@69
|
10258 entries[i] = entries[i-1];
|
jpayne@69
|
10259 }
|
jpayne@69
|
10260 entries[pos].code_line = code_line;
|
jpayne@69
|
10261 entries[pos].code_object = code_object;
|
jpayne@69
|
10262 __pyx_code_cache.count++;
|
jpayne@69
|
10263 Py_INCREF(code_object);
|
jpayne@69
|
10264 }
|
jpayne@69
|
10265 #endif
|
jpayne@69
|
10266
|
jpayne@69
|
10267 /* AddTraceback */
|
jpayne@69
|
10268 #include "compile.h"
|
jpayne@69
|
10269 #include "frameobject.h"
|
jpayne@69
|
10270 #include "traceback.h"
|
jpayne@69
|
10271 #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
10272 #ifndef Py_BUILD_CORE
|
jpayne@69
|
10273 #define Py_BUILD_CORE 1
|
jpayne@69
|
10274 #endif
|
jpayne@69
|
10275 #include "internal/pycore_frame.h"
|
jpayne@69
|
10276 #endif
|
jpayne@69
|
10277 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
10278 static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
|
jpayne@69
|
10279 PyObject *firstlineno, PyObject *name) {
|
jpayne@69
|
10280 PyObject *replace = NULL;
|
jpayne@69
|
10281 if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
|
jpayne@69
|
10282 if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
|
jpayne@69
|
10283 replace = PyObject_GetAttrString(code, "replace");
|
jpayne@69
|
10284 if (likely(replace)) {
|
jpayne@69
|
10285 PyObject *result;
|
jpayne@69
|
10286 result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
|
jpayne@69
|
10287 Py_DECREF(replace);
|
jpayne@69
|
10288 return result;
|
jpayne@69
|
10289 }
|
jpayne@69
|
10290 PyErr_Clear();
|
jpayne@69
|
10291 #if __PYX_LIMITED_VERSION_HEX < 0x030780000
|
jpayne@69
|
10292 {
|
jpayne@69
|
10293 PyObject *compiled = NULL, *result = NULL;
|
jpayne@69
|
10294 if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
|
jpayne@69
|
10295 if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
|
jpayne@69
|
10296 compiled = Py_CompileString(
|
jpayne@69
|
10297 "out = type(code)(\n"
|
jpayne@69
|
10298 " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
|
jpayne@69
|
10299 " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
|
jpayne@69
|
10300 " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
|
jpayne@69
|
10301 " code.co_lnotab)\n", "<dummy>", Py_file_input);
|
jpayne@69
|
10302 if (!compiled) return NULL;
|
jpayne@69
|
10303 result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
|
jpayne@69
|
10304 Py_DECREF(compiled);
|
jpayne@69
|
10305 if (!result) PyErr_Print();
|
jpayne@69
|
10306 Py_DECREF(result);
|
jpayne@69
|
10307 result = PyDict_GetItemString(scratch_dict, "out");
|
jpayne@69
|
10308 if (result) Py_INCREF(result);
|
jpayne@69
|
10309 return result;
|
jpayne@69
|
10310 }
|
jpayne@69
|
10311 #else
|
jpayne@69
|
10312 return NULL;
|
jpayne@69
|
10313 #endif
|
jpayne@69
|
10314 }
|
jpayne@69
|
10315 static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
jpayne@69
|
10316 int py_line, const char *filename) {
|
jpayne@69
|
10317 PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
|
jpayne@69
|
10318 PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
|
jpayne@69
|
10319 PyObject *exc_type, *exc_value, *exc_traceback;
|
jpayne@69
|
10320 int success = 0;
|
jpayne@69
|
10321 if (c_line) {
|
jpayne@69
|
10322 (void) __pyx_cfilenm;
|
jpayne@69
|
10323 (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
|
jpayne@69
|
10324 }
|
jpayne@69
|
10325 PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
|
jpayne@69
|
10326 code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
|
jpayne@69
|
10327 if (unlikely(!code_object)) goto bad;
|
jpayne@69
|
10328 py_py_line = PyLong_FromLong(py_line);
|
jpayne@69
|
10329 if (unlikely(!py_py_line)) goto bad;
|
jpayne@69
|
10330 py_funcname = PyUnicode_FromString(funcname);
|
jpayne@69
|
10331 if (unlikely(!py_funcname)) goto bad;
|
jpayne@69
|
10332 dict = PyDict_New();
|
jpayne@69
|
10333 if (unlikely(!dict)) goto bad;
|
jpayne@69
|
10334 {
|
jpayne@69
|
10335 PyObject *old_code_object = code_object;
|
jpayne@69
|
10336 code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
|
jpayne@69
|
10337 Py_DECREF(old_code_object);
|
jpayne@69
|
10338 }
|
jpayne@69
|
10339 if (unlikely(!code_object)) goto bad;
|
jpayne@69
|
10340 getframe = PySys_GetObject("_getframe");
|
jpayne@69
|
10341 if (unlikely(!getframe)) goto bad;
|
jpayne@69
|
10342 if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
|
jpayne@69
|
10343 frame = PyEval_EvalCode(code_object, dict, dict);
|
jpayne@69
|
10344 if (unlikely(!frame) || frame == Py_None) goto bad;
|
jpayne@69
|
10345 success = 1;
|
jpayne@69
|
10346 bad:
|
jpayne@69
|
10347 PyErr_Restore(exc_type, exc_value, exc_traceback);
|
jpayne@69
|
10348 Py_XDECREF(code_object);
|
jpayne@69
|
10349 Py_XDECREF(py_py_line);
|
jpayne@69
|
10350 Py_XDECREF(py_funcname);
|
jpayne@69
|
10351 Py_XDECREF(dict);
|
jpayne@69
|
10352 Py_XDECREF(replace);
|
jpayne@69
|
10353 if (success) {
|
jpayne@69
|
10354 PyTraceBack_Here(
|
jpayne@69
|
10355 (struct _frame*)frame);
|
jpayne@69
|
10356 }
|
jpayne@69
|
10357 Py_XDECREF(frame);
|
jpayne@69
|
10358 }
|
jpayne@69
|
10359 #else
|
jpayne@69
|
10360 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
jpayne@69
|
10361 const char *funcname, int c_line,
|
jpayne@69
|
10362 int py_line, const char *filename) {
|
jpayne@69
|
10363 PyCodeObject *py_code = NULL;
|
jpayne@69
|
10364 PyObject *py_funcname = NULL;
|
jpayne@69
|
10365 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10366 PyObject *py_srcfile = NULL;
|
jpayne@69
|
10367 py_srcfile = PyString_FromString(filename);
|
jpayne@69
|
10368 if (!py_srcfile) goto bad;
|
jpayne@69
|
10369 #endif
|
jpayne@69
|
10370 if (c_line) {
|
jpayne@69
|
10371 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10372 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
jpayne@69
|
10373 if (!py_funcname) goto bad;
|
jpayne@69
|
10374 #else
|
jpayne@69
|
10375 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
jpayne@69
|
10376 if (!py_funcname) goto bad;
|
jpayne@69
|
10377 funcname = PyUnicode_AsUTF8(py_funcname);
|
jpayne@69
|
10378 if (!funcname) goto bad;
|
jpayne@69
|
10379 #endif
|
jpayne@69
|
10380 }
|
jpayne@69
|
10381 else {
|
jpayne@69
|
10382 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10383 py_funcname = PyString_FromString(funcname);
|
jpayne@69
|
10384 if (!py_funcname) goto bad;
|
jpayne@69
|
10385 #endif
|
jpayne@69
|
10386 }
|
jpayne@69
|
10387 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10388 py_code = __Pyx_PyCode_New(
|
jpayne@69
|
10389 0,
|
jpayne@69
|
10390 0,
|
jpayne@69
|
10391 0,
|
jpayne@69
|
10392 0,
|
jpayne@69
|
10393 0,
|
jpayne@69
|
10394 0,
|
jpayne@69
|
10395 __pyx_empty_bytes, /*PyObject *code,*/
|
jpayne@69
|
10396 __pyx_empty_tuple, /*PyObject *consts,*/
|
jpayne@69
|
10397 __pyx_empty_tuple, /*PyObject *names,*/
|
jpayne@69
|
10398 __pyx_empty_tuple, /*PyObject *varnames,*/
|
jpayne@69
|
10399 __pyx_empty_tuple, /*PyObject *freevars,*/
|
jpayne@69
|
10400 __pyx_empty_tuple, /*PyObject *cellvars,*/
|
jpayne@69
|
10401 py_srcfile, /*PyObject *filename,*/
|
jpayne@69
|
10402 py_funcname, /*PyObject *name,*/
|
jpayne@69
|
10403 py_line,
|
jpayne@69
|
10404 __pyx_empty_bytes /*PyObject *lnotab*/
|
jpayne@69
|
10405 );
|
jpayne@69
|
10406 Py_DECREF(py_srcfile);
|
jpayne@69
|
10407 #else
|
jpayne@69
|
10408 py_code = PyCode_NewEmpty(filename, funcname, py_line);
|
jpayne@69
|
10409 #endif
|
jpayne@69
|
10410 Py_XDECREF(py_funcname);
|
jpayne@69
|
10411 return py_code;
|
jpayne@69
|
10412 bad:
|
jpayne@69
|
10413 Py_XDECREF(py_funcname);
|
jpayne@69
|
10414 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10415 Py_XDECREF(py_srcfile);
|
jpayne@69
|
10416 #endif
|
jpayne@69
|
10417 return NULL;
|
jpayne@69
|
10418 }
|
jpayne@69
|
10419 static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
jpayne@69
|
10420 int py_line, const char *filename) {
|
jpayne@69
|
10421 PyCodeObject *py_code = 0;
|
jpayne@69
|
10422 PyFrameObject *py_frame = 0;
|
jpayne@69
|
10423 PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
jpayne@69
|
10424 PyObject *ptype, *pvalue, *ptraceback;
|
jpayne@69
|
10425 if (c_line) {
|
jpayne@69
|
10426 c_line = __Pyx_CLineForTraceback(tstate, c_line);
|
jpayne@69
|
10427 }
|
jpayne@69
|
10428 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
|
jpayne@69
|
10429 if (!py_code) {
|
jpayne@69
|
10430 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
jpayne@69
|
10431 py_code = __Pyx_CreateCodeObjectForTraceback(
|
jpayne@69
|
10432 funcname, c_line, py_line, filename);
|
jpayne@69
|
10433 if (!py_code) {
|
jpayne@69
|
10434 /* If the code object creation fails, then we should clear the
|
jpayne@69
|
10435 fetched exception references and propagate the new exception */
|
jpayne@69
|
10436 Py_XDECREF(ptype);
|
jpayne@69
|
10437 Py_XDECREF(pvalue);
|
jpayne@69
|
10438 Py_XDECREF(ptraceback);
|
jpayne@69
|
10439 goto bad;
|
jpayne@69
|
10440 }
|
jpayne@69
|
10441 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
jpayne@69
|
10442 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
|
jpayne@69
|
10443 }
|
jpayne@69
|
10444 py_frame = PyFrame_New(
|
jpayne@69
|
10445 tstate, /*PyThreadState *tstate,*/
|
jpayne@69
|
10446 py_code, /*PyCodeObject *code,*/
|
jpayne@69
|
10447 __pyx_d, /*PyObject *globals,*/
|
jpayne@69
|
10448 0 /*PyObject *locals*/
|
jpayne@69
|
10449 );
|
jpayne@69
|
10450 if (!py_frame) goto bad;
|
jpayne@69
|
10451 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
|
jpayne@69
|
10452 PyTraceBack_Here(py_frame);
|
jpayne@69
|
10453 bad:
|
jpayne@69
|
10454 Py_XDECREF(py_code);
|
jpayne@69
|
10455 Py_XDECREF(py_frame);
|
jpayne@69
|
10456 }
|
jpayne@69
|
10457 #endif
|
jpayne@69
|
10458
|
jpayne@69
|
10459 /* CIntFromPyVerify */
|
jpayne@69
|
10460 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
|
jpayne@69
|
10461 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
|
jpayne@69
|
10462 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
|
jpayne@69
|
10463 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
|
jpayne@69
|
10464 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
|
jpayne@69
|
10465 {\
|
jpayne@69
|
10466 func_type value = func_value;\
|
jpayne@69
|
10467 if (sizeof(target_type) < sizeof(func_type)) {\
|
jpayne@69
|
10468 if (unlikely(value != (func_type) (target_type) value)) {\
|
jpayne@69
|
10469 func_type zero = 0;\
|
jpayne@69
|
10470 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
|
jpayne@69
|
10471 return (target_type) -1;\
|
jpayne@69
|
10472 if (is_unsigned && unlikely(value < zero))\
|
jpayne@69
|
10473 goto raise_neg_overflow;\
|
jpayne@69
|
10474 else\
|
jpayne@69
|
10475 goto raise_overflow;\
|
jpayne@69
|
10476 }\
|
jpayne@69
|
10477 }\
|
jpayne@69
|
10478 return (target_type) value;\
|
jpayne@69
|
10479 }
|
jpayne@69
|
10480
|
jpayne@69
|
10481 /* CIntFromPy */
|
jpayne@69
|
10482 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
jpayne@69
|
10483 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
10484 #pragma GCC diagnostic push
|
jpayne@69
|
10485 #pragma GCC diagnostic ignored "-Wconversion"
|
jpayne@69
|
10486 #endif
|
jpayne@69
|
10487 const int neg_one = (int) -1, const_zero = (int) 0;
|
jpayne@69
|
10488 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
10489 #pragma GCC diagnostic pop
|
jpayne@69
|
10490 #endif
|
jpayne@69
|
10491 const int is_unsigned = neg_one > const_zero;
|
jpayne@69
|
10492 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10493 if (likely(PyInt_Check(x))) {
|
jpayne@69
|
10494 if ((sizeof(int) < sizeof(long))) {
|
jpayne@69
|
10495 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
|
jpayne@69
|
10496 } else {
|
jpayne@69
|
10497 long val = PyInt_AS_LONG(x);
|
jpayne@69
|
10498 if (is_unsigned && unlikely(val < 0)) {
|
jpayne@69
|
10499 goto raise_neg_overflow;
|
jpayne@69
|
10500 }
|
jpayne@69
|
10501 return (int) val;
|
jpayne@69
|
10502 }
|
jpayne@69
|
10503 }
|
jpayne@69
|
10504 #endif
|
jpayne@69
|
10505 if (unlikely(!PyLong_Check(x))) {
|
jpayne@69
|
10506 int val;
|
jpayne@69
|
10507 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
jpayne@69
|
10508 if (!tmp) return (int) -1;
|
jpayne@69
|
10509 val = __Pyx_PyInt_As_int(tmp);
|
jpayne@69
|
10510 Py_DECREF(tmp);
|
jpayne@69
|
10511 return val;
|
jpayne@69
|
10512 }
|
jpayne@69
|
10513 if (is_unsigned) {
|
jpayne@69
|
10514 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
10515 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
jpayne@69
|
10516 goto raise_neg_overflow;
|
jpayne@69
|
10517 } else if (__Pyx_PyLong_IsCompact(x)) {
|
jpayne@69
|
10518 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
jpayne@69
|
10519 } else {
|
jpayne@69
|
10520 const digit* digits = __Pyx_PyLong_Digits(x);
|
jpayne@69
|
10521 assert(__Pyx_PyLong_DigitCount(x) > 1);
|
jpayne@69
|
10522 switch (__Pyx_PyLong_DigitCount(x)) {
|
jpayne@69
|
10523 case 2:
|
jpayne@69
|
10524 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
|
jpayne@69
|
10525 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10526 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10527 } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10528 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
jpayne@69
|
10529 }
|
jpayne@69
|
10530 }
|
jpayne@69
|
10531 break;
|
jpayne@69
|
10532 case 3:
|
jpayne@69
|
10533 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10534 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10535 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10536 } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10537 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
jpayne@69
|
10538 }
|
jpayne@69
|
10539 }
|
jpayne@69
|
10540 break;
|
jpayne@69
|
10541 case 4:
|
jpayne@69
|
10542 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10543 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10544 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10545 } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10546 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
jpayne@69
|
10547 }
|
jpayne@69
|
10548 }
|
jpayne@69
|
10549 break;
|
jpayne@69
|
10550 }
|
jpayne@69
|
10551 }
|
jpayne@69
|
10552 #endif
|
jpayne@69
|
10553 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
jpayne@69
|
10554 if (unlikely(Py_SIZE(x) < 0)) {
|
jpayne@69
|
10555 goto raise_neg_overflow;
|
jpayne@69
|
10556 }
|
jpayne@69
|
10557 #else
|
jpayne@69
|
10558 {
|
jpayne@69
|
10559 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
jpayne@69
|
10560 if (unlikely(result < 0))
|
jpayne@69
|
10561 return (int) -1;
|
jpayne@69
|
10562 if (unlikely(result == 1))
|
jpayne@69
|
10563 goto raise_neg_overflow;
|
jpayne@69
|
10564 }
|
jpayne@69
|
10565 #endif
|
jpayne@69
|
10566 if ((sizeof(int) <= sizeof(unsigned long))) {
|
jpayne@69
|
10567 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
|
jpayne@69
|
10568 #ifdef HAVE_LONG_LONG
|
jpayne@69
|
10569 } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
|
jpayne@69
|
10570 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
jpayne@69
|
10571 #endif
|
jpayne@69
|
10572 }
|
jpayne@69
|
10573 } else {
|
jpayne@69
|
10574 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
10575 if (__Pyx_PyLong_IsCompact(x)) {
|
jpayne@69
|
10576 __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
jpayne@69
|
10577 } else {
|
jpayne@69
|
10578 const digit* digits = __Pyx_PyLong_Digits(x);
|
jpayne@69
|
10579 assert(__Pyx_PyLong_DigitCount(x) > 1);
|
jpayne@69
|
10580 switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
jpayne@69
|
10581 case -2:
|
jpayne@69
|
10582 if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
|
jpayne@69
|
10583 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10584 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10585 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10586 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
jpayne@69
|
10587 }
|
jpayne@69
|
10588 }
|
jpayne@69
|
10589 break;
|
jpayne@69
|
10590 case 2:
|
jpayne@69
|
10591 if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
|
jpayne@69
|
10592 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10593 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10594 } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10595 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
jpayne@69
|
10596 }
|
jpayne@69
|
10597 }
|
jpayne@69
|
10598 break;
|
jpayne@69
|
10599 case -3:
|
jpayne@69
|
10600 if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10601 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10602 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10603 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10604 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
jpayne@69
|
10605 }
|
jpayne@69
|
10606 }
|
jpayne@69
|
10607 break;
|
jpayne@69
|
10608 case 3:
|
jpayne@69
|
10609 if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10610 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10611 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10612 } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10613 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
jpayne@69
|
10614 }
|
jpayne@69
|
10615 }
|
jpayne@69
|
10616 break;
|
jpayne@69
|
10617 case -4:
|
jpayne@69
|
10618 if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10619 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10620 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10621 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10622 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
jpayne@69
|
10623 }
|
jpayne@69
|
10624 }
|
jpayne@69
|
10625 break;
|
jpayne@69
|
10626 case 4:
|
jpayne@69
|
10627 if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10628 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10629 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10630 } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10631 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
jpayne@69
|
10632 }
|
jpayne@69
|
10633 }
|
jpayne@69
|
10634 break;
|
jpayne@69
|
10635 }
|
jpayne@69
|
10636 }
|
jpayne@69
|
10637 #endif
|
jpayne@69
|
10638 if ((sizeof(int) <= sizeof(long))) {
|
jpayne@69
|
10639 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
|
jpayne@69
|
10640 #ifdef HAVE_LONG_LONG
|
jpayne@69
|
10641 } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
|
jpayne@69
|
10642 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
|
jpayne@69
|
10643 #endif
|
jpayne@69
|
10644 }
|
jpayne@69
|
10645 }
|
jpayne@69
|
10646 {
|
jpayne@69
|
10647 int val;
|
jpayne@69
|
10648 int ret = -1;
|
jpayne@69
|
10649 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
10650 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
jpayne@69
|
10651 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
jpayne@69
|
10652 if (unlikely(bytes_copied == -1)) {
|
jpayne@69
|
10653 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
jpayne@69
|
10654 goto raise_overflow;
|
jpayne@69
|
10655 } else {
|
jpayne@69
|
10656 ret = 0;
|
jpayne@69
|
10657 }
|
jpayne@69
|
10658 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
jpayne@69
|
10659 int one = 1; int is_little = (int)*(unsigned char *)&one;
|
jpayne@69
|
10660 unsigned char *bytes = (unsigned char *)&val;
|
jpayne@69
|
10661 ret = _PyLong_AsByteArray((PyLongObject *)x,
|
jpayne@69
|
10662 bytes, sizeof(val),
|
jpayne@69
|
10663 is_little, !is_unsigned);
|
jpayne@69
|
10664 #else
|
jpayne@69
|
10665 PyObject *v;
|
jpayne@69
|
10666 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
jpayne@69
|
10667 int bits, remaining_bits, is_negative = 0;
|
jpayne@69
|
10668 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
jpayne@69
|
10669 if (likely(PyLong_CheckExact(x))) {
|
jpayne@69
|
10670 v = __Pyx_NewRef(x);
|
jpayne@69
|
10671 } else {
|
jpayne@69
|
10672 v = PyNumber_Long(x);
|
jpayne@69
|
10673 if (unlikely(!v)) return (int) -1;
|
jpayne@69
|
10674 assert(PyLong_CheckExact(v));
|
jpayne@69
|
10675 }
|
jpayne@69
|
10676 {
|
jpayne@69
|
10677 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
jpayne@69
|
10678 if (unlikely(result < 0)) {
|
jpayne@69
|
10679 Py_DECREF(v);
|
jpayne@69
|
10680 return (int) -1;
|
jpayne@69
|
10681 }
|
jpayne@69
|
10682 is_negative = result == 1;
|
jpayne@69
|
10683 }
|
jpayne@69
|
10684 if (is_unsigned && unlikely(is_negative)) {
|
jpayne@69
|
10685 Py_DECREF(v);
|
jpayne@69
|
10686 goto raise_neg_overflow;
|
jpayne@69
|
10687 } else if (is_negative) {
|
jpayne@69
|
10688 stepval = PyNumber_Invert(v);
|
jpayne@69
|
10689 Py_DECREF(v);
|
jpayne@69
|
10690 if (unlikely(!stepval))
|
jpayne@69
|
10691 return (int) -1;
|
jpayne@69
|
10692 } else {
|
jpayne@69
|
10693 stepval = v;
|
jpayne@69
|
10694 }
|
jpayne@69
|
10695 v = NULL;
|
jpayne@69
|
10696 val = (int) 0;
|
jpayne@69
|
10697 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
jpayne@69
|
10698 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
jpayne@69
|
10699 for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
|
jpayne@69
|
10700 PyObject *tmp, *digit;
|
jpayne@69
|
10701 long idigit;
|
jpayne@69
|
10702 digit = PyNumber_And(stepval, mask);
|
jpayne@69
|
10703 if (unlikely(!digit)) goto done;
|
jpayne@69
|
10704 idigit = PyLong_AsLong(digit);
|
jpayne@69
|
10705 Py_DECREF(digit);
|
jpayne@69
|
10706 if (unlikely(idigit < 0)) goto done;
|
jpayne@69
|
10707 val |= ((int) idigit) << bits;
|
jpayne@69
|
10708 tmp = PyNumber_Rshift(stepval, shift);
|
jpayne@69
|
10709 if (unlikely(!tmp)) goto done;
|
jpayne@69
|
10710 Py_DECREF(stepval); stepval = tmp;
|
jpayne@69
|
10711 }
|
jpayne@69
|
10712 Py_DECREF(shift); shift = NULL;
|
jpayne@69
|
10713 Py_DECREF(mask); mask = NULL;
|
jpayne@69
|
10714 {
|
jpayne@69
|
10715 long idigit = PyLong_AsLong(stepval);
|
jpayne@69
|
10716 if (unlikely(idigit < 0)) goto done;
|
jpayne@69
|
10717 remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
|
jpayne@69
|
10718 if (unlikely(idigit >= (1L << remaining_bits)))
|
jpayne@69
|
10719 goto raise_overflow;
|
jpayne@69
|
10720 val |= ((int) idigit) << bits;
|
jpayne@69
|
10721 }
|
jpayne@69
|
10722 if (!is_unsigned) {
|
jpayne@69
|
10723 if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
|
jpayne@69
|
10724 goto raise_overflow;
|
jpayne@69
|
10725 if (is_negative)
|
jpayne@69
|
10726 val = ~val;
|
jpayne@69
|
10727 }
|
jpayne@69
|
10728 ret = 0;
|
jpayne@69
|
10729 done:
|
jpayne@69
|
10730 Py_XDECREF(shift);
|
jpayne@69
|
10731 Py_XDECREF(mask);
|
jpayne@69
|
10732 Py_XDECREF(stepval);
|
jpayne@69
|
10733 #endif
|
jpayne@69
|
10734 if (unlikely(ret))
|
jpayne@69
|
10735 return (int) -1;
|
jpayne@69
|
10736 return val;
|
jpayne@69
|
10737 }
|
jpayne@69
|
10738 raise_overflow:
|
jpayne@69
|
10739 PyErr_SetString(PyExc_OverflowError,
|
jpayne@69
|
10740 "value too large to convert to int");
|
jpayne@69
|
10741 return (int) -1;
|
jpayne@69
|
10742 raise_neg_overflow:
|
jpayne@69
|
10743 PyErr_SetString(PyExc_OverflowError,
|
jpayne@69
|
10744 "can't convert negative value to int");
|
jpayne@69
|
10745 return (int) -1;
|
jpayne@69
|
10746 }
|
jpayne@69
|
10747
|
jpayne@69
|
10748 /* FormatTypeName */
|
jpayne@69
|
10749 #if CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
10750 static __Pyx_TypeName
|
jpayne@69
|
10751 __Pyx_PyType_GetName(PyTypeObject* tp)
|
jpayne@69
|
10752 {
|
jpayne@69
|
10753 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
|
jpayne@69
|
10754 __pyx_n_s_name);
|
jpayne@69
|
10755 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
|
jpayne@69
|
10756 PyErr_Clear();
|
jpayne@69
|
10757 Py_XDECREF(name);
|
jpayne@69
|
10758 name = __Pyx_NewRef(__pyx_n_s__8);
|
jpayne@69
|
10759 }
|
jpayne@69
|
10760 return name;
|
jpayne@69
|
10761 }
|
jpayne@69
|
10762 #endif
|
jpayne@69
|
10763
|
jpayne@69
|
10764 /* CIntToPy */
|
jpayne@69
|
10765 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
jpayne@69
|
10766 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
10767 #pragma GCC diagnostic push
|
jpayne@69
|
10768 #pragma GCC diagnostic ignored "-Wconversion"
|
jpayne@69
|
10769 #endif
|
jpayne@69
|
10770 const long neg_one = (long) -1, const_zero = (long) 0;
|
jpayne@69
|
10771 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
10772 #pragma GCC diagnostic pop
|
jpayne@69
|
10773 #endif
|
jpayne@69
|
10774 const int is_unsigned = neg_one > const_zero;
|
jpayne@69
|
10775 if (is_unsigned) {
|
jpayne@69
|
10776 if (sizeof(long) < sizeof(long)) {
|
jpayne@69
|
10777 return PyInt_FromLong((long) value);
|
jpayne@69
|
10778 } else if (sizeof(long) <= sizeof(unsigned long)) {
|
jpayne@69
|
10779 return PyLong_FromUnsignedLong((unsigned long) value);
|
jpayne@69
|
10780 #ifdef HAVE_LONG_LONG
|
jpayne@69
|
10781 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
|
jpayne@69
|
10782 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
jpayne@69
|
10783 #endif
|
jpayne@69
|
10784 }
|
jpayne@69
|
10785 } else {
|
jpayne@69
|
10786 if (sizeof(long) <= sizeof(long)) {
|
jpayne@69
|
10787 return PyInt_FromLong((long) value);
|
jpayne@69
|
10788 #ifdef HAVE_LONG_LONG
|
jpayne@69
|
10789 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
|
jpayne@69
|
10790 return PyLong_FromLongLong((PY_LONG_LONG) value);
|
jpayne@69
|
10791 #endif
|
jpayne@69
|
10792 }
|
jpayne@69
|
10793 }
|
jpayne@69
|
10794 {
|
jpayne@69
|
10795 unsigned char *bytes = (unsigned char *)&value;
|
jpayne@69
|
10796 #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
|
jpayne@69
|
10797 if (is_unsigned) {
|
jpayne@69
|
10798 return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
|
jpayne@69
|
10799 } else {
|
jpayne@69
|
10800 return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
|
jpayne@69
|
10801 }
|
jpayne@69
|
10802 #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
|
jpayne@69
|
10803 int one = 1; int little = (int)*(unsigned char *)&one;
|
jpayne@69
|
10804 return _PyLong_FromByteArray(bytes, sizeof(long),
|
jpayne@69
|
10805 little, !is_unsigned);
|
jpayne@69
|
10806 #else
|
jpayne@69
|
10807 int one = 1; int little = (int)*(unsigned char *)&one;
|
jpayne@69
|
10808 PyObject *from_bytes, *result = NULL;
|
jpayne@69
|
10809 PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
|
jpayne@69
|
10810 from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
|
jpayne@69
|
10811 if (!from_bytes) return NULL;
|
jpayne@69
|
10812 py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
|
jpayne@69
|
10813 if (!py_bytes) goto limited_bad;
|
jpayne@69
|
10814 order_str = PyUnicode_FromString(little ? "little" : "big");
|
jpayne@69
|
10815 if (!order_str) goto limited_bad;
|
jpayne@69
|
10816 arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
|
jpayne@69
|
10817 if (!arg_tuple) goto limited_bad;
|
jpayne@69
|
10818 if (!is_unsigned) {
|
jpayne@69
|
10819 kwds = PyDict_New();
|
jpayne@69
|
10820 if (!kwds) goto limited_bad;
|
jpayne@69
|
10821 if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
|
jpayne@69
|
10822 }
|
jpayne@69
|
10823 result = PyObject_Call(from_bytes, arg_tuple, kwds);
|
jpayne@69
|
10824 limited_bad:
|
jpayne@69
|
10825 Py_XDECREF(kwds);
|
jpayne@69
|
10826 Py_XDECREF(arg_tuple);
|
jpayne@69
|
10827 Py_XDECREF(order_str);
|
jpayne@69
|
10828 Py_XDECREF(py_bytes);
|
jpayne@69
|
10829 Py_XDECREF(from_bytes);
|
jpayne@69
|
10830 return result;
|
jpayne@69
|
10831 #endif
|
jpayne@69
|
10832 }
|
jpayne@69
|
10833 }
|
jpayne@69
|
10834
|
jpayne@69
|
10835 /* CIntFromPy */
|
jpayne@69
|
10836 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
|
jpayne@69
|
10837 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
10838 #pragma GCC diagnostic push
|
jpayne@69
|
10839 #pragma GCC diagnostic ignored "-Wconversion"
|
jpayne@69
|
10840 #endif
|
jpayne@69
|
10841 const long neg_one = (long) -1, const_zero = (long) 0;
|
jpayne@69
|
10842 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
jpayne@69
|
10843 #pragma GCC diagnostic pop
|
jpayne@69
|
10844 #endif
|
jpayne@69
|
10845 const int is_unsigned = neg_one > const_zero;
|
jpayne@69
|
10846 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
10847 if (likely(PyInt_Check(x))) {
|
jpayne@69
|
10848 if ((sizeof(long) < sizeof(long))) {
|
jpayne@69
|
10849 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
|
jpayne@69
|
10850 } else {
|
jpayne@69
|
10851 long val = PyInt_AS_LONG(x);
|
jpayne@69
|
10852 if (is_unsigned && unlikely(val < 0)) {
|
jpayne@69
|
10853 goto raise_neg_overflow;
|
jpayne@69
|
10854 }
|
jpayne@69
|
10855 return (long) val;
|
jpayne@69
|
10856 }
|
jpayne@69
|
10857 }
|
jpayne@69
|
10858 #endif
|
jpayne@69
|
10859 if (unlikely(!PyLong_Check(x))) {
|
jpayne@69
|
10860 long val;
|
jpayne@69
|
10861 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
|
jpayne@69
|
10862 if (!tmp) return (long) -1;
|
jpayne@69
|
10863 val = __Pyx_PyInt_As_long(tmp);
|
jpayne@69
|
10864 Py_DECREF(tmp);
|
jpayne@69
|
10865 return val;
|
jpayne@69
|
10866 }
|
jpayne@69
|
10867 if (is_unsigned) {
|
jpayne@69
|
10868 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
10869 if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
jpayne@69
|
10870 goto raise_neg_overflow;
|
jpayne@69
|
10871 } else if (__Pyx_PyLong_IsCompact(x)) {
|
jpayne@69
|
10872 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
jpayne@69
|
10873 } else {
|
jpayne@69
|
10874 const digit* digits = __Pyx_PyLong_Digits(x);
|
jpayne@69
|
10875 assert(__Pyx_PyLong_DigitCount(x) > 1);
|
jpayne@69
|
10876 switch (__Pyx_PyLong_DigitCount(x)) {
|
jpayne@69
|
10877 case 2:
|
jpayne@69
|
10878 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
|
jpayne@69
|
10879 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10880 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10881 } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10882 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
jpayne@69
|
10883 }
|
jpayne@69
|
10884 }
|
jpayne@69
|
10885 break;
|
jpayne@69
|
10886 case 3:
|
jpayne@69
|
10887 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10888 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10889 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10890 } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10891 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
jpayne@69
|
10892 }
|
jpayne@69
|
10893 }
|
jpayne@69
|
10894 break;
|
jpayne@69
|
10895 case 4:
|
jpayne@69
|
10896 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10897 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10898 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10899 } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10900 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
jpayne@69
|
10901 }
|
jpayne@69
|
10902 }
|
jpayne@69
|
10903 break;
|
jpayne@69
|
10904 }
|
jpayne@69
|
10905 }
|
jpayne@69
|
10906 #endif
|
jpayne@69
|
10907 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
jpayne@69
|
10908 if (unlikely(Py_SIZE(x) < 0)) {
|
jpayne@69
|
10909 goto raise_neg_overflow;
|
jpayne@69
|
10910 }
|
jpayne@69
|
10911 #else
|
jpayne@69
|
10912 {
|
jpayne@69
|
10913 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
jpayne@69
|
10914 if (unlikely(result < 0))
|
jpayne@69
|
10915 return (long) -1;
|
jpayne@69
|
10916 if (unlikely(result == 1))
|
jpayne@69
|
10917 goto raise_neg_overflow;
|
jpayne@69
|
10918 }
|
jpayne@69
|
10919 #endif
|
jpayne@69
|
10920 if ((sizeof(long) <= sizeof(unsigned long))) {
|
jpayne@69
|
10921 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
|
jpayne@69
|
10922 #ifdef HAVE_LONG_LONG
|
jpayne@69
|
10923 } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
|
jpayne@69
|
10924 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
jpayne@69
|
10925 #endif
|
jpayne@69
|
10926 }
|
jpayne@69
|
10927 } else {
|
jpayne@69
|
10928 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
10929 if (__Pyx_PyLong_IsCompact(x)) {
|
jpayne@69
|
10930 __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
jpayne@69
|
10931 } else {
|
jpayne@69
|
10932 const digit* digits = __Pyx_PyLong_Digits(x);
|
jpayne@69
|
10933 assert(__Pyx_PyLong_DigitCount(x) > 1);
|
jpayne@69
|
10934 switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
jpayne@69
|
10935 case -2:
|
jpayne@69
|
10936 if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
|
jpayne@69
|
10937 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10938 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10939 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10940 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
jpayne@69
|
10941 }
|
jpayne@69
|
10942 }
|
jpayne@69
|
10943 break;
|
jpayne@69
|
10944 case 2:
|
jpayne@69
|
10945 if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
|
jpayne@69
|
10946 if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10947 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10948 } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10949 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
jpayne@69
|
10950 }
|
jpayne@69
|
10951 }
|
jpayne@69
|
10952 break;
|
jpayne@69
|
10953 case -3:
|
jpayne@69
|
10954 if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10955 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10956 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10957 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10958 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
jpayne@69
|
10959 }
|
jpayne@69
|
10960 }
|
jpayne@69
|
10961 break;
|
jpayne@69
|
10962 case 3:
|
jpayne@69
|
10963 if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
|
jpayne@69
|
10964 if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10965 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10966 } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10967 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
jpayne@69
|
10968 }
|
jpayne@69
|
10969 }
|
jpayne@69
|
10970 break;
|
jpayne@69
|
10971 case -4:
|
jpayne@69
|
10972 if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10973 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10974 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10975 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10976 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
jpayne@69
|
10977 }
|
jpayne@69
|
10978 }
|
jpayne@69
|
10979 break;
|
jpayne@69
|
10980 case 4:
|
jpayne@69
|
10981 if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
|
jpayne@69
|
10982 if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10983 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
jpayne@69
|
10984 } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
|
jpayne@69
|
10985 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
jpayne@69
|
10986 }
|
jpayne@69
|
10987 }
|
jpayne@69
|
10988 break;
|
jpayne@69
|
10989 }
|
jpayne@69
|
10990 }
|
jpayne@69
|
10991 #endif
|
jpayne@69
|
10992 if ((sizeof(long) <= sizeof(long))) {
|
jpayne@69
|
10993 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
|
jpayne@69
|
10994 #ifdef HAVE_LONG_LONG
|
jpayne@69
|
10995 } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
|
jpayne@69
|
10996 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
|
jpayne@69
|
10997 #endif
|
jpayne@69
|
10998 }
|
jpayne@69
|
10999 }
|
jpayne@69
|
11000 {
|
jpayne@69
|
11001 long val;
|
jpayne@69
|
11002 int ret = -1;
|
jpayne@69
|
11003 #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
jpayne@69
|
11004 Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
jpayne@69
|
11005 x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
jpayne@69
|
11006 if (unlikely(bytes_copied == -1)) {
|
jpayne@69
|
11007 } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
jpayne@69
|
11008 goto raise_overflow;
|
jpayne@69
|
11009 } else {
|
jpayne@69
|
11010 ret = 0;
|
jpayne@69
|
11011 }
|
jpayne@69
|
11012 #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
jpayne@69
|
11013 int one = 1; int is_little = (int)*(unsigned char *)&one;
|
jpayne@69
|
11014 unsigned char *bytes = (unsigned char *)&val;
|
jpayne@69
|
11015 ret = _PyLong_AsByteArray((PyLongObject *)x,
|
jpayne@69
|
11016 bytes, sizeof(val),
|
jpayne@69
|
11017 is_little, !is_unsigned);
|
jpayne@69
|
11018 #else
|
jpayne@69
|
11019 PyObject *v;
|
jpayne@69
|
11020 PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
jpayne@69
|
11021 int bits, remaining_bits, is_negative = 0;
|
jpayne@69
|
11022 int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
jpayne@69
|
11023 if (likely(PyLong_CheckExact(x))) {
|
jpayne@69
|
11024 v = __Pyx_NewRef(x);
|
jpayne@69
|
11025 } else {
|
jpayne@69
|
11026 v = PyNumber_Long(x);
|
jpayne@69
|
11027 if (unlikely(!v)) return (long) -1;
|
jpayne@69
|
11028 assert(PyLong_CheckExact(v));
|
jpayne@69
|
11029 }
|
jpayne@69
|
11030 {
|
jpayne@69
|
11031 int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
jpayne@69
|
11032 if (unlikely(result < 0)) {
|
jpayne@69
|
11033 Py_DECREF(v);
|
jpayne@69
|
11034 return (long) -1;
|
jpayne@69
|
11035 }
|
jpayne@69
|
11036 is_negative = result == 1;
|
jpayne@69
|
11037 }
|
jpayne@69
|
11038 if (is_unsigned && unlikely(is_negative)) {
|
jpayne@69
|
11039 Py_DECREF(v);
|
jpayne@69
|
11040 goto raise_neg_overflow;
|
jpayne@69
|
11041 } else if (is_negative) {
|
jpayne@69
|
11042 stepval = PyNumber_Invert(v);
|
jpayne@69
|
11043 Py_DECREF(v);
|
jpayne@69
|
11044 if (unlikely(!stepval))
|
jpayne@69
|
11045 return (long) -1;
|
jpayne@69
|
11046 } else {
|
jpayne@69
|
11047 stepval = v;
|
jpayne@69
|
11048 }
|
jpayne@69
|
11049 v = NULL;
|
jpayne@69
|
11050 val = (long) 0;
|
jpayne@69
|
11051 mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
jpayne@69
|
11052 shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
jpayne@69
|
11053 for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
|
jpayne@69
|
11054 PyObject *tmp, *digit;
|
jpayne@69
|
11055 long idigit;
|
jpayne@69
|
11056 digit = PyNumber_And(stepval, mask);
|
jpayne@69
|
11057 if (unlikely(!digit)) goto done;
|
jpayne@69
|
11058 idigit = PyLong_AsLong(digit);
|
jpayne@69
|
11059 Py_DECREF(digit);
|
jpayne@69
|
11060 if (unlikely(idigit < 0)) goto done;
|
jpayne@69
|
11061 val |= ((long) idigit) << bits;
|
jpayne@69
|
11062 tmp = PyNumber_Rshift(stepval, shift);
|
jpayne@69
|
11063 if (unlikely(!tmp)) goto done;
|
jpayne@69
|
11064 Py_DECREF(stepval); stepval = tmp;
|
jpayne@69
|
11065 }
|
jpayne@69
|
11066 Py_DECREF(shift); shift = NULL;
|
jpayne@69
|
11067 Py_DECREF(mask); mask = NULL;
|
jpayne@69
|
11068 {
|
jpayne@69
|
11069 long idigit = PyLong_AsLong(stepval);
|
jpayne@69
|
11070 if (unlikely(idigit < 0)) goto done;
|
jpayne@69
|
11071 remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
|
jpayne@69
|
11072 if (unlikely(idigit >= (1L << remaining_bits)))
|
jpayne@69
|
11073 goto raise_overflow;
|
jpayne@69
|
11074 val |= ((long) idigit) << bits;
|
jpayne@69
|
11075 }
|
jpayne@69
|
11076 if (!is_unsigned) {
|
jpayne@69
|
11077 if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
|
jpayne@69
|
11078 goto raise_overflow;
|
jpayne@69
|
11079 if (is_negative)
|
jpayne@69
|
11080 val = ~val;
|
jpayne@69
|
11081 }
|
jpayne@69
|
11082 ret = 0;
|
jpayne@69
|
11083 done:
|
jpayne@69
|
11084 Py_XDECREF(shift);
|
jpayne@69
|
11085 Py_XDECREF(mask);
|
jpayne@69
|
11086 Py_XDECREF(stepval);
|
jpayne@69
|
11087 #endif
|
jpayne@69
|
11088 if (unlikely(ret))
|
jpayne@69
|
11089 return (long) -1;
|
jpayne@69
|
11090 return val;
|
jpayne@69
|
11091 }
|
jpayne@69
|
11092 raise_overflow:
|
jpayne@69
|
11093 PyErr_SetString(PyExc_OverflowError,
|
jpayne@69
|
11094 "value too large to convert to long");
|
jpayne@69
|
11095 return (long) -1;
|
jpayne@69
|
11096 raise_neg_overflow:
|
jpayne@69
|
11097 PyErr_SetString(PyExc_OverflowError,
|
jpayne@69
|
11098 "can't convert negative value to long");
|
jpayne@69
|
11099 return (long) -1;
|
jpayne@69
|
11100 }
|
jpayne@69
|
11101
|
jpayne@69
|
11102 /* FastTypeChecks */
|
jpayne@69
|
11103 #if CYTHON_COMPILING_IN_CPYTHON
|
jpayne@69
|
11104 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
|
jpayne@69
|
11105 while (a) {
|
jpayne@69
|
11106 a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
|
jpayne@69
|
11107 if (a == b)
|
jpayne@69
|
11108 return 1;
|
jpayne@69
|
11109 }
|
jpayne@69
|
11110 return b == &PyBaseObject_Type;
|
jpayne@69
|
11111 }
|
jpayne@69
|
11112 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
|
jpayne@69
|
11113 PyObject *mro;
|
jpayne@69
|
11114 if (a == b) return 1;
|
jpayne@69
|
11115 mro = a->tp_mro;
|
jpayne@69
|
11116 if (likely(mro)) {
|
jpayne@69
|
11117 Py_ssize_t i, n;
|
jpayne@69
|
11118 n = PyTuple_GET_SIZE(mro);
|
jpayne@69
|
11119 for (i = 0; i < n; i++) {
|
jpayne@69
|
11120 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
|
jpayne@69
|
11121 return 1;
|
jpayne@69
|
11122 }
|
jpayne@69
|
11123 return 0;
|
jpayne@69
|
11124 }
|
jpayne@69
|
11125 return __Pyx_InBases(a, b);
|
jpayne@69
|
11126 }
|
jpayne@69
|
11127 static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
|
jpayne@69
|
11128 PyObject *mro;
|
jpayne@69
|
11129 if (cls == a || cls == b) return 1;
|
jpayne@69
|
11130 mro = cls->tp_mro;
|
jpayne@69
|
11131 if (likely(mro)) {
|
jpayne@69
|
11132 Py_ssize_t i, n;
|
jpayne@69
|
11133 n = PyTuple_GET_SIZE(mro);
|
jpayne@69
|
11134 for (i = 0; i < n; i++) {
|
jpayne@69
|
11135 PyObject *base = PyTuple_GET_ITEM(mro, i);
|
jpayne@69
|
11136 if (base == (PyObject *)a || base == (PyObject *)b)
|
jpayne@69
|
11137 return 1;
|
jpayne@69
|
11138 }
|
jpayne@69
|
11139 return 0;
|
jpayne@69
|
11140 }
|
jpayne@69
|
11141 return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
|
jpayne@69
|
11142 }
|
jpayne@69
|
11143 #if PY_MAJOR_VERSION == 2
|
jpayne@69
|
11144 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
|
jpayne@69
|
11145 PyObject *exception, *value, *tb;
|
jpayne@69
|
11146 int res;
|
jpayne@69
|
11147 __Pyx_PyThreadState_declare
|
jpayne@69
|
11148 __Pyx_PyThreadState_assign
|
jpayne@69
|
11149 __Pyx_ErrFetch(&exception, &value, &tb);
|
jpayne@69
|
11150 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
|
jpayne@69
|
11151 if (unlikely(res == -1)) {
|
jpayne@69
|
11152 PyErr_WriteUnraisable(err);
|
jpayne@69
|
11153 res = 0;
|
jpayne@69
|
11154 }
|
jpayne@69
|
11155 if (!res) {
|
jpayne@69
|
11156 res = PyObject_IsSubclass(err, exc_type2);
|
jpayne@69
|
11157 if (unlikely(res == -1)) {
|
jpayne@69
|
11158 PyErr_WriteUnraisable(err);
|
jpayne@69
|
11159 res = 0;
|
jpayne@69
|
11160 }
|
jpayne@69
|
11161 }
|
jpayne@69
|
11162 __Pyx_ErrRestore(exception, value, tb);
|
jpayne@69
|
11163 return res;
|
jpayne@69
|
11164 }
|
jpayne@69
|
11165 #else
|
jpayne@69
|
11166 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
|
jpayne@69
|
11167 if (exc_type1) {
|
jpayne@69
|
11168 return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
|
jpayne@69
|
11169 } else {
|
jpayne@69
|
11170 return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
|
jpayne@69
|
11171 }
|
jpayne@69
|
11172 }
|
jpayne@69
|
11173 #endif
|
jpayne@69
|
11174 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
|
jpayne@69
|
11175 Py_ssize_t i, n;
|
jpayne@69
|
11176 assert(PyExceptionClass_Check(exc_type));
|
jpayne@69
|
11177 n = PyTuple_GET_SIZE(tuple);
|
jpayne@69
|
11178 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
11179 for (i=0; i<n; i++) {
|
jpayne@69
|
11180 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
|
jpayne@69
|
11181 }
|
jpayne@69
|
11182 #endif
|
jpayne@69
|
11183 for (i=0; i<n; i++) {
|
jpayne@69
|
11184 PyObject *t = PyTuple_GET_ITEM(tuple, i);
|
jpayne@69
|
11185 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
11186 if (likely(exc_type == t)) return 1;
|
jpayne@69
|
11187 #endif
|
jpayne@69
|
11188 if (likely(PyExceptionClass_Check(t))) {
|
jpayne@69
|
11189 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
|
jpayne@69
|
11190 } else {
|
jpayne@69
|
11191 }
|
jpayne@69
|
11192 }
|
jpayne@69
|
11193 return 0;
|
jpayne@69
|
11194 }
|
jpayne@69
|
11195 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
|
jpayne@69
|
11196 if (likely(err == exc_type)) return 1;
|
jpayne@69
|
11197 if (likely(PyExceptionClass_Check(err))) {
|
jpayne@69
|
11198 if (likely(PyExceptionClass_Check(exc_type))) {
|
jpayne@69
|
11199 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
|
jpayne@69
|
11200 } else if (likely(PyTuple_Check(exc_type))) {
|
jpayne@69
|
11201 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
|
jpayne@69
|
11202 } else {
|
jpayne@69
|
11203 }
|
jpayne@69
|
11204 }
|
jpayne@69
|
11205 return PyErr_GivenExceptionMatches(err, exc_type);
|
jpayne@69
|
11206 }
|
jpayne@69
|
11207 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
|
jpayne@69
|
11208 assert(PyExceptionClass_Check(exc_type1));
|
jpayne@69
|
11209 assert(PyExceptionClass_Check(exc_type2));
|
jpayne@69
|
11210 if (likely(err == exc_type1 || err == exc_type2)) return 1;
|
jpayne@69
|
11211 if (likely(PyExceptionClass_Check(err))) {
|
jpayne@69
|
11212 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
|
jpayne@69
|
11213 }
|
jpayne@69
|
11214 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
|
jpayne@69
|
11215 }
|
jpayne@69
|
11216 #endif
|
jpayne@69
|
11217
|
jpayne@69
|
11218 /* CheckBinaryVersion */
|
jpayne@69
|
11219 static unsigned long __Pyx_get_runtime_version(void) {
|
jpayne@69
|
11220 #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
|
jpayne@69
|
11221 return Py_Version & ~0xFFUL;
|
jpayne@69
|
11222 #else
|
jpayne@69
|
11223 const char* rt_version = Py_GetVersion();
|
jpayne@69
|
11224 unsigned long version = 0;
|
jpayne@69
|
11225 unsigned long factor = 0x01000000UL;
|
jpayne@69
|
11226 unsigned int digit = 0;
|
jpayne@69
|
11227 int i = 0;
|
jpayne@69
|
11228 while (factor) {
|
jpayne@69
|
11229 while ('0' <= rt_version[i] && rt_version[i] <= '9') {
|
jpayne@69
|
11230 digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
|
jpayne@69
|
11231 ++i;
|
jpayne@69
|
11232 }
|
jpayne@69
|
11233 version += factor * digit;
|
jpayne@69
|
11234 if (rt_version[i] != '.')
|
jpayne@69
|
11235 break;
|
jpayne@69
|
11236 digit = 0;
|
jpayne@69
|
11237 factor >>= 8;
|
jpayne@69
|
11238 ++i;
|
jpayne@69
|
11239 }
|
jpayne@69
|
11240 return version;
|
jpayne@69
|
11241 #endif
|
jpayne@69
|
11242 }
|
jpayne@69
|
11243 static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
|
jpayne@69
|
11244 const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
|
jpayne@69
|
11245 if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
|
jpayne@69
|
11246 return 0;
|
jpayne@69
|
11247 if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
|
jpayne@69
|
11248 return 1;
|
jpayne@69
|
11249 {
|
jpayne@69
|
11250 char message[200];
|
jpayne@69
|
11251 PyOS_snprintf(message, sizeof(message),
|
jpayne@69
|
11252 "compile time Python version %d.%d "
|
jpayne@69
|
11253 "of module '%.100s' "
|
jpayne@69
|
11254 "%s "
|
jpayne@69
|
11255 "runtime version %d.%d",
|
jpayne@69
|
11256 (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
|
jpayne@69
|
11257 __Pyx_MODULE_NAME,
|
jpayne@69
|
11258 (allow_newer) ? "was newer than" : "does not match",
|
jpayne@69
|
11259 (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
|
jpayne@69
|
11260 );
|
jpayne@69
|
11261 return PyErr_WarnEx(NULL, message, 1);
|
jpayne@69
|
11262 }
|
jpayne@69
|
11263 }
|
jpayne@69
|
11264
|
jpayne@69
|
11265 /* InitStrings */
|
jpayne@69
|
11266 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
11267 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
|
jpayne@69
|
11268 if (t.is_unicode | t.is_str) {
|
jpayne@69
|
11269 if (t.intern) {
|
jpayne@69
|
11270 *str = PyUnicode_InternFromString(t.s);
|
jpayne@69
|
11271 } else if (t.encoding) {
|
jpayne@69
|
11272 *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
|
jpayne@69
|
11273 } else {
|
jpayne@69
|
11274 *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
|
jpayne@69
|
11275 }
|
jpayne@69
|
11276 } else {
|
jpayne@69
|
11277 *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
|
jpayne@69
|
11278 }
|
jpayne@69
|
11279 if (!*str)
|
jpayne@69
|
11280 return -1;
|
jpayne@69
|
11281 if (PyObject_Hash(*str) == -1)
|
jpayne@69
|
11282 return -1;
|
jpayne@69
|
11283 return 0;
|
jpayne@69
|
11284 }
|
jpayne@69
|
11285 #endif
|
jpayne@69
|
11286 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
|
jpayne@69
|
11287 while (t->p) {
|
jpayne@69
|
11288 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
11289 __Pyx_InitString(*t, t->p);
|
jpayne@69
|
11290 #else
|
jpayne@69
|
11291 if (t->is_unicode) {
|
jpayne@69
|
11292 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
|
jpayne@69
|
11293 } else if (t->intern) {
|
jpayne@69
|
11294 *t->p = PyString_InternFromString(t->s);
|
jpayne@69
|
11295 } else {
|
jpayne@69
|
11296 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
|
jpayne@69
|
11297 }
|
jpayne@69
|
11298 if (!*t->p)
|
jpayne@69
|
11299 return -1;
|
jpayne@69
|
11300 if (PyObject_Hash(*t->p) == -1)
|
jpayne@69
|
11301 return -1;
|
jpayne@69
|
11302 #endif
|
jpayne@69
|
11303 ++t;
|
jpayne@69
|
11304 }
|
jpayne@69
|
11305 return 0;
|
jpayne@69
|
11306 }
|
jpayne@69
|
11307
|
jpayne@69
|
11308 #include <string.h>
|
jpayne@69
|
11309 static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
|
jpayne@69
|
11310 size_t len = strlen(s);
|
jpayne@69
|
11311 if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
|
jpayne@69
|
11312 PyErr_SetString(PyExc_OverflowError, "byte string is too long");
|
jpayne@69
|
11313 return -1;
|
jpayne@69
|
11314 }
|
jpayne@69
|
11315 return (Py_ssize_t) len;
|
jpayne@69
|
11316 }
|
jpayne@69
|
11317 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
|
jpayne@69
|
11318 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
jpayne@69
|
11319 if (unlikely(len < 0)) return NULL;
|
jpayne@69
|
11320 return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
|
jpayne@69
|
11321 }
|
jpayne@69
|
11322 static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
|
jpayne@69
|
11323 Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
jpayne@69
|
11324 if (unlikely(len < 0)) return NULL;
|
jpayne@69
|
11325 return PyByteArray_FromStringAndSize(c_str, len);
|
jpayne@69
|
11326 }
|
jpayne@69
|
11327 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
|
jpayne@69
|
11328 Py_ssize_t ignore;
|
jpayne@69
|
11329 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
|
jpayne@69
|
11330 }
|
jpayne@69
|
11331 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
jpayne@69
|
11332 #if !CYTHON_PEP393_ENABLED
|
jpayne@69
|
11333 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
jpayne@69
|
11334 char* defenc_c;
|
jpayne@69
|
11335 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
|
jpayne@69
|
11336 if (!defenc) return NULL;
|
jpayne@69
|
11337 defenc_c = PyBytes_AS_STRING(defenc);
|
jpayne@69
|
11338 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
jpayne@69
|
11339 {
|
jpayne@69
|
11340 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
|
jpayne@69
|
11341 char* c;
|
jpayne@69
|
11342 for (c = defenc_c; c < end; c++) {
|
jpayne@69
|
11343 if ((unsigned char) (*c) >= 128) {
|
jpayne@69
|
11344 PyUnicode_AsASCIIString(o);
|
jpayne@69
|
11345 return NULL;
|
jpayne@69
|
11346 }
|
jpayne@69
|
11347 }
|
jpayne@69
|
11348 }
|
jpayne@69
|
11349 #endif
|
jpayne@69
|
11350 *length = PyBytes_GET_SIZE(defenc);
|
jpayne@69
|
11351 return defenc_c;
|
jpayne@69
|
11352 }
|
jpayne@69
|
11353 #else
|
jpayne@69
|
11354 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
jpayne@69
|
11355 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
|
jpayne@69
|
11356 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
jpayne@69
|
11357 if (likely(PyUnicode_IS_ASCII(o))) {
|
jpayne@69
|
11358 *length = PyUnicode_GET_LENGTH(o);
|
jpayne@69
|
11359 return PyUnicode_AsUTF8(o);
|
jpayne@69
|
11360 } else {
|
jpayne@69
|
11361 PyUnicode_AsASCIIString(o);
|
jpayne@69
|
11362 return NULL;
|
jpayne@69
|
11363 }
|
jpayne@69
|
11364 #else
|
jpayne@69
|
11365 return PyUnicode_AsUTF8AndSize(o, length);
|
jpayne@69
|
11366 #endif
|
jpayne@69
|
11367 }
|
jpayne@69
|
11368 #endif
|
jpayne@69
|
11369 #endif
|
jpayne@69
|
11370 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
jpayne@69
|
11371 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
jpayne@69
|
11372 if (
|
jpayne@69
|
11373 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
jpayne@69
|
11374 __Pyx_sys_getdefaultencoding_not_ascii &&
|
jpayne@69
|
11375 #endif
|
jpayne@69
|
11376 PyUnicode_Check(o)) {
|
jpayne@69
|
11377 return __Pyx_PyUnicode_AsStringAndSize(o, length);
|
jpayne@69
|
11378 } else
|
jpayne@69
|
11379 #endif
|
jpayne@69
|
11380 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
|
jpayne@69
|
11381 if (PyByteArray_Check(o)) {
|
jpayne@69
|
11382 *length = PyByteArray_GET_SIZE(o);
|
jpayne@69
|
11383 return PyByteArray_AS_STRING(o);
|
jpayne@69
|
11384 } else
|
jpayne@69
|
11385 #endif
|
jpayne@69
|
11386 {
|
jpayne@69
|
11387 char* result;
|
jpayne@69
|
11388 int r = PyBytes_AsStringAndSize(o, &result, length);
|
jpayne@69
|
11389 if (unlikely(r < 0)) {
|
jpayne@69
|
11390 return NULL;
|
jpayne@69
|
11391 } else {
|
jpayne@69
|
11392 return result;
|
jpayne@69
|
11393 }
|
jpayne@69
|
11394 }
|
jpayne@69
|
11395 }
|
jpayne@69
|
11396 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
|
jpayne@69
|
11397 int is_true = x == Py_True;
|
jpayne@69
|
11398 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
|
jpayne@69
|
11399 else return PyObject_IsTrue(x);
|
jpayne@69
|
11400 }
|
jpayne@69
|
11401 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
|
jpayne@69
|
11402 int retval;
|
jpayne@69
|
11403 if (unlikely(!x)) return -1;
|
jpayne@69
|
11404 retval = __Pyx_PyObject_IsTrue(x);
|
jpayne@69
|
11405 Py_DECREF(x);
|
jpayne@69
|
11406 return retval;
|
jpayne@69
|
11407 }
|
jpayne@69
|
11408 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
|
jpayne@69
|
11409 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
|
jpayne@69
|
11410 #if PY_MAJOR_VERSION >= 3
|
jpayne@69
|
11411 if (PyLong_Check(result)) {
|
jpayne@69
|
11412 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
jpayne@69
|
11413 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
|
jpayne@69
|
11414 "The ability to return an instance of a strict subclass of int is deprecated, "
|
jpayne@69
|
11415 "and may be removed in a future version of Python.",
|
jpayne@69
|
11416 result_type_name)) {
|
jpayne@69
|
11417 __Pyx_DECREF_TypeName(result_type_name);
|
jpayne@69
|
11418 Py_DECREF(result);
|
jpayne@69
|
11419 return NULL;
|
jpayne@69
|
11420 }
|
jpayne@69
|
11421 __Pyx_DECREF_TypeName(result_type_name);
|
jpayne@69
|
11422 return result;
|
jpayne@69
|
11423 }
|
jpayne@69
|
11424 #endif
|
jpayne@69
|
11425 PyErr_Format(PyExc_TypeError,
|
jpayne@69
|
11426 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
|
jpayne@69
|
11427 type_name, type_name, result_type_name);
|
jpayne@69
|
11428 __Pyx_DECREF_TypeName(result_type_name);
|
jpayne@69
|
11429 Py_DECREF(result);
|
jpayne@69
|
11430 return NULL;
|
jpayne@69
|
11431 }
|
jpayne@69
|
11432 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
|
jpayne@69
|
11433 #if CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
11434 PyNumberMethods *m;
|
jpayne@69
|
11435 #endif
|
jpayne@69
|
11436 const char *name = NULL;
|
jpayne@69
|
11437 PyObject *res = NULL;
|
jpayne@69
|
11438 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
11439 if (likely(PyInt_Check(x) || PyLong_Check(x)))
|
jpayne@69
|
11440 #else
|
jpayne@69
|
11441 if (likely(PyLong_Check(x)))
|
jpayne@69
|
11442 #endif
|
jpayne@69
|
11443 return __Pyx_NewRef(x);
|
jpayne@69
|
11444 #if CYTHON_USE_TYPE_SLOTS
|
jpayne@69
|
11445 m = Py_TYPE(x)->tp_as_number;
|
jpayne@69
|
11446 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
11447 if (m && m->nb_int) {
|
jpayne@69
|
11448 name = "int";
|
jpayne@69
|
11449 res = m->nb_int(x);
|
jpayne@69
|
11450 }
|
jpayne@69
|
11451 else if (m && m->nb_long) {
|
jpayne@69
|
11452 name = "long";
|
jpayne@69
|
11453 res = m->nb_long(x);
|
jpayne@69
|
11454 }
|
jpayne@69
|
11455 #else
|
jpayne@69
|
11456 if (likely(m && m->nb_int)) {
|
jpayne@69
|
11457 name = "int";
|
jpayne@69
|
11458 res = m->nb_int(x);
|
jpayne@69
|
11459 }
|
jpayne@69
|
11460 #endif
|
jpayne@69
|
11461 #else
|
jpayne@69
|
11462 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
|
jpayne@69
|
11463 res = PyNumber_Int(x);
|
jpayne@69
|
11464 }
|
jpayne@69
|
11465 #endif
|
jpayne@69
|
11466 if (likely(res)) {
|
jpayne@69
|
11467 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
11468 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
|
jpayne@69
|
11469 #else
|
jpayne@69
|
11470 if (unlikely(!PyLong_CheckExact(res))) {
|
jpayne@69
|
11471 #endif
|
jpayne@69
|
11472 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
|
jpayne@69
|
11473 }
|
jpayne@69
|
11474 }
|
jpayne@69
|
11475 else if (!PyErr_Occurred()) {
|
jpayne@69
|
11476 PyErr_SetString(PyExc_TypeError,
|
jpayne@69
|
11477 "an integer is required");
|
jpayne@69
|
11478 }
|
jpayne@69
|
11479 return res;
|
jpayne@69
|
11480 }
|
jpayne@69
|
11481 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
|
jpayne@69
|
11482 Py_ssize_t ival;
|
jpayne@69
|
11483 PyObject *x;
|
jpayne@69
|
11484 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
11485 if (likely(PyInt_CheckExact(b))) {
|
jpayne@69
|
11486 if (sizeof(Py_ssize_t) >= sizeof(long))
|
jpayne@69
|
11487 return PyInt_AS_LONG(b);
|
jpayne@69
|
11488 else
|
jpayne@69
|
11489 return PyInt_AsSsize_t(b);
|
jpayne@69
|
11490 }
|
jpayne@69
|
11491 #endif
|
jpayne@69
|
11492 if (likely(PyLong_CheckExact(b))) {
|
jpayne@69
|
11493 #if CYTHON_USE_PYLONG_INTERNALS
|
jpayne@69
|
11494 if (likely(__Pyx_PyLong_IsCompact(b))) {
|
jpayne@69
|
11495 return __Pyx_PyLong_CompactValue(b);
|
jpayne@69
|
11496 } else {
|
jpayne@69
|
11497 const digit* digits = __Pyx_PyLong_Digits(b);
|
jpayne@69
|
11498 const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
|
jpayne@69
|
11499 switch (size) {
|
jpayne@69
|
11500 case 2:
|
jpayne@69
|
11501 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
|
jpayne@69
|
11502 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
jpayne@69
|
11503 }
|
jpayne@69
|
11504 break;
|
jpayne@69
|
11505 case -2:
|
jpayne@69
|
11506 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
|
jpayne@69
|
11507 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
jpayne@69
|
11508 }
|
jpayne@69
|
11509 break;
|
jpayne@69
|
11510 case 3:
|
jpayne@69
|
11511 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
|
jpayne@69
|
11512 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
jpayne@69
|
11513 }
|
jpayne@69
|
11514 break;
|
jpayne@69
|
11515 case -3:
|
jpayne@69
|
11516 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
|
jpayne@69
|
11517 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
jpayne@69
|
11518 }
|
jpayne@69
|
11519 break;
|
jpayne@69
|
11520 case 4:
|
jpayne@69
|
11521 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
|
jpayne@69
|
11522 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
jpayne@69
|
11523 }
|
jpayne@69
|
11524 break;
|
jpayne@69
|
11525 case -4:
|
jpayne@69
|
11526 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
|
jpayne@69
|
11527 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
jpayne@69
|
11528 }
|
jpayne@69
|
11529 break;
|
jpayne@69
|
11530 }
|
jpayne@69
|
11531 }
|
jpayne@69
|
11532 #endif
|
jpayne@69
|
11533 return PyLong_AsSsize_t(b);
|
jpayne@69
|
11534 }
|
jpayne@69
|
11535 x = PyNumber_Index(b);
|
jpayne@69
|
11536 if (!x) return -1;
|
jpayne@69
|
11537 ival = PyInt_AsSsize_t(x);
|
jpayne@69
|
11538 Py_DECREF(x);
|
jpayne@69
|
11539 return ival;
|
jpayne@69
|
11540 }
|
jpayne@69
|
11541 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
|
jpayne@69
|
11542 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
|
jpayne@69
|
11543 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
|
jpayne@69
|
11544 #if PY_MAJOR_VERSION < 3
|
jpayne@69
|
11545 } else if (likely(PyInt_CheckExact(o))) {
|
jpayne@69
|
11546 return PyInt_AS_LONG(o);
|
jpayne@69
|
11547 #endif
|
jpayne@69
|
11548 } else {
|
jpayne@69
|
11549 Py_ssize_t ival;
|
jpayne@69
|
11550 PyObject *x;
|
jpayne@69
|
11551 x = PyNumber_Index(o);
|
jpayne@69
|
11552 if (!x) return -1;
|
jpayne@69
|
11553 ival = PyInt_AsLong(x);
|
jpayne@69
|
11554 Py_DECREF(x);
|
jpayne@69
|
11555 return ival;
|
jpayne@69
|
11556 }
|
jpayne@69
|
11557 }
|
jpayne@69
|
11558 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
|
jpayne@69
|
11559 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
|
jpayne@69
|
11560 }
|
jpayne@69
|
11561 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
|
jpayne@69
|
11562 return PyInt_FromSize_t(ival);
|
jpayne@69
|
11563 }
|
jpayne@69
|
11564
|
jpayne@69
|
11565
|
jpayne@69
|
11566 /* #### Code section: utility_code_pragmas_end ### */
|
jpayne@69
|
11567 #ifdef _MSC_VER
|
jpayne@69
|
11568 #pragma warning( pop )
|
jpayne@69
|
11569 #endif
|
jpayne@69
|
11570
|
jpayne@69
|
11571
|
jpayne@69
|
11572
|
jpayne@69
|
11573 /* #### Code section: end ### */
|
jpayne@69
|
11574 #endif /* Py_PYTHON_H */
|