diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-08 14:29:35 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-02-08 14:29:35 -0200 |
commit | 19ca2087de4002600b891cf78b3c9b1d939ba2ca (patch) | |
tree | f685099e74b71d2e9760ab7a225dd7afd39facb6 | |
parent | 7bdbd833b550bc4b7e6a5c1618845fce567c6af4 (diff) | |
download | lua-19ca2087de4002600b891cf78b3c9b1d939ba2ca.tar.gz lua-19ca2087de4002600b891cf78b3c9b1d939ba2ca.tar.bz2 lua-19ca2087de4002600b891cf78b3c9b1d939ba2ca.zip |
another (silly) debuging function.
-rw-r--r-- | lbuiltin.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbuiltin.c,v 1.48 1999/01/26 15:38:01 roberto Exp roberto $ | 2 | ** $Id: lbuiltin.c,v 1.49 1999/02/04 19:12:35 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 | */ |
@@ -604,6 +604,11 @@ static void mem_query (void) { | |||
604 | } | 604 | } |
605 | 605 | ||
606 | 606 | ||
607 | static void query_strings (void) { | ||
608 | lua_pushnumber(L->string_root[luaL_check_int(1)].nuse); | ||
609 | } | ||
610 | |||
611 | |||
607 | static void countlist (void) { | 612 | static void countlist (void) { |
608 | char *s = luaL_check_string(1); | 613 | char *s = luaL_check_string(1); |
609 | GCnode *l = (s[0]=='t') ? L->roottable.next : (s[0]=='c') ? L->rootcl.next : | 614 | GCnode *l = (s[0]=='t') ? L->roottable.next : (s[0]=='c') ? L->rootcl.next : |
@@ -677,6 +682,7 @@ static struct luaL_reg builtin_funcs[] = { | |||
677 | {"testC", testC}, | 682 | {"testC", testC}, |
678 | {"totalmem", mem_query}, | 683 | {"totalmem", mem_query}, |
679 | {"count", countlist}, | 684 | {"count", countlist}, |
685 | {"querystr", query_strings}, | ||
680 | #endif | 686 | #endif |
681 | {"_ALERT", luaB_alert}, | 687 | {"_ALERT", luaB_alert}, |
682 | {"_ERRORMESSAGE", error_message}, | 688 | {"_ERRORMESSAGE", error_message}, |