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