Commits

Mikhail Korobov  committed f4012e8

Do not require Cython for package installation (run ./rebuild.sh before making a release in order to generate the C module)

  • Participants
  • Parent commits b88b33a

Comments (0)

Files changed (3)

File generated/tinycdb.c

+/* Generated by Cython 0.15.1 on Fri Dec 16 03:31:34 2011 */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#ifndef Py_PYTHON_H
+    #error Python headers needed to compile C extensions, please install development version of Python.
+#else
+
+#include <stddef.h> /* For offsetof */
+#ifndef offsetof
+#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+  #ifndef __fastcall
+    #define __fastcall
+  #endif
+#endif
+
+#ifndef DL_IMPORT
+  #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+  #define DL_EXPORT(t) t
+#endif
+
+#ifndef PY_LONG_LONG
+  #define PY_LONG_LONG LONG_LONG
+#endif
+
+#if PY_VERSION_HEX < 0x02040000
+  #define METH_COEXIST 0
+  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+  #define PyDict_Contains(d,o)   PySequence_Contains(d,o)
+#endif
+
+#if PY_VERSION_HEX < 0x02050000
+  typedef int Py_ssize_t;
+  #define PY_SSIZE_T_MAX INT_MAX
+  #define PY_SSIZE_T_MIN INT_MIN
+  #define PY_FORMAT_SIZE_T ""
+  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
+  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
+  #define PyNumber_Index(o)    PyNumber_Int(o)
+  #define PyIndex_Check(o)     PyNumber_Check(o)
+  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
+#endif
+
+#if PY_VERSION_HEX < 0x02060000
+  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
+  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
+  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
+  #define PyVarObject_HEAD_INIT(type, size) \
+          PyObject_HEAD_INIT(type) size,
+  #define PyType_Modified(t)
+
+  typedef struct {
+     void *buf;
+     PyObject *obj;
+     Py_ssize_t len;
+     Py_ssize_t itemsize;
+     int readonly;
+     int ndim;
+     char *format;
+     Py_ssize_t *shape;
+     Py_ssize_t *strides;
+     Py_ssize_t *suboffsets;
+     void *internal;
+  } Py_buffer;
+
+  #define PyBUF_SIMPLE 0
+  #define PyBUF_WRITABLE 0x0001
+  #define PyBUF_FORMAT 0x0004
+  #define PyBUF_ND 0x0008
+  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
+  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
+  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
+  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
+  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
+
+#endif
+
+#if PY_MAJOR_VERSION < 3
+  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+#else
+  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+#endif
+
+#if PY_MAJOR_VERSION >= 3
+  #define Py_TPFLAGS_CHECKTYPES 0
+  #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+
+#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
+  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+
+#if PY_MAJOR_VERSION >= 3
+  #define PyBaseString_Type            PyUnicode_Type
+  #define PyStringObject               PyUnicodeObject
+  #define PyString_Type                PyUnicode_Type
+  #define PyString_Check               PyUnicode_Check
+  #define PyString_CheckExact          PyUnicode_CheckExact
+#endif
+
+#if PY_VERSION_HEX < 0x02060000
+  #define PyBytesObject                PyStringObject
+  #define PyBytes_Type                 PyString_Type
+  #define PyBytes_Check                PyString_Check
+  #define PyBytes_CheckExact           PyString_CheckExact
+  #define PyBytes_FromString           PyString_FromString
+  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
+  #define PyBytes_FromFormat           PyString_FromFormat
+  #define PyBytes_DecodeEscape         PyString_DecodeEscape
+  #define PyBytes_AsString             PyString_AsString
+  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
+  #define PyBytes_Size                 PyString_Size
+  #define PyBytes_AS_STRING            PyString_AS_STRING
+  #define PyBytes_GET_SIZE             PyString_GET_SIZE
+  #define PyBytes_Repr                 PyString_Repr
+  #define PyBytes_Concat               PyString_Concat
+  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
+#endif
+
+#if PY_VERSION_HEX < 0x02060000
+  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
+  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
+#endif
+#ifndef PySet_CheckExact
+  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
+#endif
+
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+
+#if PY_MAJOR_VERSION >= 3
+  #define PyIntObject                  PyLongObject
+  #define PyInt_Type                   PyLong_Type
+  #define PyInt_Check(op)              PyLong_Check(op)
+  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
+  #define PyInt_FromString             PyLong_FromString
+  #define PyInt_FromUnicode            PyLong_FromUnicode
+  #define PyInt_FromLong               PyLong_FromLong
+  #define PyInt_FromSize_t             PyLong_FromSize_t
+  #define PyInt_FromSsize_t            PyLong_FromSsize_t
+  #define PyInt_AsLong                 PyLong_AsLong
+  #define PyInt_AS_LONG                PyLong_AS_LONG
+  #define PyInt_AsSsize_t              PyLong_AsSsize_t
+  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
+  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+#endif
+
+#if PY_MAJOR_VERSION >= 3
+  #define PyBoolObject                 PyLongObject
+#endif
+
+#if PY_VERSION_HEX < 0x03020000
+  typedef long Py_hash_t;
+  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
+#else
+  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
+#endif
+
+
+#if PY_MAJOR_VERSION >= 3
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
+#endif
+
+#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
+  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
+  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
+  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
+#else
+  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
+        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
+        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
+            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
+  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
+        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
+        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
+            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
+  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
+        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
+        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
+            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
+#endif
+
+#if PY_MAJOR_VERSION >= 3
+  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
+#endif
+
+#if PY_VERSION_HEX < 0x02050000
+  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
+  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
+  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
+#else
+  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
+  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
+  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
+#endif
+
+#if PY_VERSION_HEX < 0x02050000
+  #define __Pyx_NAMESTR(n) ((char *)(n))
+  #define __Pyx_DOCSTR(n)  ((char *)(n))
+#else
+  #define __Pyx_NAMESTR(n) (n)
+  #define __Pyx_DOCSTR(n)  (n)
+#endif
+
+#ifndef __PYX_EXTERN_C
+  #ifdef __cplusplus
+    #define __PYX_EXTERN_C extern "C"
+  #else
+    #define __PYX_EXTERN_C extern
+  #endif
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+#define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#define __PYX_HAVE__tinycdb
+#define __PYX_HAVE_API__tinycdb
+#include "stdio.h"
+#include "pythread.h"
+#include "fcntl.h"
+#include "unistd.h"
+#include "cdb.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#ifdef PYREX_WITHOUT_ASSERTIONS
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+
+/* inline attribute */
+#ifndef CYTHON_INLINE
+  #if defined(__GNUC__)
+    #define CYTHON_INLINE __inline__
+  #elif defined(_MSC_VER)
+    #define CYTHON_INLINE __inline
+  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+    #define CYTHON_INLINE inline
+  #else
+    #define CYTHON_INLINE
+  #endif
+#endif
+
+/* unused attribute */
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define CYTHON_UNUSED __attribute__ ((__unused__))
+#   else
+#     define CYTHON_UNUSED
+#   endif
+# elif defined(__ICC) || defined(__INTEL_COMPILER)
+#   define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+#   define CYTHON_UNUSED
+# endif
+#endif
+
+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*/
+
+
+/* Type Conversion Predeclarations */
+
+#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s)   ((unsigned char*) PyBytes_AsString(s))
+
+#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
+
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+
+
+#ifdef __GNUC__
+  /* Test for GCC > 2.95 */
+  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
+    #define likely(x)   __builtin_expect(!!(x), 1)
+    #define unlikely(x) __builtin_expect(!!(x), 0)
+  #else /* __GNUC__ > 2 ... */
+    #define likely(x)   (x)
+    #define unlikely(x) (x)
+  #endif /* __GNUC__ > 2 ... */
+#else /* __GNUC__ */
+  #define likely(x)   (x)
+  #define unlikely(x) (x)
+#endif /* __GNUC__ */
+    
+static PyObject *__pyx_m;
+static PyObject *__pyx_b;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+
+static const char *__pyx_f[] = {
+  "tinycdb.pyx",
+  "bool.pxd",
+  "complex.pxd",
+};
+
+/*--- Type declarations ---*/
+struct __pyx_obj_7tinycdb_tinycdb;
+struct __pyx_obj_7tinycdb_create;
+struct __pyx_obj_7tinycdb_read;
+
+/* "tinycdb.pyx":44
+ *     pass
+ * 
+ * cdef class tinycdb:             # <<<<<<<<<<<<<<
+ *     cdef int fd
+ *     cdef public char mode
+ */
+struct __pyx_obj_7tinycdb_tinycdb {
+  PyObject_HEAD
+  int fd;
+  char mode;
+  PyObject *fname;
+  struct cdb_make cdbm;
+};
+
+
+/* "tinycdb.pyx":77
+ *     return create(fname)
+ * 
+ * cdef class create(tinycdb):             # <<<<<<<<<<<<<<
+ *     cdef int finished
+ *     def __init__( self, fname ) :
+ */
+struct __pyx_obj_7tinycdb_create {
+  struct __pyx_obj_7tinycdb_tinycdb __pyx_base;
+  int finished;
+};
+
+
+/* "tinycdb.pyx":110
+ *             close( self.fd )
+ * 
+ * cdef class read(tinycdb):             # <<<<<<<<<<<<<<
+ *     def __init__( self, fname ) :
+ *         self.fd = openFile( fname, 0 )
+ */
+struct __pyx_obj_7tinycdb_read {
+  struct __pyx_obj_7tinycdb_tinycdb __pyx_base;
+};
+
+
+#ifndef CYTHON_REFNANNY
+  #define CYTHON_REFNANNY 0
+#endif
+
+#if CYTHON_REFNANNY
+  typedef struct {
+    void (*INCREF)(void*, PyObject*, int);
+    void (*DECREF)(void*, PyObject*, int);
+    void (*GOTREF)(void*, PyObject*, int);
+    void (*GIVEREF)(void*, PyObject*, int);
+    void* (*SetupContext)(const char*, int, const char*);
+    void (*FinishContext)(void**);
+  } __Pyx_RefNannyAPIStruct;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
+  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+  #define __Pyx_RefNannySetupContext(name)           __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+  #define __Pyx_RefNannyFinishContext()           __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+  #define __Pyx_RefNannyDeclarations
+  #define __Pyx_RefNannySetupContext(name)
+  #define __Pyx_RefNannyFinishContext()
+  #define __Pyx_INCREF(r) Py_INCREF(r)
+  #define __Pyx_DECREF(r) Py_DECREF(r)
+  #define __Pyx_GOTREF(r)
+  #define __Pyx_GIVEREF(r)
+  #define __Pyx_XINCREF(r) Py_XINCREF(r)
+  #define __Pyx_XDECREF(r) Py_XDECREF(r)
+  #define __Pyx_XGOTREF(r)
+  #define __Pyx_XGIVEREF(r)
+#endif /* CYTHON_REFNANNY */
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
+
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name, PyObject* kw_name); /*proto*/
+
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
+
+static PyObject *__Pyx_FindPy2Metaclass(PyObject *bases); /*proto*/
+
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name,
+                                   PyObject *modname); /*proto*/
+
+#include <string.h>
+
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
+
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
+
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+
+static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+
+static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+
+static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
+
+static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
+
+static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+
+static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+
+static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+
+static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
+
+static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+
+static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+
+static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
+
+static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+
+static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+
+static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
+static int __Pyx_check_binary_version(void);
+
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);  /*proto*/
+
+static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
+
+static void __Pyx_AddTraceback(const char *funcname, int __pyx_clineno,
+                               int __pyx_lineno, const char *__pyx_filename); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+/* Module declarations from 'cpython.version' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.exc' */
+
+/* Module declarations from 'cpython.module' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'cpython.tuple' */
+
+/* Module declarations from 'cpython.list' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.sequence' */
+
+/* Module declarations from 'cpython.mapping' */
+
+/* Module declarations from 'cpython.iterator' */
+
+/* Module declarations from 'cpython.type' */
+
+/* Module declarations from 'cpython.number' */
+
+/* Module declarations from 'cpython.int' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.bool' */
+static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
+
+/* Module declarations from 'cpython.long' */
+
+/* Module declarations from 'cpython.float' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.complex' */
+static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
+
+/* Module declarations from 'cpython.string' */
+
+/* Module declarations from 'cpython.unicode' */
+
+/* Module declarations from 'cpython.dict' */
+
+/* Module declarations from 'cpython.instance' */
+
+/* Module declarations from 'cpython.function' */
+
+/* Module declarations from 'cpython.method' */
+
+/* Module declarations from 'cpython.weakref' */
+
+/* Module declarations from 'cpython.getargs' */
+
+/* Module declarations from 'cpython.pythread' */
+
+/* Module declarations from 'cpython.pystate' */
+
+/* Module declarations from 'cpython.cobject' */
+
+/* Module declarations from 'cpython.oldbuffer' */
+
+/* Module declarations from 'cpython.set' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'cpython.bytes' */
+
+/* Module declarations from 'cpython.pycapsule' */
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'tinycdb' */
+static PyTypeObject *__pyx_ptype_7tinycdb_tinycdb = 0;
+static PyTypeObject *__pyx_ptype_7tinycdb_create = 0;
+static PyTypeObject *__pyx_ptype_7tinycdb_read = 0;
+static int __pyx_f_7tinycdb_openFile(PyObject *, int); /*proto*/
+#define __Pyx_MODULE_NAME "tinycdb"
+int __pyx_module_is_main_tinycdb = 0;
+
+/* Implementation of 'tinycdb' */
+static PyObject *__pyx_builtin_Exception;
+static PyObject *__pyx_builtin_IOError;
+static PyObject *__pyx_builtin_chr;
+static PyObject *__pyx_builtin_KeyError;
+static PyObject *__pyx_builtin_MemoryError;
+static char __pyx_k_1[] = "Can't open file: '%s'";
+static char __pyx_k_2[] = "Unknown Error";
+static char __pyx_k_4[] = "TinyCDB('%s', '%s')";
+static char __pyx_k_8[] = "Key '%s' not found";
+static char __pyx_k_9[] = "malloc() failed";
+static char __pyx_k_12[] = "\nA very simple interface to the tinycdb DBM.\n\nBy Jeethu Rao <jeethu@jeethurao.com>\n";
+static char __pyx_k__r[] = "r";
+static char __pyx_k__chr[] = "chr";
+static char __pyx_k__mode[] = "mode";
+static char __pyx_k__close[] = "close";
+static char __pyx_k__fname[] = "fname";
+static char __pyx_k__IOError[] = "IOError";
+static char __pyx_k__TinyCDB[] = "TinyCDB";
+static char __pyx_k__tinycdb[] = "tinycdb";
+static char __pyx_k__CDBError[] = "CDBError";
+static char __pyx_k__KeyError[] = "KeyError";
+static char __pyx_k____main__[] = "__main__";
+static char __pyx_k____test__[] = "__test__";
+static char __pyx_k__Exception[] = "Exception";
+static char __pyx_k__MemoryError[] = "MemoryError";
+static char __pyx_k____contains__[] = "__contains__";
+static PyObject *__pyx_kp_s_1;
+static PyObject *__pyx_kp_s_2;
+static PyObject *__pyx_kp_s_4;
+static PyObject *__pyx_kp_s_8;
+static PyObject *__pyx_kp_s_9;
+static PyObject *__pyx_n_s__CDBError;
+static PyObject *__pyx_n_s__Exception;
+static PyObject *__pyx_n_s__IOError;
+static PyObject *__pyx_n_s__KeyError;
+static PyObject *__pyx_n_s__MemoryError;
+static PyObject *__pyx_n_s__TinyCDB;
+static PyObject *__pyx_n_s____contains__;
+static PyObject *__pyx_n_s____main__;
+static PyObject *__pyx_n_s____test__;
+static PyObject *__pyx_n_s__chr;
+static PyObject *__pyx_n_s__close;
+static PyObject *__pyx_n_s__fname;
+static PyObject *__pyx_n_s__mode;
+static PyObject *__pyx_n_s__r;
+static PyObject *__pyx_n_s__tinycdb;
+static PyObject *__pyx_k_tuple_3;
+static PyObject *__pyx_k_tuple_5;
+static PyObject *__pyx_k_tuple_6;
+static PyObject *__pyx_k_tuple_7;
+static PyObject *__pyx_k_tuple_10;
+static PyObject *__pyx_k_tuple_11;
+
+/* "tinycdb.pyx":28
+ *     int cdb_bread( int fd, void* buf, int len )
+ * 
+ * cdef int openFile( object file_name, int rw ) except -1 :             # <<<<<<<<<<<<<<
+ *     cdef char *buffer
+ *     cdef Py_ssize_t len
+ */
+
+static int __pyx_f_7tinycdb_openFile(PyObject *__pyx_v_file_name, int __pyx_v_rw) {
+  char *__pyx_v_buffer;
+  Py_ssize_t __pyx_v_len;
+  int __pyx_v_rez;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("openFile");
+
+  /* "tinycdb.pyx":32
+ *     cdef Py_ssize_t len
+ *     cdef int rez
+ *     rez = PyString_AsStringAndSize(file_name, &buffer, &len)             # <<<<<<<<<<<<<<
+ *     if rw :
+ *         rez = open( buffer, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR )
+ */
+  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_file_name, (&__pyx_v_buffer), (&__pyx_v_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_rez = __pyx_t_1;
+
+  /* "tinycdb.pyx":33
+ *     cdef int rez
+ *     rez = PyString_AsStringAndSize(file_name, &buffer, &len)
+ *     if rw :             # <<<<<<<<<<<<<<
+ *         rez = open( buffer, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR )
+ *     else :
+ */
+  if (__pyx_v_rw) {
+
+    /* "tinycdb.pyx":34
+ *     rez = PyString_AsStringAndSize(file_name, &buffer, &len)
+ *     if rw :
+ *         rez = open( buffer, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR )             # <<<<<<<<<<<<<<
+ *     else :
+ *         rez = open( buffer, O_RDONLY, 0 )
+ */
+    __pyx_v_rez = open(__pyx_v_buffer, (O_RDWR | O_CREAT), (S_IRUSR | S_IWUSR));
+    goto __pyx_L3;
+  }
+  /*else*/ {
+
+    /* "tinycdb.pyx":36
+ *         rez = open( buffer, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR )
+ *     else :
+ *         rez = open( buffer, O_RDONLY, 0 )             # <<<<<<<<<<<<<<
+ *     if rez == -1 :
+ *         raise IOError("Can't open file: \'%s\'"%file_name)
+ */
+    __pyx_v_rez = open(__pyx_v_buffer, O_RDONLY, 0);
+  }
+  __pyx_L3:;
+
+  /* "tinycdb.pyx":37
+ *     else :
+ *         rez = open( buffer, O_RDONLY, 0 )
+ *     if rez == -1 :             # <<<<<<<<<<<<<<
+ *         raise IOError("Can't open file: \'%s\'"%file_name)
+ *     return rez
+ */
+  __pyx_t_2 = (__pyx_v_rez == -1);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":38
+ *         rez = open( buffer, O_RDONLY, 0 )
+ *     if rez == -1 :
+ *         raise IOError("Can't open file: \'%s\'"%file_name)             # <<<<<<<<<<<<<<
+ *     return rez
+ * 
+ */
+    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_1), __pyx_v_file_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
+    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
+    __pyx_t_3 = 0;
+    __pyx_t_3 = PyObject_Call(__pyx_builtin_IOError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L4;
+  }
+  __pyx_L4:;
+
+  /* "tinycdb.pyx":39
+ *     if rez == -1 :
+ *         raise IOError("Can't open file: \'%s\'"%file_name)
+ *     return rez             # <<<<<<<<<<<<<<
+ * 
+ * class CDBError( Exception ) :
+ */
+  __pyx_r = __pyx_v_rez;
+  goto __pyx_L0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("tinycdb.openFile", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":49
+ *     cdef public fname
+ *     cdef cdb_make cdbm
+ *     def __contains__( self, key ) :             # <<<<<<<<<<<<<<
+ *         cdef char *buffer
+ *         cdef Py_ssize_t len
+ */
+
+static int __pyx_pf_7tinycdb_7tinycdb___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static int __pyx_pf_7tinycdb_7tinycdb___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+  char *__pyx_v_buffer;
+  Py_ssize_t __pyx_v_len;
+  int __pyx_v_rez;
+  unsigned int __pyx_v_dlen;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__contains__");
+
+  /* "tinycdb.pyx":54
+ *         cdef int rez
+ *         cdef unsigned int dlen
+ *         rez = PyString_AsStringAndSize(key, &buffer, &len)             # <<<<<<<<<<<<<<
+ *         if self.mode == c'w':
+ *             rez = cdb_make_exists(&self.cdbm, buffer, len)
+ */
+  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_key, (&__pyx_v_buffer), (&__pyx_v_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_rez = __pyx_t_1;
+
+  /* "tinycdb.pyx":55
+ *         cdef unsigned int dlen
+ *         rez = PyString_AsStringAndSize(key, &buffer, &len)
+ *         if self.mode == c'w':             # <<<<<<<<<<<<<<
+ *             rez = cdb_make_exists(&self.cdbm, buffer, len)
+ *         else:
+ */
+  __pyx_t_2 = (((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->mode == 'w');
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":56
+ *         rez = PyString_AsStringAndSize(key, &buffer, &len)
+ *         if self.mode == c'w':
+ *             rez = cdb_make_exists(&self.cdbm, buffer, len)             # <<<<<<<<<<<<<<
+ *         else:
+ *             rez = cdb_seek( self.fd, buffer, len, &dlen )
+ */
+    __pyx_v_rez = cdb_make_exists((&((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->cdbm), __pyx_v_buffer, __pyx_v_len);
+    goto __pyx_L5;
+  }
+  /*else*/ {
+
+    /* "tinycdb.pyx":58
+ *             rez = cdb_make_exists(&self.cdbm, buffer, len)
+ *         else:
+ *             rez = cdb_seek( self.fd, buffer, len, &dlen )             # <<<<<<<<<<<<<<
+ *         if rez < 0 :
+ *             raise CDBError("Unknown Error")
+ */
+    __pyx_v_rez = cdb_seek(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fd, __pyx_v_buffer, __pyx_v_len, (&__pyx_v_dlen));
+  }
+  __pyx_L5:;
+
+  /* "tinycdb.pyx":59
+ *         else:
+ *             rez = cdb_seek( self.fd, buffer, len, &dlen )
+ *         if rez < 0 :             # <<<<<<<<<<<<<<
+ *             raise CDBError("Unknown Error")
+ *         return rez
+ */
+  __pyx_t_2 = (__pyx_v_rez < 0);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":60
+ *             rez = cdb_seek( self.fd, buffer, len, &dlen )
+ *         if rez < 0 :
+ *             raise CDBError("Unknown Error")             # <<<<<<<<<<<<<<
+ *         return rez
+ * 
+ */
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__CDBError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "tinycdb.pyx":61
+ *         if rez < 0 :
+ *             raise CDBError("Unknown Error")
+ *         return rez             # <<<<<<<<<<<<<<
+ * 
+ *     def has_key(self, key):
+ */
+  __pyx_r = __pyx_v_rez;
+  goto __pyx_L0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("tinycdb.tinycdb.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":63
+ *         return rez
+ * 
+ *     def has_key(self, key):             # <<<<<<<<<<<<<<
+ *         return self.__contains__(key)
+ * 
+ */
+
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_1has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_1has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("has_key");
+
+  /* "tinycdb.pyx":64
+ * 
+ *     def has_key(self, key):
+ *         return self.__contains__(key)             # <<<<<<<<<<<<<<
+ * 
+ *     def __repr__(self):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s____contains__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __Pyx_INCREF(__pyx_v_key);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_key);
+  __Pyx_GIVEREF(__pyx_v_key);
+  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_r = __pyx_t_3;
+  __pyx_t_3 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("tinycdb.tinycdb.has_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":66
+ *         return self.__contains__(key)
+ * 
+ *     def __repr__(self):             # <<<<<<<<<<<<<<
+ *         return "TinyCDB('%s', '%s')" % (self.fname, chr(self.mode))
+ * 
+ */
+
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_2__repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_2__repr__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__repr__");
+
+  /* "tinycdb.pyx":67
+ * 
+ *     def __repr__(self):
+ *         return "TinyCDB('%s', '%s')" % (self.fname, chr(self.mode))             # <<<<<<<<<<<<<<
+ * 
+ *     def close(self):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyObject_Call(__pyx_builtin_chr, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+  __Pyx_INCREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  __Pyx_GIVEREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
+  __Pyx_GIVEREF(__pyx_t_1);
+  __pyx_t_1 = 0;
+  __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
+  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+  __pyx_r = ((PyObject *)__pyx_t_1);
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("tinycdb.tinycdb.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":69
+ *         return "TinyCDB('%s', '%s')" % (self.fname, chr(self.mode))
+ * 
+ *     def close(self):             # <<<<<<<<<<<<<<
+ *         if self.fd: close( self.fd )
+ * 
+ */
+
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_3close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("close");
+
+  /* "tinycdb.pyx":70
+ * 
+ *     def close(self):
+ *         if self.fd: close( self.fd )             # <<<<<<<<<<<<<<
+ * 
+ * def TinyCDB(fname, mode="r"):
+ */
+  if (((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fd) {
+    close(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fd);
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":46
+ * cdef class tinycdb:
+ *     cdef int fd
+ *     cdef public char mode             # <<<<<<<<<<<<<<
+ *     cdef public fname
+ *     cdef cdb_make cdbm
+ */
+
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_4mode___get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_4mode___get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_r = __pyx_t_1;
+  __pyx_t_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_AddTraceback("tinycdb.tinycdb.mode.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_7tinycdb_7tinycdb_4mode_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pf_7tinycdb_7tinycdb_4mode_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  char __pyx_t_1;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__set__");
+  __pyx_t_1 = __Pyx_PyInt_AsChar(__pyx_v_value); if (unlikely((__pyx_t_1 == (char)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  ((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->mode = __pyx_t_1;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("tinycdb.tinycdb.mode.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":47
+ *     cdef int fd
+ *     cdef public char mode
+ *     cdef public fname             # <<<<<<<<<<<<<<
+ *     cdef cdb_make cdbm
+ *     def __contains__( self, key ) :
+ */
+
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_5fname___get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_7tinycdb_5fname___get__(PyObject *__pyx_v_self) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__get__");
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  __pyx_r = ((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_7tinycdb_7tinycdb_5fname_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pf_7tinycdb_7tinycdb_5fname_1__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__set__");
+  __Pyx_INCREF(__pyx_v_value);
+  __Pyx_GIVEREF(__pyx_v_value);
+  __Pyx_GOTREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  __Pyx_DECREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  ((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname = __pyx_v_value;
+
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+static int __pyx_pf_7tinycdb_7tinycdb_5fname_2__del__(PyObject *__pyx_v_self); /*proto*/
+static int __pyx_pf_7tinycdb_7tinycdb_5fname_2__del__(PyObject *__pyx_v_self) {
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  __Pyx_RefNannySetupContext("__del__");
+  __Pyx_INCREF(Py_None);
+  __Pyx_GIVEREF(Py_None);
+  __Pyx_GOTREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  __Pyx_DECREF(((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname);
+  ((struct __pyx_obj_7tinycdb_tinycdb *)__pyx_v_self)->fname = Py_None;
+
+  __pyx_r = 0;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":72
+ *         if self.fd: close( self.fd )
+ * 
+ * def TinyCDB(fname, mode="r"):             # <<<<<<<<<<<<<<
+ *     if mode == "r":
+ *         return read(fname)
+ */
+
+static PyObject *__pyx_pf_7tinycdb_TinyCDB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_7tinycdb_TinyCDB = {__Pyx_NAMESTR("TinyCDB"), (PyCFunction)__pyx_pf_7tinycdb_TinyCDB, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
+static PyObject *__pyx_pf_7tinycdb_TinyCDB(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fname = 0;
+  PyObject *__pyx_v_mode = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fname,&__pyx_n_s__mode,0};
+  __Pyx_RefNannySetupContext("TinyCDB");
+  __pyx_self = __pyx_self;
+  {
+    PyObject* values[2] = {0,0};
+    values[1] = ((PyObject *)__pyx_n_s__r);
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  0:
+        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fname);
+        if (likely(values[0])) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+        case  1:
+        if (kw_args > 0) {
+          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
+          if (value) { values[1] = value; kw_args--; }
+        }
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "TinyCDB") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else {
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+    }
+    __pyx_v_fname = values[0];
+    __pyx_v_mode = values[1];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("TinyCDB", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("tinycdb.TinyCDB", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+
+  /* "tinycdb.pyx":73
+ * 
+ * def TinyCDB(fname, mode="r"):
+ *     if mode == "r":             # <<<<<<<<<<<<<<
+ *         return read(fname)
+ *     return create(fname)
+ */
+  __pyx_t_1 = __Pyx_PyString_Equals(__pyx_v_mode, ((PyObject *)__pyx_n_s__r), Py_EQ); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  if (__pyx_t_1) {
+
+    /* "tinycdb.pyx":74
+ * def TinyCDB(fname, mode="r"):
+ *     if mode == "r":
+ *         return read(fname)             # <<<<<<<<<<<<<<
+ *     return create(fname)
+ * 
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __Pyx_INCREF(__pyx_v_fname);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_fname);
+    __Pyx_GIVEREF(__pyx_v_fname);
+    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7tinycdb_read)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "tinycdb.pyx":75
+ *     if mode == "r":
+ *         return read(fname)
+ *     return create(fname)             # <<<<<<<<<<<<<<
+ * 
+ * cdef class create(tinycdb):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+  __Pyx_INCREF(__pyx_v_fname);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_fname);
+  __Pyx_GIVEREF(__pyx_v_fname);
+  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_7tinycdb_create)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  __pyx_r = __pyx_t_2;
+  __pyx_t_2 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("tinycdb.TinyCDB", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":79
+ * cdef class create(tinycdb):
+ *     cdef int finished
+ *     def __init__( self, fname ) :             # <<<<<<<<<<<<<<
+ *         self.mode = 'w'
+ *         self.fname = fname
+ */
+
+static int __pyx_pf_7tinycdb_6create___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pf_7tinycdb_6create___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fname = 0;
+  int __pyx_v_rez;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fname,0};
+  __Pyx_RefNannySetupContext("__init__");
+  {
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  0:
+        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fname);
+        if (likely(values[0])) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_fname = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("tinycdb.create.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+
+  /* "tinycdb.pyx":80
+ *     cdef int finished
+ *     def __init__( self, fname ) :
+ *         self.mode = 'w'             # <<<<<<<<<<<<<<
+ *         self.fname = fname
+ *         cdef int rez
+ */
+  ((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.mode = 'w';
+
+  /* "tinycdb.pyx":81
+ *     def __init__( self, fname ) :
+ *         self.mode = 'w'
+ *         self.fname = fname             # <<<<<<<<<<<<<<
+ *         cdef int rez
+ *         self.fd = openFile( fname, 1 )
+ */
+  __Pyx_INCREF(__pyx_v_fname);
+  __Pyx_GIVEREF(__pyx_v_fname);
+  __Pyx_GOTREF(((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fname);
+  __Pyx_DECREF(((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fname);
+  ((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fname = __pyx_v_fname;
+
+  /* "tinycdb.pyx":83
+ *         self.fname = fname
+ *         cdef int rez
+ *         self.fd = openFile( fname, 1 )             # <<<<<<<<<<<<<<
+ *         rez = cdb_make_start( &self.cdbm, self.fd )
+ *         if rez != 0 :
+ */
+  __pyx_t_1 = __pyx_f_7tinycdb_openFile(__pyx_v_fname, 1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  ((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fd = __pyx_t_1;
+
+  /* "tinycdb.pyx":84
+ *         cdef int rez
+ *         self.fd = openFile( fname, 1 )
+ *         rez = cdb_make_start( &self.cdbm, self.fd )             # <<<<<<<<<<<<<<
+ *         if rez != 0 :
+ *             raise CDBError("Unknown Error")
+ */
+  __pyx_v_rez = cdb_make_start((&((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.cdbm), ((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fd);
+
+  /* "tinycdb.pyx":85
+ *         self.fd = openFile( fname, 1 )
+ *         rez = cdb_make_start( &self.cdbm, self.fd )
+ *         if rez != 0 :             # <<<<<<<<<<<<<<
+ *             raise CDBError("Unknown Error")
+ * 
+ */
+  __pyx_t_2 = (__pyx_v_rez != 0);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":86
+ *         rez = cdb_make_start( &self.cdbm, self.fd )
+ *         if rez != 0 :
+ *             raise CDBError("Unknown Error")             # <<<<<<<<<<<<<<
+ * 
+ *     def __setitem__( self, key, value ) :
+ */
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__CDBError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("tinycdb.create.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":88
+ *             raise CDBError("Unknown Error")
+ * 
+ *     def __setitem__( self, key, value ) :             # <<<<<<<<<<<<<<
+ *         cdef char *buffer1, *buffer2
+ *         cdef Py_ssize_t len1, len2
+ */
+
+static int __pyx_pf_7tinycdb_6create_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_pf_7tinycdb_6create_1__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
+  char *__pyx_v_buffer1;
+  char *__pyx_v_buffer2;
+  Py_ssize_t __pyx_v_len1;
+  Py_ssize_t __pyx_v_len2;
+  int __pyx_v_rez;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__setitem__");
+
+  /* "tinycdb.pyx":92
+ *         cdef Py_ssize_t len1, len2
+ *         cdef int rez
+ *         rez = PyString_AsStringAndSize(key, &buffer1, &len1)             # <<<<<<<<<<<<<<
+ *         rez = PyString_AsStringAndSize(value, &buffer2, &len2)
+ *         rez = cdb_make_add( &self.cdbm, buffer1, len1, buffer2, len2 )
+ */
+  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_key, (&__pyx_v_buffer1), (&__pyx_v_len1)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_rez = __pyx_t_1;
+
+  /* "tinycdb.pyx":93
+ *         cdef int rez
+ *         rez = PyString_AsStringAndSize(key, &buffer1, &len1)
+ *         rez = PyString_AsStringAndSize(value, &buffer2, &len2)             # <<<<<<<<<<<<<<
+ *         rez = cdb_make_add( &self.cdbm, buffer1, len1, buffer2, len2 )
+ *         if rez != 0 :
+ */
+  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_value, (&__pyx_v_buffer2), (&__pyx_v_len2)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_rez = __pyx_t_1;
+
+  /* "tinycdb.pyx":94
+ *         rez = PyString_AsStringAndSize(key, &buffer1, &len1)
+ *         rez = PyString_AsStringAndSize(value, &buffer2, &len2)
+ *         rez = cdb_make_add( &self.cdbm, buffer1, len1, buffer2, len2 )             # <<<<<<<<<<<<<<
+ *         if rez != 0 :
+ *             raise CDBError("Unknown Error")
+ */
+  __pyx_v_rez = cdb_make_add((&((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.cdbm), __pyx_v_buffer1, __pyx_v_len1, __pyx_v_buffer2, __pyx_v_len2);
+
+  /* "tinycdb.pyx":95
+ *         rez = PyString_AsStringAndSize(value, &buffer2, &len2)
+ *         rez = cdb_make_add( &self.cdbm, buffer1, len1, buffer2, len2 )
+ *         if rez != 0 :             # <<<<<<<<<<<<<<
+ *             raise CDBError("Unknown Error")
+ * 
+ */
+  __pyx_t_2 = (__pyx_v_rez != 0);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":96
+ *         rez = cdb_make_add( &self.cdbm, buffer1, len1, buffer2, len2 )
+ *         if rez != 0 :
+ *             raise CDBError("Unknown Error")             # <<<<<<<<<<<<<<
+ * 
+ *     def close( self ) :
+ */
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__CDBError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("tinycdb.create.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":98
+ *             raise CDBError("Unknown Error")
+ * 
+ *     def close( self ) :             # <<<<<<<<<<<<<<
+ *         if not self.finished :
+ *             self.finished = 1
+ */
+
+static PyObject *__pyx_pf_7tinycdb_6create_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_6create_2close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  __Pyx_RefNannySetupContext("close");
+
+  /* "tinycdb.pyx":99
+ * 
+ *     def close( self ) :
+ *         if not self.finished :             # <<<<<<<<<<<<<<
+ *             self.finished = 1
+ *             cdb_make_finish(&self.cdbm)
+ */
+  __pyx_t_1 = (!((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->finished);
+  if (__pyx_t_1) {
+
+    /* "tinycdb.pyx":100
+ *     def close( self ) :
+ *         if not self.finished :
+ *             self.finished = 1             # <<<<<<<<<<<<<<
+ *             cdb_make_finish(&self.cdbm)
+ * 
+ */
+    ((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->finished = 1;
+
+    /* "tinycdb.pyx":101
+ *         if not self.finished :
+ *             self.finished = 1
+ *             cdb_make_finish(&self.cdbm)             # <<<<<<<<<<<<<<
+ * 
+ *     def __dealloc__( self ) :
+ */
+    cdb_make_finish((&((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.cdbm));
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":103
+ *             cdb_make_finish(&self.cdbm)
+ * 
+ *     def __dealloc__( self ) :             # <<<<<<<<<<<<<<
+ *         if not self.finished :
+ *             self.finished = 1
+ */
+
+static void __pyx_pf_7tinycdb_6create_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pf_7tinycdb_6create_3__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  __Pyx_RefNannySetupContext("__dealloc__");
+
+  /* "tinycdb.pyx":104
+ * 
+ *     def __dealloc__( self ) :
+ *         if not self.finished :             # <<<<<<<<<<<<<<
+ *             self.finished = 1
+ *             cdb_make_finish(&self.cdbm)
+ */
+  __pyx_t_1 = (!((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->finished);
+  if (__pyx_t_1) {
+
+    /* "tinycdb.pyx":105
+ *     def __dealloc__( self ) :
+ *         if not self.finished :
+ *             self.finished = 1             # <<<<<<<<<<<<<<
+ *             cdb_make_finish(&self.cdbm)
+ *         if self.fd :
+ */
+    ((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->finished = 1;
+
+    /* "tinycdb.pyx":106
+ *         if not self.finished :
+ *             self.finished = 1
+ *             cdb_make_finish(&self.cdbm)             # <<<<<<<<<<<<<<
+ *         if self.fd :
+ *             close( self.fd )
+ */
+    cdb_make_finish((&((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.cdbm));
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
+  /* "tinycdb.pyx":107
+ *             self.finished = 1
+ *             cdb_make_finish(&self.cdbm)
+ *         if self.fd :             # <<<<<<<<<<<<<<
+ *             close( self.fd )
+ * 
+ */
+  if (((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fd) {
+
+    /* "tinycdb.pyx":108
+ *             cdb_make_finish(&self.cdbm)
+ *         if self.fd :
+ *             close( self.fd )             # <<<<<<<<<<<<<<
+ * 
+ * cdef class read(tinycdb):
+ */
+    close(((struct __pyx_obj_7tinycdb_create *)__pyx_v_self)->__pyx_base.fd);
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  __Pyx_RefNannyFinishContext();
+}
+
+/* "tinycdb.pyx":111
+ * 
+ * cdef class read(tinycdb):
+ *     def __init__( self, fname ) :             # <<<<<<<<<<<<<<
+ *         self.fd = openFile( fname, 0 )
+ *         self.mode = 'r'
+ */
+
+static int __pyx_pf_7tinycdb_4read___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pf_7tinycdb_4read___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_fname = 0;
+  int __pyx_r;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__fname,0};
+  __Pyx_RefNannySetupContext("__init__");
+  {
+    PyObject* values[1] = {0};
+    if (unlikely(__pyx_kwds)) {
+      Py_ssize_t kw_args;
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+        case  0: break;
+        default: goto __pyx_L5_argtuple_error;
+      }
+      kw_args = PyDict_Size(__pyx_kwds);
+      switch (PyTuple_GET_SIZE(__pyx_args)) {
+        case  0:
+        values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__fname);
+        if (likely(values[0])) kw_args--;
+        else goto __pyx_L5_argtuple_error;
+      }
+      if (unlikely(kw_args > 0)) {
+        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+      goto __pyx_L5_argtuple_error;
+    } else {
+      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+    }
+    __pyx_v_fname = values[0];
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("tinycdb.read.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_RefNannyFinishContext();
+  return -1;
+  __pyx_L4_argument_unpacking_done:;
+
+  /* "tinycdb.pyx":112
+ * cdef class read(tinycdb):
+ *     def __init__( self, fname ) :
+ *         self.fd = openFile( fname, 0 )             # <<<<<<<<<<<<<<
+ *         self.mode = 'r'
+ *         self.fname = fname
+ */
+  __pyx_t_1 = __pyx_f_7tinycdb_openFile(__pyx_v_fname, 0); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  ((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.fd = __pyx_t_1;
+
+  /* "tinycdb.pyx":113
+ *     def __init__( self, fname ) :
+ *         self.fd = openFile( fname, 0 )
+ *         self.mode = 'r'             # <<<<<<<<<<<<<<
+ *         self.fname = fname
+ * 
+ */
+  ((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.mode = 'r';
+
+  /* "tinycdb.pyx":114
+ *         self.fd = openFile( fname, 0 )
+ *         self.mode = 'r'
+ *         self.fname = fname             # <<<<<<<<<<<<<<
+ * 
+ *     def __getitem__( self, key ) :
+ */
+  __Pyx_INCREF(__pyx_v_fname);
+  __Pyx_GIVEREF(__pyx_v_fname);
+  __Pyx_GOTREF(((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.fname);
+  __Pyx_DECREF(((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.fname);
+  ((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.fname = __pyx_v_fname;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_AddTraceback("tinycdb.read.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = -1;
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":116
+ *         self.fname = fname
+ * 
+ *     def __getitem__( self, key ) :             # <<<<<<<<<<<<<<
+ *         cdef char *buffer
+ *         cdef Py_ssize_t len
+ */
+
+static PyObject *__pyx_pf_7tinycdb_4read_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
+static PyObject *__pyx_pf_7tinycdb_4read_1__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
+  char *__pyx_v_buffer;
+  Py_ssize_t __pyx_v_len;
+  int __pyx_v_rez;
+  unsigned int __pyx_v_dlen;
+  PyObject *__pyx_v_ret = 0;
+  PyObject *__pyx_r = NULL;
+  __Pyx_RefNannyDeclarations
+  int __pyx_t_1;
+  int __pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__getitem__");
+
+  /* "tinycdb.pyx":122
+ *         cdef unsigned int dlen
+ *         cdef object ret
+ *         rez = PyString_AsStringAndSize(key, &buffer, &len)             # <<<<<<<<<<<<<<
+ *         rez = cdb_seek( self.fd, buffer, len, &dlen )
+ *         if rez < 0 :
+ */
+  __pyx_t_1 = PyString_AsStringAndSize(__pyx_v_key, (&__pyx_v_buffer), (&__pyx_v_len)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_rez = __pyx_t_1;
+
+  /* "tinycdb.pyx":123
+ *         cdef object ret
+ *         rez = PyString_AsStringAndSize(key, &buffer, &len)
+ *         rez = cdb_seek( self.fd, buffer, len, &dlen )             # <<<<<<<<<<<<<<
+ *         if rez < 0 :
+ *             raise CDBError("Unknown Error")
+ */
+  __pyx_v_rez = cdb_seek(((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.fd, __pyx_v_buffer, __pyx_v_len, (&__pyx_v_dlen));
+
+  /* "tinycdb.pyx":124
+ *         rez = PyString_AsStringAndSize(key, &buffer, &len)
+ *         rez = cdb_seek( self.fd, buffer, len, &dlen )
+ *         if rez < 0 :             # <<<<<<<<<<<<<<
+ *             raise CDBError("Unknown Error")
+ *         if rez == 0 :
+ */
+  __pyx_t_2 = (__pyx_v_rez < 0);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":125
+ *         rez = cdb_seek( self.fd, buffer, len, &dlen )
+ *         if rez < 0 :
+ *             raise CDBError("Unknown Error")             # <<<<<<<<<<<<<<
+ *         if rez == 0 :
+ *             raise KeyError("Key \'%s\' not found"%key)
+ */
+    __pyx_t_3 = __Pyx_GetName(__pyx_m, __pyx_n_s__CDBError); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L5;
+  }
+  __pyx_L5:;
+
+  /* "tinycdb.pyx":126
+ *         if rez < 0 :
+ *             raise CDBError("Unknown Error")
+ *         if rez == 0 :             # <<<<<<<<<<<<<<
+ *             raise KeyError("Key \'%s\' not found"%key)
+ *         buffer = <char *>PyMem_Malloc(dlen)
+ */
+  __pyx_t_2 = (__pyx_v_rez == 0);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":127
+ *             raise CDBError("Unknown Error")
+ *         if rez == 0 :
+ *             raise KeyError("Key \'%s\' not found"%key)             # <<<<<<<<<<<<<<
+ *         buffer = <char *>PyMem_Malloc(dlen)
+ *         if buffer == NULL :
+ */
+    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_v_key); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
+    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
+    __pyx_t_4 = 0;
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_KeyError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  /* "tinycdb.pyx":128
+ *         if rez == 0 :
+ *             raise KeyError("Key \'%s\' not found"%key)
+ *         buffer = <char *>PyMem_Malloc(dlen)             # <<<<<<<<<<<<<<
+ *         if buffer == NULL :
+ *             raise MemoryError("malloc() failed")
+ */
+  __pyx_v_buffer = ((char *)PyMem_Malloc(__pyx_v_dlen));
+
+  /* "tinycdb.pyx":129
+ *             raise KeyError("Key \'%s\' not found"%key)
+ *         buffer = <char *>PyMem_Malloc(dlen)
+ *         if buffer == NULL :             # <<<<<<<<<<<<<<
+ *             raise MemoryError("malloc() failed")
+ *         rez = cdb_bread( self.fd, buffer, dlen )
+ */
+  __pyx_t_2 = (__pyx_v_buffer == NULL);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":130
+ *         buffer = <char *>PyMem_Malloc(dlen)
+ *         if buffer == NULL :
+ *             raise MemoryError("malloc() failed")             # <<<<<<<<<<<<<<
+ *         rez = cdb_bread( self.fd, buffer, dlen )
+ *         if rez == 0 :
+ */
+    __pyx_t_4 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L7;
+  }
+  __pyx_L7:;
+
+  /* "tinycdb.pyx":131
+ *         if buffer == NULL :
+ *             raise MemoryError("malloc() failed")
+ *         rez = cdb_bread( self.fd, buffer, dlen )             # <<<<<<<<<<<<<<
+ *         if rez == 0 :
+ *             ret = PyString_FromStringAndSize( buffer, dlen )
+ */
+  __pyx_v_rez = cdb_bread(((struct __pyx_obj_7tinycdb_read *)__pyx_v_self)->__pyx_base.fd, __pyx_v_buffer, __pyx_v_dlen);
+
+  /* "tinycdb.pyx":132
+ *             raise MemoryError("malloc() failed")
+ *         rez = cdb_bread( self.fd, buffer, dlen )
+ *         if rez == 0 :             # <<<<<<<<<<<<<<
+ *             ret = PyString_FromStringAndSize( buffer, dlen )
+ *             PyMem_Free(buffer)
+ */
+  __pyx_t_2 = (__pyx_v_rez == 0);
+  if (__pyx_t_2) {
+
+    /* "tinycdb.pyx":133
+ *         rez = cdb_bread( self.fd, buffer, dlen )
+ *         if rez == 0 :
+ *             ret = PyString_FromStringAndSize( buffer, dlen )             # <<<<<<<<<<<<<<
+ *             PyMem_Free(buffer)
+ *             return ret
+ */
+    __pyx_t_4 = PyString_FromStringAndSize(__pyx_v_buffer, __pyx_v_dlen); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __pyx_v_ret = __pyx_t_4;
+    __pyx_t_4 = 0;
+
+    /* "tinycdb.pyx":134
+ *         if rez == 0 :
+ *             ret = PyString_FromStringAndSize( buffer, dlen )
+ *             PyMem_Free(buffer)             # <<<<<<<<<<<<<<
+ *             return ret
+ *         PyMem_Free(buffer)
+ */
+    PyMem_Free(__pyx_v_buffer);
+
+    /* "tinycdb.pyx":135
+ *             ret = PyString_FromStringAndSize( buffer, dlen )
+ *             PyMem_Free(buffer)
+ *             return ret             # <<<<<<<<<<<<<<
+ *         PyMem_Free(buffer)
+ *         raise CDBError("Unknown Error")
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __Pyx_INCREF(__pyx_v_ret);
+    __pyx_r = __pyx_v_ret;
+    goto __pyx_L0;
+    goto __pyx_L8;
+  }
+  __pyx_L8:;
+
+  /* "tinycdb.pyx":136
+ *             PyMem_Free(buffer)
+ *             return ret
+ *         PyMem_Free(buffer)             # <<<<<<<<<<<<<<
+ *         raise CDBError("Unknown Error")
+ * 
+ */
+  PyMem_Free(__pyx_v_buffer);
+
+  /* "tinycdb.pyx":137
+ *             return ret
+ *         PyMem_Free(buffer)
+ *         raise CDBError("Unknown Error")             # <<<<<<<<<<<<<<
+ * 
+ *     def __dealloc__( self ) :
+ */
+  __pyx_t_4 = __Pyx_GetName(__pyx_m, __pyx_n_s__CDBError); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_4);
+  __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_3);
+  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_AddTraceback("tinycdb.read.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XDECREF(__pyx_v_ret);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_RefNannyFinishContext();
+  return __pyx_r;
+}
+
+/* "tinycdb.pyx":139
+ *         raise CDBError("Unknown Error")
+ * 
+ *     def __dealloc__( self ) :             # <<<<<<<<<<<<<<
+ *         self.close()
+ */
+
+static void __pyx_pf_7tinycdb_4read_2__dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_pf_7tinycdb_4read_2__dealloc__(PyObject *__pyx_v_self) {
+  __Pyx_RefNannyDeclarations
+  PyObject *__pyx_t_1 = NULL;
+  PyObject *__pyx_t_2 = NULL;
+  int __pyx_lineno = 0;
+  const char *__pyx_filename = NULL;
+  int __pyx_clineno = 0;
+  __Pyx_RefNannySetupContext("__dealloc__");
+
+  /* "tinycdb.pyx":140
+ * 
+ *     def __dealloc__( self ) :
+ *         self.close()             # <<<<<<<<<<<<<<
+ */
+  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_s__close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_1);
+  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_t_2);
+  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_t_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_AddTraceback("tinycdb.read.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __pyx_L0:;
+  __Pyx_RefNannyFinishContext();
+}
+
+static PyObject *__pyx_tp_new_7tinycdb_tinycdb(PyTypeObject *t, PyObject *a, PyObject *k) {
+  struct __pyx_obj_7tinycdb_tinycdb *p;
+  PyObject *o = (*t->tp_alloc)(t, 0);
+  if (!o) return 0;
+  p = ((struct __pyx_obj_7tinycdb_tinycdb *)o);
+  p->fname = Py_None; Py_INCREF(Py_None);
+  return o;
+}
+
+static void __pyx_tp_dealloc_7tinycdb_tinycdb(PyObject *o) {
+  struct __pyx_obj_7tinycdb_tinycdb *p = (struct __pyx_obj_7tinycdb_tinycdb *)o;
+  Py_XDECREF(p->fname);
+  (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_7tinycdb_tinycdb(PyObject *o, visitproc v, void *a) {
+  int e;
+  struct __pyx_obj_7tinycdb_tinycdb *p = (struct __pyx_obj_7tinycdb_tinycdb *)o;
+  if (p->fname) {
+    e = (*v)(p->fname, a); if (e) return e;
+  }
+  return 0;
+}
+
+static int __pyx_tp_clear_7tinycdb_tinycdb(PyObject *o) {
+  struct __pyx_obj_7tinycdb_tinycdb *p = (struct __pyx_obj_7tinycdb_tinycdb *)o;
+  PyObject* tmp;
+  tmp = ((PyObject*)p->fname);
+  p->fname = Py_None; Py_INCREF(Py_None);
+  Py_XDECREF(tmp);
+  return 0;
+}
+
+static PyObject *__pyx_getprop_7tinycdb_7tinycdb_mode(PyObject *o, void *x) {
+  return __pyx_pf_7tinycdb_7tinycdb_4mode___get__(o);
+}
+
+static int __pyx_setprop_7tinycdb_7tinycdb_mode(PyObject *o, PyObject *v, void *x) {
+  if (v) {
+    return __pyx_pf_7tinycdb_7tinycdb_4mode_1__set__(o, v);
+  }
+  else {
+    PyErr_SetString(PyExc_NotImplementedError, "__del__");
+    return -1;
+  }
+}
+
+static PyObject *__pyx_getprop_7tinycdb_7tinycdb_fname(PyObject *o, void *x) {
+  return __pyx_pf_7tinycdb_7tinycdb_5fname___get__(o);
+}
+
+static int __pyx_setprop_7tinycdb_7tinycdb_fname(PyObject *o, PyObject *v, void *x) {
+  if (v) {
+    return __pyx_pf_7tinycdb_7tinycdb_5fname_1__set__(o, v);
+  }
+  else {
+    return __pyx_pf_7tinycdb_7tinycdb_5fname_2__del__(o);
+  }
+}
+
+static PyMethodDef __pyx_methods_7tinycdb_tinycdb[] = {
+  {__Pyx_NAMESTR("has_key"), (PyCFunction)__pyx_pf_7tinycdb_7tinycdb_1has_key, METH_O, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_7tinycdb_7tinycdb_3close, METH_NOARGS, __Pyx_DOCSTR(0)},
+  {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_7tinycdb_tinycdb[] = {
+  {(char *)"mode", __pyx_getprop_7tinycdb_7tinycdb_mode, __pyx_setprop_7tinycdb_7tinycdb_mode, 0, 0},
+  {(char *)"fname", __pyx_getprop_7tinycdb_7tinycdb_fname, __pyx_setprop_7tinycdb_7tinycdb_fname, 0, 0},
+  {0, 0, 0, 0, 0}
+};
+
+static PyNumberMethods __pyx_tp_as_number_tinycdb = {
+  0, /*nb_add*/
+  0, /*nb_subtract*/
+  0, /*nb_multiply*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*nb_divide*/
+  #endif
+  0, /*nb_remainder*/
+  0, /*nb_divmod*/
+  0, /*nb_power*/
+  0, /*nb_negative*/
+  0, /*nb_positive*/
+  0, /*nb_absolute*/
+  0, /*nb_nonzero*/
+  0, /*nb_invert*/
+  0, /*nb_lshift*/
+  0, /*nb_rshift*/
+  0, /*nb_and*/
+  0, /*nb_xor*/
+  0, /*nb_or*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*nb_coerce*/
+  #endif
+  0, /*nb_int*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*nb_long*/
+  #else
+  0, /*reserved*/
+  #endif
+  0, /*nb_float*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*nb_oct*/
+  #endif
+  #if PY_MAJOR_VERSION < 3
+  0, /*nb_hex*/
+  #endif
+  0, /*nb_inplace_add*/
+  0, /*nb_inplace_subtract*/
+  0, /*nb_inplace_multiply*/
+  #if PY_MAJOR_VERSION < 3
+  0, /*nb_inplace_divide*/
+  #endif
+  0, /*nb_inplace_remainder*/
+  0, /*nb_inplace_power*/
+  0, /*nb_inplace_lshift*/
+  0, /*nb_inplace_rshift*/
+  0, /*nb_inplace_and*/
+  0, /*nb_inplace_xor*/
+  0, /*nb_inplace_or*/
+  0, /*nb_floor_divide*/
+  0, /*nb_true_divide*/
+  0, /*nb_inplace_floor_divide*/
+  0, /*nb_inplace_true_divide*/
+  #if PY_VERSION_HEX >= 0x02050000
+  0, /*nb_index*/
+  #endif
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_tinycdb = {
+  0, /*sq_length*/
+  0, /*sq_concat*/
+  0, /*sq_repeat*/
+  0, /*sq_item*/
+  0, /*sq_slice*/
+  0, /*sq_ass_item*/
+  0, /*sq_ass_slice*/
+  __pyx_pf_7tinycdb_7tinycdb___contains__, /*sq_contains*/
+  0, /*sq_inplace_concat*/
+  0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_tinycdb = {
+  0, /*mp_length*/