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