lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 19ca2087de4002600b891cf78b3c9b1d939ba2ca
parent 7bdbd833b550bc4b7e6a5c1618845fce567c6af4
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Mon,  8 Feb 1999 14:29:13 -0200

another (silly) debuging function.

Diffstat:
Mlbuiltin.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lbuiltin.c b/lbuiltin.c @@ -1,5 +1,5 @@ /* -** $Id: lbuiltin.c,v 1.48 1999/01/26 15:38:01 roberto Exp roberto $ +** $Id: lbuiltin.c,v 1.49 1999/02/04 19:12:35 roberto Exp roberto $ ** Built-in functions ** See Copyright Notice in lua.h */ @@ -604,6 +604,11 @@ static void mem_query (void) { } +static void query_strings (void) { + lua_pushnumber(L->string_root[luaL_check_int(1)].nuse); +} + + static void countlist (void) { char *s = luaL_check_string(1); GCnode *l = (s[0]=='t') ? L->roottable.next : (s[0]=='c') ? L->rootcl.next : @@ -677,6 +682,7 @@ static struct luaL_reg builtin_funcs[] = { {"testC", testC}, {"totalmem", mem_query}, {"count", countlist}, + {"querystr", query_strings}, #endif {"_ALERT", luaB_alert}, {"_ERRORMESSAGE", error_message},