1
/* ----------------------------------------------------------------------------
2
* This file was automatically generated by SWIG (http://www.swig.org).
5
* This file is not intended to be easily readable and contains a number of
6
* coding conventions designed to improve portability and efficiency. Do not make
7
* changes to this file unless you know what you are doing--modify the SWIG
8
* interface file instead.
9
* ----------------------------------------------------------------------------- */
12
/***********************************************************************
14
* This section contains generic SWIG labels for method/variable
15
* declarations/attributes, and other compiler dependent labels.
17
************************************************************************/
19
/* template workaround for compilers that cannot correctly implement the C++ standard */
20
#ifndef SWIGTEMPLATEDISAMBIGUATOR
21
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
22
# define SWIGTEMPLATEDISAMBIGUATOR template
24
# define SWIGTEMPLATEDISAMBIGUATOR
28
/* inline attribute */
30
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
31
# define SWIGINLINE inline
37
/* attribute recognised by some compilers to avoid 'unused' warnings */
39
# if defined(__GNUC__) || defined(__ICC)
40
# define SWIGUNUSED __attribute__ ((unused))
46
/* internal SWIG method */
48
# define SWIGINTERN static SWIGUNUSED
51
/* internal inline SWIG method */
52
#ifndef SWIGINTERNINLINE
53
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
56
/* exporting methods for Windows DLLs */
58
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
59
# if defined(STATIC_LINKED)
62
# define SWIGEXPORT __declspec(dllexport)
69
/* calling conventions for Windows */
71
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
72
# define SWIGSTDCALL __stdcall
82
/***********************************************************************
85
* This file contains generic CAPI SWIG runtime support for pointer
88
************************************************************************/
90
/* This should only be incremented when either the layout of swig_type_info changes,
91
or for whatever reason, the runtime changes incompatibly */
92
#define SWIG_RUNTIME_VERSION "2"
94
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
95
#ifdef SWIG_TYPE_TABLE
96
# define SWIG_QUOTE_STRING(x) #x
97
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
98
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
100
# define SWIG_TYPE_TABLE_NAME
104
You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
105
creating a static or dynamic library from the swig runtime code.
106
In 99.9% of the cases, swig just needs to declare them as 'static'.
108
But only do this if is strictly necessary, ie, if you have problems
109
with your compiler or so.
113
# define SWIGRUNTIME SWIGINTERN
116
#ifndef SWIGRUNTIMEINLINE
117
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
126
typedef void *(*swig_converter_func)(void *);
127
typedef struct swig_type_info *(*swig_dycast_func)(void **);
129
/* Structure to store inforomation on one type */
130
typedef struct swig_type_info {
131
const char *name; /* mangled name of this type */
132
const char *str; /* human readable name of this type */
133
swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
134
struct swig_cast_info *cast; /* linked list of types that can cast into this type */
135
void *clientdata; /* language specific type data */
138
/* Structure to store a type and conversion function used for casting */
139
typedef struct swig_cast_info {
140
swig_type_info *type; /* pointer to type that is equivalent to this type */
141
swig_converter_func converter; /* function to cast the void pointers */
142
struct swig_cast_info *next; /* pointer to next cast in linked list */
143
struct swig_cast_info *prev; /* pointer to the previous cast */
146
/* Structure used to store module information
147
* Each module generates one structure like this, and the runtime collects
148
* all of these structures and stores them in a circularly linked list.*/
149
typedef struct swig_module_info {
150
swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
151
size_t size; /* Number of types in this module */
152
struct swig_module_info *next; /* Pointer to next element in circularly linked list */
153
swig_type_info **type_initial; /* Array of initially generated type structures */
154
swig_cast_info **cast_initial; /* Array of initially generated casting structures */
155
void *clientdata; /* Language specific module data */
160
Compare two type names skipping the space characters, therefore
161
"char*" == "char *" and "Class<int>" == "Class<int >", etc.
163
Return 0 when the two name types are equivalent, as in
164
strncmp, but skipping ' '.
167
SWIG_TypeNameComp(const char *f1, const char *l1,
168
const char *f2, const char *l2) {
169
for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
170
while ((*f1 == ' ') && (f1 != l1)) ++f1;
171
while ((*f2 == ' ') && (f2 != l2)) ++f2;
172
if (*f1 != *f2) return (int)(*f1 - *f2);
174
return (l1 - f1) - (l2 - f2);
178
Check type equivalence in a name list like <name1>|<name2>|...
179
Return 0 if not equal, 1 if equal
182
SWIG_TypeEquiv(const char *nb, const char *tb) {
184
const char* te = tb + strlen(tb);
186
while (!equiv && *ne) {
187
for (nb = ne; *ne; ++ne) {
188
if (*ne == '|') break;
190
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
197
Check type equivalence in a name list like <name1>|<name2>|...
198
Return 0 if equal, -1 if nb < tb, 1 if nb > tb
201
SWIG_TypeCompare(const char *nb, const char *tb) {
203
const char* te = tb + strlen(tb);
205
while (!equiv && *ne) {
206
for (nb = ne; *ne; ++ne) {
207
if (*ne == '|') break;
209
equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
216
/* think of this as a c++ template<> or a scheme macro */
217
#define SWIG_TypeCheck_Template(comparison, ty) \
219
swig_cast_info *iter = ty->cast; \
222
if (iter == ty->cast) return iter; \
223
/* Move iter to the top of the linked list */ \
224
iter->prev->next = iter->next; \
226
iter->next->prev = iter->prev; \
227
iter->next = ty->cast; \
229
if (ty->cast) ty->cast->prev = iter; \
241
SWIGRUNTIME swig_cast_info *
242
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
243
SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
246
/* Same as previous function, except strcmp is replaced with a pointer comparison */
247
SWIGRUNTIME swig_cast_info *
248
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
249
SWIG_TypeCheck_Template(iter->type == from, into);
253
Cast a pointer up an inheritance hierarchy
255
SWIGRUNTIMEINLINE void *
256
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
257
return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
261
Dynamic pointer casting. Down an inheritance hierarchy
263
SWIGRUNTIME swig_type_info *
264
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
265
swig_type_info *lastty = ty;
266
if (!ty || !ty->dcast) return ty;
267
while (ty && (ty->dcast)) {
268
ty = (*ty->dcast)(ptr);
275
Return the name associated with this type
277
SWIGRUNTIMEINLINE const char *
278
SWIG_TypeName(const swig_type_info *ty) {
283
Return the pretty name associated with this type,
284
that is an unmangled type name in a form presentable to the user.
286
SWIGRUNTIME const char *
287
SWIG_TypePrettyName(const swig_type_info *type) {
288
/* The "str" field contains the equivalent pretty names of the
289
type, separated by vertical-bar characters. We choose
290
to print the last name, as it is often (?) the most
292
if (type->str != NULL) {
293
const char *last_name = type->str;
295
for (s = type->str; *s; s++)
296
if (*s == '|') last_name = s+1;
304
Set the clientdata field for a type
307
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
308
if (!ti->clientdata) {
309
swig_cast_info *cast = ti->cast;
310
/* if (ti->clientdata == clientdata) return; */
311
ti->clientdata = clientdata;
314
if (!cast->converter)
315
SWIG_TypeClientData(cast->type, clientdata);
322
Search for a swig_type_info structure only by mangled name
323
Search is a O(log #types)
325
We start searching at module start, and finish searching when start == end.
326
Note: if start == end at the beginning of the function, we go all the way around
329
SWIGRUNTIME swig_type_info *
330
SWIG_MangledTypeQueryModule(swig_module_info *start,
331
swig_module_info *end,
333
swig_module_info *iter = start;
336
register size_t l = 0;
337
register size_t r = iter->size - 1;
339
/* since l+r >= 0, we can (>> 1) instead (/ 2) */
340
register size_t i = (l + r) >> 1;
341
const char *iname = iter->types[i]->name;
343
register int compare = strcmp(name, iname);
345
return iter->types[i];
346
} else if (compare < 0) {
352
} else if (compare > 0) {
356
break; /* should never happen */
361
} while (iter != end);
366
Search for a swig_type_info structure for either a mangled name or a human readable name.
367
It first searches the mangled names of the types, which is a O(log #types)
368
If a type is not found it then searches the human readable names, which is O(#types).
370
We start searching at module start, and finish searching when start == end.
371
Note: if start == end at the beginning of the function, we go all the way around
374
SWIGRUNTIME swig_type_info *
375
SWIG_TypeQueryModule(swig_module_info *start,
376
swig_module_info *end,
378
/* STEP 1: Search the name field using binary search */
379
swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
383
/* STEP 2: If the type hasn't been found, do a complete search
384
of the str field (the human readable name) */
385
swig_module_info *iter = start;
387
register size_t i = 0;
388
for (; i < iter->size; ++i) {
389
if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
390
return iter->types[i];
393
} while (iter != end);
396
/* neither found a match */
402
Pack binary data into a string
405
SWIG_PackData(char *c, void *ptr, size_t sz) {
406
static const char hex[17] = "0123456789abcdef";
407
register const unsigned char *u = (unsigned char *) ptr;
408
register const unsigned char *eu = u + sz;
409
for (; u != eu; ++u) {
410
register unsigned char uu = *u;
411
*(c++) = hex[(uu & 0xf0) >> 4];
412
*(c++) = hex[uu & 0xf];
418
Unpack binary data from a string
420
SWIGRUNTIME const char *
421
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
422
register unsigned char *u = (unsigned char *) ptr;
423
register const unsigned char *eu = u + sz;
424
for (; u != eu; ++u) {
425
register char d = *(c++);
426
register unsigned char uu = 0;
427
if ((d >= '0') && (d <= '9'))
428
uu = ((d - '0') << 4);
429
else if ((d >= 'a') && (d <= 'f'))
430
uu = ((d - ('a'-10)) << 4);
434
if ((d >= '0') && (d <= '9'))
436
else if ((d >= 'a') && (d <= 'f'))
437
uu |= (d - ('a'-10));
446
Pack 'void *' into a string buffer.
449
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
451
if ((2*sizeof(void *) + 2) > bsz) return 0;
453
r = SWIG_PackData(r,&ptr,sizeof(void *));
454
if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
459
SWIGRUNTIME const char *
460
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
462
if (strcmp(c,"NULL") == 0) {
469
return SWIG_UnpackData(++c,ptr,sizeof(void *));
473
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
475
size_t lname = (name ? strlen(name) : 0);
476
if ((2*sz + 2 + lname) > bsz) return 0;
478
r = SWIG_PackData(r,ptr,sz);
480
strncpy(r,name,lname+1);
487
SWIGRUNTIME const char *
488
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
490
if (strcmp(c,"NULL") == 0) {
497
return SWIG_UnpackData(++c,ptr,sz);
504
/* -----------------------------------------------------------------------------
505
* SWIG API. Portion that goes into the runtime
506
* ----------------------------------------------------------------------------- */
512
/* -----------------------------------------------------------------------------
513
* for internal method declarations
514
* ----------------------------------------------------------------------------- */
517
# define SWIGINTERN static SWIGUNUSED
520
#ifndef SWIGINTERNINLINE
521
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
525
Exception handling in wrappers
527
#define SWIG_fail goto fail
528
#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
529
#define SWIG_append_errmsg(msg) SWIG_Python_AddErrMesg(msg,0)
530
#define SWIG_preppend_errmsg(msg) SWIG_Python_AddErrMesg(msg,1)
531
#define SWIG_type_error(type,obj) SWIG_Python_TypeError(type,obj)
532
#define SWIG_null_ref(type) SWIG_Python_NullRef(type)
537
#define SWIG_contract_assert(expr, msg) \
538
if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
540
/* -----------------------------------------------------------------------------
541
* Constant declarations
542
* ----------------------------------------------------------------------------- */
545
#define SWIG_PY_INT 1
546
#define SWIG_PY_FLOAT 2
547
#define SWIG_PY_STRING 3
548
#define SWIG_PY_POINTER 4
549
#define SWIG_PY_BINARY 5
551
/* Constant information structure */
552
typedef struct swig_const_info {
558
swig_type_info **ptype;
562
/* -----------------------------------------------------------------------------
563
* Alloc. memory flags
564
* ----------------------------------------------------------------------------- */
565
#define SWIG_OLDOBJ 1
566
#define SWIG_NEWOBJ SWIG_OLDOBJ + 1
567
#define SWIG_PYSTR SWIG_NEWOBJ + 1
574
/***********************************************************************
577
* This file contains the runtime support for Python modules
578
* and includes code for managing global variables and pointer
581
* Author : David Beazley (beazley@cs.uchicago.edu)
582
************************************************************************/
584
/* Common SWIG API */
585
#define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Python_ConvertPtr(obj, pp, type, flags)
586
#define SWIG_NewPointerObj(p, type, flags) SWIG_Python_NewPointerObj(p, type, flags)
587
#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
590
/* Python-specific SWIG API */
591
#define SWIG_ConvertPacked(obj, ptr, sz, ty, flags) SWIG_Python_ConvertPacked(obj, ptr, sz, ty, flags)
592
#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
595
#define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
596
#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
598
/* -----------------------------------------------------------------------------
599
* Pointer declarations
600
* ----------------------------------------------------------------------------- */
602
Use SWIG_NO_COBJECT_TYPES to force the use of strings to represent
603
C/C++ pointers in the python side. Very useful for debugging, but
606
#if !defined(SWIG_NO_COBJECT_TYPES) && !defined(SWIG_COBJECT_TYPES)
607
# define SWIG_COBJECT_TYPES
610
/* Flags for pointer conversion */
611
#define SWIG_POINTER_EXCEPTION 0x1
612
#define SWIG_POINTER_DISOWN 0x2
615
/* Add PyOS_snprintf for old Pythons */
616
#if PY_VERSION_HEX < 0x02020000
617
#define PyOS_snprintf snprintf
624
/* -----------------------------------------------------------------------------
625
* Create a new pointer string
626
* ----------------------------------------------------------------------------- */
627
#ifndef SWIG_BUFFER_SIZE
628
#define SWIG_BUFFER_SIZE 1024
631
#if defined(SWIG_COBJECT_TYPES)
632
#if !defined(SWIG_COBJECT_PYTHON)
633
/* -----------------------------------------------------------------------------
634
* Implements a simple Swig Object type, and use it instead of PyCObject
635
* ----------------------------------------------------------------------------- */
643
/* Declarations for objects of type PySwigObject */
646
PySwigObject_print(PySwigObject *v, FILE *fp, int flags)
648
char result[SWIG_BUFFER_SIZE];
650
if (SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result))) {
651
fputs("<Swig Object at ", fp); fputs(result, fp); fputs(">", fp);
658
SWIGRUNTIME PyObject *
659
PySwigObject_repr(PySwigObject *v)
661
char result[SWIG_BUFFER_SIZE];
662
return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
663
PyString_FromFormat("<Swig Object at %s>", result) : 0;
666
SWIGRUNTIME PyObject *
667
PySwigObject_str(PySwigObject *v)
669
char result[SWIG_BUFFER_SIZE];
670
return SWIG_PackVoidPtr(result, v->ptr, v->desc, sizeof(result)) ?
671
PyString_FromString(result) : 0;
674
SWIGRUNTIME PyObject *
675
PySwigObject_long(PySwigObject *v)
677
return PyLong_FromVoidPtr(v->ptr);
680
SWIGRUNTIME PyObject *
681
PySwigObject_format(const char* fmt, PySwigObject *v)
683
PyObject *res = NULL;
684
PyObject *args = PyTuple_New(1);
685
if (args && (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0)) {
686
PyObject *ofmt = PyString_FromString(fmt);
688
res = PyString_Format(ofmt,args);
696
SWIGRUNTIME PyObject *
697
PySwigObject_oct(PySwigObject *v)
699
return PySwigObject_format("%o",v);
702
SWIGRUNTIME PyObject *
703
PySwigObject_hex(PySwigObject *v)
705
return PySwigObject_format("%x",v);
709
PySwigObject_compare(PySwigObject *v, PySwigObject *w)
711
int c = strcmp(v->desc, w->desc);
713
return (c > 0) ? 1 : -1;
717
return (i < j) ? -1 : ((i > j) ? 1 : 0);
722
PySwigObject_dealloc(PySwigObject *self)
727
SWIGRUNTIME PyTypeObject*
728
PySwigObject_type(void) {
729
static char pyswigobject_type__doc__[] =
730
"Swig object carries a C/C++ instance pointer";
732
static PyNumberMethods PySwigObject_as_number = {
733
(binaryfunc)0, /*nb_add*/
734
(binaryfunc)0, /*nb_subtract*/
735
(binaryfunc)0, /*nb_multiply*/
736
(binaryfunc)0, /*nb_divide*/
737
(binaryfunc)0, /*nb_remainder*/
738
(binaryfunc)0, /*nb_divmod*/
739
(ternaryfunc)0,/*nb_power*/
740
(unaryfunc)0, /*nb_negative*/
741
(unaryfunc)0, /*nb_positive*/
742
(unaryfunc)0, /*nb_absolute*/
743
(inquiry)0, /*nb_nonzero*/
750
(coercion)0, /*nb_coerce*/
751
(unaryfunc)PySwigObject_long, /*nb_int*/
752
(unaryfunc)PySwigObject_long, /*nb_long*/
753
(unaryfunc)0, /*nb_float*/
754
(unaryfunc)PySwigObject_oct, /*nb_oct*/
755
(unaryfunc)PySwigObject_hex, /*nb_hex*/
756
#if PY_VERSION_HEX >= 0x02000000
757
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
761
static PyTypeObject pyswigobject_type
762
#if !defined(__cplusplus)
764
static int type_init = 0;
769
PyObject_HEAD_INIT(&PyType_Type)
771
(char *)"PySwigObject", /*tp_name*/
772
sizeof(PySwigObject), /*tp_basicsize*/
775
(destructor)PySwigObject_dealloc, /*tp_dealloc*/
776
(printfunc)PySwigObject_print, /*tp_print*/
777
(getattrfunc)0, /*tp_getattr*/
778
(setattrfunc)0, /*tp_setattr*/
779
(cmpfunc)PySwigObject_compare, /*tp_compare*/
780
(reprfunc)PySwigObject_repr, /*tp_repr*/
781
&PySwigObject_as_number, /*tp_as_number*/
782
0, /*tp_as_sequence*/
784
(hashfunc)0, /*tp_hash*/
785
(ternaryfunc)0, /*tp_call*/
786
(reprfunc)PySwigObject_str, /*tp_str*/
787
/* Space for future expansion */
789
pyswigobject_type__doc__, /* Documentation string */
790
#if PY_VERSION_HEX >= 0x02000000
794
#if PY_VERSION_HEX >= 0x02010000
795
0, /* tp_richcompare */
796
0, /* tp_weaklistoffset */
798
#if PY_VERSION_HEX >= 0x02020000
799
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
801
#if PY_VERSION_HEX >= 0x02030000
805
0,0,0,0 /* tp_alloc -> tp_next */
808
#if !defined(__cplusplus)
809
pyswigobject_type = tmp;
813
return &pyswigobject_type;
816
SWIGRUNTIME PyObject *
817
PySwigObject_FromVoidPtrAndDesc(void *ptr, const char *desc)
819
PySwigObject *self = PyObject_NEW(PySwigObject, PySwigObject_type());
824
return (PyObject *)self;
827
SWIGRUNTIMEINLINE void *
828
PySwigObject_AsVoidPtr(PyObject *self)
830
return ((PySwigObject *)self)->ptr;
833
SWIGRUNTIMEINLINE const char *
834
PySwigObject_GetDesc(PyObject *self)
836
return ((PySwigObject *)self)->desc;
839
SWIGRUNTIMEINLINE int
840
PySwigObject_Check(PyObject *op) {
841
return ((op)->ob_type == PySwigObject_type())
842
|| (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
845
/* -----------------------------------------------------------------------------
846
* Implements a simple Swig Packed type, and use it instead of string
847
* ----------------------------------------------------------------------------- */
857
PySwigPacked_print(PySwigPacked *v, FILE *fp, int flags)
859
char result[SWIG_BUFFER_SIZE];
861
fputs("<Swig Packed ", fp);
862
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
871
SWIGRUNTIME PyObject *
872
PySwigPacked_repr(PySwigPacked *v)
874
char result[SWIG_BUFFER_SIZE];
875
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
876
return PyString_FromFormat("<Swig Packed at %s%s>", result, v->desc);
878
return PyString_FromFormat("<Swig Packed %s>", v->desc);
882
SWIGRUNTIME PyObject *
883
PySwigPacked_str(PySwigPacked *v)
885
char result[SWIG_BUFFER_SIZE];
886
if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
887
return PyString_FromFormat("%s%s", result, v->desc);
889
return PyString_FromFormat("%s", v->desc);
894
PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
896
int c = strcmp(v->desc, w->desc);
898
return (c > 0) ? 1 : -1;
902
int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
903
return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
908
PySwigPacked_dealloc(PySwigPacked *self)
914
SWIGRUNTIME PyTypeObject*
915
PySwigPacked_type(void) {
916
static char pyswigpacked_type__doc__[] =
917
"Swig object carries a C/C++ instance pointer";
918
static PyTypeObject pyswigpacked_type
919
#if !defined(__cplusplus)
921
static int type_init = 0;
926
PyObject_HEAD_INIT(&PyType_Type)
928
(char *)"PySwigPacked", /*tp_name*/
929
sizeof(PySwigPacked), /*tp_basicsize*/
932
(destructor)PySwigPacked_dealloc, /*tp_dealloc*/
933
(printfunc)PySwigPacked_print, /*tp_print*/
934
(getattrfunc)0, /*tp_getattr*/
935
(setattrfunc)0, /*tp_setattr*/
936
(cmpfunc)PySwigPacked_compare, /*tp_compare*/
937
(reprfunc)PySwigPacked_repr, /*tp_repr*/
939
0, /*tp_as_sequence*/
941
(hashfunc)0, /*tp_hash*/
942
(ternaryfunc)0, /*tp_call*/
943
(reprfunc)PySwigPacked_str, /*tp_str*/
944
/* Space for future expansion */
946
pyswigpacked_type__doc__, /* Documentation string */
947
#if PY_VERSION_HEX >= 0x02000000
951
#if PY_VERSION_HEX >= 0x02010000
952
0, /* tp_richcompare */
953
0, /* tp_weaklistoffset */
955
#if PY_VERSION_HEX >= 0x02020000
956
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
958
#if PY_VERSION_HEX >= 0x02030000
962
0,0,0,0 /* tp_alloc -> tp_next */
965
#if !defined(__cplusplus)
966
pyswigpacked_type = tmp;
970
return &pyswigpacked_type;
973
SWIGRUNTIME PyObject *
974
PySwigPacked_FromDataAndDesc(void *ptr, size_t size, const char *desc)
976
PySwigPacked *self = PyObject_NEW(PySwigPacked, PySwigPacked_type());
980
void *pack = malloc(size);
982
memcpy(pack, ptr, size);
986
return (PyObject *) self;
992
SWIGRUNTIMEINLINE const char *
993
PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
995
PySwigPacked *self = (PySwigPacked *)obj;
996
if (self->size != size) return 0;
997
memcpy(ptr, self->pack, size);
1001
SWIGRUNTIMEINLINE const char *
1002
PySwigPacked_GetDesc(PyObject *self)
1004
return ((PySwigPacked *)self)->desc;
1007
SWIGRUNTIMEINLINE int
1008
PySwigPacked_Check(PyObject *op) {
1009
return ((op)->ob_type == PySwigPacked_type())
1010
|| (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
1014
/* -----------------------------------------------------------------------------
1015
* Use the old Python PyCObject instead of PySwigObject
1016
* ----------------------------------------------------------------------------- */
1018
#define PySwigObject_GetDesc(obj) PyCObject_GetDesc(obj)
1019
#define PySwigObject_Check(obj) PyCObject_Check(obj)
1020
#define PySwigObject_AsVoidPtr(obj) PyCObject_AsVoidPtr(obj)
1021
#define PySwigObject_FromVoidPtrAndDesc(p, d) PyCObject_FromVoidPtrAndDesc(p, d, NULL)
1027
/* -----------------------------------------------------------------------------
1028
* errors manipulation
1029
* ----------------------------------------------------------------------------- */
1032
SWIG_Python_TypeError(const char *type, PyObject *obj)
1035
#if defined(SWIG_COBJECT_TYPES)
1036
if (obj && PySwigObject_Check(obj)) {
1037
const char *otype = (const char *) PySwigObject_GetDesc(obj);
1039
PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
1046
const char *otype = (obj ? obj->ob_type->tp_name : 0);
1048
PyObject *str = PyObject_Str(obj);
1049
const char *cstr = str ? PyString_AsString(str) : 0;
1051
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
1054
PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
1061
PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
1063
PyErr_Format(PyExc_TypeError, "unexpected type is received");
1067
SWIGRUNTIMEINLINE void
1068
SWIG_Python_NullRef(const char *type)
1071
PyErr_Format(PyExc_TypeError, "null reference of type '%s' was received",type);
1073
PyErr_Format(PyExc_TypeError, "null reference was received");
1078
SWIG_Python_AddErrMesg(const char* mesg, int infront)
1080
if (PyErr_Occurred()) {
1082
PyObject *value = 0;
1083
PyObject *traceback = 0;
1084
PyErr_Fetch(&type, &value, &traceback);
1086
PyObject *old_str = PyObject_Str(value);
1090
PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
1092
PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
1103
SWIG_Python_ArgFail(int argnum)
1105
if (PyErr_Occurred()) {
1106
/* add information about failing argument */
1108
PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
1109
return SWIG_Python_AddErrMesg(mesg, 1);
1116
/* -----------------------------------------------------------------------------
1117
* pointers/data manipulation
1118
* ----------------------------------------------------------------------------- */
1120
/* Convert a pointer value */
1122
SWIG_Python_ConvertPtr(PyObject *obj, void **ptr, swig_type_info *ty, int flags) {
1125
static PyObject *SWIG_this = 0;
1127
PyObject *pyobj = 0;
1131
if (obj == Py_None) {
1136
#ifdef SWIG_COBJECT_TYPES
1137
if (!(PySwigObject_Check(obj))) {
1139
SWIG_this = PyString_FromString("this");
1141
obj = PyObject_GetAttr(obj,SWIG_this);
1143
if (!obj) goto type_error;
1144
if (!PySwigObject_Check(obj)) {
1149
vptr = PySwigObject_AsVoidPtr(obj);
1150
c = (const char *) PySwigObject_GetDesc(obj);
1151
if (newref) { Py_DECREF(obj); }
1154
if (!(PyString_Check(obj))) {
1156
SWIG_this = PyString_FromString("this");
1158
obj = PyObject_GetAttr(obj,SWIG_this);
1160
if (!obj) goto type_error;
1161
if (!PyString_Check(obj)) {
1166
c = PyString_AS_STRING(obj);
1167
/* Pointer values must start with leading underscore */
1168
c = SWIG_UnpackVoidPtr(c, &vptr, ty->name);
1169
if (newref) { Py_DECREF(obj); }
1170
if (!c) goto type_error;
1175
tc = SWIG_TypeCheck(c,ty);
1176
if (!tc) goto type_error;
1177
*ptr = SWIG_TypeCast(tc,vptr);
1181
if ((pyobj) && (flags & SWIG_POINTER_DISOWN)) {
1182
PyObject_SetAttrString(pyobj,(char*)"thisown",Py_False);
1188
if (pyobj && !obj) {
1190
if (PyCFunction_Check(obj)) {
1191
/* here we get the method pointer for callbacks */
1192
char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
1193
c = doc ? strstr(doc, "swig_ptr: ") : 0;
1195
c = ty ? SWIG_UnpackVoidPtr(c + 10, &vptr, ty->name) : 0;
1196
if (!c) goto type_error;
1201
if (flags & SWIG_POINTER_EXCEPTION) {
1203
SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
1205
SWIG_Python_TypeError("C/C++ pointer", obj);
1211
/* Convert a pointer value, signal an exception on a type mismatch */
1213
SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
1215
if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
1217
if (flags & SWIG_POINTER_EXCEPTION) {
1218
SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
1219
SWIG_Python_ArgFail(argnum);
1225
/* Convert a packed value value */
1227
SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty, int flags) {
1231
#if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
1232
c = PySwigPacked_UnpackData(obj, ptr, sz);
1234
if ((!obj) || (!PyString_Check(obj))) goto type_error;
1235
c = PyString_AS_STRING(obj);
1236
/* Pointer values must start with leading underscore */
1237
c = SWIG_UnpackDataName(c, ptr, sz, ty->name);
1239
if (!c) goto type_error;
1241
tc = SWIG_TypeCheck(c,ty);
1242
if (!tc) goto type_error;
1248
if (flags & SWIG_POINTER_EXCEPTION) {
1250
SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
1252
SWIG_Python_TypeError("C/C++ packed data", obj);
1258
/* Create a new array object */
1259
SWIGRUNTIME PyObject *
1260
SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int own) {
1263
if (!PyErr_Occurred()) {
1264
PyErr_Format(PyExc_TypeError, "Swig: null type passed to NewPointerObj");
1272
#ifdef SWIG_COBJECT_TYPES
1273
robj = PySwigObject_FromVoidPtrAndDesc((void *) ptr, (char *)type->name);
1276
char result[SWIG_BUFFER_SIZE];
1277
robj = SWIG_PackVoidPtr(result, ptr, type->name, sizeof(result)) ?
1278
PyString_FromString(result) : 0;
1281
if (!robj || (robj == Py_None)) return robj;
1282
if (type->clientdata) {
1284
PyObject *args = Py_BuildValue((char*)"(O)", robj);
1286
inst = PyObject_CallObject((PyObject *) type->clientdata, args);
1290
PyObject_SetAttrString(inst,(char*)"thisown",Py_True);
1298
SWIGRUNTIME PyObject *
1299
SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
1305
#if defined(SWIG_COBJECT_TYPES) && !defined(SWIG_COBJECT_PYTHON)
1306
robj = PySwigPacked_FromDataAndDesc((void *) ptr, sz, (char *)type->name);
1309
char result[SWIG_BUFFER_SIZE];
1310
robj = SWIG_PackDataName(result, ptr, sz, type->name, sizeof(result)) ?
1311
PyString_FromString(result) : 0;
1317
/* -----------------------------------------------------------------------------*
1319
* -----------------------------------------------------------------------------*/
1321
#ifdef SWIG_LINK_RUNTIME
1322
void *SWIG_ReturnGlobalTypeList(void *);
1325
SWIGRUNTIME swig_module_info *
1326
SWIG_Python_GetModule(void) {
1327
static void *type_pointer = (void *)0;
1328
/* first check if module already created */
1329
if (!type_pointer) {
1330
#ifdef SWIG_LINK_RUNTIME
1331
type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
1333
type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
1334
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
1335
if (PyErr_Occurred()) {
1337
type_pointer = (void *)0;
1341
return (swig_module_info *) type_pointer;
1345
SWIG_Python_SetModule(swig_module_info *swig_module) {
1346
static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
1348
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
1349
swig_empty_runtime_method_table);
1350
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, NULL);
1351
if (pointer && module) {
1352
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
1361
/* -------- TYPES TABLE (BEGIN) -------- */
1363
#define SWIGTYPE_p_char swig_types[0]
1364
#define SWIGTYPE_p_p_char swig_types[1]
1365
#define SWIGTYPE_p_unsigned_int swig_types[2]
1366
#define SWIGTYPE_ptrdiff_t swig_types[3]
1367
#define SWIGTYPE_size_t swig_types[4]
1368
static swig_type_info *swig_types[5];
1369
static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
1370
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1371
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1373
/* -------- TYPES TABLE (END) -------- */
1376
/*-----------------------------------------------
1377
@(target):= _xdelta3.so
1378
------------------------------------------------*/
1379
#define SWIG_init init_xdelta3
1381
#define SWIG_name "_xdelta3"
1383
#include "xdelta3.h"
1385
int xd3_main_cmdline (int ARGC, char **ARGV);
1390
#define SWIG_init initxdelta3
1391
#define SWIG_name "xdelta3"
1395
/* returns SWIG_OLDOBJ if the input is a raw char*, SWIG_PYSTR if is a PyString */
1397
SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize)
1399
static swig_type_info* pchar_info = 0;
1401
if (!pchar_info) pchar_info = SWIG_TypeQuery("char *");
1402
if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_info, 0) != -1) {
1403
if (cptr) *cptr = vptr;
1404
if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1408
if (PyString_Check(obj)) {
1410
*cptr = PyString_AS_STRING(obj);
1412
*psize = PyString_GET_SIZE(obj) + 1;
1419
SWIG_type_error("char *", obj);
1429
SWIG_CheckLongInRange(long value, long min_value, long max_value,
1432
if (value < min_value) {
1434
PyErr_Format(PyExc_OverflowError,
1435
"value %ld is less than '%s' minimum %ld",
1436
value, errmsg, min_value);
1439
} else if (value > max_value) {
1441
PyErr_Format(PyExc_OverflowError,
1442
"value %ld is greater than '%s' maximum %ld",
1443
value, errmsg, max_value);
1452
SWIG_AsVal_long(PyObject * obj, long* val)
1454
if (PyInt_Check(obj)) {
1455
if (val) *val = PyInt_AS_LONG(obj);
1458
if (PyLong_Check(obj)) {
1459
long v = PyLong_AsLong(obj);
1460
if (!PyErr_Occurred()) {
1464
if (!val) PyErr_Clear();
1469
SWIG_type_error("long", obj);
1475
#if INT_MAX != LONG_MAX
1477
SWIG_AsVal_int(PyObject *obj, int *val)
1479
const char* errmsg = val ? "int" : (char*)0;
1481
if (SWIG_AsVal_long(obj, &v)) {
1482
if (SWIG_CheckLongInRange(v, INT_MIN,INT_MAX, errmsg)) {
1483
if (val) *val = (int)(v);
1492
SWIG_type_error(errmsg, obj);
1497
SWIGINTERNINLINE int
1498
SWIG_AsVal_int(PyObject *obj, int *val)
1500
return SWIG_AsVal_long(obj,(long*)val);
1505
SWIGINTERNINLINE int
1506
SWIG_As_int(PyObject* obj)
1509
if (!SWIG_AsVal_int(obj, &v)) {
1511
this is needed to make valgrind/purify happier.
1513
memset((void*)&v, 0, sizeof(int));
1519
SWIGINTERNINLINE int
1520
SWIG_AsCharPtr(PyObject *obj, char **val)
1522
if (SWIG_AsCharPtrAndSize(obj, val, (size_t*)(0))) {
1527
SWIG_type_error("char *", obj);
1533
SWIGINTERNINLINE int
1534
SWIG_CheckUnsignedLongInRange(unsigned long value,
1535
unsigned long max_value,
1538
if (value > max_value) {
1540
PyErr_Format(PyExc_OverflowError,
1541
"value %lu is greater than '%s' minimum %lu",
1542
value, errmsg, max_value);
1551
SWIG_AsVal_unsigned_SS_long(PyObject *obj, unsigned long *val)
1553
if (PyInt_Check(obj)) {
1554
long v = PyInt_AS_LONG(obj);
1560
if (PyLong_Check(obj)) {
1561
unsigned long v = PyLong_AsUnsignedLong(obj);
1562
if (!PyErr_Occurred()) {
1566
if (!val) PyErr_Clear();
1571
SWIG_type_error("unsigned long", obj);
1577
#if UINT_MAX != ULONG_MAX
1579
SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val)
1581
const char* errmsg = val ? "unsigned int" : (char*)0;
1583
if (SWIG_AsVal_unsigned_SS_long(obj, &v)) {
1584
if (SWIG_CheckUnsignedLongInRange(v, INT_MAX, errmsg)) {
1585
if (val) *val = (unsigned int)(v);
1592
SWIG_type_error(errmsg, obj);
1597
SWIGINTERNINLINE unsigned int
1598
SWIG_AsVal_unsigned_SS_int(PyObject *obj, unsigned int *val)
1600
return SWIG_AsVal_unsigned_SS_long(obj,(unsigned long *)val);
1605
SWIGINTERNINLINE int
1606
SWIG_Check_unsigned_SS_int(PyObject* obj)
1608
return SWIG_AsVal_unsigned_SS_int(obj, (unsigned int*)0);
1612
SWIGINTERNINLINE int
1613
SWIG_Check_int(PyObject* obj)
1615
return SWIG_AsVal_int(obj, (int*)0);
1619
SWIGINTERN PyObject*
1620
t_output_helper(PyObject* target, PyObject* o) {
1623
} else if (target == Py_None) {
1627
if (!PyList_Check(target)) {
1628
PyObject *o2 = target;
1629
target = PyList_New(1);
1630
PyList_SetItem(target, 0, o2);
1632
PyList_Append(target,o);
1639
/*@/usr/share/swig/1.3.25/python/pymacros.swg,66,SWIG_define@*/
1640
#define SWIG_From_int PyInt_FromLong
1645
SWIG_AsArgcArgv(PyObject* input,
1646
swig_type_info* ppchar_info,
1647
size_t* argc, int* owner)
1651
if (SWIG_ConvertPtr(input, (void **)&argv, ppchar_info, 0) == -1) {
1653
int list = PyList_Check(input);
1654
if (list || PyTuple_Check(input)) {
1655
*argc = list ? PyList_Size(input) : PyTuple_Size(input);
1656
argv = ((char**) malloc((*argc + 1)*sizeof(char*)));
1658
for (; i < *argc; ++i) {
1659
PyObject *obj = list ? PyList_GetItem(input,i) : PyTuple_GetItem(input,i);
1660
if (!SWIG_AsCharPtr(obj, &(argv[i]))) {
1662
PyErr_SetString(PyExc_TypeError,"list or tuple must contain strings only");
1669
PyErr_SetString(PyExc_TypeError,"a list or tuple is expected");
1673
/* seems dangerous, but the user asked for it... */
1674
while (argv[i] != 0) ++i;
1684
static PyObject *_wrap_xd3_encode_memory(PyObject *self, PyObject *args) {
1685
PyObject *resultobj = NULL;
1686
char *arg1 = (char *) 0 ;
1688
char *arg3 = (char *) 0 ;
1690
char *arg5 = (char *) 0 ;
1691
unsigned int *arg6 = (unsigned int *) 0 ;
1699
unsigned int alloc_size7 ;
1700
PyObject * obj0 = 0 ;
1701
PyObject * obj1 = 0 ;
1702
PyObject * obj2 = 0 ;
1703
PyObject * obj3 = 0 ;
1711
if(!PyArg_ParseTuple(args,(char *)"OOO|O:xd3_encode_memory",&obj0,&obj1,&obj2,&obj3)) goto fail;
1713
int res = SWIG_AsCharPtrAndSize(obj0, &buf1, &size1);
1715
SWIG_arg_fail(1);SWIG_fail;
1717
arg1 = (char *) buf1;
1718
arg2 = (unsigned int) size1 - 1;
1721
int res = SWIG_AsCharPtrAndSize(obj1, &buf3, &size3);
1723
SWIG_arg_fail(3);SWIG_fail;
1725
arg3 = (char *) buf3;
1726
arg4 = (unsigned int) size3 - 1;
1729
arg7 = alloc_size7 = PyInt_AsLong(obj2);
1733
arg8 = (int)(SWIG_As_int(obj3));
1734
if (SWIG_arg_fail(8)) SWIG_fail;
1738
// alloc_size input is #7th position in xd3_xxcode_memory()
1739
arg5 = malloc(alloc_size7);
1740
arg6 = &alloc_size7;
1742
result = (int)xd3_encode_memory((char const *)arg1,arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8);
1745
resultobj = SWIG_From_int((int)(result));
1750
// alloc_size7 now carries actual size
1751
o = PyString_FromStringAndSize(arg5,alloc_size7);
1752
resultobj = t_output_helper(resultobj,o);
1754
resultobj = t_output_helper(resultobj,Py_None);
1764
static PyObject *_wrap_xd3_decode_memory(PyObject *self, PyObject *args) {
1765
PyObject *resultobj = NULL;
1766
char *arg1 = (char *) 0 ;
1768
char *arg3 = (char *) 0 ;
1770
char *arg5 = (char *) 0 ;
1771
unsigned int *arg6 = (unsigned int *) 0 ;
1779
unsigned int alloc_size7 ;
1780
PyObject * obj0 = 0 ;
1781
PyObject * obj1 = 0 ;
1782
PyObject * obj2 = 0 ;
1783
PyObject * obj3 = 0 ;
1791
if(!PyArg_ParseTuple(args,(char *)"OOO|O:xd3_decode_memory",&obj0,&obj1,&obj2,&obj3)) goto fail;
1793
int res = SWIG_AsCharPtrAndSize(obj0, &buf1, &size1);
1795
SWIG_arg_fail(1);SWIG_fail;
1797
arg1 = (char *) buf1;
1798
arg2 = (unsigned int) size1 - 1;
1801
int res = SWIG_AsCharPtrAndSize(obj1, &buf3, &size3);
1803
SWIG_arg_fail(3);SWIG_fail;
1805
arg3 = (char *) buf3;
1806
arg4 = (unsigned int) size3 - 1;
1809
arg7 = alloc_size7 = PyInt_AsLong(obj2);
1813
arg8 = (int)(SWIG_As_int(obj3));
1814
if (SWIG_arg_fail(8)) SWIG_fail;
1818
// alloc_size input is #7th position in xd3_xxcode_memory()
1819
arg5 = malloc(alloc_size7);
1820
arg6 = &alloc_size7;
1822
result = (int)xd3_decode_memory((char const *)arg1,arg2,(char const *)arg3,arg4,arg5,arg6,arg7,arg8);
1825
resultobj = SWIG_From_int((int)(result));
1830
// alloc_size7 now carries actual size
1831
o = PyString_FromStringAndSize(arg5,alloc_size7);
1832
resultobj = t_output_helper(resultobj,o);
1834
resultobj = t_output_helper(resultobj,Py_None);
1844
static PyObject *_wrap_xd3_main_cmdline(PyObject *self, PyObject *args) {
1845
PyObject *resultobj = NULL;
1847
char **arg2 = (char **) 0 ;
1850
PyObject * obj0 = 0 ;
1852
if(!PyArg_ParseTuple(args,(char *)"O:xd3_main_cmdline",&obj0)) goto fail;
1855
char **argv = SWIG_AsArgcArgv(obj0, SWIGTYPE_p_p_char, &argc, &owner1);
1856
if (PyErr_Occurred()) {
1858
if (SWIG_arg_fail(1)) SWIG_fail;
1861
arg2 = (char **) argv;
1864
result = (int)xd3_main_cmdline(arg1,arg2);
1867
resultobj = SWIG_From_int((int)(result));
1870
if (owner1) free((char*)arg2);
1875
if (owner1) free((char*)arg2);
1881
static PyMethodDef SwigMethods[] = {
1882
{ (char *)"xd3_encode_memory", _wrap_xd3_encode_memory, METH_VARARGS, NULL},
1883
{ (char *)"xd3_decode_memory", _wrap_xd3_decode_memory, METH_VARARGS, NULL},
1884
{ (char *)"xd3_main_cmdline", _wrap_xd3_main_cmdline, METH_VARARGS, NULL},
1885
{ NULL, NULL, 0, NULL }
1889
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
1891
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, 0};
1892
static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, 0};
1893
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *", 0, 0, 0};
1894
static swig_type_info _swigt__ptrdiff_t = {"_ptrdiff_t", "ptrdiff_t", 0, 0, 0};
1895
static swig_type_info _swigt__size_t = {"_size_t", "size_t", 0, 0, 0};
1897
static swig_type_info *swig_type_initial[] = {
1900
&_swigt__p_unsigned_int,
1905
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
1906
static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
1907
static swig_cast_info _swigc__p_unsigned_int[] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
1908
static swig_cast_info _swigc__ptrdiff_t[] = { {&_swigt__ptrdiff_t, 0, 0, 0},{0, 0, 0, 0}};
1909
static swig_cast_info _swigc__size_t[] = { {&_swigt__size_t, 0, 0, 0},{0, 0, 0, 0}};
1911
static swig_cast_info *swig_cast_initial[] = {
1914
_swigc__p_unsigned_int,
1920
/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
1922
static swig_const_info swig_const_table[] = {
1923
{0, 0, 0, 0.0, 0, 0}};
1928
/*************************************************************************
1929
* Type initialization:
1930
* This problem is tough by the requirement that no dynamic
1931
* memory is used. Also, since swig_type_info structures store pointers to
1932
* swig_cast_info structures and swig_cast_info structures store pointers back
1933
* to swig_type_info structures, we need some lookup code at initialization.
1934
* The idea is that swig generates all the structures that are needed.
1935
* The runtime then collects these partially filled structures.
1936
* The SWIG_InitializeModule function takes these initial arrays out of
1937
* swig_module, and does all the lookup, filling in the swig_module.types
1938
* array with the correct data and linking the correct swig_cast_info
1939
* structures together.
1941
* The generated swig_type_info structures are assigned staticly to an initial
1942
* array. We just loop though that array, and handle each type individually.
1943
* First we lookup if this type has been already loaded, and if so, use the
1944
* loaded structure instead of the generated one. Then we have to fill in the
1945
* cast linked list. The cast data is initially stored in something like a
1946
* two-dimensional array. Each row corresponds to a type (there are the same
1947
* number of rows as there are in the swig_type_initial array). Each entry in
1948
* a column is one of the swig_cast_info structures for that type.
1949
* The cast_initial array is actually an array of arrays, because each row has
1950
* a variable number of columns. So to actually build the cast linked list,
1951
* we find the array of casts associated with the type, and loop through it
1952
* adding the casts to the list. The one last trick we need to do is making
1953
* sure the type pointer in the swig_cast_info struct is correct.
1955
* First off, we lookup the cast->type name to see if it is already loaded.
1956
* There are three cases to handle:
1957
* 1) If the cast->type has already been loaded AND the type we are adding
1958
* casting info to has not been loaded (it is in this module), THEN we
1959
* replace the cast->type pointer with the type pointer that has already
1961
* 2) If BOTH types (the one we are adding casting info to, and the
1962
* cast->type) are loaded, THEN the cast info has already been loaded by
1963
* the previous module so we just ignore it.
1964
* 3) Finally, if cast->type has not already been loaded, then we add that
1965
* swig_cast_info to the linked list (because the cast->type) pointer will
1974
SWIG_InitializeModule(void *clientdata) {
1975
swig_type_info *type, *ret;
1976
swig_cast_info *cast;
1978
swig_module_info *module_head;
1979
static int init_run = 0;
1981
clientdata = clientdata;
1983
if (init_run) return;
1986
/* Initialize the swig_module */
1987
swig_module.type_initial = swig_type_initial;
1988
swig_module.cast_initial = swig_cast_initial;
1990
/* Try and load any already created modules */
1991
module_head = SWIG_GetModule(clientdata);
1993
swig_module.next = module_head->next;
1994
module_head->next = &swig_module;
1996
/* This is the first module loaded */
1997
swig_module.next = &swig_module;
1998
SWIG_SetModule(clientdata, &swig_module);
2001
/* Now work on filling in swig_module.types */
2002
for (i = 0; i < swig_module.size; ++i) {
2005
/* if there is another module already loaded */
2006
if (swig_module.next != &swig_module) {
2007
type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2010
/* Overwrite clientdata field */
2011
if (swig_module.type_initial[i]->clientdata) type->clientdata = swig_module.type_initial[i]->clientdata;
2013
type = swig_module.type_initial[i];
2016
/* Insert casting types */
2017
cast = swig_module.cast_initial[i];
2018
while (cast->type) {
2019
/* Don't need to add information already in the list */
2021
if (swig_module.next != &swig_module) {
2022
ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2024
if (ret && type == swig_module.type_initial[i]) {
2031
type->cast->prev = cast;
2032
cast->next = type->cast;
2040
/* Set entry in modules->types array equal to the type */
2041
swig_module.types[i] = type;
2045
/* This function will propagate the clientdata field of type to
2046
* any new swig_type_info structures that have been added into the list
2047
* of equivalent types. It is like calling
2048
* SWIG_TypeClientData(type, clientdata) a second time.
2051
SWIG_PropagateClientData(void) {
2053
swig_cast_info *equiv;
2054
static int init_run = 0;
2056
if (init_run) return;
2059
for (i = 0; i < swig_module.size; i++) {
2060
if (swig_module.types[i]->clientdata) {
2061
equiv = swig_module.types[i]->cast;
2063
if (!equiv->converter) {
2064
if (equiv->type && !equiv->type->clientdata)
2065
SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2067
equiv = equiv->next;
2083
/* Python-specific SWIG API */
2084
#define SWIG_newvarlink() SWIG_Python_newvarlink()
2085
#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
2086
#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
2088
/* -----------------------------------------------------------------------------
2089
* global variable support code.
2090
* ----------------------------------------------------------------------------- */
2092
typedef struct swig_globalvar {
2093
char *name; /* Name of global variable */
2094
PyObject *(*get_attr)(void); /* Return the current value */
2095
int (*set_attr)(PyObject *); /* Set the value */
2096
struct swig_globalvar *next;
2099
typedef struct swig_varlinkobject {
2101
swig_globalvar *vars;
2102
} swig_varlinkobject;
2104
SWIGINTERN PyObject *
2105
swig_varlink_repr(swig_varlinkobject *v) {
2107
return PyString_FromString("<Swig global variables>");
2111
swig_varlink_print(swig_varlinkobject *v, FILE *fp, int flags) {
2112
swig_globalvar *var;
2114
fprintf(fp,"Swig global variables { ");
2115
for (var = v->vars; var; var=var->next) {
2116
fprintf(fp,"%s", var->name);
2117
if (var->next) fprintf(fp,", ");
2123
SWIGINTERN PyObject *
2124
swig_varlink_getattr(swig_varlinkobject *v, char *n) {
2125
swig_globalvar *var = v->vars;
2127
if (strcmp(var->name,n) == 0) {
2128
return (*var->get_attr)();
2132
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
2137
swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
2138
swig_globalvar *var = v->vars;
2140
if (strcmp(var->name,n) == 0) {
2141
return (*var->set_attr)(p);
2145
PyErr_SetString(PyExc_NameError,"Unknown C global variable");
2149
SWIGINTERN PyTypeObject*
2150
swig_varlink_type(void) {
2151
static char varlink__doc__[] = "Swig var link object";
2152
static PyTypeObject varlink_type
2153
#if !defined(__cplusplus)
2155
static int type_init = 0;
2160
PyObject_HEAD_INIT(&PyType_Type)
2161
0, /* Number of items in variable part (ob_size) */
2162
(char *)"swigvarlink", /* Type name (tp_name) */
2163
sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
2164
0, /* Itemsize (tp_itemsize) */
2165
0, /* Deallocator (tp_dealloc) */
2166
(printfunc) swig_varlink_print, /* Print (tp_print) */
2167
(getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
2168
(setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
2170
(reprfunc) swig_varlink_repr, /* tp_repr */
2171
0, /* tp_as_number */
2172
0, /* tp_as_sequence */
2173
0, /* tp_as_mapping */
2177
0, /* tp_getattro */
2178
0, /* tp_setattro */
2179
0, /* tp_as_buffer */
2181
varlink__doc__, /* tp_doc */
2182
#if PY_VERSION_HEX >= 0x02000000
2183
0, /* tp_traverse */
2186
#if PY_VERSION_HEX >= 0x02010000
2187
0, /* tp_richcompare */
2188
0, /* tp_weaklistoffset */
2190
#if PY_VERSION_HEX >= 0x02020000
2191
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
2193
#if PY_VERSION_HEX >= 0x02030000
2197
0,0,0,0 /* tp_alloc -> tp_next */
2200
#if !defined(__cplusplus)
2205
return &varlink_type;
2208
/* Create a variable linking object for use later */
2209
SWIGINTERN PyObject *
2210
SWIG_Python_newvarlink(void) {
2211
swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
2215
return ((PyObject*) result);
2219
SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
2220
swig_varlinkobject *v = (swig_varlinkobject *) p;
2221
swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
2223
size_t size = strlen(name)+1;
2224
gv->name = (char *)malloc(size);
2226
strncpy(gv->name,name,size);
2227
gv->get_attr = get_attr;
2228
gv->set_attr = set_attr;
2235
/* -----------------------------------------------------------------------------
2236
* constants/methods manipulation
2237
* ----------------------------------------------------------------------------- */
2239
/* Install Constants */
2241
SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
2244
for (i = 0; constants[i].type; ++i) {
2245
switch(constants[i].type) {
2247
obj = PyInt_FromLong(constants[i].lvalue);
2250
obj = PyFloat_FromDouble(constants[i].dvalue);
2252
case SWIG_PY_STRING:
2253
if (constants[i].pvalue) {
2254
obj = PyString_FromString((char *) constants[i].pvalue);
2260
case SWIG_PY_POINTER:
2261
obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
2263
case SWIG_PY_BINARY:
2264
obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
2271
PyDict_SetItemString(d,constants[i].name,obj);
2277
/* -----------------------------------------------------------------------------*/
2278
/* Fix SwigMethods to carry the callback ptrs when needed */
2279
/* -----------------------------------------------------------------------------*/
2282
SWIG_Python_FixMethods(PyMethodDef *methods,
2283
swig_const_info *const_table,
2284
swig_type_info **types,
2285
swig_type_info **types_initial) {
2287
for (i = 0; methods[i].ml_name; ++i) {
2288
char *c = methods[i].ml_doc;
2289
if (c && (c = strstr(c, "swig_ptr: "))) {
2291
swig_const_info *ci = 0;
2292
char *name = c + 10;
2293
for (j = 0; const_table[j].type; ++j) {
2294
if (strncmp(const_table[j].name, name,
2295
strlen(const_table[j].name)) == 0) {
2296
ci = &(const_table[j]);
2301
size_t shift = (ci->ptype) - types;
2302
swig_type_info *ty = types_initial[shift];
2303
size_t ldoc = (c - methods[i].ml_doc);
2304
size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
2305
char *ndoc = (char*)malloc(ldoc + lptr + 10);
2308
void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
2310
strncpy(buff, methods[i].ml_doc, ldoc);
2312
strncpy(buff, "swig_ptr: ", 10);
2314
SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
2315
methods[i].ml_doc = ndoc;
2323
/* -----------------------------------------------------------------------------*
2324
* Initialize type list
2325
* -----------------------------------------------------------------------------*/
2327
#if PY_MAJOR_VERSION < 2
2328
/* PyModule_AddObject function was introduced in Python 2.0. The following function
2329
is copied out of Python/modsupport.c in python version 2.3.4 */
2331
PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2334
if (!PyModule_Check(m)) {
2335
PyErr_SetString(PyExc_TypeError,
2336
"PyModule_AddObject() needs module as first arg");
2340
PyErr_SetString(PyExc_TypeError,
2341
"PyModule_AddObject() needs non-NULL value");
2345
dict = PyModule_GetDict(m);
2347
/* Internal error -- modules must have a dict! */
2348
PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2349
PyModule_GetName(m));
2352
if (PyDict_SetItemString(dict, name, o))
2363
/* -----------------------------------------------------------------------------*
2364
* Partial Init method
2365
* -----------------------------------------------------------------------------*/
2370
SWIGEXPORT void SWIG_init(void) {
2371
static PyObject *SWIG_globals = 0;
2373
if (!SWIG_globals) SWIG_globals = SWIG_newvarlink();
2375
/* Fix SwigMethods to carry the callback ptrs when needed */
2376
SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
2378
m = Py_InitModule((char *) SWIG_name, SwigMethods);
2379
d = PyModule_GetDict(m);
2381
SWIG_InitializeModule(0);
2382
SWIG_InstallConstants(d,swig_const_table);
2385
PyDict_SetItemString(d,"XD3_SEC_DJW", SWIG_From_int((int)(XD3_SEC_DJW)));
2388
PyDict_SetItemString(d,"XD3_SEC_FGK", SWIG_From_int((int)(XD3_SEC_FGK)));
2391
PyDict_SetItemString(d,"XD3_SEC_NODATA", SWIG_From_int((int)(XD3_SEC_NODATA)));
2394
PyDict_SetItemString(d,"XD3_SEC_NOINST", SWIG_From_int((int)(XD3_SEC_NOINST)));
2397
PyDict_SetItemString(d,"XD3_SEC_NOADDR", SWIG_From_int((int)(XD3_SEC_NOADDR)));
2400
PyDict_SetItemString(d,"XD3_ADLER32", SWIG_From_int((int)(XD3_ADLER32)));
2403
PyDict_SetItemString(d,"XD3_ADLER32_NOVER", SWIG_From_int((int)(XD3_ADLER32_NOVER)));
2406
PyDict_SetItemString(d,"XD3_ALT_CODE_TABLE", SWIG_From_int((int)(XD3_ALT_CODE_TABLE)));
2409
PyDict_SetItemString(d,"XD3_NOCOMPRESS", SWIG_From_int((int)(XD3_NOCOMPRESS)));
2412
PyDict_SetItemString(d,"XD3_BEGREEDY", SWIG_From_int((int)(XD3_BEGREEDY)));
2415
PyDict_SetItemString(d,"XD3_COMPLEVEL_SHIFT", SWIG_From_int((int)(XD3_COMPLEVEL_SHIFT)));
2418
PyDict_SetItemString(d,"XD3_COMPLEVEL_MASK", SWIG_From_int((int)(XD3_COMPLEVEL_MASK)));
2421
PyDict_SetItemString(d,"XD3_COMPLEVEL_1", SWIG_From_int((int)(XD3_COMPLEVEL_1)));
2424
PyDict_SetItemString(d,"XD3_COMPLEVEL_3", SWIG_From_int((int)(XD3_COMPLEVEL_3)));
2427
PyDict_SetItemString(d,"XD3_COMPLEVEL_6", SWIG_From_int((int)(XD3_COMPLEVEL_6)));
2430
PyDict_SetItemString(d,"XD3_COMPLEVEL_9", SWIG_From_int((int)(XD3_COMPLEVEL_9)));