Sync usage with man page.
[netbsd-mini2440.git] / crypto / external / bsd / netpgp / dist / bindings / python / netpgppython_wrap.c
blobb8f4c0b17698d8ca2ae645bd80cceb22e2e0e595
1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 1.3.31
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 * ----------------------------------------------------------------------------- */
11 #define SWIGPYTHON
12 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
13 /* -----------------------------------------------------------------------------
14 * This section contains generic SWIG labels for method/variable
15 * declarations/attributes, and other compiler dependent labels.
16 * ----------------------------------------------------------------------------- */
18 /* template workaround for compilers that cannot correctly implement the C++ standard */
19 #ifndef SWIGTEMPLATEDISAMBIGUATOR
20 # if defined(__SUNPRO_CC)
21 # if (__SUNPRO_CC <= 0x560)
22 # define SWIGTEMPLATEDISAMBIGUATOR template
23 # else
24 # define SWIGTEMPLATEDISAMBIGUATOR
25 # endif
26 # else
27 # define SWIGTEMPLATEDISAMBIGUATOR
28 # endif
29 #endif
31 /* inline attribute */
32 #ifndef SWIGINLINE
33 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34 # define SWIGINLINE inline
35 # else
36 # define SWIGINLINE
37 # endif
38 #endif
40 /* attribute recognised by some compilers to avoid 'unused' warnings */
41 #ifndef SWIGUNUSED
42 # if defined(__GNUC__)
43 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44 # define SWIGUNUSED __attribute__ ((__unused__))
45 # else
46 # define SWIGUNUSED
47 # endif
48 # elif defined(__ICC)
49 # define SWIGUNUSED __attribute__ ((__unused__))
50 # else
51 # define SWIGUNUSED
52 # endif
53 #endif
55 #ifndef SWIGUNUSEDPARM
56 # ifdef __cplusplus
57 # define SWIGUNUSEDPARM(p)
58 # else
59 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
60 # endif
61 #endif
63 /* internal SWIG method */
64 #ifndef SWIGINTERN
65 # define SWIGINTERN static SWIGUNUSED
66 #endif
68 /* internal inline SWIG method */
69 #ifndef SWIGINTERNINLINE
70 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
71 #endif
73 /* exporting methods */
74 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
75 # ifndef GCC_HASCLASSVISIBILITY
76 # define GCC_HASCLASSVISIBILITY
77 # endif
78 #endif
80 #ifndef SWIGEXPORT
81 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
82 # if defined(STATIC_LINKED)
83 # define SWIGEXPORT
84 # else
85 # define SWIGEXPORT __declspec(dllexport)
86 # endif
87 # else
88 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
89 # define SWIGEXPORT __attribute__ ((visibility("default")))
90 # else
91 # define SWIGEXPORT
92 # endif
93 # endif
94 #endif
96 /* calling conventions for Windows */
97 #ifndef SWIGSTDCALL
98 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
99 # define SWIGSTDCALL __stdcall
100 # else
101 # define SWIGSTDCALL
102 # endif
103 #endif
105 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
106 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
107 # define _CRT_SECURE_NO_DEPRECATE
108 #endif
111 /* Python.h has to appear first */
112 #include <Python.h>
114 /* -----------------------------------------------------------------------------
115 * swigrun.swg
117 * This file contains generic CAPI SWIG runtime support for pointer
118 * type checking.
119 * ----------------------------------------------------------------------------- */
121 /* This should only be incremented when either the layout of swig_type_info changes,
122 or for whatever reason, the runtime changes incompatibly */
123 #define SWIG_RUNTIME_VERSION "3"
125 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
126 #ifdef SWIG_TYPE_TABLE
127 # define SWIG_QUOTE_STRING(x) #x
128 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
129 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
130 #else
131 # define SWIG_TYPE_TABLE_NAME
132 #endif
135 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
136 creating a static or dynamic library from the swig runtime code.
137 In 99.9% of the cases, swig just needs to declare them as 'static'.
139 But only do this if is strictly necessary, ie, if you have problems
140 with your compiler or so.
143 #ifndef SWIGRUNTIME
144 # define SWIGRUNTIME SWIGINTERN
145 #endif
147 #ifndef SWIGRUNTIMEINLINE
148 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
149 #endif
151 /* Generic buffer size */
152 #ifndef SWIG_BUFFER_SIZE
153 # define SWIG_BUFFER_SIZE 1024
154 #endif
156 /* Flags for pointer conversions */
157 #define SWIG_POINTER_DISOWN 0x1
159 /* Flags for new pointer objects */
160 #define SWIG_POINTER_OWN 0x1
164 Flags/methods for returning states.
166 The swig conversion methods, as ConvertPtr, return and integer
167 that tells if the conversion was successful or not. And if not,
168 an error code can be returned (see swigerrors.swg for the codes).
170 Use the following macros/flags to set or process the returning
171 states.
173 In old swig versions, you usually write code as:
175 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
176 // success code
177 } else {
178 //fail code
181 Now you can be more explicit as:
183 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
184 if (SWIG_IsOK(res)) {
185 // success code
186 } else {
187 // fail code
190 that seems to be the same, but now you can also do
192 Type *ptr;
193 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
194 if (SWIG_IsOK(res)) {
195 // success code
196 if (SWIG_IsNewObj(res) {
198 delete *ptr;
199 } else {
202 } else {
203 // fail code
206 I.e., now SWIG_ConvertPtr can return new objects and you can
207 identify the case and take care of the deallocation. Of course that
208 requires also to SWIG_ConvertPtr to return new result values, as
210 int SWIG_ConvertPtr(obj, ptr,...) {
211 if (<obj is ok>) {
212 if (<need new object>) {
213 *ptr = <ptr to new allocated object>;
214 return SWIG_NEWOBJ;
215 } else {
216 *ptr = <ptr to old object>;
217 return SWIG_OLDOBJ;
219 } else {
220 return SWIG_BADOBJ;
224 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
225 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
226 swig errors code.
228 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
229 allows to return the 'cast rank', for example, if you have this
231 int food(double)
232 int fooi(int);
234 and you call
236 food(1) // cast rank '1' (1 -> 1.0)
237 fooi(1) // cast rank '0'
239 just use the SWIG_AddCast()/SWIG_CheckState()
243 #define SWIG_OK (0)
244 #define SWIG_ERROR (-1)
245 #define SWIG_IsOK(r) (r >= 0)
246 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
248 /* The CastRankLimit says how many bits are used for the cast rank */
249 #define SWIG_CASTRANKLIMIT (1 << 8)
250 /* The NewMask denotes the object was created (using new/malloc) */
251 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
252 /* The TmpMask is for in/out typemaps that use temporal objects */
253 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
254 /* Simple returning values */
255 #define SWIG_BADOBJ (SWIG_ERROR)
256 #define SWIG_OLDOBJ (SWIG_OK)
257 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
258 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
259 /* Check, add and del mask methods */
260 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
261 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
262 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
263 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
264 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
265 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
268 /* Cast-Rank Mode */
269 #if defined(SWIG_CASTRANK_MODE)
270 # ifndef SWIG_TypeRank
271 # define SWIG_TypeRank unsigned long
272 # endif
273 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
274 # define SWIG_MAXCASTRANK (2)
275 # endif
276 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
277 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
278 SWIGINTERNINLINE int SWIG_AddCast(int r) {
279 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
281 SWIGINTERNINLINE int SWIG_CheckState(int r) {
282 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
284 #else /* no cast-rank mode */
285 # define SWIG_AddCast
286 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
287 #endif
292 #include <string.h>
294 #ifdef __cplusplus
295 extern "C" {
296 #endif
298 typedef void *(*swig_converter_func)(void *);
299 typedef struct swig_type_info *(*swig_dycast_func)(void **);
301 /* Structure to store inforomation on one type */
302 typedef struct swig_type_info {
303 const char *name; /* mangled name of this type */
304 const char *str; /* human readable name of this type */
305 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
306 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
307 void *clientdata; /* language specific type data */
308 int owndata; /* flag if the structure owns the clientdata */
309 } swig_type_info;
311 /* Structure to store a type and conversion function used for casting */
312 typedef struct swig_cast_info {
313 swig_type_info *type; /* pointer to type that is equivalent to this type */
314 swig_converter_func converter; /* function to cast the void pointers */
315 struct swig_cast_info *next; /* pointer to next cast in linked list */
316 struct swig_cast_info *prev; /* pointer to the previous cast */
317 } swig_cast_info;
319 /* Structure used to store module information
320 * Each module generates one structure like this, and the runtime collects
321 * all of these structures and stores them in a circularly linked list.*/
322 typedef struct swig_module_info {
323 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
324 size_t size; /* Number of types in this module */
325 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
326 swig_type_info **type_initial; /* Array of initially generated type structures */
327 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
328 void *clientdata; /* Language specific module data */
329 } swig_module_info;
332 Compare two type names skipping the space characters, therefore
333 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
335 Return 0 when the two name types are equivalent, as in
336 strncmp, but skipping ' '.
338 SWIGRUNTIME int
339 SWIG_TypeNameComp(const char *f1, const char *l1,
340 const char *f2, const char *l2) {
341 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
342 while ((*f1 == ' ') && (f1 != l1)) ++f1;
343 while ((*f2 == ' ') && (f2 != l2)) ++f2;
344 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
346 return (l1 - f1) - (l2 - f2);
350 Check type equivalence in a name list like <name1>|<name2>|...
351 Return 0 if not equal, 1 if equal
353 SWIGRUNTIME int
354 SWIG_TypeEquiv(const char *nb, const char *tb) {
355 int equiv = 0;
356 const char* te = tb + strlen(tb);
357 const char* ne = nb;
358 while (!equiv && *ne) {
359 for (nb = ne; *ne; ++ne) {
360 if (*ne == '|') break;
362 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
363 if (*ne) ++ne;
365 return equiv;
369 Check type equivalence in a name list like <name1>|<name2>|...
370 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
372 SWIGRUNTIME int
373 SWIG_TypeCompare(const char *nb, const char *tb) {
374 int equiv = 0;
375 const char* te = tb + strlen(tb);
376 const char* ne = nb;
377 while (!equiv && *ne) {
378 for (nb = ne; *ne; ++ne) {
379 if (*ne == '|') break;
381 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
382 if (*ne) ++ne;
384 return equiv;
388 /* think of this as a c++ template<> or a scheme macro */
389 #define SWIG_TypeCheck_Template(comparison, ty) \
390 if (ty) { \
391 swig_cast_info *iter = ty->cast; \
392 while (iter) { \
393 if (comparison) { \
394 if (iter == ty->cast) return iter; \
395 /* Move iter to the top of the linked list */ \
396 iter->prev->next = iter->next; \
397 if (iter->next) \
398 iter->next->prev = iter->prev; \
399 iter->next = ty->cast; \
400 iter->prev = 0; \
401 if (ty->cast) ty->cast->prev = iter; \
402 ty->cast = iter; \
403 return iter; \
405 iter = iter->next; \
408 return 0
411 Check the typename
413 SWIGRUNTIME swig_cast_info *
414 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
415 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
418 /* Same as previous function, except strcmp is replaced with a pointer comparison */
419 SWIGRUNTIME swig_cast_info *
420 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
421 SWIG_TypeCheck_Template(iter->type == from, into);
425 Cast a pointer up an inheritance hierarchy
427 SWIGRUNTIMEINLINE void *
428 SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
429 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
433 Dynamic pointer casting. Down an inheritance hierarchy
435 SWIGRUNTIME swig_type_info *
436 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
437 swig_type_info *lastty = ty;
438 if (!ty || !ty->dcast) return ty;
439 while (ty && (ty->dcast)) {
440 ty = (*ty->dcast)(ptr);
441 if (ty) lastty = ty;
443 return lastty;
447 Return the name associated with this type
449 SWIGRUNTIMEINLINE const char *
450 SWIG_TypeName(const swig_type_info *ty) {
451 return ty->name;
455 Return the pretty name associated with this type,
456 that is an unmangled type name in a form presentable to the user.
458 SWIGRUNTIME const char *
459 SWIG_TypePrettyName(const swig_type_info *type) {
460 /* The "str" field contains the equivalent pretty names of the
461 type, separated by vertical-bar characters. We choose
462 to print the last name, as it is often (?) the most
463 specific. */
464 if (!type) return NULL;
465 if (type->str != NULL) {
466 const char *last_name = type->str;
467 const char *s;
468 for (s = type->str; *s; s++)
469 if (*s == '|') last_name = s+1;
470 return last_name;
472 else
473 return type->name;
477 Set the clientdata field for a type
479 SWIGRUNTIME void
480 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
481 swig_cast_info *cast = ti->cast;
482 /* if (ti->clientdata == clientdata) return; */
483 ti->clientdata = clientdata;
485 while (cast) {
486 if (!cast->converter) {
487 swig_type_info *tc = cast->type;
488 if (!tc->clientdata) {
489 SWIG_TypeClientData(tc, clientdata);
492 cast = cast->next;
495 SWIGRUNTIME void
496 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
497 SWIG_TypeClientData(ti, clientdata);
498 ti->owndata = 1;
502 Search for a swig_type_info structure only by mangled name
503 Search is a O(log #types)
505 We start searching at module start, and finish searching when start == end.
506 Note: if start == end at the beginning of the function, we go all the way around
507 the circular list.
509 SWIGRUNTIME swig_type_info *
510 SWIG_MangledTypeQueryModule(swig_module_info *start,
511 swig_module_info *end,
512 const char *name) {
513 swig_module_info *iter = start;
514 do {
515 if (iter->size) {
516 register size_t l = 0;
517 register size_t r = iter->size - 1;
518 do {
519 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
520 register size_t i = (l + r) >> 1;
521 const char *iname = iter->types[i]->name;
522 if (iname) {
523 register int compare = strcmp(name, iname);
524 if (compare == 0) {
525 return iter->types[i];
526 } else if (compare < 0) {
527 if (i) {
528 r = i - 1;
529 } else {
530 break;
532 } else if (compare > 0) {
533 l = i + 1;
535 } else {
536 break; /* should never happen */
538 } while (l <= r);
540 iter = iter->next;
541 } while (iter != end);
542 return 0;
546 Search for a swig_type_info structure for either a mangled name or a human readable name.
547 It first searches the mangled names of the types, which is a O(log #types)
548 If a type is not found it then searches the human readable names, which is O(#types).
550 We start searching at module start, and finish searching when start == end.
551 Note: if start == end at the beginning of the function, we go all the way around
552 the circular list.
554 SWIGRUNTIME swig_type_info *
555 SWIG_TypeQueryModule(swig_module_info *start,
556 swig_module_info *end,
557 const char *name) {
558 /* STEP 1: Search the name field using binary search */
559 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
560 if (ret) {
561 return ret;
562 } else {
563 /* STEP 2: If the type hasn't been found, do a complete search
564 of the str field (the human readable name) */
565 swig_module_info *iter = start;
566 do {
567 register size_t i = 0;
568 for (; i < iter->size; ++i) {
569 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
570 return iter->types[i];
572 iter = iter->next;
573 } while (iter != end);
576 /* neither found a match */
577 return 0;
581 Pack binary data into a string
583 SWIGRUNTIME char *
584 SWIG_PackData(char *c, void *ptr, size_t sz) {
585 static const char hex[17] = "0123456789abcdef";
586 register const unsigned char *u = (unsigned char *) ptr;
587 register const unsigned char *eu = u + sz;
588 for (; u != eu; ++u) {
589 register unsigned char uu = *u;
590 *(c++) = hex[(uu & 0xf0) >> 4];
591 *(c++) = hex[uu & 0xf];
593 return c;
597 Unpack binary data from a string
599 SWIGRUNTIME const char *
600 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
601 register unsigned char *u = (unsigned char *) ptr;
602 register const unsigned char *eu = u + sz;
603 for (; u != eu; ++u) {
604 register char d = *(c++);
605 register unsigned char uu;
606 if ((d >= '0') && (d <= '9'))
607 uu = ((d - '0') << 4);
608 else if ((d >= 'a') && (d <= 'f'))
609 uu = ((d - ('a'-10)) << 4);
610 else
611 return (char *) 0;
612 d = *(c++);
613 if ((d >= '0') && (d <= '9'))
614 uu |= (d - '0');
615 else if ((d >= 'a') && (d <= 'f'))
616 uu |= (d - ('a'-10));
617 else
618 return (char *) 0;
619 *u = uu;
621 return c;
625 Pack 'void *' into a string buffer.
627 SWIGRUNTIME char *
628 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
629 char *r = buff;
630 if ((2*sizeof(void *) + 2) > bsz) return 0;
631 *(r++) = '_';
632 r = SWIG_PackData(r,&ptr,sizeof(void *));
633 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
634 strcpy(r,name);
635 return buff;
638 SWIGRUNTIME const char *
639 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
640 if (*c != '_') {
641 if (strcmp(c,"NULL") == 0) {
642 *ptr = (void *) 0;
643 return name;
644 } else {
645 return 0;
648 return SWIG_UnpackData(++c,ptr,sizeof(void *));
651 SWIGRUNTIME char *
652 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
653 char *r = buff;
654 size_t lname = (name ? strlen(name) : 0);
655 if ((2*sz + 2 + lname) > bsz) return 0;
656 *(r++) = '_';
657 r = SWIG_PackData(r,ptr,sz);
658 if (lname) {
659 strncpy(r,name,lname+1);
660 } else {
661 *r = 0;
663 return buff;
666 SWIGRUNTIME const char *
667 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
668 if (*c != '_') {
669 if (strcmp(c,"NULL") == 0) {
670 memset(ptr,0,sz);
671 return name;
672 } else {
673 return 0;
676 return SWIG_UnpackData(++c,ptr,sz);
679 #ifdef __cplusplus
681 #endif
683 /* Errors in SWIG */
684 #define SWIG_UnknownError -1
685 #define SWIG_IOError -2
686 #define SWIG_RuntimeError -3
687 #define SWIG_IndexError -4
688 #define SWIG_TypeError -5
689 #define SWIG_DivisionByZero -6
690 #define SWIG_OverflowError -7
691 #define SWIG_SyntaxError -8
692 #define SWIG_ValueError -9
693 #define SWIG_SystemError -10
694 #define SWIG_AttributeError -11
695 #define SWIG_MemoryError -12
696 #define SWIG_NullReferenceError -13
701 /* Add PyOS_snprintf for old Pythons */
702 #if PY_VERSION_HEX < 0x02020000
703 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
704 # define PyOS_snprintf _snprintf
705 # else
706 # define PyOS_snprintf snprintf
707 # endif
708 #endif
710 /* A crude PyString_FromFormat implementation for old Pythons */
711 #if PY_VERSION_HEX < 0x02020000
713 #ifndef SWIG_PYBUFFER_SIZE
714 # define SWIG_PYBUFFER_SIZE 1024
715 #endif
717 static PyObject *
718 PyString_FromFormat(const char *fmt, ...) {
719 va_list ap;
720 char buf[SWIG_PYBUFFER_SIZE * 2];
721 int res;
722 va_start(ap, fmt);
723 res = vsnprintf(buf, sizeof(buf), fmt, ap);
724 va_end(ap);
725 return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
727 #endif
729 /* Add PyObject_Del for old Pythons */
730 #if PY_VERSION_HEX < 0x01060000
731 # define PyObject_Del(op) PyMem_DEL((op))
732 #endif
733 #ifndef PyObject_DEL
734 # define PyObject_DEL PyObject_Del
735 #endif
737 /* A crude PyExc_StopIteration exception for old Pythons */
738 #if PY_VERSION_HEX < 0x02020000
739 # ifndef PyExc_StopIteration
740 # define PyExc_StopIteration PyExc_RuntimeError
741 # endif
742 # ifndef PyObject_GenericGetAttr
743 # define PyObject_GenericGetAttr 0
744 # endif
745 #endif
746 /* Py_NotImplemented is defined in 2.1 and up. */
747 #if PY_VERSION_HEX < 0x02010000
748 # ifndef Py_NotImplemented
749 # define Py_NotImplemented PyExc_RuntimeError
750 # endif
751 #endif
754 /* A crude PyString_AsStringAndSize implementation for old Pythons */
755 #if PY_VERSION_HEX < 0x02010000
756 # ifndef PyString_AsStringAndSize
757 # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
758 # endif
759 #endif
761 /* PySequence_Size for old Pythons */
762 #if PY_VERSION_HEX < 0x02000000
763 # ifndef PySequence_Size
764 # define PySequence_Size PySequence_Length
765 # endif
766 #endif
769 /* PyBool_FromLong for old Pythons */
770 #if PY_VERSION_HEX < 0x02030000
771 static
772 PyObject *PyBool_FromLong(long ok)
774 PyObject *result = ok ? Py_True : Py_False;
775 Py_INCREF(result);
776 return result;
778 #endif
780 /* Py_ssize_t for old Pythons */
781 /* This code is as recommended by: */
782 /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
783 #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
784 typedef int Py_ssize_t;
785 # define PY_SSIZE_T_MAX INT_MAX
786 # define PY_SSIZE_T_MIN INT_MIN
787 #endif
789 /* -----------------------------------------------------------------------------
790 * error manipulation
791 * ----------------------------------------------------------------------------- */
793 SWIGRUNTIME PyObject*
794 SWIG_Python_ErrorType(int code) {
795 PyObject* type = 0;
796 switch(code) {
797 case SWIG_MemoryError:
798 type = PyExc_MemoryError;
799 break;
800 case SWIG_IOError:
801 type = PyExc_IOError;
802 break;
803 case SWIG_RuntimeError:
804 type = PyExc_RuntimeError;
805 break;
806 case SWIG_IndexError:
807 type = PyExc_IndexError;
808 break;
809 case SWIG_TypeError:
810 type = PyExc_TypeError;
811 break;
812 case SWIG_DivisionByZero:
813 type = PyExc_ZeroDivisionError;
814 break;
815 case SWIG_OverflowError:
816 type = PyExc_OverflowError;
817 break;
818 case SWIG_SyntaxError:
819 type = PyExc_SyntaxError;
820 break;
821 case SWIG_ValueError:
822 type = PyExc_ValueError;
823 break;
824 case SWIG_SystemError:
825 type = PyExc_SystemError;
826 break;
827 case SWIG_AttributeError:
828 type = PyExc_AttributeError;
829 break;
830 default:
831 type = PyExc_RuntimeError;
833 return type;
837 SWIGRUNTIME void
838 SWIG_Python_AddErrorMsg(const char* mesg)
840 PyObject *type = 0;
841 PyObject *value = 0;
842 PyObject *traceback = 0;
844 if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
845 if (value) {
846 PyObject *old_str = PyObject_Str(value);
847 PyErr_Clear();
848 Py_XINCREF(type);
849 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
850 Py_DECREF(old_str);
851 Py_DECREF(value);
852 } else {
853 PyErr_Format(PyExc_RuntimeError, mesg);
859 #if defined(SWIG_PYTHON_NO_THREADS)
860 # if defined(SWIG_PYTHON_THREADS)
861 # undef SWIG_PYTHON_THREADS
862 # endif
863 #endif
864 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
865 # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
866 # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
867 # define SWIG_PYTHON_USE_GIL
868 # endif
869 # endif
870 # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
871 # ifndef SWIG_PYTHON_INITIALIZE_THREADS
872 # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads()
873 # endif
874 # ifdef __cplusplus /* C++ code */
875 class SWIG_Python_Thread_Block {
876 bool status;
877 PyGILState_STATE state;
878 public:
879 void end() { if (status) { PyGILState_Release(state); status = false;} }
880 SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
881 ~SWIG_Python_Thread_Block() { end(); }
883 class SWIG_Python_Thread_Allow {
884 bool status;
885 PyThreadState *save;
886 public:
887 void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
888 SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
889 ~SWIG_Python_Thread_Allow() { end(); }
891 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block
892 # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end()
893 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow
894 # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end()
895 # else /* C code */
896 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
897 # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block)
898 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread()
899 # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow)
900 # endif
901 # else /* Old thread way, not implemented, user must provide it */
902 # if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
903 # define SWIG_PYTHON_INITIALIZE_THREADS
904 # endif
905 # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
906 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
907 # endif
908 # if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
909 # define SWIG_PYTHON_THREAD_END_BLOCK
910 # endif
911 # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
912 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
913 # endif
914 # if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
915 # define SWIG_PYTHON_THREAD_END_ALLOW
916 # endif
917 # endif
918 #else /* No thread support */
919 # define SWIG_PYTHON_INITIALIZE_THREADS
920 # define SWIG_PYTHON_THREAD_BEGIN_BLOCK
921 # define SWIG_PYTHON_THREAD_END_BLOCK
922 # define SWIG_PYTHON_THREAD_BEGIN_ALLOW
923 # define SWIG_PYTHON_THREAD_END_ALLOW
924 #endif
926 /* -----------------------------------------------------------------------------
927 * Python API portion that goes into the runtime
928 * ----------------------------------------------------------------------------- */
930 #ifdef __cplusplus
931 extern "C" {
932 #if 0
933 } /* cc-mode */
934 #endif
935 #endif
937 /* -----------------------------------------------------------------------------
938 * Constant declarations
939 * ----------------------------------------------------------------------------- */
941 /* Constant Types */
942 #define SWIG_PY_POINTER 4
943 #define SWIG_PY_BINARY 5
945 /* Constant information structure */
946 typedef struct swig_const_info {
947 int type;
948 char *name;
949 long lvalue;
950 double dvalue;
951 void *pvalue;
952 swig_type_info **ptype;
953 } swig_const_info;
955 #ifdef __cplusplus
956 #if 0
957 { /* cc-mode */
958 #endif
960 #endif
963 /* -----------------------------------------------------------------------------
964 * See the LICENSE file for information on copyright, usage and redistribution
965 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
967 * pyrun.swg
969 * This file contains the runtime support for Python modules
970 * and includes code for managing global variables and pointer
971 * type checking.
973 * ----------------------------------------------------------------------------- */
975 /* Common SWIG API */
977 /* for raw pointers */
978 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
979 #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags)
980 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
981 #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags)
982 #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty)
983 #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src)
984 #define swig_owntype int
986 /* for raw packed data */
987 #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
988 #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
990 /* for class or struct pointers */
991 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
992 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
994 /* for C or C++ function pointers */
995 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
996 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0)
998 /* for C++ member pointers, ie, member methods */
999 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1000 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type)
1003 /* Runtime API */
1005 #define SWIG_GetModule(clientdata) SWIG_Python_GetModule()
1006 #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer)
1007 #define SWIG_NewClientData(obj) PySwigClientData_New(obj)
1009 #define SWIG_SetErrorObj SWIG_Python_SetErrorObj
1010 #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
1011 #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
1012 #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1013 #define SWIG_fail goto fail
1016 /* Runtime API implementation */
1018 /* Error manipulation */
1020 SWIGINTERN void
1021 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1022 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1023 PyErr_SetObject(errtype, obj);
1024 Py_DECREF(obj);
1025 SWIG_PYTHON_THREAD_END_BLOCK;
1028 SWIGINTERN void
1029 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1030 SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1031 PyErr_SetString(errtype, (char *) msg);
1032 SWIG_PYTHON_THREAD_END_BLOCK;
1035 #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1037 /* Set a constant value */
1039 SWIGINTERN void
1040 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1041 PyDict_SetItemString(d, (char*) name, obj);
1042 Py_DECREF(obj);
1045 /* Append a value to the result obj */
1047 SWIGINTERN PyObject*
1048 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1049 #if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
1050 if (!result) {
1051 result = obj;
1052 } else if (result == Py_None) {
1053 Py_DECREF(result);
1054 result = obj;
1055 } else {
1056 if (!PyList_Check(result)) {
1057 PyObject *o2 = result;
1058 result = PyList_New(1);
1059 PyList_SetItem(result, 0, o2);
1061 PyList_Append(result,obj);
1062 Py_DECREF(obj);
1064 return result;
1065 #else
1066 PyObject* o2;
1067 PyObject* o3;
1068 if (!result) {
1069 result = obj;
1070 } else if (result == Py_None) {
1071 Py_DECREF(result);
1072 result = obj;
1073 } else {
1074 if (!PyTuple_Check(result)) {
1075 o2 = result;
1076 result = PyTuple_New(1);
1077 PyTuple_SET_ITEM(result, 0, o2);
1079 o3 = PyTuple_New(1);
1080 PyTuple_SET_ITEM(o3, 0, obj);
1081 o2 = result;
1082 result = PySequence_Concat(o2, o3);
1083 Py_DECREF(o2);
1084 Py_DECREF(o3);
1086 return result;
1087 #endif
1090 /* Unpack the argument tuple */
1092 SWIGINTERN int
1093 SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs)
1095 if (!args) {
1096 if (!min && !max) {
1097 return 1;
1098 } else {
1099 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1100 name, (min == max ? "" : "at least "), min);
1101 return 0;
1104 if (!PyTuple_Check(args)) {
1105 PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1106 return 0;
1107 } else {
1108 register int l = PyTuple_GET_SIZE(args);
1109 if (l < min) {
1110 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1111 name, (min == max ? "" : "at least "), min, l);
1112 return 0;
1113 } else if (l > max) {
1114 PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1115 name, (min == max ? "" : "at most "), max, l);
1116 return 0;
1117 } else {
1118 register int i;
1119 for (i = 0; i < l; ++i) {
1120 objs[i] = PyTuple_GET_ITEM(args, i);
1122 for (; l < max; ++l) {
1123 objs[l] = 0;
1125 return i + 1;
1130 /* A functor is a function object with one single object argument */
1131 #if PY_VERSION_HEX >= 0x02020000
1132 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL);
1133 #else
1134 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj);
1135 #endif
1138 Helper for static pointer initialization for both C and C++ code, for example
1139 static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1141 #ifdef __cplusplus
1142 #define SWIG_STATIC_POINTER(var) var
1143 #else
1144 #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var
1145 #endif
1147 /* -----------------------------------------------------------------------------
1148 * Pointer declarations
1149 * ----------------------------------------------------------------------------- */
1151 /* Flags for new pointer objects */
1152 #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1)
1153 #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1155 #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1)
1157 #ifdef __cplusplus
1158 extern "C" {
1159 #if 0
1160 } /* cc-mode */
1161 #endif
1162 #endif
1164 /* How to access Py_None */
1165 #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
1166 # ifndef SWIG_PYTHON_NO_BUILD_NONE
1167 # ifndef SWIG_PYTHON_BUILD_NONE
1168 # define SWIG_PYTHON_BUILD_NONE
1169 # endif
1170 # endif
1171 #endif
1173 #ifdef SWIG_PYTHON_BUILD_NONE
1174 # ifdef Py_None
1175 # undef Py_None
1176 # define Py_None SWIG_Py_None()
1177 # endif
1178 SWIGRUNTIMEINLINE PyObject *
1179 _SWIG_Py_None(void)
1181 PyObject *none = Py_BuildValue((char*)"");
1182 Py_DECREF(none);
1183 return none;
1185 SWIGRUNTIME PyObject *
1186 SWIG_Py_None(void)
1188 static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
1189 return none;
1191 #endif
1193 /* The python void return value */
1195 SWIGRUNTIMEINLINE PyObject *
1196 SWIG_Py_Void(void)
1198 PyObject *none = Py_None;
1199 Py_INCREF(none);
1200 return none;
1203 /* PySwigClientData */
1205 typedef struct {
1206 PyObject *klass;
1207 PyObject *newraw;
1208 PyObject *newargs;
1209 PyObject *destroy;
1210 int delargs;
1211 int implicitconv;
1212 } PySwigClientData;
1214 SWIGRUNTIMEINLINE int
1215 SWIG_Python_CheckImplicit(swig_type_info *ty)
1217 PySwigClientData *data = (PySwigClientData *)ty->clientdata;
1218 return data ? data->implicitconv : 0;
1221 SWIGRUNTIMEINLINE PyObject *
1222 SWIG_Python_ExceptionType(swig_type_info *desc) {
1223 PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
1224 PyObject *klass = data ? data->klass : 0;
1225 return (klass ? klass : PyExc_RuntimeError);
1229 SWIGRUNTIME PySwigClientData *
1230 PySwigClientData_New(PyObject* obj)
1232 if (!obj) {
1233 return 0;
1234 } else {
1235 PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
1236 /* the klass element */
1237 data->klass = obj;
1238 Py_INCREF(data->klass);
1239 /* the newraw method and newargs arguments used to create a new raw instance */
1240 if (PyClass_Check(obj)) {
1241 data->newraw = 0;
1242 data->newargs = obj;
1243 Py_INCREF(obj);
1244 } else {
1245 #if (PY_VERSION_HEX < 0x02020000)
1246 data->newraw = 0;
1247 #else
1248 data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
1249 #endif
1250 if (data->newraw) {
1251 Py_INCREF(data->newraw);
1252 data->newargs = PyTuple_New(1);
1253 PyTuple_SetItem(data->newargs, 0, obj);
1254 } else {
1255 data->newargs = obj;
1257 Py_INCREF(data->newargs);
1259 /* the destroy method, aka as the C++ delete method */
1260 data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
1261 if (PyErr_Occurred()) {
1262 PyErr_Clear();
1263 data->destroy = 0;
1265 if (data->destroy) {
1266 int flags;
1267 Py_INCREF(data->destroy);
1268 flags = PyCFunction_GET_FLAGS(data->destroy);
1269 #ifdef METH_O
1270 data->delargs = !(flags & (METH_O));
1271 #else
1272 data->delargs = 0;
1273 #endif
1274 } else {
1275 data->delargs = 0;
1277 data->implicitconv = 0;
1278 return data;
1282 SWIGRUNTIME void
1283 PySwigClientData_Del(PySwigClientData* data)
1285 Py_XDECREF(data->newraw);
1286 Py_XDECREF(data->newargs);
1287 Py_XDECREF(data->destroy);
1290 /* =============== PySwigObject =====================*/
1292 typedef struct {
1293 PyObject_HEAD
1294 void *ptr;
1295 swig_type_info *ty;
1296 int own;
1297 PyObject *next;
1298 } PySwigObject;
1300 SWIGRUNTIME PyObject *
1301 PySwigObject_long(PySwigObject *v)
1303 return PyLong_FromVoidPtr(v->ptr);
1306 SWIGRUNTIME PyObject *
1307 PySwigObject_format(const char* fmt, PySwigObject *v)
1309 PyObject *res = NULL;
1310 PyObject *args = PyTuple_New(1);
1311 if (args) {
1312 if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
1313 PyObject *ofmt = PyString_FromString(fmt);
1314 if (ofmt) {
1315 res = PyString_Format(ofmt,args);
1316 Py_DECREF(ofmt);
1318 Py_DECREF(args);
1321 return res;
1324 SWIGRUNTIME PyObject *
1325 PySwigObject_oct(PySwigObject *v)
1327 return PySwigObject_format("%o",v);
1330 SWIGRUNTIME PyObject *
1331 PySwigObject_hex(PySwigObject *v)
1333 return PySwigObject_format("%x",v);
1336 SWIGRUNTIME PyObject *
1337 #ifdef METH_NOARGS
1338 PySwigObject_repr(PySwigObject *v)
1339 #else
1340 PySwigObject_repr(PySwigObject *v, PyObject *args)
1341 #endif
1343 const char *name = SWIG_TypePrettyName(v->ty);
1344 PyObject *hex = PySwigObject_hex(v);
1345 PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
1346 Py_DECREF(hex);
1347 if (v->next) {
1348 #ifdef METH_NOARGS
1349 PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
1350 #else
1351 PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
1352 #endif
1353 PyString_ConcatAndDel(&repr,nrep);
1355 return repr;
1358 SWIGRUNTIME int
1359 PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1361 #ifdef METH_NOARGS
1362 PyObject *repr = PySwigObject_repr(v);
1363 #else
1364 PyObject *repr = PySwigObject_repr(v, NULL);
1365 #endif
1366 if (repr) {
1367 fputs(PyString_AsString(repr), fp);
1368 Py_DECREF(repr);
1369 return 0;
1370 } else {
1371 return 1;
1375 SWIGRUNTIME PyObject *
1376 PySwigObject_str(PySwigObject *v)
1378 char result[SWIG_BUFFER_SIZE];
1379 return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
1380 PyString_FromString(result) : 0;
1383 SWIGRUNTIME int
1384 PySwigObject_compare(PySwigObject *v, PySwigObject *w)
1386 void *i = v->ptr;
1387 void *j = w->ptr;
1388 return (i < j) ? -1 : ((i > j) ? 1 : 0);
1391 SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
1393 SWIGRUNTIME PyTypeObject*
1394 PySwigObject_type(void) {
1395 static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
1396 return type;
1399 SWIGRUNTIMEINLINE int
1400 PySwigObject_Check(PyObject *op) {
1401 return ((op)->ob_type == PySwigObject_type())
1402 || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
1405 SWIGRUNTIME PyObject *
1406 PySwigObject_New(void *ptr, swig_type_info *ty, int own);
1408 SWIGRUNTIME void
1409 PySwigObject_dealloc(PyObject *v)
1411 PySwigObject *sobj = (PySwigObject *) v;
1412 PyObject *next = sobj->next;
1413 if (sobj->own) {
1414 swig_type_info *ty = sobj->ty;
1415 PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
1416 PyObject *destroy = data ? data->destroy : 0;
1417 if (destroy) {
1418 /* destroy is always a VARARGS method */
1419 PyObject *res;
1420 if (data->delargs) {
1421 /* we need to create a temporal object to carry the destroy operation */
1422 PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
1423 res = SWIG_Python_CallFunctor(destroy, tmp);
1424 Py_DECREF(tmp);
1425 } else {
1426 PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1427 PyObject *mself = PyCFunction_GET_SELF(destroy);
1428 res = ((*meth)(mself, v));
1430 Py_XDECREF(res);
1431 } else {
1432 const char *name = SWIG_TypePrettyName(ty);
1433 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1434 printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name);
1435 #endif
1438 Py_XDECREF(next);
1439 PyObject_DEL(v);
1442 SWIGRUNTIME PyObject*
1443 PySwigObject_append(PyObject* v, PyObject* next)
1445 PySwigObject *sobj = (PySwigObject *) v;
1446 #ifndef METH_O
1447 PyObject *tmp = 0;
1448 if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
1449 next = tmp;
1450 #endif
1451 if (!PySwigObject_Check(next)) {
1452 return NULL;
1454 sobj->next = next;
1455 Py_INCREF(next);
1456 return SWIG_Py_Void();
1459 SWIGRUNTIME PyObject*
1460 #ifdef METH_NOARGS
1461 PySwigObject_next(PyObject* v)
1462 #else
1463 PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1464 #endif
1466 PySwigObject *sobj = (PySwigObject *) v;
1467 if (sobj->next) {
1468 Py_INCREF(sobj->next);
1469 return sobj->next;
1470 } else {
1471 return SWIG_Py_Void();
1475 SWIGINTERN PyObject*
1476 #ifdef METH_NOARGS
1477 PySwigObject_disown(PyObject *v)
1478 #else
1479 PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1480 #endif
1482 PySwigObject *sobj = (PySwigObject *)v;
1483 sobj->own = 0;
1484 return SWIG_Py_Void();
1487 SWIGINTERN PyObject*
1488 #ifdef METH_NOARGS
1489 PySwigObject_acquire(PyObject *v)
1490 #else
1491 PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1492 #endif
1494 PySwigObject *sobj = (PySwigObject *)v;
1495 sobj->own = SWIG_POINTER_OWN;
1496 return SWIG_Py_Void();
1499 SWIGINTERN PyObject*
1500 PySwigObject_own(PyObject *v, PyObject *args)
1502 PyObject *val = 0;
1503 #if (PY_VERSION_HEX < 0x02020000)
1504 if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
1505 #else
1506 if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val))
1507 #endif
1509 return NULL;
1511 else
1513 PySwigObject *sobj = (PySwigObject *)v;
1514 PyObject *obj = PyBool_FromLong(sobj->own);
1515 if (val) {
1516 #ifdef METH_NOARGS
1517 if (PyObject_IsTrue(val)) {
1518 PySwigObject_acquire(v);
1519 } else {
1520 PySwigObject_disown(v);
1522 #else
1523 if (PyObject_IsTrue(val)) {
1524 PySwigObject_acquire(v,args);
1525 } else {
1526 PySwigObject_disown(v,args);
1528 #endif
1530 return obj;
1534 #ifdef METH_O
1535 static PyMethodDef
1536 swigobject_methods[] = {
1537 {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"},
1538 {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"},
1539 {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1540 {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"},
1541 {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"},
1542 {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"},
1543 {0, 0, 0, 0}
1545 #else
1546 static PyMethodDef
1547 swigobject_methods[] = {
1548 {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
1549 {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"},
1550 {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
1551 {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
1552 {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
1553 {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"},
1554 {0, 0, 0, 0}
1556 #endif
1558 #if PY_VERSION_HEX < 0x02020000
1559 SWIGINTERN PyObject *
1560 PySwigObject_getattr(PySwigObject *sobj,char *name)
1562 return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
1564 #endif
1566 SWIGRUNTIME PyTypeObject*
1567 _PySwigObject_type(void) {
1568 static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1570 static PyNumberMethods PySwigObject_as_number = {
1571 (binaryfunc)0, /*nb_add*/
1572 (binaryfunc)0, /*nb_subtract*/
1573 (binaryfunc)0, /*nb_multiply*/
1574 (binaryfunc)0, /*nb_divide*/
1575 (binaryfunc)0, /*nb_remainder*/
1576 (binaryfunc)0, /*nb_divmod*/
1577 (ternaryfunc)0,/*nb_power*/
1578 (unaryfunc)0, /*nb_negative*/
1579 (unaryfunc)0, /*nb_positive*/
1580 (unaryfunc)0, /*nb_absolute*/
1581 (inquiry)0, /*nb_nonzero*/
1582 0, /*nb_invert*/
1583 0, /*nb_lshift*/
1584 0, /*nb_rshift*/
1585 0, /*nb_and*/
1586 0, /*nb_xor*/
1587 0, /*nb_or*/
1588 (coercion)0, /*nb_coerce*/
1589 (unaryfunc)PySwigObject_long, /*nb_int*/
1590 (unaryfunc)PySwigObject_long, /*nb_long*/
1591 (unaryfunc)0, /*nb_float*/
1592 (unaryfunc)PySwigObject_oct, /*nb_oct*/
1593 (unaryfunc)PySwigObject_hex, /*nb_hex*/
1594 #if PY_VERSION_HEX >= 0x02020000
1595 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
1596 #elif PY_VERSION_HEX >= 0x02000000
1597 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
1598 #endif
1601 static PyTypeObject pyswigobject_type;
1602 static int type_init = 0;
1603 if (!type_init) {
1604 const PyTypeObject tmp
1606 PyObject_HEAD_INIT(NULL)
1607 0, /* ob_size */
1608 (char *)"PySwigObject", /* tp_name */
1609 sizeof(PySwigObject), /* tp_basicsize */
1610 0, /* tp_itemsize */
1611 (destructor)PySwigObject_dealloc, /* tp_dealloc */
1612 (printfunc)PySwigObject_print, /* tp_print */
1613 #if PY_VERSION_HEX < 0x02020000
1614 (getattrfunc)PySwigObject_getattr, /* tp_getattr */
1615 #else
1616 (getattrfunc)0, /* tp_getattr */
1617 #endif
1618 (setattrfunc)0, /* tp_setattr */
1619 (cmpfunc)PySwigObject_compare, /* tp_compare */
1620 (reprfunc)PySwigObject_repr, /* tp_repr */
1621 &PySwigObject_as_number, /* tp_as_number */
1622 0, /* tp_as_sequence */
1623 0, /* tp_as_mapping */
1624 (hashfunc)0, /* tp_hash */
1625 (ternaryfunc)0, /* tp_call */
1626 (reprfunc)PySwigObject_str, /* tp_str */
1627 PyObject_GenericGetAttr, /* tp_getattro */
1628 0, /* tp_setattro */
1629 0, /* tp_as_buffer */
1630 Py_TPFLAGS_DEFAULT, /* tp_flags */
1631 swigobject_doc, /* tp_doc */
1632 0, /* tp_traverse */
1633 0, /* tp_clear */
1634 0, /* tp_richcompare */
1635 0, /* tp_weaklistoffset */
1636 #if PY_VERSION_HEX >= 0x02020000
1637 0, /* tp_iter */
1638 0, /* tp_iternext */
1639 swigobject_methods, /* tp_methods */
1640 0, /* tp_members */
1641 0, /* tp_getset */
1642 0, /* tp_base */
1643 0, /* tp_dict */
1644 0, /* tp_descr_get */
1645 0, /* tp_descr_set */
1646 0, /* tp_dictoffset */
1647 0, /* tp_init */
1648 0, /* tp_alloc */
1649 0, /* tp_new */
1650 0, /* tp_free */
1651 0, /* tp_is_gc */
1652 0, /* tp_bases */
1653 0, /* tp_mro */
1654 0, /* tp_cache */
1655 0, /* tp_subclasses */
1656 0, /* tp_weaklist */
1657 #endif
1658 #if PY_VERSION_HEX >= 0x02030000
1659 0, /* tp_del */
1660 #endif
1661 #ifdef COUNT_ALLOCS
1662 0,0,0,0 /* tp_alloc -> tp_next */
1663 #endif
1665 pyswigobject_type = tmp;
1666 pyswigobject_type.ob_type = &PyType_Type;
1667 type_init = 1;
1669 return &pyswigobject_type;
1672 SWIGRUNTIME PyObject *
1673 PySwigObject_New(void *ptr, swig_type_info *ty, int own)
1675 PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
1676 if (sobj) {
1677 sobj->ptr = ptr;
1678 sobj->ty = ty;
1679 sobj->own = own;
1680 sobj->next = 0;
1682 return (PyObject *)sobj;
1685 /* -----------------------------------------------------------------------------
1686 * Implements a simple Swig Packed type, and use it instead of string
1687 * ----------------------------------------------------------------------------- */
1689 typedef struct {
1690 PyObject_HEAD
1691 void *pack;
1692 swig_type_info *ty;
1693 size_t size;
1694 } PySwigPacked;
1696 SWIGRUNTIME int
1697 PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
1699 char result[SWIG_BUFFER_SIZE];
1700 fputs("<Swig Packed ", fp);
1701 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1702 fputs("at ", fp);
1703 fputs(result, fp);
1705 fputs(v->ty->name,fp);
1706 fputs(">", fp);
1707 return 0;
1710 SWIGRUNTIME PyObject *
1711 PySwigPacked_repr(PySwigPacked *v)
1713 char result[SWIG_BUFFER_SIZE];
1714 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1715 return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1716 } else {
1717 return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
1721 SWIGRUNTIME PyObject *
1722 PySwigPacked_str(PySwigPacked *v)
1724 char result[SWIG_BUFFER_SIZE];
1725 if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1726 return PyString_FromFormat("%s%s", result, v->ty->name);
1727 } else {
1728 return PyString_FromString(v->ty->name);
1732 SWIGRUNTIME int
1733 PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
1735 size_t i = v->size;
1736 size_t j = w->size;
1737 int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1738 return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
1741 SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
1743 SWIGRUNTIME PyTypeObject*
1744 PySwigPacked_type(void) {
1745 static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
1746 return type;
1749 SWIGRUNTIMEINLINE int
1750 PySwigPacked_Check(PyObject *op) {
1751 return ((op)->ob_type == _PySwigPacked_type())
1752 || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
1755 SWIGRUNTIME void
1756 PySwigPacked_dealloc(PyObject *v)
1758 if (PySwigPacked_Check(v)) {
1759 PySwigPacked *sobj = (PySwigPacked *) v;
1760 free(sobj->pack);
1762 PyObject_DEL(v);
1765 SWIGRUNTIME PyTypeObject*
1766 _PySwigPacked_type(void) {
1767 static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1768 static PyTypeObject pyswigpacked_type;
1769 static int type_init = 0;
1770 if (!type_init) {
1771 const PyTypeObject tmp
1773 PyObject_HEAD_INIT(NULL)
1774 0, /* ob_size */
1775 (char *)"PySwigPacked", /* tp_name */
1776 sizeof(PySwigPacked), /* tp_basicsize */
1777 0, /* tp_itemsize */
1778 (destructor)PySwigPacked_dealloc, /* tp_dealloc */
1779 (printfunc)PySwigPacked_print, /* tp_print */
1780 (getattrfunc)0, /* tp_getattr */
1781 (setattrfunc)0, /* tp_setattr */
1782 (cmpfunc)PySwigPacked_compare, /* tp_compare */
1783 (reprfunc)PySwigPacked_repr, /* tp_repr */
1784 0, /* tp_as_number */
1785 0, /* tp_as_sequence */
1786 0, /* tp_as_mapping */
1787 (hashfunc)0, /* tp_hash */
1788 (ternaryfunc)0, /* tp_call */
1789 (reprfunc)PySwigPacked_str, /* tp_str */
1790 PyObject_GenericGetAttr, /* tp_getattro */
1791 0, /* tp_setattro */
1792 0, /* tp_as_buffer */
1793 Py_TPFLAGS_DEFAULT, /* tp_flags */
1794 swigpacked_doc, /* tp_doc */
1795 0, /* tp_traverse */
1796 0, /* tp_clear */
1797 0, /* tp_richcompare */
1798 0, /* tp_weaklistoffset */
1799 #if PY_VERSION_HEX >= 0x02020000
1800 0, /* tp_iter */
1801 0, /* tp_iternext */
1802 0, /* tp_methods */
1803 0, /* tp_members */
1804 0, /* tp_getset */
1805 0, /* tp_base */
1806 0, /* tp_dict */
1807 0, /* tp_descr_get */
1808 0, /* tp_descr_set */
1809 0, /* tp_dictoffset */
1810 0, /* tp_init */
1811 0, /* tp_alloc */
1812 0, /* tp_new */
1813 0, /* tp_free */
1814 0, /* tp_is_gc */
1815 0, /* tp_bases */
1816 0, /* tp_mro */
1817 0, /* tp_cache */
1818 0, /* tp_subclasses */
1819 0, /* tp_weaklist */
1820 #endif
1821 #if PY_VERSION_HEX >= 0x02030000
1822 0, /* tp_del */
1823 #endif
1824 #ifdef COUNT_ALLOCS
1825 0,0,0,0 /* tp_alloc -> tp_next */
1826 #endif
1828 pyswigpacked_type = tmp;
1829 pyswigpacked_type.ob_type = &PyType_Type;
1830 type_init = 1;
1832 return &pyswigpacked_type;
1835 SWIGRUNTIME PyObject *
1836 PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
1838 PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
1839 if (sobj) {
1840 void *pack = malloc(size);
1841 if (pack) {
1842 memcpy(pack, ptr, size);
1843 sobj->pack = pack;
1844 sobj->ty = ty;
1845 sobj->size = size;
1846 } else {
1847 PyObject_DEL((PyObject *) sobj);
1848 sobj = 0;
1851 return (PyObject *) sobj;
1854 SWIGRUNTIME swig_type_info *
1855 PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1857 if (PySwigPacked_Check(obj)) {
1858 PySwigPacked *sobj = (PySwigPacked *)obj;
1859 if (sobj->size != size) return 0;
1860 memcpy(ptr, sobj->pack, size);
1861 return sobj->ty;
1862 } else {
1863 return 0;
1867 /* -----------------------------------------------------------------------------
1868 * pointers/data manipulation
1869 * ----------------------------------------------------------------------------- */
1871 SWIGRUNTIMEINLINE PyObject *
1872 _SWIG_This(void)
1874 return PyString_FromString("this");
1877 SWIGRUNTIME PyObject *
1878 SWIG_This(void)
1880 static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
1881 return swig_this;
1884 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1886 SWIGRUNTIME PySwigObject *
1887 SWIG_Python_GetSwigThis(PyObject *pyobj)
1889 if (PySwigObject_Check(pyobj)) {
1890 return (PySwigObject *) pyobj;
1891 } else {
1892 PyObject *obj = 0;
1893 #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
1894 if (PyInstance_Check(pyobj)) {
1895 obj = _PyInstance_Lookup(pyobj, SWIG_This());
1896 } else {
1897 PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
1898 if (dictptr != NULL) {
1899 PyObject *dict = *dictptr;
1900 obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
1901 } else {
1902 #ifdef PyWeakref_CheckProxy
1903 if (PyWeakref_CheckProxy(pyobj)) {
1904 PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
1905 return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
1907 #endif
1908 obj = PyObject_GetAttr(pyobj,SWIG_This());
1909 if (obj) {
1910 Py_DECREF(obj);
1911 } else {
1912 if (PyErr_Occurred()) PyErr_Clear();
1913 return 0;
1917 #else
1918 obj = PyObject_GetAttr(pyobj,SWIG_This());
1919 if (obj) {
1920 Py_DECREF(obj);
1921 } else {
1922 if (PyErr_Occurred()) PyErr_Clear();
1923 return 0;
1925 #endif
1926 if (obj && !PySwigObject_Check(obj)) {
1927 /* a PyObject is called 'this', try to get the 'real this'
1928 PySwigObject from it */
1929 return SWIG_Python_GetSwigThis(obj);
1931 return (PySwigObject *)obj;
1935 /* Acquire a pointer value */
1937 SWIGRUNTIME int
1938 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
1939 if (own) {
1940 PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
1941 if (sobj) {
1942 int oldown = sobj->own;
1943 sobj->own = own;
1944 return oldown;
1947 return 0;
1950 /* Convert a pointer value */
1952 SWIGRUNTIME int
1953 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
1954 if (!obj) return SWIG_ERROR;
1955 if (obj == Py_None) {
1956 if (ptr) *ptr = 0;
1957 return SWIG_OK;
1958 } else {
1959 PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
1960 while (sobj) {
1961 void *vptr = sobj->ptr;
1962 if (ty) {
1963 swig_type_info *to = sobj->ty;
1964 if (to == ty) {
1965 /* no type cast needed */
1966 if (ptr) *ptr = vptr;
1967 break;
1968 } else {
1969 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
1970 if (!tc) {
1971 sobj = (PySwigObject *)sobj->next;
1972 } else {
1973 if (ptr) *ptr = SWIG_TypeCast(tc,vptr);
1974 break;
1977 } else {
1978 if (ptr) *ptr = vptr;
1979 break;
1982 if (sobj) {
1983 if (own) *own = sobj->own;
1984 if (flags & SWIG_POINTER_DISOWN) {
1985 sobj->own = 0;
1987 return SWIG_OK;
1988 } else {
1989 int res = SWIG_ERROR;
1990 if (flags & SWIG_POINTER_IMPLICIT_CONV) {
1991 PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
1992 if (data && !data->implicitconv) {
1993 PyObject *klass = data->klass;
1994 if (klass) {
1995 PyObject *impconv;
1996 data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
1997 impconv = SWIG_Python_CallFunctor(klass, obj);
1998 data->implicitconv = 0;
1999 if (PyErr_Occurred()) {
2000 PyErr_Clear();
2001 impconv = 0;
2003 if (impconv) {
2004 PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
2005 if (iobj) {
2006 void *vptr;
2007 res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2008 if (SWIG_IsOK(res)) {
2009 if (ptr) {
2010 *ptr = vptr;
2011 /* transfer the ownership to 'ptr' */
2012 iobj->own = 0;
2013 res = SWIG_AddCast(res);
2014 res = SWIG_AddNewMask(res);
2015 } else {
2016 res = SWIG_AddCast(res);
2020 Py_DECREF(impconv);
2025 return res;
2030 /* Convert a function ptr value */
2032 SWIGRUNTIME int
2033 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2034 if (!PyCFunction_Check(obj)) {
2035 return SWIG_ConvertPtr(obj, ptr, ty, 0);
2036 } else {
2037 void *vptr = 0;
2039 /* here we get the method pointer for callbacks */
2040 const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2041 const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2042 if (desc) {
2043 desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2044 if (!desc) return SWIG_ERROR;
2046 if (ty) {
2047 swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
2048 if (!tc) return SWIG_ERROR;
2049 *ptr = SWIG_TypeCast(tc,vptr);
2050 } else {
2051 *ptr = vptr;
2053 return SWIG_OK;
2057 /* Convert a packed value value */
2059 SWIGRUNTIME int
2060 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2061 swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
2062 if (!to) return SWIG_ERROR;
2063 if (ty) {
2064 if (to != ty) {
2065 /* check type cast? */
2066 swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2067 if (!tc) return SWIG_ERROR;
2070 return SWIG_OK;
2073 /* -----------------------------------------------------------------------------
2074 * Create a new pointer object
2075 * ----------------------------------------------------------------------------- */
2078 Create a new instance object, whitout calling __init__, and set the
2079 'this' attribute.
2082 SWIGRUNTIME PyObject*
2083 SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
2085 #if (PY_VERSION_HEX >= 0x02020000)
2086 PyObject *inst = 0;
2087 PyObject *newraw = data->newraw;
2088 if (newraw) {
2089 inst = PyObject_Call(newraw, data->newargs, NULL);
2090 if (inst) {
2091 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2092 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2093 if (dictptr != NULL) {
2094 PyObject *dict = *dictptr;
2095 if (dict == NULL) {
2096 dict = PyDict_New();
2097 *dictptr = dict;
2098 PyDict_SetItem(dict, SWIG_This(), swig_this);
2101 #else
2102 PyObject *key = SWIG_This();
2103 PyObject_SetAttr(inst, key, swig_this);
2104 #endif
2106 } else {
2107 PyObject *dict = PyDict_New();
2108 PyDict_SetItem(dict, SWIG_This(), swig_this);
2109 inst = PyInstance_NewRaw(data->newargs, dict);
2110 Py_DECREF(dict);
2112 return inst;
2113 #else
2114 #if (PY_VERSION_HEX >= 0x02010000)
2115 PyObject *inst;
2116 PyObject *dict = PyDict_New();
2117 PyDict_SetItem(dict, SWIG_This(), swig_this);
2118 inst = PyInstance_NewRaw(data->newargs, dict);
2119 Py_DECREF(dict);
2120 return (PyObject *) inst;
2121 #else
2122 PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
2123 if (inst == NULL) {
2124 return NULL;
2126 inst->in_class = (PyClassObject *)data->newargs;
2127 Py_INCREF(inst->in_class);
2128 inst->in_dict = PyDict_New();
2129 if (inst->in_dict == NULL) {
2130 Py_DECREF(inst);
2131 return NULL;
2133 #ifdef Py_TPFLAGS_HAVE_WEAKREFS
2134 inst->in_weakreflist = NULL;
2135 #endif
2136 #ifdef Py_TPFLAGS_GC
2137 PyObject_GC_Init(inst);
2138 #endif
2139 PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
2140 return (PyObject *) inst;
2141 #endif
2142 #endif
2145 SWIGRUNTIME void
2146 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2148 PyObject *dict;
2149 #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2150 PyObject **dictptr = _PyObject_GetDictPtr(inst);
2151 if (dictptr != NULL) {
2152 dict = *dictptr;
2153 if (dict == NULL) {
2154 dict = PyDict_New();
2155 *dictptr = dict;
2157 PyDict_SetItem(dict, SWIG_This(), swig_this);
2158 return;
2160 #endif
2161 dict = PyObject_GetAttrString(inst, (char*)"__dict__");
2162 PyDict_SetItem(dict, SWIG_This(), swig_this);
2163 Py_DECREF(dict);
2167 SWIGINTERN PyObject *
2168 SWIG_Python_InitShadowInstance(PyObject *args) {
2169 PyObject *obj[2];
2170 if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
2171 return NULL;
2172 } else {
2173 PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2174 if (sthis) {
2175 PySwigObject_append((PyObject*) sthis, obj[1]);
2176 } else {
2177 SWIG_Python_SetSwigThis(obj[0], obj[1]);
2179 return SWIG_Py_Void();
2183 /* Create a new pointer object */
2185 SWIGRUNTIME PyObject *
2186 SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
2187 if (!ptr) {
2188 return SWIG_Py_Void();
2189 } else {
2190 int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2191 PyObject *robj = PySwigObject_New(ptr, type, own);
2192 PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
2193 if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2194 PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2195 if (inst) {
2196 Py_DECREF(robj);
2197 robj = inst;
2200 return robj;
2204 /* Create a new packed object */
2206 SWIGRUNTIMEINLINE PyObject *
2207 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2208 return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2211 /* -----------------------------------------------------------------------------*
2212 * Get type list
2213 * -----------------------------------------------------------------------------*/
2215 #ifdef SWIG_LINK_RUNTIME
2216 void *SWIG_ReturnGlobalTypeList(void *);
2217 #endif
2219 SWIGRUNTIME swig_module_info *
2220 SWIG_Python_GetModule(void) {
2221 static void *type_pointer = (void *)0;
2222 /* first check if module already created */
2223 if (!type_pointer) {
2224 #ifdef SWIG_LINK_RUNTIME
2225 type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2226 #else
2227 type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2228 (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
2229 if (PyErr_Occurred()) {
2230 PyErr_Clear();
2231 type_pointer = (void *)0;
2233 #endif
2235 return (swig_module_info *) type_pointer;
2238 #if PY_MAJOR_VERSION < 2
2239 /* PyModule_AddObject function was introduced in Python 2.0. The following function
2240 is copied out of Python/modsupport.c in python version 2.3.4 */
2241 SWIGINTERN int
2242 PyModule_AddObject(PyObject *m, char *name, PyObject *o)
2244 PyObject *dict;
2245 if (!PyModule_Check(m)) {
2246 PyErr_SetString(PyExc_TypeError,
2247 "PyModule_AddObject() needs module as first arg");
2248 return SWIG_ERROR;
2250 if (!o) {
2251 PyErr_SetString(PyExc_TypeError,
2252 "PyModule_AddObject() needs non-NULL value");
2253 return SWIG_ERROR;
2256 dict = PyModule_GetDict(m);
2257 if (dict == NULL) {
2258 /* Internal error -- modules must have a dict! */
2259 PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
2260 PyModule_GetName(m));
2261 return SWIG_ERROR;
2263 if (PyDict_SetItemString(dict, name, o))
2264 return SWIG_ERROR;
2265 Py_DECREF(o);
2266 return SWIG_OK;
2268 #endif
2270 SWIGRUNTIME void
2271 SWIG_Python_DestroyModule(void *vptr)
2273 swig_module_info *swig_module = (swig_module_info *) vptr;
2274 swig_type_info **types = swig_module->types;
2275 size_t i;
2276 for (i =0; i < swig_module->size; ++i) {
2277 swig_type_info *ty = types[i];
2278 if (ty->owndata) {
2279 PySwigClientData *data = (PySwigClientData *) ty->clientdata;
2280 if (data) PySwigClientData_Del(data);
2283 Py_DECREF(SWIG_This());
2286 SWIGRUNTIME void
2287 SWIG_Python_SetModule(swig_module_info *swig_module) {
2288 static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
2290 PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
2291 swig_empty_runtime_method_table);
2292 PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
2293 if (pointer && module) {
2294 PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
2295 } else {
2296 Py_XDECREF(pointer);
2300 /* The python cached type query */
2301 SWIGRUNTIME PyObject *
2302 SWIG_Python_TypeCache(void) {
2303 static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2304 return cache;
2307 SWIGRUNTIME swig_type_info *
2308 SWIG_Python_TypeQuery(const char *type)
2310 PyObject *cache = SWIG_Python_TypeCache();
2311 PyObject *key = PyString_FromString(type);
2312 PyObject *obj = PyDict_GetItem(cache, key);
2313 swig_type_info *descriptor;
2314 if (obj) {
2315 descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
2316 } else {
2317 swig_module_info *swig_module = SWIG_Python_GetModule();
2318 descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2319 if (descriptor) {
2320 obj = PyCObject_FromVoidPtr(descriptor, NULL);
2321 PyDict_SetItem(cache, key, obj);
2322 Py_DECREF(obj);
2325 Py_DECREF(key);
2326 return descriptor;
2330 For backward compatibility only
2332 #define SWIG_POINTER_EXCEPTION 0
2333 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg)
2334 #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags)
2336 SWIGRUNTIME int
2337 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2339 if (PyErr_Occurred()) {
2340 PyObject *type = 0;
2341 PyObject *value = 0;
2342 PyObject *traceback = 0;
2343 PyErr_Fetch(&type, &value, &traceback);
2344 if (value) {
2345 PyObject *old_str = PyObject_Str(value);
2346 Py_XINCREF(type);
2347 PyErr_Clear();
2348 if (infront) {
2349 PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
2350 } else {
2351 PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
2353 Py_DECREF(old_str);
2355 return 1;
2356 } else {
2357 return 0;
2361 SWIGRUNTIME int
2362 SWIG_Python_ArgFail(int argnum)
2364 if (PyErr_Occurred()) {
2365 /* add information about failing argument */
2366 char mesg[256];
2367 PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2368 return SWIG_Python_AddErrMesg(mesg, 1);
2369 } else {
2370 return 0;
2374 SWIGRUNTIMEINLINE const char *
2375 PySwigObject_GetDesc(PyObject *self)
2377 PySwigObject *v = (PySwigObject *)self;
2378 swig_type_info *ty = v ? v->ty : 0;
2379 return ty ? ty->str : (char*)"";
2382 SWIGRUNTIME void
2383 SWIG_Python_TypeError(const char *type, PyObject *obj)
2385 if (type) {
2386 #if defined(SWIG_COBJECT_TYPES)
2387 if (obj && PySwigObject_Check(obj)) {
2388 const char *otype = (const char *) PySwigObject_GetDesc(obj);
2389 if (otype) {
2390 PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
2391 type, otype);
2392 return;
2394 } else
2395 #endif
2397 const char *otype = (obj ? obj->ob_type->tp_name : 0);
2398 if (otype) {
2399 PyObject *str = PyObject_Str(obj);
2400 const char *cstr = str ? PyString_AsString(str) : 0;
2401 if (cstr) {
2402 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2403 type, otype, cstr);
2404 } else {
2405 PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2406 type, otype);
2408 Py_XDECREF(str);
2409 return;
2412 PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2413 } else {
2414 PyErr_Format(PyExc_TypeError, "unexpected type is received");
2419 /* Convert a pointer value, signal an exception on a type mismatch */
2420 SWIGRUNTIME void *
2421 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
2422 void *result;
2423 if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2424 PyErr_Clear();
2425 if (flags & SWIG_POINTER_EXCEPTION) {
2426 SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2427 SWIG_Python_ArgFail(argnum);
2430 return result;
2434 #ifdef __cplusplus
2435 #if 0
2436 { /* cc-mode */
2437 #endif
2439 #endif
2443 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
2445 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
2449 /* -------- TYPES TABLE (BEGIN) -------- */
2451 #define SWIGTYPE_p_char swig_types[0]
2452 #define SWIGTYPE_p_netpgp_t swig_types[1]
2453 #define SWIGTYPE_p_p_char swig_types[2]
2454 #define SWIGTYPE_p_void swig_types[3]
2455 static swig_type_info *swig_types[5];
2456 static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
2457 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2458 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2460 /* -------- TYPES TABLE (END) -------- */
2462 #if (PY_VERSION_HEX <= 0x02000000)
2463 # if !defined(SWIG_PYTHON_CLASSIC)
2464 # error "This python version requires swig to be run with the '-classic' option"
2465 # endif
2466 #endif
2468 /*-----------------------------------------------
2469 @(target):= _netpgppython.so
2470 ------------------------------------------------*/
2471 #define SWIG_init init_netpgppython
2473 #define SWIG_name "_netpgppython"
2475 #define SWIGVERSION 0x010331
2476 #define SWIG_VERSION SWIGVERSION
2479 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
2480 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
2483 #include <netpgp.h>
2488 #include <limits.h>
2489 #ifndef LLONG_MIN
2490 # define LLONG_MIN LONG_LONG_MIN
2491 #endif
2492 #ifndef LLONG_MAX
2493 # define LLONG_MAX LONG_LONG_MAX
2494 #endif
2495 #ifndef ULLONG_MAX
2496 # define ULLONG_MAX ULONG_LONG_MAX
2497 #endif
2500 SWIGINTERN int
2501 SWIG_AsVal_double (PyObject *obj, double *val)
2503 int res = SWIG_TypeError;
2504 if (PyFloat_Check(obj)) {
2505 if (val) *val = PyFloat_AsDouble(obj);
2506 return SWIG_OK;
2507 } else if (PyInt_Check(obj)) {
2508 if (val) *val = PyInt_AsLong(obj);
2509 return SWIG_OK;
2510 } else if (PyLong_Check(obj)) {
2511 double v = PyLong_AsDouble(obj);
2512 if (!PyErr_Occurred()) {
2513 if (val) *val = v;
2514 return SWIG_OK;
2515 } else {
2516 PyErr_Clear();
2519 #ifdef SWIG_PYTHON_CAST_MODE
2521 int dispatch = 0;
2522 double d = PyFloat_AsDouble(obj);
2523 if (!PyErr_Occurred()) {
2524 if (val) *val = d;
2525 return SWIG_AddCast(SWIG_OK);
2526 } else {
2527 PyErr_Clear();
2529 if (!dispatch) {
2530 long v = PyLong_AsLong(obj);
2531 if (!PyErr_Occurred()) {
2532 if (val) *val = v;
2533 return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
2534 } else {
2535 PyErr_Clear();
2539 #endif
2540 return res;
2544 #include <float.h>
2547 #include <math.h>
2550 SWIGINTERNINLINE int
2551 SWIG_CanCastAsInteger(double *d, double min, double max) {
2552 double x = *d;
2553 if ((min <= x && x <= max)) {
2554 double fx = floor(x);
2555 double cx = ceil(x);
2556 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
2557 if ((errno == EDOM) || (errno == ERANGE)) {
2558 errno = 0;
2559 } else {
2560 double summ, reps, diff;
2561 if (rd < x) {
2562 diff = x - rd;
2563 } else if (rd > x) {
2564 diff = rd - x;
2565 } else {
2566 return 1;
2568 summ = rd + x;
2569 reps = diff/summ;
2570 if (reps < 8*DBL_EPSILON) {
2571 *d = rd;
2572 return 1;
2576 return 0;
2580 SWIGINTERN int
2581 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
2583 if (PyInt_Check(obj)) {
2584 long v = PyInt_AsLong(obj);
2585 if (v >= 0) {
2586 if (val) *val = v;
2587 return SWIG_OK;
2588 } else {
2589 return SWIG_OverflowError;
2591 } else if (PyLong_Check(obj)) {
2592 unsigned long v = PyLong_AsUnsignedLong(obj);
2593 if (!PyErr_Occurred()) {
2594 if (val) *val = v;
2595 return SWIG_OK;
2596 } else {
2597 PyErr_Clear();
2600 #ifdef SWIG_PYTHON_CAST_MODE
2602 int dispatch = 0;
2603 unsigned long v = PyLong_AsUnsignedLong(obj);
2604 if (!PyErr_Occurred()) {
2605 if (val) *val = v;
2606 return SWIG_AddCast(SWIG_OK);
2607 } else {
2608 PyErr_Clear();
2610 if (!dispatch) {
2611 double d;
2612 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
2613 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
2614 if (val) *val = (unsigned long)(d);
2615 return res;
2619 #endif
2620 return SWIG_TypeError;
2624 SWIGINTERN int
2625 SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
2627 unsigned long v;
2628 int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
2629 if (SWIG_IsOK(res)) {
2630 if ((v > UINT_MAX)) {
2631 return SWIG_OverflowError;
2632 } else {
2633 if (val) *val = (unsigned int)(v);
2636 return res;
2640 #define SWIG_From_long PyInt_FromLong
2643 SWIGINTERNINLINE PyObject*
2644 SWIG_From_unsigned_SS_long (unsigned long value)
2646 return (value > LONG_MAX) ?
2647 PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value));
2651 SWIGINTERNINLINE PyObject *
2652 SWIG_From_unsigned_SS_int (unsigned int value)
2654 return SWIG_From_unsigned_SS_long (value);
2658 SWIGINTERNINLINE PyObject *
2659 SWIG_From_int (int value)
2661 return SWIG_From_long (value);
2665 SWIGINTERN swig_type_info*
2666 SWIG_pchar_descriptor(void)
2668 static int init = 0;
2669 static swig_type_info* info = 0;
2670 if (!init) {
2671 info = SWIG_TypeQuery("_p_char");
2672 init = 1;
2674 return info;
2678 SWIGINTERN int
2679 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
2681 if (PyString_Check(obj)) {
2682 char *cstr; Py_ssize_t len;
2683 PyString_AsStringAndSize(obj, &cstr, &len);
2684 if (cptr) {
2685 if (alloc) {
2687 In python the user should not be able to modify the inner
2688 string representation. To warranty that, if you define
2689 SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
2690 buffer is always returned.
2692 The default behavior is just to return the pointer value,
2693 so, be careful.
2695 #if defined(SWIG_PYTHON_SAFE_CSTRINGS)
2696 if (*alloc != SWIG_OLDOBJ)
2697 #else
2698 if (*alloc == SWIG_NEWOBJ)
2699 #endif
2701 *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
2702 *alloc = SWIG_NEWOBJ;
2704 else {
2705 *cptr = cstr;
2706 *alloc = SWIG_OLDOBJ;
2708 } else {
2709 *cptr = PyString_AsString(obj);
2712 if (psize) *psize = len + 1;
2713 return SWIG_OK;
2714 } else {
2715 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2716 if (pchar_descriptor) {
2717 void* vptr = 0;
2718 if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
2719 if (cptr) *cptr = (char *) vptr;
2720 if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
2721 if (alloc) *alloc = SWIG_OLDOBJ;
2722 return SWIG_OK;
2726 return SWIG_TypeError;
2733 SWIGINTERNINLINE PyObject *
2734 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
2736 if (carray) {
2737 if (size > INT_MAX) {
2738 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
2739 return pchar_descriptor ?
2740 SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
2741 } else {
2742 return PyString_FromStringAndSize(carray, (int)(size));
2744 } else {
2745 return SWIG_Py_Void();
2750 SWIGINTERNINLINE PyObject *
2751 SWIG_FromCharPtr(const char *cptr)
2753 return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
2757 SWIGINTERN int
2758 SWIG_AsVal_long (PyObject *obj, long* val)
2760 if (PyInt_Check(obj)) {
2761 if (val) *val = PyInt_AsLong(obj);
2762 return SWIG_OK;
2763 } else if (PyLong_Check(obj)) {
2764 long v = PyLong_AsLong(obj);
2765 if (!PyErr_Occurred()) {
2766 if (val) *val = v;
2767 return SWIG_OK;
2768 } else {
2769 PyErr_Clear();
2772 #ifdef SWIG_PYTHON_CAST_MODE
2774 int dispatch = 0;
2775 long v = PyInt_AsLong(obj);
2776 if (!PyErr_Occurred()) {
2777 if (val) *val = v;
2778 return SWIG_AddCast(SWIG_OK);
2779 } else {
2780 PyErr_Clear();
2782 if (!dispatch) {
2783 double d;
2784 int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
2785 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
2786 if (val) *val = (long)(d);
2787 return res;
2791 #endif
2792 return SWIG_TypeError;
2796 SWIGINTERN int
2797 SWIG_AsVal_int (PyObject * obj, int *val)
2799 long v;
2800 int res = SWIG_AsVal_long (obj, &v);
2801 if (SWIG_IsOK(res)) {
2802 if ((v < INT_MIN || v > INT_MAX)) {
2803 return SWIG_OverflowError;
2804 } else {
2805 if (val) *val = (int)(v);
2808 return res;
2812 SWIGINTERNINLINE int
2813 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
2815 unsigned long v;
2816 int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
2817 if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2818 return res;
2821 #ifdef __cplusplus
2822 extern "C" {
2823 #endif
2824 SWIGINTERN PyObject *_wrap_netpgp_t_c_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2825 PyObject *resultobj = 0;
2826 netpgp_t *arg1 = (netpgp_t *) 0 ;
2827 unsigned int arg2 ;
2828 void *argp1 = 0 ;
2829 int res1 = 0 ;
2830 unsigned int val2 ;
2831 int ecode2 = 0 ;
2832 PyObject * obj0 = 0 ;
2833 PyObject * obj1 = 0 ;
2835 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_c_set",&obj0,&obj1)) SWIG_fail;
2836 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2837 if (!SWIG_IsOK(res1)) {
2838 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_c_set" "', argument " "1"" of type '" "netpgp_t *""'");
2840 arg1 = (netpgp_t *)(argp1);
2841 ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
2842 if (!SWIG_IsOK(ecode2)) {
2843 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "netpgp_t_c_set" "', argument " "2"" of type '" "unsigned int""'");
2845 arg2 = (unsigned int)(val2);
2846 if (arg1) (arg1)->c = arg2;
2848 resultobj = SWIG_Py_Void();
2849 return resultobj;
2850 fail:
2851 return NULL;
2855 SWIGINTERN PyObject *_wrap_netpgp_t_c_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2856 PyObject *resultobj = 0;
2857 netpgp_t *arg1 = (netpgp_t *) 0 ;
2858 unsigned int result;
2859 void *argp1 = 0 ;
2860 int res1 = 0 ;
2861 PyObject * obj0 = 0 ;
2863 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_c_get",&obj0)) SWIG_fail;
2864 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2865 if (!SWIG_IsOK(res1)) {
2866 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_c_get" "', argument " "1"" of type '" "netpgp_t *""'");
2868 arg1 = (netpgp_t *)(argp1);
2869 result = (unsigned int) ((arg1)->c);
2870 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result));
2871 return resultobj;
2872 fail:
2873 return NULL;
2877 SWIGINTERN PyObject *_wrap_netpgp_t_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2878 PyObject *resultobj = 0;
2879 netpgp_t *arg1 = (netpgp_t *) 0 ;
2880 unsigned int arg2 ;
2881 void *argp1 = 0 ;
2882 int res1 = 0 ;
2883 unsigned int val2 ;
2884 int ecode2 = 0 ;
2885 PyObject * obj0 = 0 ;
2886 PyObject * obj1 = 0 ;
2888 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_size_set",&obj0,&obj1)) SWIG_fail;
2889 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2890 if (!SWIG_IsOK(res1)) {
2891 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_size_set" "', argument " "1"" of type '" "netpgp_t *""'");
2893 arg1 = (netpgp_t *)(argp1);
2894 ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2);
2895 if (!SWIG_IsOK(ecode2)) {
2896 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "netpgp_t_size_set" "', argument " "2"" of type '" "unsigned int""'");
2898 arg2 = (unsigned int)(val2);
2899 if (arg1) (arg1)->size = arg2;
2901 resultobj = SWIG_Py_Void();
2902 return resultobj;
2903 fail:
2904 return NULL;
2908 SWIGINTERN PyObject *_wrap_netpgp_t_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2909 PyObject *resultobj = 0;
2910 netpgp_t *arg1 = (netpgp_t *) 0 ;
2911 unsigned int result;
2912 void *argp1 = 0 ;
2913 int res1 = 0 ;
2914 PyObject * obj0 = 0 ;
2916 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_size_get",&obj0)) SWIG_fail;
2917 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2918 if (!SWIG_IsOK(res1)) {
2919 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_size_get" "', argument " "1"" of type '" "netpgp_t *""'");
2921 arg1 = (netpgp_t *)(argp1);
2922 result = (unsigned int) ((arg1)->size);
2923 resultobj = SWIG_From_unsigned_SS_int((unsigned int)(result));
2924 return resultobj;
2925 fail:
2926 return NULL;
2930 SWIGINTERN PyObject *_wrap_netpgp_t_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2931 PyObject *resultobj = 0;
2932 netpgp_t *arg1 = (netpgp_t *) 0 ;
2933 char **arg2 = (char **) 0 ;
2934 void *argp1 = 0 ;
2935 int res1 = 0 ;
2936 void *argp2 = 0 ;
2937 int res2 = 0 ;
2938 PyObject * obj0 = 0 ;
2939 PyObject * obj1 = 0 ;
2941 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_name_set",&obj0,&obj1)) SWIG_fail;
2942 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2943 if (!SWIG_IsOK(res1)) {
2944 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_name_set" "', argument " "1"" of type '" "netpgp_t *""'");
2946 arg1 = (netpgp_t *)(argp1);
2947 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 | 0 );
2948 if (!SWIG_IsOK(res2)) {
2949 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_name_set" "', argument " "2"" of type '" "char **""'");
2951 arg2 = (char **)(argp2);
2952 if (arg1) (arg1)->name = arg2;
2954 resultobj = SWIG_Py_Void();
2955 return resultobj;
2956 fail:
2957 return NULL;
2961 SWIGINTERN PyObject *_wrap_netpgp_t_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2962 PyObject *resultobj = 0;
2963 netpgp_t *arg1 = (netpgp_t *) 0 ;
2964 char **result = 0 ;
2965 void *argp1 = 0 ;
2966 int res1 = 0 ;
2967 PyObject * obj0 = 0 ;
2969 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_name_get",&obj0)) SWIG_fail;
2970 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2971 if (!SWIG_IsOK(res1)) {
2972 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_name_get" "', argument " "1"" of type '" "netpgp_t *""'");
2974 arg1 = (netpgp_t *)(argp1);
2975 result = (char **) ((arg1)->name);
2976 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0 );
2977 return resultobj;
2978 fail:
2979 return NULL;
2983 SWIGINTERN PyObject *_wrap_netpgp_t_value_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
2984 PyObject *resultobj = 0;
2985 netpgp_t *arg1 = (netpgp_t *) 0 ;
2986 char **arg2 = (char **) 0 ;
2987 void *argp1 = 0 ;
2988 int res1 = 0 ;
2989 void *argp2 = 0 ;
2990 int res2 = 0 ;
2991 PyObject * obj0 = 0 ;
2992 PyObject * obj1 = 0 ;
2994 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_value_set",&obj0,&obj1)) SWIG_fail;
2995 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2996 if (!SWIG_IsOK(res1)) {
2997 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_value_set" "', argument " "1"" of type '" "netpgp_t *""'");
2999 arg1 = (netpgp_t *)(argp1);
3000 res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 | 0 );
3001 if (!SWIG_IsOK(res2)) {
3002 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_value_set" "', argument " "2"" of type '" "char **""'");
3004 arg2 = (char **)(argp2);
3005 if (arg1) (arg1)->value = arg2;
3007 resultobj = SWIG_Py_Void();
3008 return resultobj;
3009 fail:
3010 return NULL;
3014 SWIGINTERN PyObject *_wrap_netpgp_t_value_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3015 PyObject *resultobj = 0;
3016 netpgp_t *arg1 = (netpgp_t *) 0 ;
3017 char **result = 0 ;
3018 void *argp1 = 0 ;
3019 int res1 = 0 ;
3020 PyObject * obj0 = 0 ;
3022 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_value_get",&obj0)) SWIG_fail;
3023 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3024 if (!SWIG_IsOK(res1)) {
3025 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_value_get" "', argument " "1"" of type '" "netpgp_t *""'");
3027 arg1 = (netpgp_t *)(argp1);
3028 result = (char **) ((arg1)->value);
3029 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0 );
3030 return resultobj;
3031 fail:
3032 return NULL;
3036 SWIGINTERN PyObject *_wrap_netpgp_t_pubring_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3037 PyObject *resultobj = 0;
3038 netpgp_t *arg1 = (netpgp_t *) 0 ;
3039 void *arg2 = (void *) 0 ;
3040 void *argp1 = 0 ;
3041 int res1 = 0 ;
3042 int res2 ;
3043 PyObject * obj0 = 0 ;
3044 PyObject * obj1 = 0 ;
3046 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_pubring_set",&obj0,&obj1)) SWIG_fail;
3047 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3048 if (!SWIG_IsOK(res1)) {
3049 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_pubring_set" "', argument " "1"" of type '" "netpgp_t *""'");
3051 arg1 = (netpgp_t *)(argp1);
3052 res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
3053 if (!SWIG_IsOK(res2)) {
3054 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_pubring_set" "', argument " "2"" of type '" "void *""'");
3056 if (arg1) (arg1)->pubring = arg2;
3058 resultobj = SWIG_Py_Void();
3059 return resultobj;
3060 fail:
3061 return NULL;
3065 SWIGINTERN PyObject *_wrap_netpgp_t_pubring_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3066 PyObject *resultobj = 0;
3067 netpgp_t *arg1 = (netpgp_t *) 0 ;
3068 void *result = 0 ;
3069 void *argp1 = 0 ;
3070 int res1 = 0 ;
3071 PyObject * obj0 = 0 ;
3073 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_pubring_get",&obj0)) SWIG_fail;
3074 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3075 if (!SWIG_IsOK(res1)) {
3076 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_pubring_get" "', argument " "1"" of type '" "netpgp_t *""'");
3078 arg1 = (netpgp_t *)(argp1);
3079 result = (void *) ((arg1)->pubring);
3080 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
3081 return resultobj;
3082 fail:
3083 return NULL;
3087 SWIGINTERN PyObject *_wrap_netpgp_t_secring_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3088 PyObject *resultobj = 0;
3089 netpgp_t *arg1 = (netpgp_t *) 0 ;
3090 void *arg2 = (void *) 0 ;
3091 void *argp1 = 0 ;
3092 int res1 = 0 ;
3093 int res2 ;
3094 PyObject * obj0 = 0 ;
3095 PyObject * obj1 = 0 ;
3097 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_secring_set",&obj0,&obj1)) SWIG_fail;
3098 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3099 if (!SWIG_IsOK(res1)) {
3100 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_secring_set" "', argument " "1"" of type '" "netpgp_t *""'");
3102 arg1 = (netpgp_t *)(argp1);
3103 res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
3104 if (!SWIG_IsOK(res2)) {
3105 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_secring_set" "', argument " "2"" of type '" "void *""'");
3107 if (arg1) (arg1)->secring = arg2;
3109 resultobj = SWIG_Py_Void();
3110 return resultobj;
3111 fail:
3112 return NULL;
3116 SWIGINTERN PyObject *_wrap_netpgp_t_secring_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3117 PyObject *resultobj = 0;
3118 netpgp_t *arg1 = (netpgp_t *) 0 ;
3119 void *result = 0 ;
3120 void *argp1 = 0 ;
3121 int res1 = 0 ;
3122 PyObject * obj0 = 0 ;
3124 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_secring_get",&obj0)) SWIG_fail;
3125 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3126 if (!SWIG_IsOK(res1)) {
3127 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_secring_get" "', argument " "1"" of type '" "netpgp_t *""'");
3129 arg1 = (netpgp_t *)(argp1);
3130 result = (void *) ((arg1)->secring);
3131 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
3132 return resultobj;
3133 fail:
3134 return NULL;
3138 SWIGINTERN PyObject *_wrap_netpgp_t_io_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3139 PyObject *resultobj = 0;
3140 netpgp_t *arg1 = (netpgp_t *) 0 ;
3141 void *arg2 = (void *) 0 ;
3142 void *argp1 = 0 ;
3143 int res1 = 0 ;
3144 int res2 ;
3145 PyObject * obj0 = 0 ;
3146 PyObject * obj1 = 0 ;
3148 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_io_set",&obj0,&obj1)) SWIG_fail;
3149 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3150 if (!SWIG_IsOK(res1)) {
3151 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_io_set" "', argument " "1"" of type '" "netpgp_t *""'");
3153 arg1 = (netpgp_t *)(argp1);
3154 res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
3155 if (!SWIG_IsOK(res2)) {
3156 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_io_set" "', argument " "2"" of type '" "void *""'");
3158 if (arg1) (arg1)->io = arg2;
3160 resultobj = SWIG_Py_Void();
3161 return resultobj;
3162 fail:
3163 return NULL;
3167 SWIGINTERN PyObject *_wrap_netpgp_t_io_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3168 PyObject *resultobj = 0;
3169 netpgp_t *arg1 = (netpgp_t *) 0 ;
3170 void *result = 0 ;
3171 void *argp1 = 0 ;
3172 int res1 = 0 ;
3173 PyObject * obj0 = 0 ;
3175 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_io_get",&obj0)) SWIG_fail;
3176 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3177 if (!SWIG_IsOK(res1)) {
3178 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_io_get" "', argument " "1"" of type '" "netpgp_t *""'");
3180 arg1 = (netpgp_t *)(argp1);
3181 result = (void *) ((arg1)->io);
3182 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
3183 return resultobj;
3184 fail:
3185 return NULL;
3189 SWIGINTERN PyObject *_wrap_netpgp_t_passfp_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3190 PyObject *resultobj = 0;
3191 netpgp_t *arg1 = (netpgp_t *) 0 ;
3192 void *arg2 = (void *) 0 ;
3193 void *argp1 = 0 ;
3194 int res1 = 0 ;
3195 int res2 ;
3196 PyObject * obj0 = 0 ;
3197 PyObject * obj1 = 0 ;
3199 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_t_passfp_set",&obj0,&obj1)) SWIG_fail;
3200 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3201 if (!SWIG_IsOK(res1)) {
3202 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_passfp_set" "', argument " "1"" of type '" "netpgp_t *""'");
3204 arg1 = (netpgp_t *)(argp1);
3205 res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
3206 if (!SWIG_IsOK(res2)) {
3207 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_passfp_set" "', argument " "2"" of type '" "void *""'");
3209 if (arg1) (arg1)->passfp = arg2;
3211 resultobj = SWIG_Py_Void();
3212 return resultobj;
3213 fail:
3214 return NULL;
3218 SWIGINTERN PyObject *_wrap_netpgp_t_passfp_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3219 PyObject *resultobj = 0;
3220 netpgp_t *arg1 = (netpgp_t *) 0 ;
3221 void *result = 0 ;
3222 void *argp1 = 0 ;
3223 int res1 = 0 ;
3224 PyObject * obj0 = 0 ;
3226 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_t_passfp_get",&obj0)) SWIG_fail;
3227 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3228 if (!SWIG_IsOK(res1)) {
3229 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_passfp_get" "', argument " "1"" of type '" "netpgp_t *""'");
3231 arg1 = (netpgp_t *)(argp1);
3232 result = (void *) ((arg1)->passfp);
3233 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );
3234 return resultobj;
3235 fail:
3236 return NULL;
3240 SWIGINTERN PyObject *_wrap_new_netpgp_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3241 PyObject *resultobj = 0;
3242 netpgp_t *result = 0 ;
3244 if (!PyArg_ParseTuple(args,(char *)":new_netpgp_t")) SWIG_fail;
3245 result = (netpgp_t *)(netpgp_t *) calloc(1, sizeof(netpgp_t));
3246 resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_netpgp_t, SWIG_POINTER_NEW | 0 );
3247 return resultobj;
3248 fail:
3249 return NULL;
3253 SWIGINTERN PyObject *_wrap_delete_netpgp_t(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3254 PyObject *resultobj = 0;
3255 netpgp_t *arg1 = (netpgp_t *) 0 ;
3256 void *argp1 = 0 ;
3257 int res1 = 0 ;
3258 PyObject * obj0 = 0 ;
3260 if (!PyArg_ParseTuple(args,(char *)"O:delete_netpgp_t",&obj0)) SWIG_fail;
3261 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, SWIG_POINTER_DISOWN | 0 );
3262 if (!SWIG_IsOK(res1)) {
3263 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_netpgp_t" "', argument " "1"" of type '" "netpgp_t *""'");
3265 arg1 = (netpgp_t *)(argp1);
3266 free((char *) arg1);
3268 resultobj = SWIG_Py_Void();
3269 return resultobj;
3270 fail:
3271 return NULL;
3275 SWIGINTERN PyObject *netpgp_t_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3276 PyObject *obj;
3277 if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL;
3278 SWIG_TypeNewClientData(SWIGTYPE_p_netpgp_t, SWIG_NewClientData(obj));
3279 return SWIG_Py_Void();
3282 SWIGINTERN PyObject *_wrap_netpgp_init(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3283 PyObject *resultobj = 0;
3284 netpgp_t *arg1 = (netpgp_t *) 0 ;
3285 int result;
3286 void *argp1 = 0 ;
3287 int res1 = 0 ;
3288 PyObject * obj0 = 0 ;
3290 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_init",&obj0)) SWIG_fail;
3291 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3292 if (!SWIG_IsOK(res1)) {
3293 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_init" "', argument " "1"" of type '" "netpgp_t *""'");
3295 arg1 = (netpgp_t *)(argp1);
3296 result = (int)netpgp_init(arg1);
3297 resultobj = SWIG_From_int((int)(result));
3298 return resultobj;
3299 fail:
3300 return NULL;
3304 SWIGINTERN PyObject *_wrap_netpgp_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3305 PyObject *resultobj = 0;
3306 netpgp_t *arg1 = (netpgp_t *) 0 ;
3307 int result;
3308 void *argp1 = 0 ;
3309 int res1 = 0 ;
3310 PyObject * obj0 = 0 ;
3312 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_end",&obj0)) SWIG_fail;
3313 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3314 if (!SWIG_IsOK(res1)) {
3315 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_end" "', argument " "1"" of type '" "netpgp_t *""'");
3317 arg1 = (netpgp_t *)(argp1);
3318 result = (int)netpgp_end(arg1);
3319 resultobj = SWIG_From_int((int)(result));
3320 return resultobj;
3321 fail:
3322 return NULL;
3326 SWIGINTERN PyObject *_wrap_netpgp_set_debug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3327 PyObject *resultobj = 0;
3328 char *arg1 = (char *) 0 ;
3329 int result;
3330 int res1 ;
3331 char *buf1 = 0 ;
3332 int alloc1 = 0 ;
3333 PyObject * obj0 = 0 ;
3335 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_set_debug",&obj0)) SWIG_fail;
3336 res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
3337 if (!SWIG_IsOK(res1)) {
3338 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_set_debug" "', argument " "1"" of type '" "char const *""'");
3340 arg1 = (char *)(buf1);
3341 result = (int)netpgp_set_debug((char const *)arg1);
3342 resultobj = SWIG_From_int((int)(result));
3343 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3344 return resultobj;
3345 fail:
3346 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3347 return NULL;
3351 SWIGINTERN PyObject *_wrap_netpgp_get_debug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3352 PyObject *resultobj = 0;
3353 char *arg1 = (char *) 0 ;
3354 int result;
3355 int res1 ;
3356 char *buf1 = 0 ;
3357 int alloc1 = 0 ;
3358 PyObject * obj0 = 0 ;
3360 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_get_debug",&obj0)) SWIG_fail;
3361 res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
3362 if (!SWIG_IsOK(res1)) {
3363 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_get_debug" "', argument " "1"" of type '" "char const *""'");
3365 arg1 = (char *)(buf1);
3366 result = (int)netpgp_get_debug((char const *)arg1);
3367 resultobj = SWIG_From_int((int)(result));
3368 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3369 return resultobj;
3370 fail:
3371 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3372 return NULL;
3376 SWIGINTERN PyObject *_wrap_netpgp_get_info(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3377 PyObject *resultobj = 0;
3378 char *arg1 = (char *) 0 ;
3379 char *result = 0 ;
3380 int res1 ;
3381 char *buf1 = 0 ;
3382 int alloc1 = 0 ;
3383 PyObject * obj0 = 0 ;
3385 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_get_info",&obj0)) SWIG_fail;
3386 res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
3387 if (!SWIG_IsOK(res1)) {
3388 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_get_info" "', argument " "1"" of type '" "char const *""'");
3390 arg1 = (char *)(buf1);
3391 result = (char *)netpgp_get_info((char const *)arg1);
3392 resultobj = SWIG_FromCharPtr((const char *)result);
3393 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3394 return resultobj;
3395 fail:
3396 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
3397 return NULL;
3401 SWIGINTERN PyObject *_wrap_netpgp_list_packets(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3402 PyObject *resultobj = 0;
3403 netpgp_t *arg1 = (netpgp_t *) 0 ;
3404 char *arg2 = (char *) 0 ;
3405 int arg3 ;
3406 char *arg4 = (char *) 0 ;
3407 int result;
3408 void *argp1 = 0 ;
3409 int res1 = 0 ;
3410 int res2 ;
3411 char *buf2 = 0 ;
3412 int alloc2 = 0 ;
3413 int val3 ;
3414 int ecode3 = 0 ;
3415 int res4 ;
3416 char *buf4 = 0 ;
3417 int alloc4 = 0 ;
3418 PyObject * obj0 = 0 ;
3419 PyObject * obj1 = 0 ;
3420 PyObject * obj2 = 0 ;
3421 PyObject * obj3 = 0 ;
3423 if (!PyArg_ParseTuple(args,(char *)"OOOO:netpgp_list_packets",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
3424 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3425 if (!SWIG_IsOK(res1)) {
3426 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_packets" "', argument " "1"" of type '" "netpgp_t *""'");
3428 arg1 = (netpgp_t *)(argp1);
3429 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3430 if (!SWIG_IsOK(res2)) {
3431 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_list_packets" "', argument " "2"" of type '" "char *""'");
3433 arg2 = (char *)(buf2);
3434 ecode3 = SWIG_AsVal_int(obj2, &val3);
3435 if (!SWIG_IsOK(ecode3)) {
3436 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_list_packets" "', argument " "3"" of type '" "int""'");
3438 arg3 = (int)(val3);
3439 res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
3440 if (!SWIG_IsOK(res4)) {
3441 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "netpgp_list_packets" "', argument " "4"" of type '" "char *""'");
3443 arg4 = (char *)(buf4);
3444 result = (int)netpgp_list_packets(arg1,arg2,arg3,arg4);
3445 resultobj = SWIG_From_int((int)(result));
3446 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3447 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3448 return resultobj;
3449 fail:
3450 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3451 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3452 return NULL;
3456 SWIGINTERN PyObject *_wrap_netpgp_setvar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3457 PyObject *resultobj = 0;
3458 netpgp_t *arg1 = (netpgp_t *) 0 ;
3459 char *arg2 = (char *) 0 ;
3460 char *arg3 = (char *) 0 ;
3461 int result;
3462 void *argp1 = 0 ;
3463 int res1 = 0 ;
3464 int res2 ;
3465 char *buf2 = 0 ;
3466 int alloc2 = 0 ;
3467 int res3 ;
3468 char *buf3 = 0 ;
3469 int alloc3 = 0 ;
3470 PyObject * obj0 = 0 ;
3471 PyObject * obj1 = 0 ;
3472 PyObject * obj2 = 0 ;
3474 if (!PyArg_ParseTuple(args,(char *)"OOO:netpgp_setvar",&obj0,&obj1,&obj2)) SWIG_fail;
3475 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3476 if (!SWIG_IsOK(res1)) {
3477 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_setvar" "', argument " "1"" of type '" "netpgp_t *""'");
3479 arg1 = (netpgp_t *)(argp1);
3480 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3481 if (!SWIG_IsOK(res2)) {
3482 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_setvar" "', argument " "2"" of type '" "char const *""'");
3484 arg2 = (char *)(buf2);
3485 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
3486 if (!SWIG_IsOK(res3)) {
3487 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_setvar" "', argument " "3"" of type '" "char const *""'");
3489 arg3 = (char *)(buf3);
3490 result = (int)netpgp_setvar(arg1,(char const *)arg2,(char const *)arg3);
3491 resultobj = SWIG_From_int((int)(result));
3492 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3493 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3494 return resultobj;
3495 fail:
3496 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3497 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3498 return NULL;
3502 SWIGINTERN PyObject *_wrap_netpgp_getvar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3503 PyObject *resultobj = 0;
3504 netpgp_t *arg1 = (netpgp_t *) 0 ;
3505 char *arg2 = (char *) 0 ;
3506 char *result = 0 ;
3507 void *argp1 = 0 ;
3508 int res1 = 0 ;
3509 int res2 ;
3510 char *buf2 = 0 ;
3511 int alloc2 = 0 ;
3512 PyObject * obj0 = 0 ;
3513 PyObject * obj1 = 0 ;
3515 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_getvar",&obj0,&obj1)) SWIG_fail;
3516 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3517 if (!SWIG_IsOK(res1)) {
3518 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_getvar" "', argument " "1"" of type '" "netpgp_t *""'");
3520 arg1 = (netpgp_t *)(argp1);
3521 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3522 if (!SWIG_IsOK(res2)) {
3523 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_getvar" "', argument " "2"" of type '" "char const *""'");
3525 arg2 = (char *)(buf2);
3526 result = (char *)netpgp_getvar(arg1,(char const *)arg2);
3527 resultobj = SWIG_FromCharPtr((const char *)result);
3528 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3529 return resultobj;
3530 fail:
3531 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3532 return NULL;
3536 SWIGINTERN PyObject *_wrap_netpgp_list_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3537 PyObject *resultobj = 0;
3538 netpgp_t *arg1 = (netpgp_t *) 0 ;
3539 int result;
3540 void *argp1 = 0 ;
3541 int res1 = 0 ;
3542 PyObject * obj0 = 0 ;
3544 if (!PyArg_ParseTuple(args,(char *)"O:netpgp_list_keys",&obj0)) SWIG_fail;
3545 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3546 if (!SWIG_IsOK(res1)) {
3547 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_keys" "', argument " "1"" of type '" "netpgp_t *""'");
3549 arg1 = (netpgp_t *)(argp1);
3550 result = (int)netpgp_list_keys(arg1);
3551 resultobj = SWIG_From_int((int)(result));
3552 return resultobj;
3553 fail:
3554 return NULL;
3558 SWIGINTERN PyObject *_wrap_netpgp_list_sigs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3559 PyObject *resultobj = 0;
3560 netpgp_t *arg1 = (netpgp_t *) 0 ;
3561 char *arg2 = (char *) 0 ;
3562 int result;
3563 void *argp1 = 0 ;
3564 int res1 = 0 ;
3565 int res2 ;
3566 char *buf2 = 0 ;
3567 int alloc2 = 0 ;
3568 PyObject * obj0 = 0 ;
3569 PyObject * obj1 = 0 ;
3571 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_list_sigs",&obj0,&obj1)) SWIG_fail;
3572 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3573 if (!SWIG_IsOK(res1)) {
3574 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_sigs" "', argument " "1"" of type '" "netpgp_t *""'");
3576 arg1 = (netpgp_t *)(argp1);
3577 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3578 if (!SWIG_IsOK(res2)) {
3579 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_list_sigs" "', argument " "2"" of type '" "char const *""'");
3581 arg2 = (char *)(buf2);
3582 result = (int)netpgp_list_sigs(arg1,(char const *)arg2);
3583 resultobj = SWIG_From_int((int)(result));
3584 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3585 return resultobj;
3586 fail:
3587 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3588 return NULL;
3592 SWIGINTERN PyObject *_wrap_netpgp_find_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3593 PyObject *resultobj = 0;
3594 netpgp_t *arg1 = (netpgp_t *) 0 ;
3595 char *arg2 = (char *) 0 ;
3596 int result;
3597 void *argp1 = 0 ;
3598 int res1 = 0 ;
3599 int res2 ;
3600 char *buf2 = 0 ;
3601 int alloc2 = 0 ;
3602 PyObject * obj0 = 0 ;
3603 PyObject * obj1 = 0 ;
3605 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_find_key",&obj0,&obj1)) SWIG_fail;
3606 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3607 if (!SWIG_IsOK(res1)) {
3608 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_find_key" "', argument " "1"" of type '" "netpgp_t *""'");
3610 arg1 = (netpgp_t *)(argp1);
3611 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3612 if (!SWIG_IsOK(res2)) {
3613 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_find_key" "', argument " "2"" of type '" "char *""'");
3615 arg2 = (char *)(buf2);
3616 result = (int)netpgp_find_key(arg1,arg2);
3617 resultobj = SWIG_From_int((int)(result));
3618 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3619 return resultobj;
3620 fail:
3621 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3622 return NULL;
3626 SWIGINTERN PyObject *_wrap_netpgp_get_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3627 PyObject *resultobj = 0;
3628 netpgp_t *arg1 = (netpgp_t *) 0 ;
3629 char *arg2 = (char *) 0 ;
3630 char *result = 0 ;
3631 void *argp1 = 0 ;
3632 int res1 = 0 ;
3633 int res2 ;
3634 char *buf2 = 0 ;
3635 int alloc2 = 0 ;
3636 PyObject * obj0 = 0 ;
3637 PyObject * obj1 = 0 ;
3639 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_get_key",&obj0,&obj1)) SWIG_fail;
3640 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3641 if (!SWIG_IsOK(res1)) {
3642 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_get_key" "', argument " "1"" of type '" "netpgp_t *""'");
3644 arg1 = (netpgp_t *)(argp1);
3645 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3646 if (!SWIG_IsOK(res2)) {
3647 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_get_key" "', argument " "2"" of type '" "char const *""'");
3649 arg2 = (char *)(buf2);
3650 result = (char *)netpgp_get_key(arg1,(char const *)arg2);
3651 resultobj = SWIG_FromCharPtr((const char *)result);
3652 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3653 return resultobj;
3654 fail:
3655 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3656 return NULL;
3660 SWIGINTERN PyObject *_wrap_netpgp_export_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3661 PyObject *resultobj = 0;
3662 netpgp_t *arg1 = (netpgp_t *) 0 ;
3663 char *arg2 = (char *) 0 ;
3664 int result;
3665 void *argp1 = 0 ;
3666 int res1 = 0 ;
3667 int res2 ;
3668 char *buf2 = 0 ;
3669 int alloc2 = 0 ;
3670 PyObject * obj0 = 0 ;
3671 PyObject * obj1 = 0 ;
3673 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_export_key",&obj0,&obj1)) SWIG_fail;
3674 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3675 if (!SWIG_IsOK(res1)) {
3676 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_export_key" "', argument " "1"" of type '" "netpgp_t *""'");
3678 arg1 = (netpgp_t *)(argp1);
3679 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3680 if (!SWIG_IsOK(res2)) {
3681 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_export_key" "', argument " "2"" of type '" "char *""'");
3683 arg2 = (char *)(buf2);
3684 result = (int)netpgp_export_key(arg1,arg2);
3685 resultobj = SWIG_From_int((int)(result));
3686 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3687 return resultobj;
3688 fail:
3689 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3690 return NULL;
3694 SWIGINTERN PyObject *_wrap_netpgp_import_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3695 PyObject *resultobj = 0;
3696 netpgp_t *arg1 = (netpgp_t *) 0 ;
3697 char *arg2 = (char *) 0 ;
3698 int result;
3699 void *argp1 = 0 ;
3700 int res1 = 0 ;
3701 int res2 ;
3702 char *buf2 = 0 ;
3703 int alloc2 = 0 ;
3704 PyObject * obj0 = 0 ;
3705 PyObject * obj1 = 0 ;
3707 if (!PyArg_ParseTuple(args,(char *)"OO:netpgp_import_key",&obj0,&obj1)) SWIG_fail;
3708 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3709 if (!SWIG_IsOK(res1)) {
3710 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_import_key" "', argument " "1"" of type '" "netpgp_t *""'");
3712 arg1 = (netpgp_t *)(argp1);
3713 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3714 if (!SWIG_IsOK(res2)) {
3715 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_import_key" "', argument " "2"" of type '" "char *""'");
3717 arg2 = (char *)(buf2);
3718 result = (int)netpgp_import_key(arg1,arg2);
3719 resultobj = SWIG_From_int((int)(result));
3720 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3721 return resultobj;
3722 fail:
3723 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3724 return NULL;
3728 SWIGINTERN PyObject *_wrap_netpgp_generate_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3729 PyObject *resultobj = 0;
3730 netpgp_t *arg1 = (netpgp_t *) 0 ;
3731 char *arg2 = (char *) 0 ;
3732 int arg3 ;
3733 int result;
3734 void *argp1 = 0 ;
3735 int res1 = 0 ;
3736 int res2 ;
3737 char *buf2 = 0 ;
3738 int alloc2 = 0 ;
3739 int val3 ;
3740 int ecode3 = 0 ;
3741 PyObject * obj0 = 0 ;
3742 PyObject * obj1 = 0 ;
3743 PyObject * obj2 = 0 ;
3745 if (!PyArg_ParseTuple(args,(char *)"OOO:netpgp_generate_key",&obj0,&obj1,&obj2)) SWIG_fail;
3746 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3747 if (!SWIG_IsOK(res1)) {
3748 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_generate_key" "', argument " "1"" of type '" "netpgp_t *""'");
3750 arg1 = (netpgp_t *)(argp1);
3751 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3752 if (!SWIG_IsOK(res2)) {
3753 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_generate_key" "', argument " "2"" of type '" "char *""'");
3755 arg2 = (char *)(buf2);
3756 ecode3 = SWIG_AsVal_int(obj2, &val3);
3757 if (!SWIG_IsOK(ecode3)) {
3758 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_generate_key" "', argument " "3"" of type '" "int""'");
3760 arg3 = (int)(val3);
3761 result = (int)netpgp_generate_key(arg1,arg2,arg3);
3762 resultobj = SWIG_From_int((int)(result));
3763 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3764 return resultobj;
3765 fail:
3766 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3767 return NULL;
3771 SWIGINTERN PyObject *_wrap_netpgp_encrypt_file(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3772 PyObject *resultobj = 0;
3773 netpgp_t *arg1 = (netpgp_t *) 0 ;
3774 char *arg2 = (char *) 0 ;
3775 char *arg3 = (char *) 0 ;
3776 char *arg4 = (char *) 0 ;
3777 int arg5 ;
3778 int result;
3779 void *argp1 = 0 ;
3780 int res1 = 0 ;
3781 int res2 ;
3782 char *buf2 = 0 ;
3783 int alloc2 = 0 ;
3784 int res3 ;
3785 char *buf3 = 0 ;
3786 int alloc3 = 0 ;
3787 int res4 ;
3788 char *buf4 = 0 ;
3789 int alloc4 = 0 ;
3790 int val5 ;
3791 int ecode5 = 0 ;
3792 PyObject * obj0 = 0 ;
3793 PyObject * obj1 = 0 ;
3794 PyObject * obj2 = 0 ;
3795 PyObject * obj3 = 0 ;
3796 PyObject * obj4 = 0 ;
3798 if (!PyArg_ParseTuple(args,(char *)"OOOOO:netpgp_encrypt_file",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
3799 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3800 if (!SWIG_IsOK(res1)) {
3801 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_encrypt_file" "', argument " "1"" of type '" "netpgp_t *""'");
3803 arg1 = (netpgp_t *)(argp1);
3804 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3805 if (!SWIG_IsOK(res2)) {
3806 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_encrypt_file" "', argument " "2"" of type '" "char const *""'");
3808 arg2 = (char *)(buf2);
3809 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
3810 if (!SWIG_IsOK(res3)) {
3811 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_encrypt_file" "', argument " "3"" of type '" "char const *""'");
3813 arg3 = (char *)(buf3);
3814 res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
3815 if (!SWIG_IsOK(res4)) {
3816 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "netpgp_encrypt_file" "', argument " "4"" of type '" "char *""'");
3818 arg4 = (char *)(buf4);
3819 ecode5 = SWIG_AsVal_int(obj4, &val5);
3820 if (!SWIG_IsOK(ecode5)) {
3821 SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "netpgp_encrypt_file" "', argument " "5"" of type '" "int""'");
3823 arg5 = (int)(val5);
3824 result = (int)netpgp_encrypt_file(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
3825 resultobj = SWIG_From_int((int)(result));
3826 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3827 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3828 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3829 return resultobj;
3830 fail:
3831 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3832 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3833 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3834 return NULL;
3838 SWIGINTERN PyObject *_wrap_netpgp_decrypt_file(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3839 PyObject *resultobj = 0;
3840 netpgp_t *arg1 = (netpgp_t *) 0 ;
3841 char *arg2 = (char *) 0 ;
3842 char *arg3 = (char *) 0 ;
3843 int arg4 ;
3844 int result;
3845 void *argp1 = 0 ;
3846 int res1 = 0 ;
3847 int res2 ;
3848 char *buf2 = 0 ;
3849 int alloc2 = 0 ;
3850 int res3 ;
3851 char *buf3 = 0 ;
3852 int alloc3 = 0 ;
3853 int val4 ;
3854 int ecode4 = 0 ;
3855 PyObject * obj0 = 0 ;
3856 PyObject * obj1 = 0 ;
3857 PyObject * obj2 = 0 ;
3858 PyObject * obj3 = 0 ;
3860 if (!PyArg_ParseTuple(args,(char *)"OOOO:netpgp_decrypt_file",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
3861 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3862 if (!SWIG_IsOK(res1)) {
3863 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_decrypt_file" "', argument " "1"" of type '" "netpgp_t *""'");
3865 arg1 = (netpgp_t *)(argp1);
3866 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3867 if (!SWIG_IsOK(res2)) {
3868 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_decrypt_file" "', argument " "2"" of type '" "char const *""'");
3870 arg2 = (char *)(buf2);
3871 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
3872 if (!SWIG_IsOK(res3)) {
3873 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_decrypt_file" "', argument " "3"" of type '" "char *""'");
3875 arg3 = (char *)(buf3);
3876 ecode4 = SWIG_AsVal_int(obj3, &val4);
3877 if (!SWIG_IsOK(ecode4)) {
3878 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_decrypt_file" "', argument " "4"" of type '" "int""'");
3880 arg4 = (int)(val4);
3881 result = (int)netpgp_decrypt_file(arg1,(char const *)arg2,arg3,arg4);
3882 resultobj = SWIG_From_int((int)(result));
3883 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3884 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3885 return resultobj;
3886 fail:
3887 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3888 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3889 return NULL;
3893 SWIGINTERN PyObject *_wrap_netpgp_sign_file(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3894 PyObject *resultobj = 0;
3895 netpgp_t *arg1 = (netpgp_t *) 0 ;
3896 char *arg2 = (char *) 0 ;
3897 char *arg3 = (char *) 0 ;
3898 char *arg4 = (char *) 0 ;
3899 int arg5 ;
3900 int arg6 ;
3901 int arg7 ;
3902 int result;
3903 void *argp1 = 0 ;
3904 int res1 = 0 ;
3905 int res2 ;
3906 char *buf2 = 0 ;
3907 int alloc2 = 0 ;
3908 int res3 ;
3909 char *buf3 = 0 ;
3910 int alloc3 = 0 ;
3911 int res4 ;
3912 char *buf4 = 0 ;
3913 int alloc4 = 0 ;
3914 int val5 ;
3915 int ecode5 = 0 ;
3916 int val6 ;
3917 int ecode6 = 0 ;
3918 int val7 ;
3919 int ecode7 = 0 ;
3920 PyObject * obj0 = 0 ;
3921 PyObject * obj1 = 0 ;
3922 PyObject * obj2 = 0 ;
3923 PyObject * obj3 = 0 ;
3924 PyObject * obj4 = 0 ;
3925 PyObject * obj5 = 0 ;
3926 PyObject * obj6 = 0 ;
3928 if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:netpgp_sign_file",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail;
3929 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3930 if (!SWIG_IsOK(res1)) {
3931 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_sign_file" "', argument " "1"" of type '" "netpgp_t *""'");
3933 arg1 = (netpgp_t *)(argp1);
3934 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
3935 if (!SWIG_IsOK(res2)) {
3936 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_sign_file" "', argument " "2"" of type '" "char const *""'");
3938 arg2 = (char *)(buf2);
3939 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
3940 if (!SWIG_IsOK(res3)) {
3941 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_sign_file" "', argument " "3"" of type '" "char const *""'");
3943 arg3 = (char *)(buf3);
3944 res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
3945 if (!SWIG_IsOK(res4)) {
3946 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "netpgp_sign_file" "', argument " "4"" of type '" "char *""'");
3948 arg4 = (char *)(buf4);
3949 ecode5 = SWIG_AsVal_int(obj4, &val5);
3950 if (!SWIG_IsOK(ecode5)) {
3951 SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "netpgp_sign_file" "', argument " "5"" of type '" "int""'");
3953 arg5 = (int)(val5);
3954 ecode6 = SWIG_AsVal_int(obj5, &val6);
3955 if (!SWIG_IsOK(ecode6)) {
3956 SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "netpgp_sign_file" "', argument " "6"" of type '" "int""'");
3958 arg6 = (int)(val6);
3959 ecode7 = SWIG_AsVal_int(obj6, &val7);
3960 if (!SWIG_IsOK(ecode7)) {
3961 SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "netpgp_sign_file" "', argument " "7"" of type '" "int""'");
3963 arg7 = (int)(val7);
3964 result = (int)netpgp_sign_file(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
3965 resultobj = SWIG_From_int((int)(result));
3966 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3967 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3968 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3969 return resultobj;
3970 fail:
3971 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3972 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3973 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3974 return NULL;
3978 SWIGINTERN PyObject *_wrap_netpgp_verify_file(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
3979 PyObject *resultobj = 0;
3980 netpgp_t *arg1 = (netpgp_t *) 0 ;
3981 char *arg2 = (char *) 0 ;
3982 char *arg3 = (char *) 0 ;
3983 int arg4 ;
3984 int result;
3985 void *argp1 = 0 ;
3986 int res1 = 0 ;
3987 int res2 ;
3988 char *buf2 = 0 ;
3989 int alloc2 = 0 ;
3990 int res3 ;
3991 char *buf3 = 0 ;
3992 int alloc3 = 0 ;
3993 int val4 ;
3994 int ecode4 = 0 ;
3995 PyObject * obj0 = 0 ;
3996 PyObject * obj1 = 0 ;
3997 PyObject * obj2 = 0 ;
3998 PyObject * obj3 = 0 ;
4000 if (!PyArg_ParseTuple(args,(char *)"OOOO:netpgp_verify_file",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
4001 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
4002 if (!SWIG_IsOK(res1)) {
4003 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_verify_file" "', argument " "1"" of type '" "netpgp_t *""'");
4005 arg1 = (netpgp_t *)(argp1);
4006 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
4007 if (!SWIG_IsOK(res2)) {
4008 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_verify_file" "', argument " "2"" of type '" "char const *""'");
4010 arg2 = (char *)(buf2);
4011 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
4012 if (!SWIG_IsOK(res3)) {
4013 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_verify_file" "', argument " "3"" of type '" "char const *""'");
4015 arg3 = (char *)(buf3);
4016 ecode4 = SWIG_AsVal_int(obj3, &val4);
4017 if (!SWIG_IsOK(ecode4)) {
4018 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_verify_file" "', argument " "4"" of type '" "int""'");
4020 arg4 = (int)(val4);
4021 result = (int)netpgp_verify_file(arg1,(char const *)arg2,(char const *)arg3,arg4);
4022 resultobj = SWIG_From_int((int)(result));
4023 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4024 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
4025 return resultobj;
4026 fail:
4027 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4028 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
4029 return NULL;
4033 SWIGINTERN PyObject *_wrap_netpgp_sign_memory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4034 PyObject *resultobj = 0;
4035 netpgp_t *arg1 = (netpgp_t *) 0 ;
4036 char *arg2 = (char *) 0 ;
4037 char *arg3 = (char *) 0 ;
4038 size_t arg4 ;
4039 char *arg5 = (char *) 0 ;
4040 size_t arg6 ;
4041 unsigned int arg7 ;
4042 unsigned int arg8 ;
4043 int result;
4044 void *argp1 = 0 ;
4045 int res1 = 0 ;
4046 int res2 ;
4047 char *buf2 = 0 ;
4048 int alloc2 = 0 ;
4049 int res3 ;
4050 char *buf3 = 0 ;
4051 int alloc3 = 0 ;
4052 size_t val4 ;
4053 int ecode4 = 0 ;
4054 int res5 ;
4055 char *buf5 = 0 ;
4056 int alloc5 = 0 ;
4057 size_t val6 ;
4058 int ecode6 = 0 ;
4059 unsigned int val7 ;
4060 int ecode7 = 0 ;
4061 unsigned int val8 ;
4062 int ecode8 = 0 ;
4063 PyObject * obj0 = 0 ;
4064 PyObject * obj1 = 0 ;
4065 PyObject * obj2 = 0 ;
4066 PyObject * obj3 = 0 ;
4067 PyObject * obj4 = 0 ;
4068 PyObject * obj5 = 0 ;
4069 PyObject * obj6 = 0 ;
4070 PyObject * obj7 = 0 ;
4072 if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:netpgp_sign_memory",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail;
4073 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
4074 if (!SWIG_IsOK(res1)) {
4075 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_sign_memory" "', argument " "1"" of type '" "netpgp_t *""'");
4077 arg1 = (netpgp_t *)(argp1);
4078 res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
4079 if (!SWIG_IsOK(res2)) {
4080 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_sign_memory" "', argument " "2"" of type '" "char const *""'");
4082 arg2 = (char *)(buf2);
4083 res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
4084 if (!SWIG_IsOK(res3)) {
4085 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_sign_memory" "', argument " "3"" of type '" "char *""'");
4087 arg3 = (char *)(buf3);
4088 ecode4 = SWIG_AsVal_size_t(obj3, &val4);
4089 if (!SWIG_IsOK(ecode4)) {
4090 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_sign_memory" "', argument " "4"" of type '" "size_t""'");
4092 arg4 = (size_t)(val4);
4093 res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
4094 if (!SWIG_IsOK(res5)) {
4095 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "netpgp_sign_memory" "', argument " "5"" of type '" "char *""'");
4097 arg5 = (char *)(buf5);
4098 ecode6 = SWIG_AsVal_size_t(obj5, &val6);
4099 if (!SWIG_IsOK(ecode6)) {
4100 SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "netpgp_sign_memory" "', argument " "6"" of type '" "size_t""'");
4102 arg6 = (size_t)(val6);
4103 ecode7 = SWIG_AsVal_unsigned_SS_int(obj6, &val7);
4104 if (!SWIG_IsOK(ecode7)) {
4105 SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "netpgp_sign_memory" "', argument " "7"" of type '" "unsigned int""'");
4107 arg7 = (unsigned int)(val7);
4108 ecode8 = SWIG_AsVal_unsigned_SS_int(obj7, &val8);
4109 if (!SWIG_IsOK(ecode8)) {
4110 SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "netpgp_sign_memory" "', argument " "8"" of type '" "unsigned int""'");
4112 arg8 = (unsigned int)(val8);
4113 result = (int)netpgp_sign_memory(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
4114 resultobj = SWIG_From_int((int)(result));
4115 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4116 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
4117 if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
4118 return resultobj;
4119 fail:
4120 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
4121 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
4122 if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
4123 return NULL;
4127 SWIGINTERN PyObject *_wrap_netpgp_verify_memory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
4128 PyObject *resultobj = 0;
4129 netpgp_t *arg1 = (netpgp_t *) 0 ;
4130 void *arg2 = (void *) 0 ;
4131 size_t arg3 ;
4132 int arg4 ;
4133 int result;
4134 void *argp1 = 0 ;
4135 int res1 = 0 ;
4136 int res2 ;
4137 size_t val3 ;
4138 int ecode3 = 0 ;
4139 int val4 ;
4140 int ecode4 = 0 ;
4141 PyObject * obj0 = 0 ;
4142 PyObject * obj1 = 0 ;
4143 PyObject * obj2 = 0 ;
4144 PyObject * obj3 = 0 ;
4146 if (!PyArg_ParseTuple(args,(char *)"OOOO:netpgp_verify_memory",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
4147 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
4148 if (!SWIG_IsOK(res1)) {
4149 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_verify_memory" "', argument " "1"" of type '" "netpgp_t *""'");
4151 arg1 = (netpgp_t *)(argp1);
4152 res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0);
4153 if (!SWIG_IsOK(res2)) {
4154 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_verify_memory" "', argument " "2"" of type '" "void const *""'");
4156 ecode3 = SWIG_AsVal_size_t(obj2, &val3);
4157 if (!SWIG_IsOK(ecode3)) {
4158 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_verify_memory" "', argument " "3"" of type '" "size_t""'");
4160 arg3 = (size_t)(val3);
4161 ecode4 = SWIG_AsVal_int(obj3, &val4);
4162 if (!SWIG_IsOK(ecode4)) {
4163 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_verify_memory" "', argument " "4"" of type '" "int""'");
4165 arg4 = (int)(val4);
4166 result = (int)netpgp_verify_memory(arg1,(void const *)arg2,arg3,arg4);
4167 resultobj = SWIG_From_int((int)(result));
4168 return resultobj;
4169 fail:
4170 return NULL;
4174 static PyMethodDef SwigMethods[] = {
4175 { (char *)"netpgp_t_c_set", _wrap_netpgp_t_c_set, METH_VARARGS, NULL},
4176 { (char *)"netpgp_t_c_get", _wrap_netpgp_t_c_get, METH_VARARGS, NULL},
4177 { (char *)"netpgp_t_size_set", _wrap_netpgp_t_size_set, METH_VARARGS, NULL},
4178 { (char *)"netpgp_t_size_get", _wrap_netpgp_t_size_get, METH_VARARGS, NULL},
4179 { (char *)"netpgp_t_name_set", _wrap_netpgp_t_name_set, METH_VARARGS, NULL},
4180 { (char *)"netpgp_t_name_get", _wrap_netpgp_t_name_get, METH_VARARGS, NULL},
4181 { (char *)"netpgp_t_value_set", _wrap_netpgp_t_value_set, METH_VARARGS, NULL},
4182 { (char *)"netpgp_t_value_get", _wrap_netpgp_t_value_get, METH_VARARGS, NULL},
4183 { (char *)"netpgp_t_pubring_set", _wrap_netpgp_t_pubring_set, METH_VARARGS, NULL},
4184 { (char *)"netpgp_t_pubring_get", _wrap_netpgp_t_pubring_get, METH_VARARGS, NULL},
4185 { (char *)"netpgp_t_secring_set", _wrap_netpgp_t_secring_set, METH_VARARGS, NULL},
4186 { (char *)"netpgp_t_secring_get", _wrap_netpgp_t_secring_get, METH_VARARGS, NULL},
4187 { (char *)"netpgp_t_io_set", _wrap_netpgp_t_io_set, METH_VARARGS, NULL},
4188 { (char *)"netpgp_t_io_get", _wrap_netpgp_t_io_get, METH_VARARGS, NULL},
4189 { (char *)"netpgp_t_passfp_set", _wrap_netpgp_t_passfp_set, METH_VARARGS, NULL},
4190 { (char *)"netpgp_t_passfp_get", _wrap_netpgp_t_passfp_get, METH_VARARGS, NULL},
4191 { (char *)"new_netpgp_t", _wrap_new_netpgp_t, METH_VARARGS, NULL},
4192 { (char *)"delete_netpgp_t", _wrap_delete_netpgp_t, METH_VARARGS, NULL},
4193 { (char *)"netpgp_t_swigregister", netpgp_t_swigregister, METH_VARARGS, NULL},
4194 { (char *)"netpgp_init", _wrap_netpgp_init, METH_VARARGS, NULL},
4195 { (char *)"netpgp_end", _wrap_netpgp_end, METH_VARARGS, NULL},
4196 { (char *)"netpgp_set_debug", _wrap_netpgp_set_debug, METH_VARARGS, NULL},
4197 { (char *)"netpgp_get_debug", _wrap_netpgp_get_debug, METH_VARARGS, NULL},
4198 { (char *)"netpgp_get_info", _wrap_netpgp_get_info, METH_VARARGS, NULL},
4199 { (char *)"netpgp_list_packets", _wrap_netpgp_list_packets, METH_VARARGS, NULL},
4200 { (char *)"netpgp_setvar", _wrap_netpgp_setvar, METH_VARARGS, NULL},
4201 { (char *)"netpgp_getvar", _wrap_netpgp_getvar, METH_VARARGS, NULL},
4202 { (char *)"netpgp_list_keys", _wrap_netpgp_list_keys, METH_VARARGS, NULL},
4203 { (char *)"netpgp_list_sigs", _wrap_netpgp_list_sigs, METH_VARARGS, NULL},
4204 { (char *)"netpgp_find_key", _wrap_netpgp_find_key, METH_VARARGS, NULL},
4205 { (char *)"netpgp_get_key", _wrap_netpgp_get_key, METH_VARARGS, NULL},
4206 { (char *)"netpgp_export_key", _wrap_netpgp_export_key, METH_VARARGS, NULL},
4207 { (char *)"netpgp_import_key", _wrap_netpgp_import_key, METH_VARARGS, NULL},
4208 { (char *)"netpgp_generate_key", _wrap_netpgp_generate_key, METH_VARARGS, NULL},
4209 { (char *)"netpgp_encrypt_file", _wrap_netpgp_encrypt_file, METH_VARARGS, NULL},
4210 { (char *)"netpgp_decrypt_file", _wrap_netpgp_decrypt_file, METH_VARARGS, NULL},
4211 { (char *)"netpgp_sign_file", _wrap_netpgp_sign_file, METH_VARARGS, NULL},
4212 { (char *)"netpgp_verify_file", _wrap_netpgp_verify_file, METH_VARARGS, NULL},
4213 { (char *)"netpgp_sign_memory", _wrap_netpgp_sign_memory, METH_VARARGS, NULL},
4214 { (char *)"netpgp_verify_memory", _wrap_netpgp_verify_memory, METH_VARARGS, NULL},
4215 { NULL, NULL, 0, NULL }
4219 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4221 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
4222 static swig_type_info _swigt__p_netpgp_t = {"_p_netpgp_t", "struct netpgp_t *|netpgp_t *", 0, 0, (void*)0, 0};
4223 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
4224 static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
4226 static swig_type_info *swig_type_initial[] = {
4227 &_swigt__p_char,
4228 &_swigt__p_netpgp_t,
4229 &_swigt__p_p_char,
4230 &_swigt__p_void,
4233 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4234 static swig_cast_info _swigc__p_netpgp_t[] = { {&_swigt__p_netpgp_t, 0, 0, 0},{0, 0, 0, 0}};
4235 static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
4236 static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
4238 static swig_cast_info *swig_cast_initial[] = {
4239 _swigc__p_char,
4240 _swigc__p_netpgp_t,
4241 _swigc__p_p_char,
4242 _swigc__p_void,
4246 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4248 static swig_const_info swig_const_table[] = {
4249 {0, 0, 0, 0.0, 0, 0}};
4251 #ifdef __cplusplus
4253 #endif
4254 /* -----------------------------------------------------------------------------
4255 * Type initialization:
4256 * This problem is tough by the requirement that no dynamic
4257 * memory is used. Also, since swig_type_info structures store pointers to
4258 * swig_cast_info structures and swig_cast_info structures store pointers back
4259 * to swig_type_info structures, we need some lookup code at initialization.
4260 * The idea is that swig generates all the structures that are needed.
4261 * The runtime then collects these partially filled structures.
4262 * The SWIG_InitializeModule function takes these initial arrays out of
4263 * swig_module, and does all the lookup, filling in the swig_module.types
4264 * array with the correct data and linking the correct swig_cast_info
4265 * structures together.
4267 * The generated swig_type_info structures are assigned staticly to an initial
4268 * array. We just loop through that array, and handle each type individually.
4269 * First we lookup if this type has been already loaded, and if so, use the
4270 * loaded structure instead of the generated one. Then we have to fill in the
4271 * cast linked list. The cast data is initially stored in something like a
4272 * two-dimensional array. Each row corresponds to a type (there are the same
4273 * number of rows as there are in the swig_type_initial array). Each entry in
4274 * a column is one of the swig_cast_info structures for that type.
4275 * The cast_initial array is actually an array of arrays, because each row has
4276 * a variable number of columns. So to actually build the cast linked list,
4277 * we find the array of casts associated with the type, and loop through it
4278 * adding the casts to the list. The one last trick we need to do is making
4279 * sure the type pointer in the swig_cast_info struct is correct.
4281 * First off, we lookup the cast->type name to see if it is already loaded.
4282 * There are three cases to handle:
4283 * 1) If the cast->type has already been loaded AND the type we are adding
4284 * casting info to has not been loaded (it is in this module), THEN we
4285 * replace the cast->type pointer with the type pointer that has already
4286 * been loaded.
4287 * 2) If BOTH types (the one we are adding casting info to, and the
4288 * cast->type) are loaded, THEN the cast info has already been loaded by
4289 * the previous module so we just ignore it.
4290 * 3) Finally, if cast->type has not already been loaded, then we add that
4291 * swig_cast_info to the linked list (because the cast->type) pointer will
4292 * be correct.
4293 * ----------------------------------------------------------------------------- */
4295 #ifdef __cplusplus
4296 extern "C" {
4297 #if 0
4298 } /* c-mode */
4299 #endif
4300 #endif
4302 #if 0
4303 #define SWIGRUNTIME_DEBUG
4304 #endif
4307 SWIGRUNTIME void
4308 SWIG_InitializeModule(void *clientdata) {
4309 size_t i;
4310 swig_module_info *module_head, *iter;
4311 int found;
4313 clientdata = clientdata;
4315 /* check to see if the circular list has been setup, if not, set it up */
4316 if (swig_module.next==0) {
4317 /* Initialize the swig_module */
4318 swig_module.type_initial = swig_type_initial;
4319 swig_module.cast_initial = swig_cast_initial;
4320 swig_module.next = &swig_module;
4323 /* Try and load any already created modules */
4324 module_head = SWIG_GetModule(clientdata);
4325 if (!module_head) {
4326 /* This is the first module loaded for this interpreter */
4327 /* so set the swig module into the interpreter */
4328 SWIG_SetModule(clientdata, &swig_module);
4329 module_head = &swig_module;
4330 } else {
4331 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4332 found=0;
4333 iter=module_head;
4334 do {
4335 if (iter==&swig_module) {
4336 found=1;
4337 break;
4339 iter=iter->next;
4340 } while (iter!= module_head);
4342 /* if the is found in the list, then all is done and we may leave */
4343 if (found) return;
4344 /* otherwise we must add out module into the list */
4345 swig_module.next = module_head->next;
4346 module_head->next = &swig_module;
4349 /* Now work on filling in swig_module.types */
4350 #ifdef SWIGRUNTIME_DEBUG
4351 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4352 #endif
4353 for (i = 0; i < swig_module.size; ++i) {
4354 swig_type_info *type = 0;
4355 swig_type_info *ret;
4356 swig_cast_info *cast;
4358 #ifdef SWIGRUNTIME_DEBUG
4359 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4360 #endif
4362 /* if there is another module already loaded */
4363 if (swig_module.next != &swig_module) {
4364 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4366 if (type) {
4367 /* Overwrite clientdata field */
4368 #ifdef SWIGRUNTIME_DEBUG
4369 printf("SWIG_InitializeModule: found type %s\n", type->name);
4370 #endif
4371 if (swig_module.type_initial[i]->clientdata) {
4372 type->clientdata = swig_module.type_initial[i]->clientdata;
4373 #ifdef SWIGRUNTIME_DEBUG
4374 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4375 #endif
4377 } else {
4378 type = swig_module.type_initial[i];
4381 /* Insert casting types */
4382 cast = swig_module.cast_initial[i];
4383 while (cast->type) {
4384 /* Don't need to add information already in the list */
4385 ret = 0;
4386 #ifdef SWIGRUNTIME_DEBUG
4387 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4388 #endif
4389 if (swig_module.next != &swig_module) {
4390 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4391 #ifdef SWIGRUNTIME_DEBUG
4392 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4393 #endif
4395 if (ret) {
4396 if (type == swig_module.type_initial[i]) {
4397 #ifdef SWIGRUNTIME_DEBUG
4398 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4399 #endif
4400 cast->type = ret;
4401 ret = 0;
4402 } else {
4403 /* Check for casting already in the list */
4404 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4405 #ifdef SWIGRUNTIME_DEBUG
4406 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4407 #endif
4408 if (!ocast) ret = 0;
4412 if (!ret) {
4413 #ifdef SWIGRUNTIME_DEBUG
4414 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4415 #endif
4416 if (type->cast) {
4417 type->cast->prev = cast;
4418 cast->next = type->cast;
4420 type->cast = cast;
4422 cast++;
4424 /* Set entry in modules->types array equal to the type */
4425 swig_module.types[i] = type;
4427 swig_module.types[i] = 0;
4429 #ifdef SWIGRUNTIME_DEBUG
4430 printf("**** SWIG_InitializeModule: Cast List ******\n");
4431 for (i = 0; i < swig_module.size; ++i) {
4432 int j = 0;
4433 swig_cast_info *cast = swig_module.cast_initial[i];
4434 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4435 while (cast->type) {
4436 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4437 cast++;
4438 ++j;
4440 printf("---- Total casts: %d\n",j);
4442 printf("**** SWIG_InitializeModule: Cast List ******\n");
4443 #endif
4446 /* This function will propagate the clientdata field of type to
4447 * any new swig_type_info structures that have been added into the list
4448 * of equivalent types. It is like calling
4449 * SWIG_TypeClientData(type, clientdata) a second time.
4451 SWIGRUNTIME void
4452 SWIG_PropagateClientData(void) {
4453 size_t i;
4454 swig_cast_info *equiv;
4455 static int init_run = 0;
4457 if (init_run) return;
4458 init_run = 1;
4460 for (i = 0; i < swig_module.size; i++) {
4461 if (swig_module.types[i]->clientdata) {
4462 equiv = swig_module.types[i]->cast;
4463 while (equiv) {
4464 if (!equiv->converter) {
4465 if (equiv->type && !equiv->type->clientdata)
4466 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4468 equiv = equiv->next;
4474 #ifdef __cplusplus
4475 #if 0
4477 /* c-mode */
4478 #endif
4480 #endif
4484 #ifdef __cplusplus
4485 extern "C" {
4486 #endif
4488 /* Python-specific SWIG API */
4489 #define SWIG_newvarlink() SWIG_Python_newvarlink()
4490 #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr)
4491 #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants)
4493 /* -----------------------------------------------------------------------------
4494 * global variable support code.
4495 * ----------------------------------------------------------------------------- */
4497 typedef struct swig_globalvar {
4498 char *name; /* Name of global variable */
4499 PyObject *(*get_attr)(void); /* Return the current value */
4500 int (*set_attr)(PyObject *); /* Set the value */
4501 struct swig_globalvar *next;
4502 } swig_globalvar;
4504 typedef struct swig_varlinkobject {
4505 PyObject_HEAD
4506 swig_globalvar *vars;
4507 } swig_varlinkobject;
4509 SWIGINTERN PyObject *
4510 swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
4511 return PyString_FromString("<Swig global variables>");
4514 SWIGINTERN PyObject *
4515 swig_varlink_str(swig_varlinkobject *v) {
4516 PyObject *str = PyString_FromString("(");
4517 swig_globalvar *var;
4518 for (var = v->vars; var; var=var->next) {
4519 PyString_ConcatAndDel(&str,PyString_FromString(var->name));
4520 if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
4522 PyString_ConcatAndDel(&str,PyString_FromString(")"));
4523 return str;
4526 SWIGINTERN int
4527 swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
4528 PyObject *str = swig_varlink_str(v);
4529 fprintf(fp,"Swig global variables ");
4530 fprintf(fp,"%s\n", PyString_AsString(str));
4531 Py_DECREF(str);
4532 return 0;
4535 SWIGINTERN void
4536 swig_varlink_dealloc(swig_varlinkobject *v) {
4537 swig_globalvar *var = v->vars;
4538 while (var) {
4539 swig_globalvar *n = var->next;
4540 free(var->name);
4541 free(var);
4542 var = n;
4546 SWIGINTERN PyObject *
4547 swig_varlink_getattr(swig_varlinkobject *v, char *n) {
4548 PyObject *res = NULL;
4549 swig_globalvar *var = v->vars;
4550 while (var) {
4551 if (strcmp(var->name,n) == 0) {
4552 res = (*var->get_attr)();
4553 break;
4555 var = var->next;
4557 if (res == NULL && !PyErr_Occurred()) {
4558 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
4560 return res;
4563 SWIGINTERN int
4564 swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
4565 int res = 1;
4566 swig_globalvar *var = v->vars;
4567 while (var) {
4568 if (strcmp(var->name,n) == 0) {
4569 res = (*var->set_attr)(p);
4570 break;
4572 var = var->next;
4574 if (res == 1 && !PyErr_Occurred()) {
4575 PyErr_SetString(PyExc_NameError,"Unknown C global variable");
4577 return res;
4580 SWIGINTERN PyTypeObject*
4581 swig_varlink_type(void) {
4582 static char varlink__doc__[] = "Swig var link object";
4583 static PyTypeObject varlink_type;
4584 static int type_init = 0;
4585 if (!type_init) {
4586 const PyTypeObject tmp
4588 PyObject_HEAD_INIT(NULL)
4589 0, /* Number of items in variable part (ob_size) */
4590 (char *)"swigvarlink", /* Type name (tp_name) */
4591 sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */
4592 0, /* Itemsize (tp_itemsize) */
4593 (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */
4594 (printfunc) swig_varlink_print, /* Print (tp_print) */
4595 (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
4596 (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
4597 0, /* tp_compare */
4598 (reprfunc) swig_varlink_repr, /* tp_repr */
4599 0, /* tp_as_number */
4600 0, /* tp_as_sequence */
4601 0, /* tp_as_mapping */
4602 0, /* tp_hash */
4603 0, /* tp_call */
4604 (reprfunc)swig_varlink_str, /* tp_str */
4605 0, /* tp_getattro */
4606 0, /* tp_setattro */
4607 0, /* tp_as_buffer */
4608 0, /* tp_flags */
4609 varlink__doc__, /* tp_doc */
4610 0, /* tp_traverse */
4611 0, /* tp_clear */
4612 0, /* tp_richcompare */
4613 0, /* tp_weaklistoffset */
4614 #if PY_VERSION_HEX >= 0x02020000
4615 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
4616 #endif
4617 #if PY_VERSION_HEX >= 0x02030000
4618 0, /* tp_del */
4619 #endif
4620 #ifdef COUNT_ALLOCS
4621 0,0,0,0 /* tp_alloc -> tp_next */
4622 #endif
4624 varlink_type = tmp;
4625 varlink_type.ob_type = &PyType_Type;
4626 type_init = 1;
4628 return &varlink_type;
4631 /* Create a variable linking object for use later */
4632 SWIGINTERN PyObject *
4633 SWIG_Python_newvarlink(void) {
4634 swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
4635 if (result) {
4636 result->vars = 0;
4638 return ((PyObject*) result);
4641 SWIGINTERN void
4642 SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
4643 swig_varlinkobject *v = (swig_varlinkobject *) p;
4644 swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
4645 if (gv) {
4646 size_t size = strlen(name)+1;
4647 gv->name = (char *)malloc(size);
4648 if (gv->name) {
4649 strncpy(gv->name,name,size);
4650 gv->get_attr = get_attr;
4651 gv->set_attr = set_attr;
4652 gv->next = v->vars;
4655 v->vars = gv;
4658 SWIGINTERN PyObject *
4659 SWIG_globals(void) {
4660 static PyObject *_SWIG_globals = 0;
4661 if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();
4662 return _SWIG_globals;
4665 /* -----------------------------------------------------------------------------
4666 * constants/methods manipulation
4667 * ----------------------------------------------------------------------------- */
4669 /* Install Constants */
4670 SWIGINTERN void
4671 SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
4672 PyObject *obj = 0;
4673 size_t i;
4674 for (i = 0; constants[i].type; ++i) {
4675 switch(constants[i].type) {
4676 case SWIG_PY_POINTER:
4677 obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
4678 break;
4679 case SWIG_PY_BINARY:
4680 obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
4681 break;
4682 default:
4683 obj = 0;
4684 break;
4686 if (obj) {
4687 PyDict_SetItemString(d, constants[i].name, obj);
4688 Py_DECREF(obj);
4693 /* -----------------------------------------------------------------------------*/
4694 /* Fix SwigMethods to carry the callback ptrs when needed */
4695 /* -----------------------------------------------------------------------------*/
4697 SWIGINTERN void
4698 SWIG_Python_FixMethods(PyMethodDef *methods,
4699 swig_const_info *const_table,
4700 swig_type_info **types,
4701 swig_type_info **types_initial) {
4702 size_t i;
4703 for (i = 0; methods[i].ml_name; ++i) {
4704 const char *c = methods[i].ml_doc;
4705 if (c && (c = strstr(c, "swig_ptr: "))) {
4706 int j;
4707 swig_const_info *ci = 0;
4708 const char *name = c + 10;
4709 for (j = 0; const_table[j].type; ++j) {
4710 if (strncmp(const_table[j].name, name,
4711 strlen(const_table[j].name)) == 0) {
4712 ci = &(const_table[j]);
4713 break;
4716 if (ci) {
4717 size_t shift = (ci->ptype) - types;
4718 swig_type_info *ty = types_initial[shift];
4719 size_t ldoc = (c - methods[i].ml_doc);
4720 size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
4721 char *ndoc = (char*)malloc(ldoc + lptr + 10);
4722 if (ndoc) {
4723 char *buff = ndoc;
4724 void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
4725 if (ptr) {
4726 strncpy(buff, methods[i].ml_doc, ldoc);
4727 buff += ldoc;
4728 strncpy(buff, "swig_ptr: ", 10);
4729 buff += 10;
4730 SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
4731 methods[i].ml_doc = ndoc;
4739 #ifdef __cplusplus
4741 #endif
4743 /* -----------------------------------------------------------------------------*
4744 * Partial Init method
4745 * -----------------------------------------------------------------------------*/
4747 #ifdef __cplusplus
4748 extern "C"
4749 #endif
4750 SWIGEXPORT void SWIG_init(void) {
4751 PyObject *m, *d;
4753 /* Fix SwigMethods to carry the callback ptrs when needed */
4754 SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
4756 m = Py_InitModule((char *) SWIG_name, SwigMethods);
4757 d = PyModule_GetDict(m);
4759 SWIG_InitializeModule(0);
4760 SWIG_InstallConstants(d,swig_const_table);