aboutsummaryrefslogtreecommitdiff
path: root/table.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-10-13 12:16:25 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>1995-10-13 12:16:25 -0300
commitb17c76817d008de0e0de460c5d0fac4741d0fe02 (patch)
tree02b5b942ab01853a5be4f385dceb8ec567c13008 /table.c
parentb074306267b70015d770cb33c78dcf6cfe53fb45 (diff)
downloadlua-b17c76817d008de0e0de460c5d0fac4741d0fe02.tar.gz
lua-b17c76817d008de0e0de460c5d0fac4741d0fe02.tar.bz2
lua-b17c76817d008de0e0de460c5d0fac4741d0fe02.zip
new function "luaI_findconstantbyname".
Diffstat (limited to 'table.c')
-rw-r--r--table.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/table.c b/table.c
index 05f92c15..fc3d753c 100644
--- a/table.c
+++ b/table.c
@@ -3,7 +3,7 @@
3** Module to control static tables 3** Module to control static tables
4*/ 4*/
5 5
6char *rcs_table="$Id: table.c,v 2.32 1995/09/15 20:47:53 roberto Exp $"; 6char *rcs_table="$Id: table.c,v 2.33 1995/10/04 14:20:26 roberto Exp roberto $";
7 7
8#include <string.h> 8#include <string.h>
9 9
@@ -119,9 +119,8 @@ Word luaI_findsymbolbyname (char *name)
119 119
120 120
121/* 121/*
122** Given a name, search it at constant table and return its index. If not 122** Given a tree node, check it is has a correspondent constant index. If not,
123** found, allocate it. 123** allocate it.
124** On error, return -1.
125*/ 124*/
126Word luaI_findconstant (TreeNode *t) 125Word luaI_findconstant (TreeNode *t)
127{ 126{
@@ -146,6 +145,12 @@ Word luaI_findconstant (TreeNode *t)
146} 145}
147 146
148 147
148Word luaI_findconstantbyname (char *name)
149{
150 return luaI_findconstant(lua_constcreate(name));
151}
152
153
149/* 154/*
150** Traverse symbol table objects 155** Traverse symbol table objects
151*/ 156*/