aboutsummaryrefslogtreecommitdiff
path: root/ltablib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ltablib.c')
-rw-r--r--ltablib.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ltablib.c b/ltablib.c
index 44d55ef5..c8838963 100644
--- a/ltablib.c
+++ b/ltablib.c
@@ -58,6 +58,14 @@ static void checktab (lua_State *L, int arg, int what) {
58} 58}
59 59
60 60
61static int tcreate (lua_State *L) {
62 int sizeseq = (int)luaL_checkinteger(L, 1);
63 int sizerest = (int)luaL_optinteger(L, 2, 0);
64 lua_createtable(L, sizeseq, sizerest);
65 return 1;
66}
67
68
61static int tinsert (lua_State *L) { 69static int tinsert (lua_State *L) {
62 lua_Integer pos; /* where to insert new element */ 70 lua_Integer pos; /* where to insert new element */
63 lua_Integer e = aux_getn(L, 1, TAB_RW); 71 lua_Integer e = aux_getn(L, 1, TAB_RW);
@@ -390,6 +398,7 @@ static int sort (lua_State *L) {
390 398
391static const luaL_Reg tab_funcs[] = { 399static const luaL_Reg tab_funcs[] = {
392 {"concat", tconcat}, 400 {"concat", tconcat},
401 {"create", tcreate},
393 {"insert", tinsert}, 402 {"insert", tinsert},
394 {"pack", tpack}, 403 {"pack", tpack},
395 {"unpack", tunpack}, 404 {"unpack", tunpack},