Sync usage with man page.
[netbsd-mini2440.git] / crypto / external / bsd / netpgp / dist / bindings / perl / netpgpperl_wrap.c
blob7abbc75e134f47b71ccbf7965434487c50a0dcd8
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 SWIGPERL
12 #define SWIG_CASTRANK_MODE
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
110 /* -----------------------------------------------------------------------------
111 * swigrun.swg
113 * This file contains generic CAPI SWIG runtime support for pointer
114 * type checking.
115 * ----------------------------------------------------------------------------- */
117 /* This should only be incremented when either the layout of swig_type_info changes,
118 or for whatever reason, the runtime changes incompatibly */
119 #define SWIG_RUNTIME_VERSION "3"
121 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
122 #ifdef SWIG_TYPE_TABLE
123 # define SWIG_QUOTE_STRING(x) #x
124 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
125 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
126 #else
127 # define SWIG_TYPE_TABLE_NAME
128 #endif
131 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
132 creating a static or dynamic library from the swig runtime code.
133 In 99.9% of the cases, swig just needs to declare them as 'static'.
135 But only do this if is strictly necessary, ie, if you have problems
136 with your compiler or so.
139 #ifndef SWIGRUNTIME
140 # define SWIGRUNTIME SWIGINTERN
141 #endif
143 #ifndef SWIGRUNTIMEINLINE
144 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
145 #endif
147 /* Generic buffer size */
148 #ifndef SWIG_BUFFER_SIZE
149 # define SWIG_BUFFER_SIZE 1024
150 #endif
152 /* Flags for pointer conversions */
153 #define SWIG_POINTER_DISOWN 0x1
155 /* Flags for new pointer objects */
156 #define SWIG_POINTER_OWN 0x1
160 Flags/methods for returning states.
162 The swig conversion methods, as ConvertPtr, return and integer
163 that tells if the conversion was successful or not. And if not,
164 an error code can be returned (see swigerrors.swg for the codes).
166 Use the following macros/flags to set or process the returning
167 states.
169 In old swig versions, you usually write code as:
171 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
172 // success code
173 } else {
174 //fail code
177 Now you can be more explicit as:
179 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
180 if (SWIG_IsOK(res)) {
181 // success code
182 } else {
183 // fail code
186 that seems to be the same, but now you can also do
188 Type *ptr;
189 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
190 if (SWIG_IsOK(res)) {
191 // success code
192 if (SWIG_IsNewObj(res) {
194 delete *ptr;
195 } else {
198 } else {
199 // fail code
202 I.e., now SWIG_ConvertPtr can return new objects and you can
203 identify the case and take care of the deallocation. Of course that
204 requires also to SWIG_ConvertPtr to return new result values, as
206 int SWIG_ConvertPtr(obj, ptr,...) {
207 if (<obj is ok>) {
208 if (<need new object>) {
209 *ptr = <ptr to new allocated object>;
210 return SWIG_NEWOBJ;
211 } else {
212 *ptr = <ptr to old object>;
213 return SWIG_OLDOBJ;
215 } else {
216 return SWIG_BADOBJ;
220 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
221 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
222 swig errors code.
224 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
225 allows to return the 'cast rank', for example, if you have this
227 int food(double)
228 int fooi(int);
230 and you call
232 food(1) // cast rank '1' (1 -> 1.0)
233 fooi(1) // cast rank '0'
235 just use the SWIG_AddCast()/SWIG_CheckState()
239 #define SWIG_OK (0)
240 #define SWIG_ERROR (-1)
241 #define SWIG_IsOK(r) (r >= 0)
242 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
244 /* The CastRankLimit says how many bits are used for the cast rank */
245 #define SWIG_CASTRANKLIMIT (1 << 8)
246 /* The NewMask denotes the object was created (using new/malloc) */
247 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
248 /* The TmpMask is for in/out typemaps that use temporal objects */
249 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
250 /* Simple returning values */
251 #define SWIG_BADOBJ (SWIG_ERROR)
252 #define SWIG_OLDOBJ (SWIG_OK)
253 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
254 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
255 /* Check, add and del mask methods */
256 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
257 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
258 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
259 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
260 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
261 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
264 /* Cast-Rank Mode */
265 #if defined(SWIG_CASTRANK_MODE)
266 # ifndef SWIG_TypeRank
267 # define SWIG_TypeRank unsigned long
268 # endif
269 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
270 # define SWIG_MAXCASTRANK (2)
271 # endif
272 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
273 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
274 SWIGINTERNINLINE int SWIG_AddCast(int r) {
275 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
277 SWIGINTERNINLINE int SWIG_CheckState(int r) {
278 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
280 #else /* no cast-rank mode */
281 # define SWIG_AddCast
282 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
283 #endif
288 #include <string.h>
290 #ifdef __cplusplus
291 extern "C" {
292 #endif
294 typedef void *(*swig_converter_func)(void *);
295 typedef struct swig_type_info *(*swig_dycast_func)(void **);
297 /* Structure to store inforomation on one type */
298 typedef struct swig_type_info {
299 const char *name; /* mangled name of this type */
300 const char *str; /* human readable name of this type */
301 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
302 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
303 void *clientdata; /* language specific type data */
304 int owndata; /* flag if the structure owns the clientdata */
305 } swig_type_info;
307 /* Structure to store a type and conversion function used for casting */
308 typedef struct swig_cast_info {
309 swig_type_info *type; /* pointer to type that is equivalent to this type */
310 swig_converter_func converter; /* function to cast the void pointers */
311 struct swig_cast_info *next; /* pointer to next cast in linked list */
312 struct swig_cast_info *prev; /* pointer to the previous cast */
313 } swig_cast_info;
315 /* Structure used to store module information
316 * Each module generates one structure like this, and the runtime collects
317 * all of these structures and stores them in a circularly linked list.*/
318 typedef struct swig_module_info {
319 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
320 size_t size; /* Number of types in this module */
321 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
322 swig_type_info **type_initial; /* Array of initially generated type structures */
323 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
324 void *clientdata; /* Language specific module data */
325 } swig_module_info;
328 Compare two type names skipping the space characters, therefore
329 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
331 Return 0 when the two name types are equivalent, as in
332 strncmp, but skipping ' '.
334 SWIGRUNTIME int
335 SWIG_TypeNameComp(const char *f1, const char *l1,
336 const char *f2, const char *l2) {
337 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
338 while ((*f1 == ' ') && (f1 != l1)) ++f1;
339 while ((*f2 == ' ') && (f2 != l2)) ++f2;
340 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
342 return (l1 - f1) - (l2 - f2);
346 Check type equivalence in a name list like <name1>|<name2>|...
347 Return 0 if not equal, 1 if equal
349 SWIGRUNTIME int
350 SWIG_TypeEquiv(const char *nb, const char *tb) {
351 int equiv = 0;
352 const char* te = tb + strlen(tb);
353 const char* ne = nb;
354 while (!equiv && *ne) {
355 for (nb = ne; *ne; ++ne) {
356 if (*ne == '|') break;
358 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
359 if (*ne) ++ne;
361 return equiv;
365 Check type equivalence in a name list like <name1>|<name2>|...
366 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
368 SWIGRUNTIME int
369 SWIG_TypeCompare(const char *nb, const char *tb) {
370 int equiv = 0;
371 const char* te = tb + strlen(tb);
372 const char* ne = nb;
373 while (!equiv && *ne) {
374 for (nb = ne; *ne; ++ne) {
375 if (*ne == '|') break;
377 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
378 if (*ne) ++ne;
380 return equiv;
384 /* think of this as a c++ template<> or a scheme macro */
385 #define SWIG_TypeCheck_Template(comparison, ty) \
386 if (ty) { \
387 swig_cast_info *iter = ty->cast; \
388 while (iter) { \
389 if (comparison) { \
390 if (iter == ty->cast) return iter; \
391 /* Move iter to the top of the linked list */ \
392 iter->prev->next = iter->next; \
393 if (iter->next) \
394 iter->next->prev = iter->prev; \
395 iter->next = ty->cast; \
396 iter->prev = 0; \
397 if (ty->cast) ty->cast->prev = iter; \
398 ty->cast = iter; \
399 return iter; \
401 iter = iter->next; \
404 return 0
407 Check the typename
409 SWIGRUNTIME swig_cast_info *
410 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
411 SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
414 /* Same as previous function, except strcmp is replaced with a pointer comparison */
415 SWIGRUNTIME swig_cast_info *
416 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
417 SWIG_TypeCheck_Template(iter->type == from, into);
421 Cast a pointer up an inheritance hierarchy
423 SWIGRUNTIMEINLINE void *
424 SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
425 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
429 Dynamic pointer casting. Down an inheritance hierarchy
431 SWIGRUNTIME swig_type_info *
432 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
433 swig_type_info *lastty = ty;
434 if (!ty || !ty->dcast) return ty;
435 while (ty && (ty->dcast)) {
436 ty = (*ty->dcast)(ptr);
437 if (ty) lastty = ty;
439 return lastty;
443 Return the name associated with this type
445 SWIGRUNTIMEINLINE const char *
446 SWIG_TypeName(const swig_type_info *ty) {
447 return ty->name;
451 Return the pretty name associated with this type,
452 that is an unmangled type name in a form presentable to the user.
454 SWIGRUNTIME const char *
455 SWIG_TypePrettyName(const swig_type_info *type) {
456 /* The "str" field contains the equivalent pretty names of the
457 type, separated by vertical-bar characters. We choose
458 to print the last name, as it is often (?) the most
459 specific. */
460 if (!type) return NULL;
461 if (type->str != NULL) {
462 const char *last_name = type->str;
463 const char *s;
464 for (s = type->str; *s; s++)
465 if (*s == '|') last_name = s+1;
466 return last_name;
468 else
469 return type->name;
473 Set the clientdata field for a type
475 SWIGRUNTIME void
476 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
477 swig_cast_info *cast = ti->cast;
478 /* if (ti->clientdata == clientdata) return; */
479 ti->clientdata = clientdata;
481 while (cast) {
482 if (!cast->converter) {
483 swig_type_info *tc = cast->type;
484 if (!tc->clientdata) {
485 SWIG_TypeClientData(tc, clientdata);
488 cast = cast->next;
491 SWIGRUNTIME void
492 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
493 SWIG_TypeClientData(ti, clientdata);
494 ti->owndata = 1;
498 Search for a swig_type_info structure only by mangled name
499 Search is a O(log #types)
501 We start searching at module start, and finish searching when start == end.
502 Note: if start == end at the beginning of the function, we go all the way around
503 the circular list.
505 SWIGRUNTIME swig_type_info *
506 SWIG_MangledTypeQueryModule(swig_module_info *start,
507 swig_module_info *end,
508 const char *name) {
509 swig_module_info *iter = start;
510 do {
511 if (iter->size) {
512 register size_t l = 0;
513 register size_t r = iter->size - 1;
514 do {
515 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
516 register size_t i = (l + r) >> 1;
517 const char *iname = iter->types[i]->name;
518 if (iname) {
519 register int compare = strcmp(name, iname);
520 if (compare == 0) {
521 return iter->types[i];
522 } else if (compare < 0) {
523 if (i) {
524 r = i - 1;
525 } else {
526 break;
528 } else if (compare > 0) {
529 l = i + 1;
531 } else {
532 break; /* should never happen */
534 } while (l <= r);
536 iter = iter->next;
537 } while (iter != end);
538 return 0;
542 Search for a swig_type_info structure for either a mangled name or a human readable name.
543 It first searches the mangled names of the types, which is a O(log #types)
544 If a type is not found it then searches the human readable names, which is O(#types).
546 We start searching at module start, and finish searching when start == end.
547 Note: if start == end at the beginning of the function, we go all the way around
548 the circular list.
550 SWIGRUNTIME swig_type_info *
551 SWIG_TypeQueryModule(swig_module_info *start,
552 swig_module_info *end,
553 const char *name) {
554 /* STEP 1: Search the name field using binary search */
555 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
556 if (ret) {
557 return ret;
558 } else {
559 /* STEP 2: If the type hasn't been found, do a complete search
560 of the str field (the human readable name) */
561 swig_module_info *iter = start;
562 do {
563 register size_t i = 0;
564 for (; i < iter->size; ++i) {
565 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
566 return iter->types[i];
568 iter = iter->next;
569 } while (iter != end);
572 /* neither found a match */
573 return 0;
577 Pack binary data into a string
579 SWIGRUNTIME char *
580 SWIG_PackData(char *c, void *ptr, size_t sz) {
581 static const char hex[17] = "0123456789abcdef";
582 register const unsigned char *u = (unsigned char *) ptr;
583 register const unsigned char *eu = u + sz;
584 for (; u != eu; ++u) {
585 register unsigned char uu = *u;
586 *(c++) = hex[(uu & 0xf0) >> 4];
587 *(c++) = hex[uu & 0xf];
589 return c;
593 Unpack binary data from a string
595 SWIGRUNTIME const char *
596 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
597 register unsigned char *u = (unsigned char *) ptr;
598 register const unsigned char *eu = u + sz;
599 for (; u != eu; ++u) {
600 register char d = *(c++);
601 register unsigned char uu;
602 if ((d >= '0') && (d <= '9'))
603 uu = ((d - '0') << 4);
604 else if ((d >= 'a') && (d <= 'f'))
605 uu = ((d - ('a'-10)) << 4);
606 else
607 return (char *) 0;
608 d = *(c++);
609 if ((d >= '0') && (d <= '9'))
610 uu |= (d - '0');
611 else if ((d >= 'a') && (d <= 'f'))
612 uu |= (d - ('a'-10));
613 else
614 return (char *) 0;
615 *u = uu;
617 return c;
621 Pack 'void *' into a string buffer.
623 SWIGRUNTIME char *
624 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
625 char *r = buff;
626 if ((2*sizeof(void *) + 2) > bsz) return 0;
627 *(r++) = '_';
628 r = SWIG_PackData(r,&ptr,sizeof(void *));
629 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
630 strcpy(r,name);
631 return buff;
634 SWIGRUNTIME const char *
635 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
636 if (*c != '_') {
637 if (strcmp(c,"NULL") == 0) {
638 *ptr = (void *) 0;
639 return name;
640 } else {
641 return 0;
644 return SWIG_UnpackData(++c,ptr,sizeof(void *));
647 SWIGRUNTIME char *
648 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
649 char *r = buff;
650 size_t lname = (name ? strlen(name) : 0);
651 if ((2*sz + 2 + lname) > bsz) return 0;
652 *(r++) = '_';
653 r = SWIG_PackData(r,ptr,sz);
654 if (lname) {
655 strncpy(r,name,lname+1);
656 } else {
657 *r = 0;
659 return buff;
662 SWIGRUNTIME const char *
663 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
664 if (*c != '_') {
665 if (strcmp(c,"NULL") == 0) {
666 memset(ptr,0,sz);
667 return name;
668 } else {
669 return 0;
672 return SWIG_UnpackData(++c,ptr,sz);
675 #ifdef __cplusplus
677 #endif
679 /* Errors in SWIG */
680 #define SWIG_UnknownError -1
681 #define SWIG_IOError -2
682 #define SWIG_RuntimeError -3
683 #define SWIG_IndexError -4
684 #define SWIG_TypeError -5
685 #define SWIG_DivisionByZero -6
686 #define SWIG_OverflowError -7
687 #define SWIG_SyntaxError -8
688 #define SWIG_ValueError -9
689 #define SWIG_SystemError -10
690 #define SWIG_AttributeError -11
691 #define SWIG_MemoryError -12
692 #define SWIG_NullReferenceError -13
696 #ifdef __cplusplus
697 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
698 #include <math.h>
699 #include <stdlib.h>
700 extern "C" {
701 #endif
702 #include "EXTERN.h"
703 #include "perl.h"
704 #include "XSUB.h"
706 /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
708 /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
709 #ifndef PERL_REVISION
710 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
711 # define PERL_PATCHLEVEL_H_IMPLICIT
712 # include <patchlevel.h>
713 # endif
714 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
715 # include <could_not_find_Perl_patchlevel.h>
716 # endif
717 # ifndef PERL_REVISION
718 # define PERL_REVISION (5)
719 # define PERL_VERSION PATCHLEVEL
720 # define PERL_SUBVERSION SUBVERSION
721 # endif
722 #endif
724 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
725 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
726 #endif
728 #ifndef SvIOK_UV
729 # define SvIOK_UV(sv) (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
730 #endif
732 #ifndef SvUOK
733 # define SvUOK(sv) SvIOK_UV(sv)
734 #endif
736 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
737 # define PL_sv_undef sv_undef
738 # define PL_na na
739 # define PL_errgv errgv
740 # define PL_sv_no sv_no
741 # define PL_sv_yes sv_yes
742 # define PL_markstack_ptr markstack_ptr
743 #endif
745 #ifndef IVSIZE
746 # ifdef LONGSIZE
747 # define IVSIZE LONGSIZE
748 # else
749 # define IVSIZE 4 /* A bold guess, but the best we can make. */
750 # endif
751 #endif
753 #ifndef INT2PTR
754 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
755 # define PTRV UV
756 # define INT2PTR(any,d) (any)(d)
757 # else
758 # if PTRSIZE == LONGSIZE
759 # define PTRV unsigned long
760 # else
761 # define PTRV unsigned
762 # endif
763 # define INT2PTR(any,d) (any)(PTRV)(d)
764 # endif
766 # define NUM2PTR(any,d) (any)(PTRV)(d)
767 # define PTR2IV(p) INT2PTR(IV,p)
768 # define PTR2UV(p) INT2PTR(UV,p)
769 # define PTR2NV(p) NUM2PTR(NV,p)
771 # if PTRSIZE == LONGSIZE
772 # define PTR2ul(p) (unsigned long)(p)
773 # else
774 # define PTR2ul(p) INT2PTR(unsigned long,p)
775 # endif
776 #endif /* !INT2PTR */
778 #ifndef get_sv
779 # define get_sv perl_get_sv
780 #endif
782 #ifndef ERRSV
783 # define ERRSV get_sv("@",FALSE)
784 #endif
786 #ifndef pTHX_
787 #define pTHX_
788 #endif
790 #include <string.h>
791 #ifdef __cplusplus
793 #endif
795 /* -----------------------------------------------------------------------------
796 * error manipulation
797 * ----------------------------------------------------------------------------- */
799 SWIGINTERN const char*
800 SWIG_Perl_ErrorType(int code) {
801 const char* type = 0;
802 switch(code) {
803 case SWIG_MemoryError:
804 type = "MemoryError";
805 break;
806 case SWIG_IOError:
807 type = "IOError";
808 break;
809 case SWIG_RuntimeError:
810 type = "RuntimeError";
811 break;
812 case SWIG_IndexError:
813 type = "IndexError";
814 break;
815 case SWIG_TypeError:
816 type = "TypeError";
817 break;
818 case SWIG_DivisionByZero:
819 type = "ZeroDivisionError";
820 break;
821 case SWIG_OverflowError:
822 type = "OverflowError";
823 break;
824 case SWIG_SyntaxError:
825 type = "SyntaxError";
826 break;
827 case SWIG_ValueError:
828 type = "ValueError";
829 break;
830 case SWIG_SystemError:
831 type = "SystemError";
832 break;
833 case SWIG_AttributeError:
834 type = "AttributeError";
835 break;
836 default:
837 type = "RuntimeError";
839 return type;
845 /* -----------------------------------------------------------------------------
846 * perlrun.swg
848 * This file contains the runtime support for Perl modules
849 * and includes code for managing global variables and pointer
850 * type checking.
851 * ----------------------------------------------------------------------------- */
853 #ifdef PERL_OBJECT
854 #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
855 #define SWIG_PERL_OBJECT_CALL pPerl,
856 #else
857 #define SWIG_PERL_OBJECT_DECL
858 #define SWIG_PERL_OBJECT_CALL
859 #endif
861 /* Common SWIG API */
863 /* for raw pointers */
864 #define SWIG_ConvertPtr(obj, pp, type, flags) SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
865 #define SWIG_NewPointerObj(p, type, flags) SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
867 /* for raw packed data */
868 #define SWIG_ConvertPacked(obj, p, s, type) SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
869 #define SWIG_NewPackedObj(p, s, type) SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
871 /* for class or struct pointers */
872 #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
873 #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
875 /* for C or C++ function pointers */
876 #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
877 #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
879 /* for C++ member pointers, ie, member methods */
880 #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_ConvertPacked(obj, ptr, sz, ty)
881 #define SWIG_NewMemberObj(ptr, sz, type) SWIG_NewPackedObj(ptr, sz, type)
884 /* Runtime API */
886 #define SWIG_GetModule(clientdata) SWIG_Perl_GetModule()
887 #define SWIG_SetModule(clientdata, pointer) SWIG_Perl_SetModule(pointer)
890 /* Error manipulation */
892 #define SWIG_ErrorType(code) SWIG_Perl_ErrorType(code)
893 #define SWIG_Error(code, msg) sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
894 #define SWIG_fail goto fail
896 /* Perl-specific SWIG API */
898 #define SWIG_MakePtr(sv, ptr, type, flags) SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
899 #define SWIG_MakePackedObj(sv, p, s, type) SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
900 #define SWIG_SetError(str) SWIG_Error(SWIG_RuntimeError, str)
903 #define SWIG_PERL_DECL_ARGS_1(arg1) (SWIG_PERL_OBJECT_DECL arg1)
904 #define SWIG_PERL_CALL_ARGS_1(arg1) (SWIG_PERL_OBJECT_CALL arg1)
905 #define SWIG_PERL_DECL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_DECL arg1, arg2)
906 #define SWIG_PERL_CALL_ARGS_2(arg1, arg2) (SWIG_PERL_OBJECT_CALL arg1, arg2)
908 /* -----------------------------------------------------------------------------
909 * pointers/data manipulation
910 * ----------------------------------------------------------------------------- */
912 /* For backward compatibility only */
913 #define SWIG_POINTER_EXCEPTION 0
915 #ifdef __cplusplus
916 extern "C" {
917 #endif
919 #define SWIG_OWNER SWIG_POINTER_OWN
920 #define SWIG_SHADOW SWIG_OWNER << 1
922 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
924 /* SWIG Perl macros */
926 /* Macro to call an XS function */
927 #ifdef PERL_OBJECT
928 # define SWIG_CALLXS(_name) _name(cv,pPerl)
929 #else
930 # ifndef MULTIPLICITY
931 # define SWIG_CALLXS(_name) _name(cv)
932 # else
933 # define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv)
934 # endif
935 #endif
937 /* Note: SwigMagicFuncHack is a typedef used to get the C++ compiler to just shut up already */
939 #ifdef PERL_OBJECT
940 #define MAGIC_PPERL CPerlObj *pPerl = (CPerlObj *) this;
941 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
943 #ifdef __cplusplus
944 extern "C" {
945 #endif
946 typedef int (CPerlObj::*SwigMagicFuncHack)(SV *, MAGIC *);
947 #ifdef __cplusplus
949 #endif
951 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
952 #define SWIGCLASS_STATIC
953 #else
954 #define MAGIC_PPERL
955 #define SWIGCLASS_STATIC static SWIGUNUSED
956 #ifndef MULTIPLICITY
957 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
958 typedef int (*SwigMagicFunc)(SV *, MAGIC *);
960 #ifdef __cplusplus
961 extern "C" {
962 #endif
963 typedef int (*SwigMagicFuncHack)(SV *, MAGIC *);
964 #ifdef __cplusplus
966 #endif
969 #else
970 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
971 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
972 #ifdef __cplusplus
973 extern "C" {
974 #endif
975 typedef int (*SwigMagicFuncHack)(struct interpreter *, SV *, MAGIC *);
976 #ifdef __cplusplus
978 #endif
980 #endif
981 #endif
983 /* Workaround for bug in perl 5.6.x croak and earlier */
984 #if (PERL_VERSION < 8)
985 # ifdef PERL_OBJECT
986 # define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
987 static void SWIG_Perl_croak_null(CPerlObj *pPerl)
988 # else
989 static void SWIG_croak_null()
990 # endif
992 SV *err=ERRSV;
993 # if (PERL_VERSION < 6)
994 croak("%_", err);
995 # else
996 if (SvOK(err) && !SvROK(err)) croak("%_", err);
997 croak(Nullch);
998 # endif
1000 #else
1001 # define SWIG_croak_null() croak(Nullch)
1002 #endif
1006 Define how strict is the cast between strings and integers/doubles
1007 when overloading between these types occurs.
1009 The default is making it as strict as possible by using SWIG_AddCast
1010 when needed.
1012 You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1013 disable the SWIG_AddCast, making the casting between string and
1014 numbers less strict.
1016 In the end, we try to solve the overloading between strings and
1017 numerical types in the more natural way, but if you can avoid it,
1018 well, avoid it using %rename, for example.
1020 #ifndef SWIG_PERL_NO_STRICT_STR2NUM
1021 # ifndef SWIG_PERL_STRICT_STR2NUM
1022 # define SWIG_PERL_STRICT_STR2NUM
1023 # endif
1024 #endif
1025 #ifdef SWIG_PERL_STRICT_STR2NUM
1026 /* string takes precedence */
1027 #define SWIG_Str2NumCast(x) SWIG_AddCast(x)
1028 #else
1029 /* number takes precedence */
1030 #define SWIG_Str2NumCast(x) x
1031 #endif
1035 #include <stdlib.h>
1037 SWIGRUNTIME const char *
1038 SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1039 if (!type) return NULL;
1040 if (type->clientdata != NULL) {
1041 return (const char*) type->clientdata;
1043 else {
1044 return type->name;
1048 SWIGRUNTIME swig_cast_info *
1049 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1050 SWIG_TypeCheck_Template(( (!iter->type->clientdata && (strcmp((char*)iter->type->name, c) == 0))
1051 || (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0))), ty);
1055 /* Function for getting a pointer value */
1057 SWIGRUNTIME int
1058 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1059 swig_cast_info *tc;
1060 void *voidptr = (void *)0;
1061 SV *tsv = 0;
1062 /* If magical, apply more magic */
1063 if (SvGMAGICAL(sv))
1064 mg_get(sv);
1066 /* Check to see if this is an object */
1067 if (sv_isobject(sv)) {
1068 IV tmp = 0;
1069 tsv = (SV*) SvRV(sv);
1070 if ((SvTYPE(tsv) == SVt_PVHV)) {
1071 MAGIC *mg;
1072 if (SvMAGICAL(tsv)) {
1073 mg = mg_find(tsv,'P');
1074 if (mg) {
1075 sv = mg->mg_obj;
1076 if (sv_isobject(sv)) {
1077 tsv = (SV*)SvRV(sv);
1078 tmp = SvIV(tsv);
1081 } else {
1082 return SWIG_ERROR;
1084 } else {
1085 tmp = SvIV(tsv);
1087 voidptr = INT2PTR(void *,tmp);
1088 } else if (! SvOK(sv)) { /* Check for undef */
1089 *(ptr) = (void *) 0;
1090 return SWIG_OK;
1091 } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */
1092 if (!SvROK(sv)) {
1093 *(ptr) = (void *) 0;
1094 return SWIG_OK;
1095 } else {
1096 return SWIG_ERROR;
1098 } else { /* Don't know what it is */
1099 return SWIG_ERROR;
1101 if (_t) {
1102 /* Now see if the types match */
1103 char *_c = HvNAME(SvSTASH(SvRV(sv)));
1104 tc = SWIG_TypeProxyCheck(_c,_t);
1105 if (!tc) {
1106 return SWIG_ERROR;
1108 *ptr = SWIG_TypeCast(tc,voidptr);
1109 } else {
1110 *ptr = voidptr;
1114 * DISOWN implementation: we need a perl guru to check this one.
1116 if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1118 * almost copy paste code from below SWIG_POINTER_OWN setting
1120 SV *obj = sv;
1121 HV *stash = SvSTASH(SvRV(obj));
1122 GV *gv = *(GV**) hv_fetch(stash, "OWNER", 5, TRUE);
1123 if (isGV(gv)) {
1124 HV *hv = GvHVn(gv);
1126 * To set ownership (see below), a newSViv(1) entry is added.
1127 * Hence, to remove ownership, we delete the entry.
1129 if (hv_exists_ent(hv, obj, 0)) {
1130 hv_delete_ent(hv, obj, 0, 0);
1134 return SWIG_OK;
1137 SWIGRUNTIME void
1138 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1139 if (ptr && (flags & SWIG_SHADOW)) {
1140 SV *self;
1141 SV *obj=newSV(0);
1142 HV *hash=newHV();
1143 HV *stash;
1144 sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
1145 stash=SvSTASH(SvRV(obj));
1146 if (flags & SWIG_POINTER_OWN) {
1147 HV *hv;
1148 GV *gv=*(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1149 if (!isGV(gv))
1150 gv_init(gv, stash, "OWNER", 5, FALSE);
1151 hv=GvHVn(gv);
1152 hv_store_ent(hv, obj, newSViv(1), 0);
1154 sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1155 SvREFCNT_dec(obj);
1156 self=newRV_noinc((SV *)hash);
1157 sv_setsv(sv, self);
1158 SvREFCNT_dec((SV *)self);
1159 sv_bless(sv, stash);
1161 else {
1162 sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
1166 SWIGRUNTIMEINLINE SV *
1167 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1168 SV *result = sv_newmortal();
1169 SWIG_MakePtr(result, ptr, t, flags);
1170 return result;
1173 SWIGRUNTIME void
1174 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1175 char result[1024];
1176 char *r = result;
1177 if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1178 *(r++) = '_';
1179 r = SWIG_PackData(r,ptr,sz);
1180 strcpy(r,SWIG_Perl_TypeProxyName(type));
1181 sv_setpv(sv, result);
1184 SWIGRUNTIME SV *
1185 SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1186 SV *result = sv_newmortal();
1187 SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1188 return result;
1191 /* Convert a packed value value */
1192 SWIGRUNTIME int
1193 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1194 swig_cast_info *tc;
1195 const char *c = 0;
1197 if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1198 c = SvPV(obj, PL_na);
1199 /* Pointer values must start with leading underscore */
1200 if (*c != '_') return SWIG_ERROR;
1201 c++;
1202 c = SWIG_UnpackData(c,ptr,sz);
1203 if (ty) {
1204 tc = SWIG_TypeCheck(c,ty);
1205 if (!tc) return SWIG_ERROR;
1207 return SWIG_OK;
1211 /* Macros for low-level exception handling */
1212 #define SWIG_croak(x) { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1215 typedef XS(SwigPerlWrapper);
1216 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1218 /* Structure for command table */
1219 typedef struct {
1220 const char *name;
1221 SwigPerlWrapperPtr wrapper;
1222 } swig_command_info;
1224 /* Information for constant table */
1226 #define SWIG_INT 1
1227 #define SWIG_FLOAT 2
1228 #define SWIG_STRING 3
1229 #define SWIG_POINTER 4
1230 #define SWIG_BINARY 5
1232 /* Constant information structure */
1233 typedef struct swig_constant_info {
1234 int type;
1235 const char *name;
1236 long lvalue;
1237 double dvalue;
1238 void *pvalue;
1239 swig_type_info **ptype;
1240 } swig_constant_info;
1243 /* Structure for variable table */
1244 typedef struct {
1245 const char *name;
1246 SwigMagicFunc set;
1247 SwigMagicFunc get;
1248 swig_type_info **type;
1249 } swig_variable_info;
1251 /* Magic variable code */
1252 #ifndef PERL_OBJECT
1253 #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
1254 #ifndef MULTIPLICITY
1255 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *))
1256 #else
1257 SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *))
1258 #endif
1259 #else
1260 # define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1261 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *))
1262 #endif
1264 MAGIC *mg;
1265 sv_magic(sv,sv,'U',(char *) name,strlen(name));
1266 mg = mg_find(sv,'U');
1267 mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1268 mg->mg_virtual->svt_get = (SwigMagicFuncHack) get;
1269 mg->mg_virtual->svt_set = (SwigMagicFuncHack) set;
1270 mg->mg_virtual->svt_len = 0;
1271 mg->mg_virtual->svt_clear = 0;
1272 mg->mg_virtual->svt_free = 0;
1276 SWIGRUNTIME swig_module_info *
1277 SWIG_Perl_GetModule(void) {
1278 static void *type_pointer = (void *)0;
1279 SV *pointer;
1281 /* first check if pointer already created */
1282 if (!type_pointer) {
1283 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE);
1284 if (pointer && SvOK(pointer)) {
1285 type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1289 return (swig_module_info *) type_pointer;
1292 SWIGRUNTIME void
1293 SWIG_Perl_SetModule(swig_module_info *module) {
1294 SV *pointer;
1296 /* create a new pointer */
1297 pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE);
1298 sv_setiv(pointer, PTR2IV(module));
1301 #ifdef __cplusplus
1303 #endif
1305 /* Workaround perl5 global namespace pollution. Note that undefining library
1306 * functions like fopen will not solve the problem on all platforms as fopen
1307 * might be a macro on Windows but not necessarily on other operating systems. */
1308 #ifdef do_open
1309 #undef do_open
1310 #endif
1311 #ifdef do_close
1312 #undef do_close
1313 #endif
1314 #ifdef scalar
1315 #undef scalar
1316 #endif
1317 #ifdef list
1318 #undef list
1319 #endif
1320 #ifdef apply
1321 #undef apply
1322 #endif
1323 #ifdef convert
1324 #undef convert
1325 #endif
1326 #ifdef Error
1327 #undef Error
1328 #endif
1329 #ifdef form
1330 #undef form
1331 #endif
1332 #ifdef vform
1333 #undef vform
1334 #endif
1335 #ifdef LABEL
1336 #undef LABEL
1337 #endif
1338 #ifdef METHOD
1339 #undef METHOD
1340 #endif
1341 #ifdef Move
1342 #undef Move
1343 #endif
1344 #ifdef yylex
1345 #undef yylex
1346 #endif
1347 #ifdef yyparse
1348 #undef yyparse
1349 #endif
1350 #ifdef yyerror
1351 #undef yyerror
1352 #endif
1353 #ifdef invert
1354 #undef invert
1355 #endif
1356 #ifdef ref
1357 #undef ref
1358 #endif
1359 #ifdef read
1360 #undef read
1361 #endif
1362 #ifdef write
1363 #undef write
1364 #endif
1365 #ifdef eof
1366 #undef eof
1367 #endif
1368 #ifdef bool
1369 #undef bool
1370 #endif
1371 #ifdef close
1372 #undef close
1373 #endif
1374 #ifdef rewind
1375 #undef rewind
1376 #endif
1377 #ifdef free
1378 #undef free
1379 #endif
1380 #ifdef malloc
1381 #undef malloc
1382 #endif
1383 #ifdef calloc
1384 #undef calloc
1385 #endif
1386 #ifdef Stat
1387 #undef Stat
1388 #endif
1389 #ifdef check
1390 #undef check
1391 #endif
1392 #ifdef seekdir
1393 #undef seekdir
1394 #endif
1395 #ifdef open
1396 #undef open
1397 #endif
1401 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1403 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1407 /* -------- TYPES TABLE (BEGIN) -------- */
1409 #define SWIGTYPE_p_char swig_types[0]
1410 #define SWIGTYPE_p_netpgp_t swig_types[1]
1411 #define SWIGTYPE_p_p_char swig_types[2]
1412 #define SWIGTYPE_p_void swig_types[3]
1413 static swig_type_info *swig_types[5];
1414 static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
1415 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1416 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1418 /* -------- TYPES TABLE (END) -------- */
1420 #define SWIG_init boot_netpgpperl
1422 #define SWIG_name "netpgpperlc::boot_netpgpperl"
1423 #define SWIG_prefix "netpgpperlc::"
1425 #define SWIGVERSION 0x010331
1426 #define SWIG_VERSION SWIGVERSION
1429 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1430 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1433 #ifdef __cplusplus
1434 extern "C"
1435 #endif
1436 #ifndef PERL_OBJECT
1437 #ifndef MULTIPLICITY
1438 SWIGEXPORT void SWIG_init (CV* cv);
1439 #else
1440 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1441 #endif
1442 #else
1443 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1444 #endif
1447 #include <netpgp.h>
1448 #undef SvPOK
1449 #define SvPOK(x) 1
1452 #include <limits.h>
1453 #ifndef LLONG_MIN
1454 # define LLONG_MIN LONG_LONG_MIN
1455 #endif
1456 #ifndef LLONG_MAX
1457 # define LLONG_MAX LONG_LONG_MAX
1458 #endif
1459 #ifndef ULLONG_MAX
1460 # define ULLONG_MAX ULONG_LONG_MAX
1461 #endif
1464 SWIGINTERN int
1465 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1467 if (SvNIOK(obj)) {
1468 if (val) *val = SvNV(obj);
1469 return SWIG_OK;
1470 } else if (SvIOK(obj)) {
1471 if (val) *val = (double) SvIV(obj);
1472 return SWIG_AddCast(SWIG_OK);
1473 } else {
1474 const char *nptr = SvPV(obj, PL_na);
1475 if (nptr) {
1476 char *endptr;
1477 double v = strtod(nptr, &endptr);
1478 if (errno == ERANGE) {
1479 errno = 0;
1480 return SWIG_OverflowError;
1481 } else {
1482 if (*endptr == '\0') {
1483 if (val) *val = v;
1484 return SWIG_Str2NumCast(SWIG_OK);
1489 return SWIG_TypeError;
1493 #include <float.h>
1496 #include <math.h>
1499 SWIGINTERNINLINE int
1500 SWIG_CanCastAsInteger(double *d, double min, double max) {
1501 double x = *d;
1502 if ((min <= x && x <= max)) {
1503 double fx = floor(x);
1504 double cx = ceil(x);
1505 double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1506 if ((errno == EDOM) || (errno == ERANGE)) {
1507 errno = 0;
1508 } else {
1509 double summ, reps, diff;
1510 if (rd < x) {
1511 diff = x - rd;
1512 } else if (rd > x) {
1513 diff = rd - x;
1514 } else {
1515 return 1;
1517 summ = rd + x;
1518 reps = diff/summ;
1519 if (reps < 8*DBL_EPSILON) {
1520 *d = rd;
1521 return 1;
1525 return 0;
1529 SWIGINTERN int
1530 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
1532 if (SvUOK(obj)) {
1533 if (val) *val = SvUV(obj);
1534 return SWIG_OK;
1535 } else if (SvIOK(obj)) {
1536 long v = SvIV(obj);
1537 if (v >= 0) {
1538 if (val) *val = v;
1539 return SWIG_OK;
1540 } else {
1541 return SWIG_OverflowError;
1543 } else {
1544 int dispatch = 0;
1545 const char *nptr = SvPV(obj, PL_na);
1546 if (nptr) {
1547 char *endptr;
1548 unsigned long v = strtoul(nptr, &endptr,0);
1549 if (errno == ERANGE) {
1550 errno = 0;
1551 return SWIG_OverflowError;
1552 } else {
1553 if (*endptr == '\0') {
1554 if (val) *val = v;
1555 return SWIG_Str2NumCast(SWIG_OK);
1559 if (!dispatch) {
1560 double d;
1561 int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1562 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
1563 if (val) *val = (unsigned long)(d);
1564 return res;
1568 return SWIG_TypeError;
1572 SWIGINTERN int
1573 SWIG_AsVal_unsigned_SS_int SWIG_PERL_DECL_ARGS_2(SV * obj, unsigned int *val)
1575 unsigned long v;
1576 int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1577 if (SWIG_IsOK(res)) {
1578 if ((v > UINT_MAX)) {
1579 return SWIG_OverflowError;
1580 } else {
1581 if (val) *val = (unsigned int)(v);
1584 return res;
1588 SWIGINTERNINLINE SV *
1589 SWIG_From_unsigned_SS_long SWIG_PERL_DECL_ARGS_1(unsigned long value)
1591 SV *obj = sv_newmortal();
1592 sv_setuv(obj, (UV) value);
1593 return obj;
1597 SWIGINTERNINLINE SV *
1598 SWIG_From_unsigned_SS_int SWIG_PERL_DECL_ARGS_1(unsigned int value)
1600 return SWIG_From_unsigned_SS_long SWIG_PERL_CALL_ARGS_1(value);
1604 SWIGINTERNINLINE SV *
1605 SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
1607 SV *obj = sv_newmortal();
1608 sv_setiv(obj, (IV) value);
1609 return obj;
1613 SWIGINTERNINLINE SV *
1614 SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value)
1616 return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
1620 SWIGINTERN swig_type_info*
1621 SWIG_pchar_descriptor(void)
1623 static int init = 0;
1624 static swig_type_info* info = 0;
1625 if (!init) {
1626 info = SWIG_TypeQuery("_p_char");
1627 init = 1;
1629 return info;
1633 SWIGINTERN int
1634 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1636 if (SvPOK(obj)) {
1637 STRLEN len = 0;
1638 char *cstr = SvPV(obj, len);
1639 size_t size = len + 1;
1640 if (cptr) {
1641 if (alloc) {
1642 if (*alloc == SWIG_NEWOBJ) {
1643 *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1644 } else {
1645 *cptr = cstr;
1646 *alloc = SWIG_OLDOBJ;
1650 if (psize) *psize = size;
1651 return SWIG_OK;
1652 } else {
1653 swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1654 if (pchar_descriptor) {
1655 char* vptr = 0;
1656 if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1657 if (cptr) *cptr = vptr;
1658 if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1659 if (alloc) *alloc = SWIG_OLDOBJ;
1660 return SWIG_OK;
1664 return SWIG_TypeError;
1671 SWIGINTERNINLINE SV *
1672 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1674 SV *obj = sv_newmortal();
1675 if (carray) {
1676 if (size && (carray[size - 1] == 0)) {
1677 sv_setpv(obj, carray);
1678 } else {
1679 char *tmp = (char *)malloc((size + 1)*sizeof(char));
1680 memcpy(tmp, carray, size);
1681 tmp[size] = 0;
1682 sv_setpv(obj, tmp);
1683 free((char*)tmp);
1685 } else {
1686 sv_setsv(obj, &PL_sv_undef);
1688 return obj;
1692 SWIGINTERNINLINE SV *
1693 SWIG_FromCharPtr(const char *cptr)
1695 return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1699 SWIGINTERN int
1700 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
1702 if (SvIOK(obj)) {
1703 if (val) *val = SvIV(obj);
1704 return SWIG_OK;
1705 } else {
1706 int dispatch = 0;
1707 const char *nptr = SvPV(obj, PL_na);
1708 if (nptr) {
1709 char *endptr;
1710 long v = strtol(nptr, &endptr,0);
1711 if (errno == ERANGE) {
1712 errno = 0;
1713 return SWIG_OverflowError;
1714 } else {
1715 if (*endptr == '\0') {
1716 if (val) *val = v;
1717 return SWIG_Str2NumCast(SWIG_OK);
1721 if (!dispatch) {
1722 double d;
1723 int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1724 if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
1725 if (val) *val = (long)(d);
1726 return res;
1730 return SWIG_TypeError;
1734 SWIGINTERN int
1735 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
1737 long v;
1738 int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1739 if (SWIG_IsOK(res)) {
1740 if ((v < INT_MIN || v > INT_MAX)) {
1741 return SWIG_OverflowError;
1742 } else {
1743 if (val) *val = (int)(v);
1746 return res;
1750 SWIGINTERNINLINE int
1751 SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
1753 unsigned long v;
1754 int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
1755 if (SWIG_IsOK(res) && val) *val = (size_t)(v);
1756 return res;
1759 #ifdef PERL_OBJECT
1760 #define MAGIC_CLASS _wrap_netpgpperl_var::
1761 class _wrap_netpgpperl_var : public CPerlObj {
1762 public:
1763 #else
1764 #define MAGIC_CLASS
1765 #endif
1766 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
1767 MAGIC_PPERL
1768 croak("Value is read-only.");
1769 return 0;
1773 #ifdef PERL_OBJECT
1775 #endif
1777 #ifdef __cplusplus
1778 extern "C" {
1779 #endif
1780 XS(_wrap_netpgp_t_c_set) {
1782 netpgp_t *arg1 = (netpgp_t *) 0 ;
1783 unsigned int arg2 ;
1784 void *argp1 = 0 ;
1785 int res1 = 0 ;
1786 unsigned int val2 ;
1787 int ecode2 = 0 ;
1788 int argvi = 0;
1789 dXSARGS;
1791 if ((items < 2) || (items > 2)) {
1792 SWIG_croak("Usage: netpgp_t_c_set(self,c);");
1794 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1795 if (!SWIG_IsOK(res1)) {
1796 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_c_set" "', argument " "1"" of type '" "netpgp_t *""'");
1798 arg1 = (netpgp_t *)(argp1);
1799 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
1800 if (!SWIG_IsOK(ecode2)) {
1801 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "netpgp_t_c_set" "', argument " "2"" of type '" "unsigned int""'");
1803 arg2 = (unsigned int)(val2);
1804 if (arg1) (arg1)->c = arg2;
1809 XSRETURN(argvi);
1810 fail:
1813 SWIG_croak_null();
1818 XS(_wrap_netpgp_t_c_get) {
1820 netpgp_t *arg1 = (netpgp_t *) 0 ;
1821 unsigned int result;
1822 void *argp1 = 0 ;
1823 int res1 = 0 ;
1824 int argvi = 0;
1825 dXSARGS;
1827 if ((items < 1) || (items > 1)) {
1828 SWIG_croak("Usage: netpgp_t_c_get(self);");
1830 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1831 if (!SWIG_IsOK(res1)) {
1832 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_c_get" "', argument " "1"" of type '" "netpgp_t *""'");
1834 arg1 = (netpgp_t *)(argp1);
1835 result = (unsigned int) ((arg1)->c);
1836 ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1((unsigned int)(result)); argvi++ ;
1838 XSRETURN(argvi);
1839 fail:
1841 SWIG_croak_null();
1846 XS(_wrap_netpgp_t_size_set) {
1848 netpgp_t *arg1 = (netpgp_t *) 0 ;
1849 unsigned int arg2 ;
1850 void *argp1 = 0 ;
1851 int res1 = 0 ;
1852 unsigned int val2 ;
1853 int ecode2 = 0 ;
1854 int argvi = 0;
1855 dXSARGS;
1857 if ((items < 2) || (items > 2)) {
1858 SWIG_croak("Usage: netpgp_t_size_set(self,size);");
1860 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1861 if (!SWIG_IsOK(res1)) {
1862 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_size_set" "', argument " "1"" of type '" "netpgp_t *""'");
1864 arg1 = (netpgp_t *)(argp1);
1865 ecode2 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(1), &val2);
1866 if (!SWIG_IsOK(ecode2)) {
1867 SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "netpgp_t_size_set" "', argument " "2"" of type '" "unsigned int""'");
1869 arg2 = (unsigned int)(val2);
1870 if (arg1) (arg1)->size = arg2;
1875 XSRETURN(argvi);
1876 fail:
1879 SWIG_croak_null();
1884 XS(_wrap_netpgp_t_size_get) {
1886 netpgp_t *arg1 = (netpgp_t *) 0 ;
1887 unsigned int result;
1888 void *argp1 = 0 ;
1889 int res1 = 0 ;
1890 int argvi = 0;
1891 dXSARGS;
1893 if ((items < 1) || (items > 1)) {
1894 SWIG_croak("Usage: netpgp_t_size_get(self);");
1896 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1897 if (!SWIG_IsOK(res1)) {
1898 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_size_get" "', argument " "1"" of type '" "netpgp_t *""'");
1900 arg1 = (netpgp_t *)(argp1);
1901 result = (unsigned int) ((arg1)->size);
1902 ST(argvi) = SWIG_From_unsigned_SS_int SWIG_PERL_CALL_ARGS_1((unsigned int)(result)); argvi++ ;
1904 XSRETURN(argvi);
1905 fail:
1907 SWIG_croak_null();
1912 XS(_wrap_netpgp_t_name_set) {
1914 netpgp_t *arg1 = (netpgp_t *) 0 ;
1915 char **arg2 = (char **) 0 ;
1916 void *argp1 = 0 ;
1917 int res1 = 0 ;
1918 void *argp2 = 0 ;
1919 int res2 = 0 ;
1920 int argvi = 0;
1921 dXSARGS;
1923 if ((items < 2) || (items > 2)) {
1924 SWIG_croak("Usage: netpgp_t_name_set(self,name);");
1926 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1927 if (!SWIG_IsOK(res1)) {
1928 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_name_set" "', argument " "1"" of type '" "netpgp_t *""'");
1930 arg1 = (netpgp_t *)(argp1);
1931 res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_p_char, 0 | 0 );
1932 if (!SWIG_IsOK(res2)) {
1933 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_name_set" "', argument " "2"" of type '" "char **""'");
1935 arg2 = (char **)(argp2);
1936 if (arg1) (arg1)->name = arg2;
1941 XSRETURN(argvi);
1942 fail:
1945 SWIG_croak_null();
1950 XS(_wrap_netpgp_t_name_get) {
1952 netpgp_t *arg1 = (netpgp_t *) 0 ;
1953 char **result = 0 ;
1954 void *argp1 = 0 ;
1955 int res1 = 0 ;
1956 int argvi = 0;
1957 dXSARGS;
1959 if ((items < 1) || (items > 1)) {
1960 SWIG_croak("Usage: netpgp_t_name_get(self);");
1962 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1963 if (!SWIG_IsOK(res1)) {
1964 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_name_get" "', argument " "1"" of type '" "netpgp_t *""'");
1966 arg1 = (netpgp_t *)(argp1);
1967 result = (char **) ((arg1)->name);
1968 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ;
1970 XSRETURN(argvi);
1971 fail:
1973 SWIG_croak_null();
1978 XS(_wrap_netpgp_t_value_set) {
1980 netpgp_t *arg1 = (netpgp_t *) 0 ;
1981 char **arg2 = (char **) 0 ;
1982 void *argp1 = 0 ;
1983 int res1 = 0 ;
1984 void *argp2 = 0 ;
1985 int res2 = 0 ;
1986 int argvi = 0;
1987 dXSARGS;
1989 if ((items < 2) || (items > 2)) {
1990 SWIG_croak("Usage: netpgp_t_value_set(self,value);");
1992 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
1993 if (!SWIG_IsOK(res1)) {
1994 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_value_set" "', argument " "1"" of type '" "netpgp_t *""'");
1996 arg1 = (netpgp_t *)(argp1);
1997 res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_p_char, 0 | 0 );
1998 if (!SWIG_IsOK(res2)) {
1999 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_value_set" "', argument " "2"" of type '" "char **""'");
2001 arg2 = (char **)(argp2);
2002 if (arg1) (arg1)->value = arg2;
2007 XSRETURN(argvi);
2008 fail:
2011 SWIG_croak_null();
2016 XS(_wrap_netpgp_t_value_get) {
2018 netpgp_t *arg1 = (netpgp_t *) 0 ;
2019 char **result = 0 ;
2020 void *argp1 = 0 ;
2021 int res1 = 0 ;
2022 int argvi = 0;
2023 dXSARGS;
2025 if ((items < 1) || (items > 1)) {
2026 SWIG_croak("Usage: netpgp_t_value_get(self);");
2028 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2029 if (!SWIG_IsOK(res1)) {
2030 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_value_get" "', argument " "1"" of type '" "netpgp_t *""'");
2032 arg1 = (netpgp_t *)(argp1);
2033 result = (char **) ((arg1)->value);
2034 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0); argvi++ ;
2036 XSRETURN(argvi);
2037 fail:
2039 SWIG_croak_null();
2044 XS(_wrap_netpgp_t_pubring_set) {
2046 netpgp_t *arg1 = (netpgp_t *) 0 ;
2047 void *arg2 = (void *) 0 ;
2048 void *argp1 = 0 ;
2049 int res1 = 0 ;
2050 int res2 ;
2051 int argvi = 0;
2052 dXSARGS;
2054 if ((items < 2) || (items > 2)) {
2055 SWIG_croak("Usage: netpgp_t_pubring_set(self,pubring);");
2057 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2058 if (!SWIG_IsOK(res1)) {
2059 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_pubring_set" "', argument " "1"" of type '" "netpgp_t *""'");
2061 arg1 = (netpgp_t *)(argp1);
2062 res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
2063 if (!SWIG_IsOK(res2)) {
2064 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_pubring_set" "', argument " "2"" of type '" "void *""'");
2066 if (arg1) (arg1)->pubring = arg2;
2071 XSRETURN(argvi);
2072 fail:
2075 SWIG_croak_null();
2080 XS(_wrap_netpgp_t_pubring_get) {
2082 netpgp_t *arg1 = (netpgp_t *) 0 ;
2083 void *result = 0 ;
2084 void *argp1 = 0 ;
2085 int res1 = 0 ;
2086 int argvi = 0;
2087 dXSARGS;
2089 if ((items < 1) || (items > 1)) {
2090 SWIG_croak("Usage: netpgp_t_pubring_get(self);");
2092 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2093 if (!SWIG_IsOK(res1)) {
2094 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_pubring_get" "', argument " "1"" of type '" "netpgp_t *""'");
2096 arg1 = (netpgp_t *)(argp1);
2097 result = (void *) ((arg1)->pubring);
2098 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
2100 XSRETURN(argvi);
2101 fail:
2103 SWIG_croak_null();
2108 XS(_wrap_netpgp_t_secring_set) {
2110 netpgp_t *arg1 = (netpgp_t *) 0 ;
2111 void *arg2 = (void *) 0 ;
2112 void *argp1 = 0 ;
2113 int res1 = 0 ;
2114 int res2 ;
2115 int argvi = 0;
2116 dXSARGS;
2118 if ((items < 2) || (items > 2)) {
2119 SWIG_croak("Usage: netpgp_t_secring_set(self,secring);");
2121 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2122 if (!SWIG_IsOK(res1)) {
2123 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_secring_set" "', argument " "1"" of type '" "netpgp_t *""'");
2125 arg1 = (netpgp_t *)(argp1);
2126 res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
2127 if (!SWIG_IsOK(res2)) {
2128 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_secring_set" "', argument " "2"" of type '" "void *""'");
2130 if (arg1) (arg1)->secring = arg2;
2135 XSRETURN(argvi);
2136 fail:
2139 SWIG_croak_null();
2144 XS(_wrap_netpgp_t_secring_get) {
2146 netpgp_t *arg1 = (netpgp_t *) 0 ;
2147 void *result = 0 ;
2148 void *argp1 = 0 ;
2149 int res1 = 0 ;
2150 int argvi = 0;
2151 dXSARGS;
2153 if ((items < 1) || (items > 1)) {
2154 SWIG_croak("Usage: netpgp_t_secring_get(self);");
2156 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2157 if (!SWIG_IsOK(res1)) {
2158 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_secring_get" "', argument " "1"" of type '" "netpgp_t *""'");
2160 arg1 = (netpgp_t *)(argp1);
2161 result = (void *) ((arg1)->secring);
2162 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
2164 XSRETURN(argvi);
2165 fail:
2167 SWIG_croak_null();
2172 XS(_wrap_netpgp_t_io_set) {
2174 netpgp_t *arg1 = (netpgp_t *) 0 ;
2175 void *arg2 = (void *) 0 ;
2176 void *argp1 = 0 ;
2177 int res1 = 0 ;
2178 int res2 ;
2179 int argvi = 0;
2180 dXSARGS;
2182 if ((items < 2) || (items > 2)) {
2183 SWIG_croak("Usage: netpgp_t_io_set(self,io);");
2185 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2186 if (!SWIG_IsOK(res1)) {
2187 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_io_set" "', argument " "1"" of type '" "netpgp_t *""'");
2189 arg1 = (netpgp_t *)(argp1);
2190 res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
2191 if (!SWIG_IsOK(res2)) {
2192 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_io_set" "', argument " "2"" of type '" "void *""'");
2194 if (arg1) (arg1)->io = arg2;
2199 XSRETURN(argvi);
2200 fail:
2203 SWIG_croak_null();
2208 XS(_wrap_netpgp_t_io_get) {
2210 netpgp_t *arg1 = (netpgp_t *) 0 ;
2211 void *result = 0 ;
2212 void *argp1 = 0 ;
2213 int res1 = 0 ;
2214 int argvi = 0;
2215 dXSARGS;
2217 if ((items < 1) || (items > 1)) {
2218 SWIG_croak("Usage: netpgp_t_io_get(self);");
2220 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2221 if (!SWIG_IsOK(res1)) {
2222 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_io_get" "', argument " "1"" of type '" "netpgp_t *""'");
2224 arg1 = (netpgp_t *)(argp1);
2225 result = (void *) ((arg1)->io);
2226 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
2228 XSRETURN(argvi);
2229 fail:
2231 SWIG_croak_null();
2236 XS(_wrap_netpgp_t_passfp_set) {
2238 netpgp_t *arg1 = (netpgp_t *) 0 ;
2239 void *arg2 = (void *) 0 ;
2240 void *argp1 = 0 ;
2241 int res1 = 0 ;
2242 int res2 ;
2243 int argvi = 0;
2244 dXSARGS;
2246 if ((items < 2) || (items > 2)) {
2247 SWIG_croak("Usage: netpgp_t_passfp_set(self,passfp);");
2249 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2250 if (!SWIG_IsOK(res1)) {
2251 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_passfp_set" "', argument " "1"" of type '" "netpgp_t *""'");
2253 arg1 = (netpgp_t *)(argp1);
2254 res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, SWIG_POINTER_DISOWN);
2255 if (!SWIG_IsOK(res2)) {
2256 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_t_passfp_set" "', argument " "2"" of type '" "void *""'");
2258 if (arg1) (arg1)->passfp = arg2;
2263 XSRETURN(argvi);
2264 fail:
2267 SWIG_croak_null();
2272 XS(_wrap_netpgp_t_passfp_get) {
2274 netpgp_t *arg1 = (netpgp_t *) 0 ;
2275 void *result = 0 ;
2276 void *argp1 = 0 ;
2277 int res1 = 0 ;
2278 int argvi = 0;
2279 dXSARGS;
2281 if ((items < 1) || (items > 1)) {
2282 SWIG_croak("Usage: netpgp_t_passfp_get(self);");
2284 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2285 if (!SWIG_IsOK(res1)) {
2286 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_t_passfp_get" "', argument " "1"" of type '" "netpgp_t *""'");
2288 arg1 = (netpgp_t *)(argp1);
2289 result = (void *) ((arg1)->passfp);
2290 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0); argvi++ ;
2292 XSRETURN(argvi);
2293 fail:
2295 SWIG_croak_null();
2300 XS(_wrap_new_netpgp_t) {
2302 netpgp_t *result = 0 ;
2303 int argvi = 0;
2304 dXSARGS;
2306 if ((items < 0) || (items > 0)) {
2307 SWIG_croak("Usage: new_netpgp_t();");
2309 result = (netpgp_t *)(netpgp_t *) calloc(1, sizeof(netpgp_t));
2310 ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_netpgp_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2311 XSRETURN(argvi);
2312 fail:
2313 SWIG_croak_null();
2318 XS(_wrap_delete_netpgp_t) {
2320 netpgp_t *arg1 = (netpgp_t *) 0 ;
2321 void *argp1 = 0 ;
2322 int res1 = 0 ;
2323 int argvi = 0;
2324 dXSARGS;
2326 if ((items < 1) || (items > 1)) {
2327 SWIG_croak("Usage: delete_netpgp_t(self);");
2329 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, SWIG_POINTER_DISOWN | 0 );
2330 if (!SWIG_IsOK(res1)) {
2331 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_netpgp_t" "', argument " "1"" of type '" "netpgp_t *""'");
2333 arg1 = (netpgp_t *)(argp1);
2334 free((char *) arg1);
2338 XSRETURN(argvi);
2339 fail:
2341 SWIG_croak_null();
2346 XS(_wrap_netpgp_init) {
2348 netpgp_t *arg1 = (netpgp_t *) 0 ;
2349 int result;
2350 void *argp1 = 0 ;
2351 int res1 = 0 ;
2352 int argvi = 0;
2353 dXSARGS;
2355 if ((items < 1) || (items > 1)) {
2356 SWIG_croak("Usage: netpgp_init(netpgp_t *);");
2358 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2359 if (!SWIG_IsOK(res1)) {
2360 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_init" "', argument " "1"" of type '" "netpgp_t *""'");
2362 arg1 = (netpgp_t *)(argp1);
2363 result = (int)netpgp_init(arg1);
2364 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2366 XSRETURN(argvi);
2367 fail:
2369 SWIG_croak_null();
2374 XS(_wrap_netpgp_end) {
2376 netpgp_t *arg1 = (netpgp_t *) 0 ;
2377 int result;
2378 void *argp1 = 0 ;
2379 int res1 = 0 ;
2380 int argvi = 0;
2381 dXSARGS;
2383 if ((items < 1) || (items > 1)) {
2384 SWIG_croak("Usage: netpgp_end(netpgp_t *);");
2386 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2387 if (!SWIG_IsOK(res1)) {
2388 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_end" "', argument " "1"" of type '" "netpgp_t *""'");
2390 arg1 = (netpgp_t *)(argp1);
2391 result = (int)netpgp_end(arg1);
2392 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2394 XSRETURN(argvi);
2395 fail:
2397 SWIG_croak_null();
2402 XS(_wrap_netpgp_set_debug) {
2404 char *arg1 = (char *) 0 ;
2405 int result;
2406 int res1 ;
2407 char *buf1 = 0 ;
2408 int alloc1 = 0 ;
2409 int argvi = 0;
2410 dXSARGS;
2412 if ((items < 1) || (items > 1)) {
2413 SWIG_croak("Usage: netpgp_set_debug(char const *);");
2415 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2416 if (!SWIG_IsOK(res1)) {
2417 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_set_debug" "', argument " "1"" of type '" "char const *""'");
2419 arg1 = (char *)(buf1);
2420 result = (int)netpgp_set_debug((char const *)arg1);
2421 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2422 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2423 XSRETURN(argvi);
2424 fail:
2425 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2426 SWIG_croak_null();
2431 XS(_wrap_netpgp_get_debug) {
2433 char *arg1 = (char *) 0 ;
2434 int result;
2435 int res1 ;
2436 char *buf1 = 0 ;
2437 int alloc1 = 0 ;
2438 int argvi = 0;
2439 dXSARGS;
2441 if ((items < 1) || (items > 1)) {
2442 SWIG_croak("Usage: netpgp_get_debug(char const *);");
2444 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2445 if (!SWIG_IsOK(res1)) {
2446 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_get_debug" "', argument " "1"" of type '" "char const *""'");
2448 arg1 = (char *)(buf1);
2449 result = (int)netpgp_get_debug((char const *)arg1);
2450 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2451 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2452 XSRETURN(argvi);
2453 fail:
2454 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2455 SWIG_croak_null();
2460 XS(_wrap_netpgp_get_info) {
2462 char *arg1 = (char *) 0 ;
2463 char *result = 0 ;
2464 int res1 ;
2465 char *buf1 = 0 ;
2466 int alloc1 = 0 ;
2467 int argvi = 0;
2468 dXSARGS;
2470 if ((items < 1) || (items > 1)) {
2471 SWIG_croak("Usage: netpgp_get_info(char const *);");
2473 res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2474 if (!SWIG_IsOK(res1)) {
2475 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_get_info" "', argument " "1"" of type '" "char const *""'");
2477 arg1 = (char *)(buf1);
2478 result = (char *)netpgp_get_info((char const *)arg1);
2479 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2480 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2481 XSRETURN(argvi);
2482 fail:
2483 if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2484 SWIG_croak_null();
2489 XS(_wrap_netpgp_list_packets) {
2491 netpgp_t *arg1 = (netpgp_t *) 0 ;
2492 char *arg2 = (char *) 0 ;
2493 int arg3 ;
2494 char *arg4 = (char *) 0 ;
2495 int result;
2496 void *argp1 = 0 ;
2497 int res1 = 0 ;
2498 int res2 ;
2499 char *buf2 = 0 ;
2500 int alloc2 = 0 ;
2501 int val3 ;
2502 int ecode3 = 0 ;
2503 int res4 ;
2504 char *buf4 = 0 ;
2505 int alloc4 = 0 ;
2506 int argvi = 0;
2507 dXSARGS;
2509 if ((items < 4) || (items > 4)) {
2510 SWIG_croak("Usage: netpgp_list_packets(netpgp_t *,char *,int,char *);");
2512 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2513 if (!SWIG_IsOK(res1)) {
2514 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_packets" "', argument " "1"" of type '" "netpgp_t *""'");
2516 arg1 = (netpgp_t *)(argp1);
2517 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2518 if (!SWIG_IsOK(res2)) {
2519 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_list_packets" "', argument " "2"" of type '" "char *""'");
2521 arg2 = (char *)(buf2);
2522 ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
2523 if (!SWIG_IsOK(ecode3)) {
2524 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_list_packets" "', argument " "3"" of type '" "int""'");
2526 arg3 = (int)(val3);
2527 res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
2528 if (!SWIG_IsOK(res4)) {
2529 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "netpgp_list_packets" "', argument " "4"" of type '" "char *""'");
2531 arg4 = (char *)(buf4);
2532 result = (int)netpgp_list_packets(arg1,arg2,arg3,arg4);
2533 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2535 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2537 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2538 XSRETURN(argvi);
2539 fail:
2541 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2543 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2544 SWIG_croak_null();
2549 XS(_wrap_netpgp_setvar) {
2551 netpgp_t *arg1 = (netpgp_t *) 0 ;
2552 char *arg2 = (char *) 0 ;
2553 char *arg3 = (char *) 0 ;
2554 int result;
2555 void *argp1 = 0 ;
2556 int res1 = 0 ;
2557 int res2 ;
2558 char *buf2 = 0 ;
2559 int alloc2 = 0 ;
2560 int res3 ;
2561 char *buf3 = 0 ;
2562 int alloc3 = 0 ;
2563 int argvi = 0;
2564 dXSARGS;
2566 if ((items < 3) || (items > 3)) {
2567 SWIG_croak("Usage: netpgp_setvar(netpgp_t *,char const *,char const *);");
2569 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2570 if (!SWIG_IsOK(res1)) {
2571 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_setvar" "', argument " "1"" of type '" "netpgp_t *""'");
2573 arg1 = (netpgp_t *)(argp1);
2574 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2575 if (!SWIG_IsOK(res2)) {
2576 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_setvar" "', argument " "2"" of type '" "char const *""'");
2578 arg2 = (char *)(buf2);
2579 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
2580 if (!SWIG_IsOK(res3)) {
2581 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_setvar" "', argument " "3"" of type '" "char const *""'");
2583 arg3 = (char *)(buf3);
2584 result = (int)netpgp_setvar(arg1,(char const *)arg2,(char const *)arg3);
2585 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2587 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2588 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2589 XSRETURN(argvi);
2590 fail:
2592 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2593 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2594 SWIG_croak_null();
2599 XS(_wrap_netpgp_getvar) {
2601 netpgp_t *arg1 = (netpgp_t *) 0 ;
2602 char *arg2 = (char *) 0 ;
2603 char *result = 0 ;
2604 void *argp1 = 0 ;
2605 int res1 = 0 ;
2606 int res2 ;
2607 char *buf2 = 0 ;
2608 int alloc2 = 0 ;
2609 int argvi = 0;
2610 dXSARGS;
2612 if ((items < 2) || (items > 2)) {
2613 SWIG_croak("Usage: netpgp_getvar(netpgp_t *,char const *);");
2615 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2616 if (!SWIG_IsOK(res1)) {
2617 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_getvar" "', argument " "1"" of type '" "netpgp_t *""'");
2619 arg1 = (netpgp_t *)(argp1);
2620 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2621 if (!SWIG_IsOK(res2)) {
2622 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_getvar" "', argument " "2"" of type '" "char const *""'");
2624 arg2 = (char *)(buf2);
2625 result = (char *)netpgp_getvar(arg1,(char const *)arg2);
2626 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2628 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2629 XSRETURN(argvi);
2630 fail:
2632 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2633 SWIG_croak_null();
2638 XS(_wrap_netpgp_list_keys) {
2640 netpgp_t *arg1 = (netpgp_t *) 0 ;
2641 int result;
2642 void *argp1 = 0 ;
2643 int res1 = 0 ;
2644 int argvi = 0;
2645 dXSARGS;
2647 if ((items < 1) || (items > 1)) {
2648 SWIG_croak("Usage: netpgp_list_keys(netpgp_t *);");
2650 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2651 if (!SWIG_IsOK(res1)) {
2652 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_keys" "', argument " "1"" of type '" "netpgp_t *""'");
2654 arg1 = (netpgp_t *)(argp1);
2655 result = (int)netpgp_list_keys(arg1);
2656 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2658 XSRETURN(argvi);
2659 fail:
2661 SWIG_croak_null();
2666 XS(_wrap_netpgp_list_sigs) {
2668 netpgp_t *arg1 = (netpgp_t *) 0 ;
2669 char *arg2 = (char *) 0 ;
2670 int result;
2671 void *argp1 = 0 ;
2672 int res1 = 0 ;
2673 int res2 ;
2674 char *buf2 = 0 ;
2675 int alloc2 = 0 ;
2676 int argvi = 0;
2677 dXSARGS;
2679 if ((items < 2) || (items > 2)) {
2680 SWIG_croak("Usage: netpgp_list_sigs(netpgp_t *,char const *);");
2682 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2683 if (!SWIG_IsOK(res1)) {
2684 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_list_sigs" "', argument " "1"" of type '" "netpgp_t *""'");
2686 arg1 = (netpgp_t *)(argp1);
2687 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2688 if (!SWIG_IsOK(res2)) {
2689 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_list_sigs" "', argument " "2"" of type '" "char const *""'");
2691 arg2 = (char *)(buf2);
2692 result = (int)netpgp_list_sigs(arg1,(char const *)arg2);
2693 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2695 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2696 XSRETURN(argvi);
2697 fail:
2699 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2700 SWIG_croak_null();
2705 XS(_wrap_netpgp_find_key) {
2707 netpgp_t *arg1 = (netpgp_t *) 0 ;
2708 char *arg2 = (char *) 0 ;
2709 int result;
2710 void *argp1 = 0 ;
2711 int res1 = 0 ;
2712 int res2 ;
2713 char *buf2 = 0 ;
2714 int alloc2 = 0 ;
2715 int argvi = 0;
2716 dXSARGS;
2718 if ((items < 2) || (items > 2)) {
2719 SWIG_croak("Usage: netpgp_find_key(netpgp_t *,char *);");
2721 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2722 if (!SWIG_IsOK(res1)) {
2723 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_find_key" "', argument " "1"" of type '" "netpgp_t *""'");
2725 arg1 = (netpgp_t *)(argp1);
2726 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2727 if (!SWIG_IsOK(res2)) {
2728 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_find_key" "', argument " "2"" of type '" "char *""'");
2730 arg2 = (char *)(buf2);
2731 result = (int)netpgp_find_key(arg1,arg2);
2732 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2734 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2735 XSRETURN(argvi);
2736 fail:
2738 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2739 SWIG_croak_null();
2744 XS(_wrap_netpgp_get_key) {
2746 netpgp_t *arg1 = (netpgp_t *) 0 ;
2747 char *arg2 = (char *) 0 ;
2748 char *result = 0 ;
2749 void *argp1 = 0 ;
2750 int res1 = 0 ;
2751 int res2 ;
2752 char *buf2 = 0 ;
2753 int alloc2 = 0 ;
2754 int argvi = 0;
2755 dXSARGS;
2757 if ((items < 2) || (items > 2)) {
2758 SWIG_croak("Usage: netpgp_get_key(netpgp_t *,char const *);");
2760 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2761 if (!SWIG_IsOK(res1)) {
2762 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_get_key" "', argument " "1"" of type '" "netpgp_t *""'");
2764 arg1 = (netpgp_t *)(argp1);
2765 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2766 if (!SWIG_IsOK(res2)) {
2767 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_get_key" "', argument " "2"" of type '" "char const *""'");
2769 arg2 = (char *)(buf2);
2770 result = (char *)netpgp_get_key(arg1,(char const *)arg2);
2771 ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2773 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2774 XSRETURN(argvi);
2775 fail:
2777 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2778 SWIG_croak_null();
2783 XS(_wrap_netpgp_export_key) {
2785 netpgp_t *arg1 = (netpgp_t *) 0 ;
2786 char *arg2 = (char *) 0 ;
2787 int result;
2788 void *argp1 = 0 ;
2789 int res1 = 0 ;
2790 int res2 ;
2791 char *buf2 = 0 ;
2792 int alloc2 = 0 ;
2793 int argvi = 0;
2794 dXSARGS;
2796 if ((items < 2) || (items > 2)) {
2797 SWIG_croak("Usage: netpgp_export_key(netpgp_t *,char *);");
2799 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2800 if (!SWIG_IsOK(res1)) {
2801 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_export_key" "', argument " "1"" of type '" "netpgp_t *""'");
2803 arg1 = (netpgp_t *)(argp1);
2804 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2805 if (!SWIG_IsOK(res2)) {
2806 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_export_key" "', argument " "2"" of type '" "char *""'");
2808 arg2 = (char *)(buf2);
2809 result = (int)netpgp_export_key(arg1,arg2);
2810 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2812 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2813 XSRETURN(argvi);
2814 fail:
2816 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2817 SWIG_croak_null();
2822 XS(_wrap_netpgp_import_key) {
2824 netpgp_t *arg1 = (netpgp_t *) 0 ;
2825 char *arg2 = (char *) 0 ;
2826 int result;
2827 void *argp1 = 0 ;
2828 int res1 = 0 ;
2829 int res2 ;
2830 char *buf2 = 0 ;
2831 int alloc2 = 0 ;
2832 int argvi = 0;
2833 dXSARGS;
2835 if ((items < 2) || (items > 2)) {
2836 SWIG_croak("Usage: netpgp_import_key(netpgp_t *,char *);");
2838 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2839 if (!SWIG_IsOK(res1)) {
2840 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_import_key" "', argument " "1"" of type '" "netpgp_t *""'");
2842 arg1 = (netpgp_t *)(argp1);
2843 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2844 if (!SWIG_IsOK(res2)) {
2845 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_import_key" "', argument " "2"" of type '" "char *""'");
2847 arg2 = (char *)(buf2);
2848 result = (int)netpgp_import_key(arg1,arg2);
2849 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2851 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2852 XSRETURN(argvi);
2853 fail:
2855 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2856 SWIG_croak_null();
2861 XS(_wrap_netpgp_generate_key) {
2863 netpgp_t *arg1 = (netpgp_t *) 0 ;
2864 char *arg2 = (char *) 0 ;
2865 int arg3 ;
2866 int result;
2867 void *argp1 = 0 ;
2868 int res1 = 0 ;
2869 int res2 ;
2870 char *buf2 = 0 ;
2871 int alloc2 = 0 ;
2872 int val3 ;
2873 int ecode3 = 0 ;
2874 int argvi = 0;
2875 dXSARGS;
2877 if ((items < 3) || (items > 3)) {
2878 SWIG_croak("Usage: netpgp_generate_key(netpgp_t *,char *,int);");
2880 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2881 if (!SWIG_IsOK(res1)) {
2882 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_generate_key" "', argument " "1"" of type '" "netpgp_t *""'");
2884 arg1 = (netpgp_t *)(argp1);
2885 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2886 if (!SWIG_IsOK(res2)) {
2887 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_generate_key" "', argument " "2"" of type '" "char *""'");
2889 arg2 = (char *)(buf2);
2890 ecode3 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
2891 if (!SWIG_IsOK(ecode3)) {
2892 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_generate_key" "', argument " "3"" of type '" "int""'");
2894 arg3 = (int)(val3);
2895 result = (int)netpgp_generate_key(arg1,arg2,arg3);
2896 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2898 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2900 XSRETURN(argvi);
2901 fail:
2903 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2905 SWIG_croak_null();
2910 XS(_wrap_netpgp_encrypt_file) {
2912 netpgp_t *arg1 = (netpgp_t *) 0 ;
2913 char *arg2 = (char *) 0 ;
2914 char *arg3 = (char *) 0 ;
2915 char *arg4 = (char *) 0 ;
2916 int arg5 ;
2917 int result;
2918 void *argp1 = 0 ;
2919 int res1 = 0 ;
2920 int res2 ;
2921 char *buf2 = 0 ;
2922 int alloc2 = 0 ;
2923 int res3 ;
2924 char *buf3 = 0 ;
2925 int alloc3 = 0 ;
2926 int res4 ;
2927 char *buf4 = 0 ;
2928 int alloc4 = 0 ;
2929 int val5 ;
2930 int ecode5 = 0 ;
2931 int argvi = 0;
2932 dXSARGS;
2934 if ((items < 5) || (items > 5)) {
2935 SWIG_croak("Usage: netpgp_encrypt_file(netpgp_t *,char const *,char const *,char *,int);");
2937 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
2938 if (!SWIG_IsOK(res1)) {
2939 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_encrypt_file" "', argument " "1"" of type '" "netpgp_t *""'");
2941 arg1 = (netpgp_t *)(argp1);
2942 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
2943 if (!SWIG_IsOK(res2)) {
2944 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_encrypt_file" "', argument " "2"" of type '" "char const *""'");
2946 arg2 = (char *)(buf2);
2947 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
2948 if (!SWIG_IsOK(res3)) {
2949 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_encrypt_file" "', argument " "3"" of type '" "char const *""'");
2951 arg3 = (char *)(buf3);
2952 res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
2953 if (!SWIG_IsOK(res4)) {
2954 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "netpgp_encrypt_file" "', argument " "4"" of type '" "char *""'");
2956 arg4 = (char *)(buf4);
2957 ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
2958 if (!SWIG_IsOK(ecode5)) {
2959 SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "netpgp_encrypt_file" "', argument " "5"" of type '" "int""'");
2961 arg5 = (int)(val5);
2962 result = (int)netpgp_encrypt_file(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5);
2963 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
2965 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2966 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2967 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2969 XSRETURN(argvi);
2970 fail:
2972 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2973 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2974 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2976 SWIG_croak_null();
2981 XS(_wrap_netpgp_decrypt_file) {
2983 netpgp_t *arg1 = (netpgp_t *) 0 ;
2984 char *arg2 = (char *) 0 ;
2985 char *arg3 = (char *) 0 ;
2986 int arg4 ;
2987 int result;
2988 void *argp1 = 0 ;
2989 int res1 = 0 ;
2990 int res2 ;
2991 char *buf2 = 0 ;
2992 int alloc2 = 0 ;
2993 int res3 ;
2994 char *buf3 = 0 ;
2995 int alloc3 = 0 ;
2996 int val4 ;
2997 int ecode4 = 0 ;
2998 int argvi = 0;
2999 dXSARGS;
3001 if ((items < 4) || (items > 4)) {
3002 SWIG_croak("Usage: netpgp_decrypt_file(netpgp_t *,char const *,char *,int);");
3004 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3005 if (!SWIG_IsOK(res1)) {
3006 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_decrypt_file" "', argument " "1"" of type '" "netpgp_t *""'");
3008 arg1 = (netpgp_t *)(argp1);
3009 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3010 if (!SWIG_IsOK(res2)) {
3011 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_decrypt_file" "', argument " "2"" of type '" "char const *""'");
3013 arg2 = (char *)(buf2);
3014 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
3015 if (!SWIG_IsOK(res3)) {
3016 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_decrypt_file" "', argument " "3"" of type '" "char *""'");
3018 arg3 = (char *)(buf3);
3019 ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
3020 if (!SWIG_IsOK(ecode4)) {
3021 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_decrypt_file" "', argument " "4"" of type '" "int""'");
3023 arg4 = (int)(val4);
3024 result = (int)netpgp_decrypt_file(arg1,(char const *)arg2,arg3,arg4);
3025 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
3027 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3028 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3030 XSRETURN(argvi);
3031 fail:
3033 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3034 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3036 SWIG_croak_null();
3041 XS(_wrap_netpgp_sign_file) {
3043 netpgp_t *arg1 = (netpgp_t *) 0 ;
3044 char *arg2 = (char *) 0 ;
3045 char *arg3 = (char *) 0 ;
3046 char *arg4 = (char *) 0 ;
3047 int arg5 ;
3048 int arg6 ;
3049 int arg7 ;
3050 int result;
3051 void *argp1 = 0 ;
3052 int res1 = 0 ;
3053 int res2 ;
3054 char *buf2 = 0 ;
3055 int alloc2 = 0 ;
3056 int res3 ;
3057 char *buf3 = 0 ;
3058 int alloc3 = 0 ;
3059 int res4 ;
3060 char *buf4 = 0 ;
3061 int alloc4 = 0 ;
3062 int val5 ;
3063 int ecode5 = 0 ;
3064 int val6 ;
3065 int ecode6 = 0 ;
3066 int val7 ;
3067 int ecode7 = 0 ;
3068 int argvi = 0;
3069 dXSARGS;
3071 if ((items < 7) || (items > 7)) {
3072 SWIG_croak("Usage: netpgp_sign_file(netpgp_t *,char const *,char const *,char *,int,int,int);");
3074 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3075 if (!SWIG_IsOK(res1)) {
3076 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_sign_file" "', argument " "1"" of type '" "netpgp_t *""'");
3078 arg1 = (netpgp_t *)(argp1);
3079 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3080 if (!SWIG_IsOK(res2)) {
3081 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_sign_file" "', argument " "2"" of type '" "char const *""'");
3083 arg2 = (char *)(buf2);
3084 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
3085 if (!SWIG_IsOK(res3)) {
3086 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_sign_file" "', argument " "3"" of type '" "char const *""'");
3088 arg3 = (char *)(buf3);
3089 res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
3090 if (!SWIG_IsOK(res4)) {
3091 SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "netpgp_sign_file" "', argument " "4"" of type '" "char *""'");
3093 arg4 = (char *)(buf4);
3094 ecode5 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(4), &val5);
3095 if (!SWIG_IsOK(ecode5)) {
3096 SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "netpgp_sign_file" "', argument " "5"" of type '" "int""'");
3098 arg5 = (int)(val5);
3099 ecode6 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
3100 if (!SWIG_IsOK(ecode6)) {
3101 SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "netpgp_sign_file" "', argument " "6"" of type '" "int""'");
3103 arg6 = (int)(val6);
3104 ecode7 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
3105 if (!SWIG_IsOK(ecode7)) {
3106 SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "netpgp_sign_file" "', argument " "7"" of type '" "int""'");
3108 arg7 = (int)(val7);
3109 result = (int)netpgp_sign_file(arg1,(char const *)arg2,(char const *)arg3,arg4,arg5,arg6,arg7);
3110 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
3112 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3113 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3114 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3118 XSRETURN(argvi);
3119 fail:
3121 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3122 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3123 if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3127 SWIG_croak_null();
3132 XS(_wrap_netpgp_verify_file) {
3134 netpgp_t *arg1 = (netpgp_t *) 0 ;
3135 char *arg2 = (char *) 0 ;
3136 char *arg3 = (char *) 0 ;
3137 int arg4 ;
3138 int result;
3139 void *argp1 = 0 ;
3140 int res1 = 0 ;
3141 int res2 ;
3142 char *buf2 = 0 ;
3143 int alloc2 = 0 ;
3144 int res3 ;
3145 char *buf3 = 0 ;
3146 int alloc3 = 0 ;
3147 int val4 ;
3148 int ecode4 = 0 ;
3149 int argvi = 0;
3150 dXSARGS;
3152 if ((items < 4) || (items > 4)) {
3153 SWIG_croak("Usage: netpgp_verify_file(netpgp_t *,char const *,char const *,int);");
3155 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3156 if (!SWIG_IsOK(res1)) {
3157 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_verify_file" "', argument " "1"" of type '" "netpgp_t *""'");
3159 arg1 = (netpgp_t *)(argp1);
3160 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3161 if (!SWIG_IsOK(res2)) {
3162 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_verify_file" "', argument " "2"" of type '" "char const *""'");
3164 arg2 = (char *)(buf2);
3165 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
3166 if (!SWIG_IsOK(res3)) {
3167 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_verify_file" "', argument " "3"" of type '" "char const *""'");
3169 arg3 = (char *)(buf3);
3170 ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
3171 if (!SWIG_IsOK(ecode4)) {
3172 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_verify_file" "', argument " "4"" of type '" "int""'");
3174 arg4 = (int)(val4);
3175 result = (int)netpgp_verify_file(arg1,(char const *)arg2,(char const *)arg3,arg4);
3176 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
3178 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3179 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3181 XSRETURN(argvi);
3182 fail:
3184 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3185 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3187 SWIG_croak_null();
3192 XS(_wrap_netpgp_sign_memory) {
3194 netpgp_t *arg1 = (netpgp_t *) 0 ;
3195 char *arg2 = (char *) 0 ;
3196 char *arg3 = (char *) 0 ;
3197 size_t arg4 ;
3198 char *arg5 = (char *) 0 ;
3199 size_t arg6 ;
3200 unsigned int arg7 ;
3201 unsigned int arg8 ;
3202 int result;
3203 void *argp1 = 0 ;
3204 int res1 = 0 ;
3205 int res2 ;
3206 char *buf2 = 0 ;
3207 int alloc2 = 0 ;
3208 int res3 ;
3209 char *buf3 = 0 ;
3210 int alloc3 = 0 ;
3211 size_t val4 ;
3212 int ecode4 = 0 ;
3213 int res5 ;
3214 char *buf5 = 0 ;
3215 int alloc5 = 0 ;
3216 size_t val6 ;
3217 int ecode6 = 0 ;
3218 unsigned int val7 ;
3219 int ecode7 = 0 ;
3220 unsigned int val8 ;
3221 int ecode8 = 0 ;
3222 int argvi = 0;
3223 dXSARGS;
3225 if ((items < 8) || (items > 8)) {
3226 SWIG_croak("Usage: netpgp_sign_memory(netpgp_t *,char const *,char *,size_t,char *,size_t,unsigned int const,unsigned int const);");
3228 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3229 if (!SWIG_IsOK(res1)) {
3230 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_sign_memory" "', argument " "1"" of type '" "netpgp_t *""'");
3232 arg1 = (netpgp_t *)(argp1);
3233 res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
3234 if (!SWIG_IsOK(res2)) {
3235 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_sign_memory" "', argument " "2"" of type '" "char const *""'");
3237 arg2 = (char *)(buf2);
3238 res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
3239 if (!SWIG_IsOK(res3)) {
3240 SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "netpgp_sign_memory" "', argument " "3"" of type '" "char *""'");
3242 arg3 = (char *)(buf3);
3243 ecode4 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
3244 if (!SWIG_IsOK(ecode4)) {
3245 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_sign_memory" "', argument " "4"" of type '" "size_t""'");
3247 arg4 = (size_t)(val4);
3248 res5 = SWIG_AsCharPtrAndSize(ST(4), &buf5, NULL, &alloc5);
3249 if (!SWIG_IsOK(res5)) {
3250 SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "netpgp_sign_memory" "', argument " "5"" of type '" "char *""'");
3252 arg5 = (char *)(buf5);
3253 ecode6 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(5), &val6);
3254 if (!SWIG_IsOK(ecode6)) {
3255 SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "netpgp_sign_memory" "', argument " "6"" of type '" "size_t""'");
3257 arg6 = (size_t)(val6);
3258 ecode7 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(6), &val7);
3259 if (!SWIG_IsOK(ecode7)) {
3260 SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "netpgp_sign_memory" "', argument " "7"" of type '" "unsigned int""'");
3262 arg7 = (unsigned int)(val7);
3263 ecode8 = SWIG_AsVal_unsigned_SS_int SWIG_PERL_CALL_ARGS_2(ST(7), &val8);
3264 if (!SWIG_IsOK(ecode8)) {
3265 SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "netpgp_sign_memory" "', argument " "8"" of type '" "unsigned int""'");
3267 arg8 = (unsigned int)(val8);
3268 result = (int)netpgp_sign_memory(arg1,(char const *)arg2,arg3,arg4,arg5,arg6,arg7,arg8);
3269 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
3271 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3272 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3274 if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
3278 XSRETURN(argvi);
3279 fail:
3281 if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
3282 if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3284 if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
3288 SWIG_croak_null();
3293 XS(_wrap_netpgp_verify_memory) {
3295 netpgp_t *arg1 = (netpgp_t *) 0 ;
3296 void *arg2 = (void *) 0 ;
3297 size_t arg3 ;
3298 int arg4 ;
3299 int result;
3300 void *argp1 = 0 ;
3301 int res1 = 0 ;
3302 int res2 ;
3303 size_t val3 ;
3304 int ecode3 = 0 ;
3305 int val4 ;
3306 int ecode4 = 0 ;
3307 int argvi = 0;
3308 dXSARGS;
3310 if ((items < 4) || (items > 4)) {
3311 SWIG_croak("Usage: netpgp_verify_memory(netpgp_t *,void const *,size_t const,int const);");
3313 res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_netpgp_t, 0 | 0 );
3314 if (!SWIG_IsOK(res1)) {
3315 SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "netpgp_verify_memory" "', argument " "1"" of type '" "netpgp_t *""'");
3317 arg1 = (netpgp_t *)(argp1);
3318 res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
3319 if (!SWIG_IsOK(res2)) {
3320 SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "netpgp_verify_memory" "', argument " "2"" of type '" "void const *""'");
3322 ecode3 = SWIG_AsVal_size_t SWIG_PERL_CALL_ARGS_2(ST(2), &val3);
3323 if (!SWIG_IsOK(ecode3)) {
3324 SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "netpgp_verify_memory" "', argument " "3"" of type '" "size_t""'");
3326 arg3 = (size_t)(val3);
3327 ecode4 = SWIG_AsVal_int SWIG_PERL_CALL_ARGS_2(ST(3), &val4);
3328 if (!SWIG_IsOK(ecode4)) {
3329 SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "netpgp_verify_memory" "', argument " "4"" of type '" "int""'");
3331 arg4 = (int)(val4);
3332 result = (int)netpgp_verify_memory(arg1,(void const *)arg2,arg3,arg4);
3333 ST(argvi) = SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(result)); argvi++ ;
3338 XSRETURN(argvi);
3339 fail:
3344 SWIG_croak_null();
3350 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3352 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3353 static swig_type_info _swigt__p_netpgp_t = {"_p_netpgp_t", "struct netpgp_t *|netpgp_t *", 0, 0, (void*)"netpgpperl::netpgp_t", 0};
3354 static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
3355 static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
3357 static swig_type_info *swig_type_initial[] = {
3358 &_swigt__p_char,
3359 &_swigt__p_netpgp_t,
3360 &_swigt__p_p_char,
3361 &_swigt__p_void,
3364 static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3365 static swig_cast_info _swigc__p_netpgp_t[] = { {&_swigt__p_netpgp_t, 0, 0, 0},{0, 0, 0, 0}};
3366 static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
3367 static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
3369 static swig_cast_info *swig_cast_initial[] = {
3370 _swigc__p_char,
3371 _swigc__p_netpgp_t,
3372 _swigc__p_p_char,
3373 _swigc__p_void,
3377 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3379 static swig_constant_info swig_constants[] = {
3380 {0,0,0,0,0,0}
3382 #ifdef __cplusplus
3384 #endif
3385 static swig_variable_info swig_variables[] = {
3386 {0,0,0,0}
3388 static swig_command_info swig_commands[] = {
3389 {"netpgpperlc::netpgp_t_c_set", _wrap_netpgp_t_c_set},
3390 {"netpgpperlc::netpgp_t_c_get", _wrap_netpgp_t_c_get},
3391 {"netpgpperlc::netpgp_t_size_set", _wrap_netpgp_t_size_set},
3392 {"netpgpperlc::netpgp_t_size_get", _wrap_netpgp_t_size_get},
3393 {"netpgpperlc::netpgp_t_name_set", _wrap_netpgp_t_name_set},
3394 {"netpgpperlc::netpgp_t_name_get", _wrap_netpgp_t_name_get},
3395 {"netpgpperlc::netpgp_t_value_set", _wrap_netpgp_t_value_set},
3396 {"netpgpperlc::netpgp_t_value_get", _wrap_netpgp_t_value_get},
3397 {"netpgpperlc::netpgp_t_pubring_set", _wrap_netpgp_t_pubring_set},
3398 {"netpgpperlc::netpgp_t_pubring_get", _wrap_netpgp_t_pubring_get},
3399 {"netpgpperlc::netpgp_t_secring_set", _wrap_netpgp_t_secring_set},
3400 {"netpgpperlc::netpgp_t_secring_get", _wrap_netpgp_t_secring_get},
3401 {"netpgpperlc::netpgp_t_io_set", _wrap_netpgp_t_io_set},
3402 {"netpgpperlc::netpgp_t_io_get", _wrap_netpgp_t_io_get},
3403 {"netpgpperlc::netpgp_t_passfp_set", _wrap_netpgp_t_passfp_set},
3404 {"netpgpperlc::netpgp_t_passfp_get", _wrap_netpgp_t_passfp_get},
3405 {"netpgpperlc::new_netpgp_t", _wrap_new_netpgp_t},
3406 {"netpgpperlc::delete_netpgp_t", _wrap_delete_netpgp_t},
3407 {"netpgpperlc::netpgp_init", _wrap_netpgp_init},
3408 {"netpgpperlc::netpgp_end", _wrap_netpgp_end},
3409 {"netpgpperlc::netpgp_set_debug", _wrap_netpgp_set_debug},
3410 {"netpgpperlc::netpgp_get_debug", _wrap_netpgp_get_debug},
3411 {"netpgpperlc::netpgp_get_info", _wrap_netpgp_get_info},
3412 {"netpgpperlc::netpgp_list_packets", _wrap_netpgp_list_packets},
3413 {"netpgpperlc::netpgp_setvar", _wrap_netpgp_setvar},
3414 {"netpgpperlc::netpgp_getvar", _wrap_netpgp_getvar},
3415 {"netpgpperlc::netpgp_list_keys", _wrap_netpgp_list_keys},
3416 {"netpgpperlc::netpgp_list_sigs", _wrap_netpgp_list_sigs},
3417 {"netpgpperlc::netpgp_find_key", _wrap_netpgp_find_key},
3418 {"netpgpperlc::netpgp_get_key", _wrap_netpgp_get_key},
3419 {"netpgpperlc::netpgp_export_key", _wrap_netpgp_export_key},
3420 {"netpgpperlc::netpgp_import_key", _wrap_netpgp_import_key},
3421 {"netpgpperlc::netpgp_generate_key", _wrap_netpgp_generate_key},
3422 {"netpgpperlc::netpgp_encrypt_file", _wrap_netpgp_encrypt_file},
3423 {"netpgpperlc::netpgp_decrypt_file", _wrap_netpgp_decrypt_file},
3424 {"netpgpperlc::netpgp_sign_file", _wrap_netpgp_sign_file},
3425 {"netpgpperlc::netpgp_verify_file", _wrap_netpgp_verify_file},
3426 {"netpgpperlc::netpgp_sign_memory", _wrap_netpgp_sign_memory},
3427 {"netpgpperlc::netpgp_verify_memory", _wrap_netpgp_verify_memory},
3428 {0,0}
3430 /* -----------------------------------------------------------------------------
3431 * Type initialization:
3432 * This problem is tough by the requirement that no dynamic
3433 * memory is used. Also, since swig_type_info structures store pointers to
3434 * swig_cast_info structures and swig_cast_info structures store pointers back
3435 * to swig_type_info structures, we need some lookup code at initialization.
3436 * The idea is that swig generates all the structures that are needed.
3437 * The runtime then collects these partially filled structures.
3438 * The SWIG_InitializeModule function takes these initial arrays out of
3439 * swig_module, and does all the lookup, filling in the swig_module.types
3440 * array with the correct data and linking the correct swig_cast_info
3441 * structures together.
3443 * The generated swig_type_info structures are assigned staticly to an initial
3444 * array. We just loop through that array, and handle each type individually.
3445 * First we lookup if this type has been already loaded, and if so, use the
3446 * loaded structure instead of the generated one. Then we have to fill in the
3447 * cast linked list. The cast data is initially stored in something like a
3448 * two-dimensional array. Each row corresponds to a type (there are the same
3449 * number of rows as there are in the swig_type_initial array). Each entry in
3450 * a column is one of the swig_cast_info structures for that type.
3451 * The cast_initial array is actually an array of arrays, because each row has
3452 * a variable number of columns. So to actually build the cast linked list,
3453 * we find the array of casts associated with the type, and loop through it
3454 * adding the casts to the list. The one last trick we need to do is making
3455 * sure the type pointer in the swig_cast_info struct is correct.
3457 * First off, we lookup the cast->type name to see if it is already loaded.
3458 * There are three cases to handle:
3459 * 1) If the cast->type has already been loaded AND the type we are adding
3460 * casting info to has not been loaded (it is in this module), THEN we
3461 * replace the cast->type pointer with the type pointer that has already
3462 * been loaded.
3463 * 2) If BOTH types (the one we are adding casting info to, and the
3464 * cast->type) are loaded, THEN the cast info has already been loaded by
3465 * the previous module so we just ignore it.
3466 * 3) Finally, if cast->type has not already been loaded, then we add that
3467 * swig_cast_info to the linked list (because the cast->type) pointer will
3468 * be correct.
3469 * ----------------------------------------------------------------------------- */
3471 #ifdef __cplusplus
3472 extern "C" {
3473 #if 0
3474 } /* c-mode */
3475 #endif
3476 #endif
3478 #if 0
3479 #define SWIGRUNTIME_DEBUG
3480 #endif
3483 SWIGRUNTIME void
3484 SWIG_InitializeModule(void *clientdata) {
3485 size_t i;
3486 swig_module_info *module_head, *iter;
3487 int found;
3489 clientdata = clientdata;
3491 /* check to see if the circular list has been setup, if not, set it up */
3492 if (swig_module.next==0) {
3493 /* Initialize the swig_module */
3494 swig_module.type_initial = swig_type_initial;
3495 swig_module.cast_initial = swig_cast_initial;
3496 swig_module.next = &swig_module;
3499 /* Try and load any already created modules */
3500 module_head = SWIG_GetModule(clientdata);
3501 if (!module_head) {
3502 /* This is the first module loaded for this interpreter */
3503 /* so set the swig module into the interpreter */
3504 SWIG_SetModule(clientdata, &swig_module);
3505 module_head = &swig_module;
3506 } else {
3507 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3508 found=0;
3509 iter=module_head;
3510 do {
3511 if (iter==&swig_module) {
3512 found=1;
3513 break;
3515 iter=iter->next;
3516 } while (iter!= module_head);
3518 /* if the is found in the list, then all is done and we may leave */
3519 if (found) return;
3520 /* otherwise we must add out module into the list */
3521 swig_module.next = module_head->next;
3522 module_head->next = &swig_module;
3525 /* Now work on filling in swig_module.types */
3526 #ifdef SWIGRUNTIME_DEBUG
3527 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3528 #endif
3529 for (i = 0; i < swig_module.size; ++i) {
3530 swig_type_info *type = 0;
3531 swig_type_info *ret;
3532 swig_cast_info *cast;
3534 #ifdef SWIGRUNTIME_DEBUG
3535 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3536 #endif
3538 /* if there is another module already loaded */
3539 if (swig_module.next != &swig_module) {
3540 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3542 if (type) {
3543 /* Overwrite clientdata field */
3544 #ifdef SWIGRUNTIME_DEBUG
3545 printf("SWIG_InitializeModule: found type %s\n", type->name);
3546 #endif
3547 if (swig_module.type_initial[i]->clientdata) {
3548 type->clientdata = swig_module.type_initial[i]->clientdata;
3549 #ifdef SWIGRUNTIME_DEBUG
3550 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3551 #endif
3553 } else {
3554 type = swig_module.type_initial[i];
3557 /* Insert casting types */
3558 cast = swig_module.cast_initial[i];
3559 while (cast->type) {
3560 /* Don't need to add information already in the list */
3561 ret = 0;
3562 #ifdef SWIGRUNTIME_DEBUG
3563 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3564 #endif
3565 if (swig_module.next != &swig_module) {
3566 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3567 #ifdef SWIGRUNTIME_DEBUG
3568 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3569 #endif
3571 if (ret) {
3572 if (type == swig_module.type_initial[i]) {
3573 #ifdef SWIGRUNTIME_DEBUG
3574 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3575 #endif
3576 cast->type = ret;
3577 ret = 0;
3578 } else {
3579 /* Check for casting already in the list */
3580 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3581 #ifdef SWIGRUNTIME_DEBUG
3582 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3583 #endif
3584 if (!ocast) ret = 0;
3588 if (!ret) {
3589 #ifdef SWIGRUNTIME_DEBUG
3590 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3591 #endif
3592 if (type->cast) {
3593 type->cast->prev = cast;
3594 cast->next = type->cast;
3596 type->cast = cast;
3598 cast++;
3600 /* Set entry in modules->types array equal to the type */
3601 swig_module.types[i] = type;
3603 swig_module.types[i] = 0;
3605 #ifdef SWIGRUNTIME_DEBUG
3606 printf("**** SWIG_InitializeModule: Cast List ******\n");
3607 for (i = 0; i < swig_module.size; ++i) {
3608 int j = 0;
3609 swig_cast_info *cast = swig_module.cast_initial[i];
3610 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3611 while (cast->type) {
3612 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3613 cast++;
3614 ++j;
3616 printf("---- Total casts: %d\n",j);
3618 printf("**** SWIG_InitializeModule: Cast List ******\n");
3619 #endif
3622 /* This function will propagate the clientdata field of type to
3623 * any new swig_type_info structures that have been added into the list
3624 * of equivalent types. It is like calling
3625 * SWIG_TypeClientData(type, clientdata) a second time.
3627 SWIGRUNTIME void
3628 SWIG_PropagateClientData(void) {
3629 size_t i;
3630 swig_cast_info *equiv;
3631 static int init_run = 0;
3633 if (init_run) return;
3634 init_run = 1;
3636 for (i = 0; i < swig_module.size; i++) {
3637 if (swig_module.types[i]->clientdata) {
3638 equiv = swig_module.types[i]->cast;
3639 while (equiv) {
3640 if (!equiv->converter) {
3641 if (equiv->type && !equiv->type->clientdata)
3642 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3644 equiv = equiv->next;
3650 #ifdef __cplusplus
3651 #if 0
3653 /* c-mode */
3654 #endif
3656 #endif
3660 #ifdef __cplusplus
3661 extern "C"
3662 #endif
3664 XS(SWIG_init) {
3665 dXSARGS;
3666 int i;
3668 SWIG_InitializeModule(0);
3670 /* Install commands */
3671 for (i = 0; swig_commands[i].name; i++) {
3672 newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
3675 /* Install variables */
3676 for (i = 0; swig_variables[i].name; i++) {
3677 SV *sv;
3678 sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2);
3679 if (swig_variables[i].type) {
3680 SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
3681 } else {
3682 sv_setiv(sv,(IV) 0);
3684 swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get);
3687 /* Install constant */
3688 for (i = 0; swig_constants[i].type; i++) {
3689 SV *sv;
3690 sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2);
3691 switch(swig_constants[i].type) {
3692 case SWIG_INT:
3693 sv_setiv(sv, (IV) swig_constants[i].lvalue);
3694 break;
3695 case SWIG_FLOAT:
3696 sv_setnv(sv, (double) swig_constants[i].dvalue);
3697 break;
3698 case SWIG_STRING:
3699 sv_setpv(sv, (char *) swig_constants[i].pvalue);
3700 break;
3701 case SWIG_POINTER:
3702 SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
3703 break;
3704 case SWIG_BINARY:
3705 SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
3706 break;
3707 default:
3708 break;
3710 SvREADONLY_on(sv);
3713 SWIG_TypeClientData(SWIGTYPE_p_netpgp_t, (void*) "netpgpperl::netpgp_t");
3714 ST(0) = &PL_sv_yes;
3715 XSRETURN(1);