root/xdelta30r/xdelta3_wrap.c

Revision 31, 69.6 kB (checked in by nlawren2, 10 months ago)

Moved xdelta30r

Line 
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 1.3.25
4  *
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  * ----------------------------------------------------------------------------- */
10
11 #define SWIGPYTHON
12 /***********************************************************************
13  *
14  *  This section contains generic SWIG labels for method/variable
15  *  declarations/attributes, and other compiler dependent labels.
16  *
17  ************************************************************************/
18
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
23 #  else
24 #    define SWIGTEMPLATEDISAMBIGUATOR
25 #  endif
26 #endif
27
28 /* inline attribute */
29 #ifndef SWIGINLINE
30 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
31 #   define SWIGINLINE inline
32 # else
33 #   define SWIGINLINE
34 # endif
35 #endif
36
37 /* attribute recognised by some compilers to avoid 'unused' warnings */
38 #ifndef SWIGUNUSED
39 # if defined(__GNUC__) || defined(__ICC)
40 #   define SWIGUNUSED __attribute__ ((unused))
41 # else
42 #   define SWIGUNUSED
43 # endif
44 #endif
45
46 /* internal SWIG method */
47 #ifndef SWIGINTERN
48 # define SWIGINTERN static SWIGUNUSED
49 #endif
50
51 /* internal inline SWIG method */
52 #ifndef SWIGINTERNINLINE
53 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
54 #endif
55
56 /* exporting methods for Windows DLLs */
57 #ifndef SWIGEXPORT
58 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
59 #   if defined(STATIC_LINKED)
60 #     define SWIGEXPORT
61 #   else
62 #     define SWIGEXPORT __declspec(dllexport)
63 #   endif
64 # else
65 #   define SWIGEXPORT
66 # endif
67 #endif
68
69 /* calling conventions for Windows */
70 #ifndef SWIGSTDCALL
71 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
72 #   define SWIGSTDCALL __stdcall
73 # else
74 #   define SWIGSTDCALL
75 # endif
76 #endif
77
78
79
80 #include <Python.h>
81
82 /***********************************************************************
83  * swigrun.swg
84  *
85  *     This file contains generic CAPI SWIG runtime support for pointer
86  *     type checking.
87  *
88  ************************************************************************/
89
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"
93
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)
99 #else
100 # define SWIG_TYPE_TABLE_NAME
101 #endif
102
103 /*
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'.
107  
108   But only do this if is strictly necessary, ie, if you have problems
109   with your compiler or so.
110 */
111
112 #ifndef SWIGRUNTIME
113 # define SWIGRUNTIME SWIGINTERN
114 #endif
115
116 #ifndef SWIGRUNTIMEINLINE
117 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
118 #endif
119
120 #include <string.h>
121
122 #ifdef __cplusplus
123 extern "C" {
124 #endif
125
126 typedef void *(*swig_converter_func)(void *);
127 typedef struct swig_type_info *(*swig_dycast_func)(void **);
128
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 */
136 } swig_type_info;
137
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 */
144 } swig_cast_info;
145
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 */
156 } swig_module_info;
157
158
159 /*
160   Compare two type names skipping the space characters, therefore
161   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
162
163   Return 0 when the two name types are equivalent, as in
164   strncmp, but skipping ' '.
165 */
166 SWIGRUNTIME int
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);
173   }
174   return (l1 - f1) - (l2 - f2);
175 }
176
177 /*
178   Check type equivalence in a name list like <name1>|<name2>|...
179   Return 0 if not equal, 1 if equal
180 */
181 SWIGRUNTIME int
182 SWIG_TypeEquiv(const char *nb, const char *tb) {
183   int equiv = 0;
184   const char* te = tb + strlen(tb);
185   const char* ne = nb;
186   while (!equiv && *ne) {
187     for (nb = ne; *ne; ++ne) {
188       if (*ne == '|') break;
189     }
190     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
191     if (*ne) ++ne;
192   }
193   return equiv;
194 }
195
196 /*
197   Check type equivalence in a name list like <name1>|<name2>|...
198   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
199 */
200 SWIGRUNTIME int
201 SWIG_TypeCompare(const char *nb, const char *tb) {
202   int equiv = 0;
203   const char* te = tb + strlen(tb);
204   const char* ne = nb;
205   while (!equiv && *ne) {
206     for (nb = ne; *ne; ++ne) {
207       if (*ne == '|') break;
208     }
209     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
210     if (*ne) ++ne;
211   }
212   return equiv;
213 }
214
215
216 /* think of this as a c++ template<> or a scheme macro */
217 #define SWIG_TypeCheck_Template(comparison, ty)         \
218   if (ty) {                                             \
219     swig_cast_info *iter = ty->cast;                    \
220     while (iter) {                                      \
221       if (comparison) {                                 \
222         if (iter == ty->cast) return iter;              \
223         /* Move iter to the top of the linked list */   \
224         iter->prev->next = iter->next;                  \
225         if (iter->next)                                 \
226           iter->next->prev = iter->prev;                \
227         iter->next = ty->cast;                          \
228         iter->prev = 0;                                 \
229         if (ty->cast) ty->cast->prev = iter;            \
230         ty->cast = iter;                                \
231         return iter;                                    \
232       }                                                 \
233       iter = iter->next;                                \
234     }                                                   \
235   }                                                     \
236   return 0
237
238 /*
239   Check the typename
240 */
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);
244 }
245
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);
250 }
251
252 /*
253   Cast a pointer up an inheritance hierarchy
254 */
255 SWIGRUNTIMEINLINE void *
256 SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
257   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
258 }
259
260 /*
261    Dynamic pointer casting. Down an inheritance hierarchy
262 */
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);
269     if (ty) lastty = ty;
270   }
271   return lastty;
272 }
273
274 /*
275   Return the name associated with this type
276 */
277 SWIGRUNTIMEINLINE const char *
278 SWIG_TypeName(const swig_type_info *ty) {
279   return ty->name;
280 }
281
282 /*
283   Return the pretty name associated with this type,
284   that is an unmangled type name in a form presentable to the user.
285 */
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
291      specific. */
292   if (type->str != NULL) {
293     const char *last_name = type->str;
294     const char *s;
295     for (s = type->str; *s; s++)
296       if (*s == '|') last_name = s+1;
297     return last_name;
298   }
299   else
300     return type->name;
301 }
302
303 /*
304    Set the clientdata field for a type
305 */
306 SWIGRUNTIME void
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;
312    
313     while (cast) {
314       if (!cast->converter)
315         SWIG_TypeClientData(cast->type, clientdata);
316       cast = cast->next;
317     }
318   }
319 }
320
321 /*
322   Search for a swig_type_info structure only by mangled name
323   Search is a O(log #types)
324  
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
327   the circular list.
328 */
329 SWIGRUNTIME swig_type_info *
330 SWIG_MangledTypeQueryModule(swig_module_info *start,
331                             swig_module_info *end,
332                             const char *name) {
333   swig_module_info *iter = start;
334   do {
335     if (iter->size) {
336       register size_t l = 0;
337       register size_t r = iter->size - 1;
338       do {
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;
342         if (iname) {
343           register int compare = strcmp(name, iname);
344           if (compare == 0) {       
345             return iter->types[i];
346           } else if (compare < 0) {
347             if (i) {
348               r = i - 1;
349             } else {
350               break;
351             }
352           } else if (compare > 0) {
353             l = i + 1;
354           }
355         } else {
356           break; /* should never happen */
357         }
358       } while (l <= r);
359     }
360     iter = iter->next;
361   } while (iter != end);
362   return 0;
363 }
364
365 /*
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).
369  
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
372   the circular list.
373 */
374 SWIGRUNTIME swig_type_info *
375 SWIG_TypeQueryModule(swig_module_info *start,
376                      swig_module_info *end,
377                      const char *name) {
378   /* STEP 1: Search the name field using binary search */
379   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
380   if (ret) {
381     return ret;
382   } else {
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;
386     do {
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];
391       }
392       iter = iter->next;
393     } while (iter != end);
394   }
395  
396   /* neither found a match */
397   return 0;
398 }
399
400
401 /*
402    Pack binary data into a string
403 */
404 SWIGRUNTIME char *
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];
413   }
414   return c;
415 }
416
417 /*
418    Unpack binary data from a string
419 */
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);
431     else
432       return (char *) 0;
433     d = *(c++);
434     if ((d >= '0') && (d <= '9'))
435       uu |= (d - '0');
436     else if ((d >= 'a') && (d <= 'f'))
437       uu |= (d - ('a'-10));
438     else
439       return (char *) 0;
440     *u = uu;
441   }
442   return c;
443 }
444
445 /*
446    Pack 'void *' into a string buffer.
447 */
448 SWIGRUNTIME char *
449 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
450   char *r = buff;
451   if ((2*sizeof(void *) + 2) > bsz) return 0;
452   *(r++) = '_';
453   r = SWIG_PackData(r,&ptr,sizeof(void *));
454   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
455   strcpy(r,name);
456   return buff;
457 }
458
459 SWIGRUNTIME const char *
460 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
461   if (*c != '_') {
462     if (strcmp(c,"NULL") == 0) {
463       *ptr = (void *) 0;
464       return name;
465     } else {
466       return 0;
467     }
468   }
469   return SWIG_UnpackData(++c,ptr,sizeof(void *));
470 }
471
472 SWIGRUNTIME char *
473 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
474   char *r = buff;
475   size_t lname = (name ? strlen(name) : 0);
476   if ((2*sz + 2 + lname) > bsz) return 0;
477   *(r++) = '_';
478   r = SWIG_PackData(r,ptr,sz);
479   if (lname) {
480     strncpy(r,name,lname+1);
481   } else {
482     *r = 0;
483   }
484   return buff;
485 }
486
487 SWIGRUNTIME const char *
488 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
489   if (*c != '_') {
490     if (strcmp(c,"NULL") == 0) {
491       memset(ptr,0,sz);
492       return name;
493     } else {
494       return 0;
495     }
496   }
497   return SWIG_UnpackData(++c,ptr,sz);
498 }
499
500 #ifdef __cplusplus
501 }
502 #endif
503
504 /* -----------------------------------------------------------------------------
505  * SWIG API. Portion that goes into the runtime
506  * ----------------------------------------------------------------------------- */
507
508 #ifdef __cplusplus
509 extern "C" {
510 #endif
511
512 /* -----------------------------------------------------------------------------
513  * for internal method declarations
514  * ----------------------------------------------------------------------------- */
515
516 #ifndef SWIGINTERN
517 #  define SWIGINTERN static SWIGUNUSED
518 #endif
519
520 #ifndef SWIGINTERNINLINE
521 #  define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
522 #endif
523
524 /*
525   Exception handling in wrappers
526 */
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)
533
534 /*
535   Contract support
536 */
537 #define SWIG_contract_assert(expr, msg) \
538  if (!(expr)) { PyErr_SetString(PyExc_RuntimeError, (char *) msg ); goto fail; } else
539
540 /* -----------------------------------------------------------------------------
541  * Constant declarations
542  * ----------------------------------------------------------------------------- */
543
544 /* Constant Types */
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
550
551 /* Constant information structure */
552 typedef struct swig_const_info {
553     int type;
554     char *name;
555     long lvalue;
556     double dvalue;
557     void   *pvalue;
558     swig_type_info **ptype;
559 } swig_const_info;
560
561
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
568
569 #ifdef __cplusplus
570 }
571 #endif
572
573
574 /***********************************************************************
575  * pyrun.swg
576  *
577  *     This file contains the runtime support for Python modules
578  *     and includes code for managing global variables and pointer
579  *     type checking.
580  *
581  * Author : David Beazley (beazley@cs.uchicago.edu)
582  ************************************************************************/
583
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)
588  
589
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)
593
594 /* Runtime API */
595 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
596 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)