· 6 years ago · Sep 06, 2019, 03:08 AM
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
3 * Version 3.0.12
4 *
5 * This file is not intended to be easily readable and contains a number of
6 * coding conventions designed to improve portability and efficiency. Do not make
7 * changes to this file unless you know what you are doing--modify the SWIG
8 * interface file instead.
9 * ----------------------------------------------------------------------------- */
10
11
12#ifndef SWIGLUA
13#define SWIGLUA
14#endif
15
16#define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
17#define SWIG_LUA_MODULE_GLOBAL
18
19/* -----------------------------------------------------------------------------
20 * This section contains generic SWIG labels for method/variable
21 * declarations/attributes, and other compiler dependent labels.
22 * ----------------------------------------------------------------------------- */
23
24/* template workaround for compilers that cannot correctly implement the C++ standard */
25#ifndef SWIGTEMPLATEDISAMBIGUATOR
26# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
27# define SWIGTEMPLATEDISAMBIGUATOR template
28# elif defined(__HP_aCC)
29/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
30/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
31# define SWIGTEMPLATEDISAMBIGUATOR template
32# else
33# define SWIGTEMPLATEDISAMBIGUATOR
34# endif
35#endif
36
37/* inline attribute */
38#ifndef SWIGINLINE
39# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
40# define SWIGINLINE inline
41# else
42# define SWIGINLINE
43# endif
44#endif
45
46/* attribute recognised by some compilers to avoid 'unused' warnings */
47#ifndef SWIGUNUSED
48# if defined(__GNUC__)
49# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
50# define SWIGUNUSED __attribute__ ((__unused__))
51# else
52# define SWIGUNUSED
53# endif
54# elif defined(__ICC)
55# define SWIGUNUSED __attribute__ ((__unused__))
56# else
57# define SWIGUNUSED
58# endif
59#endif
60
61#ifndef SWIG_MSC_UNSUPPRESS_4505
62# if defined(_MSC_VER)
63# pragma warning(disable : 4505) /* unreferenced local function has been removed */
64# endif
65#endif
66
67#ifndef SWIGUNUSEDPARM
68# ifdef __cplusplus
69# define SWIGUNUSEDPARM(p)
70# else
71# define SWIGUNUSEDPARM(p) p SWIGUNUSED
72# endif
73#endif
74
75/* internal SWIG method */
76#ifndef SWIGINTERN
77# define SWIGINTERN static SWIGUNUSED
78#endif
79
80/* internal inline SWIG method */
81#ifndef SWIGINTERNINLINE
82# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
83#endif
84
85/* exporting methods */
86#if defined(__GNUC__)
87# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
88# ifndef GCC_HASCLASSVISIBILITY
89# define GCC_HASCLASSVISIBILITY
90# endif
91# endif
92#endif
93
94#ifndef SWIGEXPORT
95# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
96# if defined(STATIC_LINKED)
97# define SWIGEXPORT
98# else
99# define SWIGEXPORT __declspec(dllexport)
100# endif
101# else
102# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
103# define SWIGEXPORT __attribute__ ((visibility("default")))
104# else
105# define SWIGEXPORT
106# endif
107# endif
108#endif
109
110/* calling conventions for Windows */
111#ifndef SWIGSTDCALL
112# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
113# define SWIGSTDCALL __stdcall
114# else
115# define SWIGSTDCALL
116# endif
117#endif
118
119/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
120#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
121# define _CRT_SECURE_NO_DEPRECATE
122#endif
123
124/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
125#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
126# define _SCL_SECURE_NO_DEPRECATE
127#endif
128
129/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
130#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
131# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
132#endif
133
134/* Intel's compiler complains if a variable which was never initialised is
135 * cast to void, which is a common idiom which we use to indicate that we
136 * are aware a variable isn't used. So we just silence that warning.
137 * See: https://github.com/swig/swig/issues/192 for more discussion.
138 */
139#ifdef __INTEL_COMPILER
140# pragma warning disable 592
141#endif
142
143/* -----------------------------------------------------------------------------
144 * swigrun.swg
145 *
146 * This file contains generic C API SWIG runtime support for pointer
147 * type checking.
148 * ----------------------------------------------------------------------------- */
149
150/* This should only be incremented when either the layout of swig_type_info changes,
151 or for whatever reason, the runtime changes incompatibly */
152#define SWIG_RUNTIME_VERSION "4"
153
154/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
155#ifdef SWIG_TYPE_TABLE
156# define SWIG_QUOTE_STRING(x) #x
157# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
158# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
159#else
160# define SWIG_TYPE_TABLE_NAME
161#endif
162
163/*
164 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
165 creating a static or dynamic library from the SWIG runtime code.
166 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
167
168 But only do this if strictly necessary, ie, if you have problems
169 with your compiler or suchlike.
170*/
171
172#ifndef SWIGRUNTIME
173# define SWIGRUNTIME SWIGINTERN
174#endif
175
176#ifndef SWIGRUNTIMEINLINE
177# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
178#endif
179
180/* Generic buffer size */
181#ifndef SWIG_BUFFER_SIZE
182# define SWIG_BUFFER_SIZE 1024
183#endif
184
185/* Flags for pointer conversions */
186#define SWIG_POINTER_DISOWN 0x1
187#define SWIG_CAST_NEW_MEMORY 0x2
188
189/* Flags for new pointer objects */
190#define SWIG_POINTER_OWN 0x1
191
192
193/*
194 Flags/methods for returning states.
195
196 The SWIG conversion methods, as ConvertPtr, return an integer
197 that tells if the conversion was successful or not. And if not,
198 an error code can be returned (see swigerrors.swg for the codes).
199
200 Use the following macros/flags to set or process the returning
201 states.
202
203 In old versions of SWIG, code such as the following was usually written:
204
205 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
206 // success code
207 } else {
208 //fail code
209 }
210
211 Now you can be more explicit:
212
213 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
214 if (SWIG_IsOK(res)) {
215 // success code
216 } else {
217 // fail code
218 }
219
220 which is the same really, but now you can also do
221
222 Type *ptr;
223 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
224 if (SWIG_IsOK(res)) {
225 // success code
226 if (SWIG_IsNewObj(res) {
227 ...
228 delete *ptr;
229 } else {
230 ...
231 }
232 } else {
233 // fail code
234 }
235
236 I.e., now SWIG_ConvertPtr can return new objects and you can
237 identify the case and take care of the deallocation. Of course that
238 also requires SWIG_ConvertPtr to return new result values, such as
239
240 int SWIG_ConvertPtr(obj, ptr,...) {
241 if (<obj is ok>) {
242 if (<need new object>) {
243 *ptr = <ptr to new allocated object>;
244 return SWIG_NEWOBJ;
245 } else {
246 *ptr = <ptr to old object>;
247 return SWIG_OLDOBJ;
248 }
249 } else {
250 return SWIG_BADOBJ;
251 }
252 }
253
254 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
255 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
256 SWIG errors code.
257
258 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
259 allows to return the 'cast rank', for example, if you have this
260
261 int food(double)
262 int fooi(int);
263
264 and you call
265
266 food(1) // cast rank '1' (1 -> 1.0)
267 fooi(1) // cast rank '0'
268
269 just use the SWIG_AddCast()/SWIG_CheckState()
270*/
271
272#define SWIG_OK (0)
273#define SWIG_ERROR (-1)
274#define SWIG_IsOK(r) (r >= 0)
275#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
276
277/* The CastRankLimit says how many bits are used for the cast rank */
278#define SWIG_CASTRANKLIMIT (1 << 8)
279/* The NewMask denotes the object was created (using new/malloc) */
280#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
281/* The TmpMask is for in/out typemaps that use temporal objects */
282#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
283/* Simple returning values */
284#define SWIG_BADOBJ (SWIG_ERROR)
285#define SWIG_OLDOBJ (SWIG_OK)
286#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
287#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
288/* Check, add and del mask methods */
289#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
290#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
291#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
292#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
293#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
294#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
295
296/* Cast-Rank Mode */
297#if defined(SWIG_CASTRANK_MODE)
298# ifndef SWIG_TypeRank
299# define SWIG_TypeRank unsigned long
300# endif
301# ifndef SWIG_MAXCASTRANK /* Default cast allowed */
302# define SWIG_MAXCASTRANK (2)
303# endif
304# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
305# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
306SWIGINTERNINLINE int SWIG_AddCast(int r) {
307 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
308}
309SWIGINTERNINLINE int SWIG_CheckState(int r) {
310 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
311}
312#else /* no cast-rank mode */
313# define SWIG_AddCast(r) (r)
314# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
315#endif
316
317
318#include <string.h>
319
320#ifdef __cplusplus
321extern "C" {
322#endif
323
324typedef void *(*swig_converter_func)(void *, int *);
325typedef struct swig_type_info *(*swig_dycast_func)(void **);
326
327/* Structure to store information on one type */
328typedef struct swig_type_info {
329 const char *name; /* mangled name of this type */
330 const char *str; /* human readable name of this type */
331 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
332 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
333 void *clientdata; /* language specific type data */
334 int owndata; /* flag if the structure owns the clientdata */
335} swig_type_info;
336
337/* Structure to store a type and conversion function used for casting */
338typedef struct swig_cast_info {
339 swig_type_info *type; /* pointer to type that is equivalent to this type */
340 swig_converter_func converter; /* function to cast the void pointers */
341 struct swig_cast_info *next; /* pointer to next cast in linked list */
342 struct swig_cast_info *prev; /* pointer to the previous cast */
343} swig_cast_info;
344
345/* Structure used to store module information
346 * Each module generates one structure like this, and the runtime collects
347 * all of these structures and stores them in a circularly linked list.*/
348typedef struct swig_module_info {
349 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
350 size_t size; /* Number of types in this module */
351 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
352 swig_type_info **type_initial; /* Array of initially generated type structures */
353 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
354 void *clientdata; /* Language specific module data */
355} swig_module_info;
356
357/*
358 Compare two type names skipping the space characters, therefore
359 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
360
361 Return 0 when the two name types are equivalent, as in
362 strncmp, but skipping ' '.
363*/
364SWIGRUNTIME int
365SWIG_TypeNameComp(const char *f1, const char *l1,
366 const char *f2, const char *l2) {
367 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
368 while ((*f1 == ' ') && (f1 != l1)) ++f1;
369 while ((*f2 == ' ') && (f2 != l2)) ++f2;
370 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
371 }
372 return (int)((l1 - f1) - (l2 - f2));
373}
374
375/*
376 Check type equivalence in a name list like <name1>|<name2>|...
377 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
378*/
379SWIGRUNTIME int
380SWIG_TypeCmp(const char *nb, const char *tb) {
381 int equiv = 1;
382 const char* te = tb + strlen(tb);
383 const char* ne = nb;
384 while (equiv != 0 && *ne) {
385 for (nb = ne; *ne; ++ne) {
386 if (*ne == '|') break;
387 }
388 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
389 if (*ne) ++ne;
390 }
391 return equiv;
392}
393
394/*
395 Check type equivalence in a name list like <name1>|<name2>|...
396 Return 0 if not equal, 1 if equal
397*/
398SWIGRUNTIME int
399SWIG_TypeEquiv(const char *nb, const char *tb) {
400 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
401}
402
403/*
404 Check the typename
405*/
406SWIGRUNTIME swig_cast_info *
407SWIG_TypeCheck(const char *c, swig_type_info *ty) {
408 if (ty) {
409 swig_cast_info *iter = ty->cast;
410 while (iter) {
411 if (strcmp(iter->type->name, c) == 0) {
412 if (iter == ty->cast)
413 return iter;
414 /* Move iter to the top of the linked list */
415 iter->prev->next = iter->next;
416 if (iter->next)
417 iter->next->prev = iter->prev;
418 iter->next = ty->cast;
419 iter->prev = 0;
420 if (ty->cast) ty->cast->prev = iter;
421 ty->cast = iter;
422 return iter;
423 }
424 iter = iter->next;
425 }
426 }
427 return 0;
428}
429
430/*
431 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
432*/
433SWIGRUNTIME swig_cast_info *
434SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
435 if (ty) {
436 swig_cast_info *iter = ty->cast;
437 while (iter) {
438 if (iter->type == from) {
439 if (iter == ty->cast)
440 return iter;
441 /* Move iter to the top of the linked list */
442 iter->prev->next = iter->next;
443 if (iter->next)
444 iter->next->prev = iter->prev;
445 iter->next = ty->cast;
446 iter->prev = 0;
447 if (ty->cast) ty->cast->prev = iter;
448 ty->cast = iter;
449 return iter;
450 }
451 iter = iter->next;
452 }
453 }
454 return 0;
455}
456
457/*
458 Cast a pointer up an inheritance hierarchy
459*/
460SWIGRUNTIMEINLINE void *
461SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
462 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
463}
464
465/*
466 Dynamic pointer casting. Down an inheritance hierarchy
467*/
468SWIGRUNTIME swig_type_info *
469SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
470 swig_type_info *lastty = ty;
471 if (!ty || !ty->dcast) return ty;
472 while (ty && (ty->dcast)) {
473 ty = (*ty->dcast)(ptr);
474 if (ty) lastty = ty;
475 }
476 return lastty;
477}
478
479/*
480 Return the name associated with this type
481*/
482SWIGRUNTIMEINLINE const char *
483SWIG_TypeName(const swig_type_info *ty) {
484 return ty->name;
485}
486
487/*
488 Return the pretty name associated with this type,
489 that is an unmangled type name in a form presentable to the user.
490*/
491SWIGRUNTIME const char *
492SWIG_TypePrettyName(const swig_type_info *type) {
493 /* The "str" field contains the equivalent pretty names of the
494 type, separated by vertical-bar characters. We choose
495 to print the last name, as it is often (?) the most
496 specific. */
497 if (!type) return NULL;
498 if (type->str != NULL) {
499 const char *last_name = type->str;
500 const char *s;
501 for (s = type->str; *s; s++)
502 if (*s == '|') last_name = s+1;
503 return last_name;
504 }
505 else
506 return type->name;
507}
508
509/*
510 Set the clientdata field for a type
511*/
512SWIGRUNTIME void
513SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
514 swig_cast_info *cast = ti->cast;
515 /* if (ti->clientdata == clientdata) return; */
516 ti->clientdata = clientdata;
517
518 while (cast) {
519 if (!cast->converter) {
520 swig_type_info *tc = cast->type;
521 if (!tc->clientdata) {
522 SWIG_TypeClientData(tc, clientdata);
523 }
524 }
525 cast = cast->next;
526 }
527}
528SWIGRUNTIME void
529SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
530 SWIG_TypeClientData(ti, clientdata);
531 ti->owndata = 1;
532}
533
534/*
535 Search for a swig_type_info structure only by mangled name
536 Search is a O(log #types)
537
538 We start searching at module start, and finish searching when start == end.
539 Note: if start == end at the beginning of the function, we go all the way around
540 the circular list.
541*/
542SWIGRUNTIME swig_type_info *
543SWIG_MangledTypeQueryModule(swig_module_info *start,
544 swig_module_info *end,
545 const char *name) {
546 swig_module_info *iter = start;
547 do {
548 if (iter->size) {
549 size_t l = 0;
550 size_t r = iter->size - 1;
551 do {
552 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
553 size_t i = (l + r) >> 1;
554 const char *iname = iter->types[i]->name;
555 if (iname) {
556 int compare = strcmp(name, iname);
557 if (compare == 0) {
558 return iter->types[i];
559 } else if (compare < 0) {
560 if (i) {
561 r = i - 1;
562 } else {
563 break;
564 }
565 } else if (compare > 0) {
566 l = i + 1;
567 }
568 } else {
569 break; /* should never happen */
570 }
571 } while (l <= r);
572 }
573 iter = iter->next;
574 } while (iter != end);
575 return 0;
576}
577
578/*
579 Search for a swig_type_info structure for either a mangled name or a human readable name.
580 It first searches the mangled names of the types, which is a O(log #types)
581 If a type is not found it then searches the human readable names, which is O(#types).
582
583 We start searching at module start, and finish searching when start == end.
584 Note: if start == end at the beginning of the function, we go all the way around
585 the circular list.
586*/
587SWIGRUNTIME swig_type_info *
588SWIG_TypeQueryModule(swig_module_info *start,
589 swig_module_info *end,
590 const char *name) {
591 /* STEP 1: Search the name field using binary search */
592 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
593 if (ret) {
594 return ret;
595 } else {
596 /* STEP 2: If the type hasn't been found, do a complete search
597 of the str field (the human readable name) */
598 swig_module_info *iter = start;
599 do {
600 size_t i = 0;
601 for (; i < iter->size; ++i) {
602 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
603 return iter->types[i];
604 }
605 iter = iter->next;
606 } while (iter != end);
607 }
608
609 /* neither found a match */
610 return 0;
611}
612
613/*
614 Pack binary data into a string
615*/
616SWIGRUNTIME char *
617SWIG_PackData(char *c, void *ptr, size_t sz) {
618 static const char hex[17] = "0123456789abcdef";
619 const unsigned char *u = (unsigned char *) ptr;
620 const unsigned char *eu = u + sz;
621 for (; u != eu; ++u) {
622 unsigned char uu = *u;
623 *(c++) = hex[(uu & 0xf0) >> 4];
624 *(c++) = hex[uu & 0xf];
625 }
626 return c;
627}
628
629/*
630 Unpack binary data from a string
631*/
632SWIGRUNTIME const char *
633SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
634 unsigned char *u = (unsigned char *) ptr;
635 const unsigned char *eu = u + sz;
636 for (; u != eu; ++u) {
637 char d = *(c++);
638 unsigned char uu;
639 if ((d >= '0') && (d <= '9'))
640 uu = (unsigned char)((d - '0') << 4);
641 else if ((d >= 'a') && (d <= 'f'))
642 uu = (unsigned char)((d - ('a'-10)) << 4);
643 else
644 return (char *) 0;
645 d = *(c++);
646 if ((d >= '0') && (d <= '9'))
647 uu |= (unsigned char)(d - '0');
648 else if ((d >= 'a') && (d <= 'f'))
649 uu |= (unsigned char)(d - ('a'-10));
650 else
651 return (char *) 0;
652 *u = uu;
653 }
654 return c;
655}
656
657/*
658 Pack 'void *' into a string buffer.
659*/
660SWIGRUNTIME char *
661SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
662 char *r = buff;
663 if ((2*sizeof(void *) + 2) > bsz) return 0;
664 *(r++) = '_';
665 r = SWIG_PackData(r,&ptr,sizeof(void *));
666 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
667 strcpy(r,name);
668 return buff;
669}
670
671SWIGRUNTIME const char *
672SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
673 if (*c != '_') {
674 if (strcmp(c,"NULL") == 0) {
675 *ptr = (void *) 0;
676 return name;
677 } else {
678 return 0;
679 }
680 }
681 return SWIG_UnpackData(++c,ptr,sizeof(void *));
682}
683
684SWIGRUNTIME char *
685SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
686 char *r = buff;
687 size_t lname = (name ? strlen(name) : 0);
688 if ((2*sz + 2 + lname) > bsz) return 0;
689 *(r++) = '_';
690 r = SWIG_PackData(r,ptr,sz);
691 if (lname) {
692 strncpy(r,name,lname+1);
693 } else {
694 *r = 0;
695 }
696 return buff;
697}
698
699SWIGRUNTIME const char *
700SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
701 if (*c != '_') {
702 if (strcmp(c,"NULL") == 0) {
703 memset(ptr,0,sz);
704 return name;
705 } else {
706 return 0;
707 }
708 }
709 return SWIG_UnpackData(++c,ptr,sz);
710}
711
712#ifdef __cplusplus
713}
714#endif
715
716/* -----------------------------------------------------------------------------
717 * luarun.swg
718 *
719 * This file contains the runtime support for Lua modules
720 * and includes code for managing global variables and pointer
721 * type checking.
722 * ----------------------------------------------------------------------------- */
723
724#ifdef __cplusplus
725extern "C" {
726#endif
727
728#include "lua.h"
729#include "lauxlib.h"
730#include <stdlib.h> /* for malloc */
731#include <assert.h> /* for a few sanity tests */
732
733/* -----------------------------------------------------------------------------
734 * Lua flavors
735 * ----------------------------------------------------------------------------- */
736
737#define SWIG_LUA_FLAVOR_LUA 1
738#define SWIG_LUA_FLAVOR_ELUA 2
739#define SWIG_LUA_FLAVOR_ELUAC 3
740
741#if !defined(SWIG_LUA_TARGET)
742# error SWIG_LUA_TARGET not defined
743#endif
744
745#if defined(SWIG_LUA_ELUA_EMULATE)
746
747struct swig_elua_entry;
748
749typedef struct swig_elua_key {
750 int type;
751 union {
752 const char* strkey;
753 lua_Number numkey;
754 } key;
755} swig_elua_key;
756
757typedef struct swig_elua_val {
758 int type;
759 union {
760 lua_Number number;
761 const struct swig_elua_entry *table;
762 const char *string;
763 lua_CFunction function;
764 struct {
765 char member;
766 long lvalue;
767 void *pvalue;
768 swig_type_info **ptype;
769 } userdata;
770 } value;
771} swig_elua_val;
772
773typedef struct swig_elua_entry {
774 swig_elua_key key;
775 swig_elua_val value;
776} swig_elua_entry;
777
778#define LSTRKEY(x) {LUA_TSTRING, {.strkey = x} }
779#define LNUMKEY(x) {LUA_TNUMBER, {.numkey = x} }
780#define LNILKEY {LUA_TNIL, {.strkey = 0} }
781
782#define LNUMVAL(x) {LUA_TNUMBER, {.number = x} }
783#define LFUNCVAL(x) {LUA_TFUNCTION, {.function = x} }
784#define LROVAL(x) {LUA_TTABLE, {.table = x} }
785#define LNILVAL {LUA_TNIL, {.string = 0} }
786#define LSTRVAL(x) {LUA_TSTRING, {.string = x} }
787
788#define LUA_REG_TYPE swig_elua_entry
789
790#define SWIG_LUA_ELUA_EMUL_METATABLE_KEY "__metatable"
791
792#define lua_pushrotable(L,p)\
793 lua_newtable(L);\
794 assert(p);\
795 SWIG_Lua_elua_emulate_register(L,(swig_elua_entry*)(p));
796
797#define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
798 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={0,0,(void*)(C),&D} } }
799
800#define SWIG_LUA_CONSTTAB_BINARY(B,S,C,D)\
801 LSTRKEY(B), {LUA_TUSERDATA, { .userdata={1,S,(void*)(C),&D} } }
802#endif
803
804#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
805# define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
806# define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
807# define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
808# define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
809 /* Those two types of constants are not supported in elua */
810
811#ifndef SWIG_LUA_CONSTTAB_POINTER
812#warning eLua does not support pointers as constants. By default, nil will be used as value
813#define SWIG_LUA_CONSTTAB_POINTER(B,C,D) LSTRKEY(B), LNILVAL
814#endif
815
816#ifndef SWIG_LUA_CONSTTAB_BINARY
817#warning eLua does not support pointers to member as constants. By default, nil will be used as value
818#define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D) LSTRKEY(B), LNILVAL
819#endif
820#else /* SWIG_LUA_FLAVOR_LUA */
821# define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
822# define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
823# define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
824# define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
825# define SWIG_LUA_CONSTTAB_POINTER(B,C,D)\
826 SWIG_LUA_POINTER, (char *)B, 0, 0, (void *)C, &D
827# define SWIG_LUA_CONSTTAB_BINARY(B, S, C, D)\
828 SWIG_LUA_BINARY, (char *)B, S, 0, (void *)C, &D
829#endif
830
831#ifndef SWIG_LUA_ELUA_EMULATE
832#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
833# define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
834# define LSTRVAL LRO_STRVAL
835#endif
836#endif /* SWIG_LUA_ELUA_EMULATE*/
837
838#ifndef SWIG_LUA_ELUA_EMULATE
839#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
840
841#ifndef MIN_OPT_LEVEL
842#define MIN_OPT_LEVEL 2
843#endif
844
845#include "lrodefs.h"
846#include "lrotable.h"
847#endif
848#endif /* SWIG_LUA_ELUA_EMULATE*/
849/* -----------------------------------------------------------------------------
850 * compatibility defines
851 * ----------------------------------------------------------------------------- */
852
853/* History of Lua C API length functions: In Lua 5.0 (and before?)
854 there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen",
855 but a compatibility define of "lua_strlen" was added. In Lua 5.2,
856 this function was again renamed, to "lua_rawlen" (to emphasize that
857 it doesn't call the "__len" metamethod), and the compatibility
858 define of lua_strlen was removed. All SWIG uses have been updated
859 to "lua_rawlen", and we add our own defines of that here for older
860 versions of Lua. */
861#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
862# define lua_rawlen lua_strlen
863#elif LUA_VERSION_NUM == 501
864# define lua_rawlen lua_objlen
865#endif
866
867
868/* lua_pushglobaltable is the recommended "future-proof" way to get
869 the global table for Lua 5.2 and later. Here we define
870 lua_pushglobaltable ourselves for Lua versions before 5.2. */
871#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
872# define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
873#endif
874
875/* lua_absindex was introduced in Lua 5.2 */
876#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
877# define lua_absindex(L,i) ((i)>0 || (i) <= LUA_REGISTRYINDEX ? (i) : lua_gettop(L) + (i) + 1)
878#endif
879
880/* lua_rawsetp was introduced in Lua 5.2 */
881#if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
882#define lua_rawsetp(L,index,ptr)\
883 lua_pushlightuserdata(L,(void*)(ptr));\
884 lua_insert(L,-2);\
885 lua_rawset(L,index);
886
887#define lua_rawgetp(L,index,ptr)\
888 lua_pushlightuserdata(L,(void*)(ptr));\
889 lua_rawget(L,index);
890
891#endif
892
893/* --------------------------------------------------------------------------
894 * Helper functions for error handling
895 * -------------------------------------------------------------------------- */
896
897/* Push the string STR on the Lua stack, like lua_pushstring, but
898 prefixed with the the location of the innermost Lua call-point
899 (as formated by luaL_where). */
900SWIGRUNTIME void
901SWIG_Lua_pusherrstring (lua_State *L, const char *str)
902{
903 luaL_where (L, 1);
904 lua_pushstring (L, str);
905 lua_concat (L, 2);
906}
907
908/* Push a formatted string generated from FMT and following args on
909 the Lua stack, like lua_pushfstring, but prefixed with the the
910 location of the innermost Lua call-point (as formated by luaL_where). */
911SWIGRUNTIME void
912SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
913{
914 va_list argp;
915 va_start(argp, fmt);
916 luaL_where(L, 1);
917 lua_pushvfstring(L, fmt, argp);
918 va_end(argp);
919 lua_concat(L, 2);
920}
921
922
923/* -----------------------------------------------------------------------------
924 * global swig types
925 * ----------------------------------------------------------------------------- */
926/* Constant table */
927#define SWIG_LUA_INT 1
928#define SWIG_LUA_FLOAT 2
929#define SWIG_LUA_STRING 3
930#define SWIG_LUA_POINTER 4
931#define SWIG_LUA_BINARY 5
932#define SWIG_LUA_CHAR 6
933
934/* Structure for variable linking table */
935typedef struct {
936 const char *name;
937 lua_CFunction get;
938 lua_CFunction set;
939} swig_lua_var_info;
940
941#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
942typedef const LUA_REG_TYPE swig_lua_method;
943typedef const LUA_REG_TYPE swig_lua_const_info;
944#else /* Normal lua */
945typedef luaL_Reg swig_lua_method;
946
947/* Constant information structure */
948typedef struct {
949 int type;
950 char *name;
951 long lvalue;
952 double dvalue;
953 void *pvalue;
954 swig_type_info **ptype;
955} swig_lua_const_info;
956
957#endif
958
959typedef struct {
960 const char *name;
961 lua_CFunction getmethod;
962 lua_CFunction setmethod;
963} swig_lua_attribute;
964
965
966struct swig_lua_class;
967/* Can be used to create namespaces. Currently used to wrap class static methods/variables/constants */
968typedef struct swig_lua_namespace {
969 const char *name;
970 swig_lua_method *ns_methods;
971 swig_lua_attribute *ns_attributes;
972 swig_lua_const_info *ns_constants;
973 struct swig_lua_class **ns_classes;
974 struct swig_lua_namespace **ns_namespaces;
975} swig_lua_namespace;
976
977typedef struct swig_lua_class {
978 const char *name; /* Name that this class has in Lua */
979 const char *fqname; /* Fully qualified name - Scope + class name */
980 swig_type_info **type;
981 lua_CFunction constructor;
982 void (*destructor)(void *);
983 swig_lua_method *methods;
984 swig_lua_attribute *attributes;
985 swig_lua_namespace *cls_static;
986 swig_lua_method *metatable; /* 0 for -eluac */
987 struct swig_lua_class **bases;
988 const char **base_names;
989} swig_lua_class;
990
991/* this is the struct for wrapping all pointers in SwigLua
992*/
993typedef struct {
994 swig_type_info *type;
995 int own; /* 1 if owned & must be destroyed */
996 void *ptr;
997} swig_lua_userdata;
998
999/* this is the struct for wrapping arbitrary packed binary data
1000(currently it is only used for member function pointers)
1001the data ordering is similar to swig_lua_userdata, but it is currently not possible
1002to tell the two structures apart within SWIG, other than by looking at the type
1003*/
1004typedef struct {
1005 swig_type_info *type;
1006 int own; /* 1 if owned & must be destroyed */
1007 char data[1]; /* arbitary amount of data */
1008} swig_lua_rawdata;
1009
1010/* Common SWIG API */
1011#define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
1012#define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
1013#define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
1014/* for C++ member pointers, ie, member methods */
1015#define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
1016#define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
1017
1018/* Runtime API */
1019#define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
1020#define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
1021#define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
1022
1023/* Contract support */
1024#define SWIG_contract_assert(expr, msg) \
1025 if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
1026
1027
1028/* helper #defines */
1029#define SWIG_fail {goto fail;}
1030#define SWIG_fail_arg(func_name,argnum,type) \
1031 {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
1032 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
1033 goto fail;}
1034#define SWIG_fail_ptr(func_name,argnum,type) \
1035 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
1036#define SWIG_check_num_args(func_name,a,b) \
1037 if (lua_gettop(L)<a || lua_gettop(L)>b) \
1038 {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
1039 goto fail;}
1040
1041
1042#define SWIG_Lua_get_table(L,n) \
1043 (lua_pushstring(L, n), lua_rawget(L,-2))
1044
1045#define SWIG_Lua_add_function(L,n,f) \
1046 (lua_pushstring(L, n), \
1047 lua_pushcfunction(L, f), \
1048 lua_rawset(L,-3))
1049
1050#define SWIG_Lua_add_boolean(L,n,b) \
1051 (lua_pushstring(L, n), \
1052 lua_pushboolean(L, b), \
1053 lua_rawset(L,-3))
1054
1055/* special helper for allowing 'nil' for usertypes */
1056#define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
1057
1058#ifdef __cplusplus
1059/* Special helper for member function pointers
1060it gets the address, casts it, then dereferences it */
1061/*#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a))) */
1062#endif
1063
1064/* storing/access of swig_module_info */
1065SWIGRUNTIME swig_module_info *
1066SWIG_Lua_GetModule(lua_State *L) {
1067 swig_module_info *ret = 0;
1068 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1069 lua_rawget(L,LUA_REGISTRYINDEX);
1070 if (lua_islightuserdata(L,-1))
1071 ret=(swig_module_info*)lua_touserdata(L,-1);
1072 lua_pop(L,1); /* tidy */
1073 return ret;
1074}
1075
1076SWIGRUNTIME void
1077SWIG_Lua_SetModule(lua_State *L, swig_module_info *module) {
1078 /* add this all into the Lua registry: */
1079 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1080 lua_pushlightuserdata(L,(void*)module);
1081 lua_rawset(L,LUA_REGISTRYINDEX);
1082}
1083
1084/* -----------------------------------------------------------------------------
1085 * global variable support code: modules
1086 * ----------------------------------------------------------------------------- */
1087
1088/* this function is called when trying to set an immutable.
1089default action is to print an error.
1090This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
1091SWIGINTERN int SWIG_Lua_set_immutable(lua_State *L)
1092{
1093/* there should be 1 param passed in: the new value */
1094#ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
1095 lua_pop(L,1); /* remove it */
1096 luaL_error(L,"This variable is immutable");
1097#endif
1098 return 0; /* should not return anything */
1099}
1100
1101#ifdef SWIG_LUA_ELUA_EMULATE
1102
1103SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own);
1104SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type);
1105static int swig_lua_elua_emulate_unique_key;
1106
1107/* This function emulates eLua rotables behaviour. It loads a rotable definition into the usual lua table. */
1108SWIGINTERN void SWIG_Lua_elua_emulate_register(lua_State *L, const swig_elua_entry *table)
1109{
1110 int i, table_parsed, parsed_tables_array, target_table;
1111 assert(lua_istable(L,-1));
1112 target_table = lua_gettop(L);
1113 /* Get the registry where we put all parsed tables to avoid loops */
1114 lua_rawgetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1115 if(lua_isnil(L,-1)) {
1116 lua_pop(L,1);
1117 lua_newtable(L);
1118 lua_pushvalue(L,-1);
1119 lua_rawsetp(L,LUA_REGISTRYINDEX,(void*)(&swig_lua_elua_emulate_unique_key));
1120 }
1121 parsed_tables_array = lua_gettop(L);
1122 lua_pushvalue(L,target_table);
1123 lua_rawsetp(L, parsed_tables_array, table);
1124 table_parsed = 0;
1125 const int SWIGUNUSED pairs_start = lua_gettop(L);
1126 for(i = 0;table[i].key.type != LUA_TNIL || table[i].value.type != LUA_TNIL;i++)
1127 {
1128 const swig_elua_entry *entry = table + i;
1129 int is_metatable = 0;
1130 switch(entry->key.type) {
1131 case LUA_TSTRING:
1132 lua_pushstring(L,entry->key.key.strkey);
1133 if(strcmp(entry->key.key.strkey, SWIG_LUA_ELUA_EMUL_METATABLE_KEY) == 0)
1134 is_metatable = 1;
1135 break;
1136 case LUA_TNUMBER:
1137 lua_pushnumber(L,entry->key.key.numkey);
1138 break;
1139 case LUA_TNIL:
1140 lua_pushnil(L);
1141 break;
1142 default:
1143 assert(0);
1144 }
1145 switch(entry->value.type) {
1146 case LUA_TSTRING:
1147 lua_pushstring(L,entry->value.value.string);
1148 break;
1149 case LUA_TNUMBER:
1150 lua_pushnumber(L,entry->value.value.number);
1151 break;
1152 case LUA_TFUNCTION:
1153 lua_pushcfunction(L,entry->value.value.function);
1154 break;
1155 case LUA_TTABLE:
1156 lua_rawgetp(L,parsed_tables_array, entry->value.value.table);
1157 table_parsed = !lua_isnil(L,-1);
1158 if(!table_parsed) {
1159 lua_pop(L,1); /*remove nil */
1160 lua_newtable(L);
1161 SWIG_Lua_elua_emulate_register(L,entry->value.value.table);
1162 }
1163 if(is_metatable) {
1164 assert(lua_istable(L,-1));
1165 lua_pushvalue(L,-1);
1166 lua_setmetatable(L,target_table);
1167 }
1168
1169 break;
1170 case LUA_TUSERDATA:
1171 if(entry->value.value.userdata.member)
1172 SWIG_NewMemberObj(L,entry->value.value.userdata.pvalue,
1173 entry->value.value.userdata.lvalue,
1174 *(entry->value.value.userdata.ptype));
1175 else
1176 SWIG_NewPointerObj(L,entry->value.value.userdata.pvalue,
1177 *(entry->value.value.userdata.ptype),0);
1178 break;
1179 case LUA_TNIL:
1180 lua_pushnil(L);
1181 break;
1182 default:
1183 assert(0);
1184 }
1185 assert(lua_gettop(L) == pairs_start + 2);
1186 lua_rawset(L,target_table);
1187 }
1188 lua_pop(L,1); /* Removing parsed tables storage */
1189 assert(lua_gettop(L) == target_table);
1190}
1191
1192SWIGINTERN void SWIG_Lua_elua_emulate_register_clear(lua_State *L)
1193{
1194 lua_pushnil(L);
1195 lua_rawsetp(L, LUA_REGISTRYINDEX, &swig_lua_elua_emulate_unique_key);
1196}
1197
1198SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L);
1199
1200SWIGINTERN int SWIG_Lua_emulate_elua_getmetatable(lua_State *L)
1201{
1202 SWIG_check_num_args("getmetatable(SWIG eLua emulation)", 1, 1);
1203 SWIG_Lua_get_class_registry(L);
1204 lua_getfield(L,-1,"lua_getmetatable");
1205 lua_remove(L,-2); /* remove the registry*/
1206 assert(!lua_isnil(L,-1));
1207 lua_pushvalue(L,1);
1208 assert(lua_gettop(L) == 3); /* object | function | object again */
1209 lua_call(L,1,1);
1210 if(!lua_isnil(L,-1)) /*There is an ordinary metatable */
1211 return 1;
1212 /*if it is a table, then emulate elua behaviour - check for __metatable attribute of a table*/
1213 assert(lua_gettop(L) == 2);
1214 if(lua_istable(L,-2)) {
1215 lua_pop(L,1); /*remove the nil*/
1216 lua_getfield(L,-1, SWIG_LUA_ELUA_EMUL_METATABLE_KEY);
1217 }
1218 assert(lua_gettop(L) == 2);
1219 return 1;
1220
1221fail:
1222 lua_error(L);
1223 return 0;
1224}
1225
1226SWIGINTERN void SWIG_Lua_emulate_elua_swap_getmetatable(lua_State *L)
1227{
1228 SWIG_Lua_get_class_registry(L);
1229 lua_pushglobaltable(L);
1230 lua_pushstring(L,"lua_getmetatable");
1231 lua_getfield(L,-2,"getmetatable");
1232 assert(!lua_isnil(L,-1));
1233 lua_rawset(L,-4);
1234 lua_pushstring(L, "getmetatable");
1235 lua_pushcfunction(L, SWIG_Lua_emulate_elua_getmetatable);
1236 lua_rawset(L,-3);
1237 lua_pop(L,2);
1238
1239}
1240/* END OF REMOVE */
1241
1242#endif
1243/* -----------------------------------------------------------------------------
1244 * global variable support code: namespaces and modules (which are the same thing)
1245 * ----------------------------------------------------------------------------- */
1246
1247SWIGINTERN int SWIG_Lua_namespace_get(lua_State *L)
1248{
1249/* there should be 2 params passed in
1250 (1) table (not the meta table)
1251 (2) string name of the attribute
1252*/
1253 assert(lua_istable(L,-2)); /* just in case */
1254 lua_getmetatable(L,-2);
1255 assert(lua_istable(L,-1));
1256 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1257 assert(lua_istable(L,-1));
1258 /* look for the key in the .get table */
1259 lua_pushvalue(L,2); /* key */
1260 lua_rawget(L,-2);
1261 lua_remove(L,-2); /* stack tidy, remove .get table */
1262 if (lua_iscfunction(L,-1))
1263 { /* found it so call the fn & return its value */
1264 lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */
1265 lua_remove(L,-2); /* stack tidy, remove metatable */
1266 return 1;
1267 }
1268 lua_pop(L,1); /* remove whatever was there */
1269 /* ok, so try the .fn table */
1270 SWIG_Lua_get_table(L,".fn"); /* find the .get table */
1271 assert(lua_istable(L,-1)); /* just in case */
1272 lua_pushvalue(L,2); /* key */
1273 lua_rawget(L,-2); /* look for the fn */
1274 lua_remove(L,-2); /* stack tidy, remove .fn table */
1275 if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
1276 { /* found it so return the fn & let lua call it */
1277 lua_remove(L,-2); /* stack tidy, remove metatable */
1278 return 1;
1279 }
1280 lua_pop(L,1); /* remove whatever was there */
1281 return 0;
1282}
1283
1284SWIGINTERN int SWIG_Lua_namespace_set(lua_State *L)
1285{
1286/* there should be 3 params passed in
1287 (1) table (not the meta table)
1288 (2) string name of the attribute
1289 (3) any for the new value
1290*/
1291
1292 assert(lua_istable(L,1));
1293 lua_getmetatable(L,1); /* get the meta table */
1294 assert(lua_istable(L,-1));
1295
1296 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1297 if (lua_istable(L,-1))
1298 {
1299 /* look for the key in the .set table */
1300 lua_pushvalue(L,2); /* key */
1301 lua_rawget(L,-2);
1302 if (lua_iscfunction(L,-1))
1303 { /* found it so call the fn & return its value */
1304 lua_pushvalue(L,3); /* value */
1305 lua_call(L,1,0);
1306 return 0;
1307 }
1308 lua_pop(L,1); /* remove the value */
1309 }
1310 lua_pop(L,1); /* remove the value .set table */
1311 lua_pop(L,1); /* remote metatable */
1312 lua_rawset(L,-3);
1313 return 0;
1314}
1315
1316#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
1317SWIGINTERN void SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]); /* forward declaration */
1318SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn); /* forward declaration */
1319SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss);
1320
1321/* helper function - register namespace methods and attributes into namespace */
1322SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State *L, swig_lua_namespace *ns)
1323{
1324 int i;
1325 /* There must be namespace table (not metatable) at the top of the stack */
1326 assert(lua_istable(L,-1));
1327 SWIG_Lua_InstallConstants(L, ns->ns_constants);
1328
1329 /* add methods to the namespace/module table */
1330 for(i=0;ns->ns_methods[i].name;i++){
1331 SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].func);
1332 }
1333 lua_getmetatable(L,-1);
1334
1335 /* add fns */
1336 for(i=0;ns->ns_attributes[i].name;i++){
1337 SWIG_Lua_add_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
1338 }
1339
1340 /* clear stack - remove metatble */
1341 lua_pop(L,1);
1342 return 0;
1343}
1344
1345/* Register all classes in the namespace */
1346SWIGINTERN void SWIG_Lua_add_namespace_classes(lua_State *L, swig_lua_namespace *ns)
1347{
1348 swig_lua_class **classes;
1349
1350 /* There must be a module/namespace table at the top of the stack */
1351 assert(lua_istable(L,-1));
1352
1353 classes = ns->ns_classes;
1354
1355 if( classes != 0 ) {
1356 while(*classes != 0) {
1357 SWIG_Lua_class_register(L, *classes);
1358 classes++;
1359 }
1360 }
1361}
1362
1363/* Helper function. Creates namespace table and adds it to module table
1364 if 'reg' is true, then will register namespace table to parent one (must be on top of the stack
1365 when function is called).
1366 Function always returns newly registered table on top of the stack.
1367*/
1368SWIGINTERN void SWIG_Lua_namespace_register(lua_State *L, swig_lua_namespace *ns, int reg)
1369{
1370 swig_lua_namespace **sub_namespace;
1371 /* 1 argument - table on the top of the stack */
1372 const int SWIGUNUSED begin = lua_gettop(L);
1373 assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table or parent namespace table */
1374 lua_checkstack(L,5);
1375 lua_newtable(L); /* namespace itself */
1376 lua_newtable(L); /* metatable for namespace */
1377
1378 /* add a table called ".get" */
1379 lua_pushstring(L,".get");
1380 lua_newtable(L);
1381 lua_rawset(L,-3);
1382 /* add a table called ".set" */
1383 lua_pushstring(L,".set");
1384 lua_newtable(L);
1385 lua_rawset(L,-3);
1386 /* add a table called ".fn" */
1387 lua_pushstring(L,".fn");
1388 lua_newtable(L);
1389 lua_rawset(L,-3);
1390
1391 /* add accessor fns for using the .get,.set&.fn */
1392 SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
1393 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);
1394
1395 lua_setmetatable(L,-2); /* set metatable */
1396
1397 /* Register all functions, variables etc */
1398 SWIG_Lua_add_namespace_details(L,ns);
1399 /* Register classes */
1400 SWIG_Lua_add_namespace_classes(L,ns);
1401
1402 sub_namespace = ns->ns_namespaces;
1403 if( sub_namespace != 0) {
1404 while(*sub_namespace != 0) {
1405 SWIG_Lua_namespace_register(L, *sub_namespace, 1);
1406 lua_pop(L,1); /* removing sub-namespace table */
1407 sub_namespace++;
1408 }
1409 }
1410
1411 if (reg) {
1412 lua_pushstring(L,ns->name);
1413 lua_pushvalue(L,-2);
1414 lua_rawset(L,-4); /* add namespace to module table */
1415 }
1416 assert(lua_gettop(L) == begin+1);
1417}
1418#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */
1419
1420/* -----------------------------------------------------------------------------
1421 * global variable support code: classes
1422 * ----------------------------------------------------------------------------- */
1423
1424SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname);
1425
1426typedef int (*swig_lua_base_iterator_func)(lua_State*,swig_type_info*, int, int *ret);
1427
1428SWIGINTERN int SWIG_Lua_iterate_bases(lua_State *L, swig_type_info * SWIGUNUSED swig_type,
1429 int first_arg, swig_lua_base_iterator_func func, int *const ret)
1430{
1431 /* first_arg - position of the object in stack. Everything that is above are arguments
1432 * and is passed to every evocation of the func */
1433 int last_arg = lua_gettop(L);/* position of last argument */
1434 int original_metatable = last_arg + 1;
1435 size_t bases_count;
1436 int result = SWIG_ERROR;
1437 int bases_table;
1438 (void)swig_type;
1439 lua_getmetatable(L,first_arg);
1440
1441 /* initialise base search */
1442#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1443 SWIG_Lua_get_table(L,".bases");
1444 assert(lua_istable(L,-1));
1445 bases_count = lua_rawlen(L,-1);
1446 bases_table = lua_gettop(L);
1447#else
1448 /* In elua .bases table doesn't exist. Use table from swig_lua_class */
1449 (void)bases_table;
1450 assert(swig_type!=0);
1451 swig_module_info *module=SWIG_GetModule(L);
1452 swig_lua_class **bases= ((swig_lua_class*)(swig_type->clientdata))->bases;
1453 const char **base_names= ((swig_lua_class*)(swig_type->clientdata))->base_names;
1454 bases_count = 0;
1455 for(;base_names[bases_count];
1456 bases_count++);/* get length of bases */
1457#endif
1458
1459 if(ret)
1460 *ret = 0;
1461 if(bases_count>0)
1462 {
1463 int to_remove;
1464 size_t i;
1465 int j;
1466 int subcall_last_arg;
1467 int subcall_first_arg = lua_gettop(L) + 1;/* Here a copy of first_arg and arguments begin */
1468 int valid = 1;
1469 swig_type_info *base_swig_type = 0;
1470 for(j=first_arg;j<=last_arg;j++)
1471 lua_pushvalue(L,j);
1472 subcall_last_arg = lua_gettop(L);
1473
1474 /* Trick: temporarily replacing original metatable with metatable for base class and call getter */
1475 for(i=0;i<bases_count;i++) {
1476 /* Iteration through class bases */
1477#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1478 lua_rawgeti(L,bases_table,i+1);
1479 base_swig_type = 0;
1480 if(lua_isnil(L,-1)) {
1481 valid = 0;
1482 lua_pop(L,1);
1483 } else {
1484 valid = 1;
1485 }
1486#else /* In elua .bases table doesn't exist. Use table from swig_lua_class */
1487 swig_lua_class *base_class = bases[i];
1488 if(!base_class) {
1489 valid = 0;
1490 } else {
1491 valid = 1;
1492 SWIG_Lua_get_class_metatable(L,base_class->fqname);
1493 base_swig_type = SWIG_TypeQueryModule(module,module,base_names[i]);
1494 assert(base_swig_type != 0);
1495 }
1496#endif
1497
1498 if(!valid)
1499 continue;
1500 assert(lua_isuserdata(L, subcall_first_arg));
1501 assert(lua_istable(L,-1));
1502 lua_setmetatable(L,subcall_first_arg); /* Set new metatable */
1503 assert(lua_gettop(L) == subcall_last_arg);
1504 result = func(L, base_swig_type,subcall_first_arg, ret); /* Forward call */
1505 if(result != SWIG_ERROR) {
1506 break;
1507 }
1508 }
1509 /* Restore original metatable */
1510 lua_pushvalue(L,original_metatable);
1511 lua_setmetatable(L,first_arg);
1512 /* Clear - remove everything between last_arg and subcall_last_arg including */
1513 to_remove = subcall_last_arg - last_arg;
1514 for(j=0;j<to_remove;j++)
1515 lua_remove(L,last_arg+1);
1516 } else {
1517 /* Remove everything after last_arg */
1518 lua_pop(L, lua_gettop(L) - last_arg);
1519 }
1520 if(ret) assert(lua_gettop(L) == last_arg + *ret);
1521 return result;
1522}
1523
1524/* The class.get method helper, performs the lookup of class attributes.
1525 * It returns an error code. Number of function return values is passed inside 'ret'.
1526 * first_arg is not used in this function because function always has 2 arguments.
1527 */
1528SWIGINTERN int SWIG_Lua_class_do_get_item(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
1529{
1530/* there should be 2 params passed in
1531 (1) userdata (not the meta table)
1532 (2) string name of the attribute
1533*/
1534 int bases_search_result;
1535 int substack_start = lua_gettop(L)-2;
1536 assert(first_arg == substack_start+1);
1537 lua_checkstack(L,5);
1538 assert(lua_isuserdata(L,-2)); /* just in case */
1539 lua_getmetatable(L,-2); /* get the meta table */
1540 assert(lua_istable(L,-1)); /* just in case */
1541 /* NEW: looks for the __getitem() fn
1542 this is a user provided get fn */
1543 SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
1544 if (lua_iscfunction(L,-1)) /* if its there */
1545 { /* found it so call the fn & return its value */
1546 lua_pushvalue(L,substack_start+1); /* the userdata */
1547 lua_pushvalue(L,substack_start+2); /* the parameter */
1548 lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
1549 lua_remove(L,-2); /* stack tidy, remove metatable */
1550 if(ret) *ret = 1;
1551 return SWIG_OK;
1552 }
1553 lua_pop(L,1);
1554 /* Remove the metatable */
1555 lua_pop(L,1);
1556 /* Search in base classes */
1557 bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get_item,ret);
1558 return bases_search_result; /* sorry not known */
1559}
1560
1561
1562/* The class.get method helper, performs the lookup of class attributes.
1563 * It returns an error code. Number of function return values is passed inside 'ret'.
1564 * first_arg is not used in this function because function always has 2 arguments.
1565 */
1566SWIGINTERN int SWIG_Lua_class_do_get(lua_State *L, swig_type_info *type, int SWIGUNUSED first_arg, int *ret)
1567{
1568/* there should be 2 params passed in
1569 (1) userdata (not the meta table)
1570 (2) string name of the attribute
1571*/
1572 int bases_search_result;
1573 int substack_start = lua_gettop(L)-2;
1574 assert(first_arg == substack_start+1);
1575 lua_checkstack(L,5);
1576 assert(lua_isuserdata(L,-2)); /* just in case */
1577 lua_getmetatable(L,-2); /* get the meta table */
1578 assert(lua_istable(L,-1)); /* just in case */
1579 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1580 assert(lua_istable(L,-1)); /* just in case */
1581 /* look for the key in the .get table */
1582 lua_pushvalue(L,substack_start+2); /* key */
1583 lua_rawget(L,-2);
1584 lua_remove(L,-2); /* stack tidy, remove .get table */
1585 if (lua_iscfunction(L,-1))
1586 { /* found it so call the fn & return its value */
1587 lua_pushvalue(L,substack_start+1); /* the userdata */
1588 lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
1589 lua_remove(L,-2); /* stack tidy, remove metatable */
1590 if(ret)
1591 *ret = 1;
1592 return SWIG_OK;
1593 }
1594 lua_pop(L,1); /* remove whatever was there */
1595 /* ok, so try the .fn table */
1596 SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
1597 assert(lua_istable(L,-1)); /* just in case */
1598 lua_pushvalue(L,substack_start+2); /* key */
1599 lua_rawget(L,-2); /* look for the fn */
1600 lua_remove(L,-2); /* stack tidy, remove .fn table */
1601 if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
1602 { /* found it so return the fn & let lua call it */
1603 lua_remove(L,-2); /* stack tidy, remove metatable */
1604 if(ret)
1605 *ret = 1;
1606 return SWIG_OK;
1607 }
1608 lua_pop(L,1); /* remove whatever was there */
1609 /* Remove the metatable */
1610 lua_pop(L,1);
1611 /* Search in base classes */
1612 bases_search_result = SWIG_Lua_iterate_bases(L,type,substack_start+1,SWIG_Lua_class_do_get,ret);
1613 return bases_search_result; /* sorry not known */
1614}
1615
1616/* the class.get method, performs the lookup of class attributes
1617 */
1618SWIGINTERN int SWIG_Lua_class_get(lua_State *L)
1619{
1620/* there should be 2 params passed in
1621 (1) userdata (not the meta table)
1622 (2) string name of the attribute
1623*/
1624 int result;
1625 swig_lua_userdata *usr;
1626 swig_type_info *type;
1627 int ret = 0;
1628 assert(lua_isuserdata(L,1));
1629 usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
1630 type = usr->type;
1631 result = SWIG_Lua_class_do_get(L,type,1,&ret);
1632 if(result == SWIG_OK)
1633 return ret;
1634
1635 result = SWIG_Lua_class_do_get_item(L,type,1,&ret);
1636 if(result == SWIG_OK)
1637 return ret;
1638
1639 return 0;
1640}
1641
1642/* helper for the class.set method, performs the lookup of class attributes
1643 * It returns error code. Number of function return values is passed inside 'ret'
1644 */
1645SWIGINTERN int SWIG_Lua_class_do_set(lua_State *L, swig_type_info *type, int first_arg, int *ret)
1646{
1647/* there should be 3 params passed in
1648 (1) table (not the meta table)
1649 (2) string name of the attribute
1650 (3) any for the new value
1651 */
1652
1653 int bases_search_result;
1654 int substack_start = lua_gettop(L) - 3;
1655 lua_checkstack(L,5);
1656 assert(lua_isuserdata(L,substack_start+1)); /* just in case */
1657 lua_getmetatable(L,substack_start+1); /* get the meta table */
1658 assert(lua_istable(L,-1)); /* just in case */
1659 if(ret)
1660 *ret = 0; /* it is setter - number of return values is always 0 */
1661
1662 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1663 if (lua_istable(L,-1))
1664 {
1665 /* look for the key in the .set table */
1666 lua_pushvalue(L,substack_start+2); /* key */
1667 lua_rawget(L,-2);
1668 lua_remove(L,-2); /* tidy stack, remove .set table */
1669 if (lua_iscfunction(L,-1))
1670 { /* found it so call the fn & return its value */
1671 lua_pushvalue(L,substack_start+1); /* userdata */
1672 lua_pushvalue(L,substack_start+3); /* value */
1673 lua_call(L,2,0);
1674 lua_remove(L,substack_start+4); /*remove metatable*/
1675 return SWIG_OK;
1676 }
1677 lua_pop(L,1); /* remove the value */
1678 } else {
1679 lua_pop(L,1); /* remove the answer for .set table request*/
1680 }
1681 /* NEW: looks for the __setitem() fn
1682 this is a user provided set fn */
1683 SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
1684 if (lua_iscfunction(L,-1)) /* if its there */
1685 { /* found it so call the fn & return its value */
1686 lua_pushvalue(L,substack_start+1); /* the userdata */
1687 lua_pushvalue(L,substack_start+2); /* the parameter */
1688 lua_pushvalue(L,substack_start+3); /* the value */
1689 lua_call(L,3,0); /* 3 values in ,0 out */
1690 lua_remove(L,-2); /* stack tidy, remove metatable */
1691 return SWIG_OK;
1692 }
1693 lua_pop(L,1); /* remove value */
1694
1695 lua_pop(L,1); /* remove metatable */
1696 /* Search among bases */
1697 bases_search_result = SWIG_Lua_iterate_bases(L,type,first_arg,SWIG_Lua_class_do_set,ret);
1698 if(ret)
1699 assert(*ret == 0);
1700 assert(lua_gettop(L) == substack_start + 3);
1701 return bases_search_result;
1702}
1703
1704/* This is the actual method exported to Lua. It calls SWIG_Lua_class_do_set and correctly
1705 * handles return values.
1706 */
1707SWIGINTERN int SWIG_Lua_class_set(lua_State *L)
1708{
1709/* There should be 3 params passed in
1710 (1) table (not the meta table)
1711 (2) string name of the attribute
1712 (3) any for the new value
1713 */
1714 int ret = 0;
1715 int result;
1716 swig_lua_userdata *usr;
1717 swig_type_info *type;
1718 assert(lua_isuserdata(L,1));
1719 usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
1720 type = usr->type;
1721 result = SWIG_Lua_class_do_set(L,type,1,&ret);
1722 if(result != SWIG_OK) {
1723 SWIG_Lua_pushferrstring(L,"Assignment not possible. No setter/member with this name. For custom assignments implement __setitem method.");
1724 lua_error(L);
1725 } else {
1726 assert(ret==0);
1727 }
1728 return 0;
1729}
1730
1731/* the class.destruct method called by the interpreter */
1732SWIGINTERN int SWIG_Lua_class_destruct(lua_State *L)
1733{
1734/* there should be 1 params passed in
1735 (1) userdata (not the meta table) */
1736 swig_lua_userdata *usr;
1737 swig_lua_class *clss;
1738 assert(lua_isuserdata(L,-1)); /* just in case */
1739 usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
1740 /* if must be destroyed & has a destructor */
1741 if (usr->own) /* if must be destroyed */
1742 {
1743 clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
1744 if (clss && clss->destructor) /* there is a destroy fn */
1745 {
1746 clss->destructor(usr->ptr); /* bye bye */
1747 }
1748 }
1749 return 0;
1750}
1751
1752/* the class.__tostring method called by the interpreter and print */
1753SWIGINTERN int SWIG_Lua_class_tostring(lua_State *L)
1754{
1755/* there should be 1 param passed in
1756 (1) userdata (not the metatable) */
1757 const char *className;
1758 void* userData;
1759 assert(lua_isuserdata(L,1)); /* just in case */
1760 userData = lua_touserdata(L,1); /* get the userdata address for later */
1761 lua_getmetatable(L,1); /* get the meta table */
1762 assert(lua_istable(L,-1)); /* just in case */
1763
1764 lua_getfield(L, -1, ".type");
1765 className = lua_tostring(L, -1);
1766
1767 lua_pushfstring(L, "<%s userdata: %p>", className, userData);
1768 return 1;
1769}
1770
1771/* to manually disown some userdata */
1772SWIGINTERN int SWIG_Lua_class_disown(lua_State *L)
1773{
1774/* there should be 1 params passed in
1775 (1) userdata (not the meta table) */
1776 swig_lua_userdata *usr;
1777 assert(lua_isuserdata(L,-1)); /* just in case */
1778 usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
1779
1780 usr->own = 0; /* clear our ownership */
1781 return 0;
1782}
1783
1784/* lua callable function to compare userdata's value
1785the issue is that two userdata may point to the same thing
1786but to lua, they are different objects */
1787SWIGRUNTIME int SWIG_Lua_class_equal(lua_State *L)
1788{
1789 int result;
1790 swig_lua_userdata *usr1,*usr2;
1791 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
1792 return 0; /* nil reply */
1793 usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
1794 usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */
1795 /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
1796 result=(usr1->ptr==usr2->ptr);
1797 lua_pushboolean(L,result);
1798 return 1;
1799}
1800
1801/* populate table at the top of the stack with metamethods that ought to be inherited */
1802SWIGINTERN void SWIG_Lua_populate_inheritable_metamethods(lua_State *L)
1803{
1804 SWIG_Lua_add_boolean(L, "__add", 1);
1805 SWIG_Lua_add_boolean(L, "__sub", 1);
1806 SWIG_Lua_add_boolean(L, "__mul", 1);
1807 SWIG_Lua_add_boolean(L, "__div", 1);
1808 SWIG_Lua_add_boolean(L, "__mod", 1);
1809 SWIG_Lua_add_boolean(L, "__pow", 1);
1810 SWIG_Lua_add_boolean(L, "__unm", 1);
1811 SWIG_Lua_add_boolean(L, "__len", 1 );
1812 SWIG_Lua_add_boolean(L, "__concat", 1 );
1813 SWIG_Lua_add_boolean(L, "__eq", 1);
1814 SWIG_Lua_add_boolean(L, "__lt", 1);
1815 SWIG_Lua_add_boolean(L, "__le", 1);
1816 SWIG_Lua_add_boolean(L, "__call", 1);
1817 SWIG_Lua_add_boolean(L, "__tostring", 1);
1818 SWIG_Lua_add_boolean(L, "__gc", 0);
1819}
1820
1821/* creates the swig registry */
1822SWIGINTERN void SWIG_Lua_create_class_registry(lua_State *L)
1823{
1824 /* create main SWIG registry table */
1825 lua_pushstring(L,"SWIG");
1826 lua_newtable(L);
1827 /* populate it with some predefined data */
1828
1829 /* .library table. Placeholder */
1830 lua_pushstring(L,".library");
1831 lua_newtable(L);
1832 {
1833 /* list of metamethods that class inherits from its bases */
1834 lua_pushstring(L,"inheritable_metamethods");
1835 lua_newtable(L);
1836 /* populate with list of metamethods */
1837 SWIG_Lua_populate_inheritable_metamethods(L);
1838 lua_rawset(L,-3);
1839 }
1840 lua_rawset(L,-3);
1841
1842 lua_rawset(L,LUA_REGISTRYINDEX);
1843}
1844
1845/* gets the swig registry (or creates it) */
1846SWIGINTERN void SWIG_Lua_get_class_registry(lua_State *L)
1847{
1848 /* add this all into the swig registry: */
1849 lua_pushstring(L,"SWIG");
1850 lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
1851 if (!lua_istable(L,-1)) /* not there */
1852 { /* must be first time, so add it */
1853 lua_pop(L,1); /* remove the result */
1854 SWIG_Lua_create_class_registry(L);
1855 /* then get it */
1856 lua_pushstring(L,"SWIG");
1857 lua_rawget(L,LUA_REGISTRYINDEX);
1858 }
1859}
1860
1861SWIGINTERN void SWIG_Lua_get_inheritable_metamethods(lua_State *L)
1862{
1863 SWIG_Lua_get_class_registry(L);
1864 lua_pushstring(L, ".library");
1865 lua_rawget(L,-2);
1866 assert( !lua_isnil(L,-1) );
1867 lua_pushstring(L, "inheritable_metamethods");
1868 lua_rawget(L,-2);
1869
1870 /* Remove class registry and library table */
1871 lua_remove(L,-2);
1872 lua_remove(L,-2);
1873}
1874
1875/* Helper function to get the classes metatable from the register */
1876SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State *L,const char *cname)
1877{
1878 SWIG_Lua_get_class_registry(L); /* get the registry */
1879 lua_pushstring(L,cname); /* get the name */
1880 lua_rawget(L,-2); /* get it */
1881 lua_remove(L,-2); /* tidy up (remove registry) */
1882}
1883
1884/* Set up the base classes pointers.
1885Each class structure has a list of pointers to the base class structures.
1886This function fills them.
1887It cannot be done at compile time, as this will not work with hireachies
1888spread over more than one swig file.
1889Therefore it must be done at runtime, querying the SWIG type system.
1890*/
1891SWIGINTERN void SWIG_Lua_init_base_class(lua_State *L,swig_lua_class *clss)
1892{
1893 int i=0;
1894 swig_module_info *module=SWIG_GetModule(L);
1895 for(i=0;clss->base_names[i];i++)
1896 {
1897 if (clss->bases[i]==0) /* not found yet */
1898 {
1899 /* lookup and cache the base class */
1900 swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
1901 if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
1902 }
1903 }
1904}
1905
1906#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
1907/* Merges two tables */
1908SWIGINTERN void SWIG_Lua_merge_tables_by_index(lua_State *L, int target, int source)
1909{
1910 /* iterating */
1911 lua_pushnil(L);
1912 while (lua_next(L,source) != 0) {
1913 /* -1 - value, -2 - index */
1914 /* have to copy to assign */
1915 lua_pushvalue(L,-2); /* copy of index */
1916 lua_pushvalue(L,-2); /* copy of value */
1917 lua_rawset(L, target);
1918 lua_pop(L,1);
1919 /* only key is left */
1920 }
1921}
1922
1923/* Merges two tables with given name. original - index of target metatable, base - index of source metatable */
1924SWIGINTERN void SWIG_Lua_merge_tables(lua_State *L, const char* name, int original, int base)
1925{
1926 /* push original[name], then base[name] */
1927 lua_pushstring(L,name);
1928 lua_rawget(L,original);
1929 int original_table = lua_gettop(L);
1930 lua_pushstring(L,name);
1931 lua_rawget(L,base);
1932 int base_table = lua_gettop(L);
1933 SWIG_Lua_merge_tables_by_index(L, original_table, base_table);
1934 /* clearing stack */
1935 lua_pop(L,2);
1936}
1937
1938/* Function takes all symbols from base and adds it to derived class. It's just a helper. */
1939SWIGINTERN void SWIG_Lua_class_squash_base(lua_State *L, swig_lua_class *base_cls)
1940{
1941 /* There is one parameter - original, i.e. 'derived' class metatable */
1942 assert(lua_istable(L,-1));
1943 int original = lua_gettop(L);
1944 SWIG_Lua_get_class_metatable(L,base_cls->fqname);
1945 int base = lua_gettop(L);
1946 SWIG_Lua_merge_tables(L, ".fn", original, base );
1947 SWIG_Lua_merge_tables(L, ".set", original, base );
1948 SWIG_Lua_merge_tables(L, ".get", original, base );
1949 lua_pop(L,1);
1950}
1951
1952/* Function squashes all symbols from 'clss' bases into itself */
1953SWIGINTERN void SWIG_Lua_class_squash_bases(lua_State *L, swig_lua_class *clss)
1954{
1955 int i;
1956 SWIG_Lua_get_class_metatable(L,clss->fqname);
1957 for(i=0;clss->base_names[i];i++)
1958 {
1959 if (clss->bases[i]==0) /* Somehow it's not found. Skip it */
1960 continue;
1961 /* Thing is: all bases are already registered. Thus they have already executed
1962 * this function. So we just need to squash them into us, because their bases
1963 * are already squashed into them. No need for recursion here!
1964 */
1965 SWIG_Lua_class_squash_base(L, clss->bases[i]);
1966 }
1967 lua_pop(L,1); /*tidy stack*/
1968}
1969#endif
1970
1971#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA) /* In elua this is useless */
1972/* helper add a variable to a registered class */
1973SWIGINTERN void SWIG_Lua_add_variable(lua_State *L,const char *name,lua_CFunction getFn,lua_CFunction setFn)
1974{
1975 assert(lua_istable(L,-1)); /* just in case */
1976 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1977 assert(lua_istable(L,-1)); /* just in case */
1978 SWIG_Lua_add_function(L,name,getFn);
1979 lua_pop(L,1); /* tidy stack (remove table) */
1980 if (setFn)
1981 {
1982 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1983 assert(lua_istable(L,-1)); /* just in case */
1984 SWIG_Lua_add_function(L,name,setFn);
1985 lua_pop(L,1); /* tidy stack (remove table) */
1986 }
1987}
1988
1989/* helper to recursively add class static details (static attributes, operations and constants) */
1990SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State *L, swig_lua_class *clss)
1991{
1992 int i = 0;
1993 /* The class namespace table must be on the top of the stack */
1994 assert(lua_istable(L,-1));
1995 /* call all the base classes first: we can then override these later: */
1996 for(i=0;clss->bases[i];i++)
1997 {
1998 SWIG_Lua_add_class_static_details(L,clss->bases[i]);
1999 }
2000
2001 SWIG_Lua_add_namespace_details(L, clss->cls_static);
2002}
2003
2004SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss); /* forward declaration */
2005
2006/* helper to recursively add class details (attributes & operations) */
2007SWIGINTERN void SWIG_Lua_add_class_instance_details(lua_State *L, swig_lua_class *clss)
2008{
2009 int i;
2010 size_t bases_count = 0;
2011 /* Add bases to .bases table */
2012 SWIG_Lua_get_table(L,".bases");
2013 assert(lua_istable(L,-1)); /* just in case */
2014 for(i=0;clss->bases[i];i++)
2015 {
2016 SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
2017 /* Base class must be already registered */
2018 assert(lua_istable(L,-1));
2019 lua_rawseti(L,-2,i+1); /* In lua indexing starts from 1 */
2020 bases_count++;
2021 }
2022 assert(lua_rawlen(L,-1) == bases_count);
2023 lua_pop(L,1); /* remove .bases table */
2024 /* add attributes */
2025 for(i=0;clss->attributes[i].name;i++){
2026 SWIG_Lua_add_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
2027 }
2028 /* add methods to the metatable */
2029 SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
2030 assert(lua_istable(L,-1)); /* just in case */
2031 for(i=0;clss->methods[i].name;i++){
2032 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].func);
2033 }
2034 lua_pop(L,1); /* tidy stack (remove table) */
2035 /* add operator overloads
2036 This adds methods from metatable array to metatable. Can mess up garbage
2037 collectind if someone defines __gc method
2038 */
2039 if(clss->metatable) {
2040 for(i=0;clss->metatable[i].name;i++) {
2041 SWIG_Lua_add_function(L,clss->metatable[i].name,clss->metatable[i].func);
2042 }
2043 }
2044
2045#if !defined(SWIG_LUA_SQUASH_BASES)
2046 /* Adding metamethods that are defined in base classes. If bases were squashed
2047 * then it is obviously unnecessary
2048 */
2049 SWIG_Lua_add_class_user_metamethods(L, clss);
2050#endif
2051}
2052
2053/* Helpers to add user defined class metamedhods - __add, __sub etc. The helpers are needed
2054 for the following issue: Lua runtime checks for metamethod existence with rawget function
2055 ignoring our SWIG-provided __index and __newindex functions. Thus our inheritance-aware method
2056 search algorithm doesn't work in such case. (Not to say that Lua runtime queries metamethod directly
2057 in metatable and not in object).
2058 Current solution is this: if somewhere in hierarchy metamethod __x is defined, then all descendants
2059 are automatically given a special proxy __x that calls the real __x method.
2060 Obvious idea - to copy __x instead of creating __x-proxy is wrong because if someone changes __x in runtime,
2061 those changes must be reflected in all descendants.
2062*/
2063
2064SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L); /*forward declaration*/
2065
2066/* The real function that resolves a metamethod.
2067 * Function searches given class and all it's bases(recursively) for first instance of something that is
2068 * not equal to SWIG_Lua_resolve_metatmethod. (Almost always this 'something' is actual metamethod implementation
2069 * and it is a SWIG-generated C function.). It returns value on the top of the L and there is no garbage below the
2070 * answer.
2071 * Returns 1 if found, 0 otherwise.
2072 * clss is class which metatable we will search for method
2073 * metamethod_name_idx is index in L where metamethod name (as string) lies
2074 * skip_check allows to skip searching metamethod in givel clss and immideatelly go to searching in bases. skip_check
2075 * is not caried to subsequent recursive calls - false is always passed. It is set to true only at first call from
2076 * SWIG_Lua_resolve_metamethod
2077 * */
2078SWIGINTERN int SWIG_Lua_do_resolve_metamethod(lua_State *L, const swig_lua_class *clss, int metamethod_name_idx,
2079 int skip_check)
2080{
2081 /* This function is called recursively */
2082 int result = 0;
2083 int i = 0;
2084
2085 if (!skip_check) {
2086 SWIG_Lua_get_class_metatable(L, clss->fqname);
2087 lua_pushvalue(L, metamethod_name_idx);
2088 lua_rawget(L,-2);
2089 /* If this is cfunction and it is equal to SWIG_Lua_resolve_metamethod then
2090 * this isn't the function we are looking for :)
2091 * lua_tocfunction will return NULL if not cfunction
2092 */
2093 if (!lua_isnil(L,-1) && lua_tocfunction(L,-1) != SWIG_Lua_resolve_metamethod ) {
2094 lua_remove(L,-2); /* removing class metatable */
2095 return 1;
2096 }
2097 lua_pop(L,2); /* remove class metatable and query result */
2098 }
2099
2100 /* Forwarding calls to bases */
2101 for(i=0;clss->bases[i];i++)
2102 {
2103 result = SWIG_Lua_do_resolve_metamethod(L, clss->bases[i], metamethod_name_idx, 0);
2104 if (result)
2105 break;
2106 }
2107
2108 return result;
2109}
2110
2111/* The proxy function for metamethod. All parameters are passed as cclosure. Searches for actual method
2112 * and calls it */
2113SWIGRUNTIME int SWIG_Lua_resolve_metamethod(lua_State *L)
2114{
2115 int numargs;
2116 int metamethod_name_idx;
2117 const swig_lua_class* clss;
2118 int result;
2119
2120 lua_checkstack(L,5);
2121 numargs = lua_gettop(L); /* number of arguments to pass to actual metamethod */
2122
2123 /* Get upvalues from closure */
2124 lua_pushvalue(L, lua_upvalueindex(1)); /*Get function name*/
2125 metamethod_name_idx = lua_gettop(L);
2126
2127 lua_pushvalue(L, lua_upvalueindex(2));
2128 clss = (const swig_lua_class*)(lua_touserdata(L,-1));
2129 lua_pop(L,1); /* remove lightuserdata with clss from stack */
2130
2131 /* Actual work */
2132 result = SWIG_Lua_do_resolve_metamethod(L, clss, metamethod_name_idx, 1);
2133 if (!result) {
2134 SWIG_Lua_pushferrstring(L,"The metamethod proxy is set, but it failed to find actual metamethod. Memory corruption is most likely explanation.");
2135 lua_error(L);
2136 return 0;
2137 }
2138
2139 lua_remove(L,-2); /* remove metamethod key */
2140 lua_insert(L,1); /* move function to correct position */
2141 lua_call(L, numargs, LUA_MULTRET);
2142 return lua_gettop(L); /* return all results */
2143}
2144
2145
2146/* If given metamethod must be present in given class, then creates appropriate proxy
2147 * Returns 1 if successfully added, 0 if not added because no base class has it, -1
2148 * if method is defined in the class metatable itself
2149 */
2150SWIGINTERN int SWIG_Lua_add_class_user_metamethod(lua_State *L, swig_lua_class *clss, const int metatable_index)
2151{
2152 int key_index;
2153 int success = 0;
2154 int i = 0;
2155
2156 /* metamethod name - on the top of the stack */
2157 assert(lua_isstring(L,-1));
2158
2159 key_index = lua_gettop(L);
2160
2161 /* Check whether method is already defined in metatable */
2162 lua_pushvalue(L,key_index); /* copy of the key */
2163 lua_gettable(L,metatable_index);
2164 if( !lua_isnil(L,-1) ) {
2165 lua_pop(L,1);
2166 return -1;
2167 }
2168 lua_pop(L,1);
2169
2170 /* Iterating over immediate bases */
2171 for(i=0;clss->bases[i];i++)
2172 {
2173 const swig_lua_class *base = clss->bases[i];
2174 SWIG_Lua_get_class_metatable(L, base->fqname);
2175 lua_pushvalue(L, key_index);
2176 lua_rawget(L, -2);
2177 if( !lua_isnil(L,-1) ) {
2178 lua_pushvalue(L, key_index);
2179
2180 /* Add proxy function */
2181 lua_pushvalue(L, key_index); /* first closure value is function name */
2182 lua_pushlightuserdata(L, clss); /* second closure value is swig_lua_class structure */
2183 lua_pushcclosure(L, SWIG_Lua_resolve_metamethod, 2);
2184
2185 lua_rawset(L, metatable_index);
2186 success = 1;
2187 }
2188 lua_pop(L,1); /* remove function or nil */
2189 lua_pop(L,1); /* remove base class metatable */
2190
2191 if( success )
2192 break;
2193 }
2194
2195 return success;
2196}
2197
2198SWIGINTERN void SWIG_Lua_add_class_user_metamethods(lua_State *L, swig_lua_class *clss)
2199{
2200 int metatable_index;
2201 int metamethods_info_index;
2202 int tostring_undefined;
2203 int eq_undefined = 0;
2204
2205 SWIG_Lua_get_class_metatable(L, clss->fqname);
2206 metatable_index = lua_gettop(L);
2207 SWIG_Lua_get_inheritable_metamethods(L);
2208 assert(lua_istable(L,-1));
2209 metamethods_info_index = lua_gettop(L);
2210 lua_pushnil(L); /* first key */
2211 while(lua_next(L, metamethods_info_index) != 0 ) {
2212 /* key at index -2, value at index -1 */
2213 const int is_inheritable = lua_toboolean(L,-2);
2214 lua_pop(L,1); /* remove value - we don't need it anymore */
2215
2216 if(is_inheritable) { /* if metamethod is inheritable */
2217 SWIG_Lua_add_class_user_metamethod(L,clss,metatable_index);
2218 }
2219 }
2220
2221 lua_pop(L,1); /* remove inheritable metatmethods table */
2222
2223 /* Special handling for __tostring method */
2224 lua_pushstring(L, "__tostring");
2225 lua_pushvalue(L,-1);
2226 lua_rawget(L,metatable_index);
2227 tostring_undefined = lua_isnil(L,-1);
2228 lua_pop(L,1);
2229 if( tostring_undefined ) {
2230 lua_pushcfunction(L, SWIG_Lua_class_tostring);
2231 lua_rawset(L, metatable_index);
2232 } else {
2233 lua_pop(L,1); /* remove copy of the key */
2234 }
2235
2236 /* Special handling for __eq method */
2237 lua_pushstring(L, "__eq");
2238 lua_pushvalue(L,-1);
2239 lua_rawget(L,metatable_index);
2240 eq_undefined = lua_isnil(L,-1);
2241 lua_pop(L,1);
2242 if( eq_undefined ) {
2243 lua_pushcfunction(L, SWIG_Lua_class_equal);
2244 lua_rawset(L, metatable_index);
2245 } else {
2246 lua_pop(L,1); /* remove copy of the key */
2247 }
2248 /* Warning: __index and __newindex are SWIG-defined. For user-defined operator[]
2249 * a __getitem/__setitem method should be defined
2250 */
2251 lua_pop(L,1); /* pop class metatable */
2252}
2253
2254/* Register class static methods,attributes etc as well as constructor proxy */
2255SWIGINTERN void SWIG_Lua_class_register_static(lua_State *L, swig_lua_class *clss)
2256{
2257 const int SWIGUNUSED begin = lua_gettop(L);
2258 lua_checkstack(L,5); /* just in case */
2259 assert(lua_istable(L,-1)); /* just in case */
2260 assert(strcmp(clss->name, clss->cls_static->name) == 0); /* in class those 2 must be equal */
2261
2262 SWIG_Lua_namespace_register(L,clss->cls_static, 1);
2263
2264 assert(lua_istable(L,-1)); /* just in case */
2265
2266 /* add its constructor to module with the name of the class
2267 so you can do MyClass(...) as well as new_MyClass(...)
2268 BUT only if a constructor is defined
2269 (this overcomes the problem of pure virtual classes without constructors)*/
2270 if (clss->constructor)
2271 {
2272 lua_getmetatable(L,-1);
2273 assert(lua_istable(L,-1)); /* just in case */
2274 SWIG_Lua_add_function(L,"__call", clss->constructor);
2275 lua_pop(L,1);
2276 }
2277
2278 assert(lua_istable(L,-1)); /* just in case */
2279 SWIG_Lua_add_class_static_details(L, clss);
2280
2281 /* clear stack */
2282 lua_pop(L,1);
2283 assert( lua_gettop(L) == begin );
2284}
2285
2286/* Performs the instance (non-static) class registration process. Metatable for class is created
2287 * and added to the class registry.
2288 */
2289SWIGINTERN void SWIG_Lua_class_register_instance(lua_State *L,swig_lua_class *clss)
2290{
2291 const int SWIGUNUSED begin = lua_gettop(L);
2292 int i;
2293 /* if name already there (class is already registered) then do nothing */
2294 SWIG_Lua_get_class_registry(L); /* get the registry */
2295 lua_pushstring(L,clss->fqname); /* get the name */
2296 lua_rawget(L,-2);
2297 if(!lua_isnil(L,-1)) {
2298 lua_pop(L,2);
2299 assert(lua_gettop(L)==begin);
2300 return;
2301 }
2302 lua_pop(L,2); /* tidy stack */
2303 /* Recursively initialize all bases */
2304 for(i=0;clss->bases[i];i++)
2305 {
2306 SWIG_Lua_class_register_instance(L,clss->bases[i]);
2307 }
2308 /* Again, get registry and push name */
2309 SWIG_Lua_get_class_registry(L); /* get the registry */
2310 lua_pushstring(L,clss->fqname); /* get the name */
2311 lua_newtable(L); /* create the metatable */
2312#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2313 /* If squashing is requested, then merges all bases metatable into this one.
2314 * It would get us all special methods: __getitem, __add etc.
2315 * This would set .fn, .type, and other .xxx incorrectly, but we will overwrite it right away
2316 */
2317 {
2318 int new_metatable_index = lua_absindex(L,-1);
2319 for(i=0;clss->bases[i];i++)
2320 {
2321 int base_metatable;
2322 SWIG_Lua_get_class_metatable(L,clss->bases[i]->fqname);
2323 base_metatable = lua_absindex(L,-1);
2324 SWIG_Lua_merge_tables_by_index(L,new_metatable_index, base_metatable);
2325 lua_pop(L,1);
2326 }
2327 }
2328 /* And now we will overwrite all incorrectly set data */
2329#endif
2330 /* add string of class name called ".type" */
2331 lua_pushstring(L,".type");
2332 lua_pushstring(L,clss->fqname);
2333 lua_rawset(L,-3);
2334 /* add a table called bases */
2335 lua_pushstring(L,".bases");
2336 lua_newtable(L);
2337 lua_rawset(L,-3);
2338 /* add a table called ".get" */
2339 lua_pushstring(L,".get");
2340 lua_newtable(L);
2341 lua_rawset(L,-3);
2342 /* add a table called ".set" */
2343 lua_pushstring(L,".set");
2344 lua_newtable(L);
2345 lua_rawset(L,-3);
2346 /* add a table called ".fn" */
2347 lua_pushstring(L,".fn");
2348 lua_newtable(L);
2349 /* add manual disown method */
2350 SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
2351 lua_rawset(L,-3);
2352 /* add accessor fns for using the .get,.set&.fn */
2353 SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
2354 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
2355 SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
2356 /* add it */
2357 lua_rawset(L,-3); /* metatable into registry */
2358 lua_pop(L,1); /* tidy stack (remove registry) */
2359 assert(lua_gettop(L) == begin);
2360
2361#if defined(SWIG_LUA_SQUASH_BASES) && (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
2362 /* Now merge all symbols from .fn, .set, .get etc from bases to our tables */
2363 SWIG_Lua_class_squash_bases(L,clss);
2364#endif
2365 SWIG_Lua_get_class_metatable(L,clss->fqname);
2366 SWIG_Lua_add_class_instance_details(L,clss); /* recursive adding of details (atts & ops) */
2367 lua_pop(L,1); /* tidy stack (remove class metatable) */
2368 assert( lua_gettop(L) == begin );
2369}
2370
2371SWIGINTERN void SWIG_Lua_class_register(lua_State *L,swig_lua_class *clss)
2372{
2373 int SWIGUNUSED begin;
2374 assert(lua_istable(L,-1)); /* This is a table (module or namespace) where classes will be added */
2375 SWIG_Lua_class_register_instance(L,clss);
2376 SWIG_Lua_class_register_static(L,clss);
2377
2378 /* Add links from static part to instance part and vice versa */
2379 /* [SWIG registry] [Module]
2380 * "MyClass" ----> [MyClass metatable] <===== "MyClass" -+> [static part]
2381 * ".get" ----> ... | | getmetatable()----|
2382 * ".set" ----> ... | | |
2383 * ".static" --------------)----------------/ [static part metatable]
2384 * | ".get" --> ...
2385 * | ".set" --> ....
2386 * |=============================== ".instance"
2387 */
2388 begin = lua_gettop(L);
2389 lua_pushstring(L,clss->cls_static->name);
2390 lua_rawget(L,-2); /* get class static table */
2391 assert(lua_istable(L,-1));
2392 lua_getmetatable(L,-1);
2393 assert(lua_istable(L,-1)); /* get class static metatable */
2394 lua_pushstring(L,".instance"); /* prepare key */
2395
2396 SWIG_Lua_get_class_metatable(L,clss->fqname); /* get class metatable */
2397 assert(lua_istable(L,-1));
2398 lua_pushstring(L,".static"); /* prepare key */
2399 lua_pushvalue(L, -4); /* push static class TABLE */
2400 assert(lua_istable(L,-1));
2401 lua_rawset(L,-3); /* assign static class table(!NOT metatable) as ".static" member of class metatable */
2402 lua_rawset(L,-3); /* assign class metatable as ".instance" member of class static METATABLE */
2403 lua_pop(L,2);
2404 assert(lua_gettop(L) == begin);
2405}
2406#endif /* SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA */
2407
2408#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
2409SWIGINTERN void SWIG_Lua_elua_class_register_instance(lua_State *L, swig_lua_class *clss)
2410{
2411 const int SWIGUNUSED begin = lua_gettop(L);
2412 int i;
2413 /* if name already there (class is already registered) then do nothing */
2414 SWIG_Lua_get_class_registry(L); /* get the registry */
2415 lua_pushstring(L,clss->fqname); /* get the name */
2416 lua_rawget(L,-2);
2417 if(!lua_isnil(L,-1)) {
2418 lua_pop(L,2);
2419 assert(lua_gettop(L)==begin);
2420 return;
2421 }
2422 lua_pop(L,2); /* tidy stack */
2423 /* Recursively initialize all bases */
2424 for(i=0;clss->bases[i];i++)
2425 {
2426 SWIG_Lua_elua_class_register_instance(L,clss->bases[i]);
2427 }
2428 /* Again, get registry and push name */
2429 SWIG_Lua_get_class_registry(L); /* get the registry */
2430 lua_pushstring(L,clss->fqname); /* get the name */
2431 assert(clss->metatable);
2432 lua_pushrotable(L, (void*)(clss->metatable)); /* create the metatable */
2433 lua_rawset(L,-3);
2434 lua_pop(L,1);
2435 assert(lua_gettop(L) == begin);
2436}
2437#endif /* elua && eluac */
2438
2439/* -----------------------------------------------------------------------------
2440 * Class/structure conversion fns
2441 * ----------------------------------------------------------------------------- */
2442
2443/* helper to add metatable to new lua object */
2444SWIGINTERN void SWIG_Lua_AddMetatable(lua_State *L,swig_type_info *type)
2445{
2446 if (type->clientdata) /* there is clientdata: so add the metatable */
2447 {
2448 SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->fqname);
2449 if (lua_istable(L,-1))
2450 {
2451 lua_setmetatable(L,-2);
2452 }
2453 else
2454 {
2455 lua_pop(L,1);
2456 }
2457 }
2458}
2459
2460/* pushes a new object into the lua stack */
2461SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State *L,void *ptr,swig_type_info *type, int own)
2462{
2463 swig_lua_userdata *usr;
2464 if (!ptr){
2465 lua_pushnil(L);
2466 return;
2467 }
2468 usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */
2469 usr->ptr=ptr; /* set the ptr */
2470 usr->type=type;
2471 usr->own=own;
2472#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
2473 SWIG_Lua_AddMetatable(L,type); /* add metatable */
2474#endif
2475}
2476
2477/* takes a object from the lua stack & converts it into an object of the correct type
2478 (if possible) */
2479SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State *L,int index,void **ptr,swig_type_info *type,int flags)
2480{
2481 swig_lua_userdata *usr;
2482 swig_cast_info *cast;
2483 if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */
2484 usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
2485 if (usr)
2486 {
2487 if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
2488 {
2489 usr->own=0;
2490 }
2491 if (!type) /* special cast void*, no casting fn */
2492 {
2493 *ptr=usr->ptr;
2494 return SWIG_OK; /* ok */
2495 }
2496 cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
2497 if (cast)
2498 {
2499 int newmemory = 0;
2500 *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
2501 assert(!newmemory); /* newmemory handling not yet implemented */
2502 return SWIG_OK; /* ok */
2503 }
2504 }
2505 return SWIG_ERROR; /* error */
2506}
2507
2508SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State *L,int index,swig_type_info *type,int flags,
2509 int argnum,const char *func_name){
2510 void *result;
2511 if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
2512 luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
2513 func_name,(type && type->str)?type->str:"void*",argnum);
2514 }
2515 return result;
2516}
2517
2518/* pushes a packed userdata. user for member fn pointers only */
2519SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State *L,void *ptr,size_t size,swig_type_info *type)
2520{
2521 swig_lua_rawdata *raw;
2522 assert(ptr); /* not acceptable to pass in a NULL value */
2523 raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
2524 raw->type=type;
2525 raw->own=0;
2526 memcpy(raw->data,ptr,size); /* copy the data */
2527 SWIG_Lua_AddMetatable(L,type); /* add metatable */
2528}
2529
2530/* converts a packed userdata. user for member fn pointers only */
2531SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State *L,int index,void *ptr,size_t size,swig_type_info *type)
2532{
2533 swig_lua_rawdata *raw;
2534 raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
2535 if (!raw) return SWIG_ERROR; /* error */
2536 if (type==0 || type==raw->type) /* void* or identical type */
2537 {
2538 memcpy(ptr,raw->data,size); /* copy it */
2539 return SWIG_OK; /* ok */
2540 }
2541 return SWIG_ERROR; /* error */
2542}
2543
2544/* a function to get the typestring of a piece of data */
2545SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
2546{
2547 swig_lua_userdata *usr;
2548 if (lua_isuserdata(L,tp))
2549 {
2550 usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */
2551 if (usr && usr->type && usr->type->str)
2552 return usr->type->str;
2553 return "userdata (unknown type)";
2554 }
2555 return lua_typename(L,lua_type(L,tp));
2556}
2557
2558/* lua callable function to get the userdata's type */
2559SWIGRUNTIME int SWIG_Lua_type(lua_State *L)
2560{
2561 lua_pushstring(L,SWIG_Lua_typename(L,1));
2562 return 1;
2563}
2564
2565/* -----------------------------------------------------------------------------
2566 * global variable support code: class/struct typemap functions
2567 * ----------------------------------------------------------------------------- */
2568
2569#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
2570/* Install Constants */
2571SWIGINTERN void
2572SWIG_Lua_InstallConstants(lua_State *L, swig_lua_const_info constants[]) {
2573 int i;
2574 for (i = 0; constants[i].type; i++) {
2575 switch(constants[i].type) {
2576 case SWIG_LUA_INT:
2577 lua_pushstring(L,constants[i].name);
2578 lua_pushinteger(L,(lua_Number)constants[i].lvalue);
2579 lua_rawset(L,-3);
2580 break;
2581 case SWIG_LUA_FLOAT:
2582 lua_pushstring(L,constants[i].name);
2583 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
2584 lua_rawset(L,-3);
2585 break;
2586 case SWIG_LUA_CHAR:
2587 lua_pushstring(L,constants[i].name);
2588 {
2589 char c = constants[i].lvalue;
2590 lua_pushlstring(L,&c,1);
2591 }
2592 lua_rawset(L,-3);
2593 break;
2594 case SWIG_LUA_STRING:
2595 lua_pushstring(L,constants[i].name);
2596 lua_pushstring(L,(char *) constants[i].pvalue);
2597 lua_rawset(L,-3);
2598 break;
2599 case SWIG_LUA_POINTER:
2600 lua_pushstring(L,constants[i].name);
2601 SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
2602 lua_rawset(L,-3);
2603 break;
2604 case SWIG_LUA_BINARY:
2605 lua_pushstring(L,constants[i].name);
2606 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
2607 lua_rawset(L,-3);
2608 break;
2609 default:
2610 break;
2611 }
2612 }
2613}
2614#endif
2615
2616/* -----------------------------------------------------------------------------
2617 * executing lua code from within the wrapper
2618 * ----------------------------------------------------------------------------- */
2619
2620#ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
2621#define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
2622#endif
2623/* Executes a C string in Lua which is a really simple way of calling lua from C
2624Unfortunately lua keeps changing its APIs, so we need a conditional compile
2625In lua 5.0.X it's lua_dostring()
2626In lua 5.1.X it's luaL_dostring()
2627*/
2628SWIGINTERN int
2629SWIG_Lua_dostring(lua_State *L, const char *str) {
2630 int ok,top;
2631 if (str==0 || str[0]==0) return 0; /* nothing to do */
2632 top=lua_gettop(L); /* save stack */
2633#if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
2634 ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */
2635#else
2636 ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */
2637#endif
2638 if (ok!=0) {
2639 SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
2640 }
2641 lua_settop(L,top); /* restore the stack */
2642 return ok;
2643}
2644
2645#ifdef __cplusplus
2646}
2647#endif
2648
2649/* ------------------------------ end luarun.swg ------------------------------ */
2650
2651
2652/* -------- TYPES TABLE (BEGIN) -------- */
2653
2654#define SWIGTYPE_p_Camera swig_types[0]
2655#define SWIGTYPE_p_Camera2D swig_types[1]
2656#define SWIGTYPE_p_Camera3D swig_types[2]
2657#define SWIGTYPE_p_Color swig_types[3]
2658#define SWIGTYPE_p_Image swig_types[4]
2659#define SWIGTYPE_p_Matrix swig_types[5]
2660#define SWIGTYPE_p_Ray swig_types[6]
2661#define SWIGTYPE_p_RenderTexture2D swig_types[7]
2662#define SWIGTYPE_p_TraceLogCallback swig_types[8]
2663#define SWIGTYPE_p_Vector2 swig_types[9]
2664#define SWIGTYPE_p_Vector3 swig_types[10]
2665#define SWIGTYPE_p_Vector4 swig_types[11]
2666#define SWIGTYPE_p_int swig_types[12]
2667#define SWIGTYPE_p_p_char swig_types[13]
2668#define SWIGTYPE_p_void swig_types[14]
2669static swig_type_info *swig_types[16];
2670static swig_module_info swig_module = {swig_types, 15, 0, 0, 0, 0};
2671#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
2672#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
2673
2674/* -------- TYPES TABLE (END) -------- */
2675
2676#define SWIG_name "foo"
2677#define SWIG_init luaopen_foo
2678#define SWIG_init_user luaopen_foo_user
2679
2680#define SWIG_LUACODE luaopen_foo_luacode
2681
2682#include <stdio.h>
2683
2684
2685SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
2686 int ret = lua_isstring(L, idx);
2687 if (!ret)
2688 ret = lua_isnil(L, idx);
2689 return ret;
2690}
2691
2692#ifdef __cplusplus
2693extern "C" {
2694#endif
2695static int _wrap_InitWindow(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; char *arg3 = (char *) 0 ;
2696 SWIG_check_num_args("InitWindow",3,3) if(!lua_isnumber(L,1)) SWIG_fail_arg("InitWindow",1,"int");
2697 if(!lua_isnumber(L,2)) SWIG_fail_arg("InitWindow",2,"int");
2698 if(!SWIG_lua_isnilstring(L,3)) SWIG_fail_arg("InitWindow",3,"char const *"); arg1 = (int)lua_tonumber(L, 1);
2699 arg2 = (int)lua_tonumber(L, 2); arg3 = (char *)lua_tostring(L, 3); InitWindow(arg1,arg2,(char const *)arg3); return SWIG_arg;
2700 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2701static int _wrap_WindowShouldClose(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("WindowShouldClose",0,0)
2702 result = (bool)WindowShouldClose(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2703 lua_error(L); return SWIG_arg; }
2704static int _wrap_CloseWindow(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("CloseWindow",0,0) CloseWindow();
2705 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2706static int _wrap_IsWindowReady(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("IsWindowReady",0,0)
2707 result = (bool)IsWindowReady(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2708 lua_error(L); return SWIG_arg; }
2709static int _wrap_IsWindowMinimized(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("IsWindowMinimized",0,0)
2710 result = (bool)IsWindowMinimized(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2711 lua_error(L); return SWIG_arg; }
2712static int _wrap_IsWindowResized(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("IsWindowResized",0,0)
2713 result = (bool)IsWindowResized(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2714 lua_error(L); return SWIG_arg; }
2715static int _wrap_IsWindowHidden(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("IsWindowHidden",0,0)
2716 result = (bool)IsWindowHidden(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2717 lua_error(L); return SWIG_arg; }
2718static int _wrap_ToggleFullscreen(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("ToggleFullscreen",0,0)
2719 ToggleFullscreen(); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2720static int _wrap_UnhideWindow(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("UnhideWindow",0,0) UnhideWindow();
2721 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2722static int _wrap_HideWindow(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("HideWindow",0,0) HideWindow();
2723 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2724static int _wrap_SetWindowIcon(lua_State* L) { int SWIG_arg = 0; Image arg1 ; Image *argp1 ;
2725 SWIG_check_num_args("SetWindowIcon",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("SetWindowIcon",1,"Image");
2726 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Image,0))){ SWIG_fail_ptr("SetWindowIcon",1,SWIGTYPE_p_Image); }
2727 arg1 = *argp1; SetWindowIcon(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2728static int _wrap_SetWindowTitle(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ;
2729 SWIG_check_num_args("SetWindowTitle",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("SetWindowTitle",1,"char const *");
2730 arg1 = (char *)lua_tostring(L, 1); SetWindowTitle((char const *)arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2731 return SWIG_arg; }
2732static int _wrap_SetWindowPosition(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ;
2733 SWIG_check_num_args("SetWindowPosition",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("SetWindowPosition",1,"int");
2734 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetWindowPosition",2,"int"); arg1 = (int)lua_tonumber(L, 1);
2735 arg2 = (int)lua_tonumber(L, 2); SetWindowPosition(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2736 return SWIG_arg; }
2737static int _wrap_SetWindowMonitor(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetWindowMonitor",1,1)
2738 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetWindowMonitor",1,"int"); arg1 = (int)lua_tonumber(L, 1); SetWindowMonitor(arg1);
2739 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2740static int _wrap_SetWindowMinSize(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ;
2741 SWIG_check_num_args("SetWindowMinSize",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("SetWindowMinSize",1,"int");
2742 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetWindowMinSize",2,"int"); arg1 = (int)lua_tonumber(L, 1);
2743 arg2 = (int)lua_tonumber(L, 2); SetWindowMinSize(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2744 return SWIG_arg; }
2745static int _wrap_SetWindowSize(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; SWIG_check_num_args("SetWindowSize",2,2)
2746 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetWindowSize",1,"int"); if(!lua_isnumber(L,2)) SWIG_fail_arg("SetWindowSize",2,"int");
2747 arg1 = (int)lua_tonumber(L, 1); arg2 = (int)lua_tonumber(L, 2); SetWindowSize(arg1,arg2); return SWIG_arg; if(0) SWIG_fail;
2748 fail: lua_error(L); return SWIG_arg; }
2749static int _wrap_GetWindowHandle(lua_State* L) { int SWIG_arg = 0; void *result = 0 ; SWIG_check_num_args("GetWindowHandle",0,0)
2750 result = (void *)GetWindowHandle(); SWIG_NewPointerObj(L,result,SWIGTYPE_p_void,0); SWIG_arg++; return SWIG_arg;
2751 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2752static int _wrap_GetScreenWidth(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetScreenWidth",0,0)
2753 result = (int)GetScreenWidth(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2754 lua_error(L); return SWIG_arg; }
2755static int _wrap_GetScreenHeight(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetScreenHeight",0,0)
2756 result = (int)GetScreenHeight(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2757 lua_error(L); return SWIG_arg; }
2758static int _wrap_GetMonitorCount(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetMonitorCount",0,0)
2759 result = (int)GetMonitorCount(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2760 lua_error(L); return SWIG_arg; }
2761static int _wrap_GetMonitorWidth(lua_State* L) { int SWIG_arg = 0; int arg1 ; int result;
2762 SWIG_check_num_args("GetMonitorWidth",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetMonitorWidth",1,"int");
2763 arg1 = (int)lua_tonumber(L, 1); result = (int)GetMonitorWidth(arg1); lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
2764 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2765static int _wrap_GetMonitorHeight(lua_State* L) { int SWIG_arg = 0; int arg1 ; int result;
2766 SWIG_check_num_args("GetMonitorHeight",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetMonitorHeight",1,"int");
2767 arg1 = (int)lua_tonumber(L, 1); result = (int)GetMonitorHeight(arg1); lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
2768 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2769static int _wrap_GetMonitorPhysicalWidth(lua_State* L) { int SWIG_arg = 0; int arg1 ; int result;
2770 SWIG_check_num_args("GetMonitorPhysicalWidth",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetMonitorPhysicalWidth",1,"int");
2771 arg1 = (int)lua_tonumber(L, 1); result = (int)GetMonitorPhysicalWidth(arg1);
2772 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2773static int _wrap_GetMonitorPhysicalHeight(lua_State* L) { int SWIG_arg = 0; int arg1 ; int result;
2774 SWIG_check_num_args("GetMonitorPhysicalHeight",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetMonitorPhysicalHeight",1,"int");
2775 arg1 = (int)lua_tonumber(L, 1); result = (int)GetMonitorPhysicalHeight(arg1);
2776 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2777static int _wrap_GetMonitorName(lua_State* L) { int SWIG_arg = 0; int arg1 ; char *result = 0 ;
2778 SWIG_check_num_args("GetMonitorName",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetMonitorName",1,"int");
2779 arg1 = (int)lua_tonumber(L, 1); result = (char *)GetMonitorName(arg1); lua_pushstring(L,(const char *)result); SWIG_arg++;
2780 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2781static int _wrap_GetClipboardText(lua_State* L) { int SWIG_arg = 0; char *result = 0 ;
2782 SWIG_check_num_args("GetClipboardText",0,0) result = (char *)GetClipboardText();
2783 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2784static int _wrap_SetClipboardText(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ;
2785 SWIG_check_num_args("SetClipboardText",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("SetClipboardText",1,"char const *");
2786 arg1 = (char *)lua_tostring(L, 1); SetClipboardText((char const *)arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2787 return SWIG_arg; }
2788static int _wrap_ShowCursor(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("ShowCursor",0,0) ShowCursor();
2789 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2790static int _wrap_HideCursor(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("HideCursor",0,0) HideCursor();
2791 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2792static int _wrap_IsCursorHidden(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("IsCursorHidden",0,0)
2793 result = (bool)IsCursorHidden(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2794 lua_error(L); return SWIG_arg; }
2795static int _wrap_EnableCursor(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("EnableCursor",0,0) EnableCursor();
2796 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2797static int _wrap_DisableCursor(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("DisableCursor",0,0) DisableCursor();
2798 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2799static int _wrap_ClearBackground(lua_State* L) { int SWIG_arg = 0; Color arg1 ; Color *argp1 ;
2800 SWIG_check_num_args("ClearBackground",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("ClearBackground",1,"Color");
2801 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Color,0))){ SWIG_fail_ptr("ClearBackground",1,SWIGTYPE_p_Color); }
2802 arg1 = *argp1; ClearBackground(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2803static int _wrap_BeginDrawing(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("BeginDrawing",0,0) BeginDrawing();
2804 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2805static int _wrap_EndDrawing(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("EndDrawing",0,0) EndDrawing();
2806 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2807static int _wrap_BeginMode2D(lua_State* L) { int SWIG_arg = 0; Camera2D arg1 ; Camera2D *argp1 ;
2808 SWIG_check_num_args("BeginMode2D",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("BeginMode2D",1,"Camera2D");
2809 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Camera2D,0))){
2810 SWIG_fail_ptr("BeginMode2D",1,SWIGTYPE_p_Camera2D); } arg1 = *argp1; BeginMode2D(arg1); return SWIG_arg; if(0) SWIG_fail;
2811 fail: lua_error(L); return SWIG_arg; }
2812static int _wrap_EndMode2D(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("EndMode2D",0,0) EndMode2D(); return SWIG_arg;
2813 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2814static int _wrap_BeginMode3D(lua_State* L) { int SWIG_arg = 0; Camera3D arg1 ; Camera3D *argp1 ;
2815 SWIG_check_num_args("BeginMode3D",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("BeginMode3D",1,"Camera3D");
2816 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Camera3D,0))){
2817 SWIG_fail_ptr("BeginMode3D",1,SWIGTYPE_p_Camera3D); } arg1 = *argp1; BeginMode3D(arg1); return SWIG_arg; if(0) SWIG_fail;
2818 fail: lua_error(L); return SWIG_arg; }
2819static int _wrap_EndMode3D(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("EndMode3D",0,0) EndMode3D(); return SWIG_arg;
2820 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2821static int _wrap_BeginTextureMode(lua_State* L) { int SWIG_arg = 0; RenderTexture2D arg1 ; RenderTexture2D *argp1 ;
2822 SWIG_check_num_args("BeginTextureMode",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("BeginTextureMode",1,"RenderTexture2D");
2823 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_RenderTexture2D,0))){
2824 SWIG_fail_ptr("BeginTextureMode",1,SWIGTYPE_p_RenderTexture2D); } arg1 = *argp1; BeginTextureMode(arg1); return SWIG_arg;
2825 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2826static int _wrap_EndTextureMode(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("EndTextureMode",0,0) EndTextureMode();
2827 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2828static int _wrap_GetMouseRay(lua_State* L) { int SWIG_arg = 0; Vector2 arg1 ; Camera arg2 ; Vector2 *argp1 ; Camera *argp2 ;
2829 Ray result; SWIG_check_num_args("GetMouseRay",2,2) if(!lua_isuserdata(L,1)) SWIG_fail_arg("GetMouseRay",1,"Vector2");
2830 if(!lua_isuserdata(L,2)) SWIG_fail_arg("GetMouseRay",2,"Camera");
2831 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Vector2,0))){ SWIG_fail_ptr("GetMouseRay",1,SWIGTYPE_p_Vector2); }
2832 arg1 = *argp1; if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_Camera,0))){
2833 SWIG_fail_ptr("GetMouseRay",2,SWIGTYPE_p_Camera); } arg2 = *argp2; result = GetMouseRay(arg1,arg2); { Ray * resultptr;
2834 resultptr = (Ray *) malloc(sizeof(Ray)); memmove(resultptr, &result, sizeof(Ray));
2835 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Ray,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
2836 lua_error(L); return SWIG_arg; }
2837static int _wrap_GetWorldToScreen(lua_State* L) { int SWIG_arg = 0; Vector3 arg1 ; Camera arg2 ; Vector3 *argp1 ;
2838 Camera *argp2 ; Vector2 result; SWIG_check_num_args("GetWorldToScreen",2,2)
2839 if(!lua_isuserdata(L,1)) SWIG_fail_arg("GetWorldToScreen",1,"Vector3");
2840 if(!lua_isuserdata(L,2)) SWIG_fail_arg("GetWorldToScreen",2,"Camera");
2841 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Vector3,0))){
2842 SWIG_fail_ptr("GetWorldToScreen",1,SWIGTYPE_p_Vector3); } arg1 = *argp1;
2843 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_Camera,0))){
2844 SWIG_fail_ptr("GetWorldToScreen",2,SWIGTYPE_p_Camera); } arg2 = *argp2; result = GetWorldToScreen(arg1,arg2); {
2845 Vector2 * resultptr; resultptr = (Vector2 *) malloc(sizeof(Vector2)); memmove(resultptr, &result, sizeof(Vector2));
2846 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
2847 lua_error(L); return SWIG_arg; }
2848static int _wrap_GetCameraMatrix(lua_State* L) { int SWIG_arg = 0; Camera arg1 ; Camera *argp1 ; Matrix result;
2849 SWIG_check_num_args("GetCameraMatrix",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("GetCameraMatrix",1,"Camera");
2850 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Camera,0))){
2851 SWIG_fail_ptr("GetCameraMatrix",1,SWIGTYPE_p_Camera); } arg1 = *argp1; result = GetCameraMatrix(arg1); {
2852 Matrix * resultptr; resultptr = (Matrix *) malloc(sizeof(Matrix)); memmove(resultptr, &result, sizeof(Matrix));
2853 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Matrix,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
2854 lua_error(L); return SWIG_arg; }
2855static int _wrap_SetTargetFPS(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetTargetFPS",1,1)
2856 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetTargetFPS",1,"int"); arg1 = (int)lua_tonumber(L, 1); SetTargetFPS(arg1);
2857 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2858static int _wrap_GetFPS(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetFPS",0,0) result = (int)GetFPS();
2859 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2860static int _wrap_GetFrameTime(lua_State* L) { int SWIG_arg = 0; float result; SWIG_check_num_args("GetFrameTime",0,0)
2861 result = (float)GetFrameTime(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2862 lua_error(L); return SWIG_arg; }
2863static int _wrap_GetTime(lua_State* L) { int SWIG_arg = 0; double result; SWIG_check_num_args("GetTime",0,0)
2864 result = (double)GetTime(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2865 lua_error(L); return SWIG_arg; }
2866static int _wrap_ColorToInt(lua_State* L) { int SWIG_arg = 0; Color arg1 ; Color *argp1 ; int result;
2867 SWIG_check_num_args("ColorToInt",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("ColorToInt",1,"Color");
2868 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Color,0))){ SWIG_fail_ptr("ColorToInt",1,SWIGTYPE_p_Color); }
2869 arg1 = *argp1; result = (int)ColorToInt(arg1); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg;
2870 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2871static int _wrap_ColorNormalize(lua_State* L) { int SWIG_arg = 0; Color arg1 ; Color *argp1 ; Vector4 result;
2872 SWIG_check_num_args("ColorNormalize",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("ColorNormalize",1,"Color");
2873 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Color,0))){ SWIG_fail_ptr("ColorNormalize",1,SWIGTYPE_p_Color); }
2874 arg1 = *argp1; result = ColorNormalize(arg1); { Vector4 * resultptr; resultptr = (Vector4 *) malloc(sizeof(Vector4));
2875 memmove(resultptr, &result, sizeof(Vector4)); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector4,1); SWIG_arg++; }
2876 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2877static int _wrap_ColorToHSV(lua_State* L) { int SWIG_arg = 0; Color arg1 ; Color *argp1 ; Vector3 result;
2878 SWIG_check_num_args("ColorToHSV",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("ColorToHSV",1,"Color");
2879 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Color,0))){ SWIG_fail_ptr("ColorToHSV",1,SWIGTYPE_p_Color); }
2880 arg1 = *argp1; result = ColorToHSV(arg1); { Vector3 * resultptr; resultptr = (Vector3 *) malloc(sizeof(Vector3));
2881 memmove(resultptr, &result, sizeof(Vector3)); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector3,1); SWIG_arg++; }
2882 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2883static int _wrap_ColorFromHSV(lua_State* L) { int SWIG_arg = 0; Vector3 arg1 ; Vector3 *argp1 ; Color result;
2884 SWIG_check_num_args("ColorFromHSV",1,1) if(!lua_isuserdata(L,1)) SWIG_fail_arg("ColorFromHSV",1,"Vector3");
2885 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Vector3,0))){
2886 SWIG_fail_ptr("ColorFromHSV",1,SWIGTYPE_p_Vector3); } arg1 = *argp1; result = ColorFromHSV(arg1); { Color * resultptr;
2887 resultptr = (Color *) malloc(sizeof(Color)); memmove(resultptr, &result, sizeof(Color));
2888 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
2889 lua_error(L); return SWIG_arg; }
2890static int _wrap_GetColor(lua_State* L) { int SWIG_arg = 0; int arg1 ; Color result; SWIG_check_num_args("GetColor",1,1)
2891 if(!lua_isnumber(L,1)) SWIG_fail_arg("GetColor",1,"int"); arg1 = (int)lua_tonumber(L, 1); result = GetColor(arg1); {
2892 Color * resultptr; resultptr = (Color *) malloc(sizeof(Color)); memmove(resultptr, &result, sizeof(Color));
2893 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
2894 lua_error(L); return SWIG_arg; }
2895static int _wrap_Fade(lua_State* L) { int SWIG_arg = 0; Color arg1 ; float arg2 ; Color *argp1 ; Color result;
2896 SWIG_check_num_args("Fade",2,2) if(!lua_isuserdata(L,1)) SWIG_fail_arg("Fade",1,"Color");
2897 if(!lua_isnumber(L,2)) SWIG_fail_arg("Fade",2,"float");
2898 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Color,0))){ SWIG_fail_ptr("Fade",1,SWIGTYPE_p_Color); }
2899 arg1 = *argp1; arg2 = (float)lua_tonumber(L, 2); result = Fade(arg1,arg2); { Color * resultptr;
2900 resultptr = (Color *) malloc(sizeof(Color)); memmove(resultptr, &result, sizeof(Color));
2901 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Color,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
2902 lua_error(L); return SWIG_arg; }
2903static int _wrap_SetConfigFlags(lua_State* L) { int SWIG_arg = 0; unsigned char arg1 ; SWIG_check_num_args("SetConfigFlags",1,1)
2904 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetConfigFlags",1,"unsigned char");
2905 SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative") arg1 = (unsigned char)lua_tonumber(L, 1);
2906 SetConfigFlags(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2907static int _wrap_SetTraceLogLevel(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetTraceLogLevel",1,1)
2908 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetTraceLogLevel",1,"int"); arg1 = (int)lua_tonumber(L, 1); SetTraceLogLevel(arg1);
2909 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2910static int _wrap_SetTraceLogExit(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetTraceLogExit",1,1)
2911 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetTraceLogExit",1,"int"); arg1 = (int)lua_tonumber(L, 1); SetTraceLogExit(arg1);
2912 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2913static int _wrap_SetTraceLogCallback(lua_State* L) { int SWIG_arg = 0; TraceLogCallback arg1 ; TraceLogCallback *argp1 ;
2914 SWIG_check_num_args("SetTraceLogCallback",1,1)
2915 if(!lua_isuserdata(L,1)) SWIG_fail_arg("SetTraceLogCallback",1,"TraceLogCallback");
2916 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_TraceLogCallback,0))){
2917 SWIG_fail_ptr("SetTraceLogCallback",1,SWIGTYPE_p_TraceLogCallback); } arg1 = *argp1; SetTraceLogCallback(arg1);
2918 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2919static int _wrap_TraceLog(lua_State* L) { int SWIG_arg = 0; int arg1 ; char *arg2 = (char *) 0 ; void *arg3 = 0 ;
2920 SWIG_check_num_args("TraceLog",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("TraceLog",1,"int");
2921 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("TraceLog",2,"char const *"); arg1 = (int)lua_tonumber(L, 1);
2922 arg2 = (char *)lua_tostring(L, 2); TraceLog(arg1,(char const *)arg2,arg3); return SWIG_arg; if(0) SWIG_fail; fail:
2923 lua_error(L); return SWIG_arg; }
2924static int _wrap_TakeScreenshot(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ;
2925 SWIG_check_num_args("TakeScreenshot",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("TakeScreenshot",1,"char const *");
2926 arg1 = (char *)lua_tostring(L, 1); TakeScreenshot((char const *)arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2927 return SWIG_arg; }
2928static int _wrap_GetRandomValue(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; int result;
2929 SWIG_check_num_args("GetRandomValue",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetRandomValue",1,"int");
2930 if(!lua_isnumber(L,2)) SWIG_fail_arg("GetRandomValue",2,"int"); arg1 = (int)lua_tonumber(L, 1);
2931 arg2 = (int)lua_tonumber(L, 2); result = (int)GetRandomValue(arg1,arg2); lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
2932 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2933static int _wrap_FileExists(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; bool result;
2934 SWIG_check_num_args("FileExists",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("FileExists",1,"char const *");
2935 arg1 = (char *)lua_tostring(L, 1); result = (bool)FileExists((char const *)arg1);
2936 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2937static int _wrap_IsFileExtension(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ;
2938 bool result; SWIG_check_num_args("IsFileExtension",2,2)
2939 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("IsFileExtension",1,"char const *");
2940 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("IsFileExtension",2,"char const *"); arg1 = (char *)lua_tostring(L, 1);
2941 arg2 = (char *)lua_tostring(L, 2); result = (bool)IsFileExtension((char const *)arg1,(char const *)arg2);
2942 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2943static int _wrap_GetExtension(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; char *result = 0 ;
2944 SWIG_check_num_args("GetExtension",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("GetExtension",1,"char const *");
2945 arg1 = (char *)lua_tostring(L, 1); result = (char *)GetExtension((char const *)arg1);
2946 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2947static int _wrap_GetFileName(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; char *result = 0 ;
2948 SWIG_check_num_args("GetFileName",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("GetFileName",1,"char const *");
2949 arg1 = (char *)lua_tostring(L, 1); result = (char *)GetFileName((char const *)arg1);
2950 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2951static int _wrap_GetFileNameWithoutExt(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; char *result = 0 ;
2952 SWIG_check_num_args("GetFileNameWithoutExt",1,1)
2953 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("GetFileNameWithoutExt",1,"char const *"); arg1 = (char *)lua_tostring(L, 1);
2954 result = (char *)GetFileNameWithoutExt((char const *)arg1); lua_pushstring(L,(const char *)result); SWIG_arg++;
2955 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2956static int _wrap_GetDirectoryPath(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; char *result = 0 ;
2957 SWIG_check_num_args("GetDirectoryPath",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("GetDirectoryPath",1,"char const *");
2958 arg1 = (char *)lua_tostring(L, 1); result = (char *)GetDirectoryPath((char const *)arg1);
2959 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2960static int _wrap_GetWorkingDirectory(lua_State* L) { int SWIG_arg = 0; char *result = 0 ;
2961 SWIG_check_num_args("GetWorkingDirectory",0,0) result = (char *)GetWorkingDirectory();
2962 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2963static int _wrap_GetDirectoryFiles(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; int *arg2 = (int *) 0 ;
2964 char **result = 0 ; SWIG_check_num_args("GetDirectoryFiles",2,2)
2965 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("GetDirectoryFiles",1,"char const *");
2966 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("GetDirectoryFiles",2,"int *"); arg1 = (char *)lua_tostring(L, 1);
2967 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_int,0))){ SWIG_fail_ptr("GetDirectoryFiles",2,SWIGTYPE_p_int); }
2968 result = (char **)GetDirectoryFiles((char const *)arg1,arg2); SWIG_NewPointerObj(L,result,SWIGTYPE_p_p_char,0); SWIG_arg++;
2969 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2970static int _wrap_ClearDirectoryFiles(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("ClearDirectoryFiles",0,0)
2971 ClearDirectoryFiles(); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2972static int _wrap_ChangeDirectory(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; bool result;
2973 SWIG_check_num_args("ChangeDirectory",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("ChangeDirectory",1,"char const *");
2974 arg1 = (char *)lua_tostring(L, 1); result = (bool)ChangeDirectory((char const *)arg1);
2975 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2976static int _wrap_IsFileDropped(lua_State* L) { int SWIG_arg = 0; bool result; SWIG_check_num_args("IsFileDropped",0,0)
2977 result = (bool)IsFileDropped(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
2978 lua_error(L); return SWIG_arg; }
2979static int _wrap_GetDroppedFiles(lua_State* L) { int SWIG_arg = 0; int *arg1 = (int *) 0 ; char **result = 0 ;
2980 SWIG_check_num_args("GetDroppedFiles",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("GetDroppedFiles",1,"int *");
2981 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_int,0))){ SWIG_fail_ptr("GetDroppedFiles",1,SWIGTYPE_p_int); }
2982 result = (char **)GetDroppedFiles(arg1); SWIG_NewPointerObj(L,result,SWIGTYPE_p_p_char,0); SWIG_arg++; return SWIG_arg;
2983 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2984static int _wrap_ClearDroppedFiles(lua_State* L) { int SWIG_arg = 0; SWIG_check_num_args("ClearDroppedFiles",0,0)
2985 ClearDroppedFiles(); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2986static int _wrap_GetFileModTime(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; long result;
2987 SWIG_check_num_args("GetFileModTime",1,1) if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("GetFileModTime",1,"char const *");
2988 arg1 = (char *)lua_tostring(L, 1); result = (long)GetFileModTime((char const *)arg1);
2989 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2990static int _wrap_StorageSaveValue(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ;
2991 SWIG_check_num_args("StorageSaveValue",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("StorageSaveValue",1,"int");
2992 if(!lua_isnumber(L,2)) SWIG_fail_arg("StorageSaveValue",2,"int"); arg1 = (int)lua_tonumber(L, 1);
2993 arg2 = (int)lua_tonumber(L, 2); StorageSaveValue(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2994 return SWIG_arg; }
2995static int _wrap_StorageLoadValue(lua_State* L) { int SWIG_arg = 0; int arg1 ; int result;
2996 SWIG_check_num_args("StorageLoadValue",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("StorageLoadValue",1,"int");
2997 arg1 = (int)lua_tonumber(L, 1); result = (int)StorageLoadValue(arg1); lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
2998 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2999static int _wrap_OpenURL(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; SWIG_check_num_args("OpenURL",1,1)
3000 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("OpenURL",1,"char const *"); arg1 = (char *)lua_tostring(L, 1);
3001 OpenURL((char const *)arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3002static int _wrap_IsKeyPressed(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result; SWIG_check_num_args("IsKeyPressed",1,1)
3003 if(!lua_isnumber(L,1)) SWIG_fail_arg("IsKeyPressed",1,"int"); arg1 = (int)lua_tonumber(L, 1);
3004 result = (bool)IsKeyPressed(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3005 lua_error(L); return SWIG_arg; }
3006static int _wrap_IsKeyDown(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result; SWIG_check_num_args("IsKeyDown",1,1)
3007 if(!lua_isnumber(L,1)) SWIG_fail_arg("IsKeyDown",1,"int"); arg1 = (int)lua_tonumber(L, 1); result = (bool)IsKeyDown(arg1);
3008 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3009static int _wrap_IsKeyReleased(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3010 SWIG_check_num_args("IsKeyReleased",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsKeyReleased",1,"int");
3011 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsKeyReleased(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3012 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3013static int _wrap_IsKeyUp(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result; SWIG_check_num_args("IsKeyUp",1,1)
3014 if(!lua_isnumber(L,1)) SWIG_fail_arg("IsKeyUp",1,"int"); arg1 = (int)lua_tonumber(L, 1); result = (bool)IsKeyUp(arg1);
3015 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3016static int _wrap_GetKeyPressed(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetKeyPressed",0,0)
3017 result = (int)GetKeyPressed(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3018 lua_error(L); return SWIG_arg; }
3019static int _wrap_SetExitKey(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetExitKey",1,1)
3020 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetExitKey",1,"int"); arg1 = (int)lua_tonumber(L, 1); SetExitKey(arg1); return SWIG_arg;
3021 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3022static int _wrap_IsGamepadAvailable(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3023 SWIG_check_num_args("IsGamepadAvailable",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGamepadAvailable",1,"int");
3024 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsGamepadAvailable(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3025 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3026static int _wrap_IsGamepadName(lua_State* L) { int SWIG_arg = 0; int arg1 ; char *arg2 = (char *) 0 ; bool result;
3027 SWIG_check_num_args("IsGamepadName",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGamepadName",1,"int");
3028 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("IsGamepadName",2,"char const *"); arg1 = (int)lua_tonumber(L, 1);
3029 arg2 = (char *)lua_tostring(L, 2); result = (bool)IsGamepadName(arg1,(char const *)arg2);
3030 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3031static int _wrap_GetGamepadName(lua_State* L) { int SWIG_arg = 0; int arg1 ; char *result = 0 ;
3032 SWIG_check_num_args("GetGamepadName",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetGamepadName",1,"int");
3033 arg1 = (int)lua_tonumber(L, 1); result = (char *)GetGamepadName(arg1); lua_pushstring(L,(const char *)result); SWIG_arg++;
3034 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3035static int _wrap_IsGamepadButtonPressed(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; bool result;
3036 SWIG_check_num_args("IsGamepadButtonPressed",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGamepadButtonPressed",1,"int");
3037 if(!lua_isnumber(L,2)) SWIG_fail_arg("IsGamepadButtonPressed",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3038 arg2 = (int)lua_tonumber(L, 2); result = (bool)IsGamepadButtonPressed(arg1,arg2);
3039 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3040static int _wrap_IsGamepadButtonDown(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; bool result;
3041 SWIG_check_num_args("IsGamepadButtonDown",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGamepadButtonDown",1,"int");
3042 if(!lua_isnumber(L,2)) SWIG_fail_arg("IsGamepadButtonDown",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3043 arg2 = (int)lua_tonumber(L, 2); result = (bool)IsGamepadButtonDown(arg1,arg2);
3044 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3045static int _wrap_IsGamepadButtonReleased(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; bool result;
3046 SWIG_check_num_args("IsGamepadButtonReleased",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGamepadButtonReleased",1,"int");
3047 if(!lua_isnumber(L,2)) SWIG_fail_arg("IsGamepadButtonReleased",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3048 arg2 = (int)lua_tonumber(L, 2); result = (bool)IsGamepadButtonReleased(arg1,arg2);
3049 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3050static int _wrap_IsGamepadButtonUp(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; bool result;
3051 SWIG_check_num_args("IsGamepadButtonUp",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGamepadButtonUp",1,"int");
3052 if(!lua_isnumber(L,2)) SWIG_fail_arg("IsGamepadButtonUp",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3053 arg2 = (int)lua_tonumber(L, 2); result = (bool)IsGamepadButtonUp(arg1,arg2); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3054 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3055static int _wrap_GetGamepadButtonPressed(lua_State* L) { int SWIG_arg = 0; int result;
3056 SWIG_check_num_args("GetGamepadButtonPressed",0,0) result = (int)GetGamepadButtonPressed();
3057 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3058static int _wrap_GetGamepadAxisCount(lua_State* L) { int SWIG_arg = 0; int arg1 ; int result;
3059 SWIG_check_num_args("GetGamepadAxisCount",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetGamepadAxisCount",1,"int");
3060 arg1 = (int)lua_tonumber(L, 1); result = (int)GetGamepadAxisCount(arg1); lua_pushnumber(L, (lua_Number) result); SWIG_arg++;
3061 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3062static int _wrap_GetGamepadAxisMovement(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; float result;
3063 SWIG_check_num_args("GetGamepadAxisMovement",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetGamepadAxisMovement",1,"int");
3064 if(!lua_isnumber(L,2)) SWIG_fail_arg("GetGamepadAxisMovement",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3065 arg2 = (int)lua_tonumber(L, 2); result = (float)GetGamepadAxisMovement(arg1,arg2);
3066 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3067static int _wrap_IsMouseButtonPressed(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3068 SWIG_check_num_args("IsMouseButtonPressed",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsMouseButtonPressed",1,"int");
3069 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsMouseButtonPressed(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3070 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3071static int _wrap_IsMouseButtonDown(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3072 SWIG_check_num_args("IsMouseButtonDown",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsMouseButtonDown",1,"int");
3073 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsMouseButtonDown(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3074 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3075static int _wrap_IsMouseButtonReleased(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3076 SWIG_check_num_args("IsMouseButtonReleased",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsMouseButtonReleased",1,"int");
3077 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsMouseButtonReleased(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3078 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3079static int _wrap_IsMouseButtonUp(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3080 SWIG_check_num_args("IsMouseButtonUp",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsMouseButtonUp",1,"int");
3081 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsMouseButtonUp(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3082 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3083static int _wrap_GetMouseX(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetMouseX",0,0)
3084 result = (int)GetMouseX(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3085 lua_error(L); return SWIG_arg; }
3086static int _wrap_GetMouseY(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetMouseY",0,0)
3087 result = (int)GetMouseY(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3088 lua_error(L); return SWIG_arg; }
3089static int _wrap_GetMousePosition(lua_State* L) { int SWIG_arg = 0; Vector2 result; SWIG_check_num_args("GetMousePosition",0,0)
3090 result = GetMousePosition(); { Vector2 * resultptr; resultptr = (Vector2 *) malloc(sizeof(Vector2));
3091 memmove(resultptr, &result, sizeof(Vector2)); SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; }
3092 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3093static int _wrap_SetMousePosition(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ;
3094 SWIG_check_num_args("SetMousePosition",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("SetMousePosition",1,"int");
3095 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetMousePosition",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3096 arg2 = (int)lua_tonumber(L, 2); SetMousePosition(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3097 return SWIG_arg; }
3098static int _wrap_SetMouseOffset(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ;
3099 SWIG_check_num_args("SetMouseOffset",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("SetMouseOffset",1,"int");
3100 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetMouseOffset",2,"int"); arg1 = (int)lua_tonumber(L, 1);
3101 arg2 = (int)lua_tonumber(L, 2); SetMouseOffset(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3102 return SWIG_arg; }
3103static int _wrap_SetMouseScale(lua_State* L) { int SWIG_arg = 0; float arg1 ; float arg2 ;
3104 SWIG_check_num_args("SetMouseScale",2,2) if(!lua_isnumber(L,1)) SWIG_fail_arg("SetMouseScale",1,"float");
3105 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetMouseScale",2,"float"); arg1 = (float)lua_tonumber(L, 1);
3106 arg2 = (float)lua_tonumber(L, 2); SetMouseScale(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3107 return SWIG_arg; }
3108static int _wrap_GetMouseWheelMove(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetMouseWheelMove",0,0)
3109 result = (int)GetMouseWheelMove(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3110 lua_error(L); return SWIG_arg; }
3111static int _wrap_GetTouchX(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetTouchX",0,0)
3112 result = (int)GetTouchX(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3113 lua_error(L); return SWIG_arg; }
3114static int _wrap_GetTouchY(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetTouchY",0,0)
3115 result = (int)GetTouchY(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail:
3116 lua_error(L); return SWIG_arg; }
3117static int _wrap_GetTouchPosition(lua_State* L) { int SWIG_arg = 0; int arg1 ; Vector2 result;
3118 SWIG_check_num_args("GetTouchPosition",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("GetTouchPosition",1,"int");
3119 arg1 = (int)lua_tonumber(L, 1); result = GetTouchPosition(arg1); { Vector2 * resultptr;
3120 resultptr = (Vector2 *) malloc(sizeof(Vector2)); memmove(resultptr, &result, sizeof(Vector2));
3121 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
3122 lua_error(L); return SWIG_arg; }
3123static int _wrap_SetGesturesEnabled(lua_State* L) { int SWIG_arg = 0; unsigned int arg1 ;
3124 SWIG_check_num_args("SetGesturesEnabled",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("SetGesturesEnabled",1,"unsigned int");
3125 SWIG_contract_assert((lua_tonumber(L,1)>=0),"number must not be negative") arg1 = (unsigned int)lua_tonumber(L, 1);
3126 SetGesturesEnabled(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3127static int _wrap_IsGestureDetected(lua_State* L) { int SWIG_arg = 0; int arg1 ; bool result;
3128 SWIG_check_num_args("IsGestureDetected",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("IsGestureDetected",1,"int");
3129 arg1 = (int)lua_tonumber(L, 1); result = (bool)IsGestureDetected(arg1); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3130 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3131static int _wrap_GetGestureDetected(lua_State* L) { int SWIG_arg = 0; int result; SWIG_check_num_args("GetGestureDetected",0,0)
3132 result = (int)GetGestureDetected(); lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail;
3133 fail: lua_error(L); return SWIG_arg; }
3134static int _wrap_GetTouchPointsCount(lua_State* L) { int SWIG_arg = 0; int result;
3135 SWIG_check_num_args("GetTouchPointsCount",0,0) result = (int)GetTouchPointsCount();
3136 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3137static int _wrap_GetGestureHoldDuration(lua_State* L) { int SWIG_arg = 0; float result;
3138 SWIG_check_num_args("GetGestureHoldDuration",0,0) result = (float)GetGestureHoldDuration();
3139 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3140static int _wrap_GetGestureDragVector(lua_State* L) { int SWIG_arg = 0; Vector2 result;
3141 SWIG_check_num_args("GetGestureDragVector",0,0) result = GetGestureDragVector(); { Vector2 * resultptr;
3142 resultptr = (Vector2 *) malloc(sizeof(Vector2)); memmove(resultptr, &result, sizeof(Vector2));
3143 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
3144 lua_error(L); return SWIG_arg; }
3145static int _wrap_GetGestureDragAngle(lua_State* L) { int SWIG_arg = 0; float result;
3146 SWIG_check_num_args("GetGestureDragAngle",0,0) result = (float)GetGestureDragAngle();
3147 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3148static int _wrap_GetGesturePinchVector(lua_State* L) { int SWIG_arg = 0; Vector2 result;
3149 SWIG_check_num_args("GetGesturePinchVector",0,0) result = GetGesturePinchVector(); { Vector2 * resultptr;
3150 resultptr = (Vector2 *) malloc(sizeof(Vector2)); memmove(resultptr, &result, sizeof(Vector2));
3151 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_Vector2,1); SWIG_arg++; } return SWIG_arg; if(0) SWIG_fail; fail:
3152 lua_error(L); return SWIG_arg; }
3153static int _wrap_GetGesturePinchAngle(lua_State* L) { int SWIG_arg = 0; float result;
3154 SWIG_check_num_args("GetGesturePinchAngle",0,0) result = (float)GetGesturePinchAngle();
3155 lua_pushnumber(L, (lua_Number) result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3156static int _wrap_SetCameraMode(lua_State* L) { int SWIG_arg = 0; Camera arg1 ; int arg2 ; Camera *argp1 ;
3157 SWIG_check_num_args("SetCameraMode",2,2) if(!lua_isuserdata(L,1)) SWIG_fail_arg("SetCameraMode",1,"Camera");
3158 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetCameraMode",2,"int");
3159 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&argp1,SWIGTYPE_p_Camera,0))){ SWIG_fail_ptr("SetCameraMode",1,SWIGTYPE_p_Camera); }
3160 arg1 = *argp1; arg2 = (int)lua_tonumber(L, 2); SetCameraMode(arg1,arg2); return SWIG_arg; if(0) SWIG_fail; fail:
3161 lua_error(L); return SWIG_arg; }
3162static int _wrap_UpdateCamera(lua_State* L) { int SWIG_arg = 0; Camera *arg1 = (Camera *) 0 ;
3163 SWIG_check_num_args("UpdateCamera",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("UpdateCamera",1,"Camera *");
3164 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Camera,0))){ SWIG_fail_ptr("UpdateCamera",1,SWIGTYPE_p_Camera); }
3165 UpdateCamera(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3166static int _wrap_SetCameraPanControl(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetCameraPanControl",1,1)
3167 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetCameraPanControl",1,"int"); arg1 = (int)lua_tonumber(L, 1);
3168 SetCameraPanControl(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3169static int _wrap_SetCameraAltControl(lua_State* L) { int SWIG_arg = 0; int arg1 ; SWIG_check_num_args("SetCameraAltControl",1,1)
3170 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetCameraAltControl",1,"int"); arg1 = (int)lua_tonumber(L, 1);
3171 SetCameraAltControl(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3172static int _wrap_SetCameraSmoothZoomControl(lua_State* L) { int SWIG_arg = 0; int arg1 ;
3173 SWIG_check_num_args("SetCameraSmoothZoomControl",1,1)
3174 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetCameraSmoothZoomControl",1,"int"); arg1 = (int)lua_tonumber(L, 1);
3175 SetCameraSmoothZoomControl(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3176static int _wrap_SetCameraMoveControls(lua_State* L) { int SWIG_arg = 0; int arg1 ; int arg2 ; int arg3 ; int arg4 ; int arg5 ;
3177 int arg6 ; SWIG_check_num_args("SetCameraMoveControls",6,6)
3178 if(!lua_isnumber(L,1)) SWIG_fail_arg("SetCameraMoveControls",1,"int");
3179 if(!lua_isnumber(L,2)) SWIG_fail_arg("SetCameraMoveControls",2,"int");
3180 if(!lua_isnumber(L,3)) SWIG_fail_arg("SetCameraMoveControls",3,"int");
3181 if(!lua_isnumber(L,4)) SWIG_fail_arg("SetCameraMoveControls",4,"int");
3182 if(!lua_isnumber(L,5)) SWIG_fail_arg("SetCameraMoveControls",5,"int");
3183 if(!lua_isnumber(L,6)) SWIG_fail_arg("SetCameraMoveControls",6,"int"); arg1 = (int)lua_tonumber(L, 1);
3184 arg2 = (int)lua_tonumber(L, 2); arg3 = (int)lua_tonumber(L, 3); arg4 = (int)lua_tonumber(L, 4);
3185 arg5 = (int)lua_tonumber(L, 5); arg6 = (int)lua_tonumber(L, 6); SetCameraMoveControls(arg1,arg2,arg3,arg4,arg5,arg6);
3186 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3187static swig_lua_attribute swig_SwigModule_attributes[] = {
3188 {0,0,0}
3189};
3190static swig_lua_const_info swig_SwigModule_constants[]= {
3191 {0,0,0,0,0,0}
3192};
3193static swig_lua_method swig_SwigModule_methods[]= {
3194 { "InitWindow", _wrap_InitWindow},
3195 { "WindowShouldClose", _wrap_WindowShouldClose},
3196 { "CloseWindow", _wrap_CloseWindow},
3197 { "IsWindowReady", _wrap_IsWindowReady},
3198 { "IsWindowMinimized", _wrap_IsWindowMinimized},
3199 { "IsWindowResized", _wrap_IsWindowResized},
3200 { "IsWindowHidden", _wrap_IsWindowHidden},
3201 { "ToggleFullscreen", _wrap_ToggleFullscreen},
3202 { "UnhideWindow", _wrap_UnhideWindow},
3203 { "HideWindow", _wrap_HideWindow},
3204 { "SetWindowIcon", _wrap_SetWindowIcon},
3205 { "SetWindowTitle", _wrap_SetWindowTitle},
3206 { "SetWindowPosition", _wrap_SetWindowPosition},
3207 { "SetWindowMonitor", _wrap_SetWindowMonitor},
3208 { "SetWindowMinSize", _wrap_SetWindowMinSize},
3209 { "SetWindowSize", _wrap_SetWindowSize},
3210 { "GetWindowHandle", _wrap_GetWindowHandle},
3211 { "GetScreenWidth", _wrap_GetScreenWidth},
3212 { "GetScreenHeight", _wrap_GetScreenHeight},
3213 { "GetMonitorCount", _wrap_GetMonitorCount},
3214 { "GetMonitorWidth", _wrap_GetMonitorWidth},
3215 { "GetMonitorHeight", _wrap_GetMonitorHeight},
3216 { "GetMonitorPhysicalWidth", _wrap_GetMonitorPhysicalWidth},
3217 { "GetMonitorPhysicalHeight", _wrap_GetMonitorPhysicalHeight},
3218 { "GetMonitorName", _wrap_GetMonitorName},
3219 { "GetClipboardText", _wrap_GetClipboardText},
3220 { "SetClipboardText", _wrap_SetClipboardText},
3221 { "ShowCursor", _wrap_ShowCursor},
3222 { "HideCursor", _wrap_HideCursor},
3223 { "IsCursorHidden", _wrap_IsCursorHidden},
3224 { "EnableCursor", _wrap_EnableCursor},
3225 { "DisableCursor", _wrap_DisableCursor},
3226 { "ClearBackground", _wrap_ClearBackground},
3227 { "BeginDrawing", _wrap_BeginDrawing},
3228 { "EndDrawing", _wrap_EndDrawing},
3229 { "BeginMode2D", _wrap_BeginMode2D},
3230 { "EndMode2D", _wrap_EndMode2D},
3231 { "BeginMode3D", _wrap_BeginMode3D},
3232 { "EndMode3D", _wrap_EndMode3D},
3233 { "BeginTextureMode", _wrap_BeginTextureMode},
3234 { "EndTextureMode", _wrap_EndTextureMode},
3235 { "GetMouseRay", _wrap_GetMouseRay},
3236 { "GetWorldToScreen", _wrap_GetWorldToScreen},
3237 { "GetCameraMatrix", _wrap_GetCameraMatrix},
3238 { "SetTargetFPS", _wrap_SetTargetFPS},
3239 { "GetFPS", _wrap_GetFPS},
3240 { "GetFrameTime", _wrap_GetFrameTime},
3241 { "GetTime", _wrap_GetTime},
3242 { "ColorToInt", _wrap_ColorToInt},
3243 { "ColorNormalize", _wrap_ColorNormalize},
3244 { "ColorToHSV", _wrap_ColorToHSV},
3245 { "ColorFromHSV", _wrap_ColorFromHSV},
3246 { "GetColor", _wrap_GetColor},
3247 { "Fade", _wrap_Fade},
3248 { "SetConfigFlags", _wrap_SetConfigFlags},
3249 { "SetTraceLogLevel", _wrap_SetTraceLogLevel},
3250 { "SetTraceLogExit", _wrap_SetTraceLogExit},
3251 { "SetTraceLogCallback", _wrap_SetTraceLogCallback},
3252 { "TraceLog", _wrap_TraceLog},
3253 { "TakeScreenshot", _wrap_TakeScreenshot},
3254 { "GetRandomValue", _wrap_GetRandomValue},
3255 { "FileExists", _wrap_FileExists},
3256 { "IsFileExtension", _wrap_IsFileExtension},
3257 { "GetExtension", _wrap_GetExtension},
3258 { "GetFileName", _wrap_GetFileName},
3259 { "GetFileNameWithoutExt", _wrap_GetFileNameWithoutExt},
3260 { "GetDirectoryPath", _wrap_GetDirectoryPath},
3261 { "GetWorkingDirectory", _wrap_GetWorkingDirectory},
3262 { "GetDirectoryFiles", _wrap_GetDirectoryFiles},
3263 { "ClearDirectoryFiles", _wrap_ClearDirectoryFiles},
3264 { "ChangeDirectory", _wrap_ChangeDirectory},
3265 { "IsFileDropped", _wrap_IsFileDropped},
3266 { "GetDroppedFiles", _wrap_GetDroppedFiles},
3267 { "ClearDroppedFiles", _wrap_ClearDroppedFiles},
3268 { "GetFileModTime", _wrap_GetFileModTime},
3269 { "StorageSaveValue", _wrap_StorageSaveValue},
3270 { "StorageLoadValue", _wrap_StorageLoadValue},
3271 { "OpenURL", _wrap_OpenURL},
3272 { "IsKeyPressed", _wrap_IsKeyPressed},
3273 { "IsKeyDown", _wrap_IsKeyDown},
3274 { "IsKeyReleased", _wrap_IsKeyReleased},
3275 { "IsKeyUp", _wrap_IsKeyUp},
3276 { "GetKeyPressed", _wrap_GetKeyPressed},
3277 { "SetExitKey", _wrap_SetExitKey},
3278 { "IsGamepadAvailable", _wrap_IsGamepadAvailable},
3279 { "IsGamepadName", _wrap_IsGamepadName},
3280 { "GetGamepadName", _wrap_GetGamepadName},
3281 { "IsGamepadButtonPressed", _wrap_IsGamepadButtonPressed},
3282 { "IsGamepadButtonDown", _wrap_IsGamepadButtonDown},
3283 { "IsGamepadButtonReleased", _wrap_IsGamepadButtonReleased},
3284 { "IsGamepadButtonUp", _wrap_IsGamepadButtonUp},
3285 { "GetGamepadButtonPressed", _wrap_GetGamepadButtonPressed},
3286 { "GetGamepadAxisCount", _wrap_GetGamepadAxisCount},
3287 { "GetGamepadAxisMovement", _wrap_GetGamepadAxisMovement},
3288 { "IsMouseButtonPressed", _wrap_IsMouseButtonPressed},
3289 { "IsMouseButtonDown", _wrap_IsMouseButtonDown},
3290 { "IsMouseButtonReleased", _wrap_IsMouseButtonReleased},
3291 { "IsMouseButtonUp", _wrap_IsMouseButtonUp},
3292 { "GetMouseX", _wrap_GetMouseX},
3293 { "GetMouseY", _wrap_GetMouseY},
3294 { "GetMousePosition", _wrap_GetMousePosition},
3295 { "SetMousePosition", _wrap_SetMousePosition},
3296 { "SetMouseOffset", _wrap_SetMouseOffset},
3297 { "SetMouseScale", _wrap_SetMouseScale},
3298 { "GetMouseWheelMove", _wrap_GetMouseWheelMove},
3299 { "GetTouchX", _wrap_GetTouchX},
3300 { "GetTouchY", _wrap_GetTouchY},
3301 { "GetTouchPosition", _wrap_GetTouchPosition},
3302 { "SetGesturesEnabled", _wrap_SetGesturesEnabled},
3303 { "IsGestureDetected", _wrap_IsGestureDetected},
3304 { "GetGestureDetected", _wrap_GetGestureDetected},
3305 { "GetTouchPointsCount", _wrap_GetTouchPointsCount},
3306 { "GetGestureHoldDuration", _wrap_GetGestureHoldDuration},
3307 { "GetGestureDragVector", _wrap_GetGestureDragVector},
3308 { "GetGestureDragAngle", _wrap_GetGestureDragAngle},
3309 { "GetGesturePinchVector", _wrap_GetGesturePinchVector},
3310 { "GetGesturePinchAngle", _wrap_GetGesturePinchAngle},
3311 { "SetCameraMode", _wrap_SetCameraMode},
3312 { "UpdateCamera", _wrap_UpdateCamera},
3313 { "SetCameraPanControl", _wrap_SetCameraPanControl},
3314 { "SetCameraAltControl", _wrap_SetCameraAltControl},
3315 { "SetCameraSmoothZoomControl", _wrap_SetCameraSmoothZoomControl},
3316 { "SetCameraMoveControls", _wrap_SetCameraMoveControls},
3317 {0,0}
3318};
3319static swig_lua_class* swig_SwigModule_classes[]= {
3320 0
3321};
3322static swig_lua_namespace* swig_SwigModule_namespaces[] = {
3323 0
3324};
3325
3326static swig_lua_namespace swig_SwigModule = {
3327 "foo",
3328 swig_SwigModule_methods,
3329 swig_SwigModule_attributes,
3330 swig_SwigModule_constants,
3331 swig_SwigModule_classes,
3332 swig_SwigModule_namespaces
3333};
3334#ifdef __cplusplus
3335}
3336#endif
3337
3338/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3339
3340static swig_type_info _swigt__p_Camera = {"_p_Camera", "Camera *", 0, 0, (void*)0, 0};
3341static swig_type_info _swigt__p_Camera2D = {"_p_Camera2D", "Camera2D *", 0, 0, (void*)0, 0};
3342static swig_type_info _swigt__p_Camera3D = {"_p_Camera3D", "Camera3D *", 0, 0, (void*)0, 0};
3343static swig_type_info _swigt__p_Color = {"_p_Color", "Color *", 0, 0, (void*)0, 0};
3344static swig_type_info _swigt__p_Image = {"_p_Image", "Image *", 0, 0, (void*)0, 0};
3345static swig_type_info _swigt__p_Matrix = {"_p_Matrix", "Matrix *", 0, 0, (void*)0, 0};
3346static swig_type_info _swigt__p_Ray = {"_p_Ray", "Ray *", 0, 0, (void*)0, 0};
3347static swig_type_info _swigt__p_RenderTexture2D = {"_p_RenderTexture2D", "RenderTexture2D *", 0, 0, (void*)0, 0};
3348static swig_type_info _swigt__p_TraceLogCallback = {"_p_TraceLogCallback", "TraceLogCallback *", 0, 0, (void*)0, 0};
3349static swig_type_info _swigt__p_Vector2 = {"_p_Vector2", "Vector2 *", 0, 0, (void*)0, 0};
3350static swig_type_info _swigt__p_Vector3 = {"_p_Vector3", "Vector3 *", 0, 0, (void*)0, 0};
3351static swig_type_info _swigt__p_Vector4 = {"_p_Vector4", "Vector4 *", 0, 0, (void*)0, 0};
3352static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
3353static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0};
3354static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
3355
3356static swig_type_info *swig_type_initial[] = {
3357 &_swigt__p_Camera,
3358 &_swigt__p_Camera2D,
3359 &_swigt__p_Camera3D,
3360 &_swigt__p_Color,
3361 &_swigt__p_Image,
3362 &_swigt__p_Matrix,
3363 &_swigt__p_Ray,
3364 &_swigt__p_RenderTexture2D,
3365 &_swigt__p_TraceLogCallback,
3366 &_swigt__p_Vector2,
3367 &_swigt__p_Vector3,
3368 &_swigt__p_Vector4,
3369 &_swigt__p_int,
3370 &_swigt__p_p_char,
3371 &_swigt__p_void,
3372};
3373
3374static swig_cast_info _swigc__p_Camera[] = { {&_swigt__p_Camera, 0, 0, 0},{0, 0, 0, 0}};
3375static swig_cast_info _swigc__p_Camera2D[] = { {&_swigt__p_Camera2D, 0, 0, 0},{0, 0, 0, 0}};
3376static swig_cast_info _swigc__p_Camera3D[] = { {&_swigt__p_Camera3D, 0, 0, 0},{0, 0, 0, 0}};
3377static swig_cast_info _swigc__p_Color[] = { {&_swigt__p_Color, 0, 0, 0},{0, 0, 0, 0}};
3378static swig_cast_info _swigc__p_Image[] = { {&_swigt__p_Image, 0, 0, 0},{0, 0, 0, 0}};
3379static swig_cast_info _swigc__p_Matrix[] = { {&_swigt__p_Matrix, 0, 0, 0},{0, 0, 0, 0}};
3380static swig_cast_info _swigc__p_Ray[] = { {&_swigt__p_Ray, 0, 0, 0},{0, 0, 0, 0}};
3381static swig_cast_info _swigc__p_RenderTexture2D[] = { {&_swigt__p_RenderTexture2D, 0, 0, 0},{0, 0, 0, 0}};
3382static swig_cast_info _swigc__p_TraceLogCallback[] = { {&_swigt__p_TraceLogCallback, 0, 0, 0},{0, 0, 0, 0}};
3383static swig_cast_info _swigc__p_Vector2[] = { {&_swigt__p_Vector2, 0, 0, 0},{0, 0, 0, 0}};
3384static swig_cast_info _swigc__p_Vector3[] = { {&_swigt__p_Vector3, 0, 0, 0},{0, 0, 0, 0}};
3385static swig_cast_info _swigc__p_Vector4[] = { {&_swigt__p_Vector4, 0, 0, 0},{0, 0, 0, 0}};
3386static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
3387static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}};
3388static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
3389
3390static swig_cast_info *swig_cast_initial[] = {
3391 _swigc__p_Camera,
3392 _swigc__p_Camera2D,
3393 _swigc__p_Camera3D,
3394 _swigc__p_Color,
3395 _swigc__p_Image,
3396 _swigc__p_Matrix,
3397 _swigc__p_Ray,
3398 _swigc__p_RenderTexture2D,
3399 _swigc__p_TraceLogCallback,
3400 _swigc__p_Vector2,
3401 _swigc__p_Vector3,
3402 _swigc__p_Vector4,
3403 _swigc__p_int,
3404 _swigc__p_p_char,
3405 _swigc__p_void,
3406};
3407
3408
3409/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3410
3411/* -----------------------------------------------------------------------------
3412 * Type initialization:
3413 * This problem is tough by the requirement that no dynamic
3414 * memory is used. Also, since swig_type_info structures store pointers to
3415 * swig_cast_info structures and swig_cast_info structures store pointers back
3416 * to swig_type_info structures, we need some lookup code at initialization.
3417 * The idea is that swig generates all the structures that are needed.
3418 * The runtime then collects these partially filled structures.
3419 * The SWIG_InitializeModule function takes these initial arrays out of
3420 * swig_module, and does all the lookup, filling in the swig_module.types
3421 * array with the correct data and linking the correct swig_cast_info
3422 * structures together.
3423 *
3424 * The generated swig_type_info structures are assigned statically to an initial
3425 * array. We just loop through that array, and handle each type individually.
3426 * First we lookup if this type has been already loaded, and if so, use the
3427 * loaded structure instead of the generated one. Then we have to fill in the
3428 * cast linked list. The cast data is initially stored in something like a
3429 * two-dimensional array. Each row corresponds to a type (there are the same
3430 * number of rows as there are in the swig_type_initial array). Each entry in
3431 * a column is one of the swig_cast_info structures for that type.
3432 * The cast_initial array is actually an array of arrays, because each row has
3433 * a variable number of columns. So to actually build the cast linked list,
3434 * we find the array of casts associated with the type, and loop through it
3435 * adding the casts to the list. The one last trick we need to do is making
3436 * sure the type pointer in the swig_cast_info struct is correct.
3437 *
3438 * First off, we lookup the cast->type name to see if it is already loaded.
3439 * There are three cases to handle:
3440 * 1) If the cast->type has already been loaded AND the type we are adding
3441 * casting info to has not been loaded (it is in this module), THEN we
3442 * replace the cast->type pointer with the type pointer that has already
3443 * been loaded.
3444 * 2) If BOTH types (the one we are adding casting info to, and the
3445 * cast->type) are loaded, THEN the cast info has already been loaded by
3446 * the previous module so we just ignore it.
3447 * 3) Finally, if cast->type has not already been loaded, then we add that
3448 * swig_cast_info to the linked list (because the cast->type) pointer will
3449 * be correct.
3450 * ----------------------------------------------------------------------------- */
3451
3452#ifdef __cplusplus
3453extern "C" {
3454#if 0
3455} /* c-mode */
3456#endif
3457#endif
3458
3459#if 0
3460#define SWIGRUNTIME_DEBUG
3461#endif
3462
3463
3464SWIGRUNTIME void
3465SWIG_InitializeModule(void *clientdata) {
3466 size_t i;
3467 swig_module_info *module_head, *iter;
3468 int init;
3469
3470 /* check to see if the circular list has been setup, if not, set it up */
3471 if (swig_module.next==0) {
3472 /* Initialize the swig_module */
3473 swig_module.type_initial = swig_type_initial;
3474 swig_module.cast_initial = swig_cast_initial;
3475 swig_module.next = &swig_module;
3476 init = 1;
3477 } else {
3478 init = 0;
3479 }
3480
3481 /* Try and load any already created modules */
3482 module_head = SWIG_GetModule(clientdata);
3483 if (!module_head) {
3484 /* This is the first module loaded for this interpreter */
3485 /* so set the swig module into the interpreter */
3486 SWIG_SetModule(clientdata, &swig_module);
3487 } else {
3488 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3489 iter=module_head;
3490 do {
3491 if (iter==&swig_module) {
3492 /* Our module is already in the list, so there's nothing more to do. */
3493 return;
3494 }
3495 iter=iter->next;
3496 } while (iter!= module_head);
3497
3498 /* otherwise we must add our module into the list */
3499 swig_module.next = module_head->next;
3500 module_head->next = &swig_module;
3501 }
3502
3503 /* When multiple interpreters are used, a module could have already been initialized in
3504 a different interpreter, but not yet have a pointer in this interpreter.
3505 In this case, we do not want to continue adding types... everything should be
3506 set up already */
3507 if (init == 0) return;
3508
3509 /* Now work on filling in swig_module.types */
3510#ifdef SWIGRUNTIME_DEBUG
3511 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3512#endif
3513 for (i = 0; i < swig_module.size; ++i) {
3514 swig_type_info *type = 0;
3515 swig_type_info *ret;
3516 swig_cast_info *cast;
3517
3518#ifdef SWIGRUNTIME_DEBUG
3519 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3520#endif
3521
3522 /* if there is another module already loaded */
3523 if (swig_module.next != &swig_module) {
3524 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3525 }
3526 if (type) {
3527 /* Overwrite clientdata field */
3528#ifdef SWIGRUNTIME_DEBUG
3529 printf("SWIG_InitializeModule: found type %s\n", type->name);
3530#endif
3531 if (swig_module.type_initial[i]->clientdata) {
3532 type->clientdata = swig_module.type_initial[i]->clientdata;
3533#ifdef SWIGRUNTIME_DEBUG
3534 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3535#endif
3536 }
3537 } else {
3538 type = swig_module.type_initial[i];
3539 }
3540
3541 /* Insert casting types */
3542 cast = swig_module.cast_initial[i];
3543 while (cast->type) {
3544
3545 /* Don't need to add information already in the list */
3546 ret = 0;
3547#ifdef SWIGRUNTIME_DEBUG
3548 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3549#endif
3550 if (swig_module.next != &swig_module) {
3551 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3552#ifdef SWIGRUNTIME_DEBUG
3553 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3554#endif
3555 }
3556 if (ret) {
3557 if (type == swig_module.type_initial[i]) {
3558#ifdef SWIGRUNTIME_DEBUG
3559 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3560#endif
3561 cast->type = ret;
3562 ret = 0;
3563 } else {
3564 /* Check for casting already in the list */
3565 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3566#ifdef SWIGRUNTIME_DEBUG
3567 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3568#endif
3569 if (!ocast) ret = 0;
3570 }
3571 }
3572
3573 if (!ret) {
3574#ifdef SWIGRUNTIME_DEBUG
3575 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3576#endif
3577 if (type->cast) {
3578 type->cast->prev = cast;
3579 cast->next = type->cast;
3580 }
3581 type->cast = cast;
3582 }
3583 cast++;
3584 }
3585 /* Set entry in modules->types array equal to the type */
3586 swig_module.types[i] = type;
3587 }
3588 swig_module.types[i] = 0;
3589
3590#ifdef SWIGRUNTIME_DEBUG
3591 printf("**** SWIG_InitializeModule: Cast List ******\n");
3592 for (i = 0; i < swig_module.size; ++i) {
3593 int j = 0;
3594 swig_cast_info *cast = swig_module.cast_initial[i];
3595 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3596 while (cast->type) {
3597 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3598 cast++;
3599 ++j;
3600 }
3601 printf("---- Total casts: %d\n",j);
3602 }
3603 printf("**** SWIG_InitializeModule: Cast List ******\n");
3604#endif
3605}
3606
3607/* This function will propagate the clientdata field of type to
3608* any new swig_type_info structures that have been added into the list
3609* of equivalent types. It is like calling
3610* SWIG_TypeClientData(type, clientdata) a second time.
3611*/
3612SWIGRUNTIME void
3613SWIG_PropagateClientData(void) {
3614 size_t i;
3615 swig_cast_info *equiv;
3616 static int init_run = 0;
3617
3618 if (init_run) return;
3619 init_run = 1;
3620
3621 for (i = 0; i < swig_module.size; i++) {
3622 if (swig_module.types[i]->clientdata) {
3623 equiv = swig_module.types[i]->cast;
3624 while (equiv) {
3625 if (!equiv->converter) {
3626 if (equiv->type && !equiv->type->clientdata)
3627 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3628 }
3629 equiv = equiv->next;
3630 }
3631 }
3632 }
3633}
3634
3635#ifdef __cplusplus
3636#if 0
3637{ /* c-mode */
3638#endif
3639}
3640#endif
3641
3642
3643
3644/* Forward declaration of where the user's %init{} gets inserted */
3645void SWIG_init_user(lua_State* L );
3646
3647#ifdef __cplusplus
3648extern "C" {
3649#endif
3650/* this is the initialization function
3651 added at the very end of the code
3652 the function is always called SWIG_init, but an earlier #define will rename it
3653*/
3654#if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
3655LUALIB_API int SWIG_init(lua_State* L)
3656#else
3657SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
3658#endif
3659{
3660#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
3661 int i;
3662 int globalRegister = 0;
3663 /* start with global table */
3664 lua_pushglobaltable (L);
3665 /* SWIG's internal initialisation */
3666 SWIG_InitializeModule((void*)L);
3667 SWIG_PropagateClientData();
3668#endif
3669
3670#if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)) || defined(SWIG_LUA_ELUA_EMULATE)
3671 /* add a global fn */
3672 SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
3673 SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_class_equal);
3674#endif
3675
3676#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
3677 /* set up base class pointers (the hierarchy) */
3678 for (i = 0; swig_types[i]; i++){
3679 if (swig_types[i]->clientdata){
3680 SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
3681 }
3682 }
3683#ifdef SWIG_LUA_MODULE_GLOBAL
3684 globalRegister = 1;
3685#endif
3686
3687
3688#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_LUA)
3689 SWIG_Lua_namespace_register(L,&swig_SwigModule, globalRegister);
3690#endif
3691
3692#if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
3693 for (i = 0; swig_types[i]; i++){
3694 if (swig_types[i]->clientdata){
3695 SWIG_Lua_elua_class_register_instance(L,(swig_lua_class*)(swig_types[i]->clientdata));
3696 }
3697 }
3698#endif
3699
3700#if defined(SWIG_LUA_ELUA_EMULATE)
3701 lua_newtable(L);
3702 SWIG_Lua_elua_emulate_register(L,swig_SwigModule.ns_methods);
3703 SWIG_Lua_elua_emulate_register_clear(L);
3704 if(globalRegister) {
3705 lua_pushstring(L,swig_SwigModule.name);
3706 lua_pushvalue(L,-2);
3707 lua_rawset(L,-4);
3708 }
3709#endif
3710
3711#endif
3712
3713#if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
3714 /* invoke user-specific initialization */
3715 SWIG_init_user(L);
3716 /* end module */
3717 /* Note: We do not clean up the stack here (Lua will do this for us). At this
3718 point, we have the globals table and out module table on the stack. Returning
3719 one value makes the module table the result of the require command. */
3720 return 1;
3721#else
3722 return 0;
3723#endif
3724}
3725
3726#ifdef __cplusplus
3727}
3728#endif
3729
3730
3731const char* SWIG_LUACODE=
3732 "";
3733
3734void SWIG_init_user(lua_State* L)
3735{
3736 /* exec Lua code if applicable */
3737 SWIG_Lua_dostring(L,SWIG_LUACODE);
3738}