18 #pragma clang system_header
22 #ifndef SWIGTEMPLATEDISAMBIGUATOR
23 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
24 # define SWIGTEMPLATEDISAMBIGUATOR template
25 # elif defined(__HP_aCC)
28 # define SWIGTEMPLATEDISAMBIGUATOR template
30 # define SWIGTEMPLATEDISAMBIGUATOR
36 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
37 # define SWIGINLINE inline
45 # if defined(__GNUC__)
46 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
47 # define SWIGUNUSED __attribute__ ((__unused__))
52 # define SWIGUNUSED __attribute__ ((__unused__))
58 #ifndef SWIG_MSC_UNSUPPRESS_4505
59 # if defined(_MSC_VER)
60 # pragma warning(disable : 4505)
64 #ifndef SWIGUNUSEDPARM
66 # define SWIGUNUSEDPARM(p)
68 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
74 # define SWIGINTERN static SWIGUNUSED
78 #ifndef SWIGINTERNINLINE
79 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
83 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
84 # ifndef GCC_HASCLASSVISIBILITY
85 # define GCC_HASCLASSVISIBILITY
90 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
91 # if defined(STATIC_LINKED)
94 # define SWIGEXPORT __declspec(dllexport)
97 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
98 # define SWIGEXPORT __attribute__ ((visibility("default")))
107 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
108 # define SWIGSTDCALL __stdcall
115 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
116 # define _CRT_SECURE_NO_DEPRECATE
120 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
121 # define _SCL_SECURE_NO_DEPRECATE
125 #define SWIG_UnknownError -1
126 #define SWIG_IOError -2
127 #define SWIG_RuntimeError -3
128 #define SWIG_IndexError -4
129 #define SWIG_TypeError -5
130 #define SWIG_DivisionByZero -6
131 #define SWIG_OverflowError -7
132 #define SWIG_SyntaxError -8
133 #define SWIG_ValueError -9
134 #define SWIG_SystemError -10
135 #define SWIG_AttributeError -11
136 #define SWIG_MemoryError -12
137 #define SWIG_NullReferenceError -13
141 #define SWIG_UnknownError -1
142 #define SWIG_IOError -2
143 #define SWIG_RuntimeError -3
144 #define SWIG_IndexError -4
145 #define SWIG_TypeError -5
146 #define SWIG_DivisionByZero -6
147 #define SWIG_OverflowError -7
148 #define SWIG_SyntaxError -8
149 #define SWIG_ValueError -9
150 #define SWIG_SystemError -10
151 #define SWIG_AttributeError -11
152 #define SWIG_MemoryError -12
153 #define SWIG_NullReferenceError -13
165 #define SWIG_RUNTIME_VERSION "4"
168 #ifdef SWIG_TYPE_TABLE
169 # define SWIG_QUOTE_STRING(x) #x
170 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
171 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
173 # define SWIG_TYPE_TABLE_NAME
186 # define SWIGRUNTIME SWIGINTERN
189 #ifndef SWIGRUNTIMEINLINE
190 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
194 #ifndef SWIG_BUFFER_SIZE
195 # define SWIG_BUFFER_SIZE 1024
199 #define SWIG_POINTER_DISOWN 0x1
200 #define SWIG_CAST_NEW_MEMORY 0x2
203 #define SWIG_POINTER_OWN 0x1
286 #define SWIG_ERROR (-1)
287 #define SWIG_IsOK(r) (r >= 0)
288 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
291 #define SWIG_CASTRANKLIMIT (1 << 8)
293 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
295 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
297 #define SWIG_BADOBJ (SWIG_ERROR)
298 #define SWIG_OLDOBJ (SWIG_OK)
299 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
300 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
302 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
303 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
304 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
305 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
306 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
307 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
310 #if defined(SWIG_CASTRANK_MODE)
311 # ifndef SWIG_TypeRank
312 # define SWIG_TypeRank unsigned long
314 # ifndef SWIG_MAXCASTRANK
315 # define SWIG_MAXCASTRANK (2)
317 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
318 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
319 SWIGINTERNINLINE
int SWIG_AddCast(
int r) {
320 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
322 SWIGINTERNINLINE
int SWIG_CheckState(
int r) {
323 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
326 # define SWIG_AddCast
327 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
337 typedef void *(*swig_converter_func)(
void *,
int *);
338 typedef struct swig_type_info *(*swig_dycast_func)(
void **);
341 typedef struct swig_type_info {
344 swig_dycast_func dcast;
345 struct swig_cast_info *cast;
351 typedef struct swig_cast_info {
352 swig_type_info *type;
353 swig_converter_func converter;
354 struct swig_cast_info *next;
355 struct swig_cast_info *prev;
361 typedef struct swig_module_info {
362 swig_type_info **types;
364 struct swig_module_info *next;
365 swig_type_info **type_initial;
366 swig_cast_info **cast_initial;
378 SWIG_TypeNameComp(
const char *f1,
const char *l1,
379 const char *f2,
const char *l2) {
380 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
381 while ((*f1 ==
' ') && (f1 != l1)) ++f1;
382 while ((*f2 ==
' ') && (f2 != l2)) ++f2;
383 if (*f1 != *f2)
return (*f1 > *f2) ? 1 : -1;
385 return (
int)((l1 - f1) - (l2 - f2));
393 SWIG_TypeEquiv(
const char *nb,
const char *tb) {
395 const char* te = tb + strlen(tb);
397 while (!equiv && *ne) {
398 for (nb = ne; *ne; ++ne) {
399 if (*ne ==
'|')
break;
401 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
412 SWIG_TypeCompare(
const char *nb,
const char *tb) {
414 const char* te = tb + strlen(tb);
416 while (!equiv && *ne) {
417 for (nb = ne; *ne; ++ne) {
418 if (*ne ==
'|')
break;
420 equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
430 SWIGRUNTIME swig_cast_info *
431 SWIG_TypeCheck(
const char *c, swig_type_info *ty) {
433 swig_cast_info *iter = ty->cast;
435 if (strcmp(iter->type->name, c) == 0) {
436 if (iter == ty->cast)
439 iter->prev->next = iter->next;
441 iter->next->prev = iter->prev;
442 iter->next = ty->cast;
444 if (ty->cast) ty->cast->prev = iter;
457 SWIGRUNTIME swig_cast_info *
458 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
460 swig_cast_info *iter = ty->cast;
462 if (iter->type == from) {
463 if (iter == ty->cast)
466 iter->prev->next = iter->next;
468 iter->next->prev = iter->prev;
469 iter->next = ty->cast;
471 if (ty->cast) ty->cast->prev = iter;
484 SWIGRUNTIMEINLINE
void *
485 SWIG_TypeCast(swig_cast_info *ty,
void *ptr,
int *newmemory) {
486 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
492 SWIGRUNTIME swig_type_info *
493 SWIG_TypeDynamicCast(swig_type_info *ty,
void **ptr) {
494 swig_type_info *lastty = ty;
495 if (!ty || !ty->dcast)
return ty;
496 while (ty && (ty->dcast)) {
497 ty = (*ty->dcast)(ptr);
506 SWIGRUNTIMEINLINE
const char *
507 SWIG_TypeName(
const swig_type_info *ty) {
515 SWIGRUNTIME
const char *
516 SWIG_TypePrettyName(
const swig_type_info *type) {
521 if (!type)
return nullptr;
522 if (type->str !=
nullptr) {
523 const char *last_name = type->str;
525 for (s = type->str; *s; s++)
526 if (*s ==
'|') last_name = s+1;
537 SWIG_TypeClientData(swig_type_info *ti,
void *clientdata) {
538 swig_cast_info *cast = ti->cast;
540 ti->clientdata = clientdata;
543 if (!cast->converter) {
544 swig_type_info *tc = cast->type;
545 if (!tc->clientdata) {
546 SWIG_TypeClientData(tc, clientdata);
553 SWIG_TypeNewClientData(swig_type_info *ti,
void *clientdata) {
554 SWIG_TypeClientData(ti, clientdata);
566 SWIGRUNTIME swig_type_info *
567 SWIG_MangledTypeQueryModule(swig_module_info *start,
568 swig_module_info *end,
570 swig_module_info *iter = start;
573 register size_t l = 0;
574 register size_t r = iter->size - 1;
577 register size_t i = (l + r) >> 1;
578 const char *iname = iter->types[i]->name;
580 register int compare = strcmp(name, iname);
582 return iter->types[i];
583 }
else if (compare < 0) {
589 }
else if (compare > 0) {
598 }
while (iter != end);
611 SWIGRUNTIME swig_type_info *
612 SWIG_TypeQueryModule(swig_module_info *start,
613 swig_module_info *end,
616 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
622 swig_module_info *iter = start;
624 register size_t i = 0;
625 for (; i < iter->size; ++i) {
626 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
627 return iter->types[i];
630 }
while (iter != end);
641 SWIG_PackData(
char *c,
void *ptr,
size_t sz) {
642 static const char hex[17] =
"0123456789abcdef";
643 register const unsigned char *
u = (
unsigned char *) ptr;
644 register const unsigned char *eu = u + sz;
645 for (; u != eu; ++u) {
646 register unsigned char uu = *u;
647 *(c++) = hex[(uu & 0xf0) >> 4];
648 *(c++) = hex[uu & 0xf];
656 SWIGRUNTIME
const char *
657 SWIG_UnpackData(
const char *c,
void *ptr,
size_t sz) {
658 register unsigned char *u = (
unsigned char *) ptr;
659 register const unsigned char *eu = u + sz;
660 for (; u != eu; ++u) {
661 register char d = *(c++);
662 register unsigned char uu;
663 if ((d >=
'0') && (d <=
'9'))
664 uu = ((d -
'0') << 4);
665 else if ((d >=
'a') && (d <=
'f'))
666 uu = ((d - (
'a'-10)) << 4);
670 if ((d >=
'0') && (d <=
'9'))
672 else if ((d >=
'a') && (d <=
'f'))
673 uu |= (d - (
'a'-10));
685 SWIG_PackVoidPtr(
char *buff,
void *ptr,
const char *name,
size_t bsz) {
687 if ((2*
sizeof(
void *) + 2) > bsz)
return 0;
689 r = SWIG_PackData(r,&ptr,
sizeof(
void *));
690 if (strlen(name) + 1 > (bsz - (r - buff)))
return 0;
695 SWIGRUNTIME
const char *
696 SWIG_UnpackVoidPtr(
const char *c,
void **ptr,
const char *name) {
698 if (strcmp(c,
"nullptr") == 0) {
705 return SWIG_UnpackData(++c,ptr,
sizeof(
void *));
709 SWIG_PackDataName(
char *buff,
void *ptr,
size_t sz,
const char *name,
size_t bsz) {
711 size_t lname = (name ? strlen(name) : 0);
712 if ((2*sz + 2 + lname) > bsz)
return 0;
714 r = SWIG_PackData(r,ptr,sz);
716 strncpy(r,name,lname+1);
723 SWIGRUNTIME
const char *
724 SWIG_UnpackDataName(
const char *c,
void *ptr,
size_t sz,
const char *name) {
726 if (strcmp(c,
"nullptr") == 0) {
733 return SWIG_UnpackData(++c,ptr,sz);
760 #define SWIG_LUA_INT 1
761 #define SWIG_LUA_FLOAT 2
762 #define SWIG_LUA_STRING 3
763 #define SWIG_LUA_POINTER 4
764 #define SWIG_LUA_BINARY 5
765 #define SWIG_LUA_CHAR 6
781 swig_type_info **ptype;
782 } swig_lua_const_info;
793 } swig_lua_attribute;
795 typedef struct swig_lua_class {
797 swig_type_info **type;
799 void (*destructor)(
void *);
800 swig_lua_method *methods;
801 swig_lua_attribute *attributes;
802 struct swig_lua_class **bases;
803 const char **base_names;
809 swig_type_info *type;
820 swig_type_info *type;
826 #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
827 #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
828 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
830 #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
831 #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
834 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
835 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
836 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
839 #define SWIG_contract_assert(expr, msg) \
840 if (!(expr)) { lua_pushstring(L, (char *) msg); goto fail; } else
843 #define SWIG_fail {goto fail;}
844 #define SWIG_fail_arg(func_name,argnum,type) \
845 {lua_pushfstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
846 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
848 #define SWIG_fail_ptr(func_name,argnum,type) \
849 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
850 #define SWIG_check_num_args(func_name,a,b) \
851 if (lua_gettop(L)<a || lua_gettop(L)>b) \
852 {lua_pushfstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
856 #define SWIG_Lua_get_table(L,n) \
857 (lua_pushstring(L, n), lua_rawget(L,-2))
859 #define SWIG_Lua_add_function(L,n,f) \
860 (lua_pushstring(L, n), \
861 lua_pushcfunction(L, f), \
865 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
874 SWIGRUNTIME swig_module_info *
876 swig_module_info *ret = 0;
877 lua_pushstring(L,
"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
878 lua_rawget(L,LUA_REGISTRYINDEX);
879 if (lua_islightuserdata(L,-1))
880 ret=(swig_module_info*)lua_touserdata(L,-1);
886 SWIG_Lua_SetModule(
lua_State* L, swig_module_info *module) {
888 lua_pushstring(L,
"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
889 lua_pushlightuserdata(L,(
void*)module);
890 lua_rawset(L,LUA_REGISTRYINDEX);
900 SWIGINTERN
int SWIG_Lua_set_immutable(
lua_State* L)
903 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
905 lua_pushstring(L,
"This variable is immutable");
912 SWIGINTERN
int SWIG_Lua_module_get(
lua_State* L)
922 assert(lua_istable(L,1));
923 lua_getmetatable(L,1);
924 assert(lua_istable(L,-1));
925 SWIG_Lua_get_table(L,
".get");
927 if (lua_istable(L,-1))
933 if (lua_iscfunction(L,-1))
946 SWIGINTERN
int SWIG_Lua_module_set(
lua_State* L)
954 assert(lua_istable(L,1));
955 lua_getmetatable(L,1);
956 assert(lua_istable(L,-1));
957 SWIG_Lua_get_table(L,
".set");
959 if (lua_istable(L,-1))
965 if (lua_iscfunction(L,-1))
979 SWIGINTERN
void SWIG_Lua_module_begin(
lua_State* L,
const char* name)
981 assert(lua_istable(L,-1));
982 lua_pushstring(L,name);
986 SWIG_Lua_add_function(L,
"__index",SWIG_Lua_module_get);
987 SWIG_Lua_add_function(L,
"__newindex",SWIG_Lua_module_set);
988 lua_pushstring(L,
".get");
991 lua_pushstring(L,
".set");
994 lua_setmetatable(L,-2);
996 SWIG_Lua_get_table(L,name);
1000 SWIGINTERN
void SWIG_Lua_module_end(
lua_State* L)
1008 assert(lua_istable(L,-1));
1009 lua_getmetatable(L,-1);
1010 assert(lua_istable(L,-1));
1011 SWIG_Lua_get_table(L,
".get");
1012 assert(lua_istable(L,-1));
1013 SWIG_Lua_add_function(L,name,getFn);
1017 SWIG_Lua_get_table(L,
".set");
1018 assert(lua_istable(L,-1));
1019 SWIG_Lua_add_function(L,name,setFn);
1028 SWIG_Lua_add_function(L,name,fn);
1036 SWIGINTERN
int SWIG_Lua_class_get(
lua_State* L)
1042 assert(lua_isuserdata(L,-2));
1043 lua_getmetatable(L,-2);
1044 assert(lua_istable(L,-1));
1045 SWIG_Lua_get_table(L,
".get");
1046 assert(lua_istable(L,-1));
1051 if (lua_iscfunction(L,-1))
1060 SWIG_Lua_get_table(L,
".fn");
1061 assert(lua_istable(L,-1));
1065 if (lua_isfunction(L,-1))
1073 SWIG_Lua_get_table(L,
"__getitem");
1074 if (lua_iscfunction(L,-1))
1086 SWIGINTERN
int SWIG_Lua_class_set(
lua_State* L)
1097 assert(lua_isuserdata(L,1));
1098 lua_getmetatable(L,1);
1099 assert(lua_istable(L,-1));
1101 SWIG_Lua_get_table(L,
".set");
1102 if (lua_istable(L,-1))
1107 if (lua_iscfunction(L,-1))
1119 SWIG_Lua_get_table(L,
"__setitem");
1120 if (lua_iscfunction(L,-1))
1133 SWIGINTERN
int SWIG_Lua_class_destruct(
lua_State* L)
1137 swig_lua_userdata* usr;
1138 swig_lua_class* clss;
1139 assert(lua_isuserdata(L,-1));
1140 usr=(swig_lua_userdata*)lua_touserdata(L,-1);
1144 clss=(swig_lua_class*)usr->type->clientdata;
1145 if (clss && clss->destructor)
1147 clss->destructor(usr->ptr);
1154 SWIGINTERN
void SWIG_Lua_get_class_registry(
lua_State* L)
1157 lua_pushstring(L,
"SWIG");
1158 lua_rawget(L,LUA_REGISTRYINDEX);
1159 if (!lua_istable(L,-1))
1162 lua_pushstring(L,
"SWIG");
1164 lua_rawset(L,LUA_REGISTRYINDEX);
1166 lua_pushstring(L,
"SWIG");
1167 lua_rawget(L,LUA_REGISTRYINDEX);
1172 SWIGINTERN
void SWIG_Lua_get_class_metatable(
lua_State* L,
const char* cname)
1174 SWIG_Lua_get_class_registry(L);
1175 lua_pushstring(L,cname);
1183 assert(lua_istable(L,-1));
1184 SWIG_Lua_get_table(L,
".get");
1185 assert(lua_istable(L,-1));
1186 SWIG_Lua_add_function(L,name,getFn);
1190 SWIG_Lua_get_table(L,
".set");
1191 assert(lua_istable(L,-1));
1192 SWIG_Lua_add_function(L,name,setFn);
1198 SWIGINTERN
void SWIG_Lua_add_class_details(
lua_State* L,swig_lua_class* clss)
1202 for(i=0;clss->bases[i];i++)
1204 SWIG_Lua_add_class_details(L,clss->bases[i]);
1207 for(i=0;clss->attributes[i].name;i++){
1208 SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
1211 SWIG_Lua_get_table(L,
".fn");
1212 assert(lua_istable(L,-1));
1213 for(i=0;clss->methods[i].name;i++){
1214 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
1221 for(i=0;clss->methods[i].name;i++){
1222 if (clss->methods[i].name[0]==
'_' && clss->methods[i].name[1]==
'_'){
1223 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
1235 SWIGINTERN
void SWIG_Lua_init_base_class(
lua_State* L,swig_lua_class* clss)
1238 swig_module_info* module=SWIG_GetModule(L);
1239 for(i=0;clss->base_names[i];i++)
1241 if (clss->bases[i]==0)
1244 swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
1245 if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
1251 SWIGINTERN
void SWIG_Lua_class_register(
lua_State* L,swig_lua_class* clss)
1257 if (clss->constructor)
1258 SWIG_Lua_add_function(L,clss->name,clss->constructor);
1260 SWIG_Lua_get_class_registry(L);
1261 lua_pushstring(L,clss->name);
1264 lua_pushstring(L,
".type");
1265 lua_pushstring(L,clss->name);
1268 lua_pushstring(L,
".get");
1272 lua_pushstring(L,
".set");
1276 lua_pushstring(L,
".fn");
1280 SWIG_Lua_add_function(L,
"__index",SWIG_Lua_class_get);
1281 SWIG_Lua_add_function(L,
"__newindex",SWIG_Lua_class_set);
1282 SWIG_Lua_add_function(L,
"__gc",SWIG_Lua_class_destruct);
1287 SWIG_Lua_get_class_metatable(L,clss->name);
1288 SWIG_Lua_add_class_details(L,clss);
1297 SWIGINTERN
void _SWIG_Lua_AddMetatable(
lua_State* L,swig_type_info *type)
1299 if (type->clientdata)
1301 SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
1302 if (lua_istable(L,-1))
1304 lua_setmetatable(L,-2);
1314 SWIGRUNTIME
void SWIG_Lua_NewPointerObj(
lua_State* L,
void* ptr,swig_type_info *type,
int own)
1316 swig_lua_userdata* usr;
1321 usr=(swig_lua_userdata*)lua_newuserdata(L,
sizeof(swig_lua_userdata));
1325 _SWIG_Lua_AddMetatable(L,type);
1330 SWIGRUNTIME
int SWIG_Lua_ConvertPtr(
lua_State* L,
int index,
void** ptr,swig_type_info *type,
int flags)
1332 swig_lua_userdata* usr;
1333 swig_cast_info *cast;
1334 if (lua_isnil(L,index)){*ptr=0;
return SWIG_OK;}
1335 usr=(swig_lua_userdata*)lua_touserdata(L,index);
1338 if (flags & SWIG_POINTER_DISOWN)
1347 cast=SWIG_TypeCheckStruct(usr->type,type);
1351 *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
1359 SWIGRUNTIME
void* SWIG_Lua_MustGetPtr(
lua_State* L,
int index,swig_type_info *type,
int flags,
1360 int argnum,
const char* func_name){
1362 if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
1363 lua_pushfstring(L,
"Error in %s, expected a %s at argument number %d\n",
1364 func_name,(type && type->str)?type->str:
"void*",argnum);
1371 SWIGRUNTIME
void SWIG_Lua_NewPackedObj(
lua_State* L,
void* ptr,
size_t size,swig_type_info *type)
1373 swig_lua_rawdata* raw;
1375 raw=(swig_lua_rawdata*)lua_newuserdata(L,
sizeof(swig_lua_rawdata)-1+size);
1378 memcpy(raw->data,ptr,size);
1379 _SWIG_Lua_AddMetatable(L,type);
1383 SWIGRUNTIME
int SWIG_Lua_ConvertPacked(
lua_State* L,
int index,
void* ptr,
size_t size,swig_type_info *type)
1385 swig_lua_rawdata* raw;
1386 raw=(swig_lua_rawdata*)lua_touserdata(L,index);
1387 if (!raw)
return SWIG_ERROR;
1388 if (type==0 || type==raw->type)
1390 memcpy(ptr,raw->data,size);
1397 SWIGRUNTIME
const char *SWIG_Lua_typename(
lua_State *L,
int tp)
1399 swig_lua_userdata* usr;
1400 if (lua_isuserdata(L,tp))
1402 usr=(swig_lua_userdata*)lua_touserdata(L,tp);
1403 if (usr && usr->type && usr->type->str)
1404 return usr->type->str;
1405 return "userdata (unknown type)";
1407 return lua_typename(L,lua_type(L,tp));
1411 SWIGRUNTIME
int SWIG_Lua_type(
lua_State* L)
1413 lua_pushstring(L,SWIG_Lua_typename(L,1));
1420 SWIGRUNTIME
int SWIG_Lua_equal(
lua_State* L)
1423 swig_lua_userdata *usr1,*usr2;
1424 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2))
1426 usr1=(swig_lua_userdata*)lua_touserdata(L,1);
1427 usr2=(swig_lua_userdata*)lua_touserdata(L,2);
1429 result=(usr1->ptr==usr2->ptr);
1430 lua_pushboolean(L,result);
1440 SWIG_Lua_InstallConstants(
lua_State* L, swig_lua_const_info constants[]) {
1442 for (i = 0; constants[i].type; i++) {
1443 switch(constants[i].type) {
1445 lua_pushstring(L,constants[i].name);
1446 lua_pushnumber(L,(lua_Number)constants[i].lvalue);
1449 case SWIG_LUA_FLOAT:
1450 lua_pushstring(L,constants[i].name);
1451 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
1455 lua_pushstring(L,constants[i].name);
1456 lua_pushfstring(L,
"%c",(
char)constants[i].lvalue);
1459 case SWIG_LUA_STRING:
1460 lua_pushstring(L,constants[i].name);
1461 lua_pushstring(L,(
char *) constants[i].pvalue);
1464 case SWIG_LUA_POINTER:
1465 lua_pushstring(L,constants[i].name);
1466 SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
1469 case SWIG_LUA_BINARY:
1470 lua_pushstring(L,constants[i].name);
1471 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
1484 #ifndef SWIG_DOSTRING_FAIL
1485 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
1493 SWIG_Lua_dostring(
lua_State *L,
const char* str) {
1495 if (str==0 || str[0]==0)
return 0;
1497 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
1498 ok=luaL_dostring(L,str);
1500 ok=lua_dostring(L,str);
1503 SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
1523 #ifdef SWIG_MODULE_CLIENTDATA_TYPE
1525 SWIGRUNTIMEINLINE swig_type_info *
1526 SWIG_TypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata,
const char *name) {
1527 swig_module_info *module = SWIG_GetModule(clientdata);
1528 return SWIG_TypeQueryModule(module, module, name);
1531 SWIGRUNTIMEINLINE swig_type_info *
1532 SWIG_MangledTypeQuery(SWIG_MODULE_CLIENTDATA_TYPE clientdata,
const char *name) {
1533 swig_module_info *module = SWIG_GetModule(clientdata);
1534 return SWIG_MangledTypeQueryModule(module, module, name);
1539 SWIGRUNTIMEINLINE swig_type_info *
1540 SWIG_TypeQuery(
const char *name) {
1541 swig_module_info *module = SWIG_GetModule(
nullptr);
1542 return SWIG_TypeQueryModule(module, module, name);
1545 SWIGRUNTIMEINLINE swig_type_info *
1546 SWIG_MangledTypeQuery(
const char *name) {
1547 swig_module_info *module = SWIG_GetModule(
nullptr);
1548 return SWIG_MangledTypeQueryModule(module, module, name);
struct lua_State lua_State
Definition: defs.h:8
int(* lua_CFunction)(lua_State *)
Definition: defs.h:9