aboutsummaryrefslogtreecommitdiff
path: root/lbuiltin.c
diff options
context:
space:
mode:
Diffstat (limited to 'lbuiltin.c')
-rw-r--r--lbuiltin.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/lbuiltin.c b/lbuiltin.c
index 44b3bf23..a307e883 100644
--- a/lbuiltin.c
+++ b/lbuiltin.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbuiltin.c,v 1.47 1999/01/25 12:30:11 roberto Exp roberto $ 2** $Id: lbuiltin.c,v 1.48 1999/01/26 15:38:01 roberto Exp roberto $
3** Built-in functions 3** Built-in functions
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -71,11 +71,6 @@ static Hash *gethash (int arg) {
71 return avalue(luaA_Address(luaL_tablearg(arg))); 71 return avalue(luaA_Address(luaL_tablearg(arg)));
72} 72}
73 73
74
75static void luaB_getn (void) {
76 lua_pushnumber(getnarg(gethash(1)));
77}
78
79/* }====================================================== */ 74/* }====================================================== */
80 75
81 76
@@ -306,6 +301,7 @@ static void luaB_call (void) {
306/* }====================================================== */ 301/* }====================================================== */
307 302
308 303
304#ifdef EXTRALIB
309/* 305/*
310** {====================================================== 306** {======================================================
311** "Extra" functions 307** "Extra" functions
@@ -385,6 +381,11 @@ static void luaB_foreachvar (void) {
385} 381}
386 382
387 383
384static void luaB_getn (void) {
385 lua_pushnumber(getnarg(gethash(1)));
386}
387
388
388static void luaB_tinsert (void) { 389static void luaB_tinsert (void) {
389 Hash *a = gethash(1); 390 Hash *a = gethash(1);
390 lua_Object v = lua_getparam(3); 391 lua_Object v = lua_getparam(3);
@@ -500,6 +501,7 @@ static void luaB_sort (void) {
500} 501}
501 502
502/* }}===================================================== */ 503/* }}===================================================== */
504#endif
503 505
504 506
505/* 507/*
@@ -685,7 +687,6 @@ static struct luaL_reg builtin_funcs[] = {
685 {"dostring", luaB_dostring}, 687 {"dostring", luaB_dostring},
686 {"error", luaB_error}, 688 {"error", luaB_error},
687 {"getglobal", luaB_getglobal}, 689 {"getglobal", luaB_getglobal},
688 {"getn", luaB_getn},
689 {"gettagmethod", luaB_gettagmethod}, 690 {"gettagmethod", luaB_gettagmethod},
690 {"newtag", luaB_newtag}, 691 {"newtag", luaB_newtag},
691 {"next", luaB_next}, 692 {"next", luaB_next},
@@ -702,15 +703,18 @@ static struct luaL_reg builtin_funcs[] = {
702 {"tag", luaB_luatag}, 703 {"tag", luaB_luatag},
703 {"tonumber", luaB_tonumber}, 704 {"tonumber", luaB_tonumber},
704 {"tostring", luaB_tostring}, 705 {"tostring", luaB_tostring},
705 {"type", luaB_type}, 706 {"type", luaB_type}
706/* "Extra" functions */ 707#ifdef EXTRALIB
707 {"assert", luaB_assert}, 708 /* "Extra" functions */
709 ,{"assert", luaB_assert},
708 {"foreach", luaB_foreach}, 710 {"foreach", luaB_foreach},
709 {"foreachi", luaB_foreachi}, 711 {"foreachi", luaB_foreachi},
710 {"foreachvar", luaB_foreachvar}, 712 {"foreachvar", luaB_foreachvar},
713 {"getn", luaB_getn},
711 {"sort", luaB_sort}, 714 {"sort", luaB_sort},
712 {"tinsert", luaB_tinsert}, 715 {"tinsert", luaB_tinsert},
713 {"tremove", luaB_tremove} 716 {"tremove", luaB_tremove}
717#endif
714}; 718};
715 719
716 720