source: trunk/base/src/machista1.0/machista_wrap.c @ 136929

Last change on this file since 136929 was 136929, checked in by cal@…, 5 years ago

machista: add missing include, re-generate with newer swig

This adds a warning about a missing initializer when compiling machista_wrap.c
with clang. This warning is a false positive. While there is no explicit
initializer for the last member of the struct (a Tcl hashtable), the C99
standard guarantees unitialized static structs are set to 0 (and the value
doesn't really matter anyway, because it will be properly initialized later
on). Putting a {0} there does not really help either, because clang doesn't
recognize this standard way to say "initialize the rest with zeroes".

=> I'm ignoring this warning.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 86.7 KB
Line 
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 3.0.5
4 *
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
10
11#define SWIGTCL
12
13/* -----------------------------------------------------------------------------
14 *  This section contains generic SWIG labels for method/variable
15 *  declarations/attributes, and other compiler dependent labels.
16 * ----------------------------------------------------------------------------- */
17
18/* template workaround for compilers that cannot correctly implement the C++ standard */
19#ifndef SWIGTEMPLATEDISAMBIGUATOR
20# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21#  define SWIGTEMPLATEDISAMBIGUATOR template
22# elif defined(__HP_aCC)
23/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25#  define SWIGTEMPLATEDISAMBIGUATOR template
26# else
27#  define SWIGTEMPLATEDISAMBIGUATOR
28# endif
29#endif
30
31/* inline attribute */
32#ifndef SWIGINLINE
33# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34#   define SWIGINLINE inline
35# else
36#   define SWIGINLINE
37# endif
38#endif
39
40/* attribute recognised by some compilers to avoid 'unused' warnings */
41#ifndef SWIGUNUSED
42# if defined(__GNUC__)
43#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44#     define SWIGUNUSED __attribute__ ((__unused__))
45#   else
46#     define SWIGUNUSED
47#   endif
48# elif defined(__ICC)
49#   define SWIGUNUSED __attribute__ ((__unused__))
50# else
51#   define SWIGUNUSED
52# endif
53#endif
54
55#ifndef SWIG_MSC_UNSUPPRESS_4505
56# if defined(_MSC_VER)
57#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
58# endif
59#endif
60
61#ifndef SWIGUNUSEDPARM
62# ifdef __cplusplus
63#   define SWIGUNUSEDPARM(p)
64# else
65#   define SWIGUNUSEDPARM(p) p SWIGUNUSED
66# endif
67#endif
68
69/* internal SWIG method */
70#ifndef SWIGINTERN
71# define SWIGINTERN static SWIGUNUSED
72#endif
73
74/* internal inline SWIG method */
75#ifndef SWIGINTERNINLINE
76# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77#endif
78
79/* exporting methods */
80#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81#  ifndef GCC_HASCLASSVISIBILITY
82#    define GCC_HASCLASSVISIBILITY
83#  endif
84#endif
85
86#ifndef SWIGEXPORT
87# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88#   if defined(STATIC_LINKED)
89#     define SWIGEXPORT
90#   else
91#     define SWIGEXPORT __declspec(dllexport)
92#   endif
93# else
94#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95#     define SWIGEXPORT __attribute__ ((visibility("default")))
96#   else
97#     define SWIGEXPORT
98#   endif
99# endif
100#endif
101
102/* calling conventions for Windows */
103#ifndef SWIGSTDCALL
104# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105#   define SWIGSTDCALL __stdcall
106# else
107#   define SWIGSTDCALL
108# endif
109#endif
110
111/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113# define _CRT_SECURE_NO_DEPRECATE
114#endif
115
116/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118# define _SCL_SECURE_NO_DEPRECATE
119#endif
120
121
122
123#include <stdio.h>
124#include <tcl.h>
125#include <errno.h>
126#include <stdlib.h>
127#include <stdarg.h>
128#include <ctype.h>
129
130/* -----------------------------------------------------------------------------
131 * swigrun.swg
132 *
133 * This file contains generic C API SWIG runtime support for pointer
134 * type checking.
135 * ----------------------------------------------------------------------------- */
136
137/* This should only be incremented when either the layout of swig_type_info changes,
138   or for whatever reason, the runtime changes incompatibly */
139#define SWIG_RUNTIME_VERSION "4"
140
141/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
142#ifdef SWIG_TYPE_TABLE
143# define SWIG_QUOTE_STRING(x) #x
144# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
145# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
146#else
147# define SWIG_TYPE_TABLE_NAME
148#endif
149
150/*
151  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
152  creating a static or dynamic library from the SWIG runtime code.
153  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
154
155  But only do this if strictly necessary, ie, if you have problems
156  with your compiler or suchlike.
157*/
158
159#ifndef SWIGRUNTIME
160# define SWIGRUNTIME SWIGINTERN
161#endif
162
163#ifndef SWIGRUNTIMEINLINE
164# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
165#endif
166
167/*  Generic buffer size */
168#ifndef SWIG_BUFFER_SIZE
169# define SWIG_BUFFER_SIZE 1024
170#endif
171
172/* Flags for pointer conversions */
173#define SWIG_POINTER_DISOWN        0x1
174#define SWIG_CAST_NEW_MEMORY       0x2
175
176/* Flags for new pointer objects */
177#define SWIG_POINTER_OWN           0x1
178
179
180/*
181   Flags/methods for returning states.
182
183   The SWIG conversion methods, as ConvertPtr, return an integer
184   that tells if the conversion was successful or not. And if not,
185   an error code can be returned (see swigerrors.swg for the codes).
186
187   Use the following macros/flags to set or process the returning
188   states.
189
190   In old versions of SWIG, code such as the following was usually written:
191
192     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
193       // success code
194     } else {
195       //fail code
196     }
197
198   Now you can be more explicit:
199
200    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
201    if (SWIG_IsOK(res)) {
202      // success code
203    } else {
204      // fail code
205    }
206
207   which is the same really, but now you can also do
208
209    Type *ptr;
210    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
211    if (SWIG_IsOK(res)) {
212      // success code
213      if (SWIG_IsNewObj(res) {
214        ...
215        delete *ptr;
216      } else {
217        ...
218      }
219    } else {
220      // fail code
221    }
222
223   I.e., now SWIG_ConvertPtr can return new objects and you can
224   identify the case and take care of the deallocation. Of course that
225   also requires SWIG_ConvertPtr to return new result values, such as
226
227      int SWIG_ConvertPtr(obj, ptr,...) {
228        if (<obj is ok>) {
229          if (<need new object>) {
230            *ptr = <ptr to new allocated object>;
231            return SWIG_NEWOBJ;
232          } else {
233            *ptr = <ptr to old object>;
234            return SWIG_OLDOBJ;
235          }
236        } else {
237          return SWIG_BADOBJ;
238        }
239      }
240
241   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
242   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
243   SWIG errors code.
244
245   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
246   allows to return the 'cast rank', for example, if you have this
247
248       int food(double)
249       int fooi(int);
250
251   and you call
252
253      food(1)   // cast rank '1'  (1 -> 1.0)
254      fooi(1)   // cast rank '0'
255
256   just use the SWIG_AddCast()/SWIG_CheckState()
257*/
258
259#define SWIG_OK                    (0)
260#define SWIG_ERROR                 (-1)
261#define SWIG_IsOK(r)               (r >= 0)
262#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
263
264/* The CastRankLimit says how many bits are used for the cast rank */
265#define SWIG_CASTRANKLIMIT         (1 << 8)
266/* The NewMask denotes the object was created (using new/malloc) */
267#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
268/* The TmpMask is for in/out typemaps that use temporal objects */
269#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
270/* Simple returning values */
271#define SWIG_BADOBJ                (SWIG_ERROR)
272#define SWIG_OLDOBJ                (SWIG_OK)
273#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
274#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
275/* Check, add and del mask methods */
276#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
277#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
278#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
279#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
280#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
281#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
282
283/* Cast-Rank Mode */
284#if defined(SWIG_CASTRANK_MODE)
285#  ifndef SWIG_TypeRank
286#    define SWIG_TypeRank             unsigned long
287#  endif
288#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
289#    define SWIG_MAXCASTRANK          (2)
290#  endif
291#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
292#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
293SWIGINTERNINLINE int SWIG_AddCast(int r) {
294  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
295}
296SWIGINTERNINLINE int SWIG_CheckState(int r) {
297  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
298}
299#else /* no cast-rank mode */
300#  define SWIG_AddCast(r) (r)
301#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
302#endif
303
304
305#include <string.h>
306
307#ifdef __cplusplus
308extern "C" {
309#endif
310
311typedef void *(*swig_converter_func)(void *, int *);
312typedef struct swig_type_info *(*swig_dycast_func)(void **);
313
314/* Structure to store information on one type */
315typedef struct swig_type_info {
316  const char             *name;                 /* mangled name of this type */
317  const char             *str;                  /* human readable name of this type */
318  swig_dycast_func        dcast;                /* dynamic cast function down a hierarchy */
319  struct swig_cast_info  *cast;                 /* linked list of types that can cast into this type */
320  void                   *clientdata;           /* language specific type data */
321  int                    owndata;               /* flag if the structure owns the clientdata */
322} swig_type_info;
323
324/* Structure to store a type and conversion function used for casting */
325typedef struct swig_cast_info {
326  swig_type_info         *type;                 /* pointer to type that is equivalent to this type */
327  swig_converter_func     converter;            /* function to cast the void pointers */
328  struct swig_cast_info  *next;                 /* pointer to next cast in linked list */
329  struct swig_cast_info  *prev;                 /* pointer to the previous cast */
330} swig_cast_info;
331
332/* Structure used to store module information
333 * Each module generates one structure like this, and the runtime collects
334 * all of these structures and stores them in a circularly linked list.*/
335typedef struct swig_module_info {
336  swig_type_info         **types;               /* Array of pointers to swig_type_info structures that are in this module */
337  size_t                 size;                  /* Number of types in this module */
338  struct swig_module_info *next;                /* Pointer to next element in circularly linked list */
339  swig_type_info         **type_initial;        /* Array of initially generated type structures */
340  swig_cast_info         **cast_initial;        /* Array of initially generated casting structures */
341  void                    *clientdata;          /* Language specific module data */
342} swig_module_info;
343
344/*
345  Compare two type names skipping the space characters, therefore
346  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
347
348  Return 0 when the two name types are equivalent, as in
349  strncmp, but skipping ' '.
350*/
351SWIGRUNTIME int
352SWIG_TypeNameComp(const char *f1, const char *l1,
353                  const char *f2, const char *l2) {
354  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
355    while ((*f1 == ' ') && (f1 != l1)) ++f1;
356    while ((*f2 == ' ') && (f2 != l2)) ++f2;
357    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
358  }
359  return (int)((l1 - f1) - (l2 - f2));
360}
361
362/*
363  Check type equivalence in a name list like <name1>|<name2>|...
364  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
365*/
366SWIGRUNTIME int
367SWIG_TypeCmp(const char *nb, const char *tb) {
368  int equiv = 1;
369  const char* te = tb + strlen(tb);
370  const char* ne = nb;
371  while (equiv != 0 && *ne) {
372    for (nb = ne; *ne; ++ne) {
373      if (*ne == '|') break;
374    }
375    equiv = SWIG_TypeNameComp(nb, ne, tb, te);
376    if (*ne) ++ne;
377  }
378  return equiv;
379}
380
381/*
382  Check type equivalence in a name list like <name1>|<name2>|...
383  Return 0 if not equal, 1 if equal
384*/
385SWIGRUNTIME int
386SWIG_TypeEquiv(const char *nb, const char *tb) {
387  return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
388}
389
390/*
391  Check the typename
392*/
393SWIGRUNTIME swig_cast_info *
394SWIG_TypeCheck(const char *c, swig_type_info *ty) {
395  if (ty) {
396    swig_cast_info *iter = ty->cast;
397    while (iter) {
398      if (strcmp(iter->type->name, c) == 0) {
399        if (iter == ty->cast)
400          return iter;
401        /* Move iter to the top of the linked list */
402        iter->prev->next = iter->next;
403        if (iter->next)
404          iter->next->prev = iter->prev;
405        iter->next = ty->cast;
406        iter->prev = 0;
407        if (ty->cast) ty->cast->prev = iter;
408        ty->cast = iter;
409        return iter;
410      }
411      iter = iter->next;
412    }
413  }
414  return 0;
415}
416
417/*
418  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
419*/
420SWIGRUNTIME swig_cast_info *
421SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
422  if (ty) {
423    swig_cast_info *iter = ty->cast;
424    while (iter) {
425      if (iter->type == from) {
426        if (iter == ty->cast)
427          return iter;
428        /* Move iter to the top of the linked list */
429        iter->prev->next = iter->next;
430        if (iter->next)
431          iter->next->prev = iter->prev;
432        iter->next = ty->cast;
433        iter->prev = 0;
434        if (ty->cast) ty->cast->prev = iter;
435        ty->cast = iter;
436        return iter;
437      }
438      iter = iter->next;
439    }
440  }
441  return 0;
442}
443
444/*
445  Cast a pointer up an inheritance hierarchy
446*/
447SWIGRUNTIMEINLINE void *
448SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
449  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
450}
451
452/*
453   Dynamic pointer casting. Down an inheritance hierarchy
454*/
455SWIGRUNTIME swig_type_info *
456SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
457  swig_type_info *lastty = ty;
458  if (!ty || !ty->dcast) return ty;
459  while (ty && (ty->dcast)) {
460    ty = (*ty->dcast)(ptr);
461    if (ty) lastty = ty;
462  }
463  return lastty;
464}
465
466/*
467  Return the name associated with this type
468*/
469SWIGRUNTIMEINLINE const char *
470SWIG_TypeName(const swig_type_info *ty) {
471  return ty->name;
472}
473
474/*
475  Return the pretty name associated with this type,
476  that is an unmangled type name in a form presentable to the user.
477*/
478SWIGRUNTIME const char *
479SWIG_TypePrettyName(const swig_type_info *type) {
480  /* The "str" field contains the equivalent pretty names of the
481     type, separated by vertical-bar characters.  We choose
482     to print the last name, as it is often (?) the most
483     specific. */
484  if (!type) return NULL;
485  if (type->str != NULL) {
486    const char *last_name = type->str;
487    const char *s;
488    for (s = type->str; *s; s++)
489      if (*s == '|') last_name = s+1;
490    return last_name;
491  }
492  else
493    return type->name;
494}
495
496/*
497   Set the clientdata field for a type
498*/
499SWIGRUNTIME void
500SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
501  swig_cast_info *cast = ti->cast;
502  /* if (ti->clientdata == clientdata) return; */
503  ti->clientdata = clientdata;
504
505  while (cast) {
506    if (!cast->converter) {
507      swig_type_info *tc = cast->type;
508      if (!tc->clientdata) {
509        SWIG_TypeClientData(tc, clientdata);
510      }
511    }
512    cast = cast->next;
513  }
514}
515SWIGRUNTIME void
516SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
517  SWIG_TypeClientData(ti, clientdata);
518  ti->owndata = 1;
519}
520
521/*
522  Search for a swig_type_info structure only by mangled name
523  Search is a O(log #types)
524
525  We start searching at module start, and finish searching when start == end.
526  Note: if start == end at the beginning of the function, we go all the way around
527  the circular list.
528*/
529SWIGRUNTIME swig_type_info *
530SWIG_MangledTypeQueryModule(swig_module_info *start,
531                            swig_module_info *end,
532                            const char *name) {
533  swig_module_info *iter = start;
534  do {
535    if (iter->size) {
536      size_t l = 0;
537      size_t r = iter->size - 1;
538      do {
539        /* since l+r >= 0, we can (>> 1) instead (/ 2) */
540        size_t i = (l + r) >> 1;
541        const char *iname = iter->types[i]->name;
542        if (iname) {
543          int compare = strcmp(name, iname);
544          if (compare == 0) {
545            return iter->types[i];
546          } else if (compare < 0) {
547            if (i) {
548              r = i - 1;
549            } else {
550              break;
551            }
552          } else if (compare > 0) {
553            l = i + 1;
554          }
555        } else {
556          break; /* should never happen */
557        }
558      } while (l <= r);
559    }
560    iter = iter->next;
561  } while (iter != end);
562  return 0;
563}
564
565/*
566  Search for a swig_type_info structure for either a mangled name or a human readable name.
567  It first searches the mangled names of the types, which is a O(log #types)
568  If a type is not found it then searches the human readable names, which is O(#types).
569
570  We start searching at module start, and finish searching when start == end.
571  Note: if start == end at the beginning of the function, we go all the way around
572  the circular list.
573*/
574SWIGRUNTIME swig_type_info *
575SWIG_TypeQueryModule(swig_module_info *start,
576                     swig_module_info *end,
577                     const char *name) {
578  /* STEP 1: Search the name field using binary search */
579  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
580  if (ret) {
581    return ret;
582  } else {
583    /* STEP 2: If the type hasn't been found, do a complete search
584       of the str field (the human readable name) */
585    swig_module_info *iter = start;
586    do {
587      size_t i = 0;
588      for (; i < iter->size; ++i) {
589        if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
590          return iter->types[i];
591      }
592      iter = iter->next;
593    } while (iter != end);
594  }
595
596  /* neither found a match */
597  return 0;
598}
599
600/*
601   Pack binary data into a string
602*/
603SWIGRUNTIME char *
604SWIG_PackData(char *c, void *ptr, size_t sz) {
605  static const char hex[17] = "0123456789abcdef";
606  const unsigned char *u = (unsigned char *) ptr;
607  const unsigned char *eu =  u + sz;
608  for (; u != eu; ++u) {
609    unsigned char uu = *u;
610    *(c++) = hex[(uu & 0xf0) >> 4];
611    *(c++) = hex[uu & 0xf];
612  }
613  return c;
614}
615
616/*
617   Unpack binary data from a string
618*/
619SWIGRUNTIME const char *
620SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
621  unsigned char *u = (unsigned char *) ptr;
622  const unsigned char *eu = u + sz;
623  for (; u != eu; ++u) {
624    char d = *(c++);
625    unsigned char uu;
626    if ((d >= '0') && (d <= '9'))
627      uu = ((d - '0') << 4);
628    else if ((d >= 'a') && (d <= 'f'))
629      uu = ((d - ('a'-10)) << 4);
630    else
631      return (char *) 0;
632    d = *(c++);
633    if ((d >= '0') && (d <= '9'))
634      uu |= (d - '0');
635    else if ((d >= 'a') && (d <= 'f'))
636      uu |= (d - ('a'-10));
637    else
638      return (char *) 0;
639    *u = uu;
640  }
641  return c;
642}
643
644/*
645   Pack 'void *' into a string buffer.
646*/
647SWIGRUNTIME char *
648SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
649  char *r = buff;
650  if ((2*sizeof(void *) + 2) > bsz) return 0;
651  *(r++) = '_';
652  r = SWIG_PackData(r,&ptr,sizeof(void *));
653  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
654  strcpy(r,name);
655  return buff;
656}
657
658SWIGRUNTIME const char *
659SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
660  if (*c != '_') {
661    if (strcmp(c,"NULL") == 0) {
662      *ptr = (void *) 0;
663      return name;
664    } else {
665      return 0;
666    }
667  }
668  return SWIG_UnpackData(++c,ptr,sizeof(void *));
669}
670
671SWIGRUNTIME char *
672SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
673  char *r = buff;
674  size_t lname = (name ? strlen(name) : 0);
675  if ((2*sz + 2 + lname) > bsz) return 0;
676  *(r++) = '_';
677  r = SWIG_PackData(r,ptr,sz);
678  if (lname) {
679    strncpy(r,name,lname+1);
680  } else {
681    *r = 0;
682  }
683  return buff;
684}
685
686SWIGRUNTIME const char *
687SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
688  if (*c != '_') {
689    if (strcmp(c,"NULL") == 0) {
690      memset(ptr,0,sz);
691      return name;
692    } else {
693      return 0;
694    }
695  }
696  return SWIG_UnpackData(++c,ptr,sz);
697}
698
699#ifdef __cplusplus
700}
701#endif
702
703/*  Errors in SWIG */
704#define  SWIG_UnknownError         -1
705#define  SWIG_IOError              -2
706#define  SWIG_RuntimeError         -3
707#define  SWIG_IndexError           -4
708#define  SWIG_TypeError            -5
709#define  SWIG_DivisionByZero       -6
710#define  SWIG_OverflowError        -7
711#define  SWIG_SyntaxError          -8
712#define  SWIG_ValueError           -9
713#define  SWIG_SystemError          -10
714#define  SWIG_AttributeError       -11
715#define  SWIG_MemoryError          -12
716#define  SWIG_NullReferenceError   -13
717
718
719
720/* -----------------------------------------------------------------------------
721 * error manipulation
722 * ----------------------------------------------------------------------------- */
723
724SWIGINTERN const char*
725SWIG_Tcl_ErrorType(int code) {
726  const char* type = 0;
727  switch(code) {
728  case SWIG_MemoryError:
729    type = "MemoryError";
730    break;
731  case SWIG_IOError:
732    type = "IOError";
733    break;
734  case SWIG_RuntimeError:
735    type = "RuntimeError";
736    break;
737  case SWIG_IndexError:
738    type = "IndexError";
739    break;
740  case SWIG_TypeError:
741    type = "TypeError";
742    break;
743  case SWIG_DivisionByZero:
744    type = "ZeroDivisionError";
745    break;
746  case SWIG_OverflowError:
747    type = "OverflowError";
748    break;
749  case SWIG_SyntaxError:
750    type = "SyntaxError";
751    break;
752  case SWIG_ValueError:
753    type = "ValueError";
754    break;
755  case SWIG_SystemError:
756    type = "SystemError";
757    break;
758  case SWIG_AttributeError:
759    type = "AttributeError";
760    break;
761  default:
762    type = "RuntimeError";
763  }
764  return type;
765}
766
767
768SWIGINTERN void
769SWIG_Tcl_SetErrorObj(Tcl_Interp *interp, const char *ctype, Tcl_Obj *obj)
770{
771  Tcl_ResetResult(interp);
772  Tcl_SetObjResult(interp, obj);
773  Tcl_SetErrorCode(interp, "SWIG", ctype, NULL);
774}
775
776SWIGINTERN void
777SWIG_Tcl_SetErrorMsg(Tcl_Interp *interp, const char *ctype, const char *mesg)
778{
779  Tcl_ResetResult(interp);
780  Tcl_SetErrorCode(interp, "SWIG", ctype, NULL);
781  Tcl_AppendResult(interp, ctype, " ", mesg, NULL);
782  /*
783  Tcl_AddErrorInfo(interp, ctype);
784  Tcl_AddErrorInfo(interp, " ");
785  Tcl_AddErrorInfo(interp, mesg);
786  */
787}
788
789SWIGINTERNINLINE void
790SWIG_Tcl_AddErrorMsg(Tcl_Interp *interp, const char* mesg)
791{
792  Tcl_AddErrorInfo(interp, mesg);
793}
794
795
796
797/* -----------------------------------------------------------------------------
798 * SWIG API. Portion that goes into the runtime
799 * ----------------------------------------------------------------------------- */
800#ifdef __cplusplus
801extern "C" {
802#endif
803
804/* -----------------------------------------------------------------------------
805 * Constant declarations
806 * ----------------------------------------------------------------------------- */
807
808/* Constant Types */
809#define SWIG_TCL_POINTER 4
810#define SWIG_TCL_BINARY  5
811
812/* Constant information structure */
813typedef struct swig_const_info {
814    int type;
815    char *name;
816    long lvalue;
817    double dvalue;
818    void   *pvalue;
819    swig_type_info **ptype;
820} swig_const_info;
821
822typedef int   (*swig_wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
823typedef int   (*swig_wrapper_func)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
824typedef char *(*swig_variable_func)(ClientData, Tcl_Interp *, char *, char *, int);
825typedef void  (*swig_delete_func)(ClientData);
826
827typedef struct swig_method {
828  const char     *name;
829  swig_wrapper   method;
830} swig_method;
831
832typedef struct swig_attribute {
833  const char     *name;
834  swig_wrapper   getmethod;
835  swig_wrapper   setmethod;
836} swig_attribute;
837
838typedef struct swig_class {
839  const char         *name;
840  swig_type_info   **type;
841  swig_wrapper       constructor;
842  void              (*destructor)(void *);
843  swig_method        *methods;
844  swig_attribute     *attributes;
845  struct swig_class **bases;
846  const char              **base_names;
847  swig_module_info   *module;
848  Tcl_HashTable       hashtable;
849} swig_class;
850
851typedef struct swig_instance {
852  Tcl_Obj       *thisptr;
853  void          *thisvalue;
854  swig_class   *classptr;
855  int            destroy;
856  Tcl_Command    cmdtok;
857} swig_instance;
858
859/* Structure for command table */
860typedef struct {
861  const char *name;
862  int       (*wrapper)(ClientData, Tcl_Interp *, int, Tcl_Obj *CONST []);
863  ClientData  clientdata;
864} swig_command_info;
865
866/* Structure for variable linking table */
867typedef struct {
868  const char *name;
869  void *addr;
870  char * (*get)(ClientData, Tcl_Interp *, char *, char *, int);
871  char * (*set)(ClientData, Tcl_Interp *, char *, char *, int);
872} swig_var_info;
873
874
875/* -----------------------------------------------------------------------------*
876 *  Install a constant object
877 * -----------------------------------------------------------------------------*/
878
879static Tcl_HashTable   swigconstTable;
880static int             swigconstTableinit = 0;
881
882SWIGINTERN void
883SWIG_Tcl_SetConstantObj(Tcl_Interp *interp, const char* name, Tcl_Obj *obj) {
884  int newobj;
885  Tcl_ObjSetVar2(interp,Tcl_NewStringObj(name,-1), NULL, obj, TCL_GLOBAL_ONLY);
886  Tcl_SetHashValue(Tcl_CreateHashEntry(&swigconstTable, name, &newobj), (ClientData) obj);
887}
888
889SWIGINTERN Tcl_Obj *
890SWIG_Tcl_GetConstantObj(const char *key) {
891  Tcl_HashEntry *entryPtr;
892  if (!swigconstTableinit) return 0;
893  entryPtr = Tcl_FindHashEntry(&swigconstTable, key);
894  if (entryPtr) {
895    return (Tcl_Obj *) Tcl_GetHashValue(entryPtr);
896  }
897  return 0;
898}
899
900#ifdef __cplusplus
901}
902#endif
903
904
905
906/* -----------------------------------------------------------------------------
907 * tclrun.swg
908 *
909 * This file contains the runtime support for Tcl modules and includes
910 * code for managing global variables and pointer type checking.
911 * ----------------------------------------------------------------------------- */
912
913/* Common SWIG API */
914
915/* for raw pointers */
916#define SWIG_ConvertPtr(oc, ptr, ty, flags)             SWIG_Tcl_ConvertPtr(interp, oc, ptr, ty, flags)
917#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Tcl_NewPointerObj(ptr, type, flags)
918
919/* for raw packed data */
920#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Tcl_ConvertPacked(interp, obj, ptr, sz, ty)
921#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Tcl_NewPackedObj(ptr, sz, type)
922
923/* for class or struct pointers */
924#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, flags)
925#define SWIG_NewInstanceObj(thisvalue, type, flags)     SWIG_Tcl_NewInstanceObj(interp, thisvalue, type, flags)
926
927/* for C or C++ function pointers */
928#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Tcl_ConvertPtr(interp, obj, pptr, type, 0)
929#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Tcl_NewPointerObj(ptr, type, 0)
930
931/* for C++ member pointers, ie, member methods */
932#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Tcl_ConvertPacked(interp,obj, ptr, sz, ty)
933#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Tcl_NewPackedObj(ptr, sz, type)
934
935
936/* Runtime API */
937
938#define SWIG_GetModule(clientdata)                      SWIG_Tcl_GetModule((Tcl_Interp *) (clientdata))     
939#define SWIG_SetModule(clientdata, pointer)             SWIG_Tcl_SetModule((Tcl_Interp *) (clientdata), pointer)
940
941
942/* Error manipulation */
943
944#define SWIG_ErrorType(code)                            SWIG_Tcl_ErrorType(code)                                     
945#define SWIG_Error(code, msg)                           SWIG_Tcl_SetErrorMsg(interp, SWIG_Tcl_ErrorType(code), msg)
946#define SWIG_fail                                       goto fail                                                   
947
948
949/* Tcl-specific SWIG API */
950
951#define SWIG_Acquire(ptr)                               SWIG_Tcl_Acquire(ptr)                                     
952#define SWIG_MethodCommand                              SWIG_Tcl_MethodCommand                                 
953#define SWIG_Disown(ptr)                                SWIG_Tcl_Disown(ptr)                                   
954#define SWIG_ConvertPtrFromString(c, ptr, ty, flags)    SWIG_Tcl_ConvertPtrFromString(interp, c, ptr, ty, flags) 
955#define SWIG_MakePtr(c, ptr, ty, flags)                 SWIG_Tcl_MakePtr(c, ptr, ty, flags)                   
956#define SWIG_PointerTypeFromString(c)                   SWIG_Tcl_PointerTypeFromString(c)                             
957#define SWIG_GetArgs                                    SWIG_Tcl_GetArgs                                               
958#define SWIG_GetConstantObj(key)                        SWIG_Tcl_GetConstantObj(key)                           
959#define SWIG_ObjectConstructor                          SWIG_Tcl_ObjectConstructor                                     
960#define SWIG_Thisown(ptr)                               SWIG_Tcl_Thisown(ptr)                                 
961#define SWIG_ObjectDelete                               SWIG_Tcl_ObjectDelete                                 
962
963
964#define SWIG_TCL_DECL_ARGS_2(arg1, arg2)                (Tcl_Interp *interp SWIGUNUSED, arg1, arg2)
965#define SWIG_TCL_CALL_ARGS_2(arg1, arg2)                (interp, arg1, arg2)
966/* -----------------------------------------------------------------------------
967 * pointers/data manipulation
968 * ----------------------------------------------------------------------------- */
969
970/* For backward compatibility only */
971#define SWIG_POINTER_EXCEPTION  0
972#define SWIG_GetConstant        SWIG_GetConstantObj
973#define SWIG_Tcl_GetConstant    SWIG_Tcl_GetConstantObj
974
975#include "assert.h"
976
977#ifdef __cplusplus
978extern "C" {
979#endif
980
981/* Object support */
982
983SWIGRUNTIME Tcl_HashTable*
984SWIG_Tcl_ObjectTable(void) {
985  static Tcl_HashTable  swigobjectTable;
986  static int            swigobjectTableinit = 0;
987  if (!swigobjectTableinit) {
988    Tcl_InitHashTable(&swigobjectTable, TCL_ONE_WORD_KEYS);
989    swigobjectTableinit = 1;
990  }
991  return &swigobjectTable;
992}
993
994/* Acquire ownership of a pointer */
995SWIGRUNTIME void
996SWIG_Tcl_Acquire(void *ptr) {
997  int newobj;
998  Tcl_CreateHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr, &newobj);
999}
1000
1001SWIGRUNTIME int
1002SWIG_Tcl_Thisown(void *ptr) {
1003  if (Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr)) {
1004    return 1;
1005  }
1006  return 0;
1007}
1008
1009/* Disown a pointer.  Returns 1 if we owned it to begin with */
1010SWIGRUNTIME int
1011SWIG_Tcl_Disown(void *ptr) {
1012  Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr);
1013  if (entryPtr) {
1014    Tcl_DeleteHashEntry(entryPtr);
1015    return 1;
1016  }
1017  return 0;
1018}
1019
1020/* Convert a pointer value */
1021SWIGRUNTIME int
1022SWIG_Tcl_ConvertPtrFromString(Tcl_Interp *interp, const char *c, void **ptr, swig_type_info *ty, int flags) {
1023  swig_cast_info *tc;
1024  /* Pointer values must start with leading underscore */
1025  while (*c != '_') {
1026    *ptr = (void *) 0;
1027    if (strcmp(c,"NULL") == 0) return SWIG_OK;
1028
1029    /* Empty string: not a pointer */
1030    if (*c == 0) return SWIG_ERROR; 
1031
1032    /* Hmmm. It could be an object name. */
1033
1034    /* Check if this is a command at all. Prevents <c> cget -this         */
1035    /* from being called when c is not a command, firing the unknown proc */
1036    if (Tcl_VarEval(interp,"info commands ", c, (char *) NULL) == TCL_OK) {
1037      Tcl_Obj *result = Tcl_GetObjResult(interp);
1038      if (*(Tcl_GetStringFromObj(result, NULL)) == 0) {
1039        /* It's not a command, so it can't be a pointer */
1040        Tcl_ResetResult(interp);
1041        return SWIG_ERROR;
1042      }
1043    } else {
1044      /* This will only fail if the argument is multiple words. */
1045      /* Multiple words are also not commands.                  */
1046      Tcl_ResetResult(interp);
1047      return SWIG_ERROR;
1048    }
1049
1050    /* Check if this is really a SWIG pointer */
1051    if (Tcl_VarEval(interp,c," cget -this", (char *) NULL) != TCL_OK) {
1052      Tcl_ResetResult(interp);
1053      return SWIG_ERROR;
1054    }
1055
1056    c = Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL);
1057  }
1058
1059  c++;
1060  c = SWIG_UnpackData(c,ptr,sizeof(void *));
1061  if (ty) {
1062    tc = c ? SWIG_TypeCheck(c,ty) : 0;
1063    if (!tc) {
1064      return SWIG_ERROR;
1065    }
1066    if (flags & SWIG_POINTER_DISOWN) {
1067      SWIG_Disown((void *) *ptr);
1068    }
1069    {
1070      int newmemory = 0;
1071      *ptr = SWIG_TypeCast(tc,(void *) *ptr,&newmemory);
1072      assert(!newmemory); /* newmemory handling not yet implemented */
1073    }
1074  }
1075  return SWIG_OK;
1076}
1077
1078/* Convert a pointer value */
1079SWIGRUNTIMEINLINE int
1080SWIG_Tcl_ConvertPtr(Tcl_Interp *interp, Tcl_Obj *oc, void **ptr, swig_type_info *ty, int flags) {
1081  return SWIG_Tcl_ConvertPtrFromString(interp, Tcl_GetStringFromObj(oc,NULL), ptr, ty, flags);
1082}
1083
1084/* Convert a pointer value */
1085SWIGRUNTIME char *
1086SWIG_Tcl_PointerTypeFromString(char *c) {
1087  char d;
1088  /* Pointer values must start with leading underscore. NULL has no type */
1089  if (*c != '_') {
1090    return 0;
1091  }
1092  c++;
1093  /* Extract hex value from pointer */
1094  while ((d = *c)) {
1095    if (!(((d >= '0') && (d <= '9')) || ((d >= 'a') && (d <= 'f')))) break;
1096    c++;
1097  }
1098  return c;
1099}
1100
1101/* Convert a packed value value */
1102SWIGRUNTIME int
1103SWIG_Tcl_ConvertPacked(Tcl_Interp *SWIGUNUSEDPARM(interp) , Tcl_Obj *obj, void *ptr, int sz, swig_type_info *ty) {
1104  swig_cast_info *tc;
1105  const char  *c;
1106
1107  if (!obj) goto type_error;
1108  c = Tcl_GetStringFromObj(obj,NULL);
1109  /* Pointer values must start with leading underscore */
1110  if (*c != '_') goto type_error;
1111  c++;
1112  c = SWIG_UnpackData(c,ptr,sz);
1113  if (ty) {
1114    tc = SWIG_TypeCheck(c,ty);
1115    if (!tc) goto type_error;
1116  }
1117  return SWIG_OK;
1118
1119 type_error:
1120
1121  return SWIG_ERROR;
1122}
1123
1124
1125/* Take a pointer and convert it to a string */
1126SWIGRUNTIME void
1127SWIG_Tcl_MakePtr(char *c, void *ptr, swig_type_info *ty, int flags) {
1128  if (ptr) {
1129    *(c++) = '_';
1130    c = SWIG_PackData(c,&ptr,sizeof(void *));
1131    strcpy(c,ty->name);
1132  } else {
1133    strcpy(c,(char *)"NULL");
1134  }
1135  flags = 0;
1136}
1137
1138/* Create a new pointer object */
1139SWIGRUNTIMEINLINE Tcl_Obj *
1140SWIG_Tcl_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
1141  Tcl_Obj *robj;
1142  char result[SWIG_BUFFER_SIZE];
1143  SWIG_MakePtr(result,ptr,type,flags);
1144  robj = Tcl_NewStringObj(result,-1);
1145  return robj;
1146}
1147
1148SWIGRUNTIME Tcl_Obj *
1149SWIG_Tcl_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1150  char result[1024];
1151  char *r = result;
1152  if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1153  *(r++) = '_';
1154  r = SWIG_PackData(r,ptr,sz);
1155  strcpy(r,type->name);
1156  return Tcl_NewStringObj(result,-1);
1157}
1158
1159/* -----------------------------------------------------------------------------*
1160 *  Get type list
1161 * -----------------------------------------------------------------------------*/
1162
1163SWIGRUNTIME swig_module_info * 
1164SWIG_Tcl_GetModule(Tcl_Interp *interp) {
1165  const char *data;
1166  swig_module_info *ret = 0;
1167 
1168  /* first check if pointer already created */
1169  data = Tcl_GetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, TCL_GLOBAL_ONLY);
1170  if (data) {
1171    SWIG_UnpackData(data, &ret, sizeof(swig_type_info **));
1172  }
1173
1174  return ret;
1175}
1176
1177SWIGRUNTIME void
1178SWIG_Tcl_SetModule(Tcl_Interp *interp, swig_module_info *module) {
1179  char buf[SWIG_BUFFER_SIZE];
1180  char *data;
1181
1182  /* create a new pointer */
1183  data = SWIG_PackData(buf, &module, sizeof(swig_type_info **));
1184  *data = 0;
1185  Tcl_SetVar(interp, (char *)"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, buf, TCL_GLOBAL_ONLY);
1186}
1187
1188/* -----------------------------------------------------------------------------*
1189 *  Object auxiliars
1190 * -----------------------------------------------------------------------------*/
1191
1192
1193SWIGRUNTIME void
1194SWIG_Tcl_ObjectDelete(ClientData clientData) {
1195  swig_instance *si = (swig_instance *) clientData;
1196  if ((si) && (si->destroy) && (SWIG_Disown(si->thisvalue))) {
1197    if (si->classptr->destructor) {
1198      (si->classptr->destructor)(si->thisvalue);
1199    }
1200  }
1201  Tcl_DecrRefCount(si->thisptr);
1202  free(si);
1203}
1204
1205/* Function to invoke object methods given an instance */
1206SWIGRUNTIME int
1207SWIG_Tcl_MethodCommand(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST _objv[]) {
1208  char *method,   *attrname;
1209  swig_instance   *inst = (swig_instance *) clientData;
1210  swig_method     *meth;
1211  swig_attribute  *attr;
1212  Tcl_Obj         *oldarg;
1213  Tcl_Obj         **objv;
1214  int              rcode;
1215  swig_class      *cls;
1216  swig_class      *cls_stack[64];
1217  int              cls_stack_bi[64];
1218  int              cls_stack_top = 0;
1219  int              numconf = 2;
1220  int              bi;
1221
1222  objv = (Tcl_Obj **) _objv;
1223  if (objc < 2) {
1224    Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
1225    return TCL_ERROR;
1226  }
1227  method = Tcl_GetStringFromObj(objv[1],NULL);
1228  if (strcmp(method,"-acquire") == 0) {
1229    inst->destroy = 1;
1230    SWIG_Acquire(inst->thisvalue);
1231    return TCL_OK;
1232  }
1233  if (strcmp(method,"-disown") == 0) {
1234    if (inst->destroy) {
1235      SWIG_Disown(inst->thisvalue);
1236    }
1237    inst->destroy = 0;
1238    return TCL_OK;
1239  }
1240  if (strcmp(method,"-delete") == 0) {
1241    Tcl_DeleteCommandFromToken(interp,inst->cmdtok);
1242    return TCL_OK;
1243  }
1244  cls_stack[cls_stack_top] = inst->classptr;
1245  cls_stack_bi[cls_stack_top] = -1;
1246  cls = inst->classptr;
1247  while (1) {
1248    Tcl_HashEntry* hashentry;
1249    bi = cls_stack_bi[cls_stack_top];
1250    cls = cls_stack[cls_stack_top];
1251    if (bi != -1) {
1252      if (!cls->bases[bi] && cls->base_names[bi]) {
1253        /* lookup and cache the base class */
1254        swig_type_info *info = SWIG_TypeQueryModule(cls->module, cls->module, cls->base_names[bi]);
1255        if (info) cls->bases[bi] = (swig_class *) info->clientdata;
1256      }
1257      cls = cls->bases[bi];
1258      if (cls) {
1259        cls_stack_bi[cls_stack_top]++;
1260        cls_stack_top++;
1261        cls_stack[cls_stack_top] = cls;
1262        cls_stack_bi[cls_stack_top] = -1;
1263        continue;
1264      }
1265    }
1266    if (!cls) {
1267      cls_stack_top--;
1268      if (cls_stack_top < 0) break;
1269      else continue;
1270    }
1271    cls_stack_bi[cls_stack_top]++;
1272
1273    hashentry = Tcl_FindHashEntry(&(cls->hashtable), method);
1274    if (hashentry) {
1275        ClientData cd = Tcl_GetHashValue(hashentry);
1276        swig_wrapper method_wrapper = (swig_wrapper)cd;
1277        oldarg = objv[1];
1278        objv[1] = inst->thisptr;
1279        Tcl_IncrRefCount(inst->thisptr);
1280        rcode = (method_wrapper)(clientData,interp,objc,objv);
1281        objv[1] = oldarg;
1282        Tcl_DecrRefCount(inst->thisptr);
1283        return rcode;
1284    }
1285    /* Check class methods for a match */
1286    if (strcmp(method,"cget") == 0) {
1287      if (objc < 3) {
1288        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
1289        return TCL_ERROR;
1290      }
1291      attrname = Tcl_GetStringFromObj(objv[2],NULL);
1292      attr = cls->attributes;
1293      while (attr && attr->name) {
1294        if ((strcmp(attr->name, attrname) == 0) && (attr->getmethod)) {
1295          oldarg = objv[1];
1296          objv[1] = inst->thisptr;
1297          Tcl_IncrRefCount(inst->thisptr);
1298          rcode = (*attr->getmethod)(clientData,interp,2, objv);
1299          objv[1] = oldarg;
1300          Tcl_DecrRefCount(inst->thisptr);
1301          return rcode;
1302        }
1303        attr++;
1304      }
1305      if (strcmp(attrname, "-this") == 0) {
1306        Tcl_SetObjResult(interp, Tcl_DuplicateObj(inst->thisptr));
1307        return TCL_OK;
1308      }
1309      if (strcmp(attrname, "-thisown") == 0) {
1310        if (SWIG_Thisown(inst->thisvalue)) {
1311          Tcl_SetResult(interp,(char*)"1",TCL_STATIC);
1312        } else {
1313          Tcl_SetResult(interp,(char*)"0",TCL_STATIC);
1314        }
1315        return TCL_OK;
1316      }
1317    } else if (strcmp(method, "configure") == 0) {
1318      int i;
1319      if (objc < 4) {
1320        Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
1321        return TCL_ERROR;
1322      }
1323      i = 2;
1324      while (i < objc) {
1325        attrname = Tcl_GetStringFromObj(objv[i],NULL);
1326        attr = cls->attributes;
1327        while (attr && attr->name) {
1328          if ((strcmp(attr->name, attrname) == 0) && (attr->setmethod)) {
1329            oldarg = objv[i];
1330            objv[i] = inst->thisptr;
1331            Tcl_IncrRefCount(inst->thisptr);
1332            rcode = (*attr->setmethod)(clientData,interp,3, &objv[i-1]);
1333            objv[i] = oldarg;
1334            Tcl_DecrRefCount(inst->thisptr);
1335            if (rcode != TCL_OK) return rcode;
1336            numconf += 2;
1337          }
1338          attr++;
1339        }
1340        i+=2;
1341      }
1342    }
1343  }
1344  if (strcmp(method,"configure") == 0) {
1345    if (numconf >= objc) {
1346      return TCL_OK;
1347    } else {
1348      Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC);
1349      return TCL_ERROR;
1350    }
1351  }
1352  if (strcmp(method,"cget") == 0) {
1353    Tcl_SetResult(interp,(char *) "Invalid attribute name.", TCL_STATIC);
1354    return TCL_ERROR;
1355  }
1356  Tcl_SetResult(interp, (char *) "Invalid method. Must be one of: configure cget -acquire -disown -delete", TCL_STATIC);
1357  cls = inst->classptr;
1358  bi = 0;
1359  while (cls) {
1360    meth = cls->methods;
1361    while (meth && meth->name) {
1362      char *cr = (char *) Tcl_GetStringResult(interp);
1363      size_t meth_len = strlen(meth->name);
1364      char* where = strchr(cr,':');
1365      while(where) {
1366        where = strstr(where, meth->name);
1367        if(where) {
1368          if(where[-1] == ' ' && (where[meth_len] == ' ' || where[meth_len]==0)) {
1369            break;
1370          } else {
1371            where++;
1372          }
1373        }
1374      }
1375
1376      if (!where)
1377        Tcl_AppendElement(interp, (char *) meth->name);
1378      meth++;
1379    }
1380    cls = inst->classptr->bases[bi++];
1381  }
1382  return TCL_ERROR;
1383}
1384
1385/* This function takes the current result and turns it into an object command */
1386SWIGRUNTIME Tcl_Obj *
1387SWIG_Tcl_NewInstanceObj(Tcl_Interp *interp, void *thisvalue, swig_type_info *type, int flags) {
1388  Tcl_Obj *robj = SWIG_NewPointerObj(thisvalue, type,0);
1389  /* Check to see if this pointer belongs to a class or not */
1390  if (thisvalue && (type->clientdata) && (interp)) {
1391    Tcl_CmdInfo    ci;
1392    char          *name;
1393    name = Tcl_GetStringFromObj(robj,NULL);
1394    if (!Tcl_GetCommandInfo(interp,name, &ci) || (flags)) {
1395      swig_instance *newinst = (swig_instance *) malloc(sizeof(swig_instance));
1396      newinst->thisptr = Tcl_DuplicateObj(robj);
1397      Tcl_IncrRefCount(newinst->thisptr);
1398      newinst->thisvalue = thisvalue;
1399      newinst->classptr = (swig_class *) type->clientdata;
1400      newinst->destroy = flags;
1401      newinst->cmdtok = Tcl_CreateObjCommand(interp, Tcl_GetStringFromObj(robj,NULL), (swig_wrapper_func) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete);
1402      if (flags) {
1403        SWIG_Acquire(thisvalue);
1404      }
1405    }
1406  }
1407  return robj;
1408}
1409
1410/* Function to create objects */
1411SWIGRUNTIME int
1412SWIG_Tcl_ObjectConstructor(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1413  Tcl_Obj          *newObj = 0;
1414  void             *thisvalue = 0;
1415  swig_instance   *newinst = 0;
1416  swig_class      *classptr = (swig_class *) clientData;
1417  swig_wrapper     cons = 0;
1418  char             *name = 0;
1419  int               firstarg = 0;
1420  int               thisarg = 0;
1421  int               destroy = 1;
1422
1423  if (!classptr) {
1424    Tcl_SetResult(interp, (char *) "swig: internal runtime error. No class object defined.", TCL_STATIC);
1425    return TCL_ERROR;
1426  }
1427  cons = classptr->constructor;
1428  if (objc > 1) {
1429    char *s = Tcl_GetStringFromObj(objv[1],NULL);
1430    if (strcmp(s,"-this") == 0) {
1431      thisarg = 2;
1432      cons = 0;
1433    } else if (strcmp(s,"-args") == 0) {
1434      firstarg = 1;
1435    } else if (objc == 2) {
1436      firstarg = 1;
1437      name = s;
1438    } else if (objc >= 3) {
1439      char *s1;
1440      name = s;
1441      s1 = Tcl_GetStringFromObj(objv[2],NULL);
1442      if (strcmp(s1,"-this") == 0) {
1443        thisarg = 3;
1444        cons = 0;
1445      } else {
1446        firstarg = 1;
1447      }
1448    }
1449  }
1450  if (cons) {
1451    int result;
1452    result = (*cons)(0, interp, objc-firstarg, &objv[firstarg]);
1453    if (result != TCL_OK) {
1454      return result;
1455    }
1456    newObj = Tcl_DuplicateObj(Tcl_GetObjResult(interp));
1457    if (!name) name = Tcl_GetStringFromObj(newObj,NULL);
1458  } else if (thisarg > 0) {
1459    if (thisarg < objc) {
1460      destroy = 0;
1461      newObj = Tcl_DuplicateObj(objv[thisarg]);
1462      if (!name) name = Tcl_GetStringFromObj(newObj,NULL);
1463    } else {
1464      Tcl_SetResult(interp, (char *) "wrong # args.", TCL_STATIC);
1465      return TCL_ERROR;
1466    }
1467  } else {
1468    Tcl_SetResult(interp, (char *) "No constructor available.", TCL_STATIC);
1469    return TCL_ERROR;
1470  }
1471  if (SWIG_Tcl_ConvertPtr(interp,newObj, (void **) &thisvalue, *(classptr->type), 0) != SWIG_OK) {
1472    Tcl_DecrRefCount(newObj);
1473    return TCL_ERROR;
1474  }
1475  newinst = (swig_instance *) malloc(sizeof(swig_instance));
1476  newinst->thisptr = newObj;
1477  Tcl_IncrRefCount(newObj);
1478  newinst->thisvalue = thisvalue;
1479  newinst->classptr = classptr;
1480  newinst->destroy = destroy;
1481  if (destroy) {
1482    SWIG_Acquire(thisvalue);
1483  }
1484  newinst->cmdtok = Tcl_CreateObjCommand(interp,name, (swig_wrapper) SWIG_MethodCommand, (ClientData) newinst, (swig_delete_func) SWIG_ObjectDelete);
1485  return TCL_OK;
1486}
1487
1488/* -----------------------------------------------------------------------------*
1489 *   Get arguments
1490 * -----------------------------------------------------------------------------*/
1491SWIGRUNTIME int
1492SWIG_Tcl_GetArgs(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], const char *fmt, ...) {
1493  int        argno = 0, opt = 0;
1494  long       tempi;
1495  double     tempd;
1496  const char *c;
1497  va_list    ap;
1498  void      *vptr;
1499  Tcl_Obj   *obj = 0;
1500  swig_type_info *ty;
1501
1502  va_start(ap,fmt);
1503  for (c = fmt; (*c && (*c != ':') && (*c != ';')); c++,argno++) {
1504    if (*c == '|') {
1505      opt = 1;
1506      c++;
1507    }
1508    if (argno >= (objc-1)) {
1509      if (!opt) {
1510        Tcl_SetResult(interp, (char *) "Wrong number of arguments ", TCL_STATIC);
1511        goto argerror;
1512      } else {
1513        va_end(ap);
1514        return TCL_OK;
1515      }
1516    }
1517
1518    vptr = va_arg(ap,void *);
1519    if (vptr) {
1520      if (isupper(*c)) {
1521        obj = SWIG_Tcl_GetConstantObj(Tcl_GetStringFromObj(objv[argno+1],0));
1522        if (!obj) obj = objv[argno+1];
1523      } else {
1524        obj = objv[argno+1];
1525      }
1526      switch(*c) {
1527      case 'i': case 'I':
1528      case 'l': case 'L':
1529      case 'h': case 'H':
1530      case 'b': case 'B':
1531        if (Tcl_GetLongFromObj(interp,obj,&tempi) != TCL_OK) goto argerror;
1532        if ((*c == 'i') || (*c == 'I')) *((int *)vptr) = (int)tempi;
1533        else if ((*c == 'l') || (*c == 'L')) *((long *)vptr) = (long)tempi;
1534        else if ((*c == 'h') || (*c == 'H')) *((short*)vptr) = (short)tempi;
1535        else if ((*c == 'b') || (*c == 'B')) *((unsigned char *)vptr) = (unsigned char)tempi;
1536        break;
1537      case 'f': case 'F':
1538      case 'd': case 'D':
1539        if (Tcl_GetDoubleFromObj(interp,obj,&tempd) != TCL_OK) goto argerror;
1540        if ((*c == 'f') || (*c == 'F')) *((float *) vptr) = (float)tempd;
1541        else if ((*c == 'd') || (*c == 'D')) *((double*) vptr) = tempd;
1542        break;
1543      case 's': case 'S':
1544        if (*(c+1) == '#') {
1545          int *vlptr = (int *) va_arg(ap, void *);
1546          *((char **) vptr) = Tcl_GetStringFromObj(obj, vlptr);
1547          c++;
1548        } else {
1549          *((char **)vptr) = Tcl_GetStringFromObj(obj,NULL);
1550        }
1551        break;
1552      case 'c': case 'C':
1553        *((char *)vptr) = *(Tcl_GetStringFromObj(obj,NULL));
1554        break;
1555      case 'p': case 'P':
1556        ty = (swig_type_info *) va_arg(ap, void *);
1557        if (SWIG_Tcl_ConvertPtr(interp, obj, (void **) vptr, ty, 0) != SWIG_OK) goto argerror;
1558        break;
1559      case 'o': case 'O':
1560        *((Tcl_Obj **)vptr) = objv[argno+1];
1561        break;
1562      default:
1563        break;
1564      }
1565    }
1566  }
1567
1568  if ((*c != ';') && ((objc-1) > argno)) {
1569    Tcl_SetResult(interp, (char *) "Wrong # args.", TCL_STATIC);
1570    goto argerror;
1571  }
1572  va_end(ap);
1573  return TCL_OK;
1574
1575 argerror:
1576  {
1577    char temp[32];
1578    sprintf(temp,"%d", argno+1);
1579    c = strchr(fmt,':');
1580    if (!c) c = strchr(fmt,';');
1581    if (!c) c = (char *)"";
1582    Tcl_AppendResult(interp,c," argument ", temp, NULL);
1583    va_end(ap);
1584    return TCL_ERROR;
1585  }
1586}
1587
1588#ifdef __cplusplus
1589}
1590#endif
1591
1592
1593
1594#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1595
1596#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1597
1598
1599
1600/* -------- TYPES TABLE (BEGIN) -------- */
1601
1602#define SWIGTYPE_p_char swig_types[0]
1603#define SWIGTYPE_p_int swig_types[1]
1604#define SWIGTYPE_p_macho swig_types[2]
1605#define SWIGTYPE_p_macho_arch swig_types[3]
1606#define SWIGTYPE_p_macho_handle swig_types[4]
1607#define SWIGTYPE_p_macho_loadcmd swig_types[5]
1608#define SWIGTYPE_p_p_macho swig_types[6]
1609#define SWIGTYPE_p_unsigned_int swig_types[7]
1610static swig_type_info *swig_types[9];
1611static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
1612#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1613#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1614
1615/* -------- TYPES TABLE (END) -------- */
1616
1617#define SWIG_init    Machista_Init
1618#define SWIG_name    "machista"
1619#define SWIG_prefix  "machista::"
1620#define SWIG_namespace "machista"
1621
1622#define SWIG_version "1.0"
1623
1624#define SWIGVERSION 0x030005
1625#define SWIG_VERSION SWIGVERSION
1626
1627
1628#define SWIG_as_voidptr(a) (void *)((const void *)(a))
1629#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1630
1631
1632
1633#ifdef __cplusplus
1634extern "C" {
1635#endif
1636#ifdef MAC_TCL
1637#pragma export on
1638#endif
1639SWIGEXPORT int SWIG_init(Tcl_Interp *);
1640#ifdef MAC_TCL
1641#pragma export off
1642#endif
1643#ifdef __cplusplus
1644}
1645#endif
1646
1647/* Compatibility version for TCL stubs */
1648#ifndef SWIG_TCL_STUBS_VERSION
1649#define SWIG_TCL_STUBS_VERSION "8.1"
1650#endif
1651
1652
1653
1654#include <tcl.h>
1655#include "libmachista.h"
1656
1657
1658#ifdef __MACH__
1659    #include <mach-o/arch.h>
1660#endif
1661    #include <inttypes.h>
1662    #include <stdint.h>
1663
1664
1665#include <limits.h>
1666#if !defined(SWIG_NO_LLONG_MAX)
1667# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1668#   define LLONG_MAX __LONG_LONG_MAX__
1669#   define LLONG_MIN (-LLONG_MAX - 1LL)
1670#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1671# endif
1672#endif
1673
1674
1675SWIGINTERNINLINE Tcl_Obj* 
1676SWIG_From_long  (long value)
1677{
1678  if (((long) INT_MIN <= value) && (value <= (long) INT_MAX)) {
1679    return Tcl_NewIntObj((int)(value));
1680  } else {
1681    return Tcl_NewLongObj(value);
1682  }
1683}
1684
1685
1686SWIGINTERNINLINE Tcl_Obj *
1687SWIG_From_int  (int value)
1688{   
1689  return SWIG_From_long  (value);
1690}
1691
1692
1693SWIGINTERNINLINE Tcl_Obj *
1694SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1695{
1696  return (size < INT_MAX) ? Tcl_NewStringObj(carray, (int)(size)) : NULL;
1697}
1698
1699
1700SWIGINTERNINLINE Tcl_Obj * 
1701SWIG_FromCharPtr(const char *cptr)
1702{ 
1703  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1704}
1705
1706
1707#include <stdio.h>
1708#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
1709# ifndef snprintf
1710#  define snprintf _snprintf
1711# endif
1712#endif
1713
1714
1715SWIGINTERNINLINE Tcl_Obj* 
1716SWIG_From_unsigned_SS_long  (unsigned long value)
1717{
1718  if (value < (unsigned long) LONG_MAX) {
1719    return SWIG_From_long  ((long)(value));
1720  } else {
1721    char temp[256]; 
1722    sprintf(temp, "%lu", value);
1723    return Tcl_NewStringObj(temp,-1);
1724  }
1725}
1726
1727
1728SWIGINTERNINLINE Tcl_Obj *
1729SWIG_From_unsigned_SS_int  (unsigned int value)
1730{   
1731  return SWIG_From_unsigned_SS_long  (value);
1732}
1733
1734
1735SWIGINTERN int
1736SWIG_AsCharPtrAndSize(Tcl_Obj *obj, char** cptr, size_t* psize, int *alloc)
1737{ 
1738  int len = 0;
1739  char *cstr = Tcl_GetStringFromObj(obj, &len);
1740  if (cstr) {
1741    if (cptr)  *cptr = cstr;
1742    if (psize) *psize = len + 1;
1743    if (alloc) *alloc = SWIG_OLDOBJ;
1744    return SWIG_OK;
1745  }
1746  return SWIG_TypeError;
1747}
1748
1749
1750
1751
1752
1753SWIGINTERN int
1754SWIG_AsVal_long SWIG_TCL_DECL_ARGS_2(Tcl_Obj *obj, long* val)
1755{
1756  long v;
1757  if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) {
1758    if (val) *val = (long) v;
1759    return SWIG_OK;
1760  }
1761  return SWIG_TypeError;
1762}
1763
1764
1765SWIGINTERN int
1766SWIG_AsVal_int SWIG_TCL_DECL_ARGS_2(Tcl_Obj * obj, int *val)
1767{
1768  long v;
1769  int res = SWIG_AsVal_long SWIG_TCL_CALL_ARGS_2(obj, &v);
1770  if (SWIG_IsOK(res)) {
1771    if ((v < INT_MIN || v > INT_MAX)) {
1772      return SWIG_OverflowError;
1773    } else {
1774      if (val) *val = (int)(v);
1775    }
1776  } 
1777  return res;
1778}
1779
1780
1781SWIGINTERN int
1782SWIG_AsVal_unsigned_SS_long SWIG_TCL_DECL_ARGS_2(Tcl_Obj *obj, unsigned long *val) {
1783  long v;
1784  if (Tcl_GetLongFromObj(0,obj, &v) == TCL_OK) {
1785    if (v >= 0) {
1786      if (val) *val = (unsigned long) v;
1787      return SWIG_OK;
1788    }
1789    /* If v is negative, then this could be a negative number, or an
1790       unsigned value which doesn't fit in a signed long, so try to
1791       get it as a string so we can distinguish these cases. */
1792  }
1793  {
1794    int len = 0;
1795    const char *nptr = Tcl_GetStringFromObj(obj, &len);
1796    if (nptr && len > 0) {
1797      char *endptr;
1798      unsigned long v;
1799      if (*nptr == '-') return SWIG_OverflowError;
1800      errno = 0;
1801      v = strtoul(nptr, &endptr,0);
1802      if (nptr[0] == '\0' || *endptr != '\0')
1803        return SWIG_TypeError;
1804      if (v == ULONG_MAX && errno == ERANGE) {
1805        errno = 0;
1806        return SWIG_OverflowError;
1807      } else {
1808        if (*endptr == '\0') {
1809          if (val) *val = v;
1810          return SWIG_OK;
1811        }
1812      }
1813    }
1814  }
1815 
1816  return SWIG_TypeError;
1817}
1818
1819
1820SWIGINTERN int
1821SWIG_AsVal_unsigned_SS_int SWIG_TCL_DECL_ARGS_2(Tcl_Obj * obj, unsigned int *val)
1822{
1823  unsigned long v;
1824  int res = SWIG_AsVal_unsigned_SS_long SWIG_TCL_CALL_ARGS_2(obj, &v);
1825  if (SWIG_IsOK(res)) {
1826    if ((v > UINT_MAX)) {
1827      return SWIG_OverflowError;
1828    } else {
1829      if (val) *val = (unsigned int)(v);
1830    }
1831  } 
1832  return res;
1833}
1834
1835#ifdef __cplusplus
1836extern "C" {
1837#endif
1838static swig_method swig_macho_handle_methods[] = {
1839    {0,0}
1840};
1841static swig_attribute swig_macho_handle_attributes[] = {
1842    {0,0,0}
1843};
1844static swig_class *swig_macho_handle_bases[] = {0};
1845static const char * swig_macho_handle_base_names[] = {0};
1846static swig_class _wrap_class_macho_handle = { "macho_handle", &SWIGTYPE_p_macho_handle,0,0, swig_macho_handle_methods, swig_macho_handle_attributes, swig_macho_handle_bases,swig_macho_handle_base_names, &swig_module };
1847SWIGINTERN int
1848_wrap_macho_loadcmd_mlt_install_name_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1849  struct macho_loadcmd *arg1 = (struct macho_loadcmd *) 0 ;
1850  void *argp1 = 0 ;
1851  int res1 = 0 ;
1852  char *result = 0 ;
1853 
1854  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_loadcmd_mlt_install_name_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1855  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_loadcmd, 0 |  0 );
1856  if (!SWIG_IsOK(res1)) {
1857    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_loadcmd_mlt_install_name_get" "', argument " "1"" of type '" "struct macho_loadcmd *""'"); 
1858  }
1859  arg1 = (struct macho_loadcmd *)(argp1);
1860  result = (char *) ((arg1)->mlt_install_name);
1861  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
1862  return TCL_OK;
1863fail:
1864  return TCL_ERROR;
1865}
1866
1867
1868SWIGINTERN int
1869_wrap_macho_loadcmd_mlt_type_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1870  struct macho_loadcmd *arg1 = (struct macho_loadcmd *) 0 ;
1871  void *argp1 = 0 ;
1872  int res1 = 0 ;
1873  uint32_t result;
1874 
1875  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_loadcmd_mlt_type_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1876  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_loadcmd, 0 |  0 );
1877  if (!SWIG_IsOK(res1)) {
1878    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_loadcmd_mlt_type_get" "', argument " "1"" of type '" "struct macho_loadcmd *""'"); 
1879  }
1880  arg1 = (struct macho_loadcmd *)(argp1);
1881  result = (uint32_t) ((arg1)->mlt_type);
1882  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int((unsigned int)(result)));
1883  return TCL_OK;
1884fail:
1885  return TCL_ERROR;
1886}
1887
1888
1889SWIGINTERN int
1890_wrap_macho_loadcmd_mlt_comp_version_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1891  struct macho_loadcmd *arg1 = (struct macho_loadcmd *) 0 ;
1892  void *argp1 = 0 ;
1893  int res1 = 0 ;
1894  uint32_t result;
1895 
1896  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_loadcmd_mlt_comp_version_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1897  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_loadcmd, 0 |  0 );
1898  if (!SWIG_IsOK(res1)) {
1899    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_loadcmd_mlt_comp_version_get" "', argument " "1"" of type '" "struct macho_loadcmd *""'"); 
1900  }
1901  arg1 = (struct macho_loadcmd *)(argp1);
1902  result = (uint32_t) ((arg1)->mlt_comp_version);
1903  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int((unsigned int)(result)));
1904  return TCL_OK;
1905fail:
1906  return TCL_ERROR;
1907}
1908
1909
1910SWIGINTERN int
1911_wrap_macho_loadcmd_mlt_version_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1912  struct macho_loadcmd *arg1 = (struct macho_loadcmd *) 0 ;
1913  void *argp1 = 0 ;
1914  int res1 = 0 ;
1915  uint32_t result;
1916 
1917  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_loadcmd_mlt_version_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1918  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_loadcmd, 0 |  0 );
1919  if (!SWIG_IsOK(res1)) {
1920    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_loadcmd_mlt_version_get" "', argument " "1"" of type '" "struct macho_loadcmd *""'"); 
1921  }
1922  arg1 = (struct macho_loadcmd *)(argp1);
1923  result = (uint32_t) ((arg1)->mlt_version);
1924  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int((unsigned int)(result)));
1925  return TCL_OK;
1926fail:
1927  return TCL_ERROR;
1928}
1929
1930
1931SWIGINTERN int
1932_wrap_macho_loadcmd_next_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1933  struct macho_loadcmd *arg1 = (struct macho_loadcmd *) 0 ;
1934  void *argp1 = 0 ;
1935  int res1 = 0 ;
1936  struct macho_loadcmd *result = 0 ;
1937 
1938  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_loadcmd_next_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1939  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_loadcmd, 0 |  0 );
1940  if (!SWIG_IsOK(res1)) {
1941    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_loadcmd_next_get" "', argument " "1"" of type '" "struct macho_loadcmd *""'"); 
1942  }
1943  arg1 = (struct macho_loadcmd *)(argp1);
1944  result = (struct macho_loadcmd *) ((arg1)->next);
1945  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_macho_loadcmd,0));
1946  return TCL_OK;
1947fail:
1948  return TCL_ERROR;
1949}
1950
1951
1952static swig_method swig_macho_loadcmd_methods[] = {
1953    {0,0}
1954};
1955static swig_attribute swig_macho_loadcmd_attributes[] = {
1956    { "-mlt_install_name",_wrap_macho_loadcmd_mlt_install_name_get, 0 },
1957    { "-mlt_type",_wrap_macho_loadcmd_mlt_type_get, 0 },
1958    { "-mlt_comp_version",_wrap_macho_loadcmd_mlt_comp_version_get, 0 },
1959    { "-mlt_version",_wrap_macho_loadcmd_mlt_version_get, 0 },
1960    { "-next",_wrap_macho_loadcmd_next_get, 0 },
1961    {0,0,0}
1962};
1963static swig_class *swig_macho_loadcmd_bases[] = {0};
1964static const char * swig_macho_loadcmd_base_names[] = {0};
1965static swig_class _wrap_class_macho_loadcmd = { "macho_loadcmd", &SWIGTYPE_p_macho_loadcmd,0,0, swig_macho_loadcmd_methods, swig_macho_loadcmd_attributes, swig_macho_loadcmd_bases,swig_macho_loadcmd_base_names, &swig_module };
1966SWIGINTERN int
1967_wrap_macho_arch_mat_install_name_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1968  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
1969  void *argp1 = 0 ;
1970  int res1 = 0 ;
1971  char *result = 0 ;
1972 
1973  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_mat_install_name_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1974  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
1975  if (!SWIG_IsOK(res1)) {
1976    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_mat_install_name_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
1977  }
1978  arg1 = (struct macho_arch *)(argp1);
1979  result = (char *) ((arg1)->mat_install_name);
1980  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
1981  return TCL_OK;
1982fail:
1983  return TCL_ERROR;
1984}
1985
1986
1987SWIGINTERN int
1988_wrap_macho_arch_mat_rpath_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
1989  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
1990  void *argp1 = 0 ;
1991  int res1 = 0 ;
1992  char *result = 0 ;
1993 
1994  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_mat_rpath_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
1995  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
1996  if (!SWIG_IsOK(res1)) {
1997    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_mat_rpath_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
1998  }
1999  arg1 = (struct macho_arch *)(argp1);
2000  result = (char *) ((arg1)->mat_rpath);
2001  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
2002  return TCL_OK;
2003fail:
2004  return TCL_ERROR;
2005}
2006
2007
2008SWIGINTERN int
2009_wrap_macho_arch_mat_arch_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2010  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
2011  void *argp1 = 0 ;
2012  int res1 = 0 ;
2013  cpu_type_t result;
2014 
2015  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_mat_arch_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
2016  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
2017  if (!SWIG_IsOK(res1)) {
2018    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_mat_arch_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
2019  }
2020  arg1 = (struct macho_arch *)(argp1);
2021  result = (cpu_type_t) ((arg1)->mat_arch);
2022  Tcl_SetObjResult(interp,SWIG_From_int((int)(result)));
2023  return TCL_OK;
2024fail:
2025  return TCL_ERROR;
2026}
2027
2028
2029SWIGINTERN int
2030_wrap_macho_arch_mat_comp_version_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2031  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
2032  void *argp1 = 0 ;
2033  int res1 = 0 ;
2034  uint32_t result;
2035 
2036  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_mat_comp_version_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
2037  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
2038  if (!SWIG_IsOK(res1)) {
2039    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_mat_comp_version_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
2040  }
2041  arg1 = (struct macho_arch *)(argp1);
2042  result = (uint32_t) ((arg1)->mat_comp_version);
2043  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int((unsigned int)(result)));
2044  return TCL_OK;
2045fail:
2046  return TCL_ERROR;
2047}
2048
2049
2050SWIGINTERN int
2051_wrap_macho_arch_mat_version_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2052  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
2053  void *argp1 = 0 ;
2054  int res1 = 0 ;
2055  uint32_t result;
2056 
2057  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_mat_version_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
2058  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
2059  if (!SWIG_IsOK(res1)) {
2060    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_mat_version_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
2061  }
2062  arg1 = (struct macho_arch *)(argp1);
2063  result = (uint32_t) ((arg1)->mat_version);
2064  Tcl_SetObjResult(interp,SWIG_From_unsigned_SS_int((unsigned int)(result)));
2065  return TCL_OK;
2066fail:
2067  return TCL_ERROR;
2068}
2069
2070
2071SWIGINTERN int
2072_wrap_macho_arch_mat_loadcmds_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2073  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
2074  void *argp1 = 0 ;
2075  int res1 = 0 ;
2076  struct macho_loadcmd *result = 0 ;
2077 
2078  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_mat_loadcmds_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
2079  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
2080  if (!SWIG_IsOK(res1)) {
2081    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_mat_loadcmds_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
2082  }
2083  arg1 = (struct macho_arch *)(argp1);
2084  result = (struct macho_loadcmd *) ((arg1)->mat_loadcmds);
2085  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_macho_loadcmd,0));
2086  return TCL_OK;
2087fail:
2088  return TCL_ERROR;
2089}
2090
2091
2092SWIGINTERN int
2093_wrap_macho_arch_next_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2094  struct macho_arch *arg1 = (struct macho_arch *) 0 ;
2095  void *argp1 = 0 ;
2096  int res1 = 0 ;
2097  struct macho_arch *result = 0 ;
2098 
2099  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_arch_next_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
2100  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_arch, 0 |  0 );
2101  if (!SWIG_IsOK(res1)) {
2102    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_arch_next_get" "', argument " "1"" of type '" "struct macho_arch *""'"); 
2103  }
2104  arg1 = (struct macho_arch *)(argp1);
2105  result = (struct macho_arch *) ((arg1)->next);
2106  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_macho_arch,0));
2107  return TCL_OK;
2108fail:
2109  return TCL_ERROR;
2110}
2111
2112
2113static swig_method swig_macho_arch_methods[] = {
2114    {0,0}
2115};
2116static swig_attribute swig_macho_arch_attributes[] = {
2117    { "-mat_install_name",_wrap_macho_arch_mat_install_name_get, 0 },
2118    { "-mat_rpath",_wrap_macho_arch_mat_rpath_get, 0 },
2119    { "-mat_arch",_wrap_macho_arch_mat_arch_get, 0 },
2120    { "-mat_comp_version",_wrap_macho_arch_mat_comp_version_get, 0 },
2121    { "-mat_version",_wrap_macho_arch_mat_version_get, 0 },
2122    { "-mat_loadcmds",_wrap_macho_arch_mat_loadcmds_get, 0 },
2123    { "-next",_wrap_macho_arch_next_get, 0 },
2124    {0,0,0}
2125};
2126static swig_class *swig_macho_arch_bases[] = {0};
2127static const char * swig_macho_arch_base_names[] = {0};
2128static swig_class _wrap_class_macho_arch = { "macho_arch", &SWIGTYPE_p_macho_arch,0,0, swig_macho_arch_methods, swig_macho_arch_attributes, swig_macho_arch_bases,swig_macho_arch_base_names, &swig_module };
2129SWIGINTERN int
2130_wrap_macho_mt_archs_get(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2131  struct macho *arg1 = (struct macho *) 0 ;
2132  void *argp1 = 0 ;
2133  int res1 = 0 ;
2134  struct macho_arch *result = 0 ;
2135 
2136  if (SWIG_GetArgs(interp, objc, objv,"o:machista::macho_mt_archs_get self ",(void *)0) == TCL_ERROR) SWIG_fail;
2137  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho, 0 |  0 );
2138  if (!SWIG_IsOK(res1)) {
2139    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "macho_mt_archs_get" "', argument " "1"" of type '" "struct macho *""'"); 
2140  }
2141  arg1 = (struct macho *)(argp1);
2142  result = (struct macho_arch *) ((arg1)->mt_archs);
2143  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_macho_arch,0));
2144  return TCL_OK;
2145fail:
2146  return TCL_ERROR;
2147}
2148
2149
2150static swig_method swig_macho_methods[] = {
2151    {0,0}
2152};
2153static swig_attribute swig_macho_attributes[] = {
2154    { "-mt_archs",_wrap_macho_mt_archs_get, 0 },
2155    {0,0,0}
2156};
2157static swig_class *swig_macho_bases[] = {0};
2158static const char * swig_macho_base_names[] = {0};
2159static swig_class _wrap_class_macho = { "macho", &SWIGTYPE_p_macho,0,0, swig_macho_methods, swig_macho_attributes, swig_macho_bases,swig_macho_base_names, &swig_module };
2160SWIGINTERN int
2161_wrap_create_handle(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2162  struct macho_handle *result = 0 ;
2163 
2164  if (SWIG_GetArgs(interp, objc, objv,":machista::create_handle ") == TCL_ERROR) SWIG_fail;
2165  result = (struct macho_handle *)macho_create_handle();
2166  Tcl_SetObjResult(interp, SWIG_NewInstanceObj( SWIG_as_voidptr(result), SWIGTYPE_p_macho_handle,0));
2167  return TCL_OK;
2168fail:
2169  return TCL_ERROR;
2170}
2171
2172
2173SWIGINTERN int
2174_wrap_destroy_handle(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2175  struct macho_handle *arg1 = (struct macho_handle *) 0 ;
2176  void *argp1 = 0 ;
2177  int res1 = 0 ;
2178 
2179  if (SWIG_GetArgs(interp, objc, objv,"o:machista::destroy_handle INPUT ",(void *)0) == TCL_ERROR) SWIG_fail;
2180  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_handle, 0 |  0 );
2181  if (!SWIG_IsOK(res1)) {
2182    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "destroy_handle" "', argument " "1"" of type '" "struct macho_handle *""'"); 
2183  }
2184  arg1 = (struct macho_handle *)(argp1);
2185  macho_destroy_handle(arg1);
2186 
2187  return TCL_OK;
2188fail:
2189  return TCL_ERROR;
2190}
2191
2192
2193SWIGINTERN int
2194_wrap_parse_file(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2195  struct macho_handle *arg1 = (struct macho_handle *) 0 ;
2196  char *arg2 = (char *) 0 ;
2197  struct macho **arg3 = (struct macho **) 0 ;
2198  void *argp1 = 0 ;
2199  int res1 = 0 ;
2200  int res2 ;
2201  char *buf2 = 0 ;
2202  int alloc2 = 0 ;
2203  struct macho *res3 ;
2204  int result;
2205 
2206  {
2207    arg3 = &res3;
2208  }
2209  if (SWIG_GetArgs(interp, objc, objv,"oo:machista::parse_file handle filename ",(void *)0,(void *)0) == TCL_ERROR) SWIG_fail;
2210  res1 = SWIG_ConvertPtr(objv[1], &argp1,SWIGTYPE_p_macho_handle, 0 |  0 );
2211  if (!SWIG_IsOK(res1)) {
2212    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "parse_file" "', argument " "1"" of type '" "struct macho_handle *""'"); 
2213  }
2214  arg1 = (struct macho_handle *)(argp1);
2215  res2 = SWIG_AsCharPtrAndSize(objv[2], &buf2, NULL, &alloc2);
2216  if (!SWIG_IsOK(res2)) {
2217    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "parse_file" "', argument " "2"" of type '" "char const *""'");
2218  }
2219  arg2 = (char *)(buf2);
2220  result = (int)macho_parse_file(arg1,(char const *)arg2,(struct macho const **)arg3);
2221  Tcl_SetObjResult(interp,SWIG_From_int((int)(result)));
2222  {
2223    Tcl_ListObjAppendElement(interp, (Tcl_GetObjResult(interp)), SWIG_NewInstanceObj(SWIG_as_voidptr(*arg3), SWIGTYPE_p_macho, 0));
2224  }
2225  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2226  return TCL_OK;
2227fail:
2228  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2229  return TCL_ERROR;
2230}
2231
2232
2233SWIGINTERN int
2234_wrap_strerror(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2235  int arg1 ;
2236  int val1 ;
2237  int ecode1 = 0 ;
2238  char *result = 0 ;
2239 
2240  if (SWIG_GetArgs(interp, objc, objv,"o:machista::strerror err ",(void *)0) == TCL_ERROR) SWIG_fail;
2241  ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);
2242  if (!SWIG_IsOK(ecode1)) {
2243    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "strerror" "', argument " "1"" of type '" "int""'");
2244  } 
2245  arg1 = (int)(val1);
2246  result = (char *)macho_strerror(arg1);
2247  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
2248  return TCL_OK;
2249fail:
2250  return TCL_ERROR;
2251}
2252
2253
2254SWIGINTERN int
2255_wrap_get_arch_name(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2256  cpu_type_t arg1 ;
2257  int val1 ;
2258  int ecode1 = 0 ;
2259  char *result = 0 ;
2260 
2261  if (SWIG_GetArgs(interp, objc, objv,"o:machista::get_arch_name cpu_type_t ",(void *)0) == TCL_ERROR) SWIG_fail;
2262  ecode1 = SWIG_AsVal_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);
2263  if (!SWIG_IsOK(ecode1)) {
2264    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "get_arch_name" "', argument " "1"" of type '" "cpu_type_t""'");
2265  } 
2266  arg1 = (cpu_type_t)(val1);
2267  result = (char *)macho_get_arch_name(arg1);
2268  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
2269  return TCL_OK;
2270fail:
2271  return TCL_ERROR;
2272}
2273
2274
2275SWIGINTERN int
2276_wrap_format_dylib_version(ClientData clientData SWIGUNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) {
2277  uint32_t arg1 ;
2278  unsigned int val1 ;
2279  int ecode1 = 0 ;
2280  char *result = 0 ;
2281 
2282  if (SWIG_GetArgs(interp, objc, objv,"o:machista::format_dylib_version uint32_t ",(void *)0) == TCL_ERROR) SWIG_fail;
2283  ecode1 = SWIG_AsVal_unsigned_SS_int SWIG_TCL_CALL_ARGS_2(objv[1], &val1);
2284  if (!SWIG_IsOK(ecode1)) {
2285    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "format_dylib_version" "', argument " "1"" of type '" "uint32_t""'");
2286  } 
2287  arg1 = (uint32_t)(val1);
2288  result = (char *)macho_format_dylib_version(arg1);
2289  Tcl_SetObjResult(interp,SWIG_FromCharPtr((const char *)result));
2290  {
2291    free(result);
2292  }
2293  return TCL_OK;
2294fail:
2295  return TCL_ERROR;
2296}
2297
2298
2299
2300static swig_command_info swig_commands[] = {
2301    { SWIG_prefix "macho_handle", (swig_wrapper_func) SWIG_ObjectConstructor, (ClientData)&_wrap_class_macho_handle},
2302    { SWIG_prefix "macho_loadcmd_mlt_install_name_get", (swig_wrapper_func) _wrap_macho_loadcmd_mlt_install_name_get, NULL},
2303    { SWIG_prefix "macho_loadcmd_mlt_type_get", (swig_wrapper_func) _wrap_macho_loadcmd_mlt_type_get, NULL},
2304    { SWIG_prefix "macho_loadcmd_mlt_comp_version_get", (swig_wrapper_func) _wrap_macho_loadcmd_mlt_comp_version_get, NULL},
2305    { SWIG_prefix "macho_loadcmd_mlt_version_get", (swig_wrapper_func) _wrap_macho_loadcmd_mlt_version_get, NULL},
2306    { SWIG_prefix "macho_loadcmd_next_get", (swig_wrapper_func) _wrap_macho_loadcmd_next_get, NULL},
2307    { SWIG_prefix "macho_loadcmd", (swig_wrapper_func) SWIG_ObjectConstructor, (ClientData)&_wrap_class_macho_loadcmd},
2308    { SWIG_prefix "macho_arch_mat_install_name_get", (swig_wrapper_func) _wrap_macho_arch_mat_install_name_get, NULL},
2309    { SWIG_prefix "macho_arch_mat_rpath_get", (swig_wrapper_func) _wrap_macho_arch_mat_rpath_get, NULL},
2310    { SWIG_prefix "macho_arch_mat_arch_get", (swig_wrapper_func) _wrap_macho_arch_mat_arch_get, NULL},
2311    { SWIG_prefix "macho_arch_mat_comp_version_get", (swig_wrapper_func) _wrap_macho_arch_mat_comp_version_get, NULL},
2312    { SWIG_prefix "macho_arch_mat_version_get", (swig_wrapper_func) _wrap_macho_arch_mat_version_get, NULL},
2313    { SWIG_prefix "macho_arch_mat_loadcmds_get", (swig_wrapper_func) _wrap_macho_arch_mat_loadcmds_get, NULL},
2314    { SWIG_prefix "macho_arch_next_get", (swig_wrapper_func) _wrap_macho_arch_next_get, NULL},
2315    { SWIG_prefix "macho_arch", (swig_wrapper_func) SWIG_ObjectConstructor, (ClientData)&_wrap_class_macho_arch},
2316    { SWIG_prefix "macho_mt_archs_get", (swig_wrapper_func) _wrap_macho_mt_archs_get, NULL},
2317    { SWIG_prefix "macho", (swig_wrapper_func) SWIG_ObjectConstructor, (ClientData)&_wrap_class_macho},
2318    { SWIG_prefix "create_handle", (swig_wrapper_func) _wrap_create_handle, NULL},
2319    { SWIG_prefix "destroy_handle", (swig_wrapper_func) _wrap_destroy_handle, NULL},
2320    { SWIG_prefix "parse_file", (swig_wrapper_func) _wrap_parse_file, NULL},
2321    { SWIG_prefix "strerror", (swig_wrapper_func) _wrap_strerror, NULL},
2322    { SWIG_prefix "get_arch_name", (swig_wrapper_func) _wrap_get_arch_name, NULL},
2323    { SWIG_prefix "format_dylib_version", (swig_wrapper_func) _wrap_format_dylib_version, NULL},
2324    {0, 0, 0}
2325};
2326
2327static swig_var_info swig_variables[] = {
2328    {0,0,0,0}
2329};
2330
2331static swig_const_info swig_constants[] = {
2332    {0,0,0,0,0,0}
2333};
2334
2335/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2336
2337static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
2338static swig_type_info _swigt__p_int = {"_p_int", "int *|cpu_type_t *", 0, 0, (void*)0, 0};
2339static swig_type_info _swigt__p_macho = {"_p_macho", "struct macho *|macho *", 0, 0, (void*)&_wrap_class_macho, 0};
2340static swig_type_info _swigt__p_macho_arch = {"_p_macho_arch", "struct macho_arch *|macho_arch *", 0, 0, (void*)&_wrap_class_macho_arch, 0};
2341static swig_type_info _swigt__p_macho_handle = {"_p_macho_handle", "macho_handle *|struct macho_handle *", 0, 0, (void*)&_wrap_class_macho_handle, 0};
2342static swig_type_info _swigt__p_macho_loadcmd = {"_p_macho_loadcmd", "struct macho_loadcmd *|macho_loadcmd *", 0, 0, (void*)&_wrap_class_macho_loadcmd, 0};
2343static swig_type_info _swigt__p_p_macho = {"_p_p_macho", "struct macho **", 0, 0, (void*)0, 0};
2344static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "uint32_t *|unsigned int *", 0, 0, (void*)0, 0};
2345
2346static swig_type_info *swig_type_initial[] = {
2347  &_swigt__p_char,
2348  &_swigt__p_int,
2349  &_swigt__p_macho,
2350  &_swigt__p_macho_arch,
2351  &_swigt__p_macho_handle,
2352  &_swigt__p_macho_loadcmd,
2353  &_swigt__p_p_macho,
2354  &_swigt__p_unsigned_int,
2355};
2356
2357static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
2358static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
2359static swig_cast_info _swigc__p_macho[] = {  {&_swigt__p_macho, 0, 0, 0},{0, 0, 0, 0}};
2360static swig_cast_info _swigc__p_macho_arch[] = {  {&_swigt__p_macho_arch, 0, 0, 0},{0, 0, 0, 0}};
2361static swig_cast_info _swigc__p_macho_handle[] = {  {&_swigt__p_macho_handle, 0, 0, 0},{0, 0, 0, 0}};
2362static swig_cast_info _swigc__p_macho_loadcmd[] = {  {&_swigt__p_macho_loadcmd, 0, 0, 0},{0, 0, 0, 0}};
2363static swig_cast_info _swigc__p_p_macho[] = {  {&_swigt__p_p_macho, 0, 0, 0},{0, 0, 0, 0}};
2364static swig_cast_info _swigc__p_unsigned_int[] = {  {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}};
2365
2366static swig_cast_info *swig_cast_initial[] = {
2367  _swigc__p_char,
2368  _swigc__p_int,
2369  _swigc__p_macho,
2370  _swigc__p_macho_arch,
2371  _swigc__p_macho_handle,
2372  _swigc__p_macho_loadcmd,
2373  _swigc__p_p_macho,
2374  _swigc__p_unsigned_int,
2375};
2376
2377
2378/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2379
2380#ifdef __cplusplus
2381}
2382#endif
2383/* -----------------------------------------------------------------------------
2384 * Type initialization:
2385 * This problem is tough by the requirement that no dynamic
2386 * memory is used. Also, since swig_type_info structures store pointers to
2387 * swig_cast_info structures and swig_cast_info structures store pointers back
2388 * to swig_type_info structures, we need some lookup code at initialization.
2389 * The idea is that swig generates all the structures that are needed.
2390 * The runtime then collects these partially filled structures.
2391 * The SWIG_InitializeModule function takes these initial arrays out of
2392 * swig_module, and does all the lookup, filling in the swig_module.types
2393 * array with the correct data and linking the correct swig_cast_info
2394 * structures together.
2395 *
2396 * The generated swig_type_info structures are assigned statically to an initial
2397 * array. We just loop through that array, and handle each type individually.
2398 * First we lookup if this type has been already loaded, and if so, use the
2399 * loaded structure instead of the generated one. Then we have to fill in the
2400 * cast linked list. The cast data is initially stored in something like a
2401 * two-dimensional array. Each row corresponds to a type (there are the same
2402 * number of rows as there are in the swig_type_initial array). Each entry in
2403 * a column is one of the swig_cast_info structures for that type.
2404 * The cast_initial array is actually an array of arrays, because each row has
2405 * a variable number of columns. So to actually build the cast linked list,
2406 * we find the array of casts associated with the type, and loop through it
2407 * adding the casts to the list. The one last trick we need to do is making
2408 * sure the type pointer in the swig_cast_info struct is correct.
2409 *
2410 * First off, we lookup the cast->type name to see if it is already loaded.
2411 * There are three cases to handle:
2412 *  1) If the cast->type has already been loaded AND the type we are adding
2413 *     casting info to has not been loaded (it is in this module), THEN we
2414 *     replace the cast->type pointer with the type pointer that has already
2415 *     been loaded.
2416 *  2) If BOTH types (the one we are adding casting info to, and the
2417 *     cast->type) are loaded, THEN the cast info has already been loaded by
2418 *     the previous module so we just ignore it.
2419 *  3) Finally, if cast->type has not already been loaded, then we add that
2420 *     swig_cast_info to the linked list (because the cast->type) pointer will
2421 *     be correct.
2422 * ----------------------------------------------------------------------------- */
2423
2424#ifdef __cplusplus
2425extern "C" {
2426#if 0
2427} /* c-mode */
2428#endif
2429#endif
2430
2431#if 0
2432#define SWIGRUNTIME_DEBUG
2433#endif
2434
2435
2436SWIGRUNTIME void
2437SWIG_InitializeModule(void *clientdata) {
2438  size_t i;
2439  swig_module_info *module_head, *iter;
2440  int init;
2441 
2442  /* check to see if the circular list has been setup, if not, set it up */
2443  if (swig_module.next==0) {
2444    /* Initialize the swig_module */
2445    swig_module.type_initial = swig_type_initial;
2446    swig_module.cast_initial = swig_cast_initial;
2447    swig_module.next = &swig_module;
2448    init = 1;
2449  } else {
2450    init = 0;
2451  }
2452 
2453  /* Try and load any already created modules */
2454  module_head = SWIG_GetModule(clientdata);
2455  if (!module_head) {
2456    /* This is the first module loaded for this interpreter */
2457    /* so set the swig module into the interpreter */
2458    SWIG_SetModule(clientdata, &swig_module);
2459  } else {
2460    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
2461    iter=module_head;
2462    do {
2463      if (iter==&swig_module) {
2464        /* Our module is already in the list, so there's nothing more to do. */
2465        return;
2466      }
2467      iter=iter->next;
2468    } while (iter!= module_head);
2469   
2470    /* otherwise we must add our module into the list */
2471    swig_module.next = module_head->next;
2472    module_head->next = &swig_module;
2473  }
2474 
2475  /* When multiple interpreters are used, a module could have already been initialized in
2476       a different interpreter, but not yet have a pointer in this interpreter.
2477       In this case, we do not want to continue adding types... everything should be
2478       set up already */
2479  if (init == 0) return;
2480 
2481  /* Now work on filling in swig_module.types */
2482#ifdef SWIGRUNTIME_DEBUG
2483  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
2484#endif
2485  for (i = 0; i < swig_module.size; ++i) {
2486    swig_type_info *type = 0;
2487    swig_type_info *ret;
2488    swig_cast_info *cast;
2489   
2490#ifdef SWIGRUNTIME_DEBUG
2491    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2492#endif
2493   
2494    /* if there is another module already loaded */
2495    if (swig_module.next != &swig_module) {
2496      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2497    }
2498    if (type) {
2499      /* Overwrite clientdata field */
2500#ifdef SWIGRUNTIME_DEBUG
2501      printf("SWIG_InitializeModule: found type %s\n", type->name);
2502#endif
2503      if (swig_module.type_initial[i]->clientdata) {
2504        type->clientdata = swig_module.type_initial[i]->clientdata;
2505#ifdef SWIGRUNTIME_DEBUG
2506        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
2507#endif
2508      }
2509    } else {
2510      type = swig_module.type_initial[i];
2511    }
2512   
2513    /* Insert casting types */
2514    cast = swig_module.cast_initial[i];
2515    while (cast->type) {
2516      /* Don't need to add information already in the list */
2517      ret = 0;
2518#ifdef SWIGRUNTIME_DEBUG
2519      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
2520#endif
2521      if (swig_module.next != &swig_module) {
2522        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2523#ifdef SWIGRUNTIME_DEBUG
2524        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
2525#endif
2526      }
2527      if (ret) {
2528        if (type == swig_module.type_initial[i]) {
2529#ifdef SWIGRUNTIME_DEBUG
2530          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
2531#endif
2532          cast->type = ret;
2533          ret = 0;
2534        } else {
2535          /* Check for casting already in the list */
2536          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
2537#ifdef SWIGRUNTIME_DEBUG
2538          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
2539#endif
2540          if (!ocast) ret = 0;
2541        }
2542      }
2543     
2544      if (!ret) {
2545#ifdef SWIGRUNTIME_DEBUG
2546        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
2547#endif
2548        if (type->cast) {
2549          type->cast->prev = cast;
2550          cast->next = type->cast;
2551        }
2552        type->cast = cast;
2553      }
2554      cast++;
2555    }
2556    /* Set entry in modules->types array equal to the type */
2557    swig_module.types[i] = type;
2558  }
2559  swig_module.types[i] = 0;
2560 
2561#ifdef SWIGRUNTIME_DEBUG
2562  printf("**** SWIG_InitializeModule: Cast List ******\n");
2563  for (i = 0; i < swig_module.size; ++i) {
2564    int j = 0;
2565    swig_cast_info *cast = swig_module.cast_initial[i];
2566    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2567    while (cast->type) {
2568      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
2569      cast++;
2570      ++j;
2571    }
2572    printf("---- Total casts: %d\n",j);
2573  }
2574  printf("**** SWIG_InitializeModule: Cast List ******\n");
2575#endif
2576}
2577
2578/* This function will propagate the clientdata field of type to
2579* any new swig_type_info structures that have been added into the list
2580* of equivalent types.  It is like calling
2581* SWIG_TypeClientData(type, clientdata) a second time.
2582*/
2583SWIGRUNTIME void
2584SWIG_PropagateClientData(void) {
2585  size_t i;
2586  swig_cast_info *equiv;
2587  static int init_run = 0;
2588 
2589  if (init_run) return;
2590  init_run = 1;
2591 
2592  for (i = 0; i < swig_module.size; i++) {
2593    if (swig_module.types[i]->clientdata) {
2594      equiv = swig_module.types[i]->cast;
2595      while (equiv) {
2596        if (!equiv->converter) {
2597          if (equiv->type && !equiv->type->clientdata)
2598          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2599        }
2600        equiv = equiv->next;
2601      }
2602    }
2603  }
2604}
2605
2606#ifdef __cplusplus
2607#if 0
2608{
2609  /* c-mode */
2610#endif
2611}
2612#endif
2613
2614
2615#ifdef __cplusplus
2616extern "C" {
2617#endif
2618 
2619  /* -----------------------------------------------------------------------------
2620   * constants/methods manipulation
2621   * ----------------------------------------------------------------------------- */
2622 
2623  /* Install Constants */
2624 
2625  SWIGINTERN void
2626  SWIG_Tcl_InstallConstants(Tcl_Interp *interp, swig_const_info constants[]) {
2627    size_t i;
2628    Tcl_Obj *obj;
2629   
2630    if (!swigconstTableinit) {
2631      Tcl_InitHashTable(&swigconstTable, TCL_STRING_KEYS);
2632      swigconstTableinit = 1;
2633    }
2634    for (i = 0; constants[i].type; i++) {
2635      switch(constants[i].type) {
2636      case SWIG_TCL_POINTER:
2637        obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
2638        break;
2639      case SWIG_TCL_BINARY:
2640        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
2641        break;
2642      default:
2643        obj = 0;
2644        break;
2645      }
2646      if (obj) {
2647        SWIG_Tcl_SetConstantObj(interp, constants[i].name, obj);
2648      }
2649    }
2650  }
2651 
2652  /* Create fast method lookup tables */
2653 
2654  SWIGINTERN void
2655  SWIG_Tcl_InstallMethodLookupTables(void) {
2656    size_t i;
2657   
2658    for (i = 0; i < swig_module.size; ++i) {
2659      swig_type_info *type = swig_module.type_initial[i];
2660      if (type->clientdata) {
2661        swig_class* klass = (swig_class*) type->clientdata;
2662        swig_method* meth;
2663        Tcl_InitHashTable(&(klass->hashtable), TCL_STRING_KEYS);
2664        for (meth = klass->methods; meth && meth->name; ++meth) {
2665          int newEntry;
2666          Tcl_HashEntry* hashentry = Tcl_CreateHashEntry(&(klass->hashtable), meth->name, &newEntry);
2667          Tcl_SetHashValue(hashentry, (ClientData)meth->method);
2668        }
2669      }
2670    }
2671  }
2672 
2673#ifdef __cplusplus
2674}
2675#endif
2676
2677/* -----------------------------------------------------------------------------*
2678 *  Partial Init method
2679 * -----------------------------------------------------------------------------*/
2680
2681SWIGEXPORT int SWIG_init(Tcl_Interp *interp) {
2682  size_t i;
2683  if (interp == 0) return TCL_ERROR;
2684#ifdef USE_TCL_STUBS
2685  /* (char*) cast is required to avoid compiler warning/error for Tcl < 8.4. */
2686  if (Tcl_InitStubs(interp, (char*)SWIG_TCL_STUBS_VERSION, 0) == NULL) {
2687    return TCL_ERROR;
2688  }
2689#endif 
2690#ifdef USE_TK_STUBS
2691  /* (char*) cast is required to avoid compiler warning/error. */
2692  if (Tk_InitStubs(interp, (char*)SWIG_TCL_STUBS_VERSION, 0) == NULL) {
2693    return TCL_ERROR;
2694  }
2695#endif
2696 
2697  Tcl_PkgProvide(interp, (char*)SWIG_name, (char*)SWIG_version);
2698 
2699#ifdef SWIG_namespace
2700  Tcl_Eval(interp, "namespace eval " SWIG_namespace " { }");
2701#endif
2702 
2703  SWIG_InitializeModule((void *) interp);
2704  SWIG_PropagateClientData();
2705 
2706  for (i = 0; swig_commands[i].name; i++) {
2707    Tcl_CreateObjCommand(interp, (char *) swig_commands[i].name, (swig_wrapper_func) swig_commands[i].wrapper,
2708      swig_commands[i].clientdata, NULL);
2709  }
2710  for (i = 0; swig_variables[i].name; i++) {
2711    Tcl_SetVar(interp, (char *) swig_variables[i].name, (char *) "", TCL_GLOBAL_ONLY);
2712    Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_READS | TCL_GLOBAL_ONLY, 
2713      (Tcl_VarTraceProc *) swig_variables[i].get, (ClientData) swig_variables[i].addr);
2714    Tcl_TraceVar(interp, (char *) swig_variables[i].name, TCL_TRACE_WRITES | TCL_GLOBAL_ONLY, 
2715      (Tcl_VarTraceProc *) swig_variables[i].set, (ClientData) swig_variables[i].addr);
2716  }
2717 
2718  SWIG_Tcl_InstallConstants(interp, swig_constants);
2719  SWIG_Tcl_InstallMethodLookupTables();
2720 
2721 
2722  SWIG_Tcl_SetConstantObj(interp, "machista::SUCCESS", SWIG_From_int((int)((0x00))));
2723  SWIG_Tcl_SetConstantObj(interp, "machista::EFILE", SWIG_From_int((int)((0x01))));
2724  SWIG_Tcl_SetConstantObj(interp, "machista::EMMAP", SWIG_From_int((int)((0x02))));
2725  SWIG_Tcl_SetConstantObj(interp, "machista::EMEM", SWIG_From_int((int)((0x04))));
2726  SWIG_Tcl_SetConstantObj(interp, "machista::ERANGE", SWIG_From_int((int)((0x08))));
2727  SWIG_Tcl_SetConstantObj(interp, "machista::EMAGIC", SWIG_From_int((int)((0x10))));
2728  return TCL_OK;
2729}
2730SWIGEXPORT int Machista_SafeInit(Tcl_Interp *interp) {
2731  return SWIG_init(interp);
2732}
2733
Note: See TracBrowser for help on using the repository browser.