~ubuntu-branches/ubuntu/precise/h5py/precise

« back to all changes in this revision

Viewing changes to h5py/_conv.c

  • Committer: Bazaar Package Importer
  • Author(s): Soeren Sonnenburg
  • Date: 2010-03-23 15:38:34 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100323153834-ysfm9nsr8gdnkid3
Tags: 1.3.0-1
* New upstream version.
  - Remove quilt patches.
  - Bump standards version to 3.8.4 (no changes required).
  - Switch to dpkg-source 3.0 (quilt) format.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Generated by Cython 0.12 on Sun Mar 14 21:50:17 2010 */
 
2
 
 
3
#define PY_SSIZE_T_CLEAN
 
4
#include "Python.h"
 
5
#include "structmember.h"
 
6
#ifndef Py_PYTHON_H
 
7
    #error Python headers needed to compile C extensions, please install development version of Python.
 
8
#else
 
9
#ifndef PY_LONG_LONG
 
10
  #define PY_LONG_LONG LONG_LONG
 
11
#endif
 
12
#ifndef DL_EXPORT
 
13
  #define DL_EXPORT(t) t
 
14
#endif
 
15
#if PY_VERSION_HEX < 0x02040000
 
16
  #define METH_COEXIST 0
 
17
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
 
18
  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
 
19
#endif
 
20
#if PY_VERSION_HEX < 0x02050000
 
21
  typedef int Py_ssize_t;
 
22
  #define PY_SSIZE_T_MAX INT_MAX
 
23
  #define PY_SSIZE_T_MIN INT_MIN
 
24
  #define PY_FORMAT_SIZE_T ""
 
25
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
 
26
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
 
27
  #define PyNumber_Index(o)    PyNumber_Int(o)
 
28
  #define PyIndex_Check(o)     PyNumber_Check(o)
 
29
#endif
 
30
#if PY_VERSION_HEX < 0x02060000
 
31
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
 
32
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
 
33
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
 
34
  #define PyVarObject_HEAD_INIT(type, size) \
 
35
          PyObject_HEAD_INIT(type) size,
 
36
  #define PyType_Modified(t)
 
37
 
 
38
  typedef struct {
 
39
       void *buf;
 
40
       PyObject *obj;
 
41
       Py_ssize_t len;
 
42
       Py_ssize_t itemsize;
 
43
       int readonly;
 
44
       int ndim;
 
45
       char *format;
 
46
       Py_ssize_t *shape;
 
47
       Py_ssize_t *strides;
 
48
       Py_ssize_t *suboffsets;
 
49
       void *internal;
 
50
  } Py_buffer;
 
51
 
 
52
  #define PyBUF_SIMPLE 0
 
53
  #define PyBUF_WRITABLE 0x0001
 
54
  #define PyBUF_FORMAT 0x0004
 
55
  #define PyBUF_ND 0x0008
 
56
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
 
57
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
 
58
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
 
59
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
 
60
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
 
61
 
 
62
#endif
 
63
#if PY_MAJOR_VERSION < 3
 
64
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
 
65
#else
 
66
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
 
67
#endif
 
68
#if PY_MAJOR_VERSION >= 3
 
69
  #define Py_TPFLAGS_CHECKTYPES 0
 
70
  #define Py_TPFLAGS_HAVE_INDEX 0
 
71
#endif
 
72
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
 
73
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
 
74
#endif
 
75
#if PY_MAJOR_VERSION >= 3
 
76
  #define PyBaseString_Type            PyUnicode_Type
 
77
  #define PyString_Type                PyUnicode_Type
 
78
  #define PyString_CheckExact          PyUnicode_CheckExact
 
79
#else
 
80
  #define PyBytes_Type                 PyString_Type
 
81
  #define PyBytes_CheckExact           PyString_CheckExact
 
82
#endif
 
83
#if PY_MAJOR_VERSION >= 3
 
84
  #define PyInt_Type                   PyLong_Type
 
85
  #define PyInt_Check(op)              PyLong_Check(op)
 
86
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
 
87
  #define PyInt_FromString             PyLong_FromString
 
88
  #define PyInt_FromUnicode            PyLong_FromUnicode
 
89
  #define PyInt_FromLong               PyLong_FromLong
 
90
  #define PyInt_FromSize_t             PyLong_FromSize_t
 
91
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
 
92
  #define PyInt_AsLong                 PyLong_AsLong
 
93
  #define PyInt_AS_LONG                PyLong_AS_LONG
 
94
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
 
95
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
 
96
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
 
97
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
 
98
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
 
99
#else
 
100
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
 
101
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
 
102
#endif
 
103
#if PY_MAJOR_VERSION >= 3
 
104
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
 
105
#endif
 
106
#if !defined(WIN32) && !defined(MS_WINDOWS)
 
107
  #ifndef __stdcall
 
108
    #define __stdcall
 
109
  #endif
 
110
  #ifndef __cdecl
 
111
    #define __cdecl
 
112
  #endif
 
113
  #ifndef __fastcall
 
114
    #define __fastcall
 
115
  #endif
 
116
#else
 
117
  #define _USE_MATH_DEFINES
 
118
#endif
 
119
#if PY_VERSION_HEX < 0x02050000
 
120
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
 
121
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
 
122
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
 
123
#else
 
124
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
 
125
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
 
126
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
 
127
#endif
 
128
#if PY_VERSION_HEX < 0x02050000
 
129
  #define __Pyx_NAMESTR(n) ((char *)(n))
 
130
  #define __Pyx_DOCSTR(n)  ((char *)(n))
 
131
#else
 
132
  #define __Pyx_NAMESTR(n) (n)
 
133
  #define __Pyx_DOCSTR(n)  (n)
 
134
#endif
 
135
#ifdef __cplusplus
 
136
#define __PYX_EXTERN_C extern "C"
 
137
#else
 
138
#define __PYX_EXTERN_C extern
 
139
#endif
 
140
#include <math.h>
 
141
#define __PYX_HAVE_API__h5py___conv
 
142
#include "stdlib.h"
 
143
#include "string.h"
 
144
#include "time.h"
 
145
#include "unistd.h"
 
146
#include "stdint.h"
 
147
#include "compat.h"
 
148
#include "lzf_filter.h"
 
149
#include "hdf5.h"
 
150
 
 
151
#ifdef __GNUC__
 
152
#define INLINE __inline__
 
153
#elif _WIN32
 
154
#define INLINE __inline
 
155
#else
 
156
#define INLINE 
 
157
#endif
 
158
 
 
159
typedef struct {PyObject **p; char *s; const long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
 
160
 
 
161
 
 
162
/* Type Conversion Predeclarations */
 
163
 
 
164
#if PY_MAJOR_VERSION < 3
 
165
#define __Pyx_PyBytes_FromString          PyString_FromString
 
166
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
 
167
#define __Pyx_PyBytes_AsString            PyString_AsString
 
168
#else
 
169
#define __Pyx_PyBytes_FromString          PyBytes_FromString
 
170
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
 
171
#define __Pyx_PyBytes_AsString            PyBytes_AsString
 
172
#endif
 
173
 
 
174
#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
 
175
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
 
176
 
 
177
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
 
178
static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
 
179
static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
 
180
 
 
181
#if !defined(T_PYSSIZET)
 
182
#if PY_VERSION_HEX < 0x02050000
 
183
#define T_PYSSIZET T_INT
 
184
#elif !defined(T_LONGLONG)
 
185
#define T_PYSSIZET \
 
186
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
 
187
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
 
188
#else
 
189
#define T_PYSSIZET \
 
190
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
 
191
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
 
192
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
 
193
#endif
 
194
#endif
 
195
 
 
196
 
 
197
#if !defined(T_ULONGLONG)
 
198
#define __Pyx_T_UNSIGNED_INT(x) \
 
199
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
 
200
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
 
201
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
 
202
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
 
203
#else
 
204
#define __Pyx_T_UNSIGNED_INT(x) \
 
205
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
 
206
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
 
207
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
 
208
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
 
209
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
 
210
#endif
 
211
#if !defined(T_LONGLONG)
 
212
#define __Pyx_T_SIGNED_INT(x) \
 
213
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
 
214
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
 
215
        ((sizeof(x) == sizeof(int))   ? T_INT : \
 
216
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
 
217
#else
 
218
#define __Pyx_T_SIGNED_INT(x) \
 
219
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
 
220
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
 
221
        ((sizeof(x) == sizeof(int))   ? T_INT : \
 
222
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
 
223
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
 
224
#endif
 
225
 
 
226
#define __Pyx_T_FLOATING(x) \
 
227
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
 
228
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
 
229
 
 
230
#if !defined(T_SIZET)
 
231
#if !defined(T_ULONGLONG)
 
232
#define T_SIZET \
 
233
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
 
234
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
 
235
#else
 
236
#define T_SIZET \
 
237
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
 
238
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
 
239
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
 
240
#endif
 
241
#endif
 
242
 
 
243
static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
 
244
static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
 
245
static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
 
246
 
 
247
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
 
248
 
 
249
 
 
250
#ifdef __GNUC__
 
251
/* Test for GCC > 2.95 */
 
252
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
 
253
#define likely(x)   __builtin_expect(!!(x), 1)
 
254
#define unlikely(x) __builtin_expect(!!(x), 0)
 
255
#else /* __GNUC__ > 2 ... */
 
256
#define likely(x)   (x)
 
257
#define unlikely(x) (x)
 
258
#endif /* __GNUC__ > 2 ... */
 
259
#else /* __GNUC__ */
 
260
#define likely(x)   (x)
 
261
#define unlikely(x) (x)
 
262
#endif /* __GNUC__ */
 
263
    
 
264
static PyObject *__pyx_m;
 
265
static PyObject *__pyx_b;
 
266
static PyObject *__pyx_empty_tuple;
 
267
static PyObject *__pyx_empty_bytes;
 
268
static int __pyx_lineno;
 
269
static int __pyx_clineno = 0;
 
270
static const char * __pyx_cfilenm= __FILE__;
 
271
static const char *__pyx_filename;
 
272
static const char **__pyx_f;
 
273
 
 
274
 
 
275
/* Type declarations */
 
276
 
 
277
/* "/home/tachyon/slave/unix-release/build/h5py/h5r.pxd":20
 
278
 *   ctypedef unsigned char hdset_reg_ref_t[12]
 
279
 * 
 
280
 * cdef union ref_u:             # <<<<<<<<<<<<<<
 
281
 *     hobj_ref_t         obj_ref
 
282
 *     hdset_reg_ref_t    reg_ref
 
283
 */
 
284
 
 
285
union __pyx_t_4h5py_3h5r_ref_u {
 
286
  hobj_ref_t obj_ref;
 
287
  hdset_reg_ref_t reg_ref;
 
288
};
 
289
 
 
290
typedef int (*__pyx_t_4h5py_5_conv_conv_operator_t)(void *, void *, void *, void *);
 
291
 
 
292
typedef herr_t (*__pyx_t_4h5py_5_conv_init_operator_t)(hid_t, hid_t, void **);
 
293
 
 
294
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":107
 
295
 * # String to VLEN routines
 
296
 * 
 
297
 * ctypedef struct conv_size_t:             # <<<<<<<<<<<<<<
 
298
 *     size_t src_size
 
299
 *     size_t dst_size
 
300
 */
 
301
 
 
302
typedef struct {
 
303
  size_t src_size;
 
304
  size_t dst_size;
 
305
} __pyx_t_4h5py_5_conv_conv_size_t;
 
306
 
 
307
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":387
 
308
 * # Enum to integer converter
 
309
 * 
 
310
 * cdef struct conv_enum_t:             # <<<<<<<<<<<<<<
 
311
 *     size_t src_size
 
312
 *     size_t dst_size
 
313
 */
 
314
 
 
315
struct __pyx_t_4h5py_5_conv_conv_enum_t {
 
316
  size_t src_size;
 
317
  size_t dst_size;
 
318
  hid_t supertype;
 
319
  int identical;
 
320
};
 
321
 
 
322
/* "/home/tachyon/slave/unix-release/build/h5py/h5r.pxd":24
 
323
 *     hdset_reg_ref_t    reg_ref
 
324
 * 
 
325
 * cdef class Reference:             # <<<<<<<<<<<<<<
 
326
 * 
 
327
 *     cdef ref_u ref
 
328
 */
 
329
 
 
330
struct __pyx_obj_4h5py_3h5r_Reference {
 
331
  PyObject_HEAD
 
332
  union __pyx_t_4h5py_3h5r_ref_u ref;
 
333
  int typecode;
 
334
  size_t typesize;
 
335
};
 
336
 
 
337
/* "/home/tachyon/slave/unix-release/build/h5py/h5r.pxd":30
 
338
 *     cdef readonly size_t typesize
 
339
 * 
 
340
 * cdef class RegionReference(Reference):             # <<<<<<<<<<<<<<
 
341
 * 
 
342
 *     pass
 
343
 */
 
344
 
 
345
struct __pyx_obj_4h5py_3h5r_RegionReference {
 
346
  struct __pyx_obj_4h5py_3h5r_Reference __pyx_base;
 
347
};
 
348
 
 
349
#ifndef CYTHON_REFNANNY
 
350
  #define CYTHON_REFNANNY 0
 
351
#endif
 
352
 
 
353
#if CYTHON_REFNANNY
 
354
  typedef struct {
 
355
    void (*INCREF)(void*, PyObject*, int);
 
356
    void (*DECREF)(void*, PyObject*, int);
 
357
    void (*GOTREF)(void*, PyObject*, int);
 
358
    void (*GIVEREF)(void*, PyObject*, int);
 
359
    void* (*SetupContext)(const char*, int, const char*);
 
360
    void (*FinishContext)(void**);
 
361
  } __Pyx_RefNannyAPIStruct;
 
362
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
 
363
  static __Pyx_RefNannyAPIStruct * __Pyx_RefNannyImportAPI(const char *modname) {
 
364
    PyObject *m = NULL, *p = NULL;
 
365
    void *r = NULL;
 
366
    m = PyImport_ImportModule((char *)modname);
 
367
    if (!m) goto end;
 
368
    p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
 
369
    if (!p) goto end;
 
370
    r = PyLong_AsVoidPtr(p);
 
371
  end:
 
372
    Py_XDECREF(p);
 
373
    Py_XDECREF(m);
 
374
    return (__Pyx_RefNannyAPIStruct *)r;
 
375
  }
 
376
  #define __Pyx_RefNannySetupContext(name)           void *__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
 
377
  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
 
378
  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
379
  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
380
  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
381
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
 
382
  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r);} } while(0)
 
383
#else
 
384
  #define __Pyx_RefNannySetupContext(name)
 
385
  #define __Pyx_RefNannyFinishContext()
 
386
  #define __Pyx_INCREF(r) Py_INCREF(r)
 
387
  #define __Pyx_DECREF(r) Py_DECREF(r)
 
388
  #define __Pyx_GOTREF(r)
 
389
  #define __Pyx_GIVEREF(r)
 
390
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
 
391
#endif /* CYTHON_REFNANNY */
 
392
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);} } while(0)
 
393
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r);} } while(0)
 
394
 
 
395
static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
396
static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
 
397
 
 
398
static INLINE PyObject *__Pyx_PyInt_to_py_hid_t(hid_t);
 
399
 
 
400
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
 
401
 
 
402
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
 
403
 
 
404
static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
 
405
 
 
406
static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
 
407
 
 
408
static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
 
409
 
 
410
static INLINE char __Pyx_PyInt_AsChar(PyObject *);
 
411
 
 
412
static INLINE short __Pyx_PyInt_AsShort(PyObject *);
 
413
 
 
414
static INLINE int __Pyx_PyInt_AsInt(PyObject *);
 
415
 
 
416
static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
 
417
 
 
418
static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
 
419
 
 
420
static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
 
421
 
 
422
static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
 
423
 
 
424
static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
 
425
 
 
426
static INLINE long __Pyx_PyInt_AsLong(PyObject *);
 
427
 
 
428
static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
 
429
 
 
430
static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
 
431
 
 
432
static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
 
433
 
 
434
static void __Pyx_WriteUnraisable(const char *name); /*proto*/
 
435
 
 
436
#ifndef __PYX_FORCE_INIT_THREADS
 
437
#if PY_VERSION_HEX < 0x02040200
 
438
#define __PYX_FORCE_INIT_THREADS 1
 
439
#else
 
440
#define __PYX_FORCE_INIT_THREADS 0
 
441
#endif
 
442
#endif
 
443
 
 
444
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size);  /*proto*/
 
445
 
 
446
static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
 
447
 
 
448
static void __Pyx_AddTraceback(const char *funcname); /*proto*/
 
449
 
 
450
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
 
451
/* Module declarations from h5py.h5r */
 
452
 
 
453
static PyTypeObject *__pyx_ptype_4h5py_3h5r_Reference = 0;
 
454
static PyTypeObject *__pyx_ptype_4h5py_3h5r_RegionReference = 0;
 
455
/* Module declarations from h5py._conv */
 
456
 
 
457
static hid_t __pyx_v_4h5py_5_conv_H5PY_OBJ;
 
458
static hid_t __pyx_f_4h5py_5_conv_get_python_obj(int __pyx_skip_dispatch); /*proto*/
 
459
static herr_t __pyx_f_4h5py_5_conv_generic_converter(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t, __pyx_t_4h5py_5_conv_conv_operator_t, __pyx_t_4h5py_5_conv_init_operator_t, H5T_bkg_t); /*proto*/
 
460
static herr_t __pyx_f_4h5py_5_conv_init_generic(hid_t, hid_t, void **); /*proto*/
 
461
static int __pyx_f_4h5py_5_conv_conv_vlen2str(void *, void *, void *, void *); /*proto*/
 
462
static int __pyx_f_4h5py_5_conv_conv_str2vlen(void *, void *, void *, void *); /*proto*/
 
463
static herr_t __pyx_f_4h5py_5_conv_init_vlen2fixed(hid_t, hid_t, void **); /*proto*/
 
464
static herr_t __pyx_f_4h5py_5_conv_init_fixed2vlen(hid_t, hid_t, void **); /*proto*/
 
465
static int __pyx_f_4h5py_5_conv_conv_vlen2fixed(void *, void *, void *, void *); /*proto*/
 
466
static int __pyx_f_4h5py_5_conv_conv_fixed2vlen(void *, void *, void *, void *); /*proto*/
 
467
static int __pyx_f_4h5py_5_conv_conv_objref2pyref(void *, void *, void *, void *); /*proto*/
 
468
static int __pyx_f_4h5py_5_conv_conv_pyref2objref(void *, void *, void *, void *); /*proto*/
 
469
static int __pyx_f_4h5py_5_conv_conv_regref2pyref(void *, void *, void *, void *); /*proto*/
 
470
static int __pyx_f_4h5py_5_conv_conv_pyref2regref(void *, void *, void *, void *); /*proto*/
 
471
static herr_t __pyx_f_4h5py_5_conv_vlen2str(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
472
static herr_t __pyx_f_4h5py_5_conv_str2vlen(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
473
static herr_t __pyx_f_4h5py_5_conv_vlen2fixed(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
474
static herr_t __pyx_f_4h5py_5_conv_fixed2vlen(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
475
static herr_t __pyx_f_4h5py_5_conv_objref2pyref(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
476
static herr_t __pyx_f_4h5py_5_conv_pyref2objref(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
477
static herr_t __pyx_f_4h5py_5_conv_regref2pyref(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
478
static herr_t __pyx_f_4h5py_5_conv_pyref2regref(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
479
static herr_t __pyx_f_4h5py_5_conv_enum_int_converter(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t, int); /*proto*/
 
480
static herr_t __pyx_f_4h5py_5_conv_enum2int(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
481
static herr_t __pyx_f_4h5py_5_conv_int2enum(hid_t, hid_t, H5T_cdata_t *, size_t, size_t, size_t, void *, void *, hid_t); /*proto*/
 
482
static int __pyx_f_4h5py_5_conv_register_converters(int __pyx_skip_dispatch); /*proto*/
 
483
static int __pyx_f_4h5py_5_conv_unregister_converters(int __pyx_skip_dispatch); /*proto*/
 
484
#define __Pyx_MODULE_NAME "h5py._conv"
 
485
int __pyx_module_is_main_h5py___conv = 0;
 
486
 
 
487
/* Implementation of h5py._conv */
 
488
static PyObject *__pyx_builtin_ValueError;
 
489
static PyObject *__pyx_builtin_TypeError;
 
490
static PyObject *__pyx_builtin_MemoryError;
 
491
static char __pyx_k_1[] = "PYTHON:OBJECT";
 
492
static char __pyx_k_2[] = "";
 
493
static char __pyx_k_3[] = "VLEN strings do not support embedded NULLs";
 
494
static char __pyx_k_4[] = "Can't convert incompatible object to HDF5 object reference";
 
495
static char __pyx_k_5[] = "Can't convert incompatible object to HDF5 region reference";
 
496
static char __pyx_k_6[] = "Can't allocate conversion buffer";
 
497
static char __pyx_k_7[] = "\n    Low-level type-conversion routines.\n";
 
498
static char __pyx_k__ref[] = "ref";
 
499
static char __pyx_k__priv[] = "priv";
 
500
static char __pyx_k__command[] = "command";
 
501
static char __pyx_k__obj_ref[] = "obj_ref";
 
502
static char __pyx_k__reg_ref[] = "reg_ref";
 
503
static char __pyx_k____main__[] = "__main__";
 
504
static char __pyx_k__dst_size[] = "dst_size";
 
505
static char __pyx_k__enum2int[] = "enum2int";
 
506
static char __pyx_k__int2enum[] = "int2enum";
 
507
static char __pyx_k__need_bkg[] = "need_bkg";
 
508
static char __pyx_k__src_size[] = "src_size";
 
509
static char __pyx_k__str2vlen[] = "str2vlen";
 
510
static char __pyx_k__typecode[] = "typecode";
 
511
static char __pyx_k__vlen2str[] = "vlen2str";
 
512
static char __pyx_k__TypeError[] = "TypeError";
 
513
static char __pyx_k__identical[] = "identical";
 
514
static char __pyx_k__supertype[] = "supertype";
 
515
static char __pyx_k__ValueError[] = "ValueError";
 
516
static char __pyx_k__fixed2vlen[] = "fixed2vlen";
 
517
static char __pyx_k__vlen2fixed[] = "vlen2fixed";
 
518
static char __pyx_k__MemoryError[] = "MemoryError";
 
519
static char __pyx_k__objref2pyref[] = "objref2pyref";
 
520
static char __pyx_k__pyref2objref[] = "pyref2objref";
 
521
static char __pyx_k__pyref2regref[] = "pyref2regref";
 
522
static char __pyx_k__regref2pyref[] = "regref2pyref";
 
523
static PyObject *__pyx_kp_s_3;
 
524
static PyObject *__pyx_kp_s_4;
 
525
static PyObject *__pyx_kp_s_5;
 
526
static PyObject *__pyx_kp_s_6;
 
527
static PyObject *__pyx_n_s__MemoryError;
 
528
static PyObject *__pyx_n_s__TypeError;
 
529
static PyObject *__pyx_n_s__ValueError;
 
530
static PyObject *__pyx_n_s____main__;
 
531
static PyObject *__pyx_n_s__command;
 
532
static PyObject *__pyx_n_s__dst_size;
 
533
static PyObject *__pyx_n_s__identical;
 
534
static PyObject *__pyx_n_s__need_bkg;
 
535
static PyObject *__pyx_n_s__obj_ref;
 
536
static PyObject *__pyx_n_s__priv;
 
537
static PyObject *__pyx_n_s__ref;
 
538
static PyObject *__pyx_n_s__reg_ref;
 
539
static PyObject *__pyx_n_s__src_size;
 
540
static PyObject *__pyx_n_s__supertype;
 
541
static PyObject *__pyx_n_s__typecode;
 
542
 
 
543
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":24
 
544
 * cdef hid_t H5PY_OBJ = 0
 
545
 * 
 
546
 * cpdef hid_t get_python_obj():             # <<<<<<<<<<<<<<
 
547
 *     global H5PY_OBJ
 
548
 *     if H5PY_OBJ <= 0:
 
549
 */
 
550
 
 
551
static PyObject *__pyx_pf_4h5py_5_conv_get_python_obj(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
552
static  hid_t __pyx_f_4h5py_5_conv_get_python_obj(int __pyx_skip_dispatch) {
 
553
  hid_t __pyx_r;
 
554
  int __pyx_t_1;
 
555
  hid_t __pyx_t_2;
 
556
  herr_t __pyx_t_3;
 
557
  __Pyx_RefNannySetupContext("get_python_obj");
 
558
 
 
559
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":26
 
560
 * cpdef hid_t get_python_obj():
 
561
 *     global H5PY_OBJ
 
562
 *     if H5PY_OBJ <= 0:             # <<<<<<<<<<<<<<
 
563
 *         H5PY_OBJ = H5Tcreate(H5T_OPAQUE, sizeof(PyObject*))
 
564
 *         H5Tset_tag(H5PY_OBJ, "PYTHON:OBJECT")
 
565
 */
 
566
  __pyx_t_1 = (__pyx_v_4h5py_5_conv_H5PY_OBJ <= 0);
 
567
  if (__pyx_t_1) {
 
568
 
 
569
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":27
 
570
 *     global H5PY_OBJ
 
571
 *     if H5PY_OBJ <= 0:
 
572
 *         H5PY_OBJ = H5Tcreate(H5T_OPAQUE, sizeof(PyObject*))             # <<<<<<<<<<<<<<
 
573
 *         H5Tset_tag(H5PY_OBJ, "PYTHON:OBJECT")
 
574
 *         H5Tlock(H5PY_OBJ)
 
575
 */
 
576
    __pyx_t_2 = H5Tcreate(H5T_OPAQUE, (sizeof(PyObject *))); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
577
    __pyx_v_4h5py_5_conv_H5PY_OBJ = __pyx_t_2;
 
578
 
 
579
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":28
 
580
 *     if H5PY_OBJ <= 0:
 
581
 *         H5PY_OBJ = H5Tcreate(H5T_OPAQUE, sizeof(PyObject*))
 
582
 *         H5Tset_tag(H5PY_OBJ, "PYTHON:OBJECT")             # <<<<<<<<<<<<<<
 
583
 *         H5Tlock(H5PY_OBJ)
 
584
 *     return H5PY_OBJ
 
585
 */
 
586
    __pyx_t_3 = H5Tset_tag(__pyx_v_4h5py_5_conv_H5PY_OBJ, __pyx_k_1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
587
 
 
588
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":29
 
589
 *         H5PY_OBJ = H5Tcreate(H5T_OPAQUE, sizeof(PyObject*))
 
590
 *         H5Tset_tag(H5PY_OBJ, "PYTHON:OBJECT")
 
591
 *         H5Tlock(H5PY_OBJ)             # <<<<<<<<<<<<<<
 
592
 *     return H5PY_OBJ
 
593
 * 
 
594
 */
 
595
    __pyx_t_3 = H5Tlock(__pyx_v_4h5py_5_conv_H5PY_OBJ); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
596
    goto __pyx_L3;
 
597
  }
 
598
  __pyx_L3:;
 
599
 
 
600
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":30
 
601
 *         H5Tset_tag(H5PY_OBJ, "PYTHON:OBJECT")
 
602
 *         H5Tlock(H5PY_OBJ)
 
603
 *     return H5PY_OBJ             # <<<<<<<<<<<<<<
 
604
 * 
 
605
 * ctypedef int (*conv_operator_t)(void* ipt, void* opt, void* bkg, void* priv) except -1
 
606
 */
 
607
  __pyx_r = __pyx_v_4h5py_5_conv_H5PY_OBJ;
 
608
  goto __pyx_L0;
 
609
 
 
610
  __pyx_r = 0;
 
611
  goto __pyx_L0;
 
612
  __pyx_L1_error:;
 
613
  __Pyx_WriteUnraisable("h5py._conv.get_python_obj");
 
614
  __pyx_r = 0;
 
615
  __pyx_L0:;
 
616
  __Pyx_RefNannyFinishContext();
 
617
  return __pyx_r;
 
618
}
 
619
 
 
620
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":24
 
621
 * cdef hid_t H5PY_OBJ = 0
 
622
 * 
 
623
 * cpdef hid_t get_python_obj():             # <<<<<<<<<<<<<<
 
624
 *     global H5PY_OBJ
 
625
 *     if H5PY_OBJ <= 0:
 
626
 */
 
627
 
 
628
static PyObject *__pyx_pf_4h5py_5_conv_get_python_obj(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
629
static PyObject *__pyx_pf_4h5py_5_conv_get_python_obj(PyObject *__pyx_self, PyObject *unused) {
 
630
  PyObject *__pyx_r = NULL;
 
631
  PyObject *__pyx_t_1 = NULL;
 
632
  __Pyx_RefNannySetupContext("get_python_obj");
 
633
  __pyx_self = __pyx_self;
 
634
  __Pyx_XDECREF(__pyx_r);
 
635
  __pyx_t_1 = __Pyx_PyInt_to_py_hid_t(__pyx_f_4h5py_5_conv_get_python_obj(0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
636
  __Pyx_GOTREF(__pyx_t_1);
 
637
  __pyx_r = __pyx_t_1;
 
638
  __pyx_t_1 = 0;
 
639
  goto __pyx_L0;
 
640
 
 
641
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
642
  goto __pyx_L0;
 
643
  __pyx_L1_error:;
 
644
  __Pyx_XDECREF(__pyx_t_1);
 
645
  __Pyx_AddTraceback("h5py._conv.get_python_obj");
 
646
  __pyx_r = NULL;
 
647
  __pyx_L0:;
 
648
  __Pyx_XGIVEREF(__pyx_r);
 
649
  __Pyx_RefNannyFinishContext();
 
650
  return __pyx_r;
 
651
}
 
652
 
 
653
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":44
 
654
 * # likely small compared to the cost of the Python-side API calls required to
 
655
 * # implement the conversions.
 
656
 * cdef herr_t generic_converter(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
657
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
658
 *                     void *bkg_i, hid_t dxpl, conv_operator_t op,
 
659
 */
 
660
 
 
661
static  herr_t __pyx_f_4h5py_5_conv_generic_converter(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl, __pyx_t_4h5py_5_conv_conv_operator_t __pyx_v_op, __pyx_t_4h5py_5_conv_init_operator_t __pyx_v_initop, H5T_bkg_t __pyx_v_need_bkg) {
 
662
  int __pyx_v_command;
 
663
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_v_sizes;
 
664
  int __pyx_v_i;
 
665
  char *__pyx_v_buf;
 
666
  char *__pyx_v_bkg;
 
667
  herr_t __pyx_r;
 
668
  int __pyx_t_1;
 
669
  herr_t __pyx_t_2;
 
670
  size_t __pyx_t_3;
 
671
  int __pyx_t_4;
 
672
  __Pyx_RefNannySetupContext("generic_converter");
 
673
 
 
674
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":49
 
675
 *                     init_operator_t initop, H5T_bkg_t need_bkg) except -1:
 
676
 * 
 
677
 *     cdef int command = cdata[0].command             # <<<<<<<<<<<<<<
 
678
 *     cdef conv_size_t *sizes
 
679
 *     cdef int i
 
680
 */
 
681
  __pyx_v_command = (__pyx_v_cdata[0]).command;
 
682
 
 
683
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":53
 
684
 *     cdef int i
 
685
 * 
 
686
 *     cdef char* buf = <char*>buf_i             # <<<<<<<<<<<<<<
 
687
 *     cdef char* bkg = <char*>bkg_i
 
688
 * 
 
689
 */
 
690
  __pyx_v_buf = ((char *)__pyx_v_buf_i);
 
691
 
 
692
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":54
 
693
 * 
 
694
 *     cdef char* buf = <char*>buf_i
 
695
 *     cdef char* bkg = <char*>bkg_i             # <<<<<<<<<<<<<<
 
696
 * 
 
697
 *     if command == H5T_CONV_INIT:
 
698
 */
 
699
  __pyx_v_bkg = ((char *)__pyx_v_bkg_i);
 
700
 
 
701
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":56
 
702
 *     cdef char* bkg = <char*>bkg_i
 
703
 * 
 
704
 *     if command == H5T_CONV_INIT:             # <<<<<<<<<<<<<<
 
705
 * 
 
706
 *         cdata[0].need_bkg = need_bkg
 
707
 */
 
708
  __pyx_t_1 = (__pyx_v_command == H5T_CONV_INIT);
 
709
  if (__pyx_t_1) {
 
710
 
 
711
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":58
 
712
 *     if command == H5T_CONV_INIT:
 
713
 * 
 
714
 *         cdata[0].need_bkg = need_bkg             # <<<<<<<<<<<<<<
 
715
 *         return initop(src_id, dst_id, &(cdata[0].priv))
 
716
 * 
 
717
 */
 
718
    (__pyx_v_cdata[0]).need_bkg = __pyx_v_need_bkg;
 
719
 
 
720
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":59
 
721
 * 
 
722
 *         cdata[0].need_bkg = need_bkg
 
723
 *         return initop(src_id, dst_id, &(cdata[0].priv))             # <<<<<<<<<<<<<<
 
724
 * 
 
725
 *     elif command == H5T_CONV_FREE:
 
726
 */
 
727
    __pyx_t_2 = __pyx_v_initop(__pyx_v_src_id, __pyx_v_dst_id, (&(__pyx_v_cdata[0]).priv)); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
728
    __pyx_r = __pyx_t_2;
 
729
    goto __pyx_L0;
 
730
    goto __pyx_L3;
 
731
  }
 
732
 
 
733
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":61
 
734
 *         return initop(src_id, dst_id, &(cdata[0].priv))
 
735
 * 
 
736
 *     elif command == H5T_CONV_FREE:             # <<<<<<<<<<<<<<
 
737
 * 
 
738
 *         free(cdata[0].priv)
 
739
 */
 
740
  __pyx_t_1 = (__pyx_v_command == H5T_CONV_FREE);
 
741
  if (__pyx_t_1) {
 
742
 
 
743
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":63
 
744
 *     elif command == H5T_CONV_FREE:
 
745
 * 
 
746
 *         free(cdata[0].priv)             # <<<<<<<<<<<<<<
 
747
 *         cdata[0].priv = NULL
 
748
 * 
 
749
 */
 
750
    free((__pyx_v_cdata[0]).priv);
 
751
 
 
752
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":64
 
753
 * 
 
754
 *         free(cdata[0].priv)
 
755
 *         cdata[0].priv = NULL             # <<<<<<<<<<<<<<
 
756
 * 
 
757
 *     elif command == H5T_CONV_CONV:
 
758
 */
 
759
    (__pyx_v_cdata[0]).priv = NULL;
 
760
    goto __pyx_L3;
 
761
  }
 
762
 
 
763
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":66
 
764
 *         cdata[0].priv = NULL
 
765
 * 
 
766
 *     elif command == H5T_CONV_CONV:             # <<<<<<<<<<<<<<
 
767
 * 
 
768
 *         sizes = <conv_size_t*>cdata[0].priv
 
769
 */
 
770
  __pyx_t_1 = (__pyx_v_command == H5T_CONV_CONV);
 
771
  if (__pyx_t_1) {
 
772
 
 
773
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":68
 
774
 *     elif command == H5T_CONV_CONV:
 
775
 * 
 
776
 *         sizes = <conv_size_t*>cdata[0].priv             # <<<<<<<<<<<<<<
 
777
 * 
 
778
 *         if bkg_stride==0: bkg_stride = sizes[0].dst_size;
 
779
 */
 
780
    __pyx_v_sizes = ((__pyx_t_4h5py_5_conv_conv_size_t *)(__pyx_v_cdata[0]).priv);
 
781
 
 
782
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":70
 
783
 *         sizes = <conv_size_t*>cdata[0].priv
 
784
 * 
 
785
 *         if bkg_stride==0: bkg_stride = sizes[0].dst_size;             # <<<<<<<<<<<<<<
 
786
 * 
 
787
 *         if buf_stride == 0:
 
788
 */
 
789
    __pyx_t_1 = (__pyx_v_bkg_stride == 0);
 
790
    if (__pyx_t_1) {
 
791
      __pyx_v_bkg_stride = (__pyx_v_sizes[0]).dst_size;
 
792
      goto __pyx_L4;
 
793
    }
 
794
    __pyx_L4:;
 
795
 
 
796
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":72
 
797
 *         if bkg_stride==0: bkg_stride = sizes[0].dst_size;
 
798
 * 
 
799
 *         if buf_stride == 0:             # <<<<<<<<<<<<<<
 
800
 *             # No explicit stride seems to mean that the elements are packed
 
801
 *             # contiguously in the buffer.  In this case we must be careful
 
802
 */
 
803
    __pyx_t_1 = (__pyx_v_buf_stride == 0);
 
804
    if (__pyx_t_1) {
 
805
 
 
806
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":78
 
807
 *             # of a larger size.
 
808
 * 
 
809
 *             if sizes[0].src_size >= sizes[0].dst_size:             # <<<<<<<<<<<<<<
 
810
 *                 for i from 0<=i<nl:
 
811
 *                     op( buf + (i*sizes[0].src_size),    # input pointer
 
812
 */
 
813
      __pyx_t_1 = ((__pyx_v_sizes[0]).src_size >= (__pyx_v_sizes[0]).dst_size);
 
814
      if (__pyx_t_1) {
 
815
 
 
816
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":79
 
817
 * 
 
818
 *             if sizes[0].src_size >= sizes[0].dst_size:
 
819
 *                 for i from 0<=i<nl:             # <<<<<<<<<<<<<<
 
820
 *                     op( buf + (i*sizes[0].src_size),    # input pointer
 
821
 *                         buf + (i*sizes[0].dst_size),    # output pointer
 
822
 */
 
823
        __pyx_t_3 = __pyx_v_nl;
 
824
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
 
825
 
 
826
          /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":83
 
827
 *                         buf + (i*sizes[0].dst_size),    # output pointer
 
828
 *                         bkg + (i*bkg_stride),           # backing buffer
 
829
 *                         cdata[0].priv)                  # conversion context             # <<<<<<<<<<<<<<
 
830
 *             else:
 
831
 *                 for i from nl>i>=0:
 
832
 */
 
833
          __pyx_t_4 = __pyx_v_op((__pyx_v_buf + (__pyx_v_i * (__pyx_v_sizes[0]).src_size)), (__pyx_v_buf + (__pyx_v_i * (__pyx_v_sizes[0]).dst_size)), (__pyx_v_bkg + (__pyx_v_i * __pyx_v_bkg_stride)), (__pyx_v_cdata[0]).priv); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
834
        }
 
835
        goto __pyx_L6;
 
836
      }
 
837
      /*else*/ {
 
838
 
 
839
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":85
 
840
 *                         cdata[0].priv)                  # conversion context
 
841
 *             else:
 
842
 *                 for i from nl>i>=0:             # <<<<<<<<<<<<<<
 
843
 *                     op( buf + (i*sizes[0].src_size),
 
844
 *                         buf + (i*sizes[0].dst_size),
 
845
 */
 
846
        for (__pyx_v_i = __pyx_v_nl-1; __pyx_v_i >= 0; __pyx_v_i--) {
 
847
 
 
848
          /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":89
 
849
 *                         buf + (i*sizes[0].dst_size),
 
850
 *                         bkg + (i*bkg_stride),
 
851
 *                         cdata[0].priv)             # <<<<<<<<<<<<<<
 
852
 *         else:
 
853
 *             # With explicit strides, we assume that the library knows the
 
854
 */
 
855
          __pyx_t_4 = __pyx_v_op((__pyx_v_buf + (__pyx_v_i * (__pyx_v_sizes[0]).src_size)), (__pyx_v_buf + (__pyx_v_i * (__pyx_v_sizes[0]).dst_size)), (__pyx_v_bkg + (__pyx_v_i * __pyx_v_bkg_stride)), (__pyx_v_cdata[0]).priv); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
856
        }
 
857
      }
 
858
      __pyx_L6:;
 
859
      goto __pyx_L5;
 
860
    }
 
861
    /*else*/ {
 
862
 
 
863
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":94
 
864
 *             # alignment better than us.  Therefore we use the given stride
 
865
 *             # offsets exclusively.
 
866
 *             for i from 0<=i<nl:             # <<<<<<<<<<<<<<
 
867
 *                 op( buf + (i*buf_stride),
 
868
 *                     buf + (i*buf_stride),   # note this is the same!
 
869
 */
 
870
      __pyx_t_3 = __pyx_v_nl;
 
871
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
 
872
 
 
873
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":98
 
874
 *                     buf + (i*buf_stride),   # note this is the same!
 
875
 *                     bkg + (i*bkg_stride),
 
876
 *                     cdata[0].priv)             # <<<<<<<<<<<<<<
 
877
 *     else:
 
878
 *         return -2   # Unrecognized command.  Note this is NOT an exception.
 
879
 */
 
880
        __pyx_t_4 = __pyx_v_op((__pyx_v_buf + (__pyx_v_i * __pyx_v_buf_stride)), (__pyx_v_buf + (__pyx_v_i * __pyx_v_buf_stride)), (__pyx_v_bkg + (__pyx_v_i * __pyx_v_bkg_stride)), (__pyx_v_cdata[0]).priv); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
881
      }
 
882
    }
 
883
    __pyx_L5:;
 
884
    goto __pyx_L3;
 
885
  }
 
886
  /*else*/ {
 
887
 
 
888
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":100
 
889
 *                     cdata[0].priv)
 
890
 *     else:
 
891
 *         return -2   # Unrecognized command.  Note this is NOT an exception.             # <<<<<<<<<<<<<<
 
892
 * 
 
893
 *     return 0
 
894
 */
 
895
    __pyx_r = -2;
 
896
    goto __pyx_L0;
 
897
  }
 
898
  __pyx_L3:;
 
899
 
 
900
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":102
 
901
 *         return -2   # Unrecognized command.  Note this is NOT an exception.
 
902
 * 
 
903
 *     return 0             # <<<<<<<<<<<<<<
 
904
 * 
 
905
 * # =============================================================================
 
906
 */
 
907
  __pyx_r = 0;
 
908
  goto __pyx_L0;
 
909
 
 
910
  __pyx_r = 0;
 
911
  goto __pyx_L0;
 
912
  __pyx_L1_error:;
 
913
  __Pyx_AddTraceback("h5py._conv.generic_converter");
 
914
  __pyx_r = -1;
 
915
  __pyx_L0:;
 
916
  __Pyx_RefNannyFinishContext();
 
917
  return __pyx_r;
 
918
}
 
919
 
 
920
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":111
 
921
 *     size_t dst_size
 
922
 * 
 
923
 * cdef herr_t init_generic(hid_t src, hid_t dst, void** priv) except -1:             # <<<<<<<<<<<<<<
 
924
 * 
 
925
 *     cdef conv_size_t *sizes
 
926
 */
 
927
 
 
928
static  herr_t __pyx_f_4h5py_5_conv_init_generic(hid_t __pyx_v_src, hid_t __pyx_v_dst, void **__pyx_v_priv) {
 
929
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_v_sizes;
 
930
  herr_t __pyx_r;
 
931
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_t_1;
 
932
  size_t __pyx_t_2;
 
933
  __Pyx_RefNannySetupContext("init_generic");
 
934
 
 
935
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":114
 
936
 * 
 
937
 *     cdef conv_size_t *sizes
 
938
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))             # <<<<<<<<<<<<<<
 
939
 *     sizes[0].src_size = H5Tget_size(src)
 
940
 *     sizes[0].dst_size = H5Tget_size(dst)
 
941
 */
 
942
  __pyx_t_1 = ((__pyx_t_4h5py_5_conv_conv_size_t *)malloc((sizeof(__pyx_t_4h5py_5_conv_conv_size_t))));
 
943
  (__pyx_v_priv[0]) = __pyx_t_1;
 
944
  __pyx_v_sizes = __pyx_t_1;
 
945
 
 
946
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":115
 
947
 *     cdef conv_size_t *sizes
 
948
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
949
 *     sizes[0].src_size = H5Tget_size(src)             # <<<<<<<<<<<<<<
 
950
 *     sizes[0].dst_size = H5Tget_size(dst)
 
951
 * 
 
952
 */
 
953
  __pyx_t_2 = H5Tget_size(__pyx_v_src); if (unlikely(__pyx_t_2 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
954
  (__pyx_v_sizes[0]).src_size = __pyx_t_2;
 
955
 
 
956
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":116
 
957
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
958
 *     sizes[0].src_size = H5Tget_size(src)
 
959
 *     sizes[0].dst_size = H5Tget_size(dst)             # <<<<<<<<<<<<<<
 
960
 * 
 
961
 *     return 0
 
962
 */
 
963
  __pyx_t_2 = H5Tget_size(__pyx_v_dst); if (unlikely(__pyx_t_2 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
964
  (__pyx_v_sizes[0]).dst_size = __pyx_t_2;
 
965
 
 
966
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":118
 
967
 *     sizes[0].dst_size = H5Tget_size(dst)
 
968
 * 
 
969
 *     return 0             # <<<<<<<<<<<<<<
 
970
 * 
 
971
 * cdef int conv_vlen2str(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
972
 */
 
973
  __pyx_r = 0;
 
974
  goto __pyx_L0;
 
975
 
 
976
  __pyx_r = 0;
 
977
  goto __pyx_L0;
 
978
  __pyx_L1_error:;
 
979
  __Pyx_AddTraceback("h5py._conv.init_generic");
 
980
  __pyx_r = -1;
 
981
  __pyx_L0:;
 
982
  __Pyx_RefNannyFinishContext();
 
983
  return __pyx_r;
 
984
}
 
985
 
 
986
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":120
 
987
 *     return 0
 
988
 * 
 
989
 * cdef int conv_vlen2str(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
990
 * 
 
991
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
992
 */
 
993
 
 
994
static  int __pyx_f_4h5py_5_conv_conv_vlen2str(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
995
  PyObject **__pyx_v_buf_obj;
 
996
  PyObject **__pyx_v_bkg_obj;
 
997
  char **__pyx_v_buf_cstring;
 
998
  PyObject *__pyx_v_temp_obj;
 
999
  int __pyx_r;
 
1000
  int __pyx_t_1;
 
1001
  PyObject *__pyx_t_2;
 
1002
  __Pyx_RefNannySetupContext("conv_vlen2str");
 
1003
 
 
1004
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":122
 
1005
 * cdef int conv_vlen2str(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1006
 * 
 
1007
 *     cdef PyObject** buf_obj = <PyObject**>opt             # <<<<<<<<<<<<<<
 
1008
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
1009
 *     cdef char** buf_cstring = <char**>ipt
 
1010
 */
 
1011
  __pyx_v_buf_obj = ((PyObject **)__pyx_v_opt);
 
1012
 
 
1013
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":123
 
1014
 * 
 
1015
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
1016
 *     cdef PyObject** bkg_obj = <PyObject**>bkg             # <<<<<<<<<<<<<<
 
1017
 *     cdef char** buf_cstring = <char**>ipt
 
1018
 *     cdef PyObject* temp_obj = NULL
 
1019
 */
 
1020
  __pyx_v_bkg_obj = ((PyObject **)__pyx_v_bkg);
 
1021
 
 
1022
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":124
 
1023
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
1024
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
1025
 *     cdef char** buf_cstring = <char**>ipt             # <<<<<<<<<<<<<<
 
1026
 *     cdef PyObject* temp_obj = NULL
 
1027
 * 
 
1028
 */
 
1029
  __pyx_v_buf_cstring = ((char **)__pyx_v_ipt);
 
1030
 
 
1031
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":125
 
1032
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
1033
 *     cdef char** buf_cstring = <char**>ipt
 
1034
 *     cdef PyObject* temp_obj = NULL             # <<<<<<<<<<<<<<
 
1035
 * 
 
1036
 *     if buf_cstring[0] == NULL:
 
1037
 */
 
1038
  __pyx_v_temp_obj = NULL;
 
1039
 
 
1040
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":127
 
1041
 *     cdef PyObject* temp_obj = NULL
 
1042
 * 
 
1043
 *     if buf_cstring[0] == NULL:             # <<<<<<<<<<<<<<
 
1044
 *         temp_obj = PyString_FromString("")
 
1045
 *     else:
 
1046
 */
 
1047
  __pyx_t_1 = ((__pyx_v_buf_cstring[0]) == NULL);
 
1048
  if (__pyx_t_1) {
 
1049
 
 
1050
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":128
 
1051
 * 
 
1052
 *     if buf_cstring[0] == NULL:
 
1053
 *         temp_obj = PyString_FromString("")             # <<<<<<<<<<<<<<
 
1054
 *     else:
 
1055
 *         temp_obj = PyString_FromString(buf_cstring[0])
 
1056
 */
 
1057
    __pyx_t_2 = PyString_FromString(__pyx_k_2); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1058
    __pyx_v_temp_obj = __pyx_t_2;
 
1059
    goto __pyx_L3;
 
1060
  }
 
1061
  /*else*/ {
 
1062
 
 
1063
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":130
 
1064
 *         temp_obj = PyString_FromString("")
 
1065
 *     else:
 
1066
 *         temp_obj = PyString_FromString(buf_cstring[0])             # <<<<<<<<<<<<<<
 
1067
 * 
 
1068
 *     # Since all data conversions are by definition in-place, it
 
1069
 */
 
1070
    __pyx_t_2 = PyString_FromString((__pyx_v_buf_cstring[0])); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1071
    __pyx_v_temp_obj = __pyx_t_2;
 
1072
  }
 
1073
  __pyx_L3:;
 
1074
 
 
1075
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":134
 
1076
 *     # Since all data conversions are by definition in-place, it
 
1077
 *     # is our responsibility to free the memory used by the vlens.
 
1078
 *     free(buf_cstring[0])             # <<<<<<<<<<<<<<
 
1079
 * 
 
1080
 *     # HDF5 will eventuallly overwrite this target location, so we
 
1081
 */
 
1082
  free((__pyx_v_buf_cstring[0]));
 
1083
 
 
1084
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":138
 
1085
 *     # HDF5 will eventuallly overwrite this target location, so we
 
1086
 *     # make sure to decref the object there.
 
1087
 *     Py_XDECREF(bkg_obj[0])             # <<<<<<<<<<<<<<
 
1088
 * 
 
1089
 *     # Write the new string object to the buffer in-place
 
1090
 */
 
1091
  Py_XDECREF((__pyx_v_bkg_obj[0]));
 
1092
 
 
1093
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":141
 
1094
 * 
 
1095
 *     # Write the new string object to the buffer in-place
 
1096
 *     buf_obj[0] = temp_obj             # <<<<<<<<<<<<<<
 
1097
 * 
 
1098
 *     return 0
 
1099
 */
 
1100
  (__pyx_v_buf_obj[0]) = __pyx_v_temp_obj;
 
1101
 
 
1102
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":143
 
1103
 *     buf_obj[0] = temp_obj
 
1104
 * 
 
1105
 *     return 0             # <<<<<<<<<<<<<<
 
1106
 * 
 
1107
 * cdef int conv_str2vlen(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1108
 */
 
1109
  __pyx_r = 0;
 
1110
  goto __pyx_L0;
 
1111
 
 
1112
  __pyx_r = 0;
 
1113
  goto __pyx_L0;
 
1114
  __pyx_L1_error:;
 
1115
  __Pyx_AddTraceback("h5py._conv.conv_vlen2str");
 
1116
  __pyx_r = -1;
 
1117
  __pyx_L0:;
 
1118
  __Pyx_RefNannyFinishContext();
 
1119
  return __pyx_r;
 
1120
}
 
1121
 
 
1122
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":145
 
1123
 *     return 0
 
1124
 * 
 
1125
 * cdef int conv_str2vlen(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
1126
 * 
 
1127
 *     cdef PyObject** buf_obj = <PyObject**>ipt
 
1128
 */
 
1129
 
 
1130
static  int __pyx_f_4h5py_5_conv_conv_str2vlen(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
1131
  PyObject **__pyx_v_buf_obj;
 
1132
  char **__pyx_v_buf_cstring;
 
1133
  PyObject *__pyx_v_temp_object;
 
1134
  char *__pyx_v_temp_string;
 
1135
  size_t __pyx_v_temp_string_len;
 
1136
  int __pyx_r;
 
1137
  int __pyx_t_1;
 
1138
  int __pyx_t_2;
 
1139
  int __pyx_t_3;
 
1140
  int __pyx_t_4;
 
1141
  char *__pyx_t_5;
 
1142
  PyObject *__pyx_t_6;
 
1143
  PyObject *__pyx_t_7 = NULL;
 
1144
  PyObject *__pyx_t_8 = NULL;
 
1145
  __Pyx_RefNannySetupContext("conv_str2vlen");
 
1146
 
 
1147
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":147
 
1148
 * cdef int conv_str2vlen(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1149
 * 
 
1150
 *     cdef PyObject** buf_obj = <PyObject**>ipt             # <<<<<<<<<<<<<<
 
1151
 *     cdef char** buf_cstring = <char**>opt
 
1152
 * 
 
1153
 */
 
1154
  __pyx_v_buf_obj = ((PyObject **)__pyx_v_ipt);
 
1155
 
 
1156
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":148
 
1157
 * 
 
1158
 *     cdef PyObject** buf_obj = <PyObject**>ipt
 
1159
 *     cdef char** buf_cstring = <char**>opt             # <<<<<<<<<<<<<<
 
1160
 * 
 
1161
 *     cdef PyObject* temp_object = NULL
 
1162
 */
 
1163
  __pyx_v_buf_cstring = ((char **)__pyx_v_opt);
 
1164
 
 
1165
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":150
 
1166
 *     cdef char** buf_cstring = <char**>opt
 
1167
 * 
 
1168
 *     cdef PyObject* temp_object = NULL             # <<<<<<<<<<<<<<
 
1169
 *     cdef char* temp_string = NULL
 
1170
 *     cdef size_t temp_string_len = 0  # Not including null term
 
1171
 */
 
1172
  __pyx_v_temp_object = NULL;
 
1173
 
 
1174
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":151
 
1175
 * 
 
1176
 *     cdef PyObject* temp_object = NULL
 
1177
 *     cdef char* temp_string = NULL             # <<<<<<<<<<<<<<
 
1178
 *     cdef size_t temp_string_len = 0  # Not including null term
 
1179
 * 
 
1180
 */
 
1181
  __pyx_v_temp_string = NULL;
 
1182
 
 
1183
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":152
 
1184
 *     cdef PyObject* temp_object = NULL
 
1185
 *     cdef char* temp_string = NULL
 
1186
 *     cdef size_t temp_string_len = 0  # Not including null term             # <<<<<<<<<<<<<<
 
1187
 * 
 
1188
 *     try:
 
1189
 */
 
1190
  __pyx_v_temp_string_len = 0;
 
1191
 
 
1192
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":154
 
1193
 *     cdef size_t temp_string_len = 0  # Not including null term
 
1194
 * 
 
1195
 *     try:             # <<<<<<<<<<<<<<
 
1196
 *         if buf_obj[0] == NULL or buf_obj[0] == Py_None:
 
1197
 *             temp_string = ""
 
1198
 */
 
1199
  /*try:*/ {
 
1200
 
 
1201
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":155
 
1202
 * 
 
1203
 *     try:
 
1204
 *         if buf_obj[0] == NULL or buf_obj[0] == Py_None:             # <<<<<<<<<<<<<<
 
1205
 *             temp_string = ""
 
1206
 *             temp_string_len = 0
 
1207
 */
 
1208
    __pyx_t_1 = ((__pyx_v_buf_obj[0]) == NULL);
 
1209
    if (!__pyx_t_1) {
 
1210
      __pyx_t_2 = ((__pyx_v_buf_obj[0]) == Py_None);
 
1211
      __pyx_t_3 = __pyx_t_2;
 
1212
    } else {
 
1213
      __pyx_t_3 = __pyx_t_1;
 
1214
    }
 
1215
    if (__pyx_t_3) {
 
1216
 
 
1217
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":156
 
1218
 *     try:
 
1219
 *         if buf_obj[0] == NULL or buf_obj[0] == Py_None:
 
1220
 *             temp_string = ""             # <<<<<<<<<<<<<<
 
1221
 *             temp_string_len = 0
 
1222
 *         else:
 
1223
 */
 
1224
      __pyx_v_temp_string = __pyx_k_2;
 
1225
 
 
1226
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":157
 
1227
 *         if buf_obj[0] == NULL or buf_obj[0] == Py_None:
 
1228
 *             temp_string = ""
 
1229
 *             temp_string_len = 0             # <<<<<<<<<<<<<<
 
1230
 *         else:
 
1231
 *             if PyString_CheckExact(buf_obj[0]):
 
1232
 */
 
1233
      __pyx_v_temp_string_len = 0;
 
1234
      goto __pyx_L6;
 
1235
    }
 
1236
    /*else*/ {
 
1237
 
 
1238
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":159
 
1239
 *             temp_string_len = 0
 
1240
 *         else:
 
1241
 *             if PyString_CheckExact(buf_obj[0]):             # <<<<<<<<<<<<<<
 
1242
 *                 temp_object = buf_obj[0]
 
1243
 *                 Py_INCREF(temp_object)
 
1244
 */
 
1245
      __pyx_t_4 = PyString_CheckExact((__pyx_v_buf_obj[0])); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1246
      if (__pyx_t_4) {
 
1247
 
 
1248
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":160
 
1249
 *         else:
 
1250
 *             if PyString_CheckExact(buf_obj[0]):
 
1251
 *                 temp_object = buf_obj[0]             # <<<<<<<<<<<<<<
 
1252
 *                 Py_INCREF(temp_object)
 
1253
 *                 temp_string = PyString_AsString(temp_object)
 
1254
 */
 
1255
        __pyx_v_temp_object = (__pyx_v_buf_obj[0]);
 
1256
 
 
1257
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":161
 
1258
 *             if PyString_CheckExact(buf_obj[0]):
 
1259
 *                 temp_object = buf_obj[0]
 
1260
 *                 Py_INCREF(temp_object)             # <<<<<<<<<<<<<<
 
1261
 *                 temp_string = PyString_AsString(temp_object)
 
1262
 *                 temp_string_len = PyString_Size(temp_object)
 
1263
 */
 
1264
        Py_INCREF(__pyx_v_temp_object);
 
1265
 
 
1266
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":162
 
1267
 *                 temp_object = buf_obj[0]
 
1268
 *                 Py_INCREF(temp_object)
 
1269
 *                 temp_string = PyString_AsString(temp_object)             # <<<<<<<<<<<<<<
 
1270
 *                 temp_string_len = PyString_Size(temp_object)
 
1271
 *             else:
 
1272
 */
 
1273
        __pyx_t_5 = PyString_AsString(__pyx_v_temp_object); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1274
        __pyx_v_temp_string = __pyx_t_5;
 
1275
 
 
1276
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":163
 
1277
 *                 Py_INCREF(temp_object)
 
1278
 *                 temp_string = PyString_AsString(temp_object)
 
1279
 *                 temp_string_len = PyString_Size(temp_object)             # <<<<<<<<<<<<<<
 
1280
 *             else:
 
1281
 *                 temp_object = PyObject_Str(buf_obj[0])
 
1282
 */
 
1283
        __pyx_t_4 = PyString_Size(__pyx_v_temp_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1284
        __pyx_v_temp_string_len = __pyx_t_4;
 
1285
        goto __pyx_L7;
 
1286
      }
 
1287
      /*else*/ {
 
1288
 
 
1289
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":165
 
1290
 *                 temp_string_len = PyString_Size(temp_object)
 
1291
 *             else:
 
1292
 *                 temp_object = PyObject_Str(buf_obj[0])             # <<<<<<<<<<<<<<
 
1293
 *                 temp_string = PyString_AsString(temp_object)
 
1294
 *                 temp_string_len = PyString_Size(temp_object)
 
1295
 */
 
1296
        __pyx_t_6 = PyObject_Str((__pyx_v_buf_obj[0])); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1297
        __pyx_v_temp_object = __pyx_t_6;
 
1298
 
 
1299
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":166
 
1300
 *             else:
 
1301
 *                 temp_object = PyObject_Str(buf_obj[0])
 
1302
 *                 temp_string = PyString_AsString(temp_object)             # <<<<<<<<<<<<<<
 
1303
 *                 temp_string_len = PyString_Size(temp_object)
 
1304
 * 
 
1305
 */
 
1306
        __pyx_t_5 = PyString_AsString(__pyx_v_temp_object); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1307
        __pyx_v_temp_string = __pyx_t_5;
 
1308
 
 
1309
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":167
 
1310
 *                 temp_object = PyObject_Str(buf_obj[0])
 
1311
 *                 temp_string = PyString_AsString(temp_object)
 
1312
 *                 temp_string_len = PyString_Size(temp_object)             # <<<<<<<<<<<<<<
 
1313
 * 
 
1314
 *         if strlen(temp_string) != temp_string_len:
 
1315
 */
 
1316
        __pyx_t_4 = PyString_Size(__pyx_v_temp_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1317
        __pyx_v_temp_string_len = __pyx_t_4;
 
1318
      }
 
1319
      __pyx_L7:;
 
1320
    }
 
1321
    __pyx_L6:;
 
1322
 
 
1323
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":169
 
1324
 *                 temp_string_len = PyString_Size(temp_object)
 
1325
 * 
 
1326
 *         if strlen(temp_string) != temp_string_len:             # <<<<<<<<<<<<<<
 
1327
 *             raise ValueError("VLEN strings do not support embedded NULLs")
 
1328
 * 
 
1329
 */
 
1330
    __pyx_t_3 = (strlen(__pyx_v_temp_string) != __pyx_v_temp_string_len);
 
1331
    if (__pyx_t_3) {
 
1332
 
 
1333
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":170
 
1334
 * 
 
1335
 *         if strlen(temp_string) != temp_string_len:
 
1336
 *             raise ValueError("VLEN strings do not support embedded NULLs")             # <<<<<<<<<<<<<<
 
1337
 * 
 
1338
 *         buf_cstring[0] = <char*>malloc(temp_string_len+1)
 
1339
 */
 
1340
      __pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1341
      __Pyx_GOTREF(__pyx_t_7);
 
1342
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_3));
 
1343
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_kp_s_3));
 
1344
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_3));
 
1345
      __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, __pyx_t_7, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1346
      __Pyx_GOTREF(__pyx_t_8);
 
1347
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
 
1348
      __Pyx_Raise(__pyx_t_8, 0, 0);
 
1349
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
1350
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L4;}
 
1351
      goto __pyx_L8;
 
1352
    }
 
1353
    __pyx_L8:;
 
1354
 
 
1355
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":172
 
1356
 *             raise ValueError("VLEN strings do not support embedded NULLs")
 
1357
 * 
 
1358
 *         buf_cstring[0] = <char*>malloc(temp_string_len+1)             # <<<<<<<<<<<<<<
 
1359
 *         memcpy(buf_cstring[0], temp_string, temp_string_len+1)
 
1360
 * 
 
1361
 */
 
1362
    (__pyx_v_buf_cstring[0]) = ((char *)malloc((__pyx_v_temp_string_len + 1)));
 
1363
 
 
1364
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":173
 
1365
 * 
 
1366
 *         buf_cstring[0] = <char*>malloc(temp_string_len+1)
 
1367
 *         memcpy(buf_cstring[0], temp_string, temp_string_len+1)             # <<<<<<<<<<<<<<
 
1368
 * 
 
1369
 *         return 0
 
1370
 */
 
1371
    memcpy((__pyx_v_buf_cstring[0]), __pyx_v_temp_string, (__pyx_v_temp_string_len + 1));
 
1372
 
 
1373
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":175
 
1374
 *         memcpy(buf_cstring[0], temp_string, temp_string_len+1)
 
1375
 * 
 
1376
 *         return 0             # <<<<<<<<<<<<<<
 
1377
 *     finally:
 
1378
 *         Py_XDECREF(temp_object)
 
1379
 */
 
1380
    __pyx_r = 0;
 
1381
    goto __pyx_L3;
 
1382
  }
 
1383
  /*finally:*/ {
 
1384
    int __pyx_why;
 
1385
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
 
1386
    int __pyx_exc_lineno;
 
1387
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
 
1388
    __pyx_why = 0; goto __pyx_L5;
 
1389
    __pyx_L3: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
 
1390
    __pyx_why = 3; goto __pyx_L5;
 
1391
    __pyx_L4: {
 
1392
      __pyx_why = 4;
 
1393
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
 
1394
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
1395
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
 
1396
      __pyx_exc_lineno = __pyx_lineno;
 
1397
      goto __pyx_L5;
 
1398
    }
 
1399
    __pyx_L5:;
 
1400
 
 
1401
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":177
 
1402
 *         return 0
 
1403
 *     finally:
 
1404
 *         Py_XDECREF(temp_object)             # <<<<<<<<<<<<<<
 
1405
 * 
 
1406
 * 
 
1407
 */
 
1408
    Py_XDECREF(__pyx_v_temp_object);
 
1409
    switch (__pyx_why) {
 
1410
      case 3: goto __pyx_L0;
 
1411
      case 4: {
 
1412
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
 
1413
        __pyx_lineno = __pyx_exc_lineno;
 
1414
        __pyx_exc_type = 0;
 
1415
        __pyx_exc_value = 0;
 
1416
        __pyx_exc_tb = 0;
 
1417
        goto __pyx_L1_error;
 
1418
      }
 
1419
    }
 
1420
  }
 
1421
 
 
1422
  __pyx_r = 0;
 
1423
  goto __pyx_L0;
 
1424
  __pyx_L1_error:;
 
1425
  __Pyx_XDECREF(__pyx_t_7);
 
1426
  __Pyx_XDECREF(__pyx_t_8);
 
1427
  __Pyx_AddTraceback("h5py._conv.conv_str2vlen");
 
1428
  __pyx_r = -1;
 
1429
  __pyx_L0:;
 
1430
  __Pyx_RefNannyFinishContext();
 
1431
  return __pyx_r;
 
1432
}
 
1433
 
 
1434
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":183
 
1435
 * # VLEN to fixed-width strings
 
1436
 * 
 
1437
 * cdef herr_t init_vlen2fixed(hid_t src, hid_t dst, void** priv) except -1:             # <<<<<<<<<<<<<<
 
1438
 * 
 
1439
 *     cdef conv_size_t *sizes
 
1440
 */
 
1441
 
 
1442
static  herr_t __pyx_f_4h5py_5_conv_init_vlen2fixed(hid_t __pyx_v_src, hid_t __pyx_v_dst, void **__pyx_v_priv) {
 
1443
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_v_sizes;
 
1444
  herr_t __pyx_r;
 
1445
  htri_t __pyx_t_1;
 
1446
  htri_t __pyx_t_2;
 
1447
  int __pyx_t_3;
 
1448
  int __pyx_t_4;
 
1449
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_t_5;
 
1450
  size_t __pyx_t_6;
 
1451
  __Pyx_RefNannySetupContext("init_vlen2fixed");
 
1452
 
 
1453
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":187
 
1454
 *     cdef conv_size_t *sizes
 
1455
 * 
 
1456
 *     if not (H5Tis_variable_str(src) and (not H5Tis_variable_str(dst))):             # <<<<<<<<<<<<<<
 
1457
 *         return -2
 
1458
 * 
 
1459
 */
 
1460
  __pyx_t_1 = H5Tis_variable_str(__pyx_v_src); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1461
  if (__pyx_t_1) {
 
1462
    __pyx_t_2 = H5Tis_variable_str(__pyx_v_dst); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1463
    __pyx_t_3 = (!__pyx_t_2);
 
1464
    __pyx_t_4 = __pyx_t_3;
 
1465
  } else {
 
1466
    __pyx_t_4 = __pyx_t_1;
 
1467
  }
 
1468
  __pyx_t_3 = (!__pyx_t_4);
 
1469
  if (__pyx_t_3) {
 
1470
 
 
1471
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":188
 
1472
 * 
 
1473
 *     if not (H5Tis_variable_str(src) and (not H5Tis_variable_str(dst))):
 
1474
 *         return -2             # <<<<<<<<<<<<<<
 
1475
 * 
 
1476
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
1477
 */
 
1478
    __pyx_r = -2;
 
1479
    goto __pyx_L0;
 
1480
    goto __pyx_L3;
 
1481
  }
 
1482
  __pyx_L3:;
 
1483
 
 
1484
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":190
 
1485
 *         return -2
 
1486
 * 
 
1487
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))             # <<<<<<<<<<<<<<
 
1488
 *     sizes[0].src_size = H5Tget_size(src)
 
1489
 *     sizes[0].dst_size = H5Tget_size(dst)
 
1490
 */
 
1491
  __pyx_t_5 = ((__pyx_t_4h5py_5_conv_conv_size_t *)malloc((sizeof(__pyx_t_4h5py_5_conv_conv_size_t))));
 
1492
  (__pyx_v_priv[0]) = __pyx_t_5;
 
1493
  __pyx_v_sizes = __pyx_t_5;
 
1494
 
 
1495
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":191
 
1496
 * 
 
1497
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
1498
 *     sizes[0].src_size = H5Tget_size(src)             # <<<<<<<<<<<<<<
 
1499
 *     sizes[0].dst_size = H5Tget_size(dst)
 
1500
 * 
 
1501
 */
 
1502
  __pyx_t_6 = H5Tget_size(__pyx_v_src); if (unlikely(__pyx_t_6 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1503
  (__pyx_v_sizes[0]).src_size = __pyx_t_6;
 
1504
 
 
1505
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":192
 
1506
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
1507
 *     sizes[0].src_size = H5Tget_size(src)
 
1508
 *     sizes[0].dst_size = H5Tget_size(dst)             # <<<<<<<<<<<<<<
 
1509
 * 
 
1510
 *     return 0
 
1511
 */
 
1512
  __pyx_t_6 = H5Tget_size(__pyx_v_dst); if (unlikely(__pyx_t_6 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1513
  (__pyx_v_sizes[0]).dst_size = __pyx_t_6;
 
1514
 
 
1515
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":194
 
1516
 *     sizes[0].dst_size = H5Tget_size(dst)
 
1517
 * 
 
1518
 *     return 0             # <<<<<<<<<<<<<<
 
1519
 * 
 
1520
 * cdef herr_t init_fixed2vlen(hid_t src, hid_t dst, void** priv) except -1:
 
1521
 */
 
1522
  __pyx_r = 0;
 
1523
  goto __pyx_L0;
 
1524
 
 
1525
  __pyx_r = 0;
 
1526
  goto __pyx_L0;
 
1527
  __pyx_L1_error:;
 
1528
  __Pyx_AddTraceback("h5py._conv.init_vlen2fixed");
 
1529
  __pyx_r = -1;
 
1530
  __pyx_L0:;
 
1531
  __Pyx_RefNannyFinishContext();
 
1532
  return __pyx_r;
 
1533
}
 
1534
 
 
1535
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":196
 
1536
 *     return 0
 
1537
 * 
 
1538
 * cdef herr_t init_fixed2vlen(hid_t src, hid_t dst, void** priv) except -1:             # <<<<<<<<<<<<<<
 
1539
 * 
 
1540
 *     cdef conv_size_t *sizes
 
1541
 */
 
1542
 
 
1543
static  herr_t __pyx_f_4h5py_5_conv_init_fixed2vlen(hid_t __pyx_v_src, hid_t __pyx_v_dst, void **__pyx_v_priv) {
 
1544
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_v_sizes;
 
1545
  herr_t __pyx_r;
 
1546
  htri_t __pyx_t_1;
 
1547
  htri_t __pyx_t_2;
 
1548
  int __pyx_t_3;
 
1549
  int __pyx_t_4;
 
1550
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_t_5;
 
1551
  size_t __pyx_t_6;
 
1552
  __Pyx_RefNannySetupContext("init_fixed2vlen");
 
1553
 
 
1554
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":200
 
1555
 *     cdef conv_size_t *sizes
 
1556
 * 
 
1557
 *     if not (H5Tis_variable_str(dst) and (not H5Tis_variable_str(src))):             # <<<<<<<<<<<<<<
 
1558
 *         return -2
 
1559
 * 
 
1560
 */
 
1561
  __pyx_t_1 = H5Tis_variable_str(__pyx_v_dst); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1562
  if (__pyx_t_1) {
 
1563
    __pyx_t_2 = H5Tis_variable_str(__pyx_v_src); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1564
    __pyx_t_3 = (!__pyx_t_2);
 
1565
    __pyx_t_4 = __pyx_t_3;
 
1566
  } else {
 
1567
    __pyx_t_4 = __pyx_t_1;
 
1568
  }
 
1569
  __pyx_t_3 = (!__pyx_t_4);
 
1570
  if (__pyx_t_3) {
 
1571
 
 
1572
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":201
 
1573
 * 
 
1574
 *     if not (H5Tis_variable_str(dst) and (not H5Tis_variable_str(src))):
 
1575
 *         return -2             # <<<<<<<<<<<<<<
 
1576
 * 
 
1577
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
1578
 */
 
1579
    __pyx_r = -2;
 
1580
    goto __pyx_L0;
 
1581
    goto __pyx_L3;
 
1582
  }
 
1583
  __pyx_L3:;
 
1584
 
 
1585
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":203
 
1586
 *         return -2
 
1587
 * 
 
1588
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))             # <<<<<<<<<<<<<<
 
1589
 *     sizes[0].src_size = H5Tget_size(src)
 
1590
 *     sizes[0].dst_size = H5Tget_size(dst)
 
1591
 */
 
1592
  __pyx_t_5 = ((__pyx_t_4h5py_5_conv_conv_size_t *)malloc((sizeof(__pyx_t_4h5py_5_conv_conv_size_t))));
 
1593
  (__pyx_v_priv[0]) = __pyx_t_5;
 
1594
  __pyx_v_sizes = __pyx_t_5;
 
1595
 
 
1596
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":204
 
1597
 * 
 
1598
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
1599
 *     sizes[0].src_size = H5Tget_size(src)             # <<<<<<<<<<<<<<
 
1600
 *     sizes[0].dst_size = H5Tget_size(dst)
 
1601
 * 
 
1602
 */
 
1603
  __pyx_t_6 = H5Tget_size(__pyx_v_src); if (unlikely(__pyx_t_6 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1604
  (__pyx_v_sizes[0]).src_size = __pyx_t_6;
 
1605
 
 
1606
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":205
 
1607
 *     priv[0] = sizes = <conv_size_t*>malloc(sizeof(conv_size_t))
 
1608
 *     sizes[0].src_size = H5Tget_size(src)
 
1609
 *     sizes[0].dst_size = H5Tget_size(dst)             # <<<<<<<<<<<<<<
 
1610
 * 
 
1611
 *     return 0
 
1612
 */
 
1613
  __pyx_t_6 = H5Tget_size(__pyx_v_dst); if (unlikely(__pyx_t_6 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1614
  (__pyx_v_sizes[0]).dst_size = __pyx_t_6;
 
1615
 
 
1616
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":207
 
1617
 *     sizes[0].dst_size = H5Tget_size(dst)
 
1618
 * 
 
1619
 *     return 0             # <<<<<<<<<<<<<<
 
1620
 * 
 
1621
 * cdef int conv_vlen2fixed(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1622
 */
 
1623
  __pyx_r = 0;
 
1624
  goto __pyx_L0;
 
1625
 
 
1626
  __pyx_r = 0;
 
1627
  goto __pyx_L0;
 
1628
  __pyx_L1_error:;
 
1629
  __Pyx_AddTraceback("h5py._conv.init_fixed2vlen");
 
1630
  __pyx_r = -1;
 
1631
  __pyx_L0:;
 
1632
  __Pyx_RefNannyFinishContext();
 
1633
  return __pyx_r;
 
1634
}
 
1635
 
 
1636
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":209
 
1637
 *     return 0
 
1638
 * 
 
1639
 * cdef int conv_vlen2fixed(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
1640
 * 
 
1641
 *     cdef char** buf_vlen = <char**>ipt
 
1642
 */
 
1643
 
 
1644
static  int __pyx_f_4h5py_5_conv_conv_vlen2fixed(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
1645
  char **__pyx_v_buf_vlen;
 
1646
  char *__pyx_v_buf_fixed;
 
1647
  char *__pyx_v_temp_string;
 
1648
  size_t __pyx_v_temp_string_len;
 
1649
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_v_sizes;
 
1650
  int __pyx_r;
 
1651
  int __pyx_t_1;
 
1652
  __Pyx_RefNannySetupContext("conv_vlen2fixed");
 
1653
 
 
1654
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":211
 
1655
 * cdef int conv_vlen2fixed(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1656
 * 
 
1657
 *     cdef char** buf_vlen = <char**>ipt             # <<<<<<<<<<<<<<
 
1658
 *     cdef char* buf_fixed = <char*>opt
 
1659
 *     cdef char* temp_string = NULL
 
1660
 */
 
1661
  __pyx_v_buf_vlen = ((char **)__pyx_v_ipt);
 
1662
 
 
1663
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":212
 
1664
 * 
 
1665
 *     cdef char** buf_vlen = <char**>ipt
 
1666
 *     cdef char* buf_fixed = <char*>opt             # <<<<<<<<<<<<<<
 
1667
 *     cdef char* temp_string = NULL
 
1668
 *     cdef size_t temp_string_len = 0  # Without null term
 
1669
 */
 
1670
  __pyx_v_buf_fixed = ((char *)__pyx_v_opt);
 
1671
 
 
1672
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":213
 
1673
 *     cdef char** buf_vlen = <char**>ipt
 
1674
 *     cdef char* buf_fixed = <char*>opt
 
1675
 *     cdef char* temp_string = NULL             # <<<<<<<<<<<<<<
 
1676
 *     cdef size_t temp_string_len = 0  # Without null term
 
1677
 *     cdef conv_size_t *sizes = <conv_size_t*>priv
 
1678
 */
 
1679
  __pyx_v_temp_string = NULL;
 
1680
 
 
1681
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":214
 
1682
 *     cdef char* buf_fixed = <char*>opt
 
1683
 *     cdef char* temp_string = NULL
 
1684
 *     cdef size_t temp_string_len = 0  # Without null term             # <<<<<<<<<<<<<<
 
1685
 *     cdef conv_size_t *sizes = <conv_size_t*>priv
 
1686
 * 
 
1687
 */
 
1688
  __pyx_v_temp_string_len = 0;
 
1689
 
 
1690
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":215
 
1691
 *     cdef char* temp_string = NULL
 
1692
 *     cdef size_t temp_string_len = 0  # Without null term
 
1693
 *     cdef conv_size_t *sizes = <conv_size_t*>priv             # <<<<<<<<<<<<<<
 
1694
 * 
 
1695
 *     if buf_vlen[0] != NULL:
 
1696
 */
 
1697
  __pyx_v_sizes = ((__pyx_t_4h5py_5_conv_conv_size_t *)__pyx_v_priv);
 
1698
 
 
1699
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":217
 
1700
 *     cdef conv_size_t *sizes = <conv_size_t*>priv
 
1701
 * 
 
1702
 *     if buf_vlen[0] != NULL:             # <<<<<<<<<<<<<<
 
1703
 *         temp_string = buf_vlen[0]
 
1704
 *         temp_string_len = strlen(temp_string)
 
1705
 */
 
1706
  __pyx_t_1 = ((__pyx_v_buf_vlen[0]) != NULL);
 
1707
  if (__pyx_t_1) {
 
1708
 
 
1709
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":218
 
1710
 * 
 
1711
 *     if buf_vlen[0] != NULL:
 
1712
 *         temp_string = buf_vlen[0]             # <<<<<<<<<<<<<<
 
1713
 *         temp_string_len = strlen(temp_string)
 
1714
 * 
 
1715
 */
 
1716
    __pyx_v_temp_string = (__pyx_v_buf_vlen[0]);
 
1717
 
 
1718
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":219
 
1719
 *     if buf_vlen[0] != NULL:
 
1720
 *         temp_string = buf_vlen[0]
 
1721
 *         temp_string_len = strlen(temp_string)             # <<<<<<<<<<<<<<
 
1722
 * 
 
1723
 *         if temp_string_len <= sizes[0].dst_size:
 
1724
 */
 
1725
    __pyx_v_temp_string_len = strlen(__pyx_v_temp_string);
 
1726
 
 
1727
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":221
 
1728
 *         temp_string_len = strlen(temp_string)
 
1729
 * 
 
1730
 *         if temp_string_len <= sizes[0].dst_size:             # <<<<<<<<<<<<<<
 
1731
 *             # Pad with zeros
 
1732
 *             memcpy(buf_fixed, temp_string, temp_string_len)
 
1733
 */
 
1734
    __pyx_t_1 = (__pyx_v_temp_string_len <= (__pyx_v_sizes[0]).dst_size);
 
1735
    if (__pyx_t_1) {
 
1736
 
 
1737
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":223
 
1738
 *         if temp_string_len <= sizes[0].dst_size:
 
1739
 *             # Pad with zeros
 
1740
 *             memcpy(buf_fixed, temp_string, temp_string_len)             # <<<<<<<<<<<<<<
 
1741
 *             memset(buf_fixed + temp_string_len, c'\0', sizes[0].dst_size - temp_string_len)
 
1742
 *         else:
 
1743
 */
 
1744
      memcpy(__pyx_v_buf_fixed, __pyx_v_temp_string, __pyx_v_temp_string_len);
 
1745
 
 
1746
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":224
 
1747
 *             # Pad with zeros
 
1748
 *             memcpy(buf_fixed, temp_string, temp_string_len)
 
1749
 *             memset(buf_fixed + temp_string_len, c'\0', sizes[0].dst_size - temp_string_len)             # <<<<<<<<<<<<<<
 
1750
 *         else:
 
1751
 *             # Simply truncate the string
 
1752
 */
 
1753
      memset((__pyx_v_buf_fixed + __pyx_v_temp_string_len), '\x00', ((__pyx_v_sizes[0]).dst_size - __pyx_v_temp_string_len));
 
1754
      goto __pyx_L4;
 
1755
    }
 
1756
    /*else*/ {
 
1757
 
 
1758
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":227
 
1759
 *         else:
 
1760
 *             # Simply truncate the string
 
1761
 *             memcpy(buf_fixed, temp_string, sizes[0].dst_size)             # <<<<<<<<<<<<<<
 
1762
 *     else:
 
1763
 *         memset(buf_fixed, c'\0', sizes[0].dst_size)
 
1764
 */
 
1765
      memcpy(__pyx_v_buf_fixed, __pyx_v_temp_string, (__pyx_v_sizes[0]).dst_size);
 
1766
    }
 
1767
    __pyx_L4:;
 
1768
    goto __pyx_L3;
 
1769
  }
 
1770
  /*else*/ {
 
1771
 
 
1772
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":229
 
1773
 *             memcpy(buf_fixed, temp_string, sizes[0].dst_size)
 
1774
 *     else:
 
1775
 *         memset(buf_fixed, c'\0', sizes[0].dst_size)             # <<<<<<<<<<<<<<
 
1776
 * 
 
1777
 *     return 0
 
1778
 */
 
1779
    memset(__pyx_v_buf_fixed, '\x00', (__pyx_v_sizes[0]).dst_size);
 
1780
  }
 
1781
  __pyx_L3:;
 
1782
 
 
1783
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":231
 
1784
 *         memset(buf_fixed, c'\0', sizes[0].dst_size)
 
1785
 * 
 
1786
 *     return 0             # <<<<<<<<<<<<<<
 
1787
 * 
 
1788
 * cdef int conv_fixed2vlen(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1789
 */
 
1790
  __pyx_r = 0;
 
1791
  goto __pyx_L0;
 
1792
 
 
1793
  __pyx_r = 0;
 
1794
  __pyx_L0:;
 
1795
  __Pyx_RefNannyFinishContext();
 
1796
  return __pyx_r;
 
1797
}
 
1798
 
 
1799
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":233
 
1800
 *     return 0
 
1801
 * 
 
1802
 * cdef int conv_fixed2vlen(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
1803
 * 
 
1804
 *     cdef char** buf_vlen = <char**>opt
 
1805
 */
 
1806
 
 
1807
static  int __pyx_f_4h5py_5_conv_conv_fixed2vlen(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
1808
  char **__pyx_v_buf_vlen;
 
1809
  char *__pyx_v_buf_fixed;
 
1810
  char *__pyx_v_temp_string;
 
1811
  __pyx_t_4h5py_5_conv_conv_size_t *__pyx_v_sizes;
 
1812
  int __pyx_r;
 
1813
  __Pyx_RefNannySetupContext("conv_fixed2vlen");
 
1814
 
 
1815
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":235
 
1816
 * cdef int conv_fixed2vlen(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1817
 * 
 
1818
 *     cdef char** buf_vlen = <char**>opt             # <<<<<<<<<<<<<<
 
1819
 *     cdef char* buf_fixed = <char*>ipt
 
1820
 *     cdef char* temp_string = NULL
 
1821
 */
 
1822
  __pyx_v_buf_vlen = ((char **)__pyx_v_opt);
 
1823
 
 
1824
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":236
 
1825
 * 
 
1826
 *     cdef char** buf_vlen = <char**>opt
 
1827
 *     cdef char* buf_fixed = <char*>ipt             # <<<<<<<<<<<<<<
 
1828
 *     cdef char* temp_string = NULL
 
1829
 *     cdef conv_size_t *sizes = <conv_size_t*>priv
 
1830
 */
 
1831
  __pyx_v_buf_fixed = ((char *)__pyx_v_ipt);
 
1832
 
 
1833
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":237
 
1834
 *     cdef char** buf_vlen = <char**>opt
 
1835
 *     cdef char* buf_fixed = <char*>ipt
 
1836
 *     cdef char* temp_string = NULL             # <<<<<<<<<<<<<<
 
1837
 *     cdef conv_size_t *sizes = <conv_size_t*>priv
 
1838
 * 
 
1839
 */
 
1840
  __pyx_v_temp_string = NULL;
 
1841
 
 
1842
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":238
 
1843
 *     cdef char* buf_fixed = <char*>ipt
 
1844
 *     cdef char* temp_string = NULL
 
1845
 *     cdef conv_size_t *sizes = <conv_size_t*>priv             # <<<<<<<<<<<<<<
 
1846
 * 
 
1847
 *     temp_string = <char*>malloc(sizes[0].src_size+1)
 
1848
 */
 
1849
  __pyx_v_sizes = ((__pyx_t_4h5py_5_conv_conv_size_t *)__pyx_v_priv);
 
1850
 
 
1851
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":240
 
1852
 *     cdef conv_size_t *sizes = <conv_size_t*>priv
 
1853
 * 
 
1854
 *     temp_string = <char*>malloc(sizes[0].src_size+1)             # <<<<<<<<<<<<<<
 
1855
 *     memcpy(temp_string, buf_fixed, sizes[0].src_size)
 
1856
 *     temp_string[sizes[0].src_size] = c'\0'
 
1857
 */
 
1858
  __pyx_v_temp_string = ((char *)malloc(((__pyx_v_sizes[0]).src_size + 1)));
 
1859
 
 
1860
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":241
 
1861
 * 
 
1862
 *     temp_string = <char*>malloc(sizes[0].src_size+1)
 
1863
 *     memcpy(temp_string, buf_fixed, sizes[0].src_size)             # <<<<<<<<<<<<<<
 
1864
 *     temp_string[sizes[0].src_size] = c'\0'
 
1865
 * 
 
1866
 */
 
1867
  memcpy(__pyx_v_temp_string, __pyx_v_buf_fixed, (__pyx_v_sizes[0]).src_size);
 
1868
 
 
1869
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":242
 
1870
 *     temp_string = <char*>malloc(sizes[0].src_size+1)
 
1871
 *     memcpy(temp_string, buf_fixed, sizes[0].src_size)
 
1872
 *     temp_string[sizes[0].src_size] = c'\0'             # <<<<<<<<<<<<<<
 
1873
 * 
 
1874
 *     buf_vlen[0] = temp_string
 
1875
 */
 
1876
  (__pyx_v_temp_string[(__pyx_v_sizes[0]).src_size]) = '\x00';
 
1877
 
 
1878
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":244
 
1879
 *     temp_string[sizes[0].src_size] = c'\0'
 
1880
 * 
 
1881
 *     buf_vlen[0] = temp_string             # <<<<<<<<<<<<<<
 
1882
 * 
 
1883
 *     return 0
 
1884
 */
 
1885
  (__pyx_v_buf_vlen[0]) = __pyx_v_temp_string;
 
1886
 
 
1887
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":246
 
1888
 *     buf_vlen[0] = temp_string
 
1889
 * 
 
1890
 *     return 0             # <<<<<<<<<<<<<<
 
1891
 * 
 
1892
 * # =============================================================================
 
1893
 */
 
1894
  __pyx_r = 0;
 
1895
  goto __pyx_L0;
 
1896
 
 
1897
  __pyx_r = 0;
 
1898
  __pyx_L0:;
 
1899
  __Pyx_RefNannyFinishContext();
 
1900
  return __pyx_r;
 
1901
}
 
1902
 
 
1903
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":251
 
1904
 * # HDF5 references to Python instances of h5r.Reference
 
1905
 * 
 
1906
 * cdef int conv_objref2pyref(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
1907
 * 
 
1908
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
1909
 */
 
1910
 
 
1911
static  int __pyx_f_4h5py_5_conv_conv_objref2pyref(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
1912
  PyObject **__pyx_v_buf_obj;
 
1913
  PyObject **__pyx_v_bkg_obj;
 
1914
  hobj_ref_t *__pyx_v_buf_ref;
 
1915
  struct __pyx_obj_4h5py_3h5r_Reference *__pyx_v_ref = 0;
 
1916
  PyObject *__pyx_v_ref_ptr;
 
1917
  int __pyx_r;
 
1918
  PyObject *__pyx_t_1 = NULL;
 
1919
  __Pyx_RefNannySetupContext("conv_objref2pyref");
 
1920
 
 
1921
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":253
 
1922
 * cdef int conv_objref2pyref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
1923
 * 
 
1924
 *     cdef PyObject** buf_obj = <PyObject**>opt             # <<<<<<<<<<<<<<
 
1925
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
1926
 *     cdef hobj_ref_t* buf_ref = <hobj_ref_t*>ipt
 
1927
 */
 
1928
  __pyx_v_buf_obj = ((PyObject **)__pyx_v_opt);
 
1929
 
 
1930
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":254
 
1931
 * 
 
1932
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
1933
 *     cdef PyObject** bkg_obj = <PyObject**>bkg             # <<<<<<<<<<<<<<
 
1934
 *     cdef hobj_ref_t* buf_ref = <hobj_ref_t*>ipt
 
1935
 * 
 
1936
 */
 
1937
  __pyx_v_bkg_obj = ((PyObject **)__pyx_v_bkg);
 
1938
 
 
1939
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":255
 
1940
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
1941
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
1942
 *     cdef hobj_ref_t* buf_ref = <hobj_ref_t*>ipt             # <<<<<<<<<<<<<<
 
1943
 * 
 
1944
 *     cdef Reference ref = Reference()
 
1945
 */
 
1946
  __pyx_v_buf_ref = ((hobj_ref_t *)__pyx_v_ipt);
 
1947
 
 
1948
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":257
 
1949
 *     cdef hobj_ref_t* buf_ref = <hobj_ref_t*>ipt
 
1950
 * 
 
1951
 *     cdef Reference ref = Reference()             # <<<<<<<<<<<<<<
 
1952
 *     cdef PyObject* ref_ptr = NULL
 
1953
 * 
 
1954
 */
 
1955
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4h5py_3h5r_Reference)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
1956
  __Pyx_GOTREF(__pyx_t_1);
 
1957
  __pyx_v_ref = ((struct __pyx_obj_4h5py_3h5r_Reference *)__pyx_t_1);
 
1958
  __pyx_t_1 = 0;
 
1959
 
 
1960
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":258
 
1961
 * 
 
1962
 *     cdef Reference ref = Reference()
 
1963
 *     cdef PyObject* ref_ptr = NULL             # <<<<<<<<<<<<<<
 
1964
 * 
 
1965
 *     ref.ref.obj_ref = buf_ref[0]
 
1966
 */
 
1967
  __pyx_v_ref_ptr = NULL;
 
1968
 
 
1969
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":260
 
1970
 *     cdef PyObject* ref_ptr = NULL
 
1971
 * 
 
1972
 *     ref.ref.obj_ref = buf_ref[0]             # <<<<<<<<<<<<<<
 
1973
 *     ref.typecode = H5R_OBJECT
 
1974
 * 
 
1975
 */
 
1976
  __pyx_v_ref->ref.obj_ref = (__pyx_v_buf_ref[0]);
 
1977
 
 
1978
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":261
 
1979
 * 
 
1980
 *     ref.ref.obj_ref = buf_ref[0]
 
1981
 *     ref.typecode = H5R_OBJECT             # <<<<<<<<<<<<<<
 
1982
 * 
 
1983
 *     ref_ptr = <PyObject*>ref
 
1984
 */
 
1985
  __pyx_v_ref->typecode = H5R_OBJECT;
 
1986
 
 
1987
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":263
 
1988
 *     ref.typecode = H5R_OBJECT
 
1989
 * 
 
1990
 *     ref_ptr = <PyObject*>ref             # <<<<<<<<<<<<<<
 
1991
 *     Py_INCREF(ref_ptr)  # because Cython discards its reference when the
 
1992
 *                         # function exits
 
1993
 */
 
1994
  __pyx_v_ref_ptr = ((PyObject *)__pyx_v_ref);
 
1995
 
 
1996
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":264
 
1997
 * 
 
1998
 *     ref_ptr = <PyObject*>ref
 
1999
 *     Py_INCREF(ref_ptr)  # because Cython discards its reference when the             # <<<<<<<<<<<<<<
 
2000
 *                         # function exits
 
2001
 * 
 
2002
 */
 
2003
  Py_INCREF(__pyx_v_ref_ptr);
 
2004
 
 
2005
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":267
 
2006
 *                         # function exits
 
2007
 * 
 
2008
 *     Py_XDECREF(bkg_obj[0])             # <<<<<<<<<<<<<<
 
2009
 *     buf_obj[0] = ref_ptr
 
2010
 * 
 
2011
 */
 
2012
  Py_XDECREF((__pyx_v_bkg_obj[0]));
 
2013
 
 
2014
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":268
 
2015
 * 
 
2016
 *     Py_XDECREF(bkg_obj[0])
 
2017
 *     buf_obj[0] = ref_ptr             # <<<<<<<<<<<<<<
 
2018
 * 
 
2019
 *     return 0
 
2020
 */
 
2021
  (__pyx_v_buf_obj[0]) = __pyx_v_ref_ptr;
 
2022
 
 
2023
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":270
 
2024
 *     buf_obj[0] = ref_ptr
 
2025
 * 
 
2026
 *     return 0             # <<<<<<<<<<<<<<
 
2027
 * 
 
2028
 * cdef int conv_pyref2objref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
2029
 */
 
2030
  __pyx_r = 0;
 
2031
  goto __pyx_L0;
 
2032
 
 
2033
  __pyx_r = 0;
 
2034
  goto __pyx_L0;
 
2035
  __pyx_L1_error:;
 
2036
  __Pyx_XDECREF(__pyx_t_1);
 
2037
  __Pyx_AddTraceback("h5py._conv.conv_objref2pyref");
 
2038
  __pyx_r = -1;
 
2039
  __pyx_L0:;
 
2040
  __Pyx_XDECREF((PyObject *)__pyx_v_ref);
 
2041
  __Pyx_RefNannyFinishContext();
 
2042
  return __pyx_r;
 
2043
}
 
2044
 
 
2045
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":272
 
2046
 *     return 0
 
2047
 * 
 
2048
 * cdef int conv_pyref2objref(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
2049
 * 
 
2050
 *     cdef PyObject** buf_obj = <PyObject**>ipt
 
2051
 */
 
2052
 
 
2053
static  int __pyx_f_4h5py_5_conv_conv_pyref2objref(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
2054
  PyObject **__pyx_v_buf_obj;
 
2055
  hobj_ref_t *__pyx_v_buf_ref;
 
2056
  PyObject *__pyx_v_obj;
 
2057
  struct __pyx_obj_4h5py_3h5r_Reference *__pyx_v_ref;
 
2058
  int __pyx_r;
 
2059
  int __pyx_t_1;
 
2060
  int __pyx_t_2;
 
2061
  int __pyx_t_3;
 
2062
  PyObject *__pyx_t_4;
 
2063
  PyObject *__pyx_t_5 = NULL;
 
2064
  PyObject *__pyx_t_6 = NULL;
 
2065
  __Pyx_RefNannySetupContext("conv_pyref2objref");
 
2066
  __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None);
 
2067
  __pyx_v_ref = ((struct __pyx_obj_4h5py_3h5r_Reference *)Py_None); __Pyx_INCREF(Py_None);
 
2068
 
 
2069
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":274
 
2070
 * cdef int conv_pyref2objref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
2071
 * 
 
2072
 *     cdef PyObject** buf_obj = <PyObject**>ipt             # <<<<<<<<<<<<<<
 
2073
 *     cdef hobj_ref_t* buf_ref = <hobj_ref_t*>opt
 
2074
 * 
 
2075
 */
 
2076
  __pyx_v_buf_obj = ((PyObject **)__pyx_v_ipt);
 
2077
 
 
2078
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":275
 
2079
 * 
 
2080
 *     cdef PyObject** buf_obj = <PyObject**>ipt
 
2081
 *     cdef hobj_ref_t* buf_ref = <hobj_ref_t*>opt             # <<<<<<<<<<<<<<
 
2082
 * 
 
2083
 *     cdef object obj
 
2084
 */
 
2085
  __pyx_v_buf_ref = ((hobj_ref_t *)__pyx_v_opt);
 
2086
 
 
2087
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":280
 
2088
 *     cdef Reference ref
 
2089
 * 
 
2090
 *     if buf_obj[0] != NULL and buf_obj[0] != Py_None:             # <<<<<<<<<<<<<<
 
2091
 *         obj = <object>(buf_obj[0])
 
2092
 *         if not isinstance(obj, Reference):
 
2093
 */
 
2094
  __pyx_t_1 = ((__pyx_v_buf_obj[0]) != NULL);
 
2095
  if (__pyx_t_1) {
 
2096
    __pyx_t_2 = ((__pyx_v_buf_obj[0]) != Py_None);
 
2097
    __pyx_t_3 = __pyx_t_2;
 
2098
  } else {
 
2099
    __pyx_t_3 = __pyx_t_1;
 
2100
  }
 
2101
  if (__pyx_t_3) {
 
2102
 
 
2103
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":281
 
2104
 * 
 
2105
 *     if buf_obj[0] != NULL and buf_obj[0] != Py_None:
 
2106
 *         obj = <object>(buf_obj[0])             # <<<<<<<<<<<<<<
 
2107
 *         if not isinstance(obj, Reference):
 
2108
 *             raise TypeError("Can't convert incompatible object to HDF5 object reference")
 
2109
 */
 
2110
    __pyx_t_4 = (__pyx_v_buf_obj[0]);
 
2111
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
 
2112
    __Pyx_DECREF(__pyx_v_obj);
 
2113
    __pyx_v_obj = ((PyObject *)__pyx_t_4);
 
2114
 
 
2115
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":282
 
2116
 *     if buf_obj[0] != NULL and buf_obj[0] != Py_None:
 
2117
 *         obj = <object>(buf_obj[0])
 
2118
 *         if not isinstance(obj, Reference):             # <<<<<<<<<<<<<<
 
2119
 *             raise TypeError("Can't convert incompatible object to HDF5 object reference")
 
2120
 *         ref = <Reference>(buf_obj[0])
 
2121
 */
 
2122
    __pyx_t_3 = PyObject_TypeCheck(__pyx_v_obj, ((PyTypeObject *)((PyObject*)__pyx_ptype_4h5py_3h5r_Reference))); 
 
2123
    __pyx_t_1 = (!__pyx_t_3);
 
2124
    if (__pyx_t_1) {
 
2125
 
 
2126
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":283
 
2127
 *         obj = <object>(buf_obj[0])
 
2128
 *         if not isinstance(obj, Reference):
 
2129
 *             raise TypeError("Can't convert incompatible object to HDF5 object reference")             # <<<<<<<<<<<<<<
 
2130
 *         ref = <Reference>(buf_obj[0])
 
2131
 *         buf_ref[0] = ref.ref.obj_ref
 
2132
 */
 
2133
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2134
      __Pyx_GOTREF(__pyx_t_5);
 
2135
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_4));
 
2136
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_4));
 
2137
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_4));
 
2138
      __pyx_t_6 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2139
      __Pyx_GOTREF(__pyx_t_6);
 
2140
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
2141
      __Pyx_Raise(__pyx_t_6, 0, 0);
 
2142
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
2143
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2144
      goto __pyx_L4;
 
2145
    }
 
2146
    __pyx_L4:;
 
2147
 
 
2148
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":284
 
2149
 *         if not isinstance(obj, Reference):
 
2150
 *             raise TypeError("Can't convert incompatible object to HDF5 object reference")
 
2151
 *         ref = <Reference>(buf_obj[0])             # <<<<<<<<<<<<<<
 
2152
 *         buf_ref[0] = ref.ref.obj_ref
 
2153
 *     else:
 
2154
 */
 
2155
    __pyx_t_4 = (__pyx_v_buf_obj[0]);
 
2156
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4h5py_3h5r_Reference *)__pyx_t_4)));
 
2157
    __Pyx_DECREF(((PyObject *)__pyx_v_ref));
 
2158
    __pyx_v_ref = ((struct __pyx_obj_4h5py_3h5r_Reference *)__pyx_t_4);
 
2159
 
 
2160
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":285
 
2161
 *             raise TypeError("Can't convert incompatible object to HDF5 object reference")
 
2162
 *         ref = <Reference>(buf_obj[0])
 
2163
 *         buf_ref[0] = ref.ref.obj_ref             # <<<<<<<<<<<<<<
 
2164
 *     else:
 
2165
 *         memset(buf_ref, c'\0', sizeof(hobj_ref_t))
 
2166
 */
 
2167
    (__pyx_v_buf_ref[0]) = __pyx_v_ref->ref.obj_ref;
 
2168
    goto __pyx_L3;
 
2169
  }
 
2170
  /*else*/ {
 
2171
 
 
2172
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":287
 
2173
 *         buf_ref[0] = ref.ref.obj_ref
 
2174
 *     else:
 
2175
 *         memset(buf_ref, c'\0', sizeof(hobj_ref_t))             # <<<<<<<<<<<<<<
 
2176
 * 
 
2177
 *     return 0
 
2178
 */
 
2179
    memset(__pyx_v_buf_ref, '\x00', (sizeof(hobj_ref_t)));
 
2180
  }
 
2181
  __pyx_L3:;
 
2182
 
 
2183
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":289
 
2184
 *         memset(buf_ref, c'\0', sizeof(hobj_ref_t))
 
2185
 * 
 
2186
 *     return 0             # <<<<<<<<<<<<<<
 
2187
 * 
 
2188
 * cdef int conv_regref2pyref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
2189
 */
 
2190
  __pyx_r = 0;
 
2191
  goto __pyx_L0;
 
2192
 
 
2193
  __pyx_r = 0;
 
2194
  goto __pyx_L0;
 
2195
  __pyx_L1_error:;
 
2196
  __Pyx_XDECREF(__pyx_t_5);
 
2197
  __Pyx_XDECREF(__pyx_t_6);
 
2198
  __Pyx_AddTraceback("h5py._conv.conv_pyref2objref");
 
2199
  __pyx_r = -1;
 
2200
  __pyx_L0:;
 
2201
  __Pyx_DECREF(__pyx_v_obj);
 
2202
  __Pyx_DECREF((PyObject *)__pyx_v_ref);
 
2203
  __Pyx_RefNannyFinishContext();
 
2204
  return __pyx_r;
 
2205
}
 
2206
 
 
2207
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":291
 
2208
 *     return 0
 
2209
 * 
 
2210
 * cdef int conv_regref2pyref(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
2211
 * 
 
2212
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
2213
 */
 
2214
 
 
2215
static  int __pyx_f_4h5py_5_conv_conv_regref2pyref(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
2216
  PyObject **__pyx_v_buf_obj;
 
2217
  PyObject **__pyx_v_bkg_obj;
 
2218
  hdset_reg_ref_t *__pyx_v_buf_ref;
 
2219
  struct __pyx_obj_4h5py_3h5r_RegionReference *__pyx_v_ref = 0;
 
2220
  PyObject *__pyx_v_ref_ptr;
 
2221
  int __pyx_r;
 
2222
  PyObject *__pyx_t_1 = NULL;
 
2223
  __Pyx_RefNannySetupContext("conv_regref2pyref");
 
2224
 
 
2225
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":293
 
2226
 * cdef int conv_regref2pyref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
2227
 * 
 
2228
 *     cdef PyObject** buf_obj = <PyObject**>opt             # <<<<<<<<<<<<<<
 
2229
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
2230
 *     cdef hdset_reg_ref_t* buf_ref = <hdset_reg_ref_t*>ipt
 
2231
 */
 
2232
  __pyx_v_buf_obj = ((PyObject **)__pyx_v_opt);
 
2233
 
 
2234
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":294
 
2235
 * 
 
2236
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
2237
 *     cdef PyObject** bkg_obj = <PyObject**>bkg             # <<<<<<<<<<<<<<
 
2238
 *     cdef hdset_reg_ref_t* buf_ref = <hdset_reg_ref_t*>ipt
 
2239
 * 
 
2240
 */
 
2241
  __pyx_v_bkg_obj = ((PyObject **)__pyx_v_bkg);
 
2242
 
 
2243
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":295
 
2244
 *     cdef PyObject** buf_obj = <PyObject**>opt
 
2245
 *     cdef PyObject** bkg_obj = <PyObject**>bkg
 
2246
 *     cdef hdset_reg_ref_t* buf_ref = <hdset_reg_ref_t*>ipt             # <<<<<<<<<<<<<<
 
2247
 * 
 
2248
 *     cdef RegionReference ref = RegionReference()
 
2249
 */
 
2250
  __pyx_v_buf_ref = ((hdset_reg_ref_t *)__pyx_v_ipt);
 
2251
 
 
2252
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":297
 
2253
 *     cdef hdset_reg_ref_t* buf_ref = <hdset_reg_ref_t*>ipt
 
2254
 * 
 
2255
 *     cdef RegionReference ref = RegionReference()             # <<<<<<<<<<<<<<
 
2256
 *     cdef PyObject* ref_ptr = NULL
 
2257
 * 
 
2258
 */
 
2259
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_4h5py_3h5r_RegionReference)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 297; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2260
  __Pyx_GOTREF(__pyx_t_1);
 
2261
  __pyx_v_ref = ((struct __pyx_obj_4h5py_3h5r_RegionReference *)__pyx_t_1);
 
2262
  __pyx_t_1 = 0;
 
2263
 
 
2264
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":298
 
2265
 * 
 
2266
 *     cdef RegionReference ref = RegionReference()
 
2267
 *     cdef PyObject* ref_ptr = NULL             # <<<<<<<<<<<<<<
 
2268
 * 
 
2269
 *     memcpy(ref.ref.reg_ref, buf_ref, sizeof(hdset_reg_ref_t))
 
2270
 */
 
2271
  __pyx_v_ref_ptr = NULL;
 
2272
 
 
2273
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":300
 
2274
 *     cdef PyObject* ref_ptr = NULL
 
2275
 * 
 
2276
 *     memcpy(ref.ref.reg_ref, buf_ref, sizeof(hdset_reg_ref_t))             # <<<<<<<<<<<<<<
 
2277
 * 
 
2278
 *     ref.typecode = H5R_DATASET_REGION
 
2279
 */
 
2280
  memcpy(__pyx_v_ref->__pyx_base.ref.reg_ref, __pyx_v_buf_ref, (sizeof(hdset_reg_ref_t)));
 
2281
 
 
2282
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":302
 
2283
 *     memcpy(ref.ref.reg_ref, buf_ref, sizeof(hdset_reg_ref_t))
 
2284
 * 
 
2285
 *     ref.typecode = H5R_DATASET_REGION             # <<<<<<<<<<<<<<
 
2286
 * 
 
2287
 *     ref_ptr = <PyObject*>ref
 
2288
 */
 
2289
  __pyx_v_ref->__pyx_base.typecode = H5R_DATASET_REGION;
 
2290
 
 
2291
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":304
 
2292
 *     ref.typecode = H5R_DATASET_REGION
 
2293
 * 
 
2294
 *     ref_ptr = <PyObject*>ref             # <<<<<<<<<<<<<<
 
2295
 *     Py_INCREF(ref_ptr)  # because Cython discards its reference when the
 
2296
 *                         # function exits
 
2297
 */
 
2298
  __pyx_v_ref_ptr = ((PyObject *)__pyx_v_ref);
 
2299
 
 
2300
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":305
 
2301
 * 
 
2302
 *     ref_ptr = <PyObject*>ref
 
2303
 *     Py_INCREF(ref_ptr)  # because Cython discards its reference when the             # <<<<<<<<<<<<<<
 
2304
 *                         # function exits
 
2305
 * 
 
2306
 */
 
2307
  Py_INCREF(__pyx_v_ref_ptr);
 
2308
 
 
2309
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":308
 
2310
 *                         # function exits
 
2311
 * 
 
2312
 *     Py_XDECREF(bkg_obj[0])             # <<<<<<<<<<<<<<
 
2313
 *     buf_obj[0] = ref_ptr
 
2314
 * 
 
2315
 */
 
2316
  Py_XDECREF((__pyx_v_bkg_obj[0]));
 
2317
 
 
2318
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":309
 
2319
 * 
 
2320
 *     Py_XDECREF(bkg_obj[0])
 
2321
 *     buf_obj[0] = ref_ptr             # <<<<<<<<<<<<<<
 
2322
 * 
 
2323
 *     return 0
 
2324
 */
 
2325
  (__pyx_v_buf_obj[0]) = __pyx_v_ref_ptr;
 
2326
 
 
2327
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":311
 
2328
 *     buf_obj[0] = ref_ptr
 
2329
 * 
 
2330
 *     return 0             # <<<<<<<<<<<<<<
 
2331
 * 
 
2332
 * cdef int conv_pyref2regref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
2333
 */
 
2334
  __pyx_r = 0;
 
2335
  goto __pyx_L0;
 
2336
 
 
2337
  __pyx_r = 0;
 
2338
  goto __pyx_L0;
 
2339
  __pyx_L1_error:;
 
2340
  __Pyx_XDECREF(__pyx_t_1);
 
2341
  __Pyx_AddTraceback("h5py._conv.conv_regref2pyref");
 
2342
  __pyx_r = -1;
 
2343
  __pyx_L0:;
 
2344
  __Pyx_XDECREF((PyObject *)__pyx_v_ref);
 
2345
  __Pyx_RefNannyFinishContext();
 
2346
  return __pyx_r;
 
2347
}
 
2348
 
 
2349
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":313
 
2350
 *     return 0
 
2351
 * 
 
2352
 * cdef int conv_pyref2regref(void* ipt, void* opt, void* bkg, void* priv) except -1:             # <<<<<<<<<<<<<<
 
2353
 * 
 
2354
 *     cdef PyObject** buf_obj = <PyObject**>ipt
 
2355
 */
 
2356
 
 
2357
static  int __pyx_f_4h5py_5_conv_conv_pyref2regref(void *__pyx_v_ipt, void *__pyx_v_opt, void *__pyx_v_bkg, void *__pyx_v_priv) {
 
2358
  PyObject **__pyx_v_buf_obj;
 
2359
  hdset_reg_ref_t *__pyx_v_buf_ref;
 
2360
  PyObject *__pyx_v_obj;
 
2361
  struct __pyx_obj_4h5py_3h5r_RegionReference *__pyx_v_ref;
 
2362
  int __pyx_r;
 
2363
  int __pyx_t_1;
 
2364
  int __pyx_t_2;
 
2365
  int __pyx_t_3;
 
2366
  PyObject *__pyx_t_4;
 
2367
  PyObject *__pyx_t_5 = NULL;
 
2368
  PyObject *__pyx_t_6 = NULL;
 
2369
  __Pyx_RefNannySetupContext("conv_pyref2regref");
 
2370
  __pyx_v_obj = Py_None; __Pyx_INCREF(Py_None);
 
2371
  __pyx_v_ref = ((struct __pyx_obj_4h5py_3h5r_RegionReference *)Py_None); __Pyx_INCREF(Py_None);
 
2372
 
 
2373
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":315
 
2374
 * cdef int conv_pyref2regref(void* ipt, void* opt, void* bkg, void* priv) except -1:
 
2375
 * 
 
2376
 *     cdef PyObject** buf_obj = <PyObject**>ipt             # <<<<<<<<<<<<<<
 
2377
 *     cdef hdset_reg_ref_t* buf_ref = <hdset_reg_ref_t*>opt
 
2378
 * 
 
2379
 */
 
2380
  __pyx_v_buf_obj = ((PyObject **)__pyx_v_ipt);
 
2381
 
 
2382
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":316
 
2383
 * 
 
2384
 *     cdef PyObject** buf_obj = <PyObject**>ipt
 
2385
 *     cdef hdset_reg_ref_t* buf_ref = <hdset_reg_ref_t*>opt             # <<<<<<<<<<<<<<
 
2386
 * 
 
2387
 *     cdef object obj
 
2388
 */
 
2389
  __pyx_v_buf_ref = ((hdset_reg_ref_t *)__pyx_v_opt);
 
2390
 
 
2391
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":321
 
2392
 *     cdef RegionReference ref
 
2393
 * 
 
2394
 *     if buf_obj[0] != NULL and buf_obj[0] != Py_None:             # <<<<<<<<<<<<<<
 
2395
 *         obj = <object>(buf_obj[0])
 
2396
 *         if not isinstance(obj, RegionReference):
 
2397
 */
 
2398
  __pyx_t_1 = ((__pyx_v_buf_obj[0]) != NULL);
 
2399
  if (__pyx_t_1) {
 
2400
    __pyx_t_2 = ((__pyx_v_buf_obj[0]) != Py_None);
 
2401
    __pyx_t_3 = __pyx_t_2;
 
2402
  } else {
 
2403
    __pyx_t_3 = __pyx_t_1;
 
2404
  }
 
2405
  if (__pyx_t_3) {
 
2406
 
 
2407
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":322
 
2408
 * 
 
2409
 *     if buf_obj[0] != NULL and buf_obj[0] != Py_None:
 
2410
 *         obj = <object>(buf_obj[0])             # <<<<<<<<<<<<<<
 
2411
 *         if not isinstance(obj, RegionReference):
 
2412
 *             raise TypeError("Can't convert incompatible object to HDF5 region reference")
 
2413
 */
 
2414
    __pyx_t_4 = (__pyx_v_buf_obj[0]);
 
2415
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
 
2416
    __Pyx_DECREF(__pyx_v_obj);
 
2417
    __pyx_v_obj = ((PyObject *)__pyx_t_4);
 
2418
 
 
2419
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":323
 
2420
 *     if buf_obj[0] != NULL and buf_obj[0] != Py_None:
 
2421
 *         obj = <object>(buf_obj[0])
 
2422
 *         if not isinstance(obj, RegionReference):             # <<<<<<<<<<<<<<
 
2423
 *             raise TypeError("Can't convert incompatible object to HDF5 region reference")
 
2424
 *         ref = <RegionReference>(buf_obj[0])
 
2425
 */
 
2426
    __pyx_t_3 = PyObject_TypeCheck(__pyx_v_obj, ((PyTypeObject *)((PyObject*)__pyx_ptype_4h5py_3h5r_RegionReference))); 
 
2427
    __pyx_t_1 = (!__pyx_t_3);
 
2428
    if (__pyx_t_1) {
 
2429
 
 
2430
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":324
 
2431
 *         obj = <object>(buf_obj[0])
 
2432
 *         if not isinstance(obj, RegionReference):
 
2433
 *             raise TypeError("Can't convert incompatible object to HDF5 region reference")             # <<<<<<<<<<<<<<
 
2434
 *         ref = <RegionReference>(buf_obj[0])
 
2435
 *         memcpy(buf_ref, ref.ref.reg_ref, sizeof(hdset_reg_ref_t))
 
2436
 */
 
2437
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2438
      __Pyx_GOTREF(__pyx_t_5);
 
2439
      __Pyx_INCREF(((PyObject *)__pyx_kp_s_5));
 
2440
      PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_kp_s_5));
 
2441
      __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_5));
 
2442
      __pyx_t_6 = PyObject_Call(__pyx_builtin_TypeError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2443
      __Pyx_GOTREF(__pyx_t_6);
 
2444
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
 
2445
      __Pyx_Raise(__pyx_t_6, 0, 0);
 
2446
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
 
2447
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2448
      goto __pyx_L4;
 
2449
    }
 
2450
    __pyx_L4:;
 
2451
 
 
2452
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":325
 
2453
 *         if not isinstance(obj, RegionReference):
 
2454
 *             raise TypeError("Can't convert incompatible object to HDF5 region reference")
 
2455
 *         ref = <RegionReference>(buf_obj[0])             # <<<<<<<<<<<<<<
 
2456
 *         memcpy(buf_ref, ref.ref.reg_ref, sizeof(hdset_reg_ref_t))
 
2457
 *     else:
 
2458
 */
 
2459
    __pyx_t_4 = (__pyx_v_buf_obj[0]);
 
2460
    __Pyx_INCREF(((PyObject *)((struct __pyx_obj_4h5py_3h5r_RegionReference *)__pyx_t_4)));
 
2461
    __Pyx_DECREF(((PyObject *)__pyx_v_ref));
 
2462
    __pyx_v_ref = ((struct __pyx_obj_4h5py_3h5r_RegionReference *)__pyx_t_4);
 
2463
 
 
2464
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":326
 
2465
 *             raise TypeError("Can't convert incompatible object to HDF5 region reference")
 
2466
 *         ref = <RegionReference>(buf_obj[0])
 
2467
 *         memcpy(buf_ref, ref.ref.reg_ref, sizeof(hdset_reg_ref_t))             # <<<<<<<<<<<<<<
 
2468
 *     else:
 
2469
 *         memset(buf_ref, c'\0', sizeof(hdset_reg_ref_t))
 
2470
 */
 
2471
    memcpy(__pyx_v_buf_ref, __pyx_v_ref->__pyx_base.ref.reg_ref, (sizeof(hdset_reg_ref_t)));
 
2472
    goto __pyx_L3;
 
2473
  }
 
2474
  /*else*/ {
 
2475
 
 
2476
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":328
 
2477
 *         memcpy(buf_ref, ref.ref.reg_ref, sizeof(hdset_reg_ref_t))
 
2478
 *     else:
 
2479
 *         memset(buf_ref, c'\0', sizeof(hdset_reg_ref_t))             # <<<<<<<<<<<<<<
 
2480
 * 
 
2481
 *     return 0
 
2482
 */
 
2483
    memset(__pyx_v_buf_ref, '\x00', (sizeof(hdset_reg_ref_t)));
 
2484
  }
 
2485
  __pyx_L3:;
 
2486
 
 
2487
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":330
 
2488
 *         memset(buf_ref, c'\0', sizeof(hdset_reg_ref_t))
 
2489
 * 
 
2490
 *     return 0             # <<<<<<<<<<<<<<
 
2491
 * 
 
2492
 * # =============================================================================
 
2493
 */
 
2494
  __pyx_r = 0;
 
2495
  goto __pyx_L0;
 
2496
 
 
2497
  __pyx_r = 0;
 
2498
  goto __pyx_L0;
 
2499
  __pyx_L1_error:;
 
2500
  __Pyx_XDECREF(__pyx_t_5);
 
2501
  __Pyx_XDECREF(__pyx_t_6);
 
2502
  __Pyx_AddTraceback("h5py._conv.conv_pyref2regref");
 
2503
  __pyx_r = -1;
 
2504
  __pyx_L0:;
 
2505
  __Pyx_DECREF(__pyx_v_obj);
 
2506
  __Pyx_DECREF((PyObject *)__pyx_v_ref);
 
2507
  __Pyx_RefNannyFinishContext();
 
2508
  return __pyx_r;
 
2509
}
 
2510
 
 
2511
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":336
 
2512
 * 
 
2513
 * 
 
2514
 * cdef herr_t vlen2str(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2515
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2516
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2517
 */
 
2518
 
 
2519
static  herr_t __pyx_f_4h5py_5_conv_vlen2str(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2520
  herr_t __pyx_r;
 
2521
  herr_t __pyx_t_1;
 
2522
  __Pyx_RefNannySetupContext("vlen2str");
 
2523
 
 
2524
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":340
 
2525
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2526
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2527
 *              buf_i, bkg_i, dxpl,  conv_vlen2str, init_generic, H5T_BKG_YES)             # <<<<<<<<<<<<<<
 
2528
 * 
 
2529
 * cdef herr_t str2vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2530
 */
 
2531
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_vlen2str, __pyx_f_4h5py_5_conv_init_generic, H5T_BKG_YES); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2532
  __pyx_r = __pyx_t_1;
 
2533
  goto __pyx_L0;
 
2534
 
 
2535
  __pyx_r = 0;
 
2536
  goto __pyx_L0;
 
2537
  __pyx_L1_error:;
 
2538
  __Pyx_AddTraceback("h5py._conv.vlen2str");
 
2539
  __pyx_r = -1;
 
2540
  __pyx_L0:;
 
2541
  __Pyx_RefNannyFinishContext();
 
2542
  return __pyx_r;
 
2543
}
 
2544
 
 
2545
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":342
 
2546
 *              buf_i, bkg_i, dxpl,  conv_vlen2str, init_generic, H5T_BKG_YES)
 
2547
 * 
 
2548
 * cdef herr_t str2vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2549
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2550
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2551
 */
 
2552
 
 
2553
static  herr_t __pyx_f_4h5py_5_conv_str2vlen(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2554
  herr_t __pyx_r;
 
2555
  herr_t __pyx_t_1;
 
2556
  __Pyx_RefNannySetupContext("str2vlen");
 
2557
 
 
2558
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":346
 
2559
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2560
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2561
 *              buf_i, bkg_i, dxpl, conv_str2vlen, init_generic, H5T_BKG_NO)             # <<<<<<<<<<<<<<
 
2562
 * 
 
2563
 * cdef herr_t vlen2fixed(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2564
 */
 
2565
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_str2vlen, __pyx_f_4h5py_5_conv_init_generic, H5T_BKG_NO); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2566
  __pyx_r = __pyx_t_1;
 
2567
  goto __pyx_L0;
 
2568
 
 
2569
  __pyx_r = 0;
 
2570
  goto __pyx_L0;
 
2571
  __pyx_L1_error:;
 
2572
  __Pyx_AddTraceback("h5py._conv.str2vlen");
 
2573
  __pyx_r = -1;
 
2574
  __pyx_L0:;
 
2575
  __Pyx_RefNannyFinishContext();
 
2576
  return __pyx_r;
 
2577
}
 
2578
 
 
2579
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":348
 
2580
 *              buf_i, bkg_i, dxpl, conv_str2vlen, init_generic, H5T_BKG_NO)
 
2581
 * 
 
2582
 * cdef herr_t vlen2fixed(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2583
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2584
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2585
 */
 
2586
 
 
2587
static  herr_t __pyx_f_4h5py_5_conv_vlen2fixed(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2588
  herr_t __pyx_r;
 
2589
  herr_t __pyx_t_1;
 
2590
  __Pyx_RefNannySetupContext("vlen2fixed");
 
2591
 
 
2592
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":352
 
2593
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2594
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2595
 *              buf_i, bkg_i, dxpl, conv_vlen2fixed, init_vlen2fixed, H5T_BKG_NO)             # <<<<<<<<<<<<<<
 
2596
 * 
 
2597
 * cdef herr_t fixed2vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2598
 */
 
2599
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_vlen2fixed, __pyx_f_4h5py_5_conv_init_vlen2fixed, H5T_BKG_NO); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2600
  __pyx_r = __pyx_t_1;
 
2601
  goto __pyx_L0;
 
2602
 
 
2603
  __pyx_r = 0;
 
2604
  goto __pyx_L0;
 
2605
  __pyx_L1_error:;
 
2606
  __Pyx_AddTraceback("h5py._conv.vlen2fixed");
 
2607
  __pyx_r = -1;
 
2608
  __pyx_L0:;
 
2609
  __Pyx_RefNannyFinishContext();
 
2610
  return __pyx_r;
 
2611
}
 
2612
 
 
2613
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":354
 
2614
 *              buf_i, bkg_i, dxpl, conv_vlen2fixed, init_vlen2fixed, H5T_BKG_NO)
 
2615
 * 
 
2616
 * cdef herr_t fixed2vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2617
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2618
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2619
 */
 
2620
 
 
2621
static  herr_t __pyx_f_4h5py_5_conv_fixed2vlen(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2622
  herr_t __pyx_r;
 
2623
  herr_t __pyx_t_1;
 
2624
  __Pyx_RefNannySetupContext("fixed2vlen");
 
2625
 
 
2626
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":358
 
2627
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2628
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2629
 *              buf_i, bkg_i, dxpl, conv_fixed2vlen, init_fixed2vlen, H5T_BKG_NO)             # <<<<<<<<<<<<<<
 
2630
 * 
 
2631
 * cdef herr_t objref2pyref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2632
 */
 
2633
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_fixed2vlen, __pyx_f_4h5py_5_conv_init_fixed2vlen, H5T_BKG_NO); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2634
  __pyx_r = __pyx_t_1;
 
2635
  goto __pyx_L0;
 
2636
 
 
2637
  __pyx_r = 0;
 
2638
  goto __pyx_L0;
 
2639
  __pyx_L1_error:;
 
2640
  __Pyx_AddTraceback("h5py._conv.fixed2vlen");
 
2641
  __pyx_r = -1;
 
2642
  __pyx_L0:;
 
2643
  __Pyx_RefNannyFinishContext();
 
2644
  return __pyx_r;
 
2645
}
 
2646
 
 
2647
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":360
 
2648
 *              buf_i, bkg_i, dxpl, conv_fixed2vlen, init_fixed2vlen, H5T_BKG_NO)
 
2649
 * 
 
2650
 * cdef herr_t objref2pyref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2651
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2652
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2653
 */
 
2654
 
 
2655
static  herr_t __pyx_f_4h5py_5_conv_objref2pyref(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2656
  herr_t __pyx_r;
 
2657
  herr_t __pyx_t_1;
 
2658
  __Pyx_RefNannySetupContext("objref2pyref");
 
2659
 
 
2660
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":364
 
2661
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2662
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2663
 *              buf_i, bkg_i, dxpl, conv_objref2pyref, init_generic, H5T_BKG_YES)             # <<<<<<<<<<<<<<
 
2664
 * 
 
2665
 * cdef herr_t pyref2objref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2666
 */
 
2667
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_objref2pyref, __pyx_f_4h5py_5_conv_init_generic, H5T_BKG_YES); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2668
  __pyx_r = __pyx_t_1;
 
2669
  goto __pyx_L0;
 
2670
 
 
2671
  __pyx_r = 0;
 
2672
  goto __pyx_L0;
 
2673
  __pyx_L1_error:;
 
2674
  __Pyx_AddTraceback("h5py._conv.objref2pyref");
 
2675
  __pyx_r = -1;
 
2676
  __pyx_L0:;
 
2677
  __Pyx_RefNannyFinishContext();
 
2678
  return __pyx_r;
 
2679
}
 
2680
 
 
2681
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":366
 
2682
 *              buf_i, bkg_i, dxpl, conv_objref2pyref, init_generic, H5T_BKG_YES)
 
2683
 * 
 
2684
 * cdef herr_t pyref2objref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2685
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2686
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2687
 */
 
2688
 
 
2689
static  herr_t __pyx_f_4h5py_5_conv_pyref2objref(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2690
  herr_t __pyx_r;
 
2691
  herr_t __pyx_t_1;
 
2692
  __Pyx_RefNannySetupContext("pyref2objref");
 
2693
 
 
2694
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":370
 
2695
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2696
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2697
 *              buf_i, bkg_i, dxpl, conv_pyref2objref, init_generic, H5T_BKG_NO)             # <<<<<<<<<<<<<<
 
2698
 * 
 
2699
 * cdef herr_t regref2pyref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2700
 */
 
2701
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_pyref2objref, __pyx_f_4h5py_5_conv_init_generic, H5T_BKG_NO); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2702
  __pyx_r = __pyx_t_1;
 
2703
  goto __pyx_L0;
 
2704
 
 
2705
  __pyx_r = 0;
 
2706
  goto __pyx_L0;
 
2707
  __pyx_L1_error:;
 
2708
  __Pyx_AddTraceback("h5py._conv.pyref2objref");
 
2709
  __pyx_r = -1;
 
2710
  __pyx_L0:;
 
2711
  __Pyx_RefNannyFinishContext();
 
2712
  return __pyx_r;
 
2713
}
 
2714
 
 
2715
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":372
 
2716
 *              buf_i, bkg_i, dxpl, conv_pyref2objref, init_generic, H5T_BKG_NO)
 
2717
 * 
 
2718
 * cdef herr_t regref2pyref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2719
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2720
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2721
 */
 
2722
 
 
2723
static  herr_t __pyx_f_4h5py_5_conv_regref2pyref(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2724
  herr_t __pyx_r;
 
2725
  herr_t __pyx_t_1;
 
2726
  __Pyx_RefNannySetupContext("regref2pyref");
 
2727
 
 
2728
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":376
 
2729
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2730
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2731
 *              buf_i, bkg_i, dxpl, conv_regref2pyref, init_generic, H5T_BKG_YES)             # <<<<<<<<<<<<<<
 
2732
 * 
 
2733
 * cdef herr_t pyref2regref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
2734
 */
 
2735
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_regref2pyref, __pyx_f_4h5py_5_conv_init_generic, H5T_BKG_YES); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2736
  __pyx_r = __pyx_t_1;
 
2737
  goto __pyx_L0;
 
2738
 
 
2739
  __pyx_r = 0;
 
2740
  goto __pyx_L0;
 
2741
  __pyx_L1_error:;
 
2742
  __Pyx_AddTraceback("h5py._conv.regref2pyref");
 
2743
  __pyx_r = -1;
 
2744
  __pyx_L0:;
 
2745
  __Pyx_RefNannyFinishContext();
 
2746
  return __pyx_r;
 
2747
}
 
2748
 
 
2749
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":378
 
2750
 *              buf_i, bkg_i, dxpl, conv_regref2pyref, init_generic, H5T_BKG_YES)
 
2751
 * 
 
2752
 * cdef herr_t pyref2regref(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2753
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2754
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2755
 */
 
2756
 
 
2757
static  herr_t __pyx_f_4h5py_5_conv_pyref2regref(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
2758
  herr_t __pyx_r;
 
2759
  herr_t __pyx_t_1;
 
2760
  __Pyx_RefNannySetupContext("pyref2regref");
 
2761
 
 
2762
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":382
 
2763
 *                     void *bkg_i, hid_t dxpl) except -1:
 
2764
 *     return generic_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
2765
 *              buf_i, bkg_i, dxpl, conv_pyref2regref, init_generic, H5T_BKG_NO)             # <<<<<<<<<<<<<<
 
2766
 * 
 
2767
 * # =============================================================================
 
2768
 */
 
2769
  __pyx_t_1 = __pyx_f_4h5py_5_conv_generic_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, __pyx_f_4h5py_5_conv_conv_pyref2regref, __pyx_f_4h5py_5_conv_init_generic, H5T_BKG_NO); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2770
  __pyx_r = __pyx_t_1;
 
2771
  goto __pyx_L0;
 
2772
 
 
2773
  __pyx_r = 0;
 
2774
  goto __pyx_L0;
 
2775
  __pyx_L1_error:;
 
2776
  __Pyx_AddTraceback("h5py._conv.pyref2regref");
 
2777
  __pyx_r = -1;
 
2778
  __pyx_L0:;
 
2779
  __Pyx_RefNannyFinishContext();
 
2780
  return __pyx_r;
 
2781
}
 
2782
 
 
2783
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":394
 
2784
 * 
 
2785
 * # Direction ("forward"): 1 = enum to int, 0 = int to enum
 
2786
 * cdef herr_t enum_int_converter(hid_t src, hid_t dst, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
2787
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
2788
 *                     void *bkg_i, hid_t dxpl, int forward) except -1 with gil:
 
2789
 */
 
2790
 
 
2791
static  herr_t __pyx_f_4h5py_5_conv_enum_int_converter(hid_t __pyx_v_src, hid_t __pyx_v_dst, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl, int __pyx_v_forward) {
 
2792
  int __pyx_v_command;
 
2793
  struct __pyx_t_4h5py_5_conv_conv_enum_t *__pyx_v_info;
 
2794
  size_t __pyx_v_nalloc;
 
2795
  int __pyx_v_i;
 
2796
  char *__pyx_v_cbuf;
 
2797
  char *__pyx_v_buf;
 
2798
  herr_t __pyx_r;
 
2799
  int __pyx_t_1;
 
2800
  struct __pyx_t_4h5py_5_conv_conv_enum_t *__pyx_t_2;
 
2801
  size_t __pyx_t_3;
 
2802
  int __pyx_t_4;
 
2803
  hid_t __pyx_t_5;
 
2804
  htri_t __pyx_t_6;
 
2805
  herr_t __pyx_t_7;
 
2806
  PyObject *__pyx_t_8 = NULL;
 
2807
  PyObject *__pyx_t_9 = NULL;
 
2808
  PyGILState_STATE _save = PyGILState_Ensure();
 
2809
  __Pyx_RefNannySetupContext("enum_int_converter");
 
2810
 
 
2811
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":398
 
2812
 *                     void *bkg_i, hid_t dxpl, int forward) except -1 with gil:
 
2813
 * 
 
2814
 *     cdef int command = cdata[0].command             # <<<<<<<<<<<<<<
 
2815
 *     cdef conv_enum_t *info
 
2816
 *     cdef size_t nalloc
 
2817
 */
 
2818
  __pyx_v_command = (__pyx_v_cdata[0]).command;
 
2819
 
 
2820
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":402
 
2821
 *     cdef size_t nalloc
 
2822
 *     cdef int i
 
2823
 *     cdef char* cbuf = NULL             # <<<<<<<<<<<<<<
 
2824
 *     cdef char* buf = <char*>buf_i
 
2825
 * 
 
2826
 */
 
2827
  __pyx_v_cbuf = NULL;
 
2828
 
 
2829
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":403
 
2830
 *     cdef int i
 
2831
 *     cdef char* cbuf = NULL
 
2832
 *     cdef char* buf = <char*>buf_i             # <<<<<<<<<<<<<<
 
2833
 * 
 
2834
 *     if command == H5T_CONV_INIT:
 
2835
 */
 
2836
  __pyx_v_buf = ((char *)__pyx_v_buf_i);
 
2837
 
 
2838
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":405
 
2839
 *     cdef char* buf = <char*>buf_i
 
2840
 * 
 
2841
 *     if command == H5T_CONV_INIT:             # <<<<<<<<<<<<<<
 
2842
 *         cdata[0].need_bkg = H5T_BKG_NO
 
2843
 *         cdata[0].priv = info = <conv_enum_t*>malloc(sizeof(conv_enum_t))
 
2844
 */
 
2845
  __pyx_t_1 = (__pyx_v_command == H5T_CONV_INIT);
 
2846
  if (__pyx_t_1) {
 
2847
 
 
2848
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":406
 
2849
 * 
 
2850
 *     if command == H5T_CONV_INIT:
 
2851
 *         cdata[0].need_bkg = H5T_BKG_NO             # <<<<<<<<<<<<<<
 
2852
 *         cdata[0].priv = info = <conv_enum_t*>malloc(sizeof(conv_enum_t))
 
2853
 *         info[0].src_size = H5Tget_size(src)
 
2854
 */
 
2855
    (__pyx_v_cdata[0]).need_bkg = H5T_BKG_NO;
 
2856
 
 
2857
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":407
 
2858
 *     if command == H5T_CONV_INIT:
 
2859
 *         cdata[0].need_bkg = H5T_BKG_NO
 
2860
 *         cdata[0].priv = info = <conv_enum_t*>malloc(sizeof(conv_enum_t))             # <<<<<<<<<<<<<<
 
2861
 *         info[0].src_size = H5Tget_size(src)
 
2862
 *         info[0].dst_size = H5Tget_size(dst)
 
2863
 */
 
2864
    __pyx_t_2 = ((struct __pyx_t_4h5py_5_conv_conv_enum_t *)malloc((sizeof(struct __pyx_t_4h5py_5_conv_conv_enum_t))));
 
2865
    (__pyx_v_cdata[0]).priv = __pyx_t_2;
 
2866
    __pyx_v_info = __pyx_t_2;
 
2867
 
 
2868
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":408
 
2869
 *         cdata[0].need_bkg = H5T_BKG_NO
 
2870
 *         cdata[0].priv = info = <conv_enum_t*>malloc(sizeof(conv_enum_t))
 
2871
 *         info[0].src_size = H5Tget_size(src)             # <<<<<<<<<<<<<<
 
2872
 *         info[0].dst_size = H5Tget_size(dst)
 
2873
 *         if forward:
 
2874
 */
 
2875
    __pyx_t_3 = H5Tget_size(__pyx_v_src); if (unlikely(__pyx_t_3 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2876
    (__pyx_v_info[0]).src_size = __pyx_t_3;
 
2877
 
 
2878
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":409
 
2879
 *         cdata[0].priv = info = <conv_enum_t*>malloc(sizeof(conv_enum_t))
 
2880
 *         info[0].src_size = H5Tget_size(src)
 
2881
 *         info[0].dst_size = H5Tget_size(dst)             # <<<<<<<<<<<<<<
 
2882
 *         if forward:
 
2883
 *             info[0].supertype = H5Tget_super(src)
 
2884
 */
 
2885
    __pyx_t_3 = H5Tget_size(__pyx_v_dst); if (unlikely(__pyx_t_3 == 0 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2886
    (__pyx_v_info[0]).dst_size = __pyx_t_3;
 
2887
 
 
2888
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":410
 
2889
 *         info[0].src_size = H5Tget_size(src)
 
2890
 *         info[0].dst_size = H5Tget_size(dst)
 
2891
 *         if forward:             # <<<<<<<<<<<<<<
 
2892
 *             info[0].supertype = H5Tget_super(src)
 
2893
 *             info[0].identical = H5Tequal(info[0].supertype, dst)
 
2894
 */
 
2895
    __pyx_t_4 = __pyx_v_forward;
 
2896
    if (__pyx_t_4) {
 
2897
 
 
2898
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":411
 
2899
 *         info[0].dst_size = H5Tget_size(dst)
 
2900
 *         if forward:
 
2901
 *             info[0].supertype = H5Tget_super(src)             # <<<<<<<<<<<<<<
 
2902
 *             info[0].identical = H5Tequal(info[0].supertype, dst)
 
2903
 *         else:
 
2904
 */
 
2905
      __pyx_t_5 = H5Tget_super(__pyx_v_src); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2906
      (__pyx_v_info[0]).supertype = __pyx_t_5;
 
2907
 
 
2908
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":412
 
2909
 *         if forward:
 
2910
 *             info[0].supertype = H5Tget_super(src)
 
2911
 *             info[0].identical = H5Tequal(info[0].supertype, dst)             # <<<<<<<<<<<<<<
 
2912
 *         else:
 
2913
 *             info[0].supertype = H5Tget_super(dst)
 
2914
 */
 
2915
      __pyx_t_6 = H5Tequal((__pyx_v_info[0]).supertype, __pyx_v_dst); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2916
      (__pyx_v_info[0]).identical = __pyx_t_6;
 
2917
      goto __pyx_L4;
 
2918
    }
 
2919
    /*else*/ {
 
2920
 
 
2921
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":414
 
2922
 *             info[0].identical = H5Tequal(info[0].supertype, dst)
 
2923
 *         else:
 
2924
 *             info[0].supertype = H5Tget_super(dst)             # <<<<<<<<<<<<<<
 
2925
 *             info[0].identical = H5Tequal(info[0].supertype, src)
 
2926
 * 
 
2927
 */
 
2928
      __pyx_t_5 = H5Tget_super(__pyx_v_dst); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2929
      (__pyx_v_info[0]).supertype = __pyx_t_5;
 
2930
 
 
2931
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":415
 
2932
 *         else:
 
2933
 *             info[0].supertype = H5Tget_super(dst)
 
2934
 *             info[0].identical = H5Tequal(info[0].supertype, src)             # <<<<<<<<<<<<<<
 
2935
 * 
 
2936
 *     elif command == H5T_CONV_FREE:
 
2937
 */
 
2938
      __pyx_t_6 = H5Tequal((__pyx_v_info[0]).supertype, __pyx_v_src); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
2939
      (__pyx_v_info[0]).identical = __pyx_t_6;
 
2940
    }
 
2941
    __pyx_L4:;
 
2942
    goto __pyx_L3;
 
2943
  }
 
2944
 
 
2945
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":417
 
2946
 *             info[0].identical = H5Tequal(info[0].supertype, src)
 
2947
 * 
 
2948
 *     elif command == H5T_CONV_FREE:             # <<<<<<<<<<<<<<
 
2949
 * 
 
2950
 *         info = <conv_enum_t*>cdata[0].priv
 
2951
 */
 
2952
  __pyx_t_1 = (__pyx_v_command == H5T_CONV_FREE);
 
2953
  if (__pyx_t_1) {
 
2954
 
 
2955
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":419
 
2956
 *     elif command == H5T_CONV_FREE:
 
2957
 * 
 
2958
 *         info = <conv_enum_t*>cdata[0].priv             # <<<<<<<<<<<<<<
 
2959
 *         #H5Tclose(info[0].supertype)
 
2960
 *         free(info)
 
2961
 */
 
2962
    __pyx_v_info = ((struct __pyx_t_4h5py_5_conv_conv_enum_t *)(__pyx_v_cdata[0]).priv);
 
2963
 
 
2964
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":421
 
2965
 *         info = <conv_enum_t*>cdata[0].priv
 
2966
 *         #H5Tclose(info[0].supertype)
 
2967
 *         free(info)             # <<<<<<<<<<<<<<
 
2968
 *         cdata[0].priv = NULL
 
2969
 * 
 
2970
 */
 
2971
    free(__pyx_v_info);
 
2972
 
 
2973
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":422
 
2974
 *         #H5Tclose(info[0].supertype)
 
2975
 *         free(info)
 
2976
 *         cdata[0].priv = NULL             # <<<<<<<<<<<<<<
 
2977
 * 
 
2978
 *     elif command == H5T_CONV_CONV:
 
2979
 */
 
2980
    (__pyx_v_cdata[0]).priv = NULL;
 
2981
    goto __pyx_L3;
 
2982
  }
 
2983
 
 
2984
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":424
 
2985
 *         cdata[0].priv = NULL
 
2986
 * 
 
2987
 *     elif command == H5T_CONV_CONV:             # <<<<<<<<<<<<<<
 
2988
 * 
 
2989
 *         info = <conv_enum_t*>cdata[0].priv
 
2990
 */
 
2991
  __pyx_t_1 = (__pyx_v_command == H5T_CONV_CONV);
 
2992
  if (__pyx_t_1) {
 
2993
 
 
2994
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":426
 
2995
 *     elif command == H5T_CONV_CONV:
 
2996
 * 
 
2997
 *         info = <conv_enum_t*>cdata[0].priv             # <<<<<<<<<<<<<<
 
2998
 * 
 
2999
 *         # Short-circuit success
 
3000
 */
 
3001
    __pyx_v_info = ((struct __pyx_t_4h5py_5_conv_conv_enum_t *)(__pyx_v_cdata[0]).priv);
 
3002
 
 
3003
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":429
 
3004
 * 
 
3005
 *         # Short-circuit success
 
3006
 *         if info[0].identical:             # <<<<<<<<<<<<<<
 
3007
 *             return 0
 
3008
 * 
 
3009
 */
 
3010
    __pyx_t_4 = (__pyx_v_info[0]).identical;
 
3011
    if (__pyx_t_4) {
 
3012
 
 
3013
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":430
 
3014
 *         # Short-circuit success
 
3015
 *         if info[0].identical:
 
3016
 *             return 0             # <<<<<<<<<<<<<<
 
3017
 * 
 
3018
 *         if buf_stride == 0:
 
3019
 */
 
3020
      __pyx_r = 0;
 
3021
      goto __pyx_L0;
 
3022
      goto __pyx_L5;
 
3023
    }
 
3024
    __pyx_L5:;
 
3025
 
 
3026
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":432
 
3027
 *             return 0
 
3028
 * 
 
3029
 *         if buf_stride == 0:             # <<<<<<<<<<<<<<
 
3030
 *             # Contiguous case: call H5Tconvert directly
 
3031
 *             if forward:
 
3032
 */
 
3033
    __pyx_t_1 = (__pyx_v_buf_stride == 0);
 
3034
    if (__pyx_t_1) {
 
3035
 
 
3036
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":434
 
3037
 *         if buf_stride == 0:
 
3038
 *             # Contiguous case: call H5Tconvert directly
 
3039
 *             if forward:             # <<<<<<<<<<<<<<
 
3040
 *                 H5Tconvert(info[0].supertype, dst, nl, buf, NULL, dxpl)
 
3041
 *             else:
 
3042
 */
 
3043
      __pyx_t_4 = __pyx_v_forward;
 
3044
      if (__pyx_t_4) {
 
3045
 
 
3046
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":435
 
3047
 *             # Contiguous case: call H5Tconvert directly
 
3048
 *             if forward:
 
3049
 *                 H5Tconvert(info[0].supertype, dst, nl, buf, NULL, dxpl)             # <<<<<<<<<<<<<<
 
3050
 *             else:
 
3051
 *                 H5Tconvert(src, info[0].supertype, nl, buf, NULL, dxpl)
 
3052
 */
 
3053
        __pyx_t_7 = H5Tconvert((__pyx_v_info[0]).supertype, __pyx_v_dst, __pyx_v_nl, __pyx_v_buf, NULL, __pyx_v_dxpl); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3054
        goto __pyx_L7;
 
3055
      }
 
3056
      /*else*/ {
 
3057
 
 
3058
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":437
 
3059
 *                 H5Tconvert(info[0].supertype, dst, nl, buf, NULL, dxpl)
 
3060
 *             else:
 
3061
 *                 H5Tconvert(src, info[0].supertype, nl, buf, NULL, dxpl)             # <<<<<<<<<<<<<<
 
3062
 *         else:
 
3063
 *             # Non-contiguous: gather, convert and then scatter
 
3064
 */
 
3065
        __pyx_t_7 = H5Tconvert(__pyx_v_src, (__pyx_v_info[0]).supertype, __pyx_v_nl, __pyx_v_buf, NULL, __pyx_v_dxpl); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3066
      }
 
3067
      __pyx_L7:;
 
3068
      goto __pyx_L6;
 
3069
    }
 
3070
    /*else*/ {
 
3071
 
 
3072
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":440
 
3073
 *         else:
 
3074
 *             # Non-contiguous: gather, convert and then scatter
 
3075
 *             if info[0].src_size > info[0].dst_size:             # <<<<<<<<<<<<<<
 
3076
 *                 nalloc = info[0].src_size*nl
 
3077
 *             else:
 
3078
 */
 
3079
      __pyx_t_1 = ((__pyx_v_info[0]).src_size > (__pyx_v_info[0]).dst_size);
 
3080
      if (__pyx_t_1) {
 
3081
 
 
3082
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":441
 
3083
 *             # Non-contiguous: gather, convert and then scatter
 
3084
 *             if info[0].src_size > info[0].dst_size:
 
3085
 *                 nalloc = info[0].src_size*nl             # <<<<<<<<<<<<<<
 
3086
 *             else:
 
3087
 *                 nalloc = info[0].dst_size*nl
 
3088
 */
 
3089
        __pyx_v_nalloc = ((__pyx_v_info[0]).src_size * __pyx_v_nl);
 
3090
        goto __pyx_L8;
 
3091
      }
 
3092
      /*else*/ {
 
3093
 
 
3094
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":443
 
3095
 *                 nalloc = info[0].src_size*nl
 
3096
 *             else:
 
3097
 *                 nalloc = info[0].dst_size*nl             # <<<<<<<<<<<<<<
 
3098
 * 
 
3099
 *             cbuf = <char*>malloc(nalloc)
 
3100
 */
 
3101
        __pyx_v_nalloc = ((__pyx_v_info[0]).dst_size * __pyx_v_nl);
 
3102
      }
 
3103
      __pyx_L8:;
 
3104
 
 
3105
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":445
 
3106
 *                 nalloc = info[0].dst_size*nl
 
3107
 * 
 
3108
 *             cbuf = <char*>malloc(nalloc)             # <<<<<<<<<<<<<<
 
3109
 *             if cbuf == NULL:
 
3110
 *                 raise MemoryError("Can't allocate conversion buffer")
 
3111
 */
 
3112
      __pyx_v_cbuf = ((char *)malloc(__pyx_v_nalloc));
 
3113
 
 
3114
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":446
 
3115
 * 
 
3116
 *             cbuf = <char*>malloc(nalloc)
 
3117
 *             if cbuf == NULL:             # <<<<<<<<<<<<<<
 
3118
 *                 raise MemoryError("Can't allocate conversion buffer")
 
3119
 *             try:
 
3120
 */
 
3121
      __pyx_t_1 = (__pyx_v_cbuf == NULL);
 
3122
      if (__pyx_t_1) {
 
3123
 
 
3124
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":447
 
3125
 *             cbuf = <char*>malloc(nalloc)
 
3126
 *             if cbuf == NULL:
 
3127
 *                 raise MemoryError("Can't allocate conversion buffer")             # <<<<<<<<<<<<<<
 
3128
 *             try:
 
3129
 *                 for i from 0<=i<nl:
 
3130
 */
 
3131
        __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3132
        __Pyx_GOTREF(__pyx_t_8);
 
3133
        __Pyx_INCREF(((PyObject *)__pyx_kp_s_6));
 
3134
        PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_kp_s_6));
 
3135
        __Pyx_GIVEREF(((PyObject *)__pyx_kp_s_6));
 
3136
        __pyx_t_9 = PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3137
        __Pyx_GOTREF(__pyx_t_9);
 
3138
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
 
3139
        __Pyx_Raise(__pyx_t_9, 0, 0);
 
3140
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
 
3141
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3142
        goto __pyx_L9;
 
3143
      }
 
3144
      __pyx_L9:;
 
3145
 
 
3146
      /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":448
 
3147
 *             if cbuf == NULL:
 
3148
 *                 raise MemoryError("Can't allocate conversion buffer")
 
3149
 *             try:             # <<<<<<<<<<<<<<
 
3150
 *                 for i from 0<=i<nl:
 
3151
 *                     memcpy(cbuf + (i*info[0].src_size), buf + (i*buf_stride),
 
3152
 */
 
3153
      /*try:*/ {
 
3154
 
 
3155
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":449
 
3156
 *                 raise MemoryError("Can't allocate conversion buffer")
 
3157
 *             try:
 
3158
 *                 for i from 0<=i<nl:             # <<<<<<<<<<<<<<
 
3159
 *                     memcpy(cbuf + (i*info[0].src_size), buf + (i*buf_stride),
 
3160
 *                            info[0].src_size)
 
3161
 */
 
3162
        __pyx_t_3 = __pyx_v_nl;
 
3163
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
 
3164
 
 
3165
          /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":451
 
3166
 *                 for i from 0<=i<nl:
 
3167
 *                     memcpy(cbuf + (i*info[0].src_size), buf + (i*buf_stride),
 
3168
 *                            info[0].src_size)             # <<<<<<<<<<<<<<
 
3169
 * 
 
3170
 *                 if forward:
 
3171
 */
 
3172
          memcpy((__pyx_v_cbuf + (__pyx_v_i * (__pyx_v_info[0]).src_size)), (__pyx_v_buf + (__pyx_v_i * __pyx_v_buf_stride)), (__pyx_v_info[0]).src_size);
 
3173
        }
 
3174
 
 
3175
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":453
 
3176
 *                            info[0].src_size)
 
3177
 * 
 
3178
 *                 if forward:             # <<<<<<<<<<<<<<
 
3179
 *                     H5Tconvert(info[0].supertype, dst, nl, cbuf, NULL, dxpl)
 
3180
 *                 else:
 
3181
 */
 
3182
        __pyx_t_4 = __pyx_v_forward;
 
3183
        if (__pyx_t_4) {
 
3184
 
 
3185
          /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":454
 
3186
 * 
 
3187
 *                 if forward:
 
3188
 *                     H5Tconvert(info[0].supertype, dst, nl, cbuf, NULL, dxpl)             # <<<<<<<<<<<<<<
 
3189
 *                 else:
 
3190
 *                     H5Tconvert(src, info[0].supertype, nl, cbuf, NULL, dxpl)
 
3191
 */
 
3192
          __pyx_t_7 = H5Tconvert((__pyx_v_info[0]).supertype, __pyx_v_dst, __pyx_v_nl, __pyx_v_cbuf, NULL, __pyx_v_dxpl); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L11;}
 
3193
          goto __pyx_L15;
 
3194
        }
 
3195
        /*else*/ {
 
3196
 
 
3197
          /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":456
 
3198
 *                     H5Tconvert(info[0].supertype, dst, nl, cbuf, NULL, dxpl)
 
3199
 *                 else:
 
3200
 *                     H5Tconvert(src, info[0].supertype, nl, cbuf, NULL, dxpl)             # <<<<<<<<<<<<<<
 
3201
 * 
 
3202
 *                 for i from 0<=i<nl:
 
3203
 */
 
3204
          __pyx_t_7 = H5Tconvert(__pyx_v_src, (__pyx_v_info[0]).supertype, __pyx_v_nl, __pyx_v_cbuf, NULL, __pyx_v_dxpl); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L11;}
 
3205
        }
 
3206
        __pyx_L15:;
 
3207
 
 
3208
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":458
 
3209
 *                     H5Tconvert(src, info[0].supertype, nl, cbuf, NULL, dxpl)
 
3210
 * 
 
3211
 *                 for i from 0<=i<nl:             # <<<<<<<<<<<<<<
 
3212
 *                     memcpy(buf + (i*buf_stride), cbuf + (i*info[0].dst_size),
 
3213
 *                            info[0].dst_size)
 
3214
 */
 
3215
        __pyx_t_3 = __pyx_v_nl;
 
3216
        for (__pyx_v_i = 0; __pyx_v_i < __pyx_t_3; __pyx_v_i++) {
 
3217
 
 
3218
          /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":460
 
3219
 *                 for i from 0<=i<nl:
 
3220
 *                     memcpy(buf + (i*buf_stride), cbuf + (i*info[0].dst_size),
 
3221
 *                            info[0].dst_size)             # <<<<<<<<<<<<<<
 
3222
 *             finally:
 
3223
 *                 free(cbuf)
 
3224
 */
 
3225
          memcpy((__pyx_v_buf + (__pyx_v_i * __pyx_v_buf_stride)), (__pyx_v_cbuf + (__pyx_v_i * (__pyx_v_info[0]).dst_size)), (__pyx_v_info[0]).dst_size);
 
3226
        }
 
3227
      }
 
3228
      /*finally:*/ {
 
3229
        int __pyx_why;
 
3230
        PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
 
3231
        int __pyx_exc_lineno;
 
3232
        __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
 
3233
        __pyx_why = 0; goto __pyx_L12;
 
3234
        __pyx_L11: {
 
3235
          __pyx_why = 4;
 
3236
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
 
3237
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
 
3238
          __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
 
3239
          __pyx_exc_lineno = __pyx_lineno;
 
3240
          goto __pyx_L12;
 
3241
        }
 
3242
        __pyx_L12:;
 
3243
 
 
3244
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":462
 
3245
 *                            info[0].dst_size)
 
3246
 *             finally:
 
3247
 *                 free(cbuf)             # <<<<<<<<<<<<<<
 
3248
 *                 cbuf = NULL
 
3249
 *     else:
 
3250
 */
 
3251
        free(__pyx_v_cbuf);
 
3252
 
 
3253
        /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":463
 
3254
 *             finally:
 
3255
 *                 free(cbuf)
 
3256
 *                 cbuf = NULL             # <<<<<<<<<<<<<<
 
3257
 *     else:
 
3258
 *         return -2
 
3259
 */
 
3260
        __pyx_v_cbuf = NULL;
 
3261
        switch (__pyx_why) {
 
3262
          case 4: {
 
3263
            __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
 
3264
            __pyx_lineno = __pyx_exc_lineno;
 
3265
            __pyx_exc_type = 0;
 
3266
            __pyx_exc_value = 0;
 
3267
            __pyx_exc_tb = 0;
 
3268
            goto __pyx_L1_error;
 
3269
          }
 
3270
        }
 
3271
      }
 
3272
    }
 
3273
    __pyx_L6:;
 
3274
    goto __pyx_L3;
 
3275
  }
 
3276
  /*else*/ {
 
3277
 
 
3278
    /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":465
 
3279
 *                 cbuf = NULL
 
3280
 *     else:
 
3281
 *         return -2             # <<<<<<<<<<<<<<
 
3282
 * 
 
3283
 *     return 0
 
3284
 */
 
3285
    __pyx_r = -2;
 
3286
    goto __pyx_L0;
 
3287
  }
 
3288
  __pyx_L3:;
 
3289
 
 
3290
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":467
 
3291
 *         return -2
 
3292
 * 
 
3293
 *     return 0             # <<<<<<<<<<<<<<
 
3294
 * 
 
3295
 * cdef herr_t enum2int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
3296
 */
 
3297
  __pyx_r = 0;
 
3298
  goto __pyx_L0;
 
3299
 
 
3300
  __pyx_r = 0;
 
3301
  goto __pyx_L0;
 
3302
  __pyx_L1_error:;
 
3303
  __Pyx_XDECREF(__pyx_t_8);
 
3304
  __Pyx_XDECREF(__pyx_t_9);
 
3305
  __Pyx_AddTraceback("h5py._conv.enum_int_converter");
 
3306
  __pyx_r = -1;
 
3307
  __pyx_L0:;
 
3308
  __Pyx_RefNannyFinishContext();
 
3309
  PyGILState_Release(_save);
 
3310
  return __pyx_r;
 
3311
}
 
3312
 
 
3313
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":469
 
3314
 *     return 0
 
3315
 * 
 
3316
 * cdef herr_t enum2int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
3317
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
3318
 *                     void *bkg_i, hid_t dxpl) except -1:
 
3319
 */
 
3320
 
 
3321
static  herr_t __pyx_f_4h5py_5_conv_enum2int(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
3322
  herr_t __pyx_r;
 
3323
  herr_t __pyx_t_1;
 
3324
  __Pyx_RefNannySetupContext("enum2int");
 
3325
 
 
3326
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":473
 
3327
 *                     void *bkg_i, hid_t dxpl) except -1:
 
3328
 *     return enum_int_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
3329
 *              buf_i, bkg_i, dxpl, 1)             # <<<<<<<<<<<<<<
 
3330
 * 
 
3331
 * cdef herr_t int2enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
 
3332
 */
 
3333
  __pyx_t_1 = __pyx_f_4h5py_5_conv_enum_int_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3334
  __pyx_r = __pyx_t_1;
 
3335
  goto __pyx_L0;
 
3336
 
 
3337
  __pyx_r = 0;
 
3338
  goto __pyx_L0;
 
3339
  __pyx_L1_error:;
 
3340
  __Pyx_AddTraceback("h5py._conv.enum2int");
 
3341
  __pyx_r = -1;
 
3342
  __pyx_L0:;
 
3343
  __Pyx_RefNannyFinishContext();
 
3344
  return __pyx_r;
 
3345
}
 
3346
 
 
3347
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":475
 
3348
 *              buf_i, bkg_i, dxpl, 1)
 
3349
 * 
 
3350
 * cdef herr_t int2enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,             # <<<<<<<<<<<<<<
 
3351
 *                     size_t nl, size_t buf_stride, size_t bkg_stride, void *buf_i,
 
3352
 *                     void *bkg_i, hid_t dxpl) except -1:
 
3353
 */
 
3354
 
 
3355
static  herr_t __pyx_f_4h5py_5_conv_int2enum(hid_t __pyx_v_src_id, hid_t __pyx_v_dst_id, H5T_cdata_t *__pyx_v_cdata, size_t __pyx_v_nl, size_t __pyx_v_buf_stride, size_t __pyx_v_bkg_stride, void *__pyx_v_buf_i, void *__pyx_v_bkg_i, hid_t __pyx_v_dxpl) {
 
3356
  herr_t __pyx_r;
 
3357
  herr_t __pyx_t_1;
 
3358
  __Pyx_RefNannySetupContext("int2enum");
 
3359
 
 
3360
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":479
 
3361
 *                     void *bkg_i, hid_t dxpl) except -1:
 
3362
 *     return enum_int_converter(src_id, dst_id, cdata, nl, buf_stride, bkg_stride,
 
3363
 *              buf_i, bkg_i, dxpl, 0)             # <<<<<<<<<<<<<<
 
3364
 * 
 
3365
 * 
 
3366
 */
 
3367
  __pyx_t_1 = __pyx_f_4h5py_5_conv_enum_int_converter(__pyx_v_src_id, __pyx_v_dst_id, __pyx_v_cdata, __pyx_v_nl, __pyx_v_buf_stride, __pyx_v_bkg_stride, __pyx_v_buf_i, __pyx_v_bkg_i, __pyx_v_dxpl, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3368
  __pyx_r = __pyx_t_1;
 
3369
  goto __pyx_L0;
 
3370
 
 
3371
  __pyx_r = 0;
 
3372
  goto __pyx_L0;
 
3373
  __pyx_L1_error:;
 
3374
  __Pyx_AddTraceback("h5py._conv.int2enum");
 
3375
  __pyx_r = -1;
 
3376
  __pyx_L0:;
 
3377
  __Pyx_RefNannyFinishContext();
 
3378
  return __pyx_r;
 
3379
}
 
3380
 
 
3381
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":482
 
3382
 * 
 
3383
 * 
 
3384
 * cpdef int register_converters() except -1:             # <<<<<<<<<<<<<<
 
3385
 * 
 
3386
 *     cdef hid_t vlstring
 
3387
 */
 
3388
 
 
3389
static PyObject *__pyx_pf_4h5py_5_conv_register_converters(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
3390
static  int __pyx_f_4h5py_5_conv_register_converters(int __pyx_skip_dispatch) {
 
3391
  hid_t __pyx_v_vlstring;
 
3392
  hid_t __pyx_v_pyobj;
 
3393
  hid_t __pyx_v_enum;
 
3394
  int __pyx_r;
 
3395
  hid_t __pyx_t_1;
 
3396
  herr_t __pyx_t_2;
 
3397
  __Pyx_RefNannySetupContext("register_converters");
 
3398
 
 
3399
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":488
 
3400
 *     cdef hid_t enum
 
3401
 * 
 
3402
 *     vlstring = H5Tcopy(H5T_C_S1)             # <<<<<<<<<<<<<<
 
3403
 *     H5Tset_size(vlstring, H5T_VARIABLE)
 
3404
 * 
 
3405
 */
 
3406
  __pyx_t_1 = H5Tcopy(H5T_C_S1); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3407
  __pyx_v_vlstring = __pyx_t_1;
 
3408
 
 
3409
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":489
 
3410
 * 
 
3411
 *     vlstring = H5Tcopy(H5T_C_S1)
 
3412
 *     H5Tset_size(vlstring, H5T_VARIABLE)             # <<<<<<<<<<<<<<
 
3413
 * 
 
3414
 *     enum = H5Tenum_create(H5T_STD_I32LE)
 
3415
 */
 
3416
  __pyx_t_2 = H5Tset_size(__pyx_v_vlstring, H5T_VARIABLE); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3417
 
 
3418
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":491
 
3419
 *     H5Tset_size(vlstring, H5T_VARIABLE)
 
3420
 * 
 
3421
 *     enum = H5Tenum_create(H5T_STD_I32LE)             # <<<<<<<<<<<<<<
 
3422
 * 
 
3423
 *     pyobj = get_python_obj()
 
3424
 */
 
3425
  __pyx_t_1 = H5Tenum_create(H5T_STD_I32LE); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3426
  __pyx_v_enum = __pyx_t_1;
 
3427
 
 
3428
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":493
 
3429
 *     enum = H5Tenum_create(H5T_STD_I32LE)
 
3430
 * 
 
3431
 *     pyobj = get_python_obj()             # <<<<<<<<<<<<<<
 
3432
 * 
 
3433
 *     H5Tregister(H5T_PERS_HARD, "vlen2str", vlstring, pyobj, vlen2str)
 
3434
 */
 
3435
  __pyx_v_pyobj = __pyx_f_4h5py_5_conv_get_python_obj(0);
 
3436
 
 
3437
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":495
 
3438
 *     pyobj = get_python_obj()
 
3439
 * 
 
3440
 *     H5Tregister(H5T_PERS_HARD, "vlen2str", vlstring, pyobj, vlen2str)             # <<<<<<<<<<<<<<
 
3441
 *     H5Tregister(H5T_PERS_HARD, "str2vlen", pyobj, vlstring, str2vlen)
 
3442
 * 
 
3443
 */
 
3444
  __pyx_t_2 = H5Tregister(H5T_PERS_HARD, __pyx_k__vlen2str, __pyx_v_vlstring, __pyx_v_pyobj, __pyx_f_4h5py_5_conv_vlen2str); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3445
 
 
3446
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":496
 
3447
 * 
 
3448
 *     H5Tregister(H5T_PERS_HARD, "vlen2str", vlstring, pyobj, vlen2str)
 
3449
 *     H5Tregister(H5T_PERS_HARD, "str2vlen", pyobj, vlstring, str2vlen)             # <<<<<<<<<<<<<<
 
3450
 * 
 
3451
 *     H5Tregister(H5T_PERS_SOFT, "vlen2fixed", vlstring, H5T_C_S1, vlen2fixed)
 
3452
 */
 
3453
  __pyx_t_2 = H5Tregister(H5T_PERS_HARD, __pyx_k__str2vlen, __pyx_v_pyobj, __pyx_v_vlstring, __pyx_f_4h5py_5_conv_str2vlen); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3454
 
 
3455
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":498
 
3456
 *     H5Tregister(H5T_PERS_HARD, "str2vlen", pyobj, vlstring, str2vlen)
 
3457
 * 
 
3458
 *     H5Tregister(H5T_PERS_SOFT, "vlen2fixed", vlstring, H5T_C_S1, vlen2fixed)             # <<<<<<<<<<<<<<
 
3459
 *     H5Tregister(H5T_PERS_SOFT, "fixed2vlen", H5T_C_S1, vlstring, fixed2vlen)
 
3460
 * 
 
3461
 */
 
3462
  __pyx_t_2 = H5Tregister(H5T_PERS_SOFT, __pyx_k__vlen2fixed, __pyx_v_vlstring, H5T_C_S1, __pyx_f_4h5py_5_conv_vlen2fixed); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3463
 
 
3464
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":499
 
3465
 * 
 
3466
 *     H5Tregister(H5T_PERS_SOFT, "vlen2fixed", vlstring, H5T_C_S1, vlen2fixed)
 
3467
 *     H5Tregister(H5T_PERS_SOFT, "fixed2vlen", H5T_C_S1, vlstring, fixed2vlen)             # <<<<<<<<<<<<<<
 
3468
 * 
 
3469
 *     H5Tregister(H5T_PERS_HARD, "objref2pyref", H5T_STD_REF_OBJ, pyobj, objref2pyref)
 
3470
 */
 
3471
  __pyx_t_2 = H5Tregister(H5T_PERS_SOFT, __pyx_k__fixed2vlen, H5T_C_S1, __pyx_v_vlstring, __pyx_f_4h5py_5_conv_fixed2vlen); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3472
 
 
3473
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":501
 
3474
 *     H5Tregister(H5T_PERS_SOFT, "fixed2vlen", H5T_C_S1, vlstring, fixed2vlen)
 
3475
 * 
 
3476
 *     H5Tregister(H5T_PERS_HARD, "objref2pyref", H5T_STD_REF_OBJ, pyobj, objref2pyref)             # <<<<<<<<<<<<<<
 
3477
 *     H5Tregister(H5T_PERS_HARD, "pyref2objref", pyobj, H5T_STD_REF_OBJ, pyref2objref)
 
3478
 * 
 
3479
 */
 
3480
  __pyx_t_2 = H5Tregister(H5T_PERS_HARD, __pyx_k__objref2pyref, H5T_STD_REF_OBJ, __pyx_v_pyobj, __pyx_f_4h5py_5_conv_objref2pyref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3481
 
 
3482
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":502
 
3483
 * 
 
3484
 *     H5Tregister(H5T_PERS_HARD, "objref2pyref", H5T_STD_REF_OBJ, pyobj, objref2pyref)
 
3485
 *     H5Tregister(H5T_PERS_HARD, "pyref2objref", pyobj, H5T_STD_REF_OBJ, pyref2objref)             # <<<<<<<<<<<<<<
 
3486
 * 
 
3487
 *     H5Tregister(H5T_PERS_HARD, "regref2pyref", H5T_STD_REF_DSETREG, pyobj, regref2pyref)
 
3488
 */
 
3489
  __pyx_t_2 = H5Tregister(H5T_PERS_HARD, __pyx_k__pyref2objref, __pyx_v_pyobj, H5T_STD_REF_OBJ, __pyx_f_4h5py_5_conv_pyref2objref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3490
 
 
3491
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":504
 
3492
 *     H5Tregister(H5T_PERS_HARD, "pyref2objref", pyobj, H5T_STD_REF_OBJ, pyref2objref)
 
3493
 * 
 
3494
 *     H5Tregister(H5T_PERS_HARD, "regref2pyref", H5T_STD_REF_DSETREG, pyobj, regref2pyref)             # <<<<<<<<<<<<<<
 
3495
 *     H5Tregister(H5T_PERS_HARD, "pyref2regref", pyobj, H5T_STD_REF_DSETREG, pyref2regref)
 
3496
 * 
 
3497
 */
 
3498
  __pyx_t_2 = H5Tregister(H5T_PERS_HARD, __pyx_k__regref2pyref, H5T_STD_REF_DSETREG, __pyx_v_pyobj, __pyx_f_4h5py_5_conv_regref2pyref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3499
 
 
3500
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":505
 
3501
 * 
 
3502
 *     H5Tregister(H5T_PERS_HARD, "regref2pyref", H5T_STD_REF_DSETREG, pyobj, regref2pyref)
 
3503
 *     H5Tregister(H5T_PERS_HARD, "pyref2regref", pyobj, H5T_STD_REF_DSETREG, pyref2regref)             # <<<<<<<<<<<<<<
 
3504
 * 
 
3505
 *     H5Tregister(H5T_PERS_SOFT, "enum2int", enum, H5T_STD_I32LE, enum2int)
 
3506
 */
 
3507
  __pyx_t_2 = H5Tregister(H5T_PERS_HARD, __pyx_k__pyref2regref, __pyx_v_pyobj, H5T_STD_REF_DSETREG, __pyx_f_4h5py_5_conv_pyref2regref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3508
 
 
3509
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":507
 
3510
 *     H5Tregister(H5T_PERS_HARD, "pyref2regref", pyobj, H5T_STD_REF_DSETREG, pyref2regref)
 
3511
 * 
 
3512
 *     H5Tregister(H5T_PERS_SOFT, "enum2int", enum, H5T_STD_I32LE, enum2int)             # <<<<<<<<<<<<<<
 
3513
 *     H5Tregister(H5T_PERS_SOFT, "int2enum", H5T_STD_I32LE, enum, int2enum)
 
3514
 * 
 
3515
 */
 
3516
  __pyx_t_2 = H5Tregister(H5T_PERS_SOFT, __pyx_k__enum2int, __pyx_v_enum, H5T_STD_I32LE, __pyx_f_4h5py_5_conv_enum2int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3517
 
 
3518
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":508
 
3519
 * 
 
3520
 *     H5Tregister(H5T_PERS_SOFT, "enum2int", enum, H5T_STD_I32LE, enum2int)
 
3521
 *     H5Tregister(H5T_PERS_SOFT, "int2enum", H5T_STD_I32LE, enum, int2enum)             # <<<<<<<<<<<<<<
 
3522
 * 
 
3523
 *     H5Tclose(vlstring)
 
3524
 */
 
3525
  __pyx_t_2 = H5Tregister(H5T_PERS_SOFT, __pyx_k__int2enum, H5T_STD_I32LE, __pyx_v_enum, __pyx_f_4h5py_5_conv_int2enum); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3526
 
 
3527
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":510
 
3528
 *     H5Tregister(H5T_PERS_SOFT, "int2enum", H5T_STD_I32LE, enum, int2enum)
 
3529
 * 
 
3530
 *     H5Tclose(vlstring)             # <<<<<<<<<<<<<<
 
3531
 *     H5Tclose(enum)
 
3532
 * 
 
3533
 */
 
3534
  __pyx_t_2 = H5Tclose(__pyx_v_vlstring); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3535
 
 
3536
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":511
 
3537
 * 
 
3538
 *     H5Tclose(vlstring)
 
3539
 *     H5Tclose(enum)             # <<<<<<<<<<<<<<
 
3540
 * 
 
3541
 *     return 0
 
3542
 */
 
3543
  __pyx_t_2 = H5Tclose(__pyx_v_enum); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3544
 
 
3545
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":513
 
3546
 *     H5Tclose(enum)
 
3547
 * 
 
3548
 *     return 0             # <<<<<<<<<<<<<<
 
3549
 * 
 
3550
 * cpdef int unregister_converters() except -1:
 
3551
 */
 
3552
  __pyx_r = 0;
 
3553
  goto __pyx_L0;
 
3554
 
 
3555
  __pyx_r = 0;
 
3556
  goto __pyx_L0;
 
3557
  __pyx_L1_error:;
 
3558
  __Pyx_AddTraceback("h5py._conv.register_converters");
 
3559
  __pyx_r = -1;
 
3560
  __pyx_L0:;
 
3561
  __Pyx_RefNannyFinishContext();
 
3562
  return __pyx_r;
 
3563
}
 
3564
 
 
3565
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":482
 
3566
 * 
 
3567
 * 
 
3568
 * cpdef int register_converters() except -1:             # <<<<<<<<<<<<<<
 
3569
 * 
 
3570
 *     cdef hid_t vlstring
 
3571
 */
 
3572
 
 
3573
static PyObject *__pyx_pf_4h5py_5_conv_register_converters(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
3574
static PyObject *__pyx_pf_4h5py_5_conv_register_converters(PyObject *__pyx_self, PyObject *unused) {
 
3575
  PyObject *__pyx_r = NULL;
 
3576
  int __pyx_t_1;
 
3577
  PyObject *__pyx_t_2 = NULL;
 
3578
  __Pyx_RefNannySetupContext("register_converters");
 
3579
  __pyx_self = __pyx_self;
 
3580
  __Pyx_XDECREF(__pyx_r);
 
3581
  __pyx_t_1 = __pyx_f_4h5py_5_conv_register_converters(0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3582
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3583
  __Pyx_GOTREF(__pyx_t_2);
 
3584
  __pyx_r = __pyx_t_2;
 
3585
  __pyx_t_2 = 0;
 
3586
  goto __pyx_L0;
 
3587
 
 
3588
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
3589
  goto __pyx_L0;
 
3590
  __pyx_L1_error:;
 
3591
  __Pyx_XDECREF(__pyx_t_2);
 
3592
  __Pyx_AddTraceback("h5py._conv.register_converters");
 
3593
  __pyx_r = NULL;
 
3594
  __pyx_L0:;
 
3595
  __Pyx_XGIVEREF(__pyx_r);
 
3596
  __Pyx_RefNannyFinishContext();
 
3597
  return __pyx_r;
 
3598
}
 
3599
 
 
3600
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":515
 
3601
 *     return 0
 
3602
 * 
 
3603
 * cpdef int unregister_converters() except -1:             # <<<<<<<<<<<<<<
 
3604
 * 
 
3605
 *     H5Tunregister(H5T_PERS_HARD, "vlen2str", -1, -1, vlen2str)
 
3606
 */
 
3607
 
 
3608
static PyObject *__pyx_pf_4h5py_5_conv_unregister_converters(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
3609
static  int __pyx_f_4h5py_5_conv_unregister_converters(int __pyx_skip_dispatch) {
 
3610
  int __pyx_r;
 
3611
  herr_t __pyx_t_1;
 
3612
  __Pyx_RefNannySetupContext("unregister_converters");
 
3613
 
 
3614
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":517
 
3615
 * cpdef int unregister_converters() except -1:
 
3616
 * 
 
3617
 *     H5Tunregister(H5T_PERS_HARD, "vlen2str", -1, -1, vlen2str)             # <<<<<<<<<<<<<<
 
3618
 *     H5Tunregister(H5T_PERS_HARD, "str2vlen", -1, -1, str2vlen)
 
3619
 * 
 
3620
 */
 
3621
  __pyx_t_1 = H5Tunregister(H5T_PERS_HARD, __pyx_k__vlen2str, -1, -1, __pyx_f_4h5py_5_conv_vlen2str); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 517; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3622
 
 
3623
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":518
 
3624
 * 
 
3625
 *     H5Tunregister(H5T_PERS_HARD, "vlen2str", -1, -1, vlen2str)
 
3626
 *     H5Tunregister(H5T_PERS_HARD, "str2vlen", -1, -1, str2vlen)             # <<<<<<<<<<<<<<
 
3627
 * 
 
3628
 *     H5Tunregister(H5T_PERS_SOFT, "vlen2fixed", -1, -1, vlen2fixed)
 
3629
 */
 
3630
  __pyx_t_1 = H5Tunregister(H5T_PERS_HARD, __pyx_k__str2vlen, -1, -1, __pyx_f_4h5py_5_conv_str2vlen); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3631
 
 
3632
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":520
 
3633
 *     H5Tunregister(H5T_PERS_HARD, "str2vlen", -1, -1, str2vlen)
 
3634
 * 
 
3635
 *     H5Tunregister(H5T_PERS_SOFT, "vlen2fixed", -1, -1, vlen2fixed)             # <<<<<<<<<<<<<<
 
3636
 *     H5Tunregister(H5T_PERS_SOFT, "fixed2vlen", -1, -1, fixed2vlen)
 
3637
 * 
 
3638
 */
 
3639
  __pyx_t_1 = H5Tunregister(H5T_PERS_SOFT, __pyx_k__vlen2fixed, -1, -1, __pyx_f_4h5py_5_conv_vlen2fixed); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3640
 
 
3641
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":521
 
3642
 * 
 
3643
 *     H5Tunregister(H5T_PERS_SOFT, "vlen2fixed", -1, -1, vlen2fixed)
 
3644
 *     H5Tunregister(H5T_PERS_SOFT, "fixed2vlen", -1, -1, fixed2vlen)             # <<<<<<<<<<<<<<
 
3645
 * 
 
3646
 *     H5Tunregister(H5T_PERS_HARD, "objref2pyref", -1, -1, objref2pyref)
 
3647
 */
 
3648
  __pyx_t_1 = H5Tunregister(H5T_PERS_SOFT, __pyx_k__fixed2vlen, -1, -1, __pyx_f_4h5py_5_conv_fixed2vlen); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3649
 
 
3650
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":523
 
3651
 *     H5Tunregister(H5T_PERS_SOFT, "fixed2vlen", -1, -1, fixed2vlen)
 
3652
 * 
 
3653
 *     H5Tunregister(H5T_PERS_HARD, "objref2pyref", -1, -1, objref2pyref)             # <<<<<<<<<<<<<<
 
3654
 *     H5Tunregister(H5T_PERS_HARD, "pyref2objref", -1, -1, pyref2objref)
 
3655
 * 
 
3656
 */
 
3657
  __pyx_t_1 = H5Tunregister(H5T_PERS_HARD, __pyx_k__objref2pyref, -1, -1, __pyx_f_4h5py_5_conv_objref2pyref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3658
 
 
3659
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":524
 
3660
 * 
 
3661
 *     H5Tunregister(H5T_PERS_HARD, "objref2pyref", -1, -1, objref2pyref)
 
3662
 *     H5Tunregister(H5T_PERS_HARD, "pyref2objref", -1, -1, pyref2objref)             # <<<<<<<<<<<<<<
 
3663
 * 
 
3664
 *     H5Tunregister(H5T_PERS_HARD, "regref2pyref", -1, -1, regref2pyref)
 
3665
 */
 
3666
  __pyx_t_1 = H5Tunregister(H5T_PERS_HARD, __pyx_k__pyref2objref, -1, -1, __pyx_f_4h5py_5_conv_pyref2objref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3667
 
 
3668
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":526
 
3669
 *     H5Tunregister(H5T_PERS_HARD, "pyref2objref", -1, -1, pyref2objref)
 
3670
 * 
 
3671
 *     H5Tunregister(H5T_PERS_HARD, "regref2pyref", -1, -1, regref2pyref)             # <<<<<<<<<<<<<<
 
3672
 *     H5Tunregister(H5T_PERS_HARD, "pyref2regref", -1, -1, pyref2regref)
 
3673
 * 
 
3674
 */
 
3675
  __pyx_t_1 = H5Tunregister(H5T_PERS_HARD, __pyx_k__regref2pyref, -1, -1, __pyx_f_4h5py_5_conv_regref2pyref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3676
 
 
3677
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":527
 
3678
 * 
 
3679
 *     H5Tunregister(H5T_PERS_HARD, "regref2pyref", -1, -1, regref2pyref)
 
3680
 *     H5Tunregister(H5T_PERS_HARD, "pyref2regref", -1, -1, pyref2regref)             # <<<<<<<<<<<<<<
 
3681
 * 
 
3682
 *     H5Tunregister(H5T_PERS_SOFT, "enum2int", -1, -1, enum2int)
 
3683
 */
 
3684
  __pyx_t_1 = H5Tunregister(H5T_PERS_HARD, __pyx_k__pyref2regref, -1, -1, __pyx_f_4h5py_5_conv_pyref2regref); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3685
 
 
3686
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":529
 
3687
 *     H5Tunregister(H5T_PERS_HARD, "pyref2regref", -1, -1, pyref2regref)
 
3688
 * 
 
3689
 *     H5Tunregister(H5T_PERS_SOFT, "enum2int", -1, -1, enum2int)             # <<<<<<<<<<<<<<
 
3690
 *     H5Tunregister(H5T_PERS_SOFT, "int2enum", -1, -1, int2enum)
 
3691
 * 
 
3692
 */
 
3693
  __pyx_t_1 = H5Tunregister(H5T_PERS_SOFT, __pyx_k__enum2int, -1, -1, __pyx_f_4h5py_5_conv_enum2int); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3694
 
 
3695
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":530
 
3696
 * 
 
3697
 *     H5Tunregister(H5T_PERS_SOFT, "enum2int", -1, -1, enum2int)
 
3698
 *     H5Tunregister(H5T_PERS_SOFT, "int2enum", -1, -1, int2enum)             # <<<<<<<<<<<<<<
 
3699
 * 
 
3700
 *     return 0
 
3701
 */
 
3702
  __pyx_t_1 = H5Tunregister(H5T_PERS_SOFT, __pyx_k__int2enum, -1, -1, __pyx_f_4h5py_5_conv_int2enum); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3703
 
 
3704
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":532
 
3705
 *     H5Tunregister(H5T_PERS_SOFT, "int2enum", -1, -1, int2enum)
 
3706
 * 
 
3707
 *     return 0             # <<<<<<<<<<<<<<
 
3708
 * 
 
3709
 * 
 
3710
 */
 
3711
  __pyx_r = 0;
 
3712
  goto __pyx_L0;
 
3713
 
 
3714
  __pyx_r = 0;
 
3715
  goto __pyx_L0;
 
3716
  __pyx_L1_error:;
 
3717
  __Pyx_AddTraceback("h5py._conv.unregister_converters");
 
3718
  __pyx_r = -1;
 
3719
  __pyx_L0:;
 
3720
  __Pyx_RefNannyFinishContext();
 
3721
  return __pyx_r;
 
3722
}
 
3723
 
 
3724
/* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":515
 
3725
 *     return 0
 
3726
 * 
 
3727
 * cpdef int unregister_converters() except -1:             # <<<<<<<<<<<<<<
 
3728
 * 
 
3729
 *     H5Tunregister(H5T_PERS_HARD, "vlen2str", -1, -1, vlen2str)
 
3730
 */
 
3731
 
 
3732
static PyObject *__pyx_pf_4h5py_5_conv_unregister_converters(PyObject *__pyx_self, PyObject *unused); /*proto*/
 
3733
static PyObject *__pyx_pf_4h5py_5_conv_unregister_converters(PyObject *__pyx_self, PyObject *unused) {
 
3734
  PyObject *__pyx_r = NULL;
 
3735
  int __pyx_t_1;
 
3736
  PyObject *__pyx_t_2 = NULL;
 
3737
  __Pyx_RefNannySetupContext("unregister_converters");
 
3738
  __pyx_self = __pyx_self;
 
3739
  __Pyx_XDECREF(__pyx_r);
 
3740
  __pyx_t_1 = __pyx_f_4h5py_5_conv_unregister_converters(0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3741
  __pyx_t_2 = PyInt_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3742
  __Pyx_GOTREF(__pyx_t_2);
 
3743
  __pyx_r = __pyx_t_2;
 
3744
  __pyx_t_2 = 0;
 
3745
  goto __pyx_L0;
 
3746
 
 
3747
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
 
3748
  goto __pyx_L0;
 
3749
  __pyx_L1_error:;
 
3750
  __Pyx_XDECREF(__pyx_t_2);
 
3751
  __Pyx_AddTraceback("h5py._conv.unregister_converters");
 
3752
  __pyx_r = NULL;
 
3753
  __pyx_L0:;
 
3754
  __Pyx_XGIVEREF(__pyx_r);
 
3755
  __Pyx_RefNannyFinishContext();
 
3756
  return __pyx_r;
 
3757
}
 
3758
 
 
3759
static struct PyMethodDef __pyx_methods[] = {
 
3760
  {__Pyx_NAMESTR("get_python_obj"), (PyCFunction)__pyx_pf_4h5py_5_conv_get_python_obj, METH_NOARGS, __Pyx_DOCSTR(0)},
 
3761
  {__Pyx_NAMESTR("register_converters"), (PyCFunction)__pyx_pf_4h5py_5_conv_register_converters, METH_NOARGS, __Pyx_DOCSTR(0)},
 
3762
  {__Pyx_NAMESTR("unregister_converters"), (PyCFunction)__pyx_pf_4h5py_5_conv_unregister_converters, METH_NOARGS, __Pyx_DOCSTR(0)},
 
3763
  {0, 0, 0, 0}
 
3764
};
 
3765
 
 
3766
static void __pyx_init_filenames(void); /*proto*/
 
3767
 
 
3768
#if PY_MAJOR_VERSION >= 3
 
3769
static struct PyModuleDef __pyx_moduledef = {
 
3770
    PyModuleDef_HEAD_INIT,
 
3771
    __Pyx_NAMESTR("_conv"),
 
3772
    __Pyx_DOCSTR(__pyx_k_7), /* m_doc */
 
3773
    -1, /* m_size */
 
3774
    __pyx_methods /* m_methods */,
 
3775
    NULL, /* m_reload */
 
3776
    NULL, /* m_traverse */
 
3777
    NULL, /* m_clear */
 
3778
    NULL /* m_free */
 
3779
};
 
3780
#endif
 
3781
 
 
3782
static __Pyx_StringTabEntry __pyx_string_tab[] = {
 
3783
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 0, 1, 0},
 
3784
  {&__pyx_kp_s_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 1, 0},
 
3785
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
 
3786
  {&__pyx_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
 
3787
  {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
 
3788
  {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
 
3789
  {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
 
3790
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
 
3791
  {&__pyx_n_s__command, __pyx_k__command, sizeof(__pyx_k__command), 0, 0, 1, 1},
 
3792
  {&__pyx_n_s__dst_size, __pyx_k__dst_size, sizeof(__pyx_k__dst_size), 0, 0, 1, 1},
 
3793
  {&__pyx_n_s__identical, __pyx_k__identical, sizeof(__pyx_k__identical), 0, 0, 1, 1},
 
3794
  {&__pyx_n_s__need_bkg, __pyx_k__need_bkg, sizeof(__pyx_k__need_bkg), 0, 0, 1, 1},
 
3795
  {&__pyx_n_s__obj_ref, __pyx_k__obj_ref, sizeof(__pyx_k__obj_ref), 0, 0, 1, 1},
 
3796
  {&__pyx_n_s__priv, __pyx_k__priv, sizeof(__pyx_k__priv), 0, 0, 1, 1},
 
3797
  {&__pyx_n_s__ref, __pyx_k__ref, sizeof(__pyx_k__ref), 0, 0, 1, 1},
 
3798
  {&__pyx_n_s__reg_ref, __pyx_k__reg_ref, sizeof(__pyx_k__reg_ref), 0, 0, 1, 1},
 
3799
  {&__pyx_n_s__src_size, __pyx_k__src_size, sizeof(__pyx_k__src_size), 0, 0, 1, 1},
 
3800
  {&__pyx_n_s__supertype, __pyx_k__supertype, sizeof(__pyx_k__supertype), 0, 0, 1, 1},
 
3801
  {&__pyx_n_s__typecode, __pyx_k__typecode, sizeof(__pyx_k__typecode), 0, 0, 1, 1},
 
3802
  {0, 0, 0, 0, 0, 0, 0}
 
3803
};
 
3804
static int __Pyx_InitCachedBuiltins(void) {
 
3805
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3806
  __pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3807
  __pyx_builtin_MemoryError = __Pyx_GetName(__pyx_b, __pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3808
  return 0;
 
3809
  __pyx_L1_error:;
 
3810
  return -1;
 
3811
}
 
3812
 
 
3813
static int __Pyx_InitGlobals(void) {
 
3814
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
3815
  return 0;
 
3816
  __pyx_L1_error:;
 
3817
  return -1;
 
3818
}
 
3819
 
 
3820
#if PY_MAJOR_VERSION < 3
 
3821
PyMODINIT_FUNC init_conv(void); /*proto*/
 
3822
PyMODINIT_FUNC init_conv(void)
 
3823
#else
 
3824
PyMODINIT_FUNC PyInit__conv(void); /*proto*/
 
3825
PyMODINIT_FUNC PyInit__conv(void)
 
3826
#endif
 
3827
{
 
3828
  #if CYTHON_REFNANNY
 
3829
  void* __pyx_refnanny = NULL;
 
3830
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
 
3831
  if (!__Pyx_RefNanny) {
 
3832
      PyErr_Clear();
 
3833
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
 
3834
      if (!__Pyx_RefNanny)
 
3835
          Py_FatalError("failed to import 'refnanny' module");
 
3836
  }
 
3837
  __pyx_refnanny = __Pyx_RefNanny->SetupContext("PyMODINIT_FUNC PyInit__conv(void)", __LINE__, __FILE__);
 
3838
  #endif
 
3839
  __pyx_init_filenames();
 
3840
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3841
  #if PY_MAJOR_VERSION < 3
 
3842
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3843
  #else
 
3844
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3845
  #endif
 
3846
  /*--- Library function declarations ---*/
 
3847
  /*--- Threads initialization code ---*/
 
3848
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
 
3849
  #ifdef WITH_THREAD /* Python build with threading support? */
 
3850
  PyEval_InitThreads();
 
3851
  #endif
 
3852
  #endif
 
3853
  /*--- Module creation code ---*/
 
3854
  #if PY_MAJOR_VERSION < 3
 
3855
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_conv"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_7), 0, PYTHON_API_VERSION);
 
3856
  #else
 
3857
  __pyx_m = PyModule_Create(&__pyx_moduledef);
 
3858
  #endif
 
3859
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
3860
  #if PY_MAJOR_VERSION < 3
 
3861
  Py_INCREF(__pyx_m);
 
3862
  #endif
 
3863
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
 
3864
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
3865
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
3866
  /*--- Initialize various global constants etc. ---*/
 
3867
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3868
  if (__pyx_module_is_main_h5py___conv) {
 
3869
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
 
3870
  }
 
3871
  /*--- Builtin init code ---*/
 
3872
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3873
  /*--- Global init code ---*/
 
3874
  /*--- Function export code ---*/
 
3875
  /*--- Type init code ---*/
 
3876
  /*--- Type import code ---*/
 
3877
  __pyx_ptype_4h5py_3h5r_Reference = __Pyx_ImportType("h5py.h5r", "Reference", sizeof(struct __pyx_obj_4h5py_3h5r_Reference)); if (unlikely(!__pyx_ptype_4h5py_3h5r_Reference)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3878
  __pyx_ptype_4h5py_3h5r_RegionReference = __Pyx_ImportType("h5py.h5r", "RegionReference", sizeof(struct __pyx_obj_4h5py_3h5r_RegionReference)); if (unlikely(!__pyx_ptype_4h5py_3h5r_RegionReference)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
 
3879
  /*--- Function import code ---*/
 
3880
  /*--- Execution code ---*/
 
3881
 
 
3882
  /* "/home/tachyon/slave/unix-release/build/h5py/_conv.pyx":22
 
3883
 * 
 
3884
 * # Create Python object equivalents
 
3885
 * cdef hid_t H5PY_OBJ = 0             # <<<<<<<<<<<<<<
 
3886
 * 
 
3887
 * cpdef hid_t get_python_obj():
 
3888
 */
 
3889
  __pyx_v_4h5py_5_conv_H5PY_OBJ = 0;
 
3890
 
 
3891
  /* "/home/tachyon/slave/unix-release/build/h5py/h5r.pxd":1
 
3892
 * #+             # <<<<<<<<<<<<<<
 
3893
 * #
 
3894
 * # This file is part of h5py, a low-level Python interface to the HDF5 library.
 
3895
 */
 
3896
  goto __pyx_L0;
 
3897
  __pyx_L1_error:;
 
3898
  if (__pyx_m) {
 
3899
    __Pyx_AddTraceback("init h5py._conv");
 
3900
    Py_DECREF(__pyx_m); __pyx_m = 0;
 
3901
  } else if (!PyErr_Occurred()) {
 
3902
    PyErr_SetString(PyExc_ImportError, "init h5py._conv");
 
3903
  }
 
3904
  __pyx_L0:;
 
3905
  __Pyx_RefNannyFinishContext();
 
3906
  #if PY_MAJOR_VERSION < 3
 
3907
  return;
 
3908
  #else
 
3909
  return __pyx_m;
 
3910
  #endif
 
3911
}
 
3912
 
 
3913
static const char *__pyx_filenames[] = {
 
3914
  "_conv.pyx",
 
3915
  "h5r.pxd",
 
3916
};
 
3917
 
 
3918
/* Runtime support code */
 
3919
 
 
3920
static void __pyx_init_filenames(void) {
 
3921
  __pyx_f = __pyx_filenames;
 
3922
}
 
3923
 
 
3924
static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
 
3925
    PyObject *tmp_type, *tmp_value, *tmp_tb;
 
3926
    PyThreadState *tstate = PyThreadState_GET();
 
3927
 
 
3928
    tmp_type = tstate->curexc_type;
 
3929
    tmp_value = tstate->curexc_value;
 
3930
    tmp_tb = tstate->curexc_traceback;
 
3931
    tstate->curexc_type = type;
 
3932
    tstate->curexc_value = value;
 
3933
    tstate->curexc_traceback = tb;
 
3934
    Py_XDECREF(tmp_type);
 
3935
    Py_XDECREF(tmp_value);
 
3936
    Py_XDECREF(tmp_tb);
 
3937
}
 
3938
 
 
3939
static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
 
3940
    PyThreadState *tstate = PyThreadState_GET();
 
3941
    *type = tstate->curexc_type;
 
3942
    *value = tstate->curexc_value;
 
3943
    *tb = tstate->curexc_traceback;
 
3944
 
 
3945
    tstate->curexc_type = 0;
 
3946
    tstate->curexc_value = 0;
 
3947
    tstate->curexc_traceback = 0;
 
3948
}
 
3949
 
 
3950
 
 
3951
static INLINE PyObject *__Pyx_PyInt_to_py_hid_t(hid_t val) {
 
3952
    const hid_t neg_one = (hid_t)-1, const_zero = 0;
 
3953
    const int is_unsigned = neg_one > const_zero;
 
3954
    if (sizeof(hid_t) <  sizeof(long)) {
 
3955
        return PyInt_FromLong((long)val);
 
3956
    } else if (sizeof(hid_t) == sizeof(long)) {
 
3957
        if (is_unsigned)
 
3958
            return PyLong_FromUnsignedLong((unsigned long)val);
 
3959
        else
 
3960
            return PyInt_FromLong((long)val);
 
3961
    } else { /* (sizeof(hid_t) > sizeof(long)) */
 
3962
        if (is_unsigned)
 
3963
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
 
3964
        else
 
3965
            return PyLong_FromLongLong((PY_LONG_LONG)val);
 
3966
    }
 
3967
}
 
3968
 
 
3969
static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
 
3970
    PyObject *result;
 
3971
    result = PyObject_GetAttr(dict, name);
 
3972
    if (!result)
 
3973
        PyErr_SetObject(PyExc_NameError, name);
 
3974
    return result;
 
3975
}
 
3976
 
 
3977
#if PY_MAJOR_VERSION < 3
 
3978
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
3979
    Py_XINCREF(type);
 
3980
    Py_XINCREF(value);
 
3981
    Py_XINCREF(tb);
 
3982
    /* First, check the traceback argument, replacing None with NULL. */
 
3983
    if (tb == Py_None) {
 
3984
        Py_DECREF(tb);
 
3985
        tb = 0;
 
3986
    }
 
3987
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
 
3988
        PyErr_SetString(PyExc_TypeError,
 
3989
            "raise: arg 3 must be a traceback or None");
 
3990
        goto raise_error;
 
3991
    }
 
3992
    /* Next, replace a missing value with None */
 
3993
    if (value == NULL) {
 
3994
        value = Py_None;
 
3995
        Py_INCREF(value);
 
3996
    }
 
3997
    #if PY_VERSION_HEX < 0x02050000
 
3998
    if (!PyClass_Check(type))
 
3999
    #else
 
4000
    if (!PyType_Check(type))
 
4001
    #endif
 
4002
    {
 
4003
        /* Raising an instance.  The value should be a dummy. */
 
4004
        if (value != Py_None) {
 
4005
            PyErr_SetString(PyExc_TypeError,
 
4006
                "instance exception may not have a separate value");
 
4007
            goto raise_error;
 
4008
        }
 
4009
        /* Normalize to raise <class>, <instance> */
 
4010
        Py_DECREF(value);
 
4011
        value = type;
 
4012
        #if PY_VERSION_HEX < 0x02050000
 
4013
            if (PyInstance_Check(type)) {
 
4014
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
 
4015
                Py_INCREF(type);
 
4016
            }
 
4017
            else {
 
4018
                type = 0;
 
4019
                PyErr_SetString(PyExc_TypeError,
 
4020
                    "raise: exception must be an old-style class or instance");
 
4021
                goto raise_error;
 
4022
            }
 
4023
        #else
 
4024
            type = (PyObject*) Py_TYPE(type);
 
4025
            Py_INCREF(type);
 
4026
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
 
4027
                PyErr_SetString(PyExc_TypeError,
 
4028
                    "raise: exception class must be a subclass of BaseException");
 
4029
                goto raise_error;
 
4030
            }
 
4031
        #endif
 
4032
    }
 
4033
 
 
4034
    __Pyx_ErrRestore(type, value, tb);
 
4035
    return;
 
4036
raise_error:
 
4037
    Py_XDECREF(value);
 
4038
    Py_XDECREF(type);
 
4039
    Py_XDECREF(tb);
 
4040
    return;
 
4041
}
 
4042
 
 
4043
#else /* Python 3+ */
 
4044
 
 
4045
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
 
4046
    if (tb == Py_None) {
 
4047
        tb = 0;
 
4048
    } else if (tb && !PyTraceBack_Check(tb)) {
 
4049
        PyErr_SetString(PyExc_TypeError,
 
4050
            "raise: arg 3 must be a traceback or None");
 
4051
        goto bad;
 
4052
    }
 
4053
    if (value == Py_None)
 
4054
        value = 0;
 
4055
 
 
4056
    if (PyExceptionInstance_Check(type)) {
 
4057
        if (value) {
 
4058
            PyErr_SetString(PyExc_TypeError,
 
4059
                "instance exception may not have a separate value");
 
4060
            goto bad;
 
4061
        }
 
4062
        value = type;
 
4063
        type = (PyObject*) Py_TYPE(value);
 
4064
    } else if (!PyExceptionClass_Check(type)) {
 
4065
        PyErr_SetString(PyExc_TypeError,
 
4066
            "raise: exception class must be a subclass of BaseException");
 
4067
        goto bad;
 
4068
    }
 
4069
 
 
4070
    PyErr_SetObject(type, value);
 
4071
 
 
4072
    if (tb) {
 
4073
        PyThreadState *tstate = PyThreadState_GET();
 
4074
        PyObject* tmp_tb = tstate->curexc_traceback;
 
4075
        if (tb != tmp_tb) {
 
4076
            Py_INCREF(tb);
 
4077
            tstate->curexc_traceback = tb;
 
4078
            Py_XDECREF(tmp_tb);
 
4079
        }
 
4080
    }
 
4081
 
 
4082
bad:
 
4083
    return;
 
4084
}
 
4085
#endif
 
4086
 
 
4087
static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
 
4088
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
 
4089
    const int is_unsigned = neg_one > const_zero;
 
4090
    if (sizeof(unsigned char) < sizeof(long)) {
 
4091
        long val = __Pyx_PyInt_AsLong(x);
 
4092
        if (unlikely(val != (long)(unsigned char)val)) {
 
4093
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4094
                PyErr_SetString(PyExc_OverflowError,
 
4095
                    (is_unsigned && unlikely(val < 0)) ?
 
4096
                    "can't convert negative value to unsigned char" :
 
4097
                    "value too large to convert to unsigned char");
 
4098
            }
 
4099
            return (unsigned char)-1;
 
4100
        }
 
4101
        return (unsigned char)val;
 
4102
    }
 
4103
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
 
4104
}
 
4105
 
 
4106
static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
 
4107
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
 
4108
    const int is_unsigned = neg_one > const_zero;
 
4109
    if (sizeof(unsigned short) < sizeof(long)) {
 
4110
        long val = __Pyx_PyInt_AsLong(x);
 
4111
        if (unlikely(val != (long)(unsigned short)val)) {
 
4112
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4113
                PyErr_SetString(PyExc_OverflowError,
 
4114
                    (is_unsigned && unlikely(val < 0)) ?
 
4115
                    "can't convert negative value to unsigned short" :
 
4116
                    "value too large to convert to unsigned short");
 
4117
            }
 
4118
            return (unsigned short)-1;
 
4119
        }
 
4120
        return (unsigned short)val;
 
4121
    }
 
4122
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
 
4123
}
 
4124
 
 
4125
static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
 
4126
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
 
4127
    const int is_unsigned = neg_one > const_zero;
 
4128
    if (sizeof(unsigned int) < sizeof(long)) {
 
4129
        long val = __Pyx_PyInt_AsLong(x);
 
4130
        if (unlikely(val != (long)(unsigned int)val)) {
 
4131
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4132
                PyErr_SetString(PyExc_OverflowError,
 
4133
                    (is_unsigned && unlikely(val < 0)) ?
 
4134
                    "can't convert negative value to unsigned int" :
 
4135
                    "value too large to convert to unsigned int");
 
4136
            }
 
4137
            return (unsigned int)-1;
 
4138
        }
 
4139
        return (unsigned int)val;
 
4140
    }
 
4141
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
 
4142
}
 
4143
 
 
4144
static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
 
4145
    const char neg_one = (char)-1, const_zero = 0;
 
4146
    const int is_unsigned = neg_one > const_zero;
 
4147
    if (sizeof(char) < sizeof(long)) {
 
4148
        long val = __Pyx_PyInt_AsLong(x);
 
4149
        if (unlikely(val != (long)(char)val)) {
 
4150
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4151
                PyErr_SetString(PyExc_OverflowError,
 
4152
                    (is_unsigned && unlikely(val < 0)) ?
 
4153
                    "can't convert negative value to char" :
 
4154
                    "value too large to convert to char");
 
4155
            }
 
4156
            return (char)-1;
 
4157
        }
 
4158
        return (char)val;
 
4159
    }
 
4160
    return (char)__Pyx_PyInt_AsLong(x);
 
4161
}
 
4162
 
 
4163
static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
 
4164
    const short neg_one = (short)-1, const_zero = 0;
 
4165
    const int is_unsigned = neg_one > const_zero;
 
4166
    if (sizeof(short) < sizeof(long)) {
 
4167
        long val = __Pyx_PyInt_AsLong(x);
 
4168
        if (unlikely(val != (long)(short)val)) {
 
4169
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4170
                PyErr_SetString(PyExc_OverflowError,
 
4171
                    (is_unsigned && unlikely(val < 0)) ?
 
4172
                    "can't convert negative value to short" :
 
4173
                    "value too large to convert to short");
 
4174
            }
 
4175
            return (short)-1;
 
4176
        }
 
4177
        return (short)val;
 
4178
    }
 
4179
    return (short)__Pyx_PyInt_AsLong(x);
 
4180
}
 
4181
 
 
4182
static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
 
4183
    const int neg_one = (int)-1, const_zero = 0;
 
4184
    const int is_unsigned = neg_one > const_zero;
 
4185
    if (sizeof(int) < sizeof(long)) {
 
4186
        long val = __Pyx_PyInt_AsLong(x);
 
4187
        if (unlikely(val != (long)(int)val)) {
 
4188
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4189
                PyErr_SetString(PyExc_OverflowError,
 
4190
                    (is_unsigned && unlikely(val < 0)) ?
 
4191
                    "can't convert negative value to int" :
 
4192
                    "value too large to convert to int");
 
4193
            }
 
4194
            return (int)-1;
 
4195
        }
 
4196
        return (int)val;
 
4197
    }
 
4198
    return (int)__Pyx_PyInt_AsLong(x);
 
4199
}
 
4200
 
 
4201
static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
 
4202
    const signed char neg_one = (signed char)-1, const_zero = 0;
 
4203
    const int is_unsigned = neg_one > const_zero;
 
4204
    if (sizeof(signed char) < sizeof(long)) {
 
4205
        long val = __Pyx_PyInt_AsLong(x);
 
4206
        if (unlikely(val != (long)(signed char)val)) {
 
4207
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4208
                PyErr_SetString(PyExc_OverflowError,
 
4209
                    (is_unsigned && unlikely(val < 0)) ?
 
4210
                    "can't convert negative value to signed char" :
 
4211
                    "value too large to convert to signed char");
 
4212
            }
 
4213
            return (signed char)-1;
 
4214
        }
 
4215
        return (signed char)val;
 
4216
    }
 
4217
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
 
4218
}
 
4219
 
 
4220
static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
 
4221
    const signed short neg_one = (signed short)-1, const_zero = 0;
 
4222
    const int is_unsigned = neg_one > const_zero;
 
4223
    if (sizeof(signed short) < sizeof(long)) {
 
4224
        long val = __Pyx_PyInt_AsLong(x);
 
4225
        if (unlikely(val != (long)(signed short)val)) {
 
4226
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4227
                PyErr_SetString(PyExc_OverflowError,
 
4228
                    (is_unsigned && unlikely(val < 0)) ?
 
4229
                    "can't convert negative value to signed short" :
 
4230
                    "value too large to convert to signed short");
 
4231
            }
 
4232
            return (signed short)-1;
 
4233
        }
 
4234
        return (signed short)val;
 
4235
    }
 
4236
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
 
4237
}
 
4238
 
 
4239
static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
 
4240
    const signed int neg_one = (signed int)-1, const_zero = 0;
 
4241
    const int is_unsigned = neg_one > const_zero;
 
4242
    if (sizeof(signed int) < sizeof(long)) {
 
4243
        long val = __Pyx_PyInt_AsLong(x);
 
4244
        if (unlikely(val != (long)(signed int)val)) {
 
4245
            if (!unlikely(val == -1 && PyErr_Occurred())) {
 
4246
                PyErr_SetString(PyExc_OverflowError,
 
4247
                    (is_unsigned && unlikely(val < 0)) ?
 
4248
                    "can't convert negative value to signed int" :
 
4249
                    "value too large to convert to signed int");
 
4250
            }
 
4251
            return (signed int)-1;
 
4252
        }
 
4253
        return (signed int)val;
 
4254
    }
 
4255
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
 
4256
}
 
4257
 
 
4258
static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
 
4259
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
 
4260
    const int is_unsigned = neg_one > const_zero;
 
4261
#if PY_VERSION_HEX < 0x03000000
 
4262
    if (likely(PyInt_Check(x))) {
 
4263
        long val = PyInt_AS_LONG(x);
 
4264
        if (is_unsigned && unlikely(val < 0)) {
 
4265
            PyErr_SetString(PyExc_OverflowError,
 
4266
                            "can't convert negative value to unsigned long");
 
4267
            return (unsigned long)-1;
 
4268
        }
 
4269
        return (unsigned long)val;
 
4270
    } else
 
4271
#endif
 
4272
    if (likely(PyLong_Check(x))) {
 
4273
        if (is_unsigned) {
 
4274
            if (unlikely(Py_SIZE(x) < 0)) {
 
4275
                PyErr_SetString(PyExc_OverflowError,
 
4276
                                "can't convert negative value to unsigned long");
 
4277
                return (unsigned long)-1;
 
4278
            }
 
4279
            return PyLong_AsUnsignedLong(x);
 
4280
        } else {
 
4281
            return PyLong_AsLong(x);
 
4282
        }
 
4283
    } else {
 
4284
        unsigned long val;
 
4285
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
4286
        if (!tmp) return (unsigned long)-1;
 
4287
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
 
4288
        Py_DECREF(tmp);
 
4289
        return val;
 
4290
    }
 
4291
}
 
4292
 
 
4293
static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
 
4294
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
 
4295
    const int is_unsigned = neg_one > const_zero;
 
4296
#if PY_VERSION_HEX < 0x03000000
 
4297
    if (likely(PyInt_Check(x))) {
 
4298
        long val = PyInt_AS_LONG(x);
 
4299
        if (is_unsigned && unlikely(val < 0)) {
 
4300
            PyErr_SetString(PyExc_OverflowError,
 
4301
                            "can't convert negative value to unsigned PY_LONG_LONG");
 
4302
            return (unsigned PY_LONG_LONG)-1;
 
4303
        }
 
4304
        return (unsigned PY_LONG_LONG)val;
 
4305
    } else
 
4306
#endif
 
4307
    if (likely(PyLong_Check(x))) {
 
4308
        if (is_unsigned) {
 
4309
            if (unlikely(Py_SIZE(x) < 0)) {
 
4310
                PyErr_SetString(PyExc_OverflowError,
 
4311
                                "can't convert negative value to unsigned PY_LONG_LONG");
 
4312
                return (unsigned PY_LONG_LONG)-1;
 
4313
            }
 
4314
            return PyLong_AsUnsignedLongLong(x);
 
4315
        } else {
 
4316
            return PyLong_AsLongLong(x);
 
4317
        }
 
4318
    } else {
 
4319
        unsigned PY_LONG_LONG val;
 
4320
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
4321
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
 
4322
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
 
4323
        Py_DECREF(tmp);
 
4324
        return val;
 
4325
    }
 
4326
}
 
4327
 
 
4328
static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
 
4329
    const long neg_one = (long)-1, const_zero = 0;
 
4330
    const int is_unsigned = neg_one > const_zero;
 
4331
#if PY_VERSION_HEX < 0x03000000
 
4332
    if (likely(PyInt_Check(x))) {
 
4333
        long val = PyInt_AS_LONG(x);
 
4334
        if (is_unsigned && unlikely(val < 0)) {
 
4335
            PyErr_SetString(PyExc_OverflowError,
 
4336
                            "can't convert negative value to long");
 
4337
            return (long)-1;
 
4338
        }
 
4339
        return (long)val;
 
4340
    } else
 
4341
#endif
 
4342
    if (likely(PyLong_Check(x))) {
 
4343
        if (is_unsigned) {
 
4344
            if (unlikely(Py_SIZE(x) < 0)) {
 
4345
                PyErr_SetString(PyExc_OverflowError,
 
4346
                                "can't convert negative value to long");
 
4347
                return (long)-1;
 
4348
            }
 
4349
            return PyLong_AsUnsignedLong(x);
 
4350
        } else {
 
4351
            return PyLong_AsLong(x);
 
4352
        }
 
4353
    } else {
 
4354
        long val;
 
4355
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
4356
        if (!tmp) return (long)-1;
 
4357
        val = __Pyx_PyInt_AsLong(tmp);
 
4358
        Py_DECREF(tmp);
 
4359
        return val;
 
4360
    }
 
4361
}
 
4362
 
 
4363
static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
 
4364
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
 
4365
    const int is_unsigned = neg_one > const_zero;
 
4366
#if PY_VERSION_HEX < 0x03000000
 
4367
    if (likely(PyInt_Check(x))) {
 
4368
        long val = PyInt_AS_LONG(x);
 
4369
        if (is_unsigned && unlikely(val < 0)) {
 
4370
            PyErr_SetString(PyExc_OverflowError,
 
4371
                            "can't convert negative value to PY_LONG_LONG");
 
4372
            return (PY_LONG_LONG)-1;
 
4373
        }
 
4374
        return (PY_LONG_LONG)val;
 
4375
    } else
 
4376
#endif
 
4377
    if (likely(PyLong_Check(x))) {
 
4378
        if (is_unsigned) {
 
4379
            if (unlikely(Py_SIZE(x) < 0)) {
 
4380
                PyErr_SetString(PyExc_OverflowError,
 
4381
                                "can't convert negative value to PY_LONG_LONG");
 
4382
                return (PY_LONG_LONG)-1;
 
4383
            }
 
4384
            return PyLong_AsUnsignedLongLong(x);
 
4385
        } else {
 
4386
            return PyLong_AsLongLong(x);
 
4387
        }
 
4388
    } else {
 
4389
        PY_LONG_LONG val;
 
4390
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
4391
        if (!tmp) return (PY_LONG_LONG)-1;
 
4392
        val = __Pyx_PyInt_AsLongLong(tmp);
 
4393
        Py_DECREF(tmp);
 
4394
        return val;
 
4395
    }
 
4396
}
 
4397
 
 
4398
static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
 
4399
    const signed long neg_one = (signed long)-1, const_zero = 0;
 
4400
    const int is_unsigned = neg_one > const_zero;
 
4401
#if PY_VERSION_HEX < 0x03000000
 
4402
    if (likely(PyInt_Check(x))) {
 
4403
        long val = PyInt_AS_LONG(x);
 
4404
        if (is_unsigned && unlikely(val < 0)) {
 
4405
            PyErr_SetString(PyExc_OverflowError,
 
4406
                            "can't convert negative value to signed long");
 
4407
            return (signed long)-1;
 
4408
        }
 
4409
        return (signed long)val;
 
4410
    } else
 
4411
#endif
 
4412
    if (likely(PyLong_Check(x))) {
 
4413
        if (is_unsigned) {
 
4414
            if (unlikely(Py_SIZE(x) < 0)) {
 
4415
                PyErr_SetString(PyExc_OverflowError,
 
4416
                                "can't convert negative value to signed long");
 
4417
                return (signed long)-1;
 
4418
            }
 
4419
            return PyLong_AsUnsignedLong(x);
 
4420
        } else {
 
4421
            return PyLong_AsLong(x);
 
4422
        }
 
4423
    } else {
 
4424
        signed long val;
 
4425
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
4426
        if (!tmp) return (signed long)-1;
 
4427
        val = __Pyx_PyInt_AsSignedLong(tmp);
 
4428
        Py_DECREF(tmp);
 
4429
        return val;
 
4430
    }
 
4431
}
 
4432
 
 
4433
static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
 
4434
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
 
4435
    const int is_unsigned = neg_one > const_zero;
 
4436
#if PY_VERSION_HEX < 0x03000000
 
4437
    if (likely(PyInt_Check(x))) {
 
4438
        long val = PyInt_AS_LONG(x);
 
4439
        if (is_unsigned && unlikely(val < 0)) {
 
4440
            PyErr_SetString(PyExc_OverflowError,
 
4441
                            "can't convert negative value to signed PY_LONG_LONG");
 
4442
            return (signed PY_LONG_LONG)-1;
 
4443
        }
 
4444
        return (signed PY_LONG_LONG)val;
 
4445
    } else
 
4446
#endif
 
4447
    if (likely(PyLong_Check(x))) {
 
4448
        if (is_unsigned) {
 
4449
            if (unlikely(Py_SIZE(x) < 0)) {
 
4450
                PyErr_SetString(PyExc_OverflowError,
 
4451
                                "can't convert negative value to signed PY_LONG_LONG");
 
4452
                return (signed PY_LONG_LONG)-1;
 
4453
            }
 
4454
            return PyLong_AsUnsignedLongLong(x);
 
4455
        } else {
 
4456
            return PyLong_AsLongLong(x);
 
4457
        }
 
4458
    } else {
 
4459
        signed PY_LONG_LONG val;
 
4460
        PyObject *tmp = __Pyx_PyNumber_Int(x);
 
4461
        if (!tmp) return (signed PY_LONG_LONG)-1;
 
4462
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
 
4463
        Py_DECREF(tmp);
 
4464
        return val;
 
4465
    }
 
4466
}
 
4467
 
 
4468
static void __Pyx_WriteUnraisable(const char *name) {
 
4469
    PyObject *old_exc, *old_val, *old_tb;
 
4470
    PyObject *ctx;
 
4471
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
 
4472
    #if PY_MAJOR_VERSION < 3
 
4473
    ctx = PyString_FromString(name);
 
4474
    #else
 
4475
    ctx = PyUnicode_FromString(name);
 
4476
    #endif
 
4477
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
 
4478
    if (!ctx) {
 
4479
        PyErr_WriteUnraisable(Py_None);
 
4480
    } else {
 
4481
        PyErr_WriteUnraisable(ctx);
 
4482
        Py_DECREF(ctx);
 
4483
    }
 
4484
}
 
4485
 
 
4486
#ifndef __PYX_HAVE_RT_ImportType
 
4487
#define __PYX_HAVE_RT_ImportType
 
4488
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
 
4489
    long size)
 
4490
{
 
4491
    PyObject *py_module = 0;
 
4492
    PyObject *result = 0;
 
4493
    PyObject *py_name = 0;
 
4494
 
 
4495
    py_module = __Pyx_ImportModule(module_name);
 
4496
    if (!py_module)
 
4497
        goto bad;
 
4498
    #if PY_MAJOR_VERSION < 3
 
4499
    py_name = PyString_FromString(class_name);
 
4500
    #else
 
4501
    py_name = PyUnicode_FromString(class_name);
 
4502
    #endif
 
4503
    if (!py_name)
 
4504
        goto bad;
 
4505
    result = PyObject_GetAttr(py_module, py_name);
 
4506
    Py_DECREF(py_name);
 
4507
    py_name = 0;
 
4508
    Py_DECREF(py_module);
 
4509
    py_module = 0;
 
4510
    if (!result)
 
4511
        goto bad;
 
4512
    if (!PyType_Check(result)) {
 
4513
        PyErr_Format(PyExc_TypeError, 
 
4514
            "%s.%s is not a type object",
 
4515
            module_name, class_name);
 
4516
        goto bad;
 
4517
    }
 
4518
    if (((PyTypeObject *)result)->tp_basicsize != size) {
 
4519
        PyErr_Format(PyExc_ValueError, 
 
4520
            "%s.%s does not appear to be the correct type object",
 
4521
            module_name, class_name);
 
4522
        goto bad;
 
4523
    }
 
4524
    return (PyTypeObject *)result;
 
4525
bad:
 
4526
    Py_XDECREF(py_module);
 
4527
    Py_XDECREF(result);
 
4528
    return 0;
 
4529
}
 
4530
#endif
 
4531
 
 
4532
#ifndef __PYX_HAVE_RT_ImportModule
 
4533
#define __PYX_HAVE_RT_ImportModule
 
4534
static PyObject *__Pyx_ImportModule(const char *name) {
 
4535
    PyObject *py_name = 0;
 
4536
    PyObject *py_module = 0;
 
4537
 
 
4538
    #if PY_MAJOR_VERSION < 3
 
4539
    py_name = PyString_FromString(name);
 
4540
    #else
 
4541
    py_name = PyUnicode_FromString(name);
 
4542
    #endif
 
4543
    if (!py_name)
 
4544
        goto bad;
 
4545
    py_module = PyImport_Import(py_name);
 
4546
    Py_DECREF(py_name);
 
4547
    return py_module;
 
4548
bad:
 
4549
    Py_XDECREF(py_name);
 
4550
    return 0;
 
4551
}
 
4552
#endif
 
4553
 
 
4554
#include "compile.h"
 
4555
#include "frameobject.h"
 
4556
#include "traceback.h"
 
4557
 
 
4558
static void __Pyx_AddTraceback(const char *funcname) {
 
4559
    PyObject *py_srcfile = 0;
 
4560
    PyObject *py_funcname = 0;
 
4561
    PyObject *py_globals = 0;
 
4562
    PyCodeObject *py_code = 0;
 
4563
    PyFrameObject *py_frame = 0;
 
4564
 
 
4565
    #if PY_MAJOR_VERSION < 3
 
4566
    py_srcfile = PyString_FromString(__pyx_filename);
 
4567
    #else
 
4568
    py_srcfile = PyUnicode_FromString(__pyx_filename);
 
4569
    #endif
 
4570
    if (!py_srcfile) goto bad;
 
4571
    if (__pyx_clineno) {
 
4572
        #if PY_MAJOR_VERSION < 3
 
4573
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
 
4574
        #else
 
4575
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
 
4576
        #endif
 
4577
    }
 
4578
    else {
 
4579
        #if PY_MAJOR_VERSION < 3
 
4580
        py_funcname = PyString_FromString(funcname);
 
4581
        #else
 
4582
        py_funcname = PyUnicode_FromString(funcname);
 
4583
        #endif
 
4584
    }
 
4585
    if (!py_funcname) goto bad;
 
4586
    py_globals = PyModule_GetDict(__pyx_m);
 
4587
    if (!py_globals) goto bad;
 
4588
    py_code = PyCode_New(
 
4589
        0,            /*int argcount,*/
 
4590
        #if PY_MAJOR_VERSION >= 3
 
4591
        0,            /*int kwonlyargcount,*/
 
4592
        #endif
 
4593
        0,            /*int nlocals,*/
 
4594
        0,            /*int stacksize,*/
 
4595
        0,            /*int flags,*/
 
4596
        __pyx_empty_bytes, /*PyObject *code,*/
 
4597
        __pyx_empty_tuple,  /*PyObject *consts,*/
 
4598
        __pyx_empty_tuple,  /*PyObject *names,*/
 
4599
        __pyx_empty_tuple,  /*PyObject *varnames,*/
 
4600
        __pyx_empty_tuple,  /*PyObject *freevars,*/
 
4601
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
 
4602
        py_srcfile,   /*PyObject *filename,*/
 
4603
        py_funcname,  /*PyObject *name,*/
 
4604
        __pyx_lineno,   /*int firstlineno,*/
 
4605
        __pyx_empty_bytes  /*PyObject *lnotab*/
 
4606
    );
 
4607
    if (!py_code) goto bad;
 
4608
    py_frame = PyFrame_New(
 
4609
        PyThreadState_GET(), /*PyThreadState *tstate,*/
 
4610
        py_code,             /*PyCodeObject *code,*/
 
4611
        py_globals,          /*PyObject *globals,*/
 
4612
        0                    /*PyObject *locals*/
 
4613
    );
 
4614
    if (!py_frame) goto bad;
 
4615
    py_frame->f_lineno = __pyx_lineno;
 
4616
    PyTraceBack_Here(py_frame);
 
4617
bad:
 
4618
    Py_XDECREF(py_srcfile);
 
4619
    Py_XDECREF(py_funcname);
 
4620
    Py_XDECREF(py_code);
 
4621
    Py_XDECREF(py_frame);
 
4622
}
 
4623
 
 
4624
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
 
4625
    while (t->p) {
 
4626
        #if PY_MAJOR_VERSION < 3
 
4627
        if (t->is_unicode) {
 
4628
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
 
4629
        } else if (t->intern) {
 
4630
            *t->p = PyString_InternFromString(t->s);
 
4631
        } else {
 
4632
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
 
4633
        }
 
4634
        #else  /* Python 3+ has unicode identifiers */
 
4635
        if (t->is_unicode | t->is_str) {
 
4636
            if (t->intern) {
 
4637
                *t->p = PyUnicode_InternFromString(t->s);
 
4638
            } else if (t->encoding) {
 
4639
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
 
4640
            } else {
 
4641
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
 
4642
            }
 
4643
        } else {
 
4644
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
 
4645
        }
 
4646
        #endif
 
4647
        if (!*t->p)
 
4648
            return -1;
 
4649
        ++t;
 
4650
    }
 
4651
    return 0;
 
4652
}
 
4653
 
 
4654
/* Type Conversion Functions */
 
4655
 
 
4656
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
 
4657
   if (x == Py_True) return 1;
 
4658
   else if ((x == Py_False) | (x == Py_None)) return 0;
 
4659
   else return PyObject_IsTrue(x);
 
4660
}
 
4661
 
 
4662
static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
 
4663
  PyNumberMethods *m;
 
4664
  const char *name = NULL;
 
4665
  PyObject *res = NULL;
 
4666
#if PY_VERSION_HEX < 0x03000000
 
4667
  if (PyInt_Check(x) || PyLong_Check(x))
 
4668
#else
 
4669
  if (PyLong_Check(x))
 
4670
#endif
 
4671
    return Py_INCREF(x), x;
 
4672
  m = Py_TYPE(x)->tp_as_number;
 
4673
#if PY_VERSION_HEX < 0x03000000
 
4674
  if (m && m->nb_int) {
 
4675
    name = "int";
 
4676
    res = PyNumber_Int(x);
 
4677
  }
 
4678
  else if (m && m->nb_long) {
 
4679
    name = "long";
 
4680
    res = PyNumber_Long(x);
 
4681
  }
 
4682
#else
 
4683
  if (m && m->nb_int) {
 
4684
    name = "int";
 
4685
    res = PyNumber_Long(x);
 
4686
  }
 
4687
#endif
 
4688
  if (res) {
 
4689
#if PY_VERSION_HEX < 0x03000000
 
4690
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
 
4691
#else
 
4692
    if (!PyLong_Check(res)) {
 
4693
#endif
 
4694
      PyErr_Format(PyExc_TypeError,
 
4695
                   "__%s__ returned non-%s (type %.200s)",
 
4696
                   name, name, Py_TYPE(res)->tp_name);
 
4697
      Py_DECREF(res);
 
4698
      return NULL;
 
4699
    }
 
4700
  }
 
4701
  else if (!PyErr_Occurred()) {
 
4702
    PyErr_SetString(PyExc_TypeError,
 
4703
                    "an integer is required");
 
4704
  }
 
4705
  return res;
 
4706
}
 
4707
 
 
4708
static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
 
4709
  Py_ssize_t ival;
 
4710
  PyObject* x = PyNumber_Index(b);
 
4711
  if (!x) return -1;
 
4712
  ival = PyInt_AsSsize_t(x);
 
4713
  Py_DECREF(x);
 
4714
  return ival;
 
4715
}
 
4716
 
 
4717
static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
 
4718
#if PY_VERSION_HEX < 0x02050000
 
4719
   if (ival <= LONG_MAX)
 
4720
       return PyInt_FromLong((long)ival);
 
4721
   else {
 
4722
       unsigned char *bytes = (unsigned char *) &ival;
 
4723
       int one = 1; int little = (int)*(unsigned char*)&one;
 
4724
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
 
4725
   }
 
4726
#else
 
4727
   return PyInt_FromSize_t(ival);
 
4728
#endif
 
4729
}
 
4730
 
 
4731
static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
 
4732
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
 
4733
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
 
4734
       return (size_t)-1;
 
4735
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
 
4736
       PyErr_SetString(PyExc_OverflowError,
 
4737
                       "value too large to convert to size_t");
 
4738
       return (size_t)-1;
 
4739
   }
 
4740
   return (size_t)val;
 
4741
}
 
4742
 
 
4743
 
 
4744
#endif /* Py_PYTHON_H */