示例#1
0
int main (void)
{
	 L = lua_open();
	int i;

	for (i=0; i<10; ++i)
	{
		pp[i] = &p[i];

		ma[i] = a[i];
		mp[i] = p[i];
		mpp[i] = pp[i];

		array.a[i] = a[i];
		array.p[i] = p[i];
		array.pp[i] = pp[i];
	}

	luaopen_base(L);
	luaL_openlibs(L);  /* open libraries */
	tolua_tarray_open(L);
	tolua_TestObject_open(L);
	//luaL_dofile(L,"json.lua");
	luaL_dofile(L,"tarray.lua");
	
	lua_close(L);
	return 0;
}
示例#2
0
int main (void)
{
	int  tolua_tarray_open (lua_State*);
	lua_State* L = lua_open();
	int i;

	for (i=0; i<10; ++i)
	{
		pp[i] = &p[i];

		ma[i] = a[i];
		mp[i] = p[i];
		mpp[i] = pp[i];

		array.a[i] = a[i];
		array.p[i] = p[i];
		array.pp[i] = pp[i];
	}

	luaopen_base(L);
	tolua_tarray_open(L);

	lua_dofile(L,"tarray.lua");

	lua_close(L);
	return 0;
}
示例#3
0
int main (void)
{
	int errcode = 0;
	int  tolua_tarray_open (lua_State*);
	lua_State* L = luaL_newstate();
	int i;

	for (i=0; i<10; ++i)
	{
		pp[i] = &p[i];

		ma[i] = a[i];
		mp[i] = p[i];
		mpp[i] = pp[i];

		array.a[i] = a[i];
		array.p[i] = p[i];
		array.pp[i] = pp[i];
	}

	luaL_openlibs(L);
	tolua_tarray_open(L);

	if (luaL_dofile(L,"tarray.lua") != 0) {
		fprintf(stderr, "%s", lua_tostring(L,1));
		errcode = 1;
	}

	lua_close(L);
	return errcode;
}