aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/table.c
blob: 6ad45dce621ceeb9a01e5a04e9667cc408fc329e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <lua.h>
#include <lauxlib.h>

static int Lcreate_table(lua_State* L) {
	lua_createtable(L, luaL_checkinteger(L, 1), luaL_checkinteger(L, 2));
	return 1;
}

int luaopen_util_table(lua_State* L) {
	lua_newtable(L);
	lua_pushcfunction(L, Lcreate_table);
	lua_setfield(L, -2, "create");
	return 1;
}