1 /* Generated by Cython 0.29.23 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [
7 "gssapi/raw/python_gssapi.h",
8 "gssapi/raw/python_gssapi_ext.h"
9 ],
10 "extra_compile_args": [
11 "-DHAS_GSSAPI_EXT_H"
12 ],
13 "extra_link_args": [
14 "-Wl,-z,relro",
15 "-Wl,--as-needed",
16 "-Wl,-z,now"
17 ],
18 "include_dirs": [
19 "gssapi/raw",
20 "./gssapi/raw"
21 ],
22 "libraries": [
23 "gssapi_krb5",
24 "krb5",
25 "k5crypto",
26 "com_err"
27 ],
28 "name": "gssapi.raw.ext_dce",
29 "sources": [
30 "gssapi/raw/ext_dce.pyx"
31 ]
32 },
33 "module_name": "gssapi.raw.ext_dce"
34 }
35 END: Cython Metadata */
36
37 #ifndef PY_SSIZE_T_CLEAN
38 #define PY_SSIZE_T_CLEAN
39 #endif /* PY_SSIZE_T_CLEAN */
40 #include "Python.h"
41 #ifndef Py_PYTHON_H
42 #error Python headers needed to compile C extensions, please install development version of Python.
43 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
44 #error Cython requires Python 2.6+ or Python 3.3+.
45 #else
46 #define CYTHON_ABI "0_29_23"
47 #define CYTHON_HEX_VERSION 0x001D17F0
48 #define CYTHON_FUTURE_DIVISION 0
49 #include <stddef.h>
50 #ifndef offsetof
51 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
52 #endif
53 #if !defined(WIN32) && !defined(MS_WINDOWS)
54 #ifndef __stdcall
55 #define __stdcall
56 #endif
57 #ifndef __cdecl
58 #define __cdecl
59 #endif
60 #ifndef __fastcall
61 #define __fastcall
62 #endif
63 #endif
64 #ifndef DL_IMPORT
65 #define DL_IMPORT(t) t
66 #endif
67 #ifndef DL_EXPORT
68 #define DL_EXPORT(t) t
69 #endif
70 #define __PYX_COMMA ,
71 #ifndef HAVE_LONG_LONG
72 #if PY_VERSION_HEX >= 0x02070000
73 #define HAVE_LONG_LONG
74 #endif
75 #endif
76 #ifndef PY_LONG_LONG
77 #define PY_LONG_LONG LONG_LONG
78 #endif
79 #ifndef Py_HUGE_VAL
80 #define Py_HUGE_VAL HUGE_VAL
81 #endif
82 #ifdef PYPY_VERSION
83 #define CYTHON_COMPILING_IN_PYPY 1
84 #define CYTHON_COMPILING_IN_PYSTON 0
85 #define CYTHON_COMPILING_IN_CPYTHON 0
86 #undef CYTHON_USE_TYPE_SLOTS
87 #define CYTHON_USE_TYPE_SLOTS 0
88 #undef CYTHON_USE_PYTYPE_LOOKUP
89 #define CYTHON_USE_PYTYPE_LOOKUP 0
90 #if PY_VERSION_HEX < 0x03050000
91 #undef CYTHON_USE_ASYNC_SLOTS
92 #define CYTHON_USE_ASYNC_SLOTS 0
93 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
94 #define CYTHON_USE_ASYNC_SLOTS 1
95 #endif
96 #undef CYTHON_USE_PYLIST_INTERNALS
97 #define CYTHON_USE_PYLIST_INTERNALS 0
98 #undef CYTHON_USE_UNICODE_INTERNALS
99 #define CYTHON_USE_UNICODE_INTERNALS 0
100 #undef CYTHON_USE_UNICODE_WRITER
101 #define CYTHON_USE_UNICODE_WRITER 0
102 #undef CYTHON_USE_PYLONG_INTERNALS
103 #define CYTHON_USE_PYLONG_INTERNALS 0
104 #undef CYTHON_AVOID_BORROWED_REFS
105 #define CYTHON_AVOID_BORROWED_REFS 1
106 #undef CYTHON_ASSUME_SAFE_MACROS
107 #define CYTHON_ASSUME_SAFE_MACROS 0
108 #undef CYTHON_UNPACK_METHODS
109 #define CYTHON_UNPACK_METHODS 0
110 #undef CYTHON_FAST_THREAD_STATE
111 #define CYTHON_FAST_THREAD_STATE 0
112 #undef CYTHON_FAST_PYCALL
113 #define CYTHON_FAST_PYCALL 0
114 #undef CYTHON_PEP489_MULTI_PHASE_INIT
115 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116 #undef CYTHON_USE_TP_FINALIZE
117 #define CYTHON_USE_TP_FINALIZE 0
118 #undef CYTHON_USE_DICT_VERSIONS
119 #define CYTHON_USE_DICT_VERSIONS 0
120 #undef CYTHON_USE_EXC_INFO_STACK
121 #define CYTHON_USE_EXC_INFO_STACK 0
122 #elif defined(PYSTON_VERSION)
123 #define CYTHON_COMPILING_IN_PYPY 0
124 #define CYTHON_COMPILING_IN_PYSTON 1
125 #define CYTHON_COMPILING_IN_CPYTHON 0
126 #ifndef CYTHON_USE_TYPE_SLOTS
127 #define CYTHON_USE_TYPE_SLOTS 1
128 #endif
129 #undef CYTHON_USE_PYTYPE_LOOKUP
130 #define CYTHON_USE_PYTYPE_LOOKUP 0
131 #undef CYTHON_USE_ASYNC_SLOTS
132 #define CYTHON_USE_ASYNC_SLOTS 0
133 #undef CYTHON_USE_PYLIST_INTERNALS
134 #define CYTHON_USE_PYLIST_INTERNALS 0
135 #ifndef CYTHON_USE_UNICODE_INTERNALS
136 #define CYTHON_USE_UNICODE_INTERNALS 1
137 #endif
138 #undef CYTHON_USE_UNICODE_WRITER
139 #define CYTHON_USE_UNICODE_WRITER 0
140 #undef CYTHON_USE_PYLONG_INTERNALS
141 #define CYTHON_USE_PYLONG_INTERNALS 0
142 #ifndef CYTHON_AVOID_BORROWED_REFS
143 #define CYTHON_AVOID_BORROWED_REFS 0
144 #endif
145 #ifndef CYTHON_ASSUME_SAFE_MACROS
146 #define CYTHON_ASSUME_SAFE_MACROS 1
147 #endif
148 #ifndef CYTHON_UNPACK_METHODS
149 #define CYTHON_UNPACK_METHODS 1
150 #endif
151 #undef CYTHON_FAST_THREAD_STATE
152 #define CYTHON_FAST_THREAD_STATE 0
153 #undef CYTHON_FAST_PYCALL
154 #define CYTHON_FAST_PYCALL 0
155 #undef CYTHON_PEP489_MULTI_PHASE_INIT
156 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
157 #undef CYTHON_USE_TP_FINALIZE
158 #define CYTHON_USE_TP_FINALIZE 0
159 #undef CYTHON_USE_DICT_VERSIONS
160 #define CYTHON_USE_DICT_VERSIONS 0
161 #undef CYTHON_USE_EXC_INFO_STACK
162 #define CYTHON_USE_EXC_INFO_STACK 0
163 #else
164 #define CYTHON_COMPILING_IN_PYPY 0
165 #define CYTHON_COMPILING_IN_PYSTON 0
166 #define CYTHON_COMPILING_IN_CPYTHON 1
167 #ifndef CYTHON_USE_TYPE_SLOTS
168 #define CYTHON_USE_TYPE_SLOTS 1
169 #endif
170 #if PY_VERSION_HEX < 0x02070000
171 #undef CYTHON_USE_PYTYPE_LOOKUP
172 #define CYTHON_USE_PYTYPE_LOOKUP 0
173 #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
174 #define CYTHON_USE_PYTYPE_LOOKUP 1
175 #endif
176 #if PY_MAJOR_VERSION < 3
177 #undef CYTHON_USE_ASYNC_SLOTS
178 #define CYTHON_USE_ASYNC_SLOTS 0
179 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
180 #define CYTHON_USE_ASYNC_SLOTS 1
181 #endif
182 #if PY_VERSION_HEX < 0x02070000
183 #undef CYTHON_USE_PYLONG_INTERNALS
184 #define CYTHON_USE_PYLONG_INTERNALS 0
185 #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
186 #define CYTHON_USE_PYLONG_INTERNALS 1
187 #endif
188 #ifndef CYTHON_USE_PYLIST_INTERNALS
189 #define CYTHON_USE_PYLIST_INTERNALS 1
190 #endif
191 #ifndef CYTHON_USE_UNICODE_INTERNALS
192 #define CYTHON_USE_UNICODE_INTERNALS 1
193 #endif
194 #if PY_VERSION_HEX < 0x030300F0
195 #undef CYTHON_USE_UNICODE_WRITER
196 #define CYTHON_USE_UNICODE_WRITER 0
197 #elif !defined(CYTHON_USE_UNICODE_WRITER)
198 #define CYTHON_USE_UNICODE_WRITER 1
199 #endif
200 #ifndef CYTHON_AVOID_BORROWED_REFS
201 #define CYTHON_AVOID_BORROWED_REFS 0
202 #endif
203 #ifndef CYTHON_ASSUME_SAFE_MACROS
204 #define CYTHON_ASSUME_SAFE_MACROS 1
205 #endif
206 #ifndef CYTHON_UNPACK_METHODS
207 #define CYTHON_UNPACK_METHODS 1
208 #endif
209 #ifndef CYTHON_FAST_THREAD_STATE
210 #define CYTHON_FAST_THREAD_STATE 1
211 #endif
212 #ifndef CYTHON_FAST_PYCALL
213 #define CYTHON_FAST_PYCALL 1
214 #endif
215 #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
216 #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
217 #endif
218 #ifndef CYTHON_USE_TP_FINALIZE
219 #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
220 #endif
221 #ifndef CYTHON_USE_DICT_VERSIONS
222 #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
223 #endif
224 #ifndef CYTHON_USE_EXC_INFO_STACK
225 #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
226 #endif
227 #endif
228 #if !defined(CYTHON_FAST_PYCCALL)
229 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
230 #endif
231 #if CYTHON_USE_PYLONG_INTERNALS
232 #include "longintrepr.h"
233 #undef SHIFT
234 #undef BASE
235 #undef MASK
236 #ifdef SIZEOF_VOID_P
237 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
238 #endif
239 #endif
240 #ifndef __has_attribute
241 #define __has_attribute(x) 0
242 #endif
243 #ifndef __has_cpp_attribute
244 #define __has_cpp_attribute(x) 0
245 #endif
246 #ifndef CYTHON_RESTRICT
247 #if defined(__GNUC__)
248 #define CYTHON_RESTRICT __restrict__
249 #elif defined(_MSC_VER) && _MSC_VER >= 1400
250 #define CYTHON_RESTRICT __restrict
251 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
252 #define CYTHON_RESTRICT restrict
253 #else
254 #define CYTHON_RESTRICT
255 #endif
256 #endif
257 #ifndef CYTHON_UNUSED
258 # if defined(__GNUC__)
259 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
260 # define CYTHON_UNUSED __attribute__ ((__unused__))
261 # else
262 # define CYTHON_UNUSED
263 # endif
264 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
265 # define CYTHON_UNUSED __attribute__ ((__unused__))
266 # else
267 # define CYTHON_UNUSED
268 # endif
269 #endif
270 #ifndef CYTHON_MAYBE_UNUSED_VAR
271 # if defined(__cplusplus)
CYTHON_MAYBE_UNUSED_VAR(const T &)272 template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
273 # else
274 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
275 # endif
276 #endif
277 #ifndef CYTHON_NCP_UNUSED
278 # if CYTHON_COMPILING_IN_CPYTHON
279 # define CYTHON_NCP_UNUSED
280 # else
281 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
282 # endif
283 #endif
284 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
285 #ifdef _MSC_VER
286 #ifndef _MSC_STDINT_H_
287 #if _MSC_VER < 1300
288 typedef unsigned char uint8_t;
289 typedef unsigned int uint32_t;
290 #else
291 typedef unsigned __int8 uint8_t;
292 typedef unsigned __int32 uint32_t;
293 #endif
294 #endif
295 #else
296 #include <stdint.h>
297 #endif
298 #ifndef CYTHON_FALLTHROUGH
299 #if defined(__cplusplus) && __cplusplus >= 201103L
300 #if __has_cpp_attribute(fallthrough)
301 #define CYTHON_FALLTHROUGH [[fallthrough]]
302 #elif __has_cpp_attribute(clang::fallthrough)
303 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
304 #elif __has_cpp_attribute(gnu::fallthrough)
305 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
306 #endif
307 #endif
308 #ifndef CYTHON_FALLTHROUGH
309 #if __has_attribute(fallthrough)
310 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
311 #else
312 #define CYTHON_FALLTHROUGH
313 #endif
314 #endif
315 #if defined(__clang__ ) && defined(__apple_build_version__)
316 #if __apple_build_version__ < 7000000
317 #undef CYTHON_FALLTHROUGH
318 #define CYTHON_FALLTHROUGH
319 #endif
320 #endif
321 #endif
322
323 #ifndef CYTHON_INLINE
324 #if defined(__clang__)
325 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
326 #elif defined(__GNUC__)
327 #define CYTHON_INLINE __inline__
328 #elif defined(_MSC_VER)
329 #define CYTHON_INLINE __inline
330 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
331 #define CYTHON_INLINE inline
332 #else
333 #define CYTHON_INLINE
334 #endif
335 #endif
336
337 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
338 #define Py_OptimizeFlag 0
339 #endif
340 #define __PYX_BUILD_PY_SSIZE_T "n"
341 #define CYTHON_FORMAT_SSIZE_T "z"
342 #if PY_MAJOR_VERSION < 3
343 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
344 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
345 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
346 #define __Pyx_DefaultClassType PyClass_Type
347 #else
348 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
349 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
350 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
351 PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
352 #else
353 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
354 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
355 #endif
356 #define __Pyx_DefaultClassType PyType_Type
357 #endif
358 #ifndef Py_TPFLAGS_CHECKTYPES
359 #define Py_TPFLAGS_CHECKTYPES 0
360 #endif
361 #ifndef Py_TPFLAGS_HAVE_INDEX
362 #define Py_TPFLAGS_HAVE_INDEX 0
363 #endif
364 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
365 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
366 #endif
367 #ifndef Py_TPFLAGS_HAVE_FINALIZE
368 #define Py_TPFLAGS_HAVE_FINALIZE 0
369 #endif
370 #ifndef METH_STACKLESS
371 #define METH_STACKLESS 0
372 #endif
373 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
374 #ifndef METH_FASTCALL
375 #define METH_FASTCALL 0x80
376 #endif
377 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
378 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
379 Py_ssize_t nargs, PyObject *kwnames);
380 #else
381 #define __Pyx_PyCFunctionFast _PyCFunctionFast
382 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
383 #endif
384 #if CYTHON_FAST_PYCCALL
385 #define __Pyx_PyFastCFunction_Check(func)\
386 ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
387 #else
388 #define __Pyx_PyFastCFunction_Check(func) 0
389 #endif
390 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
391 #define PyObject_Malloc(s) PyMem_Malloc(s)
392 #define PyObject_Free(p) PyMem_Free(p)
393 #define PyObject_Realloc(p) PyMem_Realloc(p)
394 #endif
395 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
396 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
397 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
398 #define PyMem_RawFree(p) PyMem_Free(p)
399 #endif
400 #if CYTHON_COMPILING_IN_PYSTON
401 #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
402 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
403 #else
404 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
405 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
406 #endif
407 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
408 #define __Pyx_PyThreadState_Current PyThreadState_GET()
409 #elif PY_VERSION_HEX >= 0x03060000
410 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
411 #elif PY_VERSION_HEX >= 0x03000000
412 #define __Pyx_PyThreadState_Current PyThreadState_GET()
413 #else
414 #define __Pyx_PyThreadState_Current _PyThreadState_Current
415 #endif
416 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
417 #include "pythread.h"
418 #define Py_tss_NEEDS_INIT 0
419 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)420 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
421 *key = PyThread_create_key();
422 return 0;
423 }
PyThread_tss_alloc(void)424 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
425 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
426 *key = Py_tss_NEEDS_INIT;
427 return key;
428 }
PyThread_tss_free(Py_tss_t * key)429 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
430 PyObject_Free(key);
431 }
PyThread_tss_is_created(Py_tss_t * key)432 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
433 return *key != Py_tss_NEEDS_INIT;
434 }
PyThread_tss_delete(Py_tss_t * key)435 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
436 PyThread_delete_key(*key);
437 *key = Py_tss_NEEDS_INIT;
438 }
PyThread_tss_set(Py_tss_t * key,void * value)439 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
440 return PyThread_set_key_value(*key, value);
441 }
PyThread_tss_get(Py_tss_t * key)442 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
443 return PyThread_get_key_value(*key);
444 }
445 #endif
446 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
447 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
448 #else
449 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
450 #endif
451 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
452 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
453 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
454 #else
455 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
456 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
457 #endif
458 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
459 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
460 #else
461 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
462 #endif
463 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
464 #define CYTHON_PEP393_ENABLED 1
465 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
466 0 : _PyUnicode_Ready((PyObject *)(op)))
467 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
468 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
469 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
470 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
471 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
472 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
473 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
474 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
475 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
476 #else
477 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
478 #endif
479 #else
480 #define CYTHON_PEP393_ENABLED 0
481 #define PyUnicode_1BYTE_KIND 1
482 #define PyUnicode_2BYTE_KIND 2
483 #define PyUnicode_4BYTE_KIND 4
484 #define __Pyx_PyUnicode_READY(op) (0)
485 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
486 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
487 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
488 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
489 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
490 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
491 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
492 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
493 #endif
494 #if CYTHON_COMPILING_IN_PYPY
495 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
496 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
497 #else
498 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
499 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
500 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
501 #endif
502 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
503 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
504 #endif
505 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
506 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
507 #endif
508 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
509 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
510 #endif
511 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
512 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
513 #if PY_MAJOR_VERSION >= 3
514 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
515 #else
516 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
517 #endif
518 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
519 #define PyObject_ASCII(o) PyObject_Repr(o)
520 #endif
521 #if PY_MAJOR_VERSION >= 3
522 #define PyBaseString_Type PyUnicode_Type
523 #define PyStringObject PyUnicodeObject
524 #define PyString_Type PyUnicode_Type
525 #define PyString_Check PyUnicode_Check
526 #define PyString_CheckExact PyUnicode_CheckExact
527 #ifndef PyObject_Unicode
528 #define PyObject_Unicode PyObject_Str
529 #endif
530 #endif
531 #if PY_MAJOR_VERSION >= 3
532 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
533 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
534 #else
535 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
536 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
537 #endif
538 #ifndef PySet_CheckExact
539 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
540 #endif
541 #if PY_VERSION_HEX >= 0x030900A4
542 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
543 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
544 #else
545 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
546 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
547 #endif
548 #if CYTHON_ASSUME_SAFE_MACROS
549 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
550 #else
551 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
552 #endif
553 #if PY_MAJOR_VERSION >= 3
554 #define PyIntObject PyLongObject
555 #define PyInt_Type PyLong_Type
556 #define PyInt_Check(op) PyLong_Check(op)
557 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
558 #define PyInt_FromString PyLong_FromString
559 #define PyInt_FromUnicode PyLong_FromUnicode
560 #define PyInt_FromLong PyLong_FromLong
561 #define PyInt_FromSize_t PyLong_FromSize_t
562 #define PyInt_FromSsize_t PyLong_FromSsize_t
563 #define PyInt_AsLong PyLong_AsLong
564 #define PyInt_AS_LONG PyLong_AS_LONG
565 #define PyInt_AsSsize_t PyLong_AsSsize_t
566 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
567 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
568 #define PyNumber_Int PyNumber_Long
569 #endif
570 #if PY_MAJOR_VERSION >= 3
571 #define PyBoolObject PyLongObject
572 #endif
573 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
574 #ifndef PyUnicode_InternFromString
575 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
576 #endif
577 #endif
578 #if PY_VERSION_HEX < 0x030200A4
579 typedef long Py_hash_t;
580 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
581 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
582 #else
583 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
584 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
585 #endif
586 #if PY_MAJOR_VERSION >= 3
587 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
588 #else
589 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
590 #endif
591 #if CYTHON_USE_ASYNC_SLOTS
592 #if PY_VERSION_HEX >= 0x030500B1
593 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
594 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
595 #else
596 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
597 #endif
598 #else
599 #define __Pyx_PyType_AsAsync(obj) NULL
600 #endif
601 #ifndef __Pyx_PyAsyncMethodsStruct
602 typedef struct {
603 unaryfunc am_await;
604 unaryfunc am_aiter;
605 unaryfunc am_anext;
606 } __Pyx_PyAsyncMethodsStruct;
607 #endif
608
609 #if defined(WIN32) || defined(MS_WINDOWS)
610 #define _USE_MATH_DEFINES
611 #endif
612 #include <math.h>
613 #ifdef NAN
614 #define __PYX_NAN() ((float) NAN)
615 #else
__PYX_NAN()616 static CYTHON_INLINE float __PYX_NAN() {
617 float value;
618 memset(&value, 0xFF, sizeof(value));
619 return value;
620 }
621 #endif
622 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
623 #define __Pyx_truncl trunc
624 #else
625 #define __Pyx_truncl truncl
626 #endif
627
628 #define __PYX_MARK_ERR_POS(f_index, lineno) \
629 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
630 #define __PYX_ERR(f_index, lineno, Ln_error) \
631 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
632
633 #ifndef __PYX_EXTERN_C
634 #ifdef __cplusplus
635 #define __PYX_EXTERN_C extern "C"
636 #else
637 #define __PYX_EXTERN_C extern
638 #endif
639 #endif
640
641 #define __PYX_HAVE__gssapi__raw__ext_dce
642 #define __PYX_HAVE_API__gssapi__raw__ext_dce
643 /* Early includes */
644 #include <stdint.h>
645 #include "python_gssapi.h"
646 #include "python_gssapi_ext.h"
647 #include <string.h>
648 #include <stdlib.h>
649 #ifdef _OPENMP
650 #include <omp.h>
651 #endif /* _OPENMP */
652
653 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
654 #define CYTHON_WITHOUT_ASSERTIONS
655 #endif
656
657 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
658 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
659
660 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
661 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
662 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
663 #define __PYX_DEFAULT_STRING_ENCODING ""
664 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
665 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
666 #define __Pyx_uchar_cast(c) ((unsigned char)c)
667 #define __Pyx_long_cast(x) ((long)x)
668 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
669 (sizeof(type) < sizeof(Py_ssize_t)) ||\
670 (sizeof(type) > sizeof(Py_ssize_t) &&\
671 likely(v < (type)PY_SSIZE_T_MAX ||\
672 v == (type)PY_SSIZE_T_MAX) &&\
673 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
674 v == (type)PY_SSIZE_T_MIN))) ||\
675 (sizeof(type) == sizeof(Py_ssize_t) &&\
676 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
677 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)678 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
679 return (size_t) i < (size_t) limit;
680 }
681 #if defined (__cplusplus) && __cplusplus >= 201103L
682 #include <cstdlib>
683 #define __Pyx_sst_abs(value) std::abs(value)
684 #elif SIZEOF_INT >= SIZEOF_SIZE_T
685 #define __Pyx_sst_abs(value) abs(value)
686 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
687 #define __Pyx_sst_abs(value) labs(value)
688 #elif defined (_MSC_VER)
689 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
690 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
691 #define __Pyx_sst_abs(value) llabs(value)
692 #elif defined (__GNUC__)
693 #define __Pyx_sst_abs(value) __builtin_llabs(value)
694 #else
695 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
696 #endif
697 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
698 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
699 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
700 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
701 #define __Pyx_PyBytes_FromString PyBytes_FromString
702 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
703 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
704 #if PY_MAJOR_VERSION < 3
705 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
706 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
707 #else
708 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
709 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
710 #endif
711 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
712 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
713 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
714 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
715 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
716 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
717 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
718 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
719 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
720 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
721 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
722 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
723 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
724 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
725 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
726 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)727 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
728 const Py_UNICODE *u_end = u;
729 while (*u_end++) ;
730 return (size_t)(u_end - u - 1);
731 }
732 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
733 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
734 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
735 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
736 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
737 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
738 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
739 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
740 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
741 #define __Pyx_PySequence_Tuple(obj)\
742 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
743 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
744 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
745 #if CYTHON_ASSUME_SAFE_MACROS
746 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
747 #else
748 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
749 #endif
750 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
751 #if PY_MAJOR_VERSION >= 3
752 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
753 #else
754 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
755 #endif
756 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
757 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
758 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)759 static int __Pyx_init_sys_getdefaultencoding_params(void) {
760 PyObject* sys;
761 PyObject* default_encoding = NULL;
762 PyObject* ascii_chars_u = NULL;
763 PyObject* ascii_chars_b = NULL;
764 const char* default_encoding_c;
765 sys = PyImport_ImportModule("sys");
766 if (!sys) goto bad;
767 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
768 Py_DECREF(sys);
769 if (!default_encoding) goto bad;
770 default_encoding_c = PyBytes_AsString(default_encoding);
771 if (!default_encoding_c) goto bad;
772 if (strcmp(default_encoding_c, "ascii") == 0) {
773 __Pyx_sys_getdefaultencoding_not_ascii = 0;
774 } else {
775 char ascii_chars[128];
776 int c;
777 for (c = 0; c < 128; c++) {
778 ascii_chars[c] = c;
779 }
780 __Pyx_sys_getdefaultencoding_not_ascii = 1;
781 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
782 if (!ascii_chars_u) goto bad;
783 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
784 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
785 PyErr_Format(
786 PyExc_ValueError,
787 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
788 default_encoding_c);
789 goto bad;
790 }
791 Py_DECREF(ascii_chars_u);
792 Py_DECREF(ascii_chars_b);
793 }
794 Py_DECREF(default_encoding);
795 return 0;
796 bad:
797 Py_XDECREF(default_encoding);
798 Py_XDECREF(ascii_chars_u);
799 Py_XDECREF(ascii_chars_b);
800 return -1;
801 }
802 #endif
803 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
804 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
805 #else
806 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
807 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
808 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)809 static int __Pyx_init_sys_getdefaultencoding_params(void) {
810 PyObject* sys;
811 PyObject* default_encoding = NULL;
812 char* default_encoding_c;
813 sys = PyImport_ImportModule("sys");
814 if (!sys) goto bad;
815 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
816 Py_DECREF(sys);
817 if (!default_encoding) goto bad;
818 default_encoding_c = PyBytes_AsString(default_encoding);
819 if (!default_encoding_c) goto bad;
820 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
821 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
822 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
823 Py_DECREF(default_encoding);
824 return 0;
825 bad:
826 Py_XDECREF(default_encoding);
827 return -1;
828 }
829 #endif
830 #endif
831
832
833 /* Test for GCC > 2.95 */
834 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
835 #define likely(x) __builtin_expect(!!(x), 1)
836 #define unlikely(x) __builtin_expect(!!(x), 0)
837 #else /* !__GNUC__ or GCC < 2.95 */
838 #define likely(x) (x)
839 #define unlikely(x) (x)
840 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)841 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
842
843 static PyObject *__pyx_m = NULL;
844 static PyObject *__pyx_d;
845 static PyObject *__pyx_b;
846 static PyObject *__pyx_cython_runtime = NULL;
847 static PyObject *__pyx_empty_tuple;
848 static PyObject *__pyx_empty_bytes;
849 static PyObject *__pyx_empty_unicode;
850 static int __pyx_lineno;
851 static int __pyx_clineno = 0;
852 static const char * __pyx_cfilenm= __FILE__;
853 static const char *__pyx_filename;
854
855
856 static const char *__pyx_f[] = {
857 "gssapi/raw/ext_dce.pyx",
858 "stringsource",
859 "gssapi/raw/sec_contexts.pxd",
860 };
861 /* NoFastGil.proto */
862 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
863 #define __Pyx_PyGILState_Release PyGILState_Release
864 #define __Pyx_FastGIL_Remember()
865 #define __Pyx_FastGIL_Forget()
866 #define __Pyx_FastGilFuncInit()
867
868 /* ForceInitThreads.proto */
869 #ifndef __PYX_FORCE_INIT_THREADS
870 #define __PYX_FORCE_INIT_THREADS 0
871 #endif
872
873
874 /*--- Type declarations ---*/
875 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext;
876 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV;
877 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__;
878 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__;
879 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count;
880 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr;
881
882 /* "gssapi/raw/sec_contexts.pxd":3
883 * from gssapi.raw.cython_types cimport gss_ctx_id_t
884 *
885 * cdef class SecurityContext: # <<<<<<<<<<<<<<
886 * cdef gss_ctx_id_t raw_ctx
887 * cdef bint _free_on_dealloc
888 */
889 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext {
890 PyObject_HEAD
891 gss_ctx_id_t raw_ctx;
892 int _free_on_dealloc;
893 };
894
895
896 /* "gssapi/raw/ext_dce.pxd":9
897 * ctypedef gss_iov_buffer_desc* gss_iov_buffer_t
898 *
899 * cdef class IOV: # <<<<<<<<<<<<<<
900 * cdef int iov_len
901 * cdef bint c_changed
902 */
903 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV {
904 PyObject_HEAD
905 struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *__pyx_vtab;
906 int iov_len;
907 int c_changed;
908 int _unprocessed;
909 PyObject *_buffs;
910 gss_iov_buffer_desc *_iov;
911 };
912
913
914 /* "gssapi/raw/ext_dce.pyx":235
915 * return len(self._buffs)
916 *
917 * def __iter__(IOV self): # <<<<<<<<<<<<<<
918 * if self.c_changed:
919 * self._recreate_python_values()
920 */
921 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ {
922 PyObject_HEAD
923 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self;
924 PyObject *__pyx_v_val;
925 PyObject *__pyx_t_0;
926 Py_ssize_t __pyx_t_1;
927 };
928
929
930 /* "gssapi/raw/ext_dce.pyx":248
931 * return item in self._buffs
932 *
933 * def __reversed__(IOV self): # <<<<<<<<<<<<<<
934 * if self.c_changed:
935 * self._recreate_python_values()
936 */
937 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ {
938 PyObject_HEAD
939 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self;
940 PyObject *__pyx_v_val;
941 PyObject *__pyx_t_0;
942 Py_ssize_t __pyx_t_1;
943 };
944
945
946 /* "gssapi/raw/ext_dce.pyx":262
947 * raise ValueError
948 *
949 * def count(IOV self, value): # <<<<<<<<<<<<<<
950 * return sum(1 for v in self if v == value)
951 *
952 */
953 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count {
954 PyObject_HEAD
955 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self;
956 PyObject *__pyx_v_value;
957 };
958
959
960 /* "gssapi/raw/ext_dce.pyx":263
961 *
962 * def count(IOV self, value):
963 * return sum(1 for v in self if v == value) # <<<<<<<<<<<<<<
964 *
965 * def __repr__(IOV self):
966 */
967 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr {
968 PyObject_HEAD
969 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *__pyx_outer_scope;
970 PyObject *__pyx_v_v;
971 PyObject *__pyx_t_0;
972 Py_ssize_t __pyx_t_1;
973 PyObject *(*__pyx_t_2)(PyObject *);
974 };
975
976
977
978 /* "gssapi/raw/ext_dce.pyx":94
979 *
980 *
981 * cdef class IOV: # <<<<<<<<<<<<<<
982 * """A GSSAPI IOV"""
983 * # defined in ext_dce.pxd
984 */
985
986 struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV {
987 gss_iov_buffer_desc *(*__pyx___cvalue__)(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *);
988 PyObject *(*_recreate_python_values)(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *);
989 };
990 static struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *__pyx_vtabptr_6gssapi_3raw_7ext_dce_IOV;
991
992 /* --- Runtime support code (head) --- */
993 /* Refnanny.proto */
994 #ifndef CYTHON_REFNANNY
995 #define CYTHON_REFNANNY 0
996 #endif
997 #if CYTHON_REFNANNY
998 typedef struct {
999 void (*INCREF)(void*, PyObject*, int);
1000 void (*DECREF)(void*, PyObject*, int);
1001 void (*GOTREF)(void*, PyObject*, int);
1002 void (*GIVEREF)(void*, PyObject*, int);
1003 void* (*SetupContext)(const char*, int, const char*);
1004 void (*FinishContext)(void**);
1005 } __Pyx_RefNannyAPIStruct;
1006 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1007 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1008 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1009 #ifdef WITH_THREAD
1010 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1011 if (acquire_gil) {\
1012 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1013 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1014 PyGILState_Release(__pyx_gilstate_save);\
1015 } else {\
1016 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1017 }
1018 #else
1019 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1020 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1021 #endif
1022 #define __Pyx_RefNannyFinishContext()\
1023 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1024 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1025 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1026 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1027 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1028 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1029 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1030 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1031 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1032 #else
1033 #define __Pyx_RefNannyDeclarations
1034 #define __Pyx_RefNannySetupContext(name, acquire_gil)
1035 #define __Pyx_RefNannyFinishContext()
1036 #define __Pyx_INCREF(r) Py_INCREF(r)
1037 #define __Pyx_DECREF(r) Py_DECREF(r)
1038 #define __Pyx_GOTREF(r)
1039 #define __Pyx_GIVEREF(r)
1040 #define __Pyx_XINCREF(r) Py_XINCREF(r)
1041 #define __Pyx_XDECREF(r) Py_XDECREF(r)
1042 #define __Pyx_XGOTREF(r)
1043 #define __Pyx_XGIVEREF(r)
1044 #endif
1045 #define __Pyx_XDECREF_SET(r, v) do {\
1046 PyObject *tmp = (PyObject *) r;\
1047 r = v; __Pyx_XDECREF(tmp);\
1048 } while (0)
1049 #define __Pyx_DECREF_SET(r, v) do {\
1050 PyObject *tmp = (PyObject *) r;\
1051 r = v; __Pyx_DECREF(tmp);\
1052 } while (0)
1053 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1054 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1055
1056 /* PyObjectGetAttrStr.proto */
1057 #if CYTHON_USE_TYPE_SLOTS
1058 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1059 #else
1060 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1061 #endif
1062
1063 /* GetBuiltinName.proto */
1064 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1065
1066 /* RaiseDoubleKeywords.proto */
1067 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1068
1069 /* ParseKeywords.proto */
1070 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1071 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1072 const char* function_name);
1073
1074 /* RaiseArgTupleInvalid.proto */
1075 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1076 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1077
1078 /* ListAppend.proto */
1079 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1080 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1081 PyListObject* L = (PyListObject*) list;
1082 Py_ssize_t len = Py_SIZE(list);
1083 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1084 Py_INCREF(x);
1085 PyList_SET_ITEM(list, len, x);
1086 __Pyx_SET_SIZE(list, len + 1);
1087 return 0;
1088 }
1089 return PyList_Append(list, x);
1090 }
1091 #else
1092 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1093 #endif
1094
1095 /* PyDictVersioning.proto */
1096 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1097 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1098 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1099 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1100 (version_var) = __PYX_GET_DICT_VERSION(dict);\
1101 (cache_var) = (value);
1102 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1103 static PY_UINT64_T __pyx_dict_version = 0;\
1104 static PyObject *__pyx_dict_cached_value = NULL;\
1105 if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1106 (VAR) = __pyx_dict_cached_value;\
1107 } else {\
1108 (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1109 __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1110 }\
1111 }
1112 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1113 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1114 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1115 #else
1116 #define __PYX_GET_DICT_VERSION(dict) (0)
1117 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1118 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1119 #endif
1120
1121 /* GetModuleGlobalName.proto */
1122 #if CYTHON_USE_DICT_VERSIONS
1123 #define __Pyx_GetModuleGlobalName(var, name) {\
1124 static PY_UINT64_T __pyx_dict_version = 0;\
1125 static PyObject *__pyx_dict_cached_value = NULL;\
1126 (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1127 (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1128 __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1129 }
1130 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1131 PY_UINT64_T __pyx_dict_version;\
1132 PyObject *__pyx_dict_cached_value;\
1133 (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1134 }
1135 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1136 #else
1137 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1138 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1139 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1140 #endif
1141
1142 /* PyFunctionFastCall.proto */
1143 #if CYTHON_FAST_PYCALL
1144 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1145 __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1146 #if 1 || PY_VERSION_HEX < 0x030600B1
1147 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1148 #else
1149 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1150 #endif
1151 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1152 (sizeof(char [1 - 2*!(cond)]) - 1)
1153 #ifndef Py_MEMBER_SIZE
1154 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1155 #endif
1156 static size_t __pyx_pyframe_localsplus_offset = 0;
1157 #include "frameobject.h"
1158 #define __Pxy_PyFrame_Initialize_Offsets()\
1159 ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1160 (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1161 #define __Pyx_PyFrame_GetLocalsplus(frame)\
1162 (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1163 #endif
1164
1165 /* PyCFunctionFastCall.proto */
1166 #if CYTHON_FAST_PYCCALL
1167 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1168 #else
1169 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1170 #endif
1171
1172 /* PyObjectCall.proto */
1173 #if CYTHON_COMPILING_IN_CPYTHON
1174 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1175 #else
1176 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1177 #endif
1178
1179 /* PyThreadStateGet.proto */
1180 #if CYTHON_FAST_THREAD_STATE
1181 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1182 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1183 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1184 #else
1185 #define __Pyx_PyThreadState_declare
1186 #define __Pyx_PyThreadState_assign
1187 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1188 #endif
1189
1190 /* PyErrFetchRestore.proto */
1191 #if CYTHON_FAST_THREAD_STATE
1192 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1193 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1194 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1195 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1196 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1197 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1198 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1199 #if CYTHON_COMPILING_IN_CPYTHON
1200 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1201 #else
1202 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1203 #endif
1204 #else
1205 #define __Pyx_PyErr_Clear() PyErr_Clear()
1206 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1207 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1208 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1209 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1210 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1211 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1212 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1213 #endif
1214
1215 /* RaiseException.proto */
1216 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1217
1218 /* GetItemInt.proto */
1219 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1220 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1221 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1222 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1223 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1224 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1225 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1226 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1227 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1228 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1229 int wraparound, int boundscheck);
1230 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1231 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1232 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1233 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1234 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1235 int wraparound, int boundscheck);
1236 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1237 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1238 int is_list, int wraparound, int boundscheck);
1239
1240 /* PySequenceContains.proto */
__Pyx_PySequence_ContainsTF(PyObject * item,PyObject * seq,int eq)1241 static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
1242 int result = PySequence_Contains(seq, item);
1243 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
1244 }
1245
1246 /* RaiseTooManyValuesToUnpack.proto */
1247 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1248
1249 /* RaiseNeedMoreValuesToUnpack.proto */
1250 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1251
1252 /* IterFinish.proto */
1253 static CYTHON_INLINE int __Pyx_IterFinish(void);
1254
1255 /* UnpackItemEndCheck.proto */
1256 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
1257
1258 /* PyObjectCallMethO.proto */
1259 #if CYTHON_COMPILING_IN_CPYTHON
1260 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1261 #endif
1262
1263 /* PyObjectCallOneArg.proto */
1264 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1265
1266 /* ObjectGetItem.proto */
1267 #if CYTHON_USE_TYPE_SLOTS
1268 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1269 #else
1270 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1271 #endif
1272
1273 /* PyIntBinop.proto */
1274 #if !CYTHON_COMPILING_IN_PYPY
1275 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1276 #else
1277 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1278 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1279 #endif
1280
1281 /* None.proto */
1282 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1283
1284 /* PyObjectCall2Args.proto */
1285 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1286
1287 /* PyObjectCallNoArg.proto */
1288 #if CYTHON_COMPILING_IN_CPYTHON
1289 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1290 #else
1291 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1292 #endif
1293
1294 /* StringJoin.proto */
1295 #if PY_MAJOR_VERSION < 3
1296 #define __Pyx_PyString_Join __Pyx_PyBytes_Join
1297 #define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
1298 #else
1299 #define __Pyx_PyString_Join PyUnicode_Join
1300 #define __Pyx_PyBaseString_Join PyUnicode_Join
1301 #endif
1302 #if CYTHON_COMPILING_IN_CPYTHON
1303 #if PY_MAJOR_VERSION < 3
1304 #define __Pyx_PyBytes_Join _PyString_Join
1305 #else
1306 #define __Pyx_PyBytes_Join _PyBytes_Join
1307 #endif
1308 #else
1309 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
1310 #endif
1311
1312 /* ArgTypeTest.proto */
1313 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1314 ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1315 __Pyx__ArgTypeTest(obj, type, name, exact))
1316 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1317
1318 /* IncludeStringH.proto */
1319 #include <string.h>
1320
1321 /* PyObject_GenericGetAttrNoDict.proto */
1322 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1323 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1324 #else
1325 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1326 #endif
1327
1328 /* PyObject_GenericGetAttr.proto */
1329 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1330 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1331 #else
1332 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1333 #endif
1334
1335 /* SetVTable.proto */
1336 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1337
1338 /* PyErrExceptionMatches.proto */
1339 #if CYTHON_FAST_THREAD_STATE
1340 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1341 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1342 #else
1343 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1344 #endif
1345
1346 /* PyObjectGetAttrStrNoError.proto */
1347 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1348
1349 /* SetupReduce.proto */
1350 static int __Pyx_setup_reduce(PyObject* type_obj);
1351
1352 /* TypeImport.proto */
1353 #ifndef __PYX_HAVE_RT_ImportType_proto
1354 #define __PYX_HAVE_RT_ImportType_proto
1355 enum __Pyx_ImportType_CheckSize {
1356 __Pyx_ImportType_CheckSize_Error = 0,
1357 __Pyx_ImportType_CheckSize_Warn = 1,
1358 __Pyx_ImportType_CheckSize_Ignore = 2
1359 };
1360 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1361 #endif
1362
1363 /* Import.proto */
1364 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1365
1366 /* ImportFrom.proto */
1367 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1368
1369 /* SetNameInClass.proto */
1370 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
1371 #define __Pyx_SetNameInClass(ns, name, value)\
1372 (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
1373 #elif CYTHON_COMPILING_IN_CPYTHON
1374 #define __Pyx_SetNameInClass(ns, name, value)\
1375 (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
1376 #else
1377 #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
1378 #endif
1379
1380 /* CalculateMetaclass.proto */
1381 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
1382
1383 /* Py3ClassCreate.proto */
1384 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
1385 PyObject *mkw, PyObject *modname, PyObject *doc);
1386 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
1387 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
1388
1389 /* CLineInTraceback.proto */
1390 #ifdef CYTHON_CLINE_IN_TRACEBACK
1391 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1392 #else
1393 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1394 #endif
1395
1396 /* CodeObjectCache.proto */
1397 typedef struct {
1398 PyCodeObject* code_object;
1399 int code_line;
1400 } __Pyx_CodeObjectCacheEntry;
1401 struct __Pyx_CodeObjectCache {
1402 int count;
1403 int max_count;
1404 __Pyx_CodeObjectCacheEntry* entries;
1405 };
1406 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1407 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1408 static PyCodeObject *__pyx_find_code_object(int code_line);
1409 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1410
1411 /* AddTraceback.proto */
1412 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1413 int py_line, const char *filename);
1414
1415 /* GCCDiagnostics.proto */
1416 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1417 #define __Pyx_HAS_GCC_DIAGNOSTIC
1418 #endif
1419
1420 /* CIntToPy.proto */
1421 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value);
1422
1423 /* CIntToPy.proto */
1424 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1425
1426 /* CIntToPy.proto */
1427 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1428
1429 /* CIntFromPy.proto */
1430 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1431
1432 /* CIntFromPy.proto */
1433 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);
1434
1435 /* CIntFromPy.proto */
1436 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1437
1438 /* FastTypeChecks.proto */
1439 #if CYTHON_COMPILING_IN_CPYTHON
1440 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1441 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1442 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1443 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1444 #else
1445 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1446 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1447 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1448 #endif
1449 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1450
1451 /* FetchCommonType.proto */
1452 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1453
1454 /* GetTopmostException.proto */
1455 #if CYTHON_USE_EXC_INFO_STACK
1456 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1457 #endif
1458
1459 /* SaveResetException.proto */
1460 #if CYTHON_FAST_THREAD_STATE
1461 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1462 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1463 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1464 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1465 #else
1466 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1467 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1468 #endif
1469
1470 /* SwapException.proto */
1471 #if CYTHON_FAST_THREAD_STATE
1472 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1473 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1474 #else
1475 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1476 #endif
1477
1478 /* PyObjectGetMethod.proto */
1479 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1480
1481 /* PyObjectCallMethod1.proto */
1482 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1483
1484 /* CoroutineBase.proto */
1485 typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
1486 #if CYTHON_USE_EXC_INFO_STACK
1487 #define __Pyx_ExcInfoStruct _PyErr_StackItem
1488 #else
1489 typedef struct {
1490 PyObject *exc_type;
1491 PyObject *exc_value;
1492 PyObject *exc_traceback;
1493 } __Pyx_ExcInfoStruct;
1494 #endif
1495 typedef struct {
1496 PyObject_HEAD
1497 __pyx_coroutine_body_t body;
1498 PyObject *closure;
1499 __Pyx_ExcInfoStruct gi_exc_state;
1500 PyObject *gi_weakreflist;
1501 PyObject *classobj;
1502 PyObject *yieldfrom;
1503 PyObject *gi_name;
1504 PyObject *gi_qualname;
1505 PyObject *gi_modulename;
1506 PyObject *gi_code;
1507 int resume_label;
1508 char is_running;
1509 } __pyx_CoroutineObject;
1510 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
1511 PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1512 PyObject *name, PyObject *qualname, PyObject *module_name);
1513 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
1514 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
1515 PyObject *name, PyObject *qualname, PyObject *module_name);
1516 static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
1517 static int __Pyx_Coroutine_clear(PyObject *self);
1518 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
1519 static PyObject *__Pyx_Coroutine_Close(PyObject *self);
1520 static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
1521 #if CYTHON_USE_EXC_INFO_STACK
1522 #define __Pyx_Coroutine_SwapException(self)
1523 #define __Pyx_Coroutine_ResetAndClearException(self) __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
1524 #else
1525 #define __Pyx_Coroutine_SwapException(self) {\
1526 __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
1527 __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
1528 }
1529 #define __Pyx_Coroutine_ResetAndClearException(self) {\
1530 __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
1531 (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
1532 }
1533 #endif
1534 #if CYTHON_FAST_THREAD_STATE
1535 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1536 __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
1537 #else
1538 #define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
1539 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
1540 #endif
1541 static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
1542 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);
1543
1544 /* PatchModuleWithCoroutine.proto */
1545 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);
1546
1547 /* PatchGeneratorABC.proto */
1548 static int __Pyx_patch_abc(void);
1549
1550 /* Generator.proto */
1551 #define __Pyx_Generator_USED
1552 static PyTypeObject *__pyx_GeneratorType = 0;
1553 #define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
1554 #define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
1555 __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
1556 static PyObject *__Pyx_Generator_Next(PyObject *self);
1557 static int __pyx_Generator_init(void);
1558
1559 /* CheckBinaryVersion.proto */
1560 static int __Pyx_check_binary_version(void);
1561
1562 /* InitStrings.proto */
1563 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1564
1565 static gss_iov_buffer_desc *__pyx_f_6gssapi_3raw_7ext_dce_3IOV___cvalue__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto*/
1566 static PyObject *__pyx_f_6gssapi_3raw_7ext_dce_3IOV__recreate_python_values(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto*/
1567
1568 /* Module declarations from 'libc.stdint' */
1569
1570 /* Module declarations from 'gssapi.raw.cython_types' */
1571
1572 /* Module declarations from 'libc.string' */
1573
1574 /* Module declarations from 'libc.stdlib' */
1575
1576 /* Module declarations from 'gssapi.raw.sec_contexts' */
1577 static PyTypeObject *__pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext = 0;
1578
1579 /* Module declarations from 'gssapi.raw.ext_dce' */
1580 static PyTypeObject *__pyx_ptype_6gssapi_3raw_7ext_dce_IOV = 0;
1581 static PyTypeObject *__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ = 0;
1582 static PyTypeObject *__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ = 0;
1583 static PyTypeObject *__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count = 0;
1584 static PyTypeObject *__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr = 0;
1585 #define __Pyx_MODULE_NAME "gssapi.raw.ext_dce"
1586 extern int __pyx_module_is_main_gssapi__raw__ext_dce;
1587 int __pyx_module_is_main_gssapi__raw__ext_dce = 0;
1588
1589 /* Implementation of 'gssapi.raw.ext_dce' */
1590 static PyObject *__pyx_builtin_ValueError;
1591 static PyObject *__pyx_builtin_MemoryError;
1592 static PyObject *__pyx_builtin_range;
1593 static PyObject *__pyx_builtin_reversed;
1594 static PyObject *__pyx_builtin_enumerate;
1595 static PyObject *__pyx_builtin_sum;
1596 static PyObject *__pyx_builtin_TypeError;
1597 static const char __pyx_k__4[] = "\000";
1598 static const char __pyx_k__5[] = ".";
1599 static const char __pyx_k__6[] = "";
1600 static const char __pyx_k__7[] = " | ";
1601 static const char __pyx_k_IOV[] = "IOV";
1602 static const char __pyx_k_doc[] = "__doc__";
1603 static const char __pyx_k_qop[] = "qop";
1604 static const char __pyx_k_sum[] = "sum";
1605 static const char __pyx_k_BASE[] = "BASE";
1606 static const char __pyx_k_args[] = "args";
1607 static const char __pyx_k_data[] = "data";
1608 static const char __pyx_k_enum[] = "enum";
1609 static const char __pyx_k_iter[] = "__iter__";
1610 static const char __pyx_k_join[] = "join";
1611 static const char __pyx_k_main[] = "__main__";
1612 static const char __pyx_k_name[] = "name";
1613 static const char __pyx_k_send[] = "send";
1614 static const char __pyx_k_test[] = "__test__";
1615 static const char __pyx_k_type[] = "type";
1616 static const char __pyx_k_IOV_0[] = "<IOV {0}>";
1617 static const char __pyx_k_buffs[] = "buffs";
1618 static const char __pyx_k_close[] = "close";
1619 static const char __pyx_k_empty[] = "(empty)";
1620 static const char __pyx_k_range[] = "range";
1621 static const char __pyx_k_split[] = "split";
1622 static const char __pyx_k_throw[] = "throw";
1623 static const char __pyx_k_types[] = "types";
1624 static const char __pyx_k_upper[] = "upper";
1625 static const char __pyx_k_value[] = "value";
1626 static const char __pyx_k_GSSAPI[] = "GSSAPI";
1627 static const char __pyx_k_format[] = "format";
1628 static const char __pyx_k_header[] = "header";
1629 static const char __pyx_k_import[] = "__import__";
1630 static const char __pyx_k_length[] = "length";
1631 static const char __pyx_k_module[] = "module";
1632 static const char __pyx_k_name_2[] = "__name__";
1633 static const char __pyx_k_reduce[] = "__reduce__";
1634 static const char __pyx_k_stream[] = "stream";
1635 static const char __pyx_k_0_1_r_2[] = "{0}({1!r}{2})";
1636 static const char __pyx_k_IntEnum[] = "IntEnum";
1637 static const char __pyx_k_context[] = "context";
1638 static const char __pyx_k_empty_2[] = "empty";
1639 static const char __pyx_k_genexpr[] = "genexpr";
1640 static const char __pyx_k_message[] = "message";
1641 static const char __pyx_k_padding[] = "padding";
1642 static const char __pyx_k_prepare[] = "__prepare__";
1643 static const char __pyx_k_qop_req[] = "qop_req";
1644 static const char __pyx_k_res_arr[] = "res_arr";
1645 static const char __pyx_k_trailer[] = "trailer";
1646 static const char __pyx_k_GSSError[] = "GSSError";
1647 static const char __pyx_k_Sequence[] = "Sequence";
1648 static const char __pyx_k_allocate[] = "allocate";
1649 static const char __pyx_k_conf_req[] = "conf_req";
1650 static const char __pyx_k_getstate[] = "__getstate__";
1651 static const char __pyx_k_maj_stat[] = "maj_stat";
1652 static const char __pyx_k_min_stat[] = "min_stat";
1653 static const char __pyx_k_module_2[] = "__module__";
1654 static const char __pyx_k_qop_used[] = "qop_used";
1655 static const char __pyx_k_qualname[] = "__qualname__";
1656 static const char __pyx_k_reversed[] = "reversed";
1657 static const char __pyx_k_setstate[] = "__setstate__";
1658 static const char __pyx_k_wrap_iov[] = "wrap_iov";
1659 static const char __pyx_k_IOVBuffer[] = "IOVBuffer";
1660 static const char __pyx_k_TypeError[] = "TypeError";
1661 static const char __pyx_k_allocated[] = ", allocated";
1662 static const char __pyx_k_conf_used[] = "conf_used";
1663 static const char __pyx_k_enumerate[] = "enumerate";
1664 static const char __pyx_k_metaclass[] = "__metaclass__";
1665 static const char __pyx_k_qop_state[] = "qop_state";
1666 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
1667 static const char __pyx_k_sign_only[] = "sign_only";
1668 static const char __pyx_k_wrap_aead[] = "wrap_aead";
1669 static const char __pyx_k_IOV___iter[] = "IOV.__iter__";
1670 static const char __pyx_k_ValueError[] = "ValueError";
1671 static const char __pyx_k_WrapResult[] = "WrapResult";
1672 static const char __pyx_k_allocate_2[] = "(allocate)";
1673 static const char __pyx_k_associated[] = "associated";
1674 static const char __pyx_k_auto_alloc[] = "auto_alloc";
1675 static const char __pyx_k_conf_state[] = "conf_state";
1676 static const char __pyx_k_gssapi_raw[] = "gssapi.raw";
1677 static const char __pyx_k_namedtuple[] = "namedtuple";
1678 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1679 static const char __pyx_k_reversed_2[] = "__reversed__";
1680 static const char __pyx_k_std_layout[] = "std_layout";
1681 static const char __pyx_k_unwrap_iov[] = "unwrap_iov";
1682 static const char __pyx_k_MemoryError[] = "MemoryError";
1683 static const char __pyx_k_collections[] = "collections";
1684 static const char __pyx_k_mech_params[] = "mech_params";
1685 static const char __pyx_k_unwrap_aead[] = "unwrap_aead";
1686 static const char __pyx_k_UnwrapResult[] = "UnwrapResult";
1687 static const char __pyx_k_assoc_buffer[] = "assoc_buffer";
1688 static const char __pyx_k_confidential[] = "confidential";
1689 static const char __pyx_k_gssapi_types[] = "gssapi_types";
1690 static const char __pyx_k_input_buffer[] = "input_buffer";
1691 static const char __pyx_k_IOVBufferType[] = "IOVBufferType";
1692 static const char __pyx_k_output_buffer[] = "output_buffer";
1693 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
1694 static const char __pyx_k_ExtendableEnum[] = "ExtendableEnum";
1695 static const char __pyx_k_IOV___reversed[] = "IOV.__reversed__";
1696 static const char __pyx_k_message_buffer[] = "message_buffer";
1697 static const char __pyx_k_output_message[] = "output_message";
1698 static const char __pyx_k_IOVUnwrapResult[] = "IOVUnwrapResult";
1699 static const char __pyx_k_collections_abc[] = "collections.abc";
1700 static const char __pyx_k_gssapi_raw_misc[] = "gssapi.raw.misc";
1701 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
1702 static const char __pyx_k_wrap_iov_length[] = "wrap_iov_length";
1703 static const char __pyx_k_assoc_buffer_ptr[] = "assoc_buffer_ptr";
1704 static const char __pyx_k_module_name_buffs[] = "<{module}.{name} {buffs}>";
1705 static const char __pyx_k_AUTO_ALLOC_BUFFERS[] = "AUTO_ALLOC_BUFFERS";
1706 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1707 static const char __pyx_k_gssapi_raw_ext_dce[] = "gssapi.raw.ext_dce";
1708 static const char __pyx_k_count_locals_genexpr[] = "count.<locals>.genexpr";
1709 static const char __pyx_k_gssapi_raw_ext_dce_pyx[] = "gssapi/raw/ext_dce.pyx";
1710 static const char __pyx_k_gssapi_raw_named_tuples[] = "gssapi.raw.named_tuples";
1711 static const char __pyx_k_gssapi_raw__enum_extensions[] = "gssapi.raw._enum_extensions";
1712 static const char __pyx_k_Cannot_malloc_for_buffer_value[] = "Cannot malloc for buffer value";
1713 static const char __pyx_k_IOV_Buffer_Types_This_IntEnum_r[] = "\n IOV Buffer Types\n\n This IntEnum represent GSSAPI IOV buffer\n types to be used with the IOV methods.\n\n The numbers behind the values correspond directly\n to their C counterparts.\n ";
1714 static const char __pyx_k_Buffer_description_tuples_must_b[] = "Buffer description tuples must be length 2 or 3";
1715 static const char __pyx_k_Cannot_calloc_for_IOV_buffer_arr[] = "Cannot calloc for IOV buffer array";
1716 static const char __pyx_k_self__iov_cannot_be_converted_to[] = "self._iov cannot be converted to a Python object for pickling";
1717 static PyObject *__pyx_kp_s_0_1_r_2;
1718 static PyObject *__pyx_n_s_AUTO_ALLOC_BUFFERS;
1719 static PyObject *__pyx_n_s_BASE;
1720 static PyObject *__pyx_kp_s_Buffer_description_tuples_must_b;
1721 static PyObject *__pyx_kp_s_Cannot_calloc_for_IOV_buffer_arr;
1722 static PyObject *__pyx_kp_s_Cannot_malloc_for_buffer_value;
1723 static PyObject *__pyx_n_s_ExtendableEnum;
1724 static PyObject *__pyx_n_s_GSSAPI;
1725 static PyObject *__pyx_n_s_GSSError;
1726 static PyObject *__pyx_n_s_IOV;
1727 static PyObject *__pyx_n_s_IOVBuffer;
1728 static PyObject *__pyx_n_s_IOVBufferType;
1729 static PyObject *__pyx_n_s_IOVUnwrapResult;
1730 static PyObject *__pyx_kp_s_IOV_0;
1731 static PyObject *__pyx_kp_s_IOV_Buffer_Types_This_IntEnum_r;
1732 static PyObject *__pyx_n_s_IOV___iter;
1733 static PyObject *__pyx_n_s_IOV___reversed;
1734 static PyObject *__pyx_n_s_IntEnum;
1735 static PyObject *__pyx_n_s_MemoryError;
1736 static PyObject *__pyx_n_s_Sequence;
1737 static PyObject *__pyx_n_s_TypeError;
1738 static PyObject *__pyx_n_s_UnwrapResult;
1739 static PyObject *__pyx_n_s_ValueError;
1740 static PyObject *__pyx_n_s_WrapResult;
1741 static PyObject *__pyx_kp_b__4;
1742 static PyObject *__pyx_kp_s__5;
1743 static PyObject *__pyx_kp_s__6;
1744 static PyObject *__pyx_kp_s__7;
1745 static PyObject *__pyx_n_s_allocate;
1746 static PyObject *__pyx_kp_s_allocate_2;
1747 static PyObject *__pyx_kp_s_allocated;
1748 static PyObject *__pyx_n_s_args;
1749 static PyObject *__pyx_n_s_assoc_buffer;
1750 static PyObject *__pyx_n_s_assoc_buffer_ptr;
1751 static PyObject *__pyx_n_s_associated;
1752 static PyObject *__pyx_n_s_auto_alloc;
1753 static PyObject *__pyx_n_s_buffs;
1754 static PyObject *__pyx_n_s_cline_in_traceback;
1755 static PyObject *__pyx_n_s_close;
1756 static PyObject *__pyx_n_s_collections;
1757 static PyObject *__pyx_n_s_collections_abc;
1758 static PyObject *__pyx_n_s_conf_req;
1759 static PyObject *__pyx_n_s_conf_state;
1760 static PyObject *__pyx_n_s_conf_used;
1761 static PyObject *__pyx_n_s_confidential;
1762 static PyObject *__pyx_n_s_context;
1763 static PyObject *__pyx_n_s_count_locals_genexpr;
1764 static PyObject *__pyx_n_s_data;
1765 static PyObject *__pyx_n_s_doc;
1766 static PyObject *__pyx_kp_s_empty;
1767 static PyObject *__pyx_n_s_empty_2;
1768 static PyObject *__pyx_n_s_enum;
1769 static PyObject *__pyx_n_s_enumerate;
1770 static PyObject *__pyx_n_s_format;
1771 static PyObject *__pyx_n_s_genexpr;
1772 static PyObject *__pyx_n_s_getstate;
1773 static PyObject *__pyx_n_s_gssapi_raw;
1774 static PyObject *__pyx_n_s_gssapi_raw__enum_extensions;
1775 static PyObject *__pyx_n_s_gssapi_raw_ext_dce;
1776 static PyObject *__pyx_kp_s_gssapi_raw_ext_dce_pyx;
1777 static PyObject *__pyx_n_s_gssapi_raw_misc;
1778 static PyObject *__pyx_n_s_gssapi_raw_named_tuples;
1779 static PyObject *__pyx_n_s_gssapi_types;
1780 static PyObject *__pyx_n_s_header;
1781 static PyObject *__pyx_n_s_import;
1782 static PyObject *__pyx_n_s_input_buffer;
1783 static PyObject *__pyx_n_s_iter;
1784 static PyObject *__pyx_n_s_join;
1785 static PyObject *__pyx_n_s_length;
1786 static PyObject *__pyx_n_s_main;
1787 static PyObject *__pyx_n_s_maj_stat;
1788 static PyObject *__pyx_n_s_mech_params;
1789 static PyObject *__pyx_n_s_message;
1790 static PyObject *__pyx_n_s_message_buffer;
1791 static PyObject *__pyx_n_s_metaclass;
1792 static PyObject *__pyx_n_s_min_stat;
1793 static PyObject *__pyx_n_s_module;
1794 static PyObject *__pyx_n_s_module_2;
1795 static PyObject *__pyx_kp_s_module_name_buffs;
1796 static PyObject *__pyx_n_s_name;
1797 static PyObject *__pyx_n_s_name_2;
1798 static PyObject *__pyx_n_s_namedtuple;
1799 static PyObject *__pyx_n_s_output_buffer;
1800 static PyObject *__pyx_n_s_output_message;
1801 static PyObject *__pyx_n_s_padding;
1802 static PyObject *__pyx_n_s_prepare;
1803 static PyObject *__pyx_n_s_pyx_vtable;
1804 static PyObject *__pyx_n_s_qop;
1805 static PyObject *__pyx_n_s_qop_req;
1806 static PyObject *__pyx_n_s_qop_state;
1807 static PyObject *__pyx_n_s_qop_used;
1808 static PyObject *__pyx_n_s_qualname;
1809 static PyObject *__pyx_n_s_range;
1810 static PyObject *__pyx_n_s_reduce;
1811 static PyObject *__pyx_n_s_reduce_cython;
1812 static PyObject *__pyx_n_s_reduce_ex;
1813 static PyObject *__pyx_n_s_res_arr;
1814 static PyObject *__pyx_n_s_reversed;
1815 static PyObject *__pyx_n_s_reversed_2;
1816 static PyObject *__pyx_kp_s_self__iov_cannot_be_converted_to;
1817 static PyObject *__pyx_n_s_send;
1818 static PyObject *__pyx_n_s_setstate;
1819 static PyObject *__pyx_n_s_setstate_cython;
1820 static PyObject *__pyx_n_s_sign_only;
1821 static PyObject *__pyx_n_s_split;
1822 static PyObject *__pyx_n_s_std_layout;
1823 static PyObject *__pyx_n_s_stream;
1824 static PyObject *__pyx_n_s_sum;
1825 static PyObject *__pyx_n_s_test;
1826 static PyObject *__pyx_n_s_throw;
1827 static PyObject *__pyx_n_s_trailer;
1828 static PyObject *__pyx_n_s_type;
1829 static PyObject *__pyx_n_s_types;
1830 static PyObject *__pyx_n_s_unwrap_aead;
1831 static PyObject *__pyx_n_s_unwrap_iov;
1832 static PyObject *__pyx_n_s_upper;
1833 static PyObject *__pyx_n_s_value;
1834 static PyObject *__pyx_n_s_wrap_aead;
1835 static PyObject *__pyx_n_s_wrap_iov;
1836 static PyObject *__pyx_n_s_wrap_iov_length;
1837 static int __pyx_pf_6gssapi_3raw_7ext_dce_3IOV___init__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_std_layout, PyObject *__pyx_v_auto_alloc, PyObject *__pyx_v_args); /* proto */
1838 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_2__getitem__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_ind); /* proto */
1839 static Py_ssize_t __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_4__len__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1840 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_6__iter__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1841 static int __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_9__contains__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
1842 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_11__reversed__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1843 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_14index(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1844 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_5count_genexpr(PyObject *__pyx_self); /* proto */
1845 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_16count(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
1846 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_18__repr__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1847 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_20__str__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1848 static void __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_22__dealloc__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1849 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self); /* proto */
1850 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
1851 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_wrap_iov(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message, PyObject *__pyx_v_confidential, PyObject *__pyx_v_qop); /* proto */
1852 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_2unwrap_iov(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message); /* proto */
1853 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_4wrap_iov_length(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message, PyObject *__pyx_v_confidential, PyObject *__pyx_v_qop); /* proto */
1854 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_6wrap_aead(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_message, PyObject *__pyx_v_associated, PyObject *__pyx_v_confidential, PyObject *__pyx_v_qop); /* proto */
1855 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_8unwrap_aead(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_message, PyObject *__pyx_v_associated); /* proto */
1856 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce_IOV(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1857 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1858 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1859 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1860 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1861 static PyObject *__pyx_int_0;
1862 static PyObject *__pyx_int_1;
1863 static PyObject *__pyx_tuple_;
1864 static PyObject *__pyx_tuple__2;
1865 static PyObject *__pyx_tuple__3;
1866 static PyObject *__pyx_tuple__8;
1867 static PyObject *__pyx_tuple__9;
1868 static PyObject *__pyx_tuple__10;
1869 static PyObject *__pyx_tuple__12;
1870 static PyObject *__pyx_tuple__14;
1871 static PyObject *__pyx_tuple__16;
1872 static PyObject *__pyx_tuple__18;
1873 static PyObject *__pyx_codeobj__11;
1874 static PyObject *__pyx_codeobj__13;
1875 static PyObject *__pyx_codeobj__15;
1876 static PyObject *__pyx_codeobj__17;
1877 static PyObject *__pyx_codeobj__19;
1878 /* Late includes */
1879
1880 /* "gssapi/raw/ext_dce.pyx":108
1881 * IOVBufferType.trailer])
1882 *
1883 * def __init__(IOV self, *args, std_layout=True, auto_alloc=True): # <<<<<<<<<<<<<<
1884 * self._unprocessed = True
1885 * self.c_changed = False
1886 */
1887
1888 /* Python wrapper */
1889 static int __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)1890 static int __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1891 PyObject *__pyx_v_std_layout = 0;
1892 PyObject *__pyx_v_auto_alloc = 0;
1893 PyObject *__pyx_v_args = 0;
1894 int __pyx_lineno = 0;
1895 const char *__pyx_filename = NULL;
1896 int __pyx_clineno = 0;
1897 int __pyx_r;
1898 __Pyx_RefNannyDeclarations
1899 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
1900 if (PyTuple_GET_SIZE(__pyx_args) > 0) {
1901 __pyx_v_args = PyTuple_GetSlice(__pyx_args, 0, PyTuple_GET_SIZE(__pyx_args));
1902 if (unlikely(!__pyx_v_args)) {
1903 __Pyx_RefNannyFinishContext();
1904 return -1;
1905 }
1906 __Pyx_GOTREF(__pyx_v_args);
1907 } else {
1908 __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
1909 }
1910 {
1911 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_std_layout,&__pyx_n_s_auto_alloc,0};
1912 PyObject* values[2] = {0,0};
1913 values[0] = ((PyObject *)Py_True);
1914 values[1] = ((PyObject *)Py_True);
1915 if (unlikely(__pyx_kwds)) {
1916 Py_ssize_t kw_args;
1917 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1918 switch (pos_args) {
1919 default:
1920 case 0: break;
1921 }
1922 kw_args = PyDict_Size(__pyx_kwds);
1923 if (kw_args > 0 && likely(kw_args <= 2)) {
1924 Py_ssize_t index;
1925 for (index = 0; index < 2 && kw_args > 0; index++) {
1926 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
1927 if (value) { values[index] = value; kw_args--; }
1928 }
1929 }
1930 if (unlikely(kw_args > 0)) {
1931 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, 0, "__init__") < 0)) __PYX_ERR(0, 108, __pyx_L3_error)
1932 }
1933 } else if (PyTuple_GET_SIZE(__pyx_args) < 0) {
1934 goto __pyx_L5_argtuple_error;
1935 } else {
1936 }
1937 __pyx_v_std_layout = values[0];
1938 __pyx_v_auto_alloc = values[1];
1939 }
1940 goto __pyx_L4_argument_unpacking_done;
1941 __pyx_L5_argtuple_error:;
1942 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 108, __pyx_L3_error)
1943 __pyx_L3_error:;
1944 __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
1945 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
1946 __Pyx_RefNannyFinishContext();
1947 return -1;
1948 __pyx_L4_argument_unpacking_done:;
1949 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV___init__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self), __pyx_v_std_layout, __pyx_v_auto_alloc, __pyx_v_args);
1950
1951 /* function exit code */
1952 __Pyx_XDECREF(__pyx_v_args);
1953 __Pyx_RefNannyFinishContext();
1954 return __pyx_r;
1955 }
1956
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV___init__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self,PyObject * __pyx_v_std_layout,PyObject * __pyx_v_auto_alloc,PyObject * __pyx_v_args)1957 static int __pyx_pf_6gssapi_3raw_7ext_dce_3IOV___init__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_std_layout, PyObject *__pyx_v_auto_alloc, PyObject *__pyx_v_args) {
1958 PyObject *__pyx_v_buff_desc = NULL;
1959 PyObject *__pyx_v_buff_type = NULL;
1960 PyObject *__pyx_v_alloc = NULL;
1961 PyObject *__pyx_v_data = NULL;
1962 PyObject *__pyx_v_val = NULL;
1963 int __pyx_r;
1964 __Pyx_RefNannyDeclarations
1965 PyObject *__pyx_t_1 = NULL;
1966 int __pyx_t_2;
1967 PyObject *__pyx_t_3 = NULL;
1968 PyObject *__pyx_t_4 = NULL;
1969 PyObject *__pyx_t_5 = NULL;
1970 int __pyx_t_6;
1971 PyObject *__pyx_t_7 = NULL;
1972 int __pyx_t_8;
1973 Py_ssize_t __pyx_t_9;
1974 int __pyx_t_10;
1975 Py_ssize_t __pyx_t_11;
1976 PyObject *(*__pyx_t_12)(PyObject *);
1977 PyObject *__pyx_t_13 = NULL;
1978 int __pyx_lineno = 0;
1979 const char *__pyx_filename = NULL;
1980 int __pyx_clineno = 0;
1981 __Pyx_RefNannySetupContext("__init__", 0);
1982
1983 /* "gssapi/raw/ext_dce.pyx":109
1984 *
1985 * def __init__(IOV self, *args, std_layout=True, auto_alloc=True):
1986 * self._unprocessed = True # <<<<<<<<<<<<<<
1987 * self.c_changed = False
1988 *
1989 */
1990 __pyx_v_self->_unprocessed = 1;
1991
1992 /* "gssapi/raw/ext_dce.pyx":110
1993 * def __init__(IOV self, *args, std_layout=True, auto_alloc=True):
1994 * self._unprocessed = True
1995 * self.c_changed = False # <<<<<<<<<<<<<<
1996 *
1997 * self._buffs = []
1998 */
1999 __pyx_v_self->c_changed = 0;
2000
2001 /* "gssapi/raw/ext_dce.pyx":112
2002 * self.c_changed = False
2003 *
2004 * self._buffs = [] # <<<<<<<<<<<<<<
2005 *
2006 * if std_layout:
2007 */
2008 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 112, __pyx_L1_error)
2009 __Pyx_GOTREF(__pyx_t_1);
2010 __Pyx_GIVEREF(__pyx_t_1);
2011 __Pyx_GOTREF(__pyx_v_self->_buffs);
2012 __Pyx_DECREF(__pyx_v_self->_buffs);
2013 __pyx_v_self->_buffs = ((PyObject*)__pyx_t_1);
2014 __pyx_t_1 = 0;
2015
2016 /* "gssapi/raw/ext_dce.pyx":114
2017 * self._buffs = []
2018 *
2019 * if std_layout: # <<<<<<<<<<<<<<
2020 * self._buffs.append(IOVBuffer(IOVBufferType.header,
2021 * auto_alloc, None))
2022 */
2023 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_std_layout); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 114, __pyx_L1_error)
2024 if (__pyx_t_2) {
2025
2026 /* "gssapi/raw/ext_dce.pyx":115
2027 *
2028 * if std_layout:
2029 * self._buffs.append(IOVBuffer(IOVBufferType.header, # <<<<<<<<<<<<<<
2030 * auto_alloc, None))
2031 *
2032 */
2033 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
2034 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
2035 __PYX_ERR(0, 115, __pyx_L1_error)
2036 }
2037 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 115, __pyx_L1_error)
2038 __Pyx_GOTREF(__pyx_t_3);
2039 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 115, __pyx_L1_error)
2040 __Pyx_GOTREF(__pyx_t_4);
2041 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_header); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
2042 __Pyx_GOTREF(__pyx_t_5);
2043 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2044
2045 /* "gssapi/raw/ext_dce.pyx":116
2046 * if std_layout:
2047 * self._buffs.append(IOVBuffer(IOVBufferType.header,
2048 * auto_alloc, None)) # <<<<<<<<<<<<<<
2049 *
2050 * cdef char *val_copy
2051 */
2052 __pyx_t_4 = NULL;
2053 __pyx_t_6 = 0;
2054 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2055 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2056 if (likely(__pyx_t_4)) {
2057 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2058 __Pyx_INCREF(__pyx_t_4);
2059 __Pyx_INCREF(function);
2060 __Pyx_DECREF_SET(__pyx_t_3, function);
2061 __pyx_t_6 = 1;
2062 }
2063 }
2064 #if CYTHON_FAST_PYCALL
2065 if (PyFunction_Check(__pyx_t_3)) {
2066 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_5, __pyx_v_auto_alloc, Py_None};
2067 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
2068 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2069 __Pyx_GOTREF(__pyx_t_1);
2070 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2071 } else
2072 #endif
2073 #if CYTHON_FAST_PYCCALL
2074 if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
2075 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_5, __pyx_v_auto_alloc, Py_None};
2076 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
2077 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2078 __Pyx_GOTREF(__pyx_t_1);
2079 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2080 } else
2081 #endif
2082 {
2083 __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 115, __pyx_L1_error)
2084 __Pyx_GOTREF(__pyx_t_7);
2085 if (__pyx_t_4) {
2086 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
2087 }
2088 __Pyx_GIVEREF(__pyx_t_5);
2089 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_5);
2090 __Pyx_INCREF(__pyx_v_auto_alloc);
2091 __Pyx_GIVEREF(__pyx_v_auto_alloc);
2092 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_auto_alloc);
2093 __Pyx_INCREF(Py_None);
2094 __Pyx_GIVEREF(Py_None);
2095 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
2096 __pyx_t_5 = 0;
2097 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
2098 __Pyx_GOTREF(__pyx_t_1);
2099 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2100 }
2101 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2102
2103 /* "gssapi/raw/ext_dce.pyx":115
2104 *
2105 * if std_layout:
2106 * self._buffs.append(IOVBuffer(IOVBufferType.header, # <<<<<<<<<<<<<<
2107 * auto_alloc, None))
2108 *
2109 */
2110 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_buffs, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 115, __pyx_L1_error)
2111 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2112
2113 /* "gssapi/raw/ext_dce.pyx":114
2114 * self._buffs = []
2115 *
2116 * if std_layout: # <<<<<<<<<<<<<<
2117 * self._buffs.append(IOVBuffer(IOVBufferType.header,
2118 * auto_alloc, None))
2119 */
2120 }
2121
2122 /* "gssapi/raw/ext_dce.pyx":119
2123 *
2124 * cdef char *val_copy
2125 * for buff_desc in args: # <<<<<<<<<<<<<<
2126 * if isinstance(buff_desc, tuple):
2127 * if len(buff_desc) > 3 or len(buff_desc) < 2:
2128 */
2129 __pyx_t_1 = __pyx_v_args; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
2130 for (;;) {
2131 if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
2132 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2133 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 119, __pyx_L1_error)
2134 #else
2135 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 119, __pyx_L1_error)
2136 __Pyx_GOTREF(__pyx_t_3);
2137 #endif
2138 __Pyx_XDECREF_SET(__pyx_v_buff_desc, __pyx_t_3);
2139 __pyx_t_3 = 0;
2140
2141 /* "gssapi/raw/ext_dce.pyx":120
2142 * cdef char *val_copy
2143 * for buff_desc in args:
2144 * if isinstance(buff_desc, tuple): # <<<<<<<<<<<<<<
2145 * if len(buff_desc) > 3 or len(buff_desc) < 2:
2146 * raise ValueError("Buffer description tuples must be "
2147 */
2148 __pyx_t_2 = PyTuple_Check(__pyx_v_buff_desc);
2149 __pyx_t_10 = (__pyx_t_2 != 0);
2150 if (__pyx_t_10) {
2151
2152 /* "gssapi/raw/ext_dce.pyx":121
2153 * for buff_desc in args:
2154 * if isinstance(buff_desc, tuple):
2155 * if len(buff_desc) > 3 or len(buff_desc) < 2: # <<<<<<<<<<<<<<
2156 * raise ValueError("Buffer description tuples must be "
2157 * "length 2 or 3")
2158 */
2159 __pyx_t_11 = PyObject_Length(__pyx_v_buff_desc); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 121, __pyx_L1_error)
2160 __pyx_t_2 = ((__pyx_t_11 > 3) != 0);
2161 if (!__pyx_t_2) {
2162 } else {
2163 __pyx_t_10 = __pyx_t_2;
2164 goto __pyx_L8_bool_binop_done;
2165 }
2166 __pyx_t_11 = PyObject_Length(__pyx_v_buff_desc); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 121, __pyx_L1_error)
2167 __pyx_t_2 = ((__pyx_t_11 < 2) != 0);
2168 __pyx_t_10 = __pyx_t_2;
2169 __pyx_L8_bool_binop_done:;
2170 if (unlikely(__pyx_t_10)) {
2171
2172 /* "gssapi/raw/ext_dce.pyx":122
2173 * if isinstance(buff_desc, tuple):
2174 * if len(buff_desc) > 3 or len(buff_desc) < 2:
2175 * raise ValueError("Buffer description tuples must be " # <<<<<<<<<<<<<<
2176 * "length 2 or 3")
2177 *
2178 */
2179 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
2180 __Pyx_GOTREF(__pyx_t_3);
2181 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2182 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2183 __PYX_ERR(0, 122, __pyx_L1_error)
2184
2185 /* "gssapi/raw/ext_dce.pyx":121
2186 * for buff_desc in args:
2187 * if isinstance(buff_desc, tuple):
2188 * if len(buff_desc) > 3 or len(buff_desc) < 2: # <<<<<<<<<<<<<<
2189 * raise ValueError("Buffer description tuples must be "
2190 * "length 2 or 3")
2191 */
2192 }
2193
2194 /* "gssapi/raw/ext_dce.pyx":125
2195 * "length 2 or 3")
2196 *
2197 * buff_type = buff_desc[0] # <<<<<<<<<<<<<<
2198 *
2199 * if len(buff_desc) == 2:
2200 */
2201 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buff_desc, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
2202 __Pyx_GOTREF(__pyx_t_3);
2203 __Pyx_XDECREF_SET(__pyx_v_buff_type, __pyx_t_3);
2204 __pyx_t_3 = 0;
2205
2206 /* "gssapi/raw/ext_dce.pyx":127
2207 * buff_type = buff_desc[0]
2208 *
2209 * if len(buff_desc) == 2: # <<<<<<<<<<<<<<
2210 * if buff_type in self.AUTO_ALLOC_BUFFERS:
2211 * alloc = buff_desc[1]
2212 */
2213 __pyx_t_11 = PyObject_Length(__pyx_v_buff_desc); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(0, 127, __pyx_L1_error)
2214 __pyx_t_10 = ((__pyx_t_11 == 2) != 0);
2215 if (__pyx_t_10) {
2216
2217 /* "gssapi/raw/ext_dce.pyx":128
2218 *
2219 * if len(buff_desc) == 2:
2220 * if buff_type in self.AUTO_ALLOC_BUFFERS: # <<<<<<<<<<<<<<
2221 * alloc = buff_desc[1]
2222 * data = None
2223 */
2224 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_AUTO_ALLOC_BUFFERS); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
2225 __Pyx_GOTREF(__pyx_t_3);
2226 __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_buff_type, __pyx_t_3, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
2227 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2228 __pyx_t_2 = (__pyx_t_10 != 0);
2229 if (__pyx_t_2) {
2230
2231 /* "gssapi/raw/ext_dce.pyx":129
2232 * if len(buff_desc) == 2:
2233 * if buff_type in self.AUTO_ALLOC_BUFFERS:
2234 * alloc = buff_desc[1] # <<<<<<<<<<<<<<
2235 * data = None
2236 * else:
2237 */
2238 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buff_desc, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
2239 __Pyx_GOTREF(__pyx_t_3);
2240 __Pyx_XDECREF_SET(__pyx_v_alloc, __pyx_t_3);
2241 __pyx_t_3 = 0;
2242
2243 /* "gssapi/raw/ext_dce.pyx":130
2244 * if buff_type in self.AUTO_ALLOC_BUFFERS:
2245 * alloc = buff_desc[1]
2246 * data = None # <<<<<<<<<<<<<<
2247 * else:
2248 * data = buff_desc[1]
2249 */
2250 __Pyx_INCREF(Py_None);
2251 __Pyx_XDECREF_SET(__pyx_v_data, Py_None);
2252
2253 /* "gssapi/raw/ext_dce.pyx":128
2254 *
2255 * if len(buff_desc) == 2:
2256 * if buff_type in self.AUTO_ALLOC_BUFFERS: # <<<<<<<<<<<<<<
2257 * alloc = buff_desc[1]
2258 * data = None
2259 */
2260 goto __pyx_L11;
2261 }
2262
2263 /* "gssapi/raw/ext_dce.pyx":132
2264 * data = None
2265 * else:
2266 * data = buff_desc[1] # <<<<<<<<<<<<<<
2267 * alloc = False
2268 * else:
2269 */
2270 /*else*/ {
2271 __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_buff_desc, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
2272 __Pyx_GOTREF(__pyx_t_3);
2273 __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_3);
2274 __pyx_t_3 = 0;
2275
2276 /* "gssapi/raw/ext_dce.pyx":133
2277 * else:
2278 * data = buff_desc[1]
2279 * alloc = False # <<<<<<<<<<<<<<
2280 * else:
2281 * (buff_type, alloc, data) = buff_desc
2282 */
2283 __Pyx_INCREF(Py_False);
2284 __Pyx_XDECREF_SET(__pyx_v_alloc, Py_False);
2285 }
2286 __pyx_L11:;
2287
2288 /* "gssapi/raw/ext_dce.pyx":127
2289 * buff_type = buff_desc[0]
2290 *
2291 * if len(buff_desc) == 2: # <<<<<<<<<<<<<<
2292 * if buff_type in self.AUTO_ALLOC_BUFFERS:
2293 * alloc = buff_desc[1]
2294 */
2295 goto __pyx_L10;
2296 }
2297
2298 /* "gssapi/raw/ext_dce.pyx":135
2299 * alloc = False
2300 * else:
2301 * (buff_type, alloc, data) = buff_desc # <<<<<<<<<<<<<<
2302 *
2303 * self._buffs.append(IOVBuffer(buff_type, alloc, data))
2304 */
2305 /*else*/ {
2306 if ((likely(PyTuple_CheckExact(__pyx_v_buff_desc))) || (PyList_CheckExact(__pyx_v_buff_desc))) {
2307 PyObject* sequence = __pyx_v_buff_desc;
2308 Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
2309 if (unlikely(size != 3)) {
2310 if (size > 3) __Pyx_RaiseTooManyValuesError(3);
2311 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
2312 __PYX_ERR(0, 135, __pyx_L1_error)
2313 }
2314 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2315 if (likely(PyTuple_CheckExact(sequence))) {
2316 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
2317 __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
2318 __pyx_t_5 = PyTuple_GET_ITEM(sequence, 2);
2319 } else {
2320 __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
2321 __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
2322 __pyx_t_5 = PyList_GET_ITEM(sequence, 2);
2323 }
2324 __Pyx_INCREF(__pyx_t_3);
2325 __Pyx_INCREF(__pyx_t_7);
2326 __Pyx_INCREF(__pyx_t_5);
2327 #else
2328 __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
2329 __Pyx_GOTREF(__pyx_t_3);
2330 __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
2331 __Pyx_GOTREF(__pyx_t_7);
2332 __pyx_t_5 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 135, __pyx_L1_error)
2333 __Pyx_GOTREF(__pyx_t_5);
2334 #endif
2335 } else {
2336 Py_ssize_t index = -1;
2337 __pyx_t_4 = PyObject_GetIter(__pyx_v_buff_desc); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
2338 __Pyx_GOTREF(__pyx_t_4);
2339 __pyx_t_12 = Py_TYPE(__pyx_t_4)->tp_iternext;
2340 index = 0; __pyx_t_3 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L12_unpacking_failed;
2341 __Pyx_GOTREF(__pyx_t_3);
2342 index = 1; __pyx_t_7 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed;
2343 __Pyx_GOTREF(__pyx_t_7);
2344 index = 2; __pyx_t_5 = __pyx_t_12(__pyx_t_4); if (unlikely(!__pyx_t_5)) goto __pyx_L12_unpacking_failed;
2345 __Pyx_GOTREF(__pyx_t_5);
2346 if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_4), 3) < 0) __PYX_ERR(0, 135, __pyx_L1_error)
2347 __pyx_t_12 = NULL;
2348 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2349 goto __pyx_L13_unpacking_done;
2350 __pyx_L12_unpacking_failed:;
2351 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2352 __pyx_t_12 = NULL;
2353 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
2354 __PYX_ERR(0, 135, __pyx_L1_error)
2355 __pyx_L13_unpacking_done:;
2356 }
2357 __Pyx_DECREF_SET(__pyx_v_buff_type, __pyx_t_3);
2358 __pyx_t_3 = 0;
2359 __Pyx_XDECREF_SET(__pyx_v_alloc, __pyx_t_7);
2360 __pyx_t_7 = 0;
2361 __Pyx_XDECREF_SET(__pyx_v_data, __pyx_t_5);
2362 __pyx_t_5 = 0;
2363 }
2364 __pyx_L10:;
2365
2366 /* "gssapi/raw/ext_dce.pyx":137
2367 * (buff_type, alloc, data) = buff_desc
2368 *
2369 * self._buffs.append(IOVBuffer(buff_type, alloc, data)) # <<<<<<<<<<<<<<
2370 * elif isinstance(buff_desc, bytes): # assume type data
2371 * val = buff_desc
2372 */
2373 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
2374 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
2375 __PYX_ERR(0, 137, __pyx_L1_error)
2376 }
2377 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
2378 __Pyx_GOTREF(__pyx_t_7);
2379 __pyx_t_3 = NULL;
2380 __pyx_t_6 = 0;
2381 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
2382 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_7);
2383 if (likely(__pyx_t_3)) {
2384 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
2385 __Pyx_INCREF(__pyx_t_3);
2386 __Pyx_INCREF(function);
2387 __Pyx_DECREF_SET(__pyx_t_7, function);
2388 __pyx_t_6 = 1;
2389 }
2390 }
2391 #if CYTHON_FAST_PYCALL
2392 if (PyFunction_Check(__pyx_t_7)) {
2393 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_buff_type, __pyx_v_alloc, __pyx_v_data};
2394 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
2395 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2396 __Pyx_GOTREF(__pyx_t_5);
2397 } else
2398 #endif
2399 #if CYTHON_FAST_PYCCALL
2400 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
2401 PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_buff_type, __pyx_v_alloc, __pyx_v_data};
2402 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
2403 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
2404 __Pyx_GOTREF(__pyx_t_5);
2405 } else
2406 #endif
2407 {
2408 __pyx_t_4 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 137, __pyx_L1_error)
2409 __Pyx_GOTREF(__pyx_t_4);
2410 if (__pyx_t_3) {
2411 __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
2412 }
2413 __Pyx_INCREF(__pyx_v_buff_type);
2414 __Pyx_GIVEREF(__pyx_v_buff_type);
2415 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_buff_type);
2416 __Pyx_INCREF(__pyx_v_alloc);
2417 __Pyx_GIVEREF(__pyx_v_alloc);
2418 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_alloc);
2419 __Pyx_INCREF(__pyx_v_data);
2420 __Pyx_GIVEREF(__pyx_v_data);
2421 PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, __pyx_v_data);
2422 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 137, __pyx_L1_error)
2423 __Pyx_GOTREF(__pyx_t_5);
2424 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2425 }
2426 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2427 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_buffs, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 137, __pyx_L1_error)
2428 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2429
2430 /* "gssapi/raw/ext_dce.pyx":120
2431 * cdef char *val_copy
2432 * for buff_desc in args:
2433 * if isinstance(buff_desc, tuple): # <<<<<<<<<<<<<<
2434 * if len(buff_desc) > 3 or len(buff_desc) < 2:
2435 * raise ValueError("Buffer description tuples must be "
2436 */
2437 goto __pyx_L6;
2438 }
2439
2440 /* "gssapi/raw/ext_dce.pyx":138
2441 *
2442 * self._buffs.append(IOVBuffer(buff_type, alloc, data))
2443 * elif isinstance(buff_desc, bytes): # assume type data # <<<<<<<<<<<<<<
2444 * val = buff_desc
2445 * self._buffs.append(IOVBuffer(IOVBufferType.data, False, val))
2446 */
2447 __pyx_t_2 = PyBytes_Check(__pyx_v_buff_desc);
2448 __pyx_t_10 = (__pyx_t_2 != 0);
2449 if (__pyx_t_10) {
2450
2451 /* "gssapi/raw/ext_dce.pyx":139
2452 * self._buffs.append(IOVBuffer(buff_type, alloc, data))
2453 * elif isinstance(buff_desc, bytes): # assume type data
2454 * val = buff_desc # <<<<<<<<<<<<<<
2455 * self._buffs.append(IOVBuffer(IOVBufferType.data, False, val))
2456 * else:
2457 */
2458 __Pyx_INCREF(__pyx_v_buff_desc);
2459 __Pyx_XDECREF_SET(__pyx_v_val, __pyx_v_buff_desc);
2460
2461 /* "gssapi/raw/ext_dce.pyx":140
2462 * elif isinstance(buff_desc, bytes): # assume type data
2463 * val = buff_desc
2464 * self._buffs.append(IOVBuffer(IOVBufferType.data, False, val)) # <<<<<<<<<<<<<<
2465 * else:
2466 * alloc = False
2467 */
2468 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
2469 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
2470 __PYX_ERR(0, 140, __pyx_L1_error)
2471 }
2472 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 140, __pyx_L1_error)
2473 __Pyx_GOTREF(__pyx_t_7);
2474 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
2475 __Pyx_GOTREF(__pyx_t_4);
2476 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
2477 __Pyx_GOTREF(__pyx_t_3);
2478 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2479 __pyx_t_4 = NULL;
2480 __pyx_t_6 = 0;
2481 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
2482 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_7);
2483 if (likely(__pyx_t_4)) {
2484 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
2485 __Pyx_INCREF(__pyx_t_4);
2486 __Pyx_INCREF(function);
2487 __Pyx_DECREF_SET(__pyx_t_7, function);
2488 __pyx_t_6 = 1;
2489 }
2490 }
2491 #if CYTHON_FAST_PYCALL
2492 if (PyFunction_Check(__pyx_t_7)) {
2493 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, Py_False, __pyx_v_val};
2494 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
2495 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2496 __Pyx_GOTREF(__pyx_t_5);
2497 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2498 } else
2499 #endif
2500 #if CYTHON_FAST_PYCCALL
2501 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
2502 PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, Py_False, __pyx_v_val};
2503 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
2504 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2505 __Pyx_GOTREF(__pyx_t_5);
2506 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2507 } else
2508 #endif
2509 {
2510 __pyx_t_13 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 140, __pyx_L1_error)
2511 __Pyx_GOTREF(__pyx_t_13);
2512 if (__pyx_t_4) {
2513 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_4); __pyx_t_4 = NULL;
2514 }
2515 __Pyx_GIVEREF(__pyx_t_3);
2516 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_t_3);
2517 __Pyx_INCREF(Py_False);
2518 __Pyx_GIVEREF(Py_False);
2519 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, Py_False);
2520 __Pyx_INCREF(__pyx_v_val);
2521 __Pyx_GIVEREF(__pyx_v_val);
2522 PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_6, __pyx_v_val);
2523 __pyx_t_3 = 0;
2524 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
2525 __Pyx_GOTREF(__pyx_t_5);
2526 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
2527 }
2528 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2529 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_buffs, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 140, __pyx_L1_error)
2530 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2531
2532 /* "gssapi/raw/ext_dce.pyx":138
2533 *
2534 * self._buffs.append(IOVBuffer(buff_type, alloc, data))
2535 * elif isinstance(buff_desc, bytes): # assume type data # <<<<<<<<<<<<<<
2536 * val = buff_desc
2537 * self._buffs.append(IOVBuffer(IOVBufferType.data, False, val))
2538 */
2539 goto __pyx_L6;
2540 }
2541
2542 /* "gssapi/raw/ext_dce.pyx":142
2543 * self._buffs.append(IOVBuffer(IOVBufferType.data, False, val))
2544 * else:
2545 * alloc = False # <<<<<<<<<<<<<<
2546 * if buff_desc in self.AUTO_ALLOC_BUFFERS:
2547 * alloc = auto_alloc
2548 */
2549 /*else*/ {
2550 __Pyx_INCREF(Py_False);
2551 __Pyx_XDECREF_SET(__pyx_v_alloc, Py_False);
2552
2553 /* "gssapi/raw/ext_dce.pyx":143
2554 * else:
2555 * alloc = False
2556 * if buff_desc in self.AUTO_ALLOC_BUFFERS: # <<<<<<<<<<<<<<
2557 * alloc = auto_alloc
2558 *
2559 */
2560 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_AUTO_ALLOC_BUFFERS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
2561 __Pyx_GOTREF(__pyx_t_5);
2562 __pyx_t_10 = (__Pyx_PySequence_ContainsTF(__pyx_v_buff_desc, __pyx_t_5, Py_EQ)); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
2563 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2564 __pyx_t_2 = (__pyx_t_10 != 0);
2565 if (__pyx_t_2) {
2566
2567 /* "gssapi/raw/ext_dce.pyx":144
2568 * alloc = False
2569 * if buff_desc in self.AUTO_ALLOC_BUFFERS:
2570 * alloc = auto_alloc # <<<<<<<<<<<<<<
2571 *
2572 * self._buffs.append(IOVBuffer(buff_desc, alloc, None))
2573 */
2574 __Pyx_INCREF(__pyx_v_auto_alloc);
2575 __Pyx_DECREF_SET(__pyx_v_alloc, __pyx_v_auto_alloc);
2576
2577 /* "gssapi/raw/ext_dce.pyx":143
2578 * else:
2579 * alloc = False
2580 * if buff_desc in self.AUTO_ALLOC_BUFFERS: # <<<<<<<<<<<<<<
2581 * alloc = auto_alloc
2582 *
2583 */
2584 }
2585
2586 /* "gssapi/raw/ext_dce.pyx":146
2587 * alloc = auto_alloc
2588 *
2589 * self._buffs.append(IOVBuffer(buff_desc, alloc, None)) # <<<<<<<<<<<<<<
2590 *
2591 * if std_layout:
2592 */
2593 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
2594 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
2595 __PYX_ERR(0, 146, __pyx_L1_error)
2596 }
2597 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 146, __pyx_L1_error)
2598 __Pyx_GOTREF(__pyx_t_7);
2599 __pyx_t_13 = NULL;
2600 __pyx_t_6 = 0;
2601 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
2602 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_7);
2603 if (likely(__pyx_t_13)) {
2604 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
2605 __Pyx_INCREF(__pyx_t_13);
2606 __Pyx_INCREF(function);
2607 __Pyx_DECREF_SET(__pyx_t_7, function);
2608 __pyx_t_6 = 1;
2609 }
2610 }
2611 #if CYTHON_FAST_PYCALL
2612 if (PyFunction_Check(__pyx_t_7)) {
2613 PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_v_buff_desc, __pyx_v_alloc, Py_None};
2614 __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
2615 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
2616 __Pyx_GOTREF(__pyx_t_5);
2617 } else
2618 #endif
2619 #if CYTHON_FAST_PYCCALL
2620 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
2621 PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_v_buff_desc, __pyx_v_alloc, Py_None};
2622 __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
2623 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
2624 __Pyx_GOTREF(__pyx_t_5);
2625 } else
2626 #endif
2627 {
2628 __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
2629 __Pyx_GOTREF(__pyx_t_3);
2630 if (__pyx_t_13) {
2631 __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_13); __pyx_t_13 = NULL;
2632 }
2633 __Pyx_INCREF(__pyx_v_buff_desc);
2634 __Pyx_GIVEREF(__pyx_v_buff_desc);
2635 PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_v_buff_desc);
2636 __Pyx_INCREF(__pyx_v_alloc);
2637 __Pyx_GIVEREF(__pyx_v_alloc);
2638 PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_v_alloc);
2639 __Pyx_INCREF(Py_None);
2640 __Pyx_GIVEREF(Py_None);
2641 PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, Py_None);
2642 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 146, __pyx_L1_error)
2643 __Pyx_GOTREF(__pyx_t_5);
2644 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2645 }
2646 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2647 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_buffs, __pyx_t_5); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 146, __pyx_L1_error)
2648 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2649 }
2650 __pyx_L6:;
2651
2652 /* "gssapi/raw/ext_dce.pyx":119
2653 *
2654 * cdef char *val_copy
2655 * for buff_desc in args: # <<<<<<<<<<<<<<
2656 * if isinstance(buff_desc, tuple):
2657 * if len(buff_desc) > 3 or len(buff_desc) < 2:
2658 */
2659 }
2660 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2661
2662 /* "gssapi/raw/ext_dce.pyx":148
2663 * self._buffs.append(IOVBuffer(buff_desc, alloc, None))
2664 *
2665 * if std_layout: # <<<<<<<<<<<<<<
2666 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc,
2667 * None))
2668 */
2669 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_std_layout); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 148, __pyx_L1_error)
2670 if (__pyx_t_2) {
2671
2672 /* "gssapi/raw/ext_dce.pyx":149
2673 *
2674 * if std_layout:
2675 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc, # <<<<<<<<<<<<<<
2676 * None))
2677 * self._buffs.append(IOVBuffer(IOVBufferType.trailer, auto_alloc,
2678 */
2679 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
2680 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
2681 __PYX_ERR(0, 149, __pyx_L1_error)
2682 }
2683 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 149, __pyx_L1_error)
2684 __Pyx_GOTREF(__pyx_t_5);
2685 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 149, __pyx_L1_error)
2686 __Pyx_GOTREF(__pyx_t_7);
2687 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_padding); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
2688 __Pyx_GOTREF(__pyx_t_3);
2689 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2690
2691 /* "gssapi/raw/ext_dce.pyx":150
2692 * if std_layout:
2693 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc,
2694 * None)) # <<<<<<<<<<<<<<
2695 * self._buffs.append(IOVBuffer(IOVBufferType.trailer, auto_alloc,
2696 * None))
2697 */
2698 __pyx_t_7 = NULL;
2699 __pyx_t_6 = 0;
2700 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
2701 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
2702 if (likely(__pyx_t_7)) {
2703 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2704 __Pyx_INCREF(__pyx_t_7);
2705 __Pyx_INCREF(function);
2706 __Pyx_DECREF_SET(__pyx_t_5, function);
2707 __pyx_t_6 = 1;
2708 }
2709 }
2710 #if CYTHON_FAST_PYCALL
2711 if (PyFunction_Check(__pyx_t_5)) {
2712 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_v_auto_alloc, Py_None};
2713 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
2714 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2715 __Pyx_GOTREF(__pyx_t_1);
2716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2717 } else
2718 #endif
2719 #if CYTHON_FAST_PYCCALL
2720 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
2721 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_v_auto_alloc, Py_None};
2722 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
2723 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
2724 __Pyx_GOTREF(__pyx_t_1);
2725 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2726 } else
2727 #endif
2728 {
2729 __pyx_t_13 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 149, __pyx_L1_error)
2730 __Pyx_GOTREF(__pyx_t_13);
2731 if (__pyx_t_7) {
2732 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_7); __pyx_t_7 = NULL;
2733 }
2734 __Pyx_GIVEREF(__pyx_t_3);
2735 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_6, __pyx_t_3);
2736 __Pyx_INCREF(__pyx_v_auto_alloc);
2737 __Pyx_GIVEREF(__pyx_v_auto_alloc);
2738 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_6, __pyx_v_auto_alloc);
2739 __Pyx_INCREF(Py_None);
2740 __Pyx_GIVEREF(Py_None);
2741 PyTuple_SET_ITEM(__pyx_t_13, 2+__pyx_t_6, Py_None);
2742 __pyx_t_3 = 0;
2743 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_13, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
2744 __Pyx_GOTREF(__pyx_t_1);
2745 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
2746 }
2747 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2748
2749 /* "gssapi/raw/ext_dce.pyx":149
2750 *
2751 * if std_layout:
2752 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc, # <<<<<<<<<<<<<<
2753 * None))
2754 * self._buffs.append(IOVBuffer(IOVBufferType.trailer, auto_alloc,
2755 */
2756 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_buffs, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 149, __pyx_L1_error)
2757 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2758
2759 /* "gssapi/raw/ext_dce.pyx":151
2760 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc,
2761 * None))
2762 * self._buffs.append(IOVBuffer(IOVBufferType.trailer, auto_alloc, # <<<<<<<<<<<<<<
2763 * None))
2764 *
2765 */
2766 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
2767 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
2768 __PYX_ERR(0, 151, __pyx_L1_error)
2769 }
2770 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 151, __pyx_L1_error)
2771 __Pyx_GOTREF(__pyx_t_5);
2772 __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 151, __pyx_L1_error)
2773 __Pyx_GOTREF(__pyx_t_13);
2774 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_n_s_trailer); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
2775 __Pyx_GOTREF(__pyx_t_3);
2776 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
2777
2778 /* "gssapi/raw/ext_dce.pyx":152
2779 * None))
2780 * self._buffs.append(IOVBuffer(IOVBufferType.trailer, auto_alloc,
2781 * None)) # <<<<<<<<<<<<<<
2782 *
2783 * cdef gss_iov_buffer_desc* __cvalue__(IOV self) except NULL:
2784 */
2785 __pyx_t_13 = NULL;
2786 __pyx_t_6 = 0;
2787 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
2788 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_5);
2789 if (likely(__pyx_t_13)) {
2790 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
2791 __Pyx_INCREF(__pyx_t_13);
2792 __Pyx_INCREF(function);
2793 __Pyx_DECREF_SET(__pyx_t_5, function);
2794 __pyx_t_6 = 1;
2795 }
2796 }
2797 #if CYTHON_FAST_PYCALL
2798 if (PyFunction_Check(__pyx_t_5)) {
2799 PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_t_3, __pyx_v_auto_alloc, Py_None};
2800 __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
2801 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
2802 __Pyx_GOTREF(__pyx_t_1);
2803 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2804 } else
2805 #endif
2806 #if CYTHON_FAST_PYCCALL
2807 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
2808 PyObject *__pyx_temp[4] = {__pyx_t_13, __pyx_t_3, __pyx_v_auto_alloc, Py_None};
2809 __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
2810 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
2811 __Pyx_GOTREF(__pyx_t_1);
2812 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2813 } else
2814 #endif
2815 {
2816 __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error)
2817 __Pyx_GOTREF(__pyx_t_7);
2818 if (__pyx_t_13) {
2819 __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_13); __pyx_t_13 = NULL;
2820 }
2821 __Pyx_GIVEREF(__pyx_t_3);
2822 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_3);
2823 __Pyx_INCREF(__pyx_v_auto_alloc);
2824 __Pyx_GIVEREF(__pyx_v_auto_alloc);
2825 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_auto_alloc);
2826 __Pyx_INCREF(Py_None);
2827 __Pyx_GIVEREF(Py_None);
2828 PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
2829 __pyx_t_3 = 0;
2830 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
2831 __Pyx_GOTREF(__pyx_t_1);
2832 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2833 }
2834 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
2835
2836 /* "gssapi/raw/ext_dce.pyx":151
2837 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc,
2838 * None))
2839 * self._buffs.append(IOVBuffer(IOVBufferType.trailer, auto_alloc, # <<<<<<<<<<<<<<
2840 * None))
2841 *
2842 */
2843 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_buffs, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 151, __pyx_L1_error)
2844 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2845
2846 /* "gssapi/raw/ext_dce.pyx":148
2847 * self._buffs.append(IOVBuffer(buff_desc, alloc, None))
2848 *
2849 * if std_layout: # <<<<<<<<<<<<<<
2850 * self._buffs.append(IOVBuffer(IOVBufferType.padding, auto_alloc,
2851 * None))
2852 */
2853 }
2854
2855 /* "gssapi/raw/ext_dce.pyx":108
2856 * IOVBufferType.trailer])
2857 *
2858 * def __init__(IOV self, *args, std_layout=True, auto_alloc=True): # <<<<<<<<<<<<<<
2859 * self._unprocessed = True
2860 * self.c_changed = False
2861 */
2862
2863 /* function exit code */
2864 __pyx_r = 0;
2865 goto __pyx_L0;
2866 __pyx_L1_error:;
2867 __Pyx_XDECREF(__pyx_t_1);
2868 __Pyx_XDECREF(__pyx_t_3);
2869 __Pyx_XDECREF(__pyx_t_4);
2870 __Pyx_XDECREF(__pyx_t_5);
2871 __Pyx_XDECREF(__pyx_t_7);
2872 __Pyx_XDECREF(__pyx_t_13);
2873 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2874 __pyx_r = -1;
2875 __pyx_L0:;
2876 __Pyx_XDECREF(__pyx_v_buff_desc);
2877 __Pyx_XDECREF(__pyx_v_buff_type);
2878 __Pyx_XDECREF(__pyx_v_alloc);
2879 __Pyx_XDECREF(__pyx_v_data);
2880 __Pyx_XDECREF(__pyx_v_val);
2881 __Pyx_RefNannyFinishContext();
2882 return __pyx_r;
2883 }
2884
2885 /* "gssapi/raw/ext_dce.pyx":154
2886 * None))
2887 *
2888 * cdef gss_iov_buffer_desc* __cvalue__(IOV self) except NULL: # <<<<<<<<<<<<<<
2889 * cdef OM_uint32 tmp_min_stat
2890 * cdef int i
2891 */
2892
__pyx_f_6gssapi_3raw_7ext_dce_3IOV___cvalue__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)2893 static gss_iov_buffer_desc *__pyx_f_6gssapi_3raw_7ext_dce_3IOV___cvalue__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
2894 OM_uint32 __pyx_v_tmp_min_stat;
2895 int __pyx_v_i;
2896 PyObject *__pyx_v_buff = NULL;
2897 gss_iov_buffer_desc *__pyx_r;
2898 __Pyx_RefNannyDeclarations
2899 int __pyx_t_1;
2900 PyObject *__pyx_t_2 = NULL;
2901 Py_ssize_t __pyx_t_3;
2902 int __pyx_t_4;
2903 int __pyx_t_5;
2904 int __pyx_t_6;
2905 OM_uint32 __pyx_t_7;
2906 int __pyx_t_8;
2907 int __pyx_t_9;
2908 char *__pyx_t_10;
2909 int __pyx_lineno = 0;
2910 const char *__pyx_filename = NULL;
2911 int __pyx_clineno = 0;
2912 __Pyx_RefNannySetupContext("__cvalue__", 0);
2913
2914 /* "gssapi/raw/ext_dce.pyx":157
2915 * cdef OM_uint32 tmp_min_stat
2916 * cdef int i
2917 * if self._unprocessed: # <<<<<<<<<<<<<<
2918 * if self._iov is not NULL:
2919 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
2920 */
2921 __pyx_t_1 = (__pyx_v_self->_unprocessed != 0);
2922 if (__pyx_t_1) {
2923
2924 /* "gssapi/raw/ext_dce.pyx":158
2925 * cdef int i
2926 * if self._unprocessed:
2927 * if self._iov is not NULL: # <<<<<<<<<<<<<<
2928 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
2929 * free(self._iov)
2930 */
2931 __pyx_t_1 = ((__pyx_v_self->_iov != NULL) != 0);
2932 if (__pyx_t_1) {
2933
2934 /* "gssapi/raw/ext_dce.pyx":159
2935 * if self._unprocessed:
2936 * if self._iov is not NULL:
2937 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len) # <<<<<<<<<<<<<<
2938 * free(self._iov)
2939 *
2940 */
2941 (void)(gss_release_iov_buffer((&__pyx_v_tmp_min_stat), __pyx_v_self->_iov, __pyx_v_self->iov_len));
2942
2943 /* "gssapi/raw/ext_dce.pyx":160
2944 * if self._iov is not NULL:
2945 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
2946 * free(self._iov) # <<<<<<<<<<<<<<
2947 *
2948 * self.iov_len = len(self._buffs)
2949 */
2950 free(__pyx_v_self->_iov);
2951
2952 /* "gssapi/raw/ext_dce.pyx":158
2953 * cdef int i
2954 * if self._unprocessed:
2955 * if self._iov is not NULL: # <<<<<<<<<<<<<<
2956 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
2957 * free(self._iov)
2958 */
2959 }
2960
2961 /* "gssapi/raw/ext_dce.pyx":162
2962 * free(self._iov)
2963 *
2964 * self.iov_len = len(self._buffs) # <<<<<<<<<<<<<<
2965 * self._iov = <gss_iov_buffer_desc *>calloc(
2966 * self.iov_len, sizeof(gss_iov_buffer_desc))
2967 */
2968 __pyx_t_2 = __pyx_v_self->_buffs;
2969 __Pyx_INCREF(__pyx_t_2);
2970 if (unlikely(__pyx_t_2 == Py_None)) {
2971 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
2972 __PYX_ERR(0, 162, __pyx_L1_error)
2973 }
2974 __pyx_t_3 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 162, __pyx_L1_error)
2975 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2976 __pyx_v_self->iov_len = __pyx_t_3;
2977
2978 /* "gssapi/raw/ext_dce.pyx":163
2979 *
2980 * self.iov_len = len(self._buffs)
2981 * self._iov = <gss_iov_buffer_desc *>calloc( # <<<<<<<<<<<<<<
2982 * self.iov_len, sizeof(gss_iov_buffer_desc))
2983 * if self._iov is NULL:
2984 */
2985 __pyx_v_self->_iov = ((gss_iov_buffer_desc *)calloc(__pyx_v_self->iov_len, (sizeof(gss_iov_buffer_desc))));
2986
2987 /* "gssapi/raw/ext_dce.pyx":165
2988 * self._iov = <gss_iov_buffer_desc *>calloc(
2989 * self.iov_len, sizeof(gss_iov_buffer_desc))
2990 * if self._iov is NULL: # <<<<<<<<<<<<<<
2991 * raise MemoryError("Cannot calloc for IOV buffer array")
2992 *
2993 */
2994 __pyx_t_1 = ((__pyx_v_self->_iov == NULL) != 0);
2995 if (unlikely(__pyx_t_1)) {
2996
2997 /* "gssapi/raw/ext_dce.pyx":166
2998 * self.iov_len, sizeof(gss_iov_buffer_desc))
2999 * if self._iov is NULL:
3000 * raise MemoryError("Cannot calloc for IOV buffer array") # <<<<<<<<<<<<<<
3001 *
3002 * for i in range(self.iov_len):
3003 */
3004 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
3005 __Pyx_GOTREF(__pyx_t_2);
3006 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3007 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3008 __PYX_ERR(0, 166, __pyx_L1_error)
3009
3010 /* "gssapi/raw/ext_dce.pyx":165
3011 * self._iov = <gss_iov_buffer_desc *>calloc(
3012 * self.iov_len, sizeof(gss_iov_buffer_desc))
3013 * if self._iov is NULL: # <<<<<<<<<<<<<<
3014 * raise MemoryError("Cannot calloc for IOV buffer array")
3015 *
3016 */
3017 }
3018
3019 /* "gssapi/raw/ext_dce.pyx":168
3020 * raise MemoryError("Cannot calloc for IOV buffer array")
3021 *
3022 * for i in range(self.iov_len): # <<<<<<<<<<<<<<
3023 * buff = self._buffs[i]
3024 * self._iov[i].type = buff.type
3025 */
3026 __pyx_t_4 = __pyx_v_self->iov_len;
3027 __pyx_t_5 = __pyx_t_4;
3028 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
3029 __pyx_v_i = __pyx_t_6;
3030
3031 /* "gssapi/raw/ext_dce.pyx":169
3032 *
3033 * for i in range(self.iov_len):
3034 * buff = self._buffs[i] # <<<<<<<<<<<<<<
3035 * self._iov[i].type = buff.type
3036 *
3037 */
3038 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
3039 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3040 __PYX_ERR(0, 169, __pyx_L1_error)
3041 }
3042 __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->_buffs, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 169, __pyx_L1_error)
3043 __Pyx_GOTREF(__pyx_t_2);
3044 __Pyx_XDECREF_SET(__pyx_v_buff, __pyx_t_2);
3045 __pyx_t_2 = 0;
3046
3047 /* "gssapi/raw/ext_dce.pyx":170
3048 * for i in range(self.iov_len):
3049 * buff = self._buffs[i]
3050 * self._iov[i].type = buff.type # <<<<<<<<<<<<<<
3051 *
3052 * if buff.allocate:
3053 */
3054 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_type); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
3055 __Pyx_GOTREF(__pyx_t_2);
3056 __pyx_t_7 = __Pyx_PyInt_As_uint32_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((OM_uint32)-1)) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
3057 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3058 (__pyx_v_self->_iov[__pyx_v_i]).type = __pyx_t_7;
3059
3060 /* "gssapi/raw/ext_dce.pyx":172
3061 * self._iov[i].type = buff.type
3062 *
3063 * if buff.allocate: # <<<<<<<<<<<<<<
3064 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATE
3065 * elif buff.allocate is None:
3066 */
3067 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_allocate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 172, __pyx_L1_error)
3068 __Pyx_GOTREF(__pyx_t_2);
3069 __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3070 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3071 if (__pyx_t_1) {
3072
3073 /* "gssapi/raw/ext_dce.pyx":173
3074 *
3075 * if buff.allocate:
3076 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATE # <<<<<<<<<<<<<<
3077 * elif buff.allocate is None:
3078 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATED
3079 */
3080 __pyx_t_8 = __pyx_v_i;
3081 (__pyx_v_self->_iov[__pyx_t_8]).type = ((__pyx_v_self->_iov[__pyx_t_8]).type | GSS_IOV_BUFFER_FLAG_ALLOCATE);
3082
3083 /* "gssapi/raw/ext_dce.pyx":172
3084 * self._iov[i].type = buff.type
3085 *
3086 * if buff.allocate: # <<<<<<<<<<<<<<
3087 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATE
3088 * elif buff.allocate is None:
3089 */
3090 goto __pyx_L8;
3091 }
3092
3093 /* "gssapi/raw/ext_dce.pyx":174
3094 * if buff.allocate:
3095 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATE
3096 * elif buff.allocate is None: # <<<<<<<<<<<<<<
3097 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATED
3098 *
3099 */
3100 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_allocate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 174, __pyx_L1_error)
3101 __Pyx_GOTREF(__pyx_t_2);
3102 __pyx_t_1 = (__pyx_t_2 == Py_None);
3103 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3104 __pyx_t_9 = (__pyx_t_1 != 0);
3105 if (__pyx_t_9) {
3106
3107 /* "gssapi/raw/ext_dce.pyx":175
3108 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATE
3109 * elif buff.allocate is None:
3110 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATED # <<<<<<<<<<<<<<
3111 *
3112 * if buff.value is None:
3113 */
3114 __pyx_t_8 = __pyx_v_i;
3115 (__pyx_v_self->_iov[__pyx_t_8]).type = ((__pyx_v_self->_iov[__pyx_t_8]).type | GSS_IOV_BUFFER_FLAG_ALLOCATED);
3116
3117 /* "gssapi/raw/ext_dce.pyx":174
3118 * if buff.allocate:
3119 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATE
3120 * elif buff.allocate is None: # <<<<<<<<<<<<<<
3121 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATED
3122 *
3123 */
3124 }
3125 __pyx_L8:;
3126
3127 /* "gssapi/raw/ext_dce.pyx":177
3128 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATED
3129 *
3130 * if buff.value is None: # <<<<<<<<<<<<<<
3131 * self._iov[i].buffer.length = 0
3132 * self._iov[i].buffer.value = NULL
3133 */
3134 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
3135 __Pyx_GOTREF(__pyx_t_2);
3136 __pyx_t_9 = (__pyx_t_2 == Py_None);
3137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3138 __pyx_t_1 = (__pyx_t_9 != 0);
3139 if (__pyx_t_1) {
3140
3141 /* "gssapi/raw/ext_dce.pyx":178
3142 *
3143 * if buff.value is None:
3144 * self._iov[i].buffer.length = 0 # <<<<<<<<<<<<<<
3145 * self._iov[i].buffer.value = NULL
3146 * else:
3147 */
3148 (__pyx_v_self->_iov[__pyx_v_i]).buffer.length = 0;
3149
3150 /* "gssapi/raw/ext_dce.pyx":179
3151 * if buff.value is None:
3152 * self._iov[i].buffer.length = 0
3153 * self._iov[i].buffer.value = NULL # <<<<<<<<<<<<<<
3154 * else:
3155 * self._iov[i].buffer.length = len(buff.value)
3156 */
3157 (__pyx_v_self->_iov[__pyx_v_i]).buffer.value = NULL;
3158
3159 /* "gssapi/raw/ext_dce.pyx":177
3160 * self._iov[i].type |= GSS_IOV_BUFFER_FLAG_ALLOCATED
3161 *
3162 * if buff.value is None: # <<<<<<<<<<<<<<
3163 * self._iov[i].buffer.length = 0
3164 * self._iov[i].buffer.value = NULL
3165 */
3166 goto __pyx_L9;
3167 }
3168
3169 /* "gssapi/raw/ext_dce.pyx":181
3170 * self._iov[i].buffer.value = NULL
3171 * else:
3172 * self._iov[i].buffer.length = len(buff.value) # <<<<<<<<<<<<<<
3173 * self._iov[i].buffer.value = <char *>malloc(
3174 * self._iov[i].buffer.length)
3175 */
3176 /*else*/ {
3177 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
3178 __Pyx_GOTREF(__pyx_t_2);
3179 __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 181, __pyx_L1_error)
3180 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3181 (__pyx_v_self->_iov[__pyx_v_i]).buffer.length = __pyx_t_3;
3182
3183 /* "gssapi/raw/ext_dce.pyx":182
3184 * else:
3185 * self._iov[i].buffer.length = len(buff.value)
3186 * self._iov[i].buffer.value = <char *>malloc( # <<<<<<<<<<<<<<
3187 * self._iov[i].buffer.length)
3188 * if self._iov[i].buffer.value is NULL:
3189 */
3190 (__pyx_v_self->_iov[__pyx_v_i]).buffer.value = ((char *)malloc((__pyx_v_self->_iov[__pyx_v_i]).buffer.length));
3191
3192 /* "gssapi/raw/ext_dce.pyx":184
3193 * self._iov[i].buffer.value = <char *>malloc(
3194 * self._iov[i].buffer.length)
3195 * if self._iov[i].buffer.value is NULL: # <<<<<<<<<<<<<<
3196 * raise MemoryError("Cannot malloc for buffer value")
3197 *
3198 */
3199 __pyx_t_1 = (((__pyx_v_self->_iov[__pyx_v_i]).buffer.value == NULL) != 0);
3200 if (unlikely(__pyx_t_1)) {
3201
3202 /* "gssapi/raw/ext_dce.pyx":185
3203 * self._iov[i].buffer.length)
3204 * if self._iov[i].buffer.value is NULL:
3205 * raise MemoryError("Cannot malloc for buffer value") # <<<<<<<<<<<<<<
3206 *
3207 * memcpy(self._iov[i].buffer.value, <char *>buff.value,
3208 */
3209 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 185, __pyx_L1_error)
3210 __Pyx_GOTREF(__pyx_t_2);
3211 __Pyx_Raise(__pyx_t_2, 0, 0, 0);
3212 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3213 __PYX_ERR(0, 185, __pyx_L1_error)
3214
3215 /* "gssapi/raw/ext_dce.pyx":184
3216 * self._iov[i].buffer.value = <char *>malloc(
3217 * self._iov[i].buffer.length)
3218 * if self._iov[i].buffer.value is NULL: # <<<<<<<<<<<<<<
3219 * raise MemoryError("Cannot malloc for buffer value")
3220 *
3221 */
3222 }
3223
3224 /* "gssapi/raw/ext_dce.pyx":187
3225 * raise MemoryError("Cannot malloc for buffer value")
3226 *
3227 * memcpy(self._iov[i].buffer.value, <char *>buff.value, # <<<<<<<<<<<<<<
3228 * self._iov[i].buffer.length)
3229 *
3230 */
3231 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
3232 __Pyx_GOTREF(__pyx_t_2);
3233 __pyx_t_10 = __Pyx_PyObject_AsWritableString(__pyx_t_2); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 187, __pyx_L1_error)
3234
3235 /* "gssapi/raw/ext_dce.pyx":188
3236 *
3237 * memcpy(self._iov[i].buffer.value, <char *>buff.value,
3238 * self._iov[i].buffer.length) # <<<<<<<<<<<<<<
3239 *
3240 * return self._iov
3241 */
3242 (void)(memcpy((__pyx_v_self->_iov[__pyx_v_i]).buffer.value, ((char *)__pyx_t_10), (__pyx_v_self->_iov[__pyx_v_i]).buffer.length));
3243 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3244 }
3245 __pyx_L9:;
3246 }
3247
3248 /* "gssapi/raw/ext_dce.pyx":157
3249 * cdef OM_uint32 tmp_min_stat
3250 * cdef int i
3251 * if self._unprocessed: # <<<<<<<<<<<<<<
3252 * if self._iov is not NULL:
3253 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
3254 */
3255 }
3256
3257 /* "gssapi/raw/ext_dce.pyx":190
3258 * self._iov[i].buffer.length)
3259 *
3260 * return self._iov # <<<<<<<<<<<<<<
3261 *
3262 * cdef _recreate_python_values(IOV self):
3263 */
3264 __pyx_r = __pyx_v_self->_iov;
3265 goto __pyx_L0;
3266
3267 /* "gssapi/raw/ext_dce.pyx":154
3268 * None))
3269 *
3270 * cdef gss_iov_buffer_desc* __cvalue__(IOV self) except NULL: # <<<<<<<<<<<<<<
3271 * cdef OM_uint32 tmp_min_stat
3272 * cdef int i
3273 */
3274
3275 /* function exit code */
3276 __pyx_L1_error:;
3277 __Pyx_XDECREF(__pyx_t_2);
3278 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__cvalue__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3279 __pyx_r = NULL;
3280 __pyx_L0:;
3281 __Pyx_XDECREF(__pyx_v_buff);
3282 __Pyx_RefNannyFinishContext();
3283 return __pyx_r;
3284 }
3285
3286 /* "gssapi/raw/ext_dce.pyx":192
3287 * return self._iov
3288 *
3289 * cdef _recreate_python_values(IOV self): # <<<<<<<<<<<<<<
3290 * cdef i
3291 * cdef bint val_change = False
3292 */
3293
__pyx_f_6gssapi_3raw_7ext_dce_3IOV__recreate_python_values(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)3294 static PyObject *__pyx_f_6gssapi_3raw_7ext_dce_3IOV__recreate_python_values(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
3295 PyObject *__pyx_v_i = 0;
3296 CYTHON_UNUSED int __pyx_v_val_change;
3297 size_t __pyx_v_new_len;
3298 PyObject *__pyx_v_old_type = NULL;
3299 PyObject *__pyx_v_new_val = NULL;
3300 PyObject *__pyx_v_alloc = NULL;
3301 PyObject *__pyx_r = NULL;
3302 __Pyx_RefNannyDeclarations
3303 PyObject *__pyx_t_1 = NULL;
3304 PyObject *__pyx_t_2 = NULL;
3305 Py_ssize_t __pyx_t_3;
3306 PyObject *(*__pyx_t_4)(PyObject *);
3307 PyObject *__pyx_t_5 = NULL;
3308 Py_ssize_t __pyx_t_6;
3309 int __pyx_t_7;
3310 size_t __pyx_t_8;
3311 PyObject *__pyx_t_9 = NULL;
3312 int __pyx_t_10;
3313 PyObject *__pyx_t_11 = NULL;
3314 int __pyx_lineno = 0;
3315 const char *__pyx_filename = NULL;
3316 int __pyx_clineno = 0;
3317 __Pyx_RefNannySetupContext("_recreate_python_values", 0);
3318
3319 /* "gssapi/raw/ext_dce.pyx":194
3320 * cdef _recreate_python_values(IOV self):
3321 * cdef i
3322 * cdef bint val_change = False # <<<<<<<<<<<<<<
3323 * cdef size_t new_len
3324 * for i in range(self.iov_len):
3325 */
3326 __pyx_v_val_change = 0;
3327
3328 /* "gssapi/raw/ext_dce.pyx":196
3329 * cdef bint val_change = False
3330 * cdef size_t new_len
3331 * for i in range(self.iov_len): # <<<<<<<<<<<<<<
3332 * old_type = self._buffs[i].type
3333 *
3334 */
3335 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->iov_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
3336 __Pyx_GOTREF(__pyx_t_1);
3337 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
3338 __Pyx_GOTREF(__pyx_t_2);
3339 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3340 if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
3341 __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
3342 __pyx_t_4 = NULL;
3343 } else {
3344 __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 196, __pyx_L1_error)
3345 __Pyx_GOTREF(__pyx_t_1);
3346 __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
3347 }
3348 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3349 for (;;) {
3350 if (likely(!__pyx_t_4)) {
3351 if (likely(PyList_CheckExact(__pyx_t_1))) {
3352 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
3353 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3354 __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
3355 #else
3356 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
3357 __Pyx_GOTREF(__pyx_t_2);
3358 #endif
3359 } else {
3360 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
3361 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
3362 __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
3363 #else
3364 __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 196, __pyx_L1_error)
3365 __Pyx_GOTREF(__pyx_t_2);
3366 #endif
3367 }
3368 } else {
3369 __pyx_t_2 = __pyx_t_4(__pyx_t_1);
3370 if (unlikely(!__pyx_t_2)) {
3371 PyObject* exc_type = PyErr_Occurred();
3372 if (exc_type) {
3373 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
3374 else __PYX_ERR(0, 196, __pyx_L1_error)
3375 }
3376 break;
3377 }
3378 __Pyx_GOTREF(__pyx_t_2);
3379 }
3380 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
3381 __pyx_t_2 = 0;
3382
3383 /* "gssapi/raw/ext_dce.pyx":197
3384 * cdef size_t new_len
3385 * for i in range(self.iov_len):
3386 * old_type = self._buffs[i].type # <<<<<<<<<<<<<<
3387 *
3388 * if self._iov[i].buffer.value is NULL:
3389 */
3390 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
3391 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3392 __PYX_ERR(0, 197, __pyx_L1_error)
3393 }
3394 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->_buffs, __pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 197, __pyx_L1_error)
3395 __Pyx_GOTREF(__pyx_t_2);
3396 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 197, __pyx_L1_error)
3397 __Pyx_GOTREF(__pyx_t_5);
3398 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3399 __Pyx_XDECREF_SET(__pyx_v_old_type, __pyx_t_5);
3400 __pyx_t_5 = 0;
3401
3402 /* "gssapi/raw/ext_dce.pyx":199
3403 * old_type = self._buffs[i].type
3404 *
3405 * if self._iov[i].buffer.value is NULL: # <<<<<<<<<<<<<<
3406 * if self._iov[i].buffer.length == 0:
3407 * new_val = None
3408 */
3409 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L1_error)
3410 __pyx_t_7 = (((__pyx_v_self->_iov[__pyx_t_6]).buffer.value == NULL) != 0);
3411 if (__pyx_t_7) {
3412
3413 /* "gssapi/raw/ext_dce.pyx":200
3414 *
3415 * if self._iov[i].buffer.value is NULL:
3416 * if self._iov[i].buffer.length == 0: # <<<<<<<<<<<<<<
3417 * new_val = None
3418 * else:
3419 */
3420 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
3421 __pyx_t_7 = (((__pyx_v_self->_iov[__pyx_t_6]).buffer.length == 0) != 0);
3422 if (__pyx_t_7) {
3423
3424 /* "gssapi/raw/ext_dce.pyx":201
3425 * if self._iov[i].buffer.value is NULL:
3426 * if self._iov[i].buffer.length == 0:
3427 * new_val = None # <<<<<<<<<<<<<<
3428 * else:
3429 * new_len = self._iov[i].buffer.length
3430 */
3431 __Pyx_INCREF(Py_None);
3432 __Pyx_XDECREF_SET(__pyx_v_new_val, ((PyObject*)Py_None));
3433
3434 /* "gssapi/raw/ext_dce.pyx":200
3435 *
3436 * if self._iov[i].buffer.value is NULL:
3437 * if self._iov[i].buffer.length == 0: # <<<<<<<<<<<<<<
3438 * new_val = None
3439 * else:
3440 */
3441 goto __pyx_L6;
3442 }
3443
3444 /* "gssapi/raw/ext_dce.pyx":203
3445 * new_val = None
3446 * else:
3447 * new_len = self._iov[i].buffer.length # <<<<<<<<<<<<<<
3448 * new_val = b'\x00' * new_len
3449 * else:
3450 */
3451 /*else*/ {
3452 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error)
3453 __pyx_t_8 = (__pyx_v_self->_iov[__pyx_t_6]).buffer.length;
3454 __pyx_v_new_len = __pyx_t_8;
3455
3456 /* "gssapi/raw/ext_dce.pyx":204
3457 * else:
3458 * new_len = self._iov[i].buffer.length
3459 * new_val = b'\x00' * new_len # <<<<<<<<<<<<<<
3460 * else:
3461 * new_len = self._iov[i].buffer.length
3462 */
3463 __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_v_new_len); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
3464 __Pyx_GOTREF(__pyx_t_5);
3465 __pyx_t_2 = PyNumber_Multiply(__pyx_kp_b__4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
3466 __Pyx_GOTREF(__pyx_t_2);
3467 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3468 if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 204, __pyx_L1_error)
3469 __Pyx_XDECREF_SET(__pyx_v_new_val, ((PyObject*)__pyx_t_2));
3470 __pyx_t_2 = 0;
3471 }
3472 __pyx_L6:;
3473
3474 /* "gssapi/raw/ext_dce.pyx":199
3475 * old_type = self._buffs[i].type
3476 *
3477 * if self._iov[i].buffer.value is NULL: # <<<<<<<<<<<<<<
3478 * if self._iov[i].buffer.length == 0:
3479 * new_val = None
3480 */
3481 goto __pyx_L5;
3482 }
3483
3484 /* "gssapi/raw/ext_dce.pyx":206
3485 * new_val = b'\x00' * new_len
3486 * else:
3487 * new_len = self._iov[i].buffer.length # <<<<<<<<<<<<<<
3488 * new_val = (<char*>self._iov[i].buffer.value)[:new_len]
3489 *
3490 */
3491 /*else*/ {
3492 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 206, __pyx_L1_error)
3493 __pyx_t_8 = (__pyx_v_self->_iov[__pyx_t_6]).buffer.length;
3494 __pyx_v_new_len = __pyx_t_8;
3495
3496 /* "gssapi/raw/ext_dce.pyx":207
3497 * else:
3498 * new_len = self._iov[i].buffer.length
3499 * new_val = (<char*>self._iov[i].buffer.value)[:new_len] # <<<<<<<<<<<<<<
3500 *
3501 * alloc = False
3502 */
3503 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
3504 __pyx_t_2 = __Pyx_PyBytes_FromStringAndSize(((char *)(__pyx_v_self->_iov[__pyx_t_6]).buffer.value) + 0, __pyx_v_new_len - 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
3505 __Pyx_GOTREF(__pyx_t_2);
3506 __Pyx_XDECREF_SET(__pyx_v_new_val, ((PyObject*)__pyx_t_2));
3507 __pyx_t_2 = 0;
3508 }
3509 __pyx_L5:;
3510
3511 /* "gssapi/raw/ext_dce.pyx":209
3512 * new_val = (<char*>self._iov[i].buffer.value)[:new_len]
3513 *
3514 * alloc = False # <<<<<<<<<<<<<<
3515 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATE:
3516 * alloc = True
3517 */
3518 __Pyx_INCREF(Py_False);
3519 __Pyx_XDECREF_SET(__pyx_v_alloc, Py_False);
3520
3521 /* "gssapi/raw/ext_dce.pyx":210
3522 *
3523 * alloc = False
3524 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATE: # <<<<<<<<<<<<<<
3525 * alloc = True
3526 *
3527 */
3528 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error)
3529 __pyx_t_7 = (((__pyx_v_self->_iov[__pyx_t_6]).type & GSS_IOV_BUFFER_FLAG_ALLOCATE) != 0);
3530 if (__pyx_t_7) {
3531
3532 /* "gssapi/raw/ext_dce.pyx":211
3533 * alloc = False
3534 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATE:
3535 * alloc = True # <<<<<<<<<<<<<<
3536 *
3537 * # NB(directxman12): GSSAPI (at least in MIT krb5) doesn't
3538 */
3539 __Pyx_INCREF(Py_True);
3540 __Pyx_DECREF_SET(__pyx_v_alloc, Py_True);
3541
3542 /* "gssapi/raw/ext_dce.pyx":210
3543 *
3544 * alloc = False
3545 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATE: # <<<<<<<<<<<<<<
3546 * alloc = True
3547 *
3548 */
3549 }
3550
3551 /* "gssapi/raw/ext_dce.pyx":216
3552 * # unset the allocate flag (because it's an "input flag",
3553 * # so this needs to come second and be separate
3554 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATED: # <<<<<<<<<<<<<<
3555 * alloc = None
3556 *
3557 */
3558 __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 216, __pyx_L1_error)
3559 __pyx_t_7 = (((__pyx_v_self->_iov[__pyx_t_6]).type & GSS_IOV_BUFFER_FLAG_ALLOCATED) != 0);
3560 if (__pyx_t_7) {
3561
3562 /* "gssapi/raw/ext_dce.pyx":217
3563 * # so this needs to come second and be separate
3564 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATED:
3565 * alloc = None # <<<<<<<<<<<<<<
3566 *
3567 * self._buffs[i] = IOVBuffer(old_type, alloc, new_val)
3568 */
3569 __Pyx_INCREF(Py_None);
3570 __Pyx_DECREF_SET(__pyx_v_alloc, Py_None);
3571
3572 /* "gssapi/raw/ext_dce.pyx":216
3573 * # unset the allocate flag (because it's an "input flag",
3574 * # so this needs to come second and be separate
3575 * if self._iov[i].type & GSS_IOV_BUFFER_FLAG_ALLOCATED: # <<<<<<<<<<<<<<
3576 * alloc = None
3577 *
3578 */
3579 }
3580
3581 /* "gssapi/raw/ext_dce.pyx":219
3582 * alloc = None
3583 *
3584 * self._buffs[i] = IOVBuffer(old_type, alloc, new_val) # <<<<<<<<<<<<<<
3585 *
3586 * self.c_changed = False
3587 */
3588 __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_IOVBuffer); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 219, __pyx_L1_error)
3589 __Pyx_GOTREF(__pyx_t_5);
3590 __pyx_t_9 = NULL;
3591 __pyx_t_10 = 0;
3592 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
3593 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
3594 if (likely(__pyx_t_9)) {
3595 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
3596 __Pyx_INCREF(__pyx_t_9);
3597 __Pyx_INCREF(function);
3598 __Pyx_DECREF_SET(__pyx_t_5, function);
3599 __pyx_t_10 = 1;
3600 }
3601 }
3602 #if CYTHON_FAST_PYCALL
3603 if (PyFunction_Check(__pyx_t_5)) {
3604 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_old_type, __pyx_v_alloc, __pyx_v_new_val};
3605 __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
3606 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3607 __Pyx_GOTREF(__pyx_t_2);
3608 } else
3609 #endif
3610 #if CYTHON_FAST_PYCCALL
3611 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
3612 PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_old_type, __pyx_v_alloc, __pyx_v_new_val};
3613 __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_10, 3+__pyx_t_10); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
3614 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
3615 __Pyx_GOTREF(__pyx_t_2);
3616 } else
3617 #endif
3618 {
3619 __pyx_t_11 = PyTuple_New(3+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 219, __pyx_L1_error)
3620 __Pyx_GOTREF(__pyx_t_11);
3621 if (__pyx_t_9) {
3622 __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
3623 }
3624 __Pyx_INCREF(__pyx_v_old_type);
3625 __Pyx_GIVEREF(__pyx_v_old_type);
3626 PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_old_type);
3627 __Pyx_INCREF(__pyx_v_alloc);
3628 __Pyx_GIVEREF(__pyx_v_alloc);
3629 PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_alloc);
3630 __Pyx_INCREF(__pyx_v_new_val);
3631 __Pyx_GIVEREF(__pyx_v_new_val);
3632 PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_10, __pyx_v_new_val);
3633 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 219, __pyx_L1_error)
3634 __Pyx_GOTREF(__pyx_t_2);
3635 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
3636 }
3637 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3638 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
3639 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3640 __PYX_ERR(0, 219, __pyx_L1_error)
3641 }
3642 if (unlikely(PyObject_SetItem(__pyx_v_self->_buffs, __pyx_v_i, __pyx_t_2) < 0)) __PYX_ERR(0, 219, __pyx_L1_error)
3643 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3644
3645 /* "gssapi/raw/ext_dce.pyx":196
3646 * cdef bint val_change = False
3647 * cdef size_t new_len
3648 * for i in range(self.iov_len): # <<<<<<<<<<<<<<
3649 * old_type = self._buffs[i].type
3650 *
3651 */
3652 }
3653 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3654
3655 /* "gssapi/raw/ext_dce.pyx":221
3656 * self._buffs[i] = IOVBuffer(old_type, alloc, new_val)
3657 *
3658 * self.c_changed = False # <<<<<<<<<<<<<<
3659 *
3660 * def __getitem__(IOV self, ind):
3661 */
3662 __pyx_v_self->c_changed = 0;
3663
3664 /* "gssapi/raw/ext_dce.pyx":192
3665 * return self._iov
3666 *
3667 * cdef _recreate_python_values(IOV self): # <<<<<<<<<<<<<<
3668 * cdef i
3669 * cdef bint val_change = False
3670 */
3671
3672 /* function exit code */
3673 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3674 goto __pyx_L0;
3675 __pyx_L1_error:;
3676 __Pyx_XDECREF(__pyx_t_1);
3677 __Pyx_XDECREF(__pyx_t_2);
3678 __Pyx_XDECREF(__pyx_t_5);
3679 __Pyx_XDECREF(__pyx_t_9);
3680 __Pyx_XDECREF(__pyx_t_11);
3681 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV._recreate_python_values", __pyx_clineno, __pyx_lineno, __pyx_filename);
3682 __pyx_r = 0;
3683 __pyx_L0:;
3684 __Pyx_XDECREF(__pyx_v_i);
3685 __Pyx_XDECREF(__pyx_v_old_type);
3686 __Pyx_XDECREF(__pyx_v_new_val);
3687 __Pyx_XDECREF(__pyx_v_alloc);
3688 __Pyx_XGIVEREF(__pyx_r);
3689 __Pyx_RefNannyFinishContext();
3690 return __pyx_r;
3691 }
3692
3693 /* "gssapi/raw/ext_dce.pyx":223
3694 * self.c_changed = False
3695 *
3696 * def __getitem__(IOV self, ind): # <<<<<<<<<<<<<<
3697 * if self.c_changed:
3698 * self._recreate_python_values()
3699 */
3700
3701 /* Python wrapper */
3702 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ind); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_3__getitem__(PyObject * __pyx_v_self,PyObject * __pyx_v_ind)3703 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_ind) {
3704 PyObject *__pyx_r = 0;
3705 __Pyx_RefNannyDeclarations
3706 __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
3707 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_2__getitem__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self), ((PyObject *)__pyx_v_ind));
3708
3709 /* function exit code */
3710 __Pyx_RefNannyFinishContext();
3711 return __pyx_r;
3712 }
3713
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_2__getitem__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self,PyObject * __pyx_v_ind)3714 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_2__getitem__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_ind) {
3715 PyObject *__pyx_r = NULL;
3716 __Pyx_RefNannyDeclarations
3717 int __pyx_t_1;
3718 PyObject *__pyx_t_2 = NULL;
3719 int __pyx_lineno = 0;
3720 const char *__pyx_filename = NULL;
3721 int __pyx_clineno = 0;
3722 __Pyx_RefNannySetupContext("__getitem__", 0);
3723
3724 /* "gssapi/raw/ext_dce.pyx":224
3725 *
3726 * def __getitem__(IOV self, ind):
3727 * if self.c_changed: # <<<<<<<<<<<<<<
3728 * self._recreate_python_values()
3729 *
3730 */
3731 __pyx_t_1 = (__pyx_v_self->c_changed != 0);
3732 if (__pyx_t_1) {
3733
3734 /* "gssapi/raw/ext_dce.pyx":225
3735 * def __getitem__(IOV self, ind):
3736 * if self.c_changed:
3737 * self._recreate_python_values() # <<<<<<<<<<<<<<
3738 *
3739 * return self._buffs[ind]
3740 */
3741 __pyx_t_2 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self->__pyx_vtab)->_recreate_python_values(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
3742 __Pyx_GOTREF(__pyx_t_2);
3743 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3744
3745 /* "gssapi/raw/ext_dce.pyx":224
3746 *
3747 * def __getitem__(IOV self, ind):
3748 * if self.c_changed: # <<<<<<<<<<<<<<
3749 * self._recreate_python_values()
3750 *
3751 */
3752 }
3753
3754 /* "gssapi/raw/ext_dce.pyx":227
3755 * self._recreate_python_values()
3756 *
3757 * return self._buffs[ind] # <<<<<<<<<<<<<<
3758 *
3759 * def __len__(IOV self):
3760 */
3761 __Pyx_XDECREF(__pyx_r);
3762 if (unlikely(__pyx_v_self->_buffs == Py_None)) {
3763 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
3764 __PYX_ERR(0, 227, __pyx_L1_error)
3765 }
3766 __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_self->_buffs, __pyx_v_ind); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
3767 __Pyx_GOTREF(__pyx_t_2);
3768 __pyx_r = __pyx_t_2;
3769 __pyx_t_2 = 0;
3770 goto __pyx_L0;
3771
3772 /* "gssapi/raw/ext_dce.pyx":223
3773 * self.c_changed = False
3774 *
3775 * def __getitem__(IOV self, ind): # <<<<<<<<<<<<<<
3776 * if self.c_changed:
3777 * self._recreate_python_values()
3778 */
3779
3780 /* function exit code */
3781 __pyx_L1_error:;
3782 __Pyx_XDECREF(__pyx_t_2);
3783 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3784 __pyx_r = NULL;
3785 __pyx_L0:;
3786 __Pyx_XGIVEREF(__pyx_r);
3787 __Pyx_RefNannyFinishContext();
3788 return __pyx_r;
3789 }
3790
3791 /* "gssapi/raw/ext_dce.pyx":229
3792 * return self._buffs[ind]
3793 *
3794 * def __len__(IOV self): # <<<<<<<<<<<<<<
3795 * if self.c_changed:
3796 * self._recreate_python_values()
3797 */
3798
3799 /* Python wrapper */
3800 static Py_ssize_t __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_5__len__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_5__len__(PyObject * __pyx_v_self)3801 static Py_ssize_t __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_5__len__(PyObject *__pyx_v_self) {
3802 Py_ssize_t __pyx_r;
3803 __Pyx_RefNannyDeclarations
3804 __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
3805 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_4__len__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
3806
3807 /* function exit code */
3808 __Pyx_RefNannyFinishContext();
3809 return __pyx_r;
3810 }
3811
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_4__len__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)3812 static Py_ssize_t __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_4__len__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
3813 Py_ssize_t __pyx_r;
3814 __Pyx_RefNannyDeclarations
3815 int __pyx_t_1;
3816 PyObject *__pyx_t_2 = NULL;
3817 Py_ssize_t __pyx_t_3;
3818 int __pyx_lineno = 0;
3819 const char *__pyx_filename = NULL;
3820 int __pyx_clineno = 0;
3821 __Pyx_RefNannySetupContext("__len__", 0);
3822
3823 /* "gssapi/raw/ext_dce.pyx":230
3824 *
3825 * def __len__(IOV self):
3826 * if self.c_changed: # <<<<<<<<<<<<<<
3827 * self._recreate_python_values()
3828 *
3829 */
3830 __pyx_t_1 = (__pyx_v_self->c_changed != 0);
3831 if (__pyx_t_1) {
3832
3833 /* "gssapi/raw/ext_dce.pyx":231
3834 * def __len__(IOV self):
3835 * if self.c_changed:
3836 * self._recreate_python_values() # <<<<<<<<<<<<<<
3837 *
3838 * return len(self._buffs)
3839 */
3840 __pyx_t_2 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self->__pyx_vtab)->_recreate_python_values(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
3841 __Pyx_GOTREF(__pyx_t_2);
3842 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3843
3844 /* "gssapi/raw/ext_dce.pyx":230
3845 *
3846 * def __len__(IOV self):
3847 * if self.c_changed: # <<<<<<<<<<<<<<
3848 * self._recreate_python_values()
3849 *
3850 */
3851 }
3852
3853 /* "gssapi/raw/ext_dce.pyx":233
3854 * self._recreate_python_values()
3855 *
3856 * return len(self._buffs) # <<<<<<<<<<<<<<
3857 *
3858 * def __iter__(IOV self):
3859 */
3860 __pyx_t_2 = __pyx_v_self->_buffs;
3861 __Pyx_INCREF(__pyx_t_2);
3862 if (unlikely(__pyx_t_2 == Py_None)) {
3863 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3864 __PYX_ERR(0, 233, __pyx_L1_error)
3865 }
3866 __pyx_t_3 = PyList_GET_SIZE(__pyx_t_2); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 233, __pyx_L1_error)
3867 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3868 __pyx_r = __pyx_t_3;
3869 goto __pyx_L0;
3870
3871 /* "gssapi/raw/ext_dce.pyx":229
3872 * return self._buffs[ind]
3873 *
3874 * def __len__(IOV self): # <<<<<<<<<<<<<<
3875 * if self.c_changed:
3876 * self._recreate_python_values()
3877 */
3878
3879 /* function exit code */
3880 __pyx_L1_error:;
3881 __Pyx_XDECREF(__pyx_t_2);
3882 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3883 __pyx_r = -1;
3884 __pyx_L0:;
3885 __Pyx_RefNannyFinishContext();
3886 return __pyx_r;
3887 }
3888 static PyObject *__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_8generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
3889
3890 /* "gssapi/raw/ext_dce.pyx":235
3891 * return len(self._buffs)
3892 *
3893 * def __iter__(IOV self): # <<<<<<<<<<<<<<
3894 * if self.c_changed:
3895 * self._recreate_python_values()
3896 */
3897
3898 /* Python wrapper */
3899 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_7__iter__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_7__iter__(PyObject * __pyx_v_self)3900 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_7__iter__(PyObject *__pyx_v_self) {
3901 PyObject *__pyx_r = 0;
3902 __Pyx_RefNannyDeclarations
3903 __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
3904 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_6__iter__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
3905
3906 /* function exit code */
3907 __Pyx_RefNannyFinishContext();
3908 return __pyx_r;
3909 }
3910
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_6__iter__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)3911 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_6__iter__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
3912 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *__pyx_cur_scope;
3913 PyObject *__pyx_r = NULL;
3914 __Pyx_RefNannyDeclarations
3915 int __pyx_lineno = 0;
3916 const char *__pyx_filename = NULL;
3917 int __pyx_clineno = 0;
3918 __Pyx_RefNannySetupContext("__iter__", 0);
3919 __pyx_cur_scope = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *)__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__, __pyx_empty_tuple, NULL);
3920 if (unlikely(!__pyx_cur_scope)) {
3921 __pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *)Py_None);
3922 __Pyx_INCREF(Py_None);
3923 __PYX_ERR(0, 235, __pyx_L1_error)
3924 } else {
3925 __Pyx_GOTREF(__pyx_cur_scope);
3926 }
3927 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
3928 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
3929 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
3930 {
3931 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gssapi_3raw_7ext_dce_3IOV_8generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_IOV___iter, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!gen)) __PYX_ERR(0, 235, __pyx_L1_error)
3932 __Pyx_DECREF(__pyx_cur_scope);
3933 __Pyx_RefNannyFinishContext();
3934 return (PyObject *) gen;
3935 }
3936
3937 /* function exit code */
3938 __pyx_L1_error:;
3939 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3940 __pyx_r = NULL;
3941 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
3942 __Pyx_XGIVEREF(__pyx_r);
3943 __Pyx_RefNannyFinishContext();
3944 return __pyx_r;
3945 }
3946
__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_8generator(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)3947 static PyObject *__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_8generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
3948 {
3949 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *__pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *)__pyx_generator->closure);
3950 PyObject *__pyx_r = NULL;
3951 int __pyx_t_1;
3952 PyObject *__pyx_t_2 = NULL;
3953 Py_ssize_t __pyx_t_3;
3954 PyObject *__pyx_t_4 = NULL;
3955 int __pyx_lineno = 0;
3956 const char *__pyx_filename = NULL;
3957 int __pyx_clineno = 0;
3958 __Pyx_RefNannyDeclarations
3959 __Pyx_RefNannySetupContext("__iter__", 0);
3960 switch (__pyx_generator->resume_label) {
3961 case 0: goto __pyx_L3_first_run;
3962 case 1: goto __pyx_L7_resume_from_yield;
3963 default: /* CPython raises the right error here */
3964 __Pyx_RefNannyFinishContext();
3965 return NULL;
3966 }
3967 __pyx_L3_first_run:;
3968 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 235, __pyx_L1_error)
3969
3970 /* "gssapi/raw/ext_dce.pyx":236
3971 *
3972 * def __iter__(IOV self):
3973 * if self.c_changed: # <<<<<<<<<<<<<<
3974 * self._recreate_python_values()
3975 *
3976 */
3977 __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->c_changed != 0);
3978 if (__pyx_t_1) {
3979
3980 /* "gssapi/raw/ext_dce.pyx":237
3981 * def __iter__(IOV self):
3982 * if self.c_changed:
3983 * self._recreate_python_values() # <<<<<<<<<<<<<<
3984 *
3985 * for val in self._buffs:
3986 */
3987 __pyx_t_2 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_recreate_python_values(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
3988 __Pyx_GOTREF(__pyx_t_2);
3989 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3990
3991 /* "gssapi/raw/ext_dce.pyx":236
3992 *
3993 * def __iter__(IOV self):
3994 * if self.c_changed: # <<<<<<<<<<<<<<
3995 * self._recreate_python_values()
3996 *
3997 */
3998 }
3999
4000 /* "gssapi/raw/ext_dce.pyx":239
4001 * self._recreate_python_values()
4002 *
4003 * for val in self._buffs: # <<<<<<<<<<<<<<
4004 * yield val
4005 *
4006 */
4007 if (unlikely(__pyx_cur_scope->__pyx_v_self->_buffs == Py_None)) {
4008 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4009 __PYX_ERR(0, 239, __pyx_L1_error)
4010 }
4011 __pyx_t_2 = __pyx_cur_scope->__pyx_v_self->_buffs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
4012 for (;;) {
4013 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
4014 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4015 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 239, __pyx_L1_error)
4016 #else
4017 __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
4018 __Pyx_GOTREF(__pyx_t_4);
4019 #endif
4020 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
4021 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4);
4022 __Pyx_GIVEREF(__pyx_t_4);
4023 __pyx_t_4 = 0;
4024
4025 /* "gssapi/raw/ext_dce.pyx":240
4026 *
4027 * for val in self._buffs:
4028 * yield val # <<<<<<<<<<<<<<
4029 *
4030 * def __contains__(IOV self, item):
4031 */
4032 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val);
4033 __pyx_r = __pyx_cur_scope->__pyx_v_val;
4034 __Pyx_XGIVEREF(__pyx_t_2);
4035 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4036 __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
4037 __Pyx_XGIVEREF(__pyx_r);
4038 __Pyx_RefNannyFinishContext();
4039 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4040 /* return from generator, yielding value */
4041 __pyx_generator->resume_label = 1;
4042 return __pyx_r;
4043 __pyx_L7_resume_from_yield:;
4044 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4045 __pyx_cur_scope->__pyx_t_0 = 0;
4046 __Pyx_XGOTREF(__pyx_t_2);
4047 __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
4048 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 240, __pyx_L1_error)
4049
4050 /* "gssapi/raw/ext_dce.pyx":239
4051 * self._recreate_python_values()
4052 *
4053 * for val in self._buffs: # <<<<<<<<<<<<<<
4054 * yield val
4055 *
4056 */
4057 }
4058 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4059 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4060
4061 /* "gssapi/raw/ext_dce.pyx":235
4062 * return len(self._buffs)
4063 *
4064 * def __iter__(IOV self): # <<<<<<<<<<<<<<
4065 * if self.c_changed:
4066 * self._recreate_python_values()
4067 */
4068
4069 /* function exit code */
4070 PyErr_SetNone(PyExc_StopIteration);
4071 goto __pyx_L0;
4072 __pyx_L1_error:;
4073 __Pyx_XDECREF(__pyx_t_2);
4074 __Pyx_XDECREF(__pyx_t_4);
4075 __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4076 __pyx_L0:;
4077 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4078 #if !CYTHON_USE_EXC_INFO_STACK
4079 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4080 #endif
4081 __pyx_generator->resume_label = -1;
4082 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4083 __Pyx_RefNannyFinishContext();
4084 return __pyx_r;
4085 }
4086
4087 /* "gssapi/raw/ext_dce.pyx":242
4088 * yield val
4089 *
4090 * def __contains__(IOV self, item): # <<<<<<<<<<<<<<
4091 * if self.c_changed:
4092 * self._recreate_python_values()
4093 */
4094
4095 /* Python wrapper */
4096 static int __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_10__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_10__contains__(PyObject * __pyx_v_self,PyObject * __pyx_v_item)4097 static int __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_10__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
4098 int __pyx_r;
4099 __Pyx_RefNannyDeclarations
4100 __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
4101 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_9__contains__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self), ((PyObject *)__pyx_v_item));
4102
4103 /* function exit code */
4104 __Pyx_RefNannyFinishContext();
4105 return __pyx_r;
4106 }
4107
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_9__contains__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self,PyObject * __pyx_v_item)4108 static int __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_9__contains__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_item) {
4109 int __pyx_r;
4110 __Pyx_RefNannyDeclarations
4111 int __pyx_t_1;
4112 PyObject *__pyx_t_2 = NULL;
4113 int __pyx_lineno = 0;
4114 const char *__pyx_filename = NULL;
4115 int __pyx_clineno = 0;
4116 __Pyx_RefNannySetupContext("__contains__", 0);
4117
4118 /* "gssapi/raw/ext_dce.pyx":243
4119 *
4120 * def __contains__(IOV self, item):
4121 * if self.c_changed: # <<<<<<<<<<<<<<
4122 * self._recreate_python_values()
4123 *
4124 */
4125 __pyx_t_1 = (__pyx_v_self->c_changed != 0);
4126 if (__pyx_t_1) {
4127
4128 /* "gssapi/raw/ext_dce.pyx":244
4129 * def __contains__(IOV self, item):
4130 * if self.c_changed:
4131 * self._recreate_python_values() # <<<<<<<<<<<<<<
4132 *
4133 * return item in self._buffs
4134 */
4135 __pyx_t_2 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self->__pyx_vtab)->_recreate_python_values(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 244, __pyx_L1_error)
4136 __Pyx_GOTREF(__pyx_t_2);
4137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4138
4139 /* "gssapi/raw/ext_dce.pyx":243
4140 *
4141 * def __contains__(IOV self, item):
4142 * if self.c_changed: # <<<<<<<<<<<<<<
4143 * self._recreate_python_values()
4144 *
4145 */
4146 }
4147
4148 /* "gssapi/raw/ext_dce.pyx":246
4149 * self._recreate_python_values()
4150 *
4151 * return item in self._buffs # <<<<<<<<<<<<<<
4152 *
4153 * def __reversed__(IOV self):
4154 */
4155 __pyx_t_1 = (__Pyx_PySequence_ContainsTF(__pyx_v_item, __pyx_v_self->_buffs, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 246, __pyx_L1_error)
4156 __pyx_r = __pyx_t_1;
4157 goto __pyx_L0;
4158
4159 /* "gssapi/raw/ext_dce.pyx":242
4160 * yield val
4161 *
4162 * def __contains__(IOV self, item): # <<<<<<<<<<<<<<
4163 * if self.c_changed:
4164 * self._recreate_python_values()
4165 */
4166
4167 /* function exit code */
4168 __pyx_L1_error:;
4169 __Pyx_XDECREF(__pyx_t_2);
4170 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4171 __pyx_r = -1;
4172 __pyx_L0:;
4173 __Pyx_RefNannyFinishContext();
4174 return __pyx_r;
4175 }
4176 static PyObject *__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_13generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
4177
4178 /* "gssapi/raw/ext_dce.pyx":248
4179 * return item in self._buffs
4180 *
4181 * def __reversed__(IOV self): # <<<<<<<<<<<<<<
4182 * if self.c_changed:
4183 * self._recreate_python_values()
4184 */
4185
4186 /* Python wrapper */
4187 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_12__reversed__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_12__reversed__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)4188 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_12__reversed__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4189 PyObject *__pyx_r = 0;
4190 __Pyx_RefNannyDeclarations
4191 __Pyx_RefNannySetupContext("__reversed__ (wrapper)", 0);
4192 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_11__reversed__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
4193
4194 /* function exit code */
4195 __Pyx_RefNannyFinishContext();
4196 return __pyx_r;
4197 }
4198
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_11__reversed__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)4199 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_11__reversed__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
4200 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *__pyx_cur_scope;
4201 PyObject *__pyx_r = NULL;
4202 __Pyx_RefNannyDeclarations
4203 int __pyx_lineno = 0;
4204 const char *__pyx_filename = NULL;
4205 int __pyx_clineno = 0;
4206 __Pyx_RefNannySetupContext("__reversed__", 0);
4207 __pyx_cur_scope = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *)__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__, __pyx_empty_tuple, NULL);
4208 if (unlikely(!__pyx_cur_scope)) {
4209 __pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *)Py_None);
4210 __Pyx_INCREF(Py_None);
4211 __PYX_ERR(0, 248, __pyx_L1_error)
4212 } else {
4213 __Pyx_GOTREF(__pyx_cur_scope);
4214 }
4215 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4216 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4217 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4218 {
4219 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gssapi_3raw_7ext_dce_3IOV_13generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_reversed_2, __pyx_n_s_IOV___reversed, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!gen)) __PYX_ERR(0, 248, __pyx_L1_error)
4220 __Pyx_DECREF(__pyx_cur_scope);
4221 __Pyx_RefNannyFinishContext();
4222 return (PyObject *) gen;
4223 }
4224
4225 /* function exit code */
4226 __pyx_L1_error:;
4227 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__reversed__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4228 __pyx_r = NULL;
4229 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4230 __Pyx_XGIVEREF(__pyx_r);
4231 __Pyx_RefNannyFinishContext();
4232 return __pyx_r;
4233 }
4234
__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_13generator1(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)4235 static PyObject *__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_13generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
4236 {
4237 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *__pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *)__pyx_generator->closure);
4238 PyObject *__pyx_r = NULL;
4239 int __pyx_t_1;
4240 PyObject *__pyx_t_2 = NULL;
4241 Py_ssize_t __pyx_t_3;
4242 PyObject *__pyx_t_4 = NULL;
4243 int __pyx_lineno = 0;
4244 const char *__pyx_filename = NULL;
4245 int __pyx_clineno = 0;
4246 __Pyx_RefNannyDeclarations
4247 __Pyx_RefNannySetupContext("__reversed__", 0);
4248 switch (__pyx_generator->resume_label) {
4249 case 0: goto __pyx_L3_first_run;
4250 case 1: goto __pyx_L7_resume_from_yield;
4251 default: /* CPython raises the right error here */
4252 __Pyx_RefNannyFinishContext();
4253 return NULL;
4254 }
4255 __pyx_L3_first_run:;
4256 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 248, __pyx_L1_error)
4257
4258 /* "gssapi/raw/ext_dce.pyx":249
4259 *
4260 * def __reversed__(IOV self):
4261 * if self.c_changed: # <<<<<<<<<<<<<<
4262 * self._recreate_python_values()
4263 *
4264 */
4265 __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->c_changed != 0);
4266 if (__pyx_t_1) {
4267
4268 /* "gssapi/raw/ext_dce.pyx":250
4269 * def __reversed__(IOV self):
4270 * if self.c_changed:
4271 * self._recreate_python_values() # <<<<<<<<<<<<<<
4272 *
4273 * for val in reversed(self._buffs):
4274 */
4275 __pyx_t_2 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_recreate_python_values(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
4276 __Pyx_GOTREF(__pyx_t_2);
4277 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4278
4279 /* "gssapi/raw/ext_dce.pyx":249
4280 *
4281 * def __reversed__(IOV self):
4282 * if self.c_changed: # <<<<<<<<<<<<<<
4283 * self._recreate_python_values()
4284 *
4285 */
4286 }
4287
4288 /* "gssapi/raw/ext_dce.pyx":252
4289 * self._recreate_python_values()
4290 *
4291 * for val in reversed(self._buffs): # <<<<<<<<<<<<<<
4292 * yield val
4293 *
4294 */
4295 if (unlikely(__pyx_cur_scope->__pyx_v_self->_buffs == Py_None)) {
4296 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
4297 __PYX_ERR(0, 252, __pyx_L1_error)
4298 }
4299 __pyx_t_2 = __pyx_cur_scope->__pyx_v_self->_buffs; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = PyList_GET_SIZE(__pyx_t_2) - 1;
4300 for (;;) {
4301 if (__pyx_t_3 < 0) break;
4302 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
4303 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4304 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3--; if (unlikely(0 < 0)) __PYX_ERR(0, 252, __pyx_L1_error)
4305 #else
4306 __pyx_t_4 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3--; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 252, __pyx_L1_error)
4307 __Pyx_GOTREF(__pyx_t_4);
4308 #endif
4309 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_val);
4310 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_val, __pyx_t_4);
4311 __Pyx_GIVEREF(__pyx_t_4);
4312 __pyx_t_4 = 0;
4313
4314 /* "gssapi/raw/ext_dce.pyx":253
4315 *
4316 * for val in reversed(self._buffs):
4317 * yield val # <<<<<<<<<<<<<<
4318 *
4319 * def index(IOV self, value):
4320 */
4321 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_val);
4322 __pyx_r = __pyx_cur_scope->__pyx_v_val;
4323 __Pyx_XGIVEREF(__pyx_t_2);
4324 __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
4325 __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
4326 __Pyx_XGIVEREF(__pyx_r);
4327 __Pyx_RefNannyFinishContext();
4328 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4329 /* return from generator, yielding value */
4330 __pyx_generator->resume_label = 1;
4331 return __pyx_r;
4332 __pyx_L7_resume_from_yield:;
4333 __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
4334 __pyx_cur_scope->__pyx_t_0 = 0;
4335 __Pyx_XGOTREF(__pyx_t_2);
4336 __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
4337 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 253, __pyx_L1_error)
4338
4339 /* "gssapi/raw/ext_dce.pyx":252
4340 * self._recreate_python_values()
4341 *
4342 * for val in reversed(self._buffs): # <<<<<<<<<<<<<<
4343 * yield val
4344 *
4345 */
4346 }
4347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4348 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4349
4350 /* "gssapi/raw/ext_dce.pyx":248
4351 * return item in self._buffs
4352 *
4353 * def __reversed__(IOV self): # <<<<<<<<<<<<<<
4354 * if self.c_changed:
4355 * self._recreate_python_values()
4356 */
4357
4358 /* function exit code */
4359 PyErr_SetNone(PyExc_StopIteration);
4360 goto __pyx_L0;
4361 __pyx_L1_error:;
4362 __Pyx_XDECREF(__pyx_t_2);
4363 __Pyx_XDECREF(__pyx_t_4);
4364 __Pyx_AddTraceback("__reversed__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4365 __pyx_L0:;
4366 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4367 #if !CYTHON_USE_EXC_INFO_STACK
4368 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4369 #endif
4370 __pyx_generator->resume_label = -1;
4371 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4372 __Pyx_RefNannyFinishContext();
4373 return __pyx_r;
4374 }
4375
4376 /* "gssapi/raw/ext_dce.pyx":255
4377 * yield val
4378 *
4379 * def index(IOV self, value): # <<<<<<<<<<<<<<
4380 * for i, v in enumerate(self):
4381 * if v == value:
4382 */
4383
4384 /* Python wrapper */
4385 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_15index(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_15index(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4386 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_15index(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4387 PyObject *__pyx_r = 0;
4388 __Pyx_RefNannyDeclarations
4389 __Pyx_RefNannySetupContext("index (wrapper)", 0);
4390 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_14index(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4391
4392 /* function exit code */
4393 __Pyx_RefNannyFinishContext();
4394 return __pyx_r;
4395 }
4396
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_14index(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self,PyObject * __pyx_v_value)4397 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_14index(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_value) {
4398 PyObject *__pyx_v_i = NULL;
4399 PyObject *__pyx_v_v = NULL;
4400 PyObject *__pyx_r = NULL;
4401 __Pyx_RefNannyDeclarations
4402 PyObject *__pyx_t_1 = NULL;
4403 PyObject *__pyx_t_2 = NULL;
4404 Py_ssize_t __pyx_t_3;
4405 PyObject *(*__pyx_t_4)(PyObject *);
4406 PyObject *__pyx_t_5 = NULL;
4407 int __pyx_t_6;
4408 int __pyx_lineno = 0;
4409 const char *__pyx_filename = NULL;
4410 int __pyx_clineno = 0;
4411 __Pyx_RefNannySetupContext("index", 0);
4412
4413 /* "gssapi/raw/ext_dce.pyx":256
4414 *
4415 * def index(IOV self, value):
4416 * for i, v in enumerate(self): # <<<<<<<<<<<<<<
4417 * if v == value:
4418 * return i
4419 */
4420 __Pyx_INCREF(__pyx_int_0);
4421 __pyx_t_1 = __pyx_int_0;
4422 if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
4423 __pyx_t_2 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
4424 __pyx_t_4 = NULL;
4425 } else {
4426 __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 256, __pyx_L1_error)
4427 __Pyx_GOTREF(__pyx_t_2);
4428 __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 256, __pyx_L1_error)
4429 }
4430 for (;;) {
4431 if (likely(!__pyx_t_4)) {
4432 if (likely(PyList_CheckExact(__pyx_t_2))) {
4433 if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
4434 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4435 __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
4436 #else
4437 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
4438 __Pyx_GOTREF(__pyx_t_5);
4439 #endif
4440 } else {
4441 if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
4442 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4443 __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 256, __pyx_L1_error)
4444 #else
4445 __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
4446 __Pyx_GOTREF(__pyx_t_5);
4447 #endif
4448 }
4449 } else {
4450 __pyx_t_5 = __pyx_t_4(__pyx_t_2);
4451 if (unlikely(!__pyx_t_5)) {
4452 PyObject* exc_type = PyErr_Occurred();
4453 if (exc_type) {
4454 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4455 else __PYX_ERR(0, 256, __pyx_L1_error)
4456 }
4457 break;
4458 }
4459 __Pyx_GOTREF(__pyx_t_5);
4460 }
4461 __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_5);
4462 __pyx_t_5 = 0;
4463 __Pyx_INCREF(__pyx_t_1);
4464 __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
4465 __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
4466 __Pyx_GOTREF(__pyx_t_5);
4467 __Pyx_DECREF(__pyx_t_1);
4468 __pyx_t_1 = __pyx_t_5;
4469 __pyx_t_5 = 0;
4470
4471 /* "gssapi/raw/ext_dce.pyx":257
4472 * def index(IOV self, value):
4473 * for i, v in enumerate(self):
4474 * if v == value: # <<<<<<<<<<<<<<
4475 * return i
4476 *
4477 */
4478 __pyx_t_5 = PyObject_RichCompare(__pyx_v_v, __pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 257, __pyx_L1_error)
4479 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 257, __pyx_L1_error)
4480 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4481 if (__pyx_t_6) {
4482
4483 /* "gssapi/raw/ext_dce.pyx":258
4484 * for i, v in enumerate(self):
4485 * if v == value:
4486 * return i # <<<<<<<<<<<<<<
4487 *
4488 * raise ValueError
4489 */
4490 __Pyx_XDECREF(__pyx_r);
4491 __Pyx_INCREF(__pyx_v_i);
4492 __pyx_r = __pyx_v_i;
4493 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4494 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4495 goto __pyx_L0;
4496
4497 /* "gssapi/raw/ext_dce.pyx":257
4498 * def index(IOV self, value):
4499 * for i, v in enumerate(self):
4500 * if v == value: # <<<<<<<<<<<<<<
4501 * return i
4502 *
4503 */
4504 }
4505
4506 /* "gssapi/raw/ext_dce.pyx":256
4507 *
4508 * def index(IOV self, value):
4509 * for i, v in enumerate(self): # <<<<<<<<<<<<<<
4510 * if v == value:
4511 * return i
4512 */
4513 }
4514 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4515 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4516
4517 /* "gssapi/raw/ext_dce.pyx":260
4518 * return i
4519 *
4520 * raise ValueError # <<<<<<<<<<<<<<
4521 *
4522 * def count(IOV self, value):
4523 */
4524 __Pyx_Raise(__pyx_builtin_ValueError, 0, 0, 0);
4525 __PYX_ERR(0, 260, __pyx_L1_error)
4526
4527 /* "gssapi/raw/ext_dce.pyx":255
4528 * yield val
4529 *
4530 * def index(IOV self, value): # <<<<<<<<<<<<<<
4531 * for i, v in enumerate(self):
4532 * if v == value:
4533 */
4534
4535 /* function exit code */
4536 __pyx_L1_error:;
4537 __Pyx_XDECREF(__pyx_t_1);
4538 __Pyx_XDECREF(__pyx_t_2);
4539 __Pyx_XDECREF(__pyx_t_5);
4540 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
4541 __pyx_r = NULL;
4542 __pyx_L0:;
4543 __Pyx_XDECREF(__pyx_v_i);
4544 __Pyx_XDECREF(__pyx_v_v);
4545 __Pyx_XGIVEREF(__pyx_r);
4546 __Pyx_RefNannyFinishContext();
4547 return __pyx_r;
4548 }
4549
4550 /* "gssapi/raw/ext_dce.pyx":262
4551 * raise ValueError
4552 *
4553 * def count(IOV self, value): # <<<<<<<<<<<<<<
4554 * return sum(1 for v in self if v == value)
4555 *
4556 */
4557
4558 /* Python wrapper */
4559 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_17count(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_17count(PyObject * __pyx_v_self,PyObject * __pyx_v_value)4560 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_17count(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4561 PyObject *__pyx_r = 0;
4562 __Pyx_RefNannyDeclarations
4563 __Pyx_RefNannySetupContext("count (wrapper)", 0);
4564 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_16count(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4565
4566 /* function exit code */
4567 __Pyx_RefNannyFinishContext();
4568 return __pyx_r;
4569 }
4570 static PyObject *__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_5count_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */
4571
4572 /* "gssapi/raw/ext_dce.pyx":263
4573 *
4574 * def count(IOV self, value):
4575 * return sum(1 for v in self if v == value) # <<<<<<<<<<<<<<
4576 *
4577 * def __repr__(IOV self):
4578 */
4579
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_5count_genexpr(PyObject * __pyx_self)4580 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_5count_genexpr(PyObject *__pyx_self) {
4581 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *__pyx_cur_scope;
4582 PyObject *__pyx_r = NULL;
4583 __Pyx_RefNannyDeclarations
4584 int __pyx_lineno = 0;
4585 const char *__pyx_filename = NULL;
4586 int __pyx_clineno = 0;
4587 __Pyx_RefNannySetupContext("genexpr", 0);
4588 __pyx_cur_scope = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *)__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr, __pyx_empty_tuple, NULL);
4589 if (unlikely(!__pyx_cur_scope)) {
4590 __pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *)Py_None);
4591 __Pyx_INCREF(Py_None);
4592 __PYX_ERR(0, 263, __pyx_L1_error)
4593 } else {
4594 __Pyx_GOTREF(__pyx_cur_scope);
4595 }
4596 __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *) __pyx_self;
4597 __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
4598 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
4599 {
4600 __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gssapi_3raw_7ext_dce_3IOV_5count_2generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_count_locals_genexpr, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!gen)) __PYX_ERR(0, 263, __pyx_L1_error)
4601 __Pyx_DECREF(__pyx_cur_scope);
4602 __Pyx_RefNannyFinishContext();
4603 return (PyObject *) gen;
4604 }
4605
4606 /* function exit code */
4607 __pyx_L1_error:;
4608 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.count.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4609 __pyx_r = NULL;
4610 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4611 __Pyx_XGIVEREF(__pyx_r);
4612 __Pyx_RefNannyFinishContext();
4613 return __pyx_r;
4614 }
4615
__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_5count_2generator2(__pyx_CoroutineObject * __pyx_generator,CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject * __pyx_sent_value)4616 static PyObject *__pyx_gb_6gssapi_3raw_7ext_dce_3IOV_5count_2generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
4617 {
4618 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *)__pyx_generator->closure);
4619 PyObject *__pyx_r = NULL;
4620 PyObject *__pyx_t_1 = NULL;
4621 Py_ssize_t __pyx_t_2;
4622 PyObject *(*__pyx_t_3)(PyObject *);
4623 PyObject *__pyx_t_4 = NULL;
4624 int __pyx_t_5;
4625 int __pyx_lineno = 0;
4626 const char *__pyx_filename = NULL;
4627 int __pyx_clineno = 0;
4628 __Pyx_RefNannyDeclarations
4629 __Pyx_RefNannySetupContext("genexpr", 0);
4630 switch (__pyx_generator->resume_label) {
4631 case 0: goto __pyx_L3_first_run;
4632 case 1: goto __pyx_L7_resume_from_yield;
4633 default: /* CPython raises the right error here */
4634 __Pyx_RefNannyFinishContext();
4635 return NULL;
4636 }
4637 __pyx_L3_first_run:;
4638 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 263, __pyx_L1_error)
4639 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 263, __pyx_L1_error) }
4640 if (likely(PyList_CheckExact(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self))) {
4641 __pyx_t_1 = ((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
4642 __pyx_t_3 = NULL;
4643 } else {
4644 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
4645 __Pyx_GOTREF(__pyx_t_1);
4646 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 263, __pyx_L1_error)
4647 }
4648 for (;;) {
4649 if (likely(!__pyx_t_3)) {
4650 if (likely(PyList_CheckExact(__pyx_t_1))) {
4651 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
4652 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4653 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
4654 #else
4655 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4656 __Pyx_GOTREF(__pyx_t_4);
4657 #endif
4658 } else {
4659 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
4660 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4661 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
4662 #else
4663 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4664 __Pyx_GOTREF(__pyx_t_4);
4665 #endif
4666 }
4667 } else {
4668 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
4669 if (unlikely(!__pyx_t_4)) {
4670 PyObject* exc_type = PyErr_Occurred();
4671 if (exc_type) {
4672 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4673 else __PYX_ERR(0, 263, __pyx_L1_error)
4674 }
4675 break;
4676 }
4677 __Pyx_GOTREF(__pyx_t_4);
4678 }
4679 __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_v);
4680 __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_v, __pyx_t_4);
4681 __Pyx_GIVEREF(__pyx_t_4);
4682 __pyx_t_4 = 0;
4683 if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(0, 263, __pyx_L1_error) }
4684 __pyx_t_4 = PyObject_RichCompare(__pyx_cur_scope->__pyx_v_v, __pyx_cur_scope->__pyx_outer_scope->__pyx_v_value, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 263, __pyx_L1_error)
4685 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 263, __pyx_L1_error)
4686 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4687 if (__pyx_t_5) {
4688 __Pyx_INCREF(__pyx_int_1);
4689 __pyx_r = __pyx_int_1;
4690 __Pyx_XGIVEREF(__pyx_t_1);
4691 __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
4692 __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
4693 __pyx_cur_scope->__pyx_t_2 = __pyx_t_3;
4694 __Pyx_XGIVEREF(__pyx_r);
4695 __Pyx_RefNannyFinishContext();
4696 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4697 /* return from generator, yielding value */
4698 __pyx_generator->resume_label = 1;
4699 return __pyx_r;
4700 __pyx_L7_resume_from_yield:;
4701 __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
4702 __pyx_cur_scope->__pyx_t_0 = 0;
4703 __Pyx_XGOTREF(__pyx_t_1);
4704 __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
4705 __pyx_t_3 = __pyx_cur_scope->__pyx_t_2;
4706 if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 263, __pyx_L1_error)
4707 }
4708 }
4709 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4710 CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);
4711
4712 /* function exit code */
4713 PyErr_SetNone(PyExc_StopIteration);
4714 goto __pyx_L0;
4715 __pyx_L1_error:;
4716 __Pyx_XDECREF(__pyx_t_1);
4717 __Pyx_XDECREF(__pyx_t_4);
4718 __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
4719 __pyx_L0:;
4720 __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
4721 #if !CYTHON_USE_EXC_INFO_STACK
4722 __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
4723 #endif
4724 __pyx_generator->resume_label = -1;
4725 __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
4726 __Pyx_RefNannyFinishContext();
4727 return __pyx_r;
4728 }
4729
4730 /* "gssapi/raw/ext_dce.pyx":262
4731 * raise ValueError
4732 *
4733 * def count(IOV self, value): # <<<<<<<<<<<<<<
4734 * return sum(1 for v in self if v == value)
4735 *
4736 */
4737
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_16count(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self,PyObject * __pyx_v_value)4738 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_16count(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, PyObject *__pyx_v_value) {
4739 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *__pyx_cur_scope;
4740 PyObject *__pyx_r = NULL;
4741 __Pyx_RefNannyDeclarations
4742 PyObject *__pyx_t_1 = NULL;
4743 PyObject *__pyx_t_2 = NULL;
4744 int __pyx_lineno = 0;
4745 const char *__pyx_filename = NULL;
4746 int __pyx_clineno = 0;
4747 __Pyx_RefNannySetupContext("count", 0);
4748 __pyx_cur_scope = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *)__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(__pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count, __pyx_empty_tuple, NULL);
4749 if (unlikely(!__pyx_cur_scope)) {
4750 __pyx_cur_scope = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *)Py_None);
4751 __Pyx_INCREF(Py_None);
4752 __PYX_ERR(0, 262, __pyx_L1_error)
4753 } else {
4754 __Pyx_GOTREF(__pyx_cur_scope);
4755 }
4756 __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
4757 __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4758 __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
4759 __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4760 __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4761 __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4762
4763 /* "gssapi/raw/ext_dce.pyx":263
4764 *
4765 * def count(IOV self, value):
4766 * return sum(1 for v in self if v == value) # <<<<<<<<<<<<<<
4767 *
4768 * def __repr__(IOV self):
4769 */
4770 __Pyx_XDECREF(__pyx_r);
4771 __pyx_t_1 = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_5count_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
4772 __Pyx_GOTREF(__pyx_t_1);
4773 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
4774 __Pyx_GOTREF(__pyx_t_2);
4775 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4776 __pyx_r = __pyx_t_2;
4777 __pyx_t_2 = 0;
4778 goto __pyx_L0;
4779
4780 /* "gssapi/raw/ext_dce.pyx":262
4781 * raise ValueError
4782 *
4783 * def count(IOV self, value): # <<<<<<<<<<<<<<
4784 * return sum(1 for v in self if v == value)
4785 *
4786 */
4787
4788 /* function exit code */
4789 __pyx_L1_error:;
4790 __Pyx_XDECREF(__pyx_t_1);
4791 __Pyx_XDECREF(__pyx_t_2);
4792 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.count", __pyx_clineno, __pyx_lineno, __pyx_filename);
4793 __pyx_r = NULL;
4794 __pyx_L0:;
4795 __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4796 __Pyx_XGIVEREF(__pyx_r);
4797 __Pyx_RefNannyFinishContext();
4798 return __pyx_r;
4799 }
4800
4801 /* "gssapi/raw/ext_dce.pyx":265
4802 * return sum(1 for v in self if v == value)
4803 *
4804 * def __repr__(IOV self): # <<<<<<<<<<<<<<
4805 * if self.c_changed:
4806 * self._recreate_python_values()
4807 */
4808
4809 /* Python wrapper */
4810 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_19__repr__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_19__repr__(PyObject * __pyx_v_self)4811 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_19__repr__(PyObject *__pyx_v_self) {
4812 PyObject *__pyx_r = 0;
4813 __Pyx_RefNannyDeclarations
4814 __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
4815 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_18__repr__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
4816
4817 /* function exit code */
4818 __Pyx_RefNannyFinishContext();
4819 return __pyx_r;
4820 }
4821
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_18__repr__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)4822 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_18__repr__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
4823 PyObject *__pyx_r = NULL;
4824 __Pyx_RefNannyDeclarations
4825 int __pyx_t_1;
4826 PyObject *__pyx_t_2 = NULL;
4827 PyObject *__pyx_t_3 = NULL;
4828 PyObject *__pyx_t_4 = NULL;
4829 PyObject *__pyx_t_5 = NULL;
4830 int __pyx_lineno = 0;
4831 const char *__pyx_filename = NULL;
4832 int __pyx_clineno = 0;
4833 __Pyx_RefNannySetupContext("__repr__", 0);
4834
4835 /* "gssapi/raw/ext_dce.pyx":266
4836 *
4837 * def __repr__(IOV self):
4838 * if self.c_changed: # <<<<<<<<<<<<<<
4839 * self._recreate_python_values()
4840 *
4841 */
4842 __pyx_t_1 = (__pyx_v_self->c_changed != 0);
4843 if (__pyx_t_1) {
4844
4845 /* "gssapi/raw/ext_dce.pyx":267
4846 * def __repr__(IOV self):
4847 * if self.c_changed:
4848 * self._recreate_python_values() # <<<<<<<<<<<<<<
4849 *
4850 * return "<{module}.{name} {buffs}>".format(
4851 */
4852 __pyx_t_2 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self->__pyx_vtab)->_recreate_python_values(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 267, __pyx_L1_error)
4853 __Pyx_GOTREF(__pyx_t_2);
4854 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4855
4856 /* "gssapi/raw/ext_dce.pyx":266
4857 *
4858 * def __repr__(IOV self):
4859 * if self.c_changed: # <<<<<<<<<<<<<<
4860 * self._recreate_python_values()
4861 *
4862 */
4863 }
4864
4865 /* "gssapi/raw/ext_dce.pyx":269
4866 * self._recreate_python_values()
4867 *
4868 * return "<{module}.{name} {buffs}>".format( # <<<<<<<<<<<<<<
4869 * module=type(self).__module__, name=type(self).__name__,
4870 * buffs=repr(self._buffs))
4871 */
4872 __Pyx_XDECREF(__pyx_r);
4873 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_module_name_buffs, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
4874 __Pyx_GOTREF(__pyx_t_2);
4875
4876 /* "gssapi/raw/ext_dce.pyx":270
4877 *
4878 * return "<{module}.{name} {buffs}>".format(
4879 * module=type(self).__module__, name=type(self).__name__, # <<<<<<<<<<<<<<
4880 * buffs=repr(self._buffs))
4881 *
4882 */
4883 __pyx_t_3 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
4884 __Pyx_GOTREF(__pyx_t_3);
4885 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_module_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
4886 __Pyx_GOTREF(__pyx_t_4);
4887 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_module, __pyx_t_4) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
4888 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4889 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 270, __pyx_L1_error)
4890 __Pyx_GOTREF(__pyx_t_4);
4891 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_t_4) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
4892 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4893
4894 /* "gssapi/raw/ext_dce.pyx":271
4895 * return "<{module}.{name} {buffs}>".format(
4896 * module=type(self).__module__, name=type(self).__name__,
4897 * buffs=repr(self._buffs)) # <<<<<<<<<<<<<<
4898 *
4899 * def __str__(IOV self):
4900 */
4901 __pyx_t_4 = __pyx_v_self->_buffs;
4902 __Pyx_INCREF(__pyx_t_4);
4903 __pyx_t_5 = PyObject_Repr(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 271, __pyx_L1_error)
4904 __Pyx_GOTREF(__pyx_t_5);
4905 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4906 if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_buffs, __pyx_t_5) < 0) __PYX_ERR(0, 270, __pyx_L1_error)
4907 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4908
4909 /* "gssapi/raw/ext_dce.pyx":269
4910 * self._recreate_python_values()
4911 *
4912 * return "<{module}.{name} {buffs}>".format( # <<<<<<<<<<<<<<
4913 * module=type(self).__module__, name=type(self).__name__,
4914 * buffs=repr(self._buffs))
4915 */
4916 __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
4917 __Pyx_GOTREF(__pyx_t_5);
4918 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4919 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4920 __pyx_r = __pyx_t_5;
4921 __pyx_t_5 = 0;
4922 goto __pyx_L0;
4923
4924 /* "gssapi/raw/ext_dce.pyx":265
4925 * return sum(1 for v in self if v == value)
4926 *
4927 * def __repr__(IOV self): # <<<<<<<<<<<<<<
4928 * if self.c_changed:
4929 * self._recreate_python_values()
4930 */
4931
4932 /* function exit code */
4933 __pyx_L1_error:;
4934 __Pyx_XDECREF(__pyx_t_2);
4935 __Pyx_XDECREF(__pyx_t_3);
4936 __Pyx_XDECREF(__pyx_t_4);
4937 __Pyx_XDECREF(__pyx_t_5);
4938 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4939 __pyx_r = NULL;
4940 __pyx_L0:;
4941 __Pyx_XGIVEREF(__pyx_r);
4942 __Pyx_RefNannyFinishContext();
4943 return __pyx_r;
4944 }
4945
4946 /* "gssapi/raw/ext_dce.pyx":273
4947 * buffs=repr(self._buffs))
4948 *
4949 * def __str__(IOV self): # <<<<<<<<<<<<<<
4950 * buff_strs = []
4951 * for buff in self:
4952 */
4953
4954 /* Python wrapper */
4955 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_21__str__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_21__str__(PyObject * __pyx_v_self)4956 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_21__str__(PyObject *__pyx_v_self) {
4957 PyObject *__pyx_r = 0;
4958 __Pyx_RefNannyDeclarations
4959 __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
4960 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_20__str__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
4961
4962 /* function exit code */
4963 __Pyx_RefNannyFinishContext();
4964 return __pyx_r;
4965 }
4966
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_20__str__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)4967 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_20__str__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
4968 PyObject *__pyx_v_buff_strs = NULL;
4969 PyObject *__pyx_v_buff = NULL;
4970 PyObject *__pyx_v_type_val = NULL;
4971 PyObject *__pyx_v_auto_alloc = NULL;
4972 PyObject *__pyx_v_alloc_str = NULL;
4973 PyObject *__pyx_r = NULL;
4974 __Pyx_RefNannyDeclarations
4975 PyObject *__pyx_t_1 = NULL;
4976 Py_ssize_t __pyx_t_2;
4977 PyObject *(*__pyx_t_3)(PyObject *);
4978 PyObject *__pyx_t_4 = NULL;
4979 PyObject *__pyx_t_5 = NULL;
4980 PyObject *__pyx_t_6 = NULL;
4981 PyObject *__pyx_t_7 = NULL;
4982 int __pyx_t_8;
4983 int __pyx_t_9;
4984 int __pyx_t_10;
4985 int __pyx_t_11;
4986 PyObject *__pyx_t_12 = NULL;
4987 int __pyx_lineno = 0;
4988 const char *__pyx_filename = NULL;
4989 int __pyx_clineno = 0;
4990 __Pyx_RefNannySetupContext("__str__", 0);
4991
4992 /* "gssapi/raw/ext_dce.pyx":274
4993 *
4994 * def __str__(IOV self):
4995 * buff_strs = [] # <<<<<<<<<<<<<<
4996 * for buff in self:
4997 * type_val = str(buff.type).split('.')[1].upper()
4998 */
4999 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 274, __pyx_L1_error)
5000 __Pyx_GOTREF(__pyx_t_1);
5001 __pyx_v_buff_strs = ((PyObject*)__pyx_t_1);
5002 __pyx_t_1 = 0;
5003
5004 /* "gssapi/raw/ext_dce.pyx":275
5005 * def __str__(IOV self):
5006 * buff_strs = []
5007 * for buff in self: # <<<<<<<<<<<<<<
5008 * type_val = str(buff.type).split('.')[1].upper()
5009 * if buff.value is None:
5010 */
5011 if (likely(PyList_CheckExact(((PyObject *)__pyx_v_self))) || PyTuple_CheckExact(((PyObject *)__pyx_v_self))) {
5012 __pyx_t_1 = ((PyObject *)__pyx_v_self); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
5013 __pyx_t_3 = NULL;
5014 } else {
5015 __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 275, __pyx_L1_error)
5016 __Pyx_GOTREF(__pyx_t_1);
5017 __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 275, __pyx_L1_error)
5018 }
5019 for (;;) {
5020 if (likely(!__pyx_t_3)) {
5021 if (likely(PyList_CheckExact(__pyx_t_1))) {
5022 if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
5023 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5024 __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
5025 #else
5026 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
5027 __Pyx_GOTREF(__pyx_t_4);
5028 #endif
5029 } else {
5030 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
5031 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
5032 __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 275, __pyx_L1_error)
5033 #else
5034 __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 275, __pyx_L1_error)
5035 __Pyx_GOTREF(__pyx_t_4);
5036 #endif
5037 }
5038 } else {
5039 __pyx_t_4 = __pyx_t_3(__pyx_t_1);
5040 if (unlikely(!__pyx_t_4)) {
5041 PyObject* exc_type = PyErr_Occurred();
5042 if (exc_type) {
5043 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
5044 else __PYX_ERR(0, 275, __pyx_L1_error)
5045 }
5046 break;
5047 }
5048 __Pyx_GOTREF(__pyx_t_4);
5049 }
5050 __Pyx_XDECREF_SET(__pyx_v_buff, __pyx_t_4);
5051 __pyx_t_4 = 0;
5052
5053 /* "gssapi/raw/ext_dce.pyx":276
5054 * buff_strs = []
5055 * for buff in self:
5056 * type_val = str(buff.type).split('.')[1].upper() # <<<<<<<<<<<<<<
5057 * if buff.value is None:
5058 * auto_alloc = buff.allocate
5059 */
5060 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
5061 __Pyx_GOTREF(__pyx_t_6);
5062 __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 276, __pyx_L1_error)
5063 __Pyx_GOTREF(__pyx_t_7);
5064 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5065 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_split); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
5066 __Pyx_GOTREF(__pyx_t_6);
5067 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5068 __pyx_t_7 = NULL;
5069 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
5070 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
5071 if (likely(__pyx_t_7)) {
5072 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5073 __Pyx_INCREF(__pyx_t_7);
5074 __Pyx_INCREF(function);
5075 __Pyx_DECREF_SET(__pyx_t_6, function);
5076 }
5077 }
5078 __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_kp_s__5) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_kp_s__5);
5079 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5080 if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
5081 __Pyx_GOTREF(__pyx_t_5);
5082 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5083 __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 276, __pyx_L1_error)
5084 __Pyx_GOTREF(__pyx_t_6);
5085 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5086 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_upper); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 276, __pyx_L1_error)
5087 __Pyx_GOTREF(__pyx_t_5);
5088 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5089 __pyx_t_6 = NULL;
5090 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5091 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5092 if (likely(__pyx_t_6)) {
5093 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5094 __Pyx_INCREF(__pyx_t_6);
5095 __Pyx_INCREF(function);
5096 __Pyx_DECREF_SET(__pyx_t_5, function);
5097 }
5098 }
5099 __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
5100 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5101 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 276, __pyx_L1_error)
5102 __Pyx_GOTREF(__pyx_t_4);
5103 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5104 __Pyx_XDECREF_SET(__pyx_v_type_val, __pyx_t_4);
5105 __pyx_t_4 = 0;
5106
5107 /* "gssapi/raw/ext_dce.pyx":277
5108 * for buff in self:
5109 * type_val = str(buff.type).split('.')[1].upper()
5110 * if buff.value is None: # <<<<<<<<<<<<<<
5111 * auto_alloc = buff.allocate
5112 * if auto_alloc:
5113 */
5114 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 277, __pyx_L1_error)
5115 __Pyx_GOTREF(__pyx_t_4);
5116 __pyx_t_8 = (__pyx_t_4 == Py_None);
5117 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5118 __pyx_t_9 = (__pyx_t_8 != 0);
5119 if (__pyx_t_9) {
5120
5121 /* "gssapi/raw/ext_dce.pyx":278
5122 * type_val = str(buff.type).split('.')[1].upper()
5123 * if buff.value is None:
5124 * auto_alloc = buff.allocate # <<<<<<<<<<<<<<
5125 * if auto_alloc:
5126 * buff_strs.append(type_val + "(allocate)")
5127 */
5128 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_allocate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 278, __pyx_L1_error)
5129 __Pyx_GOTREF(__pyx_t_4);
5130 __Pyx_XDECREF_SET(__pyx_v_auto_alloc, __pyx_t_4);
5131 __pyx_t_4 = 0;
5132
5133 /* "gssapi/raw/ext_dce.pyx":279
5134 * if buff.value is None:
5135 * auto_alloc = buff.allocate
5136 * if auto_alloc: # <<<<<<<<<<<<<<
5137 * buff_strs.append(type_val + "(allocate)")
5138 * else:
5139 */
5140 __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_v_auto_alloc); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 279, __pyx_L1_error)
5141 if (__pyx_t_9) {
5142
5143 /* "gssapi/raw/ext_dce.pyx":280
5144 * auto_alloc = buff.allocate
5145 * if auto_alloc:
5146 * buff_strs.append(type_val + "(allocate)") # <<<<<<<<<<<<<<
5147 * else:
5148 * buff_strs.append(type_val + "(empty)")
5149 */
5150 __pyx_t_4 = PyNumber_Add(__pyx_v_type_val, __pyx_kp_s_allocate_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 280, __pyx_L1_error)
5151 __Pyx_GOTREF(__pyx_t_4);
5152 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_buff_strs, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 280, __pyx_L1_error)
5153 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5154
5155 /* "gssapi/raw/ext_dce.pyx":279
5156 * if buff.value is None:
5157 * auto_alloc = buff.allocate
5158 * if auto_alloc: # <<<<<<<<<<<<<<
5159 * buff_strs.append(type_val + "(allocate)")
5160 * else:
5161 */
5162 goto __pyx_L6;
5163 }
5164
5165 /* "gssapi/raw/ext_dce.pyx":282
5166 * buff_strs.append(type_val + "(allocate)")
5167 * else:
5168 * buff_strs.append(type_val + "(empty)") # <<<<<<<<<<<<<<
5169 * else:
5170 * if buff.allocate is None:
5171 */
5172 /*else*/ {
5173 __pyx_t_4 = PyNumber_Add(__pyx_v_type_val, __pyx_kp_s_empty); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 282, __pyx_L1_error)
5174 __Pyx_GOTREF(__pyx_t_4);
5175 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_buff_strs, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 282, __pyx_L1_error)
5176 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5177 }
5178 __pyx_L6:;
5179
5180 /* "gssapi/raw/ext_dce.pyx":277
5181 * for buff in self:
5182 * type_val = str(buff.type).split('.')[1].upper()
5183 * if buff.value is None: # <<<<<<<<<<<<<<
5184 * auto_alloc = buff.allocate
5185 * if auto_alloc:
5186 */
5187 goto __pyx_L5;
5188 }
5189
5190 /* "gssapi/raw/ext_dce.pyx":284
5191 * buff_strs.append(type_val + "(empty)")
5192 * else:
5193 * if buff.allocate is None: # <<<<<<<<<<<<<<
5194 * alloc_str = ", allocated"
5195 * else:
5196 */
5197 /*else*/ {
5198 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_allocate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 284, __pyx_L1_error)
5199 __Pyx_GOTREF(__pyx_t_4);
5200 __pyx_t_9 = (__pyx_t_4 == Py_None);
5201 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5202 __pyx_t_8 = (__pyx_t_9 != 0);
5203 if (__pyx_t_8) {
5204
5205 /* "gssapi/raw/ext_dce.pyx":285
5206 * else:
5207 * if buff.allocate is None:
5208 * alloc_str = ", allocated" # <<<<<<<<<<<<<<
5209 * else:
5210 * alloc_str = ""
5211 */
5212 __Pyx_INCREF(__pyx_kp_s_allocated);
5213 __Pyx_XDECREF_SET(__pyx_v_alloc_str, __pyx_kp_s_allocated);
5214
5215 /* "gssapi/raw/ext_dce.pyx":284
5216 * buff_strs.append(type_val + "(empty)")
5217 * else:
5218 * if buff.allocate is None: # <<<<<<<<<<<<<<
5219 * alloc_str = ", allocated"
5220 * else:
5221 */
5222 goto __pyx_L7;
5223 }
5224
5225 /* "gssapi/raw/ext_dce.pyx":287
5226 * alloc_str = ", allocated"
5227 * else:
5228 * alloc_str = "" # <<<<<<<<<<<<<<
5229 * buff_strs.append("{0}({1!r}{2})".format(type_val,
5230 * buff.value, alloc_str))
5231 */
5232 /*else*/ {
5233 __Pyx_INCREF(__pyx_kp_s__6);
5234 __Pyx_XDECREF_SET(__pyx_v_alloc_str, __pyx_kp_s__6);
5235 }
5236 __pyx_L7:;
5237
5238 /* "gssapi/raw/ext_dce.pyx":288
5239 * else:
5240 * alloc_str = ""
5241 * buff_strs.append("{0}({1!r}{2})".format(type_val, # <<<<<<<<<<<<<<
5242 * buff.value, alloc_str))
5243 *
5244 */
5245 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_0_1_r_2, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
5246 __Pyx_GOTREF(__pyx_t_5);
5247
5248 /* "gssapi/raw/ext_dce.pyx":289
5249 * alloc_str = ""
5250 * buff_strs.append("{0}({1!r}{2})".format(type_val,
5251 * buff.value, alloc_str)) # <<<<<<<<<<<<<<
5252 *
5253 * return "<IOV {0}>".format(' | '.join(buff_strs))
5254 */
5255 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_buff, __pyx_n_s_value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
5256 __Pyx_GOTREF(__pyx_t_6);
5257 __pyx_t_7 = NULL;
5258 __pyx_t_11 = 0;
5259 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5260 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
5261 if (likely(__pyx_t_7)) {
5262 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5263 __Pyx_INCREF(__pyx_t_7);
5264 __Pyx_INCREF(function);
5265 __Pyx_DECREF_SET(__pyx_t_5, function);
5266 __pyx_t_11 = 1;
5267 }
5268 }
5269 #if CYTHON_FAST_PYCALL
5270 if (PyFunction_Check(__pyx_t_5)) {
5271 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_val, __pyx_t_6, __pyx_v_alloc_str};
5272 __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
5273 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5274 __Pyx_GOTREF(__pyx_t_4);
5275 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5276 } else
5277 #endif
5278 #if CYTHON_FAST_PYCCALL
5279 if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
5280 PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_type_val, __pyx_t_6, __pyx_v_alloc_str};
5281 __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
5282 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5283 __Pyx_GOTREF(__pyx_t_4);
5284 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5285 } else
5286 #endif
5287 {
5288 __pyx_t_12 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 288, __pyx_L1_error)
5289 __Pyx_GOTREF(__pyx_t_12);
5290 if (__pyx_t_7) {
5291 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
5292 }
5293 __Pyx_INCREF(__pyx_v_type_val);
5294 __Pyx_GIVEREF(__pyx_v_type_val);
5295 PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_type_val);
5296 __Pyx_GIVEREF(__pyx_t_6);
5297 PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_6);
5298 __Pyx_INCREF(__pyx_v_alloc_str);
5299 __Pyx_GIVEREF(__pyx_v_alloc_str);
5300 PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_v_alloc_str);
5301 __pyx_t_6 = 0;
5302 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
5303 __Pyx_GOTREF(__pyx_t_4);
5304 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5305 }
5306 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5307
5308 /* "gssapi/raw/ext_dce.pyx":288
5309 * else:
5310 * alloc_str = ""
5311 * buff_strs.append("{0}({1!r}{2})".format(type_val, # <<<<<<<<<<<<<<
5312 * buff.value, alloc_str))
5313 *
5314 */
5315 __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_buff_strs, __pyx_t_4); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 288, __pyx_L1_error)
5316 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5317 }
5318 __pyx_L5:;
5319
5320 /* "gssapi/raw/ext_dce.pyx":275
5321 * def __str__(IOV self):
5322 * buff_strs = []
5323 * for buff in self: # <<<<<<<<<<<<<<
5324 * type_val = str(buff.type).split('.')[1].upper()
5325 * if buff.value is None:
5326 */
5327 }
5328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5329
5330 /* "gssapi/raw/ext_dce.pyx":291
5331 * buff.value, alloc_str))
5332 *
5333 * return "<IOV {0}>".format(' | '.join(buff_strs)) # <<<<<<<<<<<<<<
5334 *
5335 * def __dealloc__(IOV self):
5336 */
5337 __Pyx_XDECREF(__pyx_r);
5338 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_IOV_0, __pyx_n_s_format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 291, __pyx_L1_error)
5339 __Pyx_GOTREF(__pyx_t_4);
5340 __pyx_t_5 = __Pyx_PyString_Join(__pyx_kp_s__7, __pyx_v_buff_strs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 291, __pyx_L1_error)
5341 __Pyx_GOTREF(__pyx_t_5);
5342 __pyx_t_12 = NULL;
5343 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
5344 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
5345 if (likely(__pyx_t_12)) {
5346 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5347 __Pyx_INCREF(__pyx_t_12);
5348 __Pyx_INCREF(function);
5349 __Pyx_DECREF_SET(__pyx_t_4, function);
5350 }
5351 }
5352 __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_12, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
5353 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5354 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5355 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
5356 __Pyx_GOTREF(__pyx_t_1);
5357 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5358 __pyx_r = __pyx_t_1;
5359 __pyx_t_1 = 0;
5360 goto __pyx_L0;
5361
5362 /* "gssapi/raw/ext_dce.pyx":273
5363 * buffs=repr(self._buffs))
5364 *
5365 * def __str__(IOV self): # <<<<<<<<<<<<<<
5366 * buff_strs = []
5367 * for buff in self:
5368 */
5369
5370 /* function exit code */
5371 __pyx_L1_error:;
5372 __Pyx_XDECREF(__pyx_t_1);
5373 __Pyx_XDECREF(__pyx_t_4);
5374 __Pyx_XDECREF(__pyx_t_5);
5375 __Pyx_XDECREF(__pyx_t_6);
5376 __Pyx_XDECREF(__pyx_t_7);
5377 __Pyx_XDECREF(__pyx_t_12);
5378 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5379 __pyx_r = NULL;
5380 __pyx_L0:;
5381 __Pyx_XDECREF(__pyx_v_buff_strs);
5382 __Pyx_XDECREF(__pyx_v_buff);
5383 __Pyx_XDECREF(__pyx_v_type_val);
5384 __Pyx_XDECREF(__pyx_v_auto_alloc);
5385 __Pyx_XDECREF(__pyx_v_alloc_str);
5386 __Pyx_XGIVEREF(__pyx_r);
5387 __Pyx_RefNannyFinishContext();
5388 return __pyx_r;
5389 }
5390
5391 /* "gssapi/raw/ext_dce.pyx":293
5392 * return "<IOV {0}>".format(' | '.join(buff_strs))
5393 *
5394 * def __dealloc__(IOV self): # <<<<<<<<<<<<<<
5395 * cdef OM_uint32 tmp_min_stat
5396 * cdef int i
5397 */
5398
5399 /* Python wrapper */
5400 static void __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_23__dealloc__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_23__dealloc__(PyObject * __pyx_v_self)5401 static void __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_23__dealloc__(PyObject *__pyx_v_self) {
5402 __Pyx_RefNannyDeclarations
5403 __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
5404 __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_22__dealloc__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
5405
5406 /* function exit code */
5407 __Pyx_RefNannyFinishContext();
5408 }
5409
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_22__dealloc__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)5410 static void __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_22__dealloc__(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
5411 OM_uint32 __pyx_v_tmp_min_stat;
5412 int __pyx_v_i;
5413 __Pyx_RefNannyDeclarations
5414 int __pyx_t_1;
5415 int __pyx_t_2;
5416 int __pyx_t_3;
5417 int __pyx_t_4;
5418 __Pyx_RefNannySetupContext("__dealloc__", 0);
5419
5420 /* "gssapi/raw/ext_dce.pyx":296
5421 * cdef OM_uint32 tmp_min_stat
5422 * cdef int i
5423 * if self._iov is not NULL: # <<<<<<<<<<<<<<
5424 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
5425 *
5426 */
5427 __pyx_t_1 = ((__pyx_v_self->_iov != NULL) != 0);
5428 if (__pyx_t_1) {
5429
5430 /* "gssapi/raw/ext_dce.pyx":297
5431 * cdef int i
5432 * if self._iov is not NULL:
5433 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len) # <<<<<<<<<<<<<<
5434 *
5435 * for i in range(self.iov_len):
5436 */
5437 (void)(gss_release_iov_buffer((&__pyx_v_tmp_min_stat), __pyx_v_self->_iov, __pyx_v_self->iov_len));
5438
5439 /* "gssapi/raw/ext_dce.pyx":299
5440 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
5441 *
5442 * for i in range(self.iov_len): # <<<<<<<<<<<<<<
5443 * if self._iov[i].buffer.value is not NULL:
5444 * free(self._iov[i].buffer.value)
5445 */
5446 __pyx_t_2 = __pyx_v_self->iov_len;
5447 __pyx_t_3 = __pyx_t_2;
5448 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5449 __pyx_v_i = __pyx_t_4;
5450
5451 /* "gssapi/raw/ext_dce.pyx":300
5452 *
5453 * for i in range(self.iov_len):
5454 * if self._iov[i].buffer.value is not NULL: # <<<<<<<<<<<<<<
5455 * free(self._iov[i].buffer.value)
5456 *
5457 */
5458 __pyx_t_1 = (((__pyx_v_self->_iov[__pyx_v_i]).buffer.value != NULL) != 0);
5459 if (__pyx_t_1) {
5460
5461 /* "gssapi/raw/ext_dce.pyx":301
5462 * for i in range(self.iov_len):
5463 * if self._iov[i].buffer.value is not NULL:
5464 * free(self._iov[i].buffer.value) # <<<<<<<<<<<<<<
5465 *
5466 * free(self._iov)
5467 */
5468 free((__pyx_v_self->_iov[__pyx_v_i]).buffer.value);
5469
5470 /* "gssapi/raw/ext_dce.pyx":300
5471 *
5472 * for i in range(self.iov_len):
5473 * if self._iov[i].buffer.value is not NULL: # <<<<<<<<<<<<<<
5474 * free(self._iov[i].buffer.value)
5475 *
5476 */
5477 }
5478 }
5479
5480 /* "gssapi/raw/ext_dce.pyx":303
5481 * free(self._iov[i].buffer.value)
5482 *
5483 * free(self._iov) # <<<<<<<<<<<<<<
5484 *
5485 *
5486 */
5487 free(__pyx_v_self->_iov);
5488
5489 /* "gssapi/raw/ext_dce.pyx":296
5490 * cdef OM_uint32 tmp_min_stat
5491 * cdef int i
5492 * if self._iov is not NULL: # <<<<<<<<<<<<<<
5493 * gss_release_iov_buffer(&tmp_min_stat, self._iov, self.iov_len)
5494 *
5495 */
5496 }
5497
5498 /* "gssapi/raw/ext_dce.pyx":293
5499 * return "<IOV {0}>".format(' | '.join(buff_strs))
5500 *
5501 * def __dealloc__(IOV self): # <<<<<<<<<<<<<<
5502 * cdef OM_uint32 tmp_min_stat
5503 * cdef int i
5504 */
5505
5506 /* function exit code */
5507 __Pyx_RefNannyFinishContext();
5508 }
5509
5510 /* "(tree fragment)":1
5511 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5512 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5513 * def __setstate_cython__(self, __pyx_state):
5514 */
5515
5516 /* Python wrapper */
5517 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_25__reduce_cython__(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)5518 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_25__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5519 PyObject *__pyx_r = 0;
5520 __Pyx_RefNannyDeclarations
5521 __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
5522 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_24__reduce_cython__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self));
5523
5524 /* function exit code */
5525 __Pyx_RefNannyFinishContext();
5526 return __pyx_r;
5527 }
5528
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self)5529 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self) {
5530 PyObject *__pyx_r = NULL;
5531 __Pyx_RefNannyDeclarations
5532 PyObject *__pyx_t_1 = NULL;
5533 int __pyx_lineno = 0;
5534 const char *__pyx_filename = NULL;
5535 int __pyx_clineno = 0;
5536 __Pyx_RefNannySetupContext("__reduce_cython__", 0);
5537
5538 /* "(tree fragment)":2
5539 * def __reduce_cython__(self):
5540 * raise TypeError("self._iov cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5541 * def __setstate_cython__(self, __pyx_state):
5542 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5543 */
5544 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
5545 __Pyx_GOTREF(__pyx_t_1);
5546 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5547 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5548 __PYX_ERR(1, 2, __pyx_L1_error)
5549
5550 /* "(tree fragment)":1
5551 * def __reduce_cython__(self): # <<<<<<<<<<<<<<
5552 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5553 * def __setstate_cython__(self, __pyx_state):
5554 */
5555
5556 /* function exit code */
5557 __pyx_L1_error:;
5558 __Pyx_XDECREF(__pyx_t_1);
5559 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5560 __pyx_r = NULL;
5561 __Pyx_XGIVEREF(__pyx_r);
5562 __Pyx_RefNannyFinishContext();
5563 return __pyx_r;
5564 }
5565
5566 /* "(tree fragment)":3
5567 * def __reduce_cython__(self):
5568 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5569 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5570 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5571 */
5572
5573 /* Python wrapper */
5574 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_27__setstate_cython__(PyObject * __pyx_v_self,PyObject * __pyx_v___pyx_state)5575 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_27__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
5576 PyObject *__pyx_r = 0;
5577 __Pyx_RefNannyDeclarations
5578 __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
5579 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_3IOV_26__setstate_cython__(((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
5580
5581 /* function exit code */
5582 __Pyx_RefNannyFinishContext();
5583 return __pyx_r;
5584 }
5585
__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_self,CYTHON_UNUSED PyObject * __pyx_v___pyx_state)5586 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_3IOV_26__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
5587 PyObject *__pyx_r = NULL;
5588 __Pyx_RefNannyDeclarations
5589 PyObject *__pyx_t_1 = NULL;
5590 int __pyx_lineno = 0;
5591 const char *__pyx_filename = NULL;
5592 int __pyx_clineno = 0;
5593 __Pyx_RefNannySetupContext("__setstate_cython__", 0);
5594
5595 /* "(tree fragment)":4
5596 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5597 * def __setstate_cython__(self, __pyx_state):
5598 * raise TypeError("self._iov cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
5599 */
5600 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
5601 __Pyx_GOTREF(__pyx_t_1);
5602 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
5603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5604 __PYX_ERR(1, 4, __pyx_L1_error)
5605
5606 /* "(tree fragment)":3
5607 * def __reduce_cython__(self):
5608 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5609 * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
5610 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
5611 */
5612
5613 /* function exit code */
5614 __pyx_L1_error:;
5615 __Pyx_XDECREF(__pyx_t_1);
5616 __Pyx_AddTraceback("gssapi.raw.ext_dce.IOV.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5617 __pyx_r = NULL;
5618 __Pyx_XGIVEREF(__pyx_r);
5619 __Pyx_RefNannyFinishContext();
5620 return __pyx_r;
5621 }
5622
5623 /* "gssapi/raw/ext_dce.pyx":306
5624 *
5625 *
5626 * def wrap_iov(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
5627 * confidential=True, qop=None):
5628 * """
5629 */
5630
5631 /* Python wrapper */
5632 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_1wrap_iov(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5633 static char __pyx_doc_6gssapi_3raw_7ext_dce_wrap_iov[] = "\n wrap_iov(context, message, confidential=True, qop=None)\n Wrap/Encrypt an IOV message.\n\n This method wraps or encrypts an IOV message. The allocate\n parameter of the :class:`IOVBuffer` objects in the :class:`IOV`\n indicates whether or not that particular buffer should be\n automatically allocated (for use with padding, header, and\n trailer buffers).\n\n Warning:\n This modifies the input :class:`IOV`.\n\n Args:\n context (SecurityContext): the current security context\n message (IOV): an :class:`IOV` containing the message\n confidential (bool): whether or not to encrypt the message (True),\n or just wrap it with a MIC (False)\n qop (int): the desired Quality of Protection\n (or None for the default QoP)\n\n Returns:\n bool: whether or not confidentiality was actually used\n\n Raises:\n GSSError\n ";
5634 static PyMethodDef __pyx_mdef_6gssapi_3raw_7ext_dce_1wrap_iov = {"wrap_iov", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_7ext_dce_1wrap_iov, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_7ext_dce_wrap_iov};
__pyx_pw_6gssapi_3raw_7ext_dce_1wrap_iov(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5635 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_1wrap_iov(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5636 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
5637 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message = 0;
5638 PyObject *__pyx_v_confidential = 0;
5639 PyObject *__pyx_v_qop = 0;
5640 int __pyx_lineno = 0;
5641 const char *__pyx_filename = NULL;
5642 int __pyx_clineno = 0;
5643 PyObject *__pyx_r = 0;
5644 __Pyx_RefNannyDeclarations
5645 __Pyx_RefNannySetupContext("wrap_iov (wrapper)", 0);
5646 {
5647 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_message,&__pyx_n_s_confidential,&__pyx_n_s_qop,0};
5648 PyObject* values[4] = {0,0,0,0};
5649
5650 /* "gssapi/raw/ext_dce.pyx":307
5651 *
5652 * def wrap_iov(SecurityContext context not None, IOV message not None,
5653 * confidential=True, qop=None): # <<<<<<<<<<<<<<
5654 * """
5655 * wrap_iov(context, message, confidential=True, qop=None)
5656 */
5657 values[2] = ((PyObject *)Py_True);
5658 values[3] = ((PyObject *)Py_None);
5659 if (unlikely(__pyx_kwds)) {
5660 Py_ssize_t kw_args;
5661 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5662 switch (pos_args) {
5663 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5664 CYTHON_FALLTHROUGH;
5665 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5666 CYTHON_FALLTHROUGH;
5667 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5668 CYTHON_FALLTHROUGH;
5669 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5670 CYTHON_FALLTHROUGH;
5671 case 0: break;
5672 default: goto __pyx_L5_argtuple_error;
5673 }
5674 kw_args = PyDict_Size(__pyx_kwds);
5675 switch (pos_args) {
5676 case 0:
5677 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
5678 else goto __pyx_L5_argtuple_error;
5679 CYTHON_FALLTHROUGH;
5680 case 1:
5681 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
5682 else {
5683 __Pyx_RaiseArgtupleInvalid("wrap_iov", 0, 2, 4, 1); __PYX_ERR(0, 306, __pyx_L3_error)
5684 }
5685 CYTHON_FALLTHROUGH;
5686 case 2:
5687 if (kw_args > 0) {
5688 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidential);
5689 if (value) { values[2] = value; kw_args--; }
5690 }
5691 CYTHON_FALLTHROUGH;
5692 case 3:
5693 if (kw_args > 0) {
5694 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qop);
5695 if (value) { values[3] = value; kw_args--; }
5696 }
5697 }
5698 if (unlikely(kw_args > 0)) {
5699 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap_iov") < 0)) __PYX_ERR(0, 306, __pyx_L3_error)
5700 }
5701 } else {
5702 switch (PyTuple_GET_SIZE(__pyx_args)) {
5703 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5704 CYTHON_FALLTHROUGH;
5705 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5706 CYTHON_FALLTHROUGH;
5707 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5708 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5709 break;
5710 default: goto __pyx_L5_argtuple_error;
5711 }
5712 }
5713 __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
5714 __pyx_v_message = ((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)values[1]);
5715 __pyx_v_confidential = values[2];
5716 __pyx_v_qop = values[3];
5717 }
5718 goto __pyx_L4_argument_unpacking_done;
5719 __pyx_L5_argtuple_error:;
5720 __Pyx_RaiseArgtupleInvalid("wrap_iov", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 306, __pyx_L3_error)
5721 __pyx_L3_error:;
5722 __Pyx_AddTraceback("gssapi.raw.ext_dce.wrap_iov", __pyx_clineno, __pyx_lineno, __pyx_filename);
5723 __Pyx_RefNannyFinishContext();
5724 return NULL;
5725 __pyx_L4_argument_unpacking_done:;
5726 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(0, 306, __pyx_L1_error)
5727 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_message), __pyx_ptype_6gssapi_3raw_7ext_dce_IOV, 0, "message", 0))) __PYX_ERR(0, 306, __pyx_L1_error)
5728 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_wrap_iov(__pyx_self, __pyx_v_context, __pyx_v_message, __pyx_v_confidential, __pyx_v_qop);
5729
5730 /* "gssapi/raw/ext_dce.pyx":306
5731 *
5732 *
5733 * def wrap_iov(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
5734 * confidential=True, qop=None):
5735 * """
5736 */
5737
5738 /* function exit code */
5739 goto __pyx_L0;
5740 __pyx_L1_error:;
5741 __pyx_r = NULL;
5742 __pyx_L0:;
5743 __Pyx_RefNannyFinishContext();
5744 return __pyx_r;
5745 }
5746
__pyx_pf_6gssapi_3raw_7ext_dce_wrap_iov(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_message,PyObject * __pyx_v_confidential,PyObject * __pyx_v_qop)5747 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_wrap_iov(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message, PyObject *__pyx_v_confidential, PyObject *__pyx_v_qop) {
5748 int __pyx_v_conf_req;
5749 gss_qop_t __pyx_v_qop_req;
5750 int __pyx_v_conf_used;
5751 gss_iov_buffer_desc *__pyx_v_res_arr;
5752 OM_uint32 __pyx_v_maj_stat;
5753 OM_uint32 __pyx_v_min_stat;
5754 PyObject *__pyx_r = NULL;
5755 __Pyx_RefNannyDeclarations
5756 int __pyx_t_1;
5757 gss_qop_t __pyx_t_2;
5758 int __pyx_t_3;
5759 gss_qop_t __pyx_t_4;
5760 gss_iov_buffer_desc *__pyx_t_5;
5761 PyObject *__pyx_t_6 = NULL;
5762 PyObject *__pyx_t_7 = NULL;
5763 PyObject *__pyx_t_8 = NULL;
5764 PyObject *__pyx_t_9 = NULL;
5765 PyObject *__pyx_t_10 = NULL;
5766 PyObject *__pyx_t_11 = NULL;
5767 int __pyx_lineno = 0;
5768 const char *__pyx_filename = NULL;
5769 int __pyx_clineno = 0;
5770 __Pyx_RefNannySetupContext("wrap_iov", 0);
5771
5772 /* "gssapi/raw/ext_dce.pyx":336
5773 * """
5774 *
5775 * cdef int conf_req = confidential # <<<<<<<<<<<<<<
5776 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT
5777 * cdef int conf_used
5778 */
5779 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_confidential); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 336, __pyx_L1_error)
5780 __pyx_v_conf_req = __pyx_t_1;
5781
5782 /* "gssapi/raw/ext_dce.pyx":337
5783 *
5784 * cdef int conf_req = confidential
5785 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT # <<<<<<<<<<<<<<
5786 * cdef int conf_used
5787 *
5788 */
5789 __pyx_t_3 = (__pyx_v_qop != Py_None);
5790 if ((__pyx_t_3 != 0)) {
5791 __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_qop); if (unlikely((__pyx_t_4 == ((gss_qop_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
5792 __pyx_t_2 = __pyx_t_4;
5793 } else {
5794 __pyx_t_2 = GSS_C_QOP_DEFAULT;
5795 }
5796 __pyx_v_qop_req = __pyx_t_2;
5797
5798 /* "gssapi/raw/ext_dce.pyx":340
5799 * cdef int conf_used
5800 *
5801 * cdef gss_iov_buffer_desc *res_arr = message.__cvalue__() # <<<<<<<<<<<<<<
5802 *
5803 * cdef OM_uint32 maj_stat, min_stat
5804 */
5805 __pyx_t_5 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_message->__pyx_vtab)->__pyx___cvalue__(__pyx_v_message); if (unlikely(__pyx_t_5 == ((gss_iov_buffer_desc *)NULL))) __PYX_ERR(0, 340, __pyx_L1_error)
5806 __pyx_v_res_arr = __pyx_t_5;
5807
5808 /* "gssapi/raw/ext_dce.pyx":344
5809 * cdef OM_uint32 maj_stat, min_stat
5810 *
5811 * with nogil: # <<<<<<<<<<<<<<
5812 * maj_stat = gss_wrap_iov(&min_stat, context.raw_ctx, conf_req, qop_req,
5813 * &conf_used, res_arr, message.iov_len)
5814 */
5815 {
5816 #ifdef WITH_THREAD
5817 PyThreadState *_save;
5818 Py_UNBLOCK_THREADS
5819 __Pyx_FastGIL_Remember();
5820 #endif
5821 /*try:*/ {
5822
5823 /* "gssapi/raw/ext_dce.pyx":345
5824 *
5825 * with nogil:
5826 * maj_stat = gss_wrap_iov(&min_stat, context.raw_ctx, conf_req, qop_req, # <<<<<<<<<<<<<<
5827 * &conf_used, res_arr, message.iov_len)
5828 *
5829 */
5830 __pyx_v_maj_stat = gss_wrap_iov((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, __pyx_v_conf_req, __pyx_v_qop_req, (&__pyx_v_conf_used), __pyx_v_res_arr, __pyx_v_message->iov_len);
5831 }
5832
5833 /* "gssapi/raw/ext_dce.pyx":344
5834 * cdef OM_uint32 maj_stat, min_stat
5835 *
5836 * with nogil: # <<<<<<<<<<<<<<
5837 * maj_stat = gss_wrap_iov(&min_stat, context.raw_ctx, conf_req, qop_req,
5838 * &conf_used, res_arr, message.iov_len)
5839 */
5840 /*finally:*/ {
5841 /*normal exit:*/{
5842 #ifdef WITH_THREAD
5843 __Pyx_FastGIL_Forget();
5844 Py_BLOCK_THREADS
5845 #endif
5846 goto __pyx_L5;
5847 }
5848 __pyx_L5:;
5849 }
5850 }
5851
5852 /* "gssapi/raw/ext_dce.pyx":348
5853 * &conf_used, res_arr, message.iov_len)
5854 *
5855 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
5856 * message.c_changed = True
5857 * return <bint>conf_used
5858 */
5859 __pyx_t_3 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
5860 if (likely(__pyx_t_3)) {
5861
5862 /* "gssapi/raw/ext_dce.pyx":349
5863 *
5864 * if maj_stat == GSS_S_COMPLETE:
5865 * message.c_changed = True # <<<<<<<<<<<<<<
5866 * return <bint>conf_used
5867 * else:
5868 */
5869 __pyx_v_message->c_changed = 1;
5870
5871 /* "gssapi/raw/ext_dce.pyx":350
5872 * if maj_stat == GSS_S_COMPLETE:
5873 * message.c_changed = True
5874 * return <bint>conf_used # <<<<<<<<<<<<<<
5875 * else:
5876 * raise GSSError(maj_stat, min_stat)
5877 */
5878 __Pyx_XDECREF(__pyx_r);
5879 __pyx_t_6 = __Pyx_PyBool_FromLong((__pyx_v_conf_used != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 350, __pyx_L1_error)
5880 __Pyx_GOTREF(__pyx_t_6);
5881 __pyx_r = __pyx_t_6;
5882 __pyx_t_6 = 0;
5883 goto __pyx_L0;
5884
5885 /* "gssapi/raw/ext_dce.pyx":348
5886 * &conf_used, res_arr, message.iov_len)
5887 *
5888 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
5889 * message.c_changed = True
5890 * return <bint>conf_used
5891 */
5892 }
5893
5894 /* "gssapi/raw/ext_dce.pyx":352
5895 * return <bint>conf_used
5896 * else:
5897 * raise GSSError(maj_stat, min_stat) # <<<<<<<<<<<<<<
5898 *
5899 *
5900 */
5901 /*else*/ {
5902 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 352, __pyx_L1_error)
5903 __Pyx_GOTREF(__pyx_t_7);
5904 __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 352, __pyx_L1_error)
5905 __Pyx_GOTREF(__pyx_t_8);
5906 __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 352, __pyx_L1_error)
5907 __Pyx_GOTREF(__pyx_t_9);
5908 __pyx_t_10 = NULL;
5909 __pyx_t_1 = 0;
5910 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
5911 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
5912 if (likely(__pyx_t_10)) {
5913 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
5914 __Pyx_INCREF(__pyx_t_10);
5915 __Pyx_INCREF(function);
5916 __Pyx_DECREF_SET(__pyx_t_7, function);
5917 __pyx_t_1 = 1;
5918 }
5919 }
5920 #if CYTHON_FAST_PYCALL
5921 if (PyFunction_Check(__pyx_t_7)) {
5922 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
5923 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
5924 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5925 __Pyx_GOTREF(__pyx_t_6);
5926 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5927 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5928 } else
5929 #endif
5930 #if CYTHON_FAST_PYCCALL
5931 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
5932 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
5933 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
5934 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5935 __Pyx_GOTREF(__pyx_t_6);
5936 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5937 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5938 } else
5939 #endif
5940 {
5941 __pyx_t_11 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 352, __pyx_L1_error)
5942 __Pyx_GOTREF(__pyx_t_11);
5943 if (__pyx_t_10) {
5944 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
5945 }
5946 __Pyx_GIVEREF(__pyx_t_8);
5947 PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_1, __pyx_t_8);
5948 __Pyx_GIVEREF(__pyx_t_9);
5949 PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_1, __pyx_t_9);
5950 __pyx_t_8 = 0;
5951 __pyx_t_9 = 0;
5952 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 352, __pyx_L1_error)
5953 __Pyx_GOTREF(__pyx_t_6);
5954 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5955 }
5956 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5957 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
5958 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5959 __PYX_ERR(0, 352, __pyx_L1_error)
5960 }
5961
5962 /* "gssapi/raw/ext_dce.pyx":306
5963 *
5964 *
5965 * def wrap_iov(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
5966 * confidential=True, qop=None):
5967 * """
5968 */
5969
5970 /* function exit code */
5971 __pyx_L1_error:;
5972 __Pyx_XDECREF(__pyx_t_6);
5973 __Pyx_XDECREF(__pyx_t_7);
5974 __Pyx_XDECREF(__pyx_t_8);
5975 __Pyx_XDECREF(__pyx_t_9);
5976 __Pyx_XDECREF(__pyx_t_10);
5977 __Pyx_XDECREF(__pyx_t_11);
5978 __Pyx_AddTraceback("gssapi.raw.ext_dce.wrap_iov", __pyx_clineno, __pyx_lineno, __pyx_filename);
5979 __pyx_r = NULL;
5980 __pyx_L0:;
5981 __Pyx_XGIVEREF(__pyx_r);
5982 __Pyx_RefNannyFinishContext();
5983 return __pyx_r;
5984 }
5985
5986 /* "gssapi/raw/ext_dce.pyx":355
5987 *
5988 *
5989 * def unwrap_iov(SecurityContext context not None, IOV message not None): # <<<<<<<<<<<<<<
5990 * """
5991 * unwrap_iov(context, message)
5992 */
5993
5994 /* Python wrapper */
5995 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3unwrap_iov(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5996 static char __pyx_doc_6gssapi_3raw_7ext_dce_2unwrap_iov[] = "\n unwrap_iov(context, message)\n Unwrap/Decrypt an IOV message.\n\n This method uwraps or decrypts an IOV message. The allocate\n parameter of the :class:`IOVBuffer` objects in the :class:`IOV`\n indicates whether or not that particular buffer should be\n automatically allocated (for use with padding, header, and\n trailer buffers).\n\n As a special case, you may pass an entire IOV message\n as a single 'stream'. In this case, pass a buffer type\n of :attr:`IOVBufferType.stream` followed by a buffer type of\n :attr:`IOVBufferType.data`. The former should contain the\n entire IOV message, while the latter should be empty.\n\n Warning:\n This modifies the input :class:`IOV`.\n\n Args:\n context (SecurityContext): the current security context\n message (IOV): an :class:`IOV` containing the message\n\n Returns:\n IOVUnwrapResult: whether or not confidentiality was used,\n and the QoP used.\n\n Raises:\n GSSError\n ";
5997 static PyMethodDef __pyx_mdef_6gssapi_3raw_7ext_dce_3unwrap_iov = {"unwrap_iov", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_7ext_dce_3unwrap_iov, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_7ext_dce_2unwrap_iov};
__pyx_pw_6gssapi_3raw_7ext_dce_3unwrap_iov(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)5998 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_3unwrap_iov(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5999 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
6000 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message = 0;
6001 int __pyx_lineno = 0;
6002 const char *__pyx_filename = NULL;
6003 int __pyx_clineno = 0;
6004 PyObject *__pyx_r = 0;
6005 __Pyx_RefNannyDeclarations
6006 __Pyx_RefNannySetupContext("unwrap_iov (wrapper)", 0);
6007 {
6008 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_message,0};
6009 PyObject* values[2] = {0,0};
6010 if (unlikely(__pyx_kwds)) {
6011 Py_ssize_t kw_args;
6012 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6013 switch (pos_args) {
6014 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6015 CYTHON_FALLTHROUGH;
6016 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6017 CYTHON_FALLTHROUGH;
6018 case 0: break;
6019 default: goto __pyx_L5_argtuple_error;
6020 }
6021 kw_args = PyDict_Size(__pyx_kwds);
6022 switch (pos_args) {
6023 case 0:
6024 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
6025 else goto __pyx_L5_argtuple_error;
6026 CYTHON_FALLTHROUGH;
6027 case 1:
6028 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
6029 else {
6030 __Pyx_RaiseArgtupleInvalid("unwrap_iov", 1, 2, 2, 1); __PYX_ERR(0, 355, __pyx_L3_error)
6031 }
6032 }
6033 if (unlikely(kw_args > 0)) {
6034 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unwrap_iov") < 0)) __PYX_ERR(0, 355, __pyx_L3_error)
6035 }
6036 } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
6037 goto __pyx_L5_argtuple_error;
6038 } else {
6039 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6040 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6041 }
6042 __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
6043 __pyx_v_message = ((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)values[1]);
6044 }
6045 goto __pyx_L4_argument_unpacking_done;
6046 __pyx_L5_argtuple_error:;
6047 __Pyx_RaiseArgtupleInvalid("unwrap_iov", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 355, __pyx_L3_error)
6048 __pyx_L3_error:;
6049 __Pyx_AddTraceback("gssapi.raw.ext_dce.unwrap_iov", __pyx_clineno, __pyx_lineno, __pyx_filename);
6050 __Pyx_RefNannyFinishContext();
6051 return NULL;
6052 __pyx_L4_argument_unpacking_done:;
6053 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(0, 355, __pyx_L1_error)
6054 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_message), __pyx_ptype_6gssapi_3raw_7ext_dce_IOV, 0, "message", 0))) __PYX_ERR(0, 355, __pyx_L1_error)
6055 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_2unwrap_iov(__pyx_self, __pyx_v_context, __pyx_v_message);
6056
6057 /* function exit code */
6058 goto __pyx_L0;
6059 __pyx_L1_error:;
6060 __pyx_r = NULL;
6061 __pyx_L0:;
6062 __Pyx_RefNannyFinishContext();
6063 return __pyx_r;
6064 }
6065
__pyx_pf_6gssapi_3raw_7ext_dce_2unwrap_iov(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_message)6066 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_2unwrap_iov(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message) {
6067 int __pyx_v_conf_used;
6068 gss_qop_t __pyx_v_qop_used;
6069 gss_iov_buffer_desc *__pyx_v_res_arr;
6070 OM_uint32 __pyx_v_maj_stat;
6071 OM_uint32 __pyx_v_min_stat;
6072 PyObject *__pyx_r = NULL;
6073 __Pyx_RefNannyDeclarations
6074 gss_iov_buffer_desc *__pyx_t_1;
6075 int __pyx_t_2;
6076 PyObject *__pyx_t_3 = NULL;
6077 PyObject *__pyx_t_4 = NULL;
6078 PyObject *__pyx_t_5 = NULL;
6079 PyObject *__pyx_t_6 = NULL;
6080 PyObject *__pyx_t_7 = NULL;
6081 int __pyx_t_8;
6082 PyObject *__pyx_t_9 = NULL;
6083 int __pyx_lineno = 0;
6084 const char *__pyx_filename = NULL;
6085 int __pyx_clineno = 0;
6086 __Pyx_RefNannySetupContext("unwrap_iov", 0);
6087
6088 /* "gssapi/raw/ext_dce.pyx":389
6089 * cdef int conf_used
6090 * cdef gss_qop_t qop_used
6091 * cdef gss_iov_buffer_desc *res_arr = message.__cvalue__() # <<<<<<<<<<<<<<
6092 *
6093 * cdef OM_uint32 maj_stat, min_stat
6094 */
6095 __pyx_t_1 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_message->__pyx_vtab)->__pyx___cvalue__(__pyx_v_message); if (unlikely(__pyx_t_1 == ((gss_iov_buffer_desc *)NULL))) __PYX_ERR(0, 389, __pyx_L1_error)
6096 __pyx_v_res_arr = __pyx_t_1;
6097
6098 /* "gssapi/raw/ext_dce.pyx":393
6099 * cdef OM_uint32 maj_stat, min_stat
6100 *
6101 * with nogil: # <<<<<<<<<<<<<<
6102 * maj_stat = gss_unwrap_iov(&min_stat, context.raw_ctx, &conf_used,
6103 * &qop_used, res_arr, message.iov_len)
6104 */
6105 {
6106 #ifdef WITH_THREAD
6107 PyThreadState *_save;
6108 Py_UNBLOCK_THREADS
6109 __Pyx_FastGIL_Remember();
6110 #endif
6111 /*try:*/ {
6112
6113 /* "gssapi/raw/ext_dce.pyx":394
6114 *
6115 * with nogil:
6116 * maj_stat = gss_unwrap_iov(&min_stat, context.raw_ctx, &conf_used, # <<<<<<<<<<<<<<
6117 * &qop_used, res_arr, message.iov_len)
6118 *
6119 */
6120 __pyx_v_maj_stat = gss_unwrap_iov((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, (&__pyx_v_conf_used), (&__pyx_v_qop_used), __pyx_v_res_arr, __pyx_v_message->iov_len);
6121 }
6122
6123 /* "gssapi/raw/ext_dce.pyx":393
6124 * cdef OM_uint32 maj_stat, min_stat
6125 *
6126 * with nogil: # <<<<<<<<<<<<<<
6127 * maj_stat = gss_unwrap_iov(&min_stat, context.raw_ctx, &conf_used,
6128 * &qop_used, res_arr, message.iov_len)
6129 */
6130 /*finally:*/ {
6131 /*normal exit:*/{
6132 #ifdef WITH_THREAD
6133 __Pyx_FastGIL_Forget();
6134 Py_BLOCK_THREADS
6135 #endif
6136 goto __pyx_L5;
6137 }
6138 __pyx_L5:;
6139 }
6140 }
6141
6142 /* "gssapi/raw/ext_dce.pyx":397
6143 * &qop_used, res_arr, message.iov_len)
6144 *
6145 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
6146 * message.c_changed = True
6147 * return IOVUnwrapResult(<bint>conf_used, qop_used)
6148 */
6149 __pyx_t_2 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
6150 if (likely(__pyx_t_2)) {
6151
6152 /* "gssapi/raw/ext_dce.pyx":398
6153 *
6154 * if maj_stat == GSS_S_COMPLETE:
6155 * message.c_changed = True # <<<<<<<<<<<<<<
6156 * return IOVUnwrapResult(<bint>conf_used, qop_used)
6157 * else:
6158 */
6159 __pyx_v_message->c_changed = 1;
6160
6161 /* "gssapi/raw/ext_dce.pyx":399
6162 * if maj_stat == GSS_S_COMPLETE:
6163 * message.c_changed = True
6164 * return IOVUnwrapResult(<bint>conf_used, qop_used) # <<<<<<<<<<<<<<
6165 * else:
6166 * raise GSSError(maj_stat, min_stat)
6167 */
6168 __Pyx_XDECREF(__pyx_r);
6169 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_IOVUnwrapResult); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
6170 __Pyx_GOTREF(__pyx_t_4);
6171 __pyx_t_5 = __Pyx_PyBool_FromLong((__pyx_v_conf_used != 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 399, __pyx_L1_error)
6172 __Pyx_GOTREF(__pyx_t_5);
6173 __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_qop_used); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 399, __pyx_L1_error)
6174 __Pyx_GOTREF(__pyx_t_6);
6175 __pyx_t_7 = NULL;
6176 __pyx_t_8 = 0;
6177 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6178 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
6179 if (likely(__pyx_t_7)) {
6180 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6181 __Pyx_INCREF(__pyx_t_7);
6182 __Pyx_INCREF(function);
6183 __Pyx_DECREF_SET(__pyx_t_4, function);
6184 __pyx_t_8 = 1;
6185 }
6186 }
6187 #if CYTHON_FAST_PYCALL
6188 if (PyFunction_Check(__pyx_t_4)) {
6189 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
6190 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
6191 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6192 __Pyx_GOTREF(__pyx_t_3);
6193 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6194 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6195 } else
6196 #endif
6197 #if CYTHON_FAST_PYCCALL
6198 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6199 PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_5, __pyx_t_6};
6200 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
6201 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6202 __Pyx_GOTREF(__pyx_t_3);
6203 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6204 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6205 } else
6206 #endif
6207 {
6208 __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 399, __pyx_L1_error)
6209 __Pyx_GOTREF(__pyx_t_9);
6210 if (__pyx_t_7) {
6211 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
6212 }
6213 __Pyx_GIVEREF(__pyx_t_5);
6214 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_5);
6215 __Pyx_GIVEREF(__pyx_t_6);
6216 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_6);
6217 __pyx_t_5 = 0;
6218 __pyx_t_6 = 0;
6219 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 399, __pyx_L1_error)
6220 __Pyx_GOTREF(__pyx_t_3);
6221 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6222 }
6223 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6224 __pyx_r = __pyx_t_3;
6225 __pyx_t_3 = 0;
6226 goto __pyx_L0;
6227
6228 /* "gssapi/raw/ext_dce.pyx":397
6229 * &qop_used, res_arr, message.iov_len)
6230 *
6231 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
6232 * message.c_changed = True
6233 * return IOVUnwrapResult(<bint>conf_used, qop_used)
6234 */
6235 }
6236
6237 /* "gssapi/raw/ext_dce.pyx":401
6238 * return IOVUnwrapResult(<bint>conf_used, qop_used)
6239 * else:
6240 * raise GSSError(maj_stat, min_stat) # <<<<<<<<<<<<<<
6241 *
6242 *
6243 */
6244 /*else*/ {
6245 __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
6246 __Pyx_GOTREF(__pyx_t_4);
6247 __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 401, __pyx_L1_error)
6248 __Pyx_GOTREF(__pyx_t_9);
6249 __pyx_t_6 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
6250 __Pyx_GOTREF(__pyx_t_6);
6251 __pyx_t_5 = NULL;
6252 __pyx_t_8 = 0;
6253 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
6254 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
6255 if (likely(__pyx_t_5)) {
6256 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6257 __Pyx_INCREF(__pyx_t_5);
6258 __Pyx_INCREF(function);
6259 __Pyx_DECREF_SET(__pyx_t_4, function);
6260 __pyx_t_8 = 1;
6261 }
6262 }
6263 #if CYTHON_FAST_PYCALL
6264 if (PyFunction_Check(__pyx_t_4)) {
6265 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_9, __pyx_t_6};
6266 __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
6267 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6268 __Pyx_GOTREF(__pyx_t_3);
6269 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6270 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6271 } else
6272 #endif
6273 #if CYTHON_FAST_PYCCALL
6274 if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
6275 PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_9, __pyx_t_6};
6276 __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
6277 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6278 __Pyx_GOTREF(__pyx_t_3);
6279 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6280 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6281 } else
6282 #endif
6283 {
6284 __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 401, __pyx_L1_error)
6285 __Pyx_GOTREF(__pyx_t_7);
6286 if (__pyx_t_5) {
6287 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
6288 }
6289 __Pyx_GIVEREF(__pyx_t_9);
6290 PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_t_9);
6291 __Pyx_GIVEREF(__pyx_t_6);
6292 PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_t_6);
6293 __pyx_t_9 = 0;
6294 __pyx_t_6 = 0;
6295 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
6296 __Pyx_GOTREF(__pyx_t_3);
6297 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6298 }
6299 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6300 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6301 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6302 __PYX_ERR(0, 401, __pyx_L1_error)
6303 }
6304
6305 /* "gssapi/raw/ext_dce.pyx":355
6306 *
6307 *
6308 * def unwrap_iov(SecurityContext context not None, IOV message not None): # <<<<<<<<<<<<<<
6309 * """
6310 * unwrap_iov(context, message)
6311 */
6312
6313 /* function exit code */
6314 __pyx_L1_error:;
6315 __Pyx_XDECREF(__pyx_t_3);
6316 __Pyx_XDECREF(__pyx_t_4);
6317 __Pyx_XDECREF(__pyx_t_5);
6318 __Pyx_XDECREF(__pyx_t_6);
6319 __Pyx_XDECREF(__pyx_t_7);
6320 __Pyx_XDECREF(__pyx_t_9);
6321 __Pyx_AddTraceback("gssapi.raw.ext_dce.unwrap_iov", __pyx_clineno, __pyx_lineno, __pyx_filename);
6322 __pyx_r = NULL;
6323 __pyx_L0:;
6324 __Pyx_XGIVEREF(__pyx_r);
6325 __Pyx_RefNannyFinishContext();
6326 return __pyx_r;
6327 }
6328
6329 /* "gssapi/raw/ext_dce.pyx":404
6330 *
6331 *
6332 * def wrap_iov_length(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
6333 * confidential=True, qop=None):
6334 * """
6335 */
6336
6337 /* Python wrapper */
6338 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_5wrap_iov_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6339 static char __pyx_doc_6gssapi_3raw_7ext_dce_4wrap_iov_length[] = "\n wrap_iov_length(context, message, confidential=True, qop=None)\n Appropriately size padding, trailer, and header IOV buffers.\n\n This method sets the length values on the IOV buffers. You\n should already have data provided for the data (and sign-only)\n buffer(s) so that padding lengths can be appropriately computed.\n\n In Python terms, this will result in an appropriately sized\n `bytes` object consisting of all zeros.\n\n Warning:\n This modifies the input :class:`IOV`.\n\n Args:\n context (SecurityContext): the current security context\n message (IOV): an :class:`IOV` containing the message\n\n Returns:\n WrapResult: a list of :class:IOVBuffer` objects, and whether or not\n encryption was actually used\n\n Raises:\n GSSError\n ";
6340 static PyMethodDef __pyx_mdef_6gssapi_3raw_7ext_dce_5wrap_iov_length = {"wrap_iov_length", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_7ext_dce_5wrap_iov_length, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_7ext_dce_4wrap_iov_length};
__pyx_pw_6gssapi_3raw_7ext_dce_5wrap_iov_length(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6341 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_5wrap_iov_length(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6342 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
6343 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message = 0;
6344 PyObject *__pyx_v_confidential = 0;
6345 PyObject *__pyx_v_qop = 0;
6346 int __pyx_lineno = 0;
6347 const char *__pyx_filename = NULL;
6348 int __pyx_clineno = 0;
6349 PyObject *__pyx_r = 0;
6350 __Pyx_RefNannyDeclarations
6351 __Pyx_RefNannySetupContext("wrap_iov_length (wrapper)", 0);
6352 {
6353 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_message,&__pyx_n_s_confidential,&__pyx_n_s_qop,0};
6354 PyObject* values[4] = {0,0,0,0};
6355
6356 /* "gssapi/raw/ext_dce.pyx":405
6357 *
6358 * def wrap_iov_length(SecurityContext context not None, IOV message not None,
6359 * confidential=True, qop=None): # <<<<<<<<<<<<<<
6360 * """
6361 * wrap_iov_length(context, message, confidential=True, qop=None)
6362 */
6363 values[2] = ((PyObject *)Py_True);
6364 values[3] = ((PyObject *)Py_None);
6365 if (unlikely(__pyx_kwds)) {
6366 Py_ssize_t kw_args;
6367 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6368 switch (pos_args) {
6369 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6370 CYTHON_FALLTHROUGH;
6371 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6372 CYTHON_FALLTHROUGH;
6373 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6374 CYTHON_FALLTHROUGH;
6375 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6376 CYTHON_FALLTHROUGH;
6377 case 0: break;
6378 default: goto __pyx_L5_argtuple_error;
6379 }
6380 kw_args = PyDict_Size(__pyx_kwds);
6381 switch (pos_args) {
6382 case 0:
6383 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
6384 else goto __pyx_L5_argtuple_error;
6385 CYTHON_FALLTHROUGH;
6386 case 1:
6387 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
6388 else {
6389 __Pyx_RaiseArgtupleInvalid("wrap_iov_length", 0, 2, 4, 1); __PYX_ERR(0, 404, __pyx_L3_error)
6390 }
6391 CYTHON_FALLTHROUGH;
6392 case 2:
6393 if (kw_args > 0) {
6394 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidential);
6395 if (value) { values[2] = value; kw_args--; }
6396 }
6397 CYTHON_FALLTHROUGH;
6398 case 3:
6399 if (kw_args > 0) {
6400 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qop);
6401 if (value) { values[3] = value; kw_args--; }
6402 }
6403 }
6404 if (unlikely(kw_args > 0)) {
6405 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap_iov_length") < 0)) __PYX_ERR(0, 404, __pyx_L3_error)
6406 }
6407 } else {
6408 switch (PyTuple_GET_SIZE(__pyx_args)) {
6409 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6410 CYTHON_FALLTHROUGH;
6411 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6412 CYTHON_FALLTHROUGH;
6413 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6414 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6415 break;
6416 default: goto __pyx_L5_argtuple_error;
6417 }
6418 }
6419 __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
6420 __pyx_v_message = ((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)values[1]);
6421 __pyx_v_confidential = values[2];
6422 __pyx_v_qop = values[3];
6423 }
6424 goto __pyx_L4_argument_unpacking_done;
6425 __pyx_L5_argtuple_error:;
6426 __Pyx_RaiseArgtupleInvalid("wrap_iov_length", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 404, __pyx_L3_error)
6427 __pyx_L3_error:;
6428 __Pyx_AddTraceback("gssapi.raw.ext_dce.wrap_iov_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
6429 __Pyx_RefNannyFinishContext();
6430 return NULL;
6431 __pyx_L4_argument_unpacking_done:;
6432 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(0, 404, __pyx_L1_error)
6433 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_message), __pyx_ptype_6gssapi_3raw_7ext_dce_IOV, 0, "message", 0))) __PYX_ERR(0, 404, __pyx_L1_error)
6434 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_4wrap_iov_length(__pyx_self, __pyx_v_context, __pyx_v_message, __pyx_v_confidential, __pyx_v_qop);
6435
6436 /* "gssapi/raw/ext_dce.pyx":404
6437 *
6438 *
6439 * def wrap_iov_length(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
6440 * confidential=True, qop=None):
6441 * """
6442 */
6443
6444 /* function exit code */
6445 goto __pyx_L0;
6446 __pyx_L1_error:;
6447 __pyx_r = NULL;
6448 __pyx_L0:;
6449 __Pyx_RefNannyFinishContext();
6450 return __pyx_r;
6451 }
6452
__pyx_pf_6gssapi_3raw_7ext_dce_4wrap_iov_length(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV * __pyx_v_message,PyObject * __pyx_v_confidential,PyObject * __pyx_v_qop)6453 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_4wrap_iov_length(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *__pyx_v_message, PyObject *__pyx_v_confidential, PyObject *__pyx_v_qop) {
6454 int __pyx_v_conf_req;
6455 gss_qop_t __pyx_v_qop_req;
6456 int __pyx_v_conf_used;
6457 gss_iov_buffer_desc *__pyx_v_res_arr;
6458 OM_uint32 __pyx_v_maj_stat;
6459 OM_uint32 __pyx_v_min_stat;
6460 PyObject *__pyx_r = NULL;
6461 __Pyx_RefNannyDeclarations
6462 int __pyx_t_1;
6463 gss_qop_t __pyx_t_2;
6464 int __pyx_t_3;
6465 gss_qop_t __pyx_t_4;
6466 gss_iov_buffer_desc *__pyx_t_5;
6467 PyObject *__pyx_t_6 = NULL;
6468 PyObject *__pyx_t_7 = NULL;
6469 PyObject *__pyx_t_8 = NULL;
6470 PyObject *__pyx_t_9 = NULL;
6471 PyObject *__pyx_t_10 = NULL;
6472 PyObject *__pyx_t_11 = NULL;
6473 int __pyx_lineno = 0;
6474 const char *__pyx_filename = NULL;
6475 int __pyx_clineno = 0;
6476 __Pyx_RefNannySetupContext("wrap_iov_length", 0);
6477
6478 /* "gssapi/raw/ext_dce.pyx":432
6479 * """
6480 *
6481 * cdef int conf_req = confidential # <<<<<<<<<<<<<<
6482 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT
6483 * cdef int conf_used
6484 */
6485 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_confidential); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error)
6486 __pyx_v_conf_req = __pyx_t_1;
6487
6488 /* "gssapi/raw/ext_dce.pyx":433
6489 *
6490 * cdef int conf_req = confidential
6491 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT # <<<<<<<<<<<<<<
6492 * cdef int conf_used
6493 *
6494 */
6495 __pyx_t_3 = (__pyx_v_qop != Py_None);
6496 if ((__pyx_t_3 != 0)) {
6497 __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_qop); if (unlikely((__pyx_t_4 == ((gss_qop_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 433, __pyx_L1_error)
6498 __pyx_t_2 = __pyx_t_4;
6499 } else {
6500 __pyx_t_2 = GSS_C_QOP_DEFAULT;
6501 }
6502 __pyx_v_qop_req = __pyx_t_2;
6503
6504 /* "gssapi/raw/ext_dce.pyx":436
6505 * cdef int conf_used
6506 *
6507 * cdef gss_iov_buffer_desc *res_arr = message.__cvalue__() # <<<<<<<<<<<<<<
6508 *
6509 * cdef OM_uint32 maj_stat, min_stat
6510 */
6511 __pyx_t_5 = ((struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV *)__pyx_v_message->__pyx_vtab)->__pyx___cvalue__(__pyx_v_message); if (unlikely(__pyx_t_5 == ((gss_iov_buffer_desc *)NULL))) __PYX_ERR(0, 436, __pyx_L1_error)
6512 __pyx_v_res_arr = __pyx_t_5;
6513
6514 /* "gssapi/raw/ext_dce.pyx":440
6515 * cdef OM_uint32 maj_stat, min_stat
6516 *
6517 * with nogil: # <<<<<<<<<<<<<<
6518 * maj_stat = gss_wrap_iov_length(&min_stat, context.raw_ctx,
6519 * conf_req, qop_req,
6520 */
6521 {
6522 #ifdef WITH_THREAD
6523 PyThreadState *_save;
6524 Py_UNBLOCK_THREADS
6525 __Pyx_FastGIL_Remember();
6526 #endif
6527 /*try:*/ {
6528
6529 /* "gssapi/raw/ext_dce.pyx":441
6530 *
6531 * with nogil:
6532 * maj_stat = gss_wrap_iov_length(&min_stat, context.raw_ctx, # <<<<<<<<<<<<<<
6533 * conf_req, qop_req,
6534 * &conf_used, res_arr, message.iov_len)
6535 */
6536 __pyx_v_maj_stat = gss_wrap_iov_length((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, __pyx_v_conf_req, __pyx_v_qop_req, (&__pyx_v_conf_used), __pyx_v_res_arr, __pyx_v_message->iov_len);
6537 }
6538
6539 /* "gssapi/raw/ext_dce.pyx":440
6540 * cdef OM_uint32 maj_stat, min_stat
6541 *
6542 * with nogil: # <<<<<<<<<<<<<<
6543 * maj_stat = gss_wrap_iov_length(&min_stat, context.raw_ctx,
6544 * conf_req, qop_req,
6545 */
6546 /*finally:*/ {
6547 /*normal exit:*/{
6548 #ifdef WITH_THREAD
6549 __Pyx_FastGIL_Forget();
6550 Py_BLOCK_THREADS
6551 #endif
6552 goto __pyx_L5;
6553 }
6554 __pyx_L5:;
6555 }
6556 }
6557
6558 /* "gssapi/raw/ext_dce.pyx":445
6559 * &conf_used, res_arr, message.iov_len)
6560 *
6561 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
6562 * message.c_changed = True
6563 * return <bint>conf_used
6564 */
6565 __pyx_t_3 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
6566 if (likely(__pyx_t_3)) {
6567
6568 /* "gssapi/raw/ext_dce.pyx":446
6569 *
6570 * if maj_stat == GSS_S_COMPLETE:
6571 * message.c_changed = True # <<<<<<<<<<<<<<
6572 * return <bint>conf_used
6573 * else:
6574 */
6575 __pyx_v_message->c_changed = 1;
6576
6577 /* "gssapi/raw/ext_dce.pyx":447
6578 * if maj_stat == GSS_S_COMPLETE:
6579 * message.c_changed = True
6580 * return <bint>conf_used # <<<<<<<<<<<<<<
6581 * else:
6582 * raise GSSError(maj_stat, min_stat)
6583 */
6584 __Pyx_XDECREF(__pyx_r);
6585 __pyx_t_6 = __Pyx_PyBool_FromLong((__pyx_v_conf_used != 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 447, __pyx_L1_error)
6586 __Pyx_GOTREF(__pyx_t_6);
6587 __pyx_r = __pyx_t_6;
6588 __pyx_t_6 = 0;
6589 goto __pyx_L0;
6590
6591 /* "gssapi/raw/ext_dce.pyx":445
6592 * &conf_used, res_arr, message.iov_len)
6593 *
6594 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
6595 * message.c_changed = True
6596 * return <bint>conf_used
6597 */
6598 }
6599
6600 /* "gssapi/raw/ext_dce.pyx":449
6601 * return <bint>conf_used
6602 * else:
6603 * raise GSSError(maj_stat, min_stat) # <<<<<<<<<<<<<<
6604 *
6605 *
6606 */
6607 /*else*/ {
6608 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 449, __pyx_L1_error)
6609 __Pyx_GOTREF(__pyx_t_7);
6610 __pyx_t_8 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 449, __pyx_L1_error)
6611 __Pyx_GOTREF(__pyx_t_8);
6612 __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 449, __pyx_L1_error)
6613 __Pyx_GOTREF(__pyx_t_9);
6614 __pyx_t_10 = NULL;
6615 __pyx_t_1 = 0;
6616 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
6617 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
6618 if (likely(__pyx_t_10)) {
6619 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
6620 __Pyx_INCREF(__pyx_t_10);
6621 __Pyx_INCREF(function);
6622 __Pyx_DECREF_SET(__pyx_t_7, function);
6623 __pyx_t_1 = 1;
6624 }
6625 }
6626 #if CYTHON_FAST_PYCALL
6627 if (PyFunction_Check(__pyx_t_7)) {
6628 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
6629 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
6630 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6631 __Pyx_GOTREF(__pyx_t_6);
6632 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6633 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6634 } else
6635 #endif
6636 #if CYTHON_FAST_PYCCALL
6637 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
6638 PyObject *__pyx_temp[3] = {__pyx_t_10, __pyx_t_8, __pyx_t_9};
6639 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
6640 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
6641 __Pyx_GOTREF(__pyx_t_6);
6642 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6643 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6644 } else
6645 #endif
6646 {
6647 __pyx_t_11 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 449, __pyx_L1_error)
6648 __Pyx_GOTREF(__pyx_t_11);
6649 if (__pyx_t_10) {
6650 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
6651 }
6652 __Pyx_GIVEREF(__pyx_t_8);
6653 PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_1, __pyx_t_8);
6654 __Pyx_GIVEREF(__pyx_t_9);
6655 PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_1, __pyx_t_9);
6656 __pyx_t_8 = 0;
6657 __pyx_t_9 = 0;
6658 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 449, __pyx_L1_error)
6659 __Pyx_GOTREF(__pyx_t_6);
6660 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6661 }
6662 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6663 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
6664 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6665 __PYX_ERR(0, 449, __pyx_L1_error)
6666 }
6667
6668 /* "gssapi/raw/ext_dce.pyx":404
6669 *
6670 *
6671 * def wrap_iov_length(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
6672 * confidential=True, qop=None):
6673 * """
6674 */
6675
6676 /* function exit code */
6677 __pyx_L1_error:;
6678 __Pyx_XDECREF(__pyx_t_6);
6679 __Pyx_XDECREF(__pyx_t_7);
6680 __Pyx_XDECREF(__pyx_t_8);
6681 __Pyx_XDECREF(__pyx_t_9);
6682 __Pyx_XDECREF(__pyx_t_10);
6683 __Pyx_XDECREF(__pyx_t_11);
6684 __Pyx_AddTraceback("gssapi.raw.ext_dce.wrap_iov_length", __pyx_clineno, __pyx_lineno, __pyx_filename);
6685 __pyx_r = NULL;
6686 __pyx_L0:;
6687 __Pyx_XGIVEREF(__pyx_r);
6688 __Pyx_RefNannyFinishContext();
6689 return __pyx_r;
6690 }
6691
6692 /* "gssapi/raw/ext_dce.pyx":452
6693 *
6694 *
6695 * def wrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
6696 * bytes associated=None, confidential=True, qop=None):
6697 * """
6698 */
6699
6700 /* Python wrapper */
6701 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_7wrap_aead(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6702 static char __pyx_doc_6gssapi_3raw_7ext_dce_6wrap_aead[] = "\n wrap_aead(context, message, associated=None, confidential=True, qop=None)\n Wrap/Encrypt an AEAD message.\n\n This method takes an input message and associated data,\n and outputs and AEAD message.\n\n Args:\n context (SecurityContext): the current security context\n message (bytes): the message to wrap or encrypt\n associated (bytes): associated data to go with the message\n confidential (bool): whether or not to encrypt the message (True),\n or just wrap it with a MIC (False)\n qop (int): the desired Quality of Protection\n (or None for the default QoP)\n\n Returns:\n WrapResult: the wrapped/encrypted total message, and whether or not\n encryption was actually used\n\n Raises:\n GSSError\n ";
6703 static PyMethodDef __pyx_mdef_6gssapi_3raw_7ext_dce_7wrap_aead = {"wrap_aead", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_7ext_dce_7wrap_aead, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_7ext_dce_6wrap_aead};
__pyx_pw_6gssapi_3raw_7ext_dce_7wrap_aead(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)6704 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_7wrap_aead(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6705 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
6706 PyObject *__pyx_v_message = 0;
6707 PyObject *__pyx_v_associated = 0;
6708 PyObject *__pyx_v_confidential = 0;
6709 PyObject *__pyx_v_qop = 0;
6710 int __pyx_lineno = 0;
6711 const char *__pyx_filename = NULL;
6712 int __pyx_clineno = 0;
6713 PyObject *__pyx_r = 0;
6714 __Pyx_RefNannyDeclarations
6715 __Pyx_RefNannySetupContext("wrap_aead (wrapper)", 0);
6716 {
6717 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_message,&__pyx_n_s_associated,&__pyx_n_s_confidential,&__pyx_n_s_qop,0};
6718 PyObject* values[5] = {0,0,0,0,0};
6719
6720 /* "gssapi/raw/ext_dce.pyx":453
6721 *
6722 * def wrap_aead(SecurityContext context not None, bytes message not None,
6723 * bytes associated=None, confidential=True, qop=None): # <<<<<<<<<<<<<<
6724 * """
6725 * wrap_aead(context, message, associated=None, confidential=True, qop=None)
6726 */
6727 values[2] = ((PyObject*)Py_None);
6728 values[3] = ((PyObject *)Py_True);
6729 values[4] = ((PyObject *)Py_None);
6730 if (unlikely(__pyx_kwds)) {
6731 Py_ssize_t kw_args;
6732 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6733 switch (pos_args) {
6734 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6735 CYTHON_FALLTHROUGH;
6736 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6737 CYTHON_FALLTHROUGH;
6738 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6739 CYTHON_FALLTHROUGH;
6740 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6741 CYTHON_FALLTHROUGH;
6742 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6743 CYTHON_FALLTHROUGH;
6744 case 0: break;
6745 default: goto __pyx_L5_argtuple_error;
6746 }
6747 kw_args = PyDict_Size(__pyx_kwds);
6748 switch (pos_args) {
6749 case 0:
6750 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
6751 else goto __pyx_L5_argtuple_error;
6752 CYTHON_FALLTHROUGH;
6753 case 1:
6754 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
6755 else {
6756 __Pyx_RaiseArgtupleInvalid("wrap_aead", 0, 2, 5, 1); __PYX_ERR(0, 452, __pyx_L3_error)
6757 }
6758 CYTHON_FALLTHROUGH;
6759 case 2:
6760 if (kw_args > 0) {
6761 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_associated);
6762 if (value) { values[2] = value; kw_args--; }
6763 }
6764 CYTHON_FALLTHROUGH;
6765 case 3:
6766 if (kw_args > 0) {
6767 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_confidential);
6768 if (value) { values[3] = value; kw_args--; }
6769 }
6770 CYTHON_FALLTHROUGH;
6771 case 4:
6772 if (kw_args > 0) {
6773 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_qop);
6774 if (value) { values[4] = value; kw_args--; }
6775 }
6776 }
6777 if (unlikely(kw_args > 0)) {
6778 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap_aead") < 0)) __PYX_ERR(0, 452, __pyx_L3_error)
6779 }
6780 } else {
6781 switch (PyTuple_GET_SIZE(__pyx_args)) {
6782 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6783 CYTHON_FALLTHROUGH;
6784 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6785 CYTHON_FALLTHROUGH;
6786 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6787 CYTHON_FALLTHROUGH;
6788 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6789 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6790 break;
6791 default: goto __pyx_L5_argtuple_error;
6792 }
6793 }
6794 __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
6795 __pyx_v_message = ((PyObject*)values[1]);
6796 __pyx_v_associated = ((PyObject*)values[2]);
6797 __pyx_v_confidential = values[3];
6798 __pyx_v_qop = values[4];
6799 }
6800 goto __pyx_L4_argument_unpacking_done;
6801 __pyx_L5_argtuple_error:;
6802 __Pyx_RaiseArgtupleInvalid("wrap_aead", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 452, __pyx_L3_error)
6803 __pyx_L3_error:;
6804 __Pyx_AddTraceback("gssapi.raw.ext_dce.wrap_aead", __pyx_clineno, __pyx_lineno, __pyx_filename);
6805 __Pyx_RefNannyFinishContext();
6806 return NULL;
6807 __pyx_L4_argument_unpacking_done:;
6808 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(0, 452, __pyx_L1_error)
6809 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_message), (&PyBytes_Type), 0, "message", 1))) __PYX_ERR(0, 452, __pyx_L1_error)
6810 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_associated), (&PyBytes_Type), 1, "associated", 1))) __PYX_ERR(0, 453, __pyx_L1_error)
6811 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_6wrap_aead(__pyx_self, __pyx_v_context, __pyx_v_message, __pyx_v_associated, __pyx_v_confidential, __pyx_v_qop);
6812
6813 /* "gssapi/raw/ext_dce.pyx":452
6814 *
6815 *
6816 * def wrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
6817 * bytes associated=None, confidential=True, qop=None):
6818 * """
6819 */
6820
6821 /* function exit code */
6822 goto __pyx_L0;
6823 __pyx_L1_error:;
6824 __pyx_r = NULL;
6825 __pyx_L0:;
6826 __Pyx_RefNannyFinishContext();
6827 return __pyx_r;
6828 }
6829
__pyx_pf_6gssapi_3raw_7ext_dce_6wrap_aead(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,PyObject * __pyx_v_message,PyObject * __pyx_v_associated,PyObject * __pyx_v_confidential,PyObject * __pyx_v_qop)6830 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_6wrap_aead(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_message, PyObject *__pyx_v_associated, PyObject *__pyx_v_confidential, PyObject *__pyx_v_qop) {
6831 int __pyx_v_conf_req;
6832 gss_qop_t __pyx_v_qop_req;
6833 gss_buffer_desc __pyx_v_message_buffer;
6834 gss_buffer_t __pyx_v_assoc_buffer_ptr;
6835 gss_buffer_desc __pyx_v_assoc_buffer;
6836 int __pyx_v_conf_used;
6837 gss_buffer_desc __pyx_v_output_buffer;
6838 OM_uint32 __pyx_v_maj_stat;
6839 OM_uint32 __pyx_v_min_stat;
6840 PyObject *__pyx_v_output_message = NULL;
6841 PyObject *__pyx_r = NULL;
6842 __Pyx_RefNannyDeclarations
6843 int __pyx_t_1;
6844 gss_qop_t __pyx_t_2;
6845 int __pyx_t_3;
6846 gss_qop_t __pyx_t_4;
6847 gss_buffer_desc __pyx_t_5;
6848 Py_ssize_t __pyx_t_6;
6849 char *__pyx_t_7;
6850 int __pyx_t_8;
6851 PyObject *__pyx_t_9 = NULL;
6852 PyObject *__pyx_t_10 = NULL;
6853 PyObject *__pyx_t_11 = NULL;
6854 PyObject *__pyx_t_12 = NULL;
6855 PyObject *__pyx_t_13 = NULL;
6856 PyObject *__pyx_t_14 = NULL;
6857 int __pyx_lineno = 0;
6858 const char *__pyx_filename = NULL;
6859 int __pyx_clineno = 0;
6860 __Pyx_RefNannySetupContext("wrap_aead", 0);
6861
6862 /* "gssapi/raw/ext_dce.pyx":478
6863 * """
6864 *
6865 * cdef int conf_req = confidential # <<<<<<<<<<<<<<
6866 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT
6867 * cdef gss_buffer_desc message_buffer = gss_buffer_desc(len(message),
6868 */
6869 __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_confidential); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 478, __pyx_L1_error)
6870 __pyx_v_conf_req = __pyx_t_1;
6871
6872 /* "gssapi/raw/ext_dce.pyx":479
6873 *
6874 * cdef int conf_req = confidential
6875 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT # <<<<<<<<<<<<<<
6876 * cdef gss_buffer_desc message_buffer = gss_buffer_desc(len(message),
6877 * message)
6878 */
6879 __pyx_t_3 = (__pyx_v_qop != Py_None);
6880 if ((__pyx_t_3 != 0)) {
6881 __pyx_t_4 = __Pyx_PyInt_As_uint32_t(__pyx_v_qop); if (unlikely((__pyx_t_4 == ((gss_qop_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 479, __pyx_L1_error)
6882 __pyx_t_2 = __pyx_t_4;
6883 } else {
6884 __pyx_t_2 = GSS_C_QOP_DEFAULT;
6885 }
6886 __pyx_v_qop_req = __pyx_t_2;
6887
6888 /* "gssapi/raw/ext_dce.pyx":480
6889 * cdef int conf_req = confidential
6890 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT
6891 * cdef gss_buffer_desc message_buffer = gss_buffer_desc(len(message), # <<<<<<<<<<<<<<
6892 * message)
6893 *
6894 */
6895 __pyx_t_6 = PyBytes_GET_SIZE(__pyx_v_message); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 480, __pyx_L1_error)
6896 __pyx_t_5.length = __pyx_t_6;
6897
6898 /* "gssapi/raw/ext_dce.pyx":481
6899 * cdef gss_qop_t qop_req = qop if qop is not None else GSS_C_QOP_DEFAULT
6900 * cdef gss_buffer_desc message_buffer = gss_buffer_desc(len(message),
6901 * message) # <<<<<<<<<<<<<<
6902 *
6903 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER
6904 */
6905 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 481, __pyx_L1_error)
6906 __pyx_t_5.value = __pyx_t_7;
6907 __pyx_v_message_buffer = __pyx_t_5;
6908
6909 /* "gssapi/raw/ext_dce.pyx":483
6910 * message)
6911 *
6912 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER # <<<<<<<<<<<<<<
6913 * cdef gss_buffer_desc assoc_buffer
6914 * if associated is not None:
6915 */
6916 __pyx_v_assoc_buffer_ptr = GSS_C_NO_BUFFER;
6917
6918 /* "gssapi/raw/ext_dce.pyx":485
6919 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER
6920 * cdef gss_buffer_desc assoc_buffer
6921 * if associated is not None: # <<<<<<<<<<<<<<
6922 * assoc_buffer = gss_buffer_desc(len(associated), associated)
6923 * assoc_buffer_ptr = &assoc_buffer
6924 */
6925 __pyx_t_3 = (__pyx_v_associated != ((PyObject*)Py_None));
6926 __pyx_t_8 = (__pyx_t_3 != 0);
6927 if (__pyx_t_8) {
6928
6929 /* "gssapi/raw/ext_dce.pyx":486
6930 * cdef gss_buffer_desc assoc_buffer
6931 * if associated is not None:
6932 * assoc_buffer = gss_buffer_desc(len(associated), associated) # <<<<<<<<<<<<<<
6933 * assoc_buffer_ptr = &assoc_buffer
6934 *
6935 */
6936 if (unlikely(__pyx_v_associated == Py_None)) {
6937 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6938 __PYX_ERR(0, 486, __pyx_L1_error)
6939 }
6940 __pyx_t_6 = PyBytes_GET_SIZE(__pyx_v_associated); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 486, __pyx_L1_error)
6941 __pyx_t_5.length = __pyx_t_6;
6942 if (unlikely(__pyx_v_associated == Py_None)) {
6943 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
6944 __PYX_ERR(0, 486, __pyx_L1_error)
6945 }
6946 __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_associated); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L1_error)
6947 __pyx_t_5.value = __pyx_t_7;
6948 __pyx_v_assoc_buffer = __pyx_t_5;
6949
6950 /* "gssapi/raw/ext_dce.pyx":487
6951 * if associated is not None:
6952 * assoc_buffer = gss_buffer_desc(len(associated), associated)
6953 * assoc_buffer_ptr = &assoc_buffer # <<<<<<<<<<<<<<
6954 *
6955 * cdef int conf_used
6956 */
6957 __pyx_v_assoc_buffer_ptr = (&__pyx_v_assoc_buffer);
6958
6959 /* "gssapi/raw/ext_dce.pyx":485
6960 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER
6961 * cdef gss_buffer_desc assoc_buffer
6962 * if associated is not None: # <<<<<<<<<<<<<<
6963 * assoc_buffer = gss_buffer_desc(len(associated), associated)
6964 * assoc_buffer_ptr = &assoc_buffer
6965 */
6966 }
6967
6968 /* "gssapi/raw/ext_dce.pyx":491
6969 * cdef int conf_used
6970 * # GSS_C_EMPTY_BUFFER
6971 * cdef gss_buffer_desc output_buffer = gss_buffer_desc(0, NULL) # <<<<<<<<<<<<<<
6972 *
6973 * cdef OM_uint32 maj_stat, min_stat
6974 */
6975 __pyx_t_5.length = 0;
6976 __pyx_t_5.value = NULL;
6977 __pyx_v_output_buffer = __pyx_t_5;
6978
6979 /* "gssapi/raw/ext_dce.pyx":495
6980 * cdef OM_uint32 maj_stat, min_stat
6981 *
6982 * with nogil: # <<<<<<<<<<<<<<
6983 * maj_stat = gss_wrap_aead(&min_stat, context.raw_ctx, conf_req, qop_req,
6984 * assoc_buffer_ptr, &message_buffer,
6985 */
6986 {
6987 #ifdef WITH_THREAD
6988 PyThreadState *_save;
6989 Py_UNBLOCK_THREADS
6990 __Pyx_FastGIL_Remember();
6991 #endif
6992 /*try:*/ {
6993
6994 /* "gssapi/raw/ext_dce.pyx":496
6995 *
6996 * with nogil:
6997 * maj_stat = gss_wrap_aead(&min_stat, context.raw_ctx, conf_req, qop_req, # <<<<<<<<<<<<<<
6998 * assoc_buffer_ptr, &message_buffer,
6999 * &conf_used, &output_buffer)
7000 */
7001 __pyx_v_maj_stat = gss_wrap_aead((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, __pyx_v_conf_req, __pyx_v_qop_req, __pyx_v_assoc_buffer_ptr, (&__pyx_v_message_buffer), (&__pyx_v_conf_used), (&__pyx_v_output_buffer));
7002 }
7003
7004 /* "gssapi/raw/ext_dce.pyx":495
7005 * cdef OM_uint32 maj_stat, min_stat
7006 *
7007 * with nogil: # <<<<<<<<<<<<<<
7008 * maj_stat = gss_wrap_aead(&min_stat, context.raw_ctx, conf_req, qop_req,
7009 * assoc_buffer_ptr, &message_buffer,
7010 */
7011 /*finally:*/ {
7012 /*normal exit:*/{
7013 #ifdef WITH_THREAD
7014 __Pyx_FastGIL_Forget();
7015 Py_BLOCK_THREADS
7016 #endif
7017 goto __pyx_L6;
7018 }
7019 __pyx_L6:;
7020 }
7021 }
7022
7023 /* "gssapi/raw/ext_dce.pyx":500
7024 * &conf_used, &output_buffer)
7025 *
7026 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
7027 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7028 * gss_release_buffer(&min_stat, &output_buffer)
7029 */
7030 __pyx_t_8 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
7031 if (likely(__pyx_t_8)) {
7032
7033 /* "gssapi/raw/ext_dce.pyx":501
7034 *
7035 * if maj_stat == GSS_S_COMPLETE:
7036 * output_message = (<char*>output_buffer.value)[:output_buffer.length] # <<<<<<<<<<<<<<
7037 * gss_release_buffer(&min_stat, &output_buffer)
7038 * return WrapResult(output_message, <bint>conf_used)
7039 */
7040 __pyx_t_9 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_output_buffer.value) + 0, __pyx_v_output_buffer.length - 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 501, __pyx_L1_error)
7041 __Pyx_GOTREF(__pyx_t_9);
7042 __pyx_v_output_message = ((PyObject*)__pyx_t_9);
7043 __pyx_t_9 = 0;
7044
7045 /* "gssapi/raw/ext_dce.pyx":502
7046 * if maj_stat == GSS_S_COMPLETE:
7047 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7048 * gss_release_buffer(&min_stat, &output_buffer) # <<<<<<<<<<<<<<
7049 * return WrapResult(output_message, <bint>conf_used)
7050 * else:
7051 */
7052 (void)(gss_release_buffer((&__pyx_v_min_stat), (&__pyx_v_output_buffer)));
7053
7054 /* "gssapi/raw/ext_dce.pyx":503
7055 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7056 * gss_release_buffer(&min_stat, &output_buffer)
7057 * return WrapResult(output_message, <bint>conf_used) # <<<<<<<<<<<<<<
7058 * else:
7059 * raise GSSError(maj_stat, min_stat)
7060 */
7061 __Pyx_XDECREF(__pyx_r);
7062 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_WrapResult); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 503, __pyx_L1_error)
7063 __Pyx_GOTREF(__pyx_t_10);
7064 __pyx_t_11 = __Pyx_PyBool_FromLong((__pyx_v_conf_used != 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 503, __pyx_L1_error)
7065 __Pyx_GOTREF(__pyx_t_11);
7066 __pyx_t_12 = NULL;
7067 __pyx_t_1 = 0;
7068 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
7069 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
7070 if (likely(__pyx_t_12)) {
7071 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
7072 __Pyx_INCREF(__pyx_t_12);
7073 __Pyx_INCREF(function);
7074 __Pyx_DECREF_SET(__pyx_t_10, function);
7075 __pyx_t_1 = 1;
7076 }
7077 }
7078 #if CYTHON_FAST_PYCALL
7079 if (PyFunction_Check(__pyx_t_10)) {
7080 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_output_message, __pyx_t_11};
7081 __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 503, __pyx_L1_error)
7082 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7083 __Pyx_GOTREF(__pyx_t_9);
7084 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7085 } else
7086 #endif
7087 #if CYTHON_FAST_PYCCALL
7088 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
7089 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_output_message, __pyx_t_11};
7090 __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 503, __pyx_L1_error)
7091 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7092 __Pyx_GOTREF(__pyx_t_9);
7093 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7094 } else
7095 #endif
7096 {
7097 __pyx_t_13 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 503, __pyx_L1_error)
7098 __Pyx_GOTREF(__pyx_t_13);
7099 if (__pyx_t_12) {
7100 __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
7101 }
7102 __Pyx_INCREF(__pyx_v_output_message);
7103 __Pyx_GIVEREF(__pyx_v_output_message);
7104 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_1, __pyx_v_output_message);
7105 __Pyx_GIVEREF(__pyx_t_11);
7106 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_1, __pyx_t_11);
7107 __pyx_t_11 = 0;
7108 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 503, __pyx_L1_error)
7109 __Pyx_GOTREF(__pyx_t_9);
7110 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7111 }
7112 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7113 __pyx_r = __pyx_t_9;
7114 __pyx_t_9 = 0;
7115 goto __pyx_L0;
7116
7117 /* "gssapi/raw/ext_dce.pyx":500
7118 * &conf_used, &output_buffer)
7119 *
7120 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
7121 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7122 * gss_release_buffer(&min_stat, &output_buffer)
7123 */
7124 }
7125
7126 /* "gssapi/raw/ext_dce.pyx":505
7127 * return WrapResult(output_message, <bint>conf_used)
7128 * else:
7129 * raise GSSError(maj_stat, min_stat) # <<<<<<<<<<<<<<
7130 *
7131 *
7132 */
7133 /*else*/ {
7134 __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 505, __pyx_L1_error)
7135 __Pyx_GOTREF(__pyx_t_10);
7136 __pyx_t_13 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 505, __pyx_L1_error)
7137 __Pyx_GOTREF(__pyx_t_13);
7138 __pyx_t_11 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 505, __pyx_L1_error)
7139 __Pyx_GOTREF(__pyx_t_11);
7140 __pyx_t_12 = NULL;
7141 __pyx_t_1 = 0;
7142 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
7143 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
7144 if (likely(__pyx_t_12)) {
7145 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
7146 __Pyx_INCREF(__pyx_t_12);
7147 __Pyx_INCREF(function);
7148 __Pyx_DECREF_SET(__pyx_t_10, function);
7149 __pyx_t_1 = 1;
7150 }
7151 }
7152 #if CYTHON_FAST_PYCALL
7153 if (PyFunction_Check(__pyx_t_10)) {
7154 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_13, __pyx_t_11};
7155 __pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error)
7156 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7157 __Pyx_GOTREF(__pyx_t_9);
7158 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7159 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7160 } else
7161 #endif
7162 #if CYTHON_FAST_PYCCALL
7163 if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
7164 PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_13, __pyx_t_11};
7165 __pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_1, 2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error)
7166 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
7167 __Pyx_GOTREF(__pyx_t_9);
7168 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7169 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
7170 } else
7171 #endif
7172 {
7173 __pyx_t_14 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 505, __pyx_L1_error)
7174 __Pyx_GOTREF(__pyx_t_14);
7175 if (__pyx_t_12) {
7176 __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12); __pyx_t_12 = NULL;
7177 }
7178 __Pyx_GIVEREF(__pyx_t_13);
7179 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_1, __pyx_t_13);
7180 __Pyx_GIVEREF(__pyx_t_11);
7181 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_1, __pyx_t_11);
7182 __pyx_t_13 = 0;
7183 __pyx_t_11 = 0;
7184 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 505, __pyx_L1_error)
7185 __Pyx_GOTREF(__pyx_t_9);
7186 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7187 }
7188 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7189 __Pyx_Raise(__pyx_t_9, 0, 0, 0);
7190 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7191 __PYX_ERR(0, 505, __pyx_L1_error)
7192 }
7193
7194 /* "gssapi/raw/ext_dce.pyx":452
7195 *
7196 *
7197 * def wrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
7198 * bytes associated=None, confidential=True, qop=None):
7199 * """
7200 */
7201
7202 /* function exit code */
7203 __pyx_L1_error:;
7204 __Pyx_XDECREF(__pyx_t_9);
7205 __Pyx_XDECREF(__pyx_t_10);
7206 __Pyx_XDECREF(__pyx_t_11);
7207 __Pyx_XDECREF(__pyx_t_12);
7208 __Pyx_XDECREF(__pyx_t_13);
7209 __Pyx_XDECREF(__pyx_t_14);
7210 __Pyx_AddTraceback("gssapi.raw.ext_dce.wrap_aead", __pyx_clineno, __pyx_lineno, __pyx_filename);
7211 __pyx_r = NULL;
7212 __pyx_L0:;
7213 __Pyx_XDECREF(__pyx_v_output_message);
7214 __Pyx_XGIVEREF(__pyx_r);
7215 __Pyx_RefNannyFinishContext();
7216 return __pyx_r;
7217 }
7218
7219 /* "gssapi/raw/ext_dce.pyx":508
7220 *
7221 *
7222 * def unwrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
7223 * bytes associated=None):
7224 * """
7225 */
7226
7227 /* Python wrapper */
7228 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_9unwrap_aead(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7229 static char __pyx_doc_6gssapi_3raw_7ext_dce_8unwrap_aead[] = "\n unwrap_aead(context, message, associated=None)\n Unwrap/Decrypt an AEAD message.\n\n This method takes an encrpyted/wrapped AEAD message and some associated\n data, and returns an unwrapped/decrypted message.\n\n Args:\n context (SecurityContext): the current security context\n message (bytes): the AEAD message to unwrap or decrypt\n associated (bytes): associated data that goes with the message\n\n Returns:\n UnwrapResult: the unwrapped/decrypted message, whether or on\n encryption was used, and the QoP used\n\n Raises:\n GSSError\n ";
7230 static PyMethodDef __pyx_mdef_6gssapi_3raw_7ext_dce_9unwrap_aead = {"unwrap_aead", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gssapi_3raw_7ext_dce_9unwrap_aead, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gssapi_3raw_7ext_dce_8unwrap_aead};
__pyx_pw_6gssapi_3raw_7ext_dce_9unwrap_aead(PyObject * __pyx_self,PyObject * __pyx_args,PyObject * __pyx_kwds)7231 static PyObject *__pyx_pw_6gssapi_3raw_7ext_dce_9unwrap_aead(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7232 struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context = 0;
7233 PyObject *__pyx_v_message = 0;
7234 PyObject *__pyx_v_associated = 0;
7235 int __pyx_lineno = 0;
7236 const char *__pyx_filename = NULL;
7237 int __pyx_clineno = 0;
7238 PyObject *__pyx_r = 0;
7239 __Pyx_RefNannyDeclarations
7240 __Pyx_RefNannySetupContext("unwrap_aead (wrapper)", 0);
7241 {
7242 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_message,&__pyx_n_s_associated,0};
7243 PyObject* values[3] = {0,0,0};
7244
7245 /* "gssapi/raw/ext_dce.pyx":509
7246 *
7247 * def unwrap_aead(SecurityContext context not None, bytes message not None,
7248 * bytes associated=None): # <<<<<<<<<<<<<<
7249 * """
7250 * unwrap_aead(context, message, associated=None)
7251 */
7252 values[2] = ((PyObject*)Py_None);
7253 if (unlikely(__pyx_kwds)) {
7254 Py_ssize_t kw_args;
7255 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7256 switch (pos_args) {
7257 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7258 CYTHON_FALLTHROUGH;
7259 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7260 CYTHON_FALLTHROUGH;
7261 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7262 CYTHON_FALLTHROUGH;
7263 case 0: break;
7264 default: goto __pyx_L5_argtuple_error;
7265 }
7266 kw_args = PyDict_Size(__pyx_kwds);
7267 switch (pos_args) {
7268 case 0:
7269 if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
7270 else goto __pyx_L5_argtuple_error;
7271 CYTHON_FALLTHROUGH;
7272 case 1:
7273 if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
7274 else {
7275 __Pyx_RaiseArgtupleInvalid("unwrap_aead", 0, 2, 3, 1); __PYX_ERR(0, 508, __pyx_L3_error)
7276 }
7277 CYTHON_FALLTHROUGH;
7278 case 2:
7279 if (kw_args > 0) {
7280 PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_associated);
7281 if (value) { values[2] = value; kw_args--; }
7282 }
7283 }
7284 if (unlikely(kw_args > 0)) {
7285 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "unwrap_aead") < 0)) __PYX_ERR(0, 508, __pyx_L3_error)
7286 }
7287 } else {
7288 switch (PyTuple_GET_SIZE(__pyx_args)) {
7289 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7290 CYTHON_FALLTHROUGH;
7291 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7292 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7293 break;
7294 default: goto __pyx_L5_argtuple_error;
7295 }
7296 }
7297 __pyx_v_context = ((struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *)values[0]);
7298 __pyx_v_message = ((PyObject*)values[1]);
7299 __pyx_v_associated = ((PyObject*)values[2]);
7300 }
7301 goto __pyx_L4_argument_unpacking_done;
7302 __pyx_L5_argtuple_error:;
7303 __Pyx_RaiseArgtupleInvalid("unwrap_aead", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 508, __pyx_L3_error)
7304 __pyx_L3_error:;
7305 __Pyx_AddTraceback("gssapi.raw.ext_dce.unwrap_aead", __pyx_clineno, __pyx_lineno, __pyx_filename);
7306 __Pyx_RefNannyFinishContext();
7307 return NULL;
7308 __pyx_L4_argument_unpacking_done:;
7309 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_context), __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext, 0, "context", 0))) __PYX_ERR(0, 508, __pyx_L1_error)
7310 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_message), (&PyBytes_Type), 0, "message", 1))) __PYX_ERR(0, 508, __pyx_L1_error)
7311 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_associated), (&PyBytes_Type), 1, "associated", 1))) __PYX_ERR(0, 509, __pyx_L1_error)
7312 __pyx_r = __pyx_pf_6gssapi_3raw_7ext_dce_8unwrap_aead(__pyx_self, __pyx_v_context, __pyx_v_message, __pyx_v_associated);
7313
7314 /* "gssapi/raw/ext_dce.pyx":508
7315 *
7316 *
7317 * def unwrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
7318 * bytes associated=None):
7319 * """
7320 */
7321
7322 /* function exit code */
7323 goto __pyx_L0;
7324 __pyx_L1_error:;
7325 __pyx_r = NULL;
7326 __pyx_L0:;
7327 __Pyx_RefNannyFinishContext();
7328 return __pyx_r;
7329 }
7330
__pyx_pf_6gssapi_3raw_7ext_dce_8unwrap_aead(CYTHON_UNUSED PyObject * __pyx_self,struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext * __pyx_v_context,PyObject * __pyx_v_message,PyObject * __pyx_v_associated)7331 static PyObject *__pyx_pf_6gssapi_3raw_7ext_dce_8unwrap_aead(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext *__pyx_v_context, PyObject *__pyx_v_message, PyObject *__pyx_v_associated) {
7332 gss_buffer_desc __pyx_v_input_buffer;
7333 gss_buffer_t __pyx_v_assoc_buffer_ptr;
7334 gss_buffer_desc __pyx_v_assoc_buffer;
7335 gss_buffer_desc __pyx_v_output_buffer;
7336 int __pyx_v_conf_state;
7337 gss_qop_t __pyx_v_qop_state;
7338 OM_uint32 __pyx_v_maj_stat;
7339 OM_uint32 __pyx_v_min_stat;
7340 PyObject *__pyx_v_output_message = NULL;
7341 PyObject *__pyx_r = NULL;
7342 __Pyx_RefNannyDeclarations
7343 gss_buffer_desc __pyx_t_1;
7344 Py_ssize_t __pyx_t_2;
7345 char *__pyx_t_3;
7346 int __pyx_t_4;
7347 int __pyx_t_5;
7348 PyObject *__pyx_t_6 = NULL;
7349 PyObject *__pyx_t_7 = NULL;
7350 PyObject *__pyx_t_8 = NULL;
7351 PyObject *__pyx_t_9 = NULL;
7352 PyObject *__pyx_t_10 = NULL;
7353 int __pyx_t_11;
7354 PyObject *__pyx_t_12 = NULL;
7355 int __pyx_lineno = 0;
7356 const char *__pyx_filename = NULL;
7357 int __pyx_clineno = 0;
7358 __Pyx_RefNannySetupContext("unwrap_aead", 0);
7359
7360 /* "gssapi/raw/ext_dce.pyx":530
7361 * """
7362 *
7363 * cdef gss_buffer_desc input_buffer = gss_buffer_desc(len(message), message) # <<<<<<<<<<<<<<
7364 *
7365 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER
7366 */
7367 __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_message); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 530, __pyx_L1_error)
7368 __pyx_t_1.length = __pyx_t_2;
7369 __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_message); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
7370 __pyx_t_1.value = __pyx_t_3;
7371 __pyx_v_input_buffer = __pyx_t_1;
7372
7373 /* "gssapi/raw/ext_dce.pyx":532
7374 * cdef gss_buffer_desc input_buffer = gss_buffer_desc(len(message), message)
7375 *
7376 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER # <<<<<<<<<<<<<<
7377 * cdef gss_buffer_desc assoc_buffer
7378 * if associated is not None:
7379 */
7380 __pyx_v_assoc_buffer_ptr = GSS_C_NO_BUFFER;
7381
7382 /* "gssapi/raw/ext_dce.pyx":534
7383 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER
7384 * cdef gss_buffer_desc assoc_buffer
7385 * if associated is not None: # <<<<<<<<<<<<<<
7386 * assoc_buffer = gss_buffer_desc(len(associated), associated)
7387 * assoc_buffer_ptr = &assoc_buffer
7388 */
7389 __pyx_t_4 = (__pyx_v_associated != ((PyObject*)Py_None));
7390 __pyx_t_5 = (__pyx_t_4 != 0);
7391 if (__pyx_t_5) {
7392
7393 /* "gssapi/raw/ext_dce.pyx":535
7394 * cdef gss_buffer_desc assoc_buffer
7395 * if associated is not None:
7396 * assoc_buffer = gss_buffer_desc(len(associated), associated) # <<<<<<<<<<<<<<
7397 * assoc_buffer_ptr = &assoc_buffer
7398 *
7399 */
7400 if (unlikely(__pyx_v_associated == Py_None)) {
7401 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
7402 __PYX_ERR(0, 535, __pyx_L1_error)
7403 }
7404 __pyx_t_2 = PyBytes_GET_SIZE(__pyx_v_associated); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 535, __pyx_L1_error)
7405 __pyx_t_1.length = __pyx_t_2;
7406 if (unlikely(__pyx_v_associated == Py_None)) {
7407 PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7408 __PYX_ERR(0, 535, __pyx_L1_error)
7409 }
7410 __pyx_t_3 = __Pyx_PyBytes_AsWritableString(__pyx_v_associated); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error)
7411 __pyx_t_1.value = __pyx_t_3;
7412 __pyx_v_assoc_buffer = __pyx_t_1;
7413
7414 /* "gssapi/raw/ext_dce.pyx":536
7415 * if associated is not None:
7416 * assoc_buffer = gss_buffer_desc(len(associated), associated)
7417 * assoc_buffer_ptr = &assoc_buffer # <<<<<<<<<<<<<<
7418 *
7419 * # GSS_C_EMPTY_BUFFER
7420 */
7421 __pyx_v_assoc_buffer_ptr = (&__pyx_v_assoc_buffer);
7422
7423 /* "gssapi/raw/ext_dce.pyx":534
7424 * cdef gss_buffer_t assoc_buffer_ptr = GSS_C_NO_BUFFER
7425 * cdef gss_buffer_desc assoc_buffer
7426 * if associated is not None: # <<<<<<<<<<<<<<
7427 * assoc_buffer = gss_buffer_desc(len(associated), associated)
7428 * assoc_buffer_ptr = &assoc_buffer
7429 */
7430 }
7431
7432 /* "gssapi/raw/ext_dce.pyx":539
7433 *
7434 * # GSS_C_EMPTY_BUFFER
7435 * cdef gss_buffer_desc output_buffer = gss_buffer_desc(0, NULL) # <<<<<<<<<<<<<<
7436 * cdef int conf_state
7437 * cdef gss_qop_t qop_state
7438 */
7439 __pyx_t_1.length = 0;
7440 __pyx_t_1.value = NULL;
7441 __pyx_v_output_buffer = __pyx_t_1;
7442
7443 /* "gssapi/raw/ext_dce.pyx":545
7444 * cdef OM_uint32 maj_stat, min_stat
7445 *
7446 * with nogil: # <<<<<<<<<<<<<<
7447 * maj_stat = gss_unwrap_aead(&min_stat, context.raw_ctx, &input_buffer,
7448 * assoc_buffer_ptr, &output_buffer,
7449 */
7450 {
7451 #ifdef WITH_THREAD
7452 PyThreadState *_save;
7453 Py_UNBLOCK_THREADS
7454 __Pyx_FastGIL_Remember();
7455 #endif
7456 /*try:*/ {
7457
7458 /* "gssapi/raw/ext_dce.pyx":546
7459 *
7460 * with nogil:
7461 * maj_stat = gss_unwrap_aead(&min_stat, context.raw_ctx, &input_buffer, # <<<<<<<<<<<<<<
7462 * assoc_buffer_ptr, &output_buffer,
7463 * &conf_state, &qop_state)
7464 */
7465 __pyx_v_maj_stat = gss_unwrap_aead((&__pyx_v_min_stat), __pyx_v_context->raw_ctx, (&__pyx_v_input_buffer), __pyx_v_assoc_buffer_ptr, (&__pyx_v_output_buffer), (&__pyx_v_conf_state), (&__pyx_v_qop_state));
7466 }
7467
7468 /* "gssapi/raw/ext_dce.pyx":545
7469 * cdef OM_uint32 maj_stat, min_stat
7470 *
7471 * with nogil: # <<<<<<<<<<<<<<
7472 * maj_stat = gss_unwrap_aead(&min_stat, context.raw_ctx, &input_buffer,
7473 * assoc_buffer_ptr, &output_buffer,
7474 */
7475 /*finally:*/ {
7476 /*normal exit:*/{
7477 #ifdef WITH_THREAD
7478 __Pyx_FastGIL_Forget();
7479 Py_BLOCK_THREADS
7480 #endif
7481 goto __pyx_L6;
7482 }
7483 __pyx_L6:;
7484 }
7485 }
7486
7487 /* "gssapi/raw/ext_dce.pyx":550
7488 * &conf_state, &qop_state)
7489 *
7490 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
7491 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7492 * gss_release_buffer(&min_stat, &output_buffer)
7493 */
7494 __pyx_t_5 = ((__pyx_v_maj_stat == GSS_S_COMPLETE) != 0);
7495 if (likely(__pyx_t_5)) {
7496
7497 /* "gssapi/raw/ext_dce.pyx":551
7498 *
7499 * if maj_stat == GSS_S_COMPLETE:
7500 * output_message = (<char*>output_buffer.value)[:output_buffer.length] # <<<<<<<<<<<<<<
7501 * gss_release_buffer(&min_stat, &output_buffer)
7502 * return UnwrapResult(output_message, <bint>conf_state, qop_state)
7503 */
7504 __pyx_t_6 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_output_buffer.value) + 0, __pyx_v_output_buffer.length - 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 551, __pyx_L1_error)
7505 __Pyx_GOTREF(__pyx_t_6);
7506 __pyx_v_output_message = ((PyObject*)__pyx_t_6);
7507 __pyx_t_6 = 0;
7508
7509 /* "gssapi/raw/ext_dce.pyx":552
7510 * if maj_stat == GSS_S_COMPLETE:
7511 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7512 * gss_release_buffer(&min_stat, &output_buffer) # <<<<<<<<<<<<<<
7513 * return UnwrapResult(output_message, <bint>conf_state, qop_state)
7514 * else:
7515 */
7516 (void)(gss_release_buffer((&__pyx_v_min_stat), (&__pyx_v_output_buffer)));
7517
7518 /* "gssapi/raw/ext_dce.pyx":553
7519 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7520 * gss_release_buffer(&min_stat, &output_buffer)
7521 * return UnwrapResult(output_message, <bint>conf_state, qop_state) # <<<<<<<<<<<<<<
7522 * else:
7523 * raise GSSError(maj_stat, min_stat)
7524 */
7525 __Pyx_XDECREF(__pyx_r);
7526 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_UnwrapResult); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 553, __pyx_L1_error)
7527 __Pyx_GOTREF(__pyx_t_7);
7528 __pyx_t_8 = __Pyx_PyBool_FromLong((__pyx_v_conf_state != 0)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 553, __pyx_L1_error)
7529 __Pyx_GOTREF(__pyx_t_8);
7530 __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_qop_state); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 553, __pyx_L1_error)
7531 __Pyx_GOTREF(__pyx_t_9);
7532 __pyx_t_10 = NULL;
7533 __pyx_t_11 = 0;
7534 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7535 __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
7536 if (likely(__pyx_t_10)) {
7537 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7538 __Pyx_INCREF(__pyx_t_10);
7539 __Pyx_INCREF(function);
7540 __Pyx_DECREF_SET(__pyx_t_7, function);
7541 __pyx_t_11 = 1;
7542 }
7543 }
7544 #if CYTHON_FAST_PYCALL
7545 if (PyFunction_Check(__pyx_t_7)) {
7546 PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_output_message, __pyx_t_8, __pyx_t_9};
7547 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
7548 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7549 __Pyx_GOTREF(__pyx_t_6);
7550 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7551 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7552 } else
7553 #endif
7554 #if CYTHON_FAST_PYCCALL
7555 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
7556 PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_output_message, __pyx_t_8, __pyx_t_9};
7557 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 3+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
7558 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
7559 __Pyx_GOTREF(__pyx_t_6);
7560 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7561 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7562 } else
7563 #endif
7564 {
7565 __pyx_t_12 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 553, __pyx_L1_error)
7566 __Pyx_GOTREF(__pyx_t_12);
7567 if (__pyx_t_10) {
7568 __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
7569 }
7570 __Pyx_INCREF(__pyx_v_output_message);
7571 __Pyx_GIVEREF(__pyx_v_output_message);
7572 PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_output_message);
7573 __Pyx_GIVEREF(__pyx_t_8);
7574 PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_8);
7575 __Pyx_GIVEREF(__pyx_t_9);
7576 PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_11, __pyx_t_9);
7577 __pyx_t_8 = 0;
7578 __pyx_t_9 = 0;
7579 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
7580 __Pyx_GOTREF(__pyx_t_6);
7581 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7582 }
7583 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7584 __pyx_r = __pyx_t_6;
7585 __pyx_t_6 = 0;
7586 goto __pyx_L0;
7587
7588 /* "gssapi/raw/ext_dce.pyx":550
7589 * &conf_state, &qop_state)
7590 *
7591 * if maj_stat == GSS_S_COMPLETE: # <<<<<<<<<<<<<<
7592 * output_message = (<char*>output_buffer.value)[:output_buffer.length]
7593 * gss_release_buffer(&min_stat, &output_buffer)
7594 */
7595 }
7596
7597 /* "gssapi/raw/ext_dce.pyx":555
7598 * return UnwrapResult(output_message, <bint>conf_state, qop_state)
7599 * else:
7600 * raise GSSError(maj_stat, min_stat) # <<<<<<<<<<<<<<
7601 */
7602 /*else*/ {
7603 __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 555, __pyx_L1_error)
7604 __Pyx_GOTREF(__pyx_t_7);
7605 __pyx_t_12 = __Pyx_PyInt_From_uint32_t(__pyx_v_maj_stat); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 555, __pyx_L1_error)
7606 __Pyx_GOTREF(__pyx_t_12);
7607 __pyx_t_9 = __Pyx_PyInt_From_uint32_t(__pyx_v_min_stat); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 555, __pyx_L1_error)
7608 __Pyx_GOTREF(__pyx_t_9);
7609 __pyx_t_8 = NULL;
7610 __pyx_t_11 = 0;
7611 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
7612 __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
7613 if (likely(__pyx_t_8)) {
7614 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
7615 __Pyx_INCREF(__pyx_t_8);
7616 __Pyx_INCREF(function);
7617 __Pyx_DECREF_SET(__pyx_t_7, function);
7618 __pyx_t_11 = 1;
7619 }
7620 }
7621 #if CYTHON_FAST_PYCALL
7622 if (PyFunction_Check(__pyx_t_7)) {
7623 PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_9};
7624 __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error)
7625 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7626 __Pyx_GOTREF(__pyx_t_6);
7627 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7628 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7629 } else
7630 #endif
7631 #if CYTHON_FAST_PYCCALL
7632 if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
7633 PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_12, __pyx_t_9};
7634 __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_11, 2+__pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error)
7635 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7636 __Pyx_GOTREF(__pyx_t_6);
7637 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
7638 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7639 } else
7640 #endif
7641 {
7642 __pyx_t_10 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 555, __pyx_L1_error)
7643 __Pyx_GOTREF(__pyx_t_10);
7644 if (__pyx_t_8) {
7645 __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
7646 }
7647 __Pyx_GIVEREF(__pyx_t_12);
7648 PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_11, __pyx_t_12);
7649 __Pyx_GIVEREF(__pyx_t_9);
7650 PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_11, __pyx_t_9);
7651 __pyx_t_12 = 0;
7652 __pyx_t_9 = 0;
7653 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_10, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 555, __pyx_L1_error)
7654 __Pyx_GOTREF(__pyx_t_6);
7655 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7656 }
7657 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7658 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
7659 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7660 __PYX_ERR(0, 555, __pyx_L1_error)
7661 }
7662
7663 /* "gssapi/raw/ext_dce.pyx":508
7664 *
7665 *
7666 * def unwrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
7667 * bytes associated=None):
7668 * """
7669 */
7670
7671 /* function exit code */
7672 __pyx_L1_error:;
7673 __Pyx_XDECREF(__pyx_t_6);
7674 __Pyx_XDECREF(__pyx_t_7);
7675 __Pyx_XDECREF(__pyx_t_8);
7676 __Pyx_XDECREF(__pyx_t_9);
7677 __Pyx_XDECREF(__pyx_t_10);
7678 __Pyx_XDECREF(__pyx_t_12);
7679 __Pyx_AddTraceback("gssapi.raw.ext_dce.unwrap_aead", __pyx_clineno, __pyx_lineno, __pyx_filename);
7680 __pyx_r = NULL;
7681 __pyx_L0:;
7682 __Pyx_XDECREF(__pyx_v_output_message);
7683 __Pyx_XGIVEREF(__pyx_r);
7684 __Pyx_RefNannyFinishContext();
7685 return __pyx_r;
7686 }
7687 static struct __pyx_vtabstruct_6gssapi_3raw_7ext_dce_IOV __pyx_vtable_6gssapi_3raw_7ext_dce_IOV;
7688
__pyx_tp_new_6gssapi_3raw_7ext_dce_IOV(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)7689 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce_IOV(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
7690 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *p;
7691 PyObject *o;
7692 if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
7693 o = (*t->tp_alloc)(t, 0);
7694 } else {
7695 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
7696 }
7697 if (unlikely(!o)) return 0;
7698 p = ((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)o);
7699 p->__pyx_vtab = __pyx_vtabptr_6gssapi_3raw_7ext_dce_IOV;
7700 p->_buffs = ((PyObject*)Py_None); Py_INCREF(Py_None);
7701 return o;
7702 }
7703
__pyx_tp_dealloc_6gssapi_3raw_7ext_dce_IOV(PyObject * o)7704 static void __pyx_tp_dealloc_6gssapi_3raw_7ext_dce_IOV(PyObject *o) {
7705 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)o;
7706 #if CYTHON_USE_TP_FINALIZE
7707 if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
7708 if (PyObject_CallFinalizerFromDealloc(o)) return;
7709 }
7710 #endif
7711 PyObject_GC_UnTrack(o);
7712 {
7713 PyObject *etype, *eval, *etb;
7714 PyErr_Fetch(&etype, &eval, &etb);
7715 __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
7716 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_23__dealloc__(o);
7717 __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
7718 PyErr_Restore(etype, eval, etb);
7719 }
7720 Py_CLEAR(p->_buffs);
7721 (*Py_TYPE(o)->tp_free)(o);
7722 }
7723
__pyx_tp_traverse_6gssapi_3raw_7ext_dce_IOV(PyObject * o,visitproc v,void * a)7724 static int __pyx_tp_traverse_6gssapi_3raw_7ext_dce_IOV(PyObject *o, visitproc v, void *a) {
7725 int e;
7726 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)o;
7727 if (p->_buffs) {
7728 e = (*v)(p->_buffs, a); if (e) return e;
7729 }
7730 return 0;
7731 }
7732
__pyx_tp_clear_6gssapi_3raw_7ext_dce_IOV(PyObject * o)7733 static int __pyx_tp_clear_6gssapi_3raw_7ext_dce_IOV(PyObject *o) {
7734 PyObject* tmp;
7735 struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)o;
7736 tmp = ((PyObject*)p->_buffs);
7737 p->_buffs = ((PyObject*)Py_None); Py_INCREF(Py_None);
7738 Py_XDECREF(tmp);
7739 return 0;
7740 }
__pyx_sq_item_6gssapi_3raw_7ext_dce_IOV(PyObject * o,Py_ssize_t i)7741 static PyObject *__pyx_sq_item_6gssapi_3raw_7ext_dce_IOV(PyObject *o, Py_ssize_t i) {
7742 PyObject *r;
7743 PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
7744 r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
7745 Py_DECREF(x);
7746 return r;
7747 }
7748
7749 static PyMethodDef __pyx_methods_6gssapi_3raw_7ext_dce_IOV[] = {
7750 {"__reversed__", (PyCFunction)__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_12__reversed__, METH_NOARGS, 0},
7751 {"index", (PyCFunction)__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_15index, METH_O, 0},
7752 {"count", (PyCFunction)__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_17count, METH_O, 0},
7753 {"__reduce_cython__", (PyCFunction)__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_25__reduce_cython__, METH_NOARGS, 0},
7754 {"__setstate_cython__", (PyCFunction)__pyx_pw_6gssapi_3raw_7ext_dce_3IOV_27__setstate_cython__, METH_O, 0},
7755 {0, 0, 0, 0}
7756 };
7757
7758 static PySequenceMethods __pyx_tp_as_sequence_IOV = {
7759 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_5__len__, /*sq_length*/
7760 0, /*sq_concat*/
7761 0, /*sq_repeat*/
7762 __pyx_sq_item_6gssapi_3raw_7ext_dce_IOV, /*sq_item*/
7763 0, /*sq_slice*/
7764 0, /*sq_ass_item*/
7765 0, /*sq_ass_slice*/
7766 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_10__contains__, /*sq_contains*/
7767 0, /*sq_inplace_concat*/
7768 0, /*sq_inplace_repeat*/
7769 };
7770
7771 static PyMappingMethods __pyx_tp_as_mapping_IOV = {
7772 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_5__len__, /*mp_length*/
7773 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_3__getitem__, /*mp_subscript*/
7774 0, /*mp_ass_subscript*/
7775 };
7776
7777 static PyTypeObject __pyx_type_6gssapi_3raw_7ext_dce_IOV = {
7778 PyVarObject_HEAD_INIT(0, 0)
7779 "gssapi.raw.ext_dce.IOV", /*tp_name*/
7780 sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV), /*tp_basicsize*/
7781 0, /*tp_itemsize*/
7782 __pyx_tp_dealloc_6gssapi_3raw_7ext_dce_IOV, /*tp_dealloc*/
7783 #if PY_VERSION_HEX < 0x030800b4
7784 0, /*tp_print*/
7785 #endif
7786 #if PY_VERSION_HEX >= 0x030800b4
7787 0, /*tp_vectorcall_offset*/
7788 #endif
7789 0, /*tp_getattr*/
7790 0, /*tp_setattr*/
7791 #if PY_MAJOR_VERSION < 3
7792 0, /*tp_compare*/
7793 #endif
7794 #if PY_MAJOR_VERSION >= 3
7795 0, /*tp_as_async*/
7796 #endif
7797 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_19__repr__, /*tp_repr*/
7798 0, /*tp_as_number*/
7799 &__pyx_tp_as_sequence_IOV, /*tp_as_sequence*/
7800 &__pyx_tp_as_mapping_IOV, /*tp_as_mapping*/
7801 0, /*tp_hash*/
7802 0, /*tp_call*/
7803 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_21__str__, /*tp_str*/
7804 0, /*tp_getattro*/
7805 0, /*tp_setattro*/
7806 0, /*tp_as_buffer*/
7807 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7808 "A GSSAPI IOV", /*tp_doc*/
7809 __pyx_tp_traverse_6gssapi_3raw_7ext_dce_IOV, /*tp_traverse*/
7810 __pyx_tp_clear_6gssapi_3raw_7ext_dce_IOV, /*tp_clear*/
7811 0, /*tp_richcompare*/
7812 0, /*tp_weaklistoffset*/
7813 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_7__iter__, /*tp_iter*/
7814 0, /*tp_iternext*/
7815 __pyx_methods_6gssapi_3raw_7ext_dce_IOV, /*tp_methods*/
7816 0, /*tp_members*/
7817 0, /*tp_getset*/
7818 0, /*tp_base*/
7819 0, /*tp_dict*/
7820 0, /*tp_descr_get*/
7821 0, /*tp_descr_set*/
7822 0, /*tp_dictoffset*/
7823 __pyx_pw_6gssapi_3raw_7ext_dce_3IOV_1__init__, /*tp_init*/
7824 0, /*tp_alloc*/
7825 __pyx_tp_new_6gssapi_3raw_7ext_dce_IOV, /*tp_new*/
7826 0, /*tp_free*/
7827 0, /*tp_is_gc*/
7828 0, /*tp_bases*/
7829 0, /*tp_mro*/
7830 0, /*tp_cache*/
7831 0, /*tp_subclasses*/
7832 0, /*tp_weaklist*/
7833 0, /*tp_del*/
7834 0, /*tp_version_tag*/
7835 #if PY_VERSION_HEX >= 0x030400a1
7836 0, /*tp_finalize*/
7837 #endif
7838 #if PY_VERSION_HEX >= 0x030800b1
7839 0, /*tp_vectorcall*/
7840 #endif
7841 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7842 0, /*tp_print*/
7843 #endif
7844 };
7845
7846 static struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__[8];
7847 static int __pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ = 0;
7848
__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)7849 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
7850 PyObject *o;
7851 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__)))) {
7852 o = (PyObject*)__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__[--__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__];
7853 memset(o, 0, sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__));
7854 (void) PyObject_INIT(o, t);
7855 PyObject_GC_Track(o);
7856 } else {
7857 o = (*t->tp_alloc)(t, 0);
7858 if (unlikely(!o)) return 0;
7859 }
7860 return o;
7861 }
7862
__pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyObject * o)7863 static void __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyObject *o) {
7864 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *)o;
7865 PyObject_GC_UnTrack(o);
7866 Py_CLEAR(p->__pyx_v_self);
7867 Py_CLEAR(p->__pyx_v_val);
7868 Py_CLEAR(p->__pyx_t_0);
7869 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__)))) {
7870 __pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__[__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__++] = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *)o);
7871 } else {
7872 (*Py_TYPE(o)->tp_free)(o);
7873 }
7874 }
7875
__pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyObject * o,visitproc v,void * a)7876 static int __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__(PyObject *o, visitproc v, void *a) {
7877 int e;
7878 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ *)o;
7879 if (p->__pyx_v_self) {
7880 e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
7881 }
7882 if (p->__pyx_v_val) {
7883 e = (*v)(p->__pyx_v_val, a); if (e) return e;
7884 }
7885 if (p->__pyx_t_0) {
7886 e = (*v)(p->__pyx_t_0, a); if (e) return e;
7887 }
7888 return 0;
7889 }
7890
7891 static PyTypeObject __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ = {
7892 PyVarObject_HEAD_INIT(0, 0)
7893 "gssapi.raw.ext_dce.__pyx_scope_struct____iter__", /*tp_name*/
7894 sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__), /*tp_basicsize*/
7895 0, /*tp_itemsize*/
7896 __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__, /*tp_dealloc*/
7897 #if PY_VERSION_HEX < 0x030800b4
7898 0, /*tp_print*/
7899 #endif
7900 #if PY_VERSION_HEX >= 0x030800b4
7901 0, /*tp_vectorcall_offset*/
7902 #endif
7903 0, /*tp_getattr*/
7904 0, /*tp_setattr*/
7905 #if PY_MAJOR_VERSION < 3
7906 0, /*tp_compare*/
7907 #endif
7908 #if PY_MAJOR_VERSION >= 3
7909 0, /*tp_as_async*/
7910 #endif
7911 0, /*tp_repr*/
7912 0, /*tp_as_number*/
7913 0, /*tp_as_sequence*/
7914 0, /*tp_as_mapping*/
7915 0, /*tp_hash*/
7916 0, /*tp_call*/
7917 0, /*tp_str*/
7918 0, /*tp_getattro*/
7919 0, /*tp_setattro*/
7920 0, /*tp_as_buffer*/
7921 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
7922 0, /*tp_doc*/
7923 __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__, /*tp_traverse*/
7924 0, /*tp_clear*/
7925 0, /*tp_richcompare*/
7926 0, /*tp_weaklistoffset*/
7927 0, /*tp_iter*/
7928 0, /*tp_iternext*/
7929 0, /*tp_methods*/
7930 0, /*tp_members*/
7931 0, /*tp_getset*/
7932 0, /*tp_base*/
7933 0, /*tp_dict*/
7934 0, /*tp_descr_get*/
7935 0, /*tp_descr_set*/
7936 0, /*tp_dictoffset*/
7937 0, /*tp_init*/
7938 0, /*tp_alloc*/
7939 __pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__, /*tp_new*/
7940 0, /*tp_free*/
7941 0, /*tp_is_gc*/
7942 0, /*tp_bases*/
7943 0, /*tp_mro*/
7944 0, /*tp_cache*/
7945 0, /*tp_subclasses*/
7946 0, /*tp_weaklist*/
7947 0, /*tp_del*/
7948 0, /*tp_version_tag*/
7949 #if PY_VERSION_HEX >= 0x030400a1
7950 0, /*tp_finalize*/
7951 #endif
7952 #if PY_VERSION_HEX >= 0x030800b1
7953 0, /*tp_vectorcall*/
7954 #endif
7955 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
7956 0, /*tp_print*/
7957 #endif
7958 };
7959
7960 static struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__[8];
7961 static int __pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ = 0;
7962
__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)7963 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
7964 PyObject *o;
7965 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__)))) {
7966 o = (PyObject*)__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__[--__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__];
7967 memset(o, 0, sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__));
7968 (void) PyObject_INIT(o, t);
7969 PyObject_GC_Track(o);
7970 } else {
7971 o = (*t->tp_alloc)(t, 0);
7972 if (unlikely(!o)) return 0;
7973 }
7974 return o;
7975 }
7976
__pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyObject * o)7977 static void __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyObject *o) {
7978 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *)o;
7979 PyObject_GC_UnTrack(o);
7980 Py_CLEAR(p->__pyx_v_self);
7981 Py_CLEAR(p->__pyx_v_val);
7982 Py_CLEAR(p->__pyx_t_0);
7983 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__)))) {
7984 __pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__[__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__++] = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *)o);
7985 } else {
7986 (*Py_TYPE(o)->tp_free)(o);
7987 }
7988 }
7989
__pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyObject * o,visitproc v,void * a)7990 static int __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__(PyObject *o, visitproc v, void *a) {
7991 int e;
7992 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ *)o;
7993 if (p->__pyx_v_self) {
7994 e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
7995 }
7996 if (p->__pyx_v_val) {
7997 e = (*v)(p->__pyx_v_val, a); if (e) return e;
7998 }
7999 if (p->__pyx_t_0) {
8000 e = (*v)(p->__pyx_t_0, a); if (e) return e;
8001 }
8002 return 0;
8003 }
8004
8005 static PyTypeObject __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ = {
8006 PyVarObject_HEAD_INIT(0, 0)
8007 "gssapi.raw.ext_dce.__pyx_scope_struct_1___reversed__", /*tp_name*/
8008 sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__), /*tp_basicsize*/
8009 0, /*tp_itemsize*/
8010 __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__, /*tp_dealloc*/
8011 #if PY_VERSION_HEX < 0x030800b4
8012 0, /*tp_print*/
8013 #endif
8014 #if PY_VERSION_HEX >= 0x030800b4
8015 0, /*tp_vectorcall_offset*/
8016 #endif
8017 0, /*tp_getattr*/
8018 0, /*tp_setattr*/
8019 #if PY_MAJOR_VERSION < 3
8020 0, /*tp_compare*/
8021 #endif
8022 #if PY_MAJOR_VERSION >= 3
8023 0, /*tp_as_async*/
8024 #endif
8025 0, /*tp_repr*/
8026 0, /*tp_as_number*/
8027 0, /*tp_as_sequence*/
8028 0, /*tp_as_mapping*/
8029 0, /*tp_hash*/
8030 0, /*tp_call*/
8031 0, /*tp_str*/
8032 0, /*tp_getattro*/
8033 0, /*tp_setattro*/
8034 0, /*tp_as_buffer*/
8035 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8036 0, /*tp_doc*/
8037 __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__, /*tp_traverse*/
8038 0, /*tp_clear*/
8039 0, /*tp_richcompare*/
8040 0, /*tp_weaklistoffset*/
8041 0, /*tp_iter*/
8042 0, /*tp_iternext*/
8043 0, /*tp_methods*/
8044 0, /*tp_members*/
8045 0, /*tp_getset*/
8046 0, /*tp_base*/
8047 0, /*tp_dict*/
8048 0, /*tp_descr_get*/
8049 0, /*tp_descr_set*/
8050 0, /*tp_dictoffset*/
8051 0, /*tp_init*/
8052 0, /*tp_alloc*/
8053 __pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__, /*tp_new*/
8054 0, /*tp_free*/
8055 0, /*tp_is_gc*/
8056 0, /*tp_bases*/
8057 0, /*tp_mro*/
8058 0, /*tp_cache*/
8059 0, /*tp_subclasses*/
8060 0, /*tp_weaklist*/
8061 0, /*tp_del*/
8062 0, /*tp_version_tag*/
8063 #if PY_VERSION_HEX >= 0x030400a1
8064 0, /*tp_finalize*/
8065 #endif
8066 #if PY_VERSION_HEX >= 0x030800b1
8067 0, /*tp_vectorcall*/
8068 #endif
8069 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8070 0, /*tp_print*/
8071 #endif
8072 };
8073
8074 static struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count[8];
8075 static int __pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count = 0;
8076
__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8077 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8078 PyObject *o;
8079 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count)))) {
8080 o = (PyObject*)__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count[--__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count];
8081 memset(o, 0, sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count));
8082 (void) PyObject_INIT(o, t);
8083 PyObject_GC_Track(o);
8084 } else {
8085 o = (*t->tp_alloc)(t, 0);
8086 if (unlikely(!o)) return 0;
8087 }
8088 return o;
8089 }
8090
__pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyObject * o)8091 static void __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyObject *o) {
8092 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *)o;
8093 PyObject_GC_UnTrack(o);
8094 Py_CLEAR(p->__pyx_v_self);
8095 Py_CLEAR(p->__pyx_v_value);
8096 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count)))) {
8097 __pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count[__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count++] = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *)o);
8098 } else {
8099 (*Py_TYPE(o)->tp_free)(o);
8100 }
8101 }
8102
__pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyObject * o,visitproc v,void * a)8103 static int __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyObject *o, visitproc v, void *a) {
8104 int e;
8105 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *)o;
8106 if (p->__pyx_v_self) {
8107 e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
8108 }
8109 if (p->__pyx_v_value) {
8110 e = (*v)(p->__pyx_v_value, a); if (e) return e;
8111 }
8112 return 0;
8113 }
8114
__pyx_tp_clear_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyObject * o)8115 static int __pyx_tp_clear_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count(PyObject *o) {
8116 PyObject* tmp;
8117 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count *)o;
8118 tmp = ((PyObject*)p->__pyx_v_self);
8119 p->__pyx_v_self = ((struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *)Py_None); Py_INCREF(Py_None);
8120 Py_XDECREF(tmp);
8121 tmp = ((PyObject*)p->__pyx_v_value);
8122 p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
8123 Py_XDECREF(tmp);
8124 return 0;
8125 }
8126
8127 static PyTypeObject __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count = {
8128 PyVarObject_HEAD_INIT(0, 0)
8129 "gssapi.raw.ext_dce.__pyx_scope_struct_2_count", /*tp_name*/
8130 sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count), /*tp_basicsize*/
8131 0, /*tp_itemsize*/
8132 __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count, /*tp_dealloc*/
8133 #if PY_VERSION_HEX < 0x030800b4
8134 0, /*tp_print*/
8135 #endif
8136 #if PY_VERSION_HEX >= 0x030800b4
8137 0, /*tp_vectorcall_offset*/
8138 #endif
8139 0, /*tp_getattr*/
8140 0, /*tp_setattr*/
8141 #if PY_MAJOR_VERSION < 3
8142 0, /*tp_compare*/
8143 #endif
8144 #if PY_MAJOR_VERSION >= 3
8145 0, /*tp_as_async*/
8146 #endif
8147 0, /*tp_repr*/
8148 0, /*tp_as_number*/
8149 0, /*tp_as_sequence*/
8150 0, /*tp_as_mapping*/
8151 0, /*tp_hash*/
8152 0, /*tp_call*/
8153 0, /*tp_str*/
8154 0, /*tp_getattro*/
8155 0, /*tp_setattro*/
8156 0, /*tp_as_buffer*/
8157 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8158 0, /*tp_doc*/
8159 __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count, /*tp_traverse*/
8160 __pyx_tp_clear_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count, /*tp_clear*/
8161 0, /*tp_richcompare*/
8162 0, /*tp_weaklistoffset*/
8163 0, /*tp_iter*/
8164 0, /*tp_iternext*/
8165 0, /*tp_methods*/
8166 0, /*tp_members*/
8167 0, /*tp_getset*/
8168 0, /*tp_base*/
8169 0, /*tp_dict*/
8170 0, /*tp_descr_get*/
8171 0, /*tp_descr_set*/
8172 0, /*tp_dictoffset*/
8173 0, /*tp_init*/
8174 0, /*tp_alloc*/
8175 __pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count, /*tp_new*/
8176 0, /*tp_free*/
8177 0, /*tp_is_gc*/
8178 0, /*tp_bases*/
8179 0, /*tp_mro*/
8180 0, /*tp_cache*/
8181 0, /*tp_subclasses*/
8182 0, /*tp_weaklist*/
8183 0, /*tp_del*/
8184 0, /*tp_version_tag*/
8185 #if PY_VERSION_HEX >= 0x030400a1
8186 0, /*tp_finalize*/
8187 #endif
8188 #if PY_VERSION_HEX >= 0x030800b1
8189 0, /*tp_vectorcall*/
8190 #endif
8191 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8192 0, /*tp_print*/
8193 #endif
8194 };
8195
8196 static struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr[8];
8197 static int __pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr = 0;
8198
__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8199 static PyObject *__pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8200 PyObject *o;
8201 if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr)))) {
8202 o = (PyObject*)__pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr[--__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr];
8203 memset(o, 0, sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr));
8204 (void) PyObject_INIT(o, t);
8205 PyObject_GC_Track(o);
8206 } else {
8207 o = (*t->tp_alloc)(t, 0);
8208 if (unlikely(!o)) return 0;
8209 }
8210 return o;
8211 }
8212
__pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyObject * o)8213 static void __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyObject *o) {
8214 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *)o;
8215 PyObject_GC_UnTrack(o);
8216 Py_CLEAR(p->__pyx_outer_scope);
8217 Py_CLEAR(p->__pyx_v_v);
8218 Py_CLEAR(p->__pyx_t_0);
8219 if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr)))) {
8220 __pyx_freelist_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr[__pyx_freecount_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr++] = ((struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *)o);
8221 } else {
8222 (*Py_TYPE(o)->tp_free)(o);
8223 }
8224 }
8225
__pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyObject * o,visitproc v,void * a)8226 static int __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr(PyObject *o, visitproc v, void *a) {
8227 int e;
8228 struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *p = (struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr *)o;
8229 if (p->__pyx_outer_scope) {
8230 e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
8231 }
8232 if (p->__pyx_v_v) {
8233 e = (*v)(p->__pyx_v_v, a); if (e) return e;
8234 }
8235 if (p->__pyx_t_0) {
8236 e = (*v)(p->__pyx_t_0, a); if (e) return e;
8237 }
8238 return 0;
8239 }
8240
8241 static PyTypeObject __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr = {
8242 PyVarObject_HEAD_INIT(0, 0)
8243 "gssapi.raw.ext_dce.__pyx_scope_struct_3_genexpr", /*tp_name*/
8244 sizeof(struct __pyx_obj_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr), /*tp_basicsize*/
8245 0, /*tp_itemsize*/
8246 __pyx_tp_dealloc_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr, /*tp_dealloc*/
8247 #if PY_VERSION_HEX < 0x030800b4
8248 0, /*tp_print*/
8249 #endif
8250 #if PY_VERSION_HEX >= 0x030800b4
8251 0, /*tp_vectorcall_offset*/
8252 #endif
8253 0, /*tp_getattr*/
8254 0, /*tp_setattr*/
8255 #if PY_MAJOR_VERSION < 3
8256 0, /*tp_compare*/
8257 #endif
8258 #if PY_MAJOR_VERSION >= 3
8259 0, /*tp_as_async*/
8260 #endif
8261 0, /*tp_repr*/
8262 0, /*tp_as_number*/
8263 0, /*tp_as_sequence*/
8264 0, /*tp_as_mapping*/
8265 0, /*tp_hash*/
8266 0, /*tp_call*/
8267 0, /*tp_str*/
8268 0, /*tp_getattro*/
8269 0, /*tp_setattro*/
8270 0, /*tp_as_buffer*/
8271 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
8272 0, /*tp_doc*/
8273 __pyx_tp_traverse_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr, /*tp_traverse*/
8274 0, /*tp_clear*/
8275 0, /*tp_richcompare*/
8276 0, /*tp_weaklistoffset*/
8277 0, /*tp_iter*/
8278 0, /*tp_iternext*/
8279 0, /*tp_methods*/
8280 0, /*tp_members*/
8281 0, /*tp_getset*/
8282 0, /*tp_base*/
8283 0, /*tp_dict*/
8284 0, /*tp_descr_get*/
8285 0, /*tp_descr_set*/
8286 0, /*tp_dictoffset*/
8287 0, /*tp_init*/
8288 0, /*tp_alloc*/
8289 __pyx_tp_new_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr, /*tp_new*/
8290 0, /*tp_free*/
8291 0, /*tp_is_gc*/
8292 0, /*tp_bases*/
8293 0, /*tp_mro*/
8294 0, /*tp_cache*/
8295 0, /*tp_subclasses*/
8296 0, /*tp_weaklist*/
8297 0, /*tp_del*/
8298 0, /*tp_version_tag*/
8299 #if PY_VERSION_HEX >= 0x030400a1
8300 0, /*tp_finalize*/
8301 #endif
8302 #if PY_VERSION_HEX >= 0x030800b1
8303 0, /*tp_vectorcall*/
8304 #endif
8305 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8306 0, /*tp_print*/
8307 #endif
8308 };
8309
8310 static PyMethodDef __pyx_methods[] = {
8311 {0, 0, 0, 0}
8312 };
8313
8314 #if PY_MAJOR_VERSION >= 3
8315 #if CYTHON_PEP489_MULTI_PHASE_INIT
8316 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
8317 static int __pyx_pymod_exec_ext_dce(PyObject* module); /*proto*/
8318 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
8319 {Py_mod_create, (void*)__pyx_pymod_create},
8320 {Py_mod_exec, (void*)__pyx_pymod_exec_ext_dce},
8321 {0, NULL}
8322 };
8323 #endif
8324
8325 static struct PyModuleDef __pyx_moduledef = {
8326 PyModuleDef_HEAD_INIT,
8327 "ext_dce",
8328 0, /* m_doc */
8329 #if CYTHON_PEP489_MULTI_PHASE_INIT
8330 0, /* m_size */
8331 #else
8332 -1, /* m_size */
8333 #endif
8334 __pyx_methods /* m_methods */,
8335 #if CYTHON_PEP489_MULTI_PHASE_INIT
8336 __pyx_moduledef_slots, /* m_slots */
8337 #else
8338 NULL, /* m_reload */
8339 #endif
8340 NULL, /* m_traverse */
8341 NULL, /* m_clear */
8342 NULL /* m_free */
8343 };
8344 #endif
8345 #ifndef CYTHON_SMALL_CODE
8346 #if defined(__clang__)
8347 #define CYTHON_SMALL_CODE
8348 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
8349 #define CYTHON_SMALL_CODE __attribute__((cold))
8350 #else
8351 #define CYTHON_SMALL_CODE
8352 #endif
8353 #endif
8354
8355 static __Pyx_StringTabEntry __pyx_string_tab[] = {
8356 {&__pyx_kp_s_0_1_r_2, __pyx_k_0_1_r_2, sizeof(__pyx_k_0_1_r_2), 0, 0, 1, 0},
8357 {&__pyx_n_s_AUTO_ALLOC_BUFFERS, __pyx_k_AUTO_ALLOC_BUFFERS, sizeof(__pyx_k_AUTO_ALLOC_BUFFERS), 0, 0, 1, 1},
8358 {&__pyx_n_s_BASE, __pyx_k_BASE, sizeof(__pyx_k_BASE), 0, 0, 1, 1},
8359 {&__pyx_kp_s_Buffer_description_tuples_must_b, __pyx_k_Buffer_description_tuples_must_b, sizeof(__pyx_k_Buffer_description_tuples_must_b), 0, 0, 1, 0},
8360 {&__pyx_kp_s_Cannot_calloc_for_IOV_buffer_arr, __pyx_k_Cannot_calloc_for_IOV_buffer_arr, sizeof(__pyx_k_Cannot_calloc_for_IOV_buffer_arr), 0, 0, 1, 0},
8361 {&__pyx_kp_s_Cannot_malloc_for_buffer_value, __pyx_k_Cannot_malloc_for_buffer_value, sizeof(__pyx_k_Cannot_malloc_for_buffer_value), 0, 0, 1, 0},
8362 {&__pyx_n_s_ExtendableEnum, __pyx_k_ExtendableEnum, sizeof(__pyx_k_ExtendableEnum), 0, 0, 1, 1},
8363 {&__pyx_n_s_GSSAPI, __pyx_k_GSSAPI, sizeof(__pyx_k_GSSAPI), 0, 0, 1, 1},
8364 {&__pyx_n_s_GSSError, __pyx_k_GSSError, sizeof(__pyx_k_GSSError), 0, 0, 1, 1},
8365 {&__pyx_n_s_IOV, __pyx_k_IOV, sizeof(__pyx_k_IOV), 0, 0, 1, 1},
8366 {&__pyx_n_s_IOVBuffer, __pyx_k_IOVBuffer, sizeof(__pyx_k_IOVBuffer), 0, 0, 1, 1},
8367 {&__pyx_n_s_IOVBufferType, __pyx_k_IOVBufferType, sizeof(__pyx_k_IOVBufferType), 0, 0, 1, 1},
8368 {&__pyx_n_s_IOVUnwrapResult, __pyx_k_IOVUnwrapResult, sizeof(__pyx_k_IOVUnwrapResult), 0, 0, 1, 1},
8369 {&__pyx_kp_s_IOV_0, __pyx_k_IOV_0, sizeof(__pyx_k_IOV_0), 0, 0, 1, 0},
8370 {&__pyx_kp_s_IOV_Buffer_Types_This_IntEnum_r, __pyx_k_IOV_Buffer_Types_This_IntEnum_r, sizeof(__pyx_k_IOV_Buffer_Types_This_IntEnum_r), 0, 0, 1, 0},
8371 {&__pyx_n_s_IOV___iter, __pyx_k_IOV___iter, sizeof(__pyx_k_IOV___iter), 0, 0, 1, 1},
8372 {&__pyx_n_s_IOV___reversed, __pyx_k_IOV___reversed, sizeof(__pyx_k_IOV___reversed), 0, 0, 1, 1},
8373 {&__pyx_n_s_IntEnum, __pyx_k_IntEnum, sizeof(__pyx_k_IntEnum), 0, 0, 1, 1},
8374 {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
8375 {&__pyx_n_s_Sequence, __pyx_k_Sequence, sizeof(__pyx_k_Sequence), 0, 0, 1, 1},
8376 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
8377 {&__pyx_n_s_UnwrapResult, __pyx_k_UnwrapResult, sizeof(__pyx_k_UnwrapResult), 0, 0, 1, 1},
8378 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
8379 {&__pyx_n_s_WrapResult, __pyx_k_WrapResult, sizeof(__pyx_k_WrapResult), 0, 0, 1, 1},
8380 {&__pyx_kp_b__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 0, 0},
8381 {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0},
8382 {&__pyx_kp_s__6, __pyx_k__6, sizeof(__pyx_k__6), 0, 0, 1, 0},
8383 {&__pyx_kp_s__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 0, 1, 0},
8384 {&__pyx_n_s_allocate, __pyx_k_allocate, sizeof(__pyx_k_allocate), 0, 0, 1, 1},
8385 {&__pyx_kp_s_allocate_2, __pyx_k_allocate_2, sizeof(__pyx_k_allocate_2), 0, 0, 1, 0},
8386 {&__pyx_kp_s_allocated, __pyx_k_allocated, sizeof(__pyx_k_allocated), 0, 0, 1, 0},
8387 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
8388 {&__pyx_n_s_assoc_buffer, __pyx_k_assoc_buffer, sizeof(__pyx_k_assoc_buffer), 0, 0, 1, 1},
8389 {&__pyx_n_s_assoc_buffer_ptr, __pyx_k_assoc_buffer_ptr, sizeof(__pyx_k_assoc_buffer_ptr), 0, 0, 1, 1},
8390 {&__pyx_n_s_associated, __pyx_k_associated, sizeof(__pyx_k_associated), 0, 0, 1, 1},
8391 {&__pyx_n_s_auto_alloc, __pyx_k_auto_alloc, sizeof(__pyx_k_auto_alloc), 0, 0, 1, 1},
8392 {&__pyx_n_s_buffs, __pyx_k_buffs, sizeof(__pyx_k_buffs), 0, 0, 1, 1},
8393 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
8394 {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
8395 {&__pyx_n_s_collections, __pyx_k_collections, sizeof(__pyx_k_collections), 0, 0, 1, 1},
8396 {&__pyx_n_s_collections_abc, __pyx_k_collections_abc, sizeof(__pyx_k_collections_abc), 0, 0, 1, 1},
8397 {&__pyx_n_s_conf_req, __pyx_k_conf_req, sizeof(__pyx_k_conf_req), 0, 0, 1, 1},
8398 {&__pyx_n_s_conf_state, __pyx_k_conf_state, sizeof(__pyx_k_conf_state), 0, 0, 1, 1},
8399 {&__pyx_n_s_conf_used, __pyx_k_conf_used, sizeof(__pyx_k_conf_used), 0, 0, 1, 1},
8400 {&__pyx_n_s_confidential, __pyx_k_confidential, sizeof(__pyx_k_confidential), 0, 0, 1, 1},
8401 {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
8402 {&__pyx_n_s_count_locals_genexpr, __pyx_k_count_locals_genexpr, sizeof(__pyx_k_count_locals_genexpr), 0, 0, 1, 1},
8403 {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
8404 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
8405 {&__pyx_kp_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 0},
8406 {&__pyx_n_s_empty_2, __pyx_k_empty_2, sizeof(__pyx_k_empty_2), 0, 0, 1, 1},
8407 {&__pyx_n_s_enum, __pyx_k_enum, sizeof(__pyx_k_enum), 0, 0, 1, 1},
8408 {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
8409 {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
8410 {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
8411 {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
8412 {&__pyx_n_s_gssapi_raw, __pyx_k_gssapi_raw, sizeof(__pyx_k_gssapi_raw), 0, 0, 1, 1},
8413 {&__pyx_n_s_gssapi_raw__enum_extensions, __pyx_k_gssapi_raw__enum_extensions, sizeof(__pyx_k_gssapi_raw__enum_extensions), 0, 0, 1, 1},
8414 {&__pyx_n_s_gssapi_raw_ext_dce, __pyx_k_gssapi_raw_ext_dce, sizeof(__pyx_k_gssapi_raw_ext_dce), 0, 0, 1, 1},
8415 {&__pyx_kp_s_gssapi_raw_ext_dce_pyx, __pyx_k_gssapi_raw_ext_dce_pyx, sizeof(__pyx_k_gssapi_raw_ext_dce_pyx), 0, 0, 1, 0},
8416 {&__pyx_n_s_gssapi_raw_misc, __pyx_k_gssapi_raw_misc, sizeof(__pyx_k_gssapi_raw_misc), 0, 0, 1, 1},
8417 {&__pyx_n_s_gssapi_raw_named_tuples, __pyx_k_gssapi_raw_named_tuples, sizeof(__pyx_k_gssapi_raw_named_tuples), 0, 0, 1, 1},
8418 {&__pyx_n_s_gssapi_types, __pyx_k_gssapi_types, sizeof(__pyx_k_gssapi_types), 0, 0, 1, 1},
8419 {&__pyx_n_s_header, __pyx_k_header, sizeof(__pyx_k_header), 0, 0, 1, 1},
8420 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
8421 {&__pyx_n_s_input_buffer, __pyx_k_input_buffer, sizeof(__pyx_k_input_buffer), 0, 0, 1, 1},
8422 {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
8423 {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
8424 {&__pyx_n_s_length, __pyx_k_length, sizeof(__pyx_k_length), 0, 0, 1, 1},
8425 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
8426 {&__pyx_n_s_maj_stat, __pyx_k_maj_stat, sizeof(__pyx_k_maj_stat), 0, 0, 1, 1},
8427 {&__pyx_n_s_mech_params, __pyx_k_mech_params, sizeof(__pyx_k_mech_params), 0, 0, 1, 1},
8428 {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
8429 {&__pyx_n_s_message_buffer, __pyx_k_message_buffer, sizeof(__pyx_k_message_buffer), 0, 0, 1, 1},
8430 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
8431 {&__pyx_n_s_min_stat, __pyx_k_min_stat, sizeof(__pyx_k_min_stat), 0, 0, 1, 1},
8432 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
8433 {&__pyx_n_s_module_2, __pyx_k_module_2, sizeof(__pyx_k_module_2), 0, 0, 1, 1},
8434 {&__pyx_kp_s_module_name_buffs, __pyx_k_module_name_buffs, sizeof(__pyx_k_module_name_buffs), 0, 0, 1, 0},
8435 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
8436 {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
8437 {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
8438 {&__pyx_n_s_output_buffer, __pyx_k_output_buffer, sizeof(__pyx_k_output_buffer), 0, 0, 1, 1},
8439 {&__pyx_n_s_output_message, __pyx_k_output_message, sizeof(__pyx_k_output_message), 0, 0, 1, 1},
8440 {&__pyx_n_s_padding, __pyx_k_padding, sizeof(__pyx_k_padding), 0, 0, 1, 1},
8441 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
8442 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
8443 {&__pyx_n_s_qop, __pyx_k_qop, sizeof(__pyx_k_qop), 0, 0, 1, 1},
8444 {&__pyx_n_s_qop_req, __pyx_k_qop_req, sizeof(__pyx_k_qop_req), 0, 0, 1, 1},
8445 {&__pyx_n_s_qop_state, __pyx_k_qop_state, sizeof(__pyx_k_qop_state), 0, 0, 1, 1},
8446 {&__pyx_n_s_qop_used, __pyx_k_qop_used, sizeof(__pyx_k_qop_used), 0, 0, 1, 1},
8447 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
8448 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
8449 {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
8450 {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
8451 {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
8452 {&__pyx_n_s_res_arr, __pyx_k_res_arr, sizeof(__pyx_k_res_arr), 0, 0, 1, 1},
8453 {&__pyx_n_s_reversed, __pyx_k_reversed, sizeof(__pyx_k_reversed), 0, 0, 1, 1},
8454 {&__pyx_n_s_reversed_2, __pyx_k_reversed_2, sizeof(__pyx_k_reversed_2), 0, 0, 1, 1},
8455 {&__pyx_kp_s_self__iov_cannot_be_converted_to, __pyx_k_self__iov_cannot_be_converted_to, sizeof(__pyx_k_self__iov_cannot_be_converted_to), 0, 0, 1, 0},
8456 {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
8457 {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
8458 {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
8459 {&__pyx_n_s_sign_only, __pyx_k_sign_only, sizeof(__pyx_k_sign_only), 0, 0, 1, 1},
8460 {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
8461 {&__pyx_n_s_std_layout, __pyx_k_std_layout, sizeof(__pyx_k_std_layout), 0, 0, 1, 1},
8462 {&__pyx_n_s_stream, __pyx_k_stream, sizeof(__pyx_k_stream), 0, 0, 1, 1},
8463 {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
8464 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
8465 {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
8466 {&__pyx_n_s_trailer, __pyx_k_trailer, sizeof(__pyx_k_trailer), 0, 0, 1, 1},
8467 {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
8468 {&__pyx_n_s_types, __pyx_k_types, sizeof(__pyx_k_types), 0, 0, 1, 1},
8469 {&__pyx_n_s_unwrap_aead, __pyx_k_unwrap_aead, sizeof(__pyx_k_unwrap_aead), 0, 0, 1, 1},
8470 {&__pyx_n_s_unwrap_iov, __pyx_k_unwrap_iov, sizeof(__pyx_k_unwrap_iov), 0, 0, 1, 1},
8471 {&__pyx_n_s_upper, __pyx_k_upper, sizeof(__pyx_k_upper), 0, 0, 1, 1},
8472 {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
8473 {&__pyx_n_s_wrap_aead, __pyx_k_wrap_aead, sizeof(__pyx_k_wrap_aead), 0, 0, 1, 1},
8474 {&__pyx_n_s_wrap_iov, __pyx_k_wrap_iov, sizeof(__pyx_k_wrap_iov), 0, 0, 1, 1},
8475 {&__pyx_n_s_wrap_iov_length, __pyx_k_wrap_iov_length, sizeof(__pyx_k_wrap_iov_length), 0, 0, 1, 1},
8476 {0, 0, 0, 0, 0, 0, 0}
8477 };
__Pyx_InitCachedBuiltins(void)8478 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
8479 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 122, __pyx_L1_error)
8480 __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 166, __pyx_L1_error)
8481 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 168, __pyx_L1_error)
8482 __pyx_builtin_reversed = __Pyx_GetBuiltinName(__pyx_n_s_reversed); if (!__pyx_builtin_reversed) __PYX_ERR(0, 252, __pyx_L1_error)
8483 __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 256, __pyx_L1_error)
8484 __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 263, __pyx_L1_error)
8485 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
8486 return 0;
8487 __pyx_L1_error:;
8488 return -1;
8489 }
8490
__Pyx_InitCachedConstants(void)8491 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
8492 __Pyx_RefNannyDeclarations
8493 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
8494
8495 /* "gssapi/raw/ext_dce.pyx":122
8496 * if isinstance(buff_desc, tuple):
8497 * if len(buff_desc) > 3 or len(buff_desc) < 2:
8498 * raise ValueError("Buffer description tuples must be " # <<<<<<<<<<<<<<
8499 * "length 2 or 3")
8500 *
8501 */
8502 __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Buffer_description_tuples_must_b); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 122, __pyx_L1_error)
8503 __Pyx_GOTREF(__pyx_tuple_);
8504 __Pyx_GIVEREF(__pyx_tuple_);
8505
8506 /* "gssapi/raw/ext_dce.pyx":166
8507 * self.iov_len, sizeof(gss_iov_buffer_desc))
8508 * if self._iov is NULL:
8509 * raise MemoryError("Cannot calloc for IOV buffer array") # <<<<<<<<<<<<<<
8510 *
8511 * for i in range(self.iov_len):
8512 */
8513 __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Cannot_calloc_for_IOV_buffer_arr); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 166, __pyx_L1_error)
8514 __Pyx_GOTREF(__pyx_tuple__2);
8515 __Pyx_GIVEREF(__pyx_tuple__2);
8516
8517 /* "gssapi/raw/ext_dce.pyx":185
8518 * self._iov[i].buffer.length)
8519 * if self._iov[i].buffer.value is NULL:
8520 * raise MemoryError("Cannot malloc for buffer value") # <<<<<<<<<<<<<<
8521 *
8522 * memcpy(self._iov[i].buffer.value, <char *>buff.value,
8523 */
8524 __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_Cannot_malloc_for_buffer_value); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 185, __pyx_L1_error)
8525 __Pyx_GOTREF(__pyx_tuple__3);
8526 __Pyx_GIVEREF(__pyx_tuple__3);
8527
8528 /* "(tree fragment)":2
8529 * def __reduce_cython__(self):
8530 * raise TypeError("self._iov cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
8531 * def __setstate_cython__(self, __pyx_state):
8532 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
8533 */
8534 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_self__iov_cannot_be_converted_to); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(1, 2, __pyx_L1_error)
8535 __Pyx_GOTREF(__pyx_tuple__8);
8536 __Pyx_GIVEREF(__pyx_tuple__8);
8537
8538 /* "(tree fragment)":4
8539 * raise TypeError("self._iov cannot be converted to a Python object for pickling")
8540 * def __setstate_cython__(self, __pyx_state):
8541 * raise TypeError("self._iov cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
8542 */
8543 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_self__iov_cannot_be_converted_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 4, __pyx_L1_error)
8544 __Pyx_GOTREF(__pyx_tuple__9);
8545 __Pyx_GIVEREF(__pyx_tuple__9);
8546
8547 /* "gssapi/raw/ext_dce.pyx":306
8548 *
8549 *
8550 * def wrap_iov(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
8551 * confidential=True, qop=None):
8552 * """
8553 */
8554 __pyx_tuple__10 = PyTuple_Pack(10, __pyx_n_s_context, __pyx_n_s_message, __pyx_n_s_confidential, __pyx_n_s_qop, __pyx_n_s_conf_req, __pyx_n_s_qop_req, __pyx_n_s_conf_used, __pyx_n_s_res_arr, __pyx_n_s_maj_stat, __pyx_n_s_min_stat); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 306, __pyx_L1_error)
8555 __Pyx_GOTREF(__pyx_tuple__10);
8556 __Pyx_GIVEREF(__pyx_tuple__10);
8557 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_ext_dce_pyx, __pyx_n_s_wrap_iov, 306, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 306, __pyx_L1_error)
8558
8559 /* "gssapi/raw/ext_dce.pyx":355
8560 *
8561 *
8562 * def unwrap_iov(SecurityContext context not None, IOV message not None): # <<<<<<<<<<<<<<
8563 * """
8564 * unwrap_iov(context, message)
8565 */
8566 __pyx_tuple__12 = PyTuple_Pack(7, __pyx_n_s_context, __pyx_n_s_message, __pyx_n_s_conf_used, __pyx_n_s_qop_used, __pyx_n_s_res_arr, __pyx_n_s_maj_stat, __pyx_n_s_min_stat); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 355, __pyx_L1_error)
8567 __Pyx_GOTREF(__pyx_tuple__12);
8568 __Pyx_GIVEREF(__pyx_tuple__12);
8569 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_ext_dce_pyx, __pyx_n_s_unwrap_iov, 355, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 355, __pyx_L1_error)
8570
8571 /* "gssapi/raw/ext_dce.pyx":404
8572 *
8573 *
8574 * def wrap_iov_length(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
8575 * confidential=True, qop=None):
8576 * """
8577 */
8578 __pyx_tuple__14 = PyTuple_Pack(10, __pyx_n_s_context, __pyx_n_s_message, __pyx_n_s_confidential, __pyx_n_s_qop, __pyx_n_s_conf_req, __pyx_n_s_qop_req, __pyx_n_s_conf_used, __pyx_n_s_res_arr, __pyx_n_s_maj_stat, __pyx_n_s_min_stat); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 404, __pyx_L1_error)
8579 __Pyx_GOTREF(__pyx_tuple__14);
8580 __Pyx_GIVEREF(__pyx_tuple__14);
8581 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_ext_dce_pyx, __pyx_n_s_wrap_iov_length, 404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 404, __pyx_L1_error)
8582
8583 /* "gssapi/raw/ext_dce.pyx":452
8584 *
8585 *
8586 * def wrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
8587 * bytes associated=None, confidential=True, qop=None):
8588 * """
8589 */
8590 __pyx_tuple__16 = PyTuple_Pack(15, __pyx_n_s_context, __pyx_n_s_message, __pyx_n_s_associated, __pyx_n_s_confidential, __pyx_n_s_qop, __pyx_n_s_conf_req, __pyx_n_s_qop_req, __pyx_n_s_message_buffer, __pyx_n_s_assoc_buffer_ptr, __pyx_n_s_assoc_buffer, __pyx_n_s_conf_used, __pyx_n_s_output_buffer, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_output_message); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 452, __pyx_L1_error)
8591 __Pyx_GOTREF(__pyx_tuple__16);
8592 __Pyx_GIVEREF(__pyx_tuple__16);
8593 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_ext_dce_pyx, __pyx_n_s_wrap_aead, 452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 452, __pyx_L1_error)
8594
8595 /* "gssapi/raw/ext_dce.pyx":508
8596 *
8597 *
8598 * def unwrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
8599 * bytes associated=None):
8600 * """
8601 */
8602 __pyx_tuple__18 = PyTuple_Pack(12, __pyx_n_s_context, __pyx_n_s_message, __pyx_n_s_associated, __pyx_n_s_input_buffer, __pyx_n_s_assoc_buffer_ptr, __pyx_n_s_assoc_buffer, __pyx_n_s_output_buffer, __pyx_n_s_conf_state, __pyx_n_s_qop_state, __pyx_n_s_maj_stat, __pyx_n_s_min_stat, __pyx_n_s_output_message); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 508, __pyx_L1_error)
8603 __Pyx_GOTREF(__pyx_tuple__18);
8604 __Pyx_GIVEREF(__pyx_tuple__18);
8605 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(3, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gssapi_raw_ext_dce_pyx, __pyx_n_s_unwrap_aead, 508, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 508, __pyx_L1_error)
8606 __Pyx_RefNannyFinishContext();
8607 return 0;
8608 __pyx_L1_error:;
8609 __Pyx_RefNannyFinishContext();
8610 return -1;
8611 }
8612
__Pyx_InitGlobals(void)8613 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
8614 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
8615 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
8616 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
8617 return 0;
8618 __pyx_L1_error:;
8619 return -1;
8620 }
8621
8622 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
8623 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
8624 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
8625 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
8626 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
8627 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
8628 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
8629
__Pyx_modinit_global_init_code(void)8630 static int __Pyx_modinit_global_init_code(void) {
8631 __Pyx_RefNannyDeclarations
8632 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
8633 /*--- Global init code ---*/
8634 __Pyx_RefNannyFinishContext();
8635 return 0;
8636 }
8637
__Pyx_modinit_variable_export_code(void)8638 static int __Pyx_modinit_variable_export_code(void) {
8639 __Pyx_RefNannyDeclarations
8640 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
8641 /*--- Variable export code ---*/
8642 __Pyx_RefNannyFinishContext();
8643 return 0;
8644 }
8645
__Pyx_modinit_function_export_code(void)8646 static int __Pyx_modinit_function_export_code(void) {
8647 __Pyx_RefNannyDeclarations
8648 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
8649 /*--- Function export code ---*/
8650 __Pyx_RefNannyFinishContext();
8651 return 0;
8652 }
8653
__Pyx_modinit_type_init_code(void)8654 static int __Pyx_modinit_type_init_code(void) {
8655 __Pyx_RefNannyDeclarations
8656 int __pyx_lineno = 0;
8657 const char *__pyx_filename = NULL;
8658 int __pyx_clineno = 0;
8659 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
8660 /*--- Type init code ---*/
8661 __pyx_vtabptr_6gssapi_3raw_7ext_dce_IOV = &__pyx_vtable_6gssapi_3raw_7ext_dce_IOV;
8662 __pyx_vtable_6gssapi_3raw_7ext_dce_IOV.__pyx___cvalue__ = (gss_iov_buffer_desc *(*)(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *))__pyx_f_6gssapi_3raw_7ext_dce_3IOV___cvalue__;
8663 __pyx_vtable_6gssapi_3raw_7ext_dce_IOV._recreate_python_values = (PyObject *(*)(struct __pyx_obj_6gssapi_3raw_7ext_dce_IOV *))__pyx_f_6gssapi_3raw_7ext_dce_3IOV__recreate_python_values;
8664 if (PyType_Ready(&__pyx_type_6gssapi_3raw_7ext_dce_IOV) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
8665 #if PY_VERSION_HEX < 0x030800B1
8666 __pyx_type_6gssapi_3raw_7ext_dce_IOV.tp_print = 0;
8667 #endif
8668 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gssapi_3raw_7ext_dce_IOV.tp_dictoffset && __pyx_type_6gssapi_3raw_7ext_dce_IOV.tp_getattro == PyObject_GenericGetAttr)) {
8669 __pyx_type_6gssapi_3raw_7ext_dce_IOV.tp_getattro = __Pyx_PyObject_GenericGetAttr;
8670 }
8671 if (__Pyx_SetVtable(__pyx_type_6gssapi_3raw_7ext_dce_IOV.tp_dict, __pyx_vtabptr_6gssapi_3raw_7ext_dce_IOV) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
8672 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_IOV, (PyObject *)&__pyx_type_6gssapi_3raw_7ext_dce_IOV) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
8673 if (__Pyx_setup_reduce((PyObject*)&__pyx_type_6gssapi_3raw_7ext_dce_IOV) < 0) __PYX_ERR(0, 94, __pyx_L1_error)
8674 __pyx_ptype_6gssapi_3raw_7ext_dce_IOV = &__pyx_type_6gssapi_3raw_7ext_dce_IOV;
8675 if (PyType_Ready(&__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__) < 0) __PYX_ERR(0, 235, __pyx_L1_error)
8676 #if PY_VERSION_HEX < 0x030800B1
8677 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__.tp_print = 0;
8678 #endif
8679 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__.tp_dictoffset && __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__.tp_getattro == PyObject_GenericGetAttr)) {
8680 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8681 }
8682 __pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__ = &__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct____iter__;
8683 if (PyType_Ready(&__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__) < 0) __PYX_ERR(0, 248, __pyx_L1_error)
8684 #if PY_VERSION_HEX < 0x030800B1
8685 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__.tp_print = 0;
8686 #endif
8687 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__.tp_dictoffset && __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__.tp_getattro == PyObject_GenericGetAttr)) {
8688 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8689 }
8690 __pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__ = &__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_1___reversed__;
8691 if (PyType_Ready(&__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count) < 0) __PYX_ERR(0, 262, __pyx_L1_error)
8692 #if PY_VERSION_HEX < 0x030800B1
8693 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count.tp_print = 0;
8694 #endif
8695 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count.tp_dictoffset && __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count.tp_getattro == PyObject_GenericGetAttr)) {
8696 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8697 }
8698 __pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count = &__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_2_count;
8699 if (PyType_Ready(&__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr) < 0) __PYX_ERR(0, 263, __pyx_L1_error)
8700 #if PY_VERSION_HEX < 0x030800B1
8701 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr.tp_print = 0;
8702 #endif
8703 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr.tp_dictoffset && __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
8704 __pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
8705 }
8706 __pyx_ptype_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr = &__pyx_type_6gssapi_3raw_7ext_dce___pyx_scope_struct_3_genexpr;
8707 __Pyx_RefNannyFinishContext();
8708 return 0;
8709 __pyx_L1_error:;
8710 __Pyx_RefNannyFinishContext();
8711 return -1;
8712 }
8713
__Pyx_modinit_type_import_code(void)8714 static int __Pyx_modinit_type_import_code(void) {
8715 __Pyx_RefNannyDeclarations
8716 PyObject *__pyx_t_1 = NULL;
8717 int __pyx_lineno = 0;
8718 const char *__pyx_filename = NULL;
8719 int __pyx_clineno = 0;
8720 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
8721 /*--- Type import code ---*/
8722 __pyx_t_1 = PyImport_ImportModule("gssapi.raw.sec_contexts"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
8723 __Pyx_GOTREF(__pyx_t_1);
8724 __pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext = __Pyx_ImportType(__pyx_t_1, "gssapi.raw.sec_contexts", "SecurityContext", sizeof(struct __pyx_obj_6gssapi_3raw_12sec_contexts_SecurityContext), __Pyx_ImportType_CheckSize_Warn);
8725 if (!__pyx_ptype_6gssapi_3raw_12sec_contexts_SecurityContext) __PYX_ERR(2, 3, __pyx_L1_error)
8726 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8727 __Pyx_RefNannyFinishContext();
8728 return 0;
8729 __pyx_L1_error:;
8730 __Pyx_XDECREF(__pyx_t_1);
8731 __Pyx_RefNannyFinishContext();
8732 return -1;
8733 }
8734
__Pyx_modinit_variable_import_code(void)8735 static int __Pyx_modinit_variable_import_code(void) {
8736 __Pyx_RefNannyDeclarations
8737 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
8738 /*--- Variable import code ---*/
8739 __Pyx_RefNannyFinishContext();
8740 return 0;
8741 }
8742
__Pyx_modinit_function_import_code(void)8743 static int __Pyx_modinit_function_import_code(void) {
8744 __Pyx_RefNannyDeclarations
8745 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
8746 /*--- Function import code ---*/
8747 __Pyx_RefNannyFinishContext();
8748 return 0;
8749 }
8750
8751
8752 #ifndef CYTHON_NO_PYINIT_EXPORT
8753 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
8754 #elif PY_MAJOR_VERSION < 3
8755 #ifdef __cplusplus
8756 #define __Pyx_PyMODINIT_FUNC extern "C" void
8757 #else
8758 #define __Pyx_PyMODINIT_FUNC void
8759 #endif
8760 #else
8761 #ifdef __cplusplus
8762 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
8763 #else
8764 #define __Pyx_PyMODINIT_FUNC PyObject *
8765 #endif
8766 #endif
8767
8768
8769 #if PY_MAJOR_VERSION < 3
8770 __Pyx_PyMODINIT_FUNC initext_dce(void) CYTHON_SMALL_CODE; /*proto*/
initext_dce(void)8771 __Pyx_PyMODINIT_FUNC initext_dce(void)
8772 #else
8773 __Pyx_PyMODINIT_FUNC PyInit_ext_dce(void) CYTHON_SMALL_CODE; /*proto*/
8774 __Pyx_PyMODINIT_FUNC PyInit_ext_dce(void)
8775 #if CYTHON_PEP489_MULTI_PHASE_INIT
8776 {
8777 return PyModuleDef_Init(&__pyx_moduledef);
8778 }
8779 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
8780 #if PY_VERSION_HEX >= 0x030700A1
8781 static PY_INT64_T main_interpreter_id = -1;
8782 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
8783 if (main_interpreter_id == -1) {
8784 main_interpreter_id = current_id;
8785 return (unlikely(current_id == -1)) ? -1 : 0;
8786 } else if (unlikely(main_interpreter_id != current_id))
8787 #else
8788 static PyInterpreterState *main_interpreter = NULL;
8789 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
8790 if (!main_interpreter) {
8791 main_interpreter = current_interpreter;
8792 } else if (unlikely(main_interpreter != current_interpreter))
8793 #endif
8794 {
8795 PyErr_SetString(
8796 PyExc_ImportError,
8797 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
8798 return -1;
8799 }
8800 return 0;
8801 }
8802 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) {
8803 PyObject *value = PyObject_GetAttrString(spec, from_name);
8804 int result = 0;
8805 if (likely(value)) {
8806 if (allow_none || value != Py_None) {
8807 result = PyDict_SetItemString(moddict, to_name, value);
8808 }
8809 Py_DECREF(value);
8810 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
8811 PyErr_Clear();
8812 } else {
8813 result = -1;
8814 }
8815 return result;
8816 }
8817 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
8818 PyObject *module = NULL, *moddict, *modname;
8819 if (__Pyx_check_single_interpreter())
8820 return NULL;
8821 if (__pyx_m)
8822 return __Pyx_NewRef(__pyx_m);
8823 modname = PyObject_GetAttrString(spec, "name");
8824 if (unlikely(!modname)) goto bad;
8825 module = PyModule_NewObject(modname);
8826 Py_DECREF(modname);
8827 if (unlikely(!module)) goto bad;
8828 moddict = PyModule_GetDict(module);
8829 if (unlikely(!moddict)) goto bad;
8830 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
8831 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
8832 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
8833 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
8834 return module;
8835 bad:
8836 Py_XDECREF(module);
8837 return NULL;
8838 }
8839
8840
8841 static CYTHON_SMALL_CODE int __pyx_pymod_exec_ext_dce(PyObject *__pyx_pyinit_module)
8842 #endif
8843 #endif
8844 {
8845 PyObject *__pyx_t_1 = NULL;
8846 PyObject *__pyx_t_2 = NULL;
8847 PyObject *__pyx_t_3 = NULL;
8848 PyObject *__pyx_t_4 = NULL;
8849 PyObject *__pyx_t_5 = NULL;
8850 int __pyx_lineno = 0;
8851 const char *__pyx_filename = NULL;
8852 int __pyx_clineno = 0;
8853 __Pyx_RefNannyDeclarations
8854 #if CYTHON_PEP489_MULTI_PHASE_INIT
8855 if (__pyx_m) {
8856 if (__pyx_m == __pyx_pyinit_module) return 0;
8857 PyErr_SetString(PyExc_RuntimeError, "Module 'ext_dce' has already been imported. Re-initialisation is not supported.");
8858 return -1;
8859 }
8860 #elif PY_MAJOR_VERSION >= 3
8861 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
8862 #endif
8863 #if CYTHON_REFNANNY
8864 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
8865 if (!__Pyx_RefNanny) {
8866 PyErr_Clear();
8867 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
8868 if (!__Pyx_RefNanny)
8869 Py_FatalError("failed to import 'refnanny' module");
8870 }
8871 #endif
8872 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_ext_dce(void)", 0);
8873 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8874 #ifdef __Pxy_PyFrame_Initialize_Offsets
8875 __Pxy_PyFrame_Initialize_Offsets();
8876 #endif
8877 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
8878 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
8879 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
8880 #ifdef __Pyx_CyFunction_USED
8881 if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8882 #endif
8883 #ifdef __Pyx_FusedFunction_USED
8884 if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8885 #endif
8886 #ifdef __Pyx_Coroutine_USED
8887 if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8888 #endif
8889 #ifdef __Pyx_Generator_USED
8890 if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8891 #endif
8892 #ifdef __Pyx_AsyncGen_USED
8893 if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8894 #endif
8895 #ifdef __Pyx_StopAsyncIteration_USED
8896 if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8897 #endif
8898 /*--- Library function declarations ---*/
8899 /*--- Threads initialization code ---*/
8900 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
8901 #ifdef WITH_THREAD /* Python build with threading support? */
8902 PyEval_InitThreads();
8903 #endif
8904 #endif
8905 /*--- Module creation code ---*/
8906 #if CYTHON_PEP489_MULTI_PHASE_INIT
8907 __pyx_m = __pyx_pyinit_module;
8908 Py_INCREF(__pyx_m);
8909 #else
8910 #if PY_MAJOR_VERSION < 3
8911 __pyx_m = Py_InitModule4("ext_dce", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
8912 #else
8913 __pyx_m = PyModule_Create(&__pyx_moduledef);
8914 #endif
8915 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
8916 #endif
8917 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
8918 Py_INCREF(__pyx_d);
8919 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
8920 Py_INCREF(__pyx_b);
8921 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
8922 Py_INCREF(__pyx_cython_runtime);
8923 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
8924 /*--- Initialize various global constants etc. ---*/
8925 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8926 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
8927 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8928 #endif
8929 if (__pyx_module_is_main_gssapi__raw__ext_dce) {
8930 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8931 }
8932 #if PY_MAJOR_VERSION >= 3
8933 {
8934 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
8935 if (!PyDict_GetItemString(modules, "gssapi.raw.ext_dce")) {
8936 if (unlikely(PyDict_SetItemString(modules, "gssapi.raw.ext_dce", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
8937 }
8938 }
8939 #endif
8940 /*--- Builtin init code ---*/
8941 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8942 /*--- Constants init code ---*/
8943 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8944 /*--- Global type/function init code ---*/
8945 (void)__Pyx_modinit_global_init_code();
8946 (void)__Pyx_modinit_variable_export_code();
8947 (void)__Pyx_modinit_function_export_code();
8948 if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
8949 if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
8950 (void)__Pyx_modinit_variable_import_code();
8951 (void)__Pyx_modinit_function_import_code();
8952 /*--- Execution code ---*/
8953 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
8954 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8955 #endif
8956
8957 /* "gssapi/raw/ext_dce.pyx":1
8958 * GSSAPI="BASE" # This ensures that a full module is generated by Cython # <<<<<<<<<<<<<<
8959 *
8960 * from libc.stdlib cimport malloc, calloc, free
8961 */
8962 if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSAPI, __pyx_n_s_BASE) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
8963
8964 /* "gssapi/raw/ext_dce.pyx":9
8965 * from gssapi.raw.sec_contexts cimport SecurityContext
8966 *
8967 * from gssapi.raw.misc import GSSError # <<<<<<<<<<<<<<
8968 * from gssapi.raw import types as gssapi_types
8969 * from gssapi.raw.named_tuples import IOVUnwrapResult, WrapResult, UnwrapResult
8970 */
8971 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
8972 __Pyx_GOTREF(__pyx_t_1);
8973 __Pyx_INCREF(__pyx_n_s_GSSError);
8974 __Pyx_GIVEREF(__pyx_n_s_GSSError);
8975 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_GSSError);
8976 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gssapi_raw_misc, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
8977 __Pyx_GOTREF(__pyx_t_2);
8978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8979 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_GSSError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 9, __pyx_L1_error)
8980 __Pyx_GOTREF(__pyx_t_1);
8981 if (PyDict_SetItem(__pyx_d, __pyx_n_s_GSSError, __pyx_t_1) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
8982 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8983 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8984
8985 /* "gssapi/raw/ext_dce.pyx":10
8986 *
8987 * from gssapi.raw.misc import GSSError
8988 * from gssapi.raw import types as gssapi_types # <<<<<<<<<<<<<<
8989 * from gssapi.raw.named_tuples import IOVUnwrapResult, WrapResult, UnwrapResult
8990 * from collections import namedtuple
8991 */
8992 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
8993 __Pyx_GOTREF(__pyx_t_2);
8994 __Pyx_INCREF(__pyx_n_s_types);
8995 __Pyx_GIVEREF(__pyx_n_s_types);
8996 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_types);
8997 __pyx_t_1 = __Pyx_Import(__pyx_n_s_gssapi_raw, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
8998 __Pyx_GOTREF(__pyx_t_1);
8999 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9000 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_types); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
9001 __Pyx_GOTREF(__pyx_t_2);
9002 if (PyDict_SetItem(__pyx_d, __pyx_n_s_gssapi_types, __pyx_t_2) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
9003 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9004 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9005
9006 /* "gssapi/raw/ext_dce.pyx":11
9007 * from gssapi.raw.misc import GSSError
9008 * from gssapi.raw import types as gssapi_types
9009 * from gssapi.raw.named_tuples import IOVUnwrapResult, WrapResult, UnwrapResult # <<<<<<<<<<<<<<
9010 * from collections import namedtuple
9011 * from collections.abc import Sequence
9012 */
9013 __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9014 __Pyx_GOTREF(__pyx_t_1);
9015 __Pyx_INCREF(__pyx_n_s_IOVUnwrapResult);
9016 __Pyx_GIVEREF(__pyx_n_s_IOVUnwrapResult);
9017 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_IOVUnwrapResult);
9018 __Pyx_INCREF(__pyx_n_s_WrapResult);
9019 __Pyx_GIVEREF(__pyx_n_s_WrapResult);
9020 PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_WrapResult);
9021 __Pyx_INCREF(__pyx_n_s_UnwrapResult);
9022 __Pyx_GIVEREF(__pyx_n_s_UnwrapResult);
9023 PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_UnwrapResult);
9024 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gssapi_raw_named_tuples, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
9025 __Pyx_GOTREF(__pyx_t_2);
9026 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9027 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_IOVUnwrapResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9028 __Pyx_GOTREF(__pyx_t_1);
9029 if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOVUnwrapResult, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
9030 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9031 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_WrapResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9032 __Pyx_GOTREF(__pyx_t_1);
9033 if (PyDict_SetItem(__pyx_d, __pyx_n_s_WrapResult, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
9034 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9035 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_UnwrapResult); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9036 __Pyx_GOTREF(__pyx_t_1);
9037 if (PyDict_SetItem(__pyx_d, __pyx_n_s_UnwrapResult, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
9038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9039 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9040
9041 /* "gssapi/raw/ext_dce.pyx":12
9042 * from gssapi.raw import types as gssapi_types
9043 * from gssapi.raw.named_tuples import IOVUnwrapResult, WrapResult, UnwrapResult
9044 * from collections import namedtuple # <<<<<<<<<<<<<<
9045 * from collections.abc import Sequence
9046 *
9047 */
9048 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
9049 __Pyx_GOTREF(__pyx_t_2);
9050 __Pyx_INCREF(__pyx_n_s_namedtuple);
9051 __Pyx_GIVEREF(__pyx_n_s_namedtuple);
9052 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_namedtuple);
9053 __pyx_t_1 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
9054 __Pyx_GOTREF(__pyx_t_1);
9055 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9056 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
9057 __Pyx_GOTREF(__pyx_t_2);
9058 if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
9059 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9060 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9061
9062 /* "gssapi/raw/ext_dce.pyx":13
9063 * from gssapi.raw.named_tuples import IOVUnwrapResult, WrapResult, UnwrapResult
9064 * from collections import namedtuple
9065 * from collections.abc import Sequence # <<<<<<<<<<<<<<
9066 *
9067 * from enum import IntEnum
9068 */
9069 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
9070 __Pyx_GOTREF(__pyx_t_1);
9071 __Pyx_INCREF(__pyx_n_s_Sequence);
9072 __Pyx_GIVEREF(__pyx_n_s_Sequence);
9073 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Sequence);
9074 __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections_abc, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
9075 __Pyx_GOTREF(__pyx_t_2);
9076 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9077 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Sequence); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
9078 __Pyx_GOTREF(__pyx_t_1);
9079 if (PyDict_SetItem(__pyx_d, __pyx_n_s_Sequence, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
9080 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9081 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9082
9083 /* "gssapi/raw/ext_dce.pyx":15
9084 * from collections.abc import Sequence
9085 *
9086 * from enum import IntEnum # <<<<<<<<<<<<<<
9087 * from gssapi.raw._enum_extensions import ExtendableEnum
9088 *
9089 */
9090 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
9091 __Pyx_GOTREF(__pyx_t_2);
9092 __Pyx_INCREF(__pyx_n_s_IntEnum);
9093 __Pyx_GIVEREF(__pyx_n_s_IntEnum);
9094 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_IntEnum);
9095 __pyx_t_1 = __Pyx_Import(__pyx_n_s_enum, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
9096 __Pyx_GOTREF(__pyx_t_1);
9097 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9098 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
9099 __Pyx_GOTREF(__pyx_t_2);
9100 if (PyDict_SetItem(__pyx_d, __pyx_n_s_IntEnum, __pyx_t_2) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
9101 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9102 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9103
9104 /* "gssapi/raw/ext_dce.pyx":16
9105 *
9106 * from enum import IntEnum
9107 * from gssapi.raw._enum_extensions import ExtendableEnum # <<<<<<<<<<<<<<
9108 *
9109 *
9110 */
9111 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
9112 __Pyx_GOTREF(__pyx_t_1);
9113 __Pyx_INCREF(__pyx_n_s_ExtendableEnum);
9114 __Pyx_GIVEREF(__pyx_n_s_ExtendableEnum);
9115 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ExtendableEnum);
9116 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gssapi_raw__enum_extensions, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
9117 __Pyx_GOTREF(__pyx_t_2);
9118 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9119 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ExtendableEnum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
9120 __Pyx_GOTREF(__pyx_t_1);
9121 if (PyDict_SetItem(__pyx_d, __pyx_n_s_ExtendableEnum, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
9122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9123 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9124
9125 /* "gssapi/raw/ext_dce.pyx":70
9126 *
9127 *
9128 * class IOVBufferType(IntEnum, metaclass=ExtendableEnum): # <<<<<<<<<<<<<<
9129 * """
9130 * IOV Buffer Types
9131 */
9132 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IntEnum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
9133 __Pyx_GOTREF(__pyx_t_2);
9134 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
9135 __Pyx_GOTREF(__pyx_t_1);
9136 __Pyx_GIVEREF(__pyx_t_2);
9137 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
9138 __pyx_t_2 = 0;
9139 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
9140 __Pyx_GOTREF(__pyx_t_2);
9141 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_ExtendableEnum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 70, __pyx_L1_error)
9142 __Pyx_GOTREF(__pyx_t_3);
9143 __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_1, __pyx_n_s_IOVBufferType, __pyx_n_s_IOVBufferType, __pyx_t_2, __pyx_n_s_gssapi_raw_ext_dce, __pyx_kp_s_IOV_Buffer_Types_This_IntEnum_r); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 70, __pyx_L1_error)
9144 __Pyx_GOTREF(__pyx_t_4);
9145
9146 /* "gssapi/raw/ext_dce.pyx":81
9147 * """
9148 *
9149 * empty = GSS_IOV_BUFFER_TYPE_EMPTY # <<<<<<<<<<<<<<
9150 * data = GSS_IOV_BUFFER_TYPE_DATA
9151 * header = GSS_IOV_BUFFER_TYPE_HEADER
9152 */
9153 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_EMPTY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 81, __pyx_L1_error)
9154 __Pyx_GOTREF(__pyx_t_5);
9155 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_empty_2, __pyx_t_5) < 0) __PYX_ERR(0, 81, __pyx_L1_error)
9156 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9157
9158 /* "gssapi/raw/ext_dce.pyx":82
9159 *
9160 * empty = GSS_IOV_BUFFER_TYPE_EMPTY
9161 * data = GSS_IOV_BUFFER_TYPE_DATA # <<<<<<<<<<<<<<
9162 * header = GSS_IOV_BUFFER_TYPE_HEADER
9163 * mech_params = GSS_IOV_BUFFER_TYPE_MECH_PARAMS
9164 */
9165 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_DATA); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 82, __pyx_L1_error)
9166 __Pyx_GOTREF(__pyx_t_5);
9167 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_data, __pyx_t_5) < 0) __PYX_ERR(0, 82, __pyx_L1_error)
9168 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9169
9170 /* "gssapi/raw/ext_dce.pyx":83
9171 * empty = GSS_IOV_BUFFER_TYPE_EMPTY
9172 * data = GSS_IOV_BUFFER_TYPE_DATA
9173 * header = GSS_IOV_BUFFER_TYPE_HEADER # <<<<<<<<<<<<<<
9174 * mech_params = GSS_IOV_BUFFER_TYPE_MECH_PARAMS
9175 * trailer = GSS_IOV_BUFFER_TYPE_TRAILER
9176 */
9177 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_HEADER); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 83, __pyx_L1_error)
9178 __Pyx_GOTREF(__pyx_t_5);
9179 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_header, __pyx_t_5) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
9180 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9181
9182 /* "gssapi/raw/ext_dce.pyx":84
9183 * data = GSS_IOV_BUFFER_TYPE_DATA
9184 * header = GSS_IOV_BUFFER_TYPE_HEADER
9185 * mech_params = GSS_IOV_BUFFER_TYPE_MECH_PARAMS # <<<<<<<<<<<<<<
9186 * trailer = GSS_IOV_BUFFER_TYPE_TRAILER
9187 * padding = GSS_IOV_BUFFER_TYPE_PADDING
9188 */
9189 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_MECH_PARAMS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 84, __pyx_L1_error)
9190 __Pyx_GOTREF(__pyx_t_5);
9191 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_mech_params, __pyx_t_5) < 0) __PYX_ERR(0, 84, __pyx_L1_error)
9192 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9193
9194 /* "gssapi/raw/ext_dce.pyx":85
9195 * header = GSS_IOV_BUFFER_TYPE_HEADER
9196 * mech_params = GSS_IOV_BUFFER_TYPE_MECH_PARAMS
9197 * trailer = GSS_IOV_BUFFER_TYPE_TRAILER # <<<<<<<<<<<<<<
9198 * padding = GSS_IOV_BUFFER_TYPE_PADDING
9199 * stream = GSS_IOV_BUFFER_TYPE_STREAM
9200 */
9201 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_TRAILER); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 85, __pyx_L1_error)
9202 __Pyx_GOTREF(__pyx_t_5);
9203 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_trailer, __pyx_t_5) < 0) __PYX_ERR(0, 85, __pyx_L1_error)
9204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9205
9206 /* "gssapi/raw/ext_dce.pyx":86
9207 * mech_params = GSS_IOV_BUFFER_TYPE_MECH_PARAMS
9208 * trailer = GSS_IOV_BUFFER_TYPE_TRAILER
9209 * padding = GSS_IOV_BUFFER_TYPE_PADDING # <<<<<<<<<<<<<<
9210 * stream = GSS_IOV_BUFFER_TYPE_STREAM
9211 * sign_only = GSS_IOV_BUFFER_TYPE_SIGN_ONLY
9212 */
9213 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_PADDING); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
9214 __Pyx_GOTREF(__pyx_t_5);
9215 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_padding, __pyx_t_5) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
9216 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9217
9218 /* "gssapi/raw/ext_dce.pyx":87
9219 * trailer = GSS_IOV_BUFFER_TYPE_TRAILER
9220 * padding = GSS_IOV_BUFFER_TYPE_PADDING
9221 * stream = GSS_IOV_BUFFER_TYPE_STREAM # <<<<<<<<<<<<<<
9222 * sign_only = GSS_IOV_BUFFER_TYPE_SIGN_ONLY
9223 *
9224 */
9225 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_STREAM); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 87, __pyx_L1_error)
9226 __Pyx_GOTREF(__pyx_t_5);
9227 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_stream, __pyx_t_5) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
9228 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9229
9230 /* "gssapi/raw/ext_dce.pyx":88
9231 * padding = GSS_IOV_BUFFER_TYPE_PADDING
9232 * stream = GSS_IOV_BUFFER_TYPE_STREAM
9233 * sign_only = GSS_IOV_BUFFER_TYPE_SIGN_ONLY # <<<<<<<<<<<<<<
9234 *
9235 *
9236 */
9237 __pyx_t_5 = __Pyx_PyInt_From_uint32_t(GSS_IOV_BUFFER_TYPE_SIGN_ONLY); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
9238 __Pyx_GOTREF(__pyx_t_5);
9239 if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_sign_only, __pyx_t_5) < 0) __PYX_ERR(0, 88, __pyx_L1_error)
9240 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9241
9242 /* "gssapi/raw/ext_dce.pyx":70
9243 *
9244 *
9245 * class IOVBufferType(IntEnum, metaclass=ExtendableEnum): # <<<<<<<<<<<<<<
9246 * """
9247 * IOV Buffer Types
9248 */
9249 __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_IOVBufferType, __pyx_t_1, __pyx_t_4, __pyx_t_2, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 70, __pyx_L1_error)
9250 __Pyx_GOTREF(__pyx_t_5);
9251 if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOVBufferType, __pyx_t_5) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
9252 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9253 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9254 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9255 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9256 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9257
9258 /* "gssapi/raw/ext_dce.pyx":91
9259 *
9260 *
9261 * IOVBuffer = namedtuple('IOVBuffer', ['type', 'allocate', 'value']) # <<<<<<<<<<<<<<
9262 *
9263 *
9264 */
9265 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_namedtuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
9266 __Pyx_GOTREF(__pyx_t_1);
9267 __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
9268 __Pyx_GOTREF(__pyx_t_2);
9269 __Pyx_INCREF(__pyx_n_s_type);
9270 __Pyx_GIVEREF(__pyx_n_s_type);
9271 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_type);
9272 __Pyx_INCREF(__pyx_n_s_allocate);
9273 __Pyx_GIVEREF(__pyx_n_s_allocate);
9274 PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_allocate);
9275 __Pyx_INCREF(__pyx_n_s_value);
9276 __Pyx_GIVEREF(__pyx_n_s_value);
9277 PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_value);
9278 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
9279 __Pyx_GOTREF(__pyx_t_3);
9280 __Pyx_INCREF(__pyx_n_s_IOVBuffer);
9281 __Pyx_GIVEREF(__pyx_n_s_IOVBuffer);
9282 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_IOVBuffer);
9283 __Pyx_GIVEREF(__pyx_t_2);
9284 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
9285 __pyx_t_2 = 0;
9286 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
9287 __Pyx_GOTREF(__pyx_t_2);
9288 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9289 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9290 if (PyDict_SetItem(__pyx_d, __pyx_n_s_IOVBuffer, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
9291 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9292
9293 /* "gssapi/raw/ext_dce.pyx":105
9294 * # cdef list _buffs
9295 *
9296 * AUTO_ALLOC_BUFFERS = set([IOVBufferType.header, IOVBufferType.padding, # <<<<<<<<<<<<<<
9297 * IOVBufferType.trailer])
9298 *
9299 */
9300 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
9301 __Pyx_GOTREF(__pyx_t_2);
9302 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_header); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
9303 __Pyx_GOTREF(__pyx_t_3);
9304 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9305 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
9306 __Pyx_GOTREF(__pyx_t_2);
9307 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_padding); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 105, __pyx_L1_error)
9308 __Pyx_GOTREF(__pyx_t_1);
9309 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9310
9311 /* "gssapi/raw/ext_dce.pyx":106
9312 *
9313 * AUTO_ALLOC_BUFFERS = set([IOVBufferType.header, IOVBufferType.padding,
9314 * IOVBufferType.trailer]) # <<<<<<<<<<<<<<
9315 *
9316 * def __init__(IOV self, *args, std_layout=True, auto_alloc=True):
9317 */
9318 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_IOVBufferType); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 106, __pyx_L1_error)
9319 __Pyx_GOTREF(__pyx_t_2);
9320 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_trailer); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
9321 __Pyx_GOTREF(__pyx_t_4);
9322 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9323 __pyx_t_2 = PySet_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
9324 __Pyx_GOTREF(__pyx_t_2);
9325 if (PySet_Add(__pyx_t_2, __pyx_t_3) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
9326 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9327 if (PySet_Add(__pyx_t_2, __pyx_t_1) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
9328 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9329 if (PySet_Add(__pyx_t_2, __pyx_t_4) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
9330 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9331 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gssapi_3raw_7ext_dce_IOV->tp_dict, __pyx_n_s_AUTO_ALLOC_BUFFERS, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
9332 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9333 PyType_Modified(__pyx_ptype_6gssapi_3raw_7ext_dce_IOV);
9334
9335 /* "gssapi/raw/ext_dce.pyx":306
9336 *
9337 *
9338 * def wrap_iov(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
9339 * confidential=True, qop=None):
9340 * """
9341 */
9342 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_7ext_dce_1wrap_iov, NULL, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 306, __pyx_L1_error)
9343 __Pyx_GOTREF(__pyx_t_2);
9344 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wrap_iov, __pyx_t_2) < 0) __PYX_ERR(0, 306, __pyx_L1_error)
9345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9346
9347 /* "gssapi/raw/ext_dce.pyx":355
9348 *
9349 *
9350 * def unwrap_iov(SecurityContext context not None, IOV message not None): # <<<<<<<<<<<<<<
9351 * """
9352 * unwrap_iov(context, message)
9353 */
9354 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_7ext_dce_3unwrap_iov, NULL, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
9355 __Pyx_GOTREF(__pyx_t_2);
9356 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unwrap_iov, __pyx_t_2) < 0) __PYX_ERR(0, 355, __pyx_L1_error)
9357 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9358
9359 /* "gssapi/raw/ext_dce.pyx":404
9360 *
9361 *
9362 * def wrap_iov_length(SecurityContext context not None, IOV message not None, # <<<<<<<<<<<<<<
9363 * confidential=True, qop=None):
9364 * """
9365 */
9366 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_7ext_dce_5wrap_iov_length, NULL, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 404, __pyx_L1_error)
9367 __Pyx_GOTREF(__pyx_t_2);
9368 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wrap_iov_length, __pyx_t_2) < 0) __PYX_ERR(0, 404, __pyx_L1_error)
9369 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9370
9371 /* "gssapi/raw/ext_dce.pyx":452
9372 *
9373 *
9374 * def wrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
9375 * bytes associated=None, confidential=True, qop=None):
9376 * """
9377 */
9378 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_7ext_dce_7wrap_aead, NULL, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
9379 __Pyx_GOTREF(__pyx_t_2);
9380 if (PyDict_SetItem(__pyx_d, __pyx_n_s_wrap_aead, __pyx_t_2) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
9381 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9382
9383 /* "gssapi/raw/ext_dce.pyx":508
9384 *
9385 *
9386 * def unwrap_aead(SecurityContext context not None, bytes message not None, # <<<<<<<<<<<<<<
9387 * bytes associated=None):
9388 * """
9389 */
9390 __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gssapi_3raw_7ext_dce_9unwrap_aead, NULL, __pyx_n_s_gssapi_raw_ext_dce); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
9391 __Pyx_GOTREF(__pyx_t_2);
9392 if (PyDict_SetItem(__pyx_d, __pyx_n_s_unwrap_aead, __pyx_t_2) < 0) __PYX_ERR(0, 508, __pyx_L1_error)
9393 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9394
9395 /* "gssapi/raw/ext_dce.pyx":1
9396 * GSSAPI="BASE" # This ensures that a full module is generated by Cython # <<<<<<<<<<<<<<
9397 *
9398 * from libc.stdlib cimport malloc, calloc, free
9399 */
9400 __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
9401 __Pyx_GOTREF(__pyx_t_2);
9402 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9403 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9404
9405 /*--- Wrapped vars code ---*/
9406
9407 goto __pyx_L0;
9408 __pyx_L1_error:;
9409 __Pyx_XDECREF(__pyx_t_1);
9410 __Pyx_XDECREF(__pyx_t_2);
9411 __Pyx_XDECREF(__pyx_t_3);
9412 __Pyx_XDECREF(__pyx_t_4);
9413 __Pyx_XDECREF(__pyx_t_5);
9414 if (__pyx_m) {
9415 if (__pyx_d) {
9416 __Pyx_AddTraceback("init gssapi.raw.ext_dce", __pyx_clineno, __pyx_lineno, __pyx_filename);
9417 }
9418 Py_CLEAR(__pyx_m);
9419 } else if (!PyErr_Occurred()) {
9420 PyErr_SetString(PyExc_ImportError, "init gssapi.raw.ext_dce");
9421 }
9422 __pyx_L0:;
9423 __Pyx_RefNannyFinishContext();
9424 #if CYTHON_PEP489_MULTI_PHASE_INIT
9425 return (__pyx_m != NULL) ? 0 : -1;
9426 #elif PY_MAJOR_VERSION >= 3
9427 return __pyx_m;
9428 #else
9429 return;
9430 #endif
9431 }
9432
9433 /* --- Runtime support code --- */
9434 /* Refnanny */
9435 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)9436 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
9437 PyObject *m = NULL, *p = NULL;
9438 void *r = NULL;
9439 m = PyImport_ImportModule(modname);
9440 if (!m) goto end;
9441 p = PyObject_GetAttrString(m, "RefNannyAPI");
9442 if (!p) goto end;
9443 r = PyLong_AsVoidPtr(p);
9444 end:
9445 Py_XDECREF(p);
9446 Py_XDECREF(m);
9447 return (__Pyx_RefNannyAPIStruct *)r;
9448 }
9449 #endif
9450
9451 /* PyObjectGetAttrStr */
9452 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)9453 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
9454 PyTypeObject* tp = Py_TYPE(obj);
9455 if (likely(tp->tp_getattro))
9456 return tp->tp_getattro(obj, attr_name);
9457 #if PY_MAJOR_VERSION < 3
9458 if (likely(tp->tp_getattr))
9459 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
9460 #endif
9461 return PyObject_GetAttr(obj, attr_name);
9462 }
9463 #endif
9464
9465 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)9466 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
9467 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
9468 if (unlikely(!result)) {
9469 PyErr_Format(PyExc_NameError,
9470 #if PY_MAJOR_VERSION >= 3
9471 "name '%U' is not defined", name);
9472 #else
9473 "name '%.200s' is not defined", PyString_AS_STRING(name));
9474 #endif
9475 }
9476 return result;
9477 }
9478
9479 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)9480 static void __Pyx_RaiseDoubleKeywordsError(
9481 const char* func_name,
9482 PyObject* kw_name)
9483 {
9484 PyErr_Format(PyExc_TypeError,
9485 #if PY_MAJOR_VERSION >= 3
9486 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
9487 #else
9488 "%s() got multiple values for keyword argument '%s'", func_name,
9489 PyString_AsString(kw_name));
9490 #endif
9491 }
9492
9493 /* ParseKeywords */
__Pyx_ParseOptionalKeywords(PyObject * kwds,PyObject ** argnames[],PyObject * kwds2,PyObject * values[],Py_ssize_t num_pos_args,const char * function_name)9494 static int __Pyx_ParseOptionalKeywords(
9495 PyObject *kwds,
9496 PyObject **argnames[],
9497 PyObject *kwds2,
9498 PyObject *values[],
9499 Py_ssize_t num_pos_args,
9500 const char* function_name)
9501 {
9502 PyObject *key = 0, *value = 0;
9503 Py_ssize_t pos = 0;
9504 PyObject*** name;
9505 PyObject*** first_kw_arg = argnames + num_pos_args;
9506 while (PyDict_Next(kwds, &pos, &key, &value)) {
9507 name = first_kw_arg;
9508 while (*name && (**name != key)) name++;
9509 if (*name) {
9510 values[name-argnames] = value;
9511 continue;
9512 }
9513 name = first_kw_arg;
9514 #if PY_MAJOR_VERSION < 3
9515 if (likely(PyString_Check(key))) {
9516 while (*name) {
9517 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
9518 && _PyString_Eq(**name, key)) {
9519 values[name-argnames] = value;
9520 break;
9521 }
9522 name++;
9523 }
9524 if (*name) continue;
9525 else {
9526 PyObject*** argname = argnames;
9527 while (argname != first_kw_arg) {
9528 if ((**argname == key) || (
9529 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
9530 && _PyString_Eq(**argname, key))) {
9531 goto arg_passed_twice;
9532 }
9533 argname++;
9534 }
9535 }
9536 } else
9537 #endif
9538 if (likely(PyUnicode_Check(key))) {
9539 while (*name) {
9540 int cmp = (**name == key) ? 0 :
9541 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9542 (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9543 #endif
9544 PyUnicode_Compare(**name, key);
9545 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9546 if (cmp == 0) {
9547 values[name-argnames] = value;
9548 break;
9549 }
9550 name++;
9551 }
9552 if (*name) continue;
9553 else {
9554 PyObject*** argname = argnames;
9555 while (argname != first_kw_arg) {
9556 int cmp = (**argname == key) ? 0 :
9557 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
9558 (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
9559 #endif
9560 PyUnicode_Compare(**argname, key);
9561 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
9562 if (cmp == 0) goto arg_passed_twice;
9563 argname++;
9564 }
9565 }
9566 } else
9567 goto invalid_keyword_type;
9568 if (kwds2) {
9569 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
9570 } else {
9571 goto invalid_keyword;
9572 }
9573 }
9574 return 0;
9575 arg_passed_twice:
9576 __Pyx_RaiseDoubleKeywordsError(function_name, key);
9577 goto bad;
9578 invalid_keyword_type:
9579 PyErr_Format(PyExc_TypeError,
9580 "%.200s() keywords must be strings", function_name);
9581 goto bad;
9582 invalid_keyword:
9583 PyErr_Format(PyExc_TypeError,
9584 #if PY_MAJOR_VERSION < 3
9585 "%.200s() got an unexpected keyword argument '%.200s'",
9586 function_name, PyString_AsString(key));
9587 #else
9588 "%s() got an unexpected keyword argument '%U'",
9589 function_name, key);
9590 #endif
9591 bad:
9592 return -1;
9593 }
9594
9595 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)9596 static void __Pyx_RaiseArgtupleInvalid(
9597 const char* func_name,
9598 int exact,
9599 Py_ssize_t num_min,
9600 Py_ssize_t num_max,
9601 Py_ssize_t num_found)
9602 {
9603 Py_ssize_t num_expected;
9604 const char *more_or_less;
9605 if (num_found < num_min) {
9606 num_expected = num_min;
9607 more_or_less = "at least";
9608 } else {
9609 num_expected = num_max;
9610 more_or_less = "at most";
9611 }
9612 if (exact) {
9613 more_or_less = "exactly";
9614 }
9615 PyErr_Format(PyExc_TypeError,
9616 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
9617 func_name, more_or_less, num_expected,
9618 (num_expected == 1) ? "" : "s", num_found);
9619 }
9620
9621 /* PyDictVersioning */
9622 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
__Pyx_get_tp_dict_version(PyObject * obj)9623 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
9624 PyObject *dict = Py_TYPE(obj)->tp_dict;
9625 return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
9626 }
__Pyx_get_object_dict_version(PyObject * obj)9627 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
9628 PyObject **dictptr = NULL;
9629 Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
9630 if (offset) {
9631 #if CYTHON_COMPILING_IN_CPYTHON
9632 dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
9633 #else
9634 dictptr = _PyObject_GetDictPtr(obj);
9635 #endif
9636 }
9637 return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
9638 }
__Pyx_object_dict_version_matches(PyObject * obj,PY_UINT64_T tp_dict_version,PY_UINT64_T obj_dict_version)9639 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
9640 PyObject *dict = Py_TYPE(obj)->tp_dict;
9641 if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
9642 return 0;
9643 return obj_dict_version == __Pyx_get_object_dict_version(obj);
9644 }
9645 #endif
9646
9647 /* GetModuleGlobalName */
9648 #if CYTHON_USE_DICT_VERSIONS
__Pyx__GetModuleGlobalName(PyObject * name,PY_UINT64_T * dict_version,PyObject ** dict_cached_value)9649 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
9650 #else
9651 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
9652 #endif
9653 {
9654 PyObject *result;
9655 #if !CYTHON_AVOID_BORROWED_REFS
9656 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
9657 result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
9658 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9659 if (likely(result)) {
9660 return __Pyx_NewRef(result);
9661 } else if (unlikely(PyErr_Occurred())) {
9662 return NULL;
9663 }
9664 #else
9665 result = PyDict_GetItem(__pyx_d, name);
9666 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9667 if (likely(result)) {
9668 return __Pyx_NewRef(result);
9669 }
9670 #endif
9671 #else
9672 result = PyObject_GetItem(__pyx_d, name);
9673 __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
9674 if (likely(result)) {
9675 return __Pyx_NewRef(result);
9676 }
9677 PyErr_Clear();
9678 #endif
9679 return __Pyx_GetBuiltinName(name);
9680 }
9681
9682 /* PyFunctionFastCall */
9683 #if CYTHON_FAST_PYCALL
__Pyx_PyFunction_FastCallNoKw(PyCodeObject * co,PyObject ** args,Py_ssize_t na,PyObject * globals)9684 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
9685 PyObject *globals) {
9686 PyFrameObject *f;
9687 PyThreadState *tstate = __Pyx_PyThreadState_Current;
9688 PyObject **fastlocals;
9689 Py_ssize_t i;
9690 PyObject *result;
9691 assert(globals != NULL);
9692 /* XXX Perhaps we should create a specialized
9693 PyFrame_New() that doesn't take locals, but does
9694 take builtins without sanity checking them.
9695 */
9696 assert(tstate != NULL);
9697 f = PyFrame_New(tstate, co, globals, NULL);
9698 if (f == NULL) {
9699 return NULL;
9700 }
9701 fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
9702 for (i = 0; i < na; i++) {
9703 Py_INCREF(*args);
9704 fastlocals[i] = *args++;
9705 }
9706 result = PyEval_EvalFrameEx(f,0);
9707 ++tstate->recursion_depth;
9708 Py_DECREF(f);
9709 --tstate->recursion_depth;
9710 return result;
9711 }
9712 #if 1 || PY_VERSION_HEX < 0x030600B1
__Pyx_PyFunction_FastCallDict(PyObject * func,PyObject ** args,Py_ssize_t nargs,PyObject * kwargs)9713 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
9714 PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
9715 PyObject *globals = PyFunction_GET_GLOBALS(func);
9716 PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
9717 PyObject *closure;
9718 #if PY_MAJOR_VERSION >= 3
9719 PyObject *kwdefs;
9720 #endif
9721 PyObject *kwtuple, **k;
9722 PyObject **d;
9723 Py_ssize_t nd;
9724 Py_ssize_t nk;
9725 PyObject *result;
9726 assert(kwargs == NULL || PyDict_Check(kwargs));
9727 nk = kwargs ? PyDict_Size(kwargs) : 0;
9728 if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
9729 return NULL;
9730 }
9731 if (
9732 #if PY_MAJOR_VERSION >= 3
9733 co->co_kwonlyargcount == 0 &&
9734 #endif
9735 likely(kwargs == NULL || nk == 0) &&
9736 co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
9737 if (argdefs == NULL && co->co_argcount == nargs) {
9738 result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
9739 goto done;
9740 }
9741 else if (nargs == 0 && argdefs != NULL
9742 && co->co_argcount == Py_SIZE(argdefs)) {
9743 /* function called with no arguments, but all parameters have
9744 a default value: use default values as arguments .*/
9745 args = &PyTuple_GET_ITEM(argdefs, 0);
9746 result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
9747 goto done;
9748 }
9749 }
9750 if (kwargs != NULL) {
9751 Py_ssize_t pos, i;
9752 kwtuple = PyTuple_New(2 * nk);
9753 if (kwtuple == NULL) {
9754 result = NULL;
9755 goto done;
9756 }
9757 k = &PyTuple_GET_ITEM(kwtuple, 0);
9758 pos = i = 0;
9759 while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
9760 Py_INCREF(k[i]);
9761 Py_INCREF(k[i+1]);
9762 i += 2;
9763 }
9764 nk = i / 2;
9765 }
9766 else {
9767 kwtuple = NULL;
9768 k = NULL;
9769 }
9770 closure = PyFunction_GET_CLOSURE(func);
9771 #if PY_MAJOR_VERSION >= 3
9772 kwdefs = PyFunction_GET_KW_DEFAULTS(func);
9773 #endif
9774 if (argdefs != NULL) {
9775 d = &PyTuple_GET_ITEM(argdefs, 0);
9776 nd = Py_SIZE(argdefs);
9777 }
9778 else {
9779 d = NULL;
9780 nd = 0;
9781 }
9782 #if PY_MAJOR_VERSION >= 3
9783 result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
9784 args, (int)nargs,
9785 k, (int)nk,
9786 d, (int)nd, kwdefs, closure);
9787 #else
9788 result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
9789 args, (int)nargs,
9790 k, (int)nk,
9791 d, (int)nd, closure);
9792 #endif
9793 Py_XDECREF(kwtuple);
9794 done:
9795 Py_LeaveRecursiveCall();
9796 return result;
9797 }
9798 #endif
9799 #endif
9800
9801 /* PyCFunctionFastCall */
9802 #if CYTHON_FAST_PYCCALL
__Pyx_PyCFunction_FastCall(PyObject * func_obj,PyObject ** args,Py_ssize_t nargs)9803 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
9804 PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
9805 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
9806 PyObject *self = PyCFunction_GET_SELF(func);
9807 int flags = PyCFunction_GET_FLAGS(func);
9808 assert(PyCFunction_Check(func));
9809 assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
9810 assert(nargs >= 0);
9811 assert(nargs == 0 || args != NULL);
9812 /* _PyCFunction_FastCallDict() must not be called with an exception set,
9813 because it may clear it (directly or indirectly) and so the
9814 caller loses its exception */
9815 assert(!PyErr_Occurred());
9816 if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
9817 return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
9818 } else {
9819 return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
9820 }
9821 }
9822 #endif
9823
9824 /* PyObjectCall */
9825 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)9826 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
9827 PyObject *result;
9828 ternaryfunc call = func->ob_type->tp_call;
9829 if (unlikely(!call))
9830 return PyObject_Call(func, arg, kw);
9831 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
9832 return NULL;
9833 result = (*call)(func, arg, kw);
9834 Py_LeaveRecursiveCall();
9835 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
9836 PyErr_SetString(
9837 PyExc_SystemError,
9838 "NULL result without error in PyObject_Call");
9839 }
9840 return result;
9841 }
9842 #endif
9843
9844 /* PyErrFetchRestore */
9845 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)9846 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
9847 PyObject *tmp_type, *tmp_value, *tmp_tb;
9848 tmp_type = tstate->curexc_type;
9849 tmp_value = tstate->curexc_value;
9850 tmp_tb = tstate->curexc_traceback;
9851 tstate->curexc_type = type;
9852 tstate->curexc_value = value;
9853 tstate->curexc_traceback = tb;
9854 Py_XDECREF(tmp_type);
9855 Py_XDECREF(tmp_value);
9856 Py_XDECREF(tmp_tb);
9857 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)9858 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
9859 *type = tstate->curexc_type;
9860 *value = tstate->curexc_value;
9861 *tb = tstate->curexc_traceback;
9862 tstate->curexc_type = 0;
9863 tstate->curexc_value = 0;
9864 tstate->curexc_traceback = 0;
9865 }
9866 #endif
9867
9868 /* RaiseException */
9869 #if PY_MAJOR_VERSION < 3
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,CYTHON_UNUSED PyObject * cause)9870 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
9871 CYTHON_UNUSED PyObject *cause) {
9872 __Pyx_PyThreadState_declare
9873 Py_XINCREF(type);
9874 if (!value || value == Py_None)
9875 value = NULL;
9876 else
9877 Py_INCREF(value);
9878 if (!tb || tb == Py_None)
9879 tb = NULL;
9880 else {
9881 Py_INCREF(tb);
9882 if (!PyTraceBack_Check(tb)) {
9883 PyErr_SetString(PyExc_TypeError,
9884 "raise: arg 3 must be a traceback or None");
9885 goto raise_error;
9886 }
9887 }
9888 if (PyType_Check(type)) {
9889 #if CYTHON_COMPILING_IN_PYPY
9890 if (!value) {
9891 Py_INCREF(Py_None);
9892 value = Py_None;
9893 }
9894 #endif
9895 PyErr_NormalizeException(&type, &value, &tb);
9896 } else {
9897 if (value) {
9898 PyErr_SetString(PyExc_TypeError,
9899 "instance exception may not have a separate value");
9900 goto raise_error;
9901 }
9902 value = type;
9903 type = (PyObject*) Py_TYPE(type);
9904 Py_INCREF(type);
9905 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
9906 PyErr_SetString(PyExc_TypeError,
9907 "raise: exception class must be a subclass of BaseException");
9908 goto raise_error;
9909 }
9910 }
9911 __Pyx_PyThreadState_assign
9912 __Pyx_ErrRestore(type, value, tb);
9913 return;
9914 raise_error:
9915 Py_XDECREF(value);
9916 Py_XDECREF(type);
9917 Py_XDECREF(tb);
9918 return;
9919 }
9920 #else
__Pyx_Raise(PyObject * type,PyObject * value,PyObject * tb,PyObject * cause)9921 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
9922 PyObject* owned_instance = NULL;
9923 if (tb == Py_None) {
9924 tb = 0;
9925 } else if (tb && !PyTraceBack_Check(tb)) {
9926 PyErr_SetString(PyExc_TypeError,
9927 "raise: arg 3 must be a traceback or None");
9928 goto bad;
9929 }
9930 if (value == Py_None)
9931 value = 0;
9932 if (PyExceptionInstance_Check(type)) {
9933 if (value) {
9934 PyErr_SetString(PyExc_TypeError,
9935 "instance exception may not have a separate value");
9936 goto bad;
9937 }
9938 value = type;
9939 type = (PyObject*) Py_TYPE(value);
9940 } else if (PyExceptionClass_Check(type)) {
9941 PyObject *instance_class = NULL;
9942 if (value && PyExceptionInstance_Check(value)) {
9943 instance_class = (PyObject*) Py_TYPE(value);
9944 if (instance_class != type) {
9945 int is_subclass = PyObject_IsSubclass(instance_class, type);
9946 if (!is_subclass) {
9947 instance_class = NULL;
9948 } else if (unlikely(is_subclass == -1)) {
9949 goto bad;
9950 } else {
9951 type = instance_class;
9952 }
9953 }
9954 }
9955 if (!instance_class) {
9956 PyObject *args;
9957 if (!value)
9958 args = PyTuple_New(0);
9959 else if (PyTuple_Check(value)) {
9960 Py_INCREF(value);
9961 args = value;
9962 } else
9963 args = PyTuple_Pack(1, value);
9964 if (!args)
9965 goto bad;
9966 owned_instance = PyObject_Call(type, args, NULL);
9967 Py_DECREF(args);
9968 if (!owned_instance)
9969 goto bad;
9970 value = owned_instance;
9971 if (!PyExceptionInstance_Check(value)) {
9972 PyErr_Format(PyExc_TypeError,
9973 "calling %R should have returned an instance of "
9974 "BaseException, not %R",
9975 type, Py_TYPE(value));
9976 goto bad;
9977 }
9978 }
9979 } else {
9980 PyErr_SetString(PyExc_TypeError,
9981 "raise: exception class must be a subclass of BaseException");
9982 goto bad;
9983 }
9984 if (cause) {
9985 PyObject *fixed_cause;
9986 if (cause == Py_None) {
9987 fixed_cause = NULL;
9988 } else if (PyExceptionClass_Check(cause)) {
9989 fixed_cause = PyObject_CallObject(cause, NULL);
9990 if (fixed_cause == NULL)
9991 goto bad;
9992 } else if (PyExceptionInstance_Check(cause)) {
9993 fixed_cause = cause;
9994 Py_INCREF(fixed_cause);
9995 } else {
9996 PyErr_SetString(PyExc_TypeError,
9997 "exception causes must derive from "
9998 "BaseException");
9999 goto bad;
10000 }
10001 PyException_SetCause(value, fixed_cause);
10002 }
10003 PyErr_SetObject(type, value);
10004 if (tb) {
10005 #if CYTHON_COMPILING_IN_PYPY
10006 PyObject *tmp_type, *tmp_value, *tmp_tb;
10007 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
10008 Py_INCREF(tb);
10009 PyErr_Restore(tmp_type, tmp_value, tb);
10010 Py_XDECREF(tmp_tb);
10011 #else
10012 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10013 PyObject* tmp_tb = tstate->curexc_traceback;
10014 if (tb != tmp_tb) {
10015 Py_INCREF(tb);
10016 tstate->curexc_traceback = tb;
10017 Py_XDECREF(tmp_tb);
10018 }
10019 #endif
10020 }
10021 bad:
10022 Py_XDECREF(owned_instance);
10023 return;
10024 }
10025 #endif
10026
10027 /* GetItemInt */
__Pyx_GetItemInt_Generic(PyObject * o,PyObject * j)10028 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
10029 PyObject *r;
10030 if (!j) return NULL;
10031 r = PyObject_GetItem(o, j);
10032 Py_DECREF(j);
10033 return r;
10034 }
__Pyx_GetItemInt_List_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10035 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
10036 CYTHON_NCP_UNUSED int wraparound,
10037 CYTHON_NCP_UNUSED int boundscheck) {
10038 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10039 Py_ssize_t wrapped_i = i;
10040 if (wraparound & unlikely(i < 0)) {
10041 wrapped_i += PyList_GET_SIZE(o);
10042 }
10043 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
10044 PyObject *r = PyList_GET_ITEM(o, wrapped_i);
10045 Py_INCREF(r);
10046 return r;
10047 }
10048 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10049 #else
10050 return PySequence_GetItem(o, i);
10051 #endif
10052 }
__Pyx_GetItemInt_Tuple_Fast(PyObject * o,Py_ssize_t i,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10053 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
10054 CYTHON_NCP_UNUSED int wraparound,
10055 CYTHON_NCP_UNUSED int boundscheck) {
10056 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10057 Py_ssize_t wrapped_i = i;
10058 if (wraparound & unlikely(i < 0)) {
10059 wrapped_i += PyTuple_GET_SIZE(o);
10060 }
10061 if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
10062 PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
10063 Py_INCREF(r);
10064 return r;
10065 }
10066 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10067 #else
10068 return PySequence_GetItem(o, i);
10069 #endif
10070 }
__Pyx_GetItemInt_Fast(PyObject * o,Py_ssize_t i,int is_list,CYTHON_NCP_UNUSED int wraparound,CYTHON_NCP_UNUSED int boundscheck)10071 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
10072 CYTHON_NCP_UNUSED int wraparound,
10073 CYTHON_NCP_UNUSED int boundscheck) {
10074 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
10075 if (is_list || PyList_CheckExact(o)) {
10076 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
10077 if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
10078 PyObject *r = PyList_GET_ITEM(o, n);
10079 Py_INCREF(r);
10080 return r;
10081 }
10082 }
10083 else if (PyTuple_CheckExact(o)) {
10084 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
10085 if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
10086 PyObject *r = PyTuple_GET_ITEM(o, n);
10087 Py_INCREF(r);
10088 return r;
10089 }
10090 } else {
10091 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
10092 if (likely(m && m->sq_item)) {
10093 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
10094 Py_ssize_t l = m->sq_length(o);
10095 if (likely(l >= 0)) {
10096 i += l;
10097 } else {
10098 if (!PyErr_ExceptionMatches(PyExc_OverflowError))
10099 return NULL;
10100 PyErr_Clear();
10101 }
10102 }
10103 return m->sq_item(o, i);
10104 }
10105 }
10106 #else
10107 if (is_list || PySequence_Check(o)) {
10108 return PySequence_GetItem(o, i);
10109 }
10110 #endif
10111 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
10112 }
10113
10114 /* RaiseTooManyValuesToUnpack */
__Pyx_RaiseTooManyValuesError(Py_ssize_t expected)10115 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
10116 PyErr_Format(PyExc_ValueError,
10117 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
10118 }
10119
10120 /* RaiseNeedMoreValuesToUnpack */
__Pyx_RaiseNeedMoreValuesError(Py_ssize_t index)10121 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
10122 PyErr_Format(PyExc_ValueError,
10123 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
10124 index, (index == 1) ? "" : "s");
10125 }
10126
10127 /* IterFinish */
__Pyx_IterFinish(void)10128 static CYTHON_INLINE int __Pyx_IterFinish(void) {
10129 #if CYTHON_FAST_THREAD_STATE
10130 PyThreadState *tstate = __Pyx_PyThreadState_Current;
10131 PyObject* exc_type = tstate->curexc_type;
10132 if (unlikely(exc_type)) {
10133 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
10134 PyObject *exc_value, *exc_tb;
10135 exc_value = tstate->curexc_value;
10136 exc_tb = tstate->curexc_traceback;
10137 tstate->curexc_type = 0;
10138 tstate->curexc_value = 0;
10139 tstate->curexc_traceback = 0;
10140 Py_DECREF(exc_type);
10141 Py_XDECREF(exc_value);
10142 Py_XDECREF(exc_tb);
10143 return 0;
10144 } else {
10145 return -1;
10146 }
10147 }
10148 return 0;
10149 #else
10150 if (unlikely(PyErr_Occurred())) {
10151 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
10152 PyErr_Clear();
10153 return 0;
10154 } else {
10155 return -1;
10156 }
10157 }
10158 return 0;
10159 #endif
10160 }
10161
10162 /* UnpackItemEndCheck */
__Pyx_IternextUnpackEndCheck(PyObject * retval,Py_ssize_t expected)10163 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
10164 if (unlikely(retval)) {
10165 Py_DECREF(retval);
10166 __Pyx_RaiseTooManyValuesError(expected);
10167 return -1;
10168 } else {
10169 return __Pyx_IterFinish();
10170 }
10171 return 0;
10172 }
10173
10174 /* PyObjectCallMethO */
10175 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)10176 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
10177 PyObject *self, *result;
10178 PyCFunction cfunc;
10179 cfunc = PyCFunction_GET_FUNCTION(func);
10180 self = PyCFunction_GET_SELF(func);
10181 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
10182 return NULL;
10183 result = cfunc(self, arg);
10184 Py_LeaveRecursiveCall();
10185 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
10186 PyErr_SetString(
10187 PyExc_SystemError,
10188 "NULL result without error in PyObject_Call");
10189 }
10190 return result;
10191 }
10192 #endif
10193
10194 /* PyObjectCallOneArg */
10195 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx__PyObject_CallOneArg(PyObject * func,PyObject * arg)10196 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10197 PyObject *result;
10198 PyObject *args = PyTuple_New(1);
10199 if (unlikely(!args)) return NULL;
10200 Py_INCREF(arg);
10201 PyTuple_SET_ITEM(args, 0, arg);
10202 result = __Pyx_PyObject_Call(func, args, NULL);
10203 Py_DECREF(args);
10204 return result;
10205 }
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)10206 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10207 #if CYTHON_FAST_PYCALL
10208 if (PyFunction_Check(func)) {
10209 return __Pyx_PyFunction_FastCall(func, &arg, 1);
10210 }
10211 #endif
10212 if (likely(PyCFunction_Check(func))) {
10213 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
10214 return __Pyx_PyObject_CallMethO(func, arg);
10215 #if CYTHON_FAST_PYCCALL
10216 } else if (__Pyx_PyFastCFunction_Check(func)) {
10217 return __Pyx_PyCFunction_FastCall(func, &arg, 1);
10218 #endif
10219 }
10220 }
10221 return __Pyx__PyObject_CallOneArg(func, arg);
10222 }
10223 #else
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)10224 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
10225 PyObject *result;
10226 PyObject *args = PyTuple_Pack(1, arg);
10227 if (unlikely(!args)) return NULL;
10228 result = __Pyx_PyObject_Call(func, args, NULL);
10229 Py_DECREF(args);
10230 return result;
10231 }
10232 #endif
10233
10234 /* ObjectGetItem */
10235 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetIndex(PyObject * obj,PyObject * index)10236 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
10237 PyObject *runerr;
10238 Py_ssize_t key_value;
10239 PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
10240 if (unlikely(!(m && m->sq_item))) {
10241 PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
10242 return NULL;
10243 }
10244 key_value = __Pyx_PyIndex_AsSsize_t(index);
10245 if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
10246 return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
10247 }
10248 if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
10249 PyErr_Clear();
10250 PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
10251 }
10252 return NULL;
10253 }
__Pyx_PyObject_GetItem(PyObject * obj,PyObject * key)10254 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
10255 PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
10256 if (likely(m && m->mp_subscript)) {
10257 return m->mp_subscript(obj, key);
10258 }
10259 return __Pyx_PyObject_GetIndex(obj, key);
10260 }
10261 #endif
10262
10263 /* PyIntBinop */
10264 #if !CYTHON_COMPILING_IN_PYPY
__Pyx_PyInt_AddObjC(PyObject * op1,PyObject * op2,CYTHON_UNUSED long intval,int inplace,int zerodivision_check)10265 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
10266 (void)inplace;
10267 (void)zerodivision_check;
10268 #if PY_MAJOR_VERSION < 3
10269 if (likely(PyInt_CheckExact(op1))) {
10270 const long b = intval;
10271 long x;
10272 long a = PyInt_AS_LONG(op1);
10273 x = (long)((unsigned long)a + b);
10274 if (likely((x^a) >= 0 || (x^b) >= 0))
10275 return PyInt_FromLong(x);
10276 return PyLong_Type.tp_as_number->nb_add(op1, op2);
10277 }
10278 #endif
10279 #if CYTHON_USE_PYLONG_INTERNALS
10280 if (likely(PyLong_CheckExact(op1))) {
10281 const long b = intval;
10282 long a, x;
10283 #ifdef HAVE_LONG_LONG
10284 const PY_LONG_LONG llb = intval;
10285 PY_LONG_LONG lla, llx;
10286 #endif
10287 const digit* digits = ((PyLongObject*)op1)->ob_digit;
10288 const Py_ssize_t size = Py_SIZE(op1);
10289 if (likely(__Pyx_sst_abs(size) <= 1)) {
10290 a = likely(size) ? digits[0] : 0;
10291 if (size == -1) a = -a;
10292 } else {
10293 switch (size) {
10294 case -2:
10295 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10296 a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
10297 break;
10298 #ifdef HAVE_LONG_LONG
10299 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
10300 lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
10301 goto long_long;
10302 #endif
10303 }
10304 CYTHON_FALLTHROUGH;
10305 case 2:
10306 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
10307 a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
10308 break;
10309 #ifdef HAVE_LONG_LONG
10310 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
10311 lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
10312 goto long_long;
10313 #endif
10314 }
10315 CYTHON_FALLTHROUGH;
10316 case -3:
10317 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10318 a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
10319 break;
10320 #ifdef HAVE_LONG_LONG
10321 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
10322 lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
10323 goto long_long;
10324 #endif
10325 }
10326 CYTHON_FALLTHROUGH;
10327 case 3:
10328 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
10329 a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
10330 break;
10331 #ifdef HAVE_LONG_LONG
10332 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
10333 lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
10334 goto long_long;
10335 #endif
10336 }
10337 CYTHON_FALLTHROUGH;
10338 case -4:
10339 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10340 a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
10341 break;
10342 #ifdef HAVE_LONG_LONG
10343 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
10344 lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
10345 goto long_long;
10346 #endif
10347 }
10348 CYTHON_FALLTHROUGH;
10349 case 4:
10350 if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
10351 a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
10352 break;
10353 #ifdef HAVE_LONG_LONG
10354 } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
10355 lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
10356 goto long_long;
10357 #endif
10358 }
10359 CYTHON_FALLTHROUGH;
10360 default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
10361 }
10362 }
10363 x = a + b;
10364 return PyLong_FromLong(x);
10365 #ifdef HAVE_LONG_LONG
10366 long_long:
10367 llx = lla + llb;
10368 return PyLong_FromLongLong(llx);
10369 #endif
10370
10371
10372 }
10373 #endif
10374 if (PyFloat_CheckExact(op1)) {
10375 const long b = intval;
10376 double a = PyFloat_AS_DOUBLE(op1);
10377 double result;
10378 PyFPE_START_PROTECT("add", return NULL)
10379 result = ((double)a) + (double)b;
10380 PyFPE_END_PROTECT(result)
10381 return PyFloat_FromDouble(result);
10382 }
10383 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
10384 }
10385 #endif
10386
10387 /* None */
__Pyx_RaiseClosureNameError(const char * varname)10388 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
10389 PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
10390 }
10391
10392 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)10393 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
10394 PyObject *args, *result = NULL;
10395 #if CYTHON_FAST_PYCALL
10396 if (PyFunction_Check(function)) {
10397 PyObject *args[2] = {arg1, arg2};
10398 return __Pyx_PyFunction_FastCall(function, args, 2);
10399 }
10400 #endif
10401 #if CYTHON_FAST_PYCCALL
10402 if (__Pyx_PyFastCFunction_Check(function)) {
10403 PyObject *args[2] = {arg1, arg2};
10404 return __Pyx_PyCFunction_FastCall(function, args, 2);
10405 }
10406 #endif
10407 args = PyTuple_New(2);
10408 if (unlikely(!args)) goto done;
10409 Py_INCREF(arg1);
10410 PyTuple_SET_ITEM(args, 0, arg1);
10411 Py_INCREF(arg2);
10412 PyTuple_SET_ITEM(args, 1, arg2);
10413 Py_INCREF(function);
10414 result = __Pyx_PyObject_Call(function, args, NULL);
10415 Py_DECREF(args);
10416 Py_DECREF(function);
10417 done:
10418 return result;
10419 }
10420
10421 /* PyObjectCallNoArg */
10422 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallNoArg(PyObject * func)10423 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
10424 #if CYTHON_FAST_PYCALL
10425 if (PyFunction_Check(func)) {
10426 return __Pyx_PyFunction_FastCall(func, NULL, 0);
10427 }
10428 #endif
10429 #ifdef __Pyx_CyFunction_USED
10430 if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
10431 #else
10432 if (likely(PyCFunction_Check(func)))
10433 #endif
10434 {
10435 if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
10436 return __Pyx_PyObject_CallMethO(func, NULL);
10437 }
10438 }
10439 return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
10440 }
10441 #endif
10442
10443 /* StringJoin */
10444 #if !CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyBytes_Join(PyObject * sep,PyObject * values)10445 static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
10446 return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
10447 }
10448 #endif
10449
10450 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)10451 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
10452 {
10453 if (unlikely(!type)) {
10454 PyErr_SetString(PyExc_SystemError, "Missing type object");
10455 return 0;
10456 }
10457 else if (exact) {
10458 #if PY_MAJOR_VERSION == 2
10459 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
10460 #endif
10461 }
10462 else {
10463 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
10464 }
10465 PyErr_Format(PyExc_TypeError,
10466 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
10467 name, type->tp_name, Py_TYPE(obj)->tp_name);
10468 return 0;
10469 }
10470
10471 /* PyObject_GenericGetAttrNoDict */
10472 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_RaiseGenericGetAttributeError(PyTypeObject * tp,PyObject * attr_name)10473 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
10474 PyErr_Format(PyExc_AttributeError,
10475 #if PY_MAJOR_VERSION >= 3
10476 "'%.50s' object has no attribute '%U'",
10477 tp->tp_name, attr_name);
10478 #else
10479 "'%.50s' object has no attribute '%.400s'",
10480 tp->tp_name, PyString_AS_STRING(attr_name));
10481 #endif
10482 return NULL;
10483 }
__Pyx_PyObject_GenericGetAttrNoDict(PyObject * obj,PyObject * attr_name)10484 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
10485 PyObject *descr;
10486 PyTypeObject *tp = Py_TYPE(obj);
10487 if (unlikely(!PyString_Check(attr_name))) {
10488 return PyObject_GenericGetAttr(obj, attr_name);
10489 }
10490 assert(!tp->tp_dictoffset);
10491 descr = _PyType_Lookup(tp, attr_name);
10492 if (unlikely(!descr)) {
10493 return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
10494 }
10495 Py_INCREF(descr);
10496 #if PY_MAJOR_VERSION < 3
10497 if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
10498 #endif
10499 {
10500 descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
10501 if (unlikely(f)) {
10502 PyObject *res = f(descr, obj, (PyObject *)tp);
10503 Py_DECREF(descr);
10504 return res;
10505 }
10506 }
10507 return descr;
10508 }
10509 #endif
10510
10511 /* PyObject_GenericGetAttr */
10512 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)10513 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
10514 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
10515 return PyObject_GenericGetAttr(obj, attr_name);
10516 }
10517 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
10518 }
10519 #endif
10520
10521 /* SetVTable */
__Pyx_SetVtable(PyObject * dict,void * vtable)10522 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
10523 #if PY_VERSION_HEX >= 0x02070000
10524 PyObject *ob = PyCapsule_New(vtable, 0, 0);
10525 #else
10526 PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
10527 #endif
10528 if (!ob)
10529 goto bad;
10530 if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
10531 goto bad;
10532 Py_DECREF(ob);
10533 return 0;
10534 bad:
10535 Py_XDECREF(ob);
10536 return -1;
10537 }
10538
10539 /* PyErrExceptionMatches */
10540 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10541 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10542 Py_ssize_t i, n;
10543 n = PyTuple_GET_SIZE(tuple);
10544 #if PY_MAJOR_VERSION >= 3
10545 for (i=0; i<n; i++) {
10546 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10547 }
10548 #endif
10549 for (i=0; i<n; i++) {
10550 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
10551 }
10552 return 0;
10553 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)10554 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
10555 PyObject *exc_type = tstate->curexc_type;
10556 if (exc_type == err) return 1;
10557 if (unlikely(!exc_type)) return 0;
10558 if (unlikely(PyTuple_Check(err)))
10559 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
10560 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
10561 }
10562 #endif
10563
10564 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)10565 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
10566 __Pyx_PyThreadState_declare
10567 __Pyx_PyThreadState_assign
10568 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
10569 __Pyx_PyErr_Clear();
10570 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)10571 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
10572 PyObject *result;
10573 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
10574 PyTypeObject* tp = Py_TYPE(obj);
10575 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
10576 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
10577 }
10578 #endif
10579 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
10580 if (unlikely(!result)) {
10581 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
10582 }
10583 return result;
10584 }
10585
10586 /* SetupReduce */
__Pyx_setup_reduce_is_named(PyObject * meth,PyObject * name)10587 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
10588 int ret;
10589 PyObject *name_attr;
10590 name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
10591 if (likely(name_attr)) {
10592 ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
10593 } else {
10594 ret = -1;
10595 }
10596 if (unlikely(ret < 0)) {
10597 PyErr_Clear();
10598 ret = 0;
10599 }
10600 Py_XDECREF(name_attr);
10601 return ret;
10602 }
__Pyx_setup_reduce(PyObject * type_obj)10603 static int __Pyx_setup_reduce(PyObject* type_obj) {
10604 int ret = 0;
10605 PyObject *object_reduce = NULL;
10606 PyObject *object_reduce_ex = NULL;
10607 PyObject *reduce = NULL;
10608 PyObject *reduce_ex = NULL;
10609 PyObject *reduce_cython = NULL;
10610 PyObject *setstate = NULL;
10611 PyObject *setstate_cython = NULL;
10612 #if CYTHON_USE_PYTYPE_LOOKUP
10613 if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
10614 #else
10615 if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
10616 #endif
10617 #if CYTHON_USE_PYTYPE_LOOKUP
10618 object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
10619 #else
10620 object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
10621 #endif
10622 reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
10623 if (reduce_ex == object_reduce_ex) {
10624 #if CYTHON_USE_PYTYPE_LOOKUP
10625 object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
10626 #else
10627 object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
10628 #endif
10629 reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
10630 if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
10631 reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
10632 if (likely(reduce_cython)) {
10633 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10634 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10635 } else if (reduce == object_reduce || PyErr_Occurred()) {
10636 goto __PYX_BAD;
10637 }
10638 setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
10639 if (!setstate) PyErr_Clear();
10640 if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
10641 setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
10642 if (likely(setstate_cython)) {
10643 ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10644 ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
10645 } else if (!setstate || PyErr_Occurred()) {
10646 goto __PYX_BAD;
10647 }
10648 }
10649 PyType_Modified((PyTypeObject*)type_obj);
10650 }
10651 }
10652 goto __PYX_GOOD;
10653 __PYX_BAD:
10654 if (!PyErr_Occurred())
10655 PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
10656 ret = -1;
10657 __PYX_GOOD:
10658 #if !CYTHON_USE_PYTYPE_LOOKUP
10659 Py_XDECREF(object_reduce);
10660 Py_XDECREF(object_reduce_ex);
10661 #endif
10662 Py_XDECREF(reduce);
10663 Py_XDECREF(reduce_ex);
10664 Py_XDECREF(reduce_cython);
10665 Py_XDECREF(setstate);
10666 Py_XDECREF(setstate_cython);
10667 return ret;
10668 }
10669
10670 /* TypeImport */
10671 #ifndef __PYX_HAVE_RT_ImportType
10672 #define __PYX_HAVE_RT_ImportType
__Pyx_ImportType(PyObject * module,const char * module_name,const char * class_name,size_t size,enum __Pyx_ImportType_CheckSize check_size)10673 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
10674 size_t size, enum __Pyx_ImportType_CheckSize check_size)
10675 {
10676 PyObject *result = 0;
10677 char warning[200];
10678 Py_ssize_t basicsize;
10679 #ifdef Py_LIMITED_API
10680 PyObject *py_basicsize;
10681 #endif
10682 result = PyObject_GetAttrString(module, class_name);
10683 if (!result)
10684 goto bad;
10685 if (!PyType_Check(result)) {
10686 PyErr_Format(PyExc_TypeError,
10687 "%.200s.%.200s is not a type object",
10688 module_name, class_name);
10689 goto bad;
10690 }
10691 #ifndef Py_LIMITED_API
10692 basicsize = ((PyTypeObject *)result)->tp_basicsize;
10693 #else
10694 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
10695 if (!py_basicsize)
10696 goto bad;
10697 basicsize = PyLong_AsSsize_t(py_basicsize);
10698 Py_DECREF(py_basicsize);
10699 py_basicsize = 0;
10700 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
10701 goto bad;
10702 #endif
10703 if ((size_t)basicsize < size) {
10704 PyErr_Format(PyExc_ValueError,
10705 "%.200s.%.200s size changed, may indicate binary incompatibility. "
10706 "Expected %zd from C header, got %zd from PyObject",
10707 module_name, class_name, size, basicsize);
10708 goto bad;
10709 }
10710 if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
10711 PyErr_Format(PyExc_ValueError,
10712 "%.200s.%.200s size changed, may indicate binary incompatibility. "
10713 "Expected %zd from C header, got %zd from PyObject",
10714 module_name, class_name, size, basicsize);
10715 goto bad;
10716 }
10717 else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
10718 PyOS_snprintf(warning, sizeof(warning),
10719 "%s.%s size changed, may indicate binary incompatibility. "
10720 "Expected %zd from C header, got %zd from PyObject",
10721 module_name, class_name, size, basicsize);
10722 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
10723 }
10724 return (PyTypeObject *)result;
10725 bad:
10726 Py_XDECREF(result);
10727 return NULL;
10728 }
10729 #endif
10730
10731 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)10732 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
10733 PyObject *empty_list = 0;
10734 PyObject *module = 0;
10735 PyObject *global_dict = 0;
10736 PyObject *empty_dict = 0;
10737 PyObject *list;
10738 #if PY_MAJOR_VERSION < 3
10739 PyObject *py_import;
10740 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
10741 if (!py_import)
10742 goto bad;
10743 #endif
10744 if (from_list)
10745 list = from_list;
10746 else {
10747 empty_list = PyList_New(0);
10748 if (!empty_list)
10749 goto bad;
10750 list = empty_list;
10751 }
10752 global_dict = PyModule_GetDict(__pyx_m);
10753 if (!global_dict)
10754 goto bad;
10755 empty_dict = PyDict_New();
10756 if (!empty_dict)
10757 goto bad;
10758 {
10759 #if PY_MAJOR_VERSION >= 3
10760 if (level == -1) {
10761 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
10762 module = PyImport_ImportModuleLevelObject(
10763 name, global_dict, empty_dict, list, 1);
10764 if (!module) {
10765 if (!PyErr_ExceptionMatches(PyExc_ImportError))
10766 goto bad;
10767 PyErr_Clear();
10768 }
10769 }
10770 level = 0;
10771 }
10772 #endif
10773 if (!module) {
10774 #if PY_MAJOR_VERSION < 3
10775 PyObject *py_level = PyInt_FromLong(level);
10776 if (!py_level)
10777 goto bad;
10778 module = PyObject_CallFunctionObjArgs(py_import,
10779 name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
10780 Py_DECREF(py_level);
10781 #else
10782 module = PyImport_ImportModuleLevelObject(
10783 name, global_dict, empty_dict, list, level);
10784 #endif
10785 }
10786 }
10787 bad:
10788 #if PY_MAJOR_VERSION < 3
10789 Py_XDECREF(py_import);
10790 #endif
10791 Py_XDECREF(empty_list);
10792 Py_XDECREF(empty_dict);
10793 return module;
10794 }
10795
10796 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)10797 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
10798 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
10799 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
10800 PyErr_Format(PyExc_ImportError,
10801 #if PY_MAJOR_VERSION < 3
10802 "cannot import name %.230s", PyString_AS_STRING(name));
10803 #else
10804 "cannot import name %S", name);
10805 #endif
10806 }
10807 return value;
10808 }
10809
10810 /* CalculateMetaclass */
__Pyx_CalculateMetaclass(PyTypeObject * metaclass,PyObject * bases)10811 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
10812 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
10813 for (i=0; i < nbases; i++) {
10814 PyTypeObject *tmptype;
10815 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
10816 tmptype = Py_TYPE(tmp);
10817 #if PY_MAJOR_VERSION < 3
10818 if (tmptype == &PyClass_Type)
10819 continue;
10820 #endif
10821 if (!metaclass) {
10822 metaclass = tmptype;
10823 continue;
10824 }
10825 if (PyType_IsSubtype(metaclass, tmptype))
10826 continue;
10827 if (PyType_IsSubtype(tmptype, metaclass)) {
10828 metaclass = tmptype;
10829 continue;
10830 }
10831 PyErr_SetString(PyExc_TypeError,
10832 "metaclass conflict: "
10833 "the metaclass of a derived class "
10834 "must be a (non-strict) subclass "
10835 "of the metaclasses of all its bases");
10836 return NULL;
10837 }
10838 if (!metaclass) {
10839 #if PY_MAJOR_VERSION < 3
10840 metaclass = &PyClass_Type;
10841 #else
10842 metaclass = &PyType_Type;
10843 #endif
10844 }
10845 Py_INCREF((PyObject*) metaclass);
10846 return (PyObject*) metaclass;
10847 }
10848
10849 /* Py3ClassCreate */
__Pyx_Py3MetaclassPrepare(PyObject * metaclass,PyObject * bases,PyObject * name,PyObject * qualname,PyObject * mkw,PyObject * modname,PyObject * doc)10850 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
10851 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
10852 PyObject *ns;
10853 if (metaclass) {
10854 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
10855 if (prep) {
10856 PyObject *pargs = PyTuple_Pack(2, name, bases);
10857 if (unlikely(!pargs)) {
10858 Py_DECREF(prep);
10859 return NULL;
10860 }
10861 ns = PyObject_Call(prep, pargs, mkw);
10862 Py_DECREF(prep);
10863 Py_DECREF(pargs);
10864 } else {
10865 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
10866 return NULL;
10867 PyErr_Clear();
10868 ns = PyDict_New();
10869 }
10870 } else {
10871 ns = PyDict_New();
10872 }
10873 if (unlikely(!ns))
10874 return NULL;
10875 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module_2, modname) < 0)) goto bad;
10876 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
10877 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
10878 return ns;
10879 bad:
10880 Py_DECREF(ns);
10881 return NULL;
10882 }
__Pyx_Py3ClassCreate(PyObject * metaclass,PyObject * name,PyObject * bases,PyObject * dict,PyObject * mkw,int calculate_metaclass,int allow_py2_metaclass)10883 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
10884 PyObject *dict, PyObject *mkw,
10885 int calculate_metaclass, int allow_py2_metaclass) {
10886 PyObject *result, *margs;
10887 PyObject *owned_metaclass = NULL;
10888 if (allow_py2_metaclass) {
10889 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
10890 if (owned_metaclass) {
10891 metaclass = owned_metaclass;
10892 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
10893 PyErr_Clear();
10894 } else {
10895 return NULL;
10896 }
10897 }
10898 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
10899 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
10900 Py_XDECREF(owned_metaclass);
10901 if (unlikely(!metaclass))
10902 return NULL;
10903 owned_metaclass = metaclass;
10904 }
10905 margs = PyTuple_Pack(3, name, bases, dict);
10906 if (unlikely(!margs)) {
10907 result = NULL;
10908 } else {
10909 result = PyObject_Call(metaclass, margs, mkw);
10910 Py_DECREF(margs);
10911 }
10912 Py_XDECREF(owned_metaclass);
10913 return result;
10914 }
10915
10916 /* CLineInTraceback */
10917 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)10918 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
10919 PyObject *use_cline;
10920 PyObject *ptype, *pvalue, *ptraceback;
10921 #if CYTHON_COMPILING_IN_CPYTHON
10922 PyObject **cython_runtime_dict;
10923 #endif
10924 if (unlikely(!__pyx_cython_runtime)) {
10925 return c_line;
10926 }
10927 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
10928 #if CYTHON_COMPILING_IN_CPYTHON
10929 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
10930 if (likely(cython_runtime_dict)) {
10931 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
10932 use_cline, *cython_runtime_dict,
10933 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
10934 } else
10935 #endif
10936 {
10937 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
10938 if (use_cline_obj) {
10939 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
10940 Py_DECREF(use_cline_obj);
10941 } else {
10942 PyErr_Clear();
10943 use_cline = NULL;
10944 }
10945 }
10946 if (!use_cline) {
10947 c_line = 0;
10948 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
10949 }
10950 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
10951 c_line = 0;
10952 }
10953 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
10954 return c_line;
10955 }
10956 #endif
10957
10958 /* CodeObjectCache */
__pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry * entries,int count,int code_line)10959 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
10960 int start = 0, mid = 0, end = count - 1;
10961 if (end >= 0 && code_line > entries[end].code_line) {
10962 return count;
10963 }
10964 while (start < end) {
10965 mid = start + (end - start) / 2;
10966 if (code_line < entries[mid].code_line) {
10967 end = mid;
10968 } else if (code_line > entries[mid].code_line) {
10969 start = mid + 1;
10970 } else {
10971 return mid;
10972 }
10973 }
10974 if (code_line <= entries[mid].code_line) {
10975 return mid;
10976 } else {
10977 return mid + 1;
10978 }
10979 }
__pyx_find_code_object(int code_line)10980 static PyCodeObject *__pyx_find_code_object(int code_line) {
10981 PyCodeObject* code_object;
10982 int pos;
10983 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
10984 return NULL;
10985 }
10986 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
10987 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
10988 return NULL;
10989 }
10990 code_object = __pyx_code_cache.entries[pos].code_object;
10991 Py_INCREF(code_object);
10992 return code_object;
10993 }
__pyx_insert_code_object(int code_line,PyCodeObject * code_object)10994 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
10995 int pos, i;
10996 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
10997 if (unlikely(!code_line)) {
10998 return;
10999 }
11000 if (unlikely(!entries)) {
11001 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
11002 if (likely(entries)) {
11003 __pyx_code_cache.entries = entries;
11004 __pyx_code_cache.max_count = 64;
11005 __pyx_code_cache.count = 1;
11006 entries[0].code_line = code_line;
11007 entries[0].code_object = code_object;
11008 Py_INCREF(code_object);
11009 }
11010 return;
11011 }
11012 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
11013 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
11014 PyCodeObject* tmp = entries[pos].code_object;
11015 entries[pos].code_object = code_object;
11016 Py_DECREF(tmp);
11017 return;
11018 }
11019 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
11020 int new_max = __pyx_code_cache.max_count + 64;
11021 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
11022 __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
11023 if (unlikely(!entries)) {
11024 return;
11025 }
11026 __pyx_code_cache.entries = entries;
11027 __pyx_code_cache.max_count = new_max;
11028 }
11029 for (i=__pyx_code_cache.count; i>pos; i--) {
11030 entries[i] = entries[i-1];
11031 }
11032 entries[pos].code_line = code_line;
11033 entries[pos].code_object = code_object;
11034 __pyx_code_cache.count++;
11035 Py_INCREF(code_object);
11036 }
11037
11038 /* AddTraceback */
11039 #include "compile.h"
11040 #include "frameobject.h"
11041 #include "traceback.h"
__Pyx_CreateCodeObjectForTraceback(const char * funcname,int c_line,int py_line,const char * filename)11042 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
11043 const char *funcname, int c_line,
11044 int py_line, const char *filename) {
11045 PyCodeObject *py_code = 0;
11046 PyObject *py_srcfile = 0;
11047 PyObject *py_funcname = 0;
11048 #if PY_MAJOR_VERSION < 3
11049 py_srcfile = PyString_FromString(filename);
11050 #else
11051 py_srcfile = PyUnicode_FromString(filename);
11052 #endif
11053 if (!py_srcfile) goto bad;
11054 if (c_line) {
11055 #if PY_MAJOR_VERSION < 3
11056 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11057 #else
11058 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
11059 #endif
11060 }
11061 else {
11062 #if PY_MAJOR_VERSION < 3
11063 py_funcname = PyString_FromString(funcname);
11064 #else
11065 py_funcname = PyUnicode_FromString(funcname);
11066 #endif
11067 }
11068 if (!py_funcname) goto bad;
11069 py_code = __Pyx_PyCode_New(
11070 0,
11071 0,
11072 0,
11073 0,
11074 0,
11075 __pyx_empty_bytes, /*PyObject *code,*/
11076 __pyx_empty_tuple, /*PyObject *consts,*/
11077 __pyx_empty_tuple, /*PyObject *names,*/
11078 __pyx_empty_tuple, /*PyObject *varnames,*/
11079 __pyx_empty_tuple, /*PyObject *freevars,*/
11080 __pyx_empty_tuple, /*PyObject *cellvars,*/
11081 py_srcfile, /*PyObject *filename,*/
11082 py_funcname, /*PyObject *name,*/
11083 py_line,
11084 __pyx_empty_bytes /*PyObject *lnotab*/
11085 );
11086 Py_DECREF(py_srcfile);
11087 Py_DECREF(py_funcname);
11088 return py_code;
11089 bad:
11090 Py_XDECREF(py_srcfile);
11091 Py_XDECREF(py_funcname);
11092 return NULL;
11093 }
__Pyx_AddTraceback(const char * funcname,int c_line,int py_line,const char * filename)11094 static void __Pyx_AddTraceback(const char *funcname, int c_line,
11095 int py_line, const char *filename) {
11096 PyCodeObject *py_code = 0;
11097 PyFrameObject *py_frame = 0;
11098 PyThreadState *tstate = __Pyx_PyThreadState_Current;
11099 if (c_line) {
11100 c_line = __Pyx_CLineForTraceback(tstate, c_line);
11101 }
11102 py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
11103 if (!py_code) {
11104 py_code = __Pyx_CreateCodeObjectForTraceback(
11105 funcname, c_line, py_line, filename);
11106 if (!py_code) goto bad;
11107 __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
11108 }
11109 py_frame = PyFrame_New(
11110 tstate, /*PyThreadState *tstate,*/
11111 py_code, /*PyCodeObject *code,*/
11112 __pyx_d, /*PyObject *globals,*/
11113 0 /*PyObject *locals*/
11114 );
11115 if (!py_frame) goto bad;
11116 __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
11117 PyTraceBack_Here(py_frame);
11118 bad:
11119 Py_XDECREF(py_code);
11120 Py_XDECREF(py_frame);
11121 }
11122
11123 /* CIntFromPyVerify */
11124 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
11125 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
11126 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
11127 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
11128 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
11129 {\
11130 func_type value = func_value;\
11131 if (sizeof(target_type) < sizeof(func_type)) {\
11132 if (unlikely(value != (func_type) (target_type) value)) {\
11133 func_type zero = 0;\
11134 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
11135 return (target_type) -1;\
11136 if (is_unsigned && unlikely(value < zero))\
11137 goto raise_neg_overflow;\
11138 else\
11139 goto raise_overflow;\
11140 }\
11141 }\
11142 return (target_type) value;\
11143 }
11144
11145 /* CIntToPy */
__Pyx_PyInt_From_uint32_t(uint32_t value)11146 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_uint32_t(uint32_t value) {
11147 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11148 #pragma GCC diagnostic push
11149 #pragma GCC diagnostic ignored "-Wconversion"
11150 #endif
11151 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
11152 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11153 #pragma GCC diagnostic pop
11154 #endif
11155 const int is_unsigned = neg_one > const_zero;
11156 if (is_unsigned) {
11157 if (sizeof(uint32_t) < sizeof(long)) {
11158 return PyInt_FromLong((long) value);
11159 } else if (sizeof(uint32_t) <= sizeof(unsigned long)) {
11160 return PyLong_FromUnsignedLong((unsigned long) value);
11161 #ifdef HAVE_LONG_LONG
11162 } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
11163 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11164 #endif
11165 }
11166 } else {
11167 if (sizeof(uint32_t) <= sizeof(long)) {
11168 return PyInt_FromLong((long) value);
11169 #ifdef HAVE_LONG_LONG
11170 } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
11171 return PyLong_FromLongLong((PY_LONG_LONG) value);
11172 #endif
11173 }
11174 }
11175 {
11176 int one = 1; int little = (int)*(unsigned char *)&one;
11177 unsigned char *bytes = (unsigned char *)&value;
11178 return _PyLong_FromByteArray(bytes, sizeof(uint32_t),
11179 little, !is_unsigned);
11180 }
11181 }
11182
11183 /* CIntToPy */
__Pyx_PyInt_From_long(long value)11184 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
11185 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11186 #pragma GCC diagnostic push
11187 #pragma GCC diagnostic ignored "-Wconversion"
11188 #endif
11189 const long neg_one = (long) -1, const_zero = (long) 0;
11190 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11191 #pragma GCC diagnostic pop
11192 #endif
11193 const int is_unsigned = neg_one > const_zero;
11194 if (is_unsigned) {
11195 if (sizeof(long) < sizeof(long)) {
11196 return PyInt_FromLong((long) value);
11197 } else if (sizeof(long) <= sizeof(unsigned long)) {
11198 return PyLong_FromUnsignedLong((unsigned long) value);
11199 #ifdef HAVE_LONG_LONG
11200 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11201 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11202 #endif
11203 }
11204 } else {
11205 if (sizeof(long) <= sizeof(long)) {
11206 return PyInt_FromLong((long) value);
11207 #ifdef HAVE_LONG_LONG
11208 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
11209 return PyLong_FromLongLong((PY_LONG_LONG) value);
11210 #endif
11211 }
11212 }
11213 {
11214 int one = 1; int little = (int)*(unsigned char *)&one;
11215 unsigned char *bytes = (unsigned char *)&value;
11216 return _PyLong_FromByteArray(bytes, sizeof(long),
11217 little, !is_unsigned);
11218 }
11219 }
11220
11221 /* CIntToPy */
__Pyx_PyInt_From_int(int value)11222 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
11223 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11224 #pragma GCC diagnostic push
11225 #pragma GCC diagnostic ignored "-Wconversion"
11226 #endif
11227 const int neg_one = (int) -1, const_zero = (int) 0;
11228 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11229 #pragma GCC diagnostic pop
11230 #endif
11231 const int is_unsigned = neg_one > const_zero;
11232 if (is_unsigned) {
11233 if (sizeof(int) < sizeof(long)) {
11234 return PyInt_FromLong((long) value);
11235 } else if (sizeof(int) <= sizeof(unsigned long)) {
11236 return PyLong_FromUnsignedLong((unsigned long) value);
11237 #ifdef HAVE_LONG_LONG
11238 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
11239 return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
11240 #endif
11241 }
11242 } else {
11243 if (sizeof(int) <= sizeof(long)) {
11244 return PyInt_FromLong((long) value);
11245 #ifdef HAVE_LONG_LONG
11246 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
11247 return PyLong_FromLongLong((PY_LONG_LONG) value);
11248 #endif
11249 }
11250 }
11251 {
11252 int one = 1; int little = (int)*(unsigned char *)&one;
11253 unsigned char *bytes = (unsigned char *)&value;
11254 return _PyLong_FromByteArray(bytes, sizeof(int),
11255 little, !is_unsigned);
11256 }
11257 }
11258
11259 /* CIntFromPy */
__Pyx_PyInt_As_int(PyObject * x)11260 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
11261 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11262 #pragma GCC diagnostic push
11263 #pragma GCC diagnostic ignored "-Wconversion"
11264 #endif
11265 const int neg_one = (int) -1, const_zero = (int) 0;
11266 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11267 #pragma GCC diagnostic pop
11268 #endif
11269 const int is_unsigned = neg_one > const_zero;
11270 #if PY_MAJOR_VERSION < 3
11271 if (likely(PyInt_Check(x))) {
11272 if (sizeof(int) < sizeof(long)) {
11273 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
11274 } else {
11275 long val = PyInt_AS_LONG(x);
11276 if (is_unsigned && unlikely(val < 0)) {
11277 goto raise_neg_overflow;
11278 }
11279 return (int) val;
11280 }
11281 } else
11282 #endif
11283 if (likely(PyLong_Check(x))) {
11284 if (is_unsigned) {
11285 #if CYTHON_USE_PYLONG_INTERNALS
11286 const digit* digits = ((PyLongObject*)x)->ob_digit;
11287 switch (Py_SIZE(x)) {
11288 case 0: return (int) 0;
11289 case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
11290 case 2:
11291 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
11292 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11293 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11294 } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
11295 return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11296 }
11297 }
11298 break;
11299 case 3:
11300 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
11301 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11302 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11303 } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
11304 return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11305 }
11306 }
11307 break;
11308 case 4:
11309 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
11310 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11311 __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])))
11312 } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
11313 return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
11314 }
11315 }
11316 break;
11317 }
11318 #endif
11319 #if CYTHON_COMPILING_IN_CPYTHON
11320 if (unlikely(Py_SIZE(x) < 0)) {
11321 goto raise_neg_overflow;
11322 }
11323 #else
11324 {
11325 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11326 if (unlikely(result < 0))
11327 return (int) -1;
11328 if (unlikely(result == 1))
11329 goto raise_neg_overflow;
11330 }
11331 #endif
11332 if (sizeof(int) <= sizeof(unsigned long)) {
11333 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
11334 #ifdef HAVE_LONG_LONG
11335 } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
11336 __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11337 #endif
11338 }
11339 } else {
11340 #if CYTHON_USE_PYLONG_INTERNALS
11341 const digit* digits = ((PyLongObject*)x)->ob_digit;
11342 switch (Py_SIZE(x)) {
11343 case 0: return (int) 0;
11344 case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
11345 case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
11346 case -2:
11347 if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
11348 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11349 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11350 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
11351 return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11352 }
11353 }
11354 break;
11355 case 2:
11356 if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
11357 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11358 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11359 } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
11360 return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11361 }
11362 }
11363 break;
11364 case -3:
11365 if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
11366 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11367 __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11368 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
11369 return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11370 }
11371 }
11372 break;
11373 case 3:
11374 if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
11375 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11376 __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11377 } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
11378 return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11379 }
11380 }
11381 break;
11382 case -4:
11383 if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
11384 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11385 __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])))
11386 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
11387 return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11388 }
11389 }
11390 break;
11391 case 4:
11392 if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
11393 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11394 __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])))
11395 } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
11396 return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
11397 }
11398 }
11399 break;
11400 }
11401 #endif
11402 if (sizeof(int) <= sizeof(long)) {
11403 __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
11404 #ifdef HAVE_LONG_LONG
11405 } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
11406 __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
11407 #endif
11408 }
11409 }
11410 {
11411 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11412 PyErr_SetString(PyExc_RuntimeError,
11413 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11414 #else
11415 int val;
11416 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11417 #if PY_MAJOR_VERSION < 3
11418 if (likely(v) && !PyLong_Check(v)) {
11419 PyObject *tmp = v;
11420 v = PyNumber_Long(tmp);
11421 Py_DECREF(tmp);
11422 }
11423 #endif
11424 if (likely(v)) {
11425 int one = 1; int is_little = (int)*(unsigned char *)&one;
11426 unsigned char *bytes = (unsigned char *)&val;
11427 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11428 bytes, sizeof(val),
11429 is_little, !is_unsigned);
11430 Py_DECREF(v);
11431 if (likely(!ret))
11432 return val;
11433 }
11434 #endif
11435 return (int) -1;
11436 }
11437 } else {
11438 int val;
11439 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11440 if (!tmp) return (int) -1;
11441 val = __Pyx_PyInt_As_int(tmp);
11442 Py_DECREF(tmp);
11443 return val;
11444 }
11445 raise_overflow:
11446 PyErr_SetString(PyExc_OverflowError,
11447 "value too large to convert to int");
11448 return (int) -1;
11449 raise_neg_overflow:
11450 PyErr_SetString(PyExc_OverflowError,
11451 "can't convert negative value to int");
11452 return (int) -1;
11453 }
11454
11455 /* CIntFromPy */
__Pyx_PyInt_As_uint32_t(PyObject * x)11456 static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
11457 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11458 #pragma GCC diagnostic push
11459 #pragma GCC diagnostic ignored "-Wconversion"
11460 #endif
11461 const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
11462 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11463 #pragma GCC diagnostic pop
11464 #endif
11465 const int is_unsigned = neg_one > const_zero;
11466 #if PY_MAJOR_VERSION < 3
11467 if (likely(PyInt_Check(x))) {
11468 if (sizeof(uint32_t) < sizeof(long)) {
11469 __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
11470 } else {
11471 long val = PyInt_AS_LONG(x);
11472 if (is_unsigned && unlikely(val < 0)) {
11473 goto raise_neg_overflow;
11474 }
11475 return (uint32_t) val;
11476 }
11477 } else
11478 #endif
11479 if (likely(PyLong_Check(x))) {
11480 if (is_unsigned) {
11481 #if CYTHON_USE_PYLONG_INTERNALS
11482 const digit* digits = ((PyLongObject*)x)->ob_digit;
11483 switch (Py_SIZE(x)) {
11484 case 0: return (uint32_t) 0;
11485 case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
11486 case 2:
11487 if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
11488 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11489 __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11490 } else if (8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT) {
11491 return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
11492 }
11493 }
11494 break;
11495 case 3:
11496 if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
11497 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11498 __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11499 } else if (8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT) {
11500 return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
11501 }
11502 }
11503 break;
11504 case 4:
11505 if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
11506 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11507 __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11508 } else if (8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT) {
11509 return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
11510 }
11511 }
11512 break;
11513 }
11514 #endif
11515 #if CYTHON_COMPILING_IN_CPYTHON
11516 if (unlikely(Py_SIZE(x) < 0)) {
11517 goto raise_neg_overflow;
11518 }
11519 #else
11520 {
11521 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11522 if (unlikely(result < 0))
11523 return (uint32_t) -1;
11524 if (unlikely(result == 1))
11525 goto raise_neg_overflow;
11526 }
11527 #endif
11528 if (sizeof(uint32_t) <= sizeof(unsigned long)) {
11529 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
11530 #ifdef HAVE_LONG_LONG
11531 } else if (sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG)) {
11532 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11533 #endif
11534 }
11535 } else {
11536 #if CYTHON_USE_PYLONG_INTERNALS
11537 const digit* digits = ((PyLongObject*)x)->ob_digit;
11538 switch (Py_SIZE(x)) {
11539 case 0: return (uint32_t) 0;
11540 case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
11541 case 1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, +digits[0])
11542 case -2:
11543 if (8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT) {
11544 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11545 __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11546 } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
11547 return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
11548 }
11549 }
11550 break;
11551 case 2:
11552 if (8 * sizeof(uint32_t) > 1 * PyLong_SHIFT) {
11553 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11554 __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11555 } else if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
11556 return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
11557 }
11558 }
11559 break;
11560 case -3:
11561 if (8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT) {
11562 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11563 __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11564 } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
11565 return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
11566 }
11567 }
11568 break;
11569 case 3:
11570 if (8 * sizeof(uint32_t) > 2 * PyLong_SHIFT) {
11571 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11572 __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11573 } else if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
11574 return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
11575 }
11576 }
11577 break;
11578 case -4:
11579 if (8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT) {
11580 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11581 __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11582 } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
11583 return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
11584 }
11585 }
11586 break;
11587 case 4:
11588 if (8 * sizeof(uint32_t) > 3 * PyLong_SHIFT) {
11589 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11590 __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11591 } else if (8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT) {
11592 return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
11593 }
11594 }
11595 break;
11596 }
11597 #endif
11598 if (sizeof(uint32_t) <= sizeof(long)) {
11599 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
11600 #ifdef HAVE_LONG_LONG
11601 } else if (sizeof(uint32_t) <= sizeof(PY_LONG_LONG)) {
11602 __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
11603 #endif
11604 }
11605 }
11606 {
11607 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11608 PyErr_SetString(PyExc_RuntimeError,
11609 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11610 #else
11611 uint32_t val;
11612 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11613 #if PY_MAJOR_VERSION < 3
11614 if (likely(v) && !PyLong_Check(v)) {
11615 PyObject *tmp = v;
11616 v = PyNumber_Long(tmp);
11617 Py_DECREF(tmp);
11618 }
11619 #endif
11620 if (likely(v)) {
11621 int one = 1; int is_little = (int)*(unsigned char *)&one;
11622 unsigned char *bytes = (unsigned char *)&val;
11623 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11624 bytes, sizeof(val),
11625 is_little, !is_unsigned);
11626 Py_DECREF(v);
11627 if (likely(!ret))
11628 return val;
11629 }
11630 #endif
11631 return (uint32_t) -1;
11632 }
11633 } else {
11634 uint32_t val;
11635 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11636 if (!tmp) return (uint32_t) -1;
11637 val = __Pyx_PyInt_As_uint32_t(tmp);
11638 Py_DECREF(tmp);
11639 return val;
11640 }
11641 raise_overflow:
11642 PyErr_SetString(PyExc_OverflowError,
11643 "value too large to convert to uint32_t");
11644 return (uint32_t) -1;
11645 raise_neg_overflow:
11646 PyErr_SetString(PyExc_OverflowError,
11647 "can't convert negative value to uint32_t");
11648 return (uint32_t) -1;
11649 }
11650
11651 /* CIntFromPy */
__Pyx_PyInt_As_long(PyObject * x)11652 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
11653 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11654 #pragma GCC diagnostic push
11655 #pragma GCC diagnostic ignored "-Wconversion"
11656 #endif
11657 const long neg_one = (long) -1, const_zero = (long) 0;
11658 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
11659 #pragma GCC diagnostic pop
11660 #endif
11661 const int is_unsigned = neg_one > const_zero;
11662 #if PY_MAJOR_VERSION < 3
11663 if (likely(PyInt_Check(x))) {
11664 if (sizeof(long) < sizeof(long)) {
11665 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
11666 } else {
11667 long val = PyInt_AS_LONG(x);
11668 if (is_unsigned && unlikely(val < 0)) {
11669 goto raise_neg_overflow;
11670 }
11671 return (long) val;
11672 }
11673 } else
11674 #endif
11675 if (likely(PyLong_Check(x))) {
11676 if (is_unsigned) {
11677 #if CYTHON_USE_PYLONG_INTERNALS
11678 const digit* digits = ((PyLongObject*)x)->ob_digit;
11679 switch (Py_SIZE(x)) {
11680 case 0: return (long) 0;
11681 case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
11682 case 2:
11683 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11684 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11685 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11686 } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
11687 return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11688 }
11689 }
11690 break;
11691 case 3:
11692 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11693 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11694 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11695 } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
11696 return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11697 }
11698 }
11699 break;
11700 case 4:
11701 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11702 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11703 __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])))
11704 } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
11705 return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
11706 }
11707 }
11708 break;
11709 }
11710 #endif
11711 #if CYTHON_COMPILING_IN_CPYTHON
11712 if (unlikely(Py_SIZE(x) < 0)) {
11713 goto raise_neg_overflow;
11714 }
11715 #else
11716 {
11717 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
11718 if (unlikely(result < 0))
11719 return (long) -1;
11720 if (unlikely(result == 1))
11721 goto raise_neg_overflow;
11722 }
11723 #endif
11724 if (sizeof(long) <= sizeof(unsigned long)) {
11725 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
11726 #ifdef HAVE_LONG_LONG
11727 } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
11728 __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
11729 #endif
11730 }
11731 } else {
11732 #if CYTHON_USE_PYLONG_INTERNALS
11733 const digit* digits = ((PyLongObject*)x)->ob_digit;
11734 switch (Py_SIZE(x)) {
11735 case 0: return (long) 0;
11736 case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
11737 case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
11738 case -2:
11739 if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
11740 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11741 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11742 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11743 return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11744 }
11745 }
11746 break;
11747 case 2:
11748 if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
11749 if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
11750 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11751 } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11752 return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11753 }
11754 }
11755 break;
11756 case -3:
11757 if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
11758 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11759 __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11760 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11761 return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11762 }
11763 }
11764 break;
11765 case 3:
11766 if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
11767 if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
11768 __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
11769 } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11770 return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11771 }
11772 }
11773 break;
11774 case -4:
11775 if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
11776 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11777 __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])))
11778 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
11779 return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11780 }
11781 }
11782 break;
11783 case 4:
11784 if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
11785 if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
11786 __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])))
11787 } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
11788 return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
11789 }
11790 }
11791 break;
11792 }
11793 #endif
11794 if (sizeof(long) <= sizeof(long)) {
11795 __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
11796 #ifdef HAVE_LONG_LONG
11797 } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
11798 __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
11799 #endif
11800 }
11801 }
11802 {
11803 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
11804 PyErr_SetString(PyExc_RuntimeError,
11805 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
11806 #else
11807 long val;
11808 PyObject *v = __Pyx_PyNumber_IntOrLong(x);
11809 #if PY_MAJOR_VERSION < 3
11810 if (likely(v) && !PyLong_Check(v)) {
11811 PyObject *tmp = v;
11812 v = PyNumber_Long(tmp);
11813 Py_DECREF(tmp);
11814 }
11815 #endif
11816 if (likely(v)) {
11817 int one = 1; int is_little = (int)*(unsigned char *)&one;
11818 unsigned char *bytes = (unsigned char *)&val;
11819 int ret = _PyLong_AsByteArray((PyLongObject *)v,
11820 bytes, sizeof(val),
11821 is_little, !is_unsigned);
11822 Py_DECREF(v);
11823 if (likely(!ret))
11824 return val;
11825 }
11826 #endif
11827 return (long) -1;
11828 }
11829 } else {
11830 long val;
11831 PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
11832 if (!tmp) return (long) -1;
11833 val = __Pyx_PyInt_As_long(tmp);
11834 Py_DECREF(tmp);
11835 return val;
11836 }
11837 raise_overflow:
11838 PyErr_SetString(PyExc_OverflowError,
11839 "value too large to convert to long");
11840 return (long) -1;
11841 raise_neg_overflow:
11842 PyErr_SetString(PyExc_OverflowError,
11843 "can't convert negative value to long");
11844 return (long) -1;
11845 }
11846
11847 /* FastTypeChecks */
11848 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_InBases(PyTypeObject * a,PyTypeObject * b)11849 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
11850 while (a) {
11851 a = a->tp_base;
11852 if (a == b)
11853 return 1;
11854 }
11855 return b == &PyBaseObject_Type;
11856 }
__Pyx_IsSubtype(PyTypeObject * a,PyTypeObject * b)11857 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
11858 PyObject *mro;
11859 if (a == b) return 1;
11860 mro = a->tp_mro;
11861 if (likely(mro)) {
11862 Py_ssize_t i, n;
11863 n = PyTuple_GET_SIZE(mro);
11864 for (i = 0; i < n; i++) {
11865 if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
11866 return 1;
11867 }
11868 return 0;
11869 }
11870 return __Pyx_InBases(a, b);
11871 }
11872 #if PY_MAJOR_VERSION == 2
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11873 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
11874 PyObject *exception, *value, *tb;
11875 int res;
11876 __Pyx_PyThreadState_declare
11877 __Pyx_PyThreadState_assign
11878 __Pyx_ErrFetch(&exception, &value, &tb);
11879 res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
11880 if (unlikely(res == -1)) {
11881 PyErr_WriteUnraisable(err);
11882 res = 0;
11883 }
11884 if (!res) {
11885 res = PyObject_IsSubclass(err, exc_type2);
11886 if (unlikely(res == -1)) {
11887 PyErr_WriteUnraisable(err);
11888 res = 0;
11889 }
11890 }
11891 __Pyx_ErrRestore(exception, value, tb);
11892 return res;
11893 }
11894 #else
__Pyx_inner_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11895 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
11896 int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
11897 if (!res) {
11898 res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
11899 }
11900 return res;
11901 }
11902 #endif
__Pyx_PyErr_GivenExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)11903 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
11904 Py_ssize_t i, n;
11905 assert(PyExceptionClass_Check(exc_type));
11906 n = PyTuple_GET_SIZE(tuple);
11907 #if PY_MAJOR_VERSION >= 3
11908 for (i=0; i<n; i++) {
11909 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
11910 }
11911 #endif
11912 for (i=0; i<n; i++) {
11913 PyObject *t = PyTuple_GET_ITEM(tuple, i);
11914 #if PY_MAJOR_VERSION < 3
11915 if (likely(exc_type == t)) return 1;
11916 #endif
11917 if (likely(PyExceptionClass_Check(t))) {
11918 if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
11919 } else {
11920 }
11921 }
11922 return 0;
11923 }
__Pyx_PyErr_GivenExceptionMatches(PyObject * err,PyObject * exc_type)11924 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
11925 if (likely(err == exc_type)) return 1;
11926 if (likely(PyExceptionClass_Check(err))) {
11927 if (likely(PyExceptionClass_Check(exc_type))) {
11928 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
11929 } else if (likely(PyTuple_Check(exc_type))) {
11930 return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
11931 } else {
11932 }
11933 }
11934 return PyErr_GivenExceptionMatches(err, exc_type);
11935 }
__Pyx_PyErr_GivenExceptionMatches2(PyObject * err,PyObject * exc_type1,PyObject * exc_type2)11936 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
11937 assert(PyExceptionClass_Check(exc_type1));
11938 assert(PyExceptionClass_Check(exc_type2));
11939 if (likely(err == exc_type1 || err == exc_type2)) return 1;
11940 if (likely(PyExceptionClass_Check(err))) {
11941 return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
11942 }
11943 return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
11944 }
11945 #endif
11946
11947 /* FetchCommonType */
__Pyx_FetchCommonType(PyTypeObject * type)11948 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
11949 PyObject* fake_module;
11950 PyTypeObject* cached_type = NULL;
11951 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
11952 if (!fake_module) return NULL;
11953 Py_INCREF(fake_module);
11954 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
11955 if (cached_type) {
11956 if (!PyType_Check((PyObject*)cached_type)) {
11957 PyErr_Format(PyExc_TypeError,
11958 "Shared Cython type %.200s is not a type object",
11959 type->tp_name);
11960 goto bad;
11961 }
11962 if (cached_type->tp_basicsize != type->tp_basicsize) {
11963 PyErr_Format(PyExc_TypeError,
11964 "Shared Cython type %.200s has the wrong size, try recompiling",
11965 type->tp_name);
11966 goto bad;
11967 }
11968 } else {
11969 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
11970 PyErr_Clear();
11971 if (PyType_Ready(type) < 0) goto bad;
11972 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
11973 goto bad;
11974 Py_INCREF(type);
11975 cached_type = type;
11976 }
11977 done:
11978 Py_DECREF(fake_module);
11979 return cached_type;
11980 bad:
11981 Py_XDECREF(cached_type);
11982 cached_type = NULL;
11983 goto done;
11984 }
11985
11986 /* GetTopmostException */
11987 #if CYTHON_USE_EXC_INFO_STACK
11988 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)11989 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11990 {
11991 _PyErr_StackItem *exc_info = tstate->exc_info;
11992 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
11993 exc_info->previous_item != NULL)
11994 {
11995 exc_info = exc_info->previous_item;
11996 }
11997 return exc_info;
11998 }
11999 #endif
12000
12001 /* SaveResetException */
12002 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSave(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)12003 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
12004 #if CYTHON_USE_EXC_INFO_STACK
12005 _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
12006 *type = exc_info->exc_type;
12007 *value = exc_info->exc_value;
12008 *tb = exc_info->exc_traceback;
12009 #else
12010 *type = tstate->exc_type;
12011 *value = tstate->exc_value;
12012 *tb = tstate->exc_traceback;
12013 #endif
12014 Py_XINCREF(*type);
12015 Py_XINCREF(*value);
12016 Py_XINCREF(*tb);
12017 }
__Pyx__ExceptionReset(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)12018 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
12019 PyObject *tmp_type, *tmp_value, *tmp_tb;
12020 #if CYTHON_USE_EXC_INFO_STACK
12021 _PyErr_StackItem *exc_info = tstate->exc_info;
12022 tmp_type = exc_info->exc_type;
12023 tmp_value = exc_info->exc_value;
12024 tmp_tb = exc_info->exc_traceback;
12025 exc_info->exc_type = type;
12026 exc_info->exc_value = value;
12027 exc_info->exc_traceback = tb;
12028 #else
12029 tmp_type = tstate->exc_type;
12030 tmp_value = tstate->exc_value;
12031 tmp_tb = tstate->exc_traceback;
12032 tstate->exc_type = type;
12033 tstate->exc_value = value;
12034 tstate->exc_traceback = tb;
12035 #endif
12036 Py_XDECREF(tmp_type);
12037 Py_XDECREF(tmp_value);
12038 Py_XDECREF(tmp_tb);
12039 }
12040 #endif
12041
12042 /* SwapException */
12043 #if CYTHON_FAST_THREAD_STATE
__Pyx__ExceptionSwap(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)12044 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
12045 PyObject *tmp_type, *tmp_value, *tmp_tb;
12046 #if CYTHON_USE_EXC_INFO_STACK
12047 _PyErr_StackItem *exc_info = tstate->exc_info;
12048 tmp_type = exc_info->exc_type;
12049 tmp_value = exc_info->exc_value;
12050 tmp_tb = exc_info->exc_traceback;
12051 exc_info->exc_type = *type;
12052 exc_info->exc_value = *value;
12053 exc_info->exc_traceback = *tb;
12054 #else
12055 tmp_type = tstate->exc_type;
12056 tmp_value = tstate->exc_value;
12057 tmp_tb = tstate->exc_traceback;
12058 tstate->exc_type = *type;
12059 tstate->exc_value = *value;
12060 tstate->exc_traceback = *tb;
12061 #endif
12062 *type = tmp_type;
12063 *value = tmp_value;
12064 *tb = tmp_tb;
12065 }
12066 #else
__Pyx_ExceptionSwap(PyObject ** type,PyObject ** value,PyObject ** tb)12067 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
12068 PyObject *tmp_type, *tmp_value, *tmp_tb;
12069 PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
12070 PyErr_SetExcInfo(*type, *value, *tb);
12071 *type = tmp_type;
12072 *value = tmp_value;
12073 *tb = tmp_tb;
12074 }
12075 #endif
12076
12077 /* PyObjectGetMethod */
__Pyx_PyObject_GetMethod(PyObject * obj,PyObject * name,PyObject ** method)12078 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
12079 PyObject *attr;
12080 #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
12081 PyTypeObject *tp = Py_TYPE(obj);
12082 PyObject *descr;
12083 descrgetfunc f = NULL;
12084 PyObject **dictptr, *dict;
12085 int meth_found = 0;
12086 assert (*method == NULL);
12087 if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
12088 attr = __Pyx_PyObject_GetAttrStr(obj, name);
12089 goto try_unpack;
12090 }
12091 if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
12092 return 0;
12093 }
12094 descr = _PyType_Lookup(tp, name);
12095 if (likely(descr != NULL)) {
12096 Py_INCREF(descr);
12097 #if PY_MAJOR_VERSION >= 3
12098 #ifdef __Pyx_CyFunction_USED
12099 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
12100 #else
12101 if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
12102 #endif
12103 #else
12104 #ifdef __Pyx_CyFunction_USED
12105 if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
12106 #else
12107 if (likely(PyFunction_Check(descr)))
12108 #endif
12109 #endif
12110 {
12111 meth_found = 1;
12112 } else {
12113 f = Py_TYPE(descr)->tp_descr_get;
12114 if (f != NULL && PyDescr_IsData(descr)) {
12115 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
12116 Py_DECREF(descr);
12117 goto try_unpack;
12118 }
12119 }
12120 }
12121 dictptr = _PyObject_GetDictPtr(obj);
12122 if (dictptr != NULL && (dict = *dictptr) != NULL) {
12123 Py_INCREF(dict);
12124 attr = __Pyx_PyDict_GetItemStr(dict, name);
12125 if (attr != NULL) {
12126 Py_INCREF(attr);
12127 Py_DECREF(dict);
12128 Py_XDECREF(descr);
12129 goto try_unpack;
12130 }
12131 Py_DECREF(dict);
12132 }
12133 if (meth_found) {
12134 *method = descr;
12135 return 1;
12136 }
12137 if (f != NULL) {
12138 attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
12139 Py_DECREF(descr);
12140 goto try_unpack;
12141 }
12142 if (descr != NULL) {
12143 *method = descr;
12144 return 0;
12145 }
12146 PyErr_Format(PyExc_AttributeError,
12147 #if PY_MAJOR_VERSION >= 3
12148 "'%.50s' object has no attribute '%U'",
12149 tp->tp_name, name);
12150 #else
12151 "'%.50s' object has no attribute '%.400s'",
12152 tp->tp_name, PyString_AS_STRING(name));
12153 #endif
12154 return 0;
12155 #else
12156 attr = __Pyx_PyObject_GetAttrStr(obj, name);
12157 goto try_unpack;
12158 #endif
12159 try_unpack:
12160 #if CYTHON_UNPACK_METHODS
12161 if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
12162 PyObject *function = PyMethod_GET_FUNCTION(attr);
12163 Py_INCREF(function);
12164 Py_DECREF(attr);
12165 *method = function;
12166 return 1;
12167 }
12168 #endif
12169 *method = attr;
12170 return 0;
12171 }
12172
12173 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)12174 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
12175 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
12176 Py_DECREF(method);
12177 return result;
12178 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)12179 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
12180 PyObject *method = NULL, *result;
12181 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
12182 if (likely(is_method)) {
12183 result = __Pyx_PyObject_Call2Args(method, obj, arg);
12184 Py_DECREF(method);
12185 return result;
12186 }
12187 if (unlikely(!method)) return NULL;
12188 return __Pyx__PyObject_CallMethod1(method, arg);
12189 }
12190
12191 /* CoroutineBase */
12192 #include <structmember.h>
12193 #include <frameobject.h>
12194 #define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
__Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState * __pyx_tstate,PyObject ** pvalue)12195 static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
12196 PyObject *et, *ev, *tb;
12197 PyObject *value = NULL;
12198 __Pyx_ErrFetch(&et, &ev, &tb);
12199 if (!et) {
12200 Py_XDECREF(tb);
12201 Py_XDECREF(ev);
12202 Py_INCREF(Py_None);
12203 *pvalue = Py_None;
12204 return 0;
12205 }
12206 if (likely(et == PyExc_StopIteration)) {
12207 if (!ev) {
12208 Py_INCREF(Py_None);
12209 value = Py_None;
12210 }
12211 #if PY_VERSION_HEX >= 0x030300A0
12212 else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
12213 value = ((PyStopIterationObject *)ev)->value;
12214 Py_INCREF(value);
12215 Py_DECREF(ev);
12216 }
12217 #endif
12218 else if (unlikely(PyTuple_Check(ev))) {
12219 if (PyTuple_GET_SIZE(ev) >= 1) {
12220 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12221 value = PyTuple_GET_ITEM(ev, 0);
12222 Py_INCREF(value);
12223 #else
12224 value = PySequence_ITEM(ev, 0);
12225 #endif
12226 } else {
12227 Py_INCREF(Py_None);
12228 value = Py_None;
12229 }
12230 Py_DECREF(ev);
12231 }
12232 else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
12233 value = ev;
12234 }
12235 if (likely(value)) {
12236 Py_XDECREF(tb);
12237 Py_DECREF(et);
12238 *pvalue = value;
12239 return 0;
12240 }
12241 } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
12242 __Pyx_ErrRestore(et, ev, tb);
12243 return -1;
12244 }
12245 PyErr_NormalizeException(&et, &ev, &tb);
12246 if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
12247 __Pyx_ErrRestore(et, ev, tb);
12248 return -1;
12249 }
12250 Py_XDECREF(tb);
12251 Py_DECREF(et);
12252 #if PY_VERSION_HEX >= 0x030300A0
12253 value = ((PyStopIterationObject *)ev)->value;
12254 Py_INCREF(value);
12255 Py_DECREF(ev);
12256 #else
12257 {
12258 PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
12259 Py_DECREF(ev);
12260 if (likely(args)) {
12261 value = PySequence_GetItem(args, 0);
12262 Py_DECREF(args);
12263 }
12264 if (unlikely(!value)) {
12265 __Pyx_ErrRestore(NULL, NULL, NULL);
12266 Py_INCREF(Py_None);
12267 value = Py_None;
12268 }
12269 }
12270 #endif
12271 *pvalue = value;
12272 return 0;
12273 }
12274 static CYTHON_INLINE
__Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct * exc_state)12275 void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
12276 PyObject *t, *v, *tb;
12277 t = exc_state->exc_type;
12278 v = exc_state->exc_value;
12279 tb = exc_state->exc_traceback;
12280 exc_state->exc_type = NULL;
12281 exc_state->exc_value = NULL;
12282 exc_state->exc_traceback = NULL;
12283 Py_XDECREF(t);
12284 Py_XDECREF(v);
12285 Py_XDECREF(tb);
12286 }
12287 #define __Pyx_Coroutine_AlreadyRunningError(gen) (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject * gen)12288 static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
12289 const char *msg;
12290 if ((0)) {
12291 #ifdef __Pyx_Coroutine_USED
12292 } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
12293 msg = "coroutine already executing";
12294 #endif
12295 #ifdef __Pyx_AsyncGen_USED
12296 } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
12297 msg = "async generator already executing";
12298 #endif
12299 } else {
12300 msg = "generator already executing";
12301 }
12302 PyErr_SetString(PyExc_ValueError, msg);
12303 }
12304 #define __Pyx_Coroutine_NotStartedError(gen) (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
__Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject * gen)12305 static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
12306 const char *msg;
12307 if ((0)) {
12308 #ifdef __Pyx_Coroutine_USED
12309 } else if (__Pyx_Coroutine_Check(gen)) {
12310 msg = "can't send non-None value to a just-started coroutine";
12311 #endif
12312 #ifdef __Pyx_AsyncGen_USED
12313 } else if (__Pyx_AsyncGen_CheckExact(gen)) {
12314 msg = "can't send non-None value to a just-started async generator";
12315 #endif
12316 } else {
12317 msg = "can't send non-None value to a just-started generator";
12318 }
12319 PyErr_SetString(PyExc_TypeError, msg);
12320 }
12321 #define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing) (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
__Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject * gen,PyObject * value,CYTHON_UNUSED int closing)12322 static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
12323 #ifdef __Pyx_Coroutine_USED
12324 if (!closing && __Pyx_Coroutine_Check(gen)) {
12325 PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
12326 } else
12327 #endif
12328 if (value) {
12329 #ifdef __Pyx_AsyncGen_USED
12330 if (__Pyx_AsyncGen_CheckExact(gen))
12331 PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
12332 else
12333 #endif
12334 PyErr_SetNone(PyExc_StopIteration);
12335 }
12336 }
12337 static
__Pyx_Coroutine_SendEx(__pyx_CoroutineObject * self,PyObject * value,int closing)12338 PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
12339 __Pyx_PyThreadState_declare
12340 PyThreadState *tstate;
12341 __Pyx_ExcInfoStruct *exc_state;
12342 PyObject *retval;
12343 assert(!self->is_running);
12344 if (unlikely(self->resume_label == 0)) {
12345 if (unlikely(value && value != Py_None)) {
12346 return __Pyx_Coroutine_NotStartedError((PyObject*)self);
12347 }
12348 }
12349 if (unlikely(self->resume_label == -1)) {
12350 return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
12351 }
12352 #if CYTHON_FAST_THREAD_STATE
12353 __Pyx_PyThreadState_assign
12354 tstate = __pyx_tstate;
12355 #else
12356 tstate = __Pyx_PyThreadState_Current;
12357 #endif
12358 exc_state = &self->gi_exc_state;
12359 if (exc_state->exc_type) {
12360 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
12361 #else
12362 if (exc_state->exc_traceback) {
12363 PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
12364 PyFrameObject *f = tb->tb_frame;
12365 Py_XINCREF(tstate->frame);
12366 assert(f->f_back == NULL);
12367 f->f_back = tstate->frame;
12368 }
12369 #endif
12370 }
12371 #if CYTHON_USE_EXC_INFO_STACK
12372 exc_state->previous_item = tstate->exc_info;
12373 tstate->exc_info = exc_state;
12374 #else
12375 if (exc_state->exc_type) {
12376 __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
12377 } else {
12378 __Pyx_Coroutine_ExceptionClear(exc_state);
12379 __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
12380 }
12381 #endif
12382 self->is_running = 1;
12383 retval = self->body((PyObject *) self, tstate, value);
12384 self->is_running = 0;
12385 #if CYTHON_USE_EXC_INFO_STACK
12386 exc_state = &self->gi_exc_state;
12387 tstate->exc_info = exc_state->previous_item;
12388 exc_state->previous_item = NULL;
12389 __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
12390 #endif
12391 return retval;
12392 }
__Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct * exc_state)12393 static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
12394 PyObject *exc_tb = exc_state->exc_traceback;
12395 if (likely(exc_tb)) {
12396 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
12397 #else
12398 PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
12399 PyFrameObject *f = tb->tb_frame;
12400 Py_CLEAR(f->f_back);
12401 #endif
12402 }
12403 }
12404 static CYTHON_INLINE
__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject * gen,PyObject * retval)12405 PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
12406 if (unlikely(!retval)) {
12407 __Pyx_PyThreadState_declare
12408 __Pyx_PyThreadState_assign
12409 if (!__Pyx_PyErr_Occurred()) {
12410 PyObject *exc = PyExc_StopIteration;
12411 #ifdef __Pyx_AsyncGen_USED
12412 if (__Pyx_AsyncGen_CheckExact(gen))
12413 exc = __Pyx_PyExc_StopAsyncIteration;
12414 #endif
12415 __Pyx_PyErr_SetNone(exc);
12416 }
12417 }
12418 return retval;
12419 }
12420 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
12421 static CYTHON_INLINE
__Pyx_PyGen_Send(PyGenObject * gen,PyObject * arg)12422 PyObject *__Pyx_PyGen_Send(PyGenObject *gen, PyObject *arg) {
12423 #if PY_VERSION_HEX <= 0x030A00A1
12424 return _PyGen_Send(gen, arg);
12425 #else
12426 PyObject *result;
12427 if (PyIter_Send((PyObject*)gen, arg ? arg : Py_None, &result) == PYGEN_RETURN) {
12428 if (PyAsyncGen_CheckExact(gen)) {
12429 assert(result == Py_None);
12430 PyErr_SetNone(PyExc_StopAsyncIteration);
12431 }
12432 else if (result == Py_None) {
12433 PyErr_SetNone(PyExc_StopIteration);
12434 }
12435 else {
12436 _PyGen_SetStopIterationValue(result);
12437 }
12438 Py_CLEAR(result);
12439 }
12440 return result;
12441 #endif
12442 }
12443 #endif
12444 static CYTHON_INLINE
__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject * gen)12445 PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
12446 PyObject *ret;
12447 PyObject *val = NULL;
12448 __Pyx_Coroutine_Undelegate(gen);
12449 __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
12450 ret = __Pyx_Coroutine_SendEx(gen, val, 0);
12451 Py_XDECREF(val);
12452 return ret;
12453 }
__Pyx_Coroutine_Send(PyObject * self,PyObject * value)12454 static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
12455 PyObject *retval;
12456 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
12457 PyObject *yf = gen->yieldfrom;
12458 if (unlikely(gen->is_running))
12459 return __Pyx_Coroutine_AlreadyRunningError(gen);
12460 if (yf) {
12461 PyObject *ret;
12462 gen->is_running = 1;
12463 #ifdef __Pyx_Generator_USED
12464 if (__Pyx_Generator_CheckExact(yf)) {
12465 ret = __Pyx_Coroutine_Send(yf, value);
12466 } else
12467 #endif
12468 #ifdef __Pyx_Coroutine_USED
12469 if (__Pyx_Coroutine_Check(yf)) {
12470 ret = __Pyx_Coroutine_Send(yf, value);
12471 } else
12472 #endif
12473 #ifdef __Pyx_AsyncGen_USED
12474 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
12475 ret = __Pyx_async_gen_asend_send(yf, value);
12476 } else
12477 #endif
12478 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
12479 if (PyGen_CheckExact(yf)) {
12480 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
12481 } else
12482 #endif
12483 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
12484 if (PyCoro_CheckExact(yf)) {
12485 ret = __Pyx_PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
12486 } else
12487 #endif
12488 {
12489 if (value == Py_None)
12490 ret = Py_TYPE(yf)->tp_iternext(yf);
12491 else
12492 ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
12493 }
12494 gen->is_running = 0;
12495 if (likely(ret)) {
12496 return ret;
12497 }
12498 retval = __Pyx_Coroutine_FinishDelegation(gen);
12499 } else {
12500 retval = __Pyx_Coroutine_SendEx(gen, value, 0);
12501 }
12502 return __Pyx_Coroutine_MethodReturn(self, retval);
12503 }
__Pyx_Coroutine_CloseIter(__pyx_CoroutineObject * gen,PyObject * yf)12504 static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
12505 PyObject *retval = NULL;
12506 int err = 0;
12507 #ifdef __Pyx_Generator_USED
12508 if (__Pyx_Generator_CheckExact(yf)) {
12509 retval = __Pyx_Coroutine_Close(yf);
12510 if (!retval)
12511 return -1;
12512 } else
12513 #endif
12514 #ifdef __Pyx_Coroutine_USED
12515 if (__Pyx_Coroutine_Check(yf)) {
12516 retval = __Pyx_Coroutine_Close(yf);
12517 if (!retval)
12518 return -1;
12519 } else
12520 if (__Pyx_CoroutineAwait_CheckExact(yf)) {
12521 retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
12522 if (!retval)
12523 return -1;
12524 } else
12525 #endif
12526 #ifdef __Pyx_AsyncGen_USED
12527 if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
12528 retval = __Pyx_async_gen_asend_close(yf, NULL);
12529 } else
12530 if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
12531 retval = __Pyx_async_gen_athrow_close(yf, NULL);
12532 } else
12533 #endif
12534 {
12535 PyObject *meth;
12536 gen->is_running = 1;
12537 meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
12538 if (unlikely(!meth)) {
12539 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
12540 PyErr_WriteUnraisable(yf);
12541 }
12542 PyErr_Clear();
12543 } else {
12544 retval = PyObject_CallFunction(meth, NULL);
12545 Py_DECREF(meth);
12546 if (!retval)
12547 err = -1;
12548 }
12549 gen->is_running = 0;
12550 }
12551 Py_XDECREF(retval);
12552 return err;
12553 }
__Pyx_Generator_Next(PyObject * self)12554 static PyObject *__Pyx_Generator_Next(PyObject *self) {
12555 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
12556 PyObject *yf = gen->yieldfrom;
12557 if (unlikely(gen->is_running))
12558 return __Pyx_Coroutine_AlreadyRunningError(gen);
12559 if (yf) {
12560 PyObject *ret;
12561 gen->is_running = 1;
12562 #ifdef __Pyx_Generator_USED
12563 if (__Pyx_Generator_CheckExact(yf)) {
12564 ret = __Pyx_Generator_Next(yf);
12565 } else
12566 #endif
12567 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
12568 if (PyGen_CheckExact(yf)) {
12569 ret = __Pyx_PyGen_Send((PyGenObject*)yf, NULL);
12570 } else
12571 #endif
12572 #ifdef __Pyx_Coroutine_USED
12573 if (__Pyx_Coroutine_Check(yf)) {
12574 ret = __Pyx_Coroutine_Send(yf, Py_None);
12575 } else
12576 #endif
12577 ret = Py_TYPE(yf)->tp_iternext(yf);
12578 gen->is_running = 0;
12579 if (likely(ret)) {
12580 return ret;
12581 }
12582 return __Pyx_Coroutine_FinishDelegation(gen);
12583 }
12584 return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
12585 }
__Pyx_Coroutine_Close_Method(PyObject * self,CYTHON_UNUSED PyObject * arg)12586 static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
12587 return __Pyx_Coroutine_Close(self);
12588 }
__Pyx_Coroutine_Close(PyObject * self)12589 static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
12590 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12591 PyObject *retval, *raised_exception;
12592 PyObject *yf = gen->yieldfrom;
12593 int err = 0;
12594 if (unlikely(gen->is_running))
12595 return __Pyx_Coroutine_AlreadyRunningError(gen);
12596 if (yf) {
12597 Py_INCREF(yf);
12598 err = __Pyx_Coroutine_CloseIter(gen, yf);
12599 __Pyx_Coroutine_Undelegate(gen);
12600 Py_DECREF(yf);
12601 }
12602 if (err == 0)
12603 PyErr_SetNone(PyExc_GeneratorExit);
12604 retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
12605 if (unlikely(retval)) {
12606 const char *msg;
12607 Py_DECREF(retval);
12608 if ((0)) {
12609 #ifdef __Pyx_Coroutine_USED
12610 } else if (__Pyx_Coroutine_Check(self)) {
12611 msg = "coroutine ignored GeneratorExit";
12612 #endif
12613 #ifdef __Pyx_AsyncGen_USED
12614 } else if (__Pyx_AsyncGen_CheckExact(self)) {
12615 #if PY_VERSION_HEX < 0x03060000
12616 msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
12617 #else
12618 msg = "async generator ignored GeneratorExit";
12619 #endif
12620 #endif
12621 } else {
12622 msg = "generator ignored GeneratorExit";
12623 }
12624 PyErr_SetString(PyExc_RuntimeError, msg);
12625 return NULL;
12626 }
12627 raised_exception = PyErr_Occurred();
12628 if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
12629 if (raised_exception) PyErr_Clear();
12630 Py_INCREF(Py_None);
12631 return Py_None;
12632 }
12633 return NULL;
12634 }
__Pyx__Coroutine_Throw(PyObject * self,PyObject * typ,PyObject * val,PyObject * tb,PyObject * args,int close_on_genexit)12635 static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
12636 PyObject *args, int close_on_genexit) {
12637 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12638 PyObject *yf = gen->yieldfrom;
12639 if (unlikely(gen->is_running))
12640 return __Pyx_Coroutine_AlreadyRunningError(gen);
12641 if (yf) {
12642 PyObject *ret;
12643 Py_INCREF(yf);
12644 if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
12645 int err = __Pyx_Coroutine_CloseIter(gen, yf);
12646 Py_DECREF(yf);
12647 __Pyx_Coroutine_Undelegate(gen);
12648 if (err < 0)
12649 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
12650 goto throw_here;
12651 }
12652 gen->is_running = 1;
12653 if (0
12654 #ifdef __Pyx_Generator_USED
12655 || __Pyx_Generator_CheckExact(yf)
12656 #endif
12657 #ifdef __Pyx_Coroutine_USED
12658 || __Pyx_Coroutine_Check(yf)
12659 #endif
12660 ) {
12661 ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
12662 #ifdef __Pyx_Coroutine_USED
12663 } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
12664 ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
12665 #endif
12666 } else {
12667 PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
12668 if (unlikely(!meth)) {
12669 Py_DECREF(yf);
12670 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
12671 gen->is_running = 0;
12672 return NULL;
12673 }
12674 PyErr_Clear();
12675 __Pyx_Coroutine_Undelegate(gen);
12676 gen->is_running = 0;
12677 goto throw_here;
12678 }
12679 if (likely(args)) {
12680 ret = PyObject_CallObject(meth, args);
12681 } else {
12682 ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
12683 }
12684 Py_DECREF(meth);
12685 }
12686 gen->is_running = 0;
12687 Py_DECREF(yf);
12688 if (!ret) {
12689 ret = __Pyx_Coroutine_FinishDelegation(gen);
12690 }
12691 return __Pyx_Coroutine_MethodReturn(self, ret);
12692 }
12693 throw_here:
12694 __Pyx_Raise(typ, val, tb, NULL);
12695 return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
12696 }
__Pyx_Coroutine_Throw(PyObject * self,PyObject * args)12697 static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
12698 PyObject *typ;
12699 PyObject *val = NULL;
12700 PyObject *tb = NULL;
12701 if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
12702 return NULL;
12703 return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
12704 }
__Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct * exc_state,visitproc visit,void * arg)12705 static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
12706 Py_VISIT(exc_state->exc_type);
12707 Py_VISIT(exc_state->exc_value);
12708 Py_VISIT(exc_state->exc_traceback);
12709 return 0;
12710 }
__Pyx_Coroutine_traverse(__pyx_CoroutineObject * gen,visitproc visit,void * arg)12711 static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
12712 Py_VISIT(gen->closure);
12713 Py_VISIT(gen->classobj);
12714 Py_VISIT(gen->yieldfrom);
12715 return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
12716 }
__Pyx_Coroutine_clear(PyObject * self)12717 static int __Pyx_Coroutine_clear(PyObject *self) {
12718 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12719 Py_CLEAR(gen->closure);
12720 Py_CLEAR(gen->classobj);
12721 Py_CLEAR(gen->yieldfrom);
12722 __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
12723 #ifdef __Pyx_AsyncGen_USED
12724 if (__Pyx_AsyncGen_CheckExact(self)) {
12725 Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
12726 }
12727 #endif
12728 Py_CLEAR(gen->gi_code);
12729 Py_CLEAR(gen->gi_name);
12730 Py_CLEAR(gen->gi_qualname);
12731 Py_CLEAR(gen->gi_modulename);
12732 return 0;
12733 }
__Pyx_Coroutine_dealloc(PyObject * self)12734 static void __Pyx_Coroutine_dealloc(PyObject *self) {
12735 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12736 PyObject_GC_UnTrack(gen);
12737 if (gen->gi_weakreflist != NULL)
12738 PyObject_ClearWeakRefs(self);
12739 if (gen->resume_label >= 0) {
12740 PyObject_GC_Track(self);
12741 #if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
12742 if (PyObject_CallFinalizerFromDealloc(self))
12743 #else
12744 Py_TYPE(gen)->tp_del(self);
12745 if (self->ob_refcnt > 0)
12746 #endif
12747 {
12748 return;
12749 }
12750 PyObject_GC_UnTrack(self);
12751 }
12752 #ifdef __Pyx_AsyncGen_USED
12753 if (__Pyx_AsyncGen_CheckExact(self)) {
12754 /* We have to handle this case for asynchronous generators
12755 right here, because this code has to be between UNTRACK
12756 and GC_Del. */
12757 Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
12758 }
12759 #endif
12760 __Pyx_Coroutine_clear(self);
12761 PyObject_GC_Del(gen);
12762 }
__Pyx_Coroutine_del(PyObject * self)12763 static void __Pyx_Coroutine_del(PyObject *self) {
12764 PyObject *error_type, *error_value, *error_traceback;
12765 __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
12766 __Pyx_PyThreadState_declare
12767 if (gen->resume_label < 0) {
12768 return;
12769 }
12770 #if !CYTHON_USE_TP_FINALIZE
12771 assert(self->ob_refcnt == 0);
12772 __Pyx_SET_REFCNT(self, 1);
12773 #endif
12774 __Pyx_PyThreadState_assign
12775 __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
12776 #ifdef __Pyx_AsyncGen_USED
12777 if (__Pyx_AsyncGen_CheckExact(self)) {
12778 __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
12779 PyObject *finalizer = agen->ag_finalizer;
12780 if (finalizer && !agen->ag_closed) {
12781 PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
12782 if (unlikely(!res)) {
12783 PyErr_WriteUnraisable(self);
12784 } else {
12785 Py_DECREF(res);
12786 }
12787 __Pyx_ErrRestore(error_type, error_value, error_traceback);
12788 return;
12789 }
12790 }
12791 #endif
12792 if (unlikely(gen->resume_label == 0 && !error_value)) {
12793 #ifdef __Pyx_Coroutine_USED
12794 #ifdef __Pyx_Generator_USED
12795 if (!__Pyx_Generator_CheckExact(self))
12796 #endif
12797 {
12798 PyObject_GC_UnTrack(self);
12799 #if PY_MAJOR_VERSION >= 3 || defined(PyErr_WarnFormat)
12800 if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
12801 PyErr_WriteUnraisable(self);
12802 #else
12803 {PyObject *msg;
12804 char *cmsg;
12805 #if CYTHON_COMPILING_IN_PYPY
12806 msg = NULL;
12807 cmsg = (char*) "coroutine was never awaited";
12808 #else
12809 char *cname;
12810 PyObject *qualname;
12811 qualname = gen->gi_qualname;
12812 cname = PyString_AS_STRING(qualname);
12813 msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
12814 if (unlikely(!msg)) {
12815 PyErr_Clear();
12816 cmsg = (char*) "coroutine was never awaited";
12817 } else {
12818 cmsg = PyString_AS_STRING(msg);
12819 }
12820 #endif
12821 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
12822 PyErr_WriteUnraisable(self);
12823 Py_XDECREF(msg);}
12824 #endif
12825 PyObject_GC_Track(self);
12826 }
12827 #endif
12828 } else {
12829 PyObject *res = __Pyx_Coroutine_Close(self);
12830 if (unlikely(!res)) {
12831 if (PyErr_Occurred())
12832 PyErr_WriteUnraisable(self);
12833 } else {
12834 Py_DECREF(res);
12835 }
12836 }
12837 __Pyx_ErrRestore(error_type, error_value, error_traceback);
12838 #if !CYTHON_USE_TP_FINALIZE
12839 assert(self->ob_refcnt > 0);
12840 if (--self->ob_refcnt == 0) {
12841 return;
12842 }
12843 {
12844 Py_ssize_t refcnt = self->ob_refcnt;
12845 _Py_NewReference(self);
12846 __Pyx_SET_REFCNT(self, refcnt);
12847 }
12848 #if CYTHON_COMPILING_IN_CPYTHON
12849 assert(PyType_IS_GC(self->ob_type) &&
12850 _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
12851 _Py_DEC_REFTOTAL;
12852 #endif
12853 #ifdef COUNT_ALLOCS
12854 --Py_TYPE(self)->tp_frees;
12855 --Py_TYPE(self)->tp_allocs;
12856 #endif
12857 #endif
12858 }
12859 static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)12860 __Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
12861 {
12862 PyObject *name = self->gi_name;
12863 if (unlikely(!name)) name = Py_None;
12864 Py_INCREF(name);
12865 return name;
12866 }
12867 static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)12868 __Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
12869 {
12870 PyObject *tmp;
12871 #if PY_MAJOR_VERSION >= 3
12872 if (unlikely(value == NULL || !PyUnicode_Check(value)))
12873 #else
12874 if (unlikely(value == NULL || !PyString_Check(value)))
12875 #endif
12876 {
12877 PyErr_SetString(PyExc_TypeError,
12878 "__name__ must be set to a string object");
12879 return -1;
12880 }
12881 tmp = self->gi_name;
12882 Py_INCREF(value);
12883 self->gi_name = value;
12884 Py_XDECREF(tmp);
12885 return 0;
12886 }
12887 static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject * self,CYTHON_UNUSED void * context)12888 __Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
12889 {
12890 PyObject *name = self->gi_qualname;
12891 if (unlikely(!name)) name = Py_None;
12892 Py_INCREF(name);
12893 return name;
12894 }
12895 static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject * self,PyObject * value,CYTHON_UNUSED void * context)12896 __Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
12897 {
12898 PyObject *tmp;
12899 #if PY_MAJOR_VERSION >= 3
12900 if (unlikely(value == NULL || !PyUnicode_Check(value)))
12901 #else
12902 if (unlikely(value == NULL || !PyString_Check(value)))
12903 #endif
12904 {
12905 PyErr_SetString(PyExc_TypeError,
12906 "__qualname__ must be set to a string object");
12907 return -1;
12908 }
12909 tmp = self->gi_qualname;
12910 Py_INCREF(value);
12911 self->gi_qualname = value;
12912 Py_XDECREF(tmp);
12913 return 0;
12914 }
__Pyx__Coroutine_New(PyTypeObject * type,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)12915 static __pyx_CoroutineObject *__Pyx__Coroutine_New(
12916 PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
12917 PyObject *name, PyObject *qualname, PyObject *module_name) {
12918 __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
12919 if (unlikely(!gen))
12920 return NULL;
12921 return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
12922 }
__Pyx__Coroutine_NewInit(__pyx_CoroutineObject * gen,__pyx_coroutine_body_t body,PyObject * code,PyObject * closure,PyObject * name,PyObject * qualname,PyObject * module_name)12923 static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
12924 __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
12925 PyObject *name, PyObject *qualname, PyObject *module_name) {
12926 gen->body = body;
12927 gen->closure = closure;
12928 Py_XINCREF(closure);
12929 gen->is_running = 0;
12930 gen->resume_label = 0;
12931 gen->classobj = NULL;
12932 gen->yieldfrom = NULL;
12933 gen->gi_exc_state.exc_type = NULL;
12934 gen->gi_exc_state.exc_value = NULL;
12935 gen->gi_exc_state.exc_traceback = NULL;
12936 #if CYTHON_USE_EXC_INFO_STACK
12937 gen->gi_exc_state.previous_item = NULL;
12938 #endif
12939 gen->gi_weakreflist = NULL;
12940 Py_XINCREF(qualname);
12941 gen->gi_qualname = qualname;
12942 Py_XINCREF(name);
12943 gen->gi_name = name;
12944 Py_XINCREF(module_name);
12945 gen->gi_modulename = module_name;
12946 Py_XINCREF(code);
12947 gen->gi_code = code;
12948 PyObject_GC_Track(gen);
12949 return gen;
12950 }
12951
12952 /* PatchModuleWithCoroutine */
__Pyx_Coroutine_patch_module(PyObject * module,const char * py_code)12953 static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
12954 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12955 int result;
12956 PyObject *globals, *result_obj;
12957 globals = PyDict_New(); if (unlikely(!globals)) goto ignore;
12958 result = PyDict_SetItemString(globals, "_cython_coroutine_type",
12959 #ifdef __Pyx_Coroutine_USED
12960 (PyObject*)__pyx_CoroutineType);
12961 #else
12962 Py_None);
12963 #endif
12964 if (unlikely(result < 0)) goto ignore;
12965 result = PyDict_SetItemString(globals, "_cython_generator_type",
12966 #ifdef __Pyx_Generator_USED
12967 (PyObject*)__pyx_GeneratorType);
12968 #else
12969 Py_None);
12970 #endif
12971 if (unlikely(result < 0)) goto ignore;
12972 if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
12973 if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
12974 result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
12975 if (unlikely(!result_obj)) goto ignore;
12976 Py_DECREF(result_obj);
12977 Py_DECREF(globals);
12978 return module;
12979 ignore:
12980 Py_XDECREF(globals);
12981 PyErr_WriteUnraisable(module);
12982 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
12983 Py_DECREF(module);
12984 module = NULL;
12985 }
12986 #else
12987 py_code++;
12988 #endif
12989 return module;
12990 }
12991
12992 /* PatchGeneratorABC */
12993 #ifndef CYTHON_REGISTER_ABCS
12994 #define CYTHON_REGISTER_ABCS 1
12995 #endif
12996 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
12997 static PyObject* __Pyx_patch_abc_module(PyObject *module);
__Pyx_patch_abc_module(PyObject * module)12998 static PyObject* __Pyx_patch_abc_module(PyObject *module) {
12999 module = __Pyx_Coroutine_patch_module(
13000 module, ""
13001 "if _cython_generator_type is not None:\n"
13002 " try: Generator = _module.Generator\n"
13003 " except AttributeError: pass\n"
13004 " else: Generator.register(_cython_generator_type)\n"
13005 "if _cython_coroutine_type is not None:\n"
13006 " try: Coroutine = _module.Coroutine\n"
13007 " except AttributeError: pass\n"
13008 " else: Coroutine.register(_cython_coroutine_type)\n"
13009 );
13010 return module;
13011 }
13012 #endif
__Pyx_patch_abc(void)13013 static int __Pyx_patch_abc(void) {
13014 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
13015 static int abc_patched = 0;
13016 if (CYTHON_REGISTER_ABCS && !abc_patched) {
13017 PyObject *module;
13018 module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
13019 if (!module) {
13020 PyErr_WriteUnraisable(NULL);
13021 if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
13022 ((PY_MAJOR_VERSION >= 3) ?
13023 "Cython module failed to register with collections.abc module" :
13024 "Cython module failed to register with collections module"), 1) < 0)) {
13025 return -1;
13026 }
13027 } else {
13028 module = __Pyx_patch_abc_module(module);
13029 abc_patched = 1;
13030 if (unlikely(!module))
13031 return -1;
13032 Py_DECREF(module);
13033 }
13034 module = PyImport_ImportModule("backports_abc");
13035 if (module) {
13036 module = __Pyx_patch_abc_module(module);
13037 Py_XDECREF(module);
13038 }
13039 if (!module) {
13040 PyErr_Clear();
13041 }
13042 }
13043 #else
13044 if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
13045 #endif
13046 return 0;
13047 }
13048
13049 /* Generator */
13050 static PyMethodDef __pyx_Generator_methods[] = {
13051 {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
13052 (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
13053 {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
13054 (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
13055 {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
13056 (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
13057 {0, 0, 0, 0}
13058 };
13059 static PyMemberDef __pyx_Generator_memberlist[] = {
13060 {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
13061 {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
13062 (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
13063 {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
13064 {0, 0, 0, 0, 0}
13065 };
13066 static PyGetSetDef __pyx_Generator_getsets[] = {
13067 {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
13068 (char*) PyDoc_STR("name of the generator"), 0},
13069 {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
13070 (char*) PyDoc_STR("qualified name of the generator"), 0},
13071 {0, 0, 0, 0, 0}
13072 };
13073 static PyTypeObject __pyx_GeneratorType_type = {
13074 PyVarObject_HEAD_INIT(0, 0)
13075 "generator",
13076 sizeof(__pyx_CoroutineObject),
13077 0,
13078 (destructor) __Pyx_Coroutine_dealloc,
13079 0,
13080 0,
13081 0,
13082 0,
13083 0,
13084 0,
13085 0,
13086 0,
13087 0,
13088 0,
13089 0,
13090 0,
13091 0,
13092 0,
13093 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
13094 0,
13095 (traverseproc) __Pyx_Coroutine_traverse,
13096 0,
13097 0,
13098 offsetof(__pyx_CoroutineObject, gi_weakreflist),
13099 0,
13100 (iternextfunc) __Pyx_Generator_Next,
13101 __pyx_Generator_methods,
13102 __pyx_Generator_memberlist,
13103 __pyx_Generator_getsets,
13104 0,
13105 0,
13106 0,
13107 0,
13108 0,
13109 0,
13110 0,
13111 0,
13112 0,
13113 0,
13114 0,
13115 0,
13116 0,
13117 0,
13118 0,
13119 #if CYTHON_USE_TP_FINALIZE
13120 0,
13121 #else
13122 __Pyx_Coroutine_del,
13123 #endif
13124 0,
13125 #if CYTHON_USE_TP_FINALIZE
13126 __Pyx_Coroutine_del,
13127 #elif PY_VERSION_HEX >= 0x030400a1
13128 0,
13129 #endif
13130 #if PY_VERSION_HEX >= 0x030800b1
13131 0,
13132 #endif
13133 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
13134 0,
13135 #endif
13136 };
__pyx_Generator_init(void)13137 static int __pyx_Generator_init(void) {
13138 __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
13139 __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
13140 __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
13141 if (unlikely(!__pyx_GeneratorType)) {
13142 return -1;
13143 }
13144 return 0;
13145 }
13146
13147 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)13148 static int __Pyx_check_binary_version(void) {
13149 char ctversion[4], rtversion[4];
13150 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
13151 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
13152 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
13153 char message[200];
13154 PyOS_snprintf(message, sizeof(message),
13155 "compiletime version %s of module '%.100s' "
13156 "does not match runtime version %s",
13157 ctversion, __Pyx_MODULE_NAME, rtversion);
13158 return PyErr_WarnEx(NULL, message, 1);
13159 }
13160 return 0;
13161 }
13162
13163 /* InitStrings */
__Pyx_InitStrings(__Pyx_StringTabEntry * t)13164 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
13165 while (t->p) {
13166 #if PY_MAJOR_VERSION < 3
13167 if (t->is_unicode) {
13168 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
13169 } else if (t->intern) {
13170 *t->p = PyString_InternFromString(t->s);
13171 } else {
13172 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
13173 }
13174 #else
13175 if (t->is_unicode | t->is_str) {
13176 if (t->intern) {
13177 *t->p = PyUnicode_InternFromString(t->s);
13178 } else if (t->encoding) {
13179 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
13180 } else {
13181 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
13182 }
13183 } else {
13184 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
13185 }
13186 #endif
13187 if (!*t->p)
13188 return -1;
13189 if (PyObject_Hash(*t->p) == -1)
13190 return -1;
13191 ++t;
13192 }
13193 return 0;
13194 }
13195
__Pyx_PyUnicode_FromString(const char * c_str)13196 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
13197 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
13198 }
__Pyx_PyObject_AsString(PyObject * o)13199 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
13200 Py_ssize_t ignore;
13201 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
13202 }
13203 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13204 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)13205 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13206 char* defenc_c;
13207 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
13208 if (!defenc) return NULL;
13209 defenc_c = PyBytes_AS_STRING(defenc);
13210 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13211 {
13212 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
13213 char* c;
13214 for (c = defenc_c; c < end; c++) {
13215 if ((unsigned char) (*c) >= 128) {
13216 PyUnicode_AsASCIIString(o);
13217 return NULL;
13218 }
13219 }
13220 }
13221 #endif
13222 *length = PyBytes_GET_SIZE(defenc);
13223 return defenc_c;
13224 }
13225 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)13226 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13227 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
13228 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13229 if (likely(PyUnicode_IS_ASCII(o))) {
13230 *length = PyUnicode_GET_LENGTH(o);
13231 return PyUnicode_AsUTF8(o);
13232 } else {
13233 PyUnicode_AsASCIIString(o);
13234 return NULL;
13235 }
13236 #else
13237 return PyUnicode_AsUTF8AndSize(o, length);
13238 #endif
13239 }
13240 #endif
13241 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)13242 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
13243 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
13244 if (
13245 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
13246 __Pyx_sys_getdefaultencoding_not_ascii &&
13247 #endif
13248 PyUnicode_Check(o)) {
13249 return __Pyx_PyUnicode_AsStringAndSize(o, length);
13250 } else
13251 #endif
13252 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
13253 if (PyByteArray_Check(o)) {
13254 *length = PyByteArray_GET_SIZE(o);
13255 return PyByteArray_AS_STRING(o);
13256 } else
13257 #endif
13258 {
13259 char* result;
13260 int r = PyBytes_AsStringAndSize(o, &result, length);
13261 if (unlikely(r < 0)) {
13262 return NULL;
13263 } else {
13264 return result;
13265 }
13266 }
13267 }
__Pyx_PyObject_IsTrue(PyObject * x)13268 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
13269 int is_true = x == Py_True;
13270 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
13271 else return PyObject_IsTrue(x);
13272 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)13273 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
13274 int retval;
13275 if (unlikely(!x)) return -1;
13276 retval = __Pyx_PyObject_IsTrue(x);
13277 Py_DECREF(x);
13278 return retval;
13279 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)13280 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
13281 #if PY_MAJOR_VERSION >= 3
13282 if (PyLong_Check(result)) {
13283 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
13284 "__int__ returned non-int (type %.200s). "
13285 "The ability to return an instance of a strict subclass of int "
13286 "is deprecated, and may be removed in a future version of Python.",
13287 Py_TYPE(result)->tp_name)) {
13288 Py_DECREF(result);
13289 return NULL;
13290 }
13291 return result;
13292 }
13293 #endif
13294 PyErr_Format(PyExc_TypeError,
13295 "__%.4s__ returned non-%.4s (type %.200s)",
13296 type_name, type_name, Py_TYPE(result)->tp_name);
13297 Py_DECREF(result);
13298 return NULL;
13299 }
__Pyx_PyNumber_IntOrLong(PyObject * x)13300 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
13301 #if CYTHON_USE_TYPE_SLOTS
13302 PyNumberMethods *m;
13303 #endif
13304 const char *name = NULL;
13305 PyObject *res = NULL;
13306 #if PY_MAJOR_VERSION < 3
13307 if (likely(PyInt_Check(x) || PyLong_Check(x)))
13308 #else
13309 if (likely(PyLong_Check(x)))
13310 #endif
13311 return __Pyx_NewRef(x);
13312 #if CYTHON_USE_TYPE_SLOTS
13313 m = Py_TYPE(x)->tp_as_number;
13314 #if PY_MAJOR_VERSION < 3
13315 if (m && m->nb_int) {
13316 name = "int";
13317 res = m->nb_int(x);
13318 }
13319 else if (m && m->nb_long) {
13320 name = "long";
13321 res = m->nb_long(x);
13322 }
13323 #else
13324 if (likely(m && m->nb_int)) {
13325 name = "int";
13326 res = m->nb_int(x);
13327 }
13328 #endif
13329 #else
13330 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
13331 res = PyNumber_Int(x);
13332 }
13333 #endif
13334 if (likely(res)) {
13335 #if PY_MAJOR_VERSION < 3
13336 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
13337 #else
13338 if (unlikely(!PyLong_CheckExact(res))) {
13339 #endif
13340 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
13341 }
13342 }
13343 else if (!PyErr_Occurred()) {
13344 PyErr_SetString(PyExc_TypeError,
13345 "an integer is required");
13346 }
13347 return res;
13348 }
13349 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
13350 Py_ssize_t ival;
13351 PyObject *x;
13352 #if PY_MAJOR_VERSION < 3
13353 if (likely(PyInt_CheckExact(b))) {
13354 if (sizeof(Py_ssize_t) >= sizeof(long))
13355 return PyInt_AS_LONG(b);
13356 else
13357 return PyInt_AsSsize_t(b);
13358 }
13359 #endif
13360 if (likely(PyLong_CheckExact(b))) {
13361 #if CYTHON_USE_PYLONG_INTERNALS
13362 const digit* digits = ((PyLongObject*)b)->ob_digit;
13363 const Py_ssize_t size = Py_SIZE(b);
13364 if (likely(__Pyx_sst_abs(size) <= 1)) {
13365 ival = likely(size) ? digits[0] : 0;
13366 if (size == -1) ival = -ival;
13367 return ival;
13368 } else {
13369 switch (size) {
13370 case 2:
13371 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13372 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13373 }
13374 break;
13375 case -2:
13376 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13377 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13378 }
13379 break;
13380 case 3:
13381 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13382 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13383 }
13384 break;
13385 case -3:
13386 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13387 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13388 }
13389 break;
13390 case 4:
13391 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13392 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]));
13393 }
13394 break;
13395 case -4:
13396 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13397 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]));
13398 }
13399 break;
13400 }
13401 }
13402 #endif
13403 return PyLong_AsSsize_t(b);
13404 }
13405 x = PyNumber_Index(b);
13406 if (!x) return -1;
13407 ival = PyInt_AsSsize_t(x);
13408 Py_DECREF(x);
13409 return ival;
13410 }
13411 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
13412 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
13413 }
13414 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
13415 return PyInt_FromSize_t(ival);
13416 }
13417
13418
13419 #endif /* Py_PYTHON_H */
13420