/*
 * FILE : fb2parser_wrap.c
 * 
 * This file was automatically generated by :
 * Simplified Wrapper and Interface Generator (SWIG)
 * Version 1.1 (Patch 5)
 * 
 * Portions Copyright (c) 1995-1998
 * The University of Utah and The Regents of the University of California.
 * Permission is granted to distribute this file in any manner provided
 * this notice remains intact.
 * 
 * Do not make changes to this file--changes will be lost!
 *
 */


#define SWIGCODE
/* Implementation : PYTHON */

#define SWIGPYTHON
#include <string.h>
#include <stdlib.h>
/***********************************************************************
 * $Header: /cvsroot/pybookreader/PyBookReader/pybookreader/fb2parser_wrap.c,v 1.1.1.1 2005/03/29 22:37:54 conr Exp $
 * swig_lib/python/python.cfg
 *
 * This file contains coded needed to add variable linking to the
 * Python interpreter.   C variables are added as a new kind of Python
 * datatype.
 *
 * Also contains supporting code for building python under Windows
 * and things like that.
 *
 * $Log: fb2parser_wrap.c,v $
 * Revision 1.1.1.1  2005/03/29 22:37:54  conr
 * Initial import. (PyBookReader v.0.4.11)
 *
 ************************************************************************/

#ifdef __cplusplus
extern "C" {
#endif
#include "Python.h"
#ifdef __cplusplus
}
#endif

/* Definitions for Windows/Unix exporting */
#if defined(__WIN32__)
#   if defined(_MSC_VER)
#	define SWIGEXPORT(a,b) __declspec(dllexport) a b
#   else
#	if defined(__BORLANDC__)
#	    define SWIGEXPORT(a,b) a _export b
#	else
#	    define SWIGEXPORT(a,b) a b
#	endif
#   endif
#else
#   define SWIGEXPORT(a,b) a b
#endif

#ifdef SWIG_GLOBAL
#ifdef __cplusplus
#define SWIGSTATIC extern "C"
#else
#define SWIGSTATIC
#endif
#endif

#ifndef SWIGSTATIC
#define SWIGSTATIC static
#endif

typedef struct {
  char  *name;
  PyObject *(*get_attr)(void);
  int (*set_attr)(PyObject *);
} swig_globalvar;

typedef struct swig_varlinkobject {
  PyObject_HEAD
  swig_globalvar **vars;
  int      nvars;
  int      maxvars;
} swig_varlinkobject;

/* ----------------------------------------------------------------------
   swig_varlink_repr()

   Function for python repr method
   ---------------------------------------------------------------------- */

static PyObject *
swig_varlink_repr(swig_varlinkobject *v)
{
  v = v;
  return PyString_FromString("<Global variables>");
}

/* ---------------------------------------------------------------------
   swig_varlink_print()

   Print out all of the global variable names
   --------------------------------------------------------------------- */

static int
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags)
{

  int i = 0;
  flags = flags;
  fprintf(fp,"Global variables { ");
  while (v->vars[i]) {
    fprintf(fp,"%s", v->vars[i]->name);
    i++;
    if (v->vars[i]) fprintf(fp,", ");
  }
  fprintf(fp," }\n");
  return 0;
}

/* --------------------------------------------------------------------
   swig_varlink_getattr
 
   This function gets the value of a variable and returns it as a
   PyObject.   In our case, we'll be looking at the datatype and
   converting into a number or string
   -------------------------------------------------------------------- */

static PyObject *
swig_varlink_getattr(swig_varlinkobject *v, char *n)
{
  int i = 0;
  char temp[128];

  while (v->vars[i]) {
    if (strcmp(v->vars[i]->name,n) == 0) {
      return (*v->vars[i]->get_attr)();
    }
    i++;
  }
  sprintf(temp,"C global variable %s not found.", n);
  PyErr_SetString(PyExc_NameError,temp);
  return NULL;
}

/* -------------------------------------------------------------------
   swig_varlink_setattr()

   This function sets the value of a variable.
   ------------------------------------------------------------------- */

static int
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p)
{
  char temp[128];
  int i = 0;
  while (v->vars[i]) {
    if (strcmp(v->vars[i]->name,n) == 0) {
      return (*v->vars[i]->set_attr)(p);
    }
    i++;
  }
  sprintf(temp,"C global variable %s not found.", n);
  PyErr_SetString(PyExc_NameError,temp);
  return 1;
}

statichere PyTypeObject varlinktype = {
/*  PyObject_HEAD_INIT(&PyType_Type)  Note : This doesn't work on some machines */
  PyObject_HEAD_INIT(0)              
  0,
  "varlink",                          /* Type name    */
  sizeof(swig_varlinkobject),         /* Basic size   */
  0,                                  /* Itemsize     */
  0,                                  /* Deallocator  */ 
  (printfunc) swig_varlink_print,     /* Print        */
  (getattrfunc) swig_varlink_getattr, /* get attr     */
  (setattrfunc) swig_varlink_setattr, /* Set attr     */
  0,                                  /* tp_compare   */
  (reprfunc) swig_varlink_repr,       /* tp_repr      */    
  0,                                  /* tp_as_number */
  0,                                  /* tp_as_mapping*/
  0,                                  /* tp_hash      */
};

/* Create a variable linking object for use later */

SWIGSTATIC PyObject *
SWIG_newvarlink(void)
{
  swig_varlinkobject *result = 0;
  result = PyMem_NEW(swig_varlinkobject,1);
  varlinktype.ob_type = &PyType_Type;    /* Patch varlinktype into a PyType */
  result->ob_type = &varlinktype;
  /*  _Py_NewReference(result);  Does not seem to be necessary */
  result->nvars = 0;
  result->maxvars = 64;
  result->vars = (swig_globalvar **) malloc(64*sizeof(swig_globalvar *));
  result->vars[0] = 0;
  result->ob_refcnt = 0;
  Py_XINCREF((PyObject *) result);
  return ((PyObject*) result);
}

SWIGSTATIC void
SWIG_addvarlink(PyObject *p, char *name,
	   PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p))
{
  swig_varlinkobject *v;
  v= (swig_varlinkobject *) p;
	
  if (v->nvars >= v->maxvars -1) {
    v->maxvars = 2*v->maxvars;
    v->vars = (swig_globalvar **) realloc(v->vars,v->maxvars*sizeof(swig_globalvar *));
    if (v->vars == NULL) {
      fprintf(stderr,"SWIG : Fatal error in initializing Python module.\n");
      exit(1);
    }
  }
  v->vars[v->nvars] = (swig_globalvar *) malloc(sizeof(swig_globalvar));
  v->vars[v->nvars]->name = (char *) malloc(strlen(name)+1);
  strcpy(v->vars[v->nvars]->name,name);
  v->vars[v->nvars]->get_attr = get_attr;
  v->vars[v->nvars]->set_attr = set_attr;
  v->nvars++;
  v->vars[v->nvars] = 0;
}



/*****************************************************************************
 * $Header: /cvsroot/pybookreader/PyBookReader/pybookreader/fb2parser_wrap.c,v 1.1.1.1 2005/03/29 22:37:54 conr Exp $
 *
 * swigptr.swg
 *
 * This file contains supporting code for the SWIG run-time type checking
 * mechanism.  The following functions are available :
 *
 * SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *));
 *
 *      Registers a new type-mapping with the type-checker.  origtype is the
 *      original datatype and newtype is an equivalent type.  cast is optional
 *      pointer to a function to cast pointer values between types (this
 *      is typically used to cast pointers from derived classes to base classes in C++)
 *      
 * SWIG_MakePtr(char *buffer, void *ptr, char *typestring);
 *     
 *      Makes a pointer string from a pointer and typestring.  The result is returned
 *      in buffer which is assumed to hold enough space for the result.
 *
 * char * SWIG_GetPtr(char *buffer, void **ptr, char *type)
 *
 *      Gets a pointer value from a string.  If there is a type-mismatch, returns
 *      a character string to the received type.  On success, returns NULL.
 *
 *
 * You can remap these functions by making a file called "swigptr.swg" in
 * your the same directory as the interface file you are wrapping.
 *
 * These functions are normally declared static, but this file can be
 * can be used in a multi-module environment by redefining the symbol
 * SWIGSTATIC.
 *****************************************************************************/

#include <stdlib.h>

#ifdef SWIG_GLOBAL
#ifdef __cplusplus
#define SWIGSTATIC extern "C"
#else
#define SWIGSTATIC
#endif
#endif

#ifndef SWIGSTATIC
#define SWIGSTATIC static
#endif


/* SWIG pointer structure */

typedef struct SwigPtrType {
  char               *name;               /* Datatype name                  */
  int                 len;                /* Length (used for optimization) */
  void               *(*cast)(void *);    /* Pointer casting function       */
  struct SwigPtrType *next;               /* Linked list pointer            */
} SwigPtrType;

/* Pointer cache structure */

typedef struct {
  int                 stat;               /* Status (valid) bit             */
  SwigPtrType        *tp;                 /* Pointer to type structure      */
  char                name[256];          /* Given datatype name            */
  char                mapped[256];        /* Equivalent name                */
} SwigCacheType;

/* Some variables  */

static int SwigPtrMax  = 64;           /* Max entries that can be currently held */
                                       /* This value may be adjusted dynamically */
static int SwigPtrN    = 0;            /* Current number of entries              */
static int SwigPtrSort = 0;            /* Status flag indicating sort            */
static int SwigStart[256];             /* Starting positions of types            */

/* Pointer table */
static SwigPtrType *SwigPtrTable = 0;  /* Table containing pointer equivalences  */

/* Cached values */

#define SWIG_CACHESIZE  8
#define SWIG_CACHEMASK  0x7
static SwigCacheType SwigCache[SWIG_CACHESIZE];  
static int SwigCacheIndex = 0;
static int SwigLastCache = 0;

/* Sort comparison function */
static int swigsort(const void *data1, const void *data2) {
	SwigPtrType *d1 = (SwigPtrType *) data1;
	SwigPtrType *d2 = (SwigPtrType *) data2;
	return strcmp(d1->name,d2->name);
}

/* Binary Search function */
static int swigcmp(const void *key, const void *data) {
  char *k = (char *) key;
  SwigPtrType *d = (SwigPtrType *) data;
  return strncmp(k,d->name,d->len);
}

/* Register a new datatype with the type-checker */

SWIGSTATIC 
void SWIG_RegisterMapping(char *origtype, char *newtype, void *(*cast)(void *)) {

  int i;
  SwigPtrType *t = 0,*t1;

  /* Allocate the pointer table if necessary */

  if (!SwigPtrTable) {     
    SwigPtrTable = (SwigPtrType *) malloc(SwigPtrMax*sizeof(SwigPtrType));
    SwigPtrN = 0;
  }
  /* Grow the table */
  if (SwigPtrN >= SwigPtrMax) {
    SwigPtrMax = 2*SwigPtrMax;
    SwigPtrTable = (SwigPtrType *) realloc((char *) SwigPtrTable,SwigPtrMax*sizeof(SwigPtrType));
  }
  for (i = 0; i < SwigPtrN; i++)
    if (strcmp(SwigPtrTable[i].name,origtype) == 0) {
      t = &SwigPtrTable[i];
      break;
    }
  if (!t) {
    t = &SwigPtrTable[SwigPtrN];
    t->name = origtype;
    t->len = strlen(t->name);
    t->cast = 0;
    t->next = 0;
    SwigPtrN++;
  }

  /* Check for existing entry */

  while (t->next) {
    if ((strcmp(t->name,newtype) == 0)) {
      if (cast) t->cast = cast;
      return;
    }
    t = t->next;
  }
  
  /* Now place entry (in sorted order) */

  t1 = (SwigPtrType *) malloc(sizeof(SwigPtrType));
  t1->name = newtype;
  t1->len = strlen(t1->name);
  t1->cast = cast;
  t1->next = 0;            
  t->next = t1;           
  SwigPtrSort = 0;
}

/* Make a pointer value string */

SWIGSTATIC 
void SWIG_MakePtr(char *_c, const void *_ptr, char *type) {
  static char _hex[16] =
  {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
   'a', 'b', 'c', 'd', 'e', 'f'};
  unsigned long _p, _s;
  char _result[20], *_r;    /* Note : a 64-bit hex number = 16 digits */
  _r = _result;
  _p = (unsigned long) _ptr;
  if (_p > 0) {
    while (_p > 0) {
      _s = _p & 0xf;
      *(_r++) = _hex[_s];
      _p = _p >> 4;
    }
    *_r = '_';
    while (_r >= _result)
      *(_c++) = *(_r--);
  } else {
    strcpy (_c, "NULL");
  }
  if (_ptr)
    strcpy (_c, type);
}

/* Define for backwards compatibility */

#define _swig_make_hex   SWIG_MakePtr 

/* Function for getting a pointer value */

SWIGSTATIC 
char *SWIG_GetPtr(char *_c, void **ptr, char *_t)
{
  unsigned long _p;
  char temp_type[256];
  char *name;
  int  i, len;
  SwigPtrType *sp,*tp;
  SwigCacheType *cache;
  int  start, end;
  _p = 0;

  /* Pointer values must start with leading underscore */
  if (*_c == '_') {
      _c++;
      /* Extract hex value from pointer */
      while (*_c) {
	  if ((*_c >= '0') && (*_c <= '9'))
	    _p = (_p << 4) + (*_c - '0');
	  else if ((*_c >= 'a') && (*_c <= 'f'))
	    _p = (_p << 4) + ((*_c - 'a') + 10);
	  else
	    break;
	  _c++;
      }

      if (_t) {
	if (strcmp(_t,_c)) { 
	  if (!SwigPtrSort) {
	    qsort((void *) SwigPtrTable, SwigPtrN, sizeof(SwigPtrType), swigsort); 
	    for (i = 0; i < 256; i++) {
	      SwigStart[i] = SwigPtrN;
	    }
	    for (i = SwigPtrN-1; i >= 0; i--) {
	      SwigStart[(int) (SwigPtrTable[i].name[1])] = i;
	    }
	    for (i = 255; i >= 1; i--) {
	      if (SwigStart[i-1] > SwigStart[i])
		SwigStart[i-1] = SwigStart[i];
	    }
	    SwigPtrSort = 1;
	    for (i = 0; i < SWIG_CACHESIZE; i++)  
	      SwigCache[i].stat = 0;
	  }
	  
	  /* First check cache for matches.  Uses last cache value as starting point */
	  cache = &SwigCache[SwigLastCache];
	  for (i = 0; i < SWIG_CACHESIZE; i++) {
	    if (cache->stat) {
	      if (strcmp(_t,cache->name) == 0) {
		if (strcmp(_c,cache->mapped) == 0) {
		  cache->stat++;
		  *ptr = (void *) _p;
		  if (cache->tp->cast) *ptr = (*(cache->tp->cast))(*ptr);
		  return (char *) 0;
		}
	      }
	    }
	    SwigLastCache = (SwigLastCache+1) & SWIG_CACHEMASK;
	    if (!SwigLastCache) cache = SwigCache;
	    else cache++;
	  }
	  /* We have a type mismatch.  Will have to look through our type
	     mapping table to figure out whether or not we can accept this datatype */

	  start = SwigStart[(int) _t[1]];
	  end = SwigStart[(int) _t[1]+1];
	  sp = &SwigPtrTable[start];
	  while (start < end) {
	    if (swigcmp(_t,sp) == 0) break;
	    sp++;
	    start++;
	  }
	  if (start >= end) sp = 0;
	  /* Try to find a match for this */
	  if (sp) {
	    while (swigcmp(_t,sp) == 0) {
	      name = sp->name;
	      len = sp->len;
	      tp = sp->next;
	      /* Try to find entry for our given datatype */
	      while(tp) {
		if (tp->len >= 255) {
		  return _c;
		}
		strcpy(temp_type,tp->name);
		strncat(temp_type,_t+len,255-tp->len);
		if (strcmp(_c,temp_type) == 0) {
		  
		  strcpy(SwigCache[SwigCacheIndex].mapped,_c);
		  strcpy(SwigCache[SwigCacheIndex].name,_t);
		  SwigCache[SwigCacheIndex].stat = 1;
		  SwigCache[SwigCacheIndex].tp = tp;
		  SwigCacheIndex = SwigCacheIndex & SWIG_CACHEMASK;
		  
		  /* Get pointer value */
		  *ptr = (void *) _p;
		  if (tp->cast) *ptr = (*(tp->cast))(*ptr);
		  return (char *) 0;
		}
		tp = tp->next;
	      }
	      sp++;
	      /* Hmmm. Didn't find it this time */
	    }
	  }
	  /* Didn't find any sort of match for this data.  
	     Get the pointer value and return the received type */
	  *ptr = (void *) _p;
	  return _c;
	} else {
	  /* Found a match on the first try.  Return pointer value */
	  *ptr = (void *) _p;
	  return (char *) 0;
	}
      } else {
	/* No type specified.  Good luck */
	*ptr = (void *) _p;
	return (char *) 0;
      }
  } else {
    if (strcmp (_c, "NULL") == 0) {
	*ptr = (void *) 0;
	return (char *) 0;
    }
    *ptr = (void *) 0;	
    return _c;
  }
}

/* Compatibility mode */

#define _swig_get_hex  SWIG_GetPtr

#define SWIG_init    initfb2wrap

#define SWIG_name    "fb2wrap"

#include "fb2parser.h"

static PyObject* l_output_helper(PyObject* target, PyObject* o) {
    PyObject*   o2;
    PyObject*   o3;
    if (!target) {                   
        target = o;
    } else if (target == Py_None) {  
        Py_DECREF(Py_None);
        target = o;
    } else {                         
        if (!PyList_Check(target)) {
            o2 = target;
            target = PyList_New(0);
            PyList_Append(target, o2);
	    Py_XDECREF(o2);
        }
        PyList_Append(target,o);
	Py_XDECREF(o);
    }
    return target;
}

static PyObject* t_output_helper(PyObject* target, PyObject* o) {
    PyObject*   o2;
    PyObject*   o3;

    if (!target) {                   
        target = o;
    } else if (target == Py_None) {  
        Py_DECREF(Py_None);
        target = o;
    } else {                         
        if (!PyTuple_Check(target)) {
            o2 = target;
            target = PyTuple_New(1);
            PyTuple_SetItem(target, 0, o2);
        }
        o3 = PyTuple_New(1);            
        PyTuple_SetItem(o3, 0, o);      

        o2 = target;
        target = PySequence_Concat(o2, o3); 
        Py_DECREF(o2);                      
        Py_DECREF(o3);
    }
    return target;
}
static PyObject *_wrap_parseFile(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    FB2Content * _result;
    char * _arg0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:parseFile",&_arg0)) 
        return NULL;
    _result = (FB2Content *)parseFile(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_FB2Content_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

static PyObject *_wrap_freeFB2(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:freeFB2",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of freeFB2. Expected _FB2Content_p.");
        return NULL;
        }
    }
    freeFB2(_arg0);
    Py_INCREF(Py_None);
    _resultobj = Py_None;
    return _resultobj;
}

#define FB2Mark_type_set(_swigobj,_swigval) (_swigobj->type = _swigval,_swigval)
static PyObject *_wrap_FB2Mark_type_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Mark_type_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_type_set. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_type_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_type_get(_swigobj) ((int ) _swigobj->type)
static PyObject *_wrap_FB2Mark_type_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Mark_type_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_type_get. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_type_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_start_set(_swigobj,_swigval) (_swigobj->start = _swigval,_swigval)
static PyObject *_wrap_FB2Mark_start_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Mark_start_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_start_set. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_start_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_start_get(_swigobj) ((int ) _swigobj->start)
static PyObject *_wrap_FB2Mark_start_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Mark_start_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_start_get. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_start_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_end_set(_swigobj,_swigval) (_swigobj->end = _swigval,_swigval)
static PyObject *_wrap_FB2Mark_end_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Mark_end_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_end_set. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_end_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_end_get(_swigobj) ((int ) _swigobj->end)
static PyObject *_wrap_FB2Mark_end_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Mark_end_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_end_get. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_end_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_id_get(_swigobj) ((char *) _swigobj->id)
static PyObject *_wrap_FB2Mark_id_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Mark * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Mark_id_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_id_get. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Mark_id_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Mark_link_start_set(_swigobj,_swigval) (_swigobj->link_start = _swigval,_swigval)
static PyObject *_wrap_FB2Mark_link_start_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Mark_link_start_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_link_start_set. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_link_start_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_link_start_get(_swigobj) ((int ) _swigobj->link_start)
static PyObject *_wrap_FB2Mark_link_start_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Mark_link_start_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_link_start_get. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_link_start_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_link_end_set(_swigobj,_swigval) (_swigobj->link_end = _swigval,_swigval)
static PyObject *_wrap_FB2Mark_link_end_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Mark_link_end_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_link_end_set. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_link_end_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Mark_link_end_get(_swigobj) ((int ) _swigobj->link_end)
static PyObject *_wrap_FB2Mark_link_end_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Mark * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Mark_link_end_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Mark_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Mark_link_end_get. Expected _FB2Mark_p.");
        return NULL;
        }
    }
    _result = (int )FB2Mark_link_end_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

static char * FB2Binary_buffer_set(FB2Binary *obj, char *val) {
    if (obj->buffer) free(obj->buffer);
    obj->buffer = (char *) malloc(strlen(val)+1);
    strcpy(obj->buffer,val);
    return val;
}
static PyObject *_wrap_FB2Binary_buffer_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Binary * _arg0;
    char * _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"ss:FB2Binary_buffer_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_buffer_set. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Binary_buffer_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Binary_buffer_get(_swigobj) ((char *) _swigobj->buffer)
static PyObject *_wrap_FB2Binary_buffer_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Binary * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Binary_buffer_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_buffer_get. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Binary_buffer_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Binary_buffer_size_set(_swigobj,_swigval) (_swigobj->buffer_size = *(_swigval),_swigval)
static PyObject *_wrap_FB2Binary_buffer_size_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    size_t * _result;
    FB2Binary * _arg0;
    size_t * _arg1;
    char * _argc0 = 0;
    char * _argc1 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"ss:FB2Binary_buffer_size_set",&_argc0,&_argc1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_buffer_size_set. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    if (_argc1) {
        if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_size_t_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of FB2Binary_buffer_size_set. Expected _size_t_p.");
        return NULL;
        }
    }
    _result = (size_t *)FB2Binary_buffer_size_set(_arg0,_arg1);
    SWIG_MakePtr(_ptemp, (char *) _result,"_size_t_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Binary_buffer_size_get(_swigobj) (&_swigobj->buffer_size)
static PyObject *_wrap_FB2Binary_buffer_size_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    size_t * _result;
    FB2Binary * _arg0;
    char * _argc0 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Binary_buffer_size_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_buffer_size_get. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (size_t *)FB2Binary_buffer_size_get(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_size_t_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Binary_current_index_set(_swigobj,_swigval) (_swigobj->current_index = _swigval,_swigval)
static PyObject *_wrap_FB2Binary_current_index_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Binary * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Binary_current_index_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_current_index_set. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (int )FB2Binary_current_index_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Binary_current_index_get(_swigobj) ((int ) _swigobj->current_index)
static PyObject *_wrap_FB2Binary_current_index_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Binary * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Binary_current_index_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_current_index_get. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (int )FB2Binary_current_index_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Binary_id_get(_swigobj) ((char *) _swigobj->id)
static PyObject *_wrap_FB2Binary_id_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Binary * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Binary_id_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_id_get. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Binary_id_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Binary_content_type_get(_swigobj) ((char *) _swigobj->content_type)
static PyObject *_wrap_FB2Binary_content_type_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Binary * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Binary_content_type_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Binary_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Binary_content_type_get. Expected _FB2Binary_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Binary_content_type_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

static char * FB2Content_text_set(FB2Content *obj, char *val) {
    if (obj->text) free(obj->text);
    obj->text = (char *) malloc(strlen(val)+1);
    strcpy(obj->text,val);
    return val;
}
static PyObject *_wrap_FB2Content_text_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"ss:FB2Content_text_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_text_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_text_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Content_text_get(_swigobj) ((char *) _swigobj->text)
static PyObject *_wrap_FB2Content_text_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_text_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_text_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_text_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Content_text_buffer_size_set(_swigobj,_swigval) (_swigobj->text_buffer_size = *(_swigval),_swigval)
static PyObject *_wrap_FB2Content_text_buffer_size_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    size_t * _result;
    FB2Content * _arg0;
    size_t * _arg1;
    char * _argc0 = 0;
    char * _argc1 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"ss:FB2Content_text_buffer_size_set",&_argc0,&_argc1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_text_buffer_size_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    if (_argc1) {
        if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_size_t_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of FB2Content_text_buffer_size_set. Expected _size_t_p.");
        return NULL;
        }
    }
    _result = (size_t *)FB2Content_text_buffer_size_set(_arg0,_arg1);
    SWIG_MakePtr(_ptemp, (char *) _result,"_size_t_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_text_buffer_size_get(_swigobj) (&_swigobj->text_buffer_size)
static PyObject *_wrap_FB2Content_text_buffer_size_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    size_t * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_text_buffer_size_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_text_buffer_size_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (size_t *)FB2Content_text_buffer_size_get(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_size_t_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_text_current_index_set(_swigobj,_swigval) (_swigobj->text_current_index = _swigval,_swigval)
static PyObject *_wrap_FB2Content_text_current_index_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_text_current_index_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_text_current_index_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_text_current_index_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_text_current_index_get(_swigobj) ((int ) _swigobj->text_current_index)
static PyObject *_wrap_FB2Content_text_current_index_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_text_current_index_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_text_current_index_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_text_current_index_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_utf8_current_index_set(_swigobj,_swigval) (_swigobj->utf8_current_index = _swigval,_swigval)
static PyObject *_wrap_FB2Content_utf8_current_index_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_utf8_current_index_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_utf8_current_index_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_utf8_current_index_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_utf8_current_index_get(_swigobj) ((int ) _swigobj->utf8_current_index)
static PyObject *_wrap_FB2Content_utf8_current_index_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_utf8_current_index_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_utf8_current_index_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_utf8_current_index_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

static char * FB2Content_description_set(FB2Content *obj, char *val) {
    if (obj->description) free(obj->description);
    obj->description = (char *) malloc(strlen(val)+1);
    strcpy(obj->description,val);
    return val;
}
static PyObject *_wrap_FB2Content_description_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"ss:FB2Content_description_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_description_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_description_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Content_description_get(_swigobj) ((char *) _swigobj->description)
static PyObject *_wrap_FB2Content_description_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_description_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_description_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_description_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Content_description_buffer_size_set(_swigobj,_swigval) (_swigobj->description_buffer_size = *(_swigval),_swigval)
static PyObject *_wrap_FB2Content_description_buffer_size_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    size_t * _result;
    FB2Content * _arg0;
    size_t * _arg1;
    char * _argc0 = 0;
    char * _argc1 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"ss:FB2Content_description_buffer_size_set",&_argc0,&_argc1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_description_buffer_size_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    if (_argc1) {
        if (SWIG_GetPtr(_argc1,(void **) &_arg1,"_size_t_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of FB2Content_description_buffer_size_set. Expected _size_t_p.");
        return NULL;
        }
    }
    _result = (size_t *)FB2Content_description_buffer_size_set(_arg0,_arg1);
    SWIG_MakePtr(_ptemp, (char *) _result,"_size_t_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_description_buffer_size_get(_swigobj) (&_swigobj->description_buffer_size)
static PyObject *_wrap_FB2Content_description_buffer_size_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    size_t * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_description_buffer_size_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_description_buffer_size_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (size_t *)FB2Content_description_buffer_size_get(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_size_t_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_description_current_index_set(_swigobj,_swigval) (_swigobj->description_current_index = _swigval,_swigval)
static PyObject *_wrap_FB2Content_description_current_index_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_description_current_index_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_description_current_index_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_description_current_index_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_description_current_index_get(_swigobj) ((int ) _swigobj->description_current_index)
static PyObject *_wrap_FB2Content_description_current_index_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_description_current_index_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_description_current_index_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_description_current_index_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_author_get(_swigobj) ((char *) _swigobj->author)
static PyObject *_wrap_FB2Content_author_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_author_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_author_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_author_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Content_name_get(_swigobj) ((char *) _swigobj->name)
static PyObject *_wrap_FB2Content_name_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_name_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_name_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_name_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

#define FB2Content_genres_get(_swigobj) ((char **) _swigobj->genres)
static PyObject *_wrap_FB2Content_genres_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char ** _result;
    FB2Content * _arg0;
    char * _argc0 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_genres_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_genres_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char **)FB2Content_genres_get(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_char_pp");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_num_genres_set(_swigobj,_swigval) (_swigobj->num_genres = _swigval,_swigval)
static PyObject *_wrap_FB2Content_num_genres_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_num_genres_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_num_genres_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_num_genres_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_num_genres_get(_swigobj) ((int ) _swigobj->num_genres)
static PyObject *_wrap_FB2Content_num_genres_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_num_genres_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_num_genres_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_num_genres_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_marks_get(_swigobj) ((FB2Mark **) _swigobj->marks)
static PyObject *_wrap_FB2Content_marks_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    FB2Mark ** _result;
    FB2Content * _arg0;
    char * _argc0 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_marks_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_marks_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (FB2Mark **)FB2Content_marks_get(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_FB2Mark_pp");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_num_marks_set(_swigobj,_swigval) (_swigobj->num_marks = _swigval,_swigval)
static PyObject *_wrap_FB2Content_num_marks_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_num_marks_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_num_marks_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_num_marks_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_num_marks_get(_swigobj) ((int ) _swigobj->num_marks)
static PyObject *_wrap_FB2Content_num_marks_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_num_marks_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_num_marks_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_num_marks_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_current_buffer_set(_swigobj,_swigval) (_swigobj->current_buffer = _swigval,_swigval)
static PyObject *_wrap_FB2Content_current_buffer_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_current_buffer_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_current_buffer_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_current_buffer_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_current_buffer_get(_swigobj) ((int ) _swigobj->current_buffer)
static PyObject *_wrap_FB2Content_current_buffer_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_current_buffer_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_current_buffer_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_current_buffer_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_binaries_get(_swigobj) ((FB2Binary **) _swigobj->binaries)
static PyObject *_wrap_FB2Content_binaries_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    FB2Binary ** _result;
    FB2Content * _arg0;
    char * _argc0 = 0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_binaries_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_binaries_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (FB2Binary **)FB2Content_binaries_get(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_FB2Binary_pp");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

#define FB2Content_num_binaries_set(_swigobj,_swigval) (_swigobj->num_binaries = _swigval,_swigval)
static PyObject *_wrap_FB2Content_num_binaries_set(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_num_binaries_set",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_num_binaries_set. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_num_binaries_set(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_num_binaries_get(_swigobj) ((int ) _swigobj->num_binaries)
static PyObject *_wrap_FB2Content_num_binaries_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_num_binaries_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_num_binaries_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_num_binaries_get(_arg0);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

#define FB2Content_cover_href_get(_swigobj) ((char *) _swigobj->cover_href)
static PyObject *_wrap_FB2Content_cover_href_get(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:FB2Content_cover_href_get",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_cover_href_get. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_cover_href_get(_arg0);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

static FB2Content *new_FB2Content(char *filename) {
    return parseFile(filename);
  }

static PyObject *_wrap_new_FB2Content(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    FB2Content * _result;
    char * _arg0;
    char _ptemp[128];

    self = self;
    if(!PyArg_ParseTuple(args,"s:new_FB2Content",&_arg0)) 
        return NULL;
    _result = (FB2Content *)new_FB2Content(_arg0);
    SWIG_MakePtr(_ptemp, (char *) _result,"_FB2Content_p");
    _resultobj = Py_BuildValue("s",_ptemp);
    return _resultobj;
}

static void delete_FB2Content(FB2Content *self) {
    freeFB2(self);
  }
static PyObject *_wrap_delete_FB2Content(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    FB2Content * _arg0;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"s:delete_FB2Content",&_argc0)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of delete_FB2Content. Expected _FB2Content_p.");
        return NULL;
        }
    }
    delete_FB2Content(_arg0);
    Py_INCREF(Py_None);
    _resultobj = Py_None;
    return _resultobj;
}

static int  FB2Content_get_mark(FB2Content *self,int  n,int * offset,int * length,int * type) {
    int len;

    if (!self) return -1;
    if (n >= self->num_marks || n < 0) return -1;

    *offset = self->marks[n]->start;
    len = self->marks[n]->end - self->marks[n]->start;
    if (len < 0) *length = 0;
    else *length = len;
    *type = self->marks[n]->type;

    return 0;
  }
static PyObject *_wrap_FB2Content_get_mark(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    int * _arg2;
    int  temp;
    int * _arg3;
    int  temp0;
    int * _arg4;
    int  temp1;
    char * _argc0 = 0;

    self = self;
{
  _arg2 = &temp;
}
{
  _arg3 = &temp0;
}
{
  _arg4 = &temp1;
}
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_mark",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_mark. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_get_mark(_arg0,_arg1,_arg2,_arg3,_arg4);
    _resultobj = Py_BuildValue("i",_result);
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg2));
    _resultobj = t_output_helper(_resultobj, o);
}
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg3));
    _resultobj = t_output_helper(_resultobj, o);
}
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg4));
    _resultobj = t_output_helper(_resultobj, o);
}
    return _resultobj;
}

static int  FB2Content_get_link(FB2Content *self,int  n,int * start,int * end,int * link_start,int * link_end,int * type) {

    if (!self) return -1;
    if (n >= self->num_marks || n < 0) return -1;

    *start = self->marks[n]->start;
    *end = self->marks[n]->end;
    *link_start = self->marks[n]->link_start;
    *link_end = self->marks[n]->link_end;
    *type = self->marks[n]->type;

    return 0;
  }
static PyObject *_wrap_FB2Content_get_link(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    int * _arg2;
    int  temp;
    int * _arg3;
    int  temp0;
    int * _arg4;
    int  temp1;
    int * _arg5;
    int  temp2;
    int * _arg6;
    int  temp3;
    char * _argc0 = 0;

    self = self;
{
  _arg2 = &temp;
}
{
  _arg3 = &temp0;
}
{
  _arg4 = &temp1;
}
{
  _arg5 = &temp2;
}
{
  _arg6 = &temp3;
}
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_link",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_link. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_get_link(_arg0,_arg1,_arg2,_arg3,_arg4,_arg5,_arg6);
    _resultobj = Py_BuildValue("i",_result);
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg2));
    _resultobj = t_output_helper(_resultobj, o);
}
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg3));
    _resultobj = t_output_helper(_resultobj, o);
}
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg4));
    _resultobj = t_output_helper(_resultobj, o);
}
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg5));
    _resultobj = t_output_helper(_resultobj, o);
}
{
    PyObject *o;
    o = PyInt_FromLong((long) (*_arg6));
    _resultobj = t_output_helper(_resultobj, o);
}
    return _resultobj;
}

static char * FB2Content_get_genre(FB2Content *self,int  n) {
    if (!self) return NULL;
    if (n >= self->num_genres || n < 0) return NULL;
    return self->genres[n];
  }
static PyObject *_wrap_FB2Content_get_genre(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_genre",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_genre. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_get_genre(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

static char * FB2Content_get_binary_data(FB2Content *self,int  n) {
    if (!self) return NULL;
    if (n >= self->num_binaries || n < 0) return NULL;
    return self->binaries[n]->buffer;
  }
static PyObject *_wrap_FB2Content_get_binary_data(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_binary_data",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_binary_data. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_get_binary_data(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

static char * FB2Content_get_binary_id(FB2Content *self,int  n) {
    if (!self) return NULL;
    if (n >= self->num_binaries || n < 0) return NULL;
    return self->binaries[n]->id;
  }
static PyObject *_wrap_FB2Content_get_binary_id(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_binary_id",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_binary_id. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_get_binary_id(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

static char * FB2Content_get_binary_content_type(FB2Content *self,int  n) {
    if (!self) return NULL;
    if (n >= self->num_binaries || n < 0) return NULL;
    return self->binaries[n]->content_type;
  }
static PyObject *_wrap_FB2Content_get_binary_content_type(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    char * _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_binary_content_type",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_binary_content_type. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (char *)FB2Content_get_binary_content_type(_arg0,_arg1);
    _resultobj = Py_BuildValue("s", _result);
    return _resultobj;
}

static int  FB2Content_get_binary_offset(FB2Content *self,int  n) {
    int i, mi;

    if (!self) return -1;
    if (n >= self->num_binaries || n < 0) return -1;

    /* search mark index */
    mi = -1;
    for (i=0; i<BUF_SIZE-1; i++) {
      FB2Mark *m;

      m = self->marks[i];
      if (m == NULL) {
	break;
      }
      if (m->type == IMAGE_TYPE) {
	//printf("%s -- %s\n", self->binaries[n]->id, m->id);
	if (!strcmp(self->binaries[n]->id, m->id+1)) { /* skip leading "#" */
	  mi = i;
	  break;
	}
      }
    }

    if (mi>=0)
      return self->marks[mi]->start;
    else
      return -1;

  }
static PyObject *_wrap_FB2Content_get_binary_offset(PyObject *self, PyObject *args) {
    PyObject * _resultobj;
    int  _result;
    FB2Content * _arg0;
    int  _arg1;
    char * _argc0 = 0;

    self = self;
    if(!PyArg_ParseTuple(args,"si:FB2Content_get_binary_offset",&_argc0,&_arg1)) 
        return NULL;
    if (_argc0) {
        if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_FB2Content_p")) {
            PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of FB2Content_get_binary_offset. Expected _FB2Content_p.");
        return NULL;
        }
    }
    _result = (int )FB2Content_get_binary_offset(_arg0,_arg1);
    _resultobj = Py_BuildValue("i",_result);
    return _resultobj;
}

static PyMethodDef fb2wrapMethods[] = {
	 { "FB2Content_get_binary_offset", _wrap_FB2Content_get_binary_offset, 1 },
	 { "FB2Content_get_binary_content_type", _wrap_FB2Content_get_binary_content_type, 1 },
	 { "FB2Content_get_binary_id", _wrap_FB2Content_get_binary_id, 1 },
	 { "FB2Content_get_binary_data", _wrap_FB2Content_get_binary_data, 1 },
	 { "FB2Content_get_genre", _wrap_FB2Content_get_genre, 1 },
	 { "FB2Content_get_link", _wrap_FB2Content_get_link, 1 },
	 { "FB2Content_get_mark", _wrap_FB2Content_get_mark, 1 },
	 { "delete_FB2Content", _wrap_delete_FB2Content, 1 },
	 { "new_FB2Content", _wrap_new_FB2Content, 1 },
	 { "FB2Content_cover_href_get", _wrap_FB2Content_cover_href_get, 1 },
	 { "FB2Content_num_binaries_get", _wrap_FB2Content_num_binaries_get, 1 },
	 { "FB2Content_num_binaries_set", _wrap_FB2Content_num_binaries_set, 1 },
	 { "FB2Content_binaries_get", _wrap_FB2Content_binaries_get, 1 },
	 { "FB2Content_current_buffer_get", _wrap_FB2Content_current_buffer_get, 1 },
	 { "FB2Content_current_buffer_set", _wrap_FB2Content_current_buffer_set, 1 },
	 { "FB2Content_num_marks_get", _wrap_FB2Content_num_marks_get, 1 },
	 { "FB2Content_num_marks_set", _wrap_FB2Content_num_marks_set, 1 },
	 { "FB2Content_marks_get", _wrap_FB2Content_marks_get, 1 },
	 { "FB2Content_num_genres_get", _wrap_FB2Content_num_genres_get, 1 },
	 { "FB2Content_num_genres_set", _wrap_FB2Content_num_genres_set, 1 },
	 { "FB2Content_genres_get", _wrap_FB2Content_genres_get, 1 },
	 { "FB2Content_name_get", _wrap_FB2Content_name_get, 1 },
	 { "FB2Content_author_get", _wrap_FB2Content_author_get, 1 },
	 { "FB2Content_description_current_index_get", _wrap_FB2Content_description_current_index_get, 1 },
	 { "FB2Content_description_current_index_set", _wrap_FB2Content_description_current_index_set, 1 },
	 { "FB2Content_description_buffer_size_get", _wrap_FB2Content_description_buffer_size_get, 1 },
	 { "FB2Content_description_buffer_size_set", _wrap_FB2Content_description_buffer_size_set, 1 },
	 { "FB2Content_description_get", _wrap_FB2Content_description_get, 1 },
	 { "FB2Content_description_set", _wrap_FB2Content_description_set, 1 },
	 { "FB2Content_utf8_current_index_get", _wrap_FB2Content_utf8_current_index_get, 1 },
	 { "FB2Content_utf8_current_index_set", _wrap_FB2Content_utf8_current_index_set, 1 },
	 { "FB2Content_text_current_index_get", _wrap_FB2Content_text_current_index_get, 1 },
	 { "FB2Content_text_current_index_set", _wrap_FB2Content_text_current_index_set, 1 },
	 { "FB2Content_text_buffer_size_get", _wrap_FB2Content_text_buffer_size_get, 1 },
	 { "FB2Content_text_buffer_size_set", _wrap_FB2Content_text_buffer_size_set, 1 },
	 { "FB2Content_text_get", _wrap_FB2Content_text_get, 1 },
	 { "FB2Content_text_set", _wrap_FB2Content_text_set, 1 },
	 { "FB2Binary_content_type_get", _wrap_FB2Binary_content_type_get, 1 },
	 { "FB2Binary_id_get", _wrap_FB2Binary_id_get, 1 },
	 { "FB2Binary_current_index_get", _wrap_FB2Binary_current_index_get, 1 },
	 { "FB2Binary_current_index_set", _wrap_FB2Binary_current_index_set, 1 },
	 { "FB2Binary_buffer_size_get", _wrap_FB2Binary_buffer_size_get, 1 },
	 { "FB2Binary_buffer_size_set", _wrap_FB2Binary_buffer_size_set, 1 },
	 { "FB2Binary_buffer_get", _wrap_FB2Binary_buffer_get, 1 },
	 { "FB2Binary_buffer_set", _wrap_FB2Binary_buffer_set, 1 },
	 { "FB2Mark_link_end_get", _wrap_FB2Mark_link_end_get, 1 },
	 { "FB2Mark_link_end_set", _wrap_FB2Mark_link_end_set, 1 },
	 { "FB2Mark_link_start_get", _wrap_FB2Mark_link_start_get, 1 },
	 { "FB2Mark_link_start_set", _wrap_FB2Mark_link_start_set, 1 },
	 { "FB2Mark_id_get", _wrap_FB2Mark_id_get, 1 },
	 { "FB2Mark_end_get", _wrap_FB2Mark_end_get, 1 },
	 { "FB2Mark_end_set", _wrap_FB2Mark_end_set, 1 },
	 { "FB2Mark_start_get", _wrap_FB2Mark_start_get, 1 },
	 { "FB2Mark_start_set", _wrap_FB2Mark_start_set, 1 },
	 { "FB2Mark_type_get", _wrap_FB2Mark_type_get, 1 },
	 { "FB2Mark_type_set", _wrap_FB2Mark_type_set, 1 },
	 { "freeFB2", _wrap_freeFB2, 1 },
	 { "parseFile", _wrap_parseFile, 1 },
	 { NULL, NULL }
};
static PyObject *SWIG_globals;
#ifdef __cplusplus
extern "C" 
#endif
SWIGEXPORT(void,initfb2wrap)() {
	 PyObject *m, *d;
	 SWIG_globals = SWIG_newvarlink();
	 m = Py_InitModule("fb2wrap", fb2wrapMethods);
	 d = PyModule_GetDict(m);
	 PyDict_SetItemString(d,"BUF_SIZE", PyInt_FromLong((long) 1024));
	 PyDict_SetItemString(d,"DESCRIPTION_BUFFER", PyInt_FromLong((long) 1));
	 PyDict_SetItemString(d,"TEXT_BUFFER", PyInt_FromLong((long) 2));
	 PyDict_SetItemString(d,"BINARY_BUFFER", PyInt_FromLong((long) 3));
	 PyDict_SetItemString(d,"BOOKMARK_TYPE", PyInt_FromLong((long) 0));
	 PyDict_SetItemString(d,"LINK_TYPE", PyInt_FromLong((long) 10));
	 PyDict_SetItemString(d,"NOTE_TYPE", PyInt_FromLong((long) 11));
	 PyDict_SetItemString(d,"IMAGE_TYPE", PyInt_FromLong((long) 20));
	 PyDict_SetItemString(d,"STRONG_TYPE", PyInt_FromLong((long) 30));
	 PyDict_SetItemString(d,"EMPHASIS_TYPE", PyInt_FromLong((long) 31));
	 PyDict_SetItemString(d,"NAMED_STYLE_TYPE", PyInt_FromLong((long) 32));
/*
 * These are the pointer type-equivalency mappings. 
 * (Used by the SWIG pointer type-checker).
 */
	 SWIG_RegisterMapping("_signed_long","_long",0);
	 SWIG_RegisterMapping("_long","_unsigned_long",0);
	 SWIG_RegisterMapping("_long","_signed_long",0);
	 SWIG_RegisterMapping("_unsigned_long","_long",0);
	 SWIG_RegisterMapping("_signed_int","_int",0);
	 SWIG_RegisterMapping("_unsigned_short","_short",0);
	 SWIG_RegisterMapping("_signed_short","_short",0);
	 SWIG_RegisterMapping("_unsigned_int","_int",0);
	 SWIG_RegisterMapping("_short","_unsigned_short",0);
	 SWIG_RegisterMapping("_short","_signed_short",0);
	 SWIG_RegisterMapping("_int","_unsigned_int",0);
	 SWIG_RegisterMapping("_int","_signed_int",0);
}
