/*
** Lua binding: tolua
** Generated automatically by tolua++-1.0.92 on 07/04/07 14:00:26.
*/
/* Exported function */
TOLUA_API int tolua_tolua_open (lua_State* tolua_S);
/*
** Lua binding: tolua
** Generated automatically by tolua++-1.0.92 on 07/04/07 14:00:26.
*/
#ifndef __cplusplus
#include "stdlib.h"
#endif
#include "string.h"
#include "tolua++.h"
/* Exported function */
TOLUA_API int tolua_tolua_open (lua_State* tolua_S);
#include "class.h"
/* function to release collected object via destructor */
#ifdef __cplusplus
static int tolua_collect_A (lua_State* tolua_S)
{
A* self = (A*) tolua_tousertype(tolua_S,1,0);
delete self;
return 0;
}
static int tolua_collect_B (lua_State* tolua_S)
{
B* self = (B*) tolua_tousertype(tolua_S,1,0);
delete self;
return 0;
}
#endif
/* function to register type */
static void tolua_reg_types (lua_State* tolua_S)
{
tolua_usertype(tolua_S,"A");
tolua_usertype(tolua_S,"B");
}
/* method: new of class B */
#ifndef TOLUA_DISABLE_tolua_tolua_B_new00
static int tolua_tolua_B_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertable(tolua_S,1,"B",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
{
B* tolua_ret = (B*) new B();
tolua_pushusertype(tolua_S,(void*)tolua_ret,"B");
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: new_local of class B */
#ifndef TOLUA_DISABLE_tolua_tolua_B_new00_local
static int tolua_tolua_B_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertable(tolua_S,1,"B",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
{
B* tolua_ret = (B*) new B();
tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"B");
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: delete of class B */
#ifndef TOLUA_DISABLE_tolua_tolua_B_delete00
static int tolua_tolua_B_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"B",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
B* self = (B*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
delete self;
}
return 0;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: getInt of class B */
#ifndef TOLUA_DISABLE_tolua_tolua_B_getInt00
static int tolua_tolua_B_getInt00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"B",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
B* self = (B*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getInt'",NULL);
#endif
{
int tolua_ret = (int) self->getInt();
tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'getInt'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: new of class A */
#ifndef TOLUA_DISABLE_tolua_tolua_A_new00
static int tolua_tolua_A_new00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertable(tolua_S,1,"A",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
{
A* tolua_ret = (A*) new A();
tolua_pushusertype(tolua_S,(void*)tolua_ret,"A");
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: new_local of class A */
#ifndef TOLUA_DISABLE_tolua_tolua_A_new00_local
static int tolua_tolua_A_new00_local(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertable(tolua_S,1,"A",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
{
A* tolua_ret = (A*) new A();
tolua_pushusertype_and_takeownership(tolua_S,(void *)tolua_ret,"A");
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'new'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: delete of class A */
#ifndef TOLUA_DISABLE_tolua_tolua_A_delete00
static int tolua_tolua_A_delete00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"A",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
A* self = (A*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'delete'",NULL);
#endif
delete self;
}
return 0;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'delete'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* method: getB of class A */
#ifndef TOLUA_DISABLE_tolua_tolua_A_getB00
static int tolua_tolua_A_getB00(lua_State* tolua_S)
{
#ifndef TOLUA_RELEASE
tolua_Error tolua_err;
if (
!tolua_isusertype(tolua_S,1,"A",0,&tolua_err) ||
!tolua_isnoobj(tolua_S,2,&tolua_err)
)
goto tolua_lerror;
else
#endif
{
A* self = (A*) tolua_tousertype(tolua_S,1,0);
#ifndef TOLUA_RELEASE
if (!self) tolua_error(tolua_S,"invalid 'self' in function 'getB'",NULL);
#endif
{
B* tolua_ret = (B*) self->getB();
tolua_pushusertype(tolua_S,(void*)tolua_ret,"B");
}
}
return 1;
#ifndef TOLUA_RELEASE
tolua_lerror:
tolua_error(tolua_S,"#ferror in function 'getB'.",&tolua_err);
return 0;
#endif
}
#endif //#ifndef TOLUA_DISABLE
/* Open function */
TOLUA_API int tolua_tolua_open (lua_State* tolua_S)
{
tolua_open(tolua_S);
tolua_reg_types(tolua_S);
tolua_module(tolua_S,NULL,0);
tolua_beginmodule(tolua_S,NULL);
#ifdef __cplusplus
tolua_cclass(tolua_S,"B","B","",tolua_collect_B);
#else
tolua_cclass(tolua_S,"B","B","",NULL);
#endif
tolua_beginmodule(tolua_S,"B");
tolua_function(tolua_S,"new",tolua_tolua_B_new00);
tolua_function(tolua_S,"new_local",tolua_tolua_B_new00_local);
tolua_function(tolua_S,".call",tolua_tolua_B_new00_local);
tolua_function(tolua_S,"delete",tolua_tolua_B_delete00);
tolua_function(tolua_S,"getInt",tolua_tolua_B_getInt00);
tolua_endmodule(tolua_S);
#ifdef __cplusplus
tolua_cclass(tolua_S,"A","A","",tolua_collect_A);
#else
tolua_cclass(tolua_S,"A","A","",NULL);
#endif
tolua_beginmodule(tolua_S,"A");
tolua_function(tolua_S,"new",tolua_tolua_A_new00);
tolua_function(tolua_S,"new_local",tolua_tolua_A_new00_local);
tolua_function(tolua_S,".call",tolua_tolua_A_new00_local);
tolua_function(tolua_S,"delete",tolua_tolua_A_delete00);
tolua_function(tolua_S,"getB",tolua_tolua_A_getB00);
tolua_endmodule(tolua_S);
tolua_endmodule(tolua_S);
return 1;
}
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501
TOLUA_API int luaopen_tolua (lua_State* tolua_S) {
return tolua_tolua_open(tolua_S);
};
#endif
댓글을 달아 주세요
뷁
부렉