webview-python 1.1.3__cp314-cp314-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- webview/__init__.py +1 -0
- webview/_dummy_holder.c +4506 -0
- webview/_dummy_holder.cp314-win_amd64.pyd +0 -0
- webview/_webview_ffi.py +184 -0
- webview/webview.py +109 -0
- webview_python-1.1.3.dist-info/METADATA +421 -0
- webview_python-1.1.3.dist-info/RECORD +10 -0
- webview_python-1.1.3.dist-info/WHEEL +5 -0
- webview_python-1.1.3.dist-info/licenses/LICENSE +21 -0
- webview_python-1.1.3.dist-info/top_level.txt +1 -0
webview/_dummy_holder.c
ADDED
|
@@ -0,0 +1,4506 @@
|
|
|
1
|
+
/* Generated by Cython 3.2.4 */
|
|
2
|
+
|
|
3
|
+
/* BEGIN: Cython Metadata
|
|
4
|
+
{
|
|
5
|
+
"distutils": {
|
|
6
|
+
"name": "webview._dummy_holder",
|
|
7
|
+
"sources": [
|
|
8
|
+
"src/webview/_dummy_holder.pyx"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"module_name": "webview._dummy_holder"
|
|
12
|
+
}
|
|
13
|
+
END: Cython Metadata */
|
|
14
|
+
|
|
15
|
+
#ifndef PY_SSIZE_T_CLEAN
|
|
16
|
+
#define PY_SSIZE_T_CLEAN
|
|
17
|
+
#endif /* PY_SSIZE_T_CLEAN */
|
|
18
|
+
/* InitLimitedAPI */
|
|
19
|
+
#if defined(Py_LIMITED_API)
|
|
20
|
+
#if !defined(CYTHON_LIMITED_API)
|
|
21
|
+
#define CYTHON_LIMITED_API 1
|
|
22
|
+
#endif
|
|
23
|
+
#elif defined(CYTHON_LIMITED_API)
|
|
24
|
+
#ifdef _MSC_VER
|
|
25
|
+
#pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
|
|
26
|
+
#else
|
|
27
|
+
#warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
|
|
28
|
+
#endif
|
|
29
|
+
#endif
|
|
30
|
+
|
|
31
|
+
#include "Python.h"
|
|
32
|
+
#ifndef Py_PYTHON_H
|
|
33
|
+
#error Python headers needed to compile C extensions, please install development version of Python.
|
|
34
|
+
#elif PY_VERSION_HEX < 0x03080000
|
|
35
|
+
#error Cython requires Python 3.8+.
|
|
36
|
+
#else
|
|
37
|
+
#define __PYX_ABI_VERSION "3_2_4"
|
|
38
|
+
#define CYTHON_HEX_VERSION 0x030204F0
|
|
39
|
+
#define CYTHON_FUTURE_DIVISION 1
|
|
40
|
+
/* CModulePreamble */
|
|
41
|
+
#include <stddef.h>
|
|
42
|
+
#ifndef offsetof
|
|
43
|
+
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
|
|
44
|
+
#endif
|
|
45
|
+
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
|
|
46
|
+
#ifndef __stdcall
|
|
47
|
+
#define __stdcall
|
|
48
|
+
#endif
|
|
49
|
+
#ifndef __cdecl
|
|
50
|
+
#define __cdecl
|
|
51
|
+
#endif
|
|
52
|
+
#ifndef __fastcall
|
|
53
|
+
#define __fastcall
|
|
54
|
+
#endif
|
|
55
|
+
#endif
|
|
56
|
+
#ifndef DL_IMPORT
|
|
57
|
+
#define DL_IMPORT(t) t
|
|
58
|
+
#endif
|
|
59
|
+
#ifndef DL_EXPORT
|
|
60
|
+
#define DL_EXPORT(t) t
|
|
61
|
+
#endif
|
|
62
|
+
#define __PYX_COMMA ,
|
|
63
|
+
#ifndef PY_LONG_LONG
|
|
64
|
+
#define PY_LONG_LONG LONG_LONG
|
|
65
|
+
#endif
|
|
66
|
+
#ifndef Py_HUGE_VAL
|
|
67
|
+
#define Py_HUGE_VAL HUGE_VAL
|
|
68
|
+
#endif
|
|
69
|
+
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
|
|
70
|
+
#if defined(GRAALVM_PYTHON)
|
|
71
|
+
/* For very preliminary testing purposes. Most variables are set the same as PyPy.
|
|
72
|
+
The existence of this section does not imply that anything works or is even tested */
|
|
73
|
+
#define CYTHON_COMPILING_IN_PYPY 0
|
|
74
|
+
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
75
|
+
#define CYTHON_COMPILING_IN_LIMITED_API 0
|
|
76
|
+
#define CYTHON_COMPILING_IN_GRAAL 1
|
|
77
|
+
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
|
|
78
|
+
#undef CYTHON_USE_TYPE_SLOTS
|
|
79
|
+
#define CYTHON_USE_TYPE_SLOTS 0
|
|
80
|
+
#undef CYTHON_USE_TYPE_SPECS
|
|
81
|
+
#define CYTHON_USE_TYPE_SPECS 0
|
|
82
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
|
83
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
|
84
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
|
85
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
|
86
|
+
#undef CYTHON_USE_UNICODE_INTERNALS
|
|
87
|
+
#define CYTHON_USE_UNICODE_INTERNALS 0
|
|
88
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
|
89
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
|
90
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
|
91
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
92
|
+
#undef CYTHON_AVOID_BORROWED_REFS
|
|
93
|
+
#define CYTHON_AVOID_BORROWED_REFS 1
|
|
94
|
+
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
95
|
+
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
|
|
96
|
+
#undef CYTHON_ASSUME_SAFE_MACROS
|
|
97
|
+
#define CYTHON_ASSUME_SAFE_MACROS 0
|
|
98
|
+
#undef CYTHON_ASSUME_SAFE_SIZE
|
|
99
|
+
#define CYTHON_ASSUME_SAFE_SIZE 0
|
|
100
|
+
#undef CYTHON_UNPACK_METHODS
|
|
101
|
+
#define CYTHON_UNPACK_METHODS 0
|
|
102
|
+
#undef CYTHON_FAST_THREAD_STATE
|
|
103
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
|
104
|
+
#undef CYTHON_FAST_GIL
|
|
105
|
+
#define CYTHON_FAST_GIL 0
|
|
106
|
+
#undef CYTHON_METH_FASTCALL
|
|
107
|
+
#define CYTHON_METH_FASTCALL 0
|
|
108
|
+
#undef CYTHON_FAST_PYCALL
|
|
109
|
+
#define CYTHON_FAST_PYCALL 0
|
|
110
|
+
#ifndef CYTHON_PEP487_INIT_SUBCLASS
|
|
111
|
+
#define CYTHON_PEP487_INIT_SUBCLASS 1
|
|
112
|
+
#endif
|
|
113
|
+
#undef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
114
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
115
|
+
#undef CYTHON_USE_MODULE_STATE
|
|
116
|
+
#define CYTHON_USE_MODULE_STATE 0
|
|
117
|
+
#undef CYTHON_USE_SYS_MONITORING
|
|
118
|
+
#define CYTHON_USE_SYS_MONITORING 0
|
|
119
|
+
#undef CYTHON_USE_TP_FINALIZE
|
|
120
|
+
#define CYTHON_USE_TP_FINALIZE 0
|
|
121
|
+
#undef CYTHON_USE_AM_SEND
|
|
122
|
+
#define CYTHON_USE_AM_SEND 0
|
|
123
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
|
124
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
|
125
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
|
126
|
+
#define CYTHON_USE_EXC_INFO_STACK 1
|
|
127
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
128
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
129
|
+
#endif
|
|
130
|
+
#undef CYTHON_USE_FREELISTS
|
|
131
|
+
#define CYTHON_USE_FREELISTS 0
|
|
132
|
+
#undef CYTHON_IMMORTAL_CONSTANTS
|
|
133
|
+
#define CYTHON_IMMORTAL_CONSTANTS 0
|
|
134
|
+
#elif defined(PYPY_VERSION)
|
|
135
|
+
#define CYTHON_COMPILING_IN_PYPY 1
|
|
136
|
+
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
137
|
+
#define CYTHON_COMPILING_IN_LIMITED_API 0
|
|
138
|
+
#define CYTHON_COMPILING_IN_GRAAL 0
|
|
139
|
+
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
|
|
140
|
+
#undef CYTHON_USE_TYPE_SLOTS
|
|
141
|
+
#define CYTHON_USE_TYPE_SLOTS 1
|
|
142
|
+
#ifndef CYTHON_USE_TYPE_SPECS
|
|
143
|
+
#define CYTHON_USE_TYPE_SPECS 0
|
|
144
|
+
#endif
|
|
145
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
|
146
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
|
147
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
|
148
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
|
149
|
+
#undef CYTHON_USE_UNICODE_INTERNALS
|
|
150
|
+
#define CYTHON_USE_UNICODE_INTERNALS 0
|
|
151
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
|
152
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
|
153
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
|
154
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
155
|
+
#undef CYTHON_AVOID_BORROWED_REFS
|
|
156
|
+
#define CYTHON_AVOID_BORROWED_REFS 1
|
|
157
|
+
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
158
|
+
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
|
|
159
|
+
#undef CYTHON_ASSUME_SAFE_MACROS
|
|
160
|
+
#define CYTHON_ASSUME_SAFE_MACROS 0
|
|
161
|
+
#ifndef CYTHON_ASSUME_SAFE_SIZE
|
|
162
|
+
#define CYTHON_ASSUME_SAFE_SIZE 1
|
|
163
|
+
#endif
|
|
164
|
+
#undef CYTHON_UNPACK_METHODS
|
|
165
|
+
#define CYTHON_UNPACK_METHODS 0
|
|
166
|
+
#undef CYTHON_FAST_THREAD_STATE
|
|
167
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
|
168
|
+
#undef CYTHON_FAST_GIL
|
|
169
|
+
#define CYTHON_FAST_GIL 0
|
|
170
|
+
#undef CYTHON_METH_FASTCALL
|
|
171
|
+
#define CYTHON_METH_FASTCALL 0
|
|
172
|
+
#undef CYTHON_FAST_PYCALL
|
|
173
|
+
#define CYTHON_FAST_PYCALL 0
|
|
174
|
+
#ifndef CYTHON_PEP487_INIT_SUBCLASS
|
|
175
|
+
#define CYTHON_PEP487_INIT_SUBCLASS 1
|
|
176
|
+
#endif
|
|
177
|
+
#if PY_VERSION_HEX < 0x03090000
|
|
178
|
+
#undef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
179
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 0
|
|
180
|
+
#elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
|
|
181
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
182
|
+
#endif
|
|
183
|
+
#undef CYTHON_USE_MODULE_STATE
|
|
184
|
+
#define CYTHON_USE_MODULE_STATE 0
|
|
185
|
+
#undef CYTHON_USE_SYS_MONITORING
|
|
186
|
+
#define CYTHON_USE_SYS_MONITORING 0
|
|
187
|
+
#ifndef CYTHON_USE_TP_FINALIZE
|
|
188
|
+
#define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
|
|
189
|
+
#endif
|
|
190
|
+
#undef CYTHON_USE_AM_SEND
|
|
191
|
+
#define CYTHON_USE_AM_SEND 0
|
|
192
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
|
193
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
|
194
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
|
195
|
+
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
196
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
197
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
|
|
198
|
+
#endif
|
|
199
|
+
#undef CYTHON_USE_FREELISTS
|
|
200
|
+
#define CYTHON_USE_FREELISTS 0
|
|
201
|
+
#undef CYTHON_IMMORTAL_CONSTANTS
|
|
202
|
+
#define CYTHON_IMMORTAL_CONSTANTS 0
|
|
203
|
+
#elif defined(CYTHON_LIMITED_API)
|
|
204
|
+
#ifdef Py_LIMITED_API
|
|
205
|
+
#undef __PYX_LIMITED_VERSION_HEX
|
|
206
|
+
#define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
|
|
207
|
+
#endif
|
|
208
|
+
#define CYTHON_COMPILING_IN_PYPY 0
|
|
209
|
+
#define CYTHON_COMPILING_IN_CPYTHON 0
|
|
210
|
+
#define CYTHON_COMPILING_IN_LIMITED_API 1
|
|
211
|
+
#define CYTHON_COMPILING_IN_GRAAL 0
|
|
212
|
+
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
|
|
213
|
+
#undef CYTHON_USE_TYPE_SLOTS
|
|
214
|
+
#define CYTHON_USE_TYPE_SLOTS 0
|
|
215
|
+
#undef CYTHON_USE_TYPE_SPECS
|
|
216
|
+
#define CYTHON_USE_TYPE_SPECS 1
|
|
217
|
+
#undef CYTHON_USE_PYTYPE_LOOKUP
|
|
218
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 0
|
|
219
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
|
220
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
|
221
|
+
#undef CYTHON_USE_UNICODE_INTERNALS
|
|
222
|
+
#define CYTHON_USE_UNICODE_INTERNALS 0
|
|
223
|
+
#ifndef CYTHON_USE_UNICODE_WRITER
|
|
224
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
|
225
|
+
#endif
|
|
226
|
+
#undef CYTHON_USE_PYLONG_INTERNALS
|
|
227
|
+
#define CYTHON_USE_PYLONG_INTERNALS 0
|
|
228
|
+
#ifndef CYTHON_AVOID_BORROWED_REFS
|
|
229
|
+
#define CYTHON_AVOID_BORROWED_REFS 0
|
|
230
|
+
#endif
|
|
231
|
+
#ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
232
|
+
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
|
|
233
|
+
#endif
|
|
234
|
+
#undef CYTHON_ASSUME_SAFE_MACROS
|
|
235
|
+
#define CYTHON_ASSUME_SAFE_MACROS 0
|
|
236
|
+
#undef CYTHON_ASSUME_SAFE_SIZE
|
|
237
|
+
#define CYTHON_ASSUME_SAFE_SIZE 0
|
|
238
|
+
#undef CYTHON_UNPACK_METHODS
|
|
239
|
+
#define CYTHON_UNPACK_METHODS 0
|
|
240
|
+
#undef CYTHON_FAST_THREAD_STATE
|
|
241
|
+
#define CYTHON_FAST_THREAD_STATE 0
|
|
242
|
+
#undef CYTHON_FAST_GIL
|
|
243
|
+
#define CYTHON_FAST_GIL 0
|
|
244
|
+
#undef CYTHON_METH_FASTCALL
|
|
245
|
+
#define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
|
|
246
|
+
#undef CYTHON_FAST_PYCALL
|
|
247
|
+
#define CYTHON_FAST_PYCALL 0
|
|
248
|
+
#ifndef CYTHON_PEP487_INIT_SUBCLASS
|
|
249
|
+
#define CYTHON_PEP487_INIT_SUBCLASS 1
|
|
250
|
+
#endif
|
|
251
|
+
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
252
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
253
|
+
#endif
|
|
254
|
+
#ifndef CYTHON_USE_MODULE_STATE
|
|
255
|
+
#define CYTHON_USE_MODULE_STATE 0
|
|
256
|
+
#endif
|
|
257
|
+
#undef CYTHON_USE_SYS_MONITORING
|
|
258
|
+
#define CYTHON_USE_SYS_MONITORING 0
|
|
259
|
+
#ifndef CYTHON_USE_TP_FINALIZE
|
|
260
|
+
#define CYTHON_USE_TP_FINALIZE 0
|
|
261
|
+
#endif
|
|
262
|
+
#ifndef CYTHON_USE_AM_SEND
|
|
263
|
+
#define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
|
|
264
|
+
#endif
|
|
265
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
|
266
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
|
267
|
+
#undef CYTHON_USE_EXC_INFO_STACK
|
|
268
|
+
#define CYTHON_USE_EXC_INFO_STACK 0
|
|
269
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
270
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 0
|
|
271
|
+
#endif
|
|
272
|
+
#ifndef CYTHON_USE_FREELISTS
|
|
273
|
+
#define CYTHON_USE_FREELISTS 1
|
|
274
|
+
#endif
|
|
275
|
+
#undef CYTHON_IMMORTAL_CONSTANTS
|
|
276
|
+
#define CYTHON_IMMORTAL_CONSTANTS 0
|
|
277
|
+
#else
|
|
278
|
+
#define CYTHON_COMPILING_IN_PYPY 0
|
|
279
|
+
#define CYTHON_COMPILING_IN_CPYTHON 1
|
|
280
|
+
#define CYTHON_COMPILING_IN_LIMITED_API 0
|
|
281
|
+
#define CYTHON_COMPILING_IN_GRAAL 0
|
|
282
|
+
#ifdef Py_GIL_DISABLED
|
|
283
|
+
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
|
|
284
|
+
#else
|
|
285
|
+
#define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
|
|
286
|
+
#endif
|
|
287
|
+
#if PY_VERSION_HEX < 0x030A0000
|
|
288
|
+
#undef CYTHON_USE_TYPE_SLOTS
|
|
289
|
+
#define CYTHON_USE_TYPE_SLOTS 1
|
|
290
|
+
#elif !defined(CYTHON_USE_TYPE_SLOTS)
|
|
291
|
+
#define CYTHON_USE_TYPE_SLOTS 1
|
|
292
|
+
#endif
|
|
293
|
+
#ifndef CYTHON_USE_TYPE_SPECS
|
|
294
|
+
#define CYTHON_USE_TYPE_SPECS 0
|
|
295
|
+
#endif
|
|
296
|
+
#ifndef CYTHON_USE_PYTYPE_LOOKUP
|
|
297
|
+
#define CYTHON_USE_PYTYPE_LOOKUP 1
|
|
298
|
+
#endif
|
|
299
|
+
#ifndef CYTHON_USE_PYLONG_INTERNALS
|
|
300
|
+
#define CYTHON_USE_PYLONG_INTERNALS 1
|
|
301
|
+
#endif
|
|
302
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
303
|
+
#undef CYTHON_USE_PYLIST_INTERNALS
|
|
304
|
+
#define CYTHON_USE_PYLIST_INTERNALS 0
|
|
305
|
+
#elif !defined(CYTHON_USE_PYLIST_INTERNALS)
|
|
306
|
+
#define CYTHON_USE_PYLIST_INTERNALS 1
|
|
307
|
+
#endif
|
|
308
|
+
#ifndef CYTHON_USE_UNICODE_INTERNALS
|
|
309
|
+
#define CYTHON_USE_UNICODE_INTERNALS 1
|
|
310
|
+
#endif
|
|
311
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
|
|
312
|
+
#undef CYTHON_USE_UNICODE_WRITER
|
|
313
|
+
#define CYTHON_USE_UNICODE_WRITER 0
|
|
314
|
+
#elif !defined(CYTHON_USE_UNICODE_WRITER)
|
|
315
|
+
#define CYTHON_USE_UNICODE_WRITER 1
|
|
316
|
+
#endif
|
|
317
|
+
#ifndef CYTHON_AVOID_BORROWED_REFS
|
|
318
|
+
#define CYTHON_AVOID_BORROWED_REFS 0
|
|
319
|
+
#endif
|
|
320
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
321
|
+
#undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
322
|
+
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
|
|
323
|
+
#elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
|
|
324
|
+
#define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
|
|
325
|
+
#endif
|
|
326
|
+
#ifndef CYTHON_ASSUME_SAFE_MACROS
|
|
327
|
+
#define CYTHON_ASSUME_SAFE_MACROS 1
|
|
328
|
+
#endif
|
|
329
|
+
#ifndef CYTHON_ASSUME_SAFE_SIZE
|
|
330
|
+
#define CYTHON_ASSUME_SAFE_SIZE 1
|
|
331
|
+
#endif
|
|
332
|
+
#ifndef CYTHON_UNPACK_METHODS
|
|
333
|
+
#define CYTHON_UNPACK_METHODS 1
|
|
334
|
+
#endif
|
|
335
|
+
#ifndef CYTHON_FAST_THREAD_STATE
|
|
336
|
+
#define CYTHON_FAST_THREAD_STATE 1
|
|
337
|
+
#endif
|
|
338
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
339
|
+
#undef CYTHON_FAST_GIL
|
|
340
|
+
#define CYTHON_FAST_GIL 0
|
|
341
|
+
#elif !defined(CYTHON_FAST_GIL)
|
|
342
|
+
#define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
|
|
343
|
+
#endif
|
|
344
|
+
#ifndef CYTHON_METH_FASTCALL
|
|
345
|
+
#define CYTHON_METH_FASTCALL 1
|
|
346
|
+
#endif
|
|
347
|
+
#ifndef CYTHON_FAST_PYCALL
|
|
348
|
+
#define CYTHON_FAST_PYCALL 1
|
|
349
|
+
#endif
|
|
350
|
+
#ifndef CYTHON_PEP487_INIT_SUBCLASS
|
|
351
|
+
#define CYTHON_PEP487_INIT_SUBCLASS 1
|
|
352
|
+
#endif
|
|
353
|
+
#ifndef CYTHON_PEP489_MULTI_PHASE_INIT
|
|
354
|
+
#define CYTHON_PEP489_MULTI_PHASE_INIT 1
|
|
355
|
+
#endif
|
|
356
|
+
#ifndef CYTHON_USE_MODULE_STATE
|
|
357
|
+
#define CYTHON_USE_MODULE_STATE 0
|
|
358
|
+
#endif
|
|
359
|
+
#ifndef CYTHON_USE_SYS_MONITORING
|
|
360
|
+
#define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
|
|
361
|
+
#endif
|
|
362
|
+
#ifndef CYTHON_USE_TP_FINALIZE
|
|
363
|
+
#define CYTHON_USE_TP_FINALIZE 1
|
|
364
|
+
#endif
|
|
365
|
+
#ifndef CYTHON_USE_AM_SEND
|
|
366
|
+
#define CYTHON_USE_AM_SEND 1
|
|
367
|
+
#endif
|
|
368
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
369
|
+
#undef CYTHON_USE_DICT_VERSIONS
|
|
370
|
+
#define CYTHON_USE_DICT_VERSIONS 0
|
|
371
|
+
#elif !defined(CYTHON_USE_DICT_VERSIONS)
|
|
372
|
+
#define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
|
|
373
|
+
#endif
|
|
374
|
+
#ifndef CYTHON_USE_EXC_INFO_STACK
|
|
375
|
+
#define CYTHON_USE_EXC_INFO_STACK 1
|
|
376
|
+
#endif
|
|
377
|
+
#ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
|
|
378
|
+
#define CYTHON_UPDATE_DESCRIPTOR_DOC 1
|
|
379
|
+
#endif
|
|
380
|
+
#ifndef CYTHON_USE_FREELISTS
|
|
381
|
+
#define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
|
|
382
|
+
#endif
|
|
383
|
+
#if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
|
|
384
|
+
#undef CYTHON_IMMORTAL_CONSTANTS
|
|
385
|
+
#define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
|
|
386
|
+
#elif !defined(CYTHON_IMMORTAL_CONSTANTS)
|
|
387
|
+
#define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
|
|
388
|
+
#endif
|
|
389
|
+
#endif
|
|
390
|
+
#ifndef CYTHON_COMPRESS_STRINGS
|
|
391
|
+
#define CYTHON_COMPRESS_STRINGS 1
|
|
392
|
+
#endif
|
|
393
|
+
#ifndef CYTHON_FAST_PYCCALL
|
|
394
|
+
#define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL
|
|
395
|
+
#endif
|
|
396
|
+
#ifndef CYTHON_VECTORCALL
|
|
397
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
398
|
+
#define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
|
|
399
|
+
#else
|
|
400
|
+
#define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL)
|
|
401
|
+
#endif
|
|
402
|
+
#endif
|
|
403
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
404
|
+
#undef SHIFT
|
|
405
|
+
#undef BASE
|
|
406
|
+
#undef MASK
|
|
407
|
+
#ifdef SIZEOF_VOID_P
|
|
408
|
+
enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
|
|
409
|
+
#endif
|
|
410
|
+
#endif
|
|
411
|
+
#ifndef __has_attribute
|
|
412
|
+
#define __has_attribute(x) 0
|
|
413
|
+
#endif
|
|
414
|
+
#ifndef __has_cpp_attribute
|
|
415
|
+
#define __has_cpp_attribute(x) 0
|
|
416
|
+
#endif
|
|
417
|
+
#ifndef CYTHON_RESTRICT
|
|
418
|
+
#if defined(__GNUC__)
|
|
419
|
+
#define CYTHON_RESTRICT __restrict__
|
|
420
|
+
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
|
421
|
+
#define CYTHON_RESTRICT __restrict
|
|
422
|
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
423
|
+
#define CYTHON_RESTRICT restrict
|
|
424
|
+
#else
|
|
425
|
+
#define CYTHON_RESTRICT
|
|
426
|
+
#endif
|
|
427
|
+
#endif
|
|
428
|
+
#ifndef CYTHON_UNUSED
|
|
429
|
+
#if defined(__cplusplus)
|
|
430
|
+
/* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
|
|
431
|
+
* but leads to warnings with -pedantic, since it is a C++17 feature */
|
|
432
|
+
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
|
433
|
+
#if __has_cpp_attribute(maybe_unused)
|
|
434
|
+
#define CYTHON_UNUSED [[maybe_unused]]
|
|
435
|
+
#endif
|
|
436
|
+
#endif
|
|
437
|
+
#endif
|
|
438
|
+
#endif
|
|
439
|
+
#ifndef CYTHON_UNUSED
|
|
440
|
+
# if defined(__GNUC__)
|
|
441
|
+
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
|
442
|
+
# define CYTHON_UNUSED __attribute__ ((__unused__))
|
|
443
|
+
# else
|
|
444
|
+
# define CYTHON_UNUSED
|
|
445
|
+
# endif
|
|
446
|
+
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
|
|
447
|
+
# define CYTHON_UNUSED __attribute__ ((__unused__))
|
|
448
|
+
# else
|
|
449
|
+
# define CYTHON_UNUSED
|
|
450
|
+
# endif
|
|
451
|
+
#endif
|
|
452
|
+
#ifndef CYTHON_UNUSED_VAR
|
|
453
|
+
# if defined(__cplusplus)
|
|
454
|
+
template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
|
|
455
|
+
# else
|
|
456
|
+
# define CYTHON_UNUSED_VAR(x) (void)(x)
|
|
457
|
+
# endif
|
|
458
|
+
#endif
|
|
459
|
+
#ifndef CYTHON_MAYBE_UNUSED_VAR
|
|
460
|
+
#define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
|
|
461
|
+
#endif
|
|
462
|
+
#ifndef CYTHON_NCP_UNUSED
|
|
463
|
+
# if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
464
|
+
# define CYTHON_NCP_UNUSED
|
|
465
|
+
# else
|
|
466
|
+
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
|
|
467
|
+
# endif
|
|
468
|
+
#endif
|
|
469
|
+
#ifndef CYTHON_USE_CPP_STD_MOVE
|
|
470
|
+
#if defined(__cplusplus) && (\
|
|
471
|
+
__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
|
|
472
|
+
#define CYTHON_USE_CPP_STD_MOVE 1
|
|
473
|
+
#else
|
|
474
|
+
#define CYTHON_USE_CPP_STD_MOVE 0
|
|
475
|
+
#endif
|
|
476
|
+
#endif
|
|
477
|
+
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
|
|
478
|
+
#include <stdint.h>
|
|
479
|
+
typedef uintptr_t __pyx_uintptr_t;
|
|
480
|
+
#ifndef CYTHON_FALLTHROUGH
|
|
481
|
+
#if defined(__cplusplus)
|
|
482
|
+
/* for clang __has_cpp_attribute(fallthrough) is true even before C++17
|
|
483
|
+
* but leads to warnings with -pedantic, since it is a C++17 feature */
|
|
484
|
+
#if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
|
|
485
|
+
#if __has_cpp_attribute(fallthrough)
|
|
486
|
+
#define CYTHON_FALLTHROUGH [[fallthrough]]
|
|
487
|
+
#endif
|
|
488
|
+
#endif
|
|
489
|
+
#ifndef CYTHON_FALLTHROUGH
|
|
490
|
+
#if __has_cpp_attribute(clang::fallthrough)
|
|
491
|
+
#define CYTHON_FALLTHROUGH [[clang::fallthrough]]
|
|
492
|
+
#elif __has_cpp_attribute(gnu::fallthrough)
|
|
493
|
+
#define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
|
|
494
|
+
#endif
|
|
495
|
+
#endif
|
|
496
|
+
#endif
|
|
497
|
+
#ifndef CYTHON_FALLTHROUGH
|
|
498
|
+
#if __has_attribute(fallthrough)
|
|
499
|
+
#define CYTHON_FALLTHROUGH __attribute__((fallthrough))
|
|
500
|
+
#else
|
|
501
|
+
#define CYTHON_FALLTHROUGH
|
|
502
|
+
#endif
|
|
503
|
+
#endif
|
|
504
|
+
#if defined(__clang__) && defined(__apple_build_version__)
|
|
505
|
+
#if __apple_build_version__ < 7000000
|
|
506
|
+
#undef CYTHON_FALLTHROUGH
|
|
507
|
+
#define CYTHON_FALLTHROUGH
|
|
508
|
+
#endif
|
|
509
|
+
#endif
|
|
510
|
+
#endif
|
|
511
|
+
#ifndef Py_UNREACHABLE
|
|
512
|
+
#define Py_UNREACHABLE() assert(0); abort()
|
|
513
|
+
#endif
|
|
514
|
+
#ifdef __cplusplus
|
|
515
|
+
template <typename T>
|
|
516
|
+
struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
|
|
517
|
+
#define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
|
|
518
|
+
#else
|
|
519
|
+
#define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
|
|
520
|
+
#endif
|
|
521
|
+
#if CYTHON_COMPILING_IN_PYPY == 1
|
|
522
|
+
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
|
|
523
|
+
#else
|
|
524
|
+
#define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000)
|
|
525
|
+
#endif
|
|
526
|
+
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
|
|
527
|
+
|
|
528
|
+
/* CInitCode */
|
|
529
|
+
#ifndef CYTHON_INLINE
|
|
530
|
+
#if defined(__clang__)
|
|
531
|
+
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
|
|
532
|
+
#elif defined(__GNUC__)
|
|
533
|
+
#define CYTHON_INLINE __inline__
|
|
534
|
+
#elif defined(_MSC_VER)
|
|
535
|
+
#define CYTHON_INLINE __inline
|
|
536
|
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
537
|
+
#define CYTHON_INLINE inline
|
|
538
|
+
#else
|
|
539
|
+
#define CYTHON_INLINE
|
|
540
|
+
#endif
|
|
541
|
+
#endif
|
|
542
|
+
|
|
543
|
+
/* PythonCompatibility */
|
|
544
|
+
#define __PYX_BUILD_PY_SSIZE_T "n"
|
|
545
|
+
#define CYTHON_FORMAT_SSIZE_T "z"
|
|
546
|
+
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
|
|
547
|
+
#define __Pyx_DefaultClassType PyType_Type
|
|
548
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
549
|
+
#ifndef CO_OPTIMIZED
|
|
550
|
+
static int CO_OPTIMIZED;
|
|
551
|
+
#endif
|
|
552
|
+
#ifndef CO_NEWLOCALS
|
|
553
|
+
static int CO_NEWLOCALS;
|
|
554
|
+
#endif
|
|
555
|
+
#ifndef CO_VARARGS
|
|
556
|
+
static int CO_VARARGS;
|
|
557
|
+
#endif
|
|
558
|
+
#ifndef CO_VARKEYWORDS
|
|
559
|
+
static int CO_VARKEYWORDS;
|
|
560
|
+
#endif
|
|
561
|
+
#ifndef CO_ASYNC_GENERATOR
|
|
562
|
+
static int CO_ASYNC_GENERATOR;
|
|
563
|
+
#endif
|
|
564
|
+
#ifndef CO_GENERATOR
|
|
565
|
+
static int CO_GENERATOR;
|
|
566
|
+
#endif
|
|
567
|
+
#ifndef CO_COROUTINE
|
|
568
|
+
static int CO_COROUTINE;
|
|
569
|
+
#endif
|
|
570
|
+
#else
|
|
571
|
+
#ifndef CO_COROUTINE
|
|
572
|
+
#define CO_COROUTINE 0x80
|
|
573
|
+
#endif
|
|
574
|
+
#ifndef CO_ASYNC_GENERATOR
|
|
575
|
+
#define CO_ASYNC_GENERATOR 0x200
|
|
576
|
+
#endif
|
|
577
|
+
#endif
|
|
578
|
+
static int __Pyx_init_co_variables(void);
|
|
579
|
+
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
|
|
580
|
+
#define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
|
|
581
|
+
#else
|
|
582
|
+
#define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
|
|
583
|
+
#endif
|
|
584
|
+
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
|
|
585
|
+
#define __Pyx_Py_Is(x, y) Py_Is(x, y)
|
|
586
|
+
#else
|
|
587
|
+
#define __Pyx_Py_Is(x, y) ((x) == (y))
|
|
588
|
+
#endif
|
|
589
|
+
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
|
|
590
|
+
#define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
|
|
591
|
+
#else
|
|
592
|
+
#define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
|
|
593
|
+
#endif
|
|
594
|
+
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
|
|
595
|
+
#define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
|
|
596
|
+
#else
|
|
597
|
+
#define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
|
|
598
|
+
#endif
|
|
599
|
+
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
|
|
600
|
+
#define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
|
|
601
|
+
#else
|
|
602
|
+
#define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
|
|
603
|
+
#endif
|
|
604
|
+
#define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
|
|
605
|
+
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
|
|
606
|
+
#define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
|
|
607
|
+
#else
|
|
608
|
+
#define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
|
|
609
|
+
#endif
|
|
610
|
+
#ifndef Py_TPFLAGS_CHECKTYPES
|
|
611
|
+
#define Py_TPFLAGS_CHECKTYPES 0
|
|
612
|
+
#endif
|
|
613
|
+
#ifndef Py_TPFLAGS_HAVE_INDEX
|
|
614
|
+
#define Py_TPFLAGS_HAVE_INDEX 0
|
|
615
|
+
#endif
|
|
616
|
+
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
|
|
617
|
+
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
|
|
618
|
+
#endif
|
|
619
|
+
#ifndef Py_TPFLAGS_HAVE_FINALIZE
|
|
620
|
+
#define Py_TPFLAGS_HAVE_FINALIZE 0
|
|
621
|
+
#endif
|
|
622
|
+
#ifndef Py_TPFLAGS_SEQUENCE
|
|
623
|
+
#define Py_TPFLAGS_SEQUENCE 0
|
|
624
|
+
#endif
|
|
625
|
+
#ifndef Py_TPFLAGS_MAPPING
|
|
626
|
+
#define Py_TPFLAGS_MAPPING 0
|
|
627
|
+
#endif
|
|
628
|
+
#ifndef Py_TPFLAGS_IMMUTABLETYPE
|
|
629
|
+
#define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
|
|
630
|
+
#endif
|
|
631
|
+
#ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
|
|
632
|
+
#define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
|
|
633
|
+
#endif
|
|
634
|
+
#ifndef METH_STACKLESS
|
|
635
|
+
#define METH_STACKLESS 0
|
|
636
|
+
#endif
|
|
637
|
+
#ifndef METH_FASTCALL
|
|
638
|
+
#ifndef METH_FASTCALL
|
|
639
|
+
#define METH_FASTCALL 0x80
|
|
640
|
+
#endif
|
|
641
|
+
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
|
|
642
|
+
typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
|
|
643
|
+
Py_ssize_t nargs, PyObject *kwnames);
|
|
644
|
+
#else
|
|
645
|
+
#if PY_VERSION_HEX >= 0x030d00A4
|
|
646
|
+
# define __Pyx_PyCFunctionFast PyCFunctionFast
|
|
647
|
+
# define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
|
|
648
|
+
#else
|
|
649
|
+
# define __Pyx_PyCFunctionFast _PyCFunctionFast
|
|
650
|
+
# define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
|
|
651
|
+
#endif
|
|
652
|
+
#endif
|
|
653
|
+
#if CYTHON_METH_FASTCALL
|
|
654
|
+
#define __Pyx_METH_FASTCALL METH_FASTCALL
|
|
655
|
+
#define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
|
|
656
|
+
#define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
|
|
657
|
+
#else
|
|
658
|
+
#define __Pyx_METH_FASTCALL METH_VARARGS
|
|
659
|
+
#define __Pyx_PyCFunction_FastCall PyCFunction
|
|
660
|
+
#define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
|
|
661
|
+
#endif
|
|
662
|
+
#if CYTHON_VECTORCALL
|
|
663
|
+
#define __pyx_vectorcallfunc vectorcallfunc
|
|
664
|
+
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
|
|
665
|
+
#define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
|
|
666
|
+
#else
|
|
667
|
+
#define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
|
|
668
|
+
#define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
|
|
669
|
+
#endif
|
|
670
|
+
#if PY_VERSION_HEX >= 0x030900B1
|
|
671
|
+
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
|
|
672
|
+
#else
|
|
673
|
+
#define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
|
|
674
|
+
#endif
|
|
675
|
+
#define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
|
|
676
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
677
|
+
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
|
|
678
|
+
#elif !CYTHON_COMPILING_IN_LIMITED_API
|
|
679
|
+
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
|
|
680
|
+
#endif
|
|
681
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
682
|
+
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
|
|
683
|
+
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
|
|
684
|
+
return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
|
|
685
|
+
}
|
|
686
|
+
#endif
|
|
687
|
+
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
|
|
688
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
689
|
+
return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
|
|
690
|
+
#else
|
|
691
|
+
return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
|
|
692
|
+
#endif
|
|
693
|
+
}
|
|
694
|
+
#define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
|
|
695
|
+
#if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
|
|
696
|
+
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
|
|
697
|
+
typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
|
|
698
|
+
#else
|
|
699
|
+
#define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
|
|
700
|
+
#define __Pyx_PyCMethod PyCMethod
|
|
701
|
+
#endif
|
|
702
|
+
#ifndef METH_METHOD
|
|
703
|
+
#define METH_METHOD 0x200
|
|
704
|
+
#endif
|
|
705
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
|
|
706
|
+
#define PyObject_Malloc(s) PyMem_Malloc(s)
|
|
707
|
+
#define PyObject_Free(p) PyMem_Free(p)
|
|
708
|
+
#define PyObject_Realloc(p) PyMem_Realloc(p)
|
|
709
|
+
#endif
|
|
710
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
711
|
+
#define __Pyx_PyFrame_SetLineNumber(frame, lineno)
|
|
712
|
+
#elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
|
|
713
|
+
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
|
|
714
|
+
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
|
|
715
|
+
#elif CYTHON_COMPILING_IN_GRAAL
|
|
716
|
+
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
|
|
717
|
+
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
|
|
718
|
+
#else
|
|
719
|
+
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
|
|
720
|
+
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
|
|
721
|
+
#endif
|
|
722
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
723
|
+
#define __Pyx_PyThreadState_Current PyThreadState_Get()
|
|
724
|
+
#elif !CYTHON_FAST_THREAD_STATE
|
|
725
|
+
#define __Pyx_PyThreadState_Current PyThreadState_GET()
|
|
726
|
+
#elif PY_VERSION_HEX >= 0x030d00A1
|
|
727
|
+
#define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
|
|
728
|
+
#else
|
|
729
|
+
#define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
|
|
730
|
+
#endif
|
|
731
|
+
#if CYTHON_USE_MODULE_STATE
|
|
732
|
+
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
|
|
733
|
+
{
|
|
734
|
+
void *result;
|
|
735
|
+
result = PyModule_GetState(op);
|
|
736
|
+
if (!result)
|
|
737
|
+
Py_FatalError("Couldn't find the module state");
|
|
738
|
+
return result;
|
|
739
|
+
}
|
|
740
|
+
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
|
|
741
|
+
#else
|
|
742
|
+
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
|
|
743
|
+
#endif
|
|
744
|
+
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
|
|
745
|
+
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
|
|
746
|
+
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
|
|
747
|
+
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
|
|
748
|
+
#if CYTHON_USE_TYPE_SLOTS
|
|
749
|
+
#define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
|
|
750
|
+
#define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
|
|
751
|
+
#define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
|
|
752
|
+
#define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
|
|
753
|
+
#else
|
|
754
|
+
#define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
|
|
755
|
+
#define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
|
|
756
|
+
((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
|
|
757
|
+
(PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
|
|
758
|
+
__Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
|
|
759
|
+
#define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
|
|
760
|
+
#define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
|
|
761
|
+
#endif
|
|
762
|
+
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
|
|
763
|
+
#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
|
|
764
|
+
#else
|
|
765
|
+
#define __Pyx_PyDict_NewPresized(n) PyDict_New()
|
|
766
|
+
#endif
|
|
767
|
+
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
|
|
768
|
+
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
|
|
769
|
+
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
|
|
770
|
+
#define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
|
|
771
|
+
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
|
|
772
|
+
PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
|
|
773
|
+
if (res == NULL) PyErr_Clear();
|
|
774
|
+
return res;
|
|
775
|
+
}
|
|
776
|
+
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
|
|
777
|
+
#define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
|
|
778
|
+
#define __Pyx_PyDict_GetItemStr PyDict_GetItem
|
|
779
|
+
#else
|
|
780
|
+
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
|
|
781
|
+
#if CYTHON_COMPILING_IN_PYPY
|
|
782
|
+
return PyDict_GetItem(dict, name);
|
|
783
|
+
#else
|
|
784
|
+
PyDictEntry *ep;
|
|
785
|
+
PyDictObject *mp = (PyDictObject*) dict;
|
|
786
|
+
long hash = ((PyStringObject *) name)->ob_shash;
|
|
787
|
+
assert(hash != -1);
|
|
788
|
+
ep = (mp->ma_lookup)(mp, name, hash);
|
|
789
|
+
if (ep == NULL) {
|
|
790
|
+
return NULL;
|
|
791
|
+
}
|
|
792
|
+
return ep->me_value;
|
|
793
|
+
#endif
|
|
794
|
+
}
|
|
795
|
+
#define __Pyx_PyDict_GetItemStr PyDict_GetItem
|
|
796
|
+
#endif
|
|
797
|
+
#if CYTHON_USE_TYPE_SLOTS
|
|
798
|
+
#define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
|
|
799
|
+
#define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
|
|
800
|
+
#else
|
|
801
|
+
#define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
|
|
802
|
+
#define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
|
|
803
|
+
#endif
|
|
804
|
+
#define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
|
|
805
|
+
#if CYTHON_USE_TYPE_SPECS
|
|
806
|
+
#define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
|
|
807
|
+
PyTypeObject *type = Py_TYPE((PyObject*)obj);\
|
|
808
|
+
assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
|
|
809
|
+
PyObject_GC_Del(obj);\
|
|
810
|
+
Py_DECREF(type);\
|
|
811
|
+
}
|
|
812
|
+
#else
|
|
813
|
+
#define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
|
|
814
|
+
#endif
|
|
815
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
816
|
+
#define __Pyx_PyUnicode_READY(op) (0)
|
|
817
|
+
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
|
|
818
|
+
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
|
|
819
|
+
#define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
|
|
820
|
+
#define __Pyx_PyUnicode_DATA(u) ((void*)u)
|
|
821
|
+
#define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
|
|
822
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
|
|
823
|
+
#else
|
|
824
|
+
#if PY_VERSION_HEX >= 0x030C0000
|
|
825
|
+
#define __Pyx_PyUnicode_READY(op) (0)
|
|
826
|
+
#else
|
|
827
|
+
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
|
|
828
|
+
0 : _PyUnicode_Ready((PyObject *)(op)))
|
|
829
|
+
#endif
|
|
830
|
+
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
|
|
831
|
+
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
|
|
832
|
+
#define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
|
|
833
|
+
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
|
|
834
|
+
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
|
|
835
|
+
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
|
|
836
|
+
#if PY_VERSION_HEX >= 0x030C0000
|
|
837
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
|
|
838
|
+
#else
|
|
839
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
|
|
840
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
|
|
841
|
+
#else
|
|
842
|
+
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
|
|
843
|
+
#endif
|
|
844
|
+
#endif
|
|
845
|
+
#endif
|
|
846
|
+
#if CYTHON_COMPILING_IN_PYPY
|
|
847
|
+
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
|
|
848
|
+
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
|
|
849
|
+
#else
|
|
850
|
+
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
|
|
851
|
+
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
|
|
852
|
+
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
|
|
853
|
+
#endif
|
|
854
|
+
#if CYTHON_COMPILING_IN_PYPY
|
|
855
|
+
#if !defined(PyUnicode_DecodeUnicodeEscape)
|
|
856
|
+
#define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
|
|
857
|
+
#endif
|
|
858
|
+
#if !defined(PyUnicode_Contains)
|
|
859
|
+
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
|
|
860
|
+
#endif
|
|
861
|
+
#if !defined(PyByteArray_Check)
|
|
862
|
+
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
|
|
863
|
+
#endif
|
|
864
|
+
#if !defined(PyObject_Format)
|
|
865
|
+
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
|
|
866
|
+
#endif
|
|
867
|
+
#endif
|
|
868
|
+
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
|
|
869
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
|
|
870
|
+
#define __Pyx_PySequence_ListKeepNew(obj)\
|
|
871
|
+
(likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
|
|
872
|
+
#elif CYTHON_COMPILING_IN_CPYTHON
|
|
873
|
+
#define __Pyx_PySequence_ListKeepNew(obj)\
|
|
874
|
+
(likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
|
|
875
|
+
#else
|
|
876
|
+
#define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
|
|
877
|
+
#endif
|
|
878
|
+
#ifndef PySet_CheckExact
|
|
879
|
+
#define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
|
|
880
|
+
#endif
|
|
881
|
+
#if PY_VERSION_HEX >= 0x030900A4
|
|
882
|
+
#define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
|
|
883
|
+
#define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
|
|
884
|
+
#else
|
|
885
|
+
#define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
|
|
886
|
+
#define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
|
|
887
|
+
#endif
|
|
888
|
+
enum __Pyx_ReferenceSharing {
|
|
889
|
+
__Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
|
|
890
|
+
__Pyx_ReferenceSharing_OwnStrongReference,
|
|
891
|
+
__Pyx_ReferenceSharing_FunctionArgument,
|
|
892
|
+
__Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
|
|
893
|
+
};
|
|
894
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
|
|
895
|
+
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
|
|
896
|
+
(sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
|
|
897
|
+
(sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
|
|
898
|
+
(sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
|
|
899
|
+
#elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
|
|
900
|
+
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
|
|
901
|
+
#else
|
|
902
|
+
#define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
|
|
903
|
+
#endif
|
|
904
|
+
#if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
905
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
906
|
+
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
|
|
907
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
|
|
908
|
+
#define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
|
|
909
|
+
#else
|
|
910
|
+
#define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
|
|
911
|
+
#endif
|
|
912
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
|
|
913
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
914
|
+
#define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
|
|
915
|
+
#else
|
|
916
|
+
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
|
|
917
|
+
#endif
|
|
918
|
+
#else
|
|
919
|
+
#define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
|
|
920
|
+
#endif
|
|
921
|
+
#if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
|
|
922
|
+
#define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
|
|
923
|
+
__Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
|
|
924
|
+
#else
|
|
925
|
+
#define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
|
|
926
|
+
#endif
|
|
927
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
928
|
+
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
|
|
929
|
+
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
|
|
930
|
+
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
|
|
931
|
+
*result = PyObject_GetItem(dict, key);
|
|
932
|
+
if (*result == NULL) {
|
|
933
|
+
if (PyErr_ExceptionMatches(PyExc_KeyError)) {
|
|
934
|
+
PyErr_Clear();
|
|
935
|
+
return 0;
|
|
936
|
+
}
|
|
937
|
+
return -1;
|
|
938
|
+
}
|
|
939
|
+
return 1;
|
|
940
|
+
}
|
|
941
|
+
#else
|
|
942
|
+
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
|
|
943
|
+
*result = PyDict_GetItemWithError(dict, key);
|
|
944
|
+
if (*result == NULL) {
|
|
945
|
+
return PyErr_Occurred() ? -1 : 0;
|
|
946
|
+
}
|
|
947
|
+
Py_INCREF(*result);
|
|
948
|
+
return 1;
|
|
949
|
+
}
|
|
950
|
+
#endif
|
|
951
|
+
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
|
|
952
|
+
#define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
|
|
953
|
+
#else
|
|
954
|
+
#define __Pyx_VISIT_CONST(obj)
|
|
955
|
+
#endif
|
|
956
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
957
|
+
#define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
|
|
958
|
+
#define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
|
|
959
|
+
#define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
|
|
960
|
+
#define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
|
|
961
|
+
#define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
|
|
962
|
+
#define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
|
|
963
|
+
#else
|
|
964
|
+
#define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
|
|
965
|
+
#define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
|
|
966
|
+
#define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
|
|
967
|
+
#define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
|
|
968
|
+
#define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
|
|
969
|
+
#define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
|
|
970
|
+
#endif
|
|
971
|
+
#if CYTHON_ASSUME_SAFE_SIZE
|
|
972
|
+
#define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
|
|
973
|
+
#define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
|
|
974
|
+
#define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
|
|
975
|
+
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
|
|
976
|
+
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
|
|
977
|
+
#define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
|
|
978
|
+
#else
|
|
979
|
+
#define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
|
|
980
|
+
#define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
|
|
981
|
+
#define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
|
|
982
|
+
#define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
|
|
983
|
+
#define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
|
|
984
|
+
#define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
|
|
985
|
+
#endif
|
|
986
|
+
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
|
|
987
|
+
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
|
|
988
|
+
#endif
|
|
989
|
+
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
|
|
990
|
+
#define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
|
|
991
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
|
|
992
|
+
#define __Pyx_PySendResult PySendResult
|
|
993
|
+
#else
|
|
994
|
+
typedef enum {
|
|
995
|
+
PYGEN_RETURN = 0,
|
|
996
|
+
PYGEN_ERROR = -1,
|
|
997
|
+
PYGEN_NEXT = 1,
|
|
998
|
+
} __Pyx_PySendResult;
|
|
999
|
+
#endif
|
|
1000
|
+
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
|
|
1001
|
+
typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
|
|
1002
|
+
#else
|
|
1003
|
+
#define __Pyx_pyiter_sendfunc sendfunc
|
|
1004
|
+
#endif
|
|
1005
|
+
#if !CYTHON_USE_AM_SEND
|
|
1006
|
+
#define __PYX_HAS_PY_AM_SEND 0
|
|
1007
|
+
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
|
|
1008
|
+
#define __PYX_HAS_PY_AM_SEND 1
|
|
1009
|
+
#else
|
|
1010
|
+
#define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
|
|
1011
|
+
#endif
|
|
1012
|
+
#if __PYX_HAS_PY_AM_SEND < 2
|
|
1013
|
+
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
|
|
1014
|
+
#else
|
|
1015
|
+
typedef struct {
|
|
1016
|
+
unaryfunc am_await;
|
|
1017
|
+
unaryfunc am_aiter;
|
|
1018
|
+
unaryfunc am_anext;
|
|
1019
|
+
__Pyx_pyiter_sendfunc am_send;
|
|
1020
|
+
} __Pyx_PyAsyncMethodsStruct;
|
|
1021
|
+
#define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
|
|
1022
|
+
#endif
|
|
1023
|
+
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
|
|
1024
|
+
#define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
|
|
1025
|
+
#else
|
|
1026
|
+
#define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
|
|
1027
|
+
#endif
|
|
1028
|
+
#if PY_VERSION_HEX >= 0x03090000
|
|
1029
|
+
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
|
|
1030
|
+
#else
|
|
1031
|
+
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
|
|
1032
|
+
#endif
|
|
1033
|
+
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
|
|
1034
|
+
#ifdef __cplusplus
|
|
1035
|
+
extern "C"
|
|
1036
|
+
#endif
|
|
1037
|
+
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
|
|
1038
|
+
#endif
|
|
1039
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
1040
|
+
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
|
|
1041
|
+
int value;
|
|
1042
|
+
PyObject *py_value = PyObject_GetAttrString(inspect, name);
|
|
1043
|
+
if (!py_value) return 0;
|
|
1044
|
+
value = (int) PyLong_AsLong(py_value);
|
|
1045
|
+
Py_DECREF(py_value);
|
|
1046
|
+
*write_to = value;
|
|
1047
|
+
return value != -1 || !PyErr_Occurred();
|
|
1048
|
+
}
|
|
1049
|
+
static int __Pyx_init_co_variables(void) {
|
|
1050
|
+
PyObject *inspect;
|
|
1051
|
+
int result;
|
|
1052
|
+
inspect = PyImport_ImportModule("inspect");
|
|
1053
|
+
result =
|
|
1054
|
+
#if !defined(CO_OPTIMIZED)
|
|
1055
|
+
__Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
|
|
1056
|
+
#endif
|
|
1057
|
+
#if !defined(CO_NEWLOCALS)
|
|
1058
|
+
__Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
|
|
1059
|
+
#endif
|
|
1060
|
+
#if !defined(CO_VARARGS)
|
|
1061
|
+
__Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
|
|
1062
|
+
#endif
|
|
1063
|
+
#if !defined(CO_VARKEYWORDS)
|
|
1064
|
+
__Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
|
|
1065
|
+
#endif
|
|
1066
|
+
#if !defined(CO_ASYNC_GENERATOR)
|
|
1067
|
+
__Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
|
|
1068
|
+
#endif
|
|
1069
|
+
#if !defined(CO_GENERATOR)
|
|
1070
|
+
__Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
|
|
1071
|
+
#endif
|
|
1072
|
+
#if !defined(CO_COROUTINE)
|
|
1073
|
+
__Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
|
|
1074
|
+
#endif
|
|
1075
|
+
1;
|
|
1076
|
+
Py_DECREF(inspect);
|
|
1077
|
+
return result ? 0 : -1;
|
|
1078
|
+
}
|
|
1079
|
+
#else
|
|
1080
|
+
static int __Pyx_init_co_variables(void) {
|
|
1081
|
+
return 0; // It's a limited API-only feature
|
|
1082
|
+
}
|
|
1083
|
+
#endif
|
|
1084
|
+
|
|
1085
|
+
/* MathInitCode */
|
|
1086
|
+
#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
|
|
1087
|
+
#ifndef _USE_MATH_DEFINES
|
|
1088
|
+
#define _USE_MATH_DEFINES
|
|
1089
|
+
#endif
|
|
1090
|
+
#endif
|
|
1091
|
+
#include <math.h>
|
|
1092
|
+
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
|
|
1093
|
+
#define __Pyx_truncl trunc
|
|
1094
|
+
#else
|
|
1095
|
+
#define __Pyx_truncl truncl
|
|
1096
|
+
#endif
|
|
1097
|
+
|
|
1098
|
+
#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
|
|
1099
|
+
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
|
|
1100
|
+
#endif
|
|
1101
|
+
#ifndef CYTHON_CLINE_IN_TRACEBACK
|
|
1102
|
+
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
|
|
1103
|
+
#endif
|
|
1104
|
+
#if CYTHON_CLINE_IN_TRACEBACK
|
|
1105
|
+
#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
|
|
1106
|
+
#else
|
|
1107
|
+
#define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
|
|
1108
|
+
#endif
|
|
1109
|
+
#define __PYX_ERR(f_index, lineno, Ln_error) \
|
|
1110
|
+
{ __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
|
|
1111
|
+
|
|
1112
|
+
#ifdef CYTHON_EXTERN_C
|
|
1113
|
+
#undef __PYX_EXTERN_C
|
|
1114
|
+
#define __PYX_EXTERN_C CYTHON_EXTERN_C
|
|
1115
|
+
#elif defined(__PYX_EXTERN_C)
|
|
1116
|
+
#ifdef _MSC_VER
|
|
1117
|
+
#pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
|
|
1118
|
+
#else
|
|
1119
|
+
#warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
|
|
1120
|
+
#endif
|
|
1121
|
+
#else
|
|
1122
|
+
#ifdef __cplusplus
|
|
1123
|
+
#define __PYX_EXTERN_C extern "C"
|
|
1124
|
+
#else
|
|
1125
|
+
#define __PYX_EXTERN_C extern
|
|
1126
|
+
#endif
|
|
1127
|
+
#endif
|
|
1128
|
+
|
|
1129
|
+
#define __PYX_HAVE__webview___dummy_holder
|
|
1130
|
+
#define __PYX_HAVE_API__webview___dummy_holder
|
|
1131
|
+
/* Early includes */
|
|
1132
|
+
#ifdef _OPENMP
|
|
1133
|
+
#include <omp.h>
|
|
1134
|
+
#endif /* _OPENMP */
|
|
1135
|
+
|
|
1136
|
+
#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
|
|
1137
|
+
#define CYTHON_WITHOUT_ASSERTIONS
|
|
1138
|
+
#endif
|
|
1139
|
+
|
|
1140
|
+
#ifdef CYTHON_FREETHREADING_COMPATIBLE
|
|
1141
|
+
#if CYTHON_FREETHREADING_COMPATIBLE
|
|
1142
|
+
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
|
|
1143
|
+
#else
|
|
1144
|
+
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
|
|
1145
|
+
#endif
|
|
1146
|
+
#else
|
|
1147
|
+
#define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
|
|
1148
|
+
#endif
|
|
1149
|
+
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
|
|
1150
|
+
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
|
|
1151
|
+
#define __PYX_DEFAULT_STRING_ENCODING ""
|
|
1152
|
+
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
|
|
1153
|
+
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
|
1154
|
+
#define __Pyx_uchar_cast(c) ((unsigned char)c)
|
|
1155
|
+
#define __Pyx_long_cast(x) ((long)x)
|
|
1156
|
+
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
|
|
1157
|
+
(sizeof(type) < sizeof(Py_ssize_t)) ||\
|
|
1158
|
+
(sizeof(type) > sizeof(Py_ssize_t) &&\
|
|
1159
|
+
likely(v < (type)PY_SSIZE_T_MAX ||\
|
|
1160
|
+
v == (type)PY_SSIZE_T_MAX) &&\
|
|
1161
|
+
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
|
|
1162
|
+
v == (type)PY_SSIZE_T_MIN))) ||\
|
|
1163
|
+
(sizeof(type) == sizeof(Py_ssize_t) &&\
|
|
1164
|
+
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
|
|
1165
|
+
v == (type)PY_SSIZE_T_MAX))) )
|
|
1166
|
+
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
|
|
1167
|
+
return (size_t) i < (size_t) limit;
|
|
1168
|
+
}
|
|
1169
|
+
#if defined (__cplusplus) && __cplusplus >= 201103L
|
|
1170
|
+
#include <cstdlib>
|
|
1171
|
+
#define __Pyx_sst_abs(value) std::abs(value)
|
|
1172
|
+
#elif SIZEOF_INT >= SIZEOF_SIZE_T
|
|
1173
|
+
#define __Pyx_sst_abs(value) abs(value)
|
|
1174
|
+
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
|
|
1175
|
+
#define __Pyx_sst_abs(value) labs(value)
|
|
1176
|
+
#elif defined (_MSC_VER)
|
|
1177
|
+
#define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
|
|
1178
|
+
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
|
1179
|
+
#define __Pyx_sst_abs(value) llabs(value)
|
|
1180
|
+
#elif defined (__GNUC__)
|
|
1181
|
+
#define __Pyx_sst_abs(value) __builtin_llabs(value)
|
|
1182
|
+
#else
|
|
1183
|
+
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
|
|
1184
|
+
#endif
|
|
1185
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
|
|
1186
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
|
|
1187
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
|
1188
|
+
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
|
|
1189
|
+
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
|
|
1190
|
+
#define __Pyx_PyBytes_FromString PyBytes_FromString
|
|
1191
|
+
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
|
1192
|
+
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
|
1193
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
1194
|
+
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
|
|
1195
|
+
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
|
|
1196
|
+
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
|
|
1197
|
+
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
|
|
1198
|
+
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
|
|
1199
|
+
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
|
|
1200
|
+
#define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
|
|
1201
|
+
#else
|
|
1202
|
+
#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
|
|
1203
|
+
#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
|
|
1204
|
+
#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
|
|
1205
|
+
#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
|
|
1206
|
+
#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
|
|
1207
|
+
#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
|
|
1208
|
+
#define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
|
|
1209
|
+
#endif
|
|
1210
|
+
#define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
|
1211
|
+
#define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
|
1212
|
+
#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
|
|
1213
|
+
#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
|
|
1214
|
+
#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
|
|
1215
|
+
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
|
|
1216
|
+
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
|
|
1217
|
+
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
|
1218
|
+
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
|
1219
|
+
#define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
|
|
1220
|
+
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
|
1221
|
+
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
|
|
1222
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
|
|
1223
|
+
return Py_NewRef(obj);
|
|
1224
|
+
#else
|
|
1225
|
+
Py_INCREF(obj);
|
|
1226
|
+
return obj;
|
|
1227
|
+
#endif
|
|
1228
|
+
}
|
|
1229
|
+
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
|
|
1230
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
|
|
1231
|
+
return Py_XNewRef(obj);
|
|
1232
|
+
#else
|
|
1233
|
+
Py_XINCREF(obj);
|
|
1234
|
+
return obj;
|
|
1235
|
+
#endif
|
|
1236
|
+
}
|
|
1237
|
+
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
|
|
1238
|
+
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
|
|
1239
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
|
|
1240
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
|
|
1241
|
+
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
|
|
1242
|
+
#define __Pyx_PySequence_Tuple(obj)\
|
|
1243
|
+
(likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
|
|
1244
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
|
|
1245
|
+
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
|
|
1246
|
+
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
|
|
1247
|
+
#if CYTHON_ASSUME_SAFE_MACROS
|
|
1248
|
+
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
|
|
1249
|
+
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
|
|
1250
|
+
#else
|
|
1251
|
+
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
|
|
1252
|
+
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
|
|
1253
|
+
#endif
|
|
1254
|
+
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
|
|
1255
|
+
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
|
|
1256
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
1257
|
+
#if PY_VERSION_HEX >= 0x030C00A7
|
|
1258
|
+
#ifndef _PyLong_SIGN_MASK
|
|
1259
|
+
#define _PyLong_SIGN_MASK 3
|
|
1260
|
+
#endif
|
|
1261
|
+
#ifndef _PyLong_NON_SIZE_BITS
|
|
1262
|
+
#define _PyLong_NON_SIZE_BITS 3
|
|
1263
|
+
#endif
|
|
1264
|
+
#define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
|
|
1265
|
+
#define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
|
|
1266
|
+
#define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
|
|
1267
|
+
#define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
|
|
1268
|
+
#define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
|
|
1269
|
+
#define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
|
|
1270
|
+
#define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
|
|
1271
|
+
#define __Pyx_PyLong_SignedDigitCount(x)\
|
|
1272
|
+
((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
|
|
1273
|
+
#if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
|
|
1274
|
+
#define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
|
|
1275
|
+
#define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
|
|
1276
|
+
#else
|
|
1277
|
+
#define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
|
|
1278
|
+
#define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
|
|
1279
|
+
#endif
|
|
1280
|
+
typedef Py_ssize_t __Pyx_compact_pylong;
|
|
1281
|
+
typedef size_t __Pyx_compact_upylong;
|
|
1282
|
+
#else
|
|
1283
|
+
#define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
|
|
1284
|
+
#define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
|
|
1285
|
+
#define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
|
|
1286
|
+
#define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
|
|
1287
|
+
#define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
|
|
1288
|
+
#define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
|
|
1289
|
+
#define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
|
|
1290
|
+
#define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
|
|
1291
|
+
#define __Pyx_PyLong_CompactValue(x)\
|
|
1292
|
+
((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
|
|
1293
|
+
typedef sdigit __Pyx_compact_pylong;
|
|
1294
|
+
typedef digit __Pyx_compact_upylong;
|
|
1295
|
+
#endif
|
|
1296
|
+
#if PY_VERSION_HEX >= 0x030C00A5
|
|
1297
|
+
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
|
|
1298
|
+
#else
|
|
1299
|
+
#define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
|
|
1300
|
+
#endif
|
|
1301
|
+
#endif
|
|
1302
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
|
|
1303
|
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
|
|
1304
|
+
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
1305
|
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
|
|
1306
|
+
#else
|
|
1307
|
+
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
|
1308
|
+
#endif
|
|
1309
|
+
|
|
1310
|
+
|
|
1311
|
+
/* Test for GCC > 2.95 */
|
|
1312
|
+
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
|
|
1313
|
+
#define likely(x) __builtin_expect(!!(x), 1)
|
|
1314
|
+
#define unlikely(x) __builtin_expect(!!(x), 0)
|
|
1315
|
+
#else /* !__GNUC__ or GCC < 2.95 */
|
|
1316
|
+
#define likely(x) (x)
|
|
1317
|
+
#define unlikely(x) (x)
|
|
1318
|
+
#endif /* __GNUC__ */
|
|
1319
|
+
/* PretendToInitialize */
|
|
1320
|
+
#ifdef __cplusplus
|
|
1321
|
+
#if __cplusplus > 201103L
|
|
1322
|
+
#include <type_traits>
|
|
1323
|
+
#endif
|
|
1324
|
+
template <typename T>
|
|
1325
|
+
static void __Pyx_pretend_to_initialize(T* ptr) {
|
|
1326
|
+
#if __cplusplus > 201103L
|
|
1327
|
+
if ((std::is_trivially_default_constructible<T>::value))
|
|
1328
|
+
#endif
|
|
1329
|
+
*ptr = T();
|
|
1330
|
+
(void)ptr;
|
|
1331
|
+
}
|
|
1332
|
+
#else
|
|
1333
|
+
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
|
|
1334
|
+
#endif
|
|
1335
|
+
|
|
1336
|
+
|
|
1337
|
+
#if !CYTHON_USE_MODULE_STATE
|
|
1338
|
+
static PyObject *__pyx_m = NULL;
|
|
1339
|
+
#endif
|
|
1340
|
+
static int __pyx_lineno;
|
|
1341
|
+
static int __pyx_clineno = 0;
|
|
1342
|
+
static const char * const __pyx_cfilenm = __FILE__;
|
|
1343
|
+
static const char *__pyx_filename;
|
|
1344
|
+
|
|
1345
|
+
/* #### Code section: filename_table ### */
|
|
1346
|
+
|
|
1347
|
+
static const char* const __pyx_f[] = {
|
|
1348
|
+
"src/webview/_dummy_holder.pyx",
|
|
1349
|
+
};
|
|
1350
|
+
/* #### Code section: utility_code_proto_before_types ### */
|
|
1351
|
+
/* Atomics.proto (used by CodeObjectCache) */
|
|
1352
|
+
#include <pythread.h>
|
|
1353
|
+
#ifndef CYTHON_ATOMICS
|
|
1354
|
+
#define CYTHON_ATOMICS 1
|
|
1355
|
+
#endif
|
|
1356
|
+
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
|
|
1357
|
+
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
1358
|
+
#define __pyx_atomic_int_type int
|
|
1359
|
+
#define __pyx_nonatomic_int_type int
|
|
1360
|
+
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
|
|
1361
|
+
(__STDC_VERSION__ >= 201112L) &&\
|
|
1362
|
+
!defined(__STDC_NO_ATOMICS__))
|
|
1363
|
+
#include <stdatomic.h>
|
|
1364
|
+
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
|
|
1365
|
+
(__cplusplus >= 201103L) ||\
|
|
1366
|
+
(defined(_MSC_VER) && _MSC_VER >= 1700)))
|
|
1367
|
+
#include <atomic>
|
|
1368
|
+
#endif
|
|
1369
|
+
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
|
|
1370
|
+
(__STDC_VERSION__ >= 201112L) &&\
|
|
1371
|
+
!defined(__STDC_NO_ATOMICS__) &&\
|
|
1372
|
+
ATOMIC_INT_LOCK_FREE == 2)
|
|
1373
|
+
#undef __pyx_atomic_int_type
|
|
1374
|
+
#define __pyx_atomic_int_type atomic_int
|
|
1375
|
+
#define __pyx_atomic_ptr_type atomic_uintptr_t
|
|
1376
|
+
#define __pyx_nonatomic_ptr_type uintptr_t
|
|
1377
|
+
#define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
|
|
1378
|
+
#define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
|
|
1379
|
+
#define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
|
|
1380
|
+
#define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
|
|
1381
|
+
#define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
|
|
1382
|
+
#define __pyx_atomic_load(value) atomic_load(value)
|
|
1383
|
+
#define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
|
|
1384
|
+
#define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
|
|
1385
|
+
#define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
|
|
1386
|
+
#define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
|
|
1387
|
+
#define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
|
|
1388
|
+
#if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
|
|
1389
|
+
#pragma message ("Using standard C atomics")
|
|
1390
|
+
#elif defined(__PYX_DEBUG_ATOMICS)
|
|
1391
|
+
#warning "Using standard C atomics"
|
|
1392
|
+
#endif
|
|
1393
|
+
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
|
|
1394
|
+
(__cplusplus >= 201103L) ||\
|
|
1395
|
+
\
|
|
1396
|
+
(defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
|
|
1397
|
+
ATOMIC_INT_LOCK_FREE == 2)
|
|
1398
|
+
#undef __pyx_atomic_int_type
|
|
1399
|
+
#define __pyx_atomic_int_type std::atomic_int
|
|
1400
|
+
#define __pyx_atomic_ptr_type std::atomic_uintptr_t
|
|
1401
|
+
#define __pyx_nonatomic_ptr_type uintptr_t
|
|
1402
|
+
#define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
|
|
1403
|
+
#define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
|
|
1404
|
+
#define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
|
|
1405
|
+
#define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
|
|
1406
|
+
#define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
|
|
1407
|
+
#define __pyx_atomic_load(value) std::atomic_load(value)
|
|
1408
|
+
#define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
|
|
1409
|
+
#define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
|
|
1410
|
+
#define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
|
|
1411
|
+
#define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
|
|
1412
|
+
#define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
|
|
1413
|
+
#if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
|
|
1414
|
+
#pragma message ("Using standard C++ atomics")
|
|
1415
|
+
#elif defined(__PYX_DEBUG_ATOMICS)
|
|
1416
|
+
#warning "Using standard C++ atomics"
|
|
1417
|
+
#endif
|
|
1418
|
+
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
|
|
1419
|
+
(__GNUC_MINOR__ > 1 ||\
|
|
1420
|
+
(__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
|
|
1421
|
+
#define __pyx_atomic_ptr_type void*
|
|
1422
|
+
#define __pyx_nonatomic_ptr_type void*
|
|
1423
|
+
#define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
|
|
1424
|
+
#define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
|
|
1425
|
+
#define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
|
|
1426
|
+
#define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
|
|
1427
|
+
static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
|
|
1428
|
+
__pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
|
|
1429
|
+
int result = old == *expected;
|
|
1430
|
+
*expected = old;
|
|
1431
|
+
return result;
|
|
1432
|
+
}
|
|
1433
|
+
#define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
|
|
1434
|
+
#define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
|
|
1435
|
+
#define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
|
|
1436
|
+
#define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
|
|
1437
|
+
#define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
|
|
1438
|
+
static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
|
|
1439
|
+
__pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
|
|
1440
|
+
int result = old == *expected;
|
|
1441
|
+
*expected = old;
|
|
1442
|
+
return result;
|
|
1443
|
+
}
|
|
1444
|
+
#ifdef __PYX_DEBUG_ATOMICS
|
|
1445
|
+
#warning "Using GNU atomics"
|
|
1446
|
+
#endif
|
|
1447
|
+
#elif CYTHON_ATOMICS && defined(_MSC_VER)
|
|
1448
|
+
#include <intrin.h>
|
|
1449
|
+
#undef __pyx_atomic_int_type
|
|
1450
|
+
#define __pyx_atomic_int_type long
|
|
1451
|
+
#define __pyx_atomic_ptr_type void*
|
|
1452
|
+
#undef __pyx_nonatomic_int_type
|
|
1453
|
+
#define __pyx_nonatomic_int_type long
|
|
1454
|
+
#define __pyx_nonatomic_ptr_type void*
|
|
1455
|
+
#pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
|
|
1456
|
+
#define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
|
|
1457
|
+
#define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
|
|
1458
|
+
#define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
|
|
1459
|
+
#define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
|
|
1460
|
+
static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
|
|
1461
|
+
__pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
|
|
1462
|
+
int result = old == *expected;
|
|
1463
|
+
*expected = old;
|
|
1464
|
+
return result;
|
|
1465
|
+
}
|
|
1466
|
+
#define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
|
|
1467
|
+
#define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
|
|
1468
|
+
#define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
|
|
1469
|
+
#define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
|
|
1470
|
+
#define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
|
|
1471
|
+
static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
|
|
1472
|
+
__pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
|
|
1473
|
+
int result = old == *expected;
|
|
1474
|
+
*expected = old;
|
|
1475
|
+
return result;
|
|
1476
|
+
}
|
|
1477
|
+
#ifdef __PYX_DEBUG_ATOMICS
|
|
1478
|
+
#pragma message ("Using MSVC atomics")
|
|
1479
|
+
#endif
|
|
1480
|
+
#else
|
|
1481
|
+
#undef CYTHON_ATOMICS
|
|
1482
|
+
#define CYTHON_ATOMICS 0
|
|
1483
|
+
#ifdef __PYX_DEBUG_ATOMICS
|
|
1484
|
+
#warning "Not using atomics"
|
|
1485
|
+
#endif
|
|
1486
|
+
#endif
|
|
1487
|
+
|
|
1488
|
+
/* #### Code section: numeric_typedefs ### */
|
|
1489
|
+
/* #### Code section: complex_type_declarations ### */
|
|
1490
|
+
/* #### Code section: type_declarations ### */
|
|
1491
|
+
|
|
1492
|
+
/*--- Type declarations ---*/
|
|
1493
|
+
/* #### Code section: utility_code_proto ### */
|
|
1494
|
+
|
|
1495
|
+
/* --- Runtime support code (head) --- */
|
|
1496
|
+
/* Refnanny.proto */
|
|
1497
|
+
#ifndef CYTHON_REFNANNY
|
|
1498
|
+
#define CYTHON_REFNANNY 0
|
|
1499
|
+
#endif
|
|
1500
|
+
#if CYTHON_REFNANNY
|
|
1501
|
+
typedef struct {
|
|
1502
|
+
void (*INCREF)(void*, PyObject*, Py_ssize_t);
|
|
1503
|
+
void (*DECREF)(void*, PyObject*, Py_ssize_t);
|
|
1504
|
+
void (*GOTREF)(void*, PyObject*, Py_ssize_t);
|
|
1505
|
+
void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
|
|
1506
|
+
void* (*SetupContext)(const char*, Py_ssize_t, const char*);
|
|
1507
|
+
void (*FinishContext)(void**);
|
|
1508
|
+
} __Pyx_RefNannyAPIStruct;
|
|
1509
|
+
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
|
|
1510
|
+
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
|
|
1511
|
+
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
|
|
1512
|
+
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
|
|
1513
|
+
if (acquire_gil) {\
|
|
1514
|
+
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
|
1515
|
+
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
|
|
1516
|
+
PyGILState_Release(__pyx_gilstate_save);\
|
|
1517
|
+
} else {\
|
|
1518
|
+
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
|
|
1519
|
+
}
|
|
1520
|
+
#define __Pyx_RefNannyFinishContextNogil() {\
|
|
1521
|
+
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
|
1522
|
+
__Pyx_RefNannyFinishContext();\
|
|
1523
|
+
PyGILState_Release(__pyx_gilstate_save);\
|
|
1524
|
+
}
|
|
1525
|
+
#define __Pyx_RefNannyFinishContextNogil() {\
|
|
1526
|
+
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
|
|
1527
|
+
__Pyx_RefNannyFinishContext();\
|
|
1528
|
+
PyGILState_Release(__pyx_gilstate_save);\
|
|
1529
|
+
}
|
|
1530
|
+
#define __Pyx_RefNannyFinishContext()\
|
|
1531
|
+
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
|
|
1532
|
+
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
|
1533
|
+
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
|
1534
|
+
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
|
1535
|
+
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
|
|
1536
|
+
#define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
|
|
1537
|
+
#define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
|
|
1538
|
+
#define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
|
|
1539
|
+
#define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
|
|
1540
|
+
#else
|
|
1541
|
+
#define __Pyx_RefNannyDeclarations
|
|
1542
|
+
#define __Pyx_RefNannySetupContext(name, acquire_gil)
|
|
1543
|
+
#define __Pyx_RefNannyFinishContextNogil()
|
|
1544
|
+
#define __Pyx_RefNannyFinishContext()
|
|
1545
|
+
#define __Pyx_INCREF(r) Py_INCREF(r)
|
|
1546
|
+
#define __Pyx_DECREF(r) Py_DECREF(r)
|
|
1547
|
+
#define __Pyx_GOTREF(r)
|
|
1548
|
+
#define __Pyx_GIVEREF(r)
|
|
1549
|
+
#define __Pyx_XINCREF(r) Py_XINCREF(r)
|
|
1550
|
+
#define __Pyx_XDECREF(r) Py_XDECREF(r)
|
|
1551
|
+
#define __Pyx_XGOTREF(r)
|
|
1552
|
+
#define __Pyx_XGIVEREF(r)
|
|
1553
|
+
#endif
|
|
1554
|
+
#define __Pyx_Py_XDECREF_SET(r, v) do {\
|
|
1555
|
+
PyObject *tmp = (PyObject *) r;\
|
|
1556
|
+
r = v; Py_XDECREF(tmp);\
|
|
1557
|
+
} while (0)
|
|
1558
|
+
#define __Pyx_XDECREF_SET(r, v) do {\
|
|
1559
|
+
PyObject *tmp = (PyObject *) r;\
|
|
1560
|
+
r = v; __Pyx_XDECREF(tmp);\
|
|
1561
|
+
} while (0)
|
|
1562
|
+
#define __Pyx_DECREF_SET(r, v) do {\
|
|
1563
|
+
PyObject *tmp = (PyObject *) r;\
|
|
1564
|
+
r = v; __Pyx_DECREF(tmp);\
|
|
1565
|
+
} while (0)
|
|
1566
|
+
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
|
|
1567
|
+
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
|
|
1568
|
+
|
|
1569
|
+
/* dict_setdefault.proto (used by CLineInTraceback) */
|
|
1570
|
+
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
|
|
1571
|
+
|
|
1572
|
+
/* PyDictVersioning.proto (used by CLineInTraceback) */
|
|
1573
|
+
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
|
|
1574
|
+
#define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
|
|
1575
|
+
#define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
|
|
1576
|
+
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
|
|
1577
|
+
(version_var) = __PYX_GET_DICT_VERSION(dict);\
|
|
1578
|
+
(cache_var) = (value);
|
|
1579
|
+
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
|
|
1580
|
+
static PY_UINT64_T __pyx_dict_version = 0;\
|
|
1581
|
+
static PyObject *__pyx_dict_cached_value = NULL;\
|
|
1582
|
+
if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
|
|
1583
|
+
(VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
|
|
1584
|
+
} else {\
|
|
1585
|
+
(VAR) = __pyx_dict_cached_value = (LOOKUP);\
|
|
1586
|
+
__pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
|
|
1587
|
+
}\
|
|
1588
|
+
}
|
|
1589
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
|
|
1590
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
|
|
1591
|
+
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
|
|
1592
|
+
#else
|
|
1593
|
+
#define __PYX_GET_DICT_VERSION(dict) (0)
|
|
1594
|
+
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
|
|
1595
|
+
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
|
|
1596
|
+
#endif
|
|
1597
|
+
|
|
1598
|
+
/* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
|
|
1599
|
+
#if CYTHON_FAST_THREAD_STATE
|
|
1600
|
+
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
|
|
1601
|
+
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
|
|
1602
|
+
#else
|
|
1603
|
+
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
|
|
1604
|
+
#endif
|
|
1605
|
+
|
|
1606
|
+
/* PyThreadStateGet.proto (used by PyErrFetchRestore) */
|
|
1607
|
+
#if CYTHON_FAST_THREAD_STATE
|
|
1608
|
+
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
|
|
1609
|
+
#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
|
|
1610
|
+
#if PY_VERSION_HEX >= 0x030C00A6
|
|
1611
|
+
#define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
|
|
1612
|
+
#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
|
|
1613
|
+
#else
|
|
1614
|
+
#define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
|
|
1615
|
+
#define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
|
|
1616
|
+
#endif
|
|
1617
|
+
#else
|
|
1618
|
+
#define __Pyx_PyThreadState_declare
|
|
1619
|
+
#define __Pyx_PyThreadState_assign
|
|
1620
|
+
#define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
|
|
1621
|
+
#define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
|
|
1622
|
+
#endif
|
|
1623
|
+
|
|
1624
|
+
/* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */
|
|
1625
|
+
#if CYTHON_FAST_THREAD_STATE
|
|
1626
|
+
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
|
|
1627
|
+
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
|
|
1628
|
+
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
|
|
1629
|
+
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
|
|
1630
|
+
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
|
|
1631
|
+
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
|
|
1632
|
+
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
|
|
1633
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
|
|
1634
|
+
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
|
|
1635
|
+
#else
|
|
1636
|
+
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
|
1637
|
+
#endif
|
|
1638
|
+
#else
|
|
1639
|
+
#define __Pyx_PyErr_Clear() PyErr_Clear()
|
|
1640
|
+
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
|
|
1641
|
+
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
|
|
1642
|
+
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
|
|
1643
|
+
#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
|
|
1644
|
+
#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
|
|
1645
|
+
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
|
|
1646
|
+
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
|
|
1647
|
+
#endif
|
|
1648
|
+
|
|
1649
|
+
/* PyObjectGetAttrStr.proto (used by PyObjectGetAttrStrNoError) */
|
|
1650
|
+
#if CYTHON_USE_TYPE_SLOTS
|
|
1651
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
|
|
1652
|
+
#else
|
|
1653
|
+
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
|
|
1654
|
+
#endif
|
|
1655
|
+
|
|
1656
|
+
/* PyObjectGetAttrStrNoError.proto (used by CLineInTraceback) */
|
|
1657
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
|
|
1658
|
+
|
|
1659
|
+
/* CLineInTraceback.proto (used by AddTraceback) */
|
|
1660
|
+
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
|
|
1661
|
+
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
|
|
1662
|
+
#else
|
|
1663
|
+
#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
|
|
1664
|
+
#endif
|
|
1665
|
+
|
|
1666
|
+
/* CodeObjectCache.proto (used by AddTraceback) */
|
|
1667
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
1668
|
+
typedef PyObject __Pyx_CachedCodeObjectType;
|
|
1669
|
+
#else
|
|
1670
|
+
typedef PyCodeObject __Pyx_CachedCodeObjectType;
|
|
1671
|
+
#endif
|
|
1672
|
+
typedef struct {
|
|
1673
|
+
__Pyx_CachedCodeObjectType* code_object;
|
|
1674
|
+
int code_line;
|
|
1675
|
+
} __Pyx_CodeObjectCacheEntry;
|
|
1676
|
+
struct __Pyx_CodeObjectCache {
|
|
1677
|
+
int count;
|
|
1678
|
+
int max_count;
|
|
1679
|
+
__Pyx_CodeObjectCacheEntry* entries;
|
|
1680
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
1681
|
+
__pyx_atomic_int_type accessor_count;
|
|
1682
|
+
#endif
|
|
1683
|
+
};
|
|
1684
|
+
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
|
|
1685
|
+
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
|
|
1686
|
+
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
|
|
1687
|
+
|
|
1688
|
+
/* AddTraceback.proto */
|
|
1689
|
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
1690
|
+
int py_line, const char *filename);
|
|
1691
|
+
|
|
1692
|
+
/* FormatTypeName.proto */
|
|
1693
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
1694
|
+
typedef PyObject *__Pyx_TypeName;
|
|
1695
|
+
#define __Pyx_FMT_TYPENAME "%U"
|
|
1696
|
+
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
|
|
1697
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
1698
|
+
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
|
|
1699
|
+
#else
|
|
1700
|
+
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
|
|
1701
|
+
#endif
|
|
1702
|
+
#else // !LIMITED_API
|
|
1703
|
+
typedef const char *__Pyx_TypeName;
|
|
1704
|
+
#define __Pyx_FMT_TYPENAME "%.200s"
|
|
1705
|
+
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
|
|
1706
|
+
#define __Pyx_DECREF_TypeName(obj)
|
|
1707
|
+
#endif
|
|
1708
|
+
|
|
1709
|
+
/* GCCDiagnostics.proto (used by CIntToPy) */
|
|
1710
|
+
#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
|
|
1711
|
+
#define __Pyx_HAS_GCC_DIAGNOSTIC
|
|
1712
|
+
#endif
|
|
1713
|
+
|
|
1714
|
+
/* PyObjectCall.proto (used by PyObjectFastCall) */
|
|
1715
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
1716
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
|
|
1717
|
+
#else
|
|
1718
|
+
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
|
|
1719
|
+
#endif
|
|
1720
|
+
|
|
1721
|
+
/* PyObjectCallMethO.proto (used by PyObjectFastCall) */
|
|
1722
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
1723
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
|
|
1724
|
+
#endif
|
|
1725
|
+
|
|
1726
|
+
/* PyObjectFastCall.proto (used by PyObjectVectorCallKwBuilder) */
|
|
1727
|
+
#define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
|
|
1728
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);
|
|
1729
|
+
|
|
1730
|
+
/* PyObjectVectorCallKwBuilder.proto (used by CIntToPy) */
|
|
1731
|
+
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
|
|
1732
|
+
#if CYTHON_VECTORCALL
|
|
1733
|
+
#if PY_VERSION_HEX >= 0x03090000
|
|
1734
|
+
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
|
|
1735
|
+
#else
|
|
1736
|
+
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
|
|
1737
|
+
#endif
|
|
1738
|
+
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
|
|
1739
|
+
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
|
|
1740
|
+
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
|
|
1741
|
+
#else
|
|
1742
|
+
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
|
|
1743
|
+
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
|
|
1744
|
+
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
|
|
1745
|
+
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
|
|
1746
|
+
#endif
|
|
1747
|
+
|
|
1748
|
+
/* CIntToPy.proto */
|
|
1749
|
+
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
|
|
1750
|
+
|
|
1751
|
+
/* CIntFromPy.proto */
|
|
1752
|
+
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
|
|
1753
|
+
|
|
1754
|
+
/* CIntFromPy.proto */
|
|
1755
|
+
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
|
|
1756
|
+
|
|
1757
|
+
/* FastTypeChecks.proto */
|
|
1758
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
1759
|
+
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
|
|
1760
|
+
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
|
|
1761
|
+
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
|
|
1762
|
+
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
|
|
1763
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
|
|
1764
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
|
|
1765
|
+
#else
|
|
1766
|
+
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
|
|
1767
|
+
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
|
|
1768
|
+
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
|
|
1769
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
|
|
1770
|
+
return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
|
|
1771
|
+
}
|
|
1772
|
+
#endif
|
|
1773
|
+
#define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
|
|
1774
|
+
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
|
|
1775
|
+
#ifdef PyExceptionInstance_Check
|
|
1776
|
+
#define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
|
|
1777
|
+
#else
|
|
1778
|
+
#define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
|
|
1779
|
+
#endif
|
|
1780
|
+
|
|
1781
|
+
/* GetRuntimeVersion.proto */
|
|
1782
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
|
|
1783
|
+
static unsigned long __Pyx_cached_runtime_version = 0;
|
|
1784
|
+
static void __Pyx_init_runtime_version(void);
|
|
1785
|
+
#else
|
|
1786
|
+
#define __Pyx_init_runtime_version()
|
|
1787
|
+
#endif
|
|
1788
|
+
static unsigned long __Pyx_get_runtime_version(void);
|
|
1789
|
+
|
|
1790
|
+
/* AddModuleRef.proto */
|
|
1791
|
+
#if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
|
|
1792
|
+
__PYX_LIMITED_VERSION_HEX < 0x030d0000)
|
|
1793
|
+
static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
|
|
1794
|
+
#else
|
|
1795
|
+
#define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
|
|
1796
|
+
#endif
|
|
1797
|
+
|
|
1798
|
+
/* CheckBinaryVersion.proto */
|
|
1799
|
+
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
|
|
1800
|
+
|
|
1801
|
+
/* DecompressString.proto */
|
|
1802
|
+
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
|
|
1803
|
+
|
|
1804
|
+
/* MultiPhaseInitModuleState.proto */
|
|
1805
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
|
|
1806
|
+
static PyObject *__Pyx_State_FindModule(void*);
|
|
1807
|
+
static int __Pyx_State_AddModule(PyObject* module, void*);
|
|
1808
|
+
static int __Pyx_State_RemoveModule(void*);
|
|
1809
|
+
#elif CYTHON_USE_MODULE_STATE
|
|
1810
|
+
#define __Pyx_State_FindModule PyState_FindModule
|
|
1811
|
+
#define __Pyx_State_AddModule PyState_AddModule
|
|
1812
|
+
#define __Pyx_State_RemoveModule PyState_RemoveModule
|
|
1813
|
+
#endif
|
|
1814
|
+
|
|
1815
|
+
/* #### Code section: module_declarations ### */
|
|
1816
|
+
/* CythonABIVersion.proto */
|
|
1817
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
1818
|
+
#if CYTHON_METH_FASTCALL
|
|
1819
|
+
#define __PYX_FASTCALL_ABI_SUFFIX "_fastcall"
|
|
1820
|
+
#else
|
|
1821
|
+
#define __PYX_FASTCALL_ABI_SUFFIX
|
|
1822
|
+
#endif
|
|
1823
|
+
#define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
|
|
1824
|
+
#else
|
|
1825
|
+
#define __PYX_LIMITED_ABI_SUFFIX
|
|
1826
|
+
#endif
|
|
1827
|
+
#if __PYX_HAS_PY_AM_SEND == 1
|
|
1828
|
+
#define __PYX_AM_SEND_ABI_SUFFIX
|
|
1829
|
+
#elif __PYX_HAS_PY_AM_SEND == 2
|
|
1830
|
+
#define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
|
|
1831
|
+
#else
|
|
1832
|
+
#define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
|
|
1833
|
+
#endif
|
|
1834
|
+
#ifndef __PYX_MONITORING_ABI_SUFFIX
|
|
1835
|
+
#define __PYX_MONITORING_ABI_SUFFIX
|
|
1836
|
+
#endif
|
|
1837
|
+
#if CYTHON_USE_TP_FINALIZE
|
|
1838
|
+
#define __PYX_TP_FINALIZE_ABI_SUFFIX
|
|
1839
|
+
#else
|
|
1840
|
+
#define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
|
|
1841
|
+
#endif
|
|
1842
|
+
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
|
|
1843
|
+
#define __PYX_FREELISTS_ABI_SUFFIX
|
|
1844
|
+
#else
|
|
1845
|
+
#define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
|
|
1846
|
+
#endif
|
|
1847
|
+
#define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
|
|
1848
|
+
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
|
|
1849
|
+
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
|
|
1850
|
+
|
|
1851
|
+
|
|
1852
|
+
/* Module declarations from "webview._dummy_holder" */
|
|
1853
|
+
/* #### Code section: typeinfo ### */
|
|
1854
|
+
/* #### Code section: before_global_var ### */
|
|
1855
|
+
#define __Pyx_MODULE_NAME "webview._dummy_holder"
|
|
1856
|
+
extern int __pyx_module_is_main_webview___dummy_holder;
|
|
1857
|
+
int __pyx_module_is_main_webview___dummy_holder = 0;
|
|
1858
|
+
|
|
1859
|
+
/* Implementation of "webview._dummy_holder" */
|
|
1860
|
+
/* #### Code section: global_var ### */
|
|
1861
|
+
/* #### Code section: string_decls ### */
|
|
1862
|
+
/* #### Code section: decls ### */
|
|
1863
|
+
/* #### Code section: late_includes ### */
|
|
1864
|
+
/* #### Code section: module_state ### */
|
|
1865
|
+
/* SmallCodeConfig */
|
|
1866
|
+
#ifndef CYTHON_SMALL_CODE
|
|
1867
|
+
#if defined(__clang__)
|
|
1868
|
+
#define CYTHON_SMALL_CODE
|
|
1869
|
+
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
|
1870
|
+
#define CYTHON_SMALL_CODE __attribute__((cold))
|
|
1871
|
+
#else
|
|
1872
|
+
#define CYTHON_SMALL_CODE
|
|
1873
|
+
#endif
|
|
1874
|
+
#endif
|
|
1875
|
+
|
|
1876
|
+
typedef struct {
|
|
1877
|
+
PyObject *__pyx_d;
|
|
1878
|
+
PyObject *__pyx_b;
|
|
1879
|
+
PyObject *__pyx_cython_runtime;
|
|
1880
|
+
PyObject *__pyx_empty_tuple;
|
|
1881
|
+
PyObject *__pyx_empty_bytes;
|
|
1882
|
+
PyObject *__pyx_empty_unicode;
|
|
1883
|
+
PyObject *__pyx_string_tab[8];
|
|
1884
|
+
/* #### Code section: module_state_contents ### */
|
|
1885
|
+
/* CodeObjectCache.module_state_decls */
|
|
1886
|
+
struct __Pyx_CodeObjectCache __pyx_code_cache;
|
|
1887
|
+
|
|
1888
|
+
/* #### Code section: module_state_end ### */
|
|
1889
|
+
} __pyx_mstatetype;
|
|
1890
|
+
|
|
1891
|
+
#if CYTHON_USE_MODULE_STATE
|
|
1892
|
+
#ifdef __cplusplus
|
|
1893
|
+
namespace {
|
|
1894
|
+
extern struct PyModuleDef __pyx_moduledef;
|
|
1895
|
+
} /* anonymous namespace */
|
|
1896
|
+
#else
|
|
1897
|
+
static struct PyModuleDef __pyx_moduledef;
|
|
1898
|
+
#endif
|
|
1899
|
+
|
|
1900
|
+
#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
|
|
1901
|
+
|
|
1902
|
+
#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
|
|
1903
|
+
#else
|
|
1904
|
+
static __pyx_mstatetype __pyx_mstate_global_static =
|
|
1905
|
+
#ifdef __cplusplus
|
|
1906
|
+
{};
|
|
1907
|
+
#else
|
|
1908
|
+
{0};
|
|
1909
|
+
#endif
|
|
1910
|
+
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
|
|
1911
|
+
#endif
|
|
1912
|
+
/* #### Code section: constant_name_defines ### */
|
|
1913
|
+
#define __pyx_kp_u_ __pyx_string_tab[0]
|
|
1914
|
+
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[1]
|
|
1915
|
+
#define __pyx_n_u_main __pyx_string_tab[2]
|
|
1916
|
+
#define __pyx_n_u_module __pyx_string_tab[3]
|
|
1917
|
+
#define __pyx_n_u_name __pyx_string_tab[4]
|
|
1918
|
+
#define __pyx_n_u_qualname __pyx_string_tab[5]
|
|
1919
|
+
#define __pyx_n_u_setdefault __pyx_string_tab[6]
|
|
1920
|
+
#define __pyx_n_u_test __pyx_string_tab[7]
|
|
1921
|
+
/* #### Code section: module_state_clear ### */
|
|
1922
|
+
#if CYTHON_USE_MODULE_STATE
|
|
1923
|
+
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
|
|
1924
|
+
__pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
|
|
1925
|
+
if (!clear_module_state) return 0;
|
|
1926
|
+
Py_CLEAR(clear_module_state->__pyx_d);
|
|
1927
|
+
Py_CLEAR(clear_module_state->__pyx_b);
|
|
1928
|
+
Py_CLEAR(clear_module_state->__pyx_cython_runtime);
|
|
1929
|
+
Py_CLEAR(clear_module_state->__pyx_empty_tuple);
|
|
1930
|
+
Py_CLEAR(clear_module_state->__pyx_empty_bytes);
|
|
1931
|
+
Py_CLEAR(clear_module_state->__pyx_empty_unicode);
|
|
1932
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
1933
|
+
__Pyx_State_RemoveModule(NULL);
|
|
1934
|
+
#endif
|
|
1935
|
+
for (int i=0; i<8; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
|
|
1936
|
+
/* #### Code section: module_state_clear_contents ### */
|
|
1937
|
+
/* #### Code section: module_state_clear_end ### */
|
|
1938
|
+
return 0;
|
|
1939
|
+
}
|
|
1940
|
+
#endif
|
|
1941
|
+
/* #### Code section: module_state_traverse ### */
|
|
1942
|
+
#if CYTHON_USE_MODULE_STATE
|
|
1943
|
+
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
|
|
1944
|
+
__pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
|
|
1945
|
+
if (!traverse_module_state) return 0;
|
|
1946
|
+
Py_VISIT(traverse_module_state->__pyx_d);
|
|
1947
|
+
Py_VISIT(traverse_module_state->__pyx_b);
|
|
1948
|
+
Py_VISIT(traverse_module_state->__pyx_cython_runtime);
|
|
1949
|
+
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
|
|
1950
|
+
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
|
|
1951
|
+
__Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
|
|
1952
|
+
for (int i=0; i<8; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
|
|
1953
|
+
/* #### Code section: module_state_traverse_contents ### */
|
|
1954
|
+
/* #### Code section: module_state_traverse_end ### */
|
|
1955
|
+
return 0;
|
|
1956
|
+
}
|
|
1957
|
+
#endif
|
|
1958
|
+
/* #### Code section: module_code ### */
|
|
1959
|
+
/* #### Code section: module_exttypes ### */
|
|
1960
|
+
|
|
1961
|
+
static PyMethodDef __pyx_methods[] = {
|
|
1962
|
+
{0, 0, 0, 0}
|
|
1963
|
+
};
|
|
1964
|
+
/* #### Code section: initfunc_declarations ### */
|
|
1965
|
+
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1966
|
+
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1967
|
+
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
|
|
1968
|
+
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1969
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1970
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1971
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1972
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1973
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1974
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1975
|
+
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1976
|
+
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
|
|
1977
|
+
/* #### Code section: init_module ### */
|
|
1978
|
+
|
|
1979
|
+
static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
|
|
1980
|
+
__Pyx_RefNannyDeclarations
|
|
1981
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
1982
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
|
|
1983
|
+
/*--- Global init code ---*/
|
|
1984
|
+
__Pyx_RefNannyFinishContext();
|
|
1985
|
+
return 0;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
|
|
1989
|
+
__Pyx_RefNannyDeclarations
|
|
1990
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
1991
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
|
|
1992
|
+
/*--- Variable export code ---*/
|
|
1993
|
+
__Pyx_RefNannyFinishContext();
|
|
1994
|
+
return 0;
|
|
1995
|
+
}
|
|
1996
|
+
|
|
1997
|
+
static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
|
|
1998
|
+
__Pyx_RefNannyDeclarations
|
|
1999
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2000
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
|
|
2001
|
+
/*--- Function export code ---*/
|
|
2002
|
+
__Pyx_RefNannyFinishContext();
|
|
2003
|
+
return 0;
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
|
|
2007
|
+
__Pyx_RefNannyDeclarations
|
|
2008
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2009
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
|
|
2010
|
+
/*--- Type init code ---*/
|
|
2011
|
+
__Pyx_RefNannyFinishContext();
|
|
2012
|
+
return 0;
|
|
2013
|
+
}
|
|
2014
|
+
|
|
2015
|
+
static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
|
|
2016
|
+
__Pyx_RefNannyDeclarations
|
|
2017
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2018
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
|
|
2019
|
+
/*--- Type import code ---*/
|
|
2020
|
+
__Pyx_RefNannyFinishContext();
|
|
2021
|
+
return 0;
|
|
2022
|
+
}
|
|
2023
|
+
|
|
2024
|
+
static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
|
|
2025
|
+
__Pyx_RefNannyDeclarations
|
|
2026
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2027
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
|
|
2028
|
+
/*--- Variable import code ---*/
|
|
2029
|
+
__Pyx_RefNannyFinishContext();
|
|
2030
|
+
return 0;
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
|
|
2034
|
+
__Pyx_RefNannyDeclarations
|
|
2035
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2036
|
+
__Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
|
|
2037
|
+
/*--- Function import code ---*/
|
|
2038
|
+
__Pyx_RefNannyFinishContext();
|
|
2039
|
+
return 0;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
2043
|
+
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
|
|
2044
|
+
static int __pyx_pymod_exec__dummy_holder(PyObject* module); /*proto*/
|
|
2045
|
+
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
|
|
2046
|
+
{Py_mod_create, (void*)__pyx_pymod_create},
|
|
2047
|
+
{Py_mod_exec, (void*)__pyx_pymod_exec__dummy_holder},
|
|
2048
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2049
|
+
{Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
|
|
2050
|
+
#endif
|
|
2051
|
+
#if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
|
|
2052
|
+
{Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
|
|
2053
|
+
#endif
|
|
2054
|
+
{0, NULL}
|
|
2055
|
+
};
|
|
2056
|
+
#endif
|
|
2057
|
+
|
|
2058
|
+
#ifdef __cplusplus
|
|
2059
|
+
namespace {
|
|
2060
|
+
struct PyModuleDef __pyx_moduledef =
|
|
2061
|
+
#else
|
|
2062
|
+
static struct PyModuleDef __pyx_moduledef =
|
|
2063
|
+
#endif
|
|
2064
|
+
{
|
|
2065
|
+
PyModuleDef_HEAD_INIT,
|
|
2066
|
+
"_dummy_holder",
|
|
2067
|
+
0, /* m_doc */
|
|
2068
|
+
#if CYTHON_USE_MODULE_STATE
|
|
2069
|
+
sizeof(__pyx_mstatetype), /* m_size */
|
|
2070
|
+
#else
|
|
2071
|
+
(CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
|
|
2072
|
+
#endif
|
|
2073
|
+
__pyx_methods /* m_methods */,
|
|
2074
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
2075
|
+
__pyx_moduledef_slots, /* m_slots */
|
|
2076
|
+
#else
|
|
2077
|
+
NULL, /* m_reload */
|
|
2078
|
+
#endif
|
|
2079
|
+
#if CYTHON_USE_MODULE_STATE
|
|
2080
|
+
__pyx_m_traverse, /* m_traverse */
|
|
2081
|
+
__pyx_m_clear, /* m_clear */
|
|
2082
|
+
NULL /* m_free */
|
|
2083
|
+
#else
|
|
2084
|
+
NULL, /* m_traverse */
|
|
2085
|
+
NULL, /* m_clear */
|
|
2086
|
+
NULL /* m_free */
|
|
2087
|
+
#endif
|
|
2088
|
+
};
|
|
2089
|
+
#ifdef __cplusplus
|
|
2090
|
+
} /* anonymous namespace */
|
|
2091
|
+
#endif
|
|
2092
|
+
|
|
2093
|
+
/* PyModInitFuncType */
|
|
2094
|
+
#ifndef CYTHON_NO_PYINIT_EXPORT
|
|
2095
|
+
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
|
|
2096
|
+
#else
|
|
2097
|
+
#ifdef __cplusplus
|
|
2098
|
+
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
|
|
2099
|
+
#else
|
|
2100
|
+
#define __Pyx_PyMODINIT_FUNC PyObject *
|
|
2101
|
+
#endif
|
|
2102
|
+
#endif
|
|
2103
|
+
|
|
2104
|
+
__Pyx_PyMODINIT_FUNC PyInit__dummy_holder(void) CYTHON_SMALL_CODE; /*proto*/
|
|
2105
|
+
__Pyx_PyMODINIT_FUNC PyInit__dummy_holder(void)
|
|
2106
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
2107
|
+
{
|
|
2108
|
+
return PyModuleDef_Init(&__pyx_moduledef);
|
|
2109
|
+
}
|
|
2110
|
+
/* ModuleCreationPEP489 */
|
|
2111
|
+
#if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
|
|
2112
|
+
|| ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
|
|
2113
|
+
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
|
|
2114
|
+
{
|
|
2115
|
+
PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
|
|
2116
|
+
if (!module) {
|
|
2117
|
+
PyErr_Clear(); // just try the 3.8-3.12 version
|
|
2118
|
+
module = PyImport_ImportModule("_xxsubinterpreters");
|
|
2119
|
+
if (!module) goto bad;
|
|
2120
|
+
}
|
|
2121
|
+
PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
|
|
2122
|
+
Py_DECREF(module);
|
|
2123
|
+
if (!current) goto bad;
|
|
2124
|
+
if (PyTuple_Check(current)) {
|
|
2125
|
+
PyObject *new_current = PySequence_GetItem(current, 0);
|
|
2126
|
+
Py_DECREF(current);
|
|
2127
|
+
current = new_current;
|
|
2128
|
+
if (!new_current) goto bad;
|
|
2129
|
+
}
|
|
2130
|
+
long long as_c_int = PyLong_AsLongLong(current);
|
|
2131
|
+
Py_DECREF(current);
|
|
2132
|
+
return as_c_int;
|
|
2133
|
+
}
|
|
2134
|
+
bad:
|
|
2135
|
+
PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
|
|
2136
|
+
return -1;
|
|
2137
|
+
}
|
|
2138
|
+
#endif
|
|
2139
|
+
#if !CYTHON_USE_MODULE_STATE
|
|
2140
|
+
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
|
|
2141
|
+
static PY_INT64_T main_interpreter_id = -1;
|
|
2142
|
+
#if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
|
|
2143
|
+
PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
|
|
2144
|
+
#elif CYTHON_COMPILING_IN_GRAAL
|
|
2145
|
+
PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
|
|
2146
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
|
|
2147
|
+
|| ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
|
|
2148
|
+
PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
|
|
2149
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API
|
|
2150
|
+
PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
|
|
2151
|
+
#else
|
|
2152
|
+
PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
|
|
2153
|
+
#endif
|
|
2154
|
+
if (unlikely(current_id == -1)) {
|
|
2155
|
+
return -1;
|
|
2156
|
+
}
|
|
2157
|
+
if (main_interpreter_id == -1) {
|
|
2158
|
+
main_interpreter_id = current_id;
|
|
2159
|
+
return 0;
|
|
2160
|
+
} else if (unlikely(main_interpreter_id != current_id)) {
|
|
2161
|
+
PyErr_SetString(
|
|
2162
|
+
PyExc_ImportError,
|
|
2163
|
+
"Interpreter change detected - this module can only be loaded into one interpreter per process.");
|
|
2164
|
+
return -1;
|
|
2165
|
+
}
|
|
2166
|
+
return 0;
|
|
2167
|
+
}
|
|
2168
|
+
#endif
|
|
2169
|
+
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)
|
|
2170
|
+
{
|
|
2171
|
+
PyObject *value = PyObject_GetAttrString(spec, from_name);
|
|
2172
|
+
int result = 0;
|
|
2173
|
+
if (likely(value)) {
|
|
2174
|
+
if (allow_none || value != Py_None) {
|
|
2175
|
+
result = PyDict_SetItemString(moddict, to_name, value);
|
|
2176
|
+
}
|
|
2177
|
+
Py_DECREF(value);
|
|
2178
|
+
} else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
|
|
2179
|
+
PyErr_Clear();
|
|
2180
|
+
} else {
|
|
2181
|
+
result = -1;
|
|
2182
|
+
}
|
|
2183
|
+
return result;
|
|
2184
|
+
}
|
|
2185
|
+
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
|
|
2186
|
+
PyObject *module = NULL, *moddict, *modname;
|
|
2187
|
+
CYTHON_UNUSED_VAR(def);
|
|
2188
|
+
#if !CYTHON_USE_MODULE_STATE
|
|
2189
|
+
if (__Pyx_check_single_interpreter())
|
|
2190
|
+
return NULL;
|
|
2191
|
+
#endif
|
|
2192
|
+
if (__pyx_m)
|
|
2193
|
+
return __Pyx_NewRef(__pyx_m);
|
|
2194
|
+
modname = PyObject_GetAttrString(spec, "name");
|
|
2195
|
+
if (unlikely(!modname)) goto bad;
|
|
2196
|
+
module = PyModule_NewObject(modname);
|
|
2197
|
+
Py_DECREF(modname);
|
|
2198
|
+
if (unlikely(!module)) goto bad;
|
|
2199
|
+
moddict = PyModule_GetDict(module);
|
|
2200
|
+
if (unlikely(!moddict)) goto bad;
|
|
2201
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
|
|
2202
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
|
|
2203
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
|
|
2204
|
+
if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
|
|
2205
|
+
return module;
|
|
2206
|
+
bad:
|
|
2207
|
+
Py_XDECREF(module);
|
|
2208
|
+
return NULL;
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
|
|
2212
|
+
static CYTHON_SMALL_CODE int __pyx_pymod_exec__dummy_holder(PyObject *__pyx_pyinit_module)
|
|
2213
|
+
#endif
|
|
2214
|
+
{
|
|
2215
|
+
int stringtab_initialized = 0;
|
|
2216
|
+
#if CYTHON_USE_MODULE_STATE
|
|
2217
|
+
int pystate_addmodule_run = 0;
|
|
2218
|
+
#endif
|
|
2219
|
+
__pyx_mstatetype *__pyx_mstate = NULL;
|
|
2220
|
+
PyObject *__pyx_t_1 = NULL;
|
|
2221
|
+
PyObject *__pyx_t_2 = NULL;
|
|
2222
|
+
int __pyx_lineno = 0;
|
|
2223
|
+
const char *__pyx_filename = NULL;
|
|
2224
|
+
int __pyx_clineno = 0;
|
|
2225
|
+
__Pyx_RefNannyDeclarations
|
|
2226
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
2227
|
+
if (__pyx_m) {
|
|
2228
|
+
if (__pyx_m == __pyx_pyinit_module) return 0;
|
|
2229
|
+
PyErr_SetString(PyExc_RuntimeError, "Module '_dummy_holder' has already been imported. Re-initialisation is not supported.");
|
|
2230
|
+
return -1;
|
|
2231
|
+
}
|
|
2232
|
+
#else
|
|
2233
|
+
if (__pyx_m) return __Pyx_NewRef(__pyx_m);
|
|
2234
|
+
#endif
|
|
2235
|
+
/*--- Module creation code ---*/
|
|
2236
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
2237
|
+
__pyx_t_1 = __pyx_pyinit_module;
|
|
2238
|
+
Py_INCREF(__pyx_t_1);
|
|
2239
|
+
#else
|
|
2240
|
+
__pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2241
|
+
#endif
|
|
2242
|
+
#if CYTHON_USE_MODULE_STATE
|
|
2243
|
+
{
|
|
2244
|
+
int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
|
|
2245
|
+
__pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "_dummy_holder" pseudovariable */
|
|
2246
|
+
if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2247
|
+
pystate_addmodule_run = 1;
|
|
2248
|
+
}
|
|
2249
|
+
#else
|
|
2250
|
+
__pyx_m = __pyx_t_1;
|
|
2251
|
+
#endif
|
|
2252
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2253
|
+
PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
|
|
2254
|
+
#endif
|
|
2255
|
+
__pyx_mstate = __pyx_mstate_global;
|
|
2256
|
+
CYTHON_UNUSED_VAR(__pyx_t_1);
|
|
2257
|
+
__pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2258
|
+
Py_INCREF(__pyx_mstate->__pyx_d);
|
|
2259
|
+
__pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2260
|
+
__pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2261
|
+
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2262
|
+
/* ImportRefnannyAPI */
|
|
2263
|
+
#if CYTHON_REFNANNY
|
|
2264
|
+
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
|
2265
|
+
if (!__Pyx_RefNanny) {
|
|
2266
|
+
PyErr_Clear();
|
|
2267
|
+
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
|
|
2268
|
+
if (!__Pyx_RefNanny)
|
|
2269
|
+
Py_FatalError("failed to import 'refnanny' module");
|
|
2270
|
+
}
|
|
2271
|
+
#endif
|
|
2272
|
+
|
|
2273
|
+
__Pyx_RefNannySetupContext("PyInit__dummy_holder", 0);
|
|
2274
|
+
__Pyx_init_runtime_version();
|
|
2275
|
+
if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2276
|
+
__pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2277
|
+
__pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2278
|
+
__pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2279
|
+
/*--- Library function declarations ---*/
|
|
2280
|
+
/*--- Initialize various global constants etc. ---*/
|
|
2281
|
+
if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2282
|
+
stringtab_initialized = 1;
|
|
2283
|
+
if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2284
|
+
if (__pyx_module_is_main_webview___dummy_holder) {
|
|
2285
|
+
if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2286
|
+
}
|
|
2287
|
+
{
|
|
2288
|
+
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2289
|
+
if (!PyDict_GetItemString(modules, "webview._dummy_holder")) {
|
|
2290
|
+
if (unlikely((PyDict_SetItemString(modules, "webview._dummy_holder", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2291
|
+
}
|
|
2292
|
+
}
|
|
2293
|
+
/*--- Builtin init code ---*/
|
|
2294
|
+
if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2295
|
+
/*--- Constants init code ---*/
|
|
2296
|
+
if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2297
|
+
if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2298
|
+
/*--- Global type/function init code ---*/
|
|
2299
|
+
(void)__Pyx_modinit_global_init_code(__pyx_mstate);
|
|
2300
|
+
(void)__Pyx_modinit_variable_export_code(__pyx_mstate);
|
|
2301
|
+
(void)__Pyx_modinit_function_export_code(__pyx_mstate);
|
|
2302
|
+
(void)__Pyx_modinit_type_init_code(__pyx_mstate);
|
|
2303
|
+
(void)__Pyx_modinit_type_import_code(__pyx_mstate);
|
|
2304
|
+
(void)__Pyx_modinit_variable_import_code(__pyx_mstate);
|
|
2305
|
+
(void)__Pyx_modinit_function_import_code(__pyx_mstate);
|
|
2306
|
+
/*--- Execution code ---*/
|
|
2307
|
+
|
|
2308
|
+
/* "webview/_dummy_holder.pyx":1
|
|
2309
|
+
# <<<<<<<<<<<<<<
|
|
2310
|
+
*/
|
|
2311
|
+
__pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2312
|
+
__Pyx_GOTREF(__pyx_t_2);
|
|
2313
|
+
if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2314
|
+
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
2315
|
+
|
|
2316
|
+
/*--- Wrapped vars code ---*/
|
|
2317
|
+
|
|
2318
|
+
goto __pyx_L0;
|
|
2319
|
+
__pyx_L1_error:;
|
|
2320
|
+
__Pyx_XDECREF(__pyx_t_2);
|
|
2321
|
+
if (__pyx_m) {
|
|
2322
|
+
if (__pyx_mstate->__pyx_d && stringtab_initialized) {
|
|
2323
|
+
__Pyx_AddTraceback("init webview._dummy_holder", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
2324
|
+
}
|
|
2325
|
+
#if !CYTHON_USE_MODULE_STATE
|
|
2326
|
+
Py_CLEAR(__pyx_m);
|
|
2327
|
+
#else
|
|
2328
|
+
Py_DECREF(__pyx_m);
|
|
2329
|
+
if (pystate_addmodule_run) {
|
|
2330
|
+
PyObject *tp, *value, *tb;
|
|
2331
|
+
PyErr_Fetch(&tp, &value, &tb);
|
|
2332
|
+
PyState_RemoveModule(&__pyx_moduledef);
|
|
2333
|
+
PyErr_Restore(tp, value, tb);
|
|
2334
|
+
}
|
|
2335
|
+
#endif
|
|
2336
|
+
} else if (!PyErr_Occurred()) {
|
|
2337
|
+
PyErr_SetString(PyExc_ImportError, "init webview._dummy_holder");
|
|
2338
|
+
}
|
|
2339
|
+
__pyx_L0:;
|
|
2340
|
+
__Pyx_RefNannyFinishContext();
|
|
2341
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT
|
|
2342
|
+
return (__pyx_m != NULL) ? 0 : -1;
|
|
2343
|
+
#else
|
|
2344
|
+
return __pyx_m;
|
|
2345
|
+
#endif
|
|
2346
|
+
}
|
|
2347
|
+
/* #### Code section: pystring_table ### */
|
|
2348
|
+
/* #### Code section: cached_builtins ### */
|
|
2349
|
+
|
|
2350
|
+
static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
|
|
2351
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2352
|
+
return 0;
|
|
2353
|
+
}
|
|
2354
|
+
/* #### Code section: cached_constants ### */
|
|
2355
|
+
|
|
2356
|
+
static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
|
|
2357
|
+
__Pyx_RefNannyDeclarations
|
|
2358
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2359
|
+
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
|
|
2360
|
+
__Pyx_RefNannyFinishContext();
|
|
2361
|
+
return 0;
|
|
2362
|
+
}
|
|
2363
|
+
/* #### Code section: init_constants ### */
|
|
2364
|
+
|
|
2365
|
+
static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
|
|
2366
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2367
|
+
{
|
|
2368
|
+
const struct { const unsigned int length: 5; } index[] = {{1},{18},{8},{10},{8},{12},{10},{8}};
|
|
2369
|
+
const char* const bytes = "?cline_in_traceback__main____module____name____qualname__setdefault__test__";
|
|
2370
|
+
PyObject *data = NULL;
|
|
2371
|
+
CYTHON_UNUSED_VAR(__Pyx_DecompressString);
|
|
2372
|
+
PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
|
|
2373
|
+
Py_ssize_t pos = 0;
|
|
2374
|
+
for (int i = 0; i < 8; i++) {
|
|
2375
|
+
Py_ssize_t bytes_length = index[i].length;
|
|
2376
|
+
PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
|
|
2377
|
+
if (likely(string) && i >= 1) PyUnicode_InternInPlace(&string);
|
|
2378
|
+
if (unlikely(!string)) {
|
|
2379
|
+
Py_XDECREF(data);
|
|
2380
|
+
__PYX_ERR(0, 1, __pyx_L1_error)
|
|
2381
|
+
}
|
|
2382
|
+
stringtab[i] = string;
|
|
2383
|
+
pos += bytes_length;
|
|
2384
|
+
}
|
|
2385
|
+
Py_XDECREF(data);
|
|
2386
|
+
for (Py_ssize_t i = 0; i < 8; i++) {
|
|
2387
|
+
if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
|
|
2388
|
+
__PYX_ERR(0, 1, __pyx_L1_error)
|
|
2389
|
+
}
|
|
2390
|
+
}
|
|
2391
|
+
}
|
|
2392
|
+
return 0;
|
|
2393
|
+
__pyx_L1_error:;
|
|
2394
|
+
return -1;
|
|
2395
|
+
}
|
|
2396
|
+
/* #### Code section: init_codeobjects ### */
|
|
2397
|
+
|
|
2398
|
+
static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
|
|
2399
|
+
CYTHON_UNUSED_VAR(__pyx_mstate);
|
|
2400
|
+
return 0;
|
|
2401
|
+
}
|
|
2402
|
+
/* #### Code section: init_globals ### */
|
|
2403
|
+
|
|
2404
|
+
static int __Pyx_InitGlobals(void) {
|
|
2405
|
+
/* PythonCompatibility.init */
|
|
2406
|
+
if (likely(__Pyx_init_co_variables() == 0)); else
|
|
2407
|
+
|
|
2408
|
+
if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
|
|
2409
|
+
|
|
2410
|
+
return 0;
|
|
2411
|
+
__pyx_L1_error:;
|
|
2412
|
+
return -1;
|
|
2413
|
+
}
|
|
2414
|
+
/* #### Code section: cleanup_globals ### */
|
|
2415
|
+
/* #### Code section: cleanup_module ### */
|
|
2416
|
+
/* #### Code section: main_method ### */
|
|
2417
|
+
/* #### Code section: utility_code_pragmas ### */
|
|
2418
|
+
#ifdef _MSC_VER
|
|
2419
|
+
#pragma warning( push )
|
|
2420
|
+
/* Warning 4127: conditional expression is constant
|
|
2421
|
+
* Cython uses constant conditional expressions to allow in inline functions to be optimized at
|
|
2422
|
+
* compile-time, so this warning is not useful
|
|
2423
|
+
*/
|
|
2424
|
+
#pragma warning( disable : 4127 )
|
|
2425
|
+
#endif
|
|
2426
|
+
|
|
2427
|
+
|
|
2428
|
+
|
|
2429
|
+
/* #### Code section: utility_code_def ### */
|
|
2430
|
+
|
|
2431
|
+
/* --- Runtime support code --- */
|
|
2432
|
+
/* Refnanny */
|
|
2433
|
+
#if CYTHON_REFNANNY
|
|
2434
|
+
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
|
|
2435
|
+
PyObject *m = NULL, *p = NULL;
|
|
2436
|
+
void *r = NULL;
|
|
2437
|
+
m = PyImport_ImportModule(modname);
|
|
2438
|
+
if (!m) goto end;
|
|
2439
|
+
p = PyObject_GetAttrString(m, "RefNannyAPI");
|
|
2440
|
+
if (!p) goto end;
|
|
2441
|
+
r = PyLong_AsVoidPtr(p);
|
|
2442
|
+
end:
|
|
2443
|
+
Py_XDECREF(p);
|
|
2444
|
+
Py_XDECREF(m);
|
|
2445
|
+
return (__Pyx_RefNannyAPIStruct *)r;
|
|
2446
|
+
}
|
|
2447
|
+
#endif
|
|
2448
|
+
|
|
2449
|
+
/* dict_setdefault (used by CLineInTraceback) */
|
|
2450
|
+
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
|
|
2451
|
+
PyObject* value;
|
|
2452
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
|
|
2453
|
+
PyDict_SetDefaultRef(d, key, default_value, &value);
|
|
2454
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
|
|
2455
|
+
PyObject *args[] = {d, key, default_value};
|
|
2456
|
+
value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
|
|
2457
|
+
#elif CYTHON_COMPILING_IN_LIMITED_API
|
|
2458
|
+
value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
|
|
2459
|
+
#else
|
|
2460
|
+
value = PyDict_SetDefault(d, key, default_value);
|
|
2461
|
+
if (unlikely(!value)) return NULL;
|
|
2462
|
+
Py_INCREF(value);
|
|
2463
|
+
#endif
|
|
2464
|
+
return value;
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
/* PyDictVersioning (used by CLineInTraceback) */
|
|
2468
|
+
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
|
|
2469
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
|
|
2470
|
+
PyObject *dict = Py_TYPE(obj)->tp_dict;
|
|
2471
|
+
return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
|
|
2472
|
+
}
|
|
2473
|
+
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
|
|
2474
|
+
PyObject **dictptr = NULL;
|
|
2475
|
+
Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
|
|
2476
|
+
if (offset) {
|
|
2477
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
2478
|
+
dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
|
|
2479
|
+
#else
|
|
2480
|
+
dictptr = _PyObject_GetDictPtr(obj);
|
|
2481
|
+
#endif
|
|
2482
|
+
}
|
|
2483
|
+
return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
|
|
2484
|
+
}
|
|
2485
|
+
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
|
|
2486
|
+
PyObject *dict = Py_TYPE(obj)->tp_dict;
|
|
2487
|
+
if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
|
|
2488
|
+
return 0;
|
|
2489
|
+
return obj_dict_version == __Pyx_get_object_dict_version(obj);
|
|
2490
|
+
}
|
|
2491
|
+
#endif
|
|
2492
|
+
|
|
2493
|
+
/* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
|
|
2494
|
+
#if CYTHON_FAST_THREAD_STATE
|
|
2495
|
+
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
|
|
2496
|
+
Py_ssize_t i, n;
|
|
2497
|
+
n = PyTuple_GET_SIZE(tuple);
|
|
2498
|
+
for (i=0; i<n; i++) {
|
|
2499
|
+
if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
|
|
2500
|
+
}
|
|
2501
|
+
for (i=0; i<n; i++) {
|
|
2502
|
+
if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
|
|
2503
|
+
}
|
|
2504
|
+
return 0;
|
|
2505
|
+
}
|
|
2506
|
+
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
|
|
2507
|
+
int result;
|
|
2508
|
+
PyObject *exc_type;
|
|
2509
|
+
#if PY_VERSION_HEX >= 0x030C00A6
|
|
2510
|
+
PyObject *current_exception = tstate->current_exception;
|
|
2511
|
+
if (unlikely(!current_exception)) return 0;
|
|
2512
|
+
exc_type = (PyObject*) Py_TYPE(current_exception);
|
|
2513
|
+
if (exc_type == err) return 1;
|
|
2514
|
+
#else
|
|
2515
|
+
exc_type = tstate->curexc_type;
|
|
2516
|
+
if (exc_type == err) return 1;
|
|
2517
|
+
if (unlikely(!exc_type)) return 0;
|
|
2518
|
+
#endif
|
|
2519
|
+
#if CYTHON_AVOID_BORROWED_REFS
|
|
2520
|
+
Py_INCREF(exc_type);
|
|
2521
|
+
#endif
|
|
2522
|
+
if (unlikely(PyTuple_Check(err))) {
|
|
2523
|
+
result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
|
|
2524
|
+
} else {
|
|
2525
|
+
result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
|
|
2526
|
+
}
|
|
2527
|
+
#if CYTHON_AVOID_BORROWED_REFS
|
|
2528
|
+
Py_DECREF(exc_type);
|
|
2529
|
+
#endif
|
|
2530
|
+
return result;
|
|
2531
|
+
}
|
|
2532
|
+
#endif
|
|
2533
|
+
|
|
2534
|
+
/* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
|
|
2535
|
+
#if CYTHON_FAST_THREAD_STATE
|
|
2536
|
+
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
|
|
2537
|
+
#if PY_VERSION_HEX >= 0x030C00A6
|
|
2538
|
+
PyObject *tmp_value;
|
|
2539
|
+
assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
|
|
2540
|
+
if (value) {
|
|
2541
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
2542
|
+
if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
|
|
2543
|
+
#endif
|
|
2544
|
+
PyException_SetTraceback(value, tb);
|
|
2545
|
+
}
|
|
2546
|
+
tmp_value = tstate->current_exception;
|
|
2547
|
+
tstate->current_exception = value;
|
|
2548
|
+
Py_XDECREF(tmp_value);
|
|
2549
|
+
Py_XDECREF(type);
|
|
2550
|
+
Py_XDECREF(tb);
|
|
2551
|
+
#else
|
|
2552
|
+
PyObject *tmp_type, *tmp_value, *tmp_tb;
|
|
2553
|
+
tmp_type = tstate->curexc_type;
|
|
2554
|
+
tmp_value = tstate->curexc_value;
|
|
2555
|
+
tmp_tb = tstate->curexc_traceback;
|
|
2556
|
+
tstate->curexc_type = type;
|
|
2557
|
+
tstate->curexc_value = value;
|
|
2558
|
+
tstate->curexc_traceback = tb;
|
|
2559
|
+
Py_XDECREF(tmp_type);
|
|
2560
|
+
Py_XDECREF(tmp_value);
|
|
2561
|
+
Py_XDECREF(tmp_tb);
|
|
2562
|
+
#endif
|
|
2563
|
+
}
|
|
2564
|
+
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
|
|
2565
|
+
#if PY_VERSION_HEX >= 0x030C00A6
|
|
2566
|
+
PyObject* exc_value;
|
|
2567
|
+
exc_value = tstate->current_exception;
|
|
2568
|
+
tstate->current_exception = 0;
|
|
2569
|
+
*value = exc_value;
|
|
2570
|
+
*type = NULL;
|
|
2571
|
+
*tb = NULL;
|
|
2572
|
+
if (exc_value) {
|
|
2573
|
+
*type = (PyObject*) Py_TYPE(exc_value);
|
|
2574
|
+
Py_INCREF(*type);
|
|
2575
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
2576
|
+
*tb = ((PyBaseExceptionObject*) exc_value)->traceback;
|
|
2577
|
+
Py_XINCREF(*tb);
|
|
2578
|
+
#else
|
|
2579
|
+
*tb = PyException_GetTraceback(exc_value);
|
|
2580
|
+
#endif
|
|
2581
|
+
}
|
|
2582
|
+
#else
|
|
2583
|
+
*type = tstate->curexc_type;
|
|
2584
|
+
*value = tstate->curexc_value;
|
|
2585
|
+
*tb = tstate->curexc_traceback;
|
|
2586
|
+
tstate->curexc_type = 0;
|
|
2587
|
+
tstate->curexc_value = 0;
|
|
2588
|
+
tstate->curexc_traceback = 0;
|
|
2589
|
+
#endif
|
|
2590
|
+
}
|
|
2591
|
+
#endif
|
|
2592
|
+
|
|
2593
|
+
/* PyObjectGetAttrStr (used by PyObjectGetAttrStrNoError) */
|
|
2594
|
+
#if CYTHON_USE_TYPE_SLOTS
|
|
2595
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
|
|
2596
|
+
PyTypeObject* tp = Py_TYPE(obj);
|
|
2597
|
+
if (likely(tp->tp_getattro))
|
|
2598
|
+
return tp->tp_getattro(obj, attr_name);
|
|
2599
|
+
return PyObject_GetAttr(obj, attr_name);
|
|
2600
|
+
}
|
|
2601
|
+
#endif
|
|
2602
|
+
|
|
2603
|
+
/* PyObjectGetAttrStrNoError (used by CLineInTraceback) */
|
|
2604
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
|
|
2605
|
+
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
|
|
2606
|
+
__Pyx_PyThreadState_declare
|
|
2607
|
+
__Pyx_PyThreadState_assign
|
|
2608
|
+
if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
|
|
2609
|
+
__Pyx_PyErr_Clear();
|
|
2610
|
+
}
|
|
2611
|
+
#endif
|
|
2612
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
|
|
2613
|
+
PyObject *result;
|
|
2614
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
2615
|
+
(void) PyObject_GetOptionalAttr(obj, attr_name, &result);
|
|
2616
|
+
return result;
|
|
2617
|
+
#else
|
|
2618
|
+
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
|
|
2619
|
+
PyTypeObject* tp = Py_TYPE(obj);
|
|
2620
|
+
if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
|
|
2621
|
+
return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
|
|
2622
|
+
}
|
|
2623
|
+
#endif
|
|
2624
|
+
result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
|
|
2625
|
+
if (unlikely(!result)) {
|
|
2626
|
+
__Pyx_PyObject_GetAttrStr_ClearAttributeError();
|
|
2627
|
+
}
|
|
2628
|
+
return result;
|
|
2629
|
+
#endif
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
/* CLineInTraceback (used by AddTraceback) */
|
|
2633
|
+
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
|
|
2634
|
+
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
|
|
2635
|
+
#define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
|
|
2636
|
+
#elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2637
|
+
#define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
|
|
2638
|
+
#else
|
|
2639
|
+
PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
|
|
2640
|
+
PyObject **dict_ptr = _PyObject_GetDictPtr(o);
|
|
2641
|
+
return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
|
|
2642
|
+
}
|
|
2643
|
+
#endif
|
|
2644
|
+
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
|
|
2645
|
+
PyObject *use_cline = NULL;
|
|
2646
|
+
PyObject *ptype, *pvalue, *ptraceback;
|
|
2647
|
+
PyObject *cython_runtime_dict;
|
|
2648
|
+
CYTHON_MAYBE_UNUSED_VAR(tstate);
|
|
2649
|
+
if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
|
|
2650
|
+
return c_line;
|
|
2651
|
+
}
|
|
2652
|
+
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
|
2653
|
+
cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
|
|
2654
|
+
if (likely(cython_runtime_dict)) {
|
|
2655
|
+
__PYX_PY_DICT_LOOKUP_IF_MODIFIED(
|
|
2656
|
+
use_cline, cython_runtime_dict,
|
|
2657
|
+
__Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
|
|
2658
|
+
}
|
|
2659
|
+
if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
|
|
2660
|
+
c_line = 0;
|
|
2661
|
+
}
|
|
2662
|
+
Py_XDECREF(use_cline);
|
|
2663
|
+
Py_XDECREF(cython_runtime_dict);
|
|
2664
|
+
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
|
2665
|
+
return c_line;
|
|
2666
|
+
}
|
|
2667
|
+
#endif
|
|
2668
|
+
|
|
2669
|
+
/* CodeObjectCache (used by AddTraceback) */
|
|
2670
|
+
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
|
|
2671
|
+
int start = 0, mid = 0, end = count - 1;
|
|
2672
|
+
if (end >= 0 && code_line > entries[end].code_line) {
|
|
2673
|
+
return count;
|
|
2674
|
+
}
|
|
2675
|
+
while (start < end) {
|
|
2676
|
+
mid = start + (end - start) / 2;
|
|
2677
|
+
if (code_line < entries[mid].code_line) {
|
|
2678
|
+
end = mid;
|
|
2679
|
+
} else if (code_line > entries[mid].code_line) {
|
|
2680
|
+
start = mid + 1;
|
|
2681
|
+
} else {
|
|
2682
|
+
return mid;
|
|
2683
|
+
}
|
|
2684
|
+
}
|
|
2685
|
+
if (code_line <= entries[mid].code_line) {
|
|
2686
|
+
return mid;
|
|
2687
|
+
} else {
|
|
2688
|
+
return mid + 1;
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
|
|
2692
|
+
__Pyx_CachedCodeObjectType* code_object;
|
|
2693
|
+
int pos;
|
|
2694
|
+
if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
|
|
2695
|
+
return NULL;
|
|
2696
|
+
}
|
|
2697
|
+
pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
|
|
2698
|
+
if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
|
|
2699
|
+
return NULL;
|
|
2700
|
+
}
|
|
2701
|
+
code_object = code_cache->entries[pos].code_object;
|
|
2702
|
+
Py_INCREF(code_object);
|
|
2703
|
+
return code_object;
|
|
2704
|
+
}
|
|
2705
|
+
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
|
|
2706
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
|
|
2707
|
+
(void)__pyx__find_code_object;
|
|
2708
|
+
return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
|
|
2709
|
+
#else
|
|
2710
|
+
struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
|
|
2711
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2712
|
+
__pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
|
|
2713
|
+
if (old_count < 0) {
|
|
2714
|
+
__pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
|
|
2715
|
+
return NULL;
|
|
2716
|
+
}
|
|
2717
|
+
#endif
|
|
2718
|
+
__Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
|
|
2719
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2720
|
+
__pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
|
|
2721
|
+
#endif
|
|
2722
|
+
return result;
|
|
2723
|
+
#endif
|
|
2724
|
+
}
|
|
2725
|
+
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
|
|
2726
|
+
{
|
|
2727
|
+
int pos, i;
|
|
2728
|
+
__Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
|
|
2729
|
+
if (unlikely(!code_line)) {
|
|
2730
|
+
return;
|
|
2731
|
+
}
|
|
2732
|
+
if (unlikely(!entries)) {
|
|
2733
|
+
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
|
|
2734
|
+
if (likely(entries)) {
|
|
2735
|
+
code_cache->entries = entries;
|
|
2736
|
+
code_cache->max_count = 64;
|
|
2737
|
+
code_cache->count = 1;
|
|
2738
|
+
entries[0].code_line = code_line;
|
|
2739
|
+
entries[0].code_object = code_object;
|
|
2740
|
+
Py_INCREF(code_object);
|
|
2741
|
+
}
|
|
2742
|
+
return;
|
|
2743
|
+
}
|
|
2744
|
+
pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
|
|
2745
|
+
if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
|
|
2746
|
+
__Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
|
|
2747
|
+
entries[pos].code_object = code_object;
|
|
2748
|
+
Py_INCREF(code_object);
|
|
2749
|
+
Py_DECREF(tmp);
|
|
2750
|
+
return;
|
|
2751
|
+
}
|
|
2752
|
+
if (code_cache->count == code_cache->max_count) {
|
|
2753
|
+
int new_max = code_cache->max_count + 64;
|
|
2754
|
+
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
|
|
2755
|
+
code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
|
|
2756
|
+
if (unlikely(!entries)) {
|
|
2757
|
+
return;
|
|
2758
|
+
}
|
|
2759
|
+
code_cache->entries = entries;
|
|
2760
|
+
code_cache->max_count = new_max;
|
|
2761
|
+
}
|
|
2762
|
+
for (i=code_cache->count; i>pos; i--) {
|
|
2763
|
+
entries[i] = entries[i-1];
|
|
2764
|
+
}
|
|
2765
|
+
entries[pos].code_line = code_line;
|
|
2766
|
+
entries[pos].code_object = code_object;
|
|
2767
|
+
code_cache->count++;
|
|
2768
|
+
Py_INCREF(code_object);
|
|
2769
|
+
}
|
|
2770
|
+
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
|
|
2771
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
|
|
2772
|
+
(void)__pyx__insert_code_object;
|
|
2773
|
+
return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
|
|
2774
|
+
#else
|
|
2775
|
+
struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
|
|
2776
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2777
|
+
__pyx_nonatomic_int_type expected = 0;
|
|
2778
|
+
if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
|
|
2779
|
+
return;
|
|
2780
|
+
}
|
|
2781
|
+
#endif
|
|
2782
|
+
__pyx__insert_code_object(code_cache, code_line, code_object);
|
|
2783
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
2784
|
+
__pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
|
|
2785
|
+
#endif
|
|
2786
|
+
#endif
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2789
|
+
/* AddTraceback */
|
|
2790
|
+
#include "compile.h"
|
|
2791
|
+
#include "frameobject.h"
|
|
2792
|
+
#include "traceback.h"
|
|
2793
|
+
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
|
|
2794
|
+
#ifndef Py_BUILD_CORE
|
|
2795
|
+
#define Py_BUILD_CORE 1
|
|
2796
|
+
#endif
|
|
2797
|
+
#include "internal/pycore_frame.h"
|
|
2798
|
+
#endif
|
|
2799
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
2800
|
+
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
|
|
2801
|
+
PyObject *firstlineno, PyObject *name) {
|
|
2802
|
+
PyObject *replace = NULL;
|
|
2803
|
+
if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
|
|
2804
|
+
if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
|
|
2805
|
+
replace = PyObject_GetAttrString(code, "replace");
|
|
2806
|
+
if (likely(replace)) {
|
|
2807
|
+
PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
|
|
2808
|
+
Py_DECREF(replace);
|
|
2809
|
+
return result;
|
|
2810
|
+
}
|
|
2811
|
+
PyErr_Clear();
|
|
2812
|
+
return NULL;
|
|
2813
|
+
}
|
|
2814
|
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
2815
|
+
int py_line, const char *filename) {
|
|
2816
|
+
PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
|
|
2817
|
+
PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
|
|
2818
|
+
PyObject *exc_type, *exc_value, *exc_traceback;
|
|
2819
|
+
int success = 0;
|
|
2820
|
+
if (c_line) {
|
|
2821
|
+
c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
|
|
2822
|
+
}
|
|
2823
|
+
PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
|
|
2824
|
+
code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
|
|
2825
|
+
if (!code_object) {
|
|
2826
|
+
code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
|
|
2827
|
+
if (unlikely(!code_object)) goto bad;
|
|
2828
|
+
py_py_line = PyLong_FromLong(py_line);
|
|
2829
|
+
if (unlikely(!py_py_line)) goto bad;
|
|
2830
|
+
if (c_line) {
|
|
2831
|
+
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
|
2832
|
+
} else {
|
|
2833
|
+
py_funcname = PyUnicode_FromString(funcname);
|
|
2834
|
+
}
|
|
2835
|
+
if (unlikely(!py_funcname)) goto bad;
|
|
2836
|
+
dict = PyDict_New();
|
|
2837
|
+
if (unlikely(!dict)) goto bad;
|
|
2838
|
+
{
|
|
2839
|
+
PyObject *old_code_object = code_object;
|
|
2840
|
+
code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
|
|
2841
|
+
Py_DECREF(old_code_object);
|
|
2842
|
+
}
|
|
2843
|
+
if (unlikely(!code_object)) goto bad;
|
|
2844
|
+
__pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
|
|
2845
|
+
} else {
|
|
2846
|
+
dict = PyDict_New();
|
|
2847
|
+
}
|
|
2848
|
+
getframe = PySys_GetObject("_getframe");
|
|
2849
|
+
if (unlikely(!getframe)) goto bad;
|
|
2850
|
+
if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
|
|
2851
|
+
frame = PyEval_EvalCode(code_object, dict, dict);
|
|
2852
|
+
if (unlikely(!frame) || frame == Py_None) goto bad;
|
|
2853
|
+
success = 1;
|
|
2854
|
+
bad:
|
|
2855
|
+
PyErr_Restore(exc_type, exc_value, exc_traceback);
|
|
2856
|
+
Py_XDECREF(code_object);
|
|
2857
|
+
Py_XDECREF(py_py_line);
|
|
2858
|
+
Py_XDECREF(py_funcname);
|
|
2859
|
+
Py_XDECREF(dict);
|
|
2860
|
+
Py_XDECREF(replace);
|
|
2861
|
+
if (success) {
|
|
2862
|
+
PyTraceBack_Here(
|
|
2863
|
+
(struct _frame*)frame);
|
|
2864
|
+
}
|
|
2865
|
+
Py_XDECREF(frame);
|
|
2866
|
+
}
|
|
2867
|
+
#else
|
|
2868
|
+
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
|
2869
|
+
const char *funcname, int c_line,
|
|
2870
|
+
int py_line, const char *filename) {
|
|
2871
|
+
PyCodeObject *py_code = NULL;
|
|
2872
|
+
PyObject *py_funcname = NULL;
|
|
2873
|
+
if (c_line) {
|
|
2874
|
+
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
|
2875
|
+
if (!py_funcname) goto bad;
|
|
2876
|
+
funcname = PyUnicode_AsUTF8(py_funcname);
|
|
2877
|
+
if (!funcname) goto bad;
|
|
2878
|
+
}
|
|
2879
|
+
py_code = PyCode_NewEmpty(filename, funcname, py_line);
|
|
2880
|
+
Py_XDECREF(py_funcname);
|
|
2881
|
+
return py_code;
|
|
2882
|
+
bad:
|
|
2883
|
+
Py_XDECREF(py_funcname);
|
|
2884
|
+
return NULL;
|
|
2885
|
+
}
|
|
2886
|
+
static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
|
2887
|
+
int py_line, const char *filename) {
|
|
2888
|
+
PyCodeObject *py_code = 0;
|
|
2889
|
+
PyFrameObject *py_frame = 0;
|
|
2890
|
+
PyThreadState *tstate = __Pyx_PyThreadState_Current;
|
|
2891
|
+
PyObject *ptype, *pvalue, *ptraceback;
|
|
2892
|
+
if (c_line) {
|
|
2893
|
+
c_line = __Pyx_CLineForTraceback(tstate, c_line);
|
|
2894
|
+
}
|
|
2895
|
+
py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
|
|
2896
|
+
if (!py_code) {
|
|
2897
|
+
__Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
|
|
2898
|
+
py_code = __Pyx_CreateCodeObjectForTraceback(
|
|
2899
|
+
funcname, c_line, py_line, filename);
|
|
2900
|
+
if (!py_code) {
|
|
2901
|
+
/* If the code object creation fails, then we should clear the
|
|
2902
|
+
fetched exception references and propagate the new exception */
|
|
2903
|
+
Py_XDECREF(ptype);
|
|
2904
|
+
Py_XDECREF(pvalue);
|
|
2905
|
+
Py_XDECREF(ptraceback);
|
|
2906
|
+
goto bad;
|
|
2907
|
+
}
|
|
2908
|
+
__Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
|
|
2909
|
+
__pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
|
|
2910
|
+
}
|
|
2911
|
+
py_frame = PyFrame_New(
|
|
2912
|
+
tstate, /*PyThreadState *tstate,*/
|
|
2913
|
+
py_code, /*PyCodeObject *code,*/
|
|
2914
|
+
__pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
|
|
2915
|
+
0 /*PyObject *locals*/
|
|
2916
|
+
);
|
|
2917
|
+
if (!py_frame) goto bad;
|
|
2918
|
+
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
|
|
2919
|
+
PyTraceBack_Here(py_frame);
|
|
2920
|
+
bad:
|
|
2921
|
+
Py_XDECREF(py_code);
|
|
2922
|
+
Py_XDECREF(py_frame);
|
|
2923
|
+
}
|
|
2924
|
+
#endif
|
|
2925
|
+
|
|
2926
|
+
/* FormatTypeName */
|
|
2927
|
+
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
|
|
2928
|
+
static __Pyx_TypeName
|
|
2929
|
+
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
|
|
2930
|
+
{
|
|
2931
|
+
PyObject *module = NULL, *name = NULL, *result = NULL;
|
|
2932
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
|
|
2933
|
+
name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
|
|
2934
|
+
__pyx_mstate_global->__pyx_n_u_qualname);
|
|
2935
|
+
#else
|
|
2936
|
+
name = PyType_GetQualName(tp);
|
|
2937
|
+
#endif
|
|
2938
|
+
if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
|
|
2939
|
+
module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
|
|
2940
|
+
__pyx_mstate_global->__pyx_n_u_module);
|
|
2941
|
+
if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
|
|
2942
|
+
if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
|
|
2943
|
+
result = name;
|
|
2944
|
+
name = NULL;
|
|
2945
|
+
goto done;
|
|
2946
|
+
}
|
|
2947
|
+
result = PyUnicode_FromFormat("%U.%U", module, name);
|
|
2948
|
+
if (unlikely(result == NULL)) goto bad;
|
|
2949
|
+
done:
|
|
2950
|
+
Py_XDECREF(name);
|
|
2951
|
+
Py_XDECREF(module);
|
|
2952
|
+
return result;
|
|
2953
|
+
bad:
|
|
2954
|
+
PyErr_Clear();
|
|
2955
|
+
if (name) {
|
|
2956
|
+
result = name;
|
|
2957
|
+
name = NULL;
|
|
2958
|
+
} else {
|
|
2959
|
+
result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u_);
|
|
2960
|
+
}
|
|
2961
|
+
goto done;
|
|
2962
|
+
}
|
|
2963
|
+
#endif
|
|
2964
|
+
|
|
2965
|
+
/* PyObjectCall (used by PyObjectFastCall) */
|
|
2966
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
2967
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
|
2968
|
+
PyObject *result;
|
|
2969
|
+
ternaryfunc call = Py_TYPE(func)->tp_call;
|
|
2970
|
+
if (unlikely(!call))
|
|
2971
|
+
return PyObject_Call(func, arg, kw);
|
|
2972
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
|
2973
|
+
return NULL;
|
|
2974
|
+
result = (*call)(func, arg, kw);
|
|
2975
|
+
Py_LeaveRecursiveCall();
|
|
2976
|
+
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
|
2977
|
+
PyErr_SetString(
|
|
2978
|
+
PyExc_SystemError,
|
|
2979
|
+
"NULL result without error in PyObject_Call");
|
|
2980
|
+
}
|
|
2981
|
+
return result;
|
|
2982
|
+
}
|
|
2983
|
+
#endif
|
|
2984
|
+
|
|
2985
|
+
/* PyObjectCallMethO (used by PyObjectFastCall) */
|
|
2986
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
2987
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
|
|
2988
|
+
PyObject *self, *result;
|
|
2989
|
+
PyCFunction cfunc;
|
|
2990
|
+
cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
|
|
2991
|
+
self = __Pyx_CyOrPyCFunction_GET_SELF(func);
|
|
2992
|
+
if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
|
|
2993
|
+
return NULL;
|
|
2994
|
+
result = cfunc(self, arg);
|
|
2995
|
+
Py_LeaveRecursiveCall();
|
|
2996
|
+
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
|
2997
|
+
PyErr_SetString(
|
|
2998
|
+
PyExc_SystemError,
|
|
2999
|
+
"NULL result without error in PyObject_Call");
|
|
3000
|
+
}
|
|
3001
|
+
return result;
|
|
3002
|
+
}
|
|
3003
|
+
#endif
|
|
3004
|
+
|
|
3005
|
+
/* PyObjectFastCall (used by PyObjectVectorCallKwBuilder) */
|
|
3006
|
+
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
|
|
3007
|
+
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
|
|
3008
|
+
PyObject *argstuple;
|
|
3009
|
+
PyObject *result = 0;
|
|
3010
|
+
size_t i;
|
|
3011
|
+
argstuple = PyTuple_New((Py_ssize_t)nargs);
|
|
3012
|
+
if (unlikely(!argstuple)) return NULL;
|
|
3013
|
+
for (i = 0; i < nargs; i++) {
|
|
3014
|
+
Py_INCREF(args[i]);
|
|
3015
|
+
if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
|
|
3016
|
+
}
|
|
3017
|
+
result = __Pyx_PyObject_Call(func, argstuple, kwargs);
|
|
3018
|
+
bad:
|
|
3019
|
+
Py_DECREF(argstuple);
|
|
3020
|
+
return result;
|
|
3021
|
+
}
|
|
3022
|
+
#endif
|
|
3023
|
+
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
|
|
3024
|
+
#if PY_VERSION_HEX < 0x03090000
|
|
3025
|
+
#define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
|
|
3026
|
+
#elif CYTHON_COMPILING_IN_CPYTHON
|
|
3027
|
+
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
|
|
3028
|
+
PyTypeObject *tp = Py_TYPE(callable);
|
|
3029
|
+
#if defined(__Pyx_CyFunction_USED)
|
|
3030
|
+
if (__Pyx_CyFunction_CheckExact(callable)) {
|
|
3031
|
+
return __Pyx_CyFunction_func_vectorcall(callable);
|
|
3032
|
+
}
|
|
3033
|
+
#endif
|
|
3034
|
+
if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
|
|
3035
|
+
return NULL;
|
|
3036
|
+
}
|
|
3037
|
+
assert(PyCallable_Check(callable));
|
|
3038
|
+
Py_ssize_t offset = tp->tp_vectorcall_offset;
|
|
3039
|
+
assert(offset > 0);
|
|
3040
|
+
vectorcallfunc ptr;
|
|
3041
|
+
memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
|
|
3042
|
+
return ptr;
|
|
3043
|
+
}
|
|
3044
|
+
#else
|
|
3045
|
+
#define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
|
|
3046
|
+
#endif
|
|
3047
|
+
#endif
|
|
3048
|
+
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
|
|
3049
|
+
Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
|
|
3050
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
3051
|
+
if (nargs == 0 && kwargs == NULL) {
|
|
3052
|
+
if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
|
|
3053
|
+
return __Pyx_PyObject_CallMethO(func, NULL);
|
|
3054
|
+
}
|
|
3055
|
+
else if (nargs == 1 && kwargs == NULL) {
|
|
3056
|
+
if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
|
|
3057
|
+
return __Pyx_PyObject_CallMethO(func, args[0]);
|
|
3058
|
+
}
|
|
3059
|
+
#endif
|
|
3060
|
+
if (kwargs == NULL) {
|
|
3061
|
+
#if CYTHON_VECTORCALL
|
|
3062
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
3063
|
+
return PyObject_Vectorcall(func, args, _nargs, NULL);
|
|
3064
|
+
#else
|
|
3065
|
+
vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
|
|
3066
|
+
if (f) {
|
|
3067
|
+
return f(func, args, _nargs, NULL);
|
|
3068
|
+
}
|
|
3069
|
+
#endif
|
|
3070
|
+
#endif
|
|
3071
|
+
}
|
|
3072
|
+
if (nargs == 0) {
|
|
3073
|
+
return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
|
|
3074
|
+
}
|
|
3075
|
+
#if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
|
|
3076
|
+
return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
|
|
3077
|
+
#else
|
|
3078
|
+
return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
|
|
3079
|
+
#endif
|
|
3080
|
+
}
|
|
3081
|
+
|
|
3082
|
+
/* PyObjectVectorCallKwBuilder (used by CIntToPy) */
|
|
3083
|
+
#if CYTHON_VECTORCALL
|
|
3084
|
+
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
|
|
3085
|
+
(void)__Pyx_PyObject_FastCallDict;
|
|
3086
|
+
if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
|
|
3087
|
+
Py_INCREF(key);
|
|
3088
|
+
args[n] = value;
|
|
3089
|
+
return 0;
|
|
3090
|
+
}
|
|
3091
|
+
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
|
|
3092
|
+
(void)__Pyx_VectorcallBuilder_AddArgStr;
|
|
3093
|
+
if (unlikely(!PyUnicode_Check(key))) {
|
|
3094
|
+
PyErr_SetString(PyExc_TypeError, "keywords must be strings");
|
|
3095
|
+
return -1;
|
|
3096
|
+
}
|
|
3097
|
+
return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
|
|
3098
|
+
}
|
|
3099
|
+
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
|
|
3100
|
+
PyObject *pyKey = PyUnicode_FromString(key);
|
|
3101
|
+
if (!pyKey) return -1;
|
|
3102
|
+
return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
|
|
3103
|
+
}
|
|
3104
|
+
#else // CYTHON_VECTORCALL
|
|
3105
|
+
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
|
|
3106
|
+
if (unlikely(!PyUnicode_Check(key))) {
|
|
3107
|
+
PyErr_SetString(PyExc_TypeError, "keywords must be strings");
|
|
3108
|
+
return -1;
|
|
3109
|
+
}
|
|
3110
|
+
return PyDict_SetItem(builder, key, value);
|
|
3111
|
+
}
|
|
3112
|
+
#endif
|
|
3113
|
+
|
|
3114
|
+
/* CIntToPy */
|
|
3115
|
+
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
|
|
3116
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
3117
|
+
#pragma GCC diagnostic push
|
|
3118
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
|
3119
|
+
#endif
|
|
3120
|
+
const long neg_one = (long) -1, const_zero = (long) 0;
|
|
3121
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
3122
|
+
#pragma GCC diagnostic pop
|
|
3123
|
+
#endif
|
|
3124
|
+
const int is_unsigned = neg_one > const_zero;
|
|
3125
|
+
if (is_unsigned) {
|
|
3126
|
+
if (sizeof(long) < sizeof(long)) {
|
|
3127
|
+
return PyLong_FromLong((long) value);
|
|
3128
|
+
} else if (sizeof(long) <= sizeof(unsigned long)) {
|
|
3129
|
+
return PyLong_FromUnsignedLong((unsigned long) value);
|
|
3130
|
+
#if !CYTHON_COMPILING_IN_PYPY
|
|
3131
|
+
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
3132
|
+
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
|
3133
|
+
#endif
|
|
3134
|
+
}
|
|
3135
|
+
} else {
|
|
3136
|
+
if (sizeof(long) <= sizeof(long)) {
|
|
3137
|
+
return PyLong_FromLong((long) value);
|
|
3138
|
+
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
|
|
3139
|
+
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
|
3140
|
+
}
|
|
3141
|
+
}
|
|
3142
|
+
{
|
|
3143
|
+
unsigned char *bytes = (unsigned char *)&value;
|
|
3144
|
+
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
|
|
3145
|
+
if (is_unsigned) {
|
|
3146
|
+
return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
|
|
3147
|
+
} else {
|
|
3148
|
+
return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
|
|
3149
|
+
}
|
|
3150
|
+
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
|
|
3151
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
3152
|
+
return _PyLong_FromByteArray(bytes, sizeof(long),
|
|
3153
|
+
little, !is_unsigned);
|
|
3154
|
+
#else
|
|
3155
|
+
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
3156
|
+
PyObject *from_bytes, *result = NULL, *kwds = NULL;
|
|
3157
|
+
PyObject *py_bytes = NULL, *order_str = NULL;
|
|
3158
|
+
from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
|
|
3159
|
+
if (!from_bytes) return NULL;
|
|
3160
|
+
py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
|
|
3161
|
+
if (!py_bytes) goto limited_bad;
|
|
3162
|
+
order_str = PyUnicode_FromString(little ? "little" : "big");
|
|
3163
|
+
if (!order_str) goto limited_bad;
|
|
3164
|
+
{
|
|
3165
|
+
PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
|
|
3166
|
+
if (!is_unsigned) {
|
|
3167
|
+
kwds = __Pyx_MakeVectorcallBuilderKwds(1);
|
|
3168
|
+
if (!kwds) goto limited_bad;
|
|
3169
|
+
if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
|
|
3170
|
+
}
|
|
3171
|
+
result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
|
|
3172
|
+
}
|
|
3173
|
+
limited_bad:
|
|
3174
|
+
Py_XDECREF(kwds);
|
|
3175
|
+
Py_XDECREF(order_str);
|
|
3176
|
+
Py_XDECREF(py_bytes);
|
|
3177
|
+
Py_XDECREF(from_bytes);
|
|
3178
|
+
return result;
|
|
3179
|
+
#endif
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3182
|
+
|
|
3183
|
+
/* CIntFromPyVerify (used by CIntFromPy) */
|
|
3184
|
+
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
|
|
3185
|
+
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
|
|
3186
|
+
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
|
|
3187
|
+
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
|
|
3188
|
+
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
|
|
3189
|
+
{\
|
|
3190
|
+
func_type value = func_value;\
|
|
3191
|
+
if (sizeof(target_type) < sizeof(func_type)) {\
|
|
3192
|
+
if (unlikely(value != (func_type) (target_type) value)) {\
|
|
3193
|
+
func_type zero = 0;\
|
|
3194
|
+
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
|
|
3195
|
+
return (target_type) -1;\
|
|
3196
|
+
if (is_unsigned && unlikely(value < zero))\
|
|
3197
|
+
goto raise_neg_overflow;\
|
|
3198
|
+
else\
|
|
3199
|
+
goto raise_overflow;\
|
|
3200
|
+
}\
|
|
3201
|
+
}\
|
|
3202
|
+
return (target_type) value;\
|
|
3203
|
+
}
|
|
3204
|
+
|
|
3205
|
+
/* CIntFromPy */
|
|
3206
|
+
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
|
|
3207
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
3208
|
+
#pragma GCC diagnostic push
|
|
3209
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
|
3210
|
+
#endif
|
|
3211
|
+
const long neg_one = (long) -1, const_zero = (long) 0;
|
|
3212
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
3213
|
+
#pragma GCC diagnostic pop
|
|
3214
|
+
#endif
|
|
3215
|
+
const int is_unsigned = neg_one > const_zero;
|
|
3216
|
+
if (unlikely(!PyLong_Check(x))) {
|
|
3217
|
+
long val;
|
|
3218
|
+
PyObject *tmp = __Pyx_PyNumber_Long(x);
|
|
3219
|
+
if (!tmp) return (long) -1;
|
|
3220
|
+
val = __Pyx_PyLong_As_long(tmp);
|
|
3221
|
+
Py_DECREF(tmp);
|
|
3222
|
+
return val;
|
|
3223
|
+
}
|
|
3224
|
+
if (is_unsigned) {
|
|
3225
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
3226
|
+
if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
|
3227
|
+
goto raise_neg_overflow;
|
|
3228
|
+
} else if (__Pyx_PyLong_IsCompact(x)) {
|
|
3229
|
+
__PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
|
3230
|
+
} else {
|
|
3231
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
3232
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
3233
|
+
switch (__Pyx_PyLong_DigitCount(x)) {
|
|
3234
|
+
case 2:
|
|
3235
|
+
if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
|
|
3236
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
3237
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3238
|
+
} else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
|
|
3239
|
+
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
|
3240
|
+
}
|
|
3241
|
+
}
|
|
3242
|
+
break;
|
|
3243
|
+
case 3:
|
|
3244
|
+
if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
|
|
3245
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
3246
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3247
|
+
} else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
|
|
3248
|
+
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
break;
|
|
3252
|
+
case 4:
|
|
3253
|
+
if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
|
|
3254
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
3255
|
+
__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])))
|
|
3256
|
+
} else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
|
|
3257
|
+
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
|
|
3258
|
+
}
|
|
3259
|
+
}
|
|
3260
|
+
break;
|
|
3261
|
+
}
|
|
3262
|
+
}
|
|
3263
|
+
#endif
|
|
3264
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
|
3265
|
+
if (unlikely(Py_SIZE(x) < 0)) {
|
|
3266
|
+
goto raise_neg_overflow;
|
|
3267
|
+
}
|
|
3268
|
+
#else
|
|
3269
|
+
{
|
|
3270
|
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
|
3271
|
+
if (unlikely(result < 0))
|
|
3272
|
+
return (long) -1;
|
|
3273
|
+
if (unlikely(result == 1))
|
|
3274
|
+
goto raise_neg_overflow;
|
|
3275
|
+
}
|
|
3276
|
+
#endif
|
|
3277
|
+
if ((sizeof(long) <= sizeof(unsigned long))) {
|
|
3278
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
|
|
3279
|
+
} else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
|
|
3280
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
|
3281
|
+
}
|
|
3282
|
+
} else {
|
|
3283
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
3284
|
+
if (__Pyx_PyLong_IsCompact(x)) {
|
|
3285
|
+
__PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
|
3286
|
+
} else {
|
|
3287
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
3288
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
3289
|
+
switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
|
3290
|
+
case -2:
|
|
3291
|
+
if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
|
|
3292
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
3293
|
+
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3294
|
+
} else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
|
3295
|
+
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
3298
|
+
break;
|
|
3299
|
+
case 2:
|
|
3300
|
+
if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
|
|
3301
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
3302
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3303
|
+
} else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
|
3304
|
+
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
break;
|
|
3308
|
+
case -3:
|
|
3309
|
+
if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
|
|
3310
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
3311
|
+
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3312
|
+
} else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
|
3313
|
+
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
break;
|
|
3317
|
+
case 3:
|
|
3318
|
+
if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
|
|
3319
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
3320
|
+
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3321
|
+
} else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
|
3322
|
+
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
break;
|
|
3326
|
+
case -4:
|
|
3327
|
+
if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
|
|
3328
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
3329
|
+
__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])))
|
|
3330
|
+
} else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
|
|
3331
|
+
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
3332
|
+
}
|
|
3333
|
+
}
|
|
3334
|
+
break;
|
|
3335
|
+
case 4:
|
|
3336
|
+
if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
|
|
3337
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
3338
|
+
__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])))
|
|
3339
|
+
} else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
|
|
3340
|
+
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
|
|
3341
|
+
}
|
|
3342
|
+
}
|
|
3343
|
+
break;
|
|
3344
|
+
}
|
|
3345
|
+
}
|
|
3346
|
+
#endif
|
|
3347
|
+
if ((sizeof(long) <= sizeof(long))) {
|
|
3348
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
|
|
3349
|
+
} else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
|
|
3350
|
+
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
|
|
3351
|
+
}
|
|
3352
|
+
}
|
|
3353
|
+
{
|
|
3354
|
+
long val;
|
|
3355
|
+
int ret = -1;
|
|
3356
|
+
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
|
3357
|
+
Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
|
3358
|
+
x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
|
3359
|
+
if (unlikely(bytes_copied == -1)) {
|
|
3360
|
+
} else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
|
3361
|
+
goto raise_overflow;
|
|
3362
|
+
} else {
|
|
3363
|
+
ret = 0;
|
|
3364
|
+
}
|
|
3365
|
+
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
|
3366
|
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
3367
|
+
unsigned char *bytes = (unsigned char *)&val;
|
|
3368
|
+
ret = _PyLong_AsByteArray((PyLongObject *)x,
|
|
3369
|
+
bytes, sizeof(val),
|
|
3370
|
+
is_little, !is_unsigned);
|
|
3371
|
+
#else
|
|
3372
|
+
PyObject *v;
|
|
3373
|
+
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
|
3374
|
+
int bits, remaining_bits, is_negative = 0;
|
|
3375
|
+
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
|
3376
|
+
if (likely(PyLong_CheckExact(x))) {
|
|
3377
|
+
v = __Pyx_NewRef(x);
|
|
3378
|
+
} else {
|
|
3379
|
+
v = PyNumber_Long(x);
|
|
3380
|
+
if (unlikely(!v)) return (long) -1;
|
|
3381
|
+
assert(PyLong_CheckExact(v));
|
|
3382
|
+
}
|
|
3383
|
+
{
|
|
3384
|
+
int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
|
3385
|
+
if (unlikely(result < 0)) {
|
|
3386
|
+
Py_DECREF(v);
|
|
3387
|
+
return (long) -1;
|
|
3388
|
+
}
|
|
3389
|
+
is_negative = result == 1;
|
|
3390
|
+
}
|
|
3391
|
+
if (is_unsigned && unlikely(is_negative)) {
|
|
3392
|
+
Py_DECREF(v);
|
|
3393
|
+
goto raise_neg_overflow;
|
|
3394
|
+
} else if (is_negative) {
|
|
3395
|
+
stepval = PyNumber_Invert(v);
|
|
3396
|
+
Py_DECREF(v);
|
|
3397
|
+
if (unlikely(!stepval))
|
|
3398
|
+
return (long) -1;
|
|
3399
|
+
} else {
|
|
3400
|
+
stepval = v;
|
|
3401
|
+
}
|
|
3402
|
+
v = NULL;
|
|
3403
|
+
val = (long) 0;
|
|
3404
|
+
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
|
3405
|
+
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
|
3406
|
+
for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
|
|
3407
|
+
PyObject *tmp, *digit;
|
|
3408
|
+
long idigit;
|
|
3409
|
+
digit = PyNumber_And(stepval, mask);
|
|
3410
|
+
if (unlikely(!digit)) goto done;
|
|
3411
|
+
idigit = PyLong_AsLong(digit);
|
|
3412
|
+
Py_DECREF(digit);
|
|
3413
|
+
if (unlikely(idigit < 0)) goto done;
|
|
3414
|
+
val |= ((long) idigit) << bits;
|
|
3415
|
+
tmp = PyNumber_Rshift(stepval, shift);
|
|
3416
|
+
if (unlikely(!tmp)) goto done;
|
|
3417
|
+
Py_DECREF(stepval); stepval = tmp;
|
|
3418
|
+
}
|
|
3419
|
+
Py_DECREF(shift); shift = NULL;
|
|
3420
|
+
Py_DECREF(mask); mask = NULL;
|
|
3421
|
+
{
|
|
3422
|
+
long idigit = PyLong_AsLong(stepval);
|
|
3423
|
+
if (unlikely(idigit < 0)) goto done;
|
|
3424
|
+
remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
|
|
3425
|
+
if (unlikely(idigit >= (1L << remaining_bits)))
|
|
3426
|
+
goto raise_overflow;
|
|
3427
|
+
val |= ((long) idigit) << bits;
|
|
3428
|
+
}
|
|
3429
|
+
if (!is_unsigned) {
|
|
3430
|
+
if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
|
|
3431
|
+
goto raise_overflow;
|
|
3432
|
+
if (is_negative)
|
|
3433
|
+
val = ~val;
|
|
3434
|
+
}
|
|
3435
|
+
ret = 0;
|
|
3436
|
+
done:
|
|
3437
|
+
Py_XDECREF(shift);
|
|
3438
|
+
Py_XDECREF(mask);
|
|
3439
|
+
Py_XDECREF(stepval);
|
|
3440
|
+
#endif
|
|
3441
|
+
if (unlikely(ret))
|
|
3442
|
+
return (long) -1;
|
|
3443
|
+
return val;
|
|
3444
|
+
}
|
|
3445
|
+
raise_overflow:
|
|
3446
|
+
PyErr_SetString(PyExc_OverflowError,
|
|
3447
|
+
"value too large to convert to long");
|
|
3448
|
+
return (long) -1;
|
|
3449
|
+
raise_neg_overflow:
|
|
3450
|
+
PyErr_SetString(PyExc_OverflowError,
|
|
3451
|
+
"can't convert negative value to long");
|
|
3452
|
+
return (long) -1;
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
/* CIntFromPy */
|
|
3456
|
+
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
|
|
3457
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
3458
|
+
#pragma GCC diagnostic push
|
|
3459
|
+
#pragma GCC diagnostic ignored "-Wconversion"
|
|
3460
|
+
#endif
|
|
3461
|
+
const int neg_one = (int) -1, const_zero = (int) 0;
|
|
3462
|
+
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
3463
|
+
#pragma GCC diagnostic pop
|
|
3464
|
+
#endif
|
|
3465
|
+
const int is_unsigned = neg_one > const_zero;
|
|
3466
|
+
if (unlikely(!PyLong_Check(x))) {
|
|
3467
|
+
int val;
|
|
3468
|
+
PyObject *tmp = __Pyx_PyNumber_Long(x);
|
|
3469
|
+
if (!tmp) return (int) -1;
|
|
3470
|
+
val = __Pyx_PyLong_As_int(tmp);
|
|
3471
|
+
Py_DECREF(tmp);
|
|
3472
|
+
return val;
|
|
3473
|
+
}
|
|
3474
|
+
if (is_unsigned) {
|
|
3475
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
3476
|
+
if (unlikely(__Pyx_PyLong_IsNeg(x))) {
|
|
3477
|
+
goto raise_neg_overflow;
|
|
3478
|
+
} else if (__Pyx_PyLong_IsCompact(x)) {
|
|
3479
|
+
__PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
|
|
3480
|
+
} else {
|
|
3481
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
3482
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
3483
|
+
switch (__Pyx_PyLong_DigitCount(x)) {
|
|
3484
|
+
case 2:
|
|
3485
|
+
if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
|
|
3486
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
3487
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3488
|
+
} else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
|
|
3489
|
+
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
break;
|
|
3493
|
+
case 3:
|
|
3494
|
+
if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
|
|
3495
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
3496
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3497
|
+
} else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
|
|
3498
|
+
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
break;
|
|
3502
|
+
case 4:
|
|
3503
|
+
if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
|
|
3504
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
3505
|
+
__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])))
|
|
3506
|
+
} else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
|
|
3507
|
+
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
|
|
3508
|
+
}
|
|
3509
|
+
}
|
|
3510
|
+
break;
|
|
3511
|
+
}
|
|
3512
|
+
}
|
|
3513
|
+
#endif
|
|
3514
|
+
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
|
|
3515
|
+
if (unlikely(Py_SIZE(x) < 0)) {
|
|
3516
|
+
goto raise_neg_overflow;
|
|
3517
|
+
}
|
|
3518
|
+
#else
|
|
3519
|
+
{
|
|
3520
|
+
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
|
|
3521
|
+
if (unlikely(result < 0))
|
|
3522
|
+
return (int) -1;
|
|
3523
|
+
if (unlikely(result == 1))
|
|
3524
|
+
goto raise_neg_overflow;
|
|
3525
|
+
}
|
|
3526
|
+
#endif
|
|
3527
|
+
if ((sizeof(int) <= sizeof(unsigned long))) {
|
|
3528
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
|
|
3529
|
+
} else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
|
|
3530
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
|
|
3531
|
+
}
|
|
3532
|
+
} else {
|
|
3533
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
3534
|
+
if (__Pyx_PyLong_IsCompact(x)) {
|
|
3535
|
+
__PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
|
|
3536
|
+
} else {
|
|
3537
|
+
const digit* digits = __Pyx_PyLong_Digits(x);
|
|
3538
|
+
assert(__Pyx_PyLong_DigitCount(x) > 1);
|
|
3539
|
+
switch (__Pyx_PyLong_SignedDigitCount(x)) {
|
|
3540
|
+
case -2:
|
|
3541
|
+
if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
|
|
3542
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
3543
|
+
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3544
|
+
} else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
|
3545
|
+
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
3546
|
+
}
|
|
3547
|
+
}
|
|
3548
|
+
break;
|
|
3549
|
+
case 2:
|
|
3550
|
+
if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
|
|
3551
|
+
if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
|
|
3552
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3553
|
+
} else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
|
3554
|
+
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
break;
|
|
3558
|
+
case -3:
|
|
3559
|
+
if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
|
|
3560
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
3561
|
+
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3562
|
+
} else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
|
3563
|
+
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
3564
|
+
}
|
|
3565
|
+
}
|
|
3566
|
+
break;
|
|
3567
|
+
case 3:
|
|
3568
|
+
if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
|
|
3569
|
+
if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
|
|
3570
|
+
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
|
|
3571
|
+
} else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
|
3572
|
+
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
3573
|
+
}
|
|
3574
|
+
}
|
|
3575
|
+
break;
|
|
3576
|
+
case -4:
|
|
3577
|
+
if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
|
|
3578
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
3579
|
+
__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])))
|
|
3580
|
+
} else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
|
|
3581
|
+
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
break;
|
|
3585
|
+
case 4:
|
|
3586
|
+
if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
|
|
3587
|
+
if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
|
|
3588
|
+
__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])))
|
|
3589
|
+
} else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
|
|
3590
|
+
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
|
|
3591
|
+
}
|
|
3592
|
+
}
|
|
3593
|
+
break;
|
|
3594
|
+
}
|
|
3595
|
+
}
|
|
3596
|
+
#endif
|
|
3597
|
+
if ((sizeof(int) <= sizeof(long))) {
|
|
3598
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
|
|
3599
|
+
} else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
|
|
3600
|
+
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
|
|
3601
|
+
}
|
|
3602
|
+
}
|
|
3603
|
+
{
|
|
3604
|
+
int val;
|
|
3605
|
+
int ret = -1;
|
|
3606
|
+
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
|
|
3607
|
+
Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
|
|
3608
|
+
x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
|
|
3609
|
+
if (unlikely(bytes_copied == -1)) {
|
|
3610
|
+
} else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
|
|
3611
|
+
goto raise_overflow;
|
|
3612
|
+
} else {
|
|
3613
|
+
ret = 0;
|
|
3614
|
+
}
|
|
3615
|
+
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
|
|
3616
|
+
int one = 1; int is_little = (int)*(unsigned char *)&one;
|
|
3617
|
+
unsigned char *bytes = (unsigned char *)&val;
|
|
3618
|
+
ret = _PyLong_AsByteArray((PyLongObject *)x,
|
|
3619
|
+
bytes, sizeof(val),
|
|
3620
|
+
is_little, !is_unsigned);
|
|
3621
|
+
#else
|
|
3622
|
+
PyObject *v;
|
|
3623
|
+
PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
|
|
3624
|
+
int bits, remaining_bits, is_negative = 0;
|
|
3625
|
+
int chunk_size = (sizeof(long) < 8) ? 30 : 62;
|
|
3626
|
+
if (likely(PyLong_CheckExact(x))) {
|
|
3627
|
+
v = __Pyx_NewRef(x);
|
|
3628
|
+
} else {
|
|
3629
|
+
v = PyNumber_Long(x);
|
|
3630
|
+
if (unlikely(!v)) return (int) -1;
|
|
3631
|
+
assert(PyLong_CheckExact(v));
|
|
3632
|
+
}
|
|
3633
|
+
{
|
|
3634
|
+
int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
|
|
3635
|
+
if (unlikely(result < 0)) {
|
|
3636
|
+
Py_DECREF(v);
|
|
3637
|
+
return (int) -1;
|
|
3638
|
+
}
|
|
3639
|
+
is_negative = result == 1;
|
|
3640
|
+
}
|
|
3641
|
+
if (is_unsigned && unlikely(is_negative)) {
|
|
3642
|
+
Py_DECREF(v);
|
|
3643
|
+
goto raise_neg_overflow;
|
|
3644
|
+
} else if (is_negative) {
|
|
3645
|
+
stepval = PyNumber_Invert(v);
|
|
3646
|
+
Py_DECREF(v);
|
|
3647
|
+
if (unlikely(!stepval))
|
|
3648
|
+
return (int) -1;
|
|
3649
|
+
} else {
|
|
3650
|
+
stepval = v;
|
|
3651
|
+
}
|
|
3652
|
+
v = NULL;
|
|
3653
|
+
val = (int) 0;
|
|
3654
|
+
mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
|
|
3655
|
+
shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
|
|
3656
|
+
for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
|
|
3657
|
+
PyObject *tmp, *digit;
|
|
3658
|
+
long idigit;
|
|
3659
|
+
digit = PyNumber_And(stepval, mask);
|
|
3660
|
+
if (unlikely(!digit)) goto done;
|
|
3661
|
+
idigit = PyLong_AsLong(digit);
|
|
3662
|
+
Py_DECREF(digit);
|
|
3663
|
+
if (unlikely(idigit < 0)) goto done;
|
|
3664
|
+
val |= ((int) idigit) << bits;
|
|
3665
|
+
tmp = PyNumber_Rshift(stepval, shift);
|
|
3666
|
+
if (unlikely(!tmp)) goto done;
|
|
3667
|
+
Py_DECREF(stepval); stepval = tmp;
|
|
3668
|
+
}
|
|
3669
|
+
Py_DECREF(shift); shift = NULL;
|
|
3670
|
+
Py_DECREF(mask); mask = NULL;
|
|
3671
|
+
{
|
|
3672
|
+
long idigit = PyLong_AsLong(stepval);
|
|
3673
|
+
if (unlikely(idigit < 0)) goto done;
|
|
3674
|
+
remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
|
|
3675
|
+
if (unlikely(idigit >= (1L << remaining_bits)))
|
|
3676
|
+
goto raise_overflow;
|
|
3677
|
+
val |= ((int) idigit) << bits;
|
|
3678
|
+
}
|
|
3679
|
+
if (!is_unsigned) {
|
|
3680
|
+
if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
|
|
3681
|
+
goto raise_overflow;
|
|
3682
|
+
if (is_negative)
|
|
3683
|
+
val = ~val;
|
|
3684
|
+
}
|
|
3685
|
+
ret = 0;
|
|
3686
|
+
done:
|
|
3687
|
+
Py_XDECREF(shift);
|
|
3688
|
+
Py_XDECREF(mask);
|
|
3689
|
+
Py_XDECREF(stepval);
|
|
3690
|
+
#endif
|
|
3691
|
+
if (unlikely(ret))
|
|
3692
|
+
return (int) -1;
|
|
3693
|
+
return val;
|
|
3694
|
+
}
|
|
3695
|
+
raise_overflow:
|
|
3696
|
+
PyErr_SetString(PyExc_OverflowError,
|
|
3697
|
+
"value too large to convert to int");
|
|
3698
|
+
return (int) -1;
|
|
3699
|
+
raise_neg_overflow:
|
|
3700
|
+
PyErr_SetString(PyExc_OverflowError,
|
|
3701
|
+
"can't convert negative value to int");
|
|
3702
|
+
return (int) -1;
|
|
3703
|
+
}
|
|
3704
|
+
|
|
3705
|
+
/* FastTypeChecks */
|
|
3706
|
+
#if CYTHON_COMPILING_IN_CPYTHON
|
|
3707
|
+
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
|
|
3708
|
+
while (a) {
|
|
3709
|
+
a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
|
|
3710
|
+
if (a == b)
|
|
3711
|
+
return 1;
|
|
3712
|
+
}
|
|
3713
|
+
return b == &PyBaseObject_Type;
|
|
3714
|
+
}
|
|
3715
|
+
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
|
|
3716
|
+
PyObject *mro;
|
|
3717
|
+
if (a == b) return 1;
|
|
3718
|
+
mro = a->tp_mro;
|
|
3719
|
+
if (likely(mro)) {
|
|
3720
|
+
Py_ssize_t i, n;
|
|
3721
|
+
n = PyTuple_GET_SIZE(mro);
|
|
3722
|
+
for (i = 0; i < n; i++) {
|
|
3723
|
+
if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
|
|
3724
|
+
return 1;
|
|
3725
|
+
}
|
|
3726
|
+
return 0;
|
|
3727
|
+
}
|
|
3728
|
+
return __Pyx_InBases(a, b);
|
|
3729
|
+
}
|
|
3730
|
+
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
|
|
3731
|
+
PyObject *mro;
|
|
3732
|
+
if (cls == a || cls == b) return 1;
|
|
3733
|
+
mro = cls->tp_mro;
|
|
3734
|
+
if (likely(mro)) {
|
|
3735
|
+
Py_ssize_t i, n;
|
|
3736
|
+
n = PyTuple_GET_SIZE(mro);
|
|
3737
|
+
for (i = 0; i < n; i++) {
|
|
3738
|
+
PyObject *base = PyTuple_GET_ITEM(mro, i);
|
|
3739
|
+
if (base == (PyObject *)a || base == (PyObject *)b)
|
|
3740
|
+
return 1;
|
|
3741
|
+
}
|
|
3742
|
+
return 0;
|
|
3743
|
+
}
|
|
3744
|
+
return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
|
|
3745
|
+
}
|
|
3746
|
+
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
|
|
3747
|
+
if (exc_type1) {
|
|
3748
|
+
return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
|
|
3749
|
+
} else {
|
|
3750
|
+
return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
|
|
3754
|
+
Py_ssize_t i, n;
|
|
3755
|
+
assert(PyExceptionClass_Check(exc_type));
|
|
3756
|
+
n = PyTuple_GET_SIZE(tuple);
|
|
3757
|
+
for (i=0; i<n; i++) {
|
|
3758
|
+
if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
|
|
3759
|
+
}
|
|
3760
|
+
for (i=0; i<n; i++) {
|
|
3761
|
+
PyObject *t = PyTuple_GET_ITEM(tuple, i);
|
|
3762
|
+
if (likely(PyExceptionClass_Check(t))) {
|
|
3763
|
+
if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
|
|
3764
|
+
} else {
|
|
3765
|
+
}
|
|
3766
|
+
}
|
|
3767
|
+
return 0;
|
|
3768
|
+
}
|
|
3769
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
|
|
3770
|
+
if (likely(err == exc_type)) return 1;
|
|
3771
|
+
if (likely(PyExceptionClass_Check(err))) {
|
|
3772
|
+
if (likely(PyExceptionClass_Check(exc_type))) {
|
|
3773
|
+
return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
|
|
3774
|
+
} else if (likely(PyTuple_Check(exc_type))) {
|
|
3775
|
+
return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
|
|
3776
|
+
} else {
|
|
3777
|
+
}
|
|
3778
|
+
}
|
|
3779
|
+
return PyErr_GivenExceptionMatches(err, exc_type);
|
|
3780
|
+
}
|
|
3781
|
+
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
|
|
3782
|
+
assert(PyExceptionClass_Check(exc_type1));
|
|
3783
|
+
assert(PyExceptionClass_Check(exc_type2));
|
|
3784
|
+
if (likely(err == exc_type1 || err == exc_type2)) return 1;
|
|
3785
|
+
if (likely(PyExceptionClass_Check(err))) {
|
|
3786
|
+
return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
|
|
3787
|
+
}
|
|
3788
|
+
return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
|
|
3789
|
+
}
|
|
3790
|
+
#endif
|
|
3791
|
+
|
|
3792
|
+
/* GetRuntimeVersion */
|
|
3793
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030b0000
|
|
3794
|
+
void __Pyx_init_runtime_version(void) {
|
|
3795
|
+
if (__Pyx_cached_runtime_version == 0) {
|
|
3796
|
+
const char* rt_version = Py_GetVersion();
|
|
3797
|
+
unsigned long version = 0;
|
|
3798
|
+
unsigned long factor = 0x01000000UL;
|
|
3799
|
+
unsigned int digit = 0;
|
|
3800
|
+
int i = 0;
|
|
3801
|
+
while (factor) {
|
|
3802
|
+
while ('0' <= rt_version[i] && rt_version[i] <= '9') {
|
|
3803
|
+
digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
|
|
3804
|
+
++i;
|
|
3805
|
+
}
|
|
3806
|
+
version += factor * digit;
|
|
3807
|
+
if (rt_version[i] != '.')
|
|
3808
|
+
break;
|
|
3809
|
+
digit = 0;
|
|
3810
|
+
factor >>= 8;
|
|
3811
|
+
++i;
|
|
3812
|
+
}
|
|
3813
|
+
__Pyx_cached_runtime_version = version;
|
|
3814
|
+
}
|
|
3815
|
+
}
|
|
3816
|
+
#endif
|
|
3817
|
+
static unsigned long __Pyx_get_runtime_version(void) {
|
|
3818
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
|
|
3819
|
+
return Py_Version & ~0xFFUL;
|
|
3820
|
+
#else
|
|
3821
|
+
return __Pyx_cached_runtime_version;
|
|
3822
|
+
#endif
|
|
3823
|
+
}
|
|
3824
|
+
|
|
3825
|
+
/* AddModuleRef */
|
|
3826
|
+
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
|
|
3827
|
+
static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
|
|
3828
|
+
PyObject *module_dict = PyImport_GetModuleDict();
|
|
3829
|
+
PyObject *m;
|
|
3830
|
+
if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
|
|
3831
|
+
return NULL;
|
|
3832
|
+
}
|
|
3833
|
+
if (m != NULL && PyModule_Check(m)) {
|
|
3834
|
+
return m;
|
|
3835
|
+
}
|
|
3836
|
+
Py_XDECREF(m);
|
|
3837
|
+
m = PyModule_NewObject(name);
|
|
3838
|
+
if (m == NULL)
|
|
3839
|
+
return NULL;
|
|
3840
|
+
if (PyDict_CheckExact(module_dict)) {
|
|
3841
|
+
PyObject *new_m;
|
|
3842
|
+
(void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
|
|
3843
|
+
Py_DECREF(m);
|
|
3844
|
+
return new_m;
|
|
3845
|
+
} else {
|
|
3846
|
+
if (PyObject_SetItem(module_dict, name, m) != 0) {
|
|
3847
|
+
Py_DECREF(m);
|
|
3848
|
+
return NULL;
|
|
3849
|
+
}
|
|
3850
|
+
return m;
|
|
3851
|
+
}
|
|
3852
|
+
}
|
|
3853
|
+
static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
|
|
3854
|
+
PyObject *py_name = PyUnicode_FromString(name);
|
|
3855
|
+
if (!py_name) return NULL;
|
|
3856
|
+
PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
|
|
3857
|
+
Py_DECREF(py_name);
|
|
3858
|
+
return module;
|
|
3859
|
+
}
|
|
3860
|
+
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
|
|
3861
|
+
#define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
|
|
3862
|
+
#else
|
|
3863
|
+
static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
|
|
3864
|
+
PyObject *module = PyImport_AddModule(name);
|
|
3865
|
+
Py_XINCREF(module);
|
|
3866
|
+
return module;
|
|
3867
|
+
}
|
|
3868
|
+
#endif
|
|
3869
|
+
|
|
3870
|
+
/* CheckBinaryVersion */
|
|
3871
|
+
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
|
|
3872
|
+
const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
|
|
3873
|
+
if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
|
|
3874
|
+
return 0;
|
|
3875
|
+
if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
|
|
3876
|
+
return 1;
|
|
3877
|
+
{
|
|
3878
|
+
char message[200];
|
|
3879
|
+
PyOS_snprintf(message, sizeof(message),
|
|
3880
|
+
"compile time Python version %d.%d "
|
|
3881
|
+
"of module '%.100s' "
|
|
3882
|
+
"%s "
|
|
3883
|
+
"runtime version %d.%d",
|
|
3884
|
+
(int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
|
|
3885
|
+
__Pyx_MODULE_NAME,
|
|
3886
|
+
(allow_newer) ? "was newer than" : "does not match",
|
|
3887
|
+
(int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
|
|
3888
|
+
);
|
|
3889
|
+
return PyErr_WarnEx(NULL, message, 1);
|
|
3890
|
+
}
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3893
|
+
/* DecompressString */
|
|
3894
|
+
static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
|
|
3895
|
+
PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
|
|
3896
|
+
const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
|
|
3897
|
+
PyObject *methodname = PyUnicode_FromString("decompress");
|
|
3898
|
+
if (unlikely(!methodname)) return NULL;
|
|
3899
|
+
#if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
|
|
3900
|
+
if (algo == 3) {
|
|
3901
|
+
PyObject *fromlist = Py_BuildValue("[O]", methodname);
|
|
3902
|
+
if (unlikely(!fromlist)) goto bad;
|
|
3903
|
+
module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
|
|
3904
|
+
Py_DECREF(fromlist);
|
|
3905
|
+
} else
|
|
3906
|
+
#endif
|
|
3907
|
+
module = PyImport_ImportModule(module_name);
|
|
3908
|
+
if (unlikely(!module)) goto import_failed;
|
|
3909
|
+
decompress = PyObject_GetAttr(module, methodname);
|
|
3910
|
+
if (unlikely(!decompress)) goto import_failed;
|
|
3911
|
+
{
|
|
3912
|
+
#ifdef __cplusplus
|
|
3913
|
+
char *memview_bytes = const_cast<char*>(s);
|
|
3914
|
+
#else
|
|
3915
|
+
#if defined(__clang__)
|
|
3916
|
+
#pragma clang diagnostic push
|
|
3917
|
+
#pragma clang diagnostic ignored "-Wcast-qual"
|
|
3918
|
+
#elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
|
|
3919
|
+
#pragma GCC diagnostic push
|
|
3920
|
+
#pragma GCC diagnostic ignored "-Wcast-qual"
|
|
3921
|
+
#endif
|
|
3922
|
+
char *memview_bytes = (char*) s;
|
|
3923
|
+
#if defined(__clang__)
|
|
3924
|
+
#pragma clang diagnostic pop
|
|
3925
|
+
#elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
|
|
3926
|
+
#pragma GCC diagnostic pop
|
|
3927
|
+
#endif
|
|
3928
|
+
#endif
|
|
3929
|
+
#if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
|
|
3930
|
+
int memview_flags = 0x100;
|
|
3931
|
+
#else
|
|
3932
|
+
int memview_flags = PyBUF_READ;
|
|
3933
|
+
#endif
|
|
3934
|
+
compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
|
|
3935
|
+
}
|
|
3936
|
+
if (unlikely(!compressed_bytes)) {
|
|
3937
|
+
Py_DECREF(decompress);
|
|
3938
|
+
goto bad;
|
|
3939
|
+
}
|
|
3940
|
+
decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
|
|
3941
|
+
Py_DECREF(compressed_bytes);
|
|
3942
|
+
Py_DECREF(decompress);
|
|
3943
|
+
Py_DECREF(module);
|
|
3944
|
+
Py_DECREF(methodname);
|
|
3945
|
+
return decompressed;
|
|
3946
|
+
import_failed:
|
|
3947
|
+
PyErr_Format(PyExc_ImportError,
|
|
3948
|
+
"Failed to import '%.20s.decompress' - cannot initialise module strings. "
|
|
3949
|
+
"String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
|
|
3950
|
+
module_name, algo);
|
|
3951
|
+
bad:
|
|
3952
|
+
Py_XDECREF(module);
|
|
3953
|
+
Py_DECREF(methodname);
|
|
3954
|
+
return NULL;
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3957
|
+
#include <string.h>
|
|
3958
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
|
|
3959
|
+
size_t len = strlen(s);
|
|
3960
|
+
if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
|
|
3961
|
+
PyErr_SetString(PyExc_OverflowError, "byte string is too long");
|
|
3962
|
+
return -1;
|
|
3963
|
+
}
|
|
3964
|
+
return (Py_ssize_t) len;
|
|
3965
|
+
}
|
|
3966
|
+
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
|
|
3967
|
+
Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
|
3968
|
+
if (unlikely(len < 0)) return NULL;
|
|
3969
|
+
return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
|
|
3970
|
+
}
|
|
3971
|
+
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
|
|
3972
|
+
Py_ssize_t len = __Pyx_ssize_strlen(c_str);
|
|
3973
|
+
if (unlikely(len < 0)) return NULL;
|
|
3974
|
+
return PyByteArray_FromStringAndSize(c_str, len);
|
|
3975
|
+
}
|
|
3976
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
|
|
3977
|
+
Py_ssize_t ignore;
|
|
3978
|
+
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
|
|
3979
|
+
}
|
|
3980
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
|
|
3981
|
+
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
|
3982
|
+
if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
|
|
3983
|
+
#if CYTHON_COMPILING_IN_LIMITED_API
|
|
3984
|
+
{
|
|
3985
|
+
const char* result;
|
|
3986
|
+
Py_ssize_t unicode_length;
|
|
3987
|
+
CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
3988
|
+
#if __PYX_LIMITED_VERSION_HEX < 0x030A0000
|
|
3989
|
+
if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
|
|
3990
|
+
#else
|
|
3991
|
+
result = PyUnicode_AsUTF8AndSize(o, length);
|
|
3992
|
+
#endif
|
|
3993
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
3994
|
+
unicode_length = PyUnicode_GetLength(o);
|
|
3995
|
+
if (unlikely(unicode_length < 0)) return NULL;
|
|
3996
|
+
if (unlikely(unicode_length != *length)) {
|
|
3997
|
+
PyUnicode_AsASCIIString(o);
|
|
3998
|
+
return NULL;
|
|
3999
|
+
}
|
|
4000
|
+
#endif
|
|
4001
|
+
return result;
|
|
4002
|
+
}
|
|
4003
|
+
#else
|
|
4004
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
|
4005
|
+
if (likely(PyUnicode_IS_ASCII(o))) {
|
|
4006
|
+
*length = PyUnicode_GET_LENGTH(o);
|
|
4007
|
+
return PyUnicode_AsUTF8(o);
|
|
4008
|
+
} else {
|
|
4009
|
+
PyUnicode_AsASCIIString(o);
|
|
4010
|
+
return NULL;
|
|
4011
|
+
}
|
|
4012
|
+
#else
|
|
4013
|
+
return PyUnicode_AsUTF8AndSize(o, length);
|
|
4014
|
+
#endif
|
|
4015
|
+
#endif
|
|
4016
|
+
}
|
|
4017
|
+
#endif
|
|
4018
|
+
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
|
4019
|
+
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
|
|
4020
|
+
if (PyUnicode_Check(o)) {
|
|
4021
|
+
return __Pyx_PyUnicode_AsStringAndSize(o, length);
|
|
4022
|
+
} else
|
|
4023
|
+
#endif
|
|
4024
|
+
if (PyByteArray_Check(o)) {
|
|
4025
|
+
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
|
|
4026
|
+
*length = PyByteArray_GET_SIZE(o);
|
|
4027
|
+
return PyByteArray_AS_STRING(o);
|
|
4028
|
+
#else
|
|
4029
|
+
*length = PyByteArray_Size(o);
|
|
4030
|
+
if (*length == -1) return NULL;
|
|
4031
|
+
return PyByteArray_AsString(o);
|
|
4032
|
+
#endif
|
|
4033
|
+
} else
|
|
4034
|
+
{
|
|
4035
|
+
char* result;
|
|
4036
|
+
int r = PyBytes_AsStringAndSize(o, &result, length);
|
|
4037
|
+
if (unlikely(r < 0)) {
|
|
4038
|
+
return NULL;
|
|
4039
|
+
} else {
|
|
4040
|
+
return result;
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
|
|
4045
|
+
int is_true = x == Py_True;
|
|
4046
|
+
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
|
|
4047
|
+
else return PyObject_IsTrue(x);
|
|
4048
|
+
}
|
|
4049
|
+
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
|
|
4050
|
+
int retval;
|
|
4051
|
+
if (unlikely(!x)) return -1;
|
|
4052
|
+
retval = __Pyx_PyObject_IsTrue(x);
|
|
4053
|
+
Py_DECREF(x);
|
|
4054
|
+
return retval;
|
|
4055
|
+
}
|
|
4056
|
+
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
|
|
4057
|
+
__Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
|
|
4058
|
+
if (PyLong_Check(result)) {
|
|
4059
|
+
if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
|
|
4060
|
+
"__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
|
|
4061
|
+
"The ability to return an instance of a strict subclass of int is deprecated, "
|
|
4062
|
+
"and may be removed in a future version of Python.",
|
|
4063
|
+
result_type_name)) {
|
|
4064
|
+
__Pyx_DECREF_TypeName(result_type_name);
|
|
4065
|
+
Py_DECREF(result);
|
|
4066
|
+
return NULL;
|
|
4067
|
+
}
|
|
4068
|
+
__Pyx_DECREF_TypeName(result_type_name);
|
|
4069
|
+
return result;
|
|
4070
|
+
}
|
|
4071
|
+
PyErr_Format(PyExc_TypeError,
|
|
4072
|
+
"__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
|
|
4073
|
+
result_type_name);
|
|
4074
|
+
__Pyx_DECREF_TypeName(result_type_name);
|
|
4075
|
+
Py_DECREF(result);
|
|
4076
|
+
return NULL;
|
|
4077
|
+
}
|
|
4078
|
+
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
|
|
4079
|
+
#if CYTHON_USE_TYPE_SLOTS
|
|
4080
|
+
PyNumberMethods *m;
|
|
4081
|
+
#endif
|
|
4082
|
+
PyObject *res = NULL;
|
|
4083
|
+
if (likely(PyLong_Check(x)))
|
|
4084
|
+
return __Pyx_NewRef(x);
|
|
4085
|
+
#if CYTHON_USE_TYPE_SLOTS
|
|
4086
|
+
m = Py_TYPE(x)->tp_as_number;
|
|
4087
|
+
if (likely(m && m->nb_int)) {
|
|
4088
|
+
res = m->nb_int(x);
|
|
4089
|
+
}
|
|
4090
|
+
#else
|
|
4091
|
+
if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
|
|
4092
|
+
res = PyNumber_Long(x);
|
|
4093
|
+
}
|
|
4094
|
+
#endif
|
|
4095
|
+
if (likely(res)) {
|
|
4096
|
+
if (unlikely(!PyLong_CheckExact(res))) {
|
|
4097
|
+
return __Pyx_PyNumber_LongWrongResultType(res);
|
|
4098
|
+
}
|
|
4099
|
+
}
|
|
4100
|
+
else if (!PyErr_Occurred()) {
|
|
4101
|
+
PyErr_SetString(PyExc_TypeError,
|
|
4102
|
+
"an integer is required");
|
|
4103
|
+
}
|
|
4104
|
+
return res;
|
|
4105
|
+
}
|
|
4106
|
+
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
|
|
4107
|
+
Py_ssize_t ival;
|
|
4108
|
+
PyObject *x;
|
|
4109
|
+
if (likely(PyLong_CheckExact(b))) {
|
|
4110
|
+
#if CYTHON_USE_PYLONG_INTERNALS
|
|
4111
|
+
if (likely(__Pyx_PyLong_IsCompact(b))) {
|
|
4112
|
+
return __Pyx_PyLong_CompactValue(b);
|
|
4113
|
+
} else {
|
|
4114
|
+
const digit* digits = __Pyx_PyLong_Digits(b);
|
|
4115
|
+
const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
|
|
4116
|
+
switch (size) {
|
|
4117
|
+
case 2:
|
|
4118
|
+
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
|
|
4119
|
+
return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
|
4120
|
+
}
|
|
4121
|
+
break;
|
|
4122
|
+
case -2:
|
|
4123
|
+
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
|
|
4124
|
+
return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
|
4125
|
+
}
|
|
4126
|
+
break;
|
|
4127
|
+
case 3:
|
|
4128
|
+
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
|
|
4129
|
+
return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
|
4130
|
+
}
|
|
4131
|
+
break;
|
|
4132
|
+
case -3:
|
|
4133
|
+
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
|
|
4134
|
+
return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
|
|
4135
|
+
}
|
|
4136
|
+
break;
|
|
4137
|
+
case 4:
|
|
4138
|
+
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
|
|
4139
|
+
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]));
|
|
4140
|
+
}
|
|
4141
|
+
break;
|
|
4142
|
+
case -4:
|
|
4143
|
+
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
|
|
4144
|
+
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]));
|
|
4145
|
+
}
|
|
4146
|
+
break;
|
|
4147
|
+
}
|
|
4148
|
+
}
|
|
4149
|
+
#endif
|
|
4150
|
+
return PyLong_AsSsize_t(b);
|
|
4151
|
+
}
|
|
4152
|
+
x = PyNumber_Index(b);
|
|
4153
|
+
if (!x) return -1;
|
|
4154
|
+
ival = PyLong_AsSsize_t(x);
|
|
4155
|
+
Py_DECREF(x);
|
|
4156
|
+
return ival;
|
|
4157
|
+
}
|
|
4158
|
+
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
|
|
4159
|
+
if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
|
|
4160
|
+
return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
|
|
4161
|
+
} else {
|
|
4162
|
+
Py_ssize_t ival;
|
|
4163
|
+
PyObject *x;
|
|
4164
|
+
x = PyNumber_Index(o);
|
|
4165
|
+
if (!x) return -1;
|
|
4166
|
+
ival = PyLong_AsLong(x);
|
|
4167
|
+
Py_DECREF(x);
|
|
4168
|
+
return ival;
|
|
4169
|
+
}
|
|
4170
|
+
}
|
|
4171
|
+
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
|
|
4172
|
+
CYTHON_UNUSED_VAR(b);
|
|
4173
|
+
return __Pyx_NewRef(Py_None);
|
|
4174
|
+
}
|
|
4175
|
+
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
|
|
4176
|
+
return __Pyx_NewRef(b ? Py_True: Py_False);
|
|
4177
|
+
}
|
|
4178
|
+
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
|
|
4179
|
+
return PyLong_FromSize_t(ival);
|
|
4180
|
+
}
|
|
4181
|
+
|
|
4182
|
+
|
|
4183
|
+
/* MultiPhaseInitModuleState */
|
|
4184
|
+
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
|
|
4185
|
+
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4186
|
+
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
|
|
4187
|
+
#define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
|
|
4188
|
+
#else
|
|
4189
|
+
#define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
|
|
4190
|
+
#endif
|
|
4191
|
+
#endif
|
|
4192
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
|
|
4193
|
+
#error "Module state with PEP489 requires atomics. Currently that's one of\
|
|
4194
|
+
C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
|
|
4195
|
+
#endif
|
|
4196
|
+
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4197
|
+
#define __Pyx_ModuleStateLookup_Lock()
|
|
4198
|
+
#define __Pyx_ModuleStateLookup_Unlock()
|
|
4199
|
+
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
|
|
4200
|
+
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
|
|
4201
|
+
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
|
|
4202
|
+
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
|
|
4203
|
+
#elif defined(__cplusplus) && __cplusplus >= 201103L
|
|
4204
|
+
#include <mutex>
|
|
4205
|
+
static std::mutex __Pyx_ModuleStateLookup_mutex;
|
|
4206
|
+
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
|
|
4207
|
+
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
|
|
4208
|
+
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
|
|
4209
|
+
#include <threads.h>
|
|
4210
|
+
static mtx_t __Pyx_ModuleStateLookup_mutex;
|
|
4211
|
+
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
|
|
4212
|
+
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
|
|
4213
|
+
mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
|
|
4214
|
+
}
|
|
4215
|
+
#define __Pyx_ModuleStateLookup_Lock()\
|
|
4216
|
+
call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
|
|
4217
|
+
mtx_lock(&__Pyx_ModuleStateLookup_mutex)
|
|
4218
|
+
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
|
|
4219
|
+
#elif defined(HAVE_PTHREAD_H)
|
|
4220
|
+
#include <pthread.h>
|
|
4221
|
+
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
|
|
4222
|
+
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
|
|
4223
|
+
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
|
|
4224
|
+
#elif defined(_WIN32)
|
|
4225
|
+
#include <Windows.h> // synchapi.h on its own doesn't work
|
|
4226
|
+
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
|
|
4227
|
+
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
|
|
4228
|
+
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
|
|
4229
|
+
#else
|
|
4230
|
+
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
|
|
4231
|
+
Requires C standard >= C11, or C++ standard >= C++11,\
|
|
4232
|
+
or pthreads, or the Windows 32 API, or Python >= 3.13."
|
|
4233
|
+
#endif
|
|
4234
|
+
typedef struct {
|
|
4235
|
+
int64_t id;
|
|
4236
|
+
PyObject *module;
|
|
4237
|
+
} __Pyx_InterpreterIdAndModule;
|
|
4238
|
+
typedef struct {
|
|
4239
|
+
char interpreter_id_as_index;
|
|
4240
|
+
Py_ssize_t count;
|
|
4241
|
+
Py_ssize_t allocated;
|
|
4242
|
+
__Pyx_InterpreterIdAndModule table[1];
|
|
4243
|
+
} __Pyx_ModuleStateLookupData;
|
|
4244
|
+
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
|
|
4245
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4246
|
+
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
|
|
4247
|
+
#endif
|
|
4248
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4249
|
+
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
|
|
4250
|
+
#else
|
|
4251
|
+
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
|
|
4252
|
+
#endif
|
|
4253
|
+
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
|
|
4254
|
+
__Pyx_InterpreterIdAndModule* table,
|
|
4255
|
+
Py_ssize_t count,
|
|
4256
|
+
int64_t interpreterId) {
|
|
4257
|
+
__Pyx_InterpreterIdAndModule* begin = table;
|
|
4258
|
+
__Pyx_InterpreterIdAndModule* end = begin + count;
|
|
4259
|
+
if (begin->id == interpreterId) {
|
|
4260
|
+
return begin;
|
|
4261
|
+
}
|
|
4262
|
+
while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
|
|
4263
|
+
__Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
|
|
4264
|
+
if (halfway->id == interpreterId) {
|
|
4265
|
+
return halfway;
|
|
4266
|
+
}
|
|
4267
|
+
if (halfway->id < interpreterId) {
|
|
4268
|
+
begin = halfway;
|
|
4269
|
+
} else {
|
|
4270
|
+
end = halfway;
|
|
4271
|
+
}
|
|
4272
|
+
}
|
|
4273
|
+
for (; begin < end; ++begin) {
|
|
4274
|
+
if (begin->id >= interpreterId) return begin;
|
|
4275
|
+
}
|
|
4276
|
+
return begin;
|
|
4277
|
+
}
|
|
4278
|
+
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
|
|
4279
|
+
int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
|
|
4280
|
+
if (interpreter_id == -1) return NULL;
|
|
4281
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4282
|
+
__Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
|
|
4283
|
+
{
|
|
4284
|
+
__pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
|
|
4285
|
+
if (likely(data)) {
|
|
4286
|
+
__Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
|
|
4287
|
+
if (likely(data == new_data)) {
|
|
4288
|
+
goto read_finished;
|
|
4289
|
+
}
|
|
4290
|
+
}
|
|
4291
|
+
__pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
|
|
4292
|
+
__Pyx_ModuleStateLookup_Lock();
|
|
4293
|
+
__pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
|
|
4294
|
+
data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
|
|
4295
|
+
__Pyx_ModuleStateLookup_Unlock();
|
|
4296
|
+
}
|
|
4297
|
+
read_finished:;
|
|
4298
|
+
#else
|
|
4299
|
+
__Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
|
|
4300
|
+
#endif
|
|
4301
|
+
__Pyx_InterpreterIdAndModule* found = NULL;
|
|
4302
|
+
if (unlikely(!data)) goto end;
|
|
4303
|
+
if (data->interpreter_id_as_index) {
|
|
4304
|
+
if (interpreter_id < data->count) {
|
|
4305
|
+
found = data->table+interpreter_id;
|
|
4306
|
+
}
|
|
4307
|
+
} else {
|
|
4308
|
+
found = __Pyx_State_FindModuleStateLookupTableLowerBound(
|
|
4309
|
+
data->table, data->count, interpreter_id);
|
|
4310
|
+
}
|
|
4311
|
+
end:
|
|
4312
|
+
{
|
|
4313
|
+
PyObject *result=NULL;
|
|
4314
|
+
if (found && found->id == interpreter_id) {
|
|
4315
|
+
result = found->module;
|
|
4316
|
+
}
|
|
4317
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4318
|
+
__pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
|
|
4319
|
+
#endif
|
|
4320
|
+
return result;
|
|
4321
|
+
}
|
|
4322
|
+
}
|
|
4323
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4324
|
+
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
|
|
4325
|
+
while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
|
|
4326
|
+
}
|
|
4327
|
+
#else
|
|
4328
|
+
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
|
|
4329
|
+
#endif
|
|
4330
|
+
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
|
|
4331
|
+
Py_ssize_t to_allocate = (*old_data)->allocated;
|
|
4332
|
+
while (to_allocate <= interpreter_id) {
|
|
4333
|
+
if (to_allocate == 0) to_allocate = 1;
|
|
4334
|
+
else to_allocate *= 2;
|
|
4335
|
+
}
|
|
4336
|
+
__Pyx_ModuleStateLookupData *new_data = *old_data;
|
|
4337
|
+
if (to_allocate != (*old_data)->allocated) {
|
|
4338
|
+
new_data = (__Pyx_ModuleStateLookupData *)realloc(
|
|
4339
|
+
*old_data,
|
|
4340
|
+
sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
|
|
4341
|
+
if (!new_data) {
|
|
4342
|
+
PyErr_NoMemory();
|
|
4343
|
+
return -1;
|
|
4344
|
+
}
|
|
4345
|
+
for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
|
|
4346
|
+
new_data->table[i].id = i;
|
|
4347
|
+
new_data->table[i].module = NULL;
|
|
4348
|
+
}
|
|
4349
|
+
new_data->allocated = to_allocate;
|
|
4350
|
+
}
|
|
4351
|
+
new_data->table[interpreter_id].module = module;
|
|
4352
|
+
if (new_data->count < interpreter_id+1) {
|
|
4353
|
+
new_data->count = interpreter_id+1;
|
|
4354
|
+
}
|
|
4355
|
+
*old_data = new_data;
|
|
4356
|
+
return 0;
|
|
4357
|
+
}
|
|
4358
|
+
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
|
|
4359
|
+
__Pyx_InterpreterIdAndModule *read = data->table;
|
|
4360
|
+
__Pyx_InterpreterIdAndModule *write = data->table;
|
|
4361
|
+
__Pyx_InterpreterIdAndModule *end = read + data->count;
|
|
4362
|
+
for (; read<end; ++read) {
|
|
4363
|
+
if (read->module) {
|
|
4364
|
+
write->id = read->id;
|
|
4365
|
+
write->module = read->module;
|
|
4366
|
+
++write;
|
|
4367
|
+
}
|
|
4368
|
+
}
|
|
4369
|
+
data->count = write - data->table;
|
|
4370
|
+
for (; write<end; ++write) {
|
|
4371
|
+
write->id = 0;
|
|
4372
|
+
write->module = NULL;
|
|
4373
|
+
}
|
|
4374
|
+
data->interpreter_id_as_index = 0;
|
|
4375
|
+
}
|
|
4376
|
+
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
|
|
4377
|
+
int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
|
|
4378
|
+
if (interpreter_id == -1) return -1;
|
|
4379
|
+
int result = 0;
|
|
4380
|
+
__Pyx_ModuleStateLookup_Lock();
|
|
4381
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4382
|
+
__Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
|
|
4383
|
+
__pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
|
|
4384
|
+
#else
|
|
4385
|
+
__Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
|
|
4386
|
+
#endif
|
|
4387
|
+
__Pyx_ModuleStateLookupData *new_data = old_data;
|
|
4388
|
+
if (!new_data) {
|
|
4389
|
+
new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
|
|
4390
|
+
if (!new_data) {
|
|
4391
|
+
result = -1;
|
|
4392
|
+
PyErr_NoMemory();
|
|
4393
|
+
goto end;
|
|
4394
|
+
}
|
|
4395
|
+
new_data->allocated = 1;
|
|
4396
|
+
new_data->interpreter_id_as_index = 1;
|
|
4397
|
+
}
|
|
4398
|
+
__Pyx_ModuleStateLookup_wait_until_no_readers();
|
|
4399
|
+
if (new_data->interpreter_id_as_index) {
|
|
4400
|
+
if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
|
|
4401
|
+
result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
|
|
4402
|
+
goto end;
|
|
4403
|
+
}
|
|
4404
|
+
__Pyx_State_ConvertFromInterpIdAsIndex(new_data);
|
|
4405
|
+
}
|
|
4406
|
+
{
|
|
4407
|
+
Py_ssize_t insert_at = 0;
|
|
4408
|
+
{
|
|
4409
|
+
__Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
|
|
4410
|
+
new_data->table, new_data->count, interpreter_id);
|
|
4411
|
+
assert(lower_bound);
|
|
4412
|
+
insert_at = lower_bound - new_data->table;
|
|
4413
|
+
if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
|
|
4414
|
+
lower_bound->module = module;
|
|
4415
|
+
goto end; // already in table, nothing more to do
|
|
4416
|
+
}
|
|
4417
|
+
}
|
|
4418
|
+
if (new_data->count+1 >= new_data->allocated) {
|
|
4419
|
+
Py_ssize_t to_allocate = (new_data->count+1)*2;
|
|
4420
|
+
new_data =
|
|
4421
|
+
(__Pyx_ModuleStateLookupData*)realloc(
|
|
4422
|
+
new_data,
|
|
4423
|
+
sizeof(__Pyx_ModuleStateLookupData) +
|
|
4424
|
+
(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
|
|
4425
|
+
if (!new_data) {
|
|
4426
|
+
result = -1;
|
|
4427
|
+
new_data = old_data;
|
|
4428
|
+
PyErr_NoMemory();
|
|
4429
|
+
goto end;
|
|
4430
|
+
}
|
|
4431
|
+
new_data->allocated = to_allocate;
|
|
4432
|
+
}
|
|
4433
|
+
++new_data->count;
|
|
4434
|
+
int64_t last_id = interpreter_id;
|
|
4435
|
+
PyObject *last_module = module;
|
|
4436
|
+
for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
|
|
4437
|
+
int64_t current_id = new_data->table[i].id;
|
|
4438
|
+
new_data->table[i].id = last_id;
|
|
4439
|
+
last_id = current_id;
|
|
4440
|
+
PyObject *current_module = new_data->table[i].module;
|
|
4441
|
+
new_data->table[i].module = last_module;
|
|
4442
|
+
last_module = current_module;
|
|
4443
|
+
}
|
|
4444
|
+
}
|
|
4445
|
+
end:
|
|
4446
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4447
|
+
__pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
|
|
4448
|
+
#else
|
|
4449
|
+
__Pyx_ModuleStateLookup_data = new_data;
|
|
4450
|
+
#endif
|
|
4451
|
+
__Pyx_ModuleStateLookup_Unlock();
|
|
4452
|
+
return result;
|
|
4453
|
+
}
|
|
4454
|
+
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
|
|
4455
|
+
int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
|
|
4456
|
+
if (interpreter_id == -1) return -1;
|
|
4457
|
+
__Pyx_ModuleStateLookup_Lock();
|
|
4458
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4459
|
+
__Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
|
|
4460
|
+
__pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
|
|
4461
|
+
#else
|
|
4462
|
+
__Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
|
|
4463
|
+
#endif
|
|
4464
|
+
if (data->interpreter_id_as_index) {
|
|
4465
|
+
if (interpreter_id < data->count) {
|
|
4466
|
+
data->table[interpreter_id].module = NULL;
|
|
4467
|
+
}
|
|
4468
|
+
goto done;
|
|
4469
|
+
}
|
|
4470
|
+
{
|
|
4471
|
+
__Pyx_ModuleStateLookup_wait_until_no_readers();
|
|
4472
|
+
__Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
|
|
4473
|
+
data->table, data->count, interpreter_id);
|
|
4474
|
+
if (!lower_bound) goto done;
|
|
4475
|
+
if (lower_bound->id != interpreter_id) goto done;
|
|
4476
|
+
__Pyx_InterpreterIdAndModule *end = data->table+data->count;
|
|
4477
|
+
for (;lower_bound<end-1; ++lower_bound) {
|
|
4478
|
+
lower_bound->id = (lower_bound+1)->id;
|
|
4479
|
+
lower_bound->module = (lower_bound+1)->module;
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
--data->count;
|
|
4483
|
+
if (data->count == 0) {
|
|
4484
|
+
free(data);
|
|
4485
|
+
data = NULL;
|
|
4486
|
+
}
|
|
4487
|
+
done:
|
|
4488
|
+
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
|
|
4489
|
+
__pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
|
|
4490
|
+
#else
|
|
4491
|
+
__Pyx_ModuleStateLookup_data = data;
|
|
4492
|
+
#endif
|
|
4493
|
+
__Pyx_ModuleStateLookup_Unlock();
|
|
4494
|
+
return 0;
|
|
4495
|
+
}
|
|
4496
|
+
#endif
|
|
4497
|
+
|
|
4498
|
+
/* #### Code section: utility_code_pragmas_end ### */
|
|
4499
|
+
#ifdef _MSC_VER
|
|
4500
|
+
#pragma warning( pop )
|
|
4501
|
+
#endif
|
|
4502
|
+
|
|
4503
|
+
|
|
4504
|
+
|
|
4505
|
+
/* #### Code section: end ### */
|
|
4506
|
+
#endif /* Py_PYTHON_H */
|