From 5f46b4102c179680d613b6b9e0e6d392318030d2 Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 8 Nov 2021 10:53:42 +0800 Subject: + tolua --- ThirdParty/tolua-5.2.4/src/tests/tvariable.c | 46 ++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 ThirdParty/tolua-5.2.4/src/tests/tvariable.c (limited to 'ThirdParty/tolua-5.2.4/src/tests/tvariable.c') diff --git a/ThirdParty/tolua-5.2.4/src/tests/tvariable.c b/ThirdParty/tolua-5.2.4/src/tests/tvariable.c new file mode 100644 index 0000000..1ec97e4 --- /dev/null +++ b/ThirdParty/tolua-5.2.4/src/tests/tvariable.c @@ -0,0 +1,46 @@ +#include "lualib.h" +#include "lauxlib.h" + +#include "tvariable.h" + +int i = 1; +float f = 2.0f;; +double d = 3.0; +char* s = "Hello world"; +void* v = (void*)1; +char n[64] = "Hi there"; + +A a = {11,12.0f,13.0,"Hello world from class",(void*)1,"Hi there from class"}; +B* b; +U u; + +int mi = 21; +float mf = 22.0f; +double md = 23.0; +char* ms = "Hello world in module"; +void* mv = NULL; +char mn[64] = "Hi there in module"; +A ma = {31,32.0f,33.0,"Hello world from class in module", + NULL,"Hi there from class in module"}; +B* mb; + +int main (void) +{ + int tolua_tvariable_open (lua_State*); + lua_State* L = luaL_newstate(); + + B bb = {a,NULL}; + B bbb = {ma,&bb}; + b = &bb; + mb = &bbb; + + + luaL_openlibs(L); + tolua_tvariable_open(L); + + luaL_dofile(L,"tvariable.lua"); + + lua_close(L); + return 0; +} + -- cgit v1.1-26-g67d0