cfbb55fda36a96565203b0d946da124ab46f5298
[debian/amanda] / perl / Amanda / Device.c
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 2.0.4
4  * 
5  * This file is not intended to be easily readable and contains a number of 
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG 
8  * interface file instead. 
9  * ----------------------------------------------------------------------------- */
10
11 #include "../config/config.h"
12
13
14 #define SWIGPERL
15 #define SWIG_CASTRANK_MODE
16
17 /* -----------------------------------------------------------------------------
18  *  This section contains generic SWIG labels for method/variable
19  *  declarations/attributes, and other compiler dependent labels.
20  * ----------------------------------------------------------------------------- */
21
22 /* template workaround for compilers that cannot correctly implement the C++ standard */
23 #ifndef SWIGTEMPLATEDISAMBIGUATOR
24 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
25 #  define SWIGTEMPLATEDISAMBIGUATOR template
26 # elif defined(__HP_aCC)
27 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
28 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
29 #  define SWIGTEMPLATEDISAMBIGUATOR template
30 # else
31 #  define SWIGTEMPLATEDISAMBIGUATOR
32 # endif
33 #endif
34
35 /* inline attribute */
36 #ifndef SWIGINLINE
37 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
38 #   define SWIGINLINE inline
39 # else
40 #   define SWIGINLINE
41 # endif
42 #endif
43
44 /* attribute recognised by some compilers to avoid 'unused' warnings */
45 #ifndef SWIGUNUSED
46 # if defined(__GNUC__)
47 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
48 #     define SWIGUNUSED __attribute__ ((__unused__)) 
49 #   else
50 #     define SWIGUNUSED
51 #   endif
52 # elif defined(__ICC)
53 #   define SWIGUNUSED __attribute__ ((__unused__)) 
54 # else
55 #   define SWIGUNUSED 
56 # endif
57 #endif
58
59 #ifndef SWIG_MSC_UNSUPPRESS_4505
60 # if defined(_MSC_VER)
61 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
62 # endif 
63 #endif
64
65 #ifndef SWIGUNUSEDPARM
66 # ifdef __cplusplus
67 #   define SWIGUNUSEDPARM(p)
68 # else
69 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
70 # endif
71 #endif
72
73 /* internal SWIG method */
74 #ifndef SWIGINTERN
75 # define SWIGINTERN static SWIGUNUSED
76 #endif
77
78 /* internal inline SWIG method */
79 #ifndef SWIGINTERNINLINE
80 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
81 #endif
82
83 /* exporting methods */
84 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
85 #  ifndef GCC_HASCLASSVISIBILITY
86 #    define GCC_HASCLASSVISIBILITY
87 #  endif
88 #endif
89
90 #ifndef SWIGEXPORT
91 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
92 #   if defined(STATIC_LINKED)
93 #     define SWIGEXPORT
94 #   else
95 #     define SWIGEXPORT __declspec(dllexport)
96 #   endif
97 # else
98 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
99 #     define SWIGEXPORT __attribute__ ((visibility("default")))
100 #   else
101 #     define SWIGEXPORT
102 #   endif
103 # endif
104 #endif
105
106 /* calling conventions for Windows */
107 #ifndef SWIGSTDCALL
108 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
109 #   define SWIGSTDCALL __stdcall
110 # else
111 #   define SWIGSTDCALL
112 # endif 
113 #endif
114
115 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
116 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
117 # define _CRT_SECURE_NO_DEPRECATE
118 #endif
119
120 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
121 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
122 # define _SCL_SECURE_NO_DEPRECATE
123 #endif
124
125
126 /* -----------------------------------------------------------------------------
127  * swigrun.swg
128  *
129  * This file contains generic C API SWIG runtime support for pointer
130  * type checking.
131  * ----------------------------------------------------------------------------- */
132
133 /* This should only be incremented when either the layout of swig_type_info changes,
134    or for whatever reason, the runtime changes incompatibly */
135 #define SWIG_RUNTIME_VERSION "4"
136
137 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
138 #ifdef SWIG_TYPE_TABLE
139 # define SWIG_QUOTE_STRING(x) #x
140 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
141 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
142 #else
143 # define SWIG_TYPE_TABLE_NAME
144 #endif
145
146 /*
147   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
148   creating a static or dynamic library from the SWIG runtime code.
149   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
150   
151   But only do this if strictly necessary, ie, if you have problems
152   with your compiler or suchlike.
153 */
154
155 #ifndef SWIGRUNTIME
156 # define SWIGRUNTIME SWIGINTERN
157 #endif
158
159 #ifndef SWIGRUNTIMEINLINE
160 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
161 #endif
162
163 /*  Generic buffer size */
164 #ifndef SWIG_BUFFER_SIZE
165 # define SWIG_BUFFER_SIZE 1024
166 #endif
167
168 /* Flags for pointer conversions */
169 #define SWIG_POINTER_DISOWN        0x1
170 #define SWIG_CAST_NEW_MEMORY       0x2
171
172 /* Flags for new pointer objects */
173 #define SWIG_POINTER_OWN           0x1
174
175
176 /* 
177    Flags/methods for returning states.
178    
179    The SWIG conversion methods, as ConvertPtr, return an integer 
180    that tells if the conversion was successful or not. And if not,
181    an error code can be returned (see swigerrors.swg for the codes).
182    
183    Use the following macros/flags to set or process the returning
184    states.
185    
186    In old versions of SWIG, code such as the following was usually written:
187
188      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
189        // success code
190      } else {
191        //fail code
192      }
193
194    Now you can be more explicit:
195
196     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
197     if (SWIG_IsOK(res)) {
198       // success code
199     } else {
200       // fail code
201     }
202
203    which is the same really, but now you can also do
204
205     Type *ptr;
206     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
207     if (SWIG_IsOK(res)) {
208       // success code
209       if (SWIG_IsNewObj(res) {
210         ...
211         delete *ptr;
212       } else {
213         ...
214       }
215     } else {
216       // fail code
217     }
218     
219    I.e., now SWIG_ConvertPtr can return new objects and you can
220    identify the case and take care of the deallocation. Of course that
221    also requires SWIG_ConvertPtr to return new result values, such as
222
223       int SWIG_ConvertPtr(obj, ptr,...) {         
224         if (<obj is ok>) {                             
225           if (<need new object>) {                     
226             *ptr = <ptr to new allocated object>; 
227             return SWIG_NEWOBJ;                
228           } else {                                     
229             *ptr = <ptr to old object>;        
230             return SWIG_OLDOBJ;                
231           }                                    
232         } else {                                       
233           return SWIG_BADOBJ;                  
234         }                                              
235       }
236
237    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
238    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
239    SWIG errors code.
240
241    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
242    allows to return the 'cast rank', for example, if you have this
243
244        int food(double)
245        int fooi(int);
246
247    and you call
248  
249       food(1)   // cast rank '1'  (1 -> 1.0)
250       fooi(1)   // cast rank '0'
251
252    just use the SWIG_AddCast()/SWIG_CheckState()
253 */
254
255 #define SWIG_OK                    (0) 
256 #define SWIG_ERROR                 (-1)
257 #define SWIG_IsOK(r)               (r >= 0)
258 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
259
260 /* The CastRankLimit says how many bits are used for the cast rank */
261 #define SWIG_CASTRANKLIMIT         (1 << 8)
262 /* The NewMask denotes the object was created (using new/malloc) */
263 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
264 /* The TmpMask is for in/out typemaps that use temporal objects */
265 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
266 /* Simple returning values */
267 #define SWIG_BADOBJ                (SWIG_ERROR)
268 #define SWIG_OLDOBJ                (SWIG_OK)
269 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
270 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
271 /* Check, add and del mask methods */
272 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
273 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
274 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
275 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
276 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
277 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
278
279 /* Cast-Rank Mode */
280 #if defined(SWIG_CASTRANK_MODE)
281 #  ifndef SWIG_TypeRank
282 #    define SWIG_TypeRank             unsigned long
283 #  endif
284 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
285 #    define SWIG_MAXCASTRANK          (2)
286 #  endif
287 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
288 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
289 SWIGINTERNINLINE int SWIG_AddCast(int r) { 
290   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
291 }
292 SWIGINTERNINLINE int SWIG_CheckState(int r) { 
293   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
294 }
295 #else /* no cast-rank mode */
296 #  define SWIG_AddCast
297 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
298 #endif
299
300
301 #include <string.h>
302
303 #ifdef __cplusplus
304 extern "C" {
305 #endif
306
307 typedef void *(*swig_converter_func)(void *, int *);
308 typedef struct swig_type_info *(*swig_dycast_func)(void **);
309
310 /* Structure to store information on one type */
311 typedef struct swig_type_info {
312   const char             *name;                 /* mangled name of this type */
313   const char             *str;                  /* human readable name of this type */
314   swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
315   struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
316   void                   *clientdata;           /* language specific type data */
317   int                    owndata;               /* flag if the structure owns the clientdata */
318 } swig_type_info;
319
320 /* Structure to store a type and conversion function used for casting */
321 typedef struct swig_cast_info {
322   swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
323   swig_converter_func     converter;            /* function to cast the void pointers */
324   struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
325   struct swig_cast_info  *prev;                 /* pointer to the previous cast */
326 } swig_cast_info;
327
328 /* Structure used to store module information
329  * Each module generates one structure like this, and the runtime collects
330  * all of these structures and stores them in a circularly linked list.*/
331 typedef struct swig_module_info {
332   swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
333   size_t                 size;                  /* Number of types in this module */
334   struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
335   swig_type_info         **type_initial;        /* Array of initially generated type structures */
336   swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
337   void                    *clientdata;          /* Language specific module data */
338 } swig_module_info;
339
340 /* 
341   Compare two type names skipping the space characters, therefore
342   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
343
344   Return 0 when the two name types are equivalent, as in
345   strncmp, but skipping ' '.
346 */
347 SWIGRUNTIME int
348 SWIG_TypeNameComp(const char *f1, const char *l1,
349                   const char *f2, const char *l2) {
350   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
351     while ((*f1 == ' ') && (f1 != l1)) ++f1;
352     while ((*f2 == ' ') && (f2 != l2)) ++f2;
353     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
354   }
355   return (int)((l1 - f1) - (l2 - f2));
356 }
357
358 /*
359   Check type equivalence in a name list like <name1>|<name2>|...
360   Return 0 if not equal, 1 if equal
361 */
362 SWIGRUNTIME int
363 SWIG_TypeEquiv(const char *nb, const char *tb) {
364   int equiv = 0;
365   const char* te = tb + strlen(tb);
366   const char* ne = nb;
367   while (!equiv && *ne) {
368     for (nb = ne; *ne; ++ne) {
369       if (*ne == '|') break;
370     }
371     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
372     if (*ne) ++ne;
373   }
374   return equiv;
375 }
376
377 /*
378   Check type equivalence in a name list like <name1>|<name2>|...
379   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
380 */
381 SWIGRUNTIME int
382 SWIG_TypeCompare(const char *nb, const char *tb) {
383   int equiv = 0;
384   const char* te = tb + strlen(tb);
385   const char* ne = nb;
386   while (!equiv && *ne) {
387     for (nb = ne; *ne; ++ne) {
388       if (*ne == '|') break;
389     }
390     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
391     if (*ne) ++ne;
392   }
393   return equiv;
394 }
395
396
397 /*
398   Check the typename
399 */
400 SWIGRUNTIME swig_cast_info *
401 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
402   if (ty) {
403     swig_cast_info *iter = ty->cast;
404     while (iter) {
405       if (strcmp(iter->type->name, c) == 0) {
406         if (iter == ty->cast)
407           return iter;
408         /* Move iter to the top of the linked list */
409         iter->prev->next = iter->next;
410         if (iter->next)
411           iter->next->prev = iter->prev;
412         iter->next = ty->cast;
413         iter->prev = 0;
414         if (ty->cast) ty->cast->prev = iter;
415         ty->cast = iter;
416         return iter;
417       }
418       iter = iter->next;
419     }
420   }
421   return 0;
422 }
423
424 /* 
425   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
426 */
427 SWIGRUNTIME swig_cast_info *
428 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
429   if (ty) {
430     swig_cast_info *iter = ty->cast;
431     while (iter) {
432       if (iter->type == from) {
433         if (iter == ty->cast)
434           return iter;
435         /* Move iter to the top of the linked list */
436         iter->prev->next = iter->next;
437         if (iter->next)
438           iter->next->prev = iter->prev;
439         iter->next = ty->cast;
440         iter->prev = 0;
441         if (ty->cast) ty->cast->prev = iter;
442         ty->cast = iter;
443         return iter;
444       }
445       iter = iter->next;
446     }
447   }
448   return 0;
449 }
450
451 /*
452   Cast a pointer up an inheritance hierarchy
453 */
454 SWIGRUNTIMEINLINE void *
455 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
456   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
457 }
458
459 /* 
460    Dynamic pointer casting. Down an inheritance hierarchy
461 */
462 SWIGRUNTIME swig_type_info *
463 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
464   swig_type_info *lastty = ty;
465   if (!ty || !ty->dcast) return ty;
466   while (ty && (ty->dcast)) {
467     ty = (*ty->dcast)(ptr);
468     if (ty) lastty = ty;
469   }
470   return lastty;
471 }
472
473 /*
474   Return the name associated with this type
475 */
476 SWIGRUNTIMEINLINE const char *
477 SWIG_TypeName(const swig_type_info *ty) {
478   return ty->name;
479 }
480
481 /*
482   Return the pretty name associated with this type,
483   that is an unmangled type name in a form presentable to the user.
484 */
485 SWIGRUNTIME const char *
486 SWIG_TypePrettyName(const swig_type_info *type) {
487   /* The "str" field contains the equivalent pretty names of the
488      type, separated by vertical-bar characters.  We choose
489      to print the last name, as it is often (?) the most
490      specific. */
491   if (!type) return NULL;
492   if (type->str != NULL) {
493     const char *last_name = type->str;
494     const char *s;
495     for (s = type->str; *s; s++)
496       if (*s == '|') last_name = s+1;
497     return last_name;
498   }
499   else
500     return type->name;
501 }
502
503 /* 
504    Set the clientdata field for a type
505 */
506 SWIGRUNTIME void
507 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
508   swig_cast_info *cast = ti->cast;
509   /* if (ti->clientdata == clientdata) return; */
510   ti->clientdata = clientdata;
511   
512   while (cast) {
513     if (!cast->converter) {
514       swig_type_info *tc = cast->type;
515       if (!tc->clientdata) {
516         SWIG_TypeClientData(tc, clientdata);
517       }
518     }    
519     cast = cast->next;
520   }
521 }
522 SWIGRUNTIME void
523 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
524   SWIG_TypeClientData(ti, clientdata);
525   ti->owndata = 1;
526 }
527   
528 /*
529   Search for a swig_type_info structure only by mangled name
530   Search is a O(log #types)
531   
532   We start searching at module start, and finish searching when start == end.  
533   Note: if start == end at the beginning of the function, we go all the way around
534   the circular list.
535 */
536 SWIGRUNTIME swig_type_info *
537 SWIG_MangledTypeQueryModule(swig_module_info *start, 
538                             swig_module_info *end, 
539                             const char *name) {
540   swig_module_info *iter = start;
541   do {
542     if (iter->size) {
543       register size_t l = 0;
544       register size_t r = iter->size - 1;
545       do {
546         /* since l+r >= 0, we can (>> 1) instead (/ 2) */
547         register size_t i = (l + r) >> 1; 
548         const char *iname = iter->types[i]->name;
549         if (iname) {
550           register int compare = strcmp(name, iname);
551           if (compare == 0) {       
552             return iter->types[i];
553           } else if (compare < 0) {
554             if (i) {
555               r = i - 1;
556             } else {
557               break;
558             }
559           } else if (compare > 0) {
560             l = i + 1;
561           }
562         } else {
563           break; /* should never happen */
564         }
565       } while (l <= r);
566     }
567     iter = iter->next;
568   } while (iter != end);
569   return 0;
570 }
571
572 /*
573   Search for a swig_type_info structure for either a mangled name or a human readable name.
574   It first searches the mangled names of the types, which is a O(log #types)
575   If a type is not found it then searches the human readable names, which is O(#types).
576   
577   We start searching at module start, and finish searching when start == end.  
578   Note: if start == end at the beginning of the function, we go all the way around
579   the circular list.
580 */
581 SWIGRUNTIME swig_type_info *
582 SWIG_TypeQueryModule(swig_module_info *start, 
583                      swig_module_info *end, 
584                      const char *name) {
585   /* STEP 1: Search the name field using binary search */
586   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
587   if (ret) {
588     return ret;
589   } else {
590     /* STEP 2: If the type hasn't been found, do a complete search
591        of the str field (the human readable name) */
592     swig_module_info *iter = start;
593     do {
594       register size_t i = 0;
595       for (; i < iter->size; ++i) {
596         if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
597           return iter->types[i];
598       }
599       iter = iter->next;
600     } while (iter != end);
601   }
602   
603   /* neither found a match */
604   return 0;
605 }
606
607 /* 
608    Pack binary data into a string
609 */
610 SWIGRUNTIME char *
611 SWIG_PackData(char *c, void *ptr, size_t sz) {
612   static const char hex[17] = "0123456789abcdef";
613   register const unsigned char *u = (unsigned char *) ptr;
614   register const unsigned char *eu =  u + sz;
615   for (; u != eu; ++u) {
616     register unsigned char uu = *u;
617     *(c++) = hex[(uu & 0xf0) >> 4];
618     *(c++) = hex[uu & 0xf];
619   }
620   return c;
621 }
622
623 /* 
624    Unpack binary data from a string
625 */
626 SWIGRUNTIME const char *
627 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
628   register unsigned char *u = (unsigned char *) ptr;
629   register const unsigned char *eu = u + sz;
630   for (; u != eu; ++u) {
631     register char d = *(c++);
632     register unsigned char uu;
633     if ((d >= '0') && (d <= '9'))
634       uu = ((d - '0') << 4);
635     else if ((d >= 'a') && (d <= 'f'))
636       uu = ((d - ('a'-10)) << 4);
637     else 
638       return (char *) 0;
639     d = *(c++);
640     if ((d >= '0') && (d <= '9'))
641       uu |= (d - '0');
642     else if ((d >= 'a') && (d <= 'f'))
643       uu |= (d - ('a'-10));
644     else 
645       return (char *) 0;
646     *u = uu;
647   }
648   return c;
649 }
650
651 /* 
652    Pack 'void *' into a string buffer.
653 */
654 SWIGRUNTIME char *
655 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
656   char *r = buff;
657   if ((2*sizeof(void *) + 2) > bsz) return 0;
658   *(r++) = '_';
659   r = SWIG_PackData(r,&ptr,sizeof(void *));
660   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
661   strcpy(r,name);
662   return buff;
663 }
664
665 SWIGRUNTIME const char *
666 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
667   if (*c != '_') {
668     if (strcmp(c,"NULL") == 0) {
669       *ptr = (void *) 0;
670       return name;
671     } else {
672       return 0;
673     }
674   }
675   return SWIG_UnpackData(++c,ptr,sizeof(void *));
676 }
677
678 SWIGRUNTIME char *
679 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
680   char *r = buff;
681   size_t lname = (name ? strlen(name) : 0);
682   if ((2*sz + 2 + lname) > bsz) return 0;
683   *(r++) = '_';
684   r = SWIG_PackData(r,ptr,sz);
685   if (lname) {
686     strncpy(r,name,lname+1);
687   } else {
688     *r = 0;
689   }
690   return buff;
691 }
692
693 SWIGRUNTIME const char *
694 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
695   if (*c != '_') {
696     if (strcmp(c,"NULL") == 0) {
697       memset(ptr,0,sz);
698       return name;
699     } else {
700       return 0;
701     }
702   }
703   return SWIG_UnpackData(++c,ptr,sz);
704 }
705
706 #ifdef __cplusplus
707 }
708 #endif
709
710 /*  Errors in SWIG */
711 #define  SWIG_UnknownError         -1 
712 #define  SWIG_IOError              -2 
713 #define  SWIG_RuntimeError         -3 
714 #define  SWIG_IndexError           -4 
715 #define  SWIG_TypeError            -5 
716 #define  SWIG_DivisionByZero       -6 
717 #define  SWIG_OverflowError        -7 
718 #define  SWIG_SyntaxError          -8 
719 #define  SWIG_ValueError           -9 
720 #define  SWIG_SystemError          -10
721 #define  SWIG_AttributeError       -11
722 #define  SWIG_MemoryError          -12 
723 #define  SWIG_NullReferenceError   -13
724
725
726
727 #ifdef __cplusplus
728 /* Needed on some windows machines---since MS plays funny games with the header files under C++ */
729 #include <math.h>
730 #include <stdlib.h>
731 extern "C" {
732 #endif
733 #include "EXTERN.h"
734 #include "perl.h"
735 #include "XSUB.h"
736
737 /* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
738
739 /* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
740 #ifndef PERL_REVISION
741 #  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
742 #    define PERL_PATCHLEVEL_H_IMPLICIT
743 #    include <patchlevel.h>
744 #  endif
745 #  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
746 #    include <could_not_find_Perl_patchlevel.h>
747 #  endif
748 #  ifndef PERL_REVISION
749 #    define PERL_REVISION       (5)
750 #    define PERL_VERSION        PATCHLEVEL
751 #    define PERL_SUBVERSION     SUBVERSION
752 #  endif
753 #endif
754
755 #if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
756 #define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
757 #endif
758
759 #ifndef SvIOK_UV
760 # define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
761 #endif
762
763 #ifndef SvUOK
764 # define SvUOK(sv)           SvIOK_UV(sv)
765 #endif
766
767 #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
768 #  define PL_sv_undef               sv_undef
769 #  define PL_na                     na
770 #  define PL_errgv                  errgv
771 #  define PL_sv_no                  sv_no
772 #  define PL_sv_yes                 sv_yes
773 #  define PL_markstack_ptr          markstack_ptr
774 #endif
775
776 #ifndef IVSIZE
777 #  ifdef LONGSIZE
778 #    define IVSIZE LONGSIZE
779 #  else
780 #    define IVSIZE 4 /* A bold guess, but the best we can make. */
781 #  endif
782 #endif
783
784 #ifndef INT2PTR
785 #  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
786 #    define PTRV                  UV
787 #    define INT2PTR(any,d)        (any)(d)
788 #  else
789 #    if PTRSIZE == LONGSIZE
790 #      define PTRV                unsigned long
791 #    else
792 #      define PTRV                unsigned
793 #    endif
794 #    define INT2PTR(any,d)        (any)(PTRV)(d)
795 #  endif
796
797 #  define NUM2PTR(any,d)  (any)(PTRV)(d)
798 #  define PTR2IV(p)       INT2PTR(IV,p)
799 #  define PTR2UV(p)       INT2PTR(UV,p)
800 #  define PTR2NV(p)       NUM2PTR(NV,p)
801
802 #  if PTRSIZE == LONGSIZE
803 #    define PTR2ul(p)     (unsigned long)(p)
804 #  else
805 #    define PTR2ul(p)     INT2PTR(unsigned long,p)
806 #  endif
807 #endif /* !INT2PTR */
808
809 #ifndef SvPV_nolen
810 # define SvPV_nolen(x) SvPV(x,PL_na)
811 #endif
812
813 #ifndef get_sv
814 #  define get_sv perl_get_sv
815 #endif
816
817 #ifndef ERRSV
818 #  define ERRSV get_sv("@",FALSE)
819 #endif
820
821 #ifndef pTHX_
822 #define pTHX_
823 #endif   
824
825 #include <string.h>
826 #ifdef __cplusplus
827 }
828 #endif
829
830 /* -----------------------------------------------------------------------------
831  * error manipulation
832  * ----------------------------------------------------------------------------- */
833
834 SWIGINTERN const char*
835 SWIG_Perl_ErrorType(int code) {
836   const char* type = 0;
837   switch(code) {
838   case SWIG_MemoryError:
839     type = "MemoryError";
840     break;
841   case SWIG_IOError:
842     type = "IOError";
843     break;
844   case SWIG_RuntimeError:
845     type = "RuntimeError";
846     break;
847   case SWIG_IndexError:
848     type = "IndexError";
849     break;
850   case SWIG_TypeError:
851     type = "TypeError";
852     break;
853   case SWIG_DivisionByZero:
854     type = "ZeroDivisionError";
855     break;
856   case SWIG_OverflowError:
857     type = "OverflowError";
858     break;
859   case SWIG_SyntaxError:
860     type = "SyntaxError";
861     break;
862   case SWIG_ValueError:
863     type = "ValueError";
864     break;
865   case SWIG_SystemError:
866     type = "SystemError";
867     break;
868   case SWIG_AttributeError:
869     type = "AttributeError";
870     break;
871   default:
872     type = "RuntimeError";
873   }
874   return type;
875 }
876
877
878
879
880 /* -----------------------------------------------------------------------------
881  * perlrun.swg
882  *
883  * This file contains the runtime support for Perl modules
884  * and includes code for managing global variables and pointer
885  * type checking.
886  * ----------------------------------------------------------------------------- */
887
888 #ifdef PERL_OBJECT
889 #define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
890 #define SWIG_PERL_OBJECT_CALL pPerl,
891 #else
892 #define SWIG_PERL_OBJECT_DECL
893 #define SWIG_PERL_OBJECT_CALL
894 #endif
895
896 /* Common SWIG API */
897
898 /* for raw pointers */
899 #define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
900 #define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
901 #define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
902
903 /* for raw packed data */
904 #define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
905 #define SWIG_NewPackedObj(p, s, type)                   SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
906
907 /* for class or struct pointers */
908 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
909 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
910
911 /* for C or C++ function pointers */
912 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
913 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
914
915 /* for C++ member pointers, ie, member methods */
916 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
917 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
918
919
920 /* Runtime API */
921
922 #define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
923 #define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
924
925
926 /* Error manipulation */
927
928 #define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
929 #define SWIG_Error(code, msg)                           sv_setpvf(GvSV(PL_errgv),"%s %s\n", SWIG_ErrorType(code), msg)
930 #define SWIG_fail                                       goto fail                                                   
931
932 /* Perl-specific SWIG API */
933
934 #define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
935 #define SWIG_MakePackedObj(sv, p, s, type)              SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
936 #define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
937
938
939 #define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
940 #define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
941 #define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
942 #define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
943
944 /* -----------------------------------------------------------------------------
945  * pointers/data manipulation
946  * ----------------------------------------------------------------------------- */
947
948 /* For backward compatibility only */
949 #define SWIG_POINTER_EXCEPTION  0
950
951 #ifdef __cplusplus
952 extern "C" {
953 #endif
954
955 #define SWIG_OWNER   SWIG_POINTER_OWN
956 #define SWIG_SHADOW  SWIG_OWNER << 1
957
958 #define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
959
960 /* SWIG Perl macros */
961
962 /* Macro to declare an XS function */
963 #ifndef XSPROTO
964 #   define XSPROTO(name) void name(pTHX_ CV* cv)
965 #endif
966
967 /* Macro to call an XS function */
968 #ifdef PERL_OBJECT 
969 #  define SWIG_CALLXS(_name) _name(cv,pPerl) 
970 #else 
971 #  ifndef MULTIPLICITY 
972 #    define SWIG_CALLXS(_name) _name(cv) 
973 #  else 
974 #    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
975 #  endif 
976 #endif 
977
978 #ifdef PERL_OBJECT
979 #define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
980
981 #ifdef __cplusplus
982 extern "C" {
983 #endif
984 typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
985 #ifdef __cplusplus
986 }
987 #endif
988
989 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
990 #define SWIGCLASS_STATIC
991
992 #else /* PERL_OBJECT */
993
994 #define MAGIC_PPERL
995 #define SWIGCLASS_STATIC static SWIGUNUSED
996
997 #ifndef MULTIPLICITY
998 #define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
999
1000 #ifdef __cplusplus
1001 extern "C" {
1002 #endif
1003 typedef int (*SwigMagicFunc)(SV *, MAGIC *);
1004 #ifdef __cplusplus
1005 }
1006 #endif
1007
1008 #else /* MULTIPLICITY */
1009
1010 #define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
1011
1012 #ifdef __cplusplus
1013 extern "C" {
1014 #endif
1015 typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
1016 #ifdef __cplusplus
1017 }
1018 #endif
1019
1020 #endif /* MULTIPLICITY */
1021 #endif /* PERL_OBJECT */
1022
1023 /* Workaround for bug in perl 5.6.x croak and earlier */
1024 #if (PERL_VERSION < 8)
1025 #  ifdef PERL_OBJECT
1026 #    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
1027 static void SWIG_Perl_croak_null(CPerlObj *pPerl)
1028 #  else
1029 static void SWIG_croak_null()
1030 #  endif
1031 {
1032   SV *err=ERRSV;
1033 #  if (PERL_VERSION < 6)
1034   croak("%_", err);
1035 #  else
1036   if (SvOK(err) && !SvROK(err)) croak("%_", err);
1037   croak(Nullch);
1038 #  endif
1039 }
1040 #else
1041 #  define SWIG_croak_null() croak(Nullch)
1042 #endif
1043
1044
1045 /* 
1046    Define how strict is the cast between strings and integers/doubles
1047    when overloading between these types occurs.
1048    
1049    The default is making it as strict as possible by using SWIG_AddCast
1050    when needed.
1051    
1052    You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
1053    disable the SWIG_AddCast, making the casting between string and
1054    numbers less strict.
1055
1056    In the end, we try to solve the overloading between strings and
1057    numerical types in the more natural way, but if you can avoid it,
1058    well, avoid it using %rename, for example.
1059 */
1060 #ifndef SWIG_PERL_NO_STRICT_STR2NUM
1061 # ifndef SWIG_PERL_STRICT_STR2NUM
1062 #  define SWIG_PERL_STRICT_STR2NUM
1063 # endif
1064 #endif
1065 #ifdef SWIG_PERL_STRICT_STR2NUM
1066 /* string takes precedence */
1067 #define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
1068 #else
1069 /* number takes precedence */
1070 #define SWIG_Str2NumCast(x) x
1071 #endif
1072
1073
1074
1075 #include <stdlib.h>
1076
1077 SWIGRUNTIME const char *
1078 SWIG_Perl_TypeProxyName(const swig_type_info *type) {
1079   if (!type) return NULL;
1080   if (type->clientdata != NULL) {
1081     return (const char*) type->clientdata;
1082   } 
1083   else {
1084     return type->name;
1085   }
1086 }
1087
1088 /* Identical to SWIG_TypeCheck, except for strcmp comparison */
1089 SWIGRUNTIME swig_cast_info *
1090 SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
1091   if (ty) {
1092     swig_cast_info *iter = ty->cast;
1093     while (iter) {
1094       if ( (!iter->type->clientdata && (strcmp(iter->type->name, c) == 0)) ||
1095             (iter->type->clientdata && (strcmp((char*)iter->type->clientdata, c) == 0)) ) {
1096         if (iter == ty->cast)
1097           return iter;
1098         /* Move iter to the top of the linked list */
1099         iter->prev->next = iter->next;
1100         if (iter->next)
1101           iter->next->prev = iter->prev;
1102         iter->next = ty->cast;
1103         iter->prev = 0;
1104         if (ty->cast) ty->cast->prev = iter;
1105         ty->cast = iter;
1106         return iter;
1107       }
1108       iter = iter->next;
1109     }
1110   }
1111   return 0;
1112 }
1113
1114 /* Function for getting a pointer value */
1115
1116 SWIGRUNTIME int
1117 SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
1118   swig_cast_info *tc;
1119   void *voidptr = (void *)0;
1120   SV *tsv = 0;
1121
1122   if (own)
1123     *own = 0;
1124
1125   /* If magical, apply more magic */
1126   if (SvGMAGICAL(sv))
1127     mg_get(sv);
1128
1129   /* Check to see if this is an object */
1130   if (sv_isobject(sv)) {
1131     IV tmp = 0;
1132     tsv = (SV*) SvRV(sv);
1133     if ((SvTYPE(tsv) == SVt_PVHV)) {
1134       MAGIC *mg;
1135       if (SvMAGICAL(tsv)) {
1136         mg = mg_find(tsv,'P');
1137         if (mg) {
1138           sv = mg->mg_obj;
1139           if (sv_isobject(sv)) {
1140             tsv = (SV*)SvRV(sv);
1141             tmp = SvIV(tsv);
1142           }
1143         }
1144       } else {
1145         return SWIG_ERROR;
1146       }
1147     } else {
1148       tmp = SvIV(tsv);
1149     }
1150     voidptr = INT2PTR(void *,tmp);
1151   } else if (! SvOK(sv)) {            /* Check for undef */
1152     *(ptr) = (void *) 0;
1153     return SWIG_OK;
1154   } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
1155     if (!SvROK(sv)) {
1156       /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value.  */
1157       if (SvIOK(sv)) {
1158         return SWIG_ERROR;
1159       } else {
1160         /* NULL pointer (reference to undef). */
1161         *(ptr) = (void *) 0;
1162         return SWIG_OK;
1163       }
1164     } else {
1165       return SWIG_ERROR;
1166     }
1167   } else {                            /* Don't know what it is */
1168     return SWIG_ERROR;
1169   }
1170   if (_t) {
1171     /* Now see if the types match */
1172     char *_c = HvNAME(SvSTASH(SvRV(sv)));
1173     tc = SWIG_TypeProxyCheck(_c,_t);
1174     if (!tc) {
1175       return SWIG_ERROR;
1176     }
1177     {
1178       int newmemory = 0;
1179       *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
1180       if (newmemory == SWIG_CAST_NEW_MEMORY) {
1181         assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
1182         if (own)
1183           *own = *own | SWIG_CAST_NEW_MEMORY;
1184       }
1185     }
1186   } else {
1187     *ptr = voidptr;
1188   }
1189
1190   /* 
1191    *  DISOWN implementation: we need a perl guru to check this one.
1192    */
1193   if (tsv && (flags & SWIG_POINTER_DISOWN)) {
1194     /* 
1195      *  almost copy paste code from below SWIG_POINTER_OWN setting
1196      */
1197     SV *obj = sv;
1198     HV *stash = SvSTASH(SvRV(obj));
1199     GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1200     if (isGV(gv)) {
1201       HV *hv = GvHVn(gv);
1202       /*
1203        * To set ownership (see below), a newSViv(1) entry is added. 
1204        * Hence, to remove ownership, we delete the entry.
1205        */
1206       if (hv_exists_ent(hv, obj, 0)) {
1207         hv_delete_ent(hv, obj, 0, 0);
1208       }
1209     }
1210   }
1211   return SWIG_OK;
1212 }
1213
1214 SWIGRUNTIME int
1215 SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
1216   return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
1217 }
1218
1219 SWIGRUNTIME void
1220 SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
1221   if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
1222     SV *self;
1223     SV *obj=newSV(0);
1224     HV *hash=newHV();
1225     HV *stash;
1226     sv_setref_pv(obj, (char *) SWIG_Perl_TypeProxyName(t), ptr);
1227     stash=SvSTASH(SvRV(obj));
1228     if (flags & SWIG_POINTER_OWN) {
1229       HV *hv;
1230       GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
1231       if (!isGV(gv))
1232         gv_init(gv, stash, "OWNER", 5, FALSE);
1233       hv=GvHVn(gv);
1234       hv_store_ent(hv, obj, newSViv(1), 0);
1235     }
1236     sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
1237     SvREFCNT_dec(obj);
1238     self=newRV_noinc((SV *)hash);
1239     sv_setsv(sv, self);
1240     SvREFCNT_dec((SV *)self);
1241     sv_bless(sv, stash);
1242   }
1243   else {
1244     sv_setref_pv(sv, (char *) SWIG_Perl_TypeProxyName(t), ptr);
1245   }
1246 }
1247
1248 SWIGRUNTIMEINLINE SV *
1249 SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
1250   SV *result = sv_newmortal();
1251   SWIG_MakePtr(result, ptr, t, flags);
1252   return result;
1253 }
1254
1255 SWIGRUNTIME void
1256 SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
1257   char result[1024];
1258   char *r = result;
1259   if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
1260   *(r++) = '_';
1261   r = SWIG_PackData(r,ptr,sz);
1262   strcpy(r,SWIG_Perl_TypeProxyName(type));
1263   sv_setpv(sv, result);
1264 }
1265
1266 SWIGRUNTIME SV *
1267 SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
1268   SV *result = sv_newmortal();
1269   SWIG_Perl_MakePackedObj(result, ptr, sz, type);
1270   return result;
1271 }
1272
1273 /* Convert a packed value value */
1274 SWIGRUNTIME int
1275 SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
1276   swig_cast_info *tc;
1277   const char  *c = 0;
1278
1279   if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
1280   c = SvPV_nolen(obj);
1281   /* Pointer values must start with leading underscore */
1282   if (*c != '_') return SWIG_ERROR;
1283   c++;
1284   c = SWIG_UnpackData(c,ptr,sz);
1285   if (ty) {
1286     tc = SWIG_TypeCheck(c,ty);
1287     if (!tc) return SWIG_ERROR;
1288   }
1289   return SWIG_OK;
1290 }
1291
1292
1293 /* Macros for low-level exception handling */
1294 #define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
1295
1296
1297 typedef XSPROTO(SwigPerlWrapper);
1298 typedef SwigPerlWrapper *SwigPerlWrapperPtr;
1299
1300 /* Structure for command table */
1301 typedef struct {
1302   const char         *name;
1303   SwigPerlWrapperPtr  wrapper;
1304 } swig_command_info;
1305
1306 /* Information for constant table */
1307
1308 #define SWIG_INT     1
1309 #define SWIG_FLOAT   2
1310 #define SWIG_STRING  3
1311 #define SWIG_POINTER 4
1312 #define SWIG_BINARY  5
1313
1314 /* Constant information structure */
1315 typedef struct swig_constant_info {
1316     int              type;
1317     const char      *name;
1318     long             lvalue;
1319     double           dvalue;
1320     void            *pvalue;
1321     swig_type_info **ptype;
1322 } swig_constant_info;
1323
1324
1325 /* Structure for variable table */
1326 typedef struct {
1327   const char   *name;
1328   SwigMagicFunc   set;
1329   SwigMagicFunc   get;
1330   swig_type_info  **type;
1331 } swig_variable_info;
1332
1333 /* Magic variable code */
1334 #ifndef PERL_OBJECT
1335 #define swig_create_magic(s,a,b,c) _swig_create_magic(s,a,b,c)
1336   #ifndef MULTIPLICITY
1337      SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
1338   #else
1339      SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
1340   #endif
1341 #else
1342 #  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
1343 SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
1344 #endif
1345 {
1346   MAGIC *mg;
1347   sv_magic(sv,sv,'U',(char *) name,strlen(name));
1348   mg = mg_find(sv,'U');
1349   mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
1350   mg->mg_virtual->svt_get = (SwigMagicFunc) get;
1351   mg->mg_virtual->svt_set = (SwigMagicFunc) set;
1352   mg->mg_virtual->svt_len = 0;
1353   mg->mg_virtual->svt_clear = 0;
1354   mg->mg_virtual->svt_free = 0;
1355 }
1356
1357
1358 SWIGRUNTIME swig_module_info *
1359 SWIG_Perl_GetModule(void) {
1360   static void *type_pointer = (void *)0;
1361   SV *pointer;
1362
1363   /* first check if pointer already created */
1364   if (!type_pointer) {
1365     pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
1366     if (pointer && SvOK(pointer)) {
1367       type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
1368     }
1369   }
1370
1371   return (swig_module_info *) type_pointer;
1372 }
1373
1374 SWIGRUNTIME void
1375 SWIG_Perl_SetModule(swig_module_info *module) {
1376   SV *pointer;
1377
1378   /* create a new pointer */
1379   pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
1380   sv_setiv(pointer, PTR2IV(module));
1381 }
1382
1383 #ifdef __cplusplus
1384 }
1385 #endif
1386
1387 /* Workaround perl5 global namespace pollution. Note that undefining library
1388  * functions like fopen will not solve the problem on all platforms as fopen
1389  * might be a macro on Windows but not necessarily on other operating systems. */
1390 #ifdef do_open
1391   #undef do_open
1392 #endif
1393 #ifdef do_close
1394   #undef do_close
1395 #endif
1396 #ifdef do_exec
1397   #undef do_exec
1398 #endif
1399 #ifdef scalar
1400   #undef scalar
1401 #endif
1402 #ifdef list
1403   #undef list
1404 #endif
1405 #ifdef apply
1406   #undef apply
1407 #endif
1408 #ifdef convert
1409   #undef convert
1410 #endif
1411 #ifdef Error
1412   #undef Error
1413 #endif
1414 #ifdef form
1415   #undef form
1416 #endif
1417 #ifdef vform
1418   #undef vform
1419 #endif
1420 #ifdef LABEL
1421   #undef LABEL
1422 #endif
1423 #ifdef METHOD
1424   #undef METHOD
1425 #endif
1426 #ifdef Move
1427   #undef Move
1428 #endif
1429 #ifdef yylex
1430   #undef yylex
1431 #endif
1432 #ifdef yyparse
1433   #undef yyparse
1434 #endif
1435 #ifdef yyerror
1436   #undef yyerror
1437 #endif
1438 #ifdef invert
1439   #undef invert
1440 #endif
1441 #ifdef ref
1442   #undef ref
1443 #endif
1444 #ifdef read
1445   #undef read
1446 #endif
1447 #ifdef write
1448   #undef write
1449 #endif
1450 #ifdef eof
1451   #undef eof
1452 #endif
1453 #ifdef bool
1454   #undef bool
1455 #endif
1456 #ifdef close
1457   #undef close
1458 #endif
1459 #ifdef rewind
1460   #undef rewind
1461 #endif
1462 #ifdef free
1463   #undef free
1464 #endif
1465 #ifdef malloc
1466   #undef malloc
1467 #endif
1468 #ifdef calloc
1469   #undef calloc
1470 #endif
1471 #ifdef Stat
1472   #undef Stat
1473 #endif
1474 #ifdef check
1475   #undef check
1476 #endif
1477 #ifdef seekdir
1478   #undef seekdir
1479 #endif
1480 #ifdef open
1481   #undef open
1482 #endif
1483 #ifdef readdir
1484   #undef readdir
1485 #endif
1486 #ifdef bind
1487   #undef bind
1488 #endif
1489 #ifdef access
1490   #undef access
1491 #endif
1492 #ifdef stat
1493   #undef stat
1494 #endif
1495
1496
1497
1498 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
1499
1500 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
1501
1502
1503
1504   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
1505
1506
1507 /* -------- TYPES TABLE (BEGIN) -------- */
1508
1509 #define SWIGTYPE_p_Device swig_types[0]
1510 #define SWIGTYPE_p_DevicePropertyBase swig_types[1]
1511 #define SWIGTYPE_p_DirectTCPAddr swig_types[2]
1512 #define SWIGTYPE_p_DirectTCPConnection swig_types[3]
1513 #define SWIGTYPE_p_GSList swig_types[4]
1514 #define SWIGTYPE_p_GValue swig_types[5]
1515 #define SWIGTYPE_p_a_STRMAX__char swig_types[6]
1516 #define SWIGTYPE_p_char swig_types[7]
1517 #define SWIGTYPE_p_double swig_types[8]
1518 #define SWIGTYPE_p_dumpfile_t swig_types[9]
1519 #define SWIGTYPE_p_float swig_types[10]
1520 #define SWIGTYPE_p_guint swig_types[11]
1521 #define SWIGTYPE_p_guint32 swig_types[12]
1522 #define SWIGTYPE_p_guint64 swig_types[13]
1523 #define SWIGTYPE_p_int swig_types[14]
1524 #define SWIGTYPE_p_p_DirectTCPAddr swig_types[15]
1525 #define SWIGTYPE_p_unsigned_char swig_types[16]
1526 static swig_type_info *swig_types[18];
1527 static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
1528 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1529 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1530
1531 /* -------- TYPES TABLE (END) -------- */
1532
1533 #define SWIG_init    boot_Amanda__Device
1534
1535 #define SWIG_name   "Amanda::Devicec::boot_Amanda__Device"
1536 #define SWIG_prefix "Amanda::Devicec::"
1537
1538 #define SWIGVERSION 0x020004 
1539 #define SWIG_VERSION SWIGVERSION
1540
1541
1542 #define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
1543 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
1544
1545
1546 #ifdef __cplusplus
1547 extern "C"
1548 #endif
1549 #ifndef PERL_OBJECT
1550 #ifndef MULTIPLICITY
1551 SWIGEXPORT void SWIG_init (CV* cv);
1552 #else
1553 SWIGEXPORT void SWIG_init (pTHXo_ CV* cv);
1554 #endif
1555 #else
1556 SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
1557 #endif
1558
1559
1560 #include "amglue.h"
1561
1562
1563 #include "amglue.h"
1564
1565
1566 #include "amglue.h"
1567
1568
1569 #include "device.h"
1570 #include "property.h"
1571 #include "fileheader.h"
1572 #include "glib-util.h"
1573 #include "simpleprng.h"
1574 #include "amanda.h"
1575 #include "sockaddr-util.h"
1576
1577
1578
1579 /* Utility functions for typemaps, below */
1580
1581 /* return a new, mortal SV corresponding to the given GValue
1582  *
1583  * @param value: the value to convert
1584  * @returns: a new, mortal SV
1585  */
1586 static SV *
1587 set_sv_from_gvalue(GValue *value)
1588 {
1589     GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
1590     SV *sv = NULL;
1591
1592     /* complex reference types */
1593     switch (fundamental) {
1594         case G_TYPE_LONG:
1595             return sv_2mortal(amglue_newSVi64(g_value_get_long(value)));
1596
1597         case G_TYPE_ULONG:
1598             return sv_2mortal(amglue_newSVu64(g_value_get_ulong(value)));
1599
1600         case G_TYPE_INT64:
1601             return sv_2mortal(amglue_newSVi64(g_value_get_int64(value)));
1602
1603         case G_TYPE_UINT64:
1604             return sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
1605     }
1606
1607     /* simple types that can be constructed with sv_set*v */
1608     sv = sv_newmortal();
1609     switch (fundamental) {
1610         case G_TYPE_CHAR:
1611             sv_setiv(sv, g_value_get_char(value));
1612             break;
1613
1614         case G_TYPE_UCHAR:
1615             sv_setuv(sv, g_value_get_uchar(value));
1616             break;
1617
1618         case G_TYPE_BOOLEAN:
1619             sv_setiv(sv, g_value_get_boolean(value));
1620             break;
1621
1622         case G_TYPE_INT:
1623             sv_setiv(sv, g_value_get_int(value));
1624             break;
1625
1626         case G_TYPE_UINT:
1627             sv_setuv(sv, g_value_get_uint(value));
1628             break;
1629
1630         case G_TYPE_FLOAT:
1631             sv_setnv(sv, g_value_get_float(value));
1632             break;
1633
1634         case G_TYPE_DOUBLE:
1635             sv_setnv(sv, g_value_get_double(value));
1636             break;
1637
1638         case G_TYPE_STRING:
1639             sv_setpv(sv, g_value_get_string(value));
1640             break;
1641
1642         case G_TYPE_ENUM:
1643             sv_setiv(sv, g_value_get_enum(value));
1644             break;
1645
1646         case G_TYPE_FLAGS:
1647             sv_setiv(sv, g_value_get_flags(value));
1648             break;
1649
1650         /* Unsupported */
1651         default:
1652         case G_TYPE_POINTER:
1653         case G_TYPE_INTERFACE:
1654         case G_TYPE_OBJECT:
1655         case G_TYPE_PARAM:
1656             warn("Unsupported fundamental property type #%d", (int)fundamental);
1657             sv_setsv(sv, &PL_sv_undef);
1658             break;
1659     }
1660
1661     return sv;
1662 }
1663
1664 /* Given an SV and an initialized GValue, set the GValue to the value
1665  * represented by the SV.  The GValue's type must already be set.
1666  *
1667  * For basic corresponding types (string -> string, integer -> integer),
1668  * the translation is straightforward.  However, if the GValue is not a
1669  * string, but the SV has a string value, then g_value_set_from_string will
1670  * be used to parse the string.
1671  *
1672  * @param sv: SV to convert
1673  * @param value: (input/output) destination
1674  * @returns: TRUE on success
1675  */
1676 static gboolean
1677 set_gvalue_from_sv(SV *sv, GValue *value)
1678 {
1679     GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
1680
1681     /* if we got a string, use g_value_set_from_string to parse any funny
1682      * values or suffixes */
1683     if (SvPOK(sv)) {
1684         if (g_value_set_from_string(value, SvPV_nolen(sv)))
1685             return TRUE;
1686     }
1687
1688     /* otherwise, handle numeric types with SvIV, SvNV, or the amglue_* functions */
1689     switch (fundamental) {
1690         case G_TYPE_BOOLEAN:
1691             g_value_set_boolean(value, SvIV(sv));
1692             return TRUE;
1693
1694         case G_TYPE_CHAR:
1695             g_value_set_char(value, amglue_SvI8(sv));
1696             return TRUE;
1697
1698         case G_TYPE_UCHAR:
1699             g_value_set_uchar(value, amglue_SvU8(sv));
1700             return TRUE;
1701
1702         case G_TYPE_INT:
1703             g_value_set_int(value, amglue_SvI32(sv));
1704             return TRUE;
1705
1706         case G_TYPE_UINT:
1707             g_value_set_uint(value, amglue_SvU32(sv));
1708             return TRUE;
1709
1710         case G_TYPE_LONG:
1711             g_value_set_int64(value, amglue_SvI64(sv));
1712             return TRUE;
1713
1714         case G_TYPE_ULONG:
1715             g_value_set_uint64(value, amglue_SvU64(sv));
1716             return TRUE;
1717
1718         case G_TYPE_INT64:
1719             g_value_set_int64(value, amglue_SvI64(sv));
1720             return TRUE;
1721
1722         case G_TYPE_UINT64:
1723             g_value_set_uint64(value, amglue_SvU64(sv));
1724             return TRUE;
1725
1726         case G_TYPE_FLOAT:
1727             g_value_set_float(value, SvNV(sv));
1728             return TRUE;
1729
1730         case G_TYPE_DOUBLE:
1731             g_value_set_double(value, SvNV(sv));
1732             return TRUE;
1733
1734         case G_TYPE_ENUM:
1735             g_value_set_enum(value, SvIV(sv));
1736             return TRUE;
1737
1738         case G_TYPE_FLAGS:
1739             g_value_set_flags(value, SvIV(sv));
1740             return TRUE;
1741
1742         default:
1743             /* for anything else, let perl stringify it for us and try parsing it */
1744             return g_value_set_from_string(value, SvPV_nolen(sv));
1745     }
1746 }
1747
1748
1749 SWIGINTERN void delete_DirectTCPConnection(DirectTCPConnection *self){
1750             g_object_unref(self);
1751         }
1752 SWIGINTERN char *DirectTCPConnection_close(DirectTCPConnection *self){
1753             return directtcp_connection_close(self);
1754         }
1755
1756 SWIGINTERNINLINE SV *
1757 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1758 {
1759   SV *obj = sv_newmortal();
1760   if (carray) {
1761     sv_setpvn(obj, carray, size);
1762   } else {
1763     sv_setsv(obj, &PL_sv_undef);
1764   }
1765   return obj;
1766 }
1767
1768
1769 SWIGINTERNINLINE SV * 
1770 SWIG_FromCharPtr(const char *cptr)
1771
1772   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1773 }
1774
1775
1776 SWIGINTERN swig_type_info*
1777 SWIG_pchar_descriptor(void)
1778 {
1779   static int init = 0;
1780   static swig_type_info* info = 0;
1781   if (!init) {
1782     info = SWIG_TypeQuery("_p_char");
1783     init = 1;
1784   }
1785   return info;
1786 }
1787
1788
1789 SWIGINTERN int
1790 SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
1791 {
1792   if (SvMAGICAL(obj)) {
1793      SV *tmp = sv_newmortal();
1794      SvSetSV(tmp, obj);
1795      obj = tmp;
1796   }
1797   if (SvPOK(obj)) {
1798     STRLEN len = 0;
1799     char *cstr = SvPV(obj, len); 
1800     size_t size = len + 1;
1801     if (cptr)  {
1802       if (alloc) {
1803         if (*alloc == SWIG_NEWOBJ) {
1804           *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1805         } else {
1806           *cptr = cstr;
1807           *alloc = SWIG_OLDOBJ;
1808         }
1809       }
1810     }
1811     if (psize) *psize = size;
1812     return SWIG_OK;
1813   } else {
1814     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1815     if (pchar_descriptor) {
1816       char* vptr = 0; 
1817       if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
1818         if (cptr) *cptr = vptr;
1819         if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
1820         if (alloc) *alloc = SWIG_OLDOBJ;
1821         return SWIG_OK;
1822       }
1823     }
1824   }
1825   return SWIG_TypeError;
1826 }
1827
1828
1829
1830
1831 SWIGINTERN Device *new_Device(char *device_name){
1832             return device_open(device_name);
1833         }
1834 SWIGINTERN void delete_Device(Device *self){
1835             g_object_unref(self);
1836         }
1837
1838 #include <limits.h>
1839 #if !defined(SWIG_NO_LLONG_MAX)
1840 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1841 #   define LLONG_MAX __LONG_LONG_MAX__
1842 #   define LLONG_MIN (-LLONG_MAX - 1LL)
1843 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1844 # endif
1845 #endif
1846
1847
1848 SWIGINTERN int
1849 SWIG_AsVal_double SWIG_PERL_DECL_ARGS_2(SV *obj, double *val)
1850 {
1851   if (SvNIOK(obj)) {
1852     if (val) *val = SvNV(obj);
1853     return SWIG_OK;
1854   } else if (SvIOK(obj)) {
1855     if (val) *val = (double) SvIV(obj);
1856     return SWIG_AddCast(SWIG_OK);
1857   } else {
1858     const char *nptr = SvPV_nolen(obj);
1859     if (nptr) {
1860       char *endptr;
1861       double v;
1862       errno = 0;
1863       v = strtod(nptr, &endptr);
1864       if (errno == ERANGE) {
1865         errno = 0;
1866         return SWIG_OverflowError;
1867       } else {
1868         if (*endptr == '\0') {
1869           if (val) *val = v;
1870           return SWIG_Str2NumCast(SWIG_OK);
1871         }
1872       }
1873     }
1874   }
1875   return SWIG_TypeError;
1876 }
1877
1878
1879 #include <float.h>
1880
1881
1882 #include <math.h>
1883
1884
1885 SWIGINTERNINLINE int
1886 SWIG_CanCastAsInteger(double *d, double min, double max) {
1887   double x = *d;
1888   if ((min <= x && x <= max)) {
1889    double fx = floor(x);
1890    double cx = ceil(x);
1891    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
1892    if ((errno == EDOM) || (errno == ERANGE)) {
1893      errno = 0;
1894    } else {
1895      double summ, reps, diff;
1896      if (rd < x) {
1897        diff = x - rd;
1898      } else if (rd > x) {
1899        diff = rd - x;
1900      } else {
1901        return 1;
1902      }
1903      summ = rd + x;
1904      reps = diff/summ;
1905      if (reps < 8*DBL_EPSILON) {
1906        *d = rd;
1907        return 1;
1908      }
1909    }
1910   }
1911   return 0;
1912 }
1913
1914
1915 SWIGINTERN int
1916 SWIG_AsVal_long SWIG_PERL_DECL_ARGS_2(SV *obj, long* val)
1917 {
1918   if (SvIOK(obj)) {
1919     if (val) *val = SvIV(obj);
1920     return SWIG_OK;
1921   } else {
1922     int dispatch = 0;
1923     const char *nptr = SvPV_nolen(obj);
1924     if (nptr) {
1925       char *endptr;
1926       long v;
1927       errno = 0;
1928       v = strtol(nptr, &endptr,0);
1929       if (errno == ERANGE) {
1930         errno = 0;
1931         return SWIG_OverflowError;
1932       } else {
1933         if (*endptr == '\0') {
1934           if (val) *val = v;
1935           return SWIG_Str2NumCast(SWIG_OK);
1936         }
1937       }
1938     }
1939     if (!dispatch) {
1940       double d;
1941       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
1942       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
1943         if (val) *val = (long)(d);
1944         return res;
1945       }
1946     }
1947   }
1948   return SWIG_TypeError;
1949 }
1950
1951
1952 SWIGINTERN int
1953 SWIG_AsVal_int SWIG_PERL_DECL_ARGS_2(SV * obj, int *val)
1954 {
1955   long v;
1956   int res = SWIG_AsVal_long SWIG_PERL_CALL_ARGS_2(obj, &v);
1957   if (SWIG_IsOK(res)) {
1958     if ((v < INT_MIN || v > INT_MAX)) {
1959       return SWIG_OverflowError;
1960     } else {
1961       if (val) *val = (int)(v);
1962     }
1963   }  
1964   return res;
1965 }
1966
1967 SWIGINTERN gboolean Device_configure(Device *self,gboolean use_global_config){
1968             return device_configure(self, use_global_config);
1969         }
1970 SWIGINTERN char *Device_error(Device *self){
1971             return device_error(self);
1972         }
1973 SWIGINTERN char *Device_status_error(Device *self){
1974             return device_status_error(self);
1975         }
1976 SWIGINTERN char *Device_error_or_status(Device *self){
1977             return device_error_or_status(self);
1978         }
1979 SWIGINTERN DeviceStatusFlags Device_read_label(Device *self){
1980             return device_read_label(self);
1981         }
1982 SWIGINTERN gboolean Device_start(Device *self,DeviceAccessMode mode,char *label,char *timestamp){
1983             return device_start(self, mode, label, timestamp);
1984         }
1985 SWIGINTERN gboolean Device_finish(Device *self){
1986             return device_finish(self);
1987         }
1988 SWIGINTERN gboolean Device_start_file(Device *self,dumpfile_t *jobInfo){
1989             return device_start_file(self, jobInfo);
1990         }
1991 SWIGINTERN gboolean Device_write_block(Device *self,guint size,gpointer data){
1992             return device_write_block(self, size, data);
1993         }
1994 SWIGINTERN gboolean Device_finish_file(Device *self){
1995             return device_finish_file(self);
1996         }
1997 SWIGINTERN dumpfile_t *Device_seek_file(Device *self,guint file){
1998             return device_seek_file(self, file);
1999         }
2000 SWIGINTERN gboolean Device_seek_block(Device *self,guint64 block){
2001             return device_seek_block(self, block);
2002         }
2003 SWIGINTERN int Device_read_block(Device *self,gpointer buffer,int *size){
2004             return device_read_block(self, buffer, size);
2005         }
2006 SWIGINTERN gboolean Device_erase(Device *self){
2007             return device_erase(self);
2008         }
2009 SWIGINTERN gboolean Device_eject(Device *self){
2010             return device_eject(self);
2011         }
2012 SWIGINTERN gboolean Device_directtcp_supported(Device *self){
2013             return device_directtcp_supported(self);
2014         }
2015 SWIGINTERN void Device_listen(Device *self,gboolean for_writing,DirectTCPAddr **addrs){
2016             /* ensure that the addresses are empty if there was an error */
2017             if (!device_listen(self, for_writing, addrs))
2018                 *addrs = NULL;
2019         }
2020 SWIGINTERN DirectTCPConnection *Device_accept(Device *self){
2021             DirectTCPConnection *conn = NULL;
2022             gboolean rv;
2023
2024             rv = device_accept(self, &conn, NULL, NULL);
2025             if (!rv && conn) {
2026                 /* conn is ref'd for our convenience, but we don't want it */
2027                 g_object_unref(conn);
2028                 conn = NULL;
2029             }
2030             return conn;
2031         }
2032 SWIGINTERN DirectTCPConnection *Device_connect(Device *self,gboolean for_writing,DirectTCPAddr *addrs){
2033             DirectTCPConnection *conn = NULL;
2034             gboolean rv;
2035
2036             rv = device_connect(self, for_writing, addrs, &conn, NULL, NULL);
2037             if (!rv && conn) {
2038                 /* conn is ref'd for our convenience, but we don't want it */
2039                 g_object_unref(conn);
2040                 conn = NULL;
2041             }
2042             return conn;
2043         }
2044 SWIGINTERN gboolean Device_use_connection(Device *self,DirectTCPConnection *conn){
2045             return device_use_connection(self, conn);
2046         }
2047 SWIGINTERN gboolean Device_write_from_connection(Device *self,guint64 size,guint64 *actual_size){
2048             return device_write_from_connection(self, size, actual_size);
2049         }
2050 SWIGINTERN gboolean Device_read_to_connection(Device *self,guint64 size,guint64 *actual_size){
2051             return device_read_to_connection(self, size, actual_size);
2052         }
2053 SWIGINTERN GSList const *Device_property_list(Device *self){
2054             return device_property_get_list(self);
2055         }
2056 SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValue *out_val,PropertySurety *surety,PropertySource *source,gboolean *val_found){
2057             if (pbase) {
2058                 *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
2059             } else {
2060                 *val_found = FALSE;
2061             }
2062         }
2063 SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,SV *sv){
2064             GValue gval;
2065
2066             if (!pbase)
2067                 goto fail;
2068             memset(&gval, 0, sizeof(gval));
2069             g_value_init(&gval, pbase->type);
2070             if (!set_gvalue_from_sv(sv, &gval))
2071                 goto failunset;
2072
2073             if (!device_property_set(self, pbase->ID, &gval))
2074                 goto failunset;
2075
2076             g_value_unset(&gval);
2077             return TRUE;
2078         failunset:
2079             g_value_unset(&gval);
2080         fail:
2081             return FALSE;
2082         }
2083 SWIGINTERN gboolean Device_property_set_ex(Device *self,DevicePropertyBase *pbase,SV *sv,PropertySurety surety,PropertySource source){
2084             GValue gval;
2085             memset(&gval, 0, sizeof(gval));
2086             g_value_init(&gval, pbase->type);
2087             if (!set_gvalue_from_sv(sv, &gval))
2088                 goto fail;
2089
2090             if (!device_property_set_ex(self, pbase->ID, &gval, surety, source))
2091                 goto fail;
2092
2093             g_value_unset(&gval);
2094             return TRUE;
2095         fail:
2096             g_value_unset(&gval);
2097             return FALSE;
2098         }
2099 SWIGINTERN gboolean Device_recycle_file(Device *self,guint filenum){
2100             return device_recycle_file(self, filenum);
2101         }
2102 SWIGINTERN int Device_file(Device *self){ return self->file; }
2103 SWIGINTERN guint64 Device_block(Device *self){ return self->block; }
2104 SWIGINTERN gboolean Device_in_file(Device *self){ return self->in_file; }
2105 SWIGINTERN char *Device_device_name(Device *self){ return self->device_name; }
2106 SWIGINTERN DeviceAccessMode Device_access_mode(Device *self){ return self->access_mode; }
2107 SWIGINTERN gboolean Device_is_eof(Device *self){ return self->is_eof; }
2108 SWIGINTERN gboolean Device_is_eom(Device *self){ return self->is_eom; }
2109 SWIGINTERN char *Device_volume_label(Device *self){ return self->volume_label; }
2110 SWIGINTERN char *Device_volume_time(Device *self){ return self->volume_time; }
2111 SWIGINTERN DeviceStatusFlags Device_status(Device *self){ return self->status; }
2112 SWIGINTERN gsize Device_min_block_size(Device *self){ return self->min_block_size; }
2113 SWIGINTERN gsize Device_max_block_size(Device *self){ return self->max_block_size; }
2114 SWIGINTERN gsize Device_block_size(Device *self){ return self->block_size; }
2115 SWIGINTERN gsize Device_header_block_size(Device *self){ return self->header_block_size; }
2116 SWIGINTERN dumpfile_t *Device_volume_header(Device *self){ return self->volume_header; }
2117
2118
2119 /* write LENGTH bytes of random data to FILENAME, seeded with SEED */
2120 gboolean
2121 write_random_to_device(guint32 seed, size_t length, Device *device) {
2122     simpleprng_state_t prng;
2123     char *buf;
2124     gsize block_size = device->block_size;
2125     g_assert(block_size < G_MAXUINT);
2126
2127     buf = g_malloc(block_size);
2128     simpleprng_seed(&prng, seed);
2129
2130     while (length) {
2131         size_t to_write = min(block_size, length);
2132
2133         simpleprng_fill_buffer(&prng, buf, to_write);
2134         if (!device_write_block(device, (guint)block_size, buf)) {
2135             g_free(buf);
2136             return FALSE;
2137         }
2138         length -= to_write;
2139     }
2140
2141     g_free(buf);
2142     return TRUE;
2143 }
2144
2145 /* read LENGTH bytes of random data from FILENAME verifying it against
2146  * a PRNG seeded with SEED.  Sends any error messages to stderr.
2147  */
2148 gboolean
2149 verify_random_from_device(guint32 seed, size_t length, Device *device) {
2150     simpleprng_state_t prng;
2151     char *buf = NULL; /* first device_read_block will get the size */
2152     int block_size = 0;
2153
2154     simpleprng_seed(&prng, seed);
2155
2156     while (length) {
2157         int bytes_read;
2158         int size = block_size;
2159
2160         bytes_read = device_read_block(device, buf, &size);
2161         if (bytes_read == 0 && size > block_size) {
2162             g_free(buf);
2163             block_size = size;
2164             buf = g_malloc(block_size);
2165             continue;
2166         }
2167         if (bytes_read == -1) {
2168             if (device->status == DEVICE_STATUS_SUCCESS) {
2169                 g_assert(device->is_eof);
2170                 g_debug("verify_random_from_device got unexpected EOF");
2171             }
2172             goto error;
2173         }
2174
2175         /* strip padding */
2176         bytes_read = min(bytes_read, length);
2177
2178         if (!simpleprng_verify_buffer(&prng, buf, bytes_read))
2179             goto error;
2180
2181         length -= bytes_read;
2182     }
2183
2184     g_free(buf);
2185     return TRUE;
2186
2187 error:
2188     g_free(buf);
2189     return FALSE;
2190 }
2191
2192
2193 SWIGINTERN int
2194 SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val) 
2195 {
2196   if (SvUOK(obj)) {
2197     if (val) *val = SvUV(obj);
2198     return SWIG_OK;
2199   } else  if (SvIOK(obj)) {
2200     long v = SvIV(obj);
2201     if (v >= 0) {
2202       if (val) *val = v;
2203       return SWIG_OK;
2204     } else {
2205       return SWIG_OverflowError;
2206     }
2207   } else {
2208     int dispatch = 0;
2209     const char *nptr = SvPV_nolen(obj);
2210     if (nptr) {
2211       char *endptr;
2212       unsigned long v;
2213       errno = 0;
2214       v = strtoul(nptr, &endptr,0);
2215       if (errno == ERANGE) {
2216         errno = 0;
2217         return SWIG_OverflowError;
2218       } else {
2219         if (*endptr == '\0') {
2220           if (val) *val = v;
2221           return SWIG_Str2NumCast(SWIG_OK);
2222         }
2223       }
2224     }
2225     if (!dispatch) {
2226       double d;
2227       int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
2228       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
2229         if (val) *val = (unsigned long)(d);
2230         return res;
2231       }
2232     }
2233   }
2234   return SWIG_TypeError;
2235 }
2236
2237
2238 SWIGINTERNINLINE int
2239 SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
2240 {
2241   unsigned long v;
2242   int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
2243   if (SWIG_IsOK(res) && val) *val = (size_t)(v);
2244   return res;
2245 }
2246
2247
2248 SWIGINTERNINLINE SV *
2249 SWIG_From_long  SWIG_PERL_DECL_ARGS_1(long value)
2250 {    
2251   SV *obj = sv_newmortal();
2252   sv_setiv(obj, (IV) value);
2253   return obj;
2254 }
2255
2256
2257 SWIGINTERNINLINE SV *
2258 SWIG_From_int  SWIG_PERL_DECL_ARGS_1(int value)
2259 {    
2260   return SWIG_From_long  SWIG_PERL_CALL_ARGS_1(value);
2261 }
2262
2263 #ifdef __cplusplus
2264 extern "C" {
2265 #endif
2266
2267 #ifdef PERL_OBJECT
2268 #define MAGIC_CLASS _wrap_Amanda__Device_var::
2269 class _wrap_Amanda__Device_var : public CPerlObj {
2270 public:
2271 #else
2272 #define MAGIC_CLASS
2273 #endif
2274 SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
2275     MAGIC_PPERL
2276     croak("Value is read-only.");
2277     return 0;
2278 }
2279
2280
2281 #ifdef PERL_OBJECT
2282 };
2283 #endif
2284
2285 #ifdef __cplusplus
2286 }
2287 #endif
2288
2289 #ifdef __cplusplus
2290 extern "C" {
2291 #endif
2292 XS(_wrap_delete_DirectTCPConnection) {
2293   {
2294     DirectTCPConnection *arg1 = (DirectTCPConnection *) 0 ;
2295     void *argp1 = 0 ;
2296     int res1 = 0 ;
2297     int argvi = 0;
2298     dXSARGS;
2299     
2300     if ((items < 1) || (items > 1)) {
2301       SWIG_croak("Usage: delete_DirectTCPConnection(self);");
2302     }
2303     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_DirectTCPConnection, SWIG_POINTER_DISOWN |  0 );
2304     if (!SWIG_IsOK(res1)) {
2305       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DirectTCPConnection" "', argument " "1"" of type '" "DirectTCPConnection *""'"); 
2306     }
2307     arg1 = (DirectTCPConnection *)(argp1);
2308     delete_DirectTCPConnection(arg1);
2309     ST(argvi) = sv_newmortal();
2310     
2311     XSRETURN(argvi);
2312   fail:
2313     
2314     SWIG_croak_null();
2315   }
2316 }
2317
2318
2319 XS(_wrap_DirectTCPConnection_close) {
2320   {
2321     DirectTCPConnection *arg1 = (DirectTCPConnection *) 0 ;
2322     void *argp1 = 0 ;
2323     int res1 = 0 ;
2324     int argvi = 0;
2325     char *result = 0 ;
2326     dXSARGS;
2327     
2328     if ((items < 1) || (items > 1)) {
2329       SWIG_croak("Usage: DirectTCPConnection_close(self);");
2330     }
2331     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_DirectTCPConnection, 0 |  0 );
2332     if (!SWIG_IsOK(res1)) {
2333       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirectTCPConnection_close" "', argument " "1"" of type '" "DirectTCPConnection *""'"); 
2334     }
2335     arg1 = (DirectTCPConnection *)(argp1);
2336     result = (char *)DirectTCPConnection_close(arg1);
2337     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2338     
2339     free((char*)result);
2340     XSRETURN(argvi);
2341   fail:
2342     
2343     SWIG_croak_null();
2344   }
2345 }
2346
2347
2348 XS(_wrap_new_DirectTCPConnection) {
2349   {
2350     int argvi = 0;
2351     DirectTCPConnection *result = 0 ;
2352     dXSARGS;
2353     
2354     if ((items < 0) || (items > 0)) {
2355       SWIG_croak("Usage: new_DirectTCPConnection();");
2356     }
2357     result = (DirectTCPConnection *)calloc(1, sizeof(DirectTCPConnection));
2358     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2359     XSRETURN(argvi);
2360   fail:
2361     SWIG_croak_null();
2362   }
2363 }
2364
2365
2366 XS(_wrap_unaliased_name) {
2367   {
2368     char *arg1 = (char *) 0 ;
2369     int res1 ;
2370     char *buf1 = 0 ;
2371     int alloc1 = 0 ;
2372     int argvi = 0;
2373     char *result = 0 ;
2374     dXSARGS;
2375     
2376     if ((items < 1) || (items > 1)) {
2377       SWIG_croak("Usage: unaliased_name(char *);");
2378     }
2379     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2380     if (!SWIG_IsOK(res1)) {
2381       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "unaliased_name" "', argument " "1"" of type '" "char *""'");
2382     }
2383     arg1 = (char *)(buf1);
2384     result = (char *)device_unaliased_name(arg1);
2385     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2386     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2387     XSRETURN(argvi);
2388   fail:
2389     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2390     SWIG_croak_null();
2391   }
2392 }
2393
2394
2395 XS(_wrap_new_Device) {
2396   {
2397     char *arg1 = (char *) 0 ;
2398     int res1 ;
2399     char *buf1 = 0 ;
2400     int alloc1 = 0 ;
2401     int argvi = 0;
2402     Device *result = 0 ;
2403     dXSARGS;
2404     
2405     if ((items < 1) || (items > 1)) {
2406       SWIG_croak("Usage: new_Device(device_name);");
2407     }
2408     res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
2409     if (!SWIG_IsOK(res1)) {
2410       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Device" "', argument " "1"" of type '" "char *""'");
2411     }
2412     arg1 = (char *)(buf1);
2413     result = (Device *)new_Device(arg1);
2414     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Device, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
2415     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2416     XSRETURN(argvi);
2417   fail:
2418     if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2419     SWIG_croak_null();
2420   }
2421 }
2422
2423
2424 XS(_wrap_delete_Device) {
2425   {
2426     Device *arg1 = (Device *) 0 ;
2427     void *argp1 = 0 ;
2428     int res1 = 0 ;
2429     int argvi = 0;
2430     dXSARGS;
2431     
2432     if ((items < 1) || (items > 1)) {
2433       SWIG_croak("Usage: delete_Device(self);");
2434     }
2435     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, SWIG_POINTER_DISOWN |  0 );
2436     if (!SWIG_IsOK(res1)) {
2437       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Device" "', argument " "1"" of type '" "Device *""'"); 
2438     }
2439     arg1 = (Device *)(argp1);
2440     delete_Device(arg1);
2441     ST(argvi) = sv_newmortal();
2442     
2443     XSRETURN(argvi);
2444   fail:
2445     
2446     SWIG_croak_null();
2447   }
2448 }
2449
2450
2451 XS(_wrap_Device_configure) {
2452   {
2453     Device *arg1 = (Device *) 0 ;
2454     gboolean arg2 ;
2455     void *argp1 = 0 ;
2456     int res1 = 0 ;
2457     int argvi = 0;
2458     gboolean result;
2459     dXSARGS;
2460     
2461     if ((items < 2) || (items > 2)) {
2462       SWIG_croak("Usage: Device_configure(self,use_global_config);");
2463     }
2464     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2465     if (!SWIG_IsOK(res1)) {
2466       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_configure" "', argument " "1"" of type '" "Device *""'"); 
2467     }
2468     arg1 = (Device *)(argp1);
2469     {
2470       arg2 = SvTRUE(ST(1));
2471     }
2472     result = (gboolean)Device_configure(arg1,arg2);
2473     {
2474       if (result)
2475       ST(argvi) = &PL_sv_yes;
2476       else
2477       ST(argvi) = &PL_sv_no;
2478       argvi++;
2479     }
2480     
2481     
2482     XSRETURN(argvi);
2483   fail:
2484     
2485     
2486     SWIG_croak_null();
2487   }
2488 }
2489
2490
2491 XS(_wrap_Device_error) {
2492   {
2493     Device *arg1 = (Device *) 0 ;
2494     void *argp1 = 0 ;
2495     int res1 = 0 ;
2496     int argvi = 0;
2497     char *result = 0 ;
2498     dXSARGS;
2499     
2500     if ((items < 1) || (items > 1)) {
2501       SWIG_croak("Usage: Device_error(self);");
2502     }
2503     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2504     if (!SWIG_IsOK(res1)) {
2505       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_error" "', argument " "1"" of type '" "Device *""'"); 
2506     }
2507     arg1 = (Device *)(argp1);
2508     result = (char *)Device_error(arg1);
2509     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2510     
2511     XSRETURN(argvi);
2512   fail:
2513     
2514     SWIG_croak_null();
2515   }
2516 }
2517
2518
2519 XS(_wrap_Device_status_error) {
2520   {
2521     Device *arg1 = (Device *) 0 ;
2522     void *argp1 = 0 ;
2523     int res1 = 0 ;
2524     int argvi = 0;
2525     char *result = 0 ;
2526     dXSARGS;
2527     
2528     if ((items < 1) || (items > 1)) {
2529       SWIG_croak("Usage: Device_status_error(self);");
2530     }
2531     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2532     if (!SWIG_IsOK(res1)) {
2533       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_status_error" "', argument " "1"" of type '" "Device *""'"); 
2534     }
2535     arg1 = (Device *)(argp1);
2536     result = (char *)Device_status_error(arg1);
2537     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2538     
2539     XSRETURN(argvi);
2540   fail:
2541     
2542     SWIG_croak_null();
2543   }
2544 }
2545
2546
2547 XS(_wrap_Device_error_or_status) {
2548   {
2549     Device *arg1 = (Device *) 0 ;
2550     void *argp1 = 0 ;
2551     int res1 = 0 ;
2552     int argvi = 0;
2553     char *result = 0 ;
2554     dXSARGS;
2555     
2556     if ((items < 1) || (items > 1)) {
2557       SWIG_croak("Usage: Device_error_or_status(self);");
2558     }
2559     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2560     if (!SWIG_IsOK(res1)) {
2561       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_error_or_status" "', argument " "1"" of type '" "Device *""'"); 
2562     }
2563     arg1 = (Device *)(argp1);
2564     result = (char *)Device_error_or_status(arg1);
2565     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
2566     
2567     XSRETURN(argvi);
2568   fail:
2569     
2570     SWIG_croak_null();
2571   }
2572 }
2573
2574
2575 XS(_wrap_Device_read_label) {
2576   {
2577     Device *arg1 = (Device *) 0 ;
2578     void *argp1 = 0 ;
2579     int res1 = 0 ;
2580     int argvi = 0;
2581     DeviceStatusFlags result;
2582     dXSARGS;
2583     
2584     if ((items < 1) || (items > 1)) {
2585       SWIG_croak("Usage: Device_read_label(self);");
2586     }
2587     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2588     if (!SWIG_IsOK(res1)) {
2589       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_label" "', argument " "1"" of type '" "Device *""'"); 
2590     }
2591     arg1 = (Device *)(argp1);
2592     result = (DeviceStatusFlags)Device_read_label(arg1);
2593     {
2594       SV *for_stack;
2595       SP += argvi; PUTBACK;
2596       for_stack = sv_2mortal(amglue_newSVi64(result));
2597       SPAGAIN; SP -= argvi;
2598       ST(argvi) = for_stack;
2599       argvi++;
2600     }
2601     
2602     XSRETURN(argvi);
2603   fail:
2604     
2605     SWIG_croak_null();
2606   }
2607 }
2608
2609
2610 XS(_wrap_Device_start) {
2611   {
2612     Device *arg1 = (Device *) 0 ;
2613     DeviceAccessMode arg2 ;
2614     char *arg3 = (char *) 0 ;
2615     char *arg4 = (char *) 0 ;
2616     void *argp1 = 0 ;
2617     int res1 = 0 ;
2618     int res3 ;
2619     char *buf3 = 0 ;
2620     int alloc3 = 0 ;
2621     int res4 ;
2622     char *buf4 = 0 ;
2623     int alloc4 = 0 ;
2624     int argvi = 0;
2625     gboolean result;
2626     dXSARGS;
2627     
2628     if ((items < 4) || (items > 4)) {
2629       SWIG_croak("Usage: Device_start(self,mode,label,timestamp);");
2630     }
2631     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2632     if (!SWIG_IsOK(res1)) {
2633       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_start" "', argument " "1"" of type '" "Device *""'"); 
2634     }
2635     arg1 = (Device *)(argp1);
2636     {
2637       if (sizeof(signed int) == 1) {
2638         arg2 = amglue_SvI8(ST(1));
2639       } else if (sizeof(signed int) == 2) {
2640         arg2 = amglue_SvI16(ST(1));
2641       } else if (sizeof(signed int) == 4) {
2642         arg2 = amglue_SvI32(ST(1));
2643       } else if (sizeof(signed int) == 8) {
2644         arg2 = amglue_SvI64(ST(1));
2645       } else {
2646         g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
2647       }
2648     }
2649     res3 = SWIG_AsCharPtrAndSize(ST(2), &buf3, NULL, &alloc3);
2650     if (!SWIG_IsOK(res3)) {
2651       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_start" "', argument " "3"" of type '" "char *""'");
2652     }
2653     arg3 = (char *)(buf3);
2654     res4 = SWIG_AsCharPtrAndSize(ST(3), &buf4, NULL, &alloc4);
2655     if (!SWIG_IsOK(res4)) {
2656       SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Device_start" "', argument " "4"" of type '" "char *""'");
2657     }
2658     arg4 = (char *)(buf4);
2659     result = (gboolean)Device_start(arg1,arg2,arg3,arg4);
2660     {
2661       if (result)
2662       ST(argvi) = &PL_sv_yes;
2663       else
2664       ST(argvi) = &PL_sv_no;
2665       argvi++;
2666     }
2667     
2668     
2669     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2670     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2671     XSRETURN(argvi);
2672   fail:
2673     
2674     
2675     if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2676     if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
2677     SWIG_croak_null();
2678   }
2679 }
2680
2681
2682 XS(_wrap_Device_finish) {
2683   {
2684     Device *arg1 = (Device *) 0 ;
2685     void *argp1 = 0 ;
2686     int res1 = 0 ;
2687     int argvi = 0;
2688     gboolean result;
2689     dXSARGS;
2690     
2691     if ((items < 1) || (items > 1)) {
2692       SWIG_croak("Usage: Device_finish(self);");
2693     }
2694     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2695     if (!SWIG_IsOK(res1)) {
2696       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish" "', argument " "1"" of type '" "Device *""'"); 
2697     }
2698     arg1 = (Device *)(argp1);
2699     result = (gboolean)Device_finish(arg1);
2700     {
2701       if (result)
2702       ST(argvi) = &PL_sv_yes;
2703       else
2704       ST(argvi) = &PL_sv_no;
2705       argvi++;
2706     }
2707     
2708     XSRETURN(argvi);
2709   fail:
2710     
2711     SWIG_croak_null();
2712   }
2713 }
2714
2715
2716 XS(_wrap_Device_start_file) {
2717   {
2718     Device *arg1 = (Device *) 0 ;
2719     dumpfile_t *arg2 = (dumpfile_t *) 0 ;
2720     void *argp1 = 0 ;
2721     int res1 = 0 ;
2722     void *argp2 = 0 ;
2723     int res2 = 0 ;
2724     int argvi = 0;
2725     gboolean result;
2726     dXSARGS;
2727     
2728     if ((items < 2) || (items > 2)) {
2729       SWIG_croak("Usage: Device_start_file(self,jobInfo);");
2730     }
2731     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2732     if (!SWIG_IsOK(res1)) {
2733       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_start_file" "', argument " "1"" of type '" "Device *""'"); 
2734     }
2735     arg1 = (Device *)(argp1);
2736     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_dumpfile_t, 0 |  0 );
2737     if (!SWIG_IsOK(res2)) {
2738       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_start_file" "', argument " "2"" of type '" "dumpfile_t *""'"); 
2739     }
2740     arg2 = (dumpfile_t *)(argp2);
2741     result = (gboolean)Device_start_file(arg1,arg2);
2742     {
2743       if (result)
2744       ST(argvi) = &PL_sv_yes;
2745       else
2746       ST(argvi) = &PL_sv_no;
2747       argvi++;
2748     }
2749     
2750     
2751     XSRETURN(argvi);
2752   fail:
2753     
2754     
2755     SWIG_croak_null();
2756   }
2757 }
2758
2759
2760 XS(_wrap_Device_write_block) {
2761   {
2762     Device *arg1 = (Device *) 0 ;
2763     guint arg2 ;
2764     gpointer arg3 = (gpointer) 0 ;
2765     void *argp1 = 0 ;
2766     int res1 = 0 ;
2767     int res3 ;
2768     int argvi = 0;
2769     gboolean result;
2770     dXSARGS;
2771     
2772     if ((items < 3) || (items > 3)) {
2773       SWIG_croak("Usage: Device_write_block(self,size,data);");
2774     }
2775     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2776     if (!SWIG_IsOK(res1)) {
2777       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_block" "', argument " "1"" of type '" "Device *""'"); 
2778     }
2779     arg1 = (Device *)(argp1);
2780     {
2781       if (sizeof(guint) == 1) {
2782         arg2 = amglue_SvU8(ST(1));
2783       } else if (sizeof(guint) == 2) {
2784         arg2 = amglue_SvU16(ST(1));
2785       } else if (sizeof(guint) == 4) {
2786         arg2 = amglue_SvU32(ST(1));
2787       } else if (sizeof(guint) == 8) {
2788         arg2 = amglue_SvU64(ST(1));
2789       } else {
2790         croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
2791       }
2792     }
2793     res3 = SWIG_ConvertPtr(ST(2),SWIG_as_voidptrptr(&arg3), 0, 0);
2794     if (!SWIG_IsOK(res3)) {
2795       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_write_block" "', argument " "3"" of type '" "gpointer""'"); 
2796     }
2797     result = (gboolean)Device_write_block(arg1,arg2,arg3);
2798     {
2799       if (result)
2800       ST(argvi) = &PL_sv_yes;
2801       else
2802       ST(argvi) = &PL_sv_no;
2803       argvi++;
2804     }
2805     
2806     
2807     XSRETURN(argvi);
2808   fail:
2809     
2810     
2811     SWIG_croak_null();
2812   }
2813 }
2814
2815
2816 XS(_wrap_Device_finish_file) {
2817   {
2818     Device *arg1 = (Device *) 0 ;
2819     void *argp1 = 0 ;
2820     int res1 = 0 ;
2821     int argvi = 0;
2822     gboolean result;
2823     dXSARGS;
2824     
2825     if ((items < 1) || (items > 1)) {
2826       SWIG_croak("Usage: Device_finish_file(self);");
2827     }
2828     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2829     if (!SWIG_IsOK(res1)) {
2830       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish_file" "', argument " "1"" of type '" "Device *""'"); 
2831     }
2832     arg1 = (Device *)(argp1);
2833     result = (gboolean)Device_finish_file(arg1);
2834     {
2835       if (result)
2836       ST(argvi) = &PL_sv_yes;
2837       else
2838       ST(argvi) = &PL_sv_no;
2839       argvi++;
2840     }
2841     
2842     XSRETURN(argvi);
2843   fail:
2844     
2845     SWIG_croak_null();
2846   }
2847 }
2848
2849
2850 XS(_wrap_Device_seek_file) {
2851   {
2852     Device *arg1 = (Device *) 0 ;
2853     guint arg2 ;
2854     void *argp1 = 0 ;
2855     int res1 = 0 ;
2856     int argvi = 0;
2857     dumpfile_t *result = 0 ;
2858     dXSARGS;
2859     
2860     if ((items < 2) || (items > 2)) {
2861       SWIG_croak("Usage: Device_seek_file(self,file);");
2862     }
2863     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2864     if (!SWIG_IsOK(res1)) {
2865       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_file" "', argument " "1"" of type '" "Device *""'"); 
2866     }
2867     arg1 = (Device *)(argp1);
2868     {
2869       if (sizeof(guint) == 1) {
2870         arg2 = amglue_SvU8(ST(1));
2871       } else if (sizeof(guint) == 2) {
2872         arg2 = amglue_SvU16(ST(1));
2873       } else if (sizeof(guint) == 4) {
2874         arg2 = amglue_SvU32(ST(1));
2875       } else if (sizeof(guint) == 8) {
2876         arg2 = amglue_SvU64(ST(1));
2877       } else {
2878         croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
2879       }
2880     }
2881     result = (dumpfile_t *)Device_seek_file(arg1,arg2);
2882     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ;
2883     
2884     XSRETURN(argvi);
2885   fail:
2886     
2887     SWIG_croak_null();
2888   }
2889 }
2890
2891
2892 XS(_wrap_Device_seek_block) {
2893   {
2894     Device *arg1 = (Device *) 0 ;
2895     guint64 arg2 ;
2896     void *argp1 = 0 ;
2897     int res1 = 0 ;
2898     int argvi = 0;
2899     gboolean result;
2900     dXSARGS;
2901     
2902     if ((items < 2) || (items > 2)) {
2903       SWIG_croak("Usage: Device_seek_block(self,block);");
2904     }
2905     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2906     if (!SWIG_IsOK(res1)) {
2907       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_block" "', argument " "1"" of type '" "Device *""'"); 
2908     }
2909     arg1 = (Device *)(argp1);
2910     {
2911       arg2 = amglue_SvU64(ST(1));
2912     }
2913     result = (gboolean)Device_seek_block(arg1,arg2);
2914     {
2915       if (result)
2916       ST(argvi) = &PL_sv_yes;
2917       else
2918       ST(argvi) = &PL_sv_no;
2919       argvi++;
2920     }
2921     
2922     XSRETURN(argvi);
2923   fail:
2924     
2925     SWIG_croak_null();
2926   }
2927 }
2928
2929
2930 XS(_wrap_Device_read_block) {
2931   {
2932     Device *arg1 = (Device *) 0 ;
2933     gpointer arg2 = (gpointer) 0 ;
2934     int *arg3 = (int *) 0 ;
2935     void *argp1 = 0 ;
2936     int res1 = 0 ;
2937     int res2 ;
2938     void *argp3 = 0 ;
2939     int res3 = 0 ;
2940     int argvi = 0;
2941     int result;
2942     dXSARGS;
2943     
2944     if ((items < 3) || (items > 3)) {
2945       SWIG_croak("Usage: Device_read_block(self,buffer,size);");
2946     }
2947     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2948     if (!SWIG_IsOK(res1)) {
2949       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_block" "', argument " "1"" of type '" "Device *""'"); 
2950     }
2951     arg1 = (Device *)(argp1);
2952     res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
2953     if (!SWIG_IsOK(res2)) {
2954       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_block" "', argument " "2"" of type '" "gpointer""'"); 
2955     }
2956     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_int, 0 |  0 );
2957     if (!SWIG_IsOK(res3)) {
2958       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_read_block" "', argument " "3"" of type '" "int *""'"); 
2959     }
2960     arg3 = (int *)(argp3);
2961     result = (int)Device_read_block(arg1,arg2,arg3);
2962     {
2963       SV *for_stack;
2964       SP += argvi; PUTBACK;
2965       for_stack = sv_2mortal(amglue_newSVi64(result));
2966       SPAGAIN; SP -= argvi;
2967       ST(argvi) = for_stack;
2968       argvi++;
2969     }
2970     
2971     
2972     
2973     XSRETURN(argvi);
2974   fail:
2975     
2976     
2977     
2978     SWIG_croak_null();
2979   }
2980 }
2981
2982
2983 XS(_wrap_Device_erase) {
2984   {
2985     Device *arg1 = (Device *) 0 ;
2986     void *argp1 = 0 ;
2987     int res1 = 0 ;
2988     int argvi = 0;
2989     gboolean result;
2990     dXSARGS;
2991     
2992     if ((items < 1) || (items > 1)) {
2993       SWIG_croak("Usage: Device_erase(self);");
2994     }
2995     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
2996     if (!SWIG_IsOK(res1)) {
2997       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_erase" "', argument " "1"" of type '" "Device *""'"); 
2998     }
2999     arg1 = (Device *)(argp1);
3000     result = (gboolean)Device_erase(arg1);
3001     {
3002       if (result)
3003       ST(argvi) = &PL_sv_yes;
3004       else
3005       ST(argvi) = &PL_sv_no;
3006       argvi++;
3007     }
3008     
3009     XSRETURN(argvi);
3010   fail:
3011     
3012     SWIG_croak_null();
3013   }
3014 }
3015
3016
3017 XS(_wrap_Device_eject) {
3018   {
3019     Device *arg1 = (Device *) 0 ;
3020     void *argp1 = 0 ;
3021     int res1 = 0 ;
3022     int argvi = 0;
3023     gboolean result;
3024     dXSARGS;
3025     
3026     if ((items < 1) || (items > 1)) {
3027       SWIG_croak("Usage: Device_eject(self);");
3028     }
3029     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3030     if (!SWIG_IsOK(res1)) {
3031       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_eject" "', argument " "1"" of type '" "Device *""'"); 
3032     }
3033     arg1 = (Device *)(argp1);
3034     result = (gboolean)Device_eject(arg1);
3035     {
3036       if (result)
3037       ST(argvi) = &PL_sv_yes;
3038       else
3039       ST(argvi) = &PL_sv_no;
3040       argvi++;
3041     }
3042     
3043     XSRETURN(argvi);
3044   fail:
3045     
3046     SWIG_croak_null();
3047   }
3048 }
3049
3050
3051 XS(_wrap_Device_directtcp_supported) {
3052   {
3053     Device *arg1 = (Device *) 0 ;
3054     void *argp1 = 0 ;
3055     int res1 = 0 ;
3056     int argvi = 0;
3057     gboolean result;
3058     dXSARGS;
3059     
3060     if ((items < 1) || (items > 1)) {
3061       SWIG_croak("Usage: Device_directtcp_supported(self);");
3062     }
3063     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3064     if (!SWIG_IsOK(res1)) {
3065       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_directtcp_supported" "', argument " "1"" of type '" "Device *""'"); 
3066     }
3067     arg1 = (Device *)(argp1);
3068     result = (gboolean)Device_directtcp_supported(arg1);
3069     {
3070       if (result)
3071       ST(argvi) = &PL_sv_yes;
3072       else
3073       ST(argvi) = &PL_sv_no;
3074       argvi++;
3075     }
3076     
3077     XSRETURN(argvi);
3078   fail:
3079     
3080     SWIG_croak_null();
3081   }
3082 }
3083
3084
3085 XS(_wrap_Device_listen) {
3086   {
3087     Device *arg1 = (Device *) 0 ;
3088     gboolean arg2 ;
3089     DirectTCPAddr **arg3 = (DirectTCPAddr **) 0 ;
3090     void *argp1 = 0 ;
3091     int res1 = 0 ;
3092     DirectTCPAddr *addrs3 ;
3093     int argvi = 0;
3094     dXSARGS;
3095     
3096     {
3097       addrs3 = NULL;
3098       arg3 = &addrs3;
3099     }
3100     if ((items < 2) || (items > 2)) {
3101       SWIG_croak("Usage: Device_listen(self,for_writing);");
3102     }
3103     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3104     if (!SWIG_IsOK(res1)) {
3105       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_listen" "', argument " "1"" of type '" "Device *""'"); 
3106     }
3107     arg1 = (Device *)(argp1);
3108     {
3109       arg2 = SvTRUE(ST(1));
3110     }
3111     Device_listen(arg1,arg2,arg3);
3112     ST(argvi) = sv_newmortal();
3113     {
3114       if (arg3 && *arg3) {
3115         DirectTCPAddr *iter = *arg3;
3116         AV *av = newAV();
3117         int i = 0;
3118         
3119         while (iter && SU_GET_FAMILY(iter) != 0) {
3120           char *addr = str_sockaddr_no_port(iter);
3121           AV *tuple = newAV();
3122           
3123           g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
3124           g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
3125           g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
3126           iter++;
3127         }
3128         
3129         ST(argvi) = newRV_noinc((SV *)av);
3130         argvi++;
3131       }
3132     }
3133     
3134     
3135     
3136     XSRETURN(argvi);
3137   fail:
3138     
3139     
3140     
3141     SWIG_croak_null();
3142   }
3143 }
3144
3145
3146 XS(_wrap_Device_accept) {
3147   {
3148     Device *arg1 = (Device *) 0 ;
3149     void *argp1 = 0 ;
3150     int res1 = 0 ;
3151     int argvi = 0;
3152     DirectTCPConnection *result = 0 ;
3153     dXSARGS;
3154     
3155     if ((items < 1) || (items > 1)) {
3156       SWIG_croak("Usage: Device_accept(self);");
3157     }
3158     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3159     if (!SWIG_IsOK(res1)) {
3160       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_accept" "', argument " "1"" of type '" "Device *""'"); 
3161     }
3162     arg1 = (Device *)(argp1);
3163     result = (DirectTCPConnection *)Device_accept(arg1);
3164     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3165     
3166     XSRETURN(argvi);
3167   fail:
3168     
3169     SWIG_croak_null();
3170   }
3171 }
3172
3173
3174 XS(_wrap_Device_connect) {
3175   {
3176     Device *arg1 = (Device *) 0 ;
3177     gboolean arg2 ;
3178     DirectTCPAddr *arg3 = (DirectTCPAddr *) 0 ;
3179     void *argp1 = 0 ;
3180     int res1 = 0 ;
3181     int argvi = 0;
3182     DirectTCPConnection *result = 0 ;
3183     dXSARGS;
3184     
3185     if ((items < 3) || (items > 3)) {
3186       SWIG_croak("Usage: Device_connect(self,for_writing,addrs);");
3187     }
3188     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3189     if (!SWIG_IsOK(res1)) {
3190       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_connect" "', argument " "1"" of type '" "Device *""'"); 
3191     }
3192     arg1 = (Device *)(argp1);
3193     {
3194       arg2 = SvTRUE(ST(1));
3195     }
3196     {
3197       AV *addrs_av;
3198       int num_addrs, i;
3199       
3200       if (!SvROK(ST(2)) || SvTYPE(SvRV(ST(2))) != SVt_PVAV) {
3201         SWIG_exception_fail(SWIG_TypeError, "must provide an arrayref of DirectTCPAddrs");
3202       }
3203       addrs_av = (AV *)SvRV(ST(2));
3204       num_addrs = av_len(addrs_av)+1;
3205       
3206       arg3 = g_new0(DirectTCPAddr, num_addrs+1);
3207       
3208       for (i = 0; i < num_addrs; i++) {
3209         SV **svp = av_fetch(addrs_av, i, 0);
3210         AV *addr_av;
3211         sockaddr_union addr;
3212         IV port;
3213         
3214         if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
3215           || av_len((AV *)SvRV(*svp))+1 != 2) {
3216           SWIG_exception_fail(SWIG_TypeError, "each DirectTCPAddr must be a 2-element arrayref");
3217         }
3218         
3219         addr_av = (AV *)SvRV(*svp);
3220         
3221         /* get address */
3222         svp = av_fetch(addr_av, 0, 0);
3223         if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
3224           SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
3225         }
3226         
3227         /* get port */
3228         svp = av_fetch(addr_av, 1, 0);
3229         if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
3230           SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
3231         }
3232         SU_SET_PORT(&addr, port);
3233         
3234         copy_sockaddr(arg3, &addr);
3235       }
3236     }
3237     result = (DirectTCPConnection *)Device_connect(arg1,arg2,arg3);
3238     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
3239     
3240     
3241     
3242     XSRETURN(argvi);
3243   fail:
3244     
3245     
3246     
3247     SWIG_croak_null();
3248   }
3249 }
3250
3251
3252 XS(_wrap_Device_use_connection) {
3253   {
3254     Device *arg1 = (Device *) 0 ;
3255     DirectTCPConnection *arg2 = (DirectTCPConnection *) 0 ;
3256     void *argp1 = 0 ;
3257     int res1 = 0 ;
3258     void *argp2 = 0 ;
3259     int res2 = 0 ;
3260     int argvi = 0;
3261     gboolean result;
3262     dXSARGS;
3263     
3264     if ((items < 2) || (items > 2)) {
3265       SWIG_croak("Usage: Device_use_connection(self,conn);");
3266     }
3267     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3268     if (!SWIG_IsOK(res1)) {
3269       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_use_connection" "', argument " "1"" of type '" "Device *""'"); 
3270     }
3271     arg1 = (Device *)(argp1);
3272     res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_DirectTCPConnection, 0 |  0 );
3273     if (!SWIG_IsOK(res2)) {
3274       SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_use_connection" "', argument " "2"" of type '" "DirectTCPConnection *""'"); 
3275     }
3276     arg2 = (DirectTCPConnection *)(argp2);
3277     result = (gboolean)Device_use_connection(arg1,arg2);
3278     {
3279       if (result)
3280       ST(argvi) = &PL_sv_yes;
3281       else
3282       ST(argvi) = &PL_sv_no;
3283       argvi++;
3284     }
3285     
3286     
3287     XSRETURN(argvi);
3288   fail:
3289     
3290     
3291     SWIG_croak_null();
3292   }
3293 }
3294
3295
3296 XS(_wrap_Device_write_from_connection) {
3297   {
3298     Device *arg1 = (Device *) 0 ;
3299     guint64 arg2 ;
3300     guint64 *arg3 = (guint64 *) 0 ;
3301     void *argp1 = 0 ;
3302     int res1 = 0 ;
3303     guint64 sz3 ;
3304     int argvi = 0;
3305     gboolean result;
3306     dXSARGS;
3307     
3308     {
3309       sz3 = 0;
3310       arg3 = &sz3;
3311     }
3312     if ((items < 2) || (items > 2)) {
3313       SWIG_croak("Usage: Device_write_from_connection(self,size);");
3314     }
3315     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3316     if (!SWIG_IsOK(res1)) {
3317       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_connection" "', argument " "1"" of type '" "Device *""'"); 
3318     }
3319     arg1 = (Device *)(argp1);
3320     {
3321       arg2 = amglue_SvU64(ST(1));
3322     }
3323     result = (gboolean)Device_write_from_connection(arg1,arg2,arg3);
3324     {
3325       if (result)
3326       ST(argvi) = &PL_sv_yes;
3327       else
3328       ST(argvi) = &PL_sv_no;
3329       argvi++;
3330     }
3331     {
3332       SP += argvi; PUTBACK;
3333       ST(argvi) = sv_2mortal(amglue_newSVu64(*arg3));
3334       SPAGAIN; SP -= argvi; argvi++;
3335     }
3336     
3337     
3338     XSRETURN(argvi);
3339   fail:
3340     
3341     
3342     SWIG_croak_null();
3343   }
3344 }
3345
3346
3347 XS(_wrap_Device_read_to_connection) {
3348   {
3349     Device *arg1 = (Device *) 0 ;
3350     guint64 arg2 ;
3351     guint64 *arg3 = (guint64 *) 0 ;
3352     void *argp1 = 0 ;
3353     int res1 = 0 ;
3354     guint64 sz3 ;
3355     int argvi = 0;
3356     gboolean result;
3357     dXSARGS;
3358     
3359     {
3360       sz3 = 0;
3361       arg3 = &sz3;
3362     }
3363     if ((items < 2) || (items > 2)) {
3364       SWIG_croak("Usage: Device_read_to_connection(self,size);");
3365     }
3366     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3367     if (!SWIG_IsOK(res1)) {
3368       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_connection" "', argument " "1"" of type '" "Device *""'"); 
3369     }
3370     arg1 = (Device *)(argp1);
3371     {
3372       arg2 = amglue_SvU64(ST(1));
3373     }
3374     result = (gboolean)Device_read_to_connection(arg1,arg2,arg3);
3375     {
3376       if (result)
3377       ST(argvi) = &PL_sv_yes;
3378       else
3379       ST(argvi) = &PL_sv_no;
3380       argvi++;
3381     }
3382     {
3383       SP += argvi; PUTBACK;
3384       ST(argvi) = sv_2mortal(amglue_newSVu64(*arg3));
3385       SPAGAIN; SP -= argvi; argvi++;
3386     }
3387     
3388     
3389     XSRETURN(argvi);
3390   fail:
3391     
3392     
3393     SWIG_croak_null();
3394   }
3395 }
3396
3397
3398 XS(_wrap_Device_property_list) {
3399   {
3400     Device *arg1 = (Device *) 0 ;
3401     void *argp1 = 0 ;
3402     int res1 = 0 ;
3403     int argvi = 0;
3404     GSList *result = 0 ;
3405     dXSARGS;
3406     
3407     if ((items < 1) || (items > 1)) {
3408       SWIG_croak("Usage: Device_property_list(self);");
3409     }
3410     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3411     if (!SWIG_IsOK(res1)) {
3412       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_list" "', argument " "1"" of type '" "Device *""'"); 
3413     }
3414     arg1 = (Device *)(argp1);
3415     result = (GSList *)Device_property_list(arg1);
3416     {
3417       GSList *iter;
3418       
3419       /* Count the DeviceProperties */
3420       EXTEND(SP, g_slist_length(result)); /* make room for return values */
3421       
3422       /* Note that we set ST(argvi) several times. the nature of
3423              * SWIG's wrapping is such that incrementing argvi points
3424              * ST(argvi) to the next location in perl's argument stack.
3425                    */
3426       
3427       for (iter = result; iter; iter = g_slist_next(iter)) {
3428         DeviceProperty *prop = iter->data;
3429         HV *hash = newHV();
3430         SV *rv = newRV_noinc((SV *)hash);
3431         
3432         hv_store(hash, "name", 4,
3433           newSVpv(prop->base->name, 0), 0);
3434         hv_store(hash, "description", 11,
3435           newSVpv(prop->base->description, 0), 0);
3436         hv_store(hash, "access", 6,
3437           newSViv(prop->access), 0);
3438         ST(argvi) = sv_2mortal(rv);
3439         argvi++;
3440       }
3441     }
3442     
3443     XSRETURN(argvi);
3444   fail:
3445     
3446     SWIG_croak_null();
3447   }
3448 }
3449
3450
3451 XS(_wrap_Device_property_get) {
3452   {
3453     Device *arg1 = (Device *) 0 ;
3454     DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ;
3455     GValue *arg3 = (GValue *) 0 ;
3456     PropertySurety *arg4 = (PropertySurety *) 0 ;
3457     PropertySource *arg5 = (PropertySource *) 0 ;
3458     gboolean *arg6 = (gboolean *) 0 ;
3459     void *argp1 = 0 ;
3460     int res1 = 0 ;
3461     GValue val3 ;
3462     PropertySurety surety3 ;
3463     PropertySource source3 ;
3464     gboolean found3 ;
3465     int argvi = 0;
3466     dXSARGS;
3467     
3468     {
3469       memset(&val3, 0, sizeof(val3));
3470       arg3 = &val3;
3471       if (GIMME_V == G_ARRAY) {
3472         arg4 = &surety3;
3473         arg5 = &source3;
3474       }
3475       arg6 = &found3;
3476     }
3477     if ((items < 2) || (items > 2)) {
3478       SWIG_croak("Usage: Device_property_get(self,pbase,surety,source,val_found);");
3479     }
3480     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3481     if (!SWIG_IsOK(res1)) {
3482       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_get" "', argument " "1"" of type '" "Device *""'"); 
3483     }
3484     arg1 = (Device *)(argp1);
3485     {
3486       char *pname = NULL;
3487       
3488       if (SvPOK(ST(1)))
3489       pname = SvPV_nolen(ST(1));
3490       
3491       if (pname)
3492       arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
3493       else
3494       arg2 = NULL;
3495     }
3496     Device_property_get(arg1,arg2,arg3,arg4,arg5,arg6);
3497     ST(argvi) = sv_newmortal();
3498     {
3499       /* if the result is valid */
3500       if (*arg6) {
3501         /* move data from arg3 to ST(argvi), somehow, being careful to
3502                          * save the perl stack while doing so */
3503         SP += argvi; PUTBACK;
3504         ST(argvi) = set_sv_from_gvalue(arg3);
3505         SPAGAIN; SP -= argvi; argvi++;
3506         
3507         /* free any memory for the GValue */
3508         g_value_unset(arg3);
3509         
3510         if (GIMME_V == G_ARRAY) {
3511           ST(argvi) = newSViv(*arg4);
3512           argvi++;
3513           ST(argvi) = newSViv(*arg5);
3514           argvi++;
3515         }
3516       }
3517       /* otherwise, return nothing */
3518     }
3519     
3520     
3521     XSRETURN(argvi);
3522   fail:
3523     
3524     
3525     SWIG_croak_null();
3526   }
3527 }
3528
3529
3530 XS(_wrap_Device_property_set) {
3531   {
3532     Device *arg1 = (Device *) 0 ;
3533     DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ;
3534     SV *arg3 = (SV *) 0 ;
3535     void *argp1 = 0 ;
3536     int res1 = 0 ;
3537     int argvi = 0;
3538     gboolean result;
3539     dXSARGS;
3540     
3541     if ((items < 3) || (items > 3)) {
3542       SWIG_croak("Usage: Device_property_set(self,pbase,sv);");
3543     }
3544     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3545     if (!SWIG_IsOK(res1)) {
3546       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_set" "', argument " "1"" of type '" "Device *""'"); 
3547     }
3548     arg1 = (Device *)(argp1);
3549     {
3550       char *pname = NULL;
3551       
3552       if (SvPOK(ST(1)))
3553       pname = SvPV_nolen(ST(1));
3554       
3555       if (pname)
3556       arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
3557       else
3558       arg2 = NULL;
3559     }
3560     arg3 = ST(2);
3561     result = (gboolean)Device_property_set(arg1,arg2,arg3);
3562     {
3563       if (result)
3564       ST(argvi) = &PL_sv_yes;
3565       else
3566       ST(argvi) = &PL_sv_no;
3567       argvi++;
3568     }
3569     
3570     
3571     
3572     XSRETURN(argvi);
3573   fail:
3574     
3575     
3576     
3577     SWIG_croak_null();
3578   }
3579 }
3580
3581
3582 XS(_wrap_Device_property_set_ex) {
3583   {
3584     Device *arg1 = (Device *) 0 ;
3585     DevicePropertyBase *arg2 = (DevicePropertyBase *) 0 ;
3586     SV *arg3 = (SV *) 0 ;
3587     PropertySurety arg4 ;
3588     PropertySource arg5 ;
3589     void *argp1 = 0 ;
3590     int res1 = 0 ;
3591     int argvi = 0;
3592     gboolean result;
3593     dXSARGS;
3594     
3595     if ((items < 5) || (items > 5)) {
3596       SWIG_croak("Usage: Device_property_set_ex(self,pbase,sv,surety,source);");
3597     }
3598     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3599     if (!SWIG_IsOK(res1)) {
3600       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_property_set_ex" "', argument " "1"" of type '" "Device *""'"); 
3601     }
3602     arg1 = (Device *)(argp1);
3603     {
3604       char *pname = NULL;
3605       
3606       if (SvPOK(ST(1)))
3607       pname = SvPV_nolen(ST(1));
3608       
3609       if (pname)
3610       arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
3611       else
3612       arg2 = NULL;
3613     }
3614     arg3 = ST(2);
3615     {
3616       if (sizeof(signed int) == 1) {
3617         arg4 = amglue_SvI8(ST(3));
3618       } else if (sizeof(signed int) == 2) {
3619         arg4 = amglue_SvI16(ST(3));
3620       } else if (sizeof(signed int) == 4) {
3621         arg4 = amglue_SvI32(ST(3));
3622       } else if (sizeof(signed int) == 8) {
3623         arg4 = amglue_SvI64(ST(3));
3624       } else {
3625         g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
3626       }
3627     }
3628     {
3629       if (sizeof(signed int) == 1) {
3630         arg5 = amglue_SvI8(ST(4));
3631       } else if (sizeof(signed int) == 2) {
3632         arg5 = amglue_SvI16(ST(4));
3633       } else if (sizeof(signed int) == 4) {
3634         arg5 = amglue_SvI32(ST(4));
3635       } else if (sizeof(signed int) == 8) {
3636         arg5 = amglue_SvI64(ST(4));
3637       } else {
3638         g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
3639       }
3640     }
3641     result = (gboolean)Device_property_set_ex(arg1,arg2,arg3,arg4,arg5);
3642     {
3643       if (result)
3644       ST(argvi) = &PL_sv_yes;
3645       else
3646       ST(argvi) = &PL_sv_no;
3647       argvi++;
3648     }
3649     
3650     
3651     
3652     
3653     
3654     XSRETURN(argvi);
3655   fail:
3656     
3657     
3658     
3659     
3660     
3661     SWIG_croak_null();
3662   }
3663 }
3664
3665
3666 XS(_wrap_Device_recycle_file) {
3667   {
3668     Device *arg1 = (Device *) 0 ;
3669     guint arg2 ;
3670     void *argp1 = 0 ;
3671     int res1 = 0 ;
3672     int argvi = 0;
3673     gboolean result;
3674     dXSARGS;
3675     
3676     if ((items < 2) || (items > 2)) {
3677       SWIG_croak("Usage: Device_recycle_file(self,filenum);");
3678     }
3679     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3680     if (!SWIG_IsOK(res1)) {
3681       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_recycle_file" "', argument " "1"" of type '" "Device *""'"); 
3682     }
3683     arg1 = (Device *)(argp1);
3684     {
3685       if (sizeof(guint) == 1) {
3686         arg2 = amglue_SvU8(ST(1));
3687       } else if (sizeof(guint) == 2) {
3688         arg2 = amglue_SvU16(ST(1));
3689       } else if (sizeof(guint) == 4) {
3690         arg2 = amglue_SvU32(ST(1));
3691       } else if (sizeof(guint) == 8) {
3692         arg2 = amglue_SvU64(ST(1));
3693       } else {
3694         croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
3695       }
3696     }
3697     result = (gboolean)Device_recycle_file(arg1,arg2);
3698     {
3699       if (result)
3700       ST(argvi) = &PL_sv_yes;
3701       else
3702       ST(argvi) = &PL_sv_no;
3703       argvi++;
3704     }
3705     
3706     XSRETURN(argvi);
3707   fail:
3708     
3709     SWIG_croak_null();
3710   }
3711 }
3712
3713
3714 XS(_wrap_Device_file) {
3715   {
3716     Device *arg1 = (Device *) 0 ;
3717     void *argp1 = 0 ;
3718     int res1 = 0 ;
3719     int argvi = 0;
3720     int result;
3721     dXSARGS;
3722     
3723     if ((items < 1) || (items > 1)) {
3724       SWIG_croak("Usage: Device_file(self);");
3725     }
3726     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3727     if (!SWIG_IsOK(res1)) {
3728       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_file" "', argument " "1"" of type '" "Device *""'"); 
3729     }
3730     arg1 = (Device *)(argp1);
3731     result = (int)Device_file(arg1);
3732     {
3733       SV *for_stack;
3734       SP += argvi; PUTBACK;
3735       for_stack = sv_2mortal(amglue_newSVi64(result));
3736       SPAGAIN; SP -= argvi;
3737       ST(argvi) = for_stack;
3738       argvi++;
3739     }
3740     
3741     XSRETURN(argvi);
3742   fail:
3743     
3744     SWIG_croak_null();
3745   }
3746 }
3747
3748
3749 XS(_wrap_Device_block) {
3750   {
3751     Device *arg1 = (Device *) 0 ;
3752     void *argp1 = 0 ;
3753     int res1 = 0 ;
3754     int argvi = 0;
3755     guint64 result;
3756     dXSARGS;
3757     
3758     if ((items < 1) || (items > 1)) {
3759       SWIG_croak("Usage: Device_block(self);");
3760     }
3761     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3762     if (!SWIG_IsOK(res1)) {
3763       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_block" "', argument " "1"" of type '" "Device *""'"); 
3764     }
3765     arg1 = (Device *)(argp1);
3766     result = Device_block(arg1);
3767     {
3768       SV *for_stack;
3769       SP += argvi; PUTBACK;
3770       for_stack = sv_2mortal(amglue_newSVu64(result));
3771       SPAGAIN; SP -= argvi;
3772       ST(argvi) = for_stack;
3773       argvi++;
3774     }
3775     
3776     XSRETURN(argvi);
3777   fail:
3778     
3779     SWIG_croak_null();
3780   }
3781 }
3782
3783
3784 XS(_wrap_Device_in_file) {
3785   {
3786     Device *arg1 = (Device *) 0 ;
3787     void *argp1 = 0 ;
3788     int res1 = 0 ;
3789     int argvi = 0;
3790     gboolean result;
3791     dXSARGS;
3792     
3793     if ((items < 1) || (items > 1)) {
3794       SWIG_croak("Usage: Device_in_file(self);");
3795     }
3796     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3797     if (!SWIG_IsOK(res1)) {
3798       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_in_file" "', argument " "1"" of type '" "Device *""'"); 
3799     }
3800     arg1 = (Device *)(argp1);
3801     result = (gboolean)Device_in_file(arg1);
3802     {
3803       if (result)
3804       ST(argvi) = &PL_sv_yes;
3805       else
3806       ST(argvi) = &PL_sv_no;
3807       argvi++;
3808     }
3809     
3810     XSRETURN(argvi);
3811   fail:
3812     
3813     SWIG_croak_null();
3814   }
3815 }
3816
3817
3818 XS(_wrap_Device_device_name) {
3819   {
3820     Device *arg1 = (Device *) 0 ;
3821     void *argp1 = 0 ;
3822     int res1 = 0 ;
3823     int argvi = 0;
3824     char *result = 0 ;
3825     dXSARGS;
3826     
3827     if ((items < 1) || (items > 1)) {
3828       SWIG_croak("Usage: Device_device_name(self);");
3829     }
3830     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3831     if (!SWIG_IsOK(res1)) {
3832       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_device_name" "', argument " "1"" of type '" "Device *""'"); 
3833     }
3834     arg1 = (Device *)(argp1);
3835     result = (char *)Device_device_name(arg1);
3836     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
3837     
3838     XSRETURN(argvi);
3839   fail:
3840     
3841     SWIG_croak_null();
3842   }
3843 }
3844
3845
3846 XS(_wrap_Device_access_mode) {
3847   {
3848     Device *arg1 = (Device *) 0 ;
3849     void *argp1 = 0 ;
3850     int res1 = 0 ;
3851     int argvi = 0;
3852     DeviceAccessMode result;
3853     dXSARGS;
3854     
3855     if ((items < 1) || (items > 1)) {
3856       SWIG_croak("Usage: Device_access_mode(self);");
3857     }
3858     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3859     if (!SWIG_IsOK(res1)) {
3860       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_access_mode" "', argument " "1"" of type '" "Device *""'"); 
3861     }
3862     arg1 = (Device *)(argp1);
3863     result = (DeviceAccessMode)Device_access_mode(arg1);
3864     {
3865       SV *for_stack;
3866       SP += argvi; PUTBACK;
3867       for_stack = sv_2mortal(amglue_newSVi64(result));
3868       SPAGAIN; SP -= argvi;
3869       ST(argvi) = for_stack;
3870       argvi++;
3871     }
3872     
3873     XSRETURN(argvi);
3874   fail:
3875     
3876     SWIG_croak_null();
3877   }
3878 }
3879
3880
3881 XS(_wrap_Device_is_eof) {
3882   {
3883     Device *arg1 = (Device *) 0 ;
3884     void *argp1 = 0 ;
3885     int res1 = 0 ;
3886     int argvi = 0;
3887     gboolean result;
3888     dXSARGS;
3889     
3890     if ((items < 1) || (items > 1)) {
3891       SWIG_croak("Usage: Device_is_eof(self);");
3892     }
3893     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3894     if (!SWIG_IsOK(res1)) {
3895       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_is_eof" "', argument " "1"" of type '" "Device *""'"); 
3896     }
3897     arg1 = (Device *)(argp1);
3898     result = (gboolean)Device_is_eof(arg1);
3899     {
3900       if (result)
3901       ST(argvi) = &PL_sv_yes;
3902       else
3903       ST(argvi) = &PL_sv_no;
3904       argvi++;
3905     }
3906     
3907     XSRETURN(argvi);
3908   fail:
3909     
3910     SWIG_croak_null();
3911   }
3912 }
3913
3914
3915 XS(_wrap_Device_is_eom) {
3916   {
3917     Device *arg1 = (Device *) 0 ;
3918     void *argp1 = 0 ;
3919     int res1 = 0 ;
3920     int argvi = 0;
3921     gboolean result;
3922     dXSARGS;
3923     
3924     if ((items < 1) || (items > 1)) {
3925       SWIG_croak("Usage: Device_is_eom(self);");
3926     }
3927     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3928     if (!SWIG_IsOK(res1)) {
3929       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_is_eom" "', argument " "1"" of type '" "Device *""'"); 
3930     }
3931     arg1 = (Device *)(argp1);
3932     result = (gboolean)Device_is_eom(arg1);
3933     {
3934       if (result)
3935       ST(argvi) = &PL_sv_yes;
3936       else
3937       ST(argvi) = &PL_sv_no;
3938       argvi++;
3939     }
3940     
3941     XSRETURN(argvi);
3942   fail:
3943     
3944     SWIG_croak_null();
3945   }
3946 }
3947
3948
3949 XS(_wrap_Device_volume_label) {
3950   {
3951     Device *arg1 = (Device *) 0 ;
3952     void *argp1 = 0 ;
3953     int res1 = 0 ;
3954     int argvi = 0;
3955     char *result = 0 ;
3956     dXSARGS;
3957     
3958     if ((items < 1) || (items > 1)) {
3959       SWIG_croak("Usage: Device_volume_label(self);");
3960     }
3961     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3962     if (!SWIG_IsOK(res1)) {
3963       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_label" "', argument " "1"" of type '" "Device *""'"); 
3964     }
3965     arg1 = (Device *)(argp1);
3966     result = (char *)Device_volume_label(arg1);
3967     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
3968     
3969     XSRETURN(argvi);
3970   fail:
3971     
3972     SWIG_croak_null();
3973   }
3974 }
3975
3976
3977 XS(_wrap_Device_volume_time) {
3978   {
3979     Device *arg1 = (Device *) 0 ;
3980     void *argp1 = 0 ;
3981     int res1 = 0 ;
3982     int argvi = 0;
3983     char *result = 0 ;
3984     dXSARGS;
3985     
3986     if ((items < 1) || (items > 1)) {
3987       SWIG_croak("Usage: Device_volume_time(self);");
3988     }
3989     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
3990     if (!SWIG_IsOK(res1)) {
3991       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_time" "', argument " "1"" of type '" "Device *""'"); 
3992     }
3993     arg1 = (Device *)(argp1);
3994     result = (char *)Device_volume_time(arg1);
3995     ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
3996     
3997     XSRETURN(argvi);
3998   fail:
3999     
4000     SWIG_croak_null();
4001   }
4002 }
4003
4004
4005 XS(_wrap_Device_status) {
4006   {
4007     Device *arg1 = (Device *) 0 ;
4008     void *argp1 = 0 ;
4009     int res1 = 0 ;
4010     int argvi = 0;
4011     DeviceStatusFlags result;
4012     dXSARGS;
4013     
4014     if ((items < 1) || (items > 1)) {
4015       SWIG_croak("Usage: Device_status(self);");
4016     }
4017     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
4018     if (!SWIG_IsOK(res1)) {
4019       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_status" "', argument " "1"" of type '" "Device *""'"); 
4020     }
4021     arg1 = (Device *)(argp1);
4022     result = (DeviceStatusFlags)Device_status(arg1);
4023     {
4024       SV *for_stack;
4025       SP += argvi; PUTBACK;
4026       for_stack = sv_2mortal(amglue_newSVi64(result));
4027       SPAGAIN; SP -= argvi;
4028       ST(argvi) = for_stack;
4029       argvi++;
4030     }
4031     
4032     XSRETURN(argvi);
4033   fail:
4034     
4035     SWIG_croak_null();
4036   }
4037 }
4038
4039
4040 XS(_wrap_Device_min_block_size) {
4041   {
4042     Device *arg1 = (Device *) 0 ;
4043     void *argp1 = 0 ;
4044     int res1 = 0 ;
4045     int argvi = 0;
4046     gsize result;
4047     dXSARGS;
4048     
4049     if ((items < 1) || (items > 1)) {
4050       SWIG_croak("Usage: Device_min_block_size(self);");
4051     }
4052     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
4053     if (!SWIG_IsOK(res1)) {
4054       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_min_block_size" "', argument " "1"" of type '" "Device *""'"); 
4055     }
4056     arg1 = (Device *)(argp1);
4057     result = Device_min_block_size(arg1);
4058     {
4059       SV *for_stack;
4060       SP += argvi; PUTBACK;
4061       for_stack = sv_2mortal(amglue_newSVu64(result));
4062       SPAGAIN; SP -= argvi;
4063       ST(argvi) = for_stack;
4064       argvi++;
4065     }
4066     
4067     XSRETURN(argvi);
4068   fail:
4069     
4070     SWIG_croak_null();
4071   }
4072 }
4073
4074
4075 XS(_wrap_Device_max_block_size) {
4076   {
4077     Device *arg1 = (Device *) 0 ;
4078     void *argp1 = 0 ;
4079     int res1 = 0 ;
4080     int argvi = 0;
4081     gsize result;
4082     dXSARGS;
4083     
4084     if ((items < 1) || (items > 1)) {
4085       SWIG_croak("Usage: Device_max_block_size(self);");
4086     }
4087     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
4088     if (!SWIG_IsOK(res1)) {
4089       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_max_block_size" "', argument " "1"" of type '" "Device *""'"); 
4090     }
4091     arg1 = (Device *)(argp1);
4092     result = Device_max_block_size(arg1);
4093     {
4094       SV *for_stack;
4095       SP += argvi; PUTBACK;
4096       for_stack = sv_2mortal(amglue_newSVu64(result));
4097       SPAGAIN; SP -= argvi;
4098       ST(argvi) = for_stack;
4099       argvi++;
4100     }
4101     
4102     XSRETURN(argvi);
4103   fail:
4104     
4105     SWIG_croak_null();
4106   }
4107 }
4108
4109
4110 XS(_wrap_Device_block_size) {
4111   {
4112     Device *arg1 = (Device *) 0 ;
4113     void *argp1 = 0 ;
4114     int res1 = 0 ;
4115     int argvi = 0;
4116     gsize result;
4117     dXSARGS;
4118     
4119     if ((items < 1) || (items > 1)) {
4120       SWIG_croak("Usage: Device_block_size(self);");
4121     }
4122     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
4123     if (!SWIG_IsOK(res1)) {
4124       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_block_size" "', argument " "1"" of type '" "Device *""'"); 
4125     }
4126     arg1 = (Device *)(argp1);
4127     result = Device_block_size(arg1);
4128     {
4129       SV *for_stack;
4130       SP += argvi; PUTBACK;
4131       for_stack = sv_2mortal(amglue_newSVu64(result));
4132       SPAGAIN; SP -= argvi;
4133       ST(argvi) = for_stack;
4134       argvi++;
4135     }
4136     
4137     XSRETURN(argvi);
4138   fail:
4139     
4140     SWIG_croak_null();
4141   }
4142 }
4143
4144
4145 XS(_wrap_Device_header_block_size) {
4146   {
4147     Device *arg1 = (Device *) 0 ;
4148     void *argp1 = 0 ;
4149     int res1 = 0 ;
4150     int argvi = 0;
4151     gsize result;
4152     dXSARGS;
4153     
4154     if ((items < 1) || (items > 1)) {
4155       SWIG_croak("Usage: Device_header_block_size(self);");
4156     }
4157     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
4158     if (!SWIG_IsOK(res1)) {
4159       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_header_block_size" "', argument " "1"" of type '" "Device *""'"); 
4160     }
4161     arg1 = (Device *)(argp1);
4162     result = Device_header_block_size(arg1);
4163     {
4164       SV *for_stack;
4165       SP += argvi; PUTBACK;
4166       for_stack = sv_2mortal(amglue_newSVu64(result));
4167       SPAGAIN; SP -= argvi;
4168       ST(argvi) = for_stack;
4169       argvi++;
4170     }
4171     
4172     XSRETURN(argvi);
4173   fail:
4174     
4175     SWIG_croak_null();
4176   }
4177 }
4178
4179
4180 XS(_wrap_Device_volume_header) {
4181   {
4182     Device *arg1 = (Device *) 0 ;
4183     void *argp1 = 0 ;
4184     int res1 = 0 ;
4185     int argvi = 0;
4186     dumpfile_t *result = 0 ;
4187     dXSARGS;
4188     
4189     if ((items < 1) || (items > 1)) {
4190       SWIG_croak("Usage: Device_volume_header(self);");
4191     }
4192     res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 |  0 );
4193     if (!SWIG_IsOK(res1)) {
4194       SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_volume_header" "', argument " "1"" of type '" "Device *""'"); 
4195     }
4196     arg1 = (Device *)(argp1);
4197     result = (dumpfile_t *)Device_volume_header(arg1);
4198     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ;
4199     
4200     XSRETURN(argvi);
4201   fail:
4202     
4203     SWIG_croak_null();
4204   }
4205 }
4206
4207
4208 XS(_wrap_rait_device_open_from_children) {
4209   {
4210     GSList *arg1 = (GSList *) 0 ;
4211     int argvi = 0;
4212     Device *result = 0 ;
4213     dXSARGS;
4214     
4215     if ((items < 1) || (items > 1)) {
4216       SWIG_croak("Usage: rait_device_open_from_children(child_devices);");
4217     }
4218     {
4219       AV *av;
4220       int i, len;
4221       
4222       if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) {
4223         SWIG_exception(SWIG_TypeError, "Expected an arrayref");
4224       }
4225       av = (AV *)SvRV(ST(0));
4226       
4227       arg1 = NULL;
4228       len = av_len(av);
4229       for (i = 0; i <= len; i++) {
4230         SV **elt = av_fetch(av, i, 0);
4231         Device *d;
4232         
4233         if (elt && !SvOK(*elt)) {
4234           arg1 = g_slist_append(arg1, NULL); /* 'undef' => NULL */
4235         } else if (!elt || SWIG_ConvertPtr(*elt, (void **)&d, SWIGTYPE_p_Device, 0) == -1) {
4236           SWIG_exception(SWIG_TypeError, "array member is not a Device");
4237         } else {
4238           arg1 = g_slist_append(arg1, d);
4239         }
4240       }
4241     }
4242     result = (Device *)rait_device_open_from_children(arg1);
4243     ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Device, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
4244     {
4245       g_slist_free(arg1);
4246     }
4247     XSRETURN(argvi);
4248   fail:
4249     {
4250       g_slist_free(arg1);
4251     }
4252     SWIG_croak_null();
4253   }
4254 }
4255
4256
4257 XS(_wrap_write_random_to_device) {
4258   {
4259     guint32 arg1 ;
4260     size_t arg2 ;
4261     Device *arg3 = (Device *) 0 ;
4262     void *argp3 = 0 ;
4263     int res3 = 0 ;
4264     int argvi = 0;
4265     gboolean result;
4266     dXSARGS;
4267     
4268     if ((items < 3) || (items > 3)) {
4269       SWIG_croak("Usage: write_random_to_device(seed,length,device);");
4270     }
4271     {
4272       arg1 = amglue_SvU32(ST(0));
4273     }
4274     {
4275       if (sizeof(size_t) == 1) {
4276         arg2 = amglue_SvU8(ST(1));
4277       } else if (sizeof(size_t) == 2) {
4278         arg2 = amglue_SvU16(ST(1));
4279       } else if (sizeof(size_t) == 4) {
4280         arg2 = amglue_SvU32(ST(1));
4281       } else if (sizeof(size_t) == 8) {
4282         arg2 = amglue_SvU64(ST(1));
4283       } else {
4284         croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
4285       }
4286     }
4287     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Device, 0 |  0 );
4288     if (!SWIG_IsOK(res3)) {
4289       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "write_random_to_device" "', argument " "3"" of type '" "Device *""'"); 
4290     }
4291     arg3 = (Device *)(argp3);
4292     result = (gboolean)write_random_to_device(arg1,arg2,arg3);
4293     {
4294       if (result)
4295       ST(argvi) = &PL_sv_yes;
4296       else
4297       ST(argvi) = &PL_sv_no;
4298       argvi++;
4299     }
4300     
4301     
4302     XSRETURN(argvi);
4303   fail:
4304     
4305     
4306     SWIG_croak_null();
4307   }
4308 }
4309
4310
4311 XS(_wrap_verify_random_from_device) {
4312   {
4313     guint32 arg1 ;
4314     size_t arg2 ;
4315     Device *arg3 = (Device *) 0 ;
4316     void *argp3 = 0 ;
4317     int res3 = 0 ;
4318     int argvi = 0;
4319     gboolean result;
4320     dXSARGS;
4321     
4322     if ((items < 3) || (items > 3)) {
4323       SWIG_croak("Usage: verify_random_from_device(seed,length,device);");
4324     }
4325     {
4326       arg1 = amglue_SvU32(ST(0));
4327     }
4328     {
4329       if (sizeof(size_t) == 1) {
4330         arg2 = amglue_SvU8(ST(1));
4331       } else if (sizeof(size_t) == 2) {
4332         arg2 = amglue_SvU16(ST(1));
4333       } else if (sizeof(size_t) == 4) {
4334         arg2 = amglue_SvU32(ST(1));
4335       } else if (sizeof(size_t) == 8) {
4336         arg2 = amglue_SvU64(ST(1));
4337       } else {
4338         croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
4339       }
4340     }
4341     res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Device, 0 |  0 );
4342     if (!SWIG_IsOK(res3)) {
4343       SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "verify_random_from_device" "', argument " "3"" of type '" "Device *""'"); 
4344     }
4345     arg3 = (Device *)(argp3);
4346     result = (gboolean)verify_random_from_device(arg1,arg2,arg3);
4347     {
4348       if (result)
4349       ST(argvi) = &PL_sv_yes;
4350       else
4351       ST(argvi) = &PL_sv_no;
4352       argvi++;
4353     }
4354     
4355     
4356     XSRETURN(argvi);
4357   fail:
4358     
4359     
4360     SWIG_croak_null();
4361   }
4362 }
4363
4364
4365 XS(_wrap_IS_WRITABLE_ACCESS_MODE) {
4366   {
4367     DeviceAccessMode arg1 ;
4368     int argvi = 0;
4369     gboolean result;
4370     dXSARGS;
4371     
4372     if ((items < 1) || (items > 1)) {
4373       SWIG_croak("Usage: IS_WRITABLE_ACCESS_MODE(mode);");
4374     }
4375     {
4376       if (sizeof(signed int) == 1) {
4377         arg1 = amglue_SvI8(ST(0));
4378       } else if (sizeof(signed int) == 2) {
4379         arg1 = amglue_SvI16(ST(0));
4380       } else if (sizeof(signed int) == 4) {
4381         arg1 = amglue_SvI32(ST(0));
4382       } else if (sizeof(signed int) == 8) {
4383         arg1 = amglue_SvI64(ST(0));
4384       } else {
4385         g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
4386       }
4387     }
4388     result = (gboolean)IS_WRITABLE_ACCESS_MODE(arg1);
4389     {
4390       if (result)
4391       ST(argvi) = &PL_sv_yes;
4392       else
4393       ST(argvi) = &PL_sv_no;
4394       argvi++;
4395     }
4396     
4397     XSRETURN(argvi);
4398   fail:
4399     
4400     SWIG_croak_null();
4401   }
4402 }
4403
4404
4405
4406 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
4407
4408 static swig_type_info _swigt__p_Device = {"_p_Device", "struct Device *|Device *", 0, 0, (void*)"Amanda::Device::Device", 0};
4409 static swig_type_info _swigt__p_DevicePropertyBase = {"_p_DevicePropertyBase", "DevicePropertyBase *", 0, 0, (void*)0, 0};
4410 static swig_type_info _swigt__p_DirectTCPAddr = {"_p_DirectTCPAddr", "DirectTCPAddr *", 0, 0, (void*)0, 0};
4411 static swig_type_info _swigt__p_DirectTCPConnection = {"_p_DirectTCPConnection", "struct DirectTCPConnection *|DirectTCPConnection *", 0, 0, (void*)"Amanda::Device::DirectTCPConnection", 0};
4412 static swig_type_info _swigt__p_GSList = {"_p_GSList", "GSList *", 0, 0, (void*)0, 0};
4413 static swig_type_info _swigt__p_GValue = {"_p_GValue", "GValue *", 0, 0, (void*)0, 0};
4414 static swig_type_info _swigt__p_a_STRMAX__char = {"_p_a_STRMAX__char", "char (*)[STRMAX]|string_t *", 0, 0, (void*)0, 0};
4415 static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
4416 static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
4417 static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Header::Header", 0};
4418 static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
4419 static swig_type_info _swigt__p_guint = {"_p_guint", "guint *", 0, 0, (void*)0, 0};
4420 static swig_type_info _swigt__p_guint32 = {"_p_guint32", "guint32 *", 0, 0, (void*)0, 0};
4421 static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
4422 static swig_type_info _swigt__p_int = {"_p_int", "int *|PropertySurety *|ConcurrencyParadigm *|filetype_t *|PropertySource *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|DeviceStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0};
4423 static swig_type_info _swigt__p_p_DirectTCPAddr = {"_p_p_DirectTCPAddr", "DirectTCPAddr **", 0, 0, (void*)0, 0};
4424 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
4425
4426 static swig_type_info *swig_type_initial[] = {
4427   &_swigt__p_Device,
4428   &_swigt__p_DevicePropertyBase,
4429   &_swigt__p_DirectTCPAddr,
4430   &_swigt__p_DirectTCPConnection,
4431   &_swigt__p_GSList,
4432   &_swigt__p_GValue,
4433   &_swigt__p_a_STRMAX__char,
4434   &_swigt__p_char,
4435   &_swigt__p_double,
4436   &_swigt__p_dumpfile_t,
4437   &_swigt__p_float,
4438   &_swigt__p_guint,
4439   &_swigt__p_guint32,
4440   &_swigt__p_guint64,
4441   &_swigt__p_int,
4442   &_swigt__p_p_DirectTCPAddr,
4443   &_swigt__p_unsigned_char,
4444 };
4445
4446 static swig_cast_info _swigc__p_Device[] = {  {&_swigt__p_Device, 0, 0, 0},{0, 0, 0, 0}};
4447 static swig_cast_info _swigc__p_DevicePropertyBase[] = {  {&_swigt__p_DevicePropertyBase, 0, 0, 0},{0, 0, 0, 0}};
4448 static swig_cast_info _swigc__p_DirectTCPAddr[] = {  {&_swigt__p_DirectTCPAddr, 0, 0, 0},{0, 0, 0, 0}};
4449 static swig_cast_info _swigc__p_DirectTCPConnection[] = {  {&_swigt__p_DirectTCPConnection, 0, 0, 0},{0, 0, 0, 0}};
4450 static swig_cast_info _swigc__p_GSList[] = {  {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};
4451 static swig_cast_info _swigc__p_GValue[] = {  {&_swigt__p_GValue, 0, 0, 0},{0, 0, 0, 0}};
4452 static swig_cast_info _swigc__p_a_STRMAX__char[] = {  {&_swigt__p_a_STRMAX__char, 0, 0, 0},{0, 0, 0, 0}};
4453 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
4454 static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
4455 static swig_cast_info _swigc__p_dumpfile_t[] = {  {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
4456 static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
4457 static swig_cast_info _swigc__p_guint[] = {  {&_swigt__p_guint, 0, 0, 0},{0, 0, 0, 0}};
4458 static swig_cast_info _swigc__p_guint32[] = {  {&_swigt__p_guint32, 0, 0, 0},{0, 0, 0, 0}};
4459 static swig_cast_info _swigc__p_guint64[] = {  {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
4460 static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
4461 static swig_cast_info _swigc__p_p_DirectTCPAddr[] = {  {&_swigt__p_p_DirectTCPAddr, 0, 0, 0},{0, 0, 0, 0}};
4462 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
4463
4464 static swig_cast_info *swig_cast_initial[] = {
4465   _swigc__p_Device,
4466   _swigc__p_DevicePropertyBase,
4467   _swigc__p_DirectTCPAddr,
4468   _swigc__p_DirectTCPConnection,
4469   _swigc__p_GSList,
4470   _swigc__p_GValue,
4471   _swigc__p_a_STRMAX__char,
4472   _swigc__p_char,
4473   _swigc__p_double,
4474   _swigc__p_dumpfile_t,
4475   _swigc__p_float,
4476   _swigc__p_guint,
4477   _swigc__p_guint32,
4478   _swigc__p_guint64,
4479   _swigc__p_int,
4480   _swigc__p_p_DirectTCPAddr,
4481   _swigc__p_unsigned_char,
4482 };
4483
4484
4485 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
4486
4487 static swig_constant_info swig_constants[] = {
4488 {0,0,0,0,0,0}
4489 };
4490 #ifdef __cplusplus
4491 }
4492 #endif
4493 static swig_variable_info swig_variables[] = {
4494 {0,0,0,0}
4495 };
4496 static swig_command_info swig_commands[] = {
4497 {"Amanda::Devicec::delete_DirectTCPConnection", _wrap_delete_DirectTCPConnection},
4498 {"Amanda::Devicec::DirectTCPConnection_close", _wrap_DirectTCPConnection_close},
4499 {"Amanda::Devicec::new_DirectTCPConnection", _wrap_new_DirectTCPConnection},
4500 {"Amanda::Devicec::unaliased_name", _wrap_unaliased_name},
4501 {"Amanda::Devicec::new_Device", _wrap_new_Device},
4502 {"Amanda::Devicec::delete_Device", _wrap_delete_Device},
4503 {"Amanda::Devicec::Device_configure", _wrap_Device_configure},
4504 {"Amanda::Devicec::Device_error", _wrap_Device_error},
4505 {"Amanda::Devicec::Device_status_error", _wrap_Device_status_error},
4506 {"Amanda::Devicec::Device_error_or_status", _wrap_Device_error_or_status},
4507 {"Amanda::Devicec::Device_read_label", _wrap_Device_read_label},
4508 {"Amanda::Devicec::Device_start", _wrap_Device_start},
4509 {"Amanda::Devicec::Device_finish", _wrap_Device_finish},
4510 {"Amanda::Devicec::Device_start_file", _wrap_Device_start_file},
4511 {"Amanda::Devicec::Device_write_block", _wrap_Device_write_block},
4512 {"Amanda::Devicec::Device_finish_file", _wrap_Device_finish_file},
4513 {"Amanda::Devicec::Device_seek_file", _wrap_Device_seek_file},
4514 {"Amanda::Devicec::Device_seek_block", _wrap_Device_seek_block},
4515 {"Amanda::Devicec::Device_read_block", _wrap_Device_read_block},
4516 {"Amanda::Devicec::Device_erase", _wrap_Device_erase},
4517 {"Amanda::Devicec::Device_eject", _wrap_Device_eject},
4518 {"Amanda::Devicec::Device_directtcp_supported", _wrap_Device_directtcp_supported},
4519 {"Amanda::Devicec::Device_listen", _wrap_Device_listen},
4520 {"Amanda::Devicec::Device_accept", _wrap_Device_accept},
4521 {"Amanda::Devicec::Device_connect", _wrap_Device_connect},
4522 {"Amanda::Devicec::Device_use_connection", _wrap_Device_use_connection},
4523 {"Amanda::Devicec::Device_write_from_connection", _wrap_Device_write_from_connection},
4524 {"Amanda::Devicec::Device_read_to_connection", _wrap_Device_read_to_connection},
4525 {"Amanda::Devicec::Device_property_list", _wrap_Device_property_list},
4526 {"Amanda::Devicec::Device_property_get", _wrap_Device_property_get},
4527 {"Amanda::Devicec::Device_property_set", _wrap_Device_property_set},
4528 {"Amanda::Devicec::Device_property_set_ex", _wrap_Device_property_set_ex},
4529 {"Amanda::Devicec::Device_recycle_file", _wrap_Device_recycle_file},
4530 {"Amanda::Devicec::Device_file", _wrap_Device_file},
4531 {"Amanda::Devicec::Device_block", _wrap_Device_block},
4532 {"Amanda::Devicec::Device_in_file", _wrap_Device_in_file},
4533 {"Amanda::Devicec::Device_device_name", _wrap_Device_device_name},
4534 {"Amanda::Devicec::Device_access_mode", _wrap_Device_access_mode},
4535 {"Amanda::Devicec::Device_is_eof", _wrap_Device_is_eof},
4536 {"Amanda::Devicec::Device_is_eom", _wrap_Device_is_eom},
4537 {"Amanda::Devicec::Device_volume_label", _wrap_Device_volume_label},
4538 {"Amanda::Devicec::Device_volume_time", _wrap_Device_volume_time},
4539 {"Amanda::Devicec::Device_status", _wrap_Device_status},
4540 {"Amanda::Devicec::Device_min_block_size", _wrap_Device_min_block_size},
4541 {"Amanda::Devicec::Device_max_block_size", _wrap_Device_max_block_size},
4542 {"Amanda::Devicec::Device_block_size", _wrap_Device_block_size},
4543 {"Amanda::Devicec::Device_header_block_size", _wrap_Device_header_block_size},
4544 {"Amanda::Devicec::Device_volume_header", _wrap_Device_volume_header},
4545 {"Amanda::Devicec::rait_device_open_from_children", _wrap_rait_device_open_from_children},
4546 {"Amanda::Devicec::write_random_to_device", _wrap_write_random_to_device},
4547 {"Amanda::Devicec::verify_random_from_device", _wrap_verify_random_from_device},
4548 {"Amanda::Devicec::IS_WRITABLE_ACCESS_MODE", _wrap_IS_WRITABLE_ACCESS_MODE},
4549 {0,0}
4550 };
4551 /* -----------------------------------------------------------------------------
4552  * Type initialization:
4553  * This problem is tough by the requirement that no dynamic 
4554  * memory is used. Also, since swig_type_info structures store pointers to 
4555  * swig_cast_info structures and swig_cast_info structures store pointers back
4556  * to swig_type_info structures, we need some lookup code at initialization. 
4557  * The idea is that swig generates all the structures that are needed. 
4558  * The runtime then collects these partially filled structures. 
4559  * The SWIG_InitializeModule function takes these initial arrays out of 
4560  * swig_module, and does all the lookup, filling in the swig_module.types
4561  * array with the correct data and linking the correct swig_cast_info
4562  * structures together.
4563  *
4564  * The generated swig_type_info structures are assigned staticly to an initial 
4565  * array. We just loop through that array, and handle each type individually.
4566  * First we lookup if this type has been already loaded, and if so, use the
4567  * loaded structure instead of the generated one. Then we have to fill in the
4568  * cast linked list. The cast data is initially stored in something like a
4569  * two-dimensional array. Each row corresponds to a type (there are the same
4570  * number of rows as there are in the swig_type_initial array). Each entry in
4571  * a column is one of the swig_cast_info structures for that type.
4572  * The cast_initial array is actually an array of arrays, because each row has
4573  * a variable number of columns. So to actually build the cast linked list,
4574  * we find the array of casts associated with the type, and loop through it 
4575  * adding the casts to the list. The one last trick we need to do is making
4576  * sure the type pointer in the swig_cast_info struct is correct.
4577  *
4578  * First off, we lookup the cast->type name to see if it is already loaded. 
4579  * There are three cases to handle:
4580  *  1) If the cast->type has already been loaded AND the type we are adding
4581  *     casting info to has not been loaded (it is in this module), THEN we
4582  *     replace the cast->type pointer with the type pointer that has already
4583  *     been loaded.
4584  *  2) If BOTH types (the one we are adding casting info to, and the 
4585  *     cast->type) are loaded, THEN the cast info has already been loaded by
4586  *     the previous module so we just ignore it.
4587  *  3) Finally, if cast->type has not already been loaded, then we add that
4588  *     swig_cast_info to the linked list (because the cast->type) pointer will
4589  *     be correct.
4590  * ----------------------------------------------------------------------------- */
4591
4592 #ifdef __cplusplus
4593 extern "C" {
4594 #if 0
4595 } /* c-mode */
4596 #endif
4597 #endif
4598
4599 #if 0
4600 #define SWIGRUNTIME_DEBUG
4601 #endif
4602
4603
4604 SWIGRUNTIME void
4605 SWIG_InitializeModule(void *clientdata) {
4606   size_t i;
4607   swig_module_info *module_head, *iter;
4608   int found, init;
4609   
4610   clientdata = clientdata;
4611   
4612   /* check to see if the circular list has been setup, if not, set it up */
4613   if (swig_module.next==0) {
4614     /* Initialize the swig_module */
4615     swig_module.type_initial = swig_type_initial;
4616     swig_module.cast_initial = swig_cast_initial;
4617     swig_module.next = &swig_module;
4618     init = 1;
4619   } else {
4620     init = 0;
4621   }
4622   
4623   /* Try and load any already created modules */
4624   module_head = SWIG_GetModule(clientdata);
4625   if (!module_head) {
4626     /* This is the first module loaded for this interpreter */
4627     /* so set the swig module into the interpreter */
4628     SWIG_SetModule(clientdata, &swig_module);
4629     module_head = &swig_module;
4630   } else {
4631     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
4632     found=0;
4633     iter=module_head;
4634     do {
4635       if (iter==&swig_module) {
4636         found=1;
4637         break;
4638       }
4639       iter=iter->next;
4640     } while (iter!= module_head);
4641     
4642     /* if the is found in the list, then all is done and we may leave */
4643     if (found) return;
4644     /* otherwise we must add out module into the list */
4645     swig_module.next = module_head->next;
4646     module_head->next = &swig_module;
4647   }
4648   
4649   /* When multiple interpeters are used, a module could have already been initialized in
4650        a different interpreter, but not yet have a pointer in this interpreter.
4651        In this case, we do not want to continue adding types... everything should be
4652        set up already */
4653   if (init == 0) return;
4654   
4655   /* Now work on filling in swig_module.types */
4656 #ifdef SWIGRUNTIME_DEBUG
4657   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
4658 #endif
4659   for (i = 0; i < swig_module.size; ++i) {
4660     swig_type_info *type = 0;
4661     swig_type_info *ret;
4662     swig_cast_info *cast;
4663     
4664 #ifdef SWIGRUNTIME_DEBUG
4665     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4666 #endif
4667     
4668     /* if there is another module already loaded */
4669     if (swig_module.next != &swig_module) {
4670       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
4671     }
4672     if (type) {
4673       /* Overwrite clientdata field */
4674 #ifdef SWIGRUNTIME_DEBUG
4675       printf("SWIG_InitializeModule: found type %s\n", type->name);
4676 #endif
4677       if (swig_module.type_initial[i]->clientdata) {
4678         type->clientdata = swig_module.type_initial[i]->clientdata;
4679 #ifdef SWIGRUNTIME_DEBUG
4680         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
4681 #endif
4682       }
4683     } else {
4684       type = swig_module.type_initial[i];
4685     }
4686     
4687     /* Insert casting types */
4688     cast = swig_module.cast_initial[i];
4689     while (cast->type) {
4690       /* Don't need to add information already in the list */
4691       ret = 0;
4692 #ifdef SWIGRUNTIME_DEBUG
4693       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
4694 #endif
4695       if (swig_module.next != &swig_module) {
4696         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
4697 #ifdef SWIGRUNTIME_DEBUG
4698         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
4699 #endif
4700       }
4701       if (ret) {
4702         if (type == swig_module.type_initial[i]) {
4703 #ifdef SWIGRUNTIME_DEBUG
4704           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
4705 #endif
4706           cast->type = ret;
4707           ret = 0;
4708         } else {
4709           /* Check for casting already in the list */
4710           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
4711 #ifdef SWIGRUNTIME_DEBUG
4712           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
4713 #endif
4714           if (!ocast) ret = 0;
4715         }
4716       }
4717       
4718       if (!ret) {
4719 #ifdef SWIGRUNTIME_DEBUG
4720         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
4721 #endif
4722         if (type->cast) {
4723           type->cast->prev = cast;
4724           cast->next = type->cast;
4725         }
4726         type->cast = cast;
4727       }
4728       cast++;
4729     }
4730     /* Set entry in modules->types array equal to the type */
4731     swig_module.types[i] = type;
4732   }
4733   swig_module.types[i] = 0;
4734   
4735 #ifdef SWIGRUNTIME_DEBUG
4736   printf("**** SWIG_InitializeModule: Cast List ******\n");
4737   for (i = 0; i < swig_module.size; ++i) {
4738     int j = 0;
4739     swig_cast_info *cast = swig_module.cast_initial[i];
4740     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
4741     while (cast->type) {
4742       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
4743       cast++;
4744       ++j;
4745     }
4746     printf("---- Total casts: %d\n",j);
4747   }
4748   printf("**** SWIG_InitializeModule: Cast List ******\n");
4749 #endif
4750 }
4751
4752 /* This function will propagate the clientdata field of type to
4753 * any new swig_type_info structures that have been added into the list
4754 * of equivalent types.  It is like calling
4755 * SWIG_TypeClientData(type, clientdata) a second time.
4756 */
4757 SWIGRUNTIME void
4758 SWIG_PropagateClientData(void) {
4759   size_t i;
4760   swig_cast_info *equiv;
4761   static int init_run = 0;
4762   
4763   if (init_run) return;
4764   init_run = 1;
4765   
4766   for (i = 0; i < swig_module.size; i++) {
4767     if (swig_module.types[i]->clientdata) {
4768       equiv = swig_module.types[i]->cast;
4769       while (equiv) {
4770         if (!equiv->converter) {
4771           if (equiv->type && !equiv->type->clientdata)
4772           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
4773         }
4774         equiv = equiv->next;
4775       }
4776     }
4777   }
4778 }
4779
4780 #ifdef __cplusplus
4781 #if 0
4782 {
4783   /* c-mode */
4784 #endif
4785 }
4786 #endif
4787
4788
4789
4790 #ifdef __cplusplus
4791 extern "C"
4792 #endif
4793
4794 XS(SWIG_init) {
4795   dXSARGS;
4796   int i;
4797   
4798   SWIG_InitializeModule(0);
4799   
4800   /* Install commands */
4801   for (i = 0; swig_commands[i].name; i++) {
4802     newXS((char*) swig_commands[i].name,swig_commands[i].wrapper, (char*)__FILE__);
4803   }
4804   
4805   /* Install variables */
4806   for (i = 0; swig_variables[i].name; i++) {
4807     SV *sv;
4808     sv = get_sv((char*) swig_variables[i].name, TRUE | 0x2 | GV_ADDMULTI);
4809     if (swig_variables[i].type) {
4810       SWIG_MakePtr(sv,(void *)1, *swig_variables[i].type,0);
4811     } else {
4812       sv_setiv(sv,(IV) 0);
4813     }
4814     swig_create_magic(sv, (char *) swig_variables[i].name, swig_variables[i].set, swig_variables[i].get); 
4815   }
4816   
4817   /* Install constant */
4818   for (i = 0; swig_constants[i].type; i++) {
4819     SV *sv;
4820     sv = get_sv((char*)swig_constants[i].name, TRUE | 0x2 | GV_ADDMULTI);
4821     switch(swig_constants[i].type) {
4822     case SWIG_INT:
4823       sv_setiv(sv, (IV) swig_constants[i].lvalue);
4824       break;
4825     case SWIG_FLOAT:
4826       sv_setnv(sv, (double) swig_constants[i].dvalue);
4827       break;
4828     case SWIG_STRING:
4829       sv_setpv(sv, (char *) swig_constants[i].pvalue);
4830       break;
4831     case SWIG_POINTER:
4832       SWIG_MakePtr(sv, swig_constants[i].pvalue, *(swig_constants[i].ptype),0);
4833       break;
4834     case SWIG_BINARY:
4835       SWIG_MakePackedObj(sv, swig_constants[i].pvalue, swig_constants[i].lvalue, *(swig_constants[i].ptype));
4836       break;
4837     default:
4838       break;
4839     }
4840     SvREADONLY_on(sv);
4841   }
4842   
4843   
4844   /* Initialize the Device API on load */
4845   device_api_init();
4846   
4847   SWIG_TypeClientData(SWIGTYPE_p_DirectTCPConnection, (void*) "Amanda::Device::DirectTCPConnection");
4848   SWIG_TypeClientData(SWIGTYPE_p_Device, (void*) "Amanda::Device::Device");
4849   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4850     SV *sv = get_sv((char*) SWIG_prefix "ACCESS_NULL", TRUE | 0x2 | GV_ADDMULTI);
4851     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_NULL)));
4852     SvREADONLY_on(sv);
4853   } while(0) /*@SWIG@*/;
4854   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4855     SV *sv = get_sv((char*) SWIG_prefix "ACCESS_READ", TRUE | 0x2 | GV_ADDMULTI);
4856     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_READ)));
4857     SvREADONLY_on(sv);
4858   } while(0) /*@SWIG@*/;
4859   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4860     SV *sv = get_sv((char*) SWIG_prefix "ACCESS_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4861     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_WRITE)));
4862     SvREADONLY_on(sv);
4863   } while(0) /*@SWIG@*/;
4864   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4865     SV *sv = get_sv((char*) SWIG_prefix "ACCESS_APPEND", TRUE | 0x2 | GV_ADDMULTI);
4866     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(ACCESS_APPEND)));
4867     SvREADONLY_on(sv);
4868   } while(0) /*@SWIG@*/;
4869   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4870     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_SUCCESS", TRUE | 0x2 | GV_ADDMULTI);
4871     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_SUCCESS)));
4872     SvREADONLY_on(sv);
4873   } while(0) /*@SWIG@*/;
4874   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4875     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_DEVICE_ERROR", TRUE | 0x2 | GV_ADDMULTI);
4876     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_DEVICE_ERROR)));
4877     SvREADONLY_on(sv);
4878   } while(0) /*@SWIG@*/;
4879   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4880     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_DEVICE_BUSY", TRUE | 0x2 | GV_ADDMULTI);
4881     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_DEVICE_BUSY)));
4882     SvREADONLY_on(sv);
4883   } while(0) /*@SWIG@*/;
4884   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4885     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_VOLUME_MISSING", TRUE | 0x2 | GV_ADDMULTI);
4886     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_VOLUME_MISSING)));
4887     SvREADONLY_on(sv);
4888   } while(0) /*@SWIG@*/;
4889   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4890     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_VOLUME_UNLABELED", TRUE | 0x2 | GV_ADDMULTI);
4891     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_VOLUME_UNLABELED)));
4892     SvREADONLY_on(sv);
4893   } while(0) /*@SWIG@*/;
4894   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4895     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_VOLUME_ERROR", TRUE | 0x2 | GV_ADDMULTI);
4896     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_VOLUME_ERROR)));
4897     SvREADONLY_on(sv);
4898   } while(0) /*@SWIG@*/;
4899   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4900     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_STATUS_FLAGS_MAX", TRUE | 0x2 | GV_ADDMULTI);
4901     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_STATUS_FLAGS_MAX)));
4902     SvREADONLY_on(sv);
4903   } while(0) /*@SWIG@*/;
4904   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4905     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BEFORE_START", TRUE | 0x2 | GV_ADDMULTI);
4906     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BEFORE_START)));
4907     SvREADONLY_on(sv);
4908   } while(0) /*@SWIG@*/;
4909   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4910     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4911     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BETWEEN_FILE_WRITE)));
4912     SvREADONLY_on(sv);
4913   } while(0) /*@SWIG@*/;
4914   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4915     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4916     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_INSIDE_FILE_WRITE)));
4917     SvREADONLY_on(sv);
4918   } while(0) /*@SWIG@*/;
4919   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4920     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_BETWEEN_FILE_READ", TRUE | 0x2 | GV_ADDMULTI);
4921     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_BETWEEN_FILE_READ)));
4922     SvREADONLY_on(sv);
4923   } while(0) /*@SWIG@*/;
4924   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4925     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_INSIDE_FILE_READ", TRUE | 0x2 | GV_ADDMULTI);
4926     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_INSIDE_FILE_READ)));
4927     SvREADONLY_on(sv);
4928   } while(0) /*@SWIG@*/;
4929   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4930     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MAX", TRUE | 0x2 | GV_ADDMULTI);
4931     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_MAX)));
4932     SvREADONLY_on(sv);
4933   } while(0) /*@SWIG@*/;
4934   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4935     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_MASK", TRUE | 0x2 | GV_ADDMULTI);
4936     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_MASK)));
4937     SvREADONLY_on(sv);
4938   } while(0) /*@SWIG@*/;
4939   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4940     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_PHASE_SHIFT", TRUE | 0x2 | GV_ADDMULTI);
4941     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_PHASE_SHIFT)));
4942     SvREADONLY_on(sv);
4943   } while(0) /*@SWIG@*/;
4944   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4945     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BEFORE_START", TRUE | 0x2 | GV_ADDMULTI);
4946     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BEFORE_START)));
4947     SvREADONLY_on(sv);
4948   } while(0) /*@SWIG@*/;
4949   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4950     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4951     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BETWEEN_FILE_WRITE)));
4952     SvREADONLY_on(sv);
4953   } while(0) /*@SWIG@*/;
4954   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4955     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4956     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_INSIDE_FILE_WRITE)));
4957     SvREADONLY_on(sv);
4958   } while(0) /*@SWIG@*/;
4959   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4960     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_BETWEEN_FILE_READ", TRUE | 0x2 | GV_ADDMULTI);
4961     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_BETWEEN_FILE_READ)));
4962     SvREADONLY_on(sv);
4963   } while(0) /*@SWIG@*/;
4964   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4965     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_INSIDE_FILE_READ", TRUE | 0x2 | GV_ADDMULTI);
4966     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_INSIDE_FILE_READ)));
4967     SvREADONLY_on(sv);
4968   } while(0) /*@SWIG@*/;
4969   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4970     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BEFORE_START", TRUE | 0x2 | GV_ADDMULTI);
4971     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BEFORE_START)));
4972     SvREADONLY_on(sv);
4973   } while(0) /*@SWIG@*/;
4974   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4975     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4976     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BETWEEN_FILE_WRITE)));
4977     SvREADONLY_on(sv);
4978   } while(0) /*@SWIG@*/;
4979   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4980     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE", TRUE | 0x2 | GV_ADDMULTI);
4981     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE)));
4982     SvREADONLY_on(sv);
4983   } while(0) /*@SWIG@*/;
4984   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4985     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_BETWEEN_FILE_READ", TRUE | 0x2 | GV_ADDMULTI);
4986     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_BETWEEN_FILE_READ)));
4987     SvREADONLY_on(sv);
4988   } while(0) /*@SWIG@*/;
4989   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4990     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_INSIDE_FILE_READ", TRUE | 0x2 | GV_ADDMULTI);
4991     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_INSIDE_FILE_READ)));
4992     SvREADONLY_on(sv);
4993   } while(0) /*@SWIG@*/;
4994   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
4995     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_GET_MASK", TRUE | 0x2 | GV_ADDMULTI);
4996     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_GET_MASK)));
4997     SvREADONLY_on(sv);
4998   } while(0) /*@SWIG@*/;
4999   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5000     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_ACCESS_SET_MASK", TRUE | 0x2 | GV_ADDMULTI);
5001     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_ACCESS_SET_MASK)));
5002     SvREADONLY_on(sv);
5003   } while(0) /*@SWIG@*/;
5004   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5005     SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_EXCLUSIVE", TRUE | 0x2 | GV_ADDMULTI);
5006     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_EXCLUSIVE)));
5007     SvREADONLY_on(sv);
5008   } while(0) /*@SWIG@*/;
5009   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5010     SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_SHARED_READ", TRUE | 0x2 | GV_ADDMULTI);
5011     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_SHARED_READ)));
5012     SvREADONLY_on(sv);
5013   } while(0) /*@SWIG@*/;
5014   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5015     SV *sv = get_sv((char*) SWIG_prefix "CONCURRENCY_PARADIGM_RANDOM_ACCESS", TRUE | 0x2 | GV_ADDMULTI);
5016     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CONCURRENCY_PARADIGM_RANDOM_ACCESS)));
5017     SvREADONLY_on(sv);
5018   } while(0) /*@SWIG@*/;
5019   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5020     SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_NONE", TRUE | 0x2 | GV_ADDMULTI);
5021     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_NONE)));
5022     SvREADONLY_on(sv);
5023   } while(0) /*@SWIG@*/;
5024   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5025     SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_DESIRED", TRUE | 0x2 | GV_ADDMULTI);
5026     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_DESIRED)));
5027     SvREADONLY_on(sv);
5028   } while(0) /*@SWIG@*/;
5029   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5030     SV *sv = get_sv((char*) SWIG_prefix "STREAMING_REQUIREMENT_REQUIRED", TRUE | 0x2 | GV_ADDMULTI);
5031     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(STREAMING_REQUIREMENT_REQUIRED)));
5032     SvREADONLY_on(sv);
5033   } while(0) /*@SWIG@*/;
5034   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5035     SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_ONLY", TRUE | 0x2 | GV_ADDMULTI);
5036     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_READ_ONLY)));
5037     SvREADONLY_on(sv);
5038   } while(0) /*@SWIG@*/;
5039   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5040     SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WORM", TRUE | 0x2 | GV_ADDMULTI);
5041     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WORM)));
5042     SvREADONLY_on(sv);
5043   } while(0) /*@SWIG@*/;
5044   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5045     SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_READ_WRITE", TRUE | 0x2 | GV_ADDMULTI);
5046     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_READ_WRITE)));
5047     SvREADONLY_on(sv);
5048   } while(0) /*@SWIG@*/;
5049   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5050     SV *sv = get_sv((char*) SWIG_prefix "MEDIA_ACCESS_MODE_WRITE_ONLY", TRUE | 0x2 | GV_ADDMULTI);
5051     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WRITE_ONLY)));
5052     SvREADONLY_on(sv);
5053   } while(0) /*@SWIG@*/;
5054   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5055     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SURETY_BAD", TRUE | 0x2 | GV_ADDMULTI);
5056     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SURETY_BAD)));
5057     SvREADONLY_on(sv);
5058   } while(0) /*@SWIG@*/;
5059   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5060     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SURETY_GOOD", TRUE | 0x2 | GV_ADDMULTI);
5061     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SURETY_GOOD)));
5062     SvREADONLY_on(sv);
5063   } while(0) /*@SWIG@*/;
5064   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5065     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SOURCE_DEFAULT", TRUE | 0x2 | GV_ADDMULTI);
5066     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SOURCE_DEFAULT)));
5067     SvREADONLY_on(sv);
5068   } while(0) /*@SWIG@*/;
5069   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5070     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SOURCE_DETECTED", TRUE | 0x2 | GV_ADDMULTI);
5071     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SOURCE_DETECTED)));
5072     SvREADONLY_on(sv);
5073   } while(0) /*@SWIG@*/;
5074   /*@SWIG:/usr/share/swig/2.0.4/perl5/perltypemaps.swg,65,%set_constant@*/ do {
5075     SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SOURCE_USER", TRUE | 0x2 | GV_ADDMULTI);
5076     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SOURCE_USER)));
5077     SvREADONLY_on(sv);
5078   } while(0) /*@SWIG@*/;
5079   ST(0) = &PL_sv_yes;
5080   XSRETURN(1);
5081 }
5082