diff options
Diffstat (limited to 'ldblib.c')
-rw-r--r-- | ldblib.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldblib.c,v 1.3 1999/01/15 11:36:28 roberto Exp roberto $ | 2 | ** $Id: ldblib.c,v 1.4 1999/02/04 17:47:59 roberto Exp roberto $ |
3 | ** Interface from Lua to its debug API | 3 | ** Interface from Lua to its debug API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -33,24 +33,24 @@ static void settabsi (lua_Object t, char *i, int v) { | |||
33 | 33 | ||
34 | static lua_Object getfuncinfo (lua_Object func) { | 34 | static lua_Object getfuncinfo (lua_Object func) { |
35 | lua_Object result = lua_createtable(); | 35 | lua_Object result = lua_createtable(); |
36 | char *name; | 36 | char *str; |
37 | int line; | 37 | int line; |
38 | lua_funcinfo(func, &name, &line); | 38 | lua_funcinfo(func, &str, &line); |
39 | if (line == -1) /* C function? */ | 39 | if (line == -1) /* C function? */ |
40 | settabss(result, "kind", "C"); | 40 | settabss(result, "kind", "C"); |
41 | else if (line == 0) { /* "main"? */ | 41 | else if (line == 0) { /* "main"? */ |
42 | settabss(result, "kind", "chunk"); | 42 | settabss(result, "kind", "chunk"); |
43 | settabss(result, "name", name); | 43 | settabss(result, "source", str); |
44 | } | 44 | } |
45 | else { /* Lua function */ | 45 | else { /* Lua function */ |
46 | settabss(result, "kind", "Lua"); | 46 | settabss(result, "kind", "Lua"); |
47 | settabsi(result, "def_line", line); | 47 | settabsi(result, "def_line", line); |
48 | settabss(result, "def_chunk", name); | 48 | settabss(result, "source", str); |
49 | } | 49 | } |
50 | if (line != 0) { /* is it not a "main"? */ | 50 | if (line != 0) { /* is it not a "main"? */ |
51 | char *kind = lua_getobjname(func, &name); | 51 | char *kind = lua_getobjname(func, &str); |
52 | if (*kind) { | 52 | if (*kind) { |
53 | settabss(result, "name", name); | 53 | settabss(result, "name", str); |
54 | settabss(result, "where", kind); | 54 | settabss(result, "where", kind); |
55 | } | 55 | } |
56 | } | 56 | } |