From 70751dd27c4225955fe018d6829ea45e3e66a51c Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 7 Dec 2004 16:31:16 -0200 Subject: details --- ltablib.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'ltablib.c') diff --git a/ltablib.c b/ltablib.c index d5c3e37c..572730aa 100644 --- a/ltablib.c +++ b/ltablib.c @@ -1,5 +1,5 @@ /* -** $Id: ltablib.c,v 1.25 2004/05/10 18:06:14 roberto Exp roberto $ +** $Id: ltablib.c,v 1.26 2004/06/15 13:37:21 roberto Exp roberto $ ** Library for Table Manipulation ** See Copyright Notice in lua.h */ @@ -19,7 +19,7 @@ #define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n)) -static int luaB_foreachi (lua_State *L) { +static int foreachi (lua_State *L) { int i; int n = aux_getn(L, 1); luaL_checktype(L, 2, LUA_TFUNCTION); @@ -36,7 +36,7 @@ static int luaB_foreachi (lua_State *L) { } -static int luaB_foreach (lua_State *L) { +static int foreach (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); luaL_checktype(L, 2, LUA_TFUNCTION); lua_pushnil(L); /* first key */ @@ -54,13 +54,13 @@ static int luaB_foreach (lua_State *L) { } -static int luaB_getn (lua_State *L) { +static int getn (lua_State *L) { lua_pushinteger(L, aux_getn(L, 1)); return 1; } -static int luaB_setn (lua_State *L) { +static int setn (lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); luaL_setn(L, 1, luaL_checkint(L, 2)); lua_pushvalue(L, 1); @@ -68,7 +68,7 @@ static int luaB_setn (lua_State *L) { } -static int luaB_tinsert (lua_State *L) { +static int tinsert (lua_State *L) { int v = lua_gettop(L); /* number of arguments */ int e = aux_getn(L, 1) + LUA_FIRSTINDEX; /* first empty element */ int pos; /* where to insert new element */ @@ -90,7 +90,7 @@ static int luaB_tinsert (lua_State *L) { } -static int luaB_tremove (lua_State *L) { +static int tremove (lua_State *L) { int e = aux_getn(L, 1) + LUA_FIRSTINDEX - 1; int pos = luaL_optint(L, 2, e); if (e < LUA_FIRSTINDEX) return 0; /* table is `empty' */ @@ -220,7 +220,7 @@ static void auxsort (lua_State *L, int l, int u) { } /* repeat the routine for the larger one */ } -static int luaB_sort (lua_State *L) { +static int sort (lua_State *L) { int n = aux_getn(L, 1); luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */ if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ @@ -235,13 +235,13 @@ static int luaB_sort (lua_State *L) { static const luaL_reg tab_funcs[] = { {"concat", str_concat}, - {"foreach", luaB_foreach}, - {"foreachi", luaB_foreachi}, - {"getn", luaB_getn}, - {"setn", luaB_setn}, - {"sort", luaB_sort}, - {"insert", luaB_tinsert}, - {"remove", luaB_tremove}, + {"foreach", foreach}, + {"foreachi", foreachi}, + {"getn", getn}, + {"setn", setn}, + {"sort", sort}, + {"insert", tinsert}, + {"remove", tremove}, {NULL, NULL} }; -- cgit v1.2.3-55-g6feb