diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-09 19:51:06 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-01-09 19:51:06 -0200 |
| commit | ea2a75d19e260ad728d0b804d824c619bf2218d0 (patch) | |
| tree | 6d747b4380fe6e2673ffec7ed28b90b68c59f713 /ltests.c | |
| parent | b3bb0f132b2a3dba88385f8d71ba3f34252d94e4 (diff) | |
| download | lua-ea2a75d19e260ad728d0b804d824c619bf2218d0.tar.gz lua-ea2a75d19e260ad728d0b804d824c619bf2218d0.tar.bz2 lua-ea2a75d19e260ad728d0b804d824c619bf2218d0.zip | |
new macro lua_userstateopen
Diffstat (limited to 'ltests.c')
| -rw-r--r-- | ltests.c | 9 |
1 files changed, 8 insertions, 1 deletions
| @@ -254,6 +254,13 @@ static int hash_query (lua_State *L) { | |||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | 256 | ||
| 257 | static int Cstacklevel (lua_State *L) { | ||
| 258 | unsigned long a = 0; | ||
| 259 | lua_pushnumber(L, (unsigned long)&a); | ||
| 260 | return 1; | ||
| 261 | } | ||
| 262 | |||
| 263 | |||
| 257 | static int table_query (lua_State *L) { | 264 | static int table_query (lua_State *L) { |
| 258 | const Table *t; | 265 | const Table *t; |
| 259 | int i = luaL_opt_int(L, 2, -1); | 266 | int i = luaL_opt_int(L, 2, -1); |
| @@ -368,7 +375,6 @@ static int udataval (lua_State *L) { | |||
| 368 | static int doonnewstack (lua_State *L) { | 375 | static int doonnewstack (lua_State *L) { |
| 369 | lua_State *L1 = lua_newthread(L, luaL_check_int(L, 1)); | 376 | lua_State *L1 = lua_newthread(L, luaL_check_int(L, 1)); |
| 370 | if (L1 == NULL) return 0; | 377 | if (L1 == NULL) return 0; |
| 371 | *cast(int **, L1) = &islocked; /* initialize the lock */ | ||
| 372 | lua_dostring(L1, luaL_check_string(L, 2)); | 378 | lua_dostring(L1, luaL_check_string(L, 2)); |
| 373 | lua_pushnumber(L, 1); | 379 | lua_pushnumber(L, 1); |
| 374 | lua_close(L1); | 380 | lua_close(L1); |
| @@ -624,6 +630,7 @@ static const struct luaL_reg tests_funcs[] = { | |||
| 624 | {"listk", listk}, | 630 | {"listk", listk}, |
| 625 | {"listlocals", listlocals}, | 631 | {"listlocals", listlocals}, |
| 626 | {"loadlib", loadlib}, | 632 | {"loadlib", loadlib}, |
| 633 | {"Cstacklevel", Cstacklevel}, | ||
| 627 | {"querystr", string_query}, | 634 | {"querystr", string_query}, |
| 628 | {"querytab", table_query}, | 635 | {"querytab", table_query}, |
| 629 | {"testC", testC}, | 636 | {"testC", testC}, |
