diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-07 14:34:44 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-07 14:34:44 -0200 |
| commit | d95a8b312166752e2211678b33514edb1d68a0a6 (patch) | |
| tree | 87a7180705c1c5e6db71831fb8cb49ce8980f4d0 /table.c | |
| parent | 9ffba7a3dbdfa68595cd8cec26bd99689ce5fd08 (diff) | |
| download | lua-d95a8b312166752e2211678b33514edb1d68a0a6.tar.gz lua-d95a8b312166752e2211678b33514edb1d68a0a6.tar.bz2 lua-d95a8b312166752e2211678b33514edb1d68a0a6.zip | |
new API: lua_Object now is an integer
Diffstat (limited to 'table.c')
| -rw-r--r-- | table.c | 20 |
1 files changed, 10 insertions, 10 deletions
| @@ -3,7 +3,7 @@ | |||
| 3 | ** Module to control static tables | 3 | ** Module to control static tables |
| 4 | */ | 4 | */ |
| 5 | 5 | ||
| 6 | char *rcs_table="$Id: table.c,v 2.10 1994/11/03 22:33:40 roberto Exp roberto $"; | 6 | char *rcs_table="$Id: table.c,v 2.11 1994/11/04 17:20:00 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <stdlib.h> | 8 | #include <stdlib.h> |
| 9 | #include <string.h> | 9 | #include <string.h> |
| @@ -259,23 +259,23 @@ char *lua_filename (void) | |||
| 259 | void lua_nextvar (void) | 259 | void lua_nextvar (void) |
| 260 | { | 260 | { |
| 261 | char *varname, *next; | 261 | char *varname, *next; |
| 262 | Object *o = lua_getparam (1); | 262 | lua_Object o = lua_getparam(1); |
| 263 | if (o == NULL) | 263 | if (o == 0) |
| 264 | { lua_error ("too few arguments to function `nextvar'"); return; } | 264 | { lua_error ("too few arguments to function `nextvar'"); return; } |
| 265 | if (lua_getparam (2) != NULL) | 265 | if (lua_getparam(2) != NULL) |
| 266 | { lua_error ("too many arguments to function `nextvar'"); return; } | 266 | { lua_error ("too many arguments to function `nextvar'"); return; } |
| 267 | if (tag(o) == LUA_T_NIL) | 267 | if (lua_isnil(o)) |
| 268 | { | 268 | { |
| 269 | varname = 0; | 269 | varname = NULL; |
| 270 | } | 270 | } |
| 271 | else if (tag(o) != LUA_T_STRING) | 271 | else if (!lua_isstring(o)) |
| 272 | { | 272 | { |
| 273 | lua_error ("incorrect argument to function `nextvar'"); | 273 | lua_error ("incorrect argument to function `nextvar'"); |
| 274 | return; | 274 | return; |
| 275 | } | 275 | } |
| 276 | else | 276 | else |
| 277 | { | 277 | { |
| 278 | varname = svalue(o); | 278 | varname = lua_getstring(o); |
| 279 | } | 279 | } |
| 280 | next = lua_varnext(varname); | 280 | next = lua_varnext(varname); |
| 281 | if (next == NULL) | 281 | if (next == NULL) |
| @@ -288,7 +288,7 @@ void lua_nextvar (void) | |||
| 288 | Object name; | 288 | Object name; |
| 289 | tag(&name) = LUA_T_STRING; | 289 | tag(&name) = LUA_T_STRING; |
| 290 | svalue(&name) = next; | 290 | svalue(&name) = next; |
| 291 | if (lua_pushobject (&name)) return; | 291 | luaI_pushobject(&name); |
| 292 | if (lua_pushobject (&s_object(indexstring(next)))) return; | 292 | luaI_pushobject(&s_object(indexstring(next))); |
| 293 | } | 293 | } |
| 294 | } | 294 | } |
