~ubuntu-branches/ubuntu/quantal/znc/quantal-backports

« back to all changes in this revision

Viewing changes to modules/modperl/swigperlrun.h

  • Committer: Package Import Robot
  • Author(s): Micah Gersten
  • Date: 2013-01-01 19:39:47 UTC
  • mfrom: (21.1.4 experimental)
  • Revision ID: package-import@ubuntu.com-20130101193947-zlqyse3v2mjxnhvw
Tags: 1.0-2~ubuntu12.10.1
No-change backport to quantal (LP: #1085731)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ----------------------------------------------------------------------------
 
2
 * This file was automatically generated by SWIG (http://www.swig.org).
 
3
 * Version 2.0.8
 
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
/* -----------------------------------------------------------------------------
 
12
 *  This section contains generic SWIG labels for method/variable
 
13
 *  declarations/attributes, and other compiler dependent labels.
 
14
 * ----------------------------------------------------------------------------- */
 
15
 
 
16
/* template workaround for compilers that cannot correctly implement the C++ standard */
 
17
#ifndef SWIGTEMPLATEDISAMBIGUATOR
 
18
# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
 
19
#  define SWIGTEMPLATEDISAMBIGUATOR template
 
20
# elif defined(__HP_aCC)
 
21
/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
 
22
/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
 
23
#  define SWIGTEMPLATEDISAMBIGUATOR template
 
24
# else
 
25
#  define SWIGTEMPLATEDISAMBIGUATOR
 
26
# endif
 
27
#endif
 
28
 
 
29
/* inline attribute */
 
30
#ifndef SWIGINLINE
 
31
# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
 
32
#   define SWIGINLINE inline
 
33
# else
 
34
#   define SWIGINLINE
 
35
# endif
 
36
#endif
 
37
 
 
38
/* attribute recognised by some compilers to avoid 'unused' warnings */
 
39
#ifndef SWIGUNUSED
 
40
# if defined(__GNUC__)
 
41
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
 
42
#     define SWIGUNUSED __attribute__ ((__unused__)) 
 
43
#   else
 
44
#     define SWIGUNUSED
 
45
#   endif
 
46
# elif defined(__ICC)
 
47
#   define SWIGUNUSED __attribute__ ((__unused__)) 
 
48
# else
 
49
#   define SWIGUNUSED 
 
50
# endif
 
51
#endif
 
52
 
 
53
#ifndef SWIG_MSC_UNSUPPRESS_4505
 
54
# if defined(_MSC_VER)
 
55
#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
 
56
# endif 
 
57
#endif
 
58
 
 
59
#ifndef SWIGUNUSEDPARM
 
60
# ifdef __cplusplus
 
61
#   define SWIGUNUSEDPARM(p)
 
62
# else
 
63
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
 
64
# endif
 
65
#endif
 
66
 
 
67
/* internal SWIG method */
 
68
#ifndef SWIGINTERN
 
69
# define SWIGINTERN static SWIGUNUSED
 
70
#endif
 
71
 
 
72
/* internal inline SWIG method */
 
73
#ifndef SWIGINTERNINLINE
 
74
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
 
75
#endif
 
76
 
 
77
/* exporting methods */
 
78
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 
79
#  ifndef GCC_HASCLASSVISIBILITY
 
80
#    define GCC_HASCLASSVISIBILITY
 
81
#  endif
 
82
#endif
 
83
 
 
84
#ifndef SWIGEXPORT
 
85
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
86
#   if defined(STATIC_LINKED)
 
87
#     define SWIGEXPORT
 
88
#   else
 
89
#     define SWIGEXPORT __declspec(dllexport)
 
90
#   endif
 
91
# else
 
92
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
 
93
#     define SWIGEXPORT __attribute__ ((visibility("default")))
 
94
#   else
 
95
#     define SWIGEXPORT
 
96
#   endif
 
97
# endif
 
98
#endif
 
99
 
 
100
/* calling conventions for Windows */
 
101
#ifndef SWIGSTDCALL
 
102
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
103
#   define SWIGSTDCALL __stdcall
 
104
# else
 
105
#   define SWIGSTDCALL
 
106
# endif 
 
107
#endif
 
108
 
 
109
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
 
110
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
 
111
# define _CRT_SECURE_NO_DEPRECATE
 
112
#endif
 
113
 
 
114
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
 
115
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
 
116
# define _SCL_SECURE_NO_DEPRECATE
 
117
#endif
 
118
 
 
119
/*  Errors in SWIG */
 
120
#define  SWIG_UnknownError         -1 
 
121
#define  SWIG_IOError              -2 
 
122
#define  SWIG_RuntimeError         -3 
 
123
#define  SWIG_IndexError           -4 
 
124
#define  SWIG_TypeError            -5 
 
125
#define  SWIG_DivisionByZero       -6 
 
126
#define  SWIG_OverflowError        -7 
 
127
#define  SWIG_SyntaxError          -8 
 
128
#define  SWIG_ValueError           -9 
 
129
#define  SWIG_SystemError          -10
 
130
#define  SWIG_AttributeError       -11
 
131
#define  SWIG_MemoryError          -12 
 
132
#define  SWIG_NullReferenceError   -13
 
133
 
 
134
 
 
135
/* -----------------------------------------------------------------------------
 
136
 * swigrun.swg
 
137
 *
 
138
 * This file contains generic C API SWIG runtime support for pointer
 
139
 * type checking.
 
140
 * ----------------------------------------------------------------------------- */
 
141
 
 
142
/* This should only be incremented when either the layout of swig_type_info changes,
 
143
   or for whatever reason, the runtime changes incompatibly */
 
144
#define SWIG_RUNTIME_VERSION "4"
 
145
 
 
146
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 
147
#ifdef SWIG_TYPE_TABLE
 
148
# define SWIG_QUOTE_STRING(x) #x
 
149
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
 
150
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
 
151
#else
 
152
# define SWIG_TYPE_TABLE_NAME
 
153
#endif
 
154
 
 
155
/*
 
156
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
 
157
  creating a static or dynamic library from the SWIG runtime code.
 
158
  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
 
159
  
 
160
  But only do this if strictly necessary, ie, if you have problems
 
161
  with your compiler or suchlike.
 
162
*/
 
163
 
 
164
#ifndef SWIGRUNTIME
 
165
# define SWIGRUNTIME SWIGINTERN
 
166
#endif
 
167
 
 
168
#ifndef SWIGRUNTIMEINLINE
 
169
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
 
170
#endif
 
171
 
 
172
/*  Generic buffer size */
 
173
#ifndef SWIG_BUFFER_SIZE
 
174
# define SWIG_BUFFER_SIZE 1024
 
175
#endif
 
176
 
 
177
/* Flags for pointer conversions */
 
178
#define SWIG_POINTER_DISOWN        0x1
 
179
#define SWIG_CAST_NEW_MEMORY       0x2
 
180
 
 
181
/* Flags for new pointer objects */
 
182
#define SWIG_POINTER_OWN           0x1
 
183
 
 
184
 
 
185
/* 
 
186
   Flags/methods for returning states.
 
187
   
 
188
   The SWIG conversion methods, as ConvertPtr, return an integer 
 
189
   that tells if the conversion was successful or not. And if not,
 
190
   an error code can be returned (see swigerrors.swg for the codes).
 
191
   
 
192
   Use the following macros/flags to set or process the returning
 
193
   states.
 
194
   
 
195
   In old versions of SWIG, code such as the following was usually written:
 
196
 
 
197
     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
 
198
       // success code
 
199
     } else {
 
200
       //fail code
 
201
     }
 
202
 
 
203
   Now you can be more explicit:
 
204
 
 
205
    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
 
206
    if (SWIG_IsOK(res)) {
 
207
      // success code
 
208
    } else {
 
209
      // fail code
 
210
    }
 
211
 
 
212
   which is the same really, but now you can also do
 
213
 
 
214
    Type *ptr;
 
215
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
 
216
    if (SWIG_IsOK(res)) {
 
217
      // success code
 
218
      if (SWIG_IsNewObj(res) {
 
219
        ...
 
220
        delete *ptr;
 
221
      } else {
 
222
        ...
 
223
      }
 
224
    } else {
 
225
      // fail code
 
226
    }
 
227
    
 
228
   I.e., now SWIG_ConvertPtr can return new objects and you can
 
229
   identify the case and take care of the deallocation. Of course that
 
230
   also requires SWIG_ConvertPtr to return new result values, such as
 
231
 
 
232
      int SWIG_ConvertPtr(obj, ptr,...) {         
 
233
        if (<obj is ok>) {                             
 
234
          if (<need new object>) {                     
 
235
            *ptr = <ptr to new allocated object>; 
 
236
            return SWIG_NEWOBJ;                
 
237
          } else {                                     
 
238
            *ptr = <ptr to old object>;        
 
239
            return SWIG_OLDOBJ;                
 
240
          }                                    
 
241
        } else {                                       
 
242
          return SWIG_BADOBJ;                  
 
243
        }                                              
 
244
      }
 
245
 
 
246
   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
 
247
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
 
248
   SWIG errors code.
 
249
 
 
250
   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
 
251
   allows to return the 'cast rank', for example, if you have this
 
252
 
 
253
       int food(double)
 
254
       int fooi(int);
 
255
 
 
256
   and you call
 
257
 
 
258
      food(1)   // cast rank '1'  (1 -> 1.0)
 
259
      fooi(1)   // cast rank '0'
 
260
 
 
261
   just use the SWIG_AddCast()/SWIG_CheckState()
 
262
*/
 
263
 
 
264
#define SWIG_OK                    (0) 
 
265
#define SWIG_ERROR                 (-1)
 
266
#define SWIG_IsOK(r)               (r >= 0)
 
267
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
 
268
 
 
269
/* The CastRankLimit says how many bits are used for the cast rank */
 
270
#define SWIG_CASTRANKLIMIT         (1 << 8)
 
271
/* The NewMask denotes the object was created (using new/malloc) */
 
272
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
 
273
/* The TmpMask is for in/out typemaps that use temporal objects */
 
274
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
 
275
/* Simple returning values */
 
276
#define SWIG_BADOBJ                (SWIG_ERROR)
 
277
#define SWIG_OLDOBJ                (SWIG_OK)
 
278
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
 
279
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
 
280
/* Check, add and del mask methods */
 
281
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
 
282
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
 
283
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
 
284
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
 
285
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 
286
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
287
 
 
288
/* Cast-Rank Mode */
 
289
#if defined(SWIG_CASTRANK_MODE)
 
290
#  ifndef SWIG_TypeRank
 
291
#    define SWIG_TypeRank             unsigned long
 
292
#  endif
 
293
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
 
294
#    define SWIG_MAXCASTRANK          (2)
 
295
#  endif
 
296
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 
297
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
 
298
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
 
299
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 
300
}
 
301
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
 
302
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
 
303
}
 
304
#else /* no cast-rank mode */
 
305
#  define SWIG_AddCast
 
306
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 
307
#endif
 
308
 
 
309
 
 
310
#include <string.h>
 
311
 
 
312
#ifdef __cplusplus
 
313
extern "C" {
 
314
#endif
 
315
 
 
316
typedef void *(*swig_converter_func)(void *, int *);
 
317
typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
318
 
 
319
/* Structure to store information on one type */
 
320
typedef struct swig_type_info {
 
321
  const char             *name;                 /* mangled name of this type */
 
322
  const char             *str;                  /* human readable name of this type */
 
323
  swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
 
324
  struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
 
325
  void                   *clientdata;           /* language specific type data */
 
326
  int                    owndata;               /* flag if the structure owns the clientdata */
 
327
} swig_type_info;
 
328
 
 
329
/* Structure to store a type and conversion function used for casting */
 
330
typedef struct swig_cast_info {
 
331
  swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
 
332
  swig_converter_func     converter;            /* function to cast the void pointers */
 
333
  struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
 
334
  struct swig_cast_info  *prev;                 /* pointer to the previous cast */
 
335
} swig_cast_info;
 
336
 
 
337
/* Structure used to store module information
 
338
 * Each module generates one structure like this, and the runtime collects
 
339
 * all of these structures and stores them in a circularly linked list.*/
 
340
typedef struct swig_module_info {
 
341
  swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
 
342
  size_t                 size;                  /* Number of types in this module */
 
343
  struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
 
344
  swig_type_info         **type_initial;        /* Array of initially generated type structures */
 
345
  swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
 
346
  void                    *clientdata;          /* Language specific module data */
 
347
} swig_module_info;
 
348
 
 
349
/* 
 
350
  Compare two type names skipping the space characters, therefore
 
351
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
352
 
 
353
  Return 0 when the two name types are equivalent, as in
 
354
  strncmp, but skipping ' '.
 
355
*/
 
356
SWIGRUNTIME int
 
357
SWIG_TypeNameComp(const char *f1, const char *l1,
 
358
                  const char *f2, const char *l2) {
 
359
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
 
360
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
 
361
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
 
362
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
 
363
  }
 
364
  return (int)((l1 - f1) - (l2 - f2));
 
365
}
 
366
 
 
367
/*
 
368
  Check type equivalence in a name list like <name1>|<name2>|...
 
369
  Return 0 if not equal, 1 if equal
 
370
*/
 
371
SWIGRUNTIME int
 
372
SWIG_TypeEquiv(const char *nb, const char *tb) {
 
373
  int equiv = 0;
 
374
  const char* te = tb + strlen(tb);
 
375
  const char* ne = nb;
 
376
  while (!equiv && *ne) {
 
377
    for (nb = ne; *ne; ++ne) {
 
378
      if (*ne == '|') break;
 
379
    }
 
380
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
 
381
    if (*ne) ++ne;
 
382
  }
 
383
  return equiv;
 
384
}
 
385
 
 
386
/*
 
387
  Check type equivalence in a name list like <name1>|<name2>|...
 
388
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 
389
*/
 
390
SWIGRUNTIME int
 
391
SWIG_TypeCompare(const char *nb, const char *tb) {
 
392
  int equiv = 0;
 
393
  const char* te = tb + strlen(tb);
 
394
  const char* ne = nb;
 
395
  while (!equiv && *ne) {
 
396
    for (nb = ne; *ne; ++ne) {
 
397
      if (*ne == '|') break;
 
398
    }
 
399
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
 
400
    if (*ne) ++ne;
 
401
  }
 
402
  return equiv;
 
403
}
 
404
 
 
405
 
 
406
/*
 
407
  Check the typename
 
408
*/
 
409
SWIGRUNTIME swig_cast_info *
 
410
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
 
411
  if (ty) {
 
412
    swig_cast_info *iter = ty->cast;
 
413
    while (iter) {
 
414
      if (strcmp(iter->type->name, c) == 0) {
 
415
        if (iter == ty->cast)
 
416
          return iter;
 
417
        /* Move iter to the top of the linked list */
 
418
        iter->prev->next = iter->next;
 
419
        if (iter->next)
 
420
          iter->next->prev = iter->prev;
 
421
        iter->next = ty->cast;
 
422
        iter->prev = 0;
 
423
        if (ty->cast) ty->cast->prev = iter;
 
424
        ty->cast = iter;
 
425
        return iter;
 
426
      }
 
427
      iter = iter->next;
 
428
    }
 
429
  }
 
430
  return 0;
 
431
}
 
432
 
 
433
/* 
 
434
  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
 
435
*/
 
436
SWIGRUNTIME swig_cast_info *
 
437
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
 
438
  if (ty) {
 
439
    swig_cast_info *iter = ty->cast;
 
440
    while (iter) {
 
441
      if (iter->type == from) {
 
442
        if (iter == ty->cast)
 
443
          return iter;
 
444
        /* Move iter to the top of the linked list */
 
445
        iter->prev->next = iter->next;
 
446
        if (iter->next)
 
447
          iter->next->prev = iter->prev;
 
448
        iter->next = ty->cast;
 
449
        iter->prev = 0;
 
450
        if (ty->cast) ty->cast->prev = iter;
 
451
        ty->cast = iter;
 
452
        return iter;
 
453
      }
 
454
      iter = iter->next;
 
455
    }
 
456
  }
 
457
  return 0;
 
458
}
 
459
 
 
460
/*
 
461
  Cast a pointer up an inheritance hierarchy
 
462
*/
 
463
SWIGRUNTIMEINLINE void *
 
464
SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
 
465
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
 
466
}
 
467
 
 
468
/* 
 
469
   Dynamic pointer casting. Down an inheritance hierarchy
 
470
*/
 
471
SWIGRUNTIME swig_type_info *
 
472
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
 
473
  swig_type_info *lastty = ty;
 
474
  if (!ty || !ty->dcast) return ty;
 
475
  while (ty && (ty->dcast)) {
 
476
    ty = (*ty->dcast)(ptr);
 
477
    if (ty) lastty = ty;
 
478
  }
 
479
  return lastty;
 
480
}
 
481
 
 
482
/*
 
483
  Return the name associated with this type
 
484
*/
 
485
SWIGRUNTIMEINLINE const char *
 
486
SWIG_TypeName(const swig_type_info *ty) {
 
487
  return ty->name;
 
488
}
 
489
 
 
490
/*
 
491
  Return the pretty name associated with this type,
 
492
  that is an unmangled type name in a form presentable to the user.
 
493
*/
 
494
SWIGRUNTIME const char *
 
495
SWIG_TypePrettyName(const swig_type_info *type) {
 
496
  /* The "str" field contains the equivalent pretty names of the
 
497
     type, separated by vertical-bar characters.  We choose
 
498
     to print the last name, as it is often (?) the most
 
499
     specific. */
 
500
  if (!type) return NULL;
 
501
  if (type->str != NULL) {
 
502
    const char *last_name = type->str;
 
503
    const char *s;
 
504
    for (s = type->str; *s; s++)
 
505
      if (*s == '|') last_name = s+1;
 
506
    return last_name;
 
507
  }
 
508
  else
 
509
    return type->name;
 
510
}
 
511
 
 
512
/* 
 
513
   Set the clientdata field for a type
 
514
*/
 
515
SWIGRUNTIME void
 
516
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
 
517
  swig_cast_info *cast = ti->cast;
 
518
  /* if (ti->clientdata == clientdata) return; */
 
519
  ti->clientdata = clientdata;
 
520
  
 
521
  while (cast) {
 
522
    if (!cast->converter) {
 
523
      swig_type_info *tc = cast->type;
 
524
      if (!tc->clientdata) {
 
525
        SWIG_TypeClientData(tc, clientdata);
 
526
      }
 
527
    }    
 
528
    cast = cast->next;
 
529
  }
 
530
}
 
531
SWIGRUNTIME void
 
532
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
 
533
  SWIG_TypeClientData(ti, clientdata);
 
534
  ti->owndata = 1;
 
535
}
 
536
  
 
537
/*
 
538
  Search for a swig_type_info structure only by mangled name
 
539
  Search is a O(log #types)
 
540
  
 
541
  We start searching at module start, and finish searching when start == end.  
 
542
  Note: if start == end at the beginning of the function, we go all the way around
 
543
  the circular list.
 
544
*/
 
545
SWIGRUNTIME swig_type_info *
 
546
SWIG_MangledTypeQueryModule(swig_module_info *start, 
 
547
                            swig_module_info *end, 
 
548
                            const char *name) {
 
549
  swig_module_info *iter = start;
 
550
  do {
 
551
    if (iter->size) {
 
552
      register size_t l = 0;
 
553
      register size_t r = iter->size - 1;
 
554
      do {
 
555
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
 
556
        register size_t i = (l + r) >> 1; 
 
557
        const char *iname = iter->types[i]->name;
 
558
        if (iname) {
 
559
          register int compare = strcmp(name, iname);
 
560
          if (compare == 0) {       
 
561
            return iter->types[i];
 
562
          } else if (compare < 0) {
 
563
            if (i) {
 
564
              r = i - 1;
 
565
            } else {
 
566
              break;
 
567
            }
 
568
          } else if (compare > 0) {
 
569
            l = i + 1;
 
570
          }
 
571
        } else {
 
572
          break; /* should never happen */
 
573
        }
 
574
      } while (l <= r);
 
575
    }
 
576
    iter = iter->next;
 
577
  } while (iter != end);
 
578
  return 0;
 
579
}
 
580
 
 
581
/*
 
582
  Search for a swig_type_info structure for either a mangled name or a human readable name.
 
583
  It first searches the mangled names of the types, which is a O(log #types)
 
584
  If a type is not found it then searches the human readable names, which is O(#types).
 
585
  
 
586
  We start searching at module start, and finish searching when start == end.  
 
587
  Note: if start == end at the beginning of the function, we go all the way around
 
588
  the circular list.
 
589
*/
 
590
SWIGRUNTIME swig_type_info *
 
591
SWIG_TypeQueryModule(swig_module_info *start, 
 
592
                     swig_module_info *end, 
 
593
                     const char *name) {
 
594
  /* STEP 1: Search the name field using binary search */
 
595
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
 
596
  if (ret) {
 
597
    return ret;
 
598
  } else {
 
599
    /* STEP 2: If the type hasn't been found, do a complete search
 
600
       of the str field (the human readable name) */
 
601
    swig_module_info *iter = start;
 
602
    do {
 
603
      register size_t i = 0;
 
604
      for (; i < iter->size; ++i) {
 
605
        if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
 
606
          return iter->types[i];
 
607
      }
 
608
      iter = iter->next;
 
609
    } while (iter != end);
 
610
  }
 
611
  
 
612
  /* neither found a match */
 
613
  return 0;
 
614
}
 
615
 
 
616
/* 
 
617
   Pack binary data into a string
 
618
*/
 
619
SWIGRUNTIME char *
 
620
SWIG_PackData(char *c, void *ptr, size_t sz) {
 
621
  static const char hex[17] = "0123456789abcdef";
 
622
  register const unsigned char *u = (unsigned char *) ptr;
 
623
  register const unsigned char *eu =  u + sz;
 
624
  for (; u != eu; ++u) {
 
625
    register unsigned char uu = *u;
 
626
    *(c++) = hex[(uu & 0xf0) >> 4];
 
627
    *(c++) = hex[uu & 0xf];
 
628
  }
 
629
  return c;
 
630
}
 
631
 
 
632
/* 
 
633
   Unpack binary data from a string
 
634
*/
 
635
SWIGRUNTIME const char *
 
636
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
 
637
  register unsigned char *u = (unsigned char *) ptr;
 
638
  register const unsigned char *eu = u + sz;
 
639
  for (; u != eu; ++u) {
 
640
    register char d = *(c++);
 
641
    register unsigned char uu;
 
642
    if ((d >= '0') && (d <= '9'))
 
643
      uu = (unsigned char)((d - '0') << 4);
 
644
    else if ((d >= 'a') && (d <= 'f'))
 
645
      uu = (unsigned char)((d - ('a'-10)) << 4);
 
646
    else 
 
647
      return (char *) 0;
 
648
    d = *(c++);
 
649
    if ((d >= '0') && (d <= '9'))
 
650
      uu |= (unsigned char)(d - '0');
 
651
    else if ((d >= 'a') && (d <= 'f'))
 
652
      uu |= (unsigned char)(d - ('a'-10));
 
653
    else 
 
654
      return (char *) 0;
 
655
    *u = uu;
 
656
  }
 
657
  return c;
 
658
}
 
659
 
 
660
/* 
 
661
   Pack 'void *' into a string buffer.
 
662
*/
 
663
SWIGRUNTIME char *
 
664
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
 
665
  char *r = buff;
 
666
  if ((2*sizeof(void *) + 2) > bsz) return 0;
 
667
  *(r++) = '_';
 
668
  r = SWIG_PackData(r,&ptr,sizeof(void *));
 
669
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
 
670
  strcpy(r,name);
 
671
  return buff;
 
672
}
 
673
 
 
674
SWIGRUNTIME const char *
 
675
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
 
676
  if (*c != '_') {
 
677
    if (strcmp(c,"NULL") == 0) {
 
678
      *ptr = (void *) 0;
 
679
      return name;
 
680
    } else {
 
681
      return 0;
 
682
    }
 
683
  }
 
684
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
 
685
}
 
686
 
 
687
SWIGRUNTIME char *
 
688
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
 
689
  char *r = buff;
 
690
  size_t lname = (name ? strlen(name) : 0);
 
691
  if ((2*sz + 2 + lname) > bsz) return 0;
 
692
  *(r++) = '_';
 
693
  r = SWIG_PackData(r,ptr,sz);
 
694
  if (lname) {
 
695
    strncpy(r,name,lname+1);
 
696
  } else {
 
697
    *r = 0;
 
698
  }
 
699
  return buff;
 
700
}
 
701
 
 
702
SWIGRUNTIME const char *
 
703
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 
704
  if (*c != '_') {
 
705
    if (strcmp(c,"NULL") == 0) {
 
706
      memset(ptr,0,sz);
 
707
      return name;
 
708
    } else {
 
709
      return 0;
 
710
    }
 
711
  }
 
712
  return SWIG_UnpackData(++c,ptr,sz);
 
713
}
 
714
 
 
715
#ifdef __cplusplus
 
716
}
 
717
#endif
 
718
#ifdef __cplusplus
 
719
/* Needed on some windows machines---since MS plays funny games with the header files under C++ */
 
720
#include <math.h>
 
721
#include <stdlib.h>
 
722
extern "C" {
 
723
#endif
 
724
#include "EXTERN.h"
 
725
#include "perl.h"
 
726
#include "XSUB.h"
 
727
 
 
728
/* Add in functionality missing in older versions of Perl. Much of this is based on Devel-PPPort on cpan. */
 
729
 
 
730
/* Add PERL_REVISION, PERL_VERSION, PERL_SUBVERSION if missing */
 
731
#ifndef PERL_REVISION
 
732
#  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
 
733
#    define PERL_PATCHLEVEL_H_IMPLICIT
 
734
#    include <patchlevel.h>
 
735
#  endif
 
736
#  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
 
737
#    include <could_not_find_Perl_patchlevel.h>
 
738
#  endif
 
739
#  ifndef PERL_REVISION
 
740
#    define PERL_REVISION       (5)
 
741
#    define PERL_VERSION        PATCHLEVEL
 
742
#    define PERL_SUBVERSION     SUBVERSION
 
743
#  endif
 
744
#endif
 
745
 
 
746
#if defined(WIN32) && defined(PERL_OBJECT) && !defined(PerlIO_exportFILE)
 
747
#define PerlIO_exportFILE(fh,fl) (FILE*)(fh)
 
748
#endif
 
749
 
 
750
#ifndef SvIOK_UV
 
751
# define SvIOK_UV(sv)       (SvIOK(sv) && (SvUVX(sv) == SvIVX(sv)))
 
752
#endif
 
753
 
 
754
#ifndef SvUOK
 
755
# define SvUOK(sv)           SvIOK_UV(sv)
 
756
#endif
 
757
 
 
758
#if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)))
 
759
#  define PL_sv_undef               sv_undef
 
760
#  define PL_na                     na
 
761
#  define PL_errgv                  errgv
 
762
#  define PL_sv_no                  sv_no
 
763
#  define PL_sv_yes                 sv_yes
 
764
#  define PL_markstack_ptr          markstack_ptr
 
765
#endif
 
766
 
 
767
#ifndef IVSIZE
 
768
#  ifdef LONGSIZE
 
769
#    define IVSIZE LONGSIZE
 
770
#  else
 
771
#    define IVSIZE 4 /* A bold guess, but the best we can make. */
 
772
#  endif
 
773
#endif
 
774
 
 
775
#ifndef INT2PTR
 
776
#  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
 
777
#    define PTRV                  UV
 
778
#    define INT2PTR(any,d)        (any)(d)
 
779
#  else
 
780
#    if PTRSIZE == LONGSIZE
 
781
#      define PTRV                unsigned long
 
782
#    else
 
783
#      define PTRV                unsigned
 
784
#    endif
 
785
#    define INT2PTR(any,d)        (any)(PTRV)(d)
 
786
#  endif
 
787
 
 
788
#  define NUM2PTR(any,d)  (any)(PTRV)(d)
 
789
#  define PTR2IV(p)       INT2PTR(IV,p)
 
790
#  define PTR2UV(p)       INT2PTR(UV,p)
 
791
#  define PTR2NV(p)       NUM2PTR(NV,p)
 
792
 
 
793
#  if PTRSIZE == LONGSIZE
 
794
#    define PTR2ul(p)     (unsigned long)(p)
 
795
#  else
 
796
#    define PTR2ul(p)     INT2PTR(unsigned long,p)
 
797
#  endif
 
798
#endif /* !INT2PTR */
 
799
 
 
800
#ifndef SvPV_nolen
 
801
# define SvPV_nolen(x) SvPV(x,PL_na)
 
802
#endif
 
803
 
 
804
#ifndef get_sv
 
805
#  define get_sv perl_get_sv
 
806
#endif
 
807
 
 
808
#ifndef ERRSV
 
809
#  define ERRSV get_sv("@",FALSE)
 
810
#endif
 
811
 
 
812
#ifndef pTHX_
 
813
#define pTHX_
 
814
#endif   
 
815
 
 
816
#include <string.h>
 
817
#ifdef __cplusplus
 
818
}
 
819
#endif
 
820
/* -----------------------------------------------------------------------------
 
821
 * error manipulation
 
822
 * ----------------------------------------------------------------------------- */
 
823
 
 
824
SWIGINTERN const char*
 
825
SWIG_Perl_ErrorType(int code) {
 
826
  switch(code) {
 
827
  case SWIG_MemoryError:
 
828
    return "MemoryError";
 
829
  case SWIG_IOError:
 
830
    return "IOError";
 
831
  case SWIG_RuntimeError:
 
832
    return "RuntimeError";
 
833
  case SWIG_IndexError:
 
834
    return "IndexError";
 
835
  case SWIG_TypeError:
 
836
    return "TypeError";
 
837
  case SWIG_DivisionByZero:
 
838
    return "ZeroDivisionError";
 
839
  case SWIG_OverflowError:
 
840
    return "OverflowError";
 
841
  case SWIG_SyntaxError:
 
842
    return "SyntaxError";
 
843
  case SWIG_ValueError:
 
844
    return "ValueError";
 
845
  case SWIG_SystemError:
 
846
    return "SystemError";
 
847
  case SWIG_AttributeError:
 
848
    return "AttributeError";
 
849
  default:
 
850
    return "RuntimeError";
 
851
  }
 
852
}
 
853
 
 
854
/* -----------------------------------------------------------------------------
 
855
 * perlrun.swg
 
856
 *
 
857
 * This file contains the runtime support for Perl modules
 
858
 * and includes code for managing global variables and pointer
 
859
 * type checking.
 
860
 * ----------------------------------------------------------------------------- */
 
861
 
 
862
#ifdef PERL_OBJECT
 
863
#define SWIG_PERL_OBJECT_DECL CPerlObj *SWIGUNUSEDPARM(pPerl),
 
864
#define SWIG_PERL_OBJECT_CALL pPerl,
 
865
#else
 
866
#define SWIG_PERL_OBJECT_DECL
 
867
#define SWIG_PERL_OBJECT_CALL
 
868
#endif
 
869
 
 
870
/* Common SWIG API */
 
871
 
 
872
/* for raw pointers */
 
873
#define SWIG_ConvertPtr(obj, pp, type, flags)           SWIG_Perl_ConvertPtr(SWIG_PERL_OBJECT_CALL obj, pp, type, flags)
 
874
#define SWIG_ConvertPtrAndOwn(obj, pp, type, flags,own) SWIG_Perl_ConvertPtrAndOwn(SWIG_PERL_OBJECT_CALL obj, pp, type, flags, own)
 
875
#define SWIG_NewPointerObj(p, type, flags)              SWIG_Perl_NewPointerObj(SWIG_PERL_OBJECT_CALL p, type, flags)
 
876
 
 
877
/* for raw packed data */
 
878
#define SWIG_ConvertPacked(obj, p, s, type)             SWIG_Perl_ConvertPacked(SWIG_PERL_OBJECT_CALL obj, p, s, type)
 
879
#define SWIG_NewPackedObj(p, s, type)                   SWIG_Perl_NewPackedObj(SWIG_PERL_OBJECT_CALL p, s, type)
 
880
 
 
881
/* for class or struct pointers */
 
882
#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
 
883
#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
 
884
 
 
885
/* for C or C++ function pointers */
 
886
#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
 
887
#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
 
888
 
 
889
/* for C++ member pointers, ie, member methods */
 
890
#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_ConvertPacked(obj, ptr, sz, ty)
 
891
#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_NewPackedObj(ptr, sz, type)
 
892
 
 
893
 
 
894
/* Runtime API */
 
895
 
 
896
#define SWIG_GetModule(clientdata)                      SWIG_Perl_GetModule()
 
897
#define SWIG_SetModule(clientdata, pointer)             SWIG_Perl_SetModule(pointer)
 
898
 
 
899
 
 
900
/* Error manipulation */
 
901
 
 
902
#define SWIG_ErrorType(code)                            SWIG_Perl_ErrorType(code)               
 
903
#define SWIG_Error(code, msg)                           sv_setpvf(get_sv("@", GV_ADD), "%s %s", SWIG_ErrorType(code), msg)
 
904
#define SWIG_fail                                       goto fail                                                   
 
905
 
 
906
/* Perl-specific SWIG API */
 
907
 
 
908
#define SWIG_MakePtr(sv, ptr, type, flags)              SWIG_Perl_MakePtr(SWIG_PERL_OBJECT_CALL sv, ptr, type, flags)
 
909
#define SWIG_MakePackedObj(sv, p, s, type)              SWIG_Perl_MakePackedObj(SWIG_PERL_OBJECT_CALL sv, p, s, type)
 
910
#define SWIG_SetError(str)                              SWIG_Error(SWIG_RuntimeError, str)
 
911
 
 
912
 
 
913
#define SWIG_PERL_DECL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_DECL arg1)
 
914
#define SWIG_PERL_CALL_ARGS_1(arg1)                     (SWIG_PERL_OBJECT_CALL arg1)
 
915
#define SWIG_PERL_DECL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_DECL arg1, arg2)
 
916
#define SWIG_PERL_CALL_ARGS_2(arg1, arg2)               (SWIG_PERL_OBJECT_CALL arg1, arg2)
 
917
 
 
918
/* -----------------------------------------------------------------------------
 
919
 * pointers/data manipulation
 
920
 * ----------------------------------------------------------------------------- */
 
921
 
 
922
/* For backward compatibility only */
 
923
#define SWIG_POINTER_EXCEPTION  0
 
924
 
 
925
#ifdef __cplusplus
 
926
extern "C" {
 
927
#endif
 
928
 
 
929
#define SWIG_OWNER   SWIG_POINTER_OWN
 
930
#define SWIG_SHADOW  SWIG_OWNER << 1
 
931
 
 
932
#define SWIG_MAYBE_PERL_OBJECT SWIG_PERL_OBJECT_DECL
 
933
 
 
934
/* SWIG Perl macros */
 
935
 
 
936
/* Macro to declare an XS function */
 
937
#ifndef XSPROTO
 
938
#   define XSPROTO(name) void name(pTHX_ CV* cv)
 
939
#endif
 
940
 
 
941
/* Macro to call an XS function */
 
942
#ifdef PERL_OBJECT 
 
943
#  define SWIG_CALLXS(_name) _name(cv,pPerl) 
 
944
#else 
 
945
#  ifndef MULTIPLICITY 
 
946
#    define SWIG_CALLXS(_name) _name(cv) 
 
947
#  else 
 
948
#    define SWIG_CALLXS(_name) _name(PERL_GET_THX, cv) 
 
949
#  endif 
 
950
#endif 
 
951
 
 
952
#ifdef PERL_OBJECT
 
953
#define MAGIC_PPERL  CPerlObj *pPerl = (CPerlObj *) this;
 
954
 
 
955
#ifdef __cplusplus
 
956
extern "C" {
 
957
#endif
 
958
typedef int (CPerlObj::*SwigMagicFunc)(SV *, MAGIC *);
 
959
#ifdef __cplusplus
 
960
}
 
961
#endif
 
962
 
 
963
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
 
964
#define SWIGCLASS_STATIC
 
965
 
 
966
#else /* PERL_OBJECT */
 
967
 
 
968
#define MAGIC_PPERL
 
969
#define SWIGCLASS_STATIC static SWIGUNUSED
 
970
 
 
971
#ifndef MULTIPLICITY
 
972
#define SWIG_MAGIC(a,b) (SV *a, MAGIC *b)
 
973
 
 
974
#ifdef __cplusplus
 
975
extern "C" {
 
976
#endif
 
977
typedef int (*SwigMagicFunc)(SV *, MAGIC *);
 
978
#ifdef __cplusplus
 
979
}
 
980
#endif
 
981
 
 
982
#else /* MULTIPLICITY */
 
983
 
 
984
#define SWIG_MAGIC(a,b) (struct interpreter *interp, SV *a, MAGIC *b)
 
985
 
 
986
#ifdef __cplusplus
 
987
extern "C" {
 
988
#endif
 
989
typedef int (*SwigMagicFunc)(struct interpreter *, SV *, MAGIC *);
 
990
#ifdef __cplusplus
 
991
}
 
992
#endif
 
993
 
 
994
#endif /* MULTIPLICITY */
 
995
#endif /* PERL_OBJECT */
 
996
 
 
997
#  ifdef PERL_OBJECT
 
998
#    define SWIG_croak_null() SWIG_Perl_croak_null(pPerl)
 
999
static void SWIG_Perl_croak_null(CPerlObj *pPerl)
 
1000
#  else
 
1001
static void SWIG_croak_null()
 
1002
#  endif
 
1003
{
 
1004
  SV *err = get_sv("@", GV_ADD);
 
1005
#  if (PERL_VERSION < 6)
 
1006
  croak("%_", err);
 
1007
#  else
 
1008
  if (sv_isobject(err))
 
1009
    croak(0);
 
1010
  else
 
1011
    croak("%s", SvPV_nolen(err));
 
1012
#  endif
 
1013
}
 
1014
 
 
1015
 
 
1016
/* 
 
1017
   Define how strict is the cast between strings and integers/doubles
 
1018
   when overloading between these types occurs.
 
1019
   
 
1020
   The default is making it as strict as possible by using SWIG_AddCast
 
1021
   when needed.
 
1022
   
 
1023
   You can use -DSWIG_PERL_NO_STRICT_STR2NUM at compilation time to
 
1024
   disable the SWIG_AddCast, making the casting between string and
 
1025
   numbers less strict.
 
1026
 
 
1027
   In the end, we try to solve the overloading between strings and
 
1028
   numerical types in the more natural way, but if you can avoid it,
 
1029
   well, avoid it using %rename, for example.
 
1030
*/
 
1031
#ifndef SWIG_PERL_NO_STRICT_STR2NUM
 
1032
# ifndef SWIG_PERL_STRICT_STR2NUM
 
1033
#  define SWIG_PERL_STRICT_STR2NUM
 
1034
# endif
 
1035
#endif
 
1036
#ifdef SWIG_PERL_STRICT_STR2NUM
 
1037
/* string takes precedence */
 
1038
#define SWIG_Str2NumCast(x) SWIG_AddCast(x)  
 
1039
#else
 
1040
/* number takes precedence */
 
1041
#define SWIG_Str2NumCast(x) x
 
1042
#endif
 
1043
 
 
1044
 
 
1045
 
 
1046
#include <stdlib.h>
 
1047
 
 
1048
SWIGRUNTIME const char *
 
1049
SWIG_Perl_TypeProxyName(const swig_type_info *type) {
 
1050
  if (!type) return NULL;
 
1051
  if (type->clientdata != NULL) {
 
1052
    return (const char*) type->clientdata;
 
1053
  } 
 
1054
  else {
 
1055
    return type->name;
 
1056
  }
 
1057
}
 
1058
 
 
1059
/* Identical to SWIG_TypeCheck, except for strcmp comparison */
 
1060
SWIGRUNTIME swig_cast_info *
 
1061
SWIG_TypeProxyCheck(const char *c, swig_type_info *ty) {
 
1062
  if (ty) {
 
1063
    swig_cast_info *iter = ty->cast;
 
1064
    while (iter) {
 
1065
      if (strcmp(SWIG_Perl_TypeProxyName(iter->type), c) == 0) {
 
1066
        if (iter == ty->cast)
 
1067
          return iter;
 
1068
        /* Move iter to the top of the linked list */
 
1069
        iter->prev->next = iter->next;
 
1070
        if (iter->next)
 
1071
          iter->next->prev = iter->prev;
 
1072
        iter->next = ty->cast;
 
1073
        iter->prev = 0;
 
1074
        if (ty->cast) ty->cast->prev = iter;
 
1075
        ty->cast = iter;
 
1076
        return iter;
 
1077
      }
 
1078
      iter = iter->next;
 
1079
    }
 
1080
  }
 
1081
  return 0;
 
1082
}
 
1083
 
 
1084
/* Function for getting a pointer value */
 
1085
 
 
1086
SWIGRUNTIME int
 
1087
SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags, int *own) {
 
1088
  swig_cast_info *tc;
 
1089
  void *voidptr = (void *)0;
 
1090
  SV *tsv = 0;
 
1091
 
 
1092
  if (own)
 
1093
    *own = 0;
 
1094
 
 
1095
  /* If magical, apply more magic */
 
1096
  if (SvGMAGICAL(sv))
 
1097
    mg_get(sv);
 
1098
 
 
1099
  /* Check to see if this is an object */
 
1100
  if (sv_isobject(sv)) {
 
1101
    IV tmp = 0;
 
1102
    tsv = (SV*) SvRV(sv);
 
1103
    if ((SvTYPE(tsv) == SVt_PVHV)) {
 
1104
      MAGIC *mg;
 
1105
      if (SvMAGICAL(tsv)) {
 
1106
        mg = mg_find(tsv,'P');
 
1107
        if (mg) {
 
1108
          sv = mg->mg_obj;
 
1109
          if (sv_isobject(sv)) {
 
1110
            tsv = (SV*)SvRV(sv);
 
1111
            tmp = SvIV(tsv);
 
1112
          }
 
1113
        }
 
1114
      } else {
 
1115
        return SWIG_ERROR;
 
1116
      }
 
1117
    } else {
 
1118
      tmp = SvIV(tsv);
 
1119
    }
 
1120
    voidptr = INT2PTR(void *,tmp);
 
1121
  } else if (! SvOK(sv)) {            /* Check for undef */
 
1122
    *(ptr) = (void *) 0;
 
1123
    return SWIG_OK;
 
1124
  } else if (SvTYPE(sv) == SVt_RV) {  /* Check for NULL pointer */
 
1125
    if (!SvROK(sv)) {
 
1126
      /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value.  */
 
1127
      if (SvIOK(sv)) {
 
1128
        return SWIG_ERROR;
 
1129
      } else {
 
1130
        /* NULL pointer (reference to undef). */
 
1131
        *(ptr) = (void *) 0;
 
1132
        return SWIG_OK;
 
1133
      }
 
1134
    } else {
 
1135
      return SWIG_ERROR;
 
1136
    }
 
1137
  } else {                            /* Don't know what it is */
 
1138
    return SWIG_ERROR;
 
1139
  }
 
1140
  if (_t) {
 
1141
    /* Now see if the types match */
 
1142
    char *_c = HvNAME(SvSTASH(SvRV(sv)));
 
1143
    tc = SWIG_TypeProxyCheck(_c,_t);
 
1144
    if (!tc) {
 
1145
      return SWIG_ERROR;
 
1146
    }
 
1147
    {
 
1148
      int newmemory = 0;
 
1149
      *ptr = SWIG_TypeCast(tc,voidptr,&newmemory);
 
1150
      if (newmemory == SWIG_CAST_NEW_MEMORY) {
 
1151
        assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
 
1152
        if (own)
 
1153
          *own = *own | SWIG_CAST_NEW_MEMORY;
 
1154
      }
 
1155
    }
 
1156
  } else {
 
1157
    *ptr = voidptr;
 
1158
  }
 
1159
 
 
1160
  /* 
 
1161
   *  DISOWN implementation: we need a perl guru to check this one.
 
1162
   */
 
1163
  if (tsv && (flags & SWIG_POINTER_DISOWN)) {
 
1164
    /* 
 
1165
     *  almost copy paste code from below SWIG_POINTER_OWN setting
 
1166
     */
 
1167
    SV *obj = sv;
 
1168
    HV *stash = SvSTASH(SvRV(obj));
 
1169
    GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
 
1170
    if (isGV(gv)) {
 
1171
      HV *hv = GvHVn(gv);
 
1172
      /*
 
1173
       * To set ownership (see below), a newSViv(1) entry is added. 
 
1174
       * Hence, to remove ownership, we delete the entry.
 
1175
       */
 
1176
      if (hv_exists_ent(hv, obj, 0)) {
 
1177
        hv_delete_ent(hv, obj, 0, 0);
 
1178
      }
 
1179
    }
 
1180
  }
 
1181
  return SWIG_OK;
 
1182
}
 
1183
 
 
1184
SWIGRUNTIME int
 
1185
SWIG_Perl_ConvertPtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void **ptr, swig_type_info *_t, int flags) {
 
1186
  return SWIG_Perl_ConvertPtrAndOwn(sv, ptr, _t, flags, 0);
 
1187
}
 
1188
 
 
1189
SWIGRUNTIME void
 
1190
SWIG_Perl_MakePtr(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, swig_type_info *t, int flags) {
 
1191
  if (ptr && (flags & (SWIG_SHADOW | SWIG_POINTER_OWN))) {
 
1192
    SV *self;
 
1193
    SV *obj=newSV(0);
 
1194
    HV *hash=newHV();
 
1195
    HV *stash;
 
1196
    sv_setref_pv(obj, SWIG_Perl_TypeProxyName(t), ptr);
 
1197
    stash=SvSTASH(SvRV(obj));
 
1198
    if (flags & SWIG_POINTER_OWN) {
 
1199
      HV *hv;
 
1200
      GV *gv = *(GV**)hv_fetch(stash, "OWNER", 5, TRUE);
 
1201
      if (!isGV(gv))
 
1202
        gv_init(gv, stash, "OWNER", 5, FALSE);
 
1203
      hv=GvHVn(gv);
 
1204
      hv_store_ent(hv, obj, newSViv(1), 0);
 
1205
    }
 
1206
    sv_magic((SV *)hash, (SV *)obj, 'P', Nullch, 0);
 
1207
    SvREFCNT_dec(obj);
 
1208
    self=newRV_noinc((SV *)hash);
 
1209
    sv_setsv(sv, self);
 
1210
    SvREFCNT_dec((SV *)self);
 
1211
    sv_bless(sv, stash);
 
1212
  }
 
1213
  else {
 
1214
    sv_setref_pv(sv, SWIG_Perl_TypeProxyName(t), ptr);
 
1215
  }
 
1216
}
 
1217
 
 
1218
SWIGRUNTIMEINLINE SV *
 
1219
SWIG_Perl_NewPointerObj(SWIG_MAYBE_PERL_OBJECT void *ptr, swig_type_info *t, int flags) {
 
1220
  SV *result = sv_newmortal();
 
1221
  SWIG_MakePtr(result, ptr, t, flags);
 
1222
  return result;
 
1223
}
 
1224
 
 
1225
SWIGRUNTIME void
 
1226
SWIG_Perl_MakePackedObj(SWIG_MAYBE_PERL_OBJECT SV *sv, void *ptr, int sz, swig_type_info *type) {
 
1227
  char result[1024];
 
1228
  char *r = result;
 
1229
  if ((2*sz + 1 + strlen(SWIG_Perl_TypeProxyName(type))) > 1000) return;
 
1230
  *(r++) = '_';
 
1231
  r = SWIG_PackData(r,ptr,sz);
 
1232
  strcpy(r,SWIG_Perl_TypeProxyName(type));
 
1233
  sv_setpv(sv, result);
 
1234
}
 
1235
 
 
1236
SWIGRUNTIME SV *
 
1237
SWIG_Perl_NewPackedObj(SWIG_MAYBE_PERL_OBJECT void *ptr, int sz, swig_type_info *type) {
 
1238
  SV *result = sv_newmortal();
 
1239
  SWIG_Perl_MakePackedObj(result, ptr, sz, type);
 
1240
  return result;
 
1241
}
 
1242
 
 
1243
/* Convert a packed value value */
 
1244
SWIGRUNTIME int
 
1245
SWIG_Perl_ConvertPacked(SWIG_MAYBE_PERL_OBJECT SV *obj, void *ptr, int sz, swig_type_info *ty) {
 
1246
  swig_cast_info *tc;
 
1247
  const char  *c = 0;
 
1248
 
 
1249
  if ((!obj) || (!SvOK(obj))) return SWIG_ERROR;
 
1250
  c = SvPV_nolen(obj);
 
1251
  /* Pointer values must start with leading underscore */
 
1252
  if (*c != '_') return SWIG_ERROR;
 
1253
  c++;
 
1254
  c = SWIG_UnpackData(c,ptr,sz);
 
1255
  if (ty) {
 
1256
    tc = SWIG_TypeCheck(c,ty);
 
1257
    if (!tc) return SWIG_ERROR;
 
1258
  }
 
1259
  return SWIG_OK;
 
1260
}
 
1261
 
 
1262
 
 
1263
/* Macros for low-level exception handling */
 
1264
#define SWIG_croak(x)    { SWIG_Error(SWIG_RuntimeError, x); SWIG_fail; }
 
1265
 
 
1266
 
 
1267
typedef XSPROTO(SwigPerlWrapper);
 
1268
typedef SwigPerlWrapper *SwigPerlWrapperPtr;
 
1269
 
 
1270
/* Structure for command table */
 
1271
typedef struct {
 
1272
  const char         *name;
 
1273
  SwigPerlWrapperPtr  wrapper;
 
1274
} swig_command_info;
 
1275
 
 
1276
/* Information for constant table */
 
1277
 
 
1278
#define SWIG_INT     1
 
1279
#define SWIG_FLOAT   2
 
1280
#define SWIG_STRING  3
 
1281
#define SWIG_POINTER 4
 
1282
#define SWIG_BINARY  5
 
1283
 
 
1284
/* Constant information structure */
 
1285
typedef struct swig_constant_info {
 
1286
    int              type;
 
1287
    const char      *name;
 
1288
    long             lvalue;
 
1289
    double           dvalue;
 
1290
    void            *pvalue;
 
1291
    swig_type_info **ptype;
 
1292
} swig_constant_info;
 
1293
 
 
1294
 
 
1295
/* Structure for variable table */
 
1296
typedef struct {
 
1297
  const char   *name;
 
1298
  SwigMagicFunc   set;
 
1299
  SwigMagicFunc   get;
 
1300
  swig_type_info  **type;
 
1301
} swig_variable_info;
 
1302
 
 
1303
/* Magic variable code */
 
1304
#ifndef PERL_OBJECT
 
1305
# ifdef __cplusplus
 
1306
#  define swig_create_magic(s,a,b,c) _swig_create_magic(s,const_cast<char*>(a),b,c)
 
1307
# else
 
1308
#  define swig_create_magic(s,a,b,c) _swig_create_magic(s,(char*)(a),b,c)
 
1309
# endif
 
1310
# ifndef MULTIPLICITY
 
1311
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(SV *, MAGIC *), int (*get)(SV *,MAGIC *)) 
 
1312
# else
 
1313
SWIGRUNTIME void _swig_create_magic(SV *sv, char *name, int (*set)(struct interpreter*, SV *, MAGIC *), int (*get)(struct interpreter*, SV *,MAGIC *)) 
 
1314
# endif
 
1315
#else
 
1316
#  define swig_create_magic(s,a,b,c) _swig_create_magic(pPerl,s,a,b,c)
 
1317
SWIGRUNTIME void _swig_create_magic(CPerlObj *pPerl, SV *sv, const char *name, int (CPerlObj::*set)(SV *, MAGIC *), int (CPerlObj::*get)(SV *, MAGIC *)) 
 
1318
#endif
 
1319
{
 
1320
  MAGIC *mg;
 
1321
  sv_magic(sv,sv,'U',name,strlen(name));
 
1322
  mg = mg_find(sv,'U');
 
1323
  mg->mg_virtual = (MGVTBL *) malloc(sizeof(MGVTBL));
 
1324
  mg->mg_virtual->svt_get = (SwigMagicFunc) get;
 
1325
  mg->mg_virtual->svt_set = (SwigMagicFunc) set;
 
1326
  mg->mg_virtual->svt_len = 0;
 
1327
  mg->mg_virtual->svt_clear = 0;
 
1328
  mg->mg_virtual->svt_free = 0;
 
1329
}
 
1330
 
 
1331
 
 
1332
SWIGRUNTIME swig_module_info *
 
1333
SWIG_Perl_GetModule(void) {
 
1334
  static void *type_pointer = (void *)0;
 
1335
  SV *pointer;
 
1336
 
 
1337
  /* first check if pointer already created */
 
1338
  if (!type_pointer) {
 
1339
    pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, FALSE | GV_ADDMULTI);
 
1340
    if (pointer && SvOK(pointer)) {
 
1341
      type_pointer = INT2PTR(swig_type_info **, SvIV(pointer));
 
1342
    }
 
1343
  }
 
1344
 
 
1345
  return (swig_module_info *) type_pointer;
 
1346
}
 
1347
 
 
1348
SWIGRUNTIME void
 
1349
SWIG_Perl_SetModule(swig_module_info *module) {
 
1350
  SV *pointer;
 
1351
 
 
1352
  /* create a new pointer */
 
1353
  pointer = get_sv("swig_runtime_data::type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TRUE | GV_ADDMULTI);
 
1354
  sv_setiv(pointer, PTR2IV(module));
 
1355
}
 
1356
 
 
1357
#ifdef __cplusplus
 
1358
}
 
1359
#endif
 
1360
/* -----------------------------------------------------------------------------*
 
1361
   Standard SWIG API for use inside user code.
 
1362
 
 
1363
   Don't include this file directly, run the command
 
1364
   swig -python -external-runtime
 
1365
   Also, read the Modules chapter of the SWIG Manual.
 
1366
 
 
1367
 * -----------------------------------------------------------------------------*/
 
1368
 
 
1369
#ifdef SWIG_MODULE_CLIENTDATA_TYPE
 
1370
 
 
1371
SWIGRUNTIMEINLINE swig_type_info *
 
1372
SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
 
1373
  swig_module_info *module = SWIG_GetModule(clientdata);
 
1374
  return SWIG_TypeQueryModule(module, module, name);
 
1375
}
 
1376
 
 
1377
SWIGRUNTIMEINLINE swig_type_info *
 
1378
SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
 
1379
  swig_module_info *module = SWIG_GetModule(clientdata);
 
1380
  return SWIG_MangledTypeQueryModule(module, module, name);
 
1381
}
 
1382
 
 
1383
#else
 
1384
 
 
1385
SWIGRUNTIMEINLINE swig_type_info *
 
1386
SWIG_TypeQuery(const char *name) {
 
1387
  swig_module_info *module = SWIG_GetModule(NULL);
 
1388
  return SWIG_TypeQueryModule(module, module, name);
 
1389
}
 
1390
 
 
1391
SWIGRUNTIMEINLINE swig_type_info *
 
1392
SWIG_MangledTypeQuery(const char *name) {
 
1393
  swig_module_info *module = SWIG_GetModule(NULL);
 
1394
  return SWIG_MangledTypeQueryModule(module, module, name);
 
1395
}
 
1396
 
 
1397
#endif