~siretart/gnucash/ubuntu-fullsource

« back to all changes in this revision

Viewing changes to src/swig-runtime.h

  • Committer: Reinhard Tartler
  • Date: 2008-08-03 07:25:46 UTC
  • Revision ID: siretart@tauware.de-20080803072546-y6p8xda8zpfi62ys
import gnucash_2.2.4.orig.tar.gz

The original tarball had the md5sum: 27e660297dc5b8ce574515779d05a5a5

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 1.3.33
 
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 SWIGUNUSEDPARM
 
54
# ifdef __cplusplus
 
55
#   define SWIGUNUSEDPARM(p)
 
56
# else
 
57
#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
 
58
# endif
 
59
#endif
 
60
 
 
61
/* internal SWIG method */
 
62
#ifndef SWIGINTERN
 
63
# define SWIGINTERN static SWIGUNUSED
 
64
#endif
 
65
 
 
66
/* internal inline SWIG method */
 
67
#ifndef SWIGINTERNINLINE
 
68
# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
 
69
#endif
 
70
 
 
71
/* exporting methods */
 
72
#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
 
73
#  ifndef GCC_HASCLASSVISIBILITY
 
74
#    define GCC_HASCLASSVISIBILITY
 
75
#  endif
 
76
#endif
 
77
 
 
78
#ifndef SWIGEXPORT
 
79
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
80
#   if defined(STATIC_LINKED)
 
81
#     define SWIGEXPORT
 
82
#   else
 
83
#     define SWIGEXPORT __declspec(dllexport)
 
84
#   endif
 
85
# else
 
86
#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
 
87
#     define SWIGEXPORT __attribute__ ((visibility("default")))
 
88
#   else
 
89
#     define SWIGEXPORT
 
90
#   endif
 
91
# endif
 
92
#endif
 
93
 
 
94
/* calling conventions for Windows */
 
95
#ifndef SWIGSTDCALL
 
96
# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
 
97
#   define SWIGSTDCALL __stdcall
 
98
# else
 
99
#   define SWIGSTDCALL
 
100
# endif 
 
101
#endif
 
102
 
 
103
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
 
104
#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
 
105
# define _CRT_SECURE_NO_DEPRECATE
 
106
#endif
 
107
 
 
108
/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
 
109
#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
 
110
# define _SCL_SECURE_NO_DEPRECATE
 
111
#endif
 
112
 
 
113
/*  Errors in SWIG */
 
114
#define  SWIG_UnknownError         -1 
 
115
#define  SWIG_IOError              -2 
 
116
#define  SWIG_RuntimeError         -3 
 
117
#define  SWIG_IndexError           -4 
 
118
#define  SWIG_TypeError            -5 
 
119
#define  SWIG_DivisionByZero       -6 
 
120
#define  SWIG_OverflowError        -7 
 
121
#define  SWIG_SyntaxError          -8 
 
122
#define  SWIG_ValueError           -9 
 
123
#define  SWIG_SystemError          -10
 
124
#define  SWIG_AttributeError       -11
 
125
#define  SWIG_MemoryError          -12 
 
126
#define  SWIG_NullReferenceError   -13
 
127
 
 
128
 
 
129
/*  Errors in SWIG */
 
130
#define  SWIG_UnknownError         -1 
 
131
#define  SWIG_IOError              -2 
 
132
#define  SWIG_RuntimeError         -3 
 
133
#define  SWIG_IndexError           -4 
 
134
#define  SWIG_TypeError            -5 
 
135
#define  SWIG_DivisionByZero       -6 
 
136
#define  SWIG_OverflowError        -7 
 
137
#define  SWIG_SyntaxError          -8 
 
138
#define  SWIG_ValueError           -9 
 
139
#define  SWIG_SystemError          -10
 
140
#define  SWIG_AttributeError       -11
 
141
#define  SWIG_MemoryError          -12 
 
142
#define  SWIG_NullReferenceError   -13
 
143
 
 
144
 
 
145
/* -----------------------------------------------------------------------------
 
146
 * swigrun.swg
 
147
 *
 
148
 * This file contains generic CAPI SWIG runtime support for pointer
 
149
 * type checking.
 
150
 * ----------------------------------------------------------------------------- */
 
151
 
 
152
/* This should only be incremented when either the layout of swig_type_info changes,
 
153
   or for whatever reason, the runtime changes incompatibly */
 
154
#define SWIG_RUNTIME_VERSION "3"
 
155
 
 
156
/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
 
157
#ifdef SWIG_TYPE_TABLE
 
158
# define SWIG_QUOTE_STRING(x) #x
 
159
# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
 
160
# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
 
161
#else
 
162
# define SWIG_TYPE_TABLE_NAME
 
163
#endif
 
164
 
 
165
/*
 
166
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
 
167
  creating a static or dynamic library from the swig runtime code.
 
168
  In 99.9% of the cases, swig just needs to declare them as 'static'.
 
169
  
 
170
  But only do this if is strictly necessary, ie, if you have problems
 
171
  with your compiler or so.
 
172
*/
 
173
 
 
174
#ifndef SWIGRUNTIME
 
175
# define SWIGRUNTIME SWIGINTERN
 
176
#endif
 
177
 
 
178
#ifndef SWIGRUNTIMEINLINE
 
179
# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
 
180
#endif
 
181
 
 
182
/*  Generic buffer size */
 
183
#ifndef SWIG_BUFFER_SIZE
 
184
# define SWIG_BUFFER_SIZE 1024
 
185
#endif
 
186
 
 
187
/* Flags for pointer conversions */
 
188
#define SWIG_POINTER_DISOWN        0x1
 
189
 
 
190
/* Flags for new pointer objects */
 
191
#define SWIG_POINTER_OWN           0x1
 
192
 
 
193
 
 
194
/* 
 
195
   Flags/methods for returning states.
 
196
   
 
197
   The swig conversion methods, as ConvertPtr, return and integer 
 
198
   that tells if the conversion was successful or not. And if not,
 
199
   an error code can be returned (see swigerrors.swg for the codes).
 
200
   
 
201
   Use the following macros/flags to set or process the returning
 
202
   states.
 
203
   
 
204
   In old swig versions, you usually write code as:
 
205
 
 
206
     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
 
207
       // success code
 
208
     } else {
 
209
       //fail code
 
210
     }
 
211
 
 
212
   Now you can be more explicit as:
 
213
 
 
214
    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
 
215
    if (SWIG_IsOK(res)) {
 
216
      // success code
 
217
    } else {
 
218
      // fail code
 
219
    }
 
220
 
 
221
   that seems to be the same, but now you can also do
 
222
 
 
223
    Type *ptr;
 
224
    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
 
225
    if (SWIG_IsOK(res)) {
 
226
      // success code
 
227
      if (SWIG_IsNewObj(res) {
 
228
        ...
 
229
        delete *ptr;
 
230
      } else {
 
231
        ...
 
232
      }
 
233
    } else {
 
234
      // fail code
 
235
    }
 
236
    
 
237
   I.e., now SWIG_ConvertPtr can return new objects and you can
 
238
   identify the case and take care of the deallocation. Of course that
 
239
   requires also to SWIG_ConvertPtr to return new result values, as
 
240
 
 
241
      int SWIG_ConvertPtr(obj, ptr,...) {         
 
242
        if (<obj is ok>) {                             
 
243
          if (<need new object>) {                     
 
244
            *ptr = <ptr to new allocated object>; 
 
245
            return SWIG_NEWOBJ;                
 
246
          } else {                                     
 
247
            *ptr = <ptr to old object>;        
 
248
            return SWIG_OLDOBJ;                
 
249
          }                                    
 
250
        } else {                                       
 
251
          return SWIG_BADOBJ;                  
 
252
        }                                              
 
253
      }
 
254
 
 
255
   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
 
256
   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
 
257
   swig errors code.
 
258
 
 
259
   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
 
260
   allows to return the 'cast rank', for example, if you have this
 
261
 
 
262
       int food(double)
 
263
       int fooi(int);
 
264
 
 
265
   and you call
 
266
 
 
267
      food(1)   // cast rank '1'  (1 -> 1.0)
 
268
      fooi(1)   // cast rank '0'
 
269
 
 
270
   just use the SWIG_AddCast()/SWIG_CheckState()
 
271
 
 
272
 
 
273
 */
 
274
#define SWIG_OK                    (0) 
 
275
#define SWIG_ERROR                 (-1)
 
276
#define SWIG_IsOK(r)               (r >= 0)
 
277
#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
 
278
 
 
279
/* The CastRankLimit says how many bits are used for the cast rank */
 
280
#define SWIG_CASTRANKLIMIT         (1 << 8)
 
281
/* The NewMask denotes the object was created (using new/malloc) */
 
282
#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
 
283
/* The TmpMask is for in/out typemaps that use temporal objects */
 
284
#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
 
285
/* Simple returning values */
 
286
#define SWIG_BADOBJ                (SWIG_ERROR)
 
287
#define SWIG_OLDOBJ                (SWIG_OK)
 
288
#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
 
289
#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
 
290
/* Check, add and del mask methods */
 
291
#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
 
292
#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
 
293
#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
 
294
#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
 
295
#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 
296
#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
297
 
 
298
 
 
299
/* Cast-Rank Mode */
 
300
#if defined(SWIG_CASTRANK_MODE)
 
301
#  ifndef SWIG_TypeRank
 
302
#    define SWIG_TypeRank             unsigned long
 
303
#  endif
 
304
#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
 
305
#    define SWIG_MAXCASTRANK          (2)
 
306
#  endif
 
307
#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
 
308
#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
 
309
SWIGINTERNINLINE int SWIG_AddCast(int r) { 
 
310
  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
 
311
}
 
312
SWIGINTERNINLINE int SWIG_CheckState(int r) { 
 
313
  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
 
314
}
 
315
#else /* no cast-rank mode */
 
316
#  define SWIG_AddCast
 
317
#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
 
318
#endif
 
319
 
 
320
 
 
321
 
 
322
 
 
323
#include <string.h>
 
324
 
 
325
#ifdef __cplusplus
 
326
extern "C" {
 
327
#endif
 
328
 
 
329
typedef void *(*swig_converter_func)(void *);
 
330
typedef struct swig_type_info *(*swig_dycast_func)(void **);
 
331
 
 
332
/* Structure to store inforomation on one type */
 
333
typedef struct swig_type_info {
 
334
  const char             *name;                 /* mangled name of this type */
 
335
  const char             *str;                  /* human readable name of this type */
 
336
  swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
 
337
  struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
 
338
  void                   *clientdata;           /* language specific type data */
 
339
  int                    owndata;               /* flag if the structure owns the clientdata */
 
340
} swig_type_info;
 
341
 
 
342
/* Structure to store a type and conversion function used for casting */
 
343
typedef struct swig_cast_info {
 
344
  swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
 
345
  swig_converter_func     converter;            /* function to cast the void pointers */
 
346
  struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
 
347
  struct swig_cast_info  *prev;                 /* pointer to the previous cast */
 
348
} swig_cast_info;
 
349
 
 
350
/* Structure used to store module information
 
351
 * Each module generates one structure like this, and the runtime collects
 
352
 * all of these structures and stores them in a circularly linked list.*/
 
353
typedef struct swig_module_info {
 
354
  swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
 
355
  size_t                 size;                  /* Number of types in this module */
 
356
  struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
 
357
  swig_type_info         **type_initial;        /* Array of initially generated type structures */
 
358
  swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
 
359
  void                    *clientdata;          /* Language specific module data */
 
360
} swig_module_info;
 
361
 
 
362
/* 
 
363
  Compare two type names skipping the space characters, therefore
 
364
  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
 
365
 
 
366
  Return 0 when the two name types are equivalent, as in
 
367
  strncmp, but skipping ' '.
 
368
*/
 
369
SWIGRUNTIME int
 
370
SWIG_TypeNameComp(const char *f1, const char *l1,
 
371
                  const char *f2, const char *l2) {
 
372
  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
 
373
    while ((*f1 == ' ') && (f1 != l1)) ++f1;
 
374
    while ((*f2 == ' ') && (f2 != l2)) ++f2;
 
375
    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
 
376
  }
 
377
  return (int)((l1 - f1) - (l2 - f2));
 
378
}
 
379
 
 
380
/*
 
381
  Check type equivalence in a name list like <name1>|<name2>|...
 
382
  Return 0 if not equal, 1 if equal
 
383
*/
 
384
SWIGRUNTIME int
 
385
SWIG_TypeEquiv(const char *nb, const char *tb) {
 
386
  int equiv = 0;
 
387
  const char* te = tb + strlen(tb);
 
388
  const char* ne = nb;
 
389
  while (!equiv && *ne) {
 
390
    for (nb = ne; *ne; ++ne) {
 
391
      if (*ne == '|') break;
 
392
    }
 
393
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
 
394
    if (*ne) ++ne;
 
395
  }
 
396
  return equiv;
 
397
}
 
398
 
 
399
/*
 
400
  Check type equivalence in a name list like <name1>|<name2>|...
 
401
  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
 
402
*/
 
403
SWIGRUNTIME int
 
404
SWIG_TypeCompare(const char *nb, const char *tb) {
 
405
  int equiv = 0;
 
406
  const char* te = tb + strlen(tb);
 
407
  const char* ne = nb;
 
408
  while (!equiv && *ne) {
 
409
    for (nb = ne; *ne; ++ne) {
 
410
      if (*ne == '|') break;
 
411
    }
 
412
    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
 
413
    if (*ne) ++ne;
 
414
  }
 
415
  return equiv;
 
416
}
 
417
 
 
418
 
 
419
/* think of this as a c++ template<> or a scheme macro */
 
420
#define SWIG_TypeCheck_Template(comparison, ty)         \
 
421
  if (ty) {                                             \
 
422
    swig_cast_info *iter = ty->cast;                    \
 
423
    while (iter) {                                      \
 
424
      if (comparison) {                                 \
 
425
        if (iter == ty->cast) return iter;              \
 
426
        /* Move iter to the top of the linked list */   \
 
427
        iter->prev->next = iter->next;                  \
 
428
        if (iter->next)                                 \
 
429
          iter->next->prev = iter->prev;                \
 
430
        iter->next = ty->cast;                          \
 
431
        iter->prev = 0;                                 \
 
432
        if (ty->cast) ty->cast->prev = iter;            \
 
433
        ty->cast = iter;                                \
 
434
        return iter;                                    \
 
435
      }                                                 \
 
436
      iter = iter->next;                                \
 
437
    }                                                   \
 
438
  }                                                     \
 
439
  return 0
 
440
 
 
441
/*
 
442
  Check the typename
 
443
*/
 
444
SWIGRUNTIME swig_cast_info *
 
445
SWIG_TypeCheck(const char *c, swig_type_info *ty) {
 
446
  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
 
447
}
 
448
 
 
449
/* Same as previous function, except strcmp is replaced with a pointer comparison */
 
450
SWIGRUNTIME swig_cast_info *
 
451
SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
 
452
  SWIG_TypeCheck_Template(iter->type == from, into);
 
453
}
 
454
 
 
455
/*
 
456
  Cast a pointer up an inheritance hierarchy
 
457
*/
 
458
SWIGRUNTIMEINLINE void *
 
459
SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
 
460
  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
 
461
}
 
462
 
 
463
/* 
 
464
   Dynamic pointer casting. Down an inheritance hierarchy
 
465
*/
 
466
SWIGRUNTIME swig_type_info *
 
467
SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
 
468
  swig_type_info *lastty = ty;
 
469
  if (!ty || !ty->dcast) return ty;
 
470
  while (ty && (ty->dcast)) {
 
471
    ty = (*ty->dcast)(ptr);
 
472
    if (ty) lastty = ty;
 
473
  }
 
474
  return lastty;
 
475
}
 
476
 
 
477
/*
 
478
  Return the name associated with this type
 
479
*/
 
480
SWIGRUNTIMEINLINE const char *
 
481
SWIG_TypeName(const swig_type_info *ty) {
 
482
  return ty->name;
 
483
}
 
484
 
 
485
/*
 
486
  Return the pretty name associated with this type,
 
487
  that is an unmangled type name in a form presentable to the user.
 
488
*/
 
489
SWIGRUNTIME const char *
 
490
SWIG_TypePrettyName(const swig_type_info *type) {
 
491
  /* The "str" field contains the equivalent pretty names of the
 
492
     type, separated by vertical-bar characters.  We choose
 
493
     to print the last name, as it is often (?) the most
 
494
     specific. */
 
495
  if (!type) return NULL;
 
496
  if (type->str != NULL) {
 
497
    const char *last_name = type->str;
 
498
    const char *s;
 
499
    for (s = type->str; *s; s++)
 
500
      if (*s == '|') last_name = s+1;
 
501
    return last_name;
 
502
  }
 
503
  else
 
504
    return type->name;
 
505
}
 
506
 
 
507
/* 
 
508
   Set the clientdata field for a type
 
509
*/
 
510
SWIGRUNTIME void
 
511
SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
 
512
  swig_cast_info *cast = ti->cast;
 
513
  /* if (ti->clientdata == clientdata) return; */
 
514
  ti->clientdata = clientdata;
 
515
  
 
516
  while (cast) {
 
517
    if (!cast->converter) {
 
518
      swig_type_info *tc = cast->type;
 
519
      if (!tc->clientdata) {
 
520
        SWIG_TypeClientData(tc, clientdata);
 
521
      }
 
522
    }    
 
523
    cast = cast->next;
 
524
  }
 
525
}
 
526
SWIGRUNTIME void
 
527
SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
 
528
  SWIG_TypeClientData(ti, clientdata);
 
529
  ti->owndata = 1;
 
530
}
 
531
  
 
532
/*
 
533
  Search for a swig_type_info structure only by mangled name
 
534
  Search is a O(log #types)
 
535
  
 
536
  We start searching at module start, and finish searching when start == end.  
 
537
  Note: if start == end at the beginning of the function, we go all the way around
 
538
  the circular list.
 
539
*/
 
540
SWIGRUNTIME swig_type_info *
 
541
SWIG_MangledTypeQueryModule(swig_module_info *start, 
 
542
                            swig_module_info *end, 
 
543
                            const char *name) {
 
544
  swig_module_info *iter = start;
 
545
  do {
 
546
    if (iter->size) {
 
547
      register size_t l = 0;
 
548
      register size_t r = iter->size - 1;
 
549
      do {
 
550
        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
 
551
        register size_t i = (l + r) >> 1; 
 
552
        const char *iname = iter->types[i]->name;
 
553
        if (iname) {
 
554
          register int compare = strcmp(name, iname);
 
555
          if (compare == 0) {       
 
556
            return iter->types[i];
 
557
          } else if (compare < 0) {
 
558
            if (i) {
 
559
              r = i - 1;
 
560
            } else {
 
561
              break;
 
562
            }
 
563
          } else if (compare > 0) {
 
564
            l = i + 1;
 
565
          }
 
566
        } else {
 
567
          break; /* should never happen */
 
568
        }
 
569
      } while (l <= r);
 
570
    }
 
571
    iter = iter->next;
 
572
  } while (iter != end);
 
573
  return 0;
 
574
}
 
575
 
 
576
/*
 
577
  Search for a swig_type_info structure for either a mangled name or a human readable name.
 
578
  It first searches the mangled names of the types, which is a O(log #types)
 
579
  If a type is not found it then searches the human readable names, which is O(#types).
 
580
  
 
581
  We start searching at module start, and finish searching when start == end.  
 
582
  Note: if start == end at the beginning of the function, we go all the way around
 
583
  the circular list.
 
584
*/
 
585
SWIGRUNTIME swig_type_info *
 
586
SWIG_TypeQueryModule(swig_module_info *start, 
 
587
                     swig_module_info *end, 
 
588
                     const char *name) {
 
589
  /* STEP 1: Search the name field using binary search */
 
590
  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
 
591
  if (ret) {
 
592
    return ret;
 
593
  } else {
 
594
    /* STEP 2: If the type hasn't been found, do a complete search
 
595
       of the str field (the human readable name) */
 
596
    swig_module_info *iter = start;
 
597
    do {
 
598
      register size_t i = 0;
 
599
      for (; i < iter->size; ++i) {
 
600
        if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
 
601
          return iter->types[i];
 
602
      }
 
603
      iter = iter->next;
 
604
    } while (iter != end);
 
605
  }
 
606
  
 
607
  /* neither found a match */
 
608
  return 0;
 
609
}
 
610
 
 
611
/* 
 
612
   Pack binary data into a string
 
613
*/
 
614
SWIGRUNTIME char *
 
615
SWIG_PackData(char *c, void *ptr, size_t sz) {
 
616
  static const char hex[17] = "0123456789abcdef";
 
617
  register const unsigned char *u = (unsigned char *) ptr;
 
618
  register const unsigned char *eu =  u + sz;
 
619
  for (; u != eu; ++u) {
 
620
    register unsigned char uu = *u;
 
621
    *(c++) = hex[(uu & 0xf0) >> 4];
 
622
    *(c++) = hex[uu & 0xf];
 
623
  }
 
624
  return c;
 
625
}
 
626
 
 
627
/* 
 
628
   Unpack binary data from a string
 
629
*/
 
630
SWIGRUNTIME const char *
 
631
SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
 
632
  register unsigned char *u = (unsigned char *) ptr;
 
633
  register const unsigned char *eu = u + sz;
 
634
  for (; u != eu; ++u) {
 
635
    register char d = *(c++);
 
636
    register unsigned char uu;
 
637
    if ((d >= '0') && (d <= '9'))
 
638
      uu = ((d - '0') << 4);
 
639
    else if ((d >= 'a') && (d <= 'f'))
 
640
      uu = ((d - ('a'-10)) << 4);
 
641
    else 
 
642
      return (char *) 0;
 
643
    d = *(c++);
 
644
    if ((d >= '0') && (d <= '9'))
 
645
      uu |= (d - '0');
 
646
    else if ((d >= 'a') && (d <= 'f'))
 
647
      uu |= (d - ('a'-10));
 
648
    else 
 
649
      return (char *) 0;
 
650
    *u = uu;
 
651
  }
 
652
  return c;
 
653
}
 
654
 
 
655
/* 
 
656
   Pack 'void *' into a string buffer.
 
657
*/
 
658
SWIGRUNTIME char *
 
659
SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
 
660
  char *r = buff;
 
661
  if ((2*sizeof(void *) + 2) > bsz) return 0;
 
662
  *(r++) = '_';
 
663
  r = SWIG_PackData(r,&ptr,sizeof(void *));
 
664
  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
 
665
  strcpy(r,name);
 
666
  return buff;
 
667
}
 
668
 
 
669
SWIGRUNTIME const char *
 
670
SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
 
671
  if (*c != '_') {
 
672
    if (strcmp(c,"NULL") == 0) {
 
673
      *ptr = (void *) 0;
 
674
      return name;
 
675
    } else {
 
676
      return 0;
 
677
    }
 
678
  }
 
679
  return SWIG_UnpackData(++c,ptr,sizeof(void *));
 
680
}
 
681
 
 
682
SWIGRUNTIME char *
 
683
SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
 
684
  char *r = buff;
 
685
  size_t lname = (name ? strlen(name) : 0);
 
686
  if ((2*sz + 2 + lname) > bsz) return 0;
 
687
  *(r++) = '_';
 
688
  r = SWIG_PackData(r,ptr,sz);
 
689
  if (lname) {
 
690
    strncpy(r,name,lname+1);
 
691
  } else {
 
692
    *r = 0;
 
693
  }
 
694
  return buff;
 
695
}
 
696
 
 
697
SWIGRUNTIME const char *
 
698
SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
 
699
  if (*c != '_') {
 
700
    if (strcmp(c,"NULL") == 0) {
 
701
      memset(ptr,0,sz);
 
702
      return name;
 
703
    } else {
 
704
      return 0;
 
705
    }
 
706
  }
 
707
  return SWIG_UnpackData(++c,ptr,sz);
 
708
}
 
709
 
 
710
#ifdef __cplusplus
 
711
}
 
712
#endif
 
713
/* -----------------------------------------------------------------------------
 
714
 * See the LICENSE file for information on copyright, usage and redistribution
 
715
 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 
716
 *
 
717
 * guile_scm_run.swg
 
718
 * ----------------------------------------------------------------------------- */
 
719
 
 
720
#include <libguile.h>
 
721
#include <stdio.h>
 
722
#include <string.h>
 
723
#include <stdlib.h>
 
724
 
 
725
#ifdef __cplusplus
 
726
extern "C" {
 
727
#endif
 
728
 
 
729
typedef SCM (*swig_guile_proc)();
 
730
typedef SCM (*guile_destructor)(SCM);
 
731
 
 
732
typedef struct swig_guile_clientdata {
 
733
  guile_destructor destroy;
 
734
  SCM goops_class;
 
735
} swig_guile_clientdata;
 
736
 
 
737
#define SWIG_scm2str(s) \
 
738
  SWIG_Guile_scm2newstr(s, NULL)
 
739
#define SWIG_malloc(size) \
 
740
  SCM_MUST_MALLOC(size)
 
741
#define SWIG_free(mem) \
 
742
  scm_must_free(mem)
 
743
#define SWIG_ConvertPtr(s, result, type, flags) \
 
744
  SWIG_Guile_ConvertPtr(s, result, type, flags)
 
745
#define SWIG_MustGetPtr(s, type, argnum, flags) \
 
746
  SWIG_Guile_MustGetPtr(s, type, argnum, flags, FUNC_NAME)
 
747
#define SWIG_NewPointerObj(ptr, type, owner) \
 
748
  SWIG_Guile_NewPointerObj((void*)ptr, type, owner)
 
749
#define SWIG_PointerAddress(object) \
 
750
  SWIG_Guile_PointerAddress(object)
 
751
#define SWIG_PointerType(object) \
 
752
  SWIG_Guile_PointerType(object)
 
753
#define SWIG_IsPointerOfType(object, type) \
 
754
  SWIG_Guile_IsPointerOfType(object, type)
 
755
#define SWIG_IsPointer(object) \
 
756
  SWIG_Guile_IsPointer(object)
 
757
#define SWIG_contract_assert(expr, msg)                         \
 
758
  if (!(expr))                                                  \
 
759
    scm_error(scm_str2symbol("swig-contract-assertion-failed"), \
 
760
              (char *) FUNC_NAME, (char *) msg,                 \
 
761
              SCM_EOL, SCM_BOOL_F); else
 
762
 
 
763
/* for C++ member pointers, ie, member methods */
 
764
#define SWIG_ConvertMember(obj, ptr, sz, ty) \
 
765
  SWIG_Guile_ConvertMember(obj, ptr, sz, ty, FUNC_NAME)
 
766
#define SWIG_NewMemberObj(ptr, sz, type) \
 
767
  SWIG_Guile_NewMemberObj(ptr, sz, type, FUNC_NAME)
 
768
  
 
769
/* Runtime API */
 
770
static swig_module_info *SWIG_Guile_GetModule(void);
 
771
#define SWIG_GetModule(clientdata) SWIG_Guile_GetModule()
 
772
#define SWIG_SetModule(clientdata, pointer) SWIG_Guile_SetModule(pointer)
 
773
  
 
774
SWIGINTERN char *
 
775
SWIG_Guile_scm2newstr(SCM str, size_t *len) {
 
776
#define FUNC_NAME "SWIG_Guile_scm2newstr"
 
777
  char *ret;
 
778
  size_t l;
 
779
 
 
780
  SCM_ASSERT (SCM_STRINGP(str), str, 1, FUNC_NAME);
 
781
  
 
782
  l = SCM_STRING_LENGTH(str);
 
783
  ret = (char *) SWIG_malloc( (l + 1) * sizeof(char));
 
784
  if (!ret) return NULL;
 
785
 
 
786
  memcpy(ret, SCM_STRING_CHARS(str), l);
 
787
  ret[l] = '\0';
 
788
  if (len) *len = l;
 
789
  return ret;
 
790
#undef FUNC_NAME
 
791
}
 
792
 
 
793
static int swig_initialized = 0;
 
794
static scm_t_bits swig_tag = 0;
 
795
static scm_t_bits swig_collectable_tag = 0;
 
796
static scm_t_bits swig_destroyed_tag = 0;
 
797
static scm_t_bits swig_member_function_tag = 0;
 
798
static SCM swig_make_func = SCM_EOL;
 
799
static SCM swig_keyword = SCM_EOL;
 
800
static SCM swig_symbol = SCM_EOL;
 
801
 
 
802
#define SWIG_Guile_GetSmob(x) \
 
803
  ( SCM_NNULLP(x) && SCM_INSTANCEP(x) && SCM_NFALSEP(scm_slot_exists_p(x, swig_symbol)) \
 
804
      ? scm_slot_ref(x, swig_symbol) : (x) )
 
805
 
 
806
SWIGINTERN SCM
 
807
SWIG_Guile_NewPointerObj(void *ptr, swig_type_info *type, int owner)
 
808
{
 
809
  if (ptr == NULL)
 
810
    return SCM_EOL;
 
811
  else {
 
812
    SCM smob;
 
813
    swig_guile_clientdata *cdata = (swig_guile_clientdata *) type->clientdata;
 
814
    if (owner)
 
815
      SCM_NEWSMOB2(smob, swig_collectable_tag, ptr, (void *) type);
 
816
    else
 
817
      SCM_NEWSMOB2(smob, swig_tag, ptr, (void *) type);
 
818
 
 
819
    if (!cdata || SCM_NULLP(cdata->goops_class) || swig_make_func == SCM_EOL ) {
 
820
      return smob;
 
821
    } else {
 
822
      /* the scm_make() C function only handles the creation of gf,
 
823
         methods and classes (no instances) the (make ...) function is
 
824
         later redefined in goops.scm.  So we need to call that
 
825
         Scheme function. */
 
826
      return scm_apply(swig_make_func,
 
827
                       scm_list_3(cdata->goops_class,
 
828
                                  swig_keyword,
 
829
                                  smob),
 
830
                       SCM_EOL);
 
831
    }
 
832
  }
 
833
}
 
834
 
 
835
SWIGINTERN unsigned long
 
836
SWIG_Guile_PointerAddress(SCM object)
 
837
{
 
838
  SCM smob = SWIG_Guile_GetSmob(object);
 
839
  if (SCM_NULLP(smob)) return 0;
 
840
  else if (SCM_SMOB_PREDICATE(swig_tag, smob)
 
841
           || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
 
842
           || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
 
843
    return (unsigned long) (void *) SCM_CELL_WORD_1(smob);
 
844
  }
 
845
  else scm_wrong_type_arg("SWIG-Guile-PointerAddress", 1, object);
 
846
}
 
847
 
 
848
SWIGINTERN swig_type_info *
 
849
SWIG_Guile_PointerType(SCM object)
 
850
{
 
851
  SCM smob = SWIG_Guile_GetSmob(object);
 
852
  if (SCM_NULLP(smob)) return NULL;
 
853
  else if (SCM_SMOB_PREDICATE(swig_tag, smob)
 
854
           || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)
 
855
           || SCM_SMOB_PREDICATE(swig_destroyed_tag, smob)) {
 
856
    return (swig_type_info *) SCM_CELL_WORD_2(smob);
 
857
  }
 
858
  else scm_wrong_type_arg("SWIG-Guile-PointerType", 1, object);
 
859
}
 
860
  
 
861
SWIGINTERN int
 
862
SWIG_Guile_ConvertPtr(SCM s, void **result, swig_type_info *type, int flags)
 
863
{
 
864
  swig_cast_info *cast;
 
865
  swig_type_info *from;
 
866
  SCM smob = SWIG_Guile_GetSmob(s);
 
867
 
 
868
  if (SCM_NULLP(smob)) {
 
869
    *result = NULL;
 
870
    return SWIG_OK;
 
871
  } else if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
 
872
    /* we do not accept smobs representing destroyed pointers */
 
873
    from = (swig_type_info *) SCM_CELL_WORD_2(smob);
 
874
    if (!from) return SWIG_ERROR;
 
875
    if (type) {
 
876
      cast = SWIG_TypeCheckStruct(from, type);
 
877
      if (cast) {
 
878
        *result = SWIG_TypeCast(cast, (void *) SCM_CELL_WORD_1(smob));
 
879
        return SWIG_OK;
 
880
      } else {
 
881
        return SWIG_ERROR;
 
882
      }
 
883
    } else {
 
884
      *result = (void *) SCM_CELL_WORD_1(smob);
 
885
      return SWIG_OK;
 
886
    }
 
887
  }
 
888
  return SWIG_ERROR;
 
889
}
 
890
 
 
891
SWIGINTERNINLINE void *
 
892
SWIG_Guile_MustGetPtr (SCM s, swig_type_info *type,
 
893
                       int argnum, int flags, const char *func_name)
 
894
{
 
895
  void *result;
 
896
  int res = SWIG_Guile_ConvertPtr(s, &result, type, flags);
 
897
  if (!SWIG_IsOK(res)) {
 
898
    /* type mismatch */
 
899
    scm_wrong_type_arg((char *) func_name, argnum, s);
 
900
  }
 
901
  return result;
 
902
}
 
903
 
 
904
SWIGINTERNINLINE int
 
905
SWIG_Guile_IsPointerOfType (SCM s, swig_type_info *type)
 
906
{
 
907
  void *result;
 
908
  if (SWIG_Guile_ConvertPtr(s, &result, type, 0)) {
 
909
    /* type mismatch */
 
910
    return 0;
 
911
  }
 
912
  else return 1;
 
913
}
 
914
 
 
915
SWIGINTERNINLINE int
 
916
SWIG_Guile_IsPointer (SCM s)
 
917
{
 
918
  /* module might not be initialized yet, so initialize it */
 
919
  SWIG_Guile_GetModule();
 
920
  return SWIG_Guile_IsPointerOfType (s, NULL);
 
921
}
 
922
 
 
923
/* Mark a pointer object non-collectable */
 
924
SWIGINTERN void
 
925
SWIG_Guile_MarkPointerNoncollectable(SCM s)
 
926
{
 
927
  SCM smob = SWIG_Guile_GetSmob(s);
 
928
  if (!SCM_NULLP(smob)) {
 
929
    if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
 
930
      SCM_SET_CELL_TYPE(smob, swig_tag);
 
931
    }
 
932
    else scm_wrong_type_arg(NULL, 0, s);
 
933
  }
 
934
}
 
935
 
 
936
/* Mark a pointer object destroyed */
 
937
SWIGINTERN void
 
938
SWIG_Guile_MarkPointerDestroyed(SCM s)
 
939
{
 
940
  SCM smob = SWIG_Guile_GetSmob(s);
 
941
  if (!SCM_NULLP(smob)) {
 
942
    if (SCM_SMOB_PREDICATE(swig_tag, smob) || SCM_SMOB_PREDICATE(swig_collectable_tag, smob)) {
 
943
      SCM_SET_CELL_TYPE(smob, swig_destroyed_tag);
 
944
    }
 
945
    else scm_wrong_type_arg(NULL, 0, s);
 
946
  }
 
947
}
 
948
 
 
949
/* Member functions */
 
950
 
 
951
SWIGINTERN SCM
 
952
SWIG_Guile_NewMemberObj(void *ptr, size_t sz, swig_type_info *type,
 
953
                        const char *func_name)
 
954
{
 
955
  SCM smob;
 
956
  void *copy = malloc(sz);
 
957
  memcpy(copy, ptr, sz);
 
958
  SCM_NEWSMOB2(smob, swig_member_function_tag, copy, (void *) type);
 
959
  return smob;
 
960
}
 
961
 
 
962
SWIGINTERN int
 
963
SWIG_Guile_ConvertMember(SCM smob, void *ptr, size_t sz, swig_type_info *type,
 
964
                         const char *func_name)
 
965
{
 
966
  swig_cast_info *cast;
 
967
  swig_type_info *from;
 
968
 
 
969
  if (SCM_SMOB_PREDICATE(swig_member_function_tag, smob)) {
 
970
    from = (swig_type_info *) SCM_CELL_WORD_2(smob);
 
971
    if (!from) return SWIG_ERROR;
 
972
    if (type) {
 
973
      cast = SWIG_TypeCheckStruct(from, type);
 
974
      if (!cast) return SWIG_ERROR;
 
975
    }
 
976
    memcpy(ptr, (void *) SCM_CELL_WORD_1(smob), sz);
 
977
    return SWIG_OK;
 
978
  }
 
979
  return SWIG_ERROR;
 
980
}
 
981
     
 
982
 
 
983
/* Init */
 
984
 
 
985
SWIGINTERN int
 
986
print_swig_aux (SCM swig_smob, SCM port, scm_print_state *pstate, 
 
987
                const char *attribute)
 
988
{
 
989
  swig_type_info *type;
 
990
  
 
991
  type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob);
 
992
  if (type) {
 
993
    scm_puts((char *) "#<", port);
 
994
    scm_puts((char *) attribute, port);
 
995
    scm_puts((char *) "swig-pointer ", port);
 
996
    scm_puts((char *) SWIG_TypePrettyName(type), port);
 
997
    scm_puts((char *) " ", port);
 
998
    scm_intprint((long) SCM_CELL_WORD_1(swig_smob), 16, port);
 
999
    scm_puts((char *) ">", port);
 
1000
    /* non-zero means success */
 
1001
    return 1;
 
1002
  } else {
 
1003
    return 0;
 
1004
  }
 
1005
}
 
1006
 
 
1007
  
 
1008
SWIGINTERN int
 
1009
print_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
 
1010
{
 
1011
  return print_swig_aux(swig_smob, port, pstate, "");
 
1012
}
 
1013
 
 
1014
SWIGINTERN int
 
1015
print_collectable_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
 
1016
{
 
1017
  return print_swig_aux(swig_smob, port, pstate, "collectable-");
 
1018
}
 
1019
 
 
1020
SWIGINTERN int
 
1021
print_destroyed_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
 
1022
{
 
1023
  return print_swig_aux(swig_smob, port, pstate, "destroyed-");
 
1024
}
 
1025
 
 
1026
SWIGINTERN int
 
1027
print_member_function_swig (SCM swig_smob, SCM port, scm_print_state *pstate)
 
1028
{
 
1029
  swig_type_info *type;
 
1030
  type = (swig_type_info *) SCM_CELL_WORD_2(swig_smob);
 
1031
  if (type) {
 
1032
    scm_puts((char *) "#<", port);
 
1033
    scm_puts((char *) "swig-member-function-pointer ", port);
 
1034
    scm_puts((char *) SWIG_TypePrettyName(type), port);
 
1035
    scm_puts((char *) " >", port);
 
1036
    /* non-zero means success */
 
1037
    return 1;
 
1038
  } else {
 
1039
    return 0;
 
1040
  }
 
1041
}
 
1042
 
 
1043
SWIGINTERN SCM
 
1044
equalp_swig (SCM A, SCM B)
 
1045
{
 
1046
  if (SCM_CELL_WORD_0(A) == SCM_CELL_WORD_0(B) && SCM_CELL_WORD_1(A) == SCM_CELL_WORD_1(B) 
 
1047
      && SCM_CELL_WORD_2(A) == SCM_CELL_WORD_2(B))
 
1048
    return SCM_BOOL_T;
 
1049
  else return SCM_BOOL_F;
 
1050
}
 
1051
 
 
1052
SWIGINTERN size_t
 
1053
free_swig(SCM A)
 
1054
{
 
1055
  swig_type_info *type = (swig_type_info *) SCM_CELL_WORD_2(A);
 
1056
  if (type) {
 
1057
    if (type->clientdata && ((swig_guile_clientdata *)type->clientdata)->destroy)
 
1058
      ((swig_guile_clientdata *)type->clientdata)->destroy(A);
 
1059
  } 
 
1060
  return 0;
 
1061
}
 
1062
 
 
1063
SWIGINTERN size_t
 
1064
free_swig_member_function(SCM A)
 
1065
{
 
1066
  free((swig_type_info *) SCM_CELL_WORD_1(A));
 
1067
  return 0;
 
1068
}
 
1069
 
 
1070
SWIGINTERN int
 
1071
ensure_smob_tag(SCM swig_module,
 
1072
                scm_t_bits *tag_variable,
 
1073
                const char *smob_name,
 
1074
                const char *scheme_variable_name)
 
1075
{
 
1076
  SCM variable = scm_sym2var(scm_str2symbol(scheme_variable_name),
 
1077
                             scm_module_lookup_closure(swig_module),
 
1078
                             SCM_BOOL_T);
 
1079
  if (SCM_UNBNDP(SCM_VARIABLE_REF(variable))) {
 
1080
    *tag_variable = scm_make_smob_type((char*)scheme_variable_name, 0);
 
1081
    SCM_VARIABLE_SET(variable,
 
1082
                     scm_ulong2num(*tag_variable));
 
1083
    return 1;
 
1084
  }
 
1085
  else {
 
1086
    *tag_variable = scm_num2ulong(SCM_VARIABLE_REF(variable), 0,
 
1087
                                  "SWIG_Guile_Init");
 
1088
    return 0;
 
1089
  }
 
1090
}
 
1091
 
 
1092
SWIGINTERN SCM
 
1093
SWIG_Guile_Init ()
 
1094
{
 
1095
  static SCM swig_module;
 
1096
  
 
1097
  if (swig_initialized) return swig_module;
 
1098
  swig_initialized = 1;
 
1099
 
 
1100
  swig_module = scm_c_resolve_module("Swig swigrun");
 
1101
  if (ensure_smob_tag(swig_module, &swig_tag,
 
1102
                      "swig-pointer", "swig-pointer-tag")) {
 
1103
    scm_set_smob_print(swig_tag, print_swig);
 
1104
    scm_set_smob_equalp(swig_tag, equalp_swig);
 
1105
  }
 
1106
  if (ensure_smob_tag(swig_module, &swig_collectable_tag,
 
1107
                      "collectable-swig-pointer", "collectable-swig-pointer-tag")) {
 
1108
    scm_set_smob_print(swig_collectable_tag, print_collectable_swig);
 
1109
    scm_set_smob_equalp(swig_collectable_tag, equalp_swig);
 
1110
    scm_set_smob_free(swig_collectable_tag, free_swig);
 
1111
  }
 
1112
  if (ensure_smob_tag(swig_module, &swig_destroyed_tag,
 
1113
                      "destroyed-swig-pointer", "destroyed-swig-pointer-tag")) {
 
1114
    scm_set_smob_print(swig_destroyed_tag, print_destroyed_swig);
 
1115
    scm_set_smob_equalp(swig_destroyed_tag, equalp_swig);
 
1116
  }
 
1117
  if (ensure_smob_tag(swig_module, &swig_member_function_tag,
 
1118
                      "swig-member-function-pointer", "swig-member-function-pointer-tag")) {
 
1119
    scm_set_smob_print(swig_member_function_tag, print_member_function_swig);
 
1120
    scm_set_smob_free(swig_member_function_tag, free_swig_member_function);
 
1121
  }
 
1122
  swig_make_func = scm_permanent_object(
 
1123
  scm_variable_ref(scm_c_module_lookup(scm_c_resolve_module("oop goops"), "make")));
 
1124
  swig_keyword = scm_permanent_object(scm_c_make_keyword((char*) "init-smob"));
 
1125
  swig_symbol = scm_permanent_object(scm_str2symbol("swig-smob"));
 
1126
#ifdef SWIG_INIT_RUNTIME_MODULE
 
1127
  SWIG_INIT_RUNTIME_MODULE
 
1128
#endif
 
1129
 
 
1130
  return swig_module;
 
1131
}
 
1132
 
 
1133
SWIGINTERN swig_module_info *
 
1134
SWIG_Guile_GetModule(void)
 
1135
{
 
1136
  SCM module;
 
1137
  SCM variable;
 
1138
 
 
1139
  module = SWIG_Guile_Init();
 
1140
 
 
1141
  variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
 
1142
                               scm_module_lookup_closure(module),
 
1143
                               SCM_BOOL_T);
 
1144
  if (SCM_UNBNDP(SCM_VARIABLE_REF(variable))) {
 
1145
    return NULL;
 
1146
  } else {
 
1147
    return (swig_module_info *) scm_num2ulong(SCM_VARIABLE_REF(variable), 0, "SWIG_Guile_Init");
 
1148
  }
 
1149
}
 
1150
 
 
1151
SWIGINTERN void
 
1152
SWIG_Guile_SetModule(swig_module_info *swig_module)
 
1153
{
 
1154
  SCM module;
 
1155
  SCM variable;
 
1156
 
 
1157
  module = SWIG_Guile_Init();
 
1158
    
 
1159
  variable = scm_sym2var(scm_str2symbol("swig-type-list-address" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME),
 
1160
                               scm_module_lookup_closure(module),
 
1161
                               SCM_BOOL_T);
 
1162
 
 
1163
  SCM_VARIABLE_SET(variable, scm_ulong2num((unsigned long) swig_module));
 
1164
}
 
1165
 
 
1166
SWIGINTERN int
 
1167
SWIG_Guile_GetArgs (SCM *dest, SCM rest,
 
1168
                    int reqargs, int optargs,
 
1169
                    const char *procname)
 
1170
{
 
1171
  int i;
 
1172
  int num_args_passed = 0;
 
1173
  for (i = 0; i<reqargs; i++) {
 
1174
    if (!SCM_CONSP(rest))
 
1175
      scm_wrong_num_args(scm_makfrom0str((char *) procname));
 
1176
    *dest++ = SCM_CAR(rest);
 
1177
    rest = SCM_CDR(rest);
 
1178
    num_args_passed++;
 
1179
  }
 
1180
  for (i = 0; i<optargs && SCM_CONSP(rest); i++) {
 
1181
    *dest++ = SCM_CAR(rest);
 
1182
    rest = SCM_CDR(rest);
 
1183
    num_args_passed++;
 
1184
  }
 
1185
  for (; i<optargs; i++)
 
1186
    *dest++ = SCM_UNDEFINED;
 
1187
  if (!SCM_NULLP(rest))
 
1188
    scm_wrong_num_args(scm_makfrom0str((char *) procname));
 
1189
  return num_args_passed;
 
1190
}
 
1191
 
 
1192
#ifdef __cplusplus
 
1193
}
 
1194
#endif
 
1195
/* -----------------------------------------------------------------------------*
 
1196
   Standard SWIG API for use inside user code.
 
1197
 
 
1198
   Don't include this file directly, run the command
 
1199
   swig -python -external-runtime
 
1200
   Also, read the Modules chapter of the SWIG Manual.
 
1201
 
 
1202
 * -----------------------------------------------------------------------------*/
 
1203
 
 
1204
#ifdef SWIG_MODULE_CLIENTDATA_TYPE
 
1205
 
 
1206
SWIGRUNTIMEINLINE swig_type_info *
 
1207
SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
 
1208
  swig_module_info *module = SWIG_GetModule(clientdata);
 
1209
  return SWIG_TypeQueryModule(module, module, name);
 
1210
}
 
1211
 
 
1212
SWIGRUNTIMEINLINE swig_type_info *
 
1213
SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata, const char *name) {
 
1214
  swig_module_info *module = SWIG_GetModule(clientdata);
 
1215
  return SWIG_MangledTypeQueryModule(module, module, name);
 
1216
}
 
1217
 
 
1218
#else
 
1219
 
 
1220
SWIGRUNTIMEINLINE swig_type_info *
 
1221
SWIG_TypeQuery(const char *name) {
 
1222
  swig_module_info *module = SWIG_GetModule(NULL);
 
1223
  return SWIG_TypeQueryModule(module, module, name);
 
1224
}
 
1225
 
 
1226
SWIGRUNTIMEINLINE swig_type_info *
 
1227
SWIG_MangledTypeQuery(const char *name) {
 
1228
  swig_module_info *module = SWIG_GetModule(NULL);
 
1229
  return SWIG_MangledTypeQueryModule(module, module, name);
 
1230
}
 
1231
 
 
1232
#endif