[dots] Include a local copy of louisxml python bindings



commit 65fd8ae2f8c1d73ca3d88b132ad74ecac678c986
Author: Fernando Herrera <fherrera onirica com>
Date:   Wed Sep 8 17:16:47 2010 +0200

    Include a local copy of louisxml python bindings
    
    This should make life easier for packagers so they don't have
    to patch liblouisxml to include python bindings as they are
    included here. Notice that even liblouisxml svn version does
    not install those binding so there should not be conflict.

 INSTALL              |    7 -
 Makefile.am          |    2 +-
 configure.ac         |    5 +-
 louisxml/Makefile.am |    8 +
 louisxml/louisxml.c  | 2612 ++++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 2625 insertions(+), 9 deletions(-)
---
diff --git a/INSTALL b/INSTALL
index 6d32071..93faa28 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,13 +2,6 @@ To compile this software you need:
 
 * liblouis >= 1.6.2
 * liblouisxml >= 2.1.0
-* python bindings for liblouisxml
-
-In order to install python bindings for liblouisxml you need to patch
-liblouisxml 2.1.0 of svn trunk with patch included on the source dir:
-
-cd /path/to/liblouis-xml-2.1.0
-cat /path/to/dots/liblouisxml-install-python.patch | patch -p 0
 
 
 
diff --git a/Makefile.am b/Makefile.am
index 61d3eaf..fb6a87b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = bin dots data po help
+SUBDIRS = louisxml bin dots data po help
 
 EXTRA_DIST = m4/python.m4
diff --git a/configure.ac b/configure.ac
index 8a1a96e..2f9cee7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,7 @@
 AC_INIT(dots, 0.0.2, fherrera onirica com)
 AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE
+AC_PROG_LIBTOOL
 GNOME_DOC_INIT
 
 dnl == check for python ==
@@ -10,9 +11,10 @@ dnl == Check for liblouis and liblouisxml
 PKG_CHECK_MODULES(LIBLOUIS, [liblouis >= 1.6.2 liblouisxml >= 2.1.0])
 
 dnl == check for python modules ==
-AM_CHECK_PYMOD(louisxml,translateString, [], AC_MSG_ERROR([You need python bindings for liblouisxml file. Please read the INSTALL file.]))
 AM_CHECK_PYMOD(odf.odf2xhtml, ODF2XHTML, [], AC_MSG_ERROR([You need pyodf python package. Please read the INSTALL file.]))
 
+AM_CHECK_PYTHON_HEADERS([], AC_MSG_ERROR([You need python development package to build louixml extension]))
+
 
 dnl Find tables dir
 TABLES_DIR=`pkg-config --variable=tablesdir liblouis`
@@ -34,6 +36,7 @@ AM_GCONF_SOURCE_2
 dnl == generate makefiles ==
 AC_OUTPUT([
 Makefile
+louisxml/Makefile
 bin/Makefile
 bin/dots
 dots/Makefile
diff --git a/louisxml/Makefile.am b/louisxml/Makefile.am
new file mode 100644
index 0000000..f42d04a
--- /dev/null
+++ b/louisxml/Makefile.am
@@ -0,0 +1,8 @@
+INCLUDES = $(PYTHON_INCLUDES)
+
+pyexec_LTLIBRARIES = louisxml.la
+
+louisxml_la_LDFLAGS = -module -avoid-version 
+louisxml_la_CFLAGS = $(LIBLOUIS_CFLAGS)
+louisxml_la_LIBADD = $(LIBLOUIS_LIBS)
+louisxml_la_SOURCES = louisxml.c
diff --git a/louisxml/louisxml.c b/louisxml/louisxml.c
new file mode 100644
index 0000000..f293244
--- /dev/null
+++ b/louisxml/louisxml.c
@@ -0,0 +1,2612 @@
+/* Generated by Cython 0.11.3 on Wed Nov 25 18:42:23 2009 */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "structmember.h"
+#ifndef Py_PYTHON_H
+    #error Python headers needed to compile C extensions, please install development version of Python.
+#else
+#ifndef PY_LONG_LONG
+  #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef DL_EXPORT
+  #define DL_EXPORT(t) t
+#endif
+#if PY_VERSION_HEX < 0x02040000
+  #define METH_COEXIST 0
+  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
+#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)   PyInt_AsLong(o)
+  #define PyNumber_Index(o)    PyNumber_Int(o)
+  #define PyIndex_Check(o)     PyNumber_Check(o)
+#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 PyString_Type                PyBytes_Type
+  #define PyString_CheckExact          PyBytes_CheckExact
+  #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
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
+#else
+  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
+  #define PyBytes_Type                 PyString_Type
+#endif
+#if PY_MAJOR_VERSION >= 3
+  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+  #ifndef __fastcall
+    #define __fastcall
+  #endif
+#else
+  #define _USE_MATH_DEFINES
+#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
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+#include <math.h>
+#define __PYX_HAVE_API__louisxml
+#include "liblouisxml.h"
+#include "stdlib.h"
+#define __PYX_USE_C99_COMPLEX defined(_Complex_I)
+
+
+#ifdef __GNUC__
+#define INLINE __inline__
+#elif _WIN32
+#define INLINE __inline
+#else
+#define INLINE 
+#endif
+
+typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/
+
+
+
+static int __pyx_skip_dispatch = 0;
+
+
+/* Type Conversion Predeclarations */
+
+#if PY_MAJOR_VERSION < 3
+#define __Pyx_PyBytes_FromString          PyString_FromString
+#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
+#define __Pyx_PyBytes_AsString            PyString_AsString
+#else
+#define __Pyx_PyBytes_FromString          PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
+#define __Pyx_PyBytes_AsString            PyBytes_AsString
+#endif
+
+#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
+#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))
+
+#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
+static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
+
+#if !defined(T_PYSSIZET)
+#if PY_VERSION_HEX < 0x02050000
+#define T_PYSSIZET T_INT
+#elif !defined(T_LONGLONG)
+#define T_PYSSIZET \
+        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
+        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
+#else
+#define T_PYSSIZET \
+        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
+        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
+        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
+#endif
+#endif
+
+
+#if !defined(T_ULONGLONG)
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
+#else
+#define __Pyx_T_UNSIGNED_INT(x) \
+        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
+        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
+        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
+        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
+        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
+#endif
+#if !defined(T_LONGLONG)
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
+#else
+#define __Pyx_T_SIGNED_INT(x) \
+        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
+        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
+        ((sizeof(x) == sizeof(int))   ? T_INT : \
+        ((sizeof(x) == sizeof(long))  ? T_LONG : \
+        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
+#endif
+
+#define __Pyx_T_FLOATING(x) \
+        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
+        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))
+
+#if !defined(T_SIZET)
+#if !defined(T_ULONGLONG)
+#define T_SIZET \
+        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
+        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
+#else
+#define T_SIZET \
+        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
+        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
+        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
+#endif
+#endif
+
+static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+static 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;
+
+static char __pyx_mdoc[] = "Python bindings for liblouisxml\n\nThis module contains the python bindings for the liblouisxml Braille\ntranslation library. While there are docstrings to help you use this\nmodule, you are advised to view the official liblouisxml documentation.\n\nThese bindings intend to be as close to the original calls for liblouisxml\nonly making changes to the API where it simplifies the use in python.\n\n";
+
+
+#ifdef 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* (*NewContext)(const char*, int, const char*);
+  void (*FinishContext)(void**);
+} __Pyx_RefnannyAPIStruct;
+static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
+#define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
+#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
+#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
+#define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
+#define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
+#else
+#define __Pyx_INCREF(r) Py_INCREF(r)
+#define __Pyx_DECREF(r) Py_DECREF(r)
+#define __Pyx_GOTREF(r)
+#define __Pyx_GIVEREF(r)
+#define __Pyx_XDECREF(r) Py_XDECREF(r)
+#define __Pyx_SetupRefcountContext(name)
+#define __Pyx_FinishRefcountContext()
+#endif /* CYTHON_REFNANNY */
+#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
+#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)
+
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name, PyObject* kw_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 int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/
+
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, const char *modname); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
+
+static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
+
+static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
+
+static INLINE char __Pyx_PyInt_AsChar(PyObject *);
+
+static INLINE short __Pyx_PyInt_AsShort(PyObject *);
+
+static INLINE int __Pyx_PyInt_AsInt(PyObject *);
+
+static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
+
+static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
+
+static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
+
+static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
+
+static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
+
+static INLINE long __Pyx_PyInt_AsLong(PyObject *);
+
+static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
+
+static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
+
+static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
+
+static void __Pyx_AddTraceback(const char *funcname); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+/* Type declarations */
+/* Module declarations from python_version */
+
+/* Module declarations from stdlib */
+
+/* Module declarations from louisxml */
+
+static char *__pyx_v_8louisxml_lbx_encoding;
+static PyObject *__pyx_f_8louisxml_get_unicode(widechar *, int); /*proto*/
+#define __Pyx_MODULE_NAME "louisxml"
+int __pyx_module_is_main_louisxml = 0;
+
+/* Implementation of louisxml */
+static char __pyx_k___main__[] = "__main__";
+static PyObject *__pyx_kp___main__;
+static char __pyx_k_configFileName[] = "configFileName";
+static PyObject *__pyx_kp_configFileName;
+static char __pyx_k_logFileName[] = "logFileName";
+static PyObject *__pyx_kp_logFileName;
+static char __pyx_k_settingsString[] = "settingsString";
+static PyObject *__pyx_kp_settingsString;
+static char __pyx_k_inbuf[] = "inbuf";
+static PyObject *__pyx_kp_inbuf;
+static char __pyx_k_mode[] = "mode";
+static PyObject *__pyx_kp_mode;
+static char __pyx_k_infile[] = "infile";
+static PyObject *__pyx_kp_infile;
+static char __pyx_k_outfile[] = "outfile";
+static PyObject *__pyx_kp_outfile;
+static char __pyx_k_configFileList[] = "configFileList";
+static PyObject *__pyx_kp_configFileList;
+static char __pyx_k_1[] = "utf_16_le";
+static PyObject *__pyx_kp_1;
+static char __pyx_k_2[] = "utf_32_le";
+static PyObject *__pyx_kp_2;
+static char __pyx_k_PyICU[] = "PyICU";
+static PyObject *__pyx_kp_PyICU;
+static char __pyx_k_LouisXMLException[] = "LouisXMLException";
+static PyObject *__pyx_kp_LouisXMLException;
+static char __pyx_k_Exception[] = "Exception";
+static PyObject *__pyx_kp_Exception;
+static char __pyx_k_UnicodeString[] = "UnicodeString";
+static PyObject *__pyx_kp_UnicodeString;
+static char __pyx_k_encode[] = "encode";
+static PyObject *__pyx_kp_encode;
+static char __pyx_k_3[] = "ascii";
+static PyObject *__pyx_kp_3;
+static char __pyx_k_ValueError[] = "ValueError";
+static PyObject *__pyx_kp_ValueError;
+static PyObject *__pyx_builtin_Exception;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_kp_4;
+static PyObject *__pyx_kp_5;
+static char __pyx_k_4[] = "";
+static char __pyx_k_5[] = "Requires text input but got %s";
+static PyObject *__pyx_kp_6;
+static char __pyx_k_6[] = "Unable to complete translation";
+static PyObject *__pyx_kp_7;
+static char __pyx_k_7[] = "Unable to complete translation";
+static PyObject *__pyx_kp_8;
+static char __pyx_k_8[] = "Unable to complete translation";
+static PyObject *__pyx_kp_9;
+static char __pyx_k_9[] = "Unable to complete back translation";
+
+/* "/home/mike/pylouisxml/louisxml.pyx":37
+ * if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ *     import PyICU
+ * cdef object get_unicode(widechar* buftxt, int buflen):             # <<<<<<<<<<<<<<
+ *     if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ *         tmp_unicode = PyICU.UnicodeString((<char *>buftxt)[:buflen],
+ */
+
+static  PyObject *__pyx_f_8louisxml_get_unicode(widechar *__pyx_v_buftxt, int __pyx_v_buflen) {
+  PyObject *__pyx_v_tmp_unicode;
+  PyObject *__pyx_v_tmp_str;
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_1 = 0;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  __Pyx_SetupRefcountContext("get_unicode");
+  __pyx_v_tmp_unicode = Py_None; __Pyx_INCREF(Py_None);
+  __pyx_v_tmp_str = Py_None; __Pyx_INCREF(Py_None);
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":38
+ *     import PyICU
+ * cdef object get_unicode(widechar* buftxt, int buflen):
+ *     if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:             # <<<<<<<<<<<<<<
+ *         tmp_unicode = PyICU.UnicodeString((<char *>buftxt)[:buflen],
+ *                                          lbx_encoding.encode("ascii"))
+ */
+  if ((PY_MAJOR_VERSION == 2)) {
+    __pyx_t_1 = (PY_MINOR_VERSION < 6);
+  } else {
+    __pyx_t_1 = (PY_MAJOR_VERSION == 2);
+  }
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":39
+ * cdef object get_unicode(widechar* buftxt, int buflen):
+ *     if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ *         tmp_unicode = PyICU.UnicodeString((<char *>buftxt)[:buflen],             # <<<<<<<<<<<<<<
+ *                                          lbx_encoding.encode("ascii"))
+ *         return unicode(tmp_unicode)
+ */
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_PyICU); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_1);
+    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_UnicodeString); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+    __pyx_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buftxt) + 0, __pyx_v_buflen - 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_1));
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":40
+ *     if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ *         tmp_unicode = PyICU.UnicodeString((<char *>buftxt)[:buflen],
+ *                                          lbx_encoding.encode("ascii"))             # <<<<<<<<<<<<<<
+ *         return unicode(tmp_unicode)
+ *     else:
+ */
+    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_8louisxml_lbx_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_4 = PyObject_GetAttr(__pyx_t_3, __pyx_kp_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_4);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __Pyx_INCREF(__pyx_kp_3);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_3);
+    __Pyx_GIVEREF(__pyx_kp_3);
+    __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_1));
+    __Pyx_GIVEREF(((PyObject *)__pyx_1));
+    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
+    __Pyx_GIVEREF(__pyx_t_5);
+    __pyx_1 = 0;
+    __pyx_t_5 = 0;
+    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __Pyx_DECREF(__pyx_v_tmp_unicode);
+    __pyx_v_tmp_unicode = __pyx_t_5;
+    __pyx_t_5 = 0;
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":41
+ *         tmp_unicode = PyICU.UnicodeString((<char *>buftxt)[:buflen],
+ *                                          lbx_encoding.encode("ascii"))
+ *         return unicode(tmp_unicode)             # <<<<<<<<<<<<<<
+ *     else:
+ *         tmp_str = (<char *>buftxt)[:buflen]
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __Pyx_INCREF(__pyx_v_tmp_unicode);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tmp_unicode);
+    __Pyx_GIVEREF(__pyx_v_tmp_unicode);
+    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+    goto __pyx_L3;
+  }
+  /*else*/ {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":43
+ *         return unicode(tmp_unicode)
+ *     else:
+ *         tmp_str = (<char *>buftxt)[:buflen]             # <<<<<<<<<<<<<<
+ *         return unicode(tmp_str, lbx_encoding)
+ * 
+ */
+    __pyx_1 = __Pyx_PyBytes_FromStringAndSize(((char *)__pyx_v_buftxt) + 0, __pyx_v_buflen - 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_1));
+    __Pyx_DECREF(__pyx_v_tmp_str);
+    __pyx_v_tmp_str = ((PyObject *)__pyx_1);
+    __pyx_1 = 0;
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":44
+ *     else:
+ *         tmp_str = (<char *>buftxt)[:buflen]
+ *         return unicode(tmp_str, lbx_encoding)             # <<<<<<<<<<<<<<
+ * 
+ * class LouisXMLException(Exception):
+ */
+    __Pyx_XDECREF(__pyx_r);
+    __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_8louisxml_lbx_encoding); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
+    __Pyx_INCREF(__pyx_v_tmp_str);
+    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_tmp_str);
+    __Pyx_GIVEREF(__pyx_v_tmp_str);
+    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)&PyUnicode_Type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
+    __pyx_r = __pyx_t_3;
+    __pyx_t_3 = 0;
+    goto __pyx_L0;
+  }
+  __pyx_L3:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("louisxml.get_unicode");
+  __pyx_r = 0;
+  __pyx_L0:;
+  __Pyx_DECREF(__pyx_v_tmp_unicode);
+  __Pyx_DECREF(__pyx_v_tmp_str);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":49
+ *     pass
+ * 
+ * def version():             # <<<<<<<<<<<<<<
+ *     return lbx_version()
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_version(PyObject *__pyx_self, PyObject *unused); /*proto*/
+static PyObject *__pyx_pf_8louisxml_version(PyObject *__pyx_self, PyObject *unused) {
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_t_1 = NULL;
+  __Pyx_SetupRefcountContext("version");
+  __pyx_self = __pyx_self;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":50
+ * 
+ * def version():
+ *     return lbx_version()             # <<<<<<<<<<<<<<
+ * 
+ * def initialize(configFileName, logFileName, settingsString):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __pyx_t_1 = __Pyx_PyBytes_FromString(lbx_version()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __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("louisxml.version");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":52
+ *     return lbx_version()
+ * 
+ * def initialize(configFileName, logFileName, settingsString):             # <<<<<<<<<<<<<<
+ *     """Initialise liblouisxml
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_initialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_8louisxml_initialize[] = "Initialise liblouisxml\n    \n    This function will initialise liblouisxml by calling the lou_initialize\n    with the arguments you provide.\n\n    Please note: This function need not be called unless you need to set\n    something special such as a log file.\n    ";
+static PyObject *__pyx_pf_8louisxml_initialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_configFileName = 0;
+  PyObject *__pyx_v_logFileName = 0;
+  PyObject *__pyx_v_settingsString = 0;
+  PyObject *__pyx_v_logFileNameBytes;
+  char *__pyx_v_c_logFileName;
+  PyObject *__pyx_r = NULL;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  char *__pyx_t_4;
+  int __pyx_t_5;
+  char *__pyx_t_6;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_configFileName,&__pyx_kp_logFileName,&__pyx_kp_settingsString,0};
+  __Pyx_SetupRefcountContext("initialize");
+  __pyx_self = __pyx_self;
+  if (unlikely(__pyx_kwds)) {
+    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+    PyObject* values[3] = {0,0,0};
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      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;
+    }
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  0:
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_configFileName);
+      if (likely(values[0])) kw_args--;
+      else goto __pyx_L5_argtuple_error;
+      case  1:
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_logFileName);
+      if (likely(values[1])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("initialize", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  2:
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_settingsString);
+      if (likely(values[2])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("initialize", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    }
+    if (unlikely(kw_args > 0)) {
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "initialize") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    }
+    __pyx_v_configFileName = values[0];
+    __pyx_v_logFileName = values[1];
+    __pyx_v_settingsString = values[2];
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+    goto __pyx_L5_argtuple_error;
+  } else {
+    __pyx_v_configFileName = PyTuple_GET_ITEM(__pyx_args, 0);
+    __pyx_v_logFileName = PyTuple_GET_ITEM(__pyx_args, 1);
+    __pyx_v_settingsString = PyTuple_GET_ITEM(__pyx_args, 2);
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("initialize", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("louisxml.initialize");
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_v_logFileNameBytes = Py_None; __Pyx_INCREF(Py_None);
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":61
+ *     something special such as a log file.
+ *     """
+ *     logFileNameBytes = ""             # <<<<<<<<<<<<<<
+ *     cdef char *c_logFileName
+ *     if isinstance(logFileName, unicode):
+ */
+  __Pyx_INCREF(__pyx_kp_4);
+  __Pyx_DECREF(__pyx_v_logFileNameBytes);
+  __pyx_v_logFileNameBytes = __pyx_kp_4;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":63
+ *     logFileNameBytes = ""
+ *     cdef char *c_logFileName
+ *     if isinstance(logFileName, unicode):             # <<<<<<<<<<<<<<
+ *         logFileNameBytes = logFileName.encode()
+ *         c_logFileName = logFileNameBytes
+ */
+  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_logFileName, ((PyTypeObject *)((PyObject*)&PyUnicode_Type))); 
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":64
+ *     cdef char *c_logFileName
+ *     if isinstance(logFileName, unicode):
+ *         logFileNameBytes = logFileName.encode()             # <<<<<<<<<<<<<<
+ *         c_logFileName = logFileNameBytes
+ *     elif (PY_MAJOR_VERSION < 3) and isinstance(logFileName, str):
+ */
+    __pyx_t_2 = PyObject_GetAttr(__pyx_v_logFileName, __pyx_kp_encode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), 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_2); __pyx_t_2 = 0;
+    __Pyx_DECREF(__pyx_v_logFileNameBytes);
+    __pyx_v_logFileNameBytes = __pyx_t_3;
+    __pyx_t_3 = 0;
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":65
+ *     if isinstance(logFileName, unicode):
+ *         logFileNameBytes = logFileName.encode()
+ *         c_logFileName = logFileNameBytes             # <<<<<<<<<<<<<<
+ *     elif (PY_MAJOR_VERSION < 3) and isinstance(logFileName, str):
+ *         c_logFileName = configFileName
+ */
+    __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_logFileNameBytes); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_c_logFileName = __pyx_t_4;
+    goto __pyx_L6;
+  }
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":66
+ *         logFileNameBytes = logFileName.encode()
+ *         c_logFileName = logFileNameBytes
+ *     elif (PY_MAJOR_VERSION < 3) and isinstance(logFileName, str):             # <<<<<<<<<<<<<<
+ *         c_logFileName = configFileName
+ *     elif logFileName is None:
+ */
+  if ((PY_MAJOR_VERSION < 3)) {
+    __pyx_t_1 = PyObject_TypeCheck(__pyx_v_logFileName, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
+    __pyx_t_5 = __pyx_t_1;
+  } else {
+    __pyx_t_5 = (PY_MAJOR_VERSION < 3);
+  }
+  if (__pyx_t_5) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":67
+ *         c_logFileName = logFileNameBytes
+ *     elif (PY_MAJOR_VERSION < 3) and isinstance(logFileName, str):
+ *         c_logFileName = configFileName             # <<<<<<<<<<<<<<
+ *     elif logFileName is None:
+ *         c_logFileName = NULL
+ */
+    __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_configFileName); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_c_logFileName = __pyx_t_4;
+    goto __pyx_L6;
+  }
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":68
+ *     elif (PY_MAJOR_VERSION < 3) and isinstance(logFileName, str):
+ *         c_logFileName = configFileName
+ *     elif logFileName is None:             # <<<<<<<<<<<<<<
+ *         c_logFileName = NULL
+ *     else:
+ */
+  __pyx_t_5 = (__pyx_v_logFileName == Py_None);
+  if (__pyx_t_5) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":69
+ *         c_logFileName = configFileName
+ *     elif logFileName is None:
+ *         c_logFileName = NULL             # <<<<<<<<<<<<<<
+ *     else:
+ *         raise ValueError("Requires text input but got %s" % type(logFileName))
+ */
+    __pyx_v_c_logFileName = NULL;
+    goto __pyx_L6;
+  }
+  /*else*/ {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":71
+ *         c_logFileName = NULL
+ *     else:
+ *         raise ValueError("Requires text input but got %s" % type(logFileName))             # <<<<<<<<<<<<<<
+ *     lbx_initialize(configFileName, c_logFileName, settingsString)
+ * 
+ */
+    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+    __Pyx_INCREF(__pyx_v_logFileName);
+    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_logFileName);
+    __Pyx_GIVEREF(__pyx_v_logFileName);
+    __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)&PyType_Type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_2);
+    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+    __pyx_t_3 = PyNumber_Remainder(__pyx_kp_5, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
+    __Pyx_GIVEREF(__pyx_t_3);
+    __pyx_t_3 = 0;
+    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  }
+  __pyx_L6:;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":72
+ *     else:
+ *         raise ValueError("Requires text input but got %s" % type(logFileName))
+ *     lbx_initialize(configFileName, c_logFileName, settingsString)             # <<<<<<<<<<<<<<
+ * 
+ * def translateString(char *configFileName, inbuf, unsigned int mode):
+ */
+  __pyx_t_4 = __Pyx_PyBytes_AsString(__pyx_v_configFileName); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_settingsString); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  lbx_initialize(__pyx_t_4, __pyx_v_c_logFileName, __pyx_t_6);
+
+  __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("louisxml.initialize");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_DECREF(__pyx_v_logFileNameBytes);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":74
+ *     lbx_initialize(configFileName, c_logFileName, settingsString)
+ * 
+ * def translateString(char *configFileName, inbuf, unsigned int mode):             # <<<<<<<<<<<<<<
+ *     """Translate a string to Braille
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_translateString(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_8louisxml_translateString[] = "Translate a string to Braille\n    \n    This will translate a string or unicode string to Braille. This\n    does the translation by calling lbx_translateString. The call for\n    python differs from the C as python handles things differently. This\n    means that you only need specify the translation table, string to\n    translate and the mode arguments. This function will return the Braille.\n    ";
+static PyObject *__pyx_pf_8louisxml_translateString(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  char *__pyx_v_configFileName;
+  PyObject *__pyx_v_inbuf = 0;
+  unsigned int __pyx_v_mode;
+  char *__pyx_v_c_inbuf;
+  int __pyx_v_outlen;
+  int __pyx_v_widechar_size;
+  widechar *__pyx_v_outbuf;
+  PyObject *__pyx_v_unicode_outbuf;
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_1 = 0;
+  char *__pyx_t_1;
+  Py_ssize_t __pyx_t_2;
+  int __pyx_t_3;
+  PyObject *__pyx_t_4 = NULL;
+  PyObject *__pyx_t_5 = NULL;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_configFileName,&__pyx_kp_inbuf,&__pyx_kp_mode,0};
+  __Pyx_SetupRefcountContext("translateString");
+  __pyx_self = __pyx_self;
+  if (unlikely(__pyx_kwds)) {
+    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+    PyObject* values[3] = {0,0,0};
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      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;
+    }
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  0:
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_configFileName);
+      if (likely(values[0])) kw_args--;
+      else goto __pyx_L5_argtuple_error;
+      case  1:
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_inbuf);
+      if (likely(values[1])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateString", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  2:
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode);
+      if (likely(values[2])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateString", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    }
+    if (unlikely(kw_args > 0)) {
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "translateString") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    }
+    __pyx_v_configFileName = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_configFileName) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_inbuf = values[1];
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(values[2]); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+    goto __pyx_L5_argtuple_error;
+  } else {
+    __pyx_v_configFileName = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_configFileName) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_inbuf = PyTuple_GET_ITEM(__pyx_args, 1);
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("translateString", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("louisxml.translateString");
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+  __pyx_v_unicode_outbuf = Py_None; __Pyx_INCREF(Py_None);
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":83
+ *     translate and the mode arguments. This function will return the Braille.
+ *     """
+ *     cdef char *c_inbuf = inbuf             # <<<<<<<<<<<<<<
+ *     cdef int outlen = len(inbuf) * 2
+ *     cdef int widechar_size = sizeof(widechar)
+ */
+  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_inbuf); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_c_inbuf = __pyx_t_1;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":84
+ *     """
+ *     cdef char *c_inbuf = inbuf
+ *     cdef int outlen = len(inbuf) * 2             # <<<<<<<<<<<<<<
+ *     cdef int widechar_size = sizeof(widechar)
+ *     cdef widechar *outbuf = <widechar *>stdlib.malloc(outlen * widechar_size)
+ */
+  __pyx_t_2 = PyObject_Length(__pyx_v_inbuf); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_v_outlen = (__pyx_t_2 * 2);
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":85
+ *     cdef char *c_inbuf = inbuf
+ *     cdef int outlen = len(inbuf) * 2
+ *     cdef int widechar_size = sizeof(widechar)             # <<<<<<<<<<<<<<
+ *     cdef widechar *outbuf = <widechar *>stdlib.malloc(outlen * widechar_size)
+ *     unicode_outbuf = None
+ */
+  __pyx_v_widechar_size = (sizeof(widechar));
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":86
+ *     cdef int outlen = len(inbuf) * 2
+ *     cdef int widechar_size = sizeof(widechar)
+ *     cdef widechar *outbuf = <widechar *>stdlib.malloc(outlen * widechar_size)             # <<<<<<<<<<<<<<
+ *     unicode_outbuf = None
+ *     try:
+ */
+  __pyx_v_outbuf = ((widechar *)malloc((__pyx_v_outlen * __pyx_v_widechar_size)));
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":87
+ *     cdef int widechar_size = sizeof(widechar)
+ *     cdef widechar *outbuf = <widechar *>stdlib.malloc(outlen * widechar_size)
+ *     unicode_outbuf = None             # <<<<<<<<<<<<<<
+ *     try:
+ *         if lbx_translateString(configFileName, c_inbuf, outbuf, &outlen, mode) < 0:
+ */
+  __Pyx_INCREF(Py_None);
+  __Pyx_DECREF(__pyx_v_unicode_outbuf);
+  __pyx_v_unicode_outbuf = Py_None;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":88
+ *     cdef widechar *outbuf = <widechar *>stdlib.malloc(outlen * widechar_size)
+ *     unicode_outbuf = None
+ *     try:             # <<<<<<<<<<<<<<
+ *         if lbx_translateString(configFileName, c_inbuf, outbuf, &outlen, mode) < 0:
+ *             raise LouisXMLException("Unable to complete translation")
+ */
+  /*try:*/ {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":89
+ *     unicode_outbuf = None
+ *     try:
+ *         if lbx_translateString(configFileName, c_inbuf, outbuf, &outlen, mode) < 0:             # <<<<<<<<<<<<<<
+ *             raise LouisXMLException("Unable to complete translation")
+ *         unicode_outbuf = get_unicode(outbuf, outlen * widechar_size)
+ */
+    __pyx_t_3 = (lbx_translateString(__pyx_v_configFileName, __pyx_v_c_inbuf, __pyx_v_outbuf, (&__pyx_v_outlen), __pyx_v_mode) < 0);
+    if (__pyx_t_3) {
+
+      /* "/home/mike/pylouisxml/louisxml.pyx":90
+ *     try:
+ *         if lbx_translateString(configFileName, c_inbuf, outbuf, &outlen, mode) < 0:
+ *             raise LouisXMLException("Unable to complete translation")             # <<<<<<<<<<<<<<
+ *         unicode_outbuf = get_unicode(outbuf, outlen * widechar_size)
+ *     finally:
+ */
+      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LouisXMLException); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7;}
+      __Pyx_GOTREF(__pyx_1);
+      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7;}
+      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
+      __Pyx_INCREF(__pyx_kp_6);
+      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_6);
+      __Pyx_GIVEREF(__pyx_kp_6);
+      __pyx_t_5 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7;}
+      __Pyx_GOTREF(__pyx_t_5);
+      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
+      __Pyx_Raise(__pyx_t_5, 0, 0);
+      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L7;}
+      goto __pyx_L9;
+    }
+    __pyx_L9:;
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":91
+ *         if lbx_translateString(configFileName, c_inbuf, outbuf, &outlen, mode) < 0:
+ *             raise LouisXMLException("Unable to complete translation")
+ *         unicode_outbuf = get_unicode(outbuf, outlen * widechar_size)             # <<<<<<<<<<<<<<
+ *     finally:
+ *         stdlib.free(outbuf)
+ */
+    __pyx_t_5 = __pyx_f_8louisxml_get_unicode(__pyx_v_outbuf, (__pyx_v_outlen * __pyx_v_widechar_size)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L7;}
+    __Pyx_GOTREF(__pyx_t_5);
+    __Pyx_DECREF(__pyx_v_unicode_outbuf);
+    __pyx_v_unicode_outbuf = __pyx_t_5;
+    __pyx_t_5 = 0;
+  }
+  /*finally:*/ {
+    int __pyx_why;
+    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
+    int __pyx_exc_lineno;
+    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
+    __pyx_why = 0; goto __pyx_L8;
+    __pyx_L7: {
+      __pyx_why = 4;
+      __Pyx_XDECREF(__pyx_1); __pyx_1 = 0;
+      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
+      __pyx_exc_lineno = __pyx_lineno;
+      goto __pyx_L8;
+    }
+    __pyx_L8:;
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":93
+ *         unicode_outbuf = get_unicode(outbuf, outlen * widechar_size)
+ *     finally:
+ *         stdlib.free(outbuf)             # <<<<<<<<<<<<<<
+ *     return unicode_outbuf
+ * 
+ */
+    free(__pyx_v_outbuf);
+    switch (__pyx_why) {
+      case 4: {
+        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
+        __pyx_lineno = __pyx_exc_lineno;
+        __pyx_exc_type = 0;
+        __pyx_exc_value = 0;
+        __pyx_exc_tb = 0;
+        goto __pyx_L1_error;
+      }
+    }
+  }
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":94
+ *     finally:
+ *         stdlib.free(outbuf)
+ *     return unicode_outbuf             # <<<<<<<<<<<<<<
+ * 
+ * def translateFile(char * configFileName, char *infile, char * outfile, unsigned int mode):
+ */
+  __Pyx_XDECREF(__pyx_r);
+  __Pyx_INCREF(__pyx_v_unicode_outbuf);
+  __pyx_r = __pyx_v_unicode_outbuf;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_1);
+  __Pyx_XDECREF(__pyx_t_4);
+  __Pyx_XDECREF(__pyx_t_5);
+  __Pyx_AddTraceback("louisxml.translateString");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_DECREF(__pyx_v_unicode_outbuf);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":96
+ *     return unicode_outbuf
+ * 
+ * def translateFile(char * configFileName, char *infile, char * outfile, unsigned int mode):             # <<<<<<<<<<<<<<
+ *     """Translates an XML file
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_translateFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_8louisxml_translateFile[] = "Translates an XML file\n    \n    This function will translate an XML file into Braille and output the\n    Braille to a file. This does the translation by calling the\n    lbx_translateFile function.\n    ";
+static PyObject *__pyx_pf_8louisxml_translateFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  char *__pyx_v_configFileName;
+  char *__pyx_v_infile;
+  char *__pyx_v_outfile;
+  unsigned int __pyx_v_mode;
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_1 = 0;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_configFileName,&__pyx_kp_infile,&__pyx_kp_outfile,&__pyx_kp_mode,0};
+  __Pyx_SetupRefcountContext("translateFile");
+  __pyx_self = __pyx_self;
+  if (unlikely(__pyx_kwds)) {
+    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+    PyObject* values[4] = {0,0,0,0};
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      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;
+    }
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  0:
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_configFileName);
+      if (likely(values[0])) kw_args--;
+      else goto __pyx_L5_argtuple_error;
+      case  1:
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_infile);
+      if (likely(values[1])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateFile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  2:
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_outfile);
+      if (likely(values[2])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateFile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  3:
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode);
+      if (likely(values[3])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateFile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    }
+    if (unlikely(kw_args > 0)) {
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "translateFile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    }
+    __pyx_v_configFileName = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_configFileName) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_infile = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_infile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_outfile = __Pyx_PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_outfile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(values[3]); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+    goto __pyx_L5_argtuple_error;
+  } else {
+    __pyx_v_configFileName = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_configFileName) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_infile = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_infile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_outfile = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((!__pyx_v_outfile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("translateFile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("louisxml.translateFile");
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":103
+ *     lbx_translateFile function.
+ *     """
+ *     if lbx_translateFile(configFileName, infile, outfile, mode) < 0:             # <<<<<<<<<<<<<<
+ *         raise LouisXMLException("Unable to complete translation")
+ * 
+ */
+  __pyx_t_1 = (lbx_translateFile(__pyx_v_configFileName, __pyx_v_infile, __pyx_v_outfile, __pyx_v_mode) < 0);
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":104
+ *     """
+ *     if lbx_translateFile(configFileName, infile, outfile, mode) < 0:
+ *         raise LouisXMLException("Unable to complete translation")             # <<<<<<<<<<<<<<
+ * 
+ * def translateTextFile(char *configFileList, char *infile, char *outfile, unsigned int mode):
+ */
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LouisXMLException); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_1);
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __Pyx_INCREF(__pyx_kp_7);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_7);
+    __Pyx_GIVEREF(__pyx_kp_7);
+    __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("louisxml.translateFile");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":106
+ *         raise LouisXMLException("Unable to complete translation")
+ * 
+ * def translateTextFile(char *configFileList, char *infile, char *outfile, unsigned int mode):             # <<<<<<<<<<<<<<
+ *     """Translate a text file to Braille
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_translateTextFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_8louisxml_translateTextFile[] = "Translate a text file to Braille\n    \n    Translate a text file into Braille and output the result to a file.\n    This function performs the translation by calling lbx_translateTextFile.\n    ";
+static PyObject *__pyx_pf_8louisxml_translateTextFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  char *__pyx_v_configFileList;
+  char *__pyx_v_infile;
+  char *__pyx_v_outfile;
+  unsigned int __pyx_v_mode;
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_1 = 0;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_configFileList,&__pyx_kp_infile,&__pyx_kp_outfile,&__pyx_kp_mode,0};
+  __Pyx_SetupRefcountContext("translateTextFile");
+  __pyx_self = __pyx_self;
+  if (unlikely(__pyx_kwds)) {
+    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+    PyObject* values[4] = {0,0,0,0};
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      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;
+    }
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  0:
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_configFileList);
+      if (likely(values[0])) kw_args--;
+      else goto __pyx_L5_argtuple_error;
+      case  1:
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_infile);
+      if (likely(values[1])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateTextFile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  2:
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_outfile);
+      if (likely(values[2])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateTextFile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  3:
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode);
+      if (likely(values[3])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("translateTextFile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    }
+    if (unlikely(kw_args > 0)) {
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "translateTextFile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    }
+    __pyx_v_configFileList = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_configFileList) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_infile = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_infile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_outfile = __Pyx_PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_outfile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(values[3]); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+    goto __pyx_L5_argtuple_error;
+  } else {
+    __pyx_v_configFileList = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_configFileList) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_infile = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_infile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_outfile = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((!__pyx_v_outfile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("translateTextFile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("louisxml.translateTextFile");
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":112
+ *     This function performs the translation by calling lbx_translateTextFile.
+ *     """
+ *     if lbx_translateTextFile(configFileList, infile, outfile, mode) < 0:             # <<<<<<<<<<<<<<
+ *         raise LouisXMLException("Unable to complete translation")
+ * 
+ */
+  __pyx_t_1 = (lbx_translateTextFile(__pyx_v_configFileList, __pyx_v_infile, __pyx_v_outfile, __pyx_v_mode) < 0);
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":113
+ *     """
+ *     if lbx_translateTextFile(configFileList, infile, outfile, mode) < 0:
+ *         raise LouisXMLException("Unable to complete translation")             # <<<<<<<<<<<<<<
+ * 
+ * def backTranslateFile(char *configFileList, char *infile, char *outfile, unsigned int mode):
+ */
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LouisXMLException); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_1);
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __Pyx_INCREF(__pyx_kp_8);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_8);
+    __Pyx_GIVEREF(__pyx_kp_8);
+    __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("louisxml.translateTextFile");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":115
+ *         raise LouisXMLException("Unable to complete translation")
+ * 
+ * def backTranslateFile(char *configFileList, char *infile, char *outfile, unsigned int mode):             # <<<<<<<<<<<<<<
+ *     """Back translate a Braille file
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_backTranslateFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_8louisxml_backTranslateFile[] = "Back translate a Braille file\n    \n    Back translate a Braille file to a file. Does this by calling\n    lbx_backTranslateFile.\n    ";
+static PyObject *__pyx_pf_8louisxml_backTranslateFile(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  char *__pyx_v_configFileList;
+  char *__pyx_v_infile;
+  char *__pyx_v_outfile;
+  unsigned int __pyx_v_mode;
+  PyObject *__pyx_r = NULL;
+  PyObject *__pyx_1 = 0;
+  int __pyx_t_1;
+  PyObject *__pyx_t_2 = NULL;
+  PyObject *__pyx_t_3 = NULL;
+  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_configFileList,&__pyx_kp_infile,&__pyx_kp_outfile,&__pyx_kp_mode,0};
+  __Pyx_SetupRefcountContext("backTranslateFile");
+  __pyx_self = __pyx_self;
+  if (unlikely(__pyx_kwds)) {
+    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
+    PyObject* values[4] = {0,0,0,0};
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+      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;
+    }
+    switch (PyTuple_GET_SIZE(__pyx_args)) {
+      case  0:
+      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_configFileList);
+      if (likely(values[0])) kw_args--;
+      else goto __pyx_L5_argtuple_error;
+      case  1:
+      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_infile);
+      if (likely(values[1])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("backTranslateFile", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  2:
+      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_outfile);
+      if (likely(values[2])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("backTranslateFile", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+      case  3:
+      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode);
+      if (likely(values[3])) kw_args--;
+      else {
+        __Pyx_RaiseArgtupleInvalid("backTranslateFile", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+      }
+    }
+    if (unlikely(kw_args > 0)) {
+      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "backTranslateFile") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    }
+    __pyx_v_configFileList = __Pyx_PyBytes_AsString(values[0]); if (unlikely((!__pyx_v_configFileList) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_infile = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_infile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_outfile = __Pyx_PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_outfile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(values[3]); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
+    goto __pyx_L5_argtuple_error;
+  } else {
+    __pyx_v_configFileList = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((!__pyx_v_configFileList) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_infile = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_infile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_outfile = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((!__pyx_v_outfile) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+    __pyx_v_mode = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 3)); if (unlikely((__pyx_v_mode == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  }
+  goto __pyx_L4_argument_unpacking_done;
+  __pyx_L5_argtuple_error:;
+  __Pyx_RaiseArgtupleInvalid("backTranslateFile", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
+  __pyx_L3_error:;
+  __Pyx_AddTraceback("louisxml.backTranslateFile");
+  return NULL;
+  __pyx_L4_argument_unpacking_done:;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":121
+ *     lbx_backTranslateFile.
+ *     """
+ *     if lbx_backTranslateFile(configFileList, infile, outfile, mode) < 0:             # <<<<<<<<<<<<<<
+ *         raise LouisXMLException("Unable to complete back translation")
+ * 
+ */
+  __pyx_t_1 = (lbx_backTranslateFile(__pyx_v_configFileList, __pyx_v_infile, __pyx_v_outfile, __pyx_v_mode) < 0);
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":122
+ *     """
+ *     if lbx_backTranslateFile(configFileList, infile, outfile, mode) < 0:
+ *         raise LouisXMLException("Unable to complete back translation")             # <<<<<<<<<<<<<<
+ * 
+ * def free():
+ */
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_LouisXMLException); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_1);
+    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
+    __Pyx_INCREF(__pyx_kp_9);
+    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_9);
+    __Pyx_GIVEREF(__pyx_kp_9);
+    __pyx_t_3 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_t_3);
+    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
+    __Pyx_Raise(__pyx_t_3, 0, 0);
+    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    goto __pyx_L6;
+  }
+  __pyx_L6:;
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_1);
+  __Pyx_XDECREF(__pyx_t_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  __Pyx_AddTraceback("louisxml.backTranslateFile");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+/* "/home/mike/pylouisxml/louisxml.pyx":124
+ *         raise LouisXMLException("Unable to complete back translation")
+ * 
+ * def free():             # <<<<<<<<<<<<<<
+ *     """Free resources
+ * 
+ */
+
+static PyObject *__pyx_pf_8louisxml_free(PyObject *__pyx_self, PyObject *unused); /*proto*/
+static char __pyx_doc_8louisxml_free[] = "Free resources\n    \n    Frees the system resources used by liblouisxml by calling lbx_free.\n    ";
+static PyObject *__pyx_pf_8louisxml_free(PyObject *__pyx_self, PyObject *unused) {
+  PyObject *__pyx_r = NULL;
+  __Pyx_SetupRefcountContext("free");
+  __pyx_self = __pyx_self;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":129
+ *     Frees the system resources used by liblouisxml by calling lbx_free.
+ *     """
+ *     lbx_free()             # <<<<<<<<<<<<<<
+ * 
+ */
+  lbx_free();
+
+  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+  __Pyx_XGIVEREF(__pyx_r);
+  __Pyx_FinishRefcountContext();
+  return __pyx_r;
+}
+
+static struct PyMethodDef __pyx_methods[] = {
+  {__Pyx_NAMESTR("version"), (PyCFunction)__pyx_pf_8louisxml_version, METH_NOARGS, __Pyx_DOCSTR(0)},
+  {__Pyx_NAMESTR("initialize"), (PyCFunction)__pyx_pf_8louisxml_initialize, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8louisxml_initialize)},
+  {__Pyx_NAMESTR("translateString"), (PyCFunction)__pyx_pf_8louisxml_translateString, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8louisxml_translateString)},
+  {__Pyx_NAMESTR("translateFile"), (PyCFunction)__pyx_pf_8louisxml_translateFile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8louisxml_translateFile)},
+  {__Pyx_NAMESTR("translateTextFile"), (PyCFunction)__pyx_pf_8louisxml_translateTextFile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8louisxml_translateTextFile)},
+  {__Pyx_NAMESTR("backTranslateFile"), (PyCFunction)__pyx_pf_8louisxml_backTranslateFile, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_8louisxml_backTranslateFile)},
+  {__Pyx_NAMESTR("free"), (PyCFunction)__pyx_pf_8louisxml_free, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_8louisxml_free)},
+  {0, 0, 0, 0}
+};
+
+static void __pyx_init_filenames(void); /*proto*/
+
+#if PY_MAJOR_VERSION >= 3
+static struct PyModuleDef __pyx_moduledef = {
+    PyModuleDef_HEAD_INIT,
+    __Pyx_NAMESTR("louisxml"),
+    __Pyx_DOCSTR(__pyx_mdoc), /* m_doc */
+    -1, /* m_size */
+    __pyx_methods /* m_methods */,
+    NULL, /* m_reload */
+    NULL, /* m_traverse */
+    NULL, /* m_clear */
+    NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+  {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1},
+  {&__pyx_kp_configFileName, __pyx_k_configFileName, sizeof(__pyx_k_configFileName), 1, 1, 1},
+  {&__pyx_kp_logFileName, __pyx_k_logFileName, sizeof(__pyx_k_logFileName), 1, 1, 1},
+  {&__pyx_kp_settingsString, __pyx_k_settingsString, sizeof(__pyx_k_settingsString), 1, 1, 1},
+  {&__pyx_kp_inbuf, __pyx_k_inbuf, sizeof(__pyx_k_inbuf), 1, 1, 1},
+  {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1},
+  {&__pyx_kp_infile, __pyx_k_infile, sizeof(__pyx_k_infile), 1, 1, 1},
+  {&__pyx_kp_outfile, __pyx_k_outfile, sizeof(__pyx_k_outfile), 1, 1, 1},
+  {&__pyx_kp_configFileList, __pyx_k_configFileList, sizeof(__pyx_k_configFileList), 1, 1, 1},
+  {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 1, 1, 0},
+  {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 1, 1, 0},
+  {&__pyx_kp_PyICU, __pyx_k_PyICU, sizeof(__pyx_k_PyICU), 1, 1, 1},
+  {&__pyx_kp_LouisXMLException, __pyx_k_LouisXMLException, sizeof(__pyx_k_LouisXMLException), 0, 1, 1},
+  {&__pyx_kp_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 1, 1, 1},
+  {&__pyx_kp_UnicodeString, __pyx_k_UnicodeString, sizeof(__pyx_k_UnicodeString), 1, 1, 1},
+  {&__pyx_kp_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 1, 1, 1},
+  {&__pyx_kp_3, __pyx_k_3, sizeof(__pyx_k_3), 0, 1, 0},
+  {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
+  {&__pyx_kp_4, __pyx_k_4, sizeof(__pyx_k_4), 0, 0, 0},
+  {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0},
+  {&__pyx_kp_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 0},
+  {&__pyx_kp_7, __pyx_k_7, sizeof(__pyx_k_7), 0, 0, 0},
+  {&__pyx_kp_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 0},
+  {&__pyx_kp_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 0},
+  {0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+  __pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_kp_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  return 0;
+  __pyx_L1_error:;
+  return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  return 0;
+  __pyx_L1_error:;
+  return -1;
+}
+
+#if PY_MAJOR_VERSION < 3
+PyMODINIT_FUNC initlouisxml(void); /*proto*/
+PyMODINIT_FUNC initlouisxml(void)
+#else
+PyMODINIT_FUNC PyInit_louisxml(void); /*proto*/
+PyMODINIT_FUNC PyInit_louisxml(void)
+#endif
+{
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  int __pyx_t_1;
+  char *__pyx_t_2;
+  PyObject *__pyx_t_3 = NULL;
+  __pyx_init_filenames();
+  #ifdef CYTHON_REFNANNY
+  void* __pyx_refchk = NULL;
+  __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny");
+  if (!__Pyx_Refnanny) {
+      PyErr_Clear();
+      __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny");
+      if (!__Pyx_Refnanny)
+          Py_FatalError("failed to import refnanny module");
+  }
+  __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit_louisxml(void)", __LINE__, __FILE__);
+  #endif
+  __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;}
+  #if PY_MAJOR_VERSION < 3
+  __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;}
+  #else
+  __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;}
+  #endif
+  /*--- Library function declarations ---*/
+  /*--- Threads initialization code ---*/
+  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+  #ifdef WITH_THREAD /* Python build with threading support? */
+  PyEval_InitThreads();
+  #endif
+  #endif
+  /*--- Module creation code ---*/
+  #if PY_MAJOR_VERSION < 3
+  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("louisxml"), __pyx_methods, __pyx_mdoc, 0, PYTHON_API_VERSION);
+  #else
+  __pyx_m = PyModule_Create(&__pyx_moduledef);
+  #endif
+  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  #if PY_MAJOR_VERSION < 3
+  Py_INCREF(__pyx_m);
+  #endif
+  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
+  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  if (__pyx_module_is_main_louisxml) {
+    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
+  }
+  /*--- Initialize various global constants etc. ---*/
+  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  /*--- Builtin init code ---*/
+  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __pyx_skip_dispatch = 0;
+  /*--- Global init code ---*/
+  /*--- Function export code ---*/
+  /*--- Type init code ---*/
+  /*--- Type import code ---*/
+  /*--- Function import code ---*/
+  /*--- Execution code ---*/
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":31
+ * 
+ * cdef char *lbx_encoding
+ * if sizeof(widechar) == 2:             # <<<<<<<<<<<<<<
+ *     lbx_encoding = u"utf_16_le"
+ * elif sizeof(widechar) == 4:
+ */
+  __pyx_t_1 = ((sizeof(widechar)) == 2);
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":32
+ * cdef char *lbx_encoding
+ * if sizeof(widechar) == 2:
+ *     lbx_encoding = u"utf_16_le"             # <<<<<<<<<<<<<<
+ * elif sizeof(widechar) == 4:
+ *     lbx_encoding = u"utf_32_le"
+ */
+    __pyx_t_2 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_kp_1)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_8louisxml_lbx_encoding = __pyx_t_2;
+    goto __pyx_L2;
+  }
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":33
+ * if sizeof(widechar) == 2:
+ *     lbx_encoding = u"utf_16_le"
+ * elif sizeof(widechar) == 4:             # <<<<<<<<<<<<<<
+ *     lbx_encoding = u"utf_32_le"
+ * if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ */
+  __pyx_t_1 = ((sizeof(widechar)) == 4);
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":34
+ *     lbx_encoding = u"utf_16_le"
+ * elif sizeof(widechar) == 4:
+ *     lbx_encoding = u"utf_32_le"             # <<<<<<<<<<<<<<
+ * if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ *     import PyICU
+ */
+    __pyx_t_2 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_kp_2)); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __pyx_v_8louisxml_lbx_encoding = __pyx_t_2;
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":35
+ * elif sizeof(widechar) == 4:
+ *     lbx_encoding = u"utf_32_le"
+ * if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:             # <<<<<<<<<<<<<<
+ *     import PyICU
+ * cdef object get_unicode(widechar* buftxt, int buflen):
+ */
+  if ((PY_MAJOR_VERSION == 2)) {
+    __pyx_t_1 = (PY_MINOR_VERSION < 6);
+  } else {
+    __pyx_t_1 = (PY_MAJOR_VERSION == 2);
+  }
+  if (__pyx_t_1) {
+
+    /* "/home/mike/pylouisxml/louisxml.pyx":36
+ *     lbx_encoding = u"utf_32_le"
+ * if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ *     import PyICU             # <<<<<<<<<<<<<<
+ * cdef object get_unicode(widechar* buftxt, int buflen):
+ *     if PY_MAJOR_VERSION == 2 and PY_MINOR_VERSION < 6:
+ */
+    __pyx_1 = __Pyx_Import(__pyx_kp_PyICU, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_GOTREF(__pyx_1);
+    if (PyObject_SetAttr(__pyx_m, __pyx_kp_PyICU, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
+    goto __pyx_L3;
+  }
+  __pyx_L3:;
+
+  /* "/home/mike/pylouisxml/louisxml.pyx":46
+ *         return unicode(tmp_str, lbx_encoding)
+ * 
+ * class LouisXMLException(Exception):             # <<<<<<<<<<<<<<
+ *     pass
+ * 
+ */
+  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_1));
+  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
+  __Pyx_INCREF(__pyx_builtin_Exception);
+  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_builtin_Exception);
+  __Pyx_GIVEREF(__pyx_builtin_Exception);
+  __pyx_2 = __Pyx_CreateClass(((PyObject *)__pyx_t_3), ((PyObject *)__pyx_1), __pyx_kp_LouisXMLException, "louisxml"); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_GOTREF(__pyx_2);
+  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
+  if (PyObject_SetAttr(__pyx_m, __pyx_kp_LouisXMLException, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
+  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
+  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
+
+  /* "/home/mike/pylouisxml/louisxml.pxd":1
+ * ###############################################################################             # <<<<<<<<<<<<<<
+ * # Copyright (C) 2009 Michael Whapples
+ * #
+ */
+  goto __pyx_L0;
+  __pyx_L1_error:;
+  __Pyx_XDECREF(__pyx_1);
+  __Pyx_XDECREF(__pyx_2);
+  __Pyx_XDECREF(__pyx_t_3);
+  if (__pyx_m) {
+    __Pyx_AddTraceback("init louisxml");
+    Py_DECREF(__pyx_m); __pyx_m = 0;
+  } else if (!PyErr_Occurred()) {
+    PyErr_SetString(PyExc_ImportError, "init louisxml");
+  }
+  __pyx_L0:;
+  __Pyx_FinishRefcountContext();
+  #if PY_MAJOR_VERSION < 3
+  return;
+  #else
+  return __pyx_m;
+  #endif
+}
+
+static const char *__pyx_filenames[] = {
+  "louisxml.pyx",
+};
+
+/* Runtime support code */
+
+static void __pyx_init_filenames(void) {
+  __pyx_f = __pyx_filenames;
+}
+
+static void __Pyx_RaiseDoubleKeywordsError(
+    const char* func_name,
+    PyObject* kw_name)
+{
+    PyErr_Format(PyExc_TypeError,
+        #if PY_MAJOR_VERSION >= 3
+        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+        #else
+        "%s() got multiple values for keyword argument '%s'", func_name,
+        PyString_AS_STRING(kw_name));
+        #endif
+}
+
+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)
+{
+    Py_ssize_t num_expected;
+    const char *number, *more_or_less;
+
+    if (num_found < num_min) {
+        num_expected = num_min;
+        more_or_less = "at least";
+    } else {
+        num_expected = num_max;
+        more_or_less = "at most";
+    }
+    if (exact) {
+        more_or_less = "exactly";
+    }
+    number = (num_expected == 1) ? "" : "s";
+    PyErr_Format(PyExc_TypeError,
+        #if PY_VERSION_HEX < 0x02050000
+            "%s() takes %s %d positional argument%s (%d given)",
+        #else
+            "%s() takes %s %zd positional argument%s (%zd given)",
+        #endif
+        func_name, more_or_less, num_expected, number, num_found);
+}
+
+static int __Pyx_ParseOptionalKeywords(
+    PyObject *kwds,
+    PyObject **argnames[],
+    PyObject *kwds2,
+    PyObject *values[],
+    Py_ssize_t num_pos_args,
+    const char* function_name)
+{
+    PyObject *key = 0, *value = 0;
+    Py_ssize_t pos = 0;
+    PyObject*** name;
+    PyObject*** first_kw_arg = argnames + num_pos_args;
+
+    while (PyDict_Next(kwds, &pos, &key, &value)) {
+        name = first_kw_arg;
+        while (*name && (**name != key)) name++;
+        if (*name) {
+            values[name-argnames] = value;
+        } else {
+            #if PY_MAJOR_VERSION < 3
+            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
+            #else
+            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
+            #endif
+                goto invalid_keyword_type;
+            } else {
+                for (name = first_kw_arg; *name; name++) {
+                    #if PY_MAJOR_VERSION >= 3
+                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+                        PyUnicode_Compare(**name, key) == 0) break;
+                    #else
+                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+                        _PyString_Eq(**name, key)) break;
+                    #endif
+                }
+                if (*name) {
+                    values[name-argnames] = value;
+                } else {
+                    /* unexpected keyword found */
+                    for (name=argnames; name != first_kw_arg; name++) {
+                        if (**name == key) goto arg_passed_twice;
+                        #if PY_MAJOR_VERSION >= 3
+                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
+                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
+                        #else
+                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
+                            _PyString_Eq(**name, key)) goto arg_passed_twice;
+                        #endif
+                    }
+                    if (kwds2) {
+                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+                    } else {
+                        goto invalid_keyword;
+                    }
+                }
+            }
+        }
+    }
+    return 0;
+arg_passed_twice:
+    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
+    goto bad;
+invalid_keyword_type:
+    PyErr_Format(PyExc_TypeError,
+        "%s() keywords must be strings", function_name);
+    goto bad;
+invalid_keyword:
+    PyErr_Format(PyExc_TypeError,
+    #if PY_MAJOR_VERSION < 3
+        "%s() got an unexpected keyword argument '%s'",
+        function_name, PyString_AsString(key));
+    #else
+        "%s() got an unexpected keyword argument '%U'",
+        function_name, key);
+    #endif
+bad:
+    return -1;
+}
+
+static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
+    PyObject *tmp_type, *tmp_value, *tmp_tb;
+    PyThreadState *tstate = PyThreadState_GET();
+
+#if PY_MAJOR_VERSION >= 3
+    /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */
+    if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) {
+        tmp_type = tstate->exc_type;
+        tmp_value = tstate->exc_value;
+        tmp_tb = tstate->exc_traceback;
+        PyErr_NormalizeException(&type, &value, &tb);
+        PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb);
+        tstate->exc_type = 0;
+        tstate->exc_value = 0;
+        tstate->exc_traceback = 0;
+        PyException_SetContext(value, tmp_value);
+        Py_DECREF(tmp_type);
+        Py_XDECREF(tmp_tb);
+    }
+#endif
+
+    tmp_type = tstate->curexc_type;
+    tmp_value = tstate->curexc_value;
+    tmp_tb = tstate->curexc_traceback;
+    tstate->curexc_type = type;
+    tstate->curexc_value = value;
+    tstate->curexc_traceback = tb;
+    Py_XDECREF(tmp_type);
+    Py_XDECREF(tmp_value);
+    Py_XDECREF(tmp_tb);
+}
+
+static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
+    PyThreadState *tstate = PyThreadState_GET();
+    *type = tstate->curexc_type;
+    *value = tstate->curexc_value;
+    *tb = tstate->curexc_traceback;
+
+    tstate->curexc_type = 0;
+    tstate->curexc_value = 0;
+    tstate->curexc_traceback = 0;
+}
+
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
+    PyObject *__import__ = 0;
+    PyObject *empty_list = 0;
+    PyObject *module = 0;
+    PyObject *global_dict = 0;
+    PyObject *empty_dict = 0;
+    PyObject *list;
+    __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
+    if (!__import__)
+        goto bad;
+    if (from_list)
+        list = from_list;
+    else {
+        empty_list = PyList_New(0);
+        if (!empty_list)
+            goto bad;
+        list = empty_list;
+    }
+    global_dict = PyModule_GetDict(__pyx_m);
+    if (!global_dict)
+        goto bad;
+    empty_dict = PyDict_New();
+    if (!empty_dict)
+        goto bad;
+    module = PyObject_CallFunctionObjArgs(__import__,
+        name, global_dict, empty_dict, list, NULL);
+bad:
+    Py_XDECREF(empty_list);
+    Py_XDECREF(__import__);
+    Py_XDECREF(empty_dict);
+    return module;
+}
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
+    PyObject *result;
+    result = PyObject_GetAttr(dict, name);
+    if (!result)
+        PyErr_SetObject(PyExc_NameError, name);
+    return result;
+}
+
+static PyObject *__Pyx_CreateClass(
+    PyObject *bases, PyObject *dict, PyObject *name, const char *modname)
+{
+    PyObject *py_modname;
+    PyObject *result = 0;
+
+    #if PY_MAJOR_VERSION < 3
+    py_modname = PyString_FromString(modname);
+    #else
+    py_modname = PyUnicode_FromString(modname);
+    #endif
+    if (!py_modname)
+        goto bad;
+    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
+        goto bad;
+    #if PY_MAJOR_VERSION < 3
+    result = PyClass_New(bases, dict, name);
+    #else
+    result = PyObject_CallFunctionObjArgs((PyObject *)&PyType_Type, name, bases, dict, NULL);
+    #endif
+bad:
+    Py_XDECREF(py_modname);
+    return result;
+}
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
+    Py_XINCREF(type);
+    Py_XINCREF(value);
+    Py_XINCREF(tb);
+    /* First, check the traceback argument, replacing None with NULL. */
+    if (tb == Py_None) {
+        Py_DECREF(tb);
+        tb = 0;
+    }
+    else if (tb != NULL && !PyTraceBack_Check(tb)) {
+        PyErr_SetString(PyExc_TypeError,
+            "raise: arg 3 must be a traceback or None");
+        goto raise_error;
+    }
+    /* Next, replace a missing value with None */
+    if (value == NULL) {
+        value = Py_None;
+        Py_INCREF(value);
+    }
+    #if PY_VERSION_HEX < 0x02050000
+    if (!PyClass_Check(type))
+    #else
+    if (!PyType_Check(type))
+    #endif
+    {
+        /* Raising an instance.  The value should be a dummy. */
+        if (value != Py_None) {
+            PyErr_SetString(PyExc_TypeError,
+                "instance exception may not have a separate value");
+            goto raise_error;
+        }
+        /* Normalize to raise <class>, <instance> */
+        Py_DECREF(value);
+        value = type;
+        #if PY_VERSION_HEX < 0x02050000
+            if (PyInstance_Check(type)) {
+                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
+                Py_INCREF(type);
+            }
+            else {
+                type = 0;
+                PyErr_SetString(PyExc_TypeError,
+                    "raise: exception must be an old-style class or instance");
+                goto raise_error;
+            }
+        #else
+            type = (PyObject*) Py_TYPE(type);
+            Py_INCREF(type);
+            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+                PyErr_SetString(PyExc_TypeError,
+                    "raise: exception class must be a subclass of BaseException");
+                goto raise_error;
+            }
+        #endif
+    }
+    __Pyx_ErrRestore(type, value, tb);
+    return;
+raise_error:
+    Py_XDECREF(value);
+    Py_XDECREF(type);
+    Py_XDECREF(tb);
+    return;
+}
+
+static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
+    if (sizeof(unsigned char) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(unsigned char)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to unsigned char" :
+                    "value too large to convert to unsigned char");
+            }
+            return (unsigned char)-1;
+        }
+        return (unsigned char)val;
+    }
+    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
+}
+
+static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
+    if (sizeof(unsigned short) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(unsigned short)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to unsigned short" :
+                    "value too large to convert to unsigned short");
+            }
+            return (unsigned short)-1;
+        }
+        return (unsigned short)val;
+    }
+    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
+}
+
+static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
+    if (sizeof(unsigned int) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(unsigned int)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to unsigned int" :
+                    "value too large to convert to unsigned int");
+            }
+            return (unsigned int)-1;
+        }
+        return (unsigned int)val;
+    }
+    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
+}
+
+static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
+    if (sizeof(char) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(char)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((char)-1) > ((char)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to char" :
+                    "value too large to convert to char");
+            }
+            return (char)-1;
+        }
+        return (char)val;
+    }
+    return (char)__Pyx_PyInt_AsLong(x);
+}
+
+static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
+    if (sizeof(short) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(short)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((short)-1) > ((short)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to short" :
+                    "value too large to convert to short");
+            }
+            return (short)-1;
+        }
+        return (short)val;
+    }
+    return (short)__Pyx_PyInt_AsLong(x);
+}
+
+static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
+    if (sizeof(int) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(int)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((int)-1) > ((int)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to int" :
+                    "value too large to convert to int");
+            }
+            return (int)-1;
+        }
+        return (int)val;
+    }
+    return (int)__Pyx_PyInt_AsLong(x);
+}
+
+static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
+    if (sizeof(signed char) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(signed char)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to signed char" :
+                    "value too large to convert to signed char");
+            }
+            return (signed char)-1;
+        }
+        return (signed char)val;
+    }
+    return (signed char)__Pyx_PyInt_AsSignedLong(x);
+}
+
+static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
+    if (sizeof(signed short) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(signed short)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to signed short" :
+                    "value too large to convert to signed short");
+            }
+            return (signed short)-1;
+        }
+        return (signed short)val;
+    }
+    return (signed short)__Pyx_PyInt_AsSignedLong(x);
+}
+
+static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
+    if (sizeof(signed int) < sizeof(long)) {
+        long val = __Pyx_PyInt_AsLong(x);
+        if (unlikely(val != (long)(signed int)val)) {
+            if (!unlikely(val == -1 && PyErr_Occurred())) {
+                PyErr_SetString(PyExc_OverflowError,
+                    (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ?
+                    "can't convert negative value to signed int" :
+                    "value too large to convert to signed int");
+            }
+            return (signed int)-1;
+        }
+        return (signed int)val;
+    }
+    return (signed int)__Pyx_PyInt_AsSignedLong(x);
+}
+
+static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
+#if PY_VERSION_HEX < 0x03000000
+    if (likely(PyInt_Check(x))) {
+        long val = PyInt_AS_LONG(x);
+        if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to unsigned long");
+            return (unsigned long)-1;
+        }
+        return (unsigned long)val;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to unsigned long");
+            return (unsigned long)-1;
+        }
+        return (((unsigned long)-1) < ((unsigned long)0)) ?
+               PyLong_AsLong(x) :
+               PyLong_AsUnsignedLong(x);
+    } else {
+        unsigned long val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned long)-1;
+        val = __Pyx_PyInt_AsUnsignedLong(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+}
+
+static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
+#if PY_VERSION_HEX < 0x03000000
+    if (likely(PyInt_Check(x))) {
+        long val = PyInt_AS_LONG(x);
+        if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to unsigned PY_LONG_LONG");
+            return (unsigned PY_LONG_LONG)-1;
+        }
+        return (unsigned PY_LONG_LONG)val;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to unsigned PY_LONG_LONG");
+            return (unsigned PY_LONG_LONG)-1;
+        }
+        return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ?
+               PyLong_AsLongLong(x) :
+               PyLong_AsUnsignedLongLong(x);
+    } else {
+        unsigned PY_LONG_LONG val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (unsigned PY_LONG_LONG)-1;
+        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+}
+
+static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
+#if PY_VERSION_HEX < 0x03000000
+    if (likely(PyInt_Check(x))) {
+        long val = PyInt_AS_LONG(x);
+        if (((long)-1) > ((long)0) && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to long");
+            return (long)-1;
+        }
+        return (long)val;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to long");
+            return (long)-1;
+        }
+        return (((long)-1) < ((long)0)) ?
+               PyLong_AsLong(x) :
+               PyLong_AsUnsignedLong(x);
+    } else {
+        long val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (long)-1;
+        val = __Pyx_PyInt_AsLong(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+}
+
+static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
+#if PY_VERSION_HEX < 0x03000000
+    if (likely(PyInt_Check(x))) {
+        long val = PyInt_AS_LONG(x);
+        if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to PY_LONG_LONG");
+            return (PY_LONG_LONG)-1;
+        }
+        return (PY_LONG_LONG)val;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to PY_LONG_LONG");
+            return (PY_LONG_LONG)-1;
+        }
+        return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ?
+               PyLong_AsLongLong(x) :
+               PyLong_AsUnsignedLongLong(x);
+    } else {
+        PY_LONG_LONG val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (PY_LONG_LONG)-1;
+        val = __Pyx_PyInt_AsLongLong(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+}
+
+static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
+#if PY_VERSION_HEX < 0x03000000
+    if (likely(PyInt_Check(x))) {
+        long val = PyInt_AS_LONG(x);
+        if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to signed long");
+            return (signed long)-1;
+        }
+        return (signed long)val;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to signed long");
+            return (signed long)-1;
+        }
+        return (((signed long)-1) < ((signed long)0)) ?
+               PyLong_AsLong(x) :
+               PyLong_AsUnsignedLong(x);
+    } else {
+        signed long val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (signed long)-1;
+        val = __Pyx_PyInt_AsSignedLong(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+}
+
+static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
+#if PY_VERSION_HEX < 0x03000000
+    if (likely(PyInt_Check(x))) {
+        long val = PyInt_AS_LONG(x);
+        if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to signed PY_LONG_LONG");
+            return (signed PY_LONG_LONG)-1;
+        }
+        return (signed PY_LONG_LONG)val;
+    } else
+#endif
+    if (likely(PyLong_Check(x))) {
+        if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
+            PyErr_SetString(PyExc_OverflowError,
+                            "can't convert negative value to signed PY_LONG_LONG");
+            return (signed PY_LONG_LONG)-1;
+        }
+        return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ?
+               PyLong_AsLongLong(x) :
+               PyLong_AsUnsignedLongLong(x);
+    } else {
+        signed PY_LONG_LONG val;
+        PyObject *tmp = __Pyx_PyNumber_Int(x);
+        if (!tmp) return (signed PY_LONG_LONG)-1;
+        val = __Pyx_PyInt_AsSignedLongLong(tmp);
+        Py_DECREF(tmp);
+        return val;
+    }
+}
+
+#include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+
+static void __Pyx_AddTraceback(const char *funcname) {
+    PyObject *py_srcfile = 0;
+    PyObject *py_funcname = 0;
+    PyObject *py_globals = 0;
+    PyCodeObject *py_code = 0;
+    PyFrameObject *py_frame = 0;
+
+    #if PY_MAJOR_VERSION < 3
+    py_srcfile = PyString_FromString(__pyx_filename);
+    #else
+    py_srcfile = PyUnicode_FromString(__pyx_filename);
+    #endif
+    if (!py_srcfile) goto bad;
+    if (__pyx_clineno) {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
+        #else
+        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
+        #endif
+    }
+    else {
+        #if PY_MAJOR_VERSION < 3
+        py_funcname = PyString_FromString(funcname);
+        #else
+        py_funcname = PyUnicode_FromString(funcname);
+        #endif
+    }
+    if (!py_funcname) goto bad;
+    py_globals = PyModule_GetDict(__pyx_m);
+    if (!py_globals) goto bad;
+    py_code = PyCode_New(
+        0,            /*int argcount,*/
+        #if PY_MAJOR_VERSION >= 3
+        0,            /*int kwonlyargcount,*/
+        #endif
+        0,            /*int nlocals,*/
+        0,            /*int stacksize,*/
+        0,            /*int flags,*/
+        __pyx_empty_bytes, /*PyObject *code,*/
+        __pyx_empty_tuple,  /*PyObject *consts,*/
+        __pyx_empty_tuple,  /*PyObject *names,*/
+        __pyx_empty_tuple,  /*PyObject *varnames,*/
+        __pyx_empty_tuple,  /*PyObject *freevars,*/
+        __pyx_empty_tuple,  /*PyObject *cellvars,*/
+        py_srcfile,   /*PyObject *filename,*/
+        py_funcname,  /*PyObject *name,*/
+        __pyx_lineno,   /*int firstlineno,*/
+        __pyx_empty_bytes  /*PyObject *lnotab*/
+    );
+    if (!py_code) goto bad;
+    py_frame = PyFrame_New(
+        PyThreadState_GET(), /*PyThreadState *tstate,*/
+        py_code,             /*PyCodeObject *code,*/
+        py_globals,          /*PyObject *globals,*/
+        0                    /*PyObject *locals*/
+    );
+    if (!py_frame) goto bad;
+    py_frame->f_lineno = __pyx_lineno;
+    PyTraceBack_Here(py_frame);
+bad:
+    Py_XDECREF(py_srcfile);
+    Py_XDECREF(py_funcname);
+    Py_XDECREF(py_code);
+    Py_XDECREF(py_frame);
+}
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+    while (t->p) {
+        #if PY_MAJOR_VERSION < 3
+        if (t->is_unicode && (!t->is_identifier)) {
+            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+        } else if (t->intern) {
+            *t->p = PyString_InternFromString(t->s);
+        } else {
+            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+        }
+        #else  /* Python 3+ has unicode identifiers */
+        if (t->is_identifier || (t->is_unicode && t->intern)) {
+            *t->p = PyUnicode_InternFromString(t->s);
+        } else if (t->is_unicode) {
+            *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+        } else {
+            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+        }
+        #endif
+        if (!*t->p)
+            return -1;
+        ++t;
+    }
+    return 0;
+}
+
+/* Type Conversion Functions */
+
+static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+   if (x == Py_True) return 1;
+   else if ((x == Py_False) | (x == Py_None)) return 0;
+   else return PyObject_IsTrue(x);
+}
+
+static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
+  PyNumberMethods *m;
+  const char *name = NULL;
+  PyObject *res = NULL;
+#if PY_VERSION_HEX < 0x03000000
+  if (PyInt_Check(x) || PyLong_Check(x))
+#else
+  if (PyLong_Check(x))
+#endif
+    return Py_INCREF(x), x;
+  m = Py_TYPE(x)->tp_as_number;
+#if PY_VERSION_HEX < 0x03000000
+  if (m && m->nb_int) {
+    name = "int";
+    res = PyNumber_Int(x);
+  }
+  else if (m && m->nb_long) {
+    name = "long";
+    res = PyNumber_Long(x);
+  }
+#else
+  if (m && m->nb_int) {
+    name = "int";
+    res = PyNumber_Long(x);
+  }
+#endif
+  if (res) {
+#if PY_VERSION_HEX < 0x03000000
+    if (!PyInt_Check(res) && !PyLong_Check(res)) {
+#else
+    if (!PyLong_Check(res)) {
+#endif
+      PyErr_Format(PyExc_TypeError,
+                   "__%s__ returned non-%s (type %.200s)",
+                   name, name, Py_TYPE(res)->tp_name);
+      Py_DECREF(res);
+      return NULL;
+    }
+  }
+  else if (!PyErr_Occurred()) {
+    PyErr_SetString(PyExc_TypeError,
+                    "an integer is required");
+  }
+  return res;
+}
+
+static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+  Py_ssize_t ival;
+  PyObject* x = PyNumber_Index(b);
+  if (!x) return -1;
+  ival = PyInt_AsSsize_t(x);
+  Py_DECREF(x);
+  return ival;
+}
+
+static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+#if PY_VERSION_HEX < 0x02050000
+   if (ival <= LONG_MAX)
+       return PyInt_FromLong((long)ival);
+   else {
+       unsigned char *bytes = (unsigned char *) &ival;
+       int one = 1; int little = (int)*(unsigned char*)&one;
+       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
+   }
+#else
+   return PyInt_FromSize_t(ival);
+#endif
+}
+
+static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
+   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
+   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
+       return (size_t)-1;
+   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
+       PyErr_SetString(PyExc_OverflowError,
+                       "value too large to convert to size_t");
+       return (size_t)-1;
+   }
+   return (size_t)val;
+}
+
+
+#endif /* Py_PYTHON_H */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]