1 /* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (http://www.swig.org).
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 * ----------------------------------------------------------------------------- */
12 #define SWIG_LUA_TARGET SWIG_LUA_FLAVOR_LUA
13 #define SWIG_LUA_MODULE_GLOBAL
17 /* SwigValueWrapper is described in swig.swg */
18 template<typename T> class SwigValueWrapper {
19 struct SwigMovePointer {
21 SwigMovePointer(T *p) : ptr(p) { }
22 ~SwigMovePointer() { delete ptr; }
23 SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
25 SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
26 SwigValueWrapper(const SwigValueWrapper<T>& rhs);
28 SwigValueWrapper() : pointer(0) { }
29 SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
30 operator T&() const { return *pointer.ptr; }
31 T *operator&() { return pointer.ptr; }
34 template <typename T> T SwigValueInit() {
39 /* -----------------------------------------------------------------------------
40 * This section contains generic SWIG labels for method/variable
41 * declarations/attributes, and other compiler dependent labels.
42 * ----------------------------------------------------------------------------- */
44 /* template workaround for compilers that cannot correctly implement the C++ standard */
45 #ifndef SWIGTEMPLATEDISAMBIGUATOR
46 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
47 # define SWIGTEMPLATEDISAMBIGUATOR template
48 # elif defined(__HP_aCC)
49 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
50 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
51 # define SWIGTEMPLATEDISAMBIGUATOR template
53 # define SWIGTEMPLATEDISAMBIGUATOR
57 /* inline attribute */
59 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
60 # define SWIGINLINE inline
66 /* attribute recognised by some compilers to avoid 'unused' warnings */
68 # if defined(__GNUC__)
69 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
70 # define SWIGUNUSED __attribute__ ((__unused__))
75 # define SWIGUNUSED __attribute__ ((__unused__))
81 #ifndef SWIG_MSC_UNSUPPRESS_4505
82 # if defined(_MSC_VER)
83 # pragma warning(disable : 4505) /* unreferenced local function has been removed */
87 #ifndef SWIGUNUSEDPARM
89 # define SWIGUNUSEDPARM(p)
91 # define SWIGUNUSEDPARM(p) p SWIGUNUSED
95 /* internal SWIG method */
97 # define SWIGINTERN static SWIGUNUSED
100 /* internal inline SWIG method */
101 #ifndef SWIGINTERNINLINE
102 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
105 /* exporting methods */
106 #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
107 # ifndef GCC_HASCLASSVISIBILITY
108 # define GCC_HASCLASSVISIBILITY
113 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
114 # if defined(STATIC_LINKED)
117 # define SWIGEXPORT __declspec(dllexport)
120 # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
121 # define SWIGEXPORT __attribute__ ((visibility("default")))
128 /* calling conventions for Windows */
130 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
131 # define SWIGSTDCALL __stdcall
137 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
138 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
139 # define _CRT_SECURE_NO_DEPRECATE
142 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
143 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
144 # define _SCL_SECURE_NO_DEPRECATE
148 /* -----------------------------------------------------------------------------
151 * This file contains generic C API SWIG runtime support for pointer
153 * ----------------------------------------------------------------------------- */
155 /* This should only be incremented when either the layout of swig_type_info changes,
156 or for whatever reason, the runtime changes incompatibly */
157 #define SWIG_RUNTIME_VERSION "4"
159 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
160 #ifdef SWIG_TYPE_TABLE
161 # define SWIG_QUOTE_STRING(x) #x
162 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
163 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
165 # define SWIG_TYPE_TABLE_NAME
169 You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
170 creating a static or dynamic library from the SWIG runtime code.
171 In 99.9% of the cases, SWIG just needs to declare them as 'static'.
173 But only do this if strictly necessary, ie, if you have problems
174 with your compiler or suchlike.
178 # define SWIGRUNTIME SWIGINTERN
181 #ifndef SWIGRUNTIMEINLINE
182 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
185 /* Generic buffer size */
186 #ifndef SWIG_BUFFER_SIZE
187 # define SWIG_BUFFER_SIZE 1024
190 /* Flags for pointer conversions */
191 #define SWIG_POINTER_DISOWN 0x1
192 #define SWIG_CAST_NEW_MEMORY 0x2
194 /* Flags for new pointer objects */
195 #define SWIG_POINTER_OWN 0x1
199 Flags/methods for returning states.
201 The SWIG conversion methods, as ConvertPtr, return an integer
202 that tells if the conversion was successful or not. And if not,
203 an error code can be returned (see swigerrors.swg for the codes).
205 Use the following macros/flags to set or process the returning
208 In old versions of SWIG, code such as the following was usually written:
210 if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
216 Now you can be more explicit:
218 int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
219 if (SWIG_IsOK(res)) {
225 which is the same really, but now you can also do
228 int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
229 if (SWIG_IsOK(res)) {
231 if (SWIG_IsNewObj(res) {
241 I.e., now SWIG_ConvertPtr can return new objects and you can
242 identify the case and take care of the deallocation. Of course that
243 also requires SWIG_ConvertPtr to return new result values, such as
245 int SWIG_ConvertPtr(obj, ptr,...) {
247 if (<need new object>) {
248 *ptr = <ptr to new allocated object>;
251 *ptr = <ptr to old object>;
259 Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
260 more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
263 Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
264 allows to return the 'cast rank', for example, if you have this
271 food(1) // cast rank '1' (1 -> 1.0)
272 fooi(1) // cast rank '0'
274 just use the SWIG_AddCast()/SWIG_CheckState()
278 #define SWIG_ERROR (-1)
279 #define SWIG_IsOK(r) (r >= 0)
280 #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
282 /* The CastRankLimit says how many bits are used for the cast rank */
283 #define SWIG_CASTRANKLIMIT (1 << 8)
284 /* The NewMask denotes the object was created (using new/malloc) */
285 #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
286 /* The TmpMask is for in/out typemaps that use temporal objects */
287 #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
288 /* Simple returning values */
289 #define SWIG_BADOBJ (SWIG_ERROR)
290 #define SWIG_OLDOBJ (SWIG_OK)
291 #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
292 #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
293 /* Check, add and del mask methods */
294 #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
295 #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
296 #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
297 #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
298 #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
299 #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
302 #if defined(SWIG_CASTRANK_MODE)
303 # ifndef SWIG_TypeRank
304 # define SWIG_TypeRank unsigned long
306 # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
307 # define SWIG_MAXCASTRANK (2)
309 # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
310 # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
311 SWIGINTERNINLINE int SWIG_AddCast(int r) {
312 return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
314 SWIGINTERNINLINE int SWIG_CheckState(int r) {
315 return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
317 #else /* no cast-rank mode */
318 # define SWIG_AddCast(r) (r)
319 # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
326 // removed: extern "C" {
329 typedef void *(*swig_converter_func)(void *, int *);
330 typedef struct swig_type_info *(*swig_dycast_func)(void **);
332 /* Structure to store information on one type */
333 typedef struct swig_type_info {
334 const char *name; /* mangled name of this type */
335 const char *str; /* human readable name of this type */
336 swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
337 struct swig_cast_info *cast; /* linked list of types that can cast into this type */
338 void *clientdata; /* language specific type data */
339 int owndata; /* flag if the structure owns the clientdata */
342 /* Structure to store a type and conversion function used for casting */
343 typedef struct swig_cast_info {
344 swig_type_info *type; /* pointer to type that is equivalent to this type */
345 swig_converter_func converter; /* function to cast the void pointers */
346 struct swig_cast_info *next; /* pointer to next cast in linked list */
347 struct swig_cast_info *prev; /* pointer to the previous cast */
350 /* Structure used to store module information
351 * Each module generates one structure like this, and the runtime collects
352 * all of these structures and stores them in a circularly linked list.*/
353 typedef struct swig_module_info {
354 swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
355 size_t size; /* Number of types in this module */
356 struct swig_module_info *next; /* Pointer to next element in circularly linked list */
357 swig_type_info **type_initial; /* Array of initially generated type structures */
358 swig_cast_info **cast_initial; /* Array of initially generated casting structures */
359 void *clientdata; /* Language specific module data */
363 Compare two type names skipping the space characters, therefore
364 "char*" == "char *" and "Class<int>" == "Class<int >", etc.
366 Return 0 when the two name types are equivalent, as in
367 strncmp, but skipping ' '.
370 SWIG_TypeNameComp(const char *f1, const char *l1,
371 const char *f2, const char *l2) {
372 for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
373 while ((*f1 == ' ') && (f1 != l1)) ++f1;
374 while ((*f2 == ' ') && (f2 != l2)) ++f2;
375 if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
377 return (int)((l1 - f1) - (l2 - f2));
381 Check type equivalence in a name list like <name1>|<name2>|...
382 Return 0 if equal, -1 if nb < tb, 1 if nb > tb
385 SWIG_TypeCmp(const char *nb, const char *tb) {
387 const char* te = tb + strlen(tb);
389 while (equiv != 0 && *ne) {
390 for (nb = ne; *ne; ++ne) {
391 if (*ne == '|') break;
393 equiv = SWIG_TypeNameComp(nb, ne, tb, te);
400 Check type equivalence in a name list like <name1>|<name2>|...
401 Return 0 if not equal, 1 if equal
404 SWIG_TypeEquiv(const char *nb, const char *tb) {
405 return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
411 SWIGRUNTIME swig_cast_info *
412 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
414 swig_cast_info *iter = ty->cast;
416 if (strcmp(iter->type->name, c) == 0) {
417 if (iter == ty->cast)
419 /* Move iter to the top of the linked list */
420 iter->prev->next = iter->next;
422 iter->next->prev = iter->prev;
423 iter->next = ty->cast;
425 if (ty->cast) ty->cast->prev = iter;
436 Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
438 SWIGRUNTIME swig_cast_info *
439 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
441 swig_cast_info *iter = ty->cast;
443 if (iter->type == from) {
444 if (iter == ty->cast)
446 /* Move iter to the top of the linked list */
447 iter->prev->next = iter->next;
449 iter->next->prev = iter->prev;
450 iter->next = ty->cast;
452 if (ty->cast) ty->cast->prev = iter;
463 Cast a pointer up an inheritance hierarchy
465 SWIGRUNTIMEINLINE void *
466 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
467 return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
471 Dynamic pointer casting. Down an inheritance hierarchy
473 SWIGRUNTIME swig_type_info *
474 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
475 swig_type_info *lastty = ty;
476 if (!ty || !ty->dcast) return ty;
477 while (ty && (ty->dcast)) {
478 ty = (*ty->dcast)(ptr);
485 Return the name associated with this type
487 SWIGRUNTIMEINLINE const char *
488 SWIG_TypeName(const swig_type_info *ty) {
493 Return the pretty name associated with this type,
494 that is an unmangled type name in a form presentable to the user.
496 SWIGRUNTIME const char *
497 SWIG_TypePrettyName(const swig_type_info *type) {
498 /* The "str" field contains the equivalent pretty names of the
499 type, separated by vertical-bar characters. We choose
500 to print the last name, as it is often (?) the most
502 if (!type) return NULL;
503 if (type->str != NULL) {
504 const char *last_name = type->str;
506 for (s = type->str; *s; s++)
507 if (*s == '|') last_name = s+1;
515 Set the clientdata field for a type
518 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
519 swig_cast_info *cast = ti->cast;
520 /* if (ti->clientdata == clientdata) return; */
521 ti->clientdata = clientdata;
524 if (!cast->converter) {
525 swig_type_info *tc = cast->type;
526 if (!tc->clientdata) {
527 SWIG_TypeClientData(tc, clientdata);
534 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
535 SWIG_TypeClientData(ti, clientdata);
540 Search for a swig_type_info structure only by mangled name
541 Search is a O(log #types)
543 We start searching at module start, and finish searching when start == end.
544 Note: if start == end at the beginning of the function, we go all the way around
547 SWIGRUNTIME swig_type_info *
548 SWIG_MangledTypeQueryModule(swig_module_info *start,
549 swig_module_info *end,
551 swig_module_info *iter = start;
554 register size_t l = 0;
555 register size_t r = iter->size - 1;
557 /* since l+r >= 0, we can (>> 1) instead (/ 2) */
558 register size_t i = (l + r) >> 1;
559 const char *iname = iter->types[i]->name;
561 register int compare = strcmp(name, iname);
563 return iter->types[i];
564 } else if (compare < 0) {
570 } else if (compare > 0) {
574 break; /* should never happen */
579 } while (iter != end);
584 Search for a swig_type_info structure for either a mangled name or a human readable name.
585 It first searches the mangled names of the types, which is a O(log #types)
586 If a type is not found it then searches the human readable names, which is O(#types).
588 We start searching at module start, and finish searching when start == end.
589 Note: if start == end at the beginning of the function, we go all the way around
592 SWIGRUNTIME swig_type_info *
593 SWIG_TypeQueryModule(swig_module_info *start,
594 swig_module_info *end,
596 /* STEP 1: Search the name field using binary search */
597 swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
601 /* STEP 2: If the type hasn't been found, do a complete search
602 of the str field (the human readable name) */
603 swig_module_info *iter = start;
605 register size_t i = 0;
606 for (; i < iter->size; ++i) {
607 if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
608 return iter->types[i];
611 } while (iter != end);
614 /* neither found a match */
619 Pack binary data into a string
622 SWIG_PackData(char *c, void *ptr, size_t sz) {
623 static const char hex[17] = "0123456789abcdef";
624 register const unsigned char *u = (unsigned char *) ptr;
625 register const unsigned char *eu = u + sz;
626 for (; u != eu; ++u) {
627 register unsigned char uu = *u;
628 *(c++) = hex[(uu & 0xf0) >> 4];
629 *(c++) = hex[uu & 0xf];
635 Unpack binary data from a string
637 SWIGRUNTIME const char *
638 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
639 register unsigned char *u = (unsigned char *) ptr;
640 register const unsigned char *eu = u + sz;
641 for (; u != eu; ++u) {
642 register char d = *(c++);
643 register unsigned char uu;
644 if ((d >= '0') && (d <= '9'))
645 uu = ((d - '0') << 4);
646 else if ((d >= 'a') && (d <= 'f'))
647 uu = ((d - ('a'-10)) << 4);
651 if ((d >= '0') && (d <= '9'))
653 else if ((d >= 'a') && (d <= 'f'))
654 uu |= (d - ('a'-10));
663 Pack 'void *' into a string buffer.
666 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
668 if ((2*sizeof(void *) + 2) > bsz) return 0;
670 r = SWIG_PackData(r,&ptr,sizeof(void *));
671 if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
676 SWIGRUNTIME const char *
677 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
679 if (strcmp(c,"NULL") == 0) {
686 return SWIG_UnpackData(++c,ptr,sizeof(void *));
690 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
692 size_t lname = (name ? strlen(name) : 0);
693 if ((2*sz + 2 + lname) > bsz) return 0;
695 r = SWIG_PackData(r,ptr,sz);
697 strncpy(r,name,lname+1);
704 SWIGRUNTIME const char *
705 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
707 if (strcmp(c,"NULL") == 0) {
714 return SWIG_UnpackData(++c,ptr,sz);
721 /* -----------------------------------------------------------------------------
724 * This file contains the runtime support for Lua modules
725 * and includes code for managing global variables and pointer
727 * ----------------------------------------------------------------------------- */
730 // removed: extern "C" {
735 #include <stdlib.h> /* for malloc */
736 #include <assert.h> /* for a few sanity tests */
738 /* -----------------------------------------------------------------------------
740 * ----------------------------------------------------------------------------- */
742 #define SWIG_LUA_FLAVOR_LUA 1
743 #define SWIG_LUA_FLAVOR_ELUA 2
744 #define SWIG_LUA_FLAVOR_ELUAC 3
746 #if !defined(SWIG_LUA_TARGET)
747 # error SWIG_LUA_TARGET not defined
750 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
751 # define SWIG_LUA_CONSTTAB_INT(B, C) LSTRKEY(B), LNUMVAL(C)
752 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) LSTRKEY(B), LNUMVAL(C)
753 # define SWIG_LUA_CONSTTAB_STRING(B, C) LSTRKEY(B), LSTRVAL(C)
754 # define SWIG_LUA_CONSTTAB_CHAR(B, C) LSTRKEY(B), LNUMVAL(C)
755 #else /* SWIG_LUA_FLAVOR_LUA */
756 # define SWIG_LUA_CONSTTAB_INT(B, C) SWIG_LUA_INT, (char *)B, (long)C, 0, 0, 0
757 # define SWIG_LUA_CONSTTAB_FLOAT(B, C) SWIG_LUA_FLOAT, (char *)B, 0, (double)C, 0, 0
758 # define SWIG_LUA_CONSTTAB_STRING(B, C) SWIG_LUA_STRING, (char *)B, 0, 0, (void *)C, 0
759 # define SWIG_LUA_CONSTTAB_CHAR(B, C) SWIG_LUA_CHAR, (char *)B, (long)C, 0, 0, 0
762 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC)
763 # define LRO_STRVAL(v) {{.p = (char *) v}, LUA_TSTRING}
764 # define LSTRVAL LRO_STRVAL
767 /* -----------------------------------------------------------------------------
768 * compatibility defines
769 * ----------------------------------------------------------------------------- */
771 /* History of Lua C API length functions: In Lua 5.0 (and before?)
772 there was "lua_strlen". In Lua 5.1, this was renamed "lua_objlen",
773 but a compatibility define of "lua_strlen" was added. In Lua 5.2,
774 this function was again renamed, to "lua_rawlen" (to emphasize that
775 it doesn't call the "__len" metamethod), and the compatibility
776 define of lua_strlen was removed. All SWIG uses have been updated
777 to "lua_rawlen", and we add our own defines of that here for older
779 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 501
780 # define lua_rawlen lua_strlen
781 #elif LUA_VERSION_NUM == 501
782 # define lua_rawlen lua_objlen
786 /* lua_pushglobaltable is the recommended "future-proof" way to get
787 the global table for Lua 5.2 and later. Here we define
788 lua_pushglobaltable ourselves for Lua versions before 5.2. */
789 #if !defined(LUA_VERSION_NUM) || LUA_VERSION_NUM < 502
790 # define lua_pushglobaltable(L) lua_pushvalue(L, LUA_GLOBALSINDEX)
794 /* --------------------------------------------------------------------------
795 * Helper functions for error handling
796 * -------------------------------------------------------------------------- */
798 /* Push the string STR on the Lua stack, like lua_pushstring, but
799 prefixed with the the location of the innermost Lua call-point
800 (as formated by luaL_where). */
802 SWIG_Lua_pusherrstring (lua_State *L, const char *str)
805 lua_pushstring (L, str);
809 /* Push a formatted string generated from FMT and following args on
810 the Lua stack, like lua_pushfstring, but prefixed with the the
811 location of the innermost Lua call-point (as formated by luaL_where). */
813 SWIG_Lua_pushferrstring (lua_State *L, const char *fmt, ...)
818 lua_pushvfstring(L, fmt, argp);
824 /* -----------------------------------------------------------------------------
826 * ----------------------------------------------------------------------------- */
828 #define SWIG_LUA_INT 1
829 #define SWIG_LUA_FLOAT 2
830 #define SWIG_LUA_STRING 3
831 #define SWIG_LUA_POINTER 4
832 #define SWIG_LUA_BINARY 5
833 #define SWIG_LUA_CHAR 6
835 /* Structure for variable linking table */
842 /* Constant information structure */
849 swig_type_info **ptype;
850 } swig_lua_const_info;
854 lua_CFunction method;
859 lua_CFunction getmethod;
860 lua_CFunction setmethod;
861 } swig_lua_attribute;
863 // Can be used to create namespaces. Currently used to
864 // wrap class static methods/variables/constants
867 swig_lua_method *ns_methods;
868 swig_lua_attribute *ns_attributes;
869 swig_lua_const_info *ns_constants;
870 } swig_lua_namespace;
872 typedef struct swig_lua_class {
874 swig_type_info **type;
875 lua_CFunction constructor;
876 void (*destructor)(void *);
877 swig_lua_method *methods;
878 swig_lua_attribute *attributes;
879 swig_lua_namespace cls_static;
880 struct swig_lua_class **bases;
881 const char **base_names;
884 /* this is the struct for wrapping all pointers in SwigLua
887 swig_type_info *type;
888 int own; /* 1 if owned & must be destroyed */
892 /* this is the struct for wrapping arbitrary packed binary data
893 (currently it is only used for member function pointers)
894 the data ordering is similar to swig_lua_userdata, but it is currently not possible
895 to tell the two structures apart within SWIG, other than by looking at the type
898 swig_type_info *type;
899 int own; /* 1 if owned & must be destroyed */
900 char data[1]; /* arbitary amount of data */
903 /* Common SWIG API */
904 #define SWIG_NewPointerObj(L, ptr, type, owner) SWIG_Lua_NewPointerObj(L, (void *)ptr, type, owner)
905 #define SWIG_ConvertPtr(L,idx, ptr, type, flags) SWIG_Lua_ConvertPtr(L,idx,ptr,type,flags)
906 #define SWIG_MustGetPtr(L,idx, type,flags, argnum,fnname) SWIG_Lua_MustGetPtr(L,idx, type,flags, argnum,fnname)
907 /* for C++ member pointers, ie, member methods */
908 #define SWIG_ConvertMember(L, idx, ptr, sz, ty) SWIG_Lua_ConvertPacked(L, idx, ptr, sz, ty)
909 #define SWIG_NewMemberObj(L, ptr, sz, type) SWIG_Lua_NewPackedObj(L, ptr, sz, type)
912 #define SWIG_GetModule(clientdata) SWIG_Lua_GetModule((lua_State*)(clientdata))
913 #define SWIG_SetModule(clientdata, pointer) SWIG_Lua_SetModule((lua_State*) (clientdata), pointer)
914 #define SWIG_MODULE_CLIENTDATA_TYPE lua_State*
916 /* Contract support */
917 #define SWIG_contract_assert(expr, msg) \
918 if (!(expr)) { SWIG_Lua_pusherrstring(L, (char *) msg); goto fail; } else
921 /* helper #defines */
922 #define SWIG_fail {goto fail;}
923 #define SWIG_fail_arg(func_name,argnum,type) \
924 {SWIG_Lua_pushferrstring(L,"Error in %s (arg %d), expected '%s' got '%s'",\
925 func_name,argnum,type,SWIG_Lua_typename(L,argnum));\
927 #define SWIG_fail_ptr(func_name,argnum,type) \
928 SWIG_fail_arg(func_name,argnum,(type && type->str)?type->str:"void*")
929 #define SWIG_check_num_args(func_name,a,b) \
930 if (lua_gettop(L)<a || lua_gettop(L)>b) \
931 {SWIG_Lua_pushferrstring(L,"Error in %s expected %d..%d args, got %d",func_name,a,b,lua_gettop(L));\
935 #define SWIG_Lua_get_table(L,n) \
936 (lua_pushstring(L, n), lua_rawget(L,-2))
938 #define SWIG_Lua_add_function(L,n,f) \
939 (lua_pushstring(L, n), \
940 lua_pushcfunction(L, f), \
943 /* special helper for allowing 'nil' for usertypes */
944 #define SWIG_isptrtype(L,I) (lua_isuserdata(L,I) || lua_isnil(L,I))
947 /* Special helper for member function pointers
948 it gets the address, casts it, then dereferences it */
949 //#define SWIG_mem_fn_as_voidptr(a) (*((char**)&(a)))
952 /* storing/access of swig_module_info */
953 SWIGRUNTIME swig_module_info *
954 SWIG_Lua_GetModule(lua_State* L) {
955 swig_module_info *ret = 0;
956 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
957 lua_rawget(L,LUA_REGISTRYINDEX);
958 if (lua_islightuserdata(L,-1))
959 ret=(swig_module_info*)lua_touserdata(L,-1);
960 lua_pop(L,1); /* tidy */
965 SWIG_Lua_SetModule(lua_State* L, swig_module_info *module) {
966 /* add this all into the Lua registry: */
967 lua_pushstring(L,"swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
968 lua_pushlightuserdata(L,(void*)module);
969 lua_rawset(L,LUA_REGISTRYINDEX);
972 /* -----------------------------------------------------------------------------
973 * global variable support code: modules
974 * ----------------------------------------------------------------------------- */
976 /* this function is called when trying to set an immutable.
977 default action is to print an error.
978 This can removed with a compile flag SWIGLUA_IGNORE_SET_IMMUTABLE */
979 SWIGINTERN int SWIG_Lua_set_immutable(lua_State* L)
981 /* there should be 1 param passed in: the new value */
982 #ifndef SWIGLUA_IGNORE_SET_IMMUTABLE
983 lua_pop(L,1); /* remove it */
984 luaL_error(L,"This variable is immutable");
986 return 0; /* should not return anything */
989 /* the module.get method used for getting linked data */
990 SWIGINTERN int SWIG_Lua_module_get(lua_State* L)
992 /* there should be 2 params passed in
993 (1) table (not the meta table)
994 (2) string name of the attribute
995 printf("SWIG_Lua_module_get %p(%s) '%s'\n",
996 lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
999 /* get the metatable */
1000 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
1001 assert(lua_isrotable(L,1)); /* just in case */
1003 assert(lua_istable(L,1)); /* default Lua action */
1005 lua_getmetatable(L,1); /* get the metatable */
1006 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
1007 assert(lua_isrotable(L,-1)); /* just in case */
1009 assert(lua_istable(L,-1));
1011 SWIG_Lua_get_table(L,".get"); /* get the .get table */
1012 lua_remove(L,3); /* remove metatable */
1013 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
1014 if (lua_isrotable(L,-1))
1016 if (lua_istable(L,-1))
1019 /* look for the key in the .get table */
1020 lua_pushvalue(L,2); /* key */
1022 lua_remove(L,3); /* remove .get */
1023 if (lua_iscfunction(L,-1))
1024 { /* found it so call the fn & return its value */
1028 lua_pop(L,1); /* remove the top */
1030 lua_pop(L,1); /* remove the .get */
1031 lua_pushnil(L); /* return a nil */
1035 /* the module.set method used for setting linked data */
1036 SWIGINTERN int SWIG_Lua_module_set(lua_State* L)
1038 /* there should be 3 params passed in
1039 (1) table (not the meta table)
1040 (2) string name of the attribute
1041 (3) any for the new value
1043 /* get the metatable */
1044 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
1045 assert(lua_isrotable(L,1)); /* just in case */
1047 assert(lua_istable(L,1)); /* default Lua action */
1049 lua_getmetatable(L,1); /* get the metatable */
1050 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
1051 assert(lua_isrotable(L,-1)); /* just in case */
1053 assert(lua_istable(L,-1));
1055 SWIG_Lua_get_table(L,".set"); /* get the .set table */
1056 lua_remove(L,4); /* remove metatable */
1057 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
1058 if (lua_isrotable(L,-1))
1060 if (lua_istable(L,-1))
1063 /* look for the key in the .set table */
1064 lua_pushvalue(L,2); /* key */
1066 lua_remove(L,4); /* remove .set */
1067 if (lua_iscfunction(L,-1))
1068 { /* found it so call the fn & return its value */
1069 lua_pushvalue(L,3); /* value */
1073 #if (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA)
1075 return 0; // Exits stoically if an invalid key is initialized.
1079 lua_settop(L,3); /* reset back to start */
1080 /* we now have the table, key & new value, so just set directly */
1081 lua_rawset(L,1); /* add direct */
1085 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
1086 /* registering a module in lua. Pushes the module table on the stack. */
1087 SWIGINTERN void SWIG_Lua_module_begin(lua_State* L,const char* name)
1089 assert(lua_istable(L,-1)); /* just in case */
1090 lua_pushstring(L,name);
1091 lua_newtable(L); /* the table */
1092 /* add meta table */
1093 lua_newtable(L); /* the meta table */
1094 SWIG_Lua_add_function(L,"__index",SWIG_Lua_module_get);
1095 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_module_set);
1096 lua_pushstring(L,".get");
1097 lua_newtable(L); /* the .get table */
1098 lua_rawset(L,-3); /* add .get into metatable */
1099 lua_pushstring(L,".set");
1100 lua_newtable(L); /* the .set table */
1101 lua_rawset(L,-3); /* add .set into metatable */
1102 lua_setmetatable(L,-2); /* sets meta table in module */
1103 #ifdef SWIG_LUA_MODULE_GLOBAL
1104 /* If requested, install the module directly into the global namespace. */
1105 lua_rawset(L,-3); /* add module into parent */
1106 SWIG_Lua_get_table(L,name); /* get the table back out */
1108 /* Do not install the module table as global name. The stack top has
1109 the module table with the name below. We pop the top and replace
1110 the name with it. */
1115 /* ending the register */
1116 SWIGINTERN void SWIG_Lua_module_end(lua_State* L)
1118 lua_pop(L,1); /* tidy stack (remove module) */
1121 /* adding a linked variable to the module */
1122 SWIGINTERN void SWIG_Lua_module_add_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
1124 assert(lua_istable(L,-1)); /* just in case */
1125 lua_getmetatable(L,-1); /* get the metatable */
1126 assert(lua_istable(L,-1)); /* just in case */
1127 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1128 assert(lua_istable(L,-1)); /* should be a table: */
1129 SWIG_Lua_add_function(L,name,getFn);
1130 lua_pop(L,1); /* tidy stack (remove table) */
1131 if (setFn) /* if there is a set fn */
1133 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1134 assert(lua_istable(L,-1)); /* should be a table: */
1135 SWIG_Lua_add_function(L,name,setFn);
1136 lua_pop(L,1); /* tidy stack (remove table) */
1138 lua_pop(L,1); /* tidy stack (remove meta) */
1142 /* adding a function module */
1143 SWIGINTERN void SWIG_Lua_module_add_function(lua_State* L,const char* name,lua_CFunction fn)
1145 SWIG_Lua_add_function(L,name,fn);
1148 /* -----------------------------------------------------------------------------
1149 * global variable support code: namespaces
1150 * ----------------------------------------------------------------------------- */
1152 SWIGINTERN int SWIG_Lua_namespace_get(lua_State* L)
1154 /* there should be 2 params passed in
1155 (1) table (not the meta table)
1156 (2) string name of the attribute
1158 assert(lua_istable(L,-2)); /* just in case */
1159 lua_getmetatable(L,-2);
1160 assert(lua_istable(L,-1));
1161 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1162 assert(lua_istable(L,-1));
1163 /* look for the key in the .get table */
1164 lua_pushvalue(L,2); /* key */
1166 lua_remove(L,-2); /* stack tidy, remove .get table */
1167 if (lua_iscfunction(L,-1))
1168 { /* found it so call the fn & return its value */
1169 lua_call(L,0,1); /* 1 value in (userdata),1 out (result) */
1170 lua_remove(L,-2); /* stack tidy, remove metatable */
1173 lua_pop(L,1); /* remove whatever was there */
1174 /* ok, so try the .fn table */
1175 SWIG_Lua_get_table(L,".fn"); /* find the .get table */
1176 assert(lua_istable(L,-1)); /* just in case */
1177 lua_pushvalue(L,2); /* key */
1178 lua_rawget(L,-2); /* look for the fn */
1179 lua_remove(L,-2); /* stack tidy, remove .fn table */
1180 if (lua_isfunction(L,-1)) /* note: whether it's a C function or lua function */
1181 { /* found it so return the fn & let lua call it */
1182 lua_remove(L,-2); /* stack tidy, remove metatable */
1185 lua_pop(L,1); /* remove whatever was there */
1189 SWIGINTERN int SWIG_Lua_namespace_set(lua_State* L)
1191 /* there should be 3 params passed in
1192 (1) table (not the meta table)
1193 (2) string name of the attribute
1194 (3) any for the new value
1197 assert(lua_istable(L,1));
1198 lua_getmetatable(L,1); /* get the meta table */
1199 assert(lua_istable(L,-1));
1201 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1202 if (lua_istable(L,-1))
1204 /* look for the key in the .set table */
1205 lua_pushvalue(L,2); /* key */
1207 if (lua_iscfunction(L,-1))
1208 { /* found it so call the fn & return its value */
1209 lua_pushvalue(L,3); /* value */
1213 lua_pop(L,1); /* remove the value */
1215 lua_pop(L,1); /* remove the value .set table */
1219 SWIGINTERN void SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]); // forward declaration
1220 SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn); // forward declaration
1222 /* helper function - register namespace methods and attributes into namespace */
1223 SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace* ns)
1226 assert(lua_istable(L,-1));
1227 /* There must be table at the top of the stack */
1228 SWIG_Lua_InstallConstants(L, ns->ns_constants);
1230 lua_getmetatable(L,-1);
1233 for(i=0;ns->ns_attributes[i].name;i++){
1234 SWIG_Lua_add_class_variable(L,ns->ns_attributes[i].name,ns->ns_attributes[i].getmethod,ns->ns_attributes[i].setmethod);
1237 /* add methods to the metatable */
1238 SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
1239 assert(lua_istable(L,-1)); /* just in case */
1240 for(i=0;ns->ns_methods[i].name;i++){
1241 SWIG_Lua_add_function(L,ns->ns_methods[i].name,ns->ns_methods[i].method);
1245 /* clear stack - remove metatble */
1250 /* helper function. creates namespace table and add it to module table */
1251 SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns)
1253 assert(lua_istable(L,-1)); /* just in case. This is supposed to be module table */
1254 lua_checkstack(L,5);
1255 lua_pushstring(L, ns->name);
1256 lua_newtable(L); /* namespace itself */
1257 lua_newtable(L); /* metatable for namespace */
1259 /* add a table called ".get" */
1260 lua_pushstring(L,".get");
1263 /* add a table called ".set" */
1264 lua_pushstring(L,".set");
1267 /* add a table called ".fn" */
1268 lua_pushstring(L,".fn");
1272 /* add accessor fns for using the .get,.set&.fn */
1273 SWIG_Lua_add_function(L,"__index",SWIG_Lua_namespace_get);
1274 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_namespace_set);
1276 lua_setmetatable(L,-2); /* set metatable */
1277 lua_rawset(L,-3); /* add namespace to module table */
1280 /* -----------------------------------------------------------------------------
1281 * global variable support code: classes
1282 * ----------------------------------------------------------------------------- */
1284 /* the class.get method, performs the lookup of class attributes */
1285 SWIGINTERN int SWIG_Lua_class_get(lua_State* L)
1287 /* there should be 2 params passed in
1288 (1) userdata (not the meta table)
1289 (2) string name of the attribute
1291 assert(lua_isuserdata(L,-2)); /* just in case */
1292 lua_getmetatable(L,-2); /* get the meta table */
1293 assert(lua_istable(L,-1)); /* just in case */
1294 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1295 assert(lua_istable(L,-1)); /* just in case */
1296 /* look for the key in the .get table */
1297 lua_pushvalue(L,2); /* key */
1299 lua_remove(L,-2); /* stack tidy, remove .get table */
1300 if (lua_iscfunction(L,-1))
1301 { /* found it so call the fn & return its value */
1302 lua_pushvalue(L,1); /* the userdata */
1303 lua_call(L,1,1); /* 1 value in (userdata),1 out (result) */
1304 lua_remove(L,-2); /* stack tidy, remove metatable */
1307 lua_pop(L,1); /* remove whatever was there */
1308 /* ok, so try the .fn table */
1309 SWIG_Lua_get_table(L,".fn"); /* find the .get table */
1310 assert(lua_istable(L,-1)); /* just in case */
1311 lua_pushvalue(L,2); /* key */
1312 lua_rawget(L,-2); /* look for the fn */
1313 lua_remove(L,-2); /* stack tidy, remove .fn table */
1314 if (lua_isfunction(L,-1)) /* note: if its a C function or lua function */
1315 { /* found it so return the fn & let lua call it */
1316 lua_remove(L,-2); /* stack tidy, remove metatable */
1319 lua_pop(L,1); /* remove whatever was there */
1320 /* NEW: looks for the __getitem() fn
1321 this is a user provided get fn */
1322 SWIG_Lua_get_table(L,"__getitem"); /* find the __getitem fn */
1323 if (lua_iscfunction(L,-1)) /* if its there */
1324 { /* found it so call the fn & return its value */
1325 lua_pushvalue(L,1); /* the userdata */
1326 lua_pushvalue(L,2); /* the parameter */
1327 lua_call(L,2,1); /* 2 value in (userdata),1 out (result) */
1328 lua_remove(L,-2); /* stack tidy, remove metatable */
1331 return 0; /* sorry not known */
1334 /* the class.set method, performs the lookup of class attributes */
1335 SWIGINTERN int SWIG_Lua_class_set(lua_State* L)
1337 /* there should be 3 params passed in
1338 (1) table (not the meta table)
1339 (2) string name of the attribute
1340 (3) any for the new value
1341 printf("SWIG_Lua_class_set %p(%s) '%s' %p(%s)\n",
1342 lua_topointer(L,1),lua_typename(L,lua_type(L,1)),
1344 lua_topointer(L,3),lua_typename(L,lua_type(L,3)));*/
1346 assert(lua_isuserdata(L,1)); /* just in case */
1347 lua_getmetatable(L,1); /* get the meta table */
1348 assert(lua_istable(L,-1)); /* just in case */
1350 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1351 if (lua_istable(L,-1))
1353 /* look for the key in the .set table */
1354 lua_pushvalue(L,2); /* key */
1356 if (lua_iscfunction(L,-1))
1357 { /* found it so call the fn & return its value */
1358 lua_pushvalue(L,1); /* userdata */
1359 lua_pushvalue(L,3); /* value */
1363 lua_pop(L,1); /* remove the value */
1365 lua_pop(L,1); /* remove the value .set table */
1366 /* NEW: looks for the __setitem() fn
1367 this is a user provided set fn */
1368 SWIG_Lua_get_table(L,"__setitem"); /* find the fn */
1369 if (lua_iscfunction(L,-1)) /* if its there */
1370 { /* found it so call the fn & return its value */
1371 lua_pushvalue(L,1); /* the userdata */
1372 lua_pushvalue(L,2); /* the parameter */
1373 lua_pushvalue(L,3); /* the value */
1374 lua_call(L,3,0); /* 3 values in ,0 out */
1375 lua_remove(L,-2); /* stack tidy, remove metatable */
1381 /* the class.destruct method called by the interpreter */
1382 SWIGINTERN int SWIG_Lua_class_destruct(lua_State* L)
1384 /* there should be 1 params passed in
1385 (1) userdata (not the meta table) */
1386 swig_lua_userdata* usr;
1387 swig_lua_class* clss;
1388 assert(lua_isuserdata(L,-1)); /* just in case */
1389 usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
1390 /* if must be destroyed & has a destructor */
1391 if (usr->own) /* if must be destroyed */
1393 clss=(swig_lua_class*)usr->type->clientdata; /* get the class */
1394 if (clss && clss->destructor) /* there is a destroy fn */
1396 clss->destructor(usr->ptr); /* bye bye */
1402 /* the class.__tostring method called by the interpreter and print */
1403 SWIGINTERN int SWIG_Lua_class_tostring(lua_State* L)
1405 /* there should be 1 param passed in
1406 (1) userdata (not the metatable) */
1407 assert(lua_isuserdata(L,1)); /* just in case */
1408 unsigned long userData = (unsigned long)lua_touserdata(L,1); /* get the userdata address for later */
1409 lua_getmetatable(L,1); /* get the meta table */
1410 assert(lua_istable(L,-1)); /* just in case */
1412 lua_getfield(L, -1, ".type");
1413 const char* className = lua_tostring(L, -1);
1416 sprintf(output, "<%s userdata: %lX>", className, userData);
1418 lua_pushstring(L, (const char*)output);
1422 /* to manually disown some userdata */
1423 SWIGINTERN int SWIG_Lua_class_disown(lua_State* L)
1425 /* there should be 1 params passed in
1426 (1) userdata (not the meta table) */
1427 swig_lua_userdata* usr;
1428 assert(lua_isuserdata(L,-1)); /* just in case */
1429 usr=(swig_lua_userdata*)lua_touserdata(L,-1); /* get it */
1431 usr->own = 0; /* clear our ownership */
1435 /* Constructor proxy. Used when class name entry in module is not class constructor,
1436 but special table instead. */
1437 SWIGINTERN int SWIG_Lua_constructor_proxy(lua_State* L)
1439 /* unlimited number of parameters
1440 First one is our proxy table and we should remove it
1441 Other we should pass to real constructor
1443 assert(lua_istable(L,1));
1444 lua_pushstring(L,".constructor");
1446 assert(!lua_isnil(L,-1));
1447 lua_replace(L,1); /* replace our table with real constructor */
1448 lua_call(L,lua_gettop(L)-1,1);
1452 /* gets the swig class registry (or creates it) */
1453 SWIGINTERN void SWIG_Lua_get_class_registry(lua_State* L)
1455 /* add this all into the swig registry: */
1456 lua_pushstring(L,"SWIG");
1457 lua_rawget(L,LUA_REGISTRYINDEX); /* get the registry */
1458 if (!lua_istable(L,-1)) /* not there */
1459 { /* must be first time, so add it */
1460 lua_pop(L,1); /* remove the result */
1461 lua_pushstring(L,"SWIG");
1463 lua_rawset(L,LUA_REGISTRYINDEX);
1465 lua_pushstring(L,"SWIG");
1466 lua_rawget(L,LUA_REGISTRYINDEX);
1470 /* helper fn to get the classes metatable from the register */
1471 SWIGINTERN void SWIG_Lua_get_class_metatable(lua_State* L,const char* cname)
1473 SWIG_Lua_get_class_registry(L); /* get the registry */
1474 lua_pushstring(L,cname); /* get the name */
1475 lua_rawget(L,-2); /* get it */
1476 lua_remove(L,-2); /* tidy up (remove registry) */
1479 /* helper add a variable to a registered class */
1480 SWIGINTERN void SWIG_Lua_add_class_variable(lua_State* L,const char* name,lua_CFunction getFn,lua_CFunction setFn)
1482 assert(lua_istable(L,-1)); /* just in case */
1483 SWIG_Lua_get_table(L,".get"); /* find the .get table */
1484 assert(lua_istable(L,-1)); /* just in case */
1485 SWIG_Lua_add_function(L,name,getFn);
1486 lua_pop(L,1); /* tidy stack (remove table) */
1489 SWIG_Lua_get_table(L,".set"); /* find the .set table */
1490 assert(lua_istable(L,-1)); /* just in case */
1491 SWIG_Lua_add_function(L,name,setFn);
1492 lua_pop(L,1); /* tidy stack (remove table) */
1496 /* helper to recursively add class static details (static attributes, operations and constants) */
1497 SWIGINTERN void SWIG_Lua_add_class_static_details(lua_State* L, swig_lua_class* clss)
1500 /* The class namespace table must be on the top of the stack */
1501 assert(lua_istable(L,-1));
1502 /* call all the base classes first: we can then override these later: */
1503 for(i=0;clss->bases[i];i++)
1505 SWIG_Lua_add_class_static_details(L,clss->bases[i]);
1508 SWIG_Lua_add_namespace_details(L, &clss->cls_static);
1511 /* helper to recursively add class details (attributes & operations) */
1512 SWIGINTERN void SWIG_Lua_add_class_details(lua_State* L,swig_lua_class* clss)
1515 /* call all the base classes first: we can then override these later: */
1516 for(i=0;clss->bases[i];i++)
1518 SWIG_Lua_add_class_details(L,clss->bases[i]);
1521 for(i=0;clss->attributes[i].name;i++){
1522 SWIG_Lua_add_class_variable(L,clss->attributes[i].name,clss->attributes[i].getmethod,clss->attributes[i].setmethod);
1524 /* add methods to the metatable */
1525 SWIG_Lua_get_table(L,".fn"); /* find the .fn table */
1526 assert(lua_istable(L,-1)); /* just in case */
1527 for(i=0;clss->methods[i].name;i++){
1528 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
1530 lua_pop(L,1); /* tidy stack (remove table) */
1531 /* add operator overloads
1532 these look ANY method which start with "__" and assume they
1533 are operator overloads & add them to the metatable
1534 (this might mess up is someone defines a method __gc (the destructor)*/
1535 for(i=0;clss->methods[i].name;i++){
1536 if (clss->methods[i].name[0]=='_' && clss->methods[i].name[1]=='_'){
1537 SWIG_Lua_add_function(L,clss->methods[i].name,clss->methods[i].method);
1542 /* set up the base classes pointers.
1543 Each class structure has a list of pointers to the base class structures.
1544 This function fills them.
1545 It cannot be done at compile time, as this will not work with hireachies
1546 spread over more than one swig file.
1547 Therefore it must be done at runtime, querying the SWIG type system.
1549 SWIGINTERN void SWIG_Lua_init_base_class(lua_State* L,swig_lua_class* clss)
1552 swig_module_info* module=SWIG_GetModule(L);
1553 for(i=0;clss->base_names[i];i++)
1555 if (clss->bases[i]==0) /* not found yet */
1557 /* lookup and cache the base class */
1558 swig_type_info *info = SWIG_TypeQueryModule(module,module,clss->base_names[i]);
1559 if (info) clss->bases[i] = (swig_lua_class *) info->clientdata;
1564 /* Register class static methods,attributes etc as well as constructor proxy */
1565 SWIGINTERN void SWIG_Lua_class_register_static(lua_State* L, swig_lua_class* clss)
1567 lua_checkstack(L,5); /* just in case */
1568 assert(lua_istable(L,-1)); /* just in case */
1569 assert(strcmp(clss->name, clss->cls_static.name) == 0); /* in class those 2 must be equal */
1571 SWIG_Lua_namespace_register(L,&clss->cls_static);
1573 SWIG_Lua_get_table(L,clss->name); // Get namespace table back
1574 assert(lua_istable(L,-1)); /* just in case */
1576 /* add its constructor to module with the name of the class
1577 so you can do MyClass(...) as well as new_MyClass(...)
1578 BUT only if a constructor is defined
1579 (this overcomes the problem of pure virtual classes without constructors)*/
1580 if (clss->constructor)
1582 SWIG_Lua_add_function(L,".constructor", clss->constructor);
1583 lua_getmetatable(L,-1);
1584 assert(lua_istable(L,-1)); /* just in case */
1585 SWIG_Lua_add_function(L,"__call", SWIG_Lua_constructor_proxy);
1589 assert(lua_istable(L,-1)); /* just in case */
1590 SWIG_Lua_add_class_static_details(L, clss);
1596 /* performs the entire class registration process */
1597 SWIGINTERN void SWIG_Lua_class_register(lua_State* L,swig_lua_class* clss)
1599 SWIG_Lua_class_register_static(L,clss);
1601 SWIG_Lua_get_class_registry(L); /* get the registry */
1602 lua_pushstring(L,clss->name); /* get the name */
1603 lua_newtable(L); /* create the metatable */
1604 /* add string of class name called ".type" */
1605 lua_pushstring(L,".type");
1606 lua_pushstring(L,clss->name);
1608 /* add a table called ".get" */
1609 lua_pushstring(L,".get");
1612 /* add a table called ".set" */
1613 lua_pushstring(L,".set");
1616 /* add a table called ".fn" */
1617 lua_pushstring(L,".fn");
1619 /* add manual disown method */
1620 SWIG_Lua_add_function(L,"__disown",SWIG_Lua_class_disown);
1622 /* add accessor fns for using the .get,.set&.fn */
1623 SWIG_Lua_add_function(L,"__index",SWIG_Lua_class_get);
1624 SWIG_Lua_add_function(L,"__newindex",SWIG_Lua_class_set);
1625 SWIG_Lua_add_function(L,"__gc",SWIG_Lua_class_destruct);
1626 /* add tostring method for better output */
1627 SWIG_Lua_add_function(L,"__tostring",SWIG_Lua_class_tostring);
1629 lua_rawset(L,-3); /* metatable into registry */
1630 lua_pop(L,1); /* tidy stack (remove registry) */
1632 SWIG_Lua_get_class_metatable(L,clss->name);
1633 SWIG_Lua_add_class_details(L,clss); /* recursive adding of details (atts & ops) */
1634 lua_pop(L,1); /* tidy stack (remove class metatable) */
1637 /* -----------------------------------------------------------------------------
1638 * Class/structure conversion fns
1639 * ----------------------------------------------------------------------------- */
1641 /* helper to add metatable to new lua object */
1642 SWIGINTERN void _SWIG_Lua_AddMetatable(lua_State* L,swig_type_info *type)
1644 if (type->clientdata) /* there is clientdata: so add the metatable */
1646 SWIG_Lua_get_class_metatable(L,((swig_lua_class*)(type->clientdata))->name);
1647 if (lua_istable(L,-1))
1649 lua_setmetatable(L,-2);
1658 /* pushes a new object into the lua stack */
1659 SWIGRUNTIME void SWIG_Lua_NewPointerObj(lua_State* L,void* ptr,swig_type_info *type, int own)
1661 swig_lua_userdata* usr;
1666 usr=(swig_lua_userdata*)lua_newuserdata(L,sizeof(swig_lua_userdata)); /* get data */
1667 usr->ptr=ptr; /* set the ptr */
1670 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
1671 _SWIG_Lua_AddMetatable(L,type); /* add metatable */
1675 /* takes a object from the lua stack & converts it into an object of the correct type
1677 SWIGRUNTIME int SWIG_Lua_ConvertPtr(lua_State* L,int index,void** ptr,swig_type_info *type,int flags)
1679 swig_lua_userdata* usr;
1680 swig_cast_info *cast;
1681 if (lua_isnil(L,index)){*ptr=0; return SWIG_OK;} /* special case: lua nil => NULL pointer */
1682 usr=(swig_lua_userdata*)lua_touserdata(L,index); /* get data */
1685 if (flags & SWIG_POINTER_DISOWN) /* must disown the object */
1689 if (!type) /* special cast void*, no casting fn */
1692 return SWIG_OK; /* ok */
1694 cast=SWIG_TypeCheckStruct(usr->type,type); /* performs normal type checking */
1698 *ptr=SWIG_TypeCast(cast,usr->ptr,&newmemory);
1699 assert(!newmemory); /* newmemory handling not yet implemented */
1700 return SWIG_OK; /* ok */
1703 return SWIG_ERROR; /* error */
1706 SWIGRUNTIME void* SWIG_Lua_MustGetPtr(lua_State* L,int index,swig_type_info *type,int flags,
1707 int argnum,const char* func_name){
1709 if (!SWIG_IsOK(SWIG_ConvertPtr(L,index,&result,type,flags))){
1710 luaL_error (L,"Error in %s, expected a %s at argument number %d\n",
1711 func_name,(type && type->str)?type->str:"void*",argnum);
1716 /* pushes a packed userdata. user for member fn pointers only */
1717 SWIGRUNTIME void SWIG_Lua_NewPackedObj(lua_State* L,void* ptr,size_t size,swig_type_info *type)
1719 swig_lua_rawdata* raw;
1720 assert(ptr); /* not acceptable to pass in a NULL value */
1721 raw=(swig_lua_rawdata*)lua_newuserdata(L,sizeof(swig_lua_rawdata)-1+size); /* alloc data */
1724 memcpy(raw->data,ptr,size); /* copy the data */
1725 _SWIG_Lua_AddMetatable(L,type); /* add metatable */
1728 /* converts a packed userdata. user for member fn pointers only */
1729 SWIGRUNTIME int SWIG_Lua_ConvertPacked(lua_State* L,int index,void* ptr,size_t size,swig_type_info *type)
1731 swig_lua_rawdata* raw;
1732 raw=(swig_lua_rawdata*)lua_touserdata(L,index); /* get data */
1733 if (!raw) return SWIG_ERROR; /* error */
1734 if (type==0 || type==raw->type) /* void* or identical type */
1736 memcpy(ptr,raw->data,size); /* copy it */
1737 return SWIG_OK; /* ok */
1739 return SWIG_ERROR; /* error */
1742 /* a function to get the typestring of a piece of data */
1743 SWIGRUNTIME const char *SWIG_Lua_typename(lua_State *L, int tp)
1745 swig_lua_userdata* usr;
1746 if (lua_isuserdata(L,tp))
1748 usr=(swig_lua_userdata*)lua_touserdata(L,tp); /* get data */
1749 if (usr && usr->type && usr->type->str)
1750 return usr->type->str;
1751 return "userdata (unknown type)";
1753 return lua_typename(L,lua_type(L,tp));
1756 /* lua callable function to get the userdata's type */
1757 SWIGRUNTIME int SWIG_Lua_type(lua_State* L)
1759 lua_pushstring(L,SWIG_Lua_typename(L,1));
1763 /* lua callable function to compare userdata's value
1764 the issue is that two userdata may point to the same thing
1765 but to lua, they are different objects */
1766 SWIGRUNTIME int SWIG_Lua_equal(lua_State* L)
1769 swig_lua_userdata *usr1,*usr2;
1770 if (!lua_isuserdata(L,1) || !lua_isuserdata(L,2)) /* just in case */
1771 return 0; /* nil reply */
1772 usr1=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
1773 usr2=(swig_lua_userdata*)lua_touserdata(L,2); /* get data */
1774 /*result=(usr1->ptr==usr2->ptr && usr1->type==usr2->type); only works if type is the same*/
1775 result=(usr1->ptr==usr2->ptr);
1776 lua_pushboolean(L,result);
1780 /* -----------------------------------------------------------------------------
1781 * global variable support code: class/struct typemap functions
1782 * ----------------------------------------------------------------------------- */
1784 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
1785 /* Install Constants */
1787 SWIG_Lua_InstallConstants(lua_State* L, swig_lua_const_info constants[]) {
1789 for (i = 0; constants[i].type; i++) {
1790 switch(constants[i].type) {
1792 lua_pushstring(L,constants[i].name);
1793 lua_pushnumber(L,(lua_Number)constants[i].lvalue);
1796 case SWIG_LUA_FLOAT:
1797 lua_pushstring(L,constants[i].name);
1798 lua_pushnumber(L,(lua_Number)constants[i].dvalue);
1802 lua_pushstring(L,constants[i].name);
1803 lua_pushfstring(L,"%c",(char)constants[i].lvalue);
1806 case SWIG_LUA_STRING:
1807 lua_pushstring(L,constants[i].name);
1808 lua_pushstring(L,(char *) constants[i].pvalue);
1811 case SWIG_LUA_POINTER:
1812 lua_pushstring(L,constants[i].name);
1813 SWIG_NewPointerObj(L,constants[i].pvalue, *(constants[i]).ptype,0);
1816 case SWIG_LUA_BINARY:
1817 lua_pushstring(L,constants[i].name);
1818 SWIG_NewMemberObj(L,constants[i].pvalue,constants[i].lvalue,*(constants[i]).ptype);
1828 /* -----------------------------------------------------------------------------
1829 * executing lua code from within the wrapper
1830 * ----------------------------------------------------------------------------- */
1832 #ifndef SWIG_DOSTRING_FAIL /* Allows redefining of error function */
1833 #define SWIG_DOSTRING_FAIL(S) fprintf(stderr,"%s\n",S)
1835 /* Executes a C string in Lua which is a really simple way of calling lua from C
1836 Unfortunately lua keeps changing its APIs, so we need a conditional compile
1837 In lua 5.0.X its lua_dostring()
1838 In lua 5.1.X its luaL_dostring()
1841 SWIG_Lua_dostring(lua_State *L, const char* str) {
1843 if (str==0 || str[0]==0) return 0; /* nothing to do */
1844 top=lua_gettop(L); /* save stack */
1845 #if (defined(LUA_VERSION_NUM) && (LUA_VERSION_NUM>=501))
1846 ok=luaL_dostring(L,str); /* looks like this is lua 5.1.X or later, good */
1848 ok=lua_dostring(L,str); /* might be lua 5.0.x, using lua_dostring */
1851 SWIG_DOSTRING_FAIL(lua_tostring(L,-1));
1853 lua_settop(L,top); /* restore the stack */
1861 /* ------------------------------ end luarun.swg ------------------------------ */
1864 /* -------- TYPES TABLE (BEGIN) -------- */
1866 #define SWIGTYPE_p_Addr swig_types[0]
1867 #define SWIGTYPE_p_Device swig_types[1]
1868 #define SWIGTYPE_p_Generic_device swig_types[2]
1869 #define SWIGTYPE_p_Gpio_resource swig_types[3]
1870 #define SWIGTYPE_p_Hw__Device swig_types[4]
1871 #define SWIGTYPE_p_Hw__Device__Prop_val swig_types[5]
1872 #define SWIGTYPE_p_Hw__Device_factory swig_types[6]
1873 #define SWIGTYPE_p_L4Re__Rm__Auto_regionT_l4_addr_t_t swig_types[7]
1874 #define SWIGTYPE_p_Mmio_data_space swig_types[8]
1875 #define SWIGTYPE_p_Resource swig_types[9]
1876 #define SWIGTYPE_p_Resource_provider swig_types[10]
1877 #define SWIGTYPE_p_Resource_space swig_types[11]
1878 #define SWIGTYPE_p_Root_resource swig_types[12]
1879 #define SWIGTYPE_p_Size swig_types[13]
1880 #define SWIGTYPE_p_Vi__Dev_factory swig_types[14]
1881 #define SWIGTYPE_p_Vi__Device swig_types[15]
1882 #define SWIGTYPE_p_l4vbus_device_handle_t swig_types[16]
1883 #define SWIGTYPE_p_std__string swig_types[17]
1884 static swig_type_info *swig_types[19];
1885 static swig_module_info swig_module = {swig_types, 18, 0, 0, 0, 0};
1886 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1887 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1889 /* -------- TYPES TABLE (END) -------- */
1891 #define SWIG_name "Io"
1892 #define SWIG_init luaopen_Io
1893 #define SWIG_init_user luaopen_Io_user
1895 #define SWIG_LUACODE luaopen_Io_luacode
1898 typedef struct{} LANGUAGE_OBJ;
1902 #ifdef __cplusplus /* generic alloc/dealloc fns*/
1903 #define SWIG_ALLOC_ARRAY(TYPE,LEN) new TYPE[LEN]
1904 #define SWIG_FREE_ARRAY(PTR) delete[] PTR
1906 #define SWIG_ALLOC_ARRAY(TYPE,LEN) (TYPE *)malloc(LEN*sizeof(TYPE))
1907 #define SWIG_FREE_ARRAY(PTR) free(PTR)
1909 /* counting the size of arrays:*/
1910 SWIGINTERN int SWIG_itable_size(lua_State* L, int index)
1914 lua_rawgeti(L,index,n+1);
1915 if (lua_isnil(L,-1))break;
1923 SWIGINTERN int SWIG_table_size(lua_State* L, int index)
1926 lua_pushnil(L); /* first key*/
1927 while (lua_next(L, index) != 0) {
1929 lua_pop(L, 1); /* removes `value'; keeps `key' for next iteration*/
1934 /* super macro to declare array typemap helper fns */
1935 #define SWIG_DECLARE_TYPEMAP_ARR_FN(NAME,TYPE)\
1936 SWIGINTERN int SWIG_read_##NAME##_num_array(lua_State* L,int index,TYPE *array,int size){\
1938 for (i = 0; i < size; i++) {\
1939 lua_rawgeti(L,index,i+1);\
1940 if (lua_isnumber(L,-1)){\
1941 array[i] = (TYPE)lua_tonumber(L,-1);\
1950 SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_fixed(lua_State* L, int index, int size){\
1952 if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {\
1953 SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);\
1956 array=SWIG_ALLOC_ARRAY(TYPE,size);\
1957 if (!SWIG_read_##NAME##_num_array(L,index,array,size)){\
1958 SWIG_Lua_pusherrstring(L,"table must contain numbers");\
1959 SWIG_FREE_ARRAY(array);\
1964 SWIGINTERN TYPE* SWIG_get_##NAME##_num_array_var(lua_State* L, int index, int* size)\
1967 if (!lua_istable(L,index)) {\
1968 SWIG_Lua_pusherrstring(L,"expected a table");\
1971 *size=SWIG_itable_size(L,index);\
1973 SWIG_Lua_pusherrstring(L,"table appears to be empty");\
1976 array=SWIG_ALLOC_ARRAY(TYPE,*size);\
1977 if (!SWIG_read_##NAME##_num_array(L,index,array,*size)){\
1978 SWIG_Lua_pusherrstring(L,"table must contain numbers");\
1979 SWIG_FREE_ARRAY(array);\
1984 SWIGINTERN void SWIG_write_##NAME##_num_array(lua_State* L,TYPE *array,int size){\
1987 for (i = 0; i < size; i++){\
1988 lua_pushnumber(L,(lua_Number)array[i]);\
1989 lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/ \
1993 SWIG_DECLARE_TYPEMAP_ARR_FN(schar,signed char);
1994 SWIG_DECLARE_TYPEMAP_ARR_FN(uchar,unsigned char);
1995 SWIG_DECLARE_TYPEMAP_ARR_FN(int,int);
1996 SWIG_DECLARE_TYPEMAP_ARR_FN(uint,unsigned int);
1997 SWIG_DECLARE_TYPEMAP_ARR_FN(short,short);
1998 SWIG_DECLARE_TYPEMAP_ARR_FN(ushort,unsigned short);
1999 SWIG_DECLARE_TYPEMAP_ARR_FN(long,long);
2000 SWIG_DECLARE_TYPEMAP_ARR_FN(ulong,unsigned long);
2001 SWIG_DECLARE_TYPEMAP_ARR_FN(float,float);
2002 SWIG_DECLARE_TYPEMAP_ARR_FN(double,double);
2004 SWIGINTERN int SWIG_read_ptr_array(lua_State* L,int index,void **array,int size,swig_type_info *type){
2006 for (i = 0; i < size; i++) {
2007 lua_rawgeti(L,index,i+1);
2008 if (!lua_isuserdata(L,-1) || SWIG_ConvertPtr(L,-1,&array[i],type,0)==-1){
2016 SWIGINTERN void** SWIG_get_ptr_array_fixed(lua_State* L, int index, int size,swig_type_info *type){
2018 if (!lua_istable(L,index) || SWIG_itable_size(L,index) != size) {
2019 SWIG_Lua_pushferrstring(L,"expected a table of size %d",size);
2022 array=SWIG_ALLOC_ARRAY(void*,size);
2023 if (!SWIG_read_ptr_array(L,index,array,size,type)){
2024 SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
2025 SWIG_FREE_ARRAY(array);
2030 SWIGINTERN void** SWIG_get_ptr_array_var(lua_State* L, int index, int* size,swig_type_info *type){
2032 if (!lua_istable(L,index)) {
2033 SWIG_Lua_pusherrstring(L,"expected a table");
2036 *size=SWIG_itable_size(L,index);
2038 SWIG_Lua_pusherrstring(L,"table appears to be empty");
2041 array=SWIG_ALLOC_ARRAY(void*,*size);
2042 if (!SWIG_read_ptr_array(L,index,array,*size,type)){
2043 SWIG_Lua_pushferrstring(L,"table must contain pointers of type %s",type->name);
2044 SWIG_FREE_ARRAY(array);
2049 SWIGINTERN void SWIG_write_ptr_array(lua_State* L,void **array,int size,swig_type_info *type,int own){
2052 for (i = 0; i < size; i++){
2053 SWIG_NewPointerObj(L,array[i],type,own);
2054 lua_rawseti(L,-2,i+1);/* -1 is the number, -2 is the table*/
2059 #define SWIG_RECURSIVE_DEFINED defined
2065 SWIGINTERN int SWIG_lua_isnilstring(lua_State *L, int idx) {
2066 int ret = lua_isstring(L, idx);
2068 ret = lua_isnil(L, idx);
2073 inline int swig_class(lua_State *L)
2075 char const *name = lua_tostring(L, 1);
2076 SWIG_Lua_get_class_metatable(L, name);
2080 inline int swig_instance_of(lua_State *L)
2082 swig_lua_userdata* usr;
2083 if (lua_isnil(L,1) || !lua_isstring(L,2))
2085 lua_pushboolean(L, false);
2089 char const *type = lua_tostring(L,2);
2091 usr=(swig_lua_userdata*)lua_touserdata(L,1); /* get data */
2094 lua_pushboolean(L, false);
2098 swig_module_info* module=SWIG_GetModule(L);
2099 swig_type_info *to = SWIG_TypeQueryModule(module, module, type);
2102 lua_pushboolean(L, false);
2106 swig_cast_info *iter = to->cast;
2109 if (iter->type == usr->type)
2111 lua_pushboolean(L, true);
2116 lua_pushboolean(L, false);
2122 #include "virt/vdevice.h"
2123 #include "virt/vbus_factory.h"
2124 #include "hw_device.h"
2127 static int is_lua_propval(lua_State *L, int idx)
2129 if (lua_isnumber(L, idx))
2131 if (lua_isstring(L, idx))
2136 static Hw::Device::Prop_val to_lua_propval(lua_State *L, int idx)
2138 if (lua_isnumber(L, idx))
2139 return Hw::Device::Prop_val(lua_tointeger(L, idx));
2140 else if (lua_isstring(L, idx))
2141 return Hw::Device::Prop_val(lua_tostring(L, idx));
2145 int luaopen_Io(lua_State *);
2146 int add_vbus(Vi::Device *dev);
2147 void dump_devs(Device *d);
2150 SWIGINTERN int Generic_device_nresources(Generic_device const *self){
2151 return self->resources()->size();
2153 SWIGINTERN Resource *Generic_device_resource(Generic_device const *self,int idx){
2154 return self->resources()->at(idx);
2156 SWIGINTERN void Vi_Device_set_name(Vi::Device *self,char const *name){ self->name(name); }
2157 SWIGINTERN Hw::Device *Hw_Device_find_by_name(Hw::Device const *self,std::string const &name){
2158 for (Hw::Device::iterator c = self->begin(0);
2159 c != self->end(); ++c)
2160 if (name == (*c)->name())
2165 SWIGINTERN Hw::Device *Hw_Device___getitem(Hw::Device const *self,std::string const &name){
2166 for (Hw::Device::iterator c = self->begin(0);
2167 c != self->end(); ++c)
2168 if (name == (*c)->name())
2173 SWIGINTERN void Hw_Device___setitem(Hw::Device *self,std::string const &name,Hw::Device *dev){
2174 dev->set_name(name);
2175 self->add_child(dev);
2176 if (self->parent() || self == system_bus())
2180 // removed: extern "C" {
2182 static int _wrap_new_string__SWIG_0(lua_State* L) { int SWIG_arg = 0; std::string *result = 0 ;
2183 SWIG_check_num_args("std::string::string",0,0) result = (std::string *)new std::string();
2184 SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2186 static int _wrap_new_string__SWIG_1(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; std::string *result = 0 ;
2187 SWIG_check_num_args("std::string::string",1,1)
2188 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("std::string::string",1,"char const *"); arg1 = (char *)lua_tostring(L, 1);
2189 result = (std::string *)new std::string((char const *)arg1);
2190 SWIG_NewPointerObj(L,result,SWIGTYPE_p_std__string,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2192 static int _wrap_new_string(lua_State* L) { int argc; int argv[2]={ 1,2} ; argc = lua_gettop(L); if (argc == 0) {
2193 return _wrap_new_string__SWIG_0(L);} if (argc == 1) { int _v; { _v = SWIG_lua_isnilstring(L,argv[0]); } if (_v) {
2194 return _wrap_new_string__SWIG_1(L);} } SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_string'\n"
2195 " Possible C/C++ prototypes are:\n" " std::string::string()\n" " std::string::string(char const *)\n");
2196 lua_error(L);return 0; }
2197 static int _wrap_string_size(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = (std::string *) 0 ; unsigned int result;
2198 SWIG_check_num_args("std::string::size",1,1)
2199 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::size",1,"std::string const *");
2200 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
2201 SWIG_fail_ptr("string_size",1,SWIGTYPE_p_std__string); } result = (unsigned int)((std::string const *)arg1)->size();
2202 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2203 static int _wrap_string_length(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = (std::string *) 0 ; unsigned int result;
2204 SWIG_check_num_args("std::string::length",1,1)
2205 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::length",1,"std::string const *");
2206 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
2207 SWIG_fail_ptr("string_length",1,SWIGTYPE_p_std__string); } result = (unsigned int)((std::string const *)arg1)->length();
2208 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2209 static int _wrap_string_empty(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = (std::string *) 0 ; bool result;
2210 SWIG_check_num_args("std::string::empty",1,1)
2211 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::empty",1,"std::string const *");
2212 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
2213 SWIG_fail_ptr("string_empty",1,SWIGTYPE_p_std__string); } result = (bool)((std::string const *)arg1)->empty();
2214 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2215 static int _wrap_string_c_str(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = (std::string *) 0 ; char *result = 0 ;
2216 SWIG_check_num_args("std::string::c_str",1,1)
2217 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::c_str",1,"std::string const *");
2218 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
2219 SWIG_fail_ptr("string_c_str",1,SWIGTYPE_p_std__string); } result = (char *)((std::string const *)arg1)->c_str();
2220 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2221 static int _wrap_string_data(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = (std::string *) 0 ; char *result = 0 ;
2222 SWIG_check_num_args("std::string::data",1,1)
2223 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::data",1,"std::string const *");
2224 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
2225 SWIG_fail_ptr("string_data",1,SWIGTYPE_p_std__string); } result = (char *)((std::string const *)arg1)->data();
2226 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2227 static int _wrap_string_assign(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = (std::string *) 0 ;
2228 char *arg2 = (char *) 0 ; SWIG_check_num_args("std::string::assign",2,2)
2229 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("std::string::assign",1,"std::string *");
2230 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("std::string::assign",2,"char const *");
2231 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_std__string,0))){
2232 SWIG_fail_ptr("string_assign",1,SWIGTYPE_p_std__string); } arg2 = (char *)lua_tostring(L, 2);
2233 (arg1)->assign((char const *)arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2234 static void swig_delete_string(void *obj) {
2235 std::string *arg1 = (std::string *) obj;
2238 static swig_lua_method swig_std_string_methods[] = {
2239 {"size", _wrap_string_size},
2240 {"length", _wrap_string_length},
2241 {"empty", _wrap_string_empty},
2242 {"c_str", _wrap_string_c_str},
2243 {"data", _wrap_string_data},
2244 {"assign", _wrap_string_assign},
2247 static swig_lua_attribute swig_std_string_attributes[] = {
2250 static swig_lua_attribute swig_std_string_cls_attributes[] = {
2253 static swig_lua_method swig_std_string_cls_methods[] = {
2256 static swig_lua_const_info swig_std_string_cls_constants[] = {
2259 static swig_lua_class *swig_std_string_bases[] = {0};
2260 static const char *swig_std_string_base_names[] = {0};
2261 static swig_lua_class _wrap_class_std_string = { "string", &SWIGTYPE_p_std__string,_wrap_new_string, swig_delete_string, swig_std_string_methods, swig_std_string_attributes, { "string", swig_std_string_cls_methods, swig_std_string_cls_attributes, swig_std_string_cls_constants }, swig_std_string_bases, swig_std_string_base_names };
2263 static int _wrap_Resource_irq_is_level_triggered(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2264 bool result; SWIG_check_num_args("Resource::irq_is_level_triggered",1,1)
2265 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::irq_is_level_triggered",1,"Resource const *");
2266 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2267 SWIG_fail_ptr("Resource_irq_is_level_triggered",1,SWIGTYPE_p_Resource); }
2268 result = (bool)((Resource const *)arg1)->irq_is_level_triggered(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
2269 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2270 static int _wrap_Resource_irq_is_low_polarity(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2271 SWIG_check_num_args("Resource::irq_is_low_polarity",1,1)
2272 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::irq_is_low_polarity",1,"Resource const *");
2273 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2274 SWIG_fail_ptr("Resource_irq_is_low_polarity",1,SWIGTYPE_p_Resource); }
2275 result = (bool)((Resource const *)arg1)->irq_is_low_polarity(); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
2276 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2277 static int _wrap_new_Resource__SWIG_0(lua_State* L) { int SWIG_arg = 0; unsigned long arg1 ; Resource *result = 0 ;
2278 SWIG_check_num_args("Resource::Resource",1,1) if(!lua_isnumber(L,1)) SWIG_fail_arg("Resource::Resource",1,"unsigned long");
2279 arg1 = (unsigned long)lua_tointeger(L, 1); result = (Resource *)new Resource(arg1);
2280 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2282 static int _wrap_new_Resource__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *result = 0 ;
2283 SWIG_check_num_args("Resource::Resource",0,0) result = (Resource *)new Resource();
2284 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2286 static int _wrap_new_Resource__SWIG_2(lua_State* L) { int SWIG_arg = 0; unsigned long arg1 ; Resource::Addr arg2 ;
2287 Resource::Addr arg3 ; Resource *result = 0 ; SWIG_check_num_args("Resource::Resource",3,3)
2288 if(!lua_isnumber(L,1)) SWIG_fail_arg("Resource::Resource",1,"unsigned long"); arg1 = (unsigned long)lua_tointeger(L, 1);
2289 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2290 if (lua_isinteger(L, 2)) arg2 = (l4_uint32_t)lua_tointeger(L, 2);else
2291 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2292 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2294 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_uint64_t a = strtoull(s, &e, 0);
2295 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg2 = a; }
2296 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2297 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2298 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2299 if (lua_isinteger(L, 3)) arg3 = (l4_uint32_t)lua_tointeger(L, 3);else
2300 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2301 if (lua_isinteger(L, 3)) arg3 = lua_tointeger(L, 3);else
2303 if (lua_isstring(L, 3)) { char *e = 0; char const *s = lua_tostring(L, 3); l4_uint64_t a = strtoull(s, &e, 0);
2304 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg3 = a; }
2305 else if (lua_isnumber(L, 3)) arg3 = lua_tonumber(L, 3); else {
2306 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 3))); SWIG_fail; }
2307 result = (Resource *)new Resource(arg1,arg2,arg3); SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource,1); SWIG_arg++;
2308 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2309 static int _wrap_new_Resource__SWIG_3(lua_State* L) { int SWIG_arg = 0; unsigned int arg1 ; unsigned long arg2 ;
2310 Resource::Addr arg3 ; Resource::Addr arg4 ; Resource *result = 0 ; SWIG_check_num_args("Resource::Resource",4,4)
2311 if(!lua_isnumber(L,1)) SWIG_fail_arg("Resource::Resource",1,"unsigned int");
2312 if(!lua_isnumber(L,2)) SWIG_fail_arg("Resource::Resource",2,"unsigned long"); arg1 = (unsigned int)lua_tointeger(L, 1); arg2 = (unsigned long)lua_tointeger(L, 2);
2313 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2314 if (lua_isinteger(L, 3)) arg3 = (l4_uint32_t)lua_tointeger(L, 3);else
2315 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2316 if (lua_isinteger(L, 3)) arg3 = lua_tointeger(L, 3);else
2318 if (lua_isstring(L, 3)) { char *e = 0; char const *s = lua_tostring(L, 3); l4_uint64_t a = strtoull(s, &e, 0);
2319 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg3 = a; }
2320 else if (lua_isnumber(L, 3)) arg3 = lua_tonumber(L, 3); else {
2321 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 3))); SWIG_fail; }
2322 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2323 if (lua_isinteger(L, 4)) arg4 = (l4_uint32_t)lua_tointeger(L, 4);else
2324 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2325 if (lua_isinteger(L, 4)) arg4 = lua_tointeger(L, 4);else
2327 if (lua_isstring(L, 4)) { char *e = 0; char const *s = lua_tostring(L, 4); l4_uint64_t a = strtoull(s, &e, 0);
2328 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg4 = a; }
2329 else if (lua_isnumber(L, 4)) arg4 = lua_tonumber(L, 4); else {
2330 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 4))); SWIG_fail; }
2331 result = (Resource *)new Resource(arg1,arg2,arg3,arg4); SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource,1); SWIG_arg++;
2332 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2333 static int _wrap_new_Resource(lua_State* L) { int argc; int argv[5]={ 1,2,3,4,5} ; argc = lua_gettop(L); if (argc == 0) {
2334 return _wrap_new_Resource__SWIG_1(L);} if (argc == 1) { int _v; { _v = lua_isnumber(L,argv[0]); } if (_v) {
2335 return _wrap_new_Resource__SWIG_0(L);} } if (argc == 3) { int _v; { _v = lua_isnumber(L,argv[0]); } if (_v) { {
2336 _v = lua_isnumber(L, argv[1]) || lua_isstring(L, argv[1]); } if (_v) { {
2337 _v = lua_isnumber(L, argv[2]) || lua_isstring(L, argv[2]); } if (_v) { return _wrap_new_Resource__SWIG_2(L);} } } }
2338 if (argc == 4) { int _v; { _v = lua_isnumber(L,argv[0]); } if (_v) { { _v = lua_isnumber(L,argv[1]); } if (_v) { {
2339 _v = lua_isnumber(L, argv[2]) || lua_isstring(L, argv[2]); } if (_v) { {
2340 _v = lua_isnumber(L, argv[3]) || lua_isstring(L, argv[3]); } if (_v) { return _wrap_new_Resource__SWIG_3(L);} } }
2341 } } SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Resource'\n"
2342 " Possible C/C++ prototypes are:\n" " Resource::Resource(unsigned long)\n" " Resource::Resource()\n"
2343 " Resource::Resource(unsigned long,Resource::Addr,Resource::Addr)\n"
2344 " Resource::Resource(unsigned int,unsigned long,Resource::Addr,Resource::Addr)\n"); lua_error(L);return 0; }
2345 static int _wrap_Resource_flags(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; unsigned long result;
2346 SWIG_check_num_args("Resource::flags",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::flags",1,"Resource const *");
2347 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2348 SWIG_fail_ptr("Resource_flags",1,SWIGTYPE_p_Resource); } result = (unsigned long)((Resource const *)arg1)->flags();
2349 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2350 static int _wrap_Resource_add_flags(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; unsigned long arg2 ;
2351 SWIG_check_num_args("Resource::add_flags",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::add_flags",1,"Resource *");
2352 if(!lua_isnumber(L,2)) SWIG_fail_arg("Resource::add_flags",2,"unsigned long");
2353 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2354 SWIG_fail_ptr("Resource_add_flags",1,SWIGTYPE_p_Resource); } arg2 = (unsigned long)lua_tointeger(L, 2);
2355 (arg1)->add_flags(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2356 static int _wrap_Resource_del_flags(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; unsigned long arg2 ;
2357 SWIG_check_num_args("Resource::del_flags",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::del_flags",1,"Resource *");
2358 if(!lua_isnumber(L,2)) SWIG_fail_arg("Resource::del_flags",2,"unsigned long");
2359 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2360 SWIG_fail_ptr("Resource_del_flags",1,SWIGTYPE_p_Resource); } arg2 = (unsigned long)lua_tointeger(L, 2);
2361 (arg1)->del_flags(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2362 static int _wrap_Resource_hierarchical(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2363 SWIG_check_num_args("Resource::hierarchical",1,1)
2364 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::hierarchical",1,"Resource const *");
2365 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2366 SWIG_fail_ptr("Resource_hierarchical",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->hierarchical();
2367 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2368 static int _wrap_Resource_disabled(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2369 SWIG_check_num_args("Resource::disabled",1,1)
2370 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::disabled",1,"Resource const *");
2371 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2372 SWIG_fail_ptr("Resource_disabled",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->disabled();
2373 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2374 static int _wrap_Resource_prefetchable(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2375 SWIG_check_num_args("Resource::prefetchable",1,1)
2376 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::prefetchable",1,"Resource const *");
2377 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2378 SWIG_fail_ptr("Resource_prefetchable",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->prefetchable();
2379 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2380 static int _wrap_Resource_empty(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2381 SWIG_check_num_args("Resource::empty",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::empty",1,"Resource const *");
2382 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2383 SWIG_fail_ptr("Resource_empty",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->empty();
2384 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2385 static int _wrap_Resource_fixed_addr(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2386 SWIG_check_num_args("Resource::fixed_addr",1,1)
2387 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::fixed_addr",1,"Resource const *");
2388 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2389 SWIG_fail_ptr("Resource_fixed_addr",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->fixed_addr();
2390 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2391 static int _wrap_Resource_fixed_size(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2392 SWIG_check_num_args("Resource::fixed_size",1,1)
2393 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::fixed_size",1,"Resource const *");
2394 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2395 SWIG_fail_ptr("Resource_fixed_size",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->fixed_size();
2396 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2397 static int _wrap_Resource_relative(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2398 SWIG_check_num_args("Resource::relative",1,1)
2399 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::relative",1,"Resource const *");
2400 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2401 SWIG_fail_ptr("Resource_relative",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->relative();
2402 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2403 static int _wrap_Resource_type(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; unsigned int result;
2404 SWIG_check_num_args("Resource::type",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::type",1,"Resource const *");
2405 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2406 SWIG_fail_ptr("Resource_type",1,SWIGTYPE_p_Resource); } result = (unsigned int)((Resource const *)arg1)->type();
2407 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2408 static int _wrap_Resource_lt_compare(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2409 Resource *arg2 = (Resource *) 0 ; bool result; SWIG_check_num_args("Resource::lt_compare",2,2)
2410 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::lt_compare",1,"Resource const *");
2411 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Resource::lt_compare",2,"Resource const *");
2412 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2413 SWIG_fail_ptr("Resource_lt_compare",1,SWIGTYPE_p_Resource); }
2414 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Resource,0))){
2415 SWIG_fail_ptr("Resource_lt_compare",2,SWIGTYPE_p_Resource); }
2416 result = (bool)((Resource const *)arg1)->lt_compare((Resource const *)arg2); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
2417 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2418 static int _wrap_Resource_str_to_id(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ; l4_uint32_t result;
2419 SWIG_check_num_args("Resource::str_to_id",1,1)
2420 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("Resource::str_to_id",1,"char const *"); arg1 = (char *)lua_tostring(L, 1);
2421 result = Resource::str_to_id((char const *)arg1); lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail;
2422 fail: lua_error(L); return SWIG_arg; }
2423 static int _wrap_Resource_set_id__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; l4_uint32_t arg2 ;
2424 SWIG_check_num_args("Resource::set_id",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::set_id",1,"Resource *");
2425 if(!lua_isnumber(L,2)) SWIG_fail_arg("Resource::set_id",2,"l4_uint32_t");
2426 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2427 SWIG_fail_ptr("Resource_set_id",1,SWIGTYPE_p_Resource); } arg2 = (l4_uint32_t)lua_tointeger(L, 2); (arg1)->set_id(arg2);
2428 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2429 static int _wrap_Resource_set_id__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2430 char *arg2 = (char *) 0 ; SWIG_check_num_args("Resource::set_id",2,2)
2431 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::set_id",1,"Resource *");
2432 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Resource::set_id",2,"char const *");
2433 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2434 SWIG_fail_ptr("Resource_set_id",1,SWIGTYPE_p_Resource); } arg2 = (char *)lua_tostring(L, 2);
2435 (arg1)->set_id((char const *)arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2436 static int _wrap_Resource_set_id(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 2) { int _v;
2437 { void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2438 _v = 0; } else { _v = 1; } } if (_v) { { _v = lua_isnumber(L, argv[1]);} if (_v) {
2439 return _wrap_Resource_set_id__SWIG_0(L);} } } if (argc == 2) { int _v; { void *ptr;
2440 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2441 else { _v = 1; } } if (_v) { { _v = SWIG_lua_isnilstring(L,argv[1]); } if (_v) {
2442 return _wrap_Resource_set_id__SWIG_1(L);} } }
2443 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_set_id'\n" " Possible C/C++ prototypes are:\n"
2444 " Resource::set_id(l4_uint32_t)\n" " Resource::set_id(char const *)\n"); lua_error(L);return 0; }
2445 static int _wrap_Resource_id(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; l4_uint32_t result;
2446 SWIG_check_num_args("Resource::id",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::id",1,"Resource const *");
2447 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2448 SWIG_fail_ptr("Resource_id",1,SWIGTYPE_p_Resource); } result = ((Resource const *)arg1)->id();
2449 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2450 static int _wrap_Resource_set_empty__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool arg2 ;
2451 SWIG_check_num_args("Resource::set_empty",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::set_empty",1,"Resource *");
2452 if(!lua_isboolean(L,2)) SWIG_fail_arg("Resource::set_empty",2,"bool");
2453 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2454 SWIG_fail_ptr("Resource_set_empty",1,SWIGTYPE_p_Resource); } arg2 = (lua_toboolean(L, 2)!=0); (arg1)->set_empty(arg2);
2455 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2456 static int _wrap_Resource_disable(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2457 SWIG_check_num_args("Resource::disable",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::disable",1,"Resource *");
2458 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2459 SWIG_fail_ptr("Resource_disable",1,SWIGTYPE_p_Resource); } (arg1)->disable(); return SWIG_arg; if(0) SWIG_fail; fail:
2460 lua_error(L); return SWIG_arg; }
2461 static int _wrap_Resource_enable(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2462 SWIG_check_num_args("Resource::enable",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::enable",1,"Resource *");
2463 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2464 SWIG_fail_ptr("Resource_enable",1,SWIGTYPE_p_Resource); } (arg1)->enable(); return SWIG_arg; if(0) SWIG_fail; fail:
2465 lua_error(L); return SWIG_arg; }
2466 static int _wrap_Resource_provided(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2467 Resource_space *result = 0 ; SWIG_check_num_args("Resource::provided",1,1)
2468 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::provided",1,"Resource const *");
2469 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2470 SWIG_fail_ptr("Resource_provided",1,SWIGTYPE_p_Resource); }
2471 result = (Resource_space *)((Resource const *)arg1)->provided();
2472 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource_space,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2474 static int _wrap_Resource_dump__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2475 char *arg2 = (char *) 0 ; int arg3 ; SWIG_check_num_args("Resource::dump",3,3)
2476 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::dump",1,"Resource const *");
2477 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Resource::dump",2,"char const *");
2478 if(!lua_isnumber(L,3)) SWIG_fail_arg("Resource::dump",3,"int");
2479 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2480 SWIG_fail_ptr("Resource_dump",1,SWIGTYPE_p_Resource); } arg2 = (char *)lua_tostring(L, 2); arg3 = (int)lua_tointeger(L, 3);
2481 ((Resource const *)arg1)->dump((char const *)arg2,arg3); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2483 static int _wrap_Resource_dump__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; int arg2 ;
2484 SWIG_check_num_args("Resource::dump",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::dump",1,"Resource const *");
2485 if(!lua_isnumber(L,2)) SWIG_fail_arg("Resource::dump",2,"int");
2486 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2487 SWIG_fail_ptr("Resource_dump",1,SWIGTYPE_p_Resource); } arg2 = (int)lua_tointeger(L, 2);
2488 ((Resource const *)arg1)->dump(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2489 static int _wrap_Resource_dump__SWIG_2(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2490 SWIG_check_num_args("Resource::dump",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::dump",1,"Resource const *");
2491 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2492 SWIG_fail_ptr("Resource_dump",1,SWIGTYPE_p_Resource); } ((Resource const *)arg1)->dump(); return SWIG_arg; if(0) SWIG_fail;
2493 fail: lua_error(L); return SWIG_arg; }
2494 static int _wrap_Resource_dump(lua_State* L) { int argc; int argv[4]={ 1,2,3,4} ; argc = lua_gettop(L); if (argc == 1) { int _v;
2495 { void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2496 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Resource_dump__SWIG_2(L);} } if (argc == 2) { int _v; {
2497 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2498 _v = 0; } else { _v = 1; } } if (_v) { { _v = lua_isnumber(L,argv[1]); } if (_v) {
2499 return _wrap_Resource_dump__SWIG_1(L);} } } if (argc == 3) { int _v; { void *ptr;
2500 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2501 else { _v = 1; } } if (_v) { { _v = SWIG_lua_isnilstring(L,argv[1]); } if (_v) { { _v = lua_isnumber(L,argv[2]); }
2502 if (_v) { return _wrap_Resource_dump__SWIG_0(L);} } } }
2503 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_dump'\n" " Possible C/C++ prototypes are:\n"
2504 " Resource::dump(char const *,int) const\n" " Resource::dump(int) const\n" " Resource::dump() const\n");
2505 lua_error(L);return 0; }
2506 static int _wrap_Resource_compatible__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2507 Resource *arg2 = (Resource *) 0 ; bool arg3 ; bool result; SWIG_check_num_args("Resource::compatible",3,3)
2508 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::compatible",1,"Resource const *");
2509 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Resource::compatible",2,"Resource *");
2510 if(!lua_isboolean(L,3)) SWIG_fail_arg("Resource::compatible",3,"bool");
2511 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2512 SWIG_fail_ptr("Resource_compatible",1,SWIGTYPE_p_Resource); }
2513 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Resource,0))){
2514 SWIG_fail_ptr("Resource_compatible",2,SWIGTYPE_p_Resource); } arg3 = (lua_toboolean(L, 3)!=0);
2515 result = (bool)((Resource const *)arg1)->compatible(arg2,arg3); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
2516 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2517 static int _wrap_Resource_compatible__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2518 Resource *arg2 = (Resource *) 0 ; bool result; SWIG_check_num_args("Resource::compatible",2,2)
2519 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::compatible",1,"Resource const *");
2520 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Resource::compatible",2,"Resource *");
2521 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2522 SWIG_fail_ptr("Resource_compatible",1,SWIGTYPE_p_Resource); }
2523 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Resource,0))){
2524 SWIG_fail_ptr("Resource_compatible",2,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->compatible(arg2);
2525 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2526 static int _wrap_Resource_compatible(lua_State* L) { int argc; int argv[4]={ 1,2,3,4} ; argc = lua_gettop(L); if (argc == 2) {
2527 int _v; { void *ptr;
2528 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2529 else { _v = 1; } } if (_v) { { void *ptr;
2530 if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2531 else { _v = 1; } } if (_v) { return _wrap_Resource_compatible__SWIG_1(L);} } } if (argc == 3) { int _v; {
2532 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2533 _v = 0; } else { _v = 1; } } if (_v) { { void *ptr;
2534 if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2535 else { _v = 1; } } if (_v) { { _v = lua_isboolean(L,argv[2]); } if (_v) {
2536 return _wrap_Resource_compatible__SWIG_0(L);} } } }
2537 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_compatible'\n"
2538 " Possible C/C++ prototypes are:\n" " Resource::compatible(Resource *,bool) const\n"
2539 " Resource::compatible(Resource *) const\n"); lua_error(L);return 0; }
2540 static int _wrap_Resource_parent__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2541 Resource *result = 0 ; SWIG_check_num_args("Resource::parent",1,1)
2542 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::parent",1,"Resource const *");
2543 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2544 SWIG_fail_ptr("Resource_parent",1,SWIGTYPE_p_Resource); } result = (Resource *)((Resource const *)arg1)->parent();
2545 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2547 static int _wrap_Resource_parent__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2548 Resource *arg2 = (Resource *) 0 ; SWIG_check_num_args("Resource::parent",2,2)
2549 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::parent",1,"Resource *");
2550 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Resource::parent",2,"Resource *");
2551 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2552 SWIG_fail_ptr("Resource_parent",1,SWIGTYPE_p_Resource); }
2553 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Resource,0))){
2554 SWIG_fail_ptr("Resource_parent",2,SWIGTYPE_p_Resource); } (arg1)->parent(arg2); return SWIG_arg; if(0) SWIG_fail; fail:
2555 lua_error(L); return SWIG_arg; }
2556 static int _wrap_Resource_parent(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) { int _v;
2557 { void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2558 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Resource_parent__SWIG_0(L);} } if (argc == 2) { int _v; {
2559 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2560 _v = 0; } else { _v = 1; } } if (_v) { { void *ptr;
2561 if (SWIG_isptrtype(L,argv[1])==0 || SWIG_ConvertPtr(L,argv[1], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2562 else { _v = 1; } } if (_v) { return _wrap_Resource_parent__SWIG_1(L);} } }
2563 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_parent'\n" " Possible C/C++ prototypes are:\n"
2564 " Resource::parent() const\n" " Resource::parent(Resource *)\n"); lua_error(L);return 0; }
2565 static int _wrap_Resource_set_empty__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2566 SWIG_check_num_args("Resource::set_empty",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::set_empty",1,"Resource *");
2567 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2568 SWIG_fail_ptr("Resource_set_empty",1,SWIGTYPE_p_Resource); } (arg1)->set_empty(); return SWIG_arg; if(0) SWIG_fail; fail:
2569 lua_error(L); return SWIG_arg; }
2570 static int _wrap_Resource_set_empty(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) {
2571 int _v; { void *ptr;
2572 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2573 else { _v = 1; } } if (_v) { return _wrap_Resource_set_empty__SWIG_1(L);} } if (argc == 2) { int _v; { void *ptr;
2574 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2575 else { _v = 1; } } if (_v) { { _v = lua_isboolean(L,argv[1]); } if (_v) { return _wrap_Resource_set_empty__SWIG_0(L);}
2576 } } SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_set_empty'\n"
2577 " Possible C/C++ prototypes are:\n" " Resource::set_empty(bool)\n" " Resource::set_empty()\n"); lua_error(L);return 0; }
2578 static int _wrap_Resource_alignment__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2579 Resource::Size arg2 ; SWIG_check_num_args("Resource::alignment",2,2)
2580 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::alignment",1,"Resource *");
2581 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2582 SWIG_fail_ptr("Resource_alignment",1,SWIGTYPE_p_Resource); }
2583 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2584 if (lua_isinteger(L, 2)) arg2 = (l4_int32_t)lua_tointeger(L, 2);else
2585 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2586 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2588 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_int64_t a = strtoll(s, &e, 0);
2589 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoll error '%s'", s); SWIG_fail; } arg2 = a; }
2590 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2591 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2592 (arg1)->alignment(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2593 static int _wrap_Resource_valid(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2594 SWIG_check_num_args("Resource::valid",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::valid",1,"Resource const *");
2595 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2596 SWIG_fail_ptr("Resource_valid",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->valid();
2597 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2598 static int _wrap_Resource_validate(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2599 SWIG_check_num_args("Resource::validate",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::validate",1,"Resource *");
2600 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2601 SWIG_fail_ptr("Resource_validate",1,SWIGTYPE_p_Resource); } (arg1)->validate(); return SWIG_arg; if(0) SWIG_fail; fail:
2602 lua_error(L); return SWIG_arg; }
2603 static int _wrap_Resource_start__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2604 Resource::Addr result; SWIG_check_num_args("Resource::start",1,1)
2605 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::start",1,"Resource const *");
2606 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2607 SWIG_fail_ptr("Resource_start",1,SWIGTYPE_p_Resource); } result = ((Resource const *)arg1)->start();
2608 lua_pushfstring(L, "0x%llx", result); ++SWIG_arg; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2609 static int _wrap_Resource_end__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; Resource::Addr result;
2610 SWIG_check_num_args("Resource::end",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::end",1,"Resource const *");
2611 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2612 SWIG_fail_ptr("Resource_end",1,SWIGTYPE_p_Resource); } result = ((Resource const *)arg1)->end();
2613 lua_pushfstring(L, "0x%llx", result); ++SWIG_arg; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2614 static int _wrap_Resource_size__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2615 Resource::Size result; SWIG_check_num_args("Resource::size",1,1)
2616 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::size",1,"Resource const *");
2617 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2618 SWIG_fail_ptr("Resource_size",1,SWIGTYPE_p_Resource); } result = ((Resource const *)arg1)->size();
2619 lua_pushfstring(L, "0x%llx", result); ++SWIG_arg; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2620 static int _wrap_Resource_contains(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; Resource *arg2 = 0 ;
2621 bool result; SWIG_check_num_args("Resource::contains",2,2)
2622 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::contains",1,"Resource const *");
2623 if(!lua_isuserdata(L,2)) SWIG_fail_arg("Resource::contains",2,"Resource const &");
2624 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2625 SWIG_fail_ptr("Resource_contains",1,SWIGTYPE_p_Resource); }
2626 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Resource,0))){
2627 SWIG_fail_ptr("Resource_contains",2,SWIGTYPE_p_Resource); }
2628 result = (bool)((Resource const *)arg1)->contains((Resource const &)*arg2); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
2629 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2630 static int _wrap_Resource_start__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2631 Resource::Addr arg2 ; SWIG_check_num_args("Resource::start",2,2)
2632 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::start",1,"Resource *");
2633 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2634 SWIG_fail_ptr("Resource_start",1,SWIGTYPE_p_Resource); }
2635 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2636 if (lua_isinteger(L, 2)) arg2 = (l4_uint32_t)lua_tointeger(L, 2);else
2637 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2638 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2640 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_uint64_t a = strtoull(s, &e, 0);
2641 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg2 = a; }
2642 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2643 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2644 (arg1)->start(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2645 static int _wrap_Resource_start(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) { int _v;
2646 { void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2647 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Resource_start__SWIG_0(L);} } if (argc == 2) { int _v; {
2648 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2649 _v = 0; } else { _v = 1; } } if (_v) { { _v = lua_isnumber(L, argv[1]) || lua_isstring(L, argv[1]); } if (_v) {
2650 return _wrap_Resource_start__SWIG_1(L);} } }
2651 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_start'\n" " Possible C/C++ prototypes are:\n"
2652 " Resource::start() const\n" " Resource::start(Resource::Addr)\n"); lua_error(L);return 0; }
2653 static int _wrap_Resource_end__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; Resource::Addr arg2 ;
2654 SWIG_check_num_args("Resource::end",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::end",1,"Resource *");
2655 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2656 SWIG_fail_ptr("Resource_end",1,SWIGTYPE_p_Resource); }
2657 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2658 if (lua_isinteger(L, 2)) arg2 = (l4_uint32_t)lua_tointeger(L, 2);else
2659 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2660 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2662 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_uint64_t a = strtoull(s, &e, 0);
2663 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg2 = a; }
2664 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2665 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2666 (arg1)->end(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2667 static int _wrap_Resource_end(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) { int _v; {
2668 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2669 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Resource_end__SWIG_0(L);} } if (argc == 2) { int _v; {
2670 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2671 _v = 0; } else { _v = 1; } } if (_v) { { _v = lua_isnumber(L, argv[1]) || lua_isstring(L, argv[1]); } if (_v) {
2672 return _wrap_Resource_end__SWIG_1(L);} } }
2673 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_end'\n" " Possible C/C++ prototypes are:\n"
2674 " Resource::end() const\n" " Resource::end(Resource::Addr)\n"); lua_error(L);return 0; }
2675 static int _wrap_Resource_size__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; Resource::Size arg2 ;
2676 SWIG_check_num_args("Resource::size",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::size",1,"Resource *");
2677 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2678 SWIG_fail_ptr("Resource_size",1,SWIGTYPE_p_Resource); }
2679 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2680 if (lua_isinteger(L, 2)) arg2 = (l4_int32_t)lua_tointeger(L, 2);else
2681 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2682 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2684 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_int64_t a = strtoll(s, &e, 0);
2685 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoll error '%s'", s); SWIG_fail; } arg2 = a; }
2686 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2687 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2688 (arg1)->size(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2689 static int _wrap_Resource_size(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) { int _v; {
2690 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2691 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Resource_size__SWIG_0(L);} } if (argc == 2) { int _v; {
2692 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) {
2693 _v = 0; } else { _v = 1; } } if (_v) { { _v = lua_isnumber(L, argv[1]) || lua_isstring(L, argv[1]); } if (_v) {
2694 return _wrap_Resource_size__SWIG_1(L);} } }
2695 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_size'\n" " Possible C/C++ prototypes are:\n"
2696 " Resource::size() const\n" " Resource::size(Resource::Size)\n"); lua_error(L);return 0; }
2697 static int _wrap_Resource_start_end(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; Resource::Addr arg2 ;
2698 Resource::Addr arg3 ; SWIG_check_num_args("Resource::start_end",3,3)
2699 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::start_end",1,"Resource *");
2700 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2701 SWIG_fail_ptr("Resource_start_end",1,SWIGTYPE_p_Resource); }
2702 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2703 if (lua_isinteger(L, 2)) arg2 = (l4_uint32_t)lua_tointeger(L, 2);else
2704 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2705 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2707 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_uint64_t a = strtoull(s, &e, 0);
2708 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg2 = a; }
2709 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2710 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2711 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2712 if (lua_isinteger(L, 3)) arg3 = (l4_uint32_t)lua_tointeger(L, 3);else
2713 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2714 if (lua_isinteger(L, 3)) arg3 = lua_tointeger(L, 3);else
2716 if (lua_isstring(L, 3)) { char *e = 0; char const *s = lua_tostring(L, 3); l4_uint64_t a = strtoull(s, &e, 0);
2717 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg3 = a; }
2718 else if (lua_isnumber(L, 3)) arg3 = lua_tonumber(L, 3); else {
2719 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 3))); SWIG_fail; }
2720 (arg1)->start_end(arg2,arg3); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2721 static int _wrap_Resource_start_size(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; Resource::Addr arg2 ;
2722 Resource::Size arg3 ; SWIG_check_num_args("Resource::start_size",3,3)
2723 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::start_size",1,"Resource *");
2724 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2725 SWIG_fail_ptr("Resource_start_size",1,SWIGTYPE_p_Resource); }
2726 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2727 if (lua_isinteger(L, 2)) arg2 = (l4_uint32_t)lua_tointeger(L, 2);else
2728 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2729 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2731 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_uint64_t a = strtoull(s, &e, 0);
2732 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoull error '%s'", s); SWIG_fail; } arg2 = a; }
2733 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2734 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2735 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2736 if (lua_isinteger(L, 3)) arg3 = (l4_int32_t)lua_tointeger(L, 3);else
2737 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2738 if (lua_isinteger(L, 3)) arg3 = lua_tointeger(L, 3);else
2740 if (lua_isstring(L, 3)) { char *e = 0; char const *s = lua_tostring(L, 3); l4_int64_t a = strtoll(s, &e, 0);
2741 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoll error '%s'", s); SWIG_fail; } arg3 = a; }
2742 else if (lua_isnumber(L, 3)) arg3 = lua_tonumber(L, 3); else {
2743 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 3))); SWIG_fail; }
2744 (arg1)->start_size(arg2,arg3); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2745 static int _wrap_Resource_is_64bit(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; bool result;
2746 SWIG_check_num_args("Resource::is_64bit",1,1)
2747 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::is_64bit",1,"Resource const *");
2748 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2749 SWIG_fail_ptr("Resource_is_64bit",1,SWIGTYPE_p_Resource); } result = (bool)((Resource const *)arg1)->is_64bit();
2750 lua_pushboolean(L,(int)(result!=0)); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2751 static int _wrap_Resource_alignment__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2752 l4_umword_t result; SWIG_check_num_args("Resource::alignment",1,1)
2753 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::alignment",1,"Resource const *");
2754 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2755 SWIG_fail_ptr("Resource_alignment",1,SWIGTYPE_p_Resource); } result = ((Resource const *)arg1)->alignment();
2756 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2757 static int _wrap_Resource_alignment(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) {
2758 int _v; { void *ptr;
2759 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2760 else { _v = 1; } } if (_v) { return _wrap_Resource_alignment__SWIG_1(L);} } if (argc == 2) { int _v; { void *ptr;
2761 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Resource, 0)) { _v = 0; }
2762 else { _v = 1; } } if (_v) { { _v = lua_isnumber(L, argv[1]) || lua_isstring(L, argv[1]); } if (_v) {
2763 return _wrap_Resource_alignment__SWIG_0(L);} } }
2764 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Resource_alignment'\n" " Possible C/C++ prototypes are:\n"
2765 " Resource::alignment(Resource::Size)\n" " Resource::alignment() const\n"); lua_error(L);return 0; }
2766 static int _wrap_Resource_map_iomem(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ; l4_addr_t result;
2767 SWIG_check_num_args("Resource::map_iomem",1,1)
2768 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::map_iomem",1,"Resource const *");
2769 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2770 SWIG_fail_ptr("Resource_map_iomem",1,SWIGTYPE_p_Resource); } result = ((Resource const *)arg1)->map_iomem();
2771 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2772 static int _wrap_Resource_provider_device_handle(lua_State* L) { int SWIG_arg = 0; Resource *arg1 = (Resource *) 0 ;
2773 l4vbus_device_handle_t result; SWIG_check_num_args("Resource::provider_device_handle",1,1)
2774 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Resource::provider_device_handle",1,"Resource const *");
2775 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Resource,0))){
2776 SWIG_fail_ptr("Resource_provider_device_handle",1,SWIGTYPE_p_Resource); }
2777 result = ((Resource const *)arg1)->provider_device_handle(); {
2778 l4vbus_device_handle_t * resultptr = new l4vbus_device_handle_t((const l4vbus_device_handle_t &) result);
2779 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_l4vbus_device_handle_t,1); SWIG_arg++; } return SWIG_arg;
2780 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2781 static void swig_delete_Resource(void *obj) {
2782 Resource *arg1 = (Resource *) obj;
2785 static swig_lua_method swig_Resource_methods[] = {
2786 {"irq_is_level_triggered", _wrap_Resource_irq_is_level_triggered},
2787 {"irq_is_low_polarity", _wrap_Resource_irq_is_low_polarity},
2788 {"flags", _wrap_Resource_flags},
2789 {"add_flags", _wrap_Resource_add_flags},
2790 {"del_flags", _wrap_Resource_del_flags},
2791 {"hierarchical", _wrap_Resource_hierarchical},
2792 {"disabled", _wrap_Resource_disabled},
2793 {"prefetchable", _wrap_Resource_prefetchable},
2794 {"empty", _wrap_Resource_empty},
2795 {"fixed_addr", _wrap_Resource_fixed_addr},
2796 {"fixed_size", _wrap_Resource_fixed_size},
2797 {"relative", _wrap_Resource_relative},
2798 {"type", _wrap_Resource_type},
2799 {"lt_compare", _wrap_Resource_lt_compare},
2800 {"set_id", _wrap_Resource_set_id},
2801 {"id", _wrap_Resource_id},
2802 {"disable", _wrap_Resource_disable},
2803 {"enable", _wrap_Resource_enable},
2804 {"provided", _wrap_Resource_provided},
2805 {"dump", _wrap_Resource_dump},
2806 {"compatible", _wrap_Resource_compatible},
2807 {"parent", _wrap_Resource_parent},
2808 {"set_empty", _wrap_Resource_set_empty},
2809 {"valid", _wrap_Resource_valid},
2810 {"validate", _wrap_Resource_validate},
2811 {"contains", _wrap_Resource_contains},
2812 {"start", _wrap_Resource_start},
2813 {"end", _wrap_Resource_end},
2814 {"size", _wrap_Resource_size},
2815 {"start_end", _wrap_Resource_start_end},
2816 {"start_size", _wrap_Resource_start_size},
2817 {"is_64bit", _wrap_Resource_is_64bit},
2818 {"alignment", _wrap_Resource_alignment},
2819 {"map_iomem", _wrap_Resource_map_iomem},
2820 {"provider_device_handle", _wrap_Resource_provider_device_handle},
2823 static swig_lua_attribute swig_Resource_attributes[] = {
2826 static swig_lua_attribute swig_Resource_cls_attributes[] = {
2829 static swig_lua_method swig_Resource_cls_methods[] = {
2830 {"str_to_id", _wrap_Resource_str_to_id},
2833 static swig_lua_const_info swig_Resource_cls_constants[] = {
2834 {SWIG_LUA_CONSTTAB_INT("Invalid_res", Resource::Invalid_res)},
2835 {SWIG_LUA_CONSTTAB_INT("Irq_res", Resource::Irq_res)},
2836 {SWIG_LUA_CONSTTAB_INT("Mmio_res", Resource::Mmio_res)},
2837 {SWIG_LUA_CONSTTAB_INT("Io_res", Resource::Io_res)},
2838 {SWIG_LUA_CONSTTAB_INT("Bus_res", Resource::Bus_res)},
2839 {SWIG_LUA_CONSTTAB_INT("Gpio_res", Resource::Gpio_res)},
2840 {SWIG_LUA_CONSTTAB_INT("F_type_mask", Resource::F_type_mask)},
2841 {SWIG_LUA_CONSTTAB_INT("F_disabled", Resource::F_disabled)},
2842 {SWIG_LUA_CONSTTAB_INT("F_hierarchical", Resource::F_hierarchical)},
2843 {SWIG_LUA_CONSTTAB_INT("F_prefetchable", Resource::F_prefetchable)},
2844 {SWIG_LUA_CONSTTAB_INT("F_size_aligned", Resource::F_size_aligned)},
2845 {SWIG_LUA_CONSTTAB_INT("F_empty", Resource::F_empty)},
2846 {SWIG_LUA_CONSTTAB_INT("F_rom", Resource::F_rom)},
2847 {SWIG_LUA_CONSTTAB_INT("F_can_resize", Resource::F_can_resize)},
2848 {SWIG_LUA_CONSTTAB_INT("F_can_move", Resource::F_can_move)},
2849 {SWIG_LUA_CONSTTAB_INT("F_width_64bit", Resource::F_width_64bit)},
2850 {SWIG_LUA_CONSTTAB_INT("F_relative", Resource::F_relative)},
2851 {SWIG_LUA_CONSTTAB_INT("Irq_type_base", Resource::Irq_type_base)},
2852 {SWIG_LUA_CONSTTAB_INT("Irq_type_mask", Resource::Irq_type_mask)},
2853 {SWIG_LUA_CONSTTAB_INT("Irq_type_none", Resource::Irq_type_none)},
2854 {SWIG_LUA_CONSTTAB_INT("Irq_type_level_high", Resource::Irq_type_level_high)},
2855 {SWIG_LUA_CONSTTAB_INT("Irq_type_level_low", Resource::Irq_type_level_low)},
2856 {SWIG_LUA_CONSTTAB_INT("Irq_type_raising_edge", Resource::Irq_type_raising_edge)},
2857 {SWIG_LUA_CONSTTAB_INT("Irq_type_falling_edge", Resource::Irq_type_falling_edge)},
2858 {SWIG_LUA_CONSTTAB_INT("Irq_type_both_edges", Resource::Irq_type_both_edges)},
2861 static swig_lua_class *swig_Resource_bases[] = {0};
2862 static const char *swig_Resource_base_names[] = {0};
2863 static swig_lua_class _wrap_class_Resource = { "Resource", &SWIGTYPE_p_Resource,_wrap_new_Resource, swig_delete_Resource, swig_Resource_methods, swig_Resource_attributes, { "Resource", swig_Resource_cls_methods, swig_Resource_cls_attributes, swig_Resource_cls_constants }, swig_Resource_bases, swig_Resource_base_names };
2865 static int _wrap_Mmio_data_space__r_set(lua_State* L) { int SWIG_arg = 0; Mmio_data_space *arg1 = (Mmio_data_space *) 0 ;
2866 L4Re::Rm::Auto_region< l4_addr_t > arg2 ; L4Re::Rm::Auto_region< l4_addr_t > *argp2 ;
2867 SWIG_check_num_args("Mmio_data_space::_r",2,2)
2868 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Mmio_data_space::_r",1,"Mmio_data_space *");
2869 if(!lua_isuserdata(L,2)) SWIG_fail_arg("Mmio_data_space::_r",2,"L4Re::Rm::Auto_region< l4_addr_t >");
2870 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Mmio_data_space,0))){
2871 SWIG_fail_ptr("Mmio_data_space__r_set",1,SWIGTYPE_p_Mmio_data_space); }
2872 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&argp2,SWIGTYPE_p_L4Re__Rm__Auto_regionT_l4_addr_t_t,0))){
2873 SWIG_fail_ptr("Mmio_data_space__r_set",2,SWIGTYPE_p_L4Re__Rm__Auto_regionT_l4_addr_t_t); } arg2 = *argp2;
2874 if (arg1) (arg1)->_r = arg2; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2875 static int _wrap_Mmio_data_space__r_get(lua_State* L) { int SWIG_arg = 0; Mmio_data_space *arg1 = (Mmio_data_space *) 0 ;
2876 L4Re::Rm::Auto_region< l4_addr_t > result; SWIG_check_num_args("Mmio_data_space::_r",1,1)
2877 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Mmio_data_space::_r",1,"Mmio_data_space *");
2878 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Mmio_data_space,0))){
2879 SWIG_fail_ptr("Mmio_data_space__r_get",1,SWIGTYPE_p_Mmio_data_space); } result = ((arg1)->_r); {
2880 L4Re::Rm::Auto_region< l4_addr_t > * resultptr = new L4Re::Rm::Auto_region< l4_addr_t >((const L4Re::Rm::Auto_region< l4_addr_t > &) result);
2881 SWIG_NewPointerObj(L,(void *) resultptr,SWIGTYPE_p_L4Re__Rm__Auto_regionT_l4_addr_t_t,1); SWIG_arg++; } return SWIG_arg;
2882 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2883 static int _wrap_new_Mmio_data_space__SWIG_0(lua_State* L) { int SWIG_arg = 0; Resource::Size arg1 ; unsigned long arg2 ;
2884 Mmio_data_space *result = 0 ; SWIG_check_num_args("Mmio_data_space::Mmio_data_space",2,2)if(!lua_isnumber(L,2)) SWIG_fail_arg("Mmio_data_space::Mmio_data_space",2,"unsigned long");
2885 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2886 if (lua_isinteger(L, 1)) arg1 = (l4_int32_t)lua_tointeger(L, 1);else
2887 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2888 if (lua_isinteger(L, 1)) arg1 = lua_tointeger(L, 1);else
2890 if (lua_isstring(L, 1)) { char *e = 0; char const *s = lua_tostring(L, 1); l4_int64_t a = strtoll(s, &e, 0);
2891 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoll error '%s'", s); SWIG_fail; } arg1 = a; }
2892 else if (lua_isnumber(L, 1)) arg1 = lua_tonumber(L, 1); else {
2893 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 1))); SWIG_fail; }
2894 arg2 = (unsigned long)lua_tointeger(L, 2); result = (Mmio_data_space *)new Mmio_data_space(arg1,arg2);
2895 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Mmio_data_space,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2897 static int _wrap_new_Mmio_data_space__SWIG_1(lua_State* L) { int SWIG_arg = 0; Resource::Size arg1 ;
2898 Mmio_data_space *result = 0 ;SWIG_check_num_args("Mmio_data_space::Mmio_data_space",1,1)
2899 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2900 if (lua_isinteger(L, 1)) arg1 = (l4_int32_t)lua_tointeger(L, 1);else
2901 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2902 if (lua_isinteger(L, 1)) arg1 = lua_tointeger(L, 1);else
2904 if (lua_isstring(L, 1)) { char *e = 0; char const *s = lua_tostring(L, 1); l4_int64_t a = strtoll(s, &e, 0);
2905 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoll error '%s'", s); SWIG_fail; } arg1 = a; }
2906 else if (lua_isnumber(L, 1)) arg1 = lua_tonumber(L, 1); else {
2907 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 1))); SWIG_fail; }
2908 result = (Mmio_data_space *)new Mmio_data_space(arg1); SWIG_NewPointerObj(L,result,SWIGTYPE_p_Mmio_data_space,1); SWIG_arg++;
2909 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2910 static int _wrap_new_Mmio_data_space(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) {
2911 int _v; { _v = lua_isnumber(L, argv[0]) || lua_isstring(L, argv[0]); } if (_v) {
2912 return _wrap_new_Mmio_data_space__SWIG_1(L);} } if (argc == 2) { int _v; {
2913 _v = lua_isnumber(L, argv[0]) || lua_isstring(L, argv[0]); } if (_v) { { _v = lua_isnumber(L,argv[1]); } if (_v) {
2914 return _wrap_new_Mmio_data_space__SWIG_0(L);} } }
2915 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'new_Mmio_data_space'\n"
2916 " Possible C/C++ prototypes are:\n" " Mmio_data_space::Mmio_data_space(Resource::Size,unsigned long)\n"
2917 " Mmio_data_space::Mmio_data_space(Resource::Size)\n"); lua_error(L);return 0; }
2918 static int _wrap_Mmio_data_space_alloc_ram(lua_State* L) { int SWIG_arg = 0; Mmio_data_space *arg1 = (Mmio_data_space *) 0 ;
2919 Resource::Size arg2 ; unsigned long arg3 ; SWIG_check_num_args("Mmio_data_space::alloc_ram",3,3)
2920 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Mmio_data_space::alloc_ram",1,"Mmio_data_space *");
2921 if(!lua_isnumber(L,3)) SWIG_fail_arg("Mmio_data_space::alloc_ram",3,"unsigned long");
2922 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Mmio_data_space,0))){
2923 SWIG_fail_ptr("Mmio_data_space_alloc_ram",1,SWIGTYPE_p_Mmio_data_space); }
2924 #if SWIG_RECURSIVE_DEFINED LNUM_INT32
2925 if (lua_isinteger(L, 2)) arg2 = (l4_int32_t)lua_tointeger(L, 2);else
2926 #elif SWIG_RECURSIVE_DEFINED LNUM_INT64
2927 if (lua_isinteger(L, 2)) arg2 = lua_tointeger(L, 2);else
2929 if (lua_isstring(L, 2)) { char *e = 0; char const *s = lua_tostring(L, 2); l4_int64_t a = strtoll(s, &e, 0);
2930 if (s == e || *e != 0) { lua_pushfstring(L, "big number strtoll error '%s'", s); SWIG_fail; } arg2 = a; }
2931 else if (lua_isnumber(L, 2)) arg2 = lua_tonumber(L, 2); else {
2932 lua_pushfstring(L, "big number expected (string or number) got %s", lua_typename(L, lua_type(L, 2))); SWIG_fail; }
2933 arg3 = (unsigned long)lua_tointeger(L, 3); (arg1)->alloc_ram(arg2,arg3); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
2935 static void swig_delete_Mmio_data_space(void *obj) {
2936 Mmio_data_space *arg1 = (Mmio_data_space *) obj;
2939 static swig_lua_method swig_Mmio_data_space_methods[] = {
2940 {"alloc_ram", _wrap_Mmio_data_space_alloc_ram},
2943 static swig_lua_attribute swig_Mmio_data_space_attributes[] = {
2944 { "_r", _wrap_Mmio_data_space__r_get, _wrap_Mmio_data_space__r_set},
2947 static swig_lua_attribute swig_Mmio_data_space_cls_attributes[] = {
2950 static swig_lua_method swig_Mmio_data_space_cls_methods[] = {
2953 static swig_lua_const_info swig_Mmio_data_space_cls_constants[] = {
2956 static swig_lua_class *swig_Mmio_data_space_bases[] = {0,0};
2957 static const char *swig_Mmio_data_space_base_names[] = {"Resource *",0};
2958 static swig_lua_class _wrap_class_Mmio_data_space = { "Mmio_data_space", &SWIGTYPE_p_Mmio_data_space,_wrap_new_Mmio_data_space, swig_delete_Mmio_data_space, swig_Mmio_data_space_methods, swig_Mmio_data_space_attributes, { "Mmio_data_space", swig_Mmio_data_space_cls_methods, swig_Mmio_data_space_cls_attributes, swig_Mmio_data_space_cls_constants }, swig_Mmio_data_space_bases, swig_Mmio_data_space_base_names };
2960 static void swig_delete_Device(void *obj) {
2961 Device *arg1 = (Device *) obj;
2964 static swig_lua_method swig_Device_methods[] = {
2967 static swig_lua_attribute swig_Device_attributes[] = {
2970 static swig_lua_attribute swig_Device_cls_attributes[] = {
2973 static swig_lua_method swig_Device_cls_methods[] = {
2976 static swig_lua_const_info swig_Device_cls_constants[] = {
2979 static swig_lua_class *swig_Device_bases[] = {0};
2980 static const char *swig_Device_base_names[] = {0};
2981 static swig_lua_class _wrap_class_Device = { "Device", &SWIGTYPE_p_Device,0, swig_delete_Device, swig_Device_methods, swig_Device_attributes, { "Device", swig_Device_cls_methods, swig_Device_cls_attributes, swig_Device_cls_constants }, swig_Device_bases, swig_Device_base_names };
2983 static int _wrap_Generic_device_add_resource(lua_State* L) { int SWIG_arg = 0; Generic_device *arg1 = (Generic_device *) 0 ;
2984 Resource *arg2 = (Resource *) 0 ; SWIG_check_num_args("Generic_device::add_resource",2,2)
2985 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Generic_device::add_resource",1,"Generic_device *");
2986 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Generic_device::add_resource",2,"Resource *");
2987 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Generic_device,0))){
2988 SWIG_fail_ptr("Generic_device_add_resource",1,SWIGTYPE_p_Generic_device); }
2989 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Resource,SWIG_POINTER_DISOWN))){
2990 SWIG_fail_ptr("Generic_device_add_resource",2,SWIGTYPE_p_Resource); } (arg1)->add_resource(arg2); return SWIG_arg;
2991 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2992 static int _wrap_Generic_device_nresources(lua_State* L) { int SWIG_arg = 0; Generic_device *arg1 = (Generic_device *) 0 ;
2993 int result; SWIG_check_num_args("Generic_device::nresources",1,1)
2994 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Generic_device::nresources",1,"Generic_device const *");
2995 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Generic_device,0))){
2996 SWIG_fail_ptr("Generic_device_nresources",1,SWIGTYPE_p_Generic_device); }
2997 result = (int)Generic_device_nresources((Generic_device const *)arg1); lua_pushinteger(L, result); SWIG_arg++;
2998 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
2999 static int _wrap_Generic_device_resource(lua_State* L) { int SWIG_arg = 0; Generic_device *arg1 = (Generic_device *) 0 ;
3000 int arg2 ; Resource *result = 0 ; SWIG_check_num_args("Generic_device::resource",2,2)
3001 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Generic_device::resource",1,"Generic_device const *");
3002 if(!lua_isnumber(L,2)) SWIG_fail_arg("Generic_device::resource",2,"int");
3003 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Generic_device,0))){
3004 SWIG_fail_ptr("Generic_device_resource",1,SWIGTYPE_p_Generic_device); } arg2 = (int)lua_tointeger(L, 2);
3005 result = (Resource *)Generic_device_resource((Generic_device const *)arg1,arg2);
3006 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Resource,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3008 static void swig_delete_Generic_device(void *obj) {
3009 Generic_device *arg1 = (Generic_device *) obj;
3012 static swig_lua_method swig_Generic_device_methods[] = {
3013 {"add_resource", _wrap_Generic_device_add_resource},
3014 {"nresources", _wrap_Generic_device_nresources},
3015 {"resource", _wrap_Generic_device_resource},
3018 static swig_lua_attribute swig_Generic_device_attributes[] = {
3021 static swig_lua_attribute swig_Generic_device_cls_attributes[] = {
3024 static swig_lua_method swig_Generic_device_cls_methods[] = {
3027 static swig_lua_const_info swig_Generic_device_cls_constants[] = {
3030 static swig_lua_class *swig_Generic_device_bases[] = {0,0};
3031 static const char *swig_Generic_device_base_names[] = {"Device *",0};
3032 static swig_lua_class _wrap_class_Generic_device = { "Generic_device", &SWIGTYPE_p_Generic_device,0, swig_delete_Generic_device, swig_Generic_device_methods, swig_Generic_device_attributes, { "Generic_device", swig_Generic_device_cls_methods, swig_Generic_device_cls_attributes, swig_Generic_device_cls_constants }, swig_Generic_device_bases, swig_Generic_device_base_names };
3034 static int _wrap_Vi_device_add_child(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3035 Vi::Device *arg2 = (Vi::Device *) 0 ; SWIG_check_num_args("Vi::Device::add_child",2,2)
3036 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::add_child",1,"Vi::Device *");
3037 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Vi::Device::add_child",2,"Vi::Device *");
3038 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3039 SWIG_fail_ptr("Vi_device_add_child",1,SWIGTYPE_p_Vi__Device); }
3040 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Vi__Device,SWIG_POINTER_DISOWN))){
3041 SWIG_fail_ptr("Vi_device_add_child",2,SWIGTYPE_p_Vi__Device); } (arg1)->add_child(arg2); return SWIG_arg; if(0) SWIG_fail;
3042 fail: lua_error(L); return SWIG_arg; }
3043 static int _wrap_Vi_device_name__SWIG_0(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3044 char *arg2 = (char *) 0 ; SWIG_check_num_args("Vi::Device::name",2,2)
3045 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::name",1,"Vi::Device *");
3046 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Vi::Device::name",2,"char const *");
3047 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3048 SWIG_fail_ptr("Vi_device_name",1,SWIGTYPE_p_Vi__Device); } arg2 = (char *)lua_tostring(L, 2);
3049 (arg1)->name((char const *)arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3050 static int _wrap_Vi_device_name__SWIG_1(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3051 char *result = 0 ; SWIG_check_num_args("Vi::Device::name",1,1)
3052 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::name",1,"Vi::Device const *");
3053 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3054 SWIG_fail_ptr("Vi_device_name",1,SWIGTYPE_p_Vi__Device); } result = (char *)((Vi::Device const *)arg1)->name();
3055 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3056 static int _wrap_Vi_device_name(lua_State* L) { int argc; int argv[3]={ 1,2,3} ; argc = lua_gettop(L); if (argc == 1) { int _v;
3057 { void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Vi__Device, 0)) {
3058 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Vi_device_name__SWIG_1(L);} } if (argc == 2) { int _v; {
3059 void *ptr; if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Vi__Device, 0)) {
3060 _v = 0; } else { _v = 1; } } if (_v) { { _v = SWIG_lua_isnilstring(L,argv[1]); } if (_v) {
3061 return _wrap_Vi_device_name__SWIG_0(L);} } }
3062 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Vi_device_name'\n" " Possible C/C++ prototypes are:\n"
3063 " Vi::Device::name(char const *)\n" " Vi::Device::name() const\n"); lua_error(L);return 0; }
3064 static int _wrap_Vi_device_parent(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3065 Vi::Device *result = 0 ; SWIG_check_num_args("Vi::Device::parent",1,1)
3066 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::parent",1,"Vi::Device const *");
3067 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3068 SWIG_fail_ptr("Vi_device_parent",1,SWIGTYPE_p_Vi__Device); } result = (Vi::Device *)((Vi::Device const *)arg1)->parent();
3069 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3071 static int _wrap_Vi_device_children(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3072 Vi::Device *result = 0 ; SWIG_check_num_args("Vi::Device::children",1,1)
3073 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::children",1,"Vi::Device const *");
3074 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3075 SWIG_fail_ptr("Vi_device_children",1,SWIGTYPE_p_Vi__Device); }
3076 result = (Vi::Device *)((Vi::Device const *)arg1)->children();
3077 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3079 static int _wrap_Vi_device_next(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ; Vi::Device *result = 0 ;
3080 SWIG_check_num_args("Vi::Device::next",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::next",1,"Vi::Device const *");
3081 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3082 SWIG_fail_ptr("Vi_device_next",1,SWIGTYPE_p_Vi__Device); } result = (Vi::Device *)((Vi::Device const *)arg1)->next();
3083 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3085 static int _wrap_Vi_device_depth(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ; int result;
3086 SWIG_check_num_args("Vi::Device::depth",1,1)
3087 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::depth",1,"Vi::Device const *");
3088 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3089 SWIG_fail_ptr("Vi_device_depth",1,SWIGTYPE_p_Vi__Device); } result = (int)((Vi::Device const *)arg1)->depth();
3090 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3091 static int _wrap_Vi_device_add_filter__SWIG_0(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3092 cxx::String *arg2 = 0 ; cxx::String *arg3 = 0 ; cxx::String tmp2 ; cxx::String tmp3 ; int result;
3093 SWIG_check_num_args("Vi::Device::add_filter",3,3)
3094 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::add_filter",1,"Vi::Device *");
3095 if(!lua_isstring(L,2)) SWIG_fail_arg("Vi::Device::add_filter",2,"cxx::String const &");
3096 if(!lua_isstring(L,3)) SWIG_fail_arg("Vi::Device::add_filter",3,"cxx::String const &");
3097 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3098 SWIG_fail_ptr("Vi_device_add_filter",1,SWIGTYPE_p_Vi__Device); }
3099 tmp2 = cxx::String(lua_tostring(L, 2), lua_rawlen(L, 2)); arg2 = &tmp2;
3100 tmp3 = cxx::String(lua_tostring(L, 3), lua_rawlen(L, 3)); arg3 = &tmp3;
3101 result = (int)(arg1)->add_filter((cxx::String const &)*arg2,(cxx::String const &)*arg3);
3102 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3103 static int _wrap_Vi_device_add_filter__SWIG_1(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3104 cxx::String *arg2 = 0 ; unsigned long long arg3 ; cxx::String tmp2 ; int result;
3105 SWIG_check_num_args("Vi::Device::add_filter",3,3)
3106 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::add_filter",1,"Vi::Device *");
3107 if(!lua_isstring(L,2)) SWIG_fail_arg("Vi::Device::add_filter",2,"cxx::String const &");
3108 if(!lua_isnumber(L,3)) SWIG_fail_arg("Vi::Device::add_filter",3,"unsigned long long");
3109 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3110 SWIG_fail_ptr("Vi_device_add_filter",1,SWIGTYPE_p_Vi__Device); }
3111 tmp2 = cxx::String(lua_tostring(L, 2), lua_rawlen(L, 2)); arg2 = &tmp2; arg3 = (unsigned long long)lua_tonumber(L, 3);
3112 result = (int)(arg1)->add_filter((cxx::String const &)*arg2,arg3); lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg;
3113 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3114 static int _wrap_Vi_device_add_filter__SWIG_2(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3115 cxx::String *arg2 = 0 ; unsigned long long arg3 ; unsigned long long arg4 ; cxx::String tmp2 ; int result;
3116 SWIG_check_num_args("Vi::Device::add_filter",4,4)
3117 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::add_filter",1,"Vi::Device *");
3118 if(!lua_isstring(L,2)) SWIG_fail_arg("Vi::Device::add_filter",2,"cxx::String const &");
3119 if(!lua_isnumber(L,3)) SWIG_fail_arg("Vi::Device::add_filter",3,"unsigned long long");
3120 if(!lua_isnumber(L,4)) SWIG_fail_arg("Vi::Device::add_filter",4,"unsigned long long");
3121 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3122 SWIG_fail_ptr("Vi_device_add_filter",1,SWIGTYPE_p_Vi__Device); }
3123 tmp2 = cxx::String(lua_tostring(L, 2), lua_rawlen(L, 2)); arg2 = &tmp2; arg3 = (unsigned long long)lua_tonumber(L, 3);
3124 arg4 = (unsigned long long)lua_tonumber(L, 4); result = (int)(arg1)->add_filter((cxx::String const &)*arg2,arg3,arg4);
3125 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3126 static int _wrap_Vi_device_add_filter(lua_State* L) { int argc; int argv[5]={ 1,2,3,4,5} ; argc = lua_gettop(L);
3127 if (argc == 3) { int _v; { void *ptr;
3128 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Vi__Device, 0)) { _v = 0; }
3129 else { _v = 1; } } if (_v) { { _v = lua_isstring(L, argv[1]); } if (_v) { { _v = lua_isnumber(L,argv[2]); } if (_v) {
3130 return _wrap_Vi_device_add_filter__SWIG_1(L);} } } } if (argc == 3) { int _v; { void *ptr;
3131 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Vi__Device, 0)) { _v = 0; }
3132 else { _v = 1; } } if (_v) { { _v = lua_isstring(L, argv[1]); } if (_v) { { _v = lua_isstring(L, argv[2]); }
3133 if (_v) { return _wrap_Vi_device_add_filter__SWIG_0(L);} } } } if (argc == 4) { int _v; { void *ptr;
3134 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Vi__Device, 0)) { _v = 0; }
3135 else { _v = 1; } } if (_v) { { _v = lua_isstring(L, argv[1]); } if (_v) { { _v = lua_isnumber(L,argv[2]); } if (_v) {
3136 { _v = lua_isnumber(L,argv[3]); } if (_v) { return _wrap_Vi_device_add_filter__SWIG_2(L);} } } } }
3137 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Vi_device_add_filter'\n"
3138 " Possible C/C++ prototypes are:\n" " Vi::Device::add_filter(cxx::String const &,cxx::String const &)\n"
3139 " Vi::Device::add_filter(cxx::String const &,unsigned long long)\n"
3140 " Vi::Device::add_filter(cxx::String const &,unsigned long long,unsigned long long)\n"); lua_error(L);return 0; }
3141 static int _wrap_Vi_device_dump(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ; int arg2 ;
3142 SWIG_check_num_args("Vi::Device::dump",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::dump",1,"Vi::Device const *");
3143 if(!lua_isnumber(L,2)) SWIG_fail_arg("Vi::Device::dump",2,"int");
3144 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3145 SWIG_fail_ptr("Vi_device_dump",1,SWIGTYPE_p_Vi__Device); } arg2 = (int)lua_tointeger(L, 2);
3146 ((Vi::Device const *)arg1)->dump(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3147 static int _wrap_Vi_device_set_name(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ;
3148 char *arg2 = (char *) 0 ; SWIG_check_num_args("Vi::Device::set_name",2,2)
3149 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Device::set_name",1,"Vi::Device *");
3150 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Vi::Device::set_name",2,"char const *");
3151 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3152 SWIG_fail_ptr("Vi_device_set_name",1,SWIGTYPE_p_Vi__Device); } arg2 = (char *)lua_tostring(L, 2);
3153 Vi_Device_set_name(arg1,(char const *)arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3154 static void swig_delete_Vi_device(void *obj) {
3155 Vi::Device *arg1 = (Vi::Device *) obj;
3158 static swig_lua_method swig_Vi_Device_methods[] = {
3159 {"add_child", _wrap_Vi_device_add_child},
3160 {"name", _wrap_Vi_device_name},
3161 {"parent", _wrap_Vi_device_parent},
3162 {"children", _wrap_Vi_device_children},
3163 {"next", _wrap_Vi_device_next},
3164 {"depth", _wrap_Vi_device_depth},
3165 {"add_filter", _wrap_Vi_device_add_filter},
3166 {"dump", _wrap_Vi_device_dump},
3167 {"set_name", _wrap_Vi_device_set_name},
3170 static swig_lua_attribute swig_Vi_Device_attributes[] = {
3173 static swig_lua_attribute swig_Vi_Device_cls_attributes[] = {
3176 static swig_lua_method swig_Vi_Device_cls_methods[] = {
3179 static swig_lua_const_info swig_Vi_Device_cls_constants[] = {
3182 static swig_lua_class *swig_Vi_Device_bases[] = {0,0};
3183 static const char *swig_Vi_Device_base_names[] = {"Generic_device *",0};
3184 static swig_lua_class _wrap_class_Vi_Device = { "Vi_device", &SWIGTYPE_p_Vi__Device,0, swig_delete_Vi_device, swig_Vi_Device_methods, swig_Vi_Device_attributes, { "Vi_device", swig_Vi_Device_cls_methods, swig_Vi_Device_cls_attributes, swig_Vi_Device_cls_constants }, swig_Vi_Device_bases, swig_Vi_Device_base_names };
3186 static int _wrap_Vi_dev_factory_vcreate(lua_State* L) { int SWIG_arg = 0; Vi::Dev_factory *arg1 = (Vi::Dev_factory *) 0 ;
3187 Vi::Device *result = 0 ; SWIG_check_num_args("Vi::Dev_factory::vcreate",1,1)
3188 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Dev_factory::vcreate",1,"Vi::Dev_factory *");
3189 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Dev_factory,0))){
3190 SWIG_fail_ptr("Vi_dev_factory_vcreate",1,SWIGTYPE_p_Vi__Dev_factory); } result = (Vi::Device *)(arg1)->vcreate();
3191 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3193 static int _wrap_Vi_dev_factory_do_match(lua_State* L) { int SWIG_arg = 0; Vi::Dev_factory *arg1 = (Vi::Dev_factory *) 0 ;
3194 Hw::Device *arg2 = (Hw::Device *) 0 ; Vi::Device *result = 0 ; SWIG_check_num_args("Vi::Dev_factory::do_match",2,2)
3195 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Dev_factory::do_match",1,"Vi::Dev_factory *");
3196 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Vi::Dev_factory::do_match",2,"Hw::Device *");
3197 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Dev_factory,0))){
3198 SWIG_fail_ptr("Vi_dev_factory_do_match",1,SWIGTYPE_p_Vi__Dev_factory); }
3199 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Hw__Device,0))){
3200 SWIG_fail_ptr("Vi_dev_factory_do_match",2,SWIGTYPE_p_Hw__Device); } result = (Vi::Device *)(arg1)->do_match(arg2);
3201 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3203 static int _wrap_Vi_dev_factory_create__SWIG_0(lua_State* L) { int SWIG_arg = 0; std::string *arg1 = 0 ; std::string temp1 ;
3204 Vi::Device *result = 0 ; SWIG_check_num_args("Vi::Dev_factory::create",1,1)
3205 if(!lua_isstring(L,1)) SWIG_fail_arg("Vi::Dev_factory::create",1,"std::string const &");
3206 temp1.assign(lua_tostring(L,1),lua_rawlen(L,1)); arg1=&temp1;
3207 result = (Vi::Device *)Vi::Dev_factory::create((std::string const &)*arg1);
3208 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3210 static int _wrap_Vi_dev_factory_create__SWIG_1(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3211 Vi::Device *result = 0 ; SWIG_check_num_args("Vi::Dev_factory::create",1,1)
3212 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Vi::Dev_factory::create",1,"Hw::Device *");
3213 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3214 SWIG_fail_ptr("Vi_dev_factory_create",1,SWIGTYPE_p_Hw__Device); } result = (Vi::Device *)Vi::Dev_factory::create(arg1);
3215 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Vi__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3217 static int _wrap_Vi_dev_factory_create(lua_State* L) { int argc; int argv[2]={ 1,2} ; argc = lua_gettop(L); if (argc == 1) {
3218 int _v; { void *ptr;
3219 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Hw__Device, 0)) { _v = 0; }
3220 else { _v = 1; } } if (_v) { return _wrap_Vi_dev_factory_create__SWIG_1(L);} } if (argc == 1) { int _v; {
3221 _v = lua_isstring(L,argv[0]); } if (_v) { return _wrap_Vi_dev_factory_create__SWIG_0(L);} }
3222 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Vi_dev_factory_create'\n"
3223 " Possible C/C++ prototypes are:\n" " Vi::Dev_factory::create(std::string const &)\n"
3224 " Vi::Dev_factory::create(Hw::Device *)\n"); lua_error(L);return 0; }
3225 static swig_lua_method swig_Vi_Dev_factory_methods[] = {
3226 {"vcreate", _wrap_Vi_dev_factory_vcreate},
3227 {"do_match", _wrap_Vi_dev_factory_do_match},
3230 static swig_lua_attribute swig_Vi_Dev_factory_attributes[] = {
3233 static swig_lua_attribute swig_Vi_Dev_factory_cls_attributes[] = {
3236 static swig_lua_method swig_Vi_Dev_factory_cls_methods[] = {
3237 {"create", _wrap_Vi_dev_factory_create},
3240 static swig_lua_const_info swig_Vi_Dev_factory_cls_constants[] = {
3243 static swig_lua_class *swig_Vi_Dev_factory_bases[] = {0};
3244 static const char *swig_Vi_Dev_factory_base_names[] = {0};
3245 static swig_lua_class _wrap_class_Vi_Dev_factory = { "Vi_dev_factory", &SWIGTYPE_p_Vi__Dev_factory,0,0, swig_Vi_Dev_factory_methods, swig_Vi_Dev_factory_attributes, { "Vi_dev_factory", swig_Vi_Dev_factory_cls_methods, swig_Vi_Dev_factory_cls_attributes, swig_Vi_Dev_factory_cls_constants }, swig_Vi_Dev_factory_bases, swig_Vi_Dev_factory_base_names };
3247 static int _wrap_Hw_device_set_property(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3248 char *arg2 = (char *) 0 ; Hw::Device::Prop_val *arg3 = 0 ; Hw::Device::Prop_val tmp3 ; int result;
3249 SWIG_check_num_args("Hw::Device::set_property",3,3)
3250 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::set_property",1,"Hw::Device *");
3251 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Hw::Device::set_property",2,"char const *");
3252 if(!is_lua_propval(L,3)) SWIG_fail_arg("Hw::Device::set_property",3,"Hw::Device::Prop_val const &");
3253 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3254 SWIG_fail_ptr("Hw_device_set_property",1,SWIGTYPE_p_Hw__Device); } arg2 = (char *)lua_tostring(L, 2);
3255 tmp3 = to_lua_propval(L, 3); arg3 = &tmp3;
3256 result = (int)(arg1)->set_property((char const *)arg2,(Hw::Device::Prop_val const &)*arg3);
3257 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3258 static int _wrap_Hw_device_add_child(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3259 Hw::Device *arg2 = (Hw::Device *) 0 ; SWIG_check_num_args("Hw::Device::add_child",2,2)
3260 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::add_child",1,"Hw::Device *");
3261 if(!SWIG_isptrtype(L,2)) SWIG_fail_arg("Hw::Device::add_child",2,"Hw::Device *");
3262 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3263 SWIG_fail_ptr("Hw_device_add_child",1,SWIGTYPE_p_Hw__Device); }
3264 if (!SWIG_IsOK(SWIG_ConvertPtr(L,2,(void**)&arg2,SWIGTYPE_p_Hw__Device,SWIG_POINTER_DISOWN))){
3265 SWIG_fail_ptr("Hw_device_add_child",2,SWIGTYPE_p_Hw__Device); } (arg1)->add_child(arg2); return SWIG_arg; if(0) SWIG_fail;
3266 fail: lua_error(L); return SWIG_arg; }
3267 static int _wrap_Hw_device_add_cid(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3268 char *arg2 = (char *) 0 ; SWIG_check_num_args("Hw::Device::add_cid",2,2)
3269 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::add_cid",1,"Hw::Device *");
3270 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Hw::Device::add_cid",2,"char const *");
3271 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3272 SWIG_fail_ptr("Hw_device_add_cid",1,SWIGTYPE_p_Hw__Device); } arg2 = (char *)lua_tostring(L, 2);
3273 (arg1)->add_cid((char const *)arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3274 static int _wrap_Hw_device_set_name(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3275 char *arg2 = (char *) 0 ; SWIG_check_num_args("Hw::Device::set_name",2,2)
3276 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::set_name",1,"Hw::Device *");
3277 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Hw::Device::set_name",2,"char const *");
3278 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3279 SWIG_fail_ptr("Hw_device_set_name",1,SWIGTYPE_p_Hw__Device); } arg2 = (char *)lua_tostring(L, 2);
3280 (arg1)->set_name((char const *)arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3281 static int _wrap_Hw_device_name(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ; char *result = 0 ;
3282 SWIG_check_num_args("Hw::Device::name",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::name",1,"Hw::Device const *");
3283 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3284 SWIG_fail_ptr("Hw_device_name",1,SWIGTYPE_p_Hw__Device); } result = (char *)((Hw::Device const *)arg1)->name();
3285 lua_pushstring(L,(const char *)result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3286 static int _wrap_Hw_device_match_cid(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3287 char *arg2 = (char *) 0 ; bool result; SWIG_check_num_args("Hw::Device::match_cid",2,2)
3288 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::match_cid",1,"Hw::Device const *");
3289 if(!SWIG_lua_isnilstring(L,2)) SWIG_fail_arg("Hw::Device::match_cid",2,"char const *");
3290 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3291 SWIG_fail_ptr("Hw_device_match_cid",1,SWIGTYPE_p_Hw__Device); } arg2 = (char *)lua_tostring(L, 2);
3292 result = (bool)((Hw::Device const *)arg1)->match_cid((char const *)arg2); lua_pushboolean(L,(int)(result!=0)); SWIG_arg++;
3293 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3294 static int _wrap_Hw_device_parent(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3295 Hw::Device *result = 0 ; SWIG_check_num_args("Hw::Device::parent",1,1)
3296 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::parent",1,"Hw::Device const *");
3297 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3298 SWIG_fail_ptr("Hw_device_parent",1,SWIGTYPE_p_Hw__Device); } result = (Hw::Device *)((Hw::Device const *)arg1)->parent();
3299 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3301 static int _wrap_Hw_device_children(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3302 Hw::Device *result = 0 ; SWIG_check_num_args("Hw::Device::children",1,1)
3303 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::children",1,"Hw::Device const *");
3304 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3305 SWIG_fail_ptr("Hw_device_children",1,SWIGTYPE_p_Hw__Device); }
3306 result = (Hw::Device *)((Hw::Device const *)arg1)->children();
3307 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3309 static int _wrap_Hw_device_next(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ; Hw::Device *result = 0 ;
3310 SWIG_check_num_args("Hw::Device::next",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::next",1,"Hw::Device const *");
3311 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3312 SWIG_fail_ptr("Hw_device_next",1,SWIGTYPE_p_Hw__Device); } result = (Hw::Device *)((Hw::Device const *)arg1)->next();
3313 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3315 static int _wrap_Hw_device_depth(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ; int result;
3316 SWIG_check_num_args("Hw::Device::depth",1,1)
3317 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::depth",1,"Hw::Device const *");
3318 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3319 SWIG_fail_ptr("Hw_device_depth",1,SWIGTYPE_p_Hw__Device); } result = (int)((Hw::Device const *)arg1)->depth();
3320 lua_pushinteger(L, result); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3321 static int _wrap_Hw_device_plugin(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3322 SWIG_check_num_args("Hw::Device::plugin",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::plugin",1,"Hw::Device *");
3323 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3324 SWIG_fail_ptr("Hw_device_plugin",1,SWIGTYPE_p_Hw__Device); } (arg1)->plugin(); return SWIG_arg; if(0) SWIG_fail; fail:
3325 lua_error(L); return SWIG_arg; }
3326 static int _wrap_Hw_device_dump(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ; int arg2 ;
3327 SWIG_check_num_args("Hw::Device::dump",2,2) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::dump",1,"Hw::Device const *");
3328 if(!lua_isnumber(L,2)) SWIG_fail_arg("Hw::Device::dump",2,"int");
3329 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3330 SWIG_fail_ptr("Hw_device_dump",1,SWIGTYPE_p_Hw__Device); } arg2 = (int)lua_tointeger(L, 2);
3331 ((Hw::Device const *)arg1)->dump(arg2); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3332 static int _wrap_Hw_device_find_by_name(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3333 std::string *arg2 = 0 ; std::string temp2 ; Hw::Device *result = 0 ; SWIG_check_num_args("Hw::Device::find_by_name",2,2)
3334 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::find_by_name",1,"Hw::Device const *");
3335 if(!lua_isstring(L,2)) SWIG_fail_arg("Hw::Device::find_by_name",2,"std::string const &");
3336 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3337 SWIG_fail_ptr("Hw_device_find_by_name",1,SWIGTYPE_p_Hw__Device); }
3338 temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
3339 result = (Hw::Device *)Hw_Device_find_by_name((Hw::Device const *)arg1,(std::string const &)*arg2);
3340 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3342 static int _wrap_Hw_device___getitem(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3343 std::string *arg2 = 0 ; std::string temp2 ; Hw::Device *result = 0 ; SWIG_check_num_args("Hw::Device::__getitem",2,2)
3344 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::__getitem",1,"Hw::Device const *");
3345 if(!lua_isstring(L,2)) SWIG_fail_arg("Hw::Device::__getitem",2,"std::string const &");
3346 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3347 SWIG_fail_ptr("Hw_device___getitem",1,SWIGTYPE_p_Hw__Device); }
3348 temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
3349 result = (Hw::Device *)Hw_Device___getitem((Hw::Device const *)arg1,(std::string const &)*arg2);
3350 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3352 static int _wrap_Hw_device___setitem(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ;
3353 std::string *arg2 = 0 ; Hw::Device *arg3 = (Hw::Device *) 0 ; std::string temp2 ;
3354 SWIG_check_num_args("Hw::Device::__setitem",3,3)
3355 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device::__setitem",1,"Hw::Device *");
3356 if(!lua_isstring(L,2)) SWIG_fail_arg("Hw::Device::__setitem",2,"std::string const &");
3357 if(!SWIG_isptrtype(L,3)) SWIG_fail_arg("Hw::Device::__setitem",3,"Hw::Device *");
3358 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3359 SWIG_fail_ptr("Hw_device___setitem",1,SWIGTYPE_p_Hw__Device); }
3360 temp2.assign(lua_tostring(L,2),lua_rawlen(L,2)); arg2=&temp2;
3361 if (!SWIG_IsOK(SWIG_ConvertPtr(L,3,(void**)&arg3,SWIGTYPE_p_Hw__Device,0))){
3362 SWIG_fail_ptr("Hw_device___setitem",3,SWIGTYPE_p_Hw__Device); } Hw_Device___setitem(arg1,(std::string const &)*arg2,arg3);
3363 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3364 static void swig_delete_Hw_device(void *obj) {
3365 Hw::Device *arg1 = (Hw::Device *) obj;
3368 static swig_lua_method swig_Hw_Device_methods[] = {
3369 {"set_property", _wrap_Hw_device_set_property},
3370 {"add_child", _wrap_Hw_device_add_child},
3371 {"add_cid", _wrap_Hw_device_add_cid},
3372 {"set_name", _wrap_Hw_device_set_name},
3373 {"name", _wrap_Hw_device_name},
3374 {"match_cid", _wrap_Hw_device_match_cid},
3375 {"parent", _wrap_Hw_device_parent},
3376 {"children", _wrap_Hw_device_children},
3377 {"next", _wrap_Hw_device_next},
3378 {"depth", _wrap_Hw_device_depth},
3379 {"plugin", _wrap_Hw_device_plugin},
3380 {"dump", _wrap_Hw_device_dump},
3381 {"find_by_name", _wrap_Hw_device_find_by_name},
3382 {"__getitem", _wrap_Hw_device___getitem},
3383 {"__setitem", _wrap_Hw_device___setitem},
3386 static swig_lua_attribute swig_Hw_Device_attributes[] = {
3389 static swig_lua_attribute swig_Hw_Device_cls_attributes[] = {
3392 static swig_lua_method swig_Hw_Device_cls_methods[] = {
3395 static swig_lua_const_info swig_Hw_Device_cls_constants[] = {
3398 static swig_lua_class *swig_Hw_Device_bases[] = {0,0};
3399 static const char *swig_Hw_Device_base_names[] = {"Generic_device *",0};
3400 static swig_lua_class _wrap_class_Hw_Device = { "Hw_device", &SWIGTYPE_p_Hw__Device,0, swig_delete_Hw_device, swig_Hw_Device_methods, swig_Hw_Device_attributes, { "Hw_device", swig_Hw_Device_cls_methods, swig_Hw_Device_cls_attributes, swig_Hw_Device_cls_constants }, swig_Hw_Device_bases, swig_Hw_Device_base_names };
3402 static int _wrap_Hw_dev_factory_create__SWIG_0(lua_State* L) { int SWIG_arg = 0;
3403 Hw::Device_factory *arg1 = (Hw::Device_factory *) 0 ; Hw::Device *result = 0 ;
3404 SWIG_check_num_args("Hw::Device_factory::create",1,1)
3405 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Hw::Device_factory::create",1,"Hw::Device_factory *");
3406 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device_factory,0))){
3407 SWIG_fail_ptr("Hw_dev_factory_create",1,SWIGTYPE_p_Hw__Device_factory); } result = (Hw::Device *)(arg1)->create();
3408 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3410 static int _wrap_Hw_dev_factory_create__SWIG_1(lua_State* L) { int SWIG_arg = 0; char *arg1 = (char *) 0 ;
3411 Hw::Device *result = 0 ; SWIG_check_num_args("Hw::Device_factory::create",1,1)
3412 if(!SWIG_lua_isnilstring(L,1)) SWIG_fail_arg("Hw::Device_factory::create",1,"char const *");
3413 arg1 = (char *)lua_tostring(L, 1); result = (Hw::Device *)Hw::Device_factory::create((char const *)arg1);
3414 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3416 static int _wrap_Hw_dev_factory_create(lua_State* L) { int argc; int argv[2]={ 1,2} ; argc = lua_gettop(L); if (argc == 1) {
3417 int _v; { void *ptr;
3418 if (SWIG_isptrtype(L,argv[0])==0 || SWIG_ConvertPtr(L,argv[0], (void **) &ptr, SWIGTYPE_p_Hw__Device_factory, 0)) {
3419 _v = 0; } else { _v = 1; } } if (_v) { return _wrap_Hw_dev_factory_create__SWIG_0(L);} } if (argc == 1) { int _v; {
3420 _v = SWIG_lua_isnilstring(L,argv[0]); } if (_v) { return _wrap_Hw_dev_factory_create__SWIG_1(L);} }
3421 SWIG_Lua_pusherrstring(L,"Wrong arguments for overloaded function 'Hw_dev_factory_create'\n"
3422 " Possible C/C++ prototypes are:\n" " Hw::Device_factory::create()\n" " Hw::Device_factory::create(char const *)\n");
3423 lua_error(L);return 0; }
3424 static swig_lua_method swig_Hw_Device_factory_methods[] = {
3427 static swig_lua_attribute swig_Hw_Device_factory_attributes[] = {
3430 static swig_lua_attribute swig_Hw_Device_factory_cls_attributes[] = {
3433 static swig_lua_method swig_Hw_Device_factory_cls_methods[] = {
3434 {"create", _wrap_Hw_dev_factory_create},
3437 static swig_lua_const_info swig_Hw_Device_factory_cls_constants[] = {
3440 static swig_lua_class *swig_Hw_Device_factory_bases[] = {0};
3441 static const char *swig_Hw_Device_factory_base_names[] = {0};
3442 static swig_lua_class _wrap_class_Hw_Device_factory = { "Hw_dev_factory", &SWIGTYPE_p_Hw__Device_factory,0,0, swig_Hw_Device_factory_methods, swig_Hw_Device_factory_attributes, { "Hw_dev_factory", swig_Hw_Device_factory_cls_methods, swig_Hw_Device_factory_cls_attributes, swig_Hw_Device_factory_cls_constants }, swig_Hw_Device_factory_bases, swig_Hw_Device_factory_base_names };
3444 static int _wrap_system_bus(lua_State* L) { int SWIG_arg = 0; Hw::Device *result = 0 ; SWIG_check_num_args("system_bus",0,0)
3445 result = (Hw::Device *)system_bus(); SWIG_NewPointerObj(L,result,SWIGTYPE_p_Hw__Device,0); SWIG_arg++; return SWIG_arg;
3446 if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3447 static int _wrap_dump_devs(lua_State* L) { int SWIG_arg = 0; Device *arg1 = (Device *) 0 ; SWIG_check_num_args("dump_devs",1,1)
3448 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("dump_devs",1,"Device *");
3449 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Device,0))){ SWIG_fail_ptr("dump_devs",1,SWIGTYPE_p_Device); }
3450 dump_devs(arg1); return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3451 static int _wrap_add_vbus(lua_State* L) { int SWIG_arg = 0; Vi::Device *arg1 = (Vi::Device *) 0 ; int result;
3452 SWIG_check_num_args("add_vbus",1,1) if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("add_vbus",1,"Vi::Device *");
3453 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Vi__Device,0))){
3454 SWIG_fail_ptr("add_vbus",1,SWIGTYPE_p_Vi__Device); } result = (int)add_vbus(arg1); lua_pushinteger(L, result); SWIG_arg++;
3455 return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L); return SWIG_arg; }
3456 static int _wrap_new_Gpio_resource(lua_State* L) { int SWIG_arg = 0; Hw::Device *arg1 = (Hw::Device *) 0 ; unsigned int arg2 ;
3457 unsigned int arg3 ; Gpio_resource *result = 0 ; SWIG_check_num_args("Gpio_resource::Gpio_resource",3,3)
3458 if(!SWIG_isptrtype(L,1)) SWIG_fail_arg("Gpio_resource::Gpio_resource",1,"Hw::Device *");
3459 if(!lua_isnumber(L,2)) SWIG_fail_arg("Gpio_resource::Gpio_resource",2,"unsigned int");
3460 if(!lua_isnumber(L,3)) SWIG_fail_arg("Gpio_resource::Gpio_resource",3,"unsigned int");
3461 if (!SWIG_IsOK(SWIG_ConvertPtr(L,1,(void**)&arg1,SWIGTYPE_p_Hw__Device,0))){
3462 SWIG_fail_ptr("new_Gpio_resource",1,SWIGTYPE_p_Hw__Device); } arg2 = (unsigned int)lua_tointeger(L, 2);
3463 arg3 = (unsigned int)lua_tointeger(L, 3); try { result = (Gpio_resource *)new Gpio_resource(arg1,arg2,arg3);}
3464 catch(char const *_e) { lua_pushstring(L,_e);SWIG_fail; }
3465 SWIG_NewPointerObj(L,result,SWIGTYPE_p_Gpio_resource,1); SWIG_arg++; return SWIG_arg; if(0) SWIG_fail; fail: lua_error(L);
3467 static void swig_delete_Gpio_resource(void *obj) {
3468 Gpio_resource *arg1 = (Gpio_resource *) obj;
3471 static swig_lua_method swig_Gpio_resource_methods[] = {
3474 static swig_lua_attribute swig_Gpio_resource_attributes[] = {
3477 static swig_lua_attribute swig_Gpio_resource_cls_attributes[] = {
3480 static swig_lua_method swig_Gpio_resource_cls_methods[] = {
3483 static swig_lua_const_info swig_Gpio_resource_cls_constants[] = {
3486 static swig_lua_class *swig_Gpio_resource_bases[] = {0,0};
3487 static const char *swig_Gpio_resource_base_names[] = {"Resource *",0};
3488 static swig_lua_class _wrap_class_Gpio_resource = { "Gpio_resource", &SWIGTYPE_p_Gpio_resource,_wrap_new_Gpio_resource, swig_delete_Gpio_resource, swig_Gpio_resource_methods, swig_Gpio_resource_attributes, { "Gpio_resource", swig_Gpio_resource_cls_methods, swig_Gpio_resource_cls_attributes, swig_Gpio_resource_cls_constants }, swig_Gpio_resource_bases, swig_Gpio_resource_base_names };
3494 static const struct luaL_Reg swig_commands[] = {
3495 { "swig_class",swig_class},
3496 { "swig_instance_of",swig_instance_of},
3497 { "Resource_str_to_id", _wrap_Resource_str_to_id},
3498 { "Vi_dev_factory_create",_wrap_Vi_dev_factory_create},
3499 { "Hw_dev_factory_create",_wrap_Hw_dev_factory_create},
3500 { "system_bus", _wrap_system_bus},
3501 { "dump_devs", _wrap_dump_devs},
3502 { "add_vbus", _wrap_add_vbus},
3506 static swig_lua_var_info swig_variables[] = {
3510 static swig_lua_const_info swig_constants[] = {
3511 {SWIG_LUA_CONSTTAB_INT("Resource_Invalid_res", Resource::Invalid_res)},
3512 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_res", Resource::Irq_res)},
3513 {SWIG_LUA_CONSTTAB_INT("Resource_Mmio_res", Resource::Mmio_res)},
3514 {SWIG_LUA_CONSTTAB_INT("Resource_Io_res", Resource::Io_res)},
3515 {SWIG_LUA_CONSTTAB_INT("Resource_Bus_res", Resource::Bus_res)},
3516 {SWIG_LUA_CONSTTAB_INT("Resource_Gpio_res", Resource::Gpio_res)},
3517 {SWIG_LUA_CONSTTAB_INT("Resource_F_type_mask", Resource::F_type_mask)},
3518 {SWIG_LUA_CONSTTAB_INT("Resource_F_disabled", Resource::F_disabled)},
3519 {SWIG_LUA_CONSTTAB_INT("Resource_F_hierarchical", Resource::F_hierarchical)},
3520 {SWIG_LUA_CONSTTAB_INT("Resource_F_prefetchable", Resource::F_prefetchable)},
3521 {SWIG_LUA_CONSTTAB_INT("Resource_F_size_aligned", Resource::F_size_aligned)},
3522 {SWIG_LUA_CONSTTAB_INT("Resource_F_empty", Resource::F_empty)},
3523 {SWIG_LUA_CONSTTAB_INT("Resource_F_rom", Resource::F_rom)},
3524 {SWIG_LUA_CONSTTAB_INT("Resource_F_can_resize", Resource::F_can_resize)},
3525 {SWIG_LUA_CONSTTAB_INT("Resource_F_can_move", Resource::F_can_move)},
3526 {SWIG_LUA_CONSTTAB_INT("Resource_F_width_64bit", Resource::F_width_64bit)},
3527 {SWIG_LUA_CONSTTAB_INT("Resource_F_relative", Resource::F_relative)},
3528 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_base", Resource::Irq_type_base)},
3529 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_mask", Resource::Irq_type_mask)},
3530 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_none", Resource::Irq_type_none)},
3531 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_level_high", Resource::Irq_type_level_high)},
3532 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_level_low", Resource::Irq_type_level_low)},
3533 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_raising_edge", Resource::Irq_type_raising_edge)},
3534 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_falling_edge", Resource::Irq_type_falling_edge)},
3535 {SWIG_LUA_CONSTTAB_INT("Resource_Irq_type_both_edges", Resource::Irq_type_both_edges)},
3539 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3541 static void *_p_Vi__DeviceTo_p_Generic_device(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3542 return (void *)((Generic_device *) ((Vi::Device *) x));
3544 static void *_p_Hw__DeviceTo_p_Generic_device(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3545 return (void *)((Generic_device *) ((Hw::Device *) x));
3547 static void *_p_Generic_deviceTo_p_Device(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3548 return (void *)((Device *) ((Generic_device *) x));
3550 static void *_p_Vi__DeviceTo_p_Device(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3551 return (void *)((Device *) (Generic_device *) ((Vi::Device *) x));
3553 static void *_p_Hw__DeviceTo_p_Device(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3554 return (void *)((Device *) (Generic_device *) ((Hw::Device *) x));
3556 static void *_p_Root_resourceTo_p_Resource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3557 return (void *)((Resource *) ((Root_resource *) x));
3559 static void *_p_Mmio_data_spaceTo_p_Resource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3560 return (void *)((Resource *) ((Mmio_data_space *) x));
3562 static void *_p_Gpio_resourceTo_p_Resource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3563 return (void *)((Resource *) ((Gpio_resource *) x));
3565 static void *_p_Resource_providerTo_p_Resource(void *x, int *SWIGUNUSEDPARM(newmemory)) {
3566 return (void *)((Resource *) ((Resource_provider *) x));
3568 static swig_type_info _swigt__p_Addr = {"_p_Addr", "Addr *", 0, 0, (void*)0, 0};
3569 static swig_type_info _swigt__p_Device = {"_p_Device", "Device *", 0, 0, (void*)&_wrap_class_Device, 0};
3570 static swig_type_info _swigt__p_Generic_device = {"_p_Generic_device", "Generic_device *", 0, 0, (void*)&_wrap_class_Generic_device, 0};
3571 static swig_type_info _swigt__p_Gpio_resource = {"_p_Gpio_resource", "Gpio_resource *", 0, 0, (void*)&_wrap_class_Gpio_resource, 0};
3572 static swig_type_info _swigt__p_Hw__Device = {"_p_Hw__Device", "Device *|Hw::Device *", 0, 0, (void*)&_wrap_class_Hw_Device, 0};
3573 static swig_type_info _swigt__p_Hw__Device__Prop_val = {"_p_Hw__Device__Prop_val", "Hw::Device::Prop_val *", 0, 0, (void*)0, 0};
3574 static swig_type_info _swigt__p_Hw__Device_factory = {"_p_Hw__Device_factory", "Hw::Device_factory *", 0, 0, (void*)&_wrap_class_Hw_Device_factory, 0};
3575 static swig_type_info _swigt__p_L4Re__Rm__Auto_regionT_l4_addr_t_t = {"_p_L4Re__Rm__Auto_regionT_l4_addr_t_t", "L4Re::Rm::Auto_region< l4_addr_t > *", 0, 0, (void*)0, 0};
3576 static swig_type_info _swigt__p_Mmio_data_space = {"_p_Mmio_data_space", "Mmio_data_space *", 0, 0, (void*)&_wrap_class_Mmio_data_space, 0};
3577 static swig_type_info _swigt__p_Resource = {"_p_Resource", "Resource *", 0, 0, (void*)&_wrap_class_Resource, 0};
3578 static swig_type_info _swigt__p_Root_resource = {"_p_Root_resource", 0, 0, 0, 0, 0};
3579 static swig_type_info _swigt__p_Resource_provider = {"_p_Resource_provider", 0, 0, 0, 0, 0};
3580 static swig_type_info _swigt__p_Resource_space = {"_p_Resource_space", "Resource_space *", 0, 0, (void*)0, 0};
3581 static swig_type_info _swigt__p_Size = {"_p_Size", "Size *", 0, 0, (void*)0, 0};
3582 static swig_type_info _swigt__p_Vi__Dev_factory = {"_p_Vi__Dev_factory", "Vi::Dev_factory *", 0, 0, (void*)&_wrap_class_Vi_Dev_factory, 0};
3583 static swig_type_info _swigt__p_Vi__Device = {"_p_Vi__Device", "Device *|Vi::Device *", 0, 0, (void*)&_wrap_class_Vi_Device, 0};
3584 static swig_type_info _swigt__p_l4vbus_device_handle_t = {"_p_l4vbus_device_handle_t", "l4vbus_device_handle_t *", 0, 0, (void*)0, 0};
3585 static swig_type_info _swigt__p_std__string = {"_p_std__string", "std::string *", 0, 0, (void*)&_wrap_class_std_string, 0};
3587 static swig_type_info *swig_type_initial[] = {
3590 &_swigt__p_Generic_device,
3591 &_swigt__p_Gpio_resource,
3592 &_swigt__p_Hw__Device,
3593 &_swigt__p_Hw__Device__Prop_val,
3594 &_swigt__p_Hw__Device_factory,
3595 &_swigt__p_L4Re__Rm__Auto_regionT_l4_addr_t_t,
3596 &_swigt__p_Mmio_data_space,
3597 &_swigt__p_Resource,
3598 &_swigt__p_Resource_provider,
3599 &_swigt__p_Resource_space,
3600 &_swigt__p_Root_resource,
3602 &_swigt__p_Vi__Dev_factory,
3603 &_swigt__p_Vi__Device,
3604 &_swigt__p_l4vbus_device_handle_t,
3605 &_swigt__p_std__string,
3608 static swig_cast_info _swigc__p_Addr[] = { {&_swigt__p_Addr, 0, 0, 0},{0, 0, 0, 0}};
3609 static swig_cast_info _swigc__p_Device[] = { {&_swigt__p_Generic_device, _p_Generic_deviceTo_p_Device, 0, 0}, {&_swigt__p_Device, 0, 0, 0}, {&_swigt__p_Vi__Device, _p_Vi__DeviceTo_p_Device, 0, 0}, {&_swigt__p_Hw__Device, _p_Hw__DeviceTo_p_Device, 0, 0},{0, 0, 0, 0}};
3610 static swig_cast_info _swigc__p_Generic_device[] = { {&_swigt__p_Generic_device, 0, 0, 0}, {&_swigt__p_Vi__Device, _p_Vi__DeviceTo_p_Generic_device, 0, 0}, {&_swigt__p_Hw__Device, _p_Hw__DeviceTo_p_Generic_device, 0, 0},{0, 0, 0, 0}};
3611 static swig_cast_info _swigc__p_Gpio_resource[] = { {&_swigt__p_Gpio_resource, 0, 0, 0},{0, 0, 0, 0}};
3612 static swig_cast_info _swigc__p_Hw__Device[] = { {&_swigt__p_Hw__Device, 0, 0, 0},{0, 0, 0, 0}};
3613 static swig_cast_info _swigc__p_Hw__Device__Prop_val[] = { {&_swigt__p_Hw__Device__Prop_val, 0, 0, 0},{0, 0, 0, 0}};
3614 static swig_cast_info _swigc__p_Hw__Device_factory[] = { {&_swigt__p_Hw__Device_factory, 0, 0, 0},{0, 0, 0, 0}};
3615 static swig_cast_info _swigc__p_L4Re__Rm__Auto_regionT_l4_addr_t_t[] = { {&_swigt__p_L4Re__Rm__Auto_regionT_l4_addr_t_t, 0, 0, 0},{0, 0, 0, 0}};
3616 static swig_cast_info _swigc__p_Mmio_data_space[] = { {&_swigt__p_Mmio_data_space, 0, 0, 0},{0, 0, 0, 0}};
3617 static swig_cast_info _swigc__p_Root_resource[] = {{&_swigt__p_Root_resource, 0, 0, 0},{0, 0, 0, 0}};
3618 static swig_cast_info _swigc__p_Resource_provider[] = {{&_swigt__p_Resource_provider, 0, 0, 0},{0, 0, 0, 0}};
3619 static swig_cast_info _swigc__p_Resource[] = { {&_swigt__p_Resource, 0, 0, 0}, {&_swigt__p_Root_resource, _p_Root_resourceTo_p_Resource, 0, 0}, {&_swigt__p_Mmio_data_space, _p_Mmio_data_spaceTo_p_Resource, 0, 0}, {&_swigt__p_Gpio_resource, _p_Gpio_resourceTo_p_Resource, 0, 0}, {&_swigt__p_Resource_provider, _p_Resource_providerTo_p_Resource, 0, 0},{0, 0, 0, 0}};
3620 static swig_cast_info _swigc__p_Resource_space[] = { {&_swigt__p_Resource_space, 0, 0, 0},{0, 0, 0, 0}};
3621 static swig_cast_info _swigc__p_Size[] = { {&_swigt__p_Size, 0, 0, 0},{0, 0, 0, 0}};
3622 static swig_cast_info _swigc__p_Vi__Dev_factory[] = { {&_swigt__p_Vi__Dev_factory, 0, 0, 0},{0, 0, 0, 0}};
3623 static swig_cast_info _swigc__p_Vi__Device[] = { {&_swigt__p_Vi__Device, 0, 0, 0},{0, 0, 0, 0}};
3624 static swig_cast_info _swigc__p_l4vbus_device_handle_t[] = { {&_swigt__p_l4vbus_device_handle_t, 0, 0, 0},{0, 0, 0, 0}};
3625 static swig_cast_info _swigc__p_std__string[] = { {&_swigt__p_std__string, 0, 0, 0},{0, 0, 0, 0}};
3627 static swig_cast_info *swig_cast_initial[] = {
3630 _swigc__p_Generic_device,
3631 _swigc__p_Gpio_resource,
3632 _swigc__p_Hw__Device,
3633 _swigc__p_Hw__Device__Prop_val,
3634 _swigc__p_Hw__Device_factory,
3635 _swigc__p_L4Re__Rm__Auto_regionT_l4_addr_t_t,
3636 _swigc__p_Mmio_data_space,
3638 _swigc__p_Resource_provider,
3639 _swigc__p_Resource_space,
3640 _swigc__p_Root_resource,
3642 _swigc__p_Vi__Dev_factory,
3643 _swigc__p_Vi__Device,
3644 _swigc__p_l4vbus_device_handle_t,
3645 _swigc__p_std__string,
3649 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3651 /* -----------------------------------------------------------------------------
3652 * Type initialization:
3653 * This problem is tough by the requirement that no dynamic
3654 * memory is used. Also, since swig_type_info structures store pointers to
3655 * swig_cast_info structures and swig_cast_info structures store pointers back
3656 * to swig_type_info structures, we need some lookup code at initialization.
3657 * The idea is that swig generates all the structures that are needed.
3658 * The runtime then collects these partially filled structures.
3659 * The SWIG_InitializeModule function takes these initial arrays out of
3660 * swig_module, and does all the lookup, filling in the swig_module.types
3661 * array with the correct data and linking the correct swig_cast_info
3662 * structures together.
3664 * The generated swig_type_info structures are assigned staticly to an initial
3665 * array. We just loop through that array, and handle each type individually.
3666 * First we lookup if this type has been already loaded, and if so, use the
3667 * loaded structure instead of the generated one. Then we have to fill in the
3668 * cast linked list. The cast data is initially stored in something like a
3669 * two-dimensional array. Each row corresponds to a type (there are the same
3670 * number of rows as there are in the swig_type_initial array). Each entry in
3671 * a column is one of the swig_cast_info structures for that type.
3672 * The cast_initial array is actually an array of arrays, because each row has
3673 * a variable number of columns. So to actually build the cast linked list,
3674 * we find the array of casts associated with the type, and loop through it
3675 * adding the casts to the list. The one last trick we need to do is making
3676 * sure the type pointer in the swig_cast_info struct is correct.
3678 * First off, we lookup the cast->type name to see if it is already loaded.
3679 * There are three cases to handle:
3680 * 1) If the cast->type has already been loaded AND the type we are adding
3681 * casting info to has not been loaded (it is in this module), THEN we
3682 * replace the cast->type pointer with the type pointer that has already
3684 * 2) If BOTH types (the one we are adding casting info to, and the
3685 * cast->type) are loaded, THEN the cast info has already been loaded by
3686 * the previous module so we just ignore it.
3687 * 3) Finally, if cast->type has not already been loaded, then we add that
3688 * swig_cast_info to the linked list (because the cast->type) pointer will
3690 * ----------------------------------------------------------------------------- */
3693 // removed: extern "C" {
3700 #define SWIGRUNTIME_DEBUG
3705 SWIG_InitializeModule(void *clientdata) {
3707 swig_module_info *module_head, *iter;
3710 /* check to see if the circular list has been setup, if not, set it up */
3711 if (swig_module.next==0) {
3712 /* Initialize the swig_module */
3713 swig_module.type_initial = swig_type_initial;
3714 swig_module.cast_initial = swig_cast_initial;
3715 swig_module.next = &swig_module;
3721 /* Try and load any already created modules */
3722 module_head = SWIG_GetModule(clientdata);
3724 /* This is the first module loaded for this interpreter */
3725 /* so set the swig module into the interpreter */
3726 SWIG_SetModule(clientdata, &swig_module);
3727 module_head = &swig_module;
3729 /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3733 if (iter==&swig_module) {
3738 } while (iter!= module_head);
3740 /* if the is found in the list, then all is done and we may leave */
3742 /* otherwise we must add out module into the list */
3743 swig_module.next = module_head->next;
3744 module_head->next = &swig_module;
3747 /* When multiple interpreters are used, a module could have already been initialized in
3748 a different interpreter, but not yet have a pointer in this interpreter.
3749 In this case, we do not want to continue adding types... everything should be
3751 if (init == 0) return;
3753 /* Now work on filling in swig_module.types */
3754 #ifdef SWIGRUNTIME_DEBUG
3755 printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3757 for (i = 0; i < swig_module.size; ++i) {
3758 swig_type_info *type = 0;
3759 swig_type_info *ret;
3760 swig_cast_info *cast;
3762 #ifdef SWIGRUNTIME_DEBUG
3763 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3766 /* if there is another module already loaded */
3767 if (swig_module.next != &swig_module) {
3768 type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3771 /* Overwrite clientdata field */
3772 #ifdef SWIGRUNTIME_DEBUG
3773 printf("SWIG_InitializeModule: found type %s\n", type->name);
3775 if (swig_module.type_initial[i]->clientdata) {
3776 type->clientdata = swig_module.type_initial[i]->clientdata;
3777 #ifdef SWIGRUNTIME_DEBUG
3778 printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3782 type = swig_module.type_initial[i];
3785 /* Insert casting types */
3786 cast = swig_module.cast_initial[i];
3787 while (cast->type) {
3789 /* Don't need to add information already in the list */
3791 #ifdef SWIGRUNTIME_DEBUG
3792 printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3794 if (swig_module.next != &swig_module) {
3795 ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3796 #ifdef SWIGRUNTIME_DEBUG
3797 if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3801 if (type == swig_module.type_initial[i]) {
3802 #ifdef SWIGRUNTIME_DEBUG
3803 printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3808 /* Check for casting already in the list */
3809 swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3810 #ifdef SWIGRUNTIME_DEBUG
3811 if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3813 if (!ocast) ret = 0;
3818 #ifdef SWIGRUNTIME_DEBUG
3819 printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3822 type->cast->prev = cast;
3823 cast->next = type->cast;
3829 /* Set entry in modules->types array equal to the type */
3830 swig_module.types[i] = type;
3832 swig_module.types[i] = 0;
3834 #ifdef SWIGRUNTIME_DEBUG
3835 printf("**** SWIG_InitializeModule: Cast List ******\n");
3836 for (i = 0; i < swig_module.size; ++i) {
3838 swig_cast_info *cast = swig_module.cast_initial[i];
3839 printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3840 while (cast->type) {
3841 printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3845 printf("---- Total casts: %d\n",j);
3847 printf("**** SWIG_InitializeModule: Cast List ******\n");
3851 /* This function will propagate the clientdata field of type to
3852 * any new swig_type_info structures that have been added into the list
3853 * of equivalent types. It is like calling
3854 * SWIG_TypeClientData(type, clientdata) a second time.
3857 SWIG_PropagateClientData(void) {
3859 swig_cast_info *equiv;
3860 static int init_run = 0;
3862 if (init_run) return;
3865 for (i = 0; i < swig_module.size; i++) {
3866 if (swig_module.types[i]->clientdata) {
3867 equiv = swig_module.types[i]->cast;
3869 if (!equiv->converter) {
3870 if (equiv->type && !equiv->type->clientdata)
3871 SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3873 equiv = equiv->next;
3888 /* Forward declaration of where the user's %init{} gets inserted */
3889 void SWIG_init_user(lua_State* L );
3892 // removed: extern "C" {
3894 /* this is the initialization function
3895 added at the very end of the code
3896 the function is always called SWIG_init, but an earlier #define will rename it
3898 #if ((SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUA) || (SWIG_LUA_TARGET == SWIG_LUA_FLAVOR_ELUAC))
3899 LUALIB_API int SWIG_init(lua_State* L)
3901 SWIGEXPORT int SWIG_init(lua_State* L) /* default Lua action */
3904 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC) /* valid for both Lua and eLua */
3906 /* start with global table */
3907 lua_pushglobaltable (L);
3908 /* SWIG's internal initalisation */
3909 SWIG_InitializeModule((void*)L);
3910 SWIG_PropagateClientData();
3913 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
3914 /* add a global fn */
3915 SWIG_Lua_add_function(L,"swig_type",SWIG_Lua_type);
3916 SWIG_Lua_add_function(L,"swig_equals",SWIG_Lua_equal);
3917 /* begin the module (its a table with the same name as the module) */
3918 SWIG_Lua_module_begin(L,SWIG_name);
3919 /* add commands/functions */
3920 for (i = 0; swig_commands[i].name; i++){
3921 SWIG_Lua_module_add_function(L,swig_commands[i].name,swig_commands[i].func);
3924 for (i = 0; swig_variables[i].name; i++){
3925 SWIG_Lua_module_add_variable(L,swig_variables[i].name,swig_variables[i].get,swig_variables[i].set);
3929 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
3930 /* set up base class pointers (the hierarchy) */
3931 for (i = 0; swig_types[i]; i++){
3932 if (swig_types[i]->clientdata){
3933 SWIG_Lua_init_base_class(L,(swig_lua_class*)(swig_types[i]->clientdata));
3936 /* additional registration structs & classes in lua */
3937 for (i = 0; swig_types[i]; i++){
3938 if (swig_types[i]->clientdata){
3939 SWIG_Lua_class_register(L,(swig_lua_class*)(swig_types[i]->clientdata));
3944 #if ((SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUA) && (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC))
3946 SWIG_Lua_InstallConstants(L,swig_constants);
3949 #if (SWIG_LUA_TARGET != SWIG_LUA_FLAVOR_ELUAC)
3950 /* invoke user-specific initialization */
3953 /* Note: We do not clean up the stack here (Lua will do this for us). At this
3954 point, we have the globals table and out module table on the stack. Returning
3955 one value makes the module table the result of the require command. */
3967 const char* SWIG_LUACODE=
3970 "local function check_device(dev, depth, err)\n"
3971 " if not Io.swig_instance_of(dev, \"Generic_device *\") then\n"
3972 " local e = err or \"expected device, got: \" .. tostring(dev);\n"
3973 " error(e, depth + 1);\n"
3980 "function Io.Res.io(start, _end, flags)\n"
3981 " local f = flags or 0\n"
3982 " return Io.Resource(Io.Resource_Io_res, f, start, _end or start)\n"
3985 "function Io.Res.mmio(start, _end, flags)\n"
3986 " local f = flags or 0\n"
3987 " return Io.Resource(Io.Resource_Mmio_res, f, start, _end or start)\n"
3990 "function Io.Res.irq(start, flags)\n"
3991 " local f = flags or 0\n"
3993 " if type(start) == \"table\" then\n"
4000 " return Io.Resource(Io.Resource_Irq_res, f, s, e)\n"
4005 "function Io.Dt.add_child(parent, name, dev, idx)\n"
4006 " parent:add_child(dev)\n"
4007 " if dev.plugin and (parent:parent() or swig_equals(parent, Io.system_bus())) then\n"
4010 " if type(name) == \"string\" then\n"
4011 " if idx ~= nil then\n"
4012 " name = name .. '[' .. idx ..']'\n"
4014 " dev:set_name(name)\n"
4018 "function Io.Dt.add_children(parent, bus_func)\n"
4019 " check_device(parent, 2);\n"
4020 " if type(bus_func) == \"function\" then\n"
4022 " local my_env = getfenv(1)\n"
4023 " local old_ENV = my_env._ENV;\n"
4024 " my_env._ENV = d;\n"
4025 " setmetatable(d, { __index = my_env })\n"
4026 " setfenv(bus_func, d)\n"
4028 " my_env._ENV = old_ENV;\n"
4029 " Io.Dt.add_device_data(parent, d)\n"
4034 "function Io.Dt.iterator(dev, max_depth)\n"
4035 " local max_d = (max_depth or 0) + dev:depth()\n"
4036 " local current = dev\n"
4037 " local start = dev\n"
4038 " return function ()\n"
4039 " local c = current\n"
4040 " if c == nil then\n"
4044 " local cd = c:depth()\n"
4045 " local cc = c:children()\n"
4046 " if max_d > cd and cc then\n"
4049 " elseif c:next() then\n"
4050 " current = c:next()\n"
4054 " while (true) do\n"
4056 " if (not p) or swig_equals(p, start) then\n"
4059 " elseif p:next() then\n"
4060 " current = p:next()\n"
4068 "function Io.Dt.match_cids(self, ...)\n"
4070 " for _, v in ipairs{...} do\n"
4071 " if self:match_cid(v) then\n"
4080 " storage = \"CC_01\",\n"
4081 " network = \"CC_02\",\n"
4082 " display = \"CC_03\",\n"
4083 " media = \"CC_04\",\n"
4084 " bridge = \"CC_06\",\n"
4085 " com = \"CC_07\",\n"
4086 " usb = \"CC_0c\",\n"
4087 " wlan = \"CC_0d\",\n"
4090 "Io.Dt.MAX_DEPTH = 1000\n"
4092 "function Io.Dt.Range(start, stop)\n"
4093 " return { range = true, start, stop }\n"
4096 "function Io.Dt.match(self, ...)\n"
4097 " local cids = {...}\n"
4098 " for t,v in pairs(Io.Dt.PCI_cc) do\n"
4099 " for i, cid in ipairs(cids) do\n"
4100 " cids[i] = cid:gsub(\"(PCI/\"..t..\")\", \"PCI/\" .. v)\n"
4104 " local devs = {}\n"
4105 " for d in self:devices(Io.Dt.MAX_DEPTH) do\n"
4106 " if d:match_cids(unpack(cids)) then\n"
4107 " devs[#devs+1] = d\n"
4113 "function Io.Dt.device(self, path)\n"
4114 " for i in string.gmatch(path, \"([^%./]+)%.*\") do\n"
4115 " self = self:find_by_name(i)\n"
4116 " if self == nil then\n"
4123 "function Io.Dt.resources(self)\n"
4124 " local n = self:nresources()\n"
4126 " return function ()\n"
4127 " if c >= n then return nil end\n"
4129 " return self:resource(c - 1)\n"
4133 "local hwfn = Io.swig_class(\"Hw_device\")[\".fn\"]\n"
4134 "local vifn = Io.swig_class(\"Vi_device\")[\".fn\"]\n"
4138 " resources = Io.Dt.resources,\n"
4139 " devices = Io.Dt.iterator,\n"
4140 " match_cids = Io.Dt.match_cids,\n"
4141 " match = Io.Dt.match,\n"
4142 " device = Io.Dt.device\n"
4145 "for name, func in pairs(dev_fns) do\n"
4146 " hwfn[name] = func\n"
4147 " vifn[name] = func\n"
4150 "function vifn:add_filter_val(tag, value)\n"
4151 " if type(value) == \"table\" and value.range then\n"
4152 " return self:add_filter(tag, value[1], value[2])\n"
4153 " elseif type(value) == \"table\" then\n"
4154 " for _, v in ipairs(value) do\n"
4155 " local res = self:add_filter_val(tag, v)\n"
4156 " if res < 0 then\n"
4162 " return self:add_filter(tag, value)\n"
4166 "local add_child = Io.Dt.add_child\n"
4168 "local function handle_device_member(dev, val, name)\n"
4169 " if name == \"compatible\" then\n"
4170 " if type(val) == \"table\" then\n"
4171 " for k, v in ipairs(val) do\n"
4174 " elseif type(val) == \"string\" then\n"
4175 " dev:add_cid(val)\n"
4178 " elseif type(val) == \"table\" then\n"
4179 " for i, v in pairs(val) do\n"
4180 " handle_device_member(dev, v, name .. '[' .. i .. ']')\n"
4183 " elseif Io.swig_instance_of(val, \"Resource *\") then\n"
4184 " val:set_id(name)\n"
4185 " dev:add_resource(val)\n"
4187 " elseif Io.swig_instance_of(val, \"Generic_device *\") then\n"
4188 " add_child(dev, name, val)\n"
4191 " local sp = dev.set_property\n"
4192 " if type(sp) == \"function\" then\n"
4193 " sp(dev, name, val)\n"
4197 " print(\"ERROR: cannot handle device member: \" .. tostring(name) .. \": \" .. tostring(val))\n"
4200 "function Io.Dt.add_resource(dev, res)\n"
4201 " if not Io.swig_instance_of(dev, \"Generic_device *\") then\n"
4202 " error(\"expected a device got: \" .. tostring(dev), 2)\n"
4204 " if not Io.swig_instance_of(res, \"Resource *\") then\n"
4205 " error(\"expected a resource got: \" .. tostring(res), 2)\n"
4207 " dev:add_resource(res)\n"
4210 "function Io.Dt.add_device_data(dev, data)\n"
4212 " for i, v in ipairs(data) do\n"
4213 " handle_device_member(dev, v, i)\n"
4216 " for k, v in pairs(data) do\n"
4217 " if (type(k) ~= \"number\") or (k > maxi) then\n"
4218 " handle_device_member(dev, v, k)\n"
4223 "local set_dev_data = Io.Dt.add_device_data\n"
4224 "local add_children = Io.Dt.add_children\n"
4228 "setmetatable(Io.Hw, { __index = function (self, t)\n"
4229 " return function (data)\n"
4230 " local b = check_device(Io.Hw_dev_factory_create(t), 3, \"could not create device: \" .. t)\n"
4231 " if type(data) == \"function\" then\n"
4232 " add_children(b, data)\n"
4233 " elseif type(data) == \"table\" then\n"
4234 " set_dev_data(b, data)\n"
4240 "function Io.hw_add_devices(data)\n"
4241 " local sb = Io.system_bus()\n"
4242 " local dtype = type(data)\n"
4243 " if dtype == 'function' then\n"
4244 " Io.Dt.add_children(sb, data)\n"
4245 " elseif dtype == 'table' then\n"
4246 " for n, dev in pairs(data) do\n"
4247 " if type(n) == \"string\" then\n"
4248 " dev:set_property(\"name\", n)\n"
4250 " sb:add_child(dev)\n"
4259 "setmetatable(Io.Vi, { __index = function (self, t)\n"
4260 " return function (data)\n"
4261 " local b = Io.Vi_dev_factory_create(t)\n"
4262 " if type(data) == \"function\" then\n"
4263 " add_children(b, data)\n"
4264 " elseif type(data) == \"table\" then\n"
4265 " set_dev_data(b, data)\n"
4271 "function wrap(devs_, filter)\n"
4272 " local devs = devs_\n"
4273 " if type(devs_) ~= \"table\" then\n"
4274 " devs = { devs_ }\n"
4277 " for _, d in ipairs(devs) do\n"
4278 " local vd = Io.Vi_dev_factory_create(d)\n"
4280 " if type(filter) == \"table\" then\n"
4281 " for tag, val in pairs(filter) do\n"
4282 " local res = vd:add_filter_val(tag, val)\n"
4283 " if res < 0 then\n"
4284 " print(\"ERROR: applying filter expression: \"..tag..\"=...\", debug.traceback(2))\n"
4291 " if #v == 1 then\n"
4298 "local add_vbus = Io.add_vbus\n"
4300 "function Io.add_vbus(name, bus)\n"
4301 " bus:set_name(name)\n"
4305 "function Io.add_vbusses(busses)\n"
4306 " for name, bus in pairs(busses) do\n"
4307 " Io.add_vbus(name, bus)\n"
4312 void SWIG_init_user(lua_State* L)
4314 /* exec Lua code if applicable */
4315 SWIG_Lua_dostring(L,SWIG_LUACODE);