diff options
Diffstat (limited to 'opcode.c')
| -rw-r--r-- | opcode.c | 15 |
1 files changed, 14 insertions, 1 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.23 1994/11/30 21:20:37 roberto Exp roberto $"; | 6 | char *rcs_opcode="$Id: opcode.c,v 3.24 1994/12/06 14:27:18 roberto Exp roberto $"; |
| 7 | 7 | ||
| 8 | #include <setjmp.h> | 8 | #include <setjmp.h> |
| 9 | #include <stdio.h> | 9 | #include <stdio.h> |
| @@ -644,6 +644,19 @@ int lua_pushstring (char *s) | |||
| 644 | } | 644 | } |
| 645 | 645 | ||
| 646 | /* | 646 | /* |
| 647 | ** Push an object (tag=string) on stack and register it on the constant table. | ||
| 648 | Return 0 on success or 1 on error. | ||
| 649 | */ | ||
| 650 | int lua_pushliteral (char *s) | ||
| 651 | { | ||
| 652 | lua_checkstack(top-stack+1); | ||
| 653 | tsvalue(top) = lua_constant[luaI_findconstant(lua_constcreate(s))]; | ||
| 654 | tag(top) = LUA_T_STRING; | ||
| 655 | top++; | ||
| 656 | return 0; | ||
| 657 | } | ||
| 658 | |||
| 659 | /* | ||
| 647 | ** Push an object (tag=cfunction) to stack. Return 0 on success or 1 on error. | 660 | ** Push an object (tag=cfunction) to stack. Return 0 on success or 1 on error. |
| 648 | */ | 661 | */ |
| 649 | int lua_pushcfunction (lua_CFunction fn) | 662 | int lua_pushcfunction (lua_CFunction fn) |
