util-src/table.c
author Kim Alvefur <zash@zash.se>
Mon, 30 May 2016 13:29:43 +0200
changeset 7451 34678ce8a6ac
parent 6618 8e4572a642cb
child 7522 d278a770eddc
permissions -rw-r--r--
core.stanza_router: Remove compatibility with Jabiru not including id attribute (originally added in 9b352c8a32e6)

#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;
}