diff options
| -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}, |
