aboutsummaryrefslogtreecommitdiff
path: root/ltests.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-10-06 16:29:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2000-10-06 16:29:26 -0300
commitae63a0e692fdc64a2bbafcb6ff10ecbdf3946f88 (patch)
treeb0b6d6706ae2bcc42fad5d5e675f464db6b2c9e7 /ltests.c
parentcd3d44695775631271d9d038247fe64092f13f33 (diff)
downloadlua-ae63a0e692fdc64a2bbafcb6ff10ecbdf3946f88.tar.gz
lua-ae63a0e692fdc64a2bbafcb6ff10ecbdf3946f88.tar.bz2
lua-ae63a0e692fdc64a2bbafcb6ff10ecbdf3946f88.zip
new implementation for some API functions
Diffstat (limited to 'ltests.c')
-rw-r--r--ltests.c41
1 files changed, 40 insertions, 1 deletions
diff --git a/ltests.c b/ltests.c
index e7464e51..76c44588 100644
--- a/ltests.c
+++ b/ltests.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltests.c,v 1.48 2000/10/05 12:14:08 roberto Exp roberto $ 2** $Id: ltests.c,v 1.49 2000/10/05 13:00:17 roberto Exp roberto $
3** Internal Module for Debugging of the Lua Implementation 3** Internal Module for Debugging of the Lua Implementation
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -389,6 +389,45 @@ static int testC (lua_State *L) {
389 for (;;) { 389 for (;;) {
390 const char *inst = getname; 390 const char *inst = getname;
391 if EQ("") return 0; 391 if EQ("") return 0;
392 else if EQ("isnumber") {
393 lua_pushnumber(L, lua_isnumber(L, getnum));
394 }
395 else if EQ("isstring") {
396 lua_pushnumber(L, lua_isstring(L, getnum));
397 }
398 else if EQ("istable") {
399 lua_pushnumber(L, lua_istable(L, getnum));
400 }
401 else if EQ("iscfunction") {
402 lua_pushnumber(L, lua_iscfunction(L, getnum));
403 }
404 else if EQ("isfunction") {
405 lua_pushnumber(L, lua_isfunction(L, getnum));
406 }
407 else if EQ("isuserdata") {
408 lua_pushnumber(L, lua_isuserdata(L, getnum));
409 }
410 else if EQ("isnil") {
411 lua_pushnumber(L, lua_isnil(L, getnum));
412 }
413 else if EQ("isnull") {
414 lua_pushnumber(L, lua_isnull(L, getnum));
415 }
416 else if EQ("tonumber") {
417 lua_pushnumber(L, lua_tonumber(L, getnum));
418 }
419 else if EQ("tostring") {
420 lua_pushstring(L, lua_tostring(L, getnum));
421 }
422 else if EQ("tonumber") {
423 lua_pushnumber(L, lua_tonumber(L, getnum));
424 }
425 else if EQ("strlen") {
426 lua_pushnumber(L, lua_strlen(L, getnum));
427 }
428 else if EQ("tocfunction") {
429 lua_pushcfunction(L, lua_tocfunction(L, getnum));
430 }
392 else if EQ("return") { 431 else if EQ("return") {
393 return getnum; 432 return getnum;
394 } 433 }