Skip to content

Commit

Permalink
add toboolean
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Apr 4, 2024
1 parent 6f4a3aa commit 7bcdab3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/src/xmake/package/loadxmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ tb_int_t xm_package_loadxmi(lua_State* lua)
{
s_luaops._lua_createtable = &lua_createtable;
s_luaops._lua_tointegerx = &lua_tointegerx;
s_luaops._lua_toboolean = &lua_toboolean;
s_luaops._lua_touserdata = &lua_touserdata;
s_luaops._lua_pushinteger = &lua_pushinteger;
s_luaops._lua_gettop = &lua_gettop;
Expand Down
3 changes: 3 additions & 0 deletions xmake/scripts/module/xmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
// lua interfaces
#define xmi_lua_createtable(lua, narr, nrec) (g_lua_ops)->_lua_createtable(lua, narr, nrec)
#define xmi_lua_tointegerx(lua, idx, isnum) (g_lua_ops)->_lua_tointegerx(lua, idx, isnum)
#define xmi_lua_toboolean(lua, idx) (g_lua_ops)->_lua_toboolean(lua, idx)
#define xmi_lua_touserdata(lua, idx) (g_lua_ops)->_lua_touserdata(lua, idx)
#define xmi_lua_pushinteger(lua, n) (g_lua_ops)->_lua_pushinteger(lua, n)
#define xmi_lua_gettop(lua) (g_lua_ops)->_lua_gettop(lua)
Expand Down Expand Up @@ -121,6 +122,7 @@

# define lua_createtable xmi_lua_createtable
# define lua_tointegerx xmi_lua_tointegerx
# define lua_toboolean xmi_lua_toboolean
# define lua_touserdata xmi_lua_touserdata
# define lua_pushinteger xmi_lua_pushinteger
# define lua_gettop xmi_lua_gettop
Expand Down Expand Up @@ -201,6 +203,7 @@ typedef struct xmi_luaL_Reg_ {
typedef struct xmi_lua_ops_t_ {
void (*_lua_createtable)(lua_State* lua, int narr, int nrec);
lua_Integer (*_lua_tointegerx)(lua_State* lua, int idx, int* isnum);
int (*_lua_toboolean) (lua_State* lua, int idx);
void* (*_lua_touserdata)(lua_State* lua, int idx);
void (*_lua_pushinteger)(lua_State* lua, lua_Integer n);
int (*_lua_gettop)(lua_State* lua);
Expand Down

0 comments on commit 7bcdab3

Please sign in to comment.