0 0 1
default
Jean-Francois Pieronne - 3 years ago 2016-12-17 23:26:59
jf.pieronne@laposte.net
python/local/vms/rtl/fdl/_vmsfdl.c initial version
1 file changed with 3604 insertions and 0 deletions:
↑ Collapse Diff ↑
 
new file 100644
1
 
/* Generated by Cython 0.25.1 */
2
 

	
3
 
#define PY_SSIZE_T_CLEAN
4
 
#include "Python.h"
5
 
#ifndef Py_PYTHON_H
6
 
    #error Python headers needed to compile C extensions, please install development version of Python.
7
 
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
8
 
    #error Cython requires Python 2.6+ or Python 3.2+.
9
 
#else
10
 
#define CYTHON_ABI "0_25_1"
11
 
#include <stddef.h>
12
 
#ifndef offsetof
13
 
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14
 
#endif
15
 
#if !defined(WIN32) && !defined(MS_WINDOWS)
16
 
  #ifndef __stdcall
17
 
    #define __stdcall
18
 
  #endif
19
 
  #ifndef __cdecl
20
 
    #define __cdecl
21
 
  #endif
22
 
  #ifndef __fastcall
23
 
    #define __fastcall
24
 
  #endif
25
 
#endif
26
 
#ifndef DL_IMPORT
27
 
  #define DL_IMPORT(t) t
28
 
#endif
29
 
#ifndef DL_EXPORT
30
 
  #define DL_EXPORT(t) t
31
 
#endif
32
 
#ifndef HAVE_LONG_LONG
33
 
  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34
 
    #define HAVE_LONG_LONG
35
 
  #endif
36
 
#endif
37
 
#ifndef PY_LONG_LONG
38
 
  #define PY_LONG_LONG LONG_LONG
39
 
#endif
40
 
#ifndef Py_HUGE_VAL
41
 
  #define Py_HUGE_VAL HUGE_VAL
42
 
#endif
43
 
#ifdef PYPY_VERSION
44
 
  #define CYTHON_COMPILING_IN_PYPY 1
45
 
  #define CYTHON_COMPILING_IN_PYSTON 0
46
 
  #define CYTHON_COMPILING_IN_CPYTHON 0
47
 
  #undef CYTHON_USE_TYPE_SLOTS
48
 
  #define CYTHON_USE_TYPE_SLOTS 0
49
 
  #undef CYTHON_USE_ASYNC_SLOTS
50
 
  #define CYTHON_USE_ASYNC_SLOTS 0
51
 
  #undef CYTHON_USE_PYLIST_INTERNALS
52
 
  #define CYTHON_USE_PYLIST_INTERNALS 0
53
 
  #undef CYTHON_USE_UNICODE_INTERNALS
54
 
  #define CYTHON_USE_UNICODE_INTERNALS 0
55
 
  #undef CYTHON_USE_UNICODE_WRITER
56
 
  #define CYTHON_USE_UNICODE_WRITER 0
57
 
  #undef CYTHON_USE_PYLONG_INTERNALS
58
 
  #define CYTHON_USE_PYLONG_INTERNALS 0
59
 
  #undef CYTHON_AVOID_BORROWED_REFS
60
 
  #define CYTHON_AVOID_BORROWED_REFS 1
61
 
  #undef CYTHON_ASSUME_SAFE_MACROS
62
 
  #define CYTHON_ASSUME_SAFE_MACROS 0
63
 
  #undef CYTHON_UNPACK_METHODS
64
 
  #define CYTHON_UNPACK_METHODS 0
65
 
  #undef CYTHON_FAST_THREAD_STATE
66
 
  #define CYTHON_FAST_THREAD_STATE 0
67
 
  #undef CYTHON_FAST_PYCALL
68
 
  #define CYTHON_FAST_PYCALL 0
69
 
#elif defined(PYSTON_VERSION)
70
 
  #define CYTHON_COMPILING_IN_PYPY 0
71
 
  #define CYTHON_COMPILING_IN_PYSTON 1
72
 
  #define CYTHON_COMPILING_IN_CPYTHON 0
73
 
  #ifndef CYTHON_USE_TYPE_SLOTS
74
 
    #define CYTHON_USE_TYPE_SLOTS 1
75
 
  #endif
76
 
  #undef CYTHON_USE_ASYNC_SLOTS
77
 
  #define CYTHON_USE_ASYNC_SLOTS 0
78
 
  #undef CYTHON_USE_PYLIST_INTERNALS
79
 
  #define CYTHON_USE_PYLIST_INTERNALS 0
80
 
  #ifndef CYTHON_USE_UNICODE_INTERNALS
81
 
    #define CYTHON_USE_UNICODE_INTERNALS 1
82
 
  #endif
83
 
  #undef CYTHON_USE_UNICODE_WRITER
84
 
  #define CYTHON_USE_UNICODE_WRITER 0
85
 
  #undef CYTHON_USE_PYLONG_INTERNALS
86
 
  #define CYTHON_USE_PYLONG_INTERNALS 0
87
 
  #ifndef CYTHON_AVOID_BORROWED_REFS
88
 
    #define CYTHON_AVOID_BORROWED_REFS 0
89
 
  #endif
90
 
  #ifndef CYTHON_ASSUME_SAFE_MACROS
91
 
    #define CYTHON_ASSUME_SAFE_MACROS 1
92
 
  #endif
93
 
  #ifndef CYTHON_UNPACK_METHODS
94
 
    #define CYTHON_UNPACK_METHODS 1
95
 
  #endif
96
 
  #undef CYTHON_FAST_THREAD_STATE
97
 
  #define CYTHON_FAST_THREAD_STATE 0
98
 
  #undef CYTHON_FAST_PYCALL
99
 
  #define CYTHON_FAST_PYCALL 0
100
 
#else
101
 
  #define CYTHON_COMPILING_IN_PYPY 0
102
 
  #define CYTHON_COMPILING_IN_PYSTON 0
103
 
  #define CYTHON_COMPILING_IN_CPYTHON 1
104
 
  #ifndef CYTHON_USE_TYPE_SLOTS
105
 
    #define CYTHON_USE_TYPE_SLOTS 1
106
 
  #endif
107
 
  #if PY_MAJOR_VERSION < 3
108
 
    #undef CYTHON_USE_ASYNC_SLOTS
109
 
    #define CYTHON_USE_ASYNC_SLOTS 0
110
 
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
111
 
    #define CYTHON_USE_ASYNC_SLOTS 1
112
 
  #endif
113
 
  #if PY_VERSION_HEX < 0x02070000
114
 
    #undef CYTHON_USE_PYLONG_INTERNALS
115
 
    #define CYTHON_USE_PYLONG_INTERNALS 0
116
 
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
117
 
    #define CYTHON_USE_PYLONG_INTERNALS 1
118
 
  #endif
119
 
  #ifndef CYTHON_USE_PYLIST_INTERNALS
120
 
    #define CYTHON_USE_PYLIST_INTERNALS 1
121
 
  #endif
122
 
  #ifndef CYTHON_USE_UNICODE_INTERNALS
123
 
    #define CYTHON_USE_UNICODE_INTERNALS 1
124
 
  #endif
125
 
  #if PY_VERSION_HEX < 0x030300F0
126
 
    #undef CYTHON_USE_UNICODE_WRITER
127
 
    #define CYTHON_USE_UNICODE_WRITER 0
128
 
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
129
 
    #define CYTHON_USE_UNICODE_WRITER 1
130
 
  #endif
131
 
  #ifndef CYTHON_AVOID_BORROWED_REFS
132
 
    #define CYTHON_AVOID_BORROWED_REFS 0
133
 
  #endif
134
 
  #ifndef CYTHON_ASSUME_SAFE_MACROS
135
 
    #define CYTHON_ASSUME_SAFE_MACROS 1
136
 
  #endif
137
 
  #ifndef CYTHON_UNPACK_METHODS
138
 
    #define CYTHON_UNPACK_METHODS 1
139
 
  #endif
140
 
  #ifndef CYTHON_FAST_THREAD_STATE
141
 
    #define CYTHON_FAST_THREAD_STATE 1
142
 
  #endif
143
 
  #ifndef CYTHON_FAST_PYCALL
144
 
    #define CYTHON_FAST_PYCALL 1
145
 
  #endif
146
 
#endif
147
 
#if !defined(CYTHON_FAST_PYCCALL)
148
 
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
149
 
#endif
150
 
#if CYTHON_USE_PYLONG_INTERNALS
151
 
  #include "longintrepr.h"
152
 
  #undef SHIFT
153
 
  #undef BASE
154
 
  #undef MASK
155
 
#endif
156
 
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
157
 
  #define Py_OptimizeFlag 0
158
 
#endif
159
 
#define __PYX_BUILD_PY_SSIZE_T "n"
160
 
#define CYTHON_FORMAT_SSIZE_T "z"
161
 
#if PY_MAJOR_VERSION < 3
162
 
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
163
 
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
164
 
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
165
 
  #define __Pyx_DefaultClassType PyClass_Type
166
 
#else
167
 
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
168
 
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
169
 
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
170
 
  #define __Pyx_DefaultClassType PyType_Type
171
 
#endif
172
 
#ifndef Py_TPFLAGS_CHECKTYPES
173
 
  #define Py_TPFLAGS_CHECKTYPES 0
174
 
#endif
175
 
#ifndef Py_TPFLAGS_HAVE_INDEX
176
 
  #define Py_TPFLAGS_HAVE_INDEX 0
177
 
#endif
178
 
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
179
 
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
180
 
#endif
181
 
#ifndef Py_TPFLAGS_HAVE_FINALIZE
182
 
  #define Py_TPFLAGS_HAVE_FINALIZE 0
183
 
#endif
184
 
#ifndef METH_FASTCALL
185
 
  #define METH_FASTCALL 0x80
186
 
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
187
 
                                              Py_ssize_t nargs, PyObject *kwnames);
188
 
#else
189
 
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
190
 
#endif
191
 
#if CYTHON_FAST_PYCCALL
192
 
#define __Pyx_PyFastCFunction_Check(func)\
193
 
    ((PyCFunction_Check(func) && METH_FASTCALL == PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))
194
 
#else
195
 
#define __Pyx_PyFastCFunction_Check(func) 0
196
 
#endif
197
 
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
198
 
  #define CYTHON_PEP393_ENABLED 1
199
 
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
200
 
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
201
 
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
202
 
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
203
 
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
204
 
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
205
 
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
206
 
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
207
 
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
208
 
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
209
 
#else
210
 
  #define CYTHON_PEP393_ENABLED 0
211
 
  #define PyUnicode_1BYTE_KIND  1
212
 
  #define PyUnicode_2BYTE_KIND  2
213
 
  #define PyUnicode_4BYTE_KIND  4
214
 
  #define __Pyx_PyUnicode_READY(op)       (0)
215
 
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
216
 
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
217
 
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
218
 
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
219
 
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
220
 
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
221
 
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
222
 
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
223
 
#endif
224
 
#if CYTHON_COMPILING_IN_PYPY
225
 
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
226
 
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
227
 
#else
228
 
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
229
 
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
230
 
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
231
 
#endif
232
 
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
233
 
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
234
 
#endif
235
 
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
236
 
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
237
 
#endif
238
 
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
239
 
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
240
 
#endif
241
 
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
242
 
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
243
 
  #define PyObject_Free(p)     PyMem_Free(p)
244
 
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
245
 
#endif
246
 
#if CYTHON_COMPILING_IN_PYSTON
247
 
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
248
 
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
249
 
#else
250
 
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
251
 
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
252
 
#endif
253
 
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
254
 
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
255
 
#if PY_MAJOR_VERSION >= 3
256
 
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
257
 
#else
258
 
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
259
 
#endif
260
 
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
261
 
  #define PyObject_ASCII(o)            PyObject_Repr(o)
262
 
#endif
263
 
#if PY_MAJOR_VERSION >= 3
264
 
  #define PyBaseString_Type            PyUnicode_Type
265
 
  #define PyStringObject               PyUnicodeObject
266
 
  #define PyString_Type                PyUnicode_Type
267
 
  #define PyString_Check               PyUnicode_Check
268
 
  #define PyString_CheckExact          PyUnicode_CheckExact
269
 
#endif
270
 
#if PY_MAJOR_VERSION >= 3
271
 
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
272
 
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
273
 
#else
274
 
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
275
 
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
276
 
#endif
277
 
#ifndef PySet_CheckExact
278
 
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
279
 
#endif
280
 
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
281
 
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
282
 
#if PY_MAJOR_VERSION >= 3
283
 
  #define PyIntObject                  PyLongObject
284
 
  #define PyInt_Type                   PyLong_Type
285
 
  #define PyInt_Check(op)              PyLong_Check(op)
286
 
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
287
 
  #define PyInt_FromString             PyLong_FromString
288
 
  #define PyInt_FromUnicode            PyLong_FromUnicode
289
 
  #define PyInt_FromLong               PyLong_FromLong
290
 
  #define PyInt_FromSize_t             PyLong_FromSize_t
291
 
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
292
 
  #define PyInt_AsLong                 PyLong_AsLong
293
 
  #define PyInt_AS_LONG                PyLong_AS_LONG
294
 
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
295
 
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
296
 
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
297
 
  #define PyNumber_Int                 PyNumber_Long
298
 
#endif
299
 
#if PY_MAJOR_VERSION >= 3
300
 
  #define PyBoolObject                 PyLongObject
301
 
#endif
302
 
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
303
 
  #ifndef PyUnicode_InternFromString
304
 
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
305
 
  #endif
306
 
#endif
307
 
#if PY_VERSION_HEX < 0x030200A4
308
 
  typedef long Py_hash_t;
309
 
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
310
 
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
311
 
#else
312
 
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
313
 
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
314
 
#endif
315
 
#if PY_MAJOR_VERSION >= 3
316
 
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
317
 
#else
318
 
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
319
 
#endif
320
 
#if CYTHON_USE_ASYNC_SLOTS
321
 
  #if PY_VERSION_HEX >= 0x030500B1
322
 
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
323
 
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
324
 
  #else
325
 
    typedef struct {
326
 
        unaryfunc am_await;
327
 
        unaryfunc am_aiter;
328
 
        unaryfunc am_anext;
329
 
    } __Pyx_PyAsyncMethodsStruct;
330
 
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
331
 
  #endif
332
 
#else
333
 
  #define __Pyx_PyType_AsAsync(obj) NULL
334
 
#endif
335
 
#ifndef CYTHON_RESTRICT
336
 
  #if defined(__GNUC__)
337
 
    #define CYTHON_RESTRICT __restrict__
338
 
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
339
 
    #define CYTHON_RESTRICT __restrict
340
 
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
341
 
    #define CYTHON_RESTRICT restrict
342
 
  #else
343
 
    #define CYTHON_RESTRICT
344
 
  #endif
345
 
#endif
346
 
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
347
 

	
348
 
#ifndef CYTHON_INLINE
349
 
  #if defined(__GNUC__)
350
 
    #define CYTHON_INLINE __inline__
351
 
  #elif defined(_MSC_VER)
352
 
    #define CYTHON_INLINE __inline
353
 
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
354
 
    #define CYTHON_INLINE inline
355
 
  #else
356
 
    #define CYTHON_INLINE
357
 
  #endif
358
 
#endif
359
 

	
360
 
#if defined(WIN32) || defined(MS_WINDOWS)
361
 
  #define _USE_MATH_DEFINES
362
 
#endif
363
 
#include <math.h>
364
 
#ifdef NAN
365
 
#define __PYX_NAN() ((float) NAN)
366
 
#else
367
 
static CYTHON_INLINE float __PYX_NAN() {
368
 
  float value;
369
 
  memset(&value, 0xFF, sizeof(value));
370
 
  return value;
371
 
}
372
 
#endif
373
 
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
374
 
#define __Pyx_truncl trunc
375
 
#else
376
 
#define __Pyx_truncl truncl
377
 
#endif
378
 

	
379
 

	
380
 
#define __PYX_ERR(f_index, lineno, Ln_error) \
381
 
{ \
382
 
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
383
 
}
384
 

	
385
 
#if PY_MAJOR_VERSION >= 3
386
 
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
387
 
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
388
 
#else
389
 
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
390
 
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
391
 
#endif
392
 

	
393
 
#ifndef __PYX_EXTERN_C
394
 
  #ifdef __cplusplus
395
 
    #define __PYX_EXTERN_C extern "C"
396
 
  #else
397
 
    #define __PYX_EXTERN_C extern
398
 
  #endif
399
 
#endif
400
 

	
401
 
#define __PYX_HAVE__vms__rtl__fdl___vmsfdl
402
 
#define __PYX_HAVE_API__vms__rtl__fdl___vmsfdl
403
 
#include "../lib/vmslib.h"
404
 
#include "vmsfdl.h"
405
 
#include <string.h>
406
 
#include <stdio.h>
407
 
#include "pythread.h"
408
 
#ifdef _OPENMP
409
 
#include <omp.h>
410
 
#endif /* _OPENMP */
411
 

	
412
 
#ifdef PYREX_WITHOUT_ASSERTIONS
413
 
#define CYTHON_WITHOUT_ASSERTIONS
414
 
#endif
415
 

	
416
 
#ifndef CYTHON_UNUSED
417
 
# if defined(__GNUC__)
418
 
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
419
 
#     define CYTHON_UNUSED __attribute__ ((__unused__))
420
 
#   else
421
 
#     define CYTHON_UNUSED
422
 
#   endif
423
 
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
424
 
#   define CYTHON_UNUSED __attribute__ ((__unused__))
425
 
# else
426
 
#   define CYTHON_UNUSED
427
 
# endif
428
 
#endif
429
 
#ifndef CYTHON_NCP_UNUSED
430
 
# if CYTHON_COMPILING_IN_CPYTHON
431
 
#  define CYTHON_NCP_UNUSED
432
 
# else
433
 
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
434
 
# endif
435
 
#endif
436
 
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
437
 
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
438
 

	
439
 
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
440
 
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
441
 
#define __PYX_DEFAULT_STRING_ENCODING ""
442
 
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
443
 
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
444
 
#define __Pyx_uchar_cast(c) ((unsigned char)c)
445
 
#define __Pyx_long_cast(x) ((long)x)
446
 
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
447
 
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
448
 
    (sizeof(type) > sizeof(Py_ssize_t) &&\
449
 
          likely(v < (type)PY_SSIZE_T_MAX ||\
450
 
                 v == (type)PY_SSIZE_T_MAX)  &&\
451
 
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
452
 
                                v == (type)PY_SSIZE_T_MIN)))  ||\
453
 
    (sizeof(type) == sizeof(Py_ssize_t) &&\
454
 
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
455
 
                               v == (type)PY_SSIZE_T_MAX)))  )
456
 
#if defined (__cplusplus) && __cplusplus >= 201103L
457
 
    #include <cstdlib>
458
 
    #define __Pyx_sst_abs(value) std::abs(value)
459
 
#elif SIZEOF_INT >= SIZEOF_SIZE_T
460
 
    #define __Pyx_sst_abs(value) abs(value)
461
 
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
462
 
    #define __Pyx_sst_abs(value) labs(value)
463
 
#elif defined (_MSC_VER) && defined (_M_X64)
464
 
    #define __Pyx_sst_abs(value) _abs64(value)
465
 
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
466
 
    #define __Pyx_sst_abs(value) llabs(value)
467
 
#elif defined (__GNUC__)
468
 
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
469
 
#else
470
 
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
471
 
#endif
472
 
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
473
 
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
474
 
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
475
 
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
476
 
#define __Pyx_PyBytes_FromString        PyBytes_FromString
477
 
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
478
 
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
479
 
#if PY_MAJOR_VERSION < 3
480
 
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
481
 
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
482
 
#else
483
 
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
484
 
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
485
 
#endif
486
 
#define __Pyx_PyObject_AsSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
487
 
#define __Pyx_PyObject_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
488
 
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
489
 
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
490
 
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
491
 
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
492
 
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
493
 
#if PY_MAJOR_VERSION < 3
494
 
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
495
 
{
496
 
    const Py_UNICODE *u_end = u;
497
 
    while (*u_end++) ;
498
 
    return (size_t)(u_end - u - 1);
499
 
}
500
 
#else
501
 
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
502
 
#endif
503
 
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
504
 
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
505
 
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
506
 
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
507
 
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
508
 
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
509
 
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
510
 
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
511
 
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
512
 
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
513
 
#if CYTHON_ASSUME_SAFE_MACROS
514
 
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
515
 
#else
516
 
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
517
 
#endif
518
 
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
519
 
#if PY_MAJOR_VERSION >= 3
520
 
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
521
 
#else
522
 
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
523
 
#endif
524
 
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
525
 
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
526
 
static int __Pyx_sys_getdefaultencoding_not_ascii;
527
 
static int __Pyx_init_sys_getdefaultencoding_params(void) {
528
 
    PyObject* sys;
529
 
    PyObject* default_encoding = NULL;
530
 
    PyObject* ascii_chars_u = NULL;
531
 
    PyObject* ascii_chars_b = NULL;
532
 
    const char* default_encoding_c;
533
 
    sys = PyImport_ImportModule("sys");
534
 
    if (!sys) goto bad;
535
 
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
536
 
    Py_DECREF(sys);
537
 
    if (!default_encoding) goto bad;
538
 
    default_encoding_c = PyBytes_AsString(default_encoding);
539
 
    if (!default_encoding_c) goto bad;
540
 
    if (strcmp(default_encoding_c, "ascii") == 0) {
541
 
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
542
 
    } else {
543
 
        char ascii_chars[128];
544
 
        int c;
545
 
        for (c = 0; c < 128; c++) {
546
 
            ascii_chars[c] = c;
547
 
        }
548
 
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
549
 
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
550
 
        if (!ascii_chars_u) goto bad;
551
 
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
552
 
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
553
 
            PyErr_Format(
554
 
                PyExc_ValueError,
555
 
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
556
 
                default_encoding_c);
557
 
            goto bad;
558
 
        }
559
 
        Py_DECREF(ascii_chars_u);
560
 
        Py_DECREF(ascii_chars_b);
561
 
    }
562
 
    Py_DECREF(default_encoding);
563
 
    return 0;
564
 
bad:
565
 
    Py_XDECREF(default_encoding);
566
 
    Py_XDECREF(ascii_chars_u);
567
 
    Py_XDECREF(ascii_chars_b);
568
 
    return -1;
569
 
}
570
 
#endif
571
 
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
572
 
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
573
 
#else
574
 
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
575
 
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
576
 
static char* __PYX_DEFAULT_STRING_ENCODING;
577
 
static int __Pyx_init_sys_getdefaultencoding_params(void) {
578
 
    PyObject* sys;
579
 
    PyObject* default_encoding = NULL;
580
 
    char* default_encoding_c;
581
 
    sys = PyImport_ImportModule("sys");
582
 
    if (!sys) goto bad;
583
 
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
584
 
    Py_DECREF(sys);
585
 
    if (!default_encoding) goto bad;
586
 
    default_encoding_c = PyBytes_AsString(default_encoding);
587
 
    if (!default_encoding_c) goto bad;
588
 
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
589
 
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
590
 
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
591
 
    Py_DECREF(default_encoding);
592
 
    return 0;
593
 
bad:
594
 
    Py_XDECREF(default_encoding);
595
 
    return -1;
596
 
}
597
 
#endif
598
 
#endif
599
 

	
600
 

	
601
 
/* Test for GCC > 2.95 */
602
 
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
603
 
  #define likely(x)   __builtin_expect(!!(x), 1)
604
 
  #define unlikely(x) __builtin_expect(!!(x), 0)
605
 
#else /* !__GNUC__ or GCC < 2.95 */
606
 
  #define likely(x)   (x)
607
 
  #define unlikely(x) (x)
608
 
#endif /* __GNUC__ */
609
 

	
610
 
static PyObject *__pyx_m;
611
 
static PyObject *__pyx_d;
612
 
static PyObject *__pyx_b;
613
 
static PyObject *__pyx_empty_tuple;
614
 
static PyObject *__pyx_empty_bytes;
615
 
static PyObject *__pyx_empty_unicode;
616
 
static int __pyx_lineno;
617
 
static int __pyx_clineno = 0;
618
 
static const char * __pyx_cfilenm= __FILE__;
619
 
static const char *__pyx_filename;
620
 

	
621
 

	
622
 
static const char *__pyx_f[] = {
623
 
  "vms/rtl/fdl/_vmsfdl.pyx",
624
 
  "type.pxd",
625
 
  "bool.pxd",
626
 
  "complex.pxd",
627
 
};
628
 

	
629
 
/*--- Type declarations ---*/
630
 

	
631
 
/* --- Runtime support code (head) --- */
632
 
/* Refnanny.proto */
633
 
#ifndef CYTHON_REFNANNY
634
 
  #define CYTHON_REFNANNY 0
635
 
#endif
636
 
#if CYTHON_REFNANNY
637
 
  typedef struct {
638
 
    void (*INCREF)(void*, PyObject*, int);
639
 
    void (*DECREF)(void*, PyObject*, int);
640
 
    void (*GOTREF)(void*, PyObject*, int);
641
 
    void (*GIVEREF)(void*, PyObject*, int);
642
 
    void* (*SetupContext)(const char*, int, const char*);
643
 
    void (*FinishContext)(void**);
644
 
  } __Pyx_RefNannyAPIStruct;
645
 
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
646
 
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
647
 
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
648
 
#ifdef WITH_THREAD
649
 
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
650
 
          if (acquire_gil) {\
651
 
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
652
 
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
653
 
              PyGILState_Release(__pyx_gilstate_save);\
654
 
          } else {\
655
 
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
656
 
          }
657
 
#else
658
 
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
659
 
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
660
 
#endif
661
 
  #define __Pyx_RefNannyFinishContext()\
662
 
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
663
 
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
664
 
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
665
 
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
666
 
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
667
 
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
668
 
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
669
 
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
670
 
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
671
 
#else
672
 
  #define __Pyx_RefNannyDeclarations
673
 
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
674
 
  #define __Pyx_RefNannyFinishContext()
675
 
  #define __Pyx_INCREF(r) Py_INCREF(r)
676
 
  #define __Pyx_DECREF(r) Py_DECREF(r)
677
 
  #define __Pyx_GOTREF(r)
678
 
  #define __Pyx_GIVEREF(r)
679
 
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
680
 
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
681
 
  #define __Pyx_XGOTREF(r)
682
 
  #define __Pyx_XGIVEREF(r)
683
 
#endif
684
 
#define __Pyx_XDECREF_SET(r, v) do {\
685
 
        PyObject *tmp = (PyObject *) r;\
686
 
        r = v; __Pyx_XDECREF(tmp);\
687
 
    } while (0)
688
 
#define __Pyx_DECREF_SET(r, v) do {\
689
 
        PyObject *tmp = (PyObject *) r;\
690
 
        r = v; __Pyx_DECREF(tmp);\
691
 
    } while (0)
692
 
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
693
 
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
694
 

	
695
 
/* PyObjectGetAttrStr.proto */
696
 
#if CYTHON_USE_TYPE_SLOTS
697
 
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
698
 
    PyTypeObject* tp = Py_TYPE(obj);
699
 
    if (likely(tp->tp_getattro))
700
 
        return tp->tp_getattro(obj, attr_name);
701
 
#if PY_MAJOR_VERSION < 3
702
 
    if (likely(tp->tp_getattr))
703
 
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
704
 
#endif
705
 
    return PyObject_GetAttr(obj, attr_name);
706
 
}
707
 
#else
708
 
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
709
 
#endif
710
 

	
711
 
/* GetBuiltinName.proto */
712
 
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
713
 

	
714
 
/* PyObjectCall.proto */
715
 
#if CYTHON_COMPILING_IN_CPYTHON
716
 
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
717
 
#else
718
 
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
719
 
#endif
720
 

	
721
 
/* PyThreadStateGet.proto */
722
 
#if CYTHON_FAST_THREAD_STATE
723
 
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
724
 
#define __Pyx_PyThreadState_assign  __pyx_tstate = PyThreadState_GET();
725
 
#else
726
 
#define __Pyx_PyThreadState_declare
727
 
#define __Pyx_PyThreadState_assign
728
 
#endif
729
 

	
730
 
/* PyErrFetchRestore.proto */
731
 
#if CYTHON_FAST_THREAD_STATE
732
 
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
733
 
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
734
 
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
735
 
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
736
 
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
737
 
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
738
 
#else
739
 
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
740
 
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
741
 
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
742
 
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
743
 
#endif
744
 

	
745
 
/* RaiseException.proto */
746
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
747
 

	
748
 
/* RaiseDoubleKeywords.proto */
749
 
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
750
 

	
751
 
/* ParseKeywords.proto */
752
 
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
753
 
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
754
 
    const char* function_name);
755
 

	
756
 
/* RaiseArgTupleInvalid.proto */
757
 
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
758
 
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
759
 

	
760
 
/* CodeObjectCache.proto */
761
 
typedef struct {
762
 
    PyCodeObject* code_object;
763
 
    int code_line;
764
 
} __Pyx_CodeObjectCacheEntry;
765
 
struct __Pyx_CodeObjectCache {
766
 
    int count;
767
 
    int max_count;
768
 
    __Pyx_CodeObjectCacheEntry* entries;
769
 
};
770
 
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
771
 
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
772
 
static PyCodeObject *__pyx_find_code_object(int code_line);
773
 
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
774
 

	
775
 
/* AddTraceback.proto */
776
 
static void __Pyx_AddTraceback(const char *funcname, int c_line,
777
 
                               int py_line, const char *filename);
778
 

	
779
 
/* CIntToPy.proto */
780
 
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
781
 

	
782
 
/* CIntToPy.proto */
783
 
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value);
784
 

	
785
 
/* CIntFromPy.proto */
786
 
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
787
 

	
788
 
/* CIntToPy.proto */
789
 
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
790
 

	
791
 
/* CIntFromPy.proto */
792
 
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
793
 

	
794
 
/* CIntFromPy.proto */
795
 
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
796
 

	
797
 
/* CheckBinaryVersion.proto */
798
 
static int __Pyx_check_binary_version(void);
799
 

	
800
 
/* PyIdentifierFromString.proto */
801
 
#if !defined(__Pyx_PyIdentifier_FromString)
802
 
#if PY_MAJOR_VERSION < 3
803
 
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
804
 
#else
805
 
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
806
 
#endif
807
 
#endif
808
 

	
809
 
/* ModuleImport.proto */
810
 
static PyObject *__Pyx_ImportModule(const char *name);
811
 

	
812
 
/* TypeImport.proto */
813
 
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
814
 

	
815
 
/* InitStrings.proto */
816
 
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
817
 

	
818
 

	
819
 
/* Module declarations from 'cpython.version' */
820
 

	
821
 
/* Module declarations from '__builtin__' */
822
 

	
823
 
/* Module declarations from 'cpython.type' */
824
 
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
825
 

	
826
 
/* Module declarations from 'libc.string' */
827
 

	
828
 
/* Module declarations from 'libc.stdio' */
829
 

	
830
 
/* Module declarations from 'cpython.object' */
831
 

	
832
 
/* Module declarations from 'cpython.ref' */
833
 

	
834
 
/* Module declarations from 'cpython.exc' */
835
 

	
836
 
/* Module declarations from 'cpython.module' */
837
 

	
838
 
/* Module declarations from 'cpython.mem' */
839
 

	
840
 
/* Module declarations from 'cpython.tuple' */
841
 

	
842
 
/* Module declarations from 'cpython.list' */
843
 

	
844
 
/* Module declarations from 'cpython.sequence' */
845
 

	
846
 
/* Module declarations from 'cpython.mapping' */
847
 

	
848
 
/* Module declarations from 'cpython.iterator' */
849
 

	
850
 
/* Module declarations from 'cpython.number' */
851
 

	
852
 
/* Module declarations from 'cpython.int' */
853
 

	
854
 
/* Module declarations from '__builtin__' */
855
 

	
856
 
/* Module declarations from 'cpython.bool' */
857
 
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
858
 

	
859
 
/* Module declarations from 'cpython.long' */
860
 

	
861
 
/* Module declarations from 'cpython.float' */
862
 

	
863
 
/* Module declarations from '__builtin__' */
864
 

	
865
 
/* Module declarations from 'cpython.complex' */
866
 
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
867
 

	
868
 
/* Module declarations from 'cpython.string' */
869
 

	
870
 
/* Module declarations from 'cpython.unicode' */
871
 

	
872
 
/* Module declarations from 'cpython.dict' */
873
 

	
874
 
/* Module declarations from 'cpython.instance' */
875
 

	
876
 
/* Module declarations from 'cpython.function' */
877
 

	
878
 
/* Module declarations from 'cpython.method' */
879
 

	
880
 
/* Module declarations from 'cpython.weakref' */
881
 

	
882
 
/* Module declarations from 'cpython.getargs' */
883
 

	
884
 
/* Module declarations from 'cpython.pythread' */
885
 

	
886
 
/* Module declarations from 'cpython.pystate' */
887
 

	
888
 
/* Module declarations from 'cpython.cobject' */
889
 

	
890
 
/* Module declarations from 'cpython.oldbuffer' */
891
 

	
892
 
/* Module declarations from 'cpython.set' */
893
 

	
894
 
/* Module declarations from 'cpython.buffer' */
895
 

	
896
 
/* Module declarations from 'cpython.bytes' */
897
 

	
898
 
/* Module declarations from 'cpython.pycapsule' */
899
 

	
900
 
/* Module declarations from 'cpython' */
901
 

	
902
 
/* Module declarations from 'vms.rtl.fdl._vmsfdl' */
903
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_checkStatus(unsigned int); /*proto*/
904
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_getstr(PyObject *); /*proto*/
905
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMSTR(struct dsc$descriptor_s *, PyObject *); /*proto*/
906
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMOPTSTR(struct dsc$descriptor_s **, struct dsc$descriptor_s *, PyObject *); /*proto*/
907
 
#define __Pyx_MODULE_NAME "vms.rtl.fdl._vmsfdl"
908
 
int __pyx_module_is_main_vms__rtl__fdl___vmsfdl = 0;
909
 

	
910
 
/* Implementation of 'vms.rtl.fdl._vmsfdl' */
911
 
static PyObject *__pyx_builtin_VMSError;
912
 
static PyObject *__pyx_builtin_TypeError;
913
 
static PyObject *__pyx_builtin_ValueError;
914
 
static const char __pyx_k_s[] = "s";
915
 
static const char __pyx_k_sts[] = "sts";
916
 
static const char __pyx_k_stv[] = "stv";
917
 
static const char __pyx_k_main[] = "__main__";
918
 
static const char __pyx_k_test[] = "__test__";
919
 
static const char __pyx_k_flags[] = "flags";
920
 
static const char __pyx_k_buffer[] = "buffer";
921
 
static const char __pyx_k_encode[] = "encode";
922
 
static const char __pyx_k_retlen[] = "retlen";
923
 
static const char __pyx_k_bufferD[] = "bufferD";
924
 
static const char __pyx_k_VMSError[] = "VMSError";
925
 
static const char __pyx_k_fdlDescD[] = "fdlDescD";
926
 
static const char __pyx_k_fdl_desc[] = "fdl_desc";
927
 
static const char __pyx_k_TypeError[] = "TypeError";
928
 
static const char __pyx_k_fileNameD[] = "fileNameD";
929
 
static const char __pyx_k_file_name[] = "file_name";
930
 
static const char __pyx_k_ValueError[] = "ValueError";
931
 
static const char __pyx_k_fdl_create[] = "fdl_create";
932
 
static const char __pyx_k_ISO_8859_15[] = "ISO-8859-15";
933
 
static const char __pyx_k_defaultFDLD[] = "defaultFDLD";
934
 
static const char __pyx_k_default_fdl[] = "default_fdl";
935
 
static const char __pyx_k_fileNamePtr[] = "fileNamePtr";
936
 
static const char __pyx_k_defaultNameD[] = "defaultNameD";
937
 
static const char __pyx_k_default_name[] = "default_name";
938
 
static const char __pyx_k_defaultFDLPtr[] = "defaultFDLPtr";
939
 
static const char __pyx_k_defaultNamePtr[] = "defaultNamePtr";
940
 
static const char __pyx_k_vms_rtl_fdl__vmsfdl[] = "vms.rtl.fdl._vmsfdl";
941
 
static const char __pyx_k_DISK_REPOS_vmspython_python_loc[] = "/DISK$REPOS/vmspython/python/local/vms/rtl/fdl/_vmsfdl.pyx";
942
 
static const char __pyx_k_expected_string_or_Unicode_objec[] = "expected string or Unicode object, %s found";
943
 
static PyObject *__pyx_kp_s_DISK_REPOS_vmspython_python_loc;
944
 
static PyObject *__pyx_kp_s_iso885915_ISO_8859_15;
945
 
static PyObject *__pyx_n_s_TypeError;
946
 
static PyObject *__pyx_n_s_VMSError;
947
 
static PyObject *__pyx_n_s_ValueError;
948
 
static PyObject *__pyx_n_s_buffer;
949
 
static PyObject *__pyx_n_s_bufferD;
950
 
static PyObject *__pyx_n_s_defaultFDLD;
951
 
static PyObject *__pyx_n_s_defaultFDLPtr;
952
 
static PyObject *__pyx_n_s_defaultNameD;
953
 
static PyObject *__pyx_n_s_defaultNamePtr;
954
 
static PyObject *__pyx_n_s_default_fdl;
955
 
static PyObject *__pyx_n_s_default_name;
956
 
static PyObject *__pyx_n_s_encode;
957
 
static PyObject *__pyx_kp_s_iso885915_expected_string_or_Unicode_objec;
958
 
static PyObject *__pyx_n_s_fdlDescD;
959
 
static PyObject *__pyx_n_s_fdl_create;
960
 
static PyObject *__pyx_n_s_fdl_desc;
961
 
static PyObject *__pyx_n_s_fileNameD;
962
 
static PyObject *__pyx_n_s_fileNamePtr;
963
 
static PyObject *__pyx_n_s_file_name;
964
 
static PyObject *__pyx_n_s_flags;
965
 
static PyObject *__pyx_n_s_main;
966
 
static PyObject *__pyx_n_s_retlen;
967
 
static PyObject *__pyx_n_s_s;
968
 
static PyObject *__pyx_n_s_sts;
969
 
static PyObject *__pyx_n_s_stv;
970
 
static PyObject *__pyx_n_s_test;
971
 
static PyObject *__pyx_n_s_vms_rtl_fdl__vmsfdl;
972
 
static PyObject *__pyx_pf_3vms_3rtl_3fdl_7_vmsfdl_fdl_create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fdl_desc, PyObject *__pyx_v_file_name, PyObject *__pyx_v_default_name, unsigned int __pyx_v_flags, PyObject *__pyx_v_default_fdl); /* proto */
973
 
static PyObject *__pyx_tuple_;
974
 
static PyObject *__pyx_tuple__2;
975
 
static PyObject *__pyx_codeobj__3;
976
 

	
977
 
/* "vms/rtl/fdl/_vmsfdl.pyx":37
978
 
 * from cpython cimport PY_MAJOR_VERSION
979
 
 * 
980
 
 * cdef checkStatus(unsigned int s):             # <<<<<<<<<<<<<<
981
 
 *     cdef char msg[256]
982
 
 *     if s & 1 == 0:
983
 
 */
984
 

	
985
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_checkStatus(unsigned int __pyx_v_s) {
986
 
  char __pyx_v_msg[0x100];
987
 
  PyObject *__pyx_r = NULL;
988
 
  __Pyx_RefNannyDeclarations
989
 
  int __pyx_t_1;
990
 
  PyObject *__pyx_t_2 = NULL;
991
 
  PyObject *__pyx_t_3 = NULL;
992
 
  PyObject *__pyx_t_4 = NULL;
993
 
  __Pyx_RefNannySetupContext("checkStatus", 0);
994
 

	
995
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":39
996
 
 * cdef checkStatus(unsigned int s):
997
 
 *     cdef char msg[256]
998
 
 *     if s & 1 == 0:             # <<<<<<<<<<<<<<
999
 
 *         getmsg(s, msg, 256)
1000
 
 *         raise VMSError(s, msg)
1001
 
 */
1002
 
  __pyx_t_1 = (((__pyx_v_s & 1) == 0) != 0);
1003
 
  if (__pyx_t_1) {
1004
 

	
1005
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":40
1006
 
 *     cdef char msg[256]
1007
 
 *     if s & 1 == 0:
1008
 
 *         getmsg(s, msg, 256)             # <<<<<<<<<<<<<<
1009
 
 *         raise VMSError(s, msg)
1010
 
 * 
1011
 
 */
1012
 
    getmsg(__pyx_v_s, __pyx_v_msg, 0x100);
1013
 

	
1014
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":41
1015
 
 *     if s & 1 == 0:
1016
 
 *         getmsg(s, msg, 256)
1017
 
 *         raise VMSError(s, msg)             # <<<<<<<<<<<<<<
1018
 
 * 
1019
 
 * cdef checkstr(text):
1020
 
 */
1021
 
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_s); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
1022
 
    __Pyx_GOTREF(__pyx_t_2);
1023
 
    __pyx_t_3 = __Pyx_PyObject_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
1024
 
    __Pyx_GOTREF(__pyx_t_3);
1025
 
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 41, __pyx_L1_error)
1026
 
    __Pyx_GOTREF(__pyx_t_4);
1027
 
    __Pyx_GIVEREF(__pyx_t_2);
1028
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
1029
 
    __Pyx_GIVEREF(__pyx_t_3);
1030
 
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
1031
 
    __pyx_t_2 = 0;
1032
 
    __pyx_t_3 = 0;
1033
 
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_VMSError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 41, __pyx_L1_error)
1034
 
    __Pyx_GOTREF(__pyx_t_3);
1035
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1036
 
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1037
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1038
 
    __PYX_ERR(0, 41, __pyx_L1_error)
1039
 

	
1040
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":39
1041
 
 * cdef checkStatus(unsigned int s):
1042
 
 *     cdef char msg[256]
1043
 
 *     if s & 1 == 0:             # <<<<<<<<<<<<<<
1044
 
 *         getmsg(s, msg, 256)
1045
 
 *         raise VMSError(s, msg)
1046
 
 */
1047
 
  }
1048
 

	
1049
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":37
1050
 
 * from cpython cimport PY_MAJOR_VERSION
1051
 
 * 
1052
 
 * cdef checkStatus(unsigned int s):             # <<<<<<<<<<<<<<
1053
 
 *     cdef char msg[256]
1054
 
 *     if s & 1 == 0:
1055
 
 */
1056
 

	
1057
 
  /* function exit code */
1058
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1059
 
  goto __pyx_L0;
1060
 
  __pyx_L1_error:;
1061
 
  __Pyx_XDECREF(__pyx_t_2);
1062
 
  __Pyx_XDECREF(__pyx_t_3);
1063
 
  __Pyx_XDECREF(__pyx_t_4);
1064
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.checkStatus", __pyx_clineno, __pyx_lineno, __pyx_filename);
1065
 
  __pyx_r = 0;
1066
 
  __pyx_L0:;
1067
 
  __Pyx_XGIVEREF(__pyx_r);
1068
 
  __Pyx_RefNannyFinishContext();
1069
 
  return __pyx_r;
1070
 
}
1071
 

	
1072
 
/* "vms/rtl/fdl/_vmsfdl.pyx":43
1073
 
 *         raise VMSError(s, msg)
1074
 
 * 
1075
 
 * cdef checkstr(text):             # <<<<<<<<<<<<<<
1076
 
 *     if not isinstance(text, basestring):
1077
 
 *         raise TypeError("expected string or Unicode object, %s found" %
1078
 
 */
1079
 

	
1080
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_checkstr(PyObject *__pyx_v_text) {
1081
 
  PyObject *__pyx_r = NULL;
1082
 
  __Pyx_RefNannyDeclarations
1083
 
  int __pyx_t_1;
1084
 
  int __pyx_t_2;
1085
 
  PyObject *__pyx_t_3 = NULL;
1086
 
  PyObject *__pyx_t_4 = NULL;
1087
 
  __Pyx_RefNannySetupContext("checkstr", 0);
1088
 

	
1089
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":44
1090
 
 * 
1091
 
 * cdef checkstr(text):
1092
 
 *     if not isinstance(text, basestring):             # <<<<<<<<<<<<<<
1093
 
 *         raise TypeError("expected string or Unicode object, %s found" %
1094
 
 *                         type(text))
1095
 
 */
1096
 
  __pyx_t_1 = __Pyx_PyBaseString_Check(__pyx_v_text); 
1097
 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
1098
 
  if (__pyx_t_2) {
1099
 

	
1100
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":45
1101
 
 * cdef checkstr(text):
1102
 
 *     if not isinstance(text, basestring):
1103
 
 *         raise TypeError("expected string or Unicode object, %s found" %             # <<<<<<<<<<<<<<
1104
 
 *                         type(text))
1105
 
 * 
1106
 
 */
1107
 
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_iso885915_expected_string_or_Unicode_objec, ((PyObject *)Py_TYPE(__pyx_v_text))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
1108
 
    __Pyx_GOTREF(__pyx_t_3);
1109
 
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 45, __pyx_L1_error)
1110
 
    __Pyx_GOTREF(__pyx_t_4);
1111
 
    __Pyx_GIVEREF(__pyx_t_3);
1112
 
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
1113
 
    __pyx_t_3 = 0;
1114
 
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 45, __pyx_L1_error)
1115
 
    __Pyx_GOTREF(__pyx_t_3);
1116
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1117
 
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
1118
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1119
 
    __PYX_ERR(0, 45, __pyx_L1_error)
1120
 

	
1121
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":44
1122
 
 * 
1123
 
 * cdef checkstr(text):
1124
 
 *     if not isinstance(text, basestring):             # <<<<<<<<<<<<<<
1125
 
 *         raise TypeError("expected string or Unicode object, %s found" %
1126
 
 *                         type(text))
1127
 
 */
1128
 
  }
1129
 

	
1130
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":43
1131
 
 *         raise VMSError(s, msg)
1132
 
 * 
1133
 
 * cdef checkstr(text):             # <<<<<<<<<<<<<<
1134
 
 *     if not isinstance(text, basestring):
1135
 
 *         raise TypeError("expected string or Unicode object, %s found" %
1136
 
 */
1137
 

	
1138
 
  /* function exit code */
1139
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1140
 
  goto __pyx_L0;
1141
 
  __pyx_L1_error:;
1142
 
  __Pyx_XDECREF(__pyx_t_3);
1143
 
  __Pyx_XDECREF(__pyx_t_4);
1144
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.checkstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
1145
 
  __pyx_r = 0;
1146
 
  __pyx_L0:;
1147
 
  __Pyx_XGIVEREF(__pyx_r);
1148
 
  __Pyx_RefNannyFinishContext();
1149
 
  return __pyx_r;
1150
 
}
1151
 

	
1152
 
/* "vms/rtl/fdl/_vmsfdl.pyx":48
1153
 
 *                         type(text))
1154
 
 * 
1155
 
 * cdef getstr(text):             # <<<<<<<<<<<<<<
1156
 
 *     if isinstance(text, unicode):
1157
 
 *         return text.encode('ISO-8859-15')
1158
 
 */
1159
 

	
1160
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_getstr(PyObject *__pyx_v_text) {
1161
 
  PyObject *__pyx_r = NULL;
1162
 
  __Pyx_RefNannyDeclarations
1163
 
  int __pyx_t_1;
1164
 
  int __pyx_t_2;
1165
 
  PyObject *__pyx_t_3 = NULL;
1166
 
  PyObject *__pyx_t_4 = NULL;
1167
 
  int __pyx_t_5;
1168
 
  __Pyx_RefNannySetupContext("getstr", 0);
1169
 

	
1170
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":49
1171
 
 * 
1172
 
 * cdef getstr(text):
1173
 
 *     if isinstance(text, unicode):             # <<<<<<<<<<<<<<
1174
 
 *         return text.encode('ISO-8859-15')
1175
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):
1176
 
 */
1177
 
  __pyx_t_1 = PyUnicode_Check(__pyx_v_text); 
1178
 
  __pyx_t_2 = (__pyx_t_1 != 0);
1179
 
  if (__pyx_t_2) {
1180
 

	
1181
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":50
1182
 
 * cdef getstr(text):
1183
 
 *     if isinstance(text, unicode):
1184
 
 *         return text.encode('ISO-8859-15')             # <<<<<<<<<<<<<<
1185
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):
1186
 
 *         return text
1187
 
 */
1188
 
    __Pyx_XDECREF(__pyx_r);
1189
 
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_text, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
1190
 
    __Pyx_GOTREF(__pyx_t_3);
1191
 
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
1192
 
    __Pyx_GOTREF(__pyx_t_4);
1193
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1194
 
    __pyx_r = __pyx_t_4;
1195
 
    __pyx_t_4 = 0;
1196
 
    goto __pyx_L0;
1197
 

	
1198
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":49
1199
 
 * 
1200
 
 * cdef getstr(text):
1201
 
 *     if isinstance(text, unicode):             # <<<<<<<<<<<<<<
1202
 
 *         return text.encode('ISO-8859-15')
1203
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):
1204
 
 */
1205
 
  }
1206
 

	
1207
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":51
1208
 
 *     if isinstance(text, unicode):
1209
 
 *         return text.encode('ISO-8859-15')
1210
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):             # <<<<<<<<<<<<<<
1211
 
 *         return text
1212
 
 *     else:
1213
 
 */
1214
 
  __pyx_t_1 = (__pyx_v_text == Py_None);
1215
 
  __pyx_t_5 = (__pyx_t_1 != 0);
1216
 
  if (!__pyx_t_5) {
1217
 
  } else {
1218
 
    __pyx_t_2 = __pyx_t_5;
1219
 
    goto __pyx_L4_bool_binop_done;
1220
 
  }
1221
 
  __pyx_t_5 = ((PY_MAJOR_VERSION < 3) != 0);
1222
 
  if (__pyx_t_5) {
1223
 
  } else {
1224
 
    __pyx_t_2 = __pyx_t_5;
1225
 
    goto __pyx_L4_bool_binop_done;
1226
 
  }
1227
 
  __pyx_t_5 = PyString_Check(__pyx_v_text); 
1228
 
  __pyx_t_1 = (__pyx_t_5 != 0);
1229
 
  __pyx_t_2 = __pyx_t_1;
1230
 
  __pyx_L4_bool_binop_done:;
1231
 
  if (__pyx_t_2) {
1232
 

	
1233
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":52
1234
 
 *         return text.encode('ISO-8859-15')
1235
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):
1236
 
 *         return text             # <<<<<<<<<<<<<<
1237
 
 *     else:
1238
 
 *         raise ValueError("expected string or Unicode object, %s found" %
1239
 
 */
1240
 
    __Pyx_XDECREF(__pyx_r);
1241
 
    __Pyx_INCREF(__pyx_v_text);
1242
 
    __pyx_r = __pyx_v_text;
1243
 
    goto __pyx_L0;
1244
 

	
1245
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":51
1246
 
 *     if isinstance(text, unicode):
1247
 
 *         return text.encode('ISO-8859-15')
1248
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):             # <<<<<<<<<<<<<<
1249
 
 *         return text
1250
 
 *     else:
1251
 
 */
1252
 
  }
1253
 

	
1254
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":54
1255
 
 *         return text
1256
 
 *     else:
1257
 
 *         raise ValueError("expected string or Unicode object, %s found" %             # <<<<<<<<<<<<<<
1258
 
 *                          type(text))
1259
 
 * 
1260
 
 */
1261
 
  /*else*/ {
1262
 

	
1263
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":55
1264
 
 *     else:
1265
 
 *         raise ValueError("expected string or Unicode object, %s found" %
1266
 
 *                          type(text))             # <<<<<<<<<<<<<<
1267
 
 * 
1268
 
 * cdef DESCFROMSTR(dsc_descriptor_s* dsc, src):
1269
 
 */
1270
 
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_iso885915_expected_string_or_Unicode_objec, ((PyObject *)Py_TYPE(__pyx_v_text))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
1271
 
    __Pyx_GOTREF(__pyx_t_4);
1272
 

	
1273
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":54
1274
 
 *         return text
1275
 
 *     else:
1276
 
 *         raise ValueError("expected string or Unicode object, %s found" %             # <<<<<<<<<<<<<<
1277
 
 *                          type(text))
1278
 
 * 
1279
 
 */
1280
 
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 54, __pyx_L1_error)
1281
 
    __Pyx_GOTREF(__pyx_t_3);
1282
 
    __Pyx_GIVEREF(__pyx_t_4);
1283
 
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
1284
 
    __pyx_t_4 = 0;
1285
 
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
1286
 
    __Pyx_GOTREF(__pyx_t_4);
1287
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1288
 
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
1289
 
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
1290
 
    __PYX_ERR(0, 54, __pyx_L1_error)
1291
 
  }
1292
 

	
1293
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":48
1294
 
 *                         type(text))
1295
 
 * 
1296
 
 * cdef getstr(text):             # <<<<<<<<<<<<<<
1297
 
 *     if isinstance(text, unicode):
1298
 
 *         return text.encode('ISO-8859-15')
1299
 
 */
1300
 

	
1301
 
  /* function exit code */
1302
 
  __pyx_L1_error:;
1303
 
  __Pyx_XDECREF(__pyx_t_3);
1304
 
  __Pyx_XDECREF(__pyx_t_4);
1305
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.getstr", __pyx_clineno, __pyx_lineno, __pyx_filename);
1306
 
  __pyx_r = 0;
1307
 
  __pyx_L0:;
1308
 
  __Pyx_XGIVEREF(__pyx_r);
1309
 
  __Pyx_RefNannyFinishContext();
1310
 
  return __pyx_r;
1311
 
}
1312
 

	
1313
 
/* "vms/rtl/fdl/_vmsfdl.pyx":57
1314
 
 *                          type(text))
1315
 
 * 
1316
 
 * cdef DESCFROMSTR(dsc_descriptor_s* dsc, src):             # <<<<<<<<<<<<<<
1317
 
 *     dsc.dsc_b_dtype = DSC_K_DTYPE_T
1318
 
 *     dsc.dsc_b_class = DSC_K_CLASS_S
1319
 
 */
1320
 

	
1321
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMSTR(struct dsc$descriptor_s *__pyx_v_dsc, PyObject *__pyx_v_src) {
1322
 
  PyObject *__pyx_r = NULL;
1323
 
  __Pyx_RefNannyDeclarations
1324
 
  char *__pyx_t_1;
1325
 
  Py_ssize_t __pyx_t_2;
1326
 
  __Pyx_RefNannySetupContext("DESCFROMSTR", 0);
1327
 

	
1328
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":58
1329
 
 * 
1330
 
 * cdef DESCFROMSTR(dsc_descriptor_s* dsc, src):
1331
 
 *     dsc.dsc_b_dtype = DSC_K_DTYPE_T             # <<<<<<<<<<<<<<
1332
 
 *     dsc.dsc_b_class = DSC_K_CLASS_S
1333
 
 *     dsc.dsc_a_pointer = <char *>src
1334
 
 */
1335
 
  __pyx_v_dsc->dsc$b_dtype = DSC$K_DTYPE_T;
1336
 

	
1337
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":59
1338
 
 * cdef DESCFROMSTR(dsc_descriptor_s* dsc, src):
1339
 
 *     dsc.dsc_b_dtype = DSC_K_DTYPE_T
1340
 
 *     dsc.dsc_b_class = DSC_K_CLASS_S             # <<<<<<<<<<<<<<
1341
 
 *     dsc.dsc_a_pointer = <char *>src
1342
 
 *     dsc.dsc_w_length = len(src)
1343
 
 */
1344
 
  __pyx_v_dsc->dsc$b_class = DSC$K_CLASS_S;
1345
 

	
1346
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":60
1347
 
 *     dsc.dsc_b_dtype = DSC_K_DTYPE_T
1348
 
 *     dsc.dsc_b_class = DSC_K_CLASS_S
1349
 
 *     dsc.dsc_a_pointer = <char *>src             # <<<<<<<<<<<<<<
1350
 
 *     dsc.dsc_w_length = len(src)
1351
 
 * 
1352
 
 */
1353
 
  __pyx_t_1 = __Pyx_PyObject_AsString(__pyx_v_src); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
1354
 
  __pyx_v_dsc->dsc$a_pointer = ((char *)__pyx_t_1);
1355
 

	
1356
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":61
1357
 
 *     dsc.dsc_b_class = DSC_K_CLASS_S
1358
 
 *     dsc.dsc_a_pointer = <char *>src
1359
 
 *     dsc.dsc_w_length = len(src)             # <<<<<<<<<<<<<<
1360
 
 * 
1361
 
 * cdef DESCFROMOPTSTR(dsc_descriptor_s** ptr,dsc_descriptor_s* dsc, string):
1362
 
 */
1363
 
  __pyx_t_2 = PyObject_Length(__pyx_v_src); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 61, __pyx_L1_error)
1364
 
  __pyx_v_dsc->dsc$w_length = __pyx_t_2;
1365
 

	
1366
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":57
1367
 
 *                          type(text))
1368
 
 * 
1369
 
 * cdef DESCFROMSTR(dsc_descriptor_s* dsc, src):             # <<<<<<<<<<<<<<
1370
 
 *     dsc.dsc_b_dtype = DSC_K_DTYPE_T
1371
 
 *     dsc.dsc_b_class = DSC_K_CLASS_S
1372
 
 */
1373
 

	
1374
 
  /* function exit code */
1375
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1376
 
  goto __pyx_L0;
1377
 
  __pyx_L1_error:;
1378
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.DESCFROMSTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
1379
 
  __pyx_r = 0;
1380
 
  __pyx_L0:;
1381
 
  __Pyx_XGIVEREF(__pyx_r);
1382
 
  __Pyx_RefNannyFinishContext();
1383
 
  return __pyx_r;
1384
 
}
1385
 

	
1386
 
/* "vms/rtl/fdl/_vmsfdl.pyx":63
1387
 
 *     dsc.dsc_w_length = len(src)
1388
 
 * 
1389
 
 * cdef DESCFROMOPTSTR(dsc_descriptor_s** ptr,dsc_descriptor_s* dsc, string):             # <<<<<<<<<<<<<<
1390
 
 *     if string is not None:
1391
 
 *         DESCFROMSTR(dsc, string)
1392
 
 */
1393
 

	
1394
 
static PyObject *__pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMOPTSTR(struct dsc$descriptor_s **__pyx_v_ptr, struct dsc$descriptor_s *__pyx_v_dsc, PyObject *__pyx_v_string) {
1395
 
  PyObject *__pyx_r = NULL;
1396
 
  __Pyx_RefNannyDeclarations
1397
 
  int __pyx_t_1;
1398
 
  int __pyx_t_2;
1399
 
  PyObject *__pyx_t_3 = NULL;
1400
 
  __Pyx_RefNannySetupContext("DESCFROMOPTSTR", 0);
1401
 

	
1402
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":64
1403
 
 * 
1404
 
 * cdef DESCFROMOPTSTR(dsc_descriptor_s** ptr,dsc_descriptor_s* dsc, string):
1405
 
 *     if string is not None:             # <<<<<<<<<<<<<<
1406
 
 *         DESCFROMSTR(dsc, string)
1407
 
 *         ptr[0] = dsc
1408
 
 */
1409
 
  __pyx_t_1 = (__pyx_v_string != Py_None);
1410
 
  __pyx_t_2 = (__pyx_t_1 != 0);
1411
 
  if (__pyx_t_2) {
1412
 

	
1413
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":65
1414
 
 * cdef DESCFROMOPTSTR(dsc_descriptor_s** ptr,dsc_descriptor_s* dsc, string):
1415
 
 *     if string is not None:
1416
 
 *         DESCFROMSTR(dsc, string)             # <<<<<<<<<<<<<<
1417
 
 *         ptr[0] = dsc
1418
 
 *     else:
1419
 
 */
1420
 
    __pyx_t_3 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMSTR(__pyx_v_dsc, __pyx_v_string); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
1421
 
    __Pyx_GOTREF(__pyx_t_3);
1422
 
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
1423
 

	
1424
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":66
1425
 
 *     if string is not None:
1426
 
 *         DESCFROMSTR(dsc, string)
1427
 
 *         ptr[0] = dsc             # <<<<<<<<<<<<<<
1428
 
 *     else:
1429
 
 *         ptr[0] = NULL
1430
 
 */
1431
 
    (__pyx_v_ptr[0]) = __pyx_v_dsc;
1432
 

	
1433
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":64
1434
 
 * 
1435
 
 * cdef DESCFROMOPTSTR(dsc_descriptor_s** ptr,dsc_descriptor_s* dsc, string):
1436
 
 *     if string is not None:             # <<<<<<<<<<<<<<
1437
 
 *         DESCFROMSTR(dsc, string)
1438
 
 *         ptr[0] = dsc
1439
 
 */
1440
 
    goto __pyx_L3;
1441
 
  }
1442
 

	
1443
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":68
1444
 
 *         ptr[0] = dsc
1445
 
 *     else:
1446
 
 *         ptr[0] = NULL             # <<<<<<<<<<<<<<
1447
 
 * 
1448
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,
1449
 
 */
1450
 
  /*else*/ {
1451
 
    (__pyx_v_ptr[0]) = NULL;
1452
 
  }
1453
 
  __pyx_L3:;
1454
 

	
1455
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":63
1456
 
 *     dsc.dsc_w_length = len(src)
1457
 
 * 
1458
 
 * cdef DESCFROMOPTSTR(dsc_descriptor_s** ptr,dsc_descriptor_s* dsc, string):             # <<<<<<<<<<<<<<
1459
 
 *     if string is not None:
1460
 
 *         DESCFROMSTR(dsc, string)
1461
 
 */
1462
 

	
1463
 
  /* function exit code */
1464
 
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
1465
 
  goto __pyx_L0;
1466
 
  __pyx_L1_error:;
1467
 
  __Pyx_XDECREF(__pyx_t_3);
1468
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.DESCFROMOPTSTR", __pyx_clineno, __pyx_lineno, __pyx_filename);
1469
 
  __pyx_r = 0;
1470
 
  __pyx_L0:;
1471
 
  __Pyx_XGIVEREF(__pyx_r);
1472
 
  __Pyx_RefNannyFinishContext();
1473
 
  return __pyx_r;
1474
 
}
1475
 

	
1476
 
/* "vms/rtl/fdl/_vmsfdl.pyx":70
1477
 
 *         ptr[0] = NULL
1478
 
 * 
1479
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,             # <<<<<<<<<<<<<<
1480
 
 *                unsigned int flags=0, default_fdl=None):
1481
 
 *     "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] \
1482
 
 */
1483
 

	
1484
 
/* Python wrapper */
1485
 
static PyObject *__pyx_pw_3vms_3rtl_3fdl_7_vmsfdl_1fdl_create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
1486
 
static char __pyx_doc_3vms_3rtl_3fdl_7_vmsfdl_fdl_create[] = "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] [, default_name] [, flags] [, default_fdl])";
1487
 
static PyMethodDef __pyx_mdef_3vms_3rtl_3fdl_7_vmsfdl_1fdl_create = {"fdl_create", (PyCFunction)__pyx_pw_3vms_3rtl_3fdl_7_vmsfdl_1fdl_create, METH_VARARGS|METH_KEYWORDS, __pyx_doc_3vms_3rtl_3fdl_7_vmsfdl_fdl_create};
1488
 
static PyObject *__pyx_pw_3vms_3rtl_3fdl_7_vmsfdl_1fdl_create(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1489
 
  PyObject *__pyx_v_fdl_desc = 0;
1490
 
  PyObject *__pyx_v_file_name = 0;
1491
 
  PyObject *__pyx_v_default_name = 0;
1492
 
  unsigned int __pyx_v_flags;
1493
 
  PyObject *__pyx_v_default_fdl = 0;
1494
 
  PyObject *__pyx_r = 0;
1495
 
  __Pyx_RefNannyDeclarations
1496
 
  __Pyx_RefNannySetupContext("fdl_create (wrapper)", 0);
1497
 
  {
1498
 
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fdl_desc,&__pyx_n_s_file_name,&__pyx_n_s_default_name,&__pyx_n_s_flags,&__pyx_n_s_default_fdl,0};
1499
 
    PyObject* values[5] = {0,0,0,0,0};
1500
 
    values[1] = ((PyObject *)Py_None);
1501
 
    values[2] = ((PyObject *)Py_None);
1502
 

	
1503
 
    /* "vms/rtl/fdl/_vmsfdl.pyx":71
1504
 
 * 
1505
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,
1506
 
 *                unsigned int flags=0, default_fdl=None):             # <<<<<<<<<<<<<<
1507
 
 *     "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] \
1508
 
 * [, default_name] [, flags] [, default_fdl])"
1509
 
 */
1510
 
    values[4] = ((PyObject *)Py_None);
1511
 
    if (unlikely(__pyx_kwds)) {
1512
 
      Py_ssize_t kw_args;
1513
 
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1514
 
      switch (pos_args) {
1515
 
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1516
 
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1517
 
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1518
 
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1519
 
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1520
 
        case  0: break;
1521
 
        default: goto __pyx_L5_argtuple_error;
1522
 
      }
1523
 
      kw_args = PyDict_Size(__pyx_kwds);
1524
 
      switch (pos_args) {
1525
 
        case  0:
1526
 
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fdl_desc)) != 0)) kw_args--;
1527
 
        else goto __pyx_L5_argtuple_error;
1528
 
        case  1:
1529
 
        if (kw_args > 0) {
1530
 
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_file_name);
1531
 
          if (value) { values[1] = value; kw_args--; }
1532
 
        }
1533
 
        case  2:
1534
 
        if (kw_args > 0) {
1535
 
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default_name);
1536
 
          if (value) { values[2] = value; kw_args--; }
1537
 
        }
1538
 
        case  3:
1539
 
        if (kw_args > 0) {
1540
 
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags);
1541
 
          if (value) { values[3] = value; kw_args--; }
1542
 
        }
1543
 
        case  4:
1544
 
        if (kw_args > 0) {
1545
 
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default_fdl);
1546
 
          if (value) { values[4] = value; kw_args--; }
1547
 
        }
1548
 
      }
1549
 
      if (unlikely(kw_args > 0)) {
1550
 
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fdl_create") < 0)) __PYX_ERR(0, 70, __pyx_L3_error)
1551
 
      }
1552
 
    } else {
1553
 
      switch (PyTuple_GET_SIZE(__pyx_args)) {
1554
 
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1555
 
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1556
 
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1557
 
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1558
 
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1559
 
        break;
1560
 
        default: goto __pyx_L5_argtuple_error;
1561
 
      }
1562
 
    }
1563
 
    __pyx_v_fdl_desc = values[0];
1564
 
    __pyx_v_file_name = values[1];
1565
 
    __pyx_v_default_name = values[2];
1566
 
    if (values[3]) {
1567
 
      __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(values[3]); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 71, __pyx_L3_error)
1568
 
    } else {
1569
 
      __pyx_v_flags = ((unsigned int)0);
1570
 
    }
1571
 
    __pyx_v_default_fdl = values[4];
1572
 
  }
1573
 
  goto __pyx_L4_argument_unpacking_done;
1574
 
  __pyx_L5_argtuple_error:;
1575
 
  __Pyx_RaiseArgtupleInvalid("fdl_create", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 70, __pyx_L3_error)
1576
 
  __pyx_L3_error:;
1577
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.fdl_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
1578
 
  __Pyx_RefNannyFinishContext();
1579
 
  return NULL;
1580
 
  __pyx_L4_argument_unpacking_done:;
1581
 
  __pyx_r = __pyx_pf_3vms_3rtl_3fdl_7_vmsfdl_fdl_create(__pyx_self, __pyx_v_fdl_desc, __pyx_v_file_name, __pyx_v_default_name, __pyx_v_flags, __pyx_v_default_fdl);
1582
 

	
1583
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":70
1584
 
 *         ptr[0] = NULL
1585
 
 * 
1586
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,             # <<<<<<<<<<<<<<
1587
 
 *                unsigned int flags=0, default_fdl=None):
1588
 
 *     "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] \
1589
 
 */
1590
 

	
1591
 
  /* function exit code */
1592
 
  __Pyx_RefNannyFinishContext();
1593
 
  return __pyx_r;
1594
 
}
1595
 

	
1596
 
static PyObject *__pyx_pf_3vms_3rtl_3fdl_7_vmsfdl_fdl_create(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_fdl_desc, PyObject *__pyx_v_file_name, PyObject *__pyx_v_default_name, unsigned int __pyx_v_flags, PyObject *__pyx_v_default_fdl) {
1597
 
  struct dsc$descriptor_s __pyx_v_fdlDescD;
1598
 
  struct dsc$descriptor_s __pyx_v_fileNameD;
1599
 
  struct dsc$descriptor_s __pyx_v_defaultNameD;
1600
 
  struct dsc$descriptor_s __pyx_v_defaultFDLD;
1601
 
  struct dsc$descriptor_s *__pyx_v_fileNamePtr;
1602
 
  struct dsc$descriptor_s *__pyx_v_defaultNamePtr;
1603
 
  struct dsc$descriptor_s *__pyx_v_defaultFDLPtr;
1604
 
  struct dsc$descriptor_s __pyx_v_bufferD;
1605
 
  char __pyx_v_buffer[0x1000];
1606
 
  unsigned long __pyx_v_retlen;
1607
 
  unsigned long __pyx_v_sts;
1608
 
  unsigned long __pyx_v_stv;
1609
 
  unsigned long __pyx_v_s;
1610
 
  PyObject *__pyx_r = NULL;
1611
 
  __Pyx_RefNannyDeclarations
1612
 
  PyObject *__pyx_t_1 = NULL;
1613
 
  PyObject *__pyx_t_2 = NULL;
1614
 
  PyObject *__pyx_t_3 = NULL;
1615
 
  PyObject *__pyx_t_4 = NULL;
1616
 
  PyObject *__pyx_t_5 = NULL;
1617
 
  __Pyx_RefNannySetupContext("fdl_create", 0);
1618
 
  __Pyx_INCREF(__pyx_v_fdl_desc);
1619
 

	
1620
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":78
1621
 
 *     cdef dsc_descriptor_s defaultNameD
1622
 
 *     cdef dsc_descriptor_s defaultFDLD
1623
 
 *     cdef dsc_descriptor_s* fileNamePtr = NULL             # <<<<<<<<<<<<<<
1624
 
 *     cdef dsc_descriptor_s* defaultNamePtr = NULL
1625
 
 *     cdef dsc_descriptor_s* defaultFDLPtr = NULL
1626
 
 */
1627
 
  __pyx_v_fileNamePtr = NULL;
1628
 

	
1629
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":79
1630
 
 *     cdef dsc_descriptor_s defaultFDLD
1631
 
 *     cdef dsc_descriptor_s* fileNamePtr = NULL
1632
 
 *     cdef dsc_descriptor_s* defaultNamePtr = NULL             # <<<<<<<<<<<<<<
1633
 
 *     cdef dsc_descriptor_s* defaultFDLPtr = NULL
1634
 
 *     cdef dsc_descriptor_s bufferD
1635
 
 */
1636
 
  __pyx_v_defaultNamePtr = NULL;
1637
 

	
1638
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":80
1639
 
 *     cdef dsc_descriptor_s* fileNamePtr = NULL
1640
 
 *     cdef dsc_descriptor_s* defaultNamePtr = NULL
1641
 
 *     cdef dsc_descriptor_s* defaultFDLPtr = NULL             # <<<<<<<<<<<<<<
1642
 
 *     cdef dsc_descriptor_s bufferD
1643
 
 *     cdef char buffer[4096]
1644
 
 */
1645
 
  __pyx_v_defaultFDLPtr = NULL;
1646
 

	
1647
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":83
1648
 
 *     cdef dsc_descriptor_s bufferD
1649
 
 *     cdef char buffer[4096]
1650
 
 *     cdef unsigned long retlen = 0             # <<<<<<<<<<<<<<
1651
 
 *     cdef unsigned long sts = 0
1652
 
 *     cdef unsigned long stv = 0
1653
 
 */
1654
 
  __pyx_v_retlen = 0;
1655
 

	
1656
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":84
1657
 
 *     cdef char buffer[4096]
1658
 
 *     cdef unsigned long retlen = 0
1659
 
 *     cdef unsigned long sts = 0             # <<<<<<<<<<<<<<
1660
 
 *     cdef unsigned long stv = 0
1661
 
 *     DESCSTR(bufferD, buffer)
1662
 
 */
1663
 
  __pyx_v_sts = 0;
1664
 

	
1665
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":85
1666
 
 *     cdef unsigned long retlen = 0
1667
 
 *     cdef unsigned long sts = 0
1668
 
 *     cdef unsigned long stv = 0             # <<<<<<<<<<<<<<
1669
 
 *     DESCSTR(bufferD, buffer)
1670
 
 * 
1671
 
 */
1672
 
  __pyx_v_stv = 0;
1673
 

	
1674
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":86
1675
 
 *     cdef unsigned long sts = 0
1676
 
 *     cdef unsigned long stv = 0
1677
 
 *     DESCSTR(bufferD, buffer)             # <<<<<<<<<<<<<<
1678
 
 * 
1679
 
 *     fdl_desc = getstr(fdl_desc)
1680
 
 */
1681
 
  DESCSTR(__pyx_v_bufferD, __pyx_v_buffer);
1682
 

	
1683
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":88
1684
 
 *     DESCSTR(bufferD, buffer)
1685
 
 * 
1686
 
 *     fdl_desc = getstr(fdl_desc)             # <<<<<<<<<<<<<<
1687
 
 *     DESCFROMSTR(&fdlDescD, fdl_desc)
1688
 
 *     DESCFROMOPTSTR(&fileNamePtr, &fileNameD, file_name)
1689
 
 */
1690
 
  __pyx_t_1 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_getstr(__pyx_v_fdl_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
1691
 
  __Pyx_GOTREF(__pyx_t_1);
1692
 
  __Pyx_DECREF_SET(__pyx_v_fdl_desc, __pyx_t_1);
1693
 
  __pyx_t_1 = 0;
1694
 

	
1695
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":89
1696
 
 * 
1697
 
 *     fdl_desc = getstr(fdl_desc)
1698
 
 *     DESCFROMSTR(&fdlDescD, fdl_desc)             # <<<<<<<<<<<<<<
1699
 
 *     DESCFROMOPTSTR(&fileNamePtr, &fileNameD, file_name)
1700
 
 *     DESCFROMOPTSTR(&defaultNamePtr, &defaultNameD, default_name)
1701
 
 */
1702
 
  __pyx_t_1 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMSTR((&__pyx_v_fdlDescD), __pyx_v_fdl_desc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
1703
 
  __Pyx_GOTREF(__pyx_t_1);
1704
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1705
 

	
1706
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":90
1707
 
 *     fdl_desc = getstr(fdl_desc)
1708
 
 *     DESCFROMSTR(&fdlDescD, fdl_desc)
1709
 
 *     DESCFROMOPTSTR(&fileNamePtr, &fileNameD, file_name)             # <<<<<<<<<<<<<<
1710
 
 *     DESCFROMOPTSTR(&defaultNamePtr, &defaultNameD, default_name)
1711
 
 *     DESCFROMOPTSTR(&defaultFDLPtr, &defaultFDLD, default_fdl)
1712
 
 */
1713
 
  __pyx_t_1 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMOPTSTR((&__pyx_v_fileNamePtr), (&__pyx_v_fileNameD), __pyx_v_file_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
1714
 
  __Pyx_GOTREF(__pyx_t_1);
1715
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1716
 

	
1717
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":91
1718
 
 *     DESCFROMSTR(&fdlDescD, fdl_desc)
1719
 
 *     DESCFROMOPTSTR(&fileNamePtr, &fileNameD, file_name)
1720
 
 *     DESCFROMOPTSTR(&defaultNamePtr, &defaultNameD, default_name)             # <<<<<<<<<<<<<<
1721
 
 *     DESCFROMOPTSTR(&defaultFDLPtr, &defaultFDLD, default_fdl)
1722
 
 *     s = fdl_fdl_create(&fdlDescD, fileNamePtr, defaultNamePtr, &bufferD, NULL,
1723
 
 */
1724
 
  __pyx_t_1 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMOPTSTR((&__pyx_v_defaultNamePtr), (&__pyx_v_defaultNameD), __pyx_v_default_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
1725
 
  __Pyx_GOTREF(__pyx_t_1);
1726
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1727
 

	
1728
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":92
1729
 
 *     DESCFROMOPTSTR(&fileNamePtr, &fileNameD, file_name)
1730
 
 *     DESCFROMOPTSTR(&defaultNamePtr, &defaultNameD, default_name)
1731
 
 *     DESCFROMOPTSTR(&defaultFDLPtr, &defaultFDLD, default_fdl)             # <<<<<<<<<<<<<<
1732
 
 *     s = fdl_fdl_create(&fdlDescD, fileNamePtr, defaultNamePtr, &bufferD, NULL,
1733
 
 *                    &flags, NULL, &retlen, &sts, &stv, defaultFDLPtr)
1734
 
 */
1735
 
  __pyx_t_1 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_DESCFROMOPTSTR((&__pyx_v_defaultFDLPtr), (&__pyx_v_defaultFDLD), __pyx_v_default_fdl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 92, __pyx_L1_error)
1736
 
  __Pyx_GOTREF(__pyx_t_1);
1737
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1738
 

	
1739
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":93
1740
 
 *     DESCFROMOPTSTR(&defaultNamePtr, &defaultNameD, default_name)
1741
 
 *     DESCFROMOPTSTR(&defaultFDLPtr, &defaultFDLD, default_fdl)
1742
 
 *     s = fdl_fdl_create(&fdlDescD, fileNamePtr, defaultNamePtr, &bufferD, NULL,             # <<<<<<<<<<<<<<
1743
 
 *                    &flags, NULL, &retlen, &sts, &stv, defaultFDLPtr)
1744
 
 * 
1745
 
 */
1746
 
  __pyx_v_s = fdl$create((&__pyx_v_fdlDescD), __pyx_v_fileNamePtr, __pyx_v_defaultNamePtr, (&__pyx_v_bufferD), NULL, (&__pyx_v_flags), NULL, (&__pyx_v_retlen), (&__pyx_v_sts), (&__pyx_v_stv), __pyx_v_defaultFDLPtr);
1747
 

	
1748
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":96
1749
 
 *                    &flags, NULL, &retlen, &sts, &stv, defaultFDLPtr)
1750
 
 * 
1751
 
 *     checkStatus(s)             # <<<<<<<<<<<<<<
1752
 
 *     return s, sts, stv, buffer[:retlen]
1753
 
 */
1754
 
  __pyx_t_1 = __pyx_f_3vms_3rtl_3fdl_7_vmsfdl_checkStatus(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
1755
 
  __Pyx_GOTREF(__pyx_t_1);
1756
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
1757
 

	
1758
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":97
1759
 
 * 
1760
 
 *     checkStatus(s)
1761
 
 *     return s, sts, stv, buffer[:retlen]             # <<<<<<<<<<<<<<
1762
 
 */
1763
 
  __Pyx_XDECREF(__pyx_r);
1764
 
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_long(__pyx_v_s); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 97, __pyx_L1_error)
1765
 
  __Pyx_GOTREF(__pyx_t_1);
1766
 
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_long(__pyx_v_sts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
1767
 
  __Pyx_GOTREF(__pyx_t_2);
1768
 
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_long(__pyx_v_stv); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 97, __pyx_L1_error)
1769
 
  __Pyx_GOTREF(__pyx_t_3);
1770
 
  __pyx_t_4 = __Pyx_PyBytes_FromStringAndSize(((const char*)__pyx_v_buffer) + 0, __pyx_v_retlen - 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 97, __pyx_L1_error)
1771
 
  __Pyx_GOTREF(__pyx_t_4);
1772
 
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 97, __pyx_L1_error)
1773
 
  __Pyx_GOTREF(__pyx_t_5);
1774
 
  __Pyx_GIVEREF(__pyx_t_1);
1775
 
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
1776
 
  __Pyx_GIVEREF(__pyx_t_2);
1777
 
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
1778
 
  __Pyx_GIVEREF(__pyx_t_3);
1779
 
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
1780
 
  __Pyx_GIVEREF(__pyx_t_4);
1781
 
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
1782
 
  __pyx_t_1 = 0;
1783
 
  __pyx_t_2 = 0;
1784
 
  __pyx_t_3 = 0;
1785
 
  __pyx_t_4 = 0;
1786
 
  __pyx_r = __pyx_t_5;
1787
 
  __pyx_t_5 = 0;
1788
 
  goto __pyx_L0;
1789
 

	
1790
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":70
1791
 
 *         ptr[0] = NULL
1792
 
 * 
1793
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,             # <<<<<<<<<<<<<<
1794
 
 *                unsigned int flags=0, default_fdl=None):
1795
 
 *     "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] \
1796
 
 */
1797
 

	
1798
 
  /* function exit code */
1799
 
  __pyx_L1_error:;
1800
 
  __Pyx_XDECREF(__pyx_t_1);
1801
 
  __Pyx_XDECREF(__pyx_t_2);
1802
 
  __Pyx_XDECREF(__pyx_t_3);
1803
 
  __Pyx_XDECREF(__pyx_t_4);
1804
 
  __Pyx_XDECREF(__pyx_t_5);
1805
 
  __Pyx_AddTraceback("vms.rtl.fdl._vmsfdl.fdl_create", __pyx_clineno, __pyx_lineno, __pyx_filename);
1806
 
  __pyx_r = NULL;
1807
 
  __pyx_L0:;
1808
 
  __Pyx_XDECREF(__pyx_v_fdl_desc);
1809
 
  __Pyx_XGIVEREF(__pyx_r);
1810
 
  __Pyx_RefNannyFinishContext();
1811
 
  return __pyx_r;
1812
 
}
1813
 

	
1814
 
static PyMethodDef __pyx_methods[] = {
1815
 
  {0, 0, 0, 0}
1816
 
};
1817
 

	
1818
 
#if PY_MAJOR_VERSION >= 3
1819
 
static struct PyModuleDef __pyx_moduledef = {
1820
 
  #if PY_VERSION_HEX < 0x03020000
1821
 
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
1822
 
  #else
1823
 
    PyModuleDef_HEAD_INIT,
1824
 
  #endif
1825
 
    "_vmsfdl",
1826
 
    0, /* m_doc */
1827
 
    -1, /* m_size */
1828
 
    __pyx_methods /* m_methods */,
1829
 
    NULL, /* m_reload */
1830
 
    NULL, /* m_traverse */
1831
 
    NULL, /* m_clear */
1832
 
    NULL /* m_free */
1833
 
};
1834
 
#endif
1835
 

	
1836
 
static __Pyx_StringTabEntry __pyx_string_tab[] = {
1837
 
  {&__pyx_kp_s_DISK_REPOS_vmspython_python_loc, __pyx_k_DISK_REPOS_vmspython_python_loc, sizeof(__pyx_k_DISK_REPOS_vmspython_python_loc), 0, 0, 1, 0},
1838
 
  {&__pyx_kp_s_iso885915_ISO_8859_15, __pyx_k_ISO_8859_15, sizeof(__pyx_k_ISO_8859_15), "iso-8859-15", 0, 1, 0},
1839
 
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
1840
 
  {&__pyx_n_s_VMSError, __pyx_k_VMSError, sizeof(__pyx_k_VMSError), 0, 0, 1, 1},
1841
 
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
1842
 
  {&__pyx_n_s_buffer, __pyx_k_buffer, sizeof(__pyx_k_buffer), 0, 0, 1, 1},
1843
 
  {&__pyx_n_s_bufferD, __pyx_k_bufferD, sizeof(__pyx_k_bufferD), 0, 0, 1, 1},
1844
 
  {&__pyx_n_s_defaultFDLD, __pyx_k_defaultFDLD, sizeof(__pyx_k_defaultFDLD), 0, 0, 1, 1},
1845
 
  {&__pyx_n_s_defaultFDLPtr, __pyx_k_defaultFDLPtr, sizeof(__pyx_k_defaultFDLPtr), 0, 0, 1, 1},
1846
 
  {&__pyx_n_s_defaultNameD, __pyx_k_defaultNameD, sizeof(__pyx_k_defaultNameD), 0, 0, 1, 1},
1847
 
  {&__pyx_n_s_defaultNamePtr, __pyx_k_defaultNamePtr, sizeof(__pyx_k_defaultNamePtr), 0, 0, 1, 1},
1848
 
  {&__pyx_n_s_default_fdl, __pyx_k_default_fdl, sizeof(__pyx_k_default_fdl), 0, 0, 1, 1},
1849
 
  {&__pyx_n_s_default_name, __pyx_k_default_name, sizeof(__pyx_k_default_name), 0, 0, 1, 1},
1850
 
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
1851
 
  {&__pyx_kp_s_iso885915_expected_string_or_Unicode_objec, __pyx_k_expected_string_or_Unicode_objec, sizeof(__pyx_k_expected_string_or_Unicode_objec), "iso-8859-15", 0, 1, 0},
1852
 
  {&__pyx_n_s_fdlDescD, __pyx_k_fdlDescD, sizeof(__pyx_k_fdlDescD), 0, 0, 1, 1},
1853
 
  {&__pyx_n_s_fdl_create, __pyx_k_fdl_create, sizeof(__pyx_k_fdl_create), 0, 0, 1, 1},
1854
 
  {&__pyx_n_s_fdl_desc, __pyx_k_fdl_desc, sizeof(__pyx_k_fdl_desc), 0, 0, 1, 1},
1855
 
  {&__pyx_n_s_fileNameD, __pyx_k_fileNameD, sizeof(__pyx_k_fileNameD), 0, 0, 1, 1},
1856
 
  {&__pyx_n_s_fileNamePtr, __pyx_k_fileNamePtr, sizeof(__pyx_k_fileNamePtr), 0, 0, 1, 1},
1857
 
  {&__pyx_n_s_file_name, __pyx_k_file_name, sizeof(__pyx_k_file_name), 0, 0, 1, 1},
1858
 
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
1859
 
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
1860
 
  {&__pyx_n_s_retlen, __pyx_k_retlen, sizeof(__pyx_k_retlen), 0, 0, 1, 1},
1861
 
  {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
1862
 
  {&__pyx_n_s_sts, __pyx_k_sts, sizeof(__pyx_k_sts), 0, 0, 1, 1},
1863
 
  {&__pyx_n_s_stv, __pyx_k_stv, sizeof(__pyx_k_stv), 0, 0, 1, 1},
1864
 
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
1865
 
  {&__pyx_n_s_vms_rtl_fdl__vmsfdl, __pyx_k_vms_rtl_fdl__vmsfdl, sizeof(__pyx_k_vms_rtl_fdl__vmsfdl), 0, 0, 1, 1},
1866
 
  {0, 0, 0, 0, 0, 0, 0}
1867
 
};
1868
 
static int __Pyx_InitCachedBuiltins(void) {
1869
 
  __pyx_builtin_VMSError = __Pyx_GetBuiltinName(__pyx_n_s_VMSError); if (!__pyx_builtin_VMSError) __PYX_ERR(0, 41, __pyx_L1_error)
1870
 
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 45, __pyx_L1_error)
1871
 
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 54, __pyx_L1_error)
1872
 
  return 0;
1873
 
  __pyx_L1_error:;
1874
 
  return -1;
1875
 
}
1876
 

	
1877
 
static int __Pyx_InitCachedConstants(void) {
1878
 
  __Pyx_RefNannyDeclarations
1879
 
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
1880
 

	
1881
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":50
1882
 
 * cdef getstr(text):
1883
 
 *     if isinstance(text, unicode):
1884
 
 *         return text.encode('ISO-8859-15')             # <<<<<<<<<<<<<<
1885
 
 *     elif text is None or (PY_MAJOR_VERSION < 3) and isinstance(text, str):
1886
 
 *         return text
1887
 
 */
1888
 
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_iso885915_ISO_8859_15); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 50, __pyx_L1_error)
1889
 
  __Pyx_GOTREF(__pyx_tuple_);
1890
 
  __Pyx_GIVEREF(__pyx_tuple_);
1891
 

	
1892
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":70
1893
 
 *         ptr[0] = NULL
1894
 
 * 
1895
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,             # <<<<<<<<<<<<<<
1896
 
 *                unsigned int flags=0, default_fdl=None):
1897
 
 *     "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] \
1898
 
 */
1899
 
  __pyx_tuple__2 = PyTuple_Pack(18, __pyx_n_s_fdl_desc, __pyx_n_s_file_name, __pyx_n_s_default_name, __pyx_n_s_flags, __pyx_n_s_default_fdl, __pyx_n_s_fdlDescD, __pyx_n_s_fileNameD, __pyx_n_s_defaultNameD, __pyx_n_s_defaultFDLD, __pyx_n_s_fileNamePtr, __pyx_n_s_defaultNamePtr, __pyx_n_s_defaultFDLPtr, __pyx_n_s_bufferD, __pyx_n_s_buffer, __pyx_n_s_retlen, __pyx_n_s_sts, __pyx_n_s_stv, __pyx_n_s_s); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 70, __pyx_L1_error)
1900
 
  __Pyx_GOTREF(__pyx_tuple__2);
1901
 
  __Pyx_GIVEREF(__pyx_tuple__2);
1902
 
  __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(5, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_DISK_REPOS_vmspython_python_loc, __pyx_n_s_fdl_create, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 70, __pyx_L1_error)
1903
 
  __Pyx_RefNannyFinishContext();
1904
 
  return 0;
1905
 
  __pyx_L1_error:;
1906
 
  __Pyx_RefNannyFinishContext();
1907
 
  return -1;
1908
 
}
1909
 

	
1910
 
static int __Pyx_InitGlobals(void) {
1911
 
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
1912
 
  return 0;
1913
 
  __pyx_L1_error:;
1914
 
  return -1;
1915
 
}
1916
 

	
1917
 
#if PY_MAJOR_VERSION < 3
1918
 
PyMODINIT_FUNC init_vmsfdl(void); /*proto*/
1919
 
PyMODINIT_FUNC init_vmsfdl(void)
1920
 
#else
1921
 
PyMODINIT_FUNC PyInit__vmsfdl(void); /*proto*/
1922
 
PyMODINIT_FUNC PyInit__vmsfdl(void)
1923
 
#endif
1924
 
{
1925
 
  PyObject *__pyx_t_1 = NULL;
1926
 
  __Pyx_RefNannyDeclarations
1927
 
  #if CYTHON_REFNANNY
1928
 
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
1929
 
  if (!__Pyx_RefNanny) {
1930
 
      PyErr_Clear();
1931
 
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
1932
 
      if (!__Pyx_RefNanny)
1933
 
          Py_FatalError("failed to import 'refnanny' module");
1934
 
  }
1935
 
  #endif
1936
 
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__vmsfdl(void)", 0);
1937
 
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1938
 
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
1939
 
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
1940
 
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
1941
 
  #ifdef __Pyx_CyFunction_USED
1942
 
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1943
 
  #endif
1944
 
  #ifdef __Pyx_FusedFunction_USED
1945
 
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1946
 
  #endif
1947
 
  #ifdef __Pyx_Coroutine_USED
1948
 
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1949
 
  #endif
1950
 
  #ifdef __Pyx_Generator_USED
1951
 
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1952
 
  #endif
1953
 
  #ifdef __Pyx_StopAsyncIteration_USED
1954
 
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1955
 
  #endif
1956
 
  /*--- Library function declarations ---*/
1957
 
  /*--- Threads initialization code ---*/
1958
 
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
1959
 
  #ifdef WITH_THREAD /* Python build with threading support? */
1960
 
  PyEval_InitThreads();
1961
 
  #endif
1962
 
  #endif
1963
 
  /*--- Module creation code ---*/
1964
 
  #if PY_MAJOR_VERSION < 3
1965
 
  __pyx_m = Py_InitModule4("_vmsfdl", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
1966
 
  #else
1967
 
  __pyx_m = PyModule_Create(&__pyx_moduledef);
1968
 
  #endif
1969
 
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
1970
 
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
1971
 
  Py_INCREF(__pyx_d);
1972
 
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
1973
 
  #if CYTHON_COMPILING_IN_PYPY
1974
 
  Py_INCREF(__pyx_b);
1975
 
  #endif
1976
 
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
1977
 
  /*--- Initialize various global constants etc. ---*/
1978
 
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1979
 
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
1980
 
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1981
 
  #endif
1982
 
  if (__pyx_module_is_main_vms__rtl__fdl___vmsfdl) {
1983
 
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1984
 
  }
1985
 
  #if PY_MAJOR_VERSION >= 3
1986
 
  {
1987
 
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
1988
 
    if (!PyDict_GetItemString(modules, "vms.rtl.fdl._vmsfdl")) {
1989
 
      if (unlikely(PyDict_SetItemString(modules, "vms.rtl.fdl._vmsfdl", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
1990
 
    }
1991
 
  }
1992
 
  #endif
1993
 
  /*--- Builtin init code ---*/
1994
 
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1995
 
  /*--- Constants init code ---*/
1996
 
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
1997
 
  /*--- Global init code ---*/
1998
 
  /*--- Variable export code ---*/
1999
 
  /*--- Function export code ---*/
2000
 
  /*--- Type init code ---*/
2001
 
  /*--- Type import code ---*/
2002
 
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
2003
 
  #if CYTHON_COMPILING_IN_PYPY
2004
 
  sizeof(PyTypeObject),
2005
 
  #else
2006
 
  sizeof(PyHeapTypeObject),
2007
 
  #endif
2008
 
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(1, 9, __pyx_L1_error)
2009
 
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(2, 8, __pyx_L1_error)
2010
 
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(3, 15, __pyx_L1_error)
2011
 
  /*--- Variable import code ---*/
2012
 
  /*--- Function import code ---*/
2013
 
  /*--- Execution code ---*/
2014
 
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
2015
 
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2016
 
  #endif
2017
 

	
2018
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":70
2019
 
 *         ptr[0] = NULL
2020
 
 * 
2021
 
 * def fdl_create(fdl_desc, file_name=None, default_name=None,             # <<<<<<<<<<<<<<
2022
 
 *                unsigned int flags=0, default_fdl=None):
2023
 
 *     "status, resultant_string, sts, stv = fdl_create(fdl_name[, file_name] \
2024
 
 */
2025
 
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_3vms_3rtl_3fdl_7_vmsfdl_1fdl_create, NULL, __pyx_n_s_vms_rtl_fdl__vmsfdl); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
2026
 
  __Pyx_GOTREF(__pyx_t_1);
2027
 
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_fdl_create, __pyx_t_1) < 0) __PYX_ERR(0, 70, __pyx_L1_error)
2028
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2029
 

	
2030
 
  /* "vms/rtl/fdl/_vmsfdl.pyx":1
2031
 
 * # -*- coding: ISO-8859-15 -*-             # <<<<<<<<<<<<<<
2032
 
 * # file: _vmsfdl.pyx
2033
 
 * # build:
2034
 
 */
2035
 
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
2036
 
  __Pyx_GOTREF(__pyx_t_1);
2037
 
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
2038
 
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2039
 

	
2040
 
  /*--- Wrapped vars code ---*/
2041
 

	
2042
 
  goto __pyx_L0;
2043
 
  __pyx_L1_error:;
2044
 
  __Pyx_XDECREF(__pyx_t_1);
2045
 
  if (__pyx_m) {
2046
 
    if (__pyx_d) {
2047
 
      __Pyx_AddTraceback("init vms.rtl.fdl._vmsfdl", __pyx_clineno, __pyx_lineno, __pyx_filename);
2048
 
    }
2049
 
    Py_DECREF(__pyx_m); __pyx_m = 0;
2050
 
  } else if (!PyErr_Occurred()) {
2051
 
    PyErr_SetString(PyExc_ImportError, "init vms.rtl.fdl._vmsfdl");
2052
 
  }
2053
 
  __pyx_L0:;
2054
 
  __Pyx_RefNannyFinishContext();
2055
 
  #if PY_MAJOR_VERSION < 3
2056
 
  return;
2057
 
  #else
2058
 
  return __pyx_m;
2059
 
  #endif
2060
 
}
2061
 

	
2062
 
/* --- Runtime support code --- */
2063
 
/* Refnanny */
2064
 
#if CYTHON_REFNANNY
2065
 
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
2066
 
    PyObject *m = NULL, *p = NULL;
2067
 
    void *r = NULL;
2068
 
    m = PyImport_ImportModule((char *)modname);
2069
 
    if (!m) goto end;
2070
 
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
2071
 
    if (!p) goto end;
2072
 
    r = PyLong_AsVoidPtr(p);
2073
 
end:
2074
 
    Py_XDECREF(p);
2075
 
    Py_XDECREF(m);
2076
 
    return (__Pyx_RefNannyAPIStruct *)r;
2077
 
}
2078
 
#endif
2079
 

	
2080
 
/* GetBuiltinName */
2081
 
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
2082
 
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
2083
 
    if (unlikely(!result)) {
2084
 
        PyErr_Format(PyExc_NameError,
2085
 
#if PY_MAJOR_VERSION >= 3
2086
 
            "name '%U' is not defined", name);
2087
 
#else
2088
 
            "name '%.200s' is not defined", PyString_AS_STRING(name));
2089
 
#endif
2090
 
    }
2091
 
    return result;
2092
 
}
2093
 

	
2094
 
/* PyObjectCall */
2095
 
#if CYTHON_COMPILING_IN_CPYTHON
2096
 
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
2097
 
    PyObject *result;
2098
 
    ternaryfunc call = func->ob_type->tp_call;
2099
 
    if (unlikely(!call))
2100
 
        return PyObject_Call(func, arg, kw);
2101
 
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
2102
 
        return NULL;
2103
 
    result = (*call)(func, arg, kw);
2104
 
    Py_LeaveRecursiveCall();
2105
 
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
2106
 
        PyErr_SetString(
2107
 
            PyExc_SystemError,
2108
 
            "NULL result without error in PyObject_Call");
2109
 
    }
2110
 
    return result;
2111
 
}
2112
 
#endif
2113
 

	
2114
 
/* PyErrFetchRestore */
2115
 
#if CYTHON_FAST_THREAD_STATE
2116
 
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
2117
 
    PyObject *tmp_type, *tmp_value, *tmp_tb;
2118
 
    tmp_type = tstate->curexc_type;
2119
 
    tmp_value = tstate->curexc_value;
2120
 
    tmp_tb = tstate->curexc_traceback;
2121
 
    tstate->curexc_type = type;
2122
 
    tstate->curexc_value = value;
2123
 
    tstate->curexc_traceback = tb;
2124
 
    Py_XDECREF(tmp_type);
2125
 
    Py_XDECREF(tmp_value);
2126
 
    Py_XDECREF(tmp_tb);
2127
 
}
2128
 
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
2129
 
    *type = tstate->curexc_type;
2130
 
    *value = tstate->curexc_value;
2131
 
    *tb = tstate->curexc_traceback;
2132
 
    tstate->curexc_type = 0;
2133
 
    tstate->curexc_value = 0;
2134
 
    tstate->curexc_traceback = 0;
2135
 
}
2136
 
#endif
2137
 

	
2138
 
/* RaiseException */
2139
 
#if PY_MAJOR_VERSION < 3
2140
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
2141
 
                        CYTHON_UNUSED PyObject *cause) {
2142
 
    __Pyx_PyThreadState_declare
2143
 
    Py_XINCREF(type);
2144
 
    if (!value || value == Py_None)
2145
 
        value = NULL;
2146
 
    else
2147
 
        Py_INCREF(value);
2148
 
    if (!tb || tb == Py_None)
2149
 
        tb = NULL;
2150
 
    else {
2151
 
        Py_INCREF(tb);
2152
 
        if (!PyTraceBack_Check(tb)) {
2153
 
            PyErr_SetString(PyExc_TypeError,
2154
 
                "raise: arg 3 must be a traceback or None");
2155
 
            goto raise_error;
2156
 
        }
2157
 
    }
2158
 
    if (PyType_Check(type)) {
2159
 
#if CYTHON_COMPILING_IN_PYPY
2160
 
        if (!value) {
2161
 
            Py_INCREF(Py_None);
2162
 
            value = Py_None;
2163
 
        }
2164
 
#endif
2165
 
        PyErr_NormalizeException(&type, &value, &tb);
2166
 
    } else {
2167
 
        if (value) {
2168
 
            PyErr_SetString(PyExc_TypeError,
2169
 
                "instance exception may not have a separate value");
2170
 
            goto raise_error;
2171
 
        }
2172
 
        value = type;
2173
 
        type = (PyObject*) Py_TYPE(type);
2174
 
        Py_INCREF(type);
2175
 
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
2176
 
            PyErr_SetString(PyExc_TypeError,
2177
 
                "raise: exception class must be a subclass of BaseException");
2178
 
            goto raise_error;
2179
 
        }
2180
 
    }
2181
 
    __Pyx_PyThreadState_assign
2182
 
    __Pyx_ErrRestore(type, value, tb);
2183
 
    return;
2184
 
raise_error:
2185
 
    Py_XDECREF(value);
2186
 
    Py_XDECREF(type);
2187
 
    Py_XDECREF(tb);
2188
 
    return;
2189
 
}
2190
 
#else
2191
 
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
2192
 
    PyObject* owned_instance = NULL;
2193
 
    if (tb == Py_None) {
2194
 
        tb = 0;
2195
 
    } else if (tb && !PyTraceBack_Check(tb)) {
2196
 
        PyErr_SetString(PyExc_TypeError,
2197
 
            "raise: arg 3 must be a traceback or None");
2198
 
        goto bad;
2199
 
    }
2200
 
    if (value == Py_None)
2201
 
        value = 0;
2202
 
    if (PyExceptionInstance_Check(type)) {
2203
 
        if (value) {
2204
 
            PyErr_SetString(PyExc_TypeError,
2205
 
                "instance exception may not have a separate value");
2206
 
            goto bad;
2207
 
        }
2208
 
        value = type;
2209
 
        type = (PyObject*) Py_TYPE(value);
2210
 
    } else if (PyExceptionClass_Check(type)) {
2211
 
        PyObject *instance_class = NULL;
2212
 
        if (value && PyExceptionInstance_Check(value)) {
2213
 
            instance_class = (PyObject*) Py_TYPE(value);
2214
 
            if (instance_class != type) {
2215
 
                int is_subclass = PyObject_IsSubclass(instance_class, type);
2216
 
                if (!is_subclass) {
2217
 
                    instance_class = NULL;
2218
 
                } else if (unlikely(is_subclass == -1)) {
2219
 
                    goto bad;
2220
 
                } else {
2221
 
                    type = instance_class;
2222
 
                }
2223
 
            }
2224
 
        }
2225
 
        if (!instance_class) {
2226
 
            PyObject *args;
2227
 
            if (!value)
2228
 
                args = PyTuple_New(0);
2229
 
            else if (PyTuple_Check(value)) {
2230
 
                Py_INCREF(value);
2231
 
                args = value;
2232
 
            } else
2233
 
                args = PyTuple_Pack(1, value);
2234
 
            if (!args)
2235
 
                goto bad;
2236
 
            owned_instance = PyObject_Call(type, args, NULL);
2237
 
            Py_DECREF(args);
2238
 
            if (!owned_instance)
2239
 
                goto bad;
2240
 
            value = owned_instance;
2241
 
            if (!PyExceptionInstance_Check(value)) {
2242
 
                PyErr_Format(PyExc_TypeError,
2243
 
                             "calling %R should have returned an instance of "
2244
 
                             "BaseException, not %R",
2245
 
                             type, Py_TYPE(value));
2246
 
                goto bad;
2247
 
            }
2248
 
        }
2249
 
    } else {
2250
 
        PyErr_SetString(PyExc_TypeError,
2251
 
            "raise: exception class must be a subclass of BaseException");
2252
 
        goto bad;
2253
 
    }
2254
 
#if PY_VERSION_HEX >= 0x03030000
2255
 
    if (cause) {
2256
 
#else
2257
 
    if (cause && cause != Py_None) {
2258
 
#endif
2259
 
        PyObject *fixed_cause;
2260
 
        if (cause == Py_None) {
2261
 
            fixed_cause = NULL;
2262
 
        } else if (PyExceptionClass_Check(cause)) {
2263
 
            fixed_cause = PyObject_CallObject(cause, NULL);
2264
 
            if (fixed_cause == NULL)
2265
 
                goto bad;
2266
 
        } else if (PyExceptionInstance_Check(cause)) {
2267
 
            fixed_cause = cause;
2268
 
            Py_INCREF(fixed_cause);
2269
 
        } else {
2270
 
            PyErr_SetString(PyExc_TypeError,
2271
 
                            "exception causes must derive from "
2272
 
                            "BaseException");
2273
 
            goto bad;
2274
 
        }
2275
 
        PyException_SetCause(value, fixed_cause);
2276
 
    }
2277
 
    PyErr_SetObject(type, value);
2278
 
    if (tb) {
2279
 
#if CYTHON_COMPILING_IN_PYPY
2280
 
        PyObject *tmp_type, *tmp_value, *tmp_tb;
2281
 
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
2282
 
        Py_INCREF(tb);
2283
 
        PyErr_Restore(tmp_type, tmp_value, tb);
2284
 
        Py_XDECREF(tmp_tb);
2285
 
#else
2286
 
        PyThreadState *tstate = PyThreadState_GET();
2287
 
        PyObject* tmp_tb = tstate->curexc_traceback;
2288
 
        if (tb != tmp_tb) {
2289
 
            Py_INCREF(tb);
2290
 
            tstate->curexc_traceback = tb;
2291
 
            Py_XDECREF(tmp_tb);
2292
 
        }
2293
 
#endif
2294
 
    }
2295
 
bad:
2296
 
    Py_XDECREF(owned_instance);
2297
 
    return;
2298
 
}
2299
 
#endif
2300
 

	
2301
 
/* RaiseDoubleKeywords */
2302
 
  static void __Pyx_RaiseDoubleKeywordsError(
2303
 
    const char* func_name,
2304
 
    PyObject* kw_name)
2305
 
{
2306
 
    PyErr_Format(PyExc_TypeError,
2307
 
        #if PY_MAJOR_VERSION >= 3
2308
 
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
2309
 
        #else
2310
 
        "%s() got multiple values for keyword argument '%s'", func_name,
2311
 
        PyString_AsString(kw_name));
2312
 
        #endif
2313
 
}
2314
 

	
2315
 
/* ParseKeywords */
2316
 
  static int __Pyx_ParseOptionalKeywords(
2317
 
    PyObject *kwds,
2318
 
    PyObject **argnames[],
2319
 
    PyObject *kwds2,
2320
 
    PyObject *values[],
2321
 
    Py_ssize_t num_pos_args,
2322
 
    const char* function_name)
2323
 
{
2324
 
    PyObject *key = 0, *value = 0;
2325
 
    Py_ssize_t pos = 0;
2326
 
    PyObject*** name;
2327
 
    PyObject*** first_kw_arg = argnames + num_pos_args;
2328
 
    while (PyDict_Next(kwds, &pos, &key, &value)) {
2329
 
        name = first_kw_arg;
2330
 
        while (*name && (**name != key)) name++;
2331
 
        if (*name) {
2332
 
            values[name-argnames] = value;
2333
 
            continue;
2334
 
        }
2335
 
        name = first_kw_arg;
2336
 
        #if PY_MAJOR_VERSION < 3
2337
 
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
2338
 
            while (*name) {
2339
 
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
2340
 
                        && _PyString_Eq(**name, key)) {
2341
 
                    values[name-argnames] = value;
2342
 
                    break;
2343
 
                }
2344
 
                name++;
2345
 
            }
2346
 
            if (*name) continue;
2347
 
            else {
2348
 
                PyObject*** argname = argnames;
2349
 
                while (argname != first_kw_arg) {
2350
 
                    if ((**argname == key) || (
2351
 
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
2352
 
                             && _PyString_Eq(**argname, key))) {
2353
 
                        goto arg_passed_twice;
2354
 
                    }
2355
 
                    argname++;
2356
 
                }
2357
 
            }
2358
 
        } else
2359
 
        #endif
2360
 
        if (likely(PyUnicode_Check(key))) {
2361
 
            while (*name) {
2362
 
                int cmp = (**name == key) ? 0 :
2363
 
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
2364
 
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
2365
 
                #endif
2366
 
                    PyUnicode_Compare(**name, key);
2367
 
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
2368
 
                if (cmp == 0) {
2369
 
                    values[name-argnames] = value;
2370
 
                    break;
2371
 
                }
2372
 
                name++;
2373
 
            }
2374
 
            if (*name) continue;
2375
 
            else {
2376
 
                PyObject*** argname = argnames;
2377
 
                while (argname != first_kw_arg) {
2378
 
                    int cmp = (**argname == key) ? 0 :
2379
 
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
2380
 
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
2381
 
                    #endif
2382
 
                        PyUnicode_Compare(**argname, key);
2383
 
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
2384
 
                    if (cmp == 0) goto arg_passed_twice;
2385
 
                    argname++;
2386
 
                }
2387
 
            }
2388
 
        } else
2389
 
            goto invalid_keyword_type;
2390
 
        if (kwds2) {
2391
 
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
2392
 
        } else {
2393
 
            goto invalid_keyword;
2394
 
        }
2395
 
    }
2396
 
    return 0;
2397
 
arg_passed_twice:
2398
 
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
2399
 
    goto bad;
2400
 
invalid_keyword_type:
2401
 
    PyErr_Format(PyExc_TypeError,
2402
 
        "%.200s() keywords must be strings", function_name);
2403
 
    goto bad;
2404
 
invalid_keyword:
2405
 
    PyErr_Format(PyExc_TypeError,
2406
 
    #if PY_MAJOR_VERSION < 3
2407
 
        "%.200s() got an unexpected keyword argument '%.200s'",
2408
 
        function_name, PyString_AsString(key));
2409
 
    #else
2410
 
        "%s() got an unexpected keyword argument '%U'",
2411
 
        function_name, key);
2412
 
    #endif
2413
 
bad:
2414
 
    return -1;
2415
 
}
2416
 

	
2417
 
/* RaiseArgTupleInvalid */
2418
 
  static void __Pyx_RaiseArgtupleInvalid(
2419
 
    const char* func_name,
2420
 
    int exact,
2421
 
    Py_ssize_t num_min,
2422
 
    Py_ssize_t num_max,
2423
 
    Py_ssize_t num_found)
2424
 
{
2425
 
    Py_ssize_t num_expected;
2426
 
    const char *more_or_less;
2427
 
    if (num_found < num_min) {
2428
 
        num_expected = num_min;
2429
 
        more_or_less = "at least";
2430
 
    } else {
2431
 
        num_expected = num_max;
2432
 
        more_or_less = "at most";
2433
 
    }
2434
 
    if (exact) {
2435
 
        more_or_less = "exactly";
2436
 
    }
2437
 
    PyErr_Format(PyExc_TypeError,
2438
 
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
2439
 
                 func_name, more_or_less, num_expected,
2440
 
                 (num_expected == 1) ? "" : "s", num_found);
2441
 
}
2442
 

	
2443
 
/* CodeObjectCache */
2444
 
  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
2445
 
    int start = 0, mid = 0, end = count - 1;
2446
 
    if (end >= 0 && code_line > entries[end].code_line) {
2447
 
        return count;
2448
 
    }
2449
 
    while (start < end) {
2450
 
        mid = start + (end - start) / 2;
2451
 
        if (code_line < entries[mid].code_line) {
2452
 
            end = mid;
2453
 
        } else if (code_line > entries[mid].code_line) {
2454
 
             start = mid + 1;
2455
 
        } else {
2456
 
            return mid;
2457
 
        }
2458
 
    }
2459
 
    if (code_line <= entries[mid].code_line) {
2460
 
        return mid;
2461
 
    } else {
2462
 
        return mid + 1;
2463
 
    }
2464
 
}
2465
 
static PyCodeObject *__pyx_find_code_object(int code_line) {
2466
 
    PyCodeObject* code_object;
2467
 
    int pos;
2468
 
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
2469
 
        return NULL;
2470
 
    }
2471
 
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
2472
 
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
2473
 
        return NULL;
2474
 
    }
2475
 
    code_object = __pyx_code_cache.entries[pos].code_object;
2476
 
    Py_INCREF(code_object);
2477
 
    return code_object;
2478
 
}
2479
 
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
2480
 
    int pos, i;
2481
 
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
2482
 
    if (unlikely(!code_line)) {
2483
 
        return;
2484
 
    }
2485
 
    if (unlikely(!entries)) {
2486
 
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
2487
 
        if (likely(entries)) {
2488
 
            __pyx_code_cache.entries = entries;
2489
 
            __pyx_code_cache.max_count = 64;
2490
 
            __pyx_code_cache.count = 1;
2491
 
            entries[0].code_line = code_line;
2492
 
            entries[0].code_object = code_object;
2493
 
            Py_INCREF(code_object);
2494
 
        }
2495
 
        return;
2496
 
    }
2497
 
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
2498
 
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
2499
 
        PyCodeObject* tmp = entries[pos].code_object;
2500
 
        entries[pos].code_object = code_object;
2501
 
        Py_DECREF(tmp);
2502
 
        return;
2503
 
    }
2504
 
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
2505
 
        int new_max = __pyx_code_cache.max_count + 64;
2506
 
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
2507
 
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
2508
 
        if (unlikely(!entries)) {
2509
 
            return;
2510
 
        }
2511
 
        __pyx_code_cache.entries = entries;
2512
 
        __pyx_code_cache.max_count = new_max;
2513
 
    }
2514
 
    for (i=__pyx_code_cache.count; i>pos; i--) {
2515
 
        entries[i] = entries[i-1];
2516
 
    }
2517
 
    entries[pos].code_line = code_line;
2518
 
    entries[pos].code_object = code_object;
2519
 
    __pyx_code_cache.count++;
2520
 
    Py_INCREF(code_object);
2521
 
}
2522
 

	
2523
 
/* AddTraceback */
2524
 
  #include "compile.h"
2525
 
#include "frameobject.h"
2526
 
#include "traceback.h"
2527
 
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
2528
 
            const char *funcname, int c_line,
2529
 
            int py_line, const char *filename) {
2530
 
    PyCodeObject *py_code = 0;
2531
 
    PyObject *py_srcfile = 0;
2532
 
    PyObject *py_funcname = 0;
2533
 
    #if PY_MAJOR_VERSION < 3
2534
 
    py_srcfile = PyString_FromString(filename);
2535
 
    #else
2536
 
    py_srcfile = PyUnicode_FromString(filename);
2537
 
    #endif
2538
 
    if (!py_srcfile) goto bad;
2539
 
    if (c_line) {
2540
 
        #if PY_MAJOR_VERSION < 3
2541
 
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
2542
 
        #else
2543
 
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
2544
 
        #endif
2545
 
    }
2546
 
    else {
2547
 
        #if PY_MAJOR_VERSION < 3
2548
 
        py_funcname = PyString_FromString(funcname);
2549
 
        #else
2550
 
        py_funcname = PyUnicode_FromString(funcname);
2551
 
        #endif
2552
 
    }
2553
 
    if (!py_funcname) goto bad;
2554
 
    py_code = __Pyx_PyCode_New(
2555
 
        0,
2556
 
        0,
2557
 
        0,
2558
 
        0,
2559
 
        0,
2560
 
        __pyx_empty_bytes, /*PyObject *code,*/
2561
 
        __pyx_empty_tuple, /*PyObject *consts,*/
2562
 
        __pyx_empty_tuple, /*PyObject *names,*/
2563
 
        __pyx_empty_tuple, /*PyObject *varnames,*/
2564
 
        __pyx_empty_tuple, /*PyObject *freevars,*/
2565
 
        __pyx_empty_tuple, /*PyObject *cellvars,*/
2566
 
        py_srcfile,   /*PyObject *filename,*/
2567
 
        py_funcname,  /*PyObject *name,*/
2568
 
        py_line,
2569
 
        __pyx_empty_bytes  /*PyObject *lnotab*/
2570
 
    );
2571
 
    Py_DECREF(py_srcfile);
2572
 
    Py_DECREF(py_funcname);
2573
 
    return py_code;
2574
 
bad:
2575
 
    Py_XDECREF(py_srcfile);
2576
 
    Py_XDECREF(py_funcname);
2577
 
    return NULL;
2578
 
}
2579
 
static void __Pyx_AddTraceback(const char *funcname, int c_line,
2580
 
                               int py_line, const char *filename) {
2581
 
    PyCodeObject *py_code = 0;
2582
 
    PyFrameObject *py_frame = 0;
2583
 
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
2584
 
    if (!py_code) {
2585
 
        py_code = __Pyx_CreateCodeObjectForTraceback(
2586
 
            funcname, c_line, py_line, filename);
2587
 
        if (!py_code) goto bad;
2588
 
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
2589
 
    }
2590
 
    py_frame = PyFrame_New(
2591
 
        PyThreadState_GET(), /*PyThreadState *tstate,*/
2592
 
        py_code,             /*PyCodeObject *code,*/
2593
 
        __pyx_d,      /*PyObject *globals,*/
2594
 
        0                    /*PyObject *locals*/
2595
 
    );
2596
 
    if (!py_frame) goto bad;
2597
 
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
2598
 
    PyTraceBack_Here(py_frame);
2599
 
bad:
2600
 
    Py_XDECREF(py_code);
2601
 
    Py_XDECREF(py_frame);
2602
 
}
2603
 

	
2604
 
/* CIntFromPyVerify */
2605
 
  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
2606
 
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
2607
 
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
2608
 
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
2609
 
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
2610
 
    {\
2611
 
        func_type value = func_value;\
2612
 
        if (sizeof(target_type) < sizeof(func_type)) {\
2613
 
            if (unlikely(value != (func_type) (target_type) value)) {\
2614
 
                func_type zero = 0;\
2615
 
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
2616
 
                    return (target_type) -1;\
2617
 
                if (is_unsigned && unlikely(value < zero))\
2618
 
                    goto raise_neg_overflow;\
2619
 
                else\
2620
 
                    goto raise_overflow;\
2621
 
            }\
2622
 
        }\
2623
 
        return (target_type) value;\
2624
 
    }
2625
 

	
2626
 
/* CIntToPy */
2627
 
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
2628
 
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
2629
 
    const int is_unsigned = neg_one > const_zero;
2630
 
    if (is_unsigned) {
2631
 
        if (sizeof(unsigned int) < sizeof(long)) {
2632
 
            return PyInt_FromLong((long) value);
2633
 
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
2634
 
            return PyLong_FromUnsignedLong((unsigned long) value);
2635
 
#ifdef HAVE_LONG_LONG
2636
 
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
2637
 
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2638
 
#endif
2639
 
        }
2640
 
    } else {
2641
 
        if (sizeof(unsigned int) <= sizeof(long)) {
2642
 
            return PyInt_FromLong((long) value);
2643
 
#ifdef HAVE_LONG_LONG
2644
 
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
2645
 
            return PyLong_FromLongLong((PY_LONG_LONG) value);
2646
 
#endif
2647
 
        }
2648
 
    }
2649
 
    {
2650
 
        int one = 1; int little = (int)*(unsigned char *)&one;
2651
 
        unsigned char *bytes = (unsigned char *)&value;
2652
 
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
2653
 
                                     little, !is_unsigned);
2654
 
    }
2655
 
}
2656
 

	
2657
 
/* CIntToPy */
2658
 
  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_long(unsigned long value) {
2659
 
    const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
2660
 
    const int is_unsigned = neg_one > const_zero;
2661
 
    if (is_unsigned) {
2662
 
        if (sizeof(unsigned long) < sizeof(long)) {
2663
 
            return PyInt_FromLong((long) value);
2664
 
        } else if (sizeof(unsigned long) <= sizeof(unsigned long)) {
2665
 
            return PyLong_FromUnsignedLong((unsigned long) value);
2666
 
#ifdef HAVE_LONG_LONG
2667
 
        } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
2668
 
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
2669
 
#endif
2670
 
        }
2671
 
    } else {
2672
 
        if (sizeof(unsigned long) <= sizeof(long)) {
2673
 
            return PyInt_FromLong((long) value);
2674
 
#ifdef HAVE_LONG_LONG
2675
 
        } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
2676
 
            return PyLong_FromLongLong((PY_LONG_LONG) value);
2677
 
#endif
2678
 
        }
2679
 
    }
2680
 
    {
2681
 
        int one = 1; int little = (int)*(unsigned char *)&one;
2682
 
        unsigned char *bytes = (unsigned char *)&value;
2683
 
        return _PyLong_FromByteArray(bytes, sizeof(unsigned long),
2684
 
                                     little, !is_unsigned);
2685
 
    }
2686
 
}
2687
 

	
2688
 
/* CIntFromPy */
2689
 
  static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
2690
 
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
2691
 
    const int is_unsigned = neg_one > const_zero;
2692
 
#if PY_MAJOR_VERSION < 3
2693
 
    if (likely(PyInt_Check(x))) {
2694
 
        if (sizeof(unsigned int) < sizeof(long)) {
2695
 
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
2696
 
        } else {
2697
 
            long val = PyInt_AS_LONG(x);
2698
 
            if (is_unsigned && unlikely(val < 0)) {
2699
 
                goto raise_neg_overflow;
2700
 
            }
2701
 
            return (unsigned int) val;
2702
 
        }
2703
 
    } else
2704
 
#endif
2705
 
    if (likely(PyLong_Check(x))) {
2706
 
        if (is_unsigned) {
2707
 
#if CYTHON_USE_PYLONG_INTERNALS
2708
 
            const digit* digits = ((PyLongObject*)x)->ob_digit;
2709
 
            switch (Py_SIZE(x)) {
2710
 
                case  0: return (unsigned int) 0;
2711
 
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
2712
 
                case 2:
2713
 
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
2714
 
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
2715
 
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2716
 
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
2717
 
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
2718
 
                        }
2719
 
                    }
2720
 
                    break;
2721
 
                case 3:
2722
 
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
2723
 
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
2724
 
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2725
 
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
2726
 
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
2727
 
                        }
2728
 
                    }
2729
 
                    break;
2730
 
                case 4:
2731
 
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
2732
 
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
2733
 
                            __PYX_VERIFY_RETURN_INT(unsigned 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])))
2734
 
                        } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
2735
 
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
2736
 
                        }
2737
 
                    }
2738
 
                    break;
2739
 
            }
2740
 
#endif
2741
 
#if CYTHON_COMPILING_IN_CPYTHON
2742
 
            if (unlikely(Py_SIZE(x) < 0)) {
2743
 
                goto raise_neg_overflow;
2744
 
            }
2745
 
#else
2746
 
            {
2747
 
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
2748
 
                if (unlikely(result < 0))
2749
 
                    return (unsigned int) -1;
2750
 
                if (unlikely(result == 1))
2751
 
                    goto raise_neg_overflow;
2752
 
            }
2753
 
#endif
2754
 
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
2755
 
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
2756
 
#ifdef HAVE_LONG_LONG
2757
 
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
2758
 
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
2759
 
#endif
2760
 
            }
2761
 
        } else {
2762
 
#if CYTHON_USE_PYLONG_INTERNALS
2763
 
            const digit* digits = ((PyLongObject*)x)->ob_digit;
2764
 
            switch (Py_SIZE(x)) {
2765
 
                case  0: return (unsigned int) 0;
2766
 
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
2767
 
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
2768
 
                case -2:
2769
 
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
2770
 
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
2771
 
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2772
 
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
2773
 
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
2774
 
                        }
2775
 
                    }
2776
 
                    break;
2777
 
                case 2:
2778
 
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
2779
 
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
2780
 
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2781
 
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
2782
 
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
2783
 
                        }
2784
 
                    }
2785
 
                    break;
2786
 
                case -3:
2787
 
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
2788
 
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
2789
 
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2790
 
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
2791
 
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
2792
 
                        }
2793
 
                    }
2794
 
                    break;
2795
 
                case 3:
2796
 
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
2797
 
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
2798
 
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
2799
 
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
2800
 
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
2801
 
                        }
2802
 
                    }
2803
 
                    break;
2804
 
                case -4:
2805
 
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
2806
 
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
2807
 
                            __PYX_VERIFY_RETURN_INT(unsigned 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])))
2808
 
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
2809
 
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
2810
 
                        }
2811
 
                    }
2812
 
                    break;
2813
 
                case 4:
2814
 
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
2815
 
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
2816
 
                            __PYX_VERIFY_RETURN_INT(unsigned 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])))
2817
 
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
2818
 
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
2819
 
                        }
2820
 
                    }
2821
 
                    break;
2822
 
            }
2823
 
#endif
2824
 
            if (sizeof(unsigned int) <= sizeof(long)) {
2825
 
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
2826
 
#ifdef HAVE_LONG_LONG
2827
 
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
2828
 
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
2829
 
#endif
2830
 
            }
2831
 
        }
2832
 
        {
2833
 
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
2834
 
            PyErr_SetString(PyExc_RuntimeError,
2835
 
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
2836
 
#else
2837
 
            unsigned int val;
2838
 
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
2839
 
 #if PY_MAJOR_VERSION < 3
2840
 
            if (likely(v) && !PyLong_Check(v)) {
2841
 
                PyObject *tmp = v;
2842
 
                v = PyNumber_Long(tmp);
2843
 
                Py_DECREF(tmp);
2844
 
            }
2845
 
 #endif
2846
 
            if (likely(v)) {
2847
 
                int one = 1; int is_little = (int)*(unsigned char *)&one;
2848
 
                unsigned char *bytes = (unsigned char *)&val;
2849
 
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
2850
 
                                              bytes, sizeof(val),
2851
 
                                              is_little, !is_unsigned);
2852
 
                Py_DECREF(v);