1 
2 // SWIGFUSION ^.^
3 
4 // Lua
5 struct lua_State;
6 
7 // Forward declarations of fused methods:
8 namespace love_sdlmixer
9 {
10 }
11 
12 
13 /* ----------------------------------------------------------------------------
14  * This file was automatically generated by SWIG (http://www.swig.org).
15  * Version 1.3.35
16  *
17  * This file is not intended to be easily readable and contains a number of
18  * coding conventions designed to improve portability and efficiency. Do not make
19  * changes to this file unless you know what you are doing--modify the SWIG
20  * interface file instead.
21  * ----------------------------------------------------------------------------- */
22 
23 
24 #ifdef __cplusplus
25 template<typename T> class SwigValueWrapper {
26     T *tt;
27 public:
SwigValueWrapper()28     SwigValueWrapper() : tt(0) { }
SwigValueWrapper(const SwigValueWrapper<T> & rhs)29     SwigValueWrapper(const SwigValueWrapper<T>& rhs) : tt(new T(*rhs.tt)) { }
SwigValueWrapper(const T & t)30     SwigValueWrapper(const T& t) : tt(new T(t)) { }
~SwigValueWrapper()31     ~SwigValueWrapper() { delete tt; }
operator =(const T & t)32     SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; }
operator T&() const33     operator T&() const { return *tt; }
operator &()34     T *operator&() { return tt; }
35 private:
36     SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
37 };
38 
SwigValueInit()39 template <typename T> T SwigValueInit() {
40   return T();
41 }
42 #endif
43 
44 /* -----------------------------------------------------------------------------
45  *  This section contains generic SWIG labels for method/variable
46  *  declarations/attributes, and other compiler dependent labels.
47  * ----------------------------------------------------------------------------- */
48 
49 /* template workaround for compilers that cannot correctly implement the C++ standard */
50 #ifndef SWIGTEMPLATEDISAMBIGUATOR
51 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
52 #  define SWIGTEMPLATEDISAMBIGUATOR template
53 # elif defined(__HP_aCC)
54 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
55 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
56 #  define SWIGTEMPLATEDISAMBIGUATOR template
57 # else
58 #  define SWIGTEMPLATEDISAMBIGUATOR
59 # endif
60 #endif
61 
62 /* inline attribute */
63 #ifndef SWIGINLINE
64 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
65 #   define SWIGINLINE inline
66 # else
67 #   define SWIGINLINE
68 # endif
69 #endif
70 
71 /* attribute recognised by some compilers to avoid 'unused' warnings */
72 #ifndef SWIGUNUSED
73 # if defined(__GNUC__)
74 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
75 #     define SWIGUNUSED __attribute__ ((__unused__))
76 #   else
77 #     define SWIGUNUSED
78 #   endif
79 # elif defined(__ICC)
80 #   define SWIGUNUSED __attribute__ ((__unused__))
81 # else
82 #   define SWIGUNUSED
83 # endif
84 #endif
85 
86 #ifndef SWIGUNUSEDPARM
87 # ifdef __cplusplus
88 #   define SWIGUNUSEDPARM(p)
89 # else
90 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
91 # endif
92 #endif
93 
94 /* internal SWIG method */
95 #ifndef SWIGINTERN
96 # define SWIGINTERN static SWIGUNUSED
97 #endif
98 
99 /* internal inline SWIG method */
100 #ifndef SWIGINTERNINLINE
101 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
102 #endif
103 
104 /* exporting methods */
105 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
106 #  ifndef GCC_HASCLASSVISIBILITY
107 #    define GCC_HASCLASSVISIBILITY
108 #  endif
109 #endif
110 
111 #ifndef SWIGEXPORT
112 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113 #   if defined(STATIC_LINKED)
114 #     define SWIGEXPORT
115 #   else
116 #     define SWIGEXPORT __declspec(dllexport)
117 #   endif
118 # else
119 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
120 #     define SWIGEXPORT __attribute__ ((visibility("default")))
121 #   else
122 #     define SWIGEXPORT
123 #   endif
124 # endif
125 #endif
126 
127 /* calling conventions for Windows */
128 #ifndef SWIGSTDCALL
129 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
130 #   define SWIGSTDCALL __stdcall
131 # else
132 #   define SWIGSTDCALL
133 # endif
134 #endif
135 
136 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
137 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
138 # define _CRT_SECURE_NO_DEPRECATE
139 #endif
140 
141 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
142 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
143 # define _SCL_SECURE_NO_DEPRECATE
144 #endif
145 
146 
147 /* -----------------------------------------------------------------------------
148  * swigrun.swg
149  *
150  * This file contains generic CAPI SWIG runtime support for pointer
151  * type checking.
152  * ----------------------------------------------------------------------------- */
153 
154 /* This should only be incremented when either the layout of swig_type_info changes,
155    or for whatever reason, the runtime changes incompatibly */
156 #define SWIG_RUNTIME_VERSION "4"
157 
158 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
159 #ifdef SWIG_TYPE_TABLE
160 # define SWIG_QUOTE_STRING(x) #x
161 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
162 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
163 #else
164 # define SWIG_TYPE_TABLE_NAME
165 #endif
166 
167 /*
168   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
169   creating a static or dynamic library from the swig runtime code.
170   In 99.9% of the cases, swig just needs to declare them as 'static'.
171 
172   But only do this if is strictly necessary, ie, if you have problems
173   with your compiler or so.
174 */
175 
176 #ifndef SWIGRUNTIME
177 # define SWIGRUNTIME SWIGINTERN
178 #endif
179 
180 #ifndef SWIGRUNTIMEINLINE
181 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
182 #endif
183 
184 /*  Generic buffer size */
185 #ifndef SWIG_BUFFER_SIZE
186 # define SWIG_BUFFER_SIZE 1024
187 #endif
188 
189 /* Flags for pointer conversions */
190 #define SWIG_POINTER_DISOWN        0x1
191 #define SWIG_CAST_NEW_MEMORY       0x2
192 
193 /* Flags for new pointer objects */
194 #define SWIG_POINTER_OWN           0x1
195 
196 
197 /*
198    Flags/methods for returning states.
199 
200    The swig conversion methods, as ConvertPtr, return and integer
201    that tells if the conversion was successful or not. And if not,
202    an error code can be returned (see swigerrors.swg for the codes).
203 
204    Use the following macros/flags to set or process the returning
205    states.
206 
207    In old swig versions, you usually write code as:
208 
209      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
210        // success code
211      } else {
212        //fail code
213      }
214 
215    Now you can be more explicit as:
216 
217     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
218     if (SWIG_IsOK(res)) {
219       // success code
220     } else {
221       // fail code
222     }
223 
224    that seems to be the same, but now you can also do
225 
226     Type *ptr;
227     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
228     if (SWIG_IsOK(res)) {
229       // success code
230       if (SWIG_IsNewObj(res) {
231         ...
232 	delete *ptr;
233       } else {
234         ...
235       }
236     } else {
237       // fail code
238     }
239 
240    I.e., now SWIG_ConvertPtr can return new objects and you can
241    identify the case and take care of the deallocation. Of course that
242    requires also to SWIG_ConvertPtr to return new result values, as
243 
244       int SWIG_ConvertPtr(obj, ptr,...) {
245         if (<obj is ok>) {
246           if (<need new object>) {
247             *ptr = <ptr to new allocated object>;
248             return SWIG_NEWOBJ;
249           } else {
250             *ptr = <ptr to old object>;
251             return SWIG_OLDOBJ;
252           }
253         } else {
254           return SWIG_BADOBJ;
255         }
256       }
257 
258    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
259    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
260    swig errors code.
261 
262    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
263    allows to return the 'cast rank', for example, if you have this
264 
265        int food(double)
266        int fooi(int);
267 
268    and you call
269 
270       food(1)   // cast rank '1'  (1 -> 1.0)
271       fooi(1)   // cast rank '0'
272 
273    just use the SWIG_AddCast()/SWIG_CheckState()
274 
275 
276  */
277 #define SWIG_OK                    (0)
278 #define SWIG_ERROR                 (-1)
279 #define SWIG_IsOK(r)               (r >= 0)
280 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
281 
282 /* The CastRankLimit says how many bits are used for the cast rank */
283 #define SWIG_CASTRANKLIMIT         (1 << 8)
284 /* The NewMask denotes the object was created (using new/malloc) */
285 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
286 /* The TmpMask is for in/out typemaps that use temporal objects */
287 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
288 /* Simple returning values */
289 #define SWIG_BADOBJ                (SWIG_ERROR)
290 #define SWIG_OLDOBJ                (SWIG_OK)
291 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
292 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
293 /* Check, add and del mask methods */
294 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
295 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
296 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
297 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
298 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
299 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
300 
301 
302 /* Cast-Rank Mode */
303 #if defined(SWIG_CASTRANK_MODE)
304 #  ifndef SWIG_TypeRank
305 #    define SWIG_TypeRank             unsigned long
306 #  endif
307 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
308 #    define SWIG_MAXCASTRANK          (2)
309 #  endif
310 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
311 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)312 SWIGINTERNINLINE int SWIG_AddCast(int r) {
313   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
314 }
SWIG_CheckState(int r)315 SWIGINTERNINLINE int SWIG_CheckState(int r) {
316   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
317 }
318 #else /* no cast-rank mode */
319 #  define SWIG_AddCast
320 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
321 #endif
322 
323 
324 
325 
326 #include <string.h>
327 
328 #ifdef __cplusplus
329 extern "C" {
330 #endif
331 
332 typedef void *(*swig_converter_func)(void *, int *);
333 typedef struct swig_type_info *(*swig_dycast_func)(void **);
334 
335 /* Structure to store information on one type */
336 typedef struct swig_type_info {
337   const char             *name;			/* mangled name of this type */
338   const char             *str;			/* human readable name of this type */
339   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
340   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
341   void                   *clientdata;		/* language specific type data */
342   int                    owndata;		/* flag if the structure owns the clientdata */
343 } swig_type_info;
344 
345 /* Structure to store a type and conversion function used for casting */
346 typedef struct swig_cast_info {
347   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
348   swig_converter_func     converter;		/* function to cast the void pointers */
349   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
350   struct swig_cast_info  *prev;			/* pointer to the previous cast */
351 } swig_cast_info;
352 
353 /* Structure used to store module information
354  * Each module generates one structure like this, and the runtime collects
355  * all of these structures and stores them in a circularly linked list.*/
356 typedef struct swig_module_info {
357   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
358   size_t                 size;		        /* Number of types in this module */
359   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
360   swig_type_info         **type_initial;	/* Array of initially generated type structures */
361   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
362   void                    *clientdata;		/* Language specific module data */
363 } swig_module_info;
364 
365 /*
366   Compare two type names skipping the space characters, therefore
367   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
368 
369   Return 0 when the two name types are equivalent, as in
370   strncmp, but skipping ' '.
371 */
372 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)373 SWIG_TypeNameComp(const char *f1, const char *l1,
374 		  const char *f2, const char *l2) {
375   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
376     while ((*f1 == ' ') && (f1 != l1)) ++f1;
377     while ((*f2 == ' ') && (f2 != l2)) ++f2;
378     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
379   }
380   return (int)((l1 - f1) - (l2 - f2));
381 }
382 
383 /*
384   Check type equivalence in a name list like <name1>|<name2>|...
385   Return 0 if not equal, 1 if equal
386 */
387 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)388 SWIG_TypeEquiv(const char *nb, const char *tb) {
389   int equiv = 0;
390   const char* te = tb + strlen(tb);
391   const char* ne = nb;
392   while (!equiv && *ne) {
393     for (nb = ne; *ne; ++ne) {
394       if (*ne == '|') break;
395     }
396     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
397     if (*ne) ++ne;
398   }
399   return equiv;
400 }
401 
402 /*
403   Check type equivalence in a name list like <name1>|<name2>|...
404   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
405 */
406 SWIGRUNTIME int
SWIG_TypeCompare(const char * nb,const char * tb)407 SWIG_TypeCompare(const char *nb, const char *tb) {
408   int equiv = 0;
409   const char* te = tb + strlen(tb);
410   const char* ne = nb;
411   while (!equiv && *ne) {
412     for (nb = ne; *ne; ++ne) {
413       if (*ne == '|') break;
414     }
415     equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
416     if (*ne) ++ne;
417   }
418   return equiv;
419 }
420 
421 
422 /* think of this as a c++ template<> or a scheme macro */
423 #define SWIG_TypeCheck_Template(comparison, ty)         \
424   if (ty) {                                             \
425     swig_cast_info *iter = ty->cast;                    \
426     while (iter) {                                      \
427       if (comparison) {                                 \
428         if (iter == ty->cast) return iter;              \
429         /* Move iter to the top of the linked list */   \
430         iter->prev->next = iter->next;                  \
431         if (iter->next)                                 \
432           iter->next->prev = iter->prev;                \
433         iter->next = ty->cast;                          \
434         iter->prev = 0;                                 \
435         if (ty->cast) ty->cast->prev = iter;            \
436         ty->cast = iter;                                \
437         return iter;                                    \
438       }                                                 \
439       iter = iter->next;                                \
440     }                                                   \
441   }                                                     \
442   return 0
443 
444 /*
445   Check the typename
446 */
447 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)448 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
449   SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
450 }
451 
452 /* Same as previous function, except strcmp is replaced with a pointer comparison */
453 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * into)454 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
455   SWIG_TypeCheck_Template(iter->type == from, into);
456 }
457 
458 /*
459   Cast a pointer up an inheritance hierarchy
460 */
461 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)462 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
463   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
464 }
465 
466 /*
467    Dynamic pointer casting. Down an inheritance hierarchy
468 */
469 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)470 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
471   swig_type_info *lastty = ty;
472   if (!ty || !ty->dcast) return ty;
473   while (ty && (ty->dcast)) {
474     ty = (*ty->dcast)(ptr);
475     if (ty) lastty = ty;
476   }
477   return lastty;
478 }
479 
480 /*
481   Return the name associated with this type
482 */
483 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)484 SWIG_TypeName(const swig_type_info *ty) {
485   return ty->name;
486 }
487 
488 /*
489   Return the pretty name associated with this type,
490   that is an unmangled type name in a form presentable to the user.
491 */
492 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)493 SWIG_TypePrettyName(const swig_type_info *type) {
494   /* The "str" field contains the equivalent pretty names of the
495      type, separated by vertical-bar characters.  We choose
496      to print the last name, as it is often (?) the most
497      specific. */
498   if (!type) return NULL;
499   if (type->str != NULL) {
500     const char *last_name = type->str;
501     const char *s;
502     for (s = type->str; *s; s++)
503       if (*s == '|') last_name = s+1;
504     return last_name;
505   }
506   else
507     return type->name;
508 }
509 
510 /*
511    Set the clientdata field for a type
512 */
513 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)514 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
515   swig_cast_info *cast = ti->cast;
516   /* if (ti->clientdata == clientdata) return; */
517   ti->clientdata = clientdata;
518 
519   while (cast) {
520     if (!cast->converter) {
521       swig_type_info *tc = cast->type;
522       if (!tc->clientdata) {
523 	SWIG_TypeClientData(tc, clientdata);
524       }
525     }
526     cast = cast->next;
527   }
528 }
529 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)530 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
531   SWIG_TypeClientData(ti, clientdata);
532   ti->owndata = 1;
533 }
534 
535 /*
536   Search for a swig_type_info structure only by mangled name
537   Search is a O(log #types)
538 
539   We start searching at module start, and finish searching when start == end.
540   Note: if start == end at the beginning of the function, we go all the way around
541   the circular list.
542 */
543 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)544 SWIG_MangledTypeQueryModule(swig_module_info *start,
545                             swig_module_info *end,
546 		            const char *name) {
547   swig_module_info *iter = start;
548   do {
549     if (iter->size) {
550       register size_t l = 0;
551       register size_t r = iter->size - 1;
552       do {
553 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
554 	register size_t i = (l + r) >> 1;
555 	const char *iname = iter->types[i]->name;
556 	if (iname) {
557 	  register int compare = strcmp(name, iname);
558 	  if (compare == 0) {
559 	    return iter->types[i];
560 	  } else if (compare < 0) {
561 	    if (i) {
562 	      r = i - 1;
563 	    } else {
564 	      break;
565 	    }
566 	  } else if (compare > 0) {
567 	    l = i + 1;
568 	  }
569 	} else {
570 	  break; /* should never happen */
571 	}
572       } while (l <= r);
573     }
574     iter = iter->next;
575   } while (iter != end);
576   return 0;
577 }
578 
579 /*
580   Search for a swig_type_info structure for either a mangled name or a human readable name.
581   It first searches the mangled names of the types, which is a O(log #types)
582   If a type is not found it then searches the human readable names, which is O(#types).
583 
584   We start searching at module start, and finish searching when start == end.
585   Note: if start == end at the beginning of the function, we go all the way around
586   the circular list.
587 */
588 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)589 SWIG_TypeQueryModule(swig_module_info *start,
590                      swig_module_info *end,
591 		     const char *name) {
592   /* STEP 1: Search the name field using binary search */
593   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
594   if (ret) {
595     return ret;
596   } else {
597     /* STEP 2: If the type hasn't been found, do a complete search
598        of the str field (the human readable name) */
599     swig_module_info *iter = start;
600     do {
601       register size_t i = 0;
602       for (; i < iter->size; ++i) {
603 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
604 	  return iter->types[i];
605       }
606       iter = iter->next;
607     } while (iter != end);
608   }
609 
610   /* neither found a match */
611   return 0;
612 }
613 
614 /*
615    Pack binary data into a string
616 */
617 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)618 SWIG_PackData(char *c, void *ptr, size_t sz) {
619   static const char hex[17] = "0123456789abcdef";
620   register const unsigned char *u = (unsigned char *) ptr;
621   register const unsigned char *eu =  u + sz;
622   for (; u != eu; ++u) {
623     register unsigned char uu = *u;
624     *(c++) = hex[(uu & 0xf0) >> 4];
625     *(c++) = hex[uu & 0xf];
626   }
627   return c;
628 }
629 
630 /*
631    Unpack binary data from a string
632 */
633 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)634 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
635   register unsigned char *u = (unsigned char *) ptr;
636   register const unsigned char *eu = u + sz;
637   for (; u != eu; ++u) {
638     register char d = *(c++);
639     register unsigned char uu;
640     if ((d >= '0') && (d <= '9'))
641       uu = ((d - '0') << 4);
642     else if ((d >= 'a') && (d <= 'f'))
643       uu = ((d - ('a'-10)) << 4);
644     else
645       return (char *) 0;
646     d = *(c++);
647     if ((d >= '0') && (d <= '9'))
648       uu |= (d - '0');
649     else if ((d >= 'a') && (d <= 'f'))
650       uu |= (d - ('a'-10));
651     else
652       return (char *) 0;
653     *u = uu;
654   }
655   return c;
656 }
657 
658 /*
659    Pack 'void *' into a string buffer.
660 */
661 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)662 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
663   char *r = buff;
664   if ((2*sizeof(void *) + 2) > bsz) return 0;
665   *(r++) = '_';
666   r = SWIG_PackData(r,&ptr,sizeof(void *));
667   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
668   strcpy(r,name);
669   return buff;
670 }
671 
672 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)673 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
674   if (*c != '_') {
675     if (strcmp(c,"NULL") == 0) {
676       *ptr = (void *) 0;
677       return name;
678     } else {
679       return 0;
680     }
681   }
682   return SWIG_UnpackData(++c,ptr,sizeof(void *));
683 }
684 
685 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)686 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
687   char *r = buff;
688   size_t lname = (name ? strlen(name) : 0);
689   if ((2*sz + 2 + lname) > bsz) return 0;
690   *(r++) = '_';
691   r = SWIG_PackData(r,ptr,sz);
692   if (lname) {
693     strncpy(r,name,lname+1);
694   } else {
695     *r = 0;
696   }
697   return buff;
698 }
699 
700 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)701 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
702   if (*c != '_') {
703     if (strcmp(c,"NULL") == 0) {
704       memset(ptr,0,sz);
705       return name;
706     } else {
707       return 0;
708     }
709   }
710   return SWIG_UnpackData(++c,ptr,sz);
711 }
712 
713 #ifdef __cplusplus
714 }
715 #endif
716 
717 /* -----------------------------------------------------------------------------
718  * See the LICENSE file for information on copyright, usage and redistribution
719  * of SWIG, and the README file for authors - http://www.swig.org/release.html.
720  *
721  * luarun.swg
722  *
723  * This file contains the runtime support for Lua modules
724  * and includes code for managing global variables and pointer
725  * type checking.
726  * ----------------------------------------------------------------------------- */
727 
728 #ifdef __cplusplus
729 extern "C" {
730 #endif
731 
732 #include "lua.h"
733 #include "lauxlib.h"
734 #include <stdlib.h>  /* for malloc */
735 #include <assert.h>  /* for a few sanity tests */
736 
737 /* -----------------------------------------------------------------------------
738  * global swig types
739  * ----------------------------------------------------------------------------- */
740 /* Constant table */
741 #define SWIG_LUA_INT     1
742 #define SWIG_LUA_FLOAT   2
743 #define SWIG_LUA_STRING  3
744 #define SWIG_LUA_POINTER 4
745 #define SWIG_LUA_BINARY  5
746 #define SWIG_LUA_CHAR    6
747 
748 /* Structure for variable linking table */
749 typedef struct {
750   const char *name;
751   lua_CFunction get;
752   lua_CFunction set;
753 } swig_lua_var_info;
754 
755 /* Constant information structure */
756 typedef struct {
757     int type;
758     char *name;
759     long lvalue;
760     double dvalue;
761     void   *pvalue;
762     swig_type_info **ptype;
763 } swig_lua_const_info;
764 
765 typedef struct {
766   const char     *name;
767   lua_CFunction   method;
768 } swig_lua_method;
769 
770 typedef struct {
771   const char     *name;
772   lua_CFunction   getmethod;
773   lua_CFunction   setmethod;
774 } swig_lua_attribute;
775 
776 typedef struct swig_lua_class {
777   const char    *name;
778   swig_type_info   **type;
779   lua_CFunction  constructor;
780   void    (*destructor)(void *);
781   swig_lua_method   *methods;
782   swig_lua_attribute     *attributes;
783   struct swig_lua_class **bases;
784   const char **base_names;
785 } swig_lua_class;
786 
787 /* this is the struct for wrappering all pointers in SwigLua
788 */
789 typedef struct {
790   swig_type_info   *type;
791   int     own;  /* 1 if owned & must be destroyed */
792   void        *ptr;
793 } swig_lua_userdata;
794 
795 /* this is the struct for wrapping arbitary packed binary data
796 (currently it is only used for member function pointers)
797 the data ordering is similar to swig_lua_userdata, but it is currently not possible
798 to tell the two structures apart within Swig, other than by looking at the type
799 */
800 typedef struct {
801   swig_type_info   *type;
802   int     own;  /* 1 if owned & must be destroyed */
803   char data[1];       /* arbitary amount of data */
804 } swig_lua_rawdata;
805 
806 /* Common SWIG API */
807 #define SWIG_NewPointerObj(L, ptr, type, owner)       SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
808 #define SWIG_ConvertPtr(L,idx, ptr, type, flags)    SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
809 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname)  SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
810 /* for C++ member pointers, ie, member methods */
811 #define SWIG_ConvertMember(L, idx, ptr, sz, ty)       SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
812 #define SWIG_NewMemberObj(L, ptr, sz, type)      SWIG_Lua_NewPackedObj(L, ptr, sz, type)
813 
814 /* Runtime API */
815 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
816 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
817 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
818 
819 /* Contract support */
820 #define SWIG_contract_assert(expr, msg)  \
821   if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
822 
823 /* helper #defines */
824 #define SWIG_fail {goto fail;}
825 #define SWIG_fail_arg(func_name,argnum,type) \
826   {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
827   func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
828   goto fail;}
829 #define SWIG_fail_ptr(func_name,argnum,type) \
830   SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
831 #define SWIG_check_num_args(func_name,a,b) \
832   if (lua_gettop(L)<a || lua_gettop(L)>b) \
833   {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
834   goto fail;}
835 
836 
837 #define SWIG_Lua_get_table(L,n) \
838   (lua_pushstring(L, n), lua_rawget(L,-2))
839 
840 #define SWIG_Lua_add_function(L,n,f) \
841   (lua_pushstring(L, n), \
842       lua_pushcfunction(L, f), \
843       lua_rawset(L,-3))
844 
845 /* special helper for allowing 'nil' for usertypes */
846 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
847 
848 #ifdef __cplusplus
849 /* Special helper for member function pointers
850 it gets the address, casts it, then dereferences it */
851 //#define SWIG_mem_fn_as_voidptr(a)  (*((char**)&(a)))
852 #endif
853 
854 /* storing/access of swig_module_info */
855 SWIGRUNTIME swig_module_info *
SWIG_Lua_GetModule(lua_State * L)856 SWIG_Lua_GetModule(lua_State* L) {
857   swig_module_info *ret = 0;
858   lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
859   lua_rawget(L,LUA_REGISTRYINDEX);
860   if (lua_islightuserdata(L,-1))
861     ret=(swig_module_info*)lua_touserdata(L,-1);
862   lua_pop(L,1);  /* tidy */
863   return ret;
864 }
865 
866 SWIGRUNTIME void
SWIG_Lua_SetModule(lua_State * L,swig_module_info * module)867 SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
868   /* add this all into the Lua registry: */
869   lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
870   lua_pushlightuserdata(L,(void*)module);
871   lua_rawset(L,LUA_REGISTRYINDEX);
872 }
873 
874 /* -----------------------------------------------------------------------------
875  * global variable support code: modules
876  * ----------------------------------------------------------------------------- */
877 
878 /* this function is called when trying to set an immutable.
879 default value is to print an error.
880 This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
SWIG_Lua_set_immutable(lua_State * L)881 SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
882 {
883 /*  there should be 1 param passed in: the new value */
884 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
885   lua_pop(L,1);  /* remove it */
886   lua_pushstring(L,"This variable is immutable");
887   lua_error(L);
888 #endif
889     return 0;   /* should not return anything */
890 }
891 
892 /* the module.get method used for getting linked data */
SWIG_Lua_module_get(lua_State * L)893 SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
894 {
895 /*  there should be 2 params passed in
896   (1) table (not the meta table)
897   (2) string name of the attribute
898   printf("SWIG_Lua_module_get %p(%s) '%s'\n",
899    lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
900    lua_tostring(L,2));
901 */
902   /* get the metatable */
903   assert(lua_istable(L,1));  /* just in case */
904   lua_getmetatable(L,1);  /* get the metatable */
905   assert(lua_istable(L,-1));  /* just in case */
906   SWIG_Lua_get_table(L,".get");  /* get the .get table */
907   lua_remove(L,3);  /* remove metatable */
908   if (lua_istable(L,-1))
909   {
910     /* look for the key in the .get table */
911     lua_pushvalue(L,2);  /* key */
912     lua_rawget(L,-2);
913     lua_remove(L,3);  /* remove .get */
914     if (lua_iscfunction(L,-1))
915     {  /* found it so call the fn & return its value */
916       lua_call(L,0,1);
917       return 1;
918     }
919     lua_pop(L,1);  /* remove the top */
920   }
921   lua_pop(L,1);  /* remove the .get */
922   lua_pushnil(L);  /* return a nil */
923     return 1;
924 }
925 
926 /* the module.set method used for setting linked data */
SWIG_Lua_module_set(lua_State * L)927 SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
928 {
929 /*  there should be 3 params passed in
930   (1) table (not the meta table)
931   (2) string name of the attribute
932   (3) any for the new value
933 */
934   /* get the metatable */
935   assert(lua_istable(L,1));  /* just in case */
936   lua_getmetatable(L,1);  /* get the metatable */
937   assert(lua_istable(L,-1));  /* just in case */
938   SWIG_Lua_get_table(L,".set");  /* get the .set table */
939   lua_remove(L,4);  /* remove metatable */
940   if (lua_istable(L,-1))
941   {
942     /* look for the key in the .set table */
943     lua_pushvalue(L,2);  /* key */
944     lua_rawget(L,-2);
945     lua_remove(L,4);  /* remove .set */
946     if (lua_iscfunction(L,-1))
947     {  /* found it so call the fn & return its value */
948       lua_pushvalue(L,3);  /* value */
949       lua_call(L,1,0);
950       return 0;
951     }
952   }
953   lua_settop(L,3);  /* reset back to start */
954   /* we now have the table, key & new value, so just set directly */
955   lua_rawset(L,1);  /* add direct */
956   return 0;
957 }
958 
959 /* registering a module in lua */
SWIG_Lua_module_begin(lua_State * L,const char * name)960 SWIGINTERN void  SWIG_Lua_module_begin(lua_State* L,const char* name)
961 {
962   assert(lua_istable(L,-1));  /* just in case */
963   lua_pushstring(L,name);
964   lua_newtable(L);   /* the table */
965   /* add meta table */
966   lua_newtable(L);    /* the meta table */
967   SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
968   SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
969   lua_pushstring(L,".get");
970   lua_newtable(L);    /* the .get table */
971   lua_rawset(L,-3);  /* add .get into metatable */
972   lua_pushstring(L,".set");
973   lua_newtable(L);    /* the .set table */
974   lua_rawset(L,-3);  /* add .set into metatable */
975   lua_setmetatable(L,-2);  /* sets meta table in module */
976   lua_rawset(L,-3);        /* add module into parent */
977   SWIG_Lua_get_table(L,name);   /* get the table back out */
978 }
979 
980 /* ending the register */
SWIG_Lua_module_end(lua_State * L)981 SWIGINTERN void  SWIG_Lua_module_end(lua_State* L)
982 {
983   lua_pop(L,1);       /* tidy stack (remove module) */
984 }
985 
986 /* adding a linked variable to the module */
SWIG_Lua_module_add_variable(lua_State * L,const char * name,lua_CFunction getFn,lua_CFunction setFn)987 SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
988 {
989   assert(lua_istable(L,-1));  /* just in case */
990   lua_getmetatable(L,-1);  /* get the metatable */
991   assert(lua_istable(L,-1));  /* just in case */
992   SWIG_Lua_get_table(L,".get"); /* find the .get table */
993   assert(lua_istable(L,-1));  /* should be a table: */
994   SWIG_Lua_add_function(L,name,getFn);
995   lua_pop(L,1);       /* tidy stack (remove table) */
996   if (setFn)  /* if there is a set fn */
997   {
998     SWIG_Lua_get_table(L,".set"); /* find the .set table */
999     assert(lua_istable(L,-1));  /* should be a table: */
1000     SWIG_Lua_add_function(L,name,setFn);
1001     lua_pop(L,1);       /* tidy stack (remove table) */
1002   }
1003   lua_pop(L,1);       /* tidy stack (remove meta) */
1004 }
1005 
1006 /* adding a function module */
SWIG_Lua_module_add_function(lua_State * L,const char * name,lua_CFunction fn)1007 SWIGINTERN void  SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
1008 {
1009   SWIG_Lua_add_function(L,name,fn);
1010 }
1011 
1012 /* -----------------------------------------------------------------------------
1013  * global variable support code: classes
1014  * ----------------------------------------------------------------------------- */
1015 
1016 /* the class.get method, performs the lookup of class attributes */
SWIG_Lua_class_get(lua_State * L)1017 SWIGINTERN int  SWIG_Lua_class_get(lua_State* L)
1018 {
1019 /*  there should be 2 params passed in
1020   (1) userdata (not the meta table)
1021   (2) string name of the attribute
1022 */
1023   assert(lua_isuserdata(L,-2));  /* just in case */
1024   lua_getmetatable(L,-2);    /* get the meta table */
1025   assert(lua_istable(L,-1));  /* just in case */
1026   SWIG_Lua_get_table(L,".get"); /* find the .get table */
1027   assert(lua_istable(L,-1));  /* just in case */
1028   /* look for the key in the .get table */
1029   lua_pushvalue(L,2);  /* key */
1030   lua_rawget(L,-2);
1031   lua_remove(L,-2); /* stack tidy, remove .get table */
1032   if (lua_iscfunction(L,-1))
1033   {  /* found it so call the fn & return its value */
1034     lua_pushvalue(L,1);  /* the userdata */
1035     lua_call(L,1,1);  /* 1 value in (userdata),1 out (result) */
1036     lua_remove(L,-2); /* stack tidy, remove metatable */
1037     return 1;
1038   }
1039   lua_pop(L,1);  /* remove whatever was there */
1040   /* ok, so try the .fn table */
1041   SWIG_Lua_get_table(L,".fn"); /* find the .get table */
1042   assert(lua_istable(L,-1));  /* just in case */
1043   lua_pushvalue(L,2);  /* key */
1044   lua_rawget(L,-2);  /* look for the fn */
1045   lua_remove(L,-2); /* stack tidy, remove .fn table */
1046   if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
1047   {  /* found it so return the fn & let lua call it */
1048     lua_remove(L,-2); /* stack tidy, remove metatable */
1049     return 1;
1050   }
1051   lua_pop(L,1);  /* remove whatever was there */
1052   /* NEW: looks for the __getitem() fn
1053   this is a user provided get fn */
1054   SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
1055   if (lua_iscfunction(L,-1))  /* if its there */
1056   {  /* found it so call the fn & return its value */
1057     lua_pushvalue(L,1);  /* the userdata */
1058     lua_pushvalue(L,2);  /* the parameter */
1059     lua_call(L,2,1);  /* 2 value in (userdata),1 out (result) */
1060     lua_remove(L,-2); /* stack tidy, remove metatable */
1061     return 1;
1062   }
1063   return 0;  /* sorry not known */
1064 }
1065 
1066 /* the class.set method, performs the lookup of class attributes */
SWIG_Lua_class_set(lua_State * L)1067 SWIGINTERN int  SWIG_Lua_class_set(lua_State* L)
1068 {
1069 /*  there should be 3 params passed in
1070   (1) table (not the meta table)
1071   (2) string name of the attribute
1072   (3) any for the new value
1073 printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
1074       lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
1075       lua_tostring(L,2),
1076       lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/
1077 
1078   assert(lua_isuserdata(L,1));  /* just in case */
1079   lua_getmetatable(L,1);    /* get the meta table */
1080   assert(lua_istable(L,-1));  /* just in case */
1081 
1082   SWIG_Lua_get_table(L,".set"); /* find the .set table */
1083   if (lua_istable(L,-1))
1084   {
1085     /* look for the key in the .set table */
1086     lua_pushvalue(L,2);  /* key */
1087     lua_rawget(L,-2);
1088     if (lua_iscfunction(L,-1))
1089     {  /* found it so call the fn & return its value */
1090       lua_pushvalue(L,1);  /* userdata */
1091       lua_pushvalue(L,3);  /* value */
1092       lua_call(L,2,0);
1093       return 0;
1094     }
1095     lua_pop(L,1);  /* remove the value */
1096   }
1097   lua_pop(L,1);  /* remove the value .set table */
1098   /* NEW: looks for the __setitem() fn
1099   this is a user provided set fn */
1100   SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
1101   if (lua_iscfunction(L,-1))  /* if its there */
1102   {  /* found it so call the fn & return its value */
1103     lua_pushvalue(L,1);  /* the userdata */
1104     lua_pushvalue(L,2);  /* the parameter */
1105     lua_pushvalue(L,3);  /* the value */
1106     lua_call(L,3,0);  /* 3 values in ,0 out */
1107     lua_remove(L,-2); /* stack tidy, remove metatable */
1108     return 1;
1109   }
1110   return 0;
1111 }
1112 
1113 /* the class.destruct method called by the interpreter */
SWIG_Lua_class_destruct(lua_State * L)1114 SWIGINTERN int  SWIG_Lua_class_destruct(lua_State* L)
1115 {
1116 /*  there should be 1 params passed in
1117   (1) userdata (not the meta table) */
1118   swig_lua_userdata* usr;
1119   swig_lua_class* clss;
1120   assert(lua_isuserdata(L,-1));  /* just in case */
1121   usr=(swig_lua_userdata*)lua_touserdata(L,-1);  /* get it */
1122   /* if must be destroyed & has a destructor */
1123   if (usr->own) /* if must be destroyed */
1124   {
1125     clss=(swig_lua_class*)usr->type->clientdata;  /* get the class */
1126     if (clss && clss->destructor)  /* there is a destroy fn */
1127     {
1128       clss->destructor(usr->ptr);  /* bye bye */
1129     }
1130   }
1131   return 0;
1132 }
1133 
1134 /* gets the swig class registry (or creates it) */
SWIG_Lua_get_class_registry(lua_State * L)1135 SWIGINTERN void  SWIG_Lua_get_class_registry(lua_State* L)
1136 {
1137   /* add this all into the swig registry: */
1138   lua_pushstring(L,"SWIG");
1139   lua_rawget(L,LUA_REGISTRYINDEX);  /* get the registry */
1140   if (!lua_istable(L,-1))  /* not there */
1141   {  /* must be first time, so add it */
1142     lua_pop(L,1);  /* remove the result */
1143     lua_pushstring(L,"SWIG");
1144     lua_newtable(L);
1145     lua_rawset(L,LUA_REGISTRYINDEX);
1146     /* then get it */
1147     lua_pushstring(L,"SWIG");
1148     lua_rawget(L,LUA_REGISTRYINDEX);
1149   }
1150 }
1151 
1152 /* helper fn to get the classes metatable from the register */
SWIG_Lua_get_class_metatable(lua_State * L,const char * cname)1153 SWIGINTERN void  SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
1154 {
1155   SWIG_Lua_get_class_registry(L);  /* get the registry */
1156   lua_pushstring(L,cname);  /* get the name */
1157   lua_rawget(L,-2);    /* get it */
1158   lua_remove(L,-2);    /* tidy up (remove registry) */
1159 }
1160 
1161 /* helper add a variable to a registered class */
SWIG_Lua_add_class_variable(lua_State * L,const char * name,lua_CFunction getFn,lua_CFunction setFn)1162 SWIGINTERN void  SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
1163 {
1164   assert(lua_istable(L,-1));  /* just in case */
1165   SWIG_Lua_get_table(L,".get"); /* find the .get table */
1166   assert(lua_istable(L,-1));  /* just in case */
1167   SWIG_Lua_add_function(L,name,getFn);
1168   lua_pop(L,1);       /* tidy stack (remove table) */
1169   if (setFn)
1170   {
1171     SWIG_Lua_get_table(L,".set"); /* find the .set table */
1172     assert(lua_istable(L,-1));  /* just in case */
1173     SWIG_Lua_add_function(L,name,setFn);
1174     lua_pop(L,1);       /* tidy stack (remove table) */
1175   }
1176 }
1177 
1178 /* helper to recursively add class details (attributes & operations) */
SWIG_Lua_add_class_details(lua_State * L,swig_lua_class * clss)1179 SWIGINTERN void  SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
1180 {
1181   int i;
1182   /* call all the base classes first: we can then override these later: */
1183   for(i=0;clss->bases[i];i++)
1184   {
1185     SWIG_Lua_add_class_details(L,clss->bases[i]);
1186   }
1187   /* add fns */
1188   for(i=0;clss->attributes[i].name;i++){
1189     SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
1190   }
1191   /* add methods to the metatable */
1192   SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
1193   assert(lua_istable(L,-1));  /* just in case */
1194   for(i=0;clss->methods[i].name;i++){
1195     SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
1196   }
1197   lua_pop(L,1);       /* tidy stack (remove table) */
1198   /*   add operator overloads
1199     these look ANY method which start with "__" and assume they
1200     are operator overloads & add them to the metatable
1201     (this might mess up is someone defines a method __gc (the destructor)*/
1202   for(i=0;clss->methods[i].name;i++){
1203     if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
1204       SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
1205     }
1206   }
1207 }
1208 
1209 /* set up the base classes pointers.
1210 Each class structure has a list of pointers to the base class structures.
1211 This function fills them.
1212 It cannot be done at compile time, as this will not work with hireachies
1213 spread over more than one swig file.
1214 Therefore it must be done at runtime, querying the SWIG type system.
1215 */
SWIG_Lua_init_base_class(lua_State * L,swig_lua_class * clss)1216 SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
1217 {
1218   int i=0;
1219   swig_module_info* module=SWIG_GetModule(L);
1220   for(i=0;clss->base_names[i];i++)
1221   {
1222     if (clss->bases[i]==0) /* not found yet */
1223     {
1224       /* lookup and cache the base class */
1225       swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
1226       if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
1227     }
1228   }
1229 }
1230 
1231 /* performs the entire class registration process */
SWIG_Lua_class_register(lua_State * L,swig_lua_class * clss)1232 SWIGINTERN void  SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
1233 {
1234   /*  add its constructor to module with the name of the class
1235   so you can do MyClass(...) as well as new_MyClass(...)
1236   BUT only if a constructor is defined
1237   (this overcomes the problem of pure virtual classes without constructors)*/
1238   if (clss->constructor)
1239     SWIG_Lua_add_function(L,clss->name,clss->constructor);
1240 
1241   SWIG_Lua_get_class_registry(L);  /* get the registry */
1242   lua_pushstring(L,clss->name);  /* get the name */
1243   lua_newtable(L);    /* create the metatable */
1244   /* add string of class name called ".type" */
1245   lua_pushstring(L,".type");
1246   lua_pushstring(L,clss->name);
1247   lua_rawset(L,-3);
1248   /* add a table called ".get" */
1249   lua_pushstring(L,".get");
1250   lua_newtable(L);
1251   lua_rawset(L,-3);
1252   /* add a table called ".set" */
1253   lua_pushstring(L,".set");
1254   lua_newtable(L);
1255   lua_rawset(L,-3);
1256   /* add a table called ".fn" */
1257   lua_pushstring(L,".fn");
1258   lua_newtable(L);
1259   lua_rawset(L,-3);
1260   /* add accessor fns for using the .get,.set&.fn */
1261   SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
1262   SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
1263   SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
1264   /* add it */
1265   lua_rawset(L,-3);  /* metatable into registry */
1266   lua_pop(L,1);      /* tidy stack (remove registry) */
1267 
1268   SWIG_Lua_get_class_metatable(L,clss->name);
1269   SWIG_Lua_add_class_details(L,clss);  /* recursive adding of details (atts & ops) */
1270   lua_pop(L,1);      /* tidy stack (remove class metatable) */
1271 }
1272 
1273 /* -----------------------------------------------------------------------------
1274  * Class/structure conversion fns
1275  * ----------------------------------------------------------------------------- */
1276 
1277 /* helper to add metatable to new lua object */
_SWIG_Lua_AddMetatable(lua_State * L,swig_type_info * type)1278 SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
1279 {
1280   if (type->clientdata)  /* there is clientdata: so add the metatable */
1281   {
1282     SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
1283     if (lua_istable(L,-1))
1284     {
1285       lua_setmetatable(L,-2);
1286     }
1287     else
1288     {
1289       lua_pop(L,1);
1290     }
1291   }
1292 }
1293 
1294 /* pushes a new object into the lua stack */
SWIG_Lua_NewPointerObj(lua_State * L,void * ptr,swig_type_info * type,int own)1295 SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
1296 {
1297   swig_lua_userdata* usr;
1298   if (!ptr){
1299     lua_pushnil(L);
1300     return;
1301   }
1302   usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata));  /* get data */
1303   usr->ptr=ptr;  /* set the ptr */
1304   usr->type=type;
1305   usr->own=own;
1306   _SWIG_Lua_AddMetatable(L,type); /* add metatable */
1307 }
1308 
1309 /* takes a object from the lua stack & converts it into an object of the correct type
1310  (if possible) */
SWIG_Lua_ConvertPtr(lua_State * L,int index,void ** ptr,swig_type_info * type,int flags)1311 SWIGRUNTIME int  SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
1312 {
1313   swig_lua_userdata* usr;
1314   swig_cast_info *cast;
1315   if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;}    /* special case: lua nil => NULL pointer */
1316   usr=(swig_lua_userdata*)lua_touserdata(L,index);  /* get data */
1317   if (usr)
1318   {
1319     if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
1320     {
1321         usr->own=0;
1322     }
1323     if (!type)            /* special cast void*, no casting fn */
1324     {
1325       *ptr=usr->ptr;
1326       return SWIG_OK; /* ok */
1327     }
1328     cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
1329     if (cast)
1330     {
1331       int newmemory = 0;
1332       *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
1333       assert(!newmemory); /* newmemory handling not yet implemented */
1334       return SWIG_OK;  /* ok */
1335     }
1336   }
1337   return SWIG_ERROR;  /* error */
1338 }
1339 
SWIG_Lua_MustGetPtr(lua_State * L,int index,swig_type_info * type,int flags,int argnum,const char * func_name)1340 SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
1341        int argnum,const char* func_name){
1342   void* result;
1343   if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
1344     lua_pushfstring(L,"Error in %s, expected a %s at argument number %d\n",
1345       func_name,(type && type->str)?type->str:"void*",argnum);
1346     lua_error(L);
1347   }
1348   return result;
1349 }
1350 
1351 /* pushes a packed userdata. user for member fn pointers only */
SWIG_Lua_NewPackedObj(lua_State * L,void * ptr,size_t size,swig_type_info * type)1352 SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
1353 {
1354   swig_lua_rawdata* raw;
1355   assert(ptr); /* not acceptable to pass in a NULL value */
1356   raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size);  /* alloc data */
1357   raw->type=type;
1358   raw->own=0;
1359   memcpy(raw->data,ptr,size); /* copy the data */
1360   _SWIG_Lua_AddMetatable(L,type); /* add metatable */
1361 }
1362 
1363 /* converts a packed userdata. user for member fn pointers only */
SWIG_Lua_ConvertPacked(lua_State * L,int index,void * ptr,size_t size,swig_type_info * type)1364 SWIGRUNTIME int  SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
1365 {
1366   swig_lua_rawdata* raw;
1367   raw=(swig_lua_rawdata*)lua_touserdata(L,index);  /* get data */
1368   if (!raw) return SWIG_ERROR;  /* error */
1369   if (type==0 || type==raw->type) /* void* or identical type */
1370   {
1371     memcpy(ptr,raw->data,size); /* copy it */
1372     return SWIG_OK; /* ok */
1373   }
1374   return SWIG_ERROR;  /* error */
1375 }
1376 
1377 /* a function to get the typestring of a piece of data */
SWIG_Lua_typename(lua_State * L,int tp)1378 SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
1379 {
1380   swig_lua_userdata* usr;
1381   if (lua_isuserdata(L,tp))
1382   {
1383     usr=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
1384     if (usr && usr->type && usr->type->str)
1385       return usr->type->str;
1386     return "userdata (unknown type)";
1387   }
1388   return lua_typename(L,lua_type(L,tp));
1389 }
1390 
1391 /* lua callable function to get the userdata's type */
SWIG_Lua_type(lua_State * L)1392 SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
1393 {
1394   lua_pushstring(L,SWIG_Lua_typename(L,1));
1395   return 1;
1396 }
1397 
1398 /* lua callable function to compare userdata's value
1399 the issue is that two userdata may point to the same thing
1400 but to lua, they are different objects */
SWIG_Lua_equal(lua_State * L)1401 SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
1402 {
1403   int result;
1404   swig_lua_userdata *usr1,*usr2;
1405   if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))  /* just in case */
1406     return 0;  /* nil reply */
1407   usr1=(swig_lua_userdata*)lua_touserdata(L,1);  /* get data */
1408   usr2=(swig_lua_userdata*)lua_touserdata(L,2);  /* get data */
1409   /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
1410   result=(usr1->ptr==usr2->ptr);
1411    lua_pushboolean(L,result);
1412   return 1;
1413 }
1414 
1415 /* -----------------------------------------------------------------------------
1416  * global variable support code: class/struct typemap functions
1417  * ----------------------------------------------------------------------------- */
1418 
1419 /* Install Constants */
1420 SWIGINTERN void
SWIG_Lua_InstallConstants(lua_State * L,swig_lua_const_info constants[])1421 SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
1422   int i;
1423   for (i = 0; constants[i].type; i++) {
1424     switch(constants[i].type) {
1425     case SWIG_LUA_INT:
1426       lua_pushstring(L,constants[i].name);
1427       lua_pushnumber(L,(lua_Number)constants[i].lvalue);
1428       lua_rawset(L,-3);
1429       break;
1430     case SWIG_LUA_FLOAT:
1431       lua_pushstring(L,constants[i].name);
1432       lua_pushnumber(L,(lua_Number)constants[i].dvalue);
1433       lua_rawset(L,-3);
1434       break;
1435     case SWIG_LUA_CHAR:
1436       lua_pushstring(L,constants[i].name);
1437       lua_pushfstring(L,"%c",(char)constants[i].lvalue);
1438       lua_rawset(L,-3);
1439       break;
1440     case SWIG_LUA_STRING:
1441       lua_pushstring(L,constants[i].name);
1442       lua_pushstring(L,(char *) constants[i].pvalue);
1443       lua_rawset(L,-3);
1444       break;
1445     case SWIG_LUA_POINTER:
1446       lua_pushstring(L,constants[i].name);
1447       SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
1448       lua_rawset(L,-3);
1449       break;
1450     case SWIG_LUA_BINARY:
1451       lua_pushstring(L,constants[i].name);
1452       SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
1453       lua_rawset(L,-3);
1454       break;
1455     default:
1456       break;
1457     }
1458   }
1459 }
1460 
1461 /* -----------------------------------------------------------------------------
1462  * executing lua code from within the wrapper
1463  * ----------------------------------------------------------------------------- */
1464 
1465 #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
1466 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
1467 #endif
1468 /* Executes a C string in Lua a really simple way of calling lua from C
1469 Unfortunately lua keeps changing its API's, so we need a conditional compile
1470 In lua 5.0.X its lua_dostring()
1471 In lua 5.1.X its luaL_dostring()
1472 */
1473 SWIGINTERN int
SWIG_Lua_dostring(lua_State * L,const char * str)1474 SWIG_Lua_dostring(lua_State *L, const char* str) {
1475   int ok,top;
1476   if (str==0 || str[0]==0) return 0; /* nothing to do */
1477   top=lua_gettop(L); /* save stack */
1478 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
1479   ok=luaL_dostring(L,str);	/* looks like this is lua 5.1.X or later, good */
1480 #else
1481   ok=lua_dostring(L,str);	/* might be lua 5.0.x, using lua_dostring */
1482 #endif
1483   if (ok!=0) {
1484     SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
1485   }
1486   lua_settop(L,top); /* restore the stack */
1487   return ok;
1488 }
1489 
1490 #ifdef __cplusplus
1491 }
1492 #endif
1493 
1494 /* ------------------------------ end luarun.swg  ------------------------------ */
1495 
1496 
1497 /* -------- TYPES TABLE (BEGIN) -------- */
1498 
1499 #define SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t swig_types[0]
1500 #define SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t swig_types[1]
1501 #define SWIGTYPE_p_love_sdlmixer__Music swig_types[2]
1502 #define SWIGTYPE_p_love_sdlmixer__Sound swig_types[3]
1503 static swig_type_info *swig_types[5];
1504 static swig_module_info swig_module = {swig_types, 4, 0, 0, 0, 0};
1505 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1506 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1507 
1508 /* -------- TYPES TABLE (END) -------- */
1509 
1510 #define SWIG_name      "mod_sdlmixer"
1511 #define SWIG_init      luaopen_mod_sdlmixer
1512 #define SWIG_init_user luaopen_mod_sdlmixer_user
1513 
1514 #define SWIG_LUACODE   luaopen_mod_sdlmixer_luacode
1515 
1516 
1517 namespace swig {
1518 typedef struct{} LANGUAGE_OBJ;
1519 }
1520 
1521 #include "love_sdlmixer.h"
1522 #include <boost/shared_ptr.hpp>
1523 #include "Sound.h"
1524 #include "Music.h"
1525 #ifdef __cplusplus
1526 extern "C" {
1527 #endif
_wrap_Sound_setVolume(lua_State * L)1528 static int _wrap_Sound_setVolume(lua_State* L) {
1529   int SWIG_arg = -1;
1530   love_sdlmixer::Sound *arg1 = (love_sdlmixer::Sound *) 0 ;
1531   float arg2 ;
1532 
1533   SWIG_check_num_args("setVolume",2,2)
1534   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setVolume",1,"love_sdlmixer::Sound *");
1535   if(!lua_isnumber(L,2)) SWIG_fail_arg("setVolume",2,"float");
1536 
1537   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_love_sdlmixer__Sound,0))){
1538     SWIG_fail_ptr("Sound_setVolume",1,SWIGTYPE_p_love_sdlmixer__Sound);
1539   }
1540 
1541   arg2 = (float)lua_tonumber(L, 2);
1542   (arg1)->setVolume(arg2);
1543   SWIG_arg=0;
1544 
1545   return SWIG_arg;
1546 
1547   if(0) SWIG_fail;
1548 
1549 fail:
1550   lua_error(L);
1551   return SWIG_arg;
1552 }
1553 
1554 
_wrap_delete_Sound(lua_State * L)1555 static int _wrap_delete_Sound(lua_State* L) {
1556   int SWIG_arg = -1;
1557   love_sdlmixer::Sound *arg1 = (love_sdlmixer::Sound *) 0 ;
1558 
1559   SWIG_check_num_args("love_sdlmixer::Sound::~Sound",1,1)
1560   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("love_sdlmixer::Sound::~Sound",1,"love_sdlmixer::Sound *");
1561 
1562   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_love_sdlmixer__Sound,SWIG_POINTER_DISOWN))){
1563     SWIG_fail_ptr("delete_Sound",1,SWIGTYPE_p_love_sdlmixer__Sound);
1564   }
1565 
1566   delete arg1;
1567 
1568   SWIG_arg=0;
1569 
1570   return SWIG_arg;
1571 
1572   if(0) SWIG_fail;
1573 
1574 fail:
1575   lua_error(L);
1576   return SWIG_arg;
1577 }
1578 
1579 
swig_delete_Sound(void * obj)1580 static void swig_delete_Sound(void *obj) {
1581 love_sdlmixer::Sound *arg1 = (love_sdlmixer::Sound *) obj;
1582 delete arg1;
1583 }
1584 static swig_lua_method swig_love_sdlmixer_Sound_methods[] = {
1585     {"setVolume", _wrap_Sound_setVolume},
1586     {0,0}
1587 };
1588 static swig_lua_attribute swig_love_sdlmixer_Sound_attributes[] = {
1589     {0,0,0}
1590 };
1591 static swig_lua_class *swig_love_sdlmixer_Sound_bases[] = {0};
1592 static const char *swig_love_sdlmixer_Sound_base_names[] = {0};
1593 static swig_lua_class _wrap_class_love_sdlmixer_Sound = { "Sound", &SWIGTYPE_p_love_sdlmixer__Sound,0, swig_delete_Sound, swig_love_sdlmixer_Sound_methods, swig_love_sdlmixer_Sound_attributes, swig_love_sdlmixer_Sound_bases, swig_love_sdlmixer_Sound_base_names };
1594 
_wrap_SmartSound___deref__(lua_State * L)1595 static int _wrap_SmartSound___deref__(lua_State* L) {
1596   int SWIG_arg = -1;
1597   boost::shared_ptr< love_sdlmixer::Sound > *arg1 = (boost::shared_ptr< love_sdlmixer::Sound > *) 0 ;
1598   love_sdlmixer::Sound *result = 0 ;
1599 
1600   SWIG_check_num_args("operator ->",1,1)
1601   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("operator ->",1,"boost::shared_ptr< love_sdlmixer::Sound > const *");
1602 
1603   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0))){
1604     SWIG_fail_ptr("SmartSound___deref__",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
1605   }
1606 
1607   result = (love_sdlmixer::Sound *)((boost::shared_ptr< love_sdlmixer::Sound > const *)arg1)->operator ->();
1608   SWIG_arg=0;
1609   SWIG_NewPointerObj(L,result,SWIGTYPE_p_love_sdlmixer__Sound,0); SWIG_arg++;
1610   return SWIG_arg;
1611 
1612   if(0) SWIG_fail;
1613 
1614 fail:
1615   lua_error(L);
1616   return SWIG_arg;
1617 }
1618 
1619 
_wrap_delete_SmartSound(lua_State * L)1620 static int _wrap_delete_SmartSound(lua_State* L) {
1621   int SWIG_arg = -1;
1622   boost::shared_ptr< love_sdlmixer::Sound > *arg1 = (boost::shared_ptr< love_sdlmixer::Sound > *) 0 ;
1623 
1624   SWIG_check_num_args("boost::shared_ptr<(love_sdlmixer::Sound)>::~shared_ptr<(love_sdlmixer::Sound)>",1,1)
1625   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("boost::shared_ptr<(love_sdlmixer::Sound)>::~shared_ptr<(love_sdlmixer::Sound)>",1,"boost::shared_ptr< love_sdlmixer::Sound > *");
1626 
1627   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,SWIG_POINTER_DISOWN))){
1628     SWIG_fail_ptr("delete_SmartSound",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
1629   }
1630 
1631   delete arg1;
1632 
1633   SWIG_arg=0;
1634 
1635   return SWIG_arg;
1636 
1637   if(0) SWIG_fail;
1638 
1639 fail:
1640   lua_error(L);
1641   return SWIG_arg;
1642 }
1643 
1644 
_wrap_SmartSound_setVolume(lua_State * L)1645 static int _wrap_SmartSound_setVolume(lua_State* L) {
1646   int SWIG_arg = -1;
1647   boost::shared_ptr< love_sdlmixer::Sound > *arg1 = (boost::shared_ptr< love_sdlmixer::Sound > *) 0 ;
1648   float arg2 ;
1649 
1650   SWIG_check_num_args("setVolume",2,2)
1651   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("setVolume",1,"boost::shared_ptr< love_sdlmixer::Sound > *");
1652   if(!lua_isnumber(L,2)) SWIG_fail_arg("setVolume",2,"float");
1653 
1654   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0))){
1655     SWIG_fail_ptr("SmartSound_setVolume",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
1656   }
1657 
1658   arg2 = (float)lua_tonumber(L, 2);
1659   (*arg1)->setVolume(arg2);
1660   SWIG_arg=0;
1661 
1662   return SWIG_arg;
1663 
1664   if(0) SWIG_fail;
1665 
1666 fail:
1667   lua_error(L);
1668   return SWIG_arg;
1669 }
1670 
1671 
swig_delete_SmartSound(void * obj)1672 static void swig_delete_SmartSound(void *obj) {
1673 boost::shared_ptr< love_sdlmixer::Sound > *arg1 = (boost::shared_ptr< love_sdlmixer::Sound > *) obj;
1674 delete arg1;
1675 }
1676 static swig_lua_method swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__methods[] = {
1677     {"__deref__", _wrap_SmartSound___deref__},
1678     {"setVolume", _wrap_SmartSound_setVolume},
1679     {0,0}
1680 };
1681 static swig_lua_attribute swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__attributes[] = {
1682     {0,0,0}
1683 };
1684 static swig_lua_class *swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__bases[] = {0};
1685 static const char *swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__base_names[] = {0};
1686 static swig_lua_class _wrap_class_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg_ = { "SmartSound", &SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0, swig_delete_SmartSound, swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__methods, swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__attributes, swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__bases, swig_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg__base_names };
1687 
_wrap_delete_Music(lua_State * L)1688 static int _wrap_delete_Music(lua_State* L) {
1689   int SWIG_arg = -1;
1690   love_sdlmixer::Music *arg1 = (love_sdlmixer::Music *) 0 ;
1691 
1692   SWIG_check_num_args("love_sdlmixer::Music::~Music",1,1)
1693   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("love_sdlmixer::Music::~Music",1,"love_sdlmixer::Music *");
1694 
1695   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_love_sdlmixer__Music,SWIG_POINTER_DISOWN))){
1696     SWIG_fail_ptr("delete_Music",1,SWIGTYPE_p_love_sdlmixer__Music);
1697   }
1698 
1699   delete arg1;
1700 
1701   SWIG_arg=0;
1702 
1703   return SWIG_arg;
1704 
1705   if(0) SWIG_fail;
1706 
1707 fail:
1708   lua_error(L);
1709   return SWIG_arg;
1710 }
1711 
1712 
swig_delete_Music(void * obj)1713 static void swig_delete_Music(void *obj) {
1714 love_sdlmixer::Music *arg1 = (love_sdlmixer::Music *) obj;
1715 delete arg1;
1716 }
1717 static swig_lua_method swig_love_sdlmixer_Music_methods[] = {
1718     {0,0}
1719 };
1720 static swig_lua_attribute swig_love_sdlmixer_Music_attributes[] = {
1721     {0,0,0}
1722 };
1723 static swig_lua_class *swig_love_sdlmixer_Music_bases[] = {0};
1724 static const char *swig_love_sdlmixer_Music_base_names[] = {0};
1725 static swig_lua_class _wrap_class_love_sdlmixer_Music = { "Music", &SWIGTYPE_p_love_sdlmixer__Music,0, swig_delete_Music, swig_love_sdlmixer_Music_methods, swig_love_sdlmixer_Music_attributes, swig_love_sdlmixer_Music_bases, swig_love_sdlmixer_Music_base_names };
1726 
_wrap_SmartMusic___deref__(lua_State * L)1727 static int _wrap_SmartMusic___deref__(lua_State* L) {
1728   int SWIG_arg = -1;
1729   boost::shared_ptr< love_sdlmixer::Music > *arg1 = (boost::shared_ptr< love_sdlmixer::Music > *) 0 ;
1730   love_sdlmixer::Music *result = 0 ;
1731 
1732   SWIG_check_num_args("operator ->",1,1)
1733   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("operator ->",1,"boost::shared_ptr< love_sdlmixer::Music > const *");
1734 
1735   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,0))){
1736     SWIG_fail_ptr("SmartMusic___deref__",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t);
1737   }
1738 
1739   result = (love_sdlmixer::Music *)((boost::shared_ptr< love_sdlmixer::Music > const *)arg1)->operator ->();
1740   SWIG_arg=0;
1741   SWIG_NewPointerObj(L,result,SWIGTYPE_p_love_sdlmixer__Music,0); SWIG_arg++;
1742   return SWIG_arg;
1743 
1744   if(0) SWIG_fail;
1745 
1746 fail:
1747   lua_error(L);
1748   return SWIG_arg;
1749 }
1750 
1751 
_wrap_delete_SmartMusic(lua_State * L)1752 static int _wrap_delete_SmartMusic(lua_State* L) {
1753   int SWIG_arg = -1;
1754   boost::shared_ptr< love_sdlmixer::Music > *arg1 = (boost::shared_ptr< love_sdlmixer::Music > *) 0 ;
1755 
1756   SWIG_check_num_args("boost::shared_ptr<(love_sdlmixer::Music)>::~shared_ptr<(love_sdlmixer::Music)>",1,1)
1757   if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("boost::shared_ptr<(love_sdlmixer::Music)>::~shared_ptr<(love_sdlmixer::Music)>",1,"boost::shared_ptr< love_sdlmixer::Music > *");
1758 
1759   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,SWIG_POINTER_DISOWN))){
1760     SWIG_fail_ptr("delete_SmartMusic",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t);
1761   }
1762 
1763   delete arg1;
1764 
1765   SWIG_arg=0;
1766 
1767   return SWIG_arg;
1768 
1769   if(0) SWIG_fail;
1770 
1771 fail:
1772   lua_error(L);
1773   return SWIG_arg;
1774 }
1775 
1776 
swig_delete_SmartMusic(void * obj)1777 static void swig_delete_SmartMusic(void *obj) {
1778 boost::shared_ptr< love_sdlmixer::Music > *arg1 = (boost::shared_ptr< love_sdlmixer::Music > *) obj;
1779 delete arg1;
1780 }
1781 static swig_lua_method swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__methods[] = {
1782     {"__deref__", _wrap_SmartMusic___deref__},
1783     {0,0}
1784 };
1785 static swig_lua_attribute swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__attributes[] = {
1786     {0,0,0}
1787 };
1788 static swig_lua_class *swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__bases[] = {0};
1789 static const char *swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__base_names[] = {0};
1790 static swig_lua_class _wrap_class_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg_ = { "SmartMusic", &SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,0, swig_delete_SmartMusic, swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__methods, swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__attributes, swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__bases, swig_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg__base_names };
1791 
_wrap_newSound(lua_State * L)1792 static int _wrap_newSound(lua_State* L) {
1793   int SWIG_arg = -1;
1794   char *arg1 = (char *) 0 ;
1795   love_sdlmixer::pSound result;
1796 
1797   SWIG_check_num_args("love_sdlmixer::newSound",1,1)
1798   if(!lua_isstring(L,1)) SWIG_fail_arg("love_sdlmixer::newSound",1,"char const *");
1799   arg1 = (char *)lua_tostring(L, 1);
1800   result = love_sdlmixer::newSound((char const *)arg1);
1801   SWIG_arg=0;
1802   {
1803     love_sdlmixer::pSound * resultptr = new love_sdlmixer::pSound((love_sdlmixer::pSound &) result);
1804     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,1); SWIG_arg++;
1805   }
1806   return SWIG_arg;
1807 
1808   if(0) SWIG_fail;
1809 
1810 fail:
1811   lua_error(L);
1812   return SWIG_arg;
1813 }
1814 
1815 
_wrap_newMusic(lua_State * L)1816 static int _wrap_newMusic(lua_State* L) {
1817   int SWIG_arg = -1;
1818   char *arg1 = (char *) 0 ;
1819   love_sdlmixer::pMusic result;
1820 
1821   SWIG_check_num_args("love_sdlmixer::newMusic",1,1)
1822   if(!lua_isstring(L,1)) SWIG_fail_arg("love_sdlmixer::newMusic",1,"char const *");
1823   arg1 = (char *)lua_tostring(L, 1);
1824   result = love_sdlmixer::newMusic((char const *)arg1);
1825   SWIG_arg=0;
1826   {
1827     love_sdlmixer::pMusic * resultptr = new love_sdlmixer::pMusic((love_sdlmixer::pMusic &) result);
1828     SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,1); SWIG_arg++;
1829   }
1830   return SWIG_arg;
1831 
1832   if(0) SWIG_fail;
1833 
1834 fail:
1835   lua_error(L);
1836   return SWIG_arg;
1837 }
1838 
1839 
_wrap_isPlaying(lua_State * L)1840 static int _wrap_isPlaying(lua_State* L) {
1841   int SWIG_arg = -1;
1842   bool result;
1843 
1844   SWIG_check_num_args("love_sdlmixer::isPlaying",0,0)
1845   result = (bool)love_sdlmixer::isPlaying();
1846   SWIG_arg=0;
1847   lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
1848   return SWIG_arg;
1849 
1850   if(0) SWIG_fail;
1851 
1852 fail:
1853   lua_error(L);
1854   return SWIG_arg;
1855 }
1856 
1857 
_wrap_isPaused(lua_State * L)1858 static int _wrap_isPaused(lua_State* L) {
1859   int SWIG_arg = -1;
1860   bool result;
1861 
1862   SWIG_check_num_args("love_sdlmixer::isPaused",0,0)
1863   result = (bool)love_sdlmixer::isPaused();
1864   SWIG_arg=0;
1865   lua_pushboolean(L,(int)(result==true)); SWIG_arg++;
1866   return SWIG_arg;
1867 
1868   if(0) SWIG_fail;
1869 
1870 fail:
1871   lua_error(L);
1872   return SWIG_arg;
1873 }
1874 
1875 
_wrap_pause(lua_State * L)1876 static int _wrap_pause(lua_State* L) {
1877   int SWIG_arg = -1;
1878 
1879   SWIG_check_num_args("love_sdlmixer::pause",0,0)
1880   love_sdlmixer::pause();
1881   SWIG_arg=0;
1882 
1883   return SWIG_arg;
1884 
1885   if(0) SWIG_fail;
1886 
1887 fail:
1888   lua_error(L);
1889   return SWIG_arg;
1890 }
1891 
1892 
_wrap_stop(lua_State * L)1893 static int _wrap_stop(lua_State* L) {
1894   int SWIG_arg = -1;
1895 
1896   SWIG_check_num_args("love_sdlmixer::stop",0,0)
1897   love_sdlmixer::stop();
1898   SWIG_arg=0;
1899 
1900   return SWIG_arg;
1901 
1902   if(0) SWIG_fail;
1903 
1904 fail:
1905   lua_error(L);
1906   return SWIG_arg;
1907 }
1908 
1909 
_wrap_resume(lua_State * L)1910 static int _wrap_resume(lua_State* L) {
1911   int SWIG_arg = -1;
1912 
1913   SWIG_check_num_args("love_sdlmixer::resume",0,0)
1914   love_sdlmixer::resume();
1915   SWIG_arg=0;
1916 
1917   return SWIG_arg;
1918 
1919   if(0) SWIG_fail;
1920 
1921 fail:
1922   lua_error(L);
1923   return SWIG_arg;
1924 }
1925 
1926 
_wrap_setChannels(lua_State * L)1927 static int _wrap_setChannels(lua_State* L) {
1928   int SWIG_arg = -1;
1929   int arg1 ;
1930 
1931   SWIG_check_num_args("love_sdlmixer::setChannels",1,1)
1932   if(!lua_isnumber(L,1)) SWIG_fail_arg("love_sdlmixer::setChannels",1,"int");
1933   arg1 = (int)lua_tonumber(L, 1);
1934   love_sdlmixer::setChannels(arg1);
1935   SWIG_arg=0;
1936 
1937   return SWIG_arg;
1938 
1939   if(0) SWIG_fail;
1940 
1941 fail:
1942   lua_error(L);
1943   return SWIG_arg;
1944 }
1945 
1946 
_wrap_setMode(lua_State * L)1947 static int _wrap_setMode(lua_State* L) {
1948   int SWIG_arg = -1;
1949   int arg1 ;
1950   int arg2 ;
1951   int arg3 ;
1952 
1953   SWIG_check_num_args("love_sdlmixer::setMode",3,3)
1954   if(!lua_isnumber(L,1)) SWIG_fail_arg("love_sdlmixer::setMode",1,"int");
1955   if(!lua_isnumber(L,2)) SWIG_fail_arg("love_sdlmixer::setMode",2,"int");
1956   if(!lua_isnumber(L,3)) SWIG_fail_arg("love_sdlmixer::setMode",3,"int");
1957   arg1 = (int)lua_tonumber(L, 1);
1958   arg2 = (int)lua_tonumber(L, 2);
1959   arg3 = (int)lua_tonumber(L, 3);
1960   love_sdlmixer::setMode(arg1,arg2,arg3);
1961   SWIG_arg=0;
1962 
1963   return SWIG_arg;
1964 
1965   if(0) SWIG_fail;
1966 
1967 fail:
1968   lua_error(L);
1969   return SWIG_arg;
1970 }
1971 
1972 
_wrap_setVolume(lua_State * L)1973 static int _wrap_setVolume(lua_State* L) {
1974   int SWIG_arg = -1;
1975   float arg1 ;
1976 
1977   SWIG_check_num_args("love_sdlmixer::setVolume",1,1)
1978   if(!lua_isnumber(L,1)) SWIG_fail_arg("love_sdlmixer::setVolume",1,"float");
1979   arg1 = (float)lua_tonumber(L, 1);
1980   love_sdlmixer::setVolume(arg1);
1981   SWIG_arg=0;
1982 
1983   return SWIG_arg;
1984 
1985   if(0) SWIG_fail;
1986 
1987 fail:
1988   lua_error(L);
1989   return SWIG_arg;
1990 }
1991 
1992 
_wrap_play__SWIG_0(lua_State * L)1993 static int _wrap_play__SWIG_0(lua_State* L) {
1994   int SWIG_arg = -1;
1995   love_sdlmixer::pSound *arg1 = 0 ;
1996   int arg2 ;
1997   int arg3 ;
1998 
1999   SWIG_check_num_args("love_sdlmixer::play",3,3)
2000   if(!lua_isuserdata(L,1)) SWIG_fail_arg("love_sdlmixer::play",1,"love_sdlmixer::pSound const &");
2001   if(!lua_isnumber(L,2)) SWIG_fail_arg("love_sdlmixer::play",2,"int");
2002   if(!lua_isnumber(L,3)) SWIG_fail_arg("love_sdlmixer::play",3,"int");
2003 
2004   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0))){
2005     SWIG_fail_ptr("play",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
2006   }
2007 
2008   arg2 = (int)lua_tonumber(L, 2);
2009   arg3 = (int)lua_tonumber(L, 3);
2010   love_sdlmixer::play((boost::shared_ptr< love_sdlmixer::Sound > const &)*arg1,arg2,arg3);
2011   SWIG_arg=0;
2012 
2013   return SWIG_arg;
2014 
2015   if(0) SWIG_fail;
2016 
2017 fail:
2018   lua_error(L);
2019   return SWIG_arg;
2020 }
2021 
2022 
_wrap_play__SWIG_1(lua_State * L)2023 static int _wrap_play__SWIG_1(lua_State* L) {
2024   int SWIG_arg = -1;
2025   love_sdlmixer::pSound *arg1 = 0 ;
2026   int arg2 ;
2027 
2028   SWIG_check_num_args("love_sdlmixer::play",2,2)
2029   if(!lua_isuserdata(L,1)) SWIG_fail_arg("love_sdlmixer::play",1,"love_sdlmixer::pSound const &");
2030   if(!lua_isnumber(L,2)) SWIG_fail_arg("love_sdlmixer::play",2,"int");
2031 
2032   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0))){
2033     SWIG_fail_ptr("play",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
2034   }
2035 
2036   arg2 = (int)lua_tonumber(L, 2);
2037   love_sdlmixer::play((boost::shared_ptr< love_sdlmixer::Sound > const &)*arg1,arg2);
2038   SWIG_arg=0;
2039 
2040   return SWIG_arg;
2041 
2042   if(0) SWIG_fail;
2043 
2044 fail:
2045   lua_error(L);
2046   return SWIG_arg;
2047 }
2048 
2049 
_wrap_play__SWIG_2(lua_State * L)2050 static int _wrap_play__SWIG_2(lua_State* L) {
2051   int SWIG_arg = -1;
2052   love_sdlmixer::pSound *arg1 = 0 ;
2053 
2054   SWIG_check_num_args("love_sdlmixer::play",1,1)
2055   if(!lua_isuserdata(L,1)) SWIG_fail_arg("love_sdlmixer::play",1,"love_sdlmixer::pSound const &");
2056 
2057   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0))){
2058     SWIG_fail_ptr("play",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
2059   }
2060 
2061   love_sdlmixer::play((boost::shared_ptr< love_sdlmixer::Sound > const &)*arg1);
2062   SWIG_arg=0;
2063 
2064   return SWIG_arg;
2065 
2066   if(0) SWIG_fail;
2067 
2068 fail:
2069   lua_error(L);
2070   return SWIG_arg;
2071 }
2072 
2073 
_wrap_play__SWIG_3(lua_State * L)2074 static int _wrap_play__SWIG_3(lua_State* L) {
2075   int SWIG_arg = -1;
2076   love_sdlmixer::pMusic *arg1 = 0 ;
2077   int arg2 ;
2078 
2079   SWIG_check_num_args("love_sdlmixer::play",2,2)
2080   if(!lua_isuserdata(L,1)) SWIG_fail_arg("love_sdlmixer::play",1,"love_sdlmixer::pMusic const &");
2081   if(!lua_isnumber(L,2)) SWIG_fail_arg("love_sdlmixer::play",2,"int");
2082 
2083   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,0))){
2084     SWIG_fail_ptr("play",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t);
2085   }
2086 
2087   arg2 = (int)lua_tonumber(L, 2);
2088   love_sdlmixer::play((boost::shared_ptr< love_sdlmixer::Music > const &)*arg1,arg2);
2089   SWIG_arg=0;
2090 
2091   return SWIG_arg;
2092 
2093   if(0) SWIG_fail;
2094 
2095 fail:
2096   lua_error(L);
2097   return SWIG_arg;
2098 }
2099 
2100 
_wrap_play__SWIG_4(lua_State * L)2101 static int _wrap_play__SWIG_4(lua_State* L) {
2102   int SWIG_arg = -1;
2103   love_sdlmixer::pMusic *arg1 = 0 ;
2104 
2105   SWIG_check_num_args("love_sdlmixer::play",1,1)
2106   if(!lua_isuserdata(L,1)) SWIG_fail_arg("love_sdlmixer::play",1,"love_sdlmixer::pMusic const &");
2107 
2108   if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,0))){
2109     SWIG_fail_ptr("play",1,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t);
2110   }
2111 
2112   love_sdlmixer::play((boost::shared_ptr< love_sdlmixer::Music > const &)*arg1);
2113   SWIG_arg=0;
2114 
2115   return SWIG_arg;
2116 
2117   if(0) SWIG_fail;
2118 
2119 fail:
2120   lua_error(L);
2121   return SWIG_arg;
2122 }
2123 
2124 
_wrap_play(lua_State * L)2125 static int _wrap_play(lua_State* L) {
2126   int argc;
2127   int argv[4]={
2128     1,2,3,4
2129   };
2130 
2131   argc = lua_gettop(L);
2132   if (argc == 1) {
2133     int _v;
2134     {
2135       void *ptr;
2136       if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t, 0)) {
2137         _v = 0;
2138       } else {
2139         _v = 1;
2140       }
2141     }
2142     if (_v) {
2143       return _wrap_play__SWIG_2(L);
2144     }
2145   }
2146   if (argc == 1) {
2147     int _v;
2148     {
2149       void *ptr;
2150       if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t, 0)) {
2151         _v = 0;
2152       } else {
2153         _v = 1;
2154       }
2155     }
2156     if (_v) {
2157       return _wrap_play__SWIG_4(L);
2158     }
2159   }
2160   if (argc == 2) {
2161     int _v;
2162     {
2163       void *ptr;
2164       if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t, 0)) {
2165         _v = 0;
2166       } else {
2167         _v = 1;
2168       }
2169     }
2170     if (_v) {
2171       {
2172         _v = lua_isnumber(L,argv[1]);
2173       }
2174       if (_v) {
2175         return _wrap_play__SWIG_3(L);
2176       }
2177     }
2178   }
2179   if (argc == 2) {
2180     int _v;
2181     {
2182       void *ptr;
2183       if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t, 0)) {
2184         _v = 0;
2185       } else {
2186         _v = 1;
2187       }
2188     }
2189     if (_v) {
2190       {
2191         _v = lua_isnumber(L,argv[1]);
2192       }
2193       if (_v) {
2194         return _wrap_play__SWIG_1(L);
2195       }
2196     }
2197   }
2198   if (argc == 3) {
2199     int _v;
2200     {
2201       void *ptr;
2202       if (lua_isuserdata(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t, 0)) {
2203         _v = 0;
2204       } else {
2205         _v = 1;
2206       }
2207     }
2208     if (_v) {
2209       {
2210         _v = lua_isnumber(L,argv[1]);
2211       }
2212       if (_v) {
2213         {
2214           _v = lua_isnumber(L,argv[2]);
2215         }
2216         if (_v) {
2217           return _wrap_play__SWIG_0(L);
2218         }
2219       }
2220     }
2221   }
2222 
2223   lua_pushstring(L,"No matching function for overloaded 'play'");
2224   lua_error(L);return 0;
2225 }
2226 
2227 
2228 #ifdef __cplusplus
2229 }
2230 #endif
2231 
2232 static const struct luaL_reg swig_commands[] = {
2233     { "newSound", _wrap_newSound},
2234     { "newMusic", _wrap_newMusic},
2235     { "isPlaying", _wrap_isPlaying},
2236     { "isPaused", _wrap_isPaused},
2237     { "pause", _wrap_pause},
2238     { "stop", _wrap_stop},
2239     { "resume", _wrap_resume},
2240     { "setChannels", _wrap_setChannels},
2241     { "setMode", _wrap_setMode},
2242     { "setVolume", _wrap_setVolume},
2243     { "play",_wrap_play},
2244     {0,0}
2245 };
2246 
2247 static swig_lua_var_info swig_variables[] = {
2248     {0,0,0}
2249 };
2250 
2251 static swig_lua_const_info swig_constants[] = {
2252     {0,0,0,0,0,0}
2253 };
2254 
2255 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
2256 
2257 static swig_type_info _swigt__p_boost__shared_ptrT_love_sdlmixer__Music_t = {"_p_boost__shared_ptrT_love_sdlmixer__Music_t", "love_sdlmixer::pMusic *|boost::shared_ptr< love_sdlmixer::Music > *", 0, 0, (void*)&_wrap_class_boost_shared_ptr_Sl_love_sdlmixer_Music_Sg_, 0};
2258 static swig_type_info _swigt__p_boost__shared_ptrT_love_sdlmixer__Sound_t = {"_p_boost__shared_ptrT_love_sdlmixer__Sound_t", "boost::shared_ptr< love_sdlmixer::Sound > *|love_sdlmixer::pSound *", 0, 0, (void*)&_wrap_class_boost_shared_ptr_Sl_love_sdlmixer_Sound_Sg_, 0};
2259 static swig_type_info _swigt__p_love_sdlmixer__Music = {"_p_love_sdlmixer__Music", "love_sdlmixer::Music *", 0, 0, (void*)&_wrap_class_love_sdlmixer_Music, 0};
2260 static swig_type_info _swigt__p_love_sdlmixer__Sound = {"_p_love_sdlmixer__Sound", "love_sdlmixer::Sound *", 0, 0, (void*)&_wrap_class_love_sdlmixer_Sound, 0};
2261 
2262 static swig_type_info *swig_type_initial[] = {
2263   &_swigt__p_boost__shared_ptrT_love_sdlmixer__Music_t,
2264   &_swigt__p_boost__shared_ptrT_love_sdlmixer__Sound_t,
2265   &_swigt__p_love_sdlmixer__Music,
2266   &_swigt__p_love_sdlmixer__Sound,
2267 };
2268 
2269 static swig_cast_info _swigc__p_boost__shared_ptrT_love_sdlmixer__Music_t[] = {  {&_swigt__p_boost__shared_ptrT_love_sdlmixer__Music_t, 0, 0, 0},{0, 0, 0, 0}};
2270 static swig_cast_info _swigc__p_boost__shared_ptrT_love_sdlmixer__Sound_t[] = {  {&_swigt__p_boost__shared_ptrT_love_sdlmixer__Sound_t, 0, 0, 0},{0, 0, 0, 0}};
2271 static swig_cast_info _swigc__p_love_sdlmixer__Music[] = {  {&_swigt__p_love_sdlmixer__Music, 0, 0, 0},{0, 0, 0, 0}};
2272 static swig_cast_info _swigc__p_love_sdlmixer__Sound[] = {  {&_swigt__p_love_sdlmixer__Sound, 0, 0, 0},{0, 0, 0, 0}};
2273 
2274 static swig_cast_info *swig_cast_initial[] = {
2275   _swigc__p_boost__shared_ptrT_love_sdlmixer__Music_t,
2276   _swigc__p_boost__shared_ptrT_love_sdlmixer__Sound_t,
2277   _swigc__p_love_sdlmixer__Music,
2278   _swigc__p_love_sdlmixer__Sound,
2279 };
2280 
2281 
2282 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
2283 
2284 /* -----------------------------------------------------------------------------
2285  * Type initialization:
2286  * This problem is tough by the requirement that no dynamic
2287  * memory is used. Also, since swig_type_info structures store pointers to
2288  * swig_cast_info structures and swig_cast_info structures store pointers back
2289  * to swig_type_info structures, we need some lookup code at initialization.
2290  * The idea is that swig generates all the structures that are needed.
2291  * The runtime then collects these partially filled structures.
2292  * The SWIG_InitializeModule function takes these initial arrays out of
2293  * swig_module, and does all the lookup, filling in the swig_module.types
2294  * array with the correct data and linking the correct swig_cast_info
2295  * structures together.
2296  *
2297  * The generated swig_type_info structures are assigned staticly to an initial
2298  * array. We just loop through that array, and handle each type individually.
2299  * First we lookup if this type has been already loaded, and if so, use the
2300  * loaded structure instead of the generated one. Then we have to fill in the
2301  * cast linked list. The cast data is initially stored in something like a
2302  * two-dimensional array. Each row corresponds to a type (there are the same
2303  * number of rows as there are in the swig_type_initial array). Each entry in
2304  * a column is one of the swig_cast_info structures for that type.
2305  * The cast_initial array is actually an array of arrays, because each row has
2306  * a variable number of columns. So to actually build the cast linked list,
2307  * we find the array of casts associated with the type, and loop through it
2308  * adding the casts to the list. The one last trick we need to do is making
2309  * sure the type pointer in the swig_cast_info struct is correct.
2310  *
2311  * First off, we lookup the cast->type name to see if it is already loaded.
2312  * There are three cases to handle:
2313  *  1) If the cast->type has already been loaded AND the type we are adding
2314  *     casting info to has not been loaded (it is in this module), THEN we
2315  *     replace the cast->type pointer with the type pointer that has already
2316  *     been loaded.
2317  *  2) If BOTH types (the one we are adding casting info to, and the
2318  *     cast->type) are loaded, THEN the cast info has already been loaded by
2319  *     the previous module so we just ignore it.
2320  *  3) Finally, if cast->type has not already been loaded, then we add that
2321  *     swig_cast_info to the linked list (because the cast->type) pointer will
2322  *     be correct.
2323  * ----------------------------------------------------------------------------- */
2324 
2325 #ifdef __cplusplus
2326 extern "C" {
2327 #if 0
2328 } /* c-mode */
2329 #endif
2330 #endif
2331 
2332 #if 0
2333 #define SWIGRUNTIME_DEBUG
2334 #endif
2335 
2336 
2337 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)2338 SWIG_InitializeModule(void *clientdata) {
2339   size_t i;
2340   swig_module_info *module_head, *iter;
2341   int found, init;
2342 
2343   clientdata = clientdata;
2344 
2345   /* check to see if the circular list has been setup, if not, set it up */
2346   if (swig_module.next==0) {
2347     /* Initialize the swig_module */
2348     swig_module.type_initial = swig_type_initial;
2349     swig_module.cast_initial = swig_cast_initial;
2350     swig_module.next = &swig_module;
2351     init = 1;
2352   } else {
2353     init = 0;
2354   }
2355 
2356   /* Try and load any already created modules */
2357   module_head = SWIG_GetModule(clientdata);
2358   if (!module_head) {
2359     /* This is the first module loaded for this interpreter */
2360     /* so set the swig module into the interpreter */
2361     SWIG_SetModule(clientdata, &swig_module);
2362     module_head = &swig_module;
2363   } else {
2364     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
2365     found=0;
2366     iter=module_head;
2367     do {
2368       if (iter==&swig_module) {
2369         found=1;
2370         break;
2371       }
2372       iter=iter->next;
2373     } while (iter!= module_head);
2374 
2375     /* if the is found in the list, then all is done and we may leave */
2376     if (found) return;
2377     /* otherwise we must add out module into the list */
2378     swig_module.next = module_head->next;
2379     module_head->next = &swig_module;
2380   }
2381 
2382   /* When multiple interpeters are used, a module could have already been initialized in
2383      a different interpreter, but not yet have a pointer in this interpreter.
2384      In this case, we do not want to continue adding types... everything should be
2385      set up already */
2386   if (init == 0) return;
2387 
2388   /* Now work on filling in swig_module.types */
2389 #ifdef SWIGRUNTIME_DEBUG
2390   printf("SWIG_InitializeModule: size %d\n", swig_module.size);
2391 #endif
2392   for (i = 0; i < swig_module.size; ++i) {
2393     swig_type_info *type = 0;
2394     swig_type_info *ret;
2395     swig_cast_info *cast;
2396 
2397 #ifdef SWIGRUNTIME_DEBUG
2398     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2399 #endif
2400 
2401     /* if there is another module already loaded */
2402     if (swig_module.next != &swig_module) {
2403       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
2404     }
2405     if (type) {
2406       /* Overwrite clientdata field */
2407 #ifdef SWIGRUNTIME_DEBUG
2408       printf("SWIG_InitializeModule: found type %s\n", type->name);
2409 #endif
2410       if (swig_module.type_initial[i]->clientdata) {
2411 	type->clientdata = swig_module.type_initial[i]->clientdata;
2412 #ifdef SWIGRUNTIME_DEBUG
2413       printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
2414 #endif
2415       }
2416     } else {
2417       type = swig_module.type_initial[i];
2418     }
2419 
2420     /* Insert casting types */
2421     cast = swig_module.cast_initial[i];
2422     while (cast->type) {
2423 
2424       /* Don't need to add information already in the list */
2425       ret = 0;
2426 #ifdef SWIGRUNTIME_DEBUG
2427       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
2428 #endif
2429       if (swig_module.next != &swig_module) {
2430         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
2431 #ifdef SWIGRUNTIME_DEBUG
2432 	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
2433 #endif
2434       }
2435       if (ret) {
2436 	if (type == swig_module.type_initial[i]) {
2437 #ifdef SWIGRUNTIME_DEBUG
2438 	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
2439 #endif
2440 	  cast->type = ret;
2441 	  ret = 0;
2442 	} else {
2443 	  /* Check for casting already in the list */
2444 	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
2445 #ifdef SWIGRUNTIME_DEBUG
2446 	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
2447 #endif
2448 	  if (!ocast) ret = 0;
2449 	}
2450       }
2451 
2452       if (!ret) {
2453 #ifdef SWIGRUNTIME_DEBUG
2454 	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
2455 #endif
2456         if (type->cast) {
2457           type->cast->prev = cast;
2458           cast->next = type->cast;
2459         }
2460         type->cast = cast;
2461       }
2462       cast++;
2463     }
2464     /* Set entry in modules->types array equal to the type */
2465     swig_module.types[i] = type;
2466   }
2467   swig_module.types[i] = 0;
2468 
2469 #ifdef SWIGRUNTIME_DEBUG
2470   printf("**** SWIG_InitializeModule: Cast List ******\n");
2471   for (i = 0; i < swig_module.size; ++i) {
2472     int j = 0;
2473     swig_cast_info *cast = swig_module.cast_initial[i];
2474     printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
2475     while (cast->type) {
2476       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
2477       cast++;
2478       ++j;
2479     }
2480   printf("---- Total casts: %d\n",j);
2481   }
2482   printf("**** SWIG_InitializeModule: Cast List ******\n");
2483 #endif
2484 }
2485 
2486 /* This function will propagate the clientdata field of type to
2487 * any new swig_type_info structures that have been added into the list
2488 * of equivalent types.  It is like calling
2489 * SWIG_TypeClientData(type, clientdata) a second time.
2490 */
2491 SWIGRUNTIME void
SWIG_PropagateClientData(void)2492 SWIG_PropagateClientData(void) {
2493   size_t i;
2494   swig_cast_info *equiv;
2495   static int init_run = 0;
2496 
2497   if (init_run) return;
2498   init_run = 1;
2499 
2500   for (i = 0; i < swig_module.size; i++) {
2501     if (swig_module.types[i]->clientdata) {
2502       equiv = swig_module.types[i]->cast;
2503       while (equiv) {
2504         if (!equiv->converter) {
2505           if (equiv->type && !equiv->type->clientdata)
2506             SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
2507         }
2508         equiv = equiv->next;
2509       }
2510     }
2511   }
2512 }
2513 
2514 #ifdef __cplusplus
2515 #if 0
2516 { /* c-mode */
2517 #endif
2518 }
2519 #endif
2520 
2521 
2522 
2523 /* Forward declaration of where the user's %init{} gets inserted */
2524 void SWIG_init_user(lua_State* L );
2525 
2526 #ifdef __cplusplus
2527 extern "C" {
2528 #endif
2529 /* this is the initialization function
2530   added at the very end of the code
2531   the function is always called SWIG_init, but an eariler #define will rename it
2532 */
SWIG_init(lua_State * L)2533 SWIGEXPORT int SWIG_init(lua_State* L)
2534 {
2535   int i;
2536   /* start with global table */
2537   lua_pushvalue(L,LUA_GLOBALSINDEX);
2538   /* SWIG's internal initalisation */
2539   SWIG_InitializeModule((void*)L);
2540   SWIG_PropagateClientData();
2541   /* add a global fn */
2542   SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
2543   SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
2544   /* begin the module (its a table with the same name as the module) */
2545   SWIG_Lua_module_begin(L,SWIG_name);
2546   /* add commands/functions */
2547   for (i = 0; swig_commands[i].name; i++){
2548     SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
2549   }
2550   /* add variables */
2551   for (i = 0; swig_variables[i].name; i++){
2552     SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
2553   }
2554   /* set up base class pointers (the hierachy) */
2555   for (i = 0; swig_types[i]; i++){
2556     if (swig_types[i]->clientdata){
2557       SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
2558     }
2559   }
2560   /* additional registration structs & classes in lua */
2561   for (i = 0; swig_types[i]; i++){
2562     if (swig_types[i]->clientdata){
2563       SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
2564     }
2565   }
2566   /* constants */
2567   SWIG_Lua_InstallConstants(L,swig_constants);
2568   /* invoke user-specific initialization */
2569   SWIG_init_user(L);
2570   /* end module */
2571   lua_pop(L,1);  /* tidy stack (remove module table)*/
2572   lua_pop(L,1);  /* tidy stack (remove global table)*/
2573   return 1;
2574 }
2575 
2576 #ifdef __cplusplus
2577 }
2578 #endif
2579 
2580 
2581 const char* SWIG_LUACODE=
2582   "\n"
2583   "love.audio = mod_sdlmixer";
2584 
SWIG_init_user(lua_State * L)2585 void SWIG_init_user(lua_State* L)
2586 {
2587   /* exec Lua code if applicable */
2588   SWIG_Lua_dostring(L,SWIG_LUACODE);
2589 }
2590 
2591 namespace love_sdlmixer
2592 {
mod_is_sound(lua_State * L,int idx)2593 	bool mod_is_sound(lua_State * L, int idx)
2594     {
2595         swig_lua_userdata* usr = 0;
2596         swig_cast_info *cast = 0;
2597         usr=(swig_lua_userdata*)lua_touserdata(L,idx);
2598         if(!usr) return false;
2599         cast=SWIG_TypeCheckStruct(usr->type,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t);
2600         if(cast) return true;
2601         return false;
2602     }
2603 
mod_to_sound(lua_State * L,int idx)2604 	boost::shared_ptr<Sound> mod_to_sound(lua_State * L, int idx)
2605     {
2606         love_sdlmixer::pSound * arg;
2607         if(!lua_isuserdata(L,idx)) luaL_error(L, "Error, argument is not userdata.");
2608         if (!SWIG_IsOK(SWIG_ConvertPtr(L,idx,(void**)&arg,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,0))){
2609               luaL_error(L, "Error, argument is not type Sound.");
2610         }
2611         return *arg;
2612     }
2613 
mod_push_sound(lua_State * L,boost::shared_ptr<Sound> sound)2614 	void mod_push_sound(lua_State * L, boost::shared_ptr<Sound> sound)
2615     {
2616         love_sdlmixer::pSound * resultptr = new love_sdlmixer::pSound((love_sdlmixer::pSound &) sound);
2617         SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Sound_t,1);
2618     }
2619 
mod_is_music(lua_State * L,int idx)2620 	bool mod_is_music(lua_State * L, int idx)
2621     {
2622         swig_lua_userdata* usr = 0;
2623         swig_cast_info *cast = 0;
2624         usr=(swig_lua_userdata*)lua_touserdata(L,idx);
2625         if(!usr) return false;
2626         cast=SWIG_TypeCheckStruct(usr->type,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t);
2627         if(cast) return true;
2628         return false;
2629     }
2630 
mod_to_music(lua_State * L,int idx)2631 	boost::shared_ptr<Music> mod_to_music(lua_State * L, int idx)
2632     {
2633         love_sdlmixer::pMusic * arg;
2634         if(!lua_isuserdata(L,idx)) luaL_error(L, "Error, argument is not userdata.");
2635         if (!SWIG_IsOK(SWIG_ConvertPtr(L,idx,(void**)&arg,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,0))){
2636               luaL_error(L, "Error, argument is not type Music.");
2637         }
2638         return *arg;
2639     }
2640 
mod_push_music(lua_State * L,boost::shared_ptr<Music> music)2641 	void mod_push_music(lua_State * L, boost::shared_ptr<Music> music)
2642     {
2643         love_sdlmixer::pMusic * resultptr = new love_sdlmixer::pMusic((love_sdlmixer::pMusic &) music);
2644         SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_boost__shared_ptrT_love_sdlmixer__Music_t,1);
2645     }
2646 
2647 }
2648 
2649