diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-08 15:03:20 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1996-02-08 15:03:20 -0200 |
commit | 826d70fcba11a46de74a316b76caf94eb5a5acc5 (patch) | |
tree | f3b050e29578dd8bfe3a2af0d55fa59ab7f911cb /opcode.c | |
parent | bbb23048e399aa9ebcc22f83104de35aab6bbe14 (diff) | |
download | lua-826d70fcba11a46de74a316b76caf94eb5a5acc5.tar.gz lua-826d70fcba11a46de74a316b76caf94eb5a5acc5.tar.bz2 lua-826d70fcba11a46de74a316b76caf94eb5a5acc5.zip |
new type lua_Function for activation records
Diffstat (limited to 'opcode.c')
-rw-r--r-- | opcode.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -3,7 +3,7 @@ | |||
3 | ** TecCGraf - PUC-Rio | 3 | ** TecCGraf - PUC-Rio |
4 | */ | 4 | */ |
5 | 5 | ||
6 | char *rcs_opcode="$Id: opcode.c,v 3.54 1996/01/30 15:25:23 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.55 1996/02/07 18:10:27 roberto Exp roberto $"; |
7 | 7 | ||
8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
9 | #include <stdlib.h> | 9 | #include <stdlib.h> |
@@ -423,7 +423,7 @@ void lua_error (char *s) | |||
423 | } | 423 | } |
424 | 424 | ||
425 | 425 | ||
426 | lua_Object lua_stackedfunction (int level) | 426 | lua_Function lua_stackedfunction (int level) |
427 | { | 427 | { |
428 | Object *p = top; | 428 | Object *p = top; |
429 | while (--p >= stack) | 429 | while (--p >= stack) |
@@ -434,14 +434,14 @@ lua_Object lua_stackedfunction (int level) | |||
434 | } | 434 | } |
435 | 435 | ||
436 | 436 | ||
437 | int lua_currentline (lua_Object func) | 437 | int lua_currentline (lua_Function func) |
438 | { | 438 | { |
439 | Object *f = Address(func); | 439 | Object *f = Address(func); |
440 | return (f+1 < top && (f+1)->tag == LUA_T_LINE) ? (f+1)->value.i : -1; | 440 | return (f+1 < top && (f+1)->tag == LUA_T_LINE) ? (f+1)->value.i : -1; |
441 | } | 441 | } |
442 | 442 | ||
443 | 443 | ||
444 | lua_Object lua_getlocal (lua_Object func, int local_number, char **name) | 444 | lua_Object lua_getlocal (lua_Function func, int local_number, char **name) |
445 | { | 445 | { |
446 | Object *f = luaI_Address(func); | 446 | Object *f = luaI_Address(func); |
447 | *name = luaI_getlocalname(f->value.tf, local_number, lua_currentline(func)); | 447 | *name = luaI_getlocalname(f->value.tf, local_number, lua_currentline(func)); |
@@ -455,7 +455,7 @@ lua_Object lua_getlocal (lua_Object func, int local_number, char **name) | |||
455 | return LUA_NOOBJECT; | 455 | return LUA_NOOBJECT; |
456 | } | 456 | } |
457 | 457 | ||
458 | int lua_setlocal (lua_Object func, int local_number) | 458 | int lua_setlocal (lua_Function func, int local_number) |
459 | { | 459 | { |
460 | Object *f = Address(func); | 460 | Object *f = Address(func); |
461 | char *name = luaI_getlocalname(f->value.tf, local_number, lua_currentline(func)); | 461 | char *name = luaI_getlocalname(f->value.tf, local_number, lua_currentline(func)); |