From b17c76817d008de0e0de460c5d0fac4741d0fe02 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 13 Oct 1995 12:16:25 -0300 Subject: new function "luaI_findconstantbyname". --- table.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'table.c') diff --git a/table.c b/table.c index 05f92c15..fc3d753c 100644 --- a/table.c +++ b/table.c @@ -3,7 +3,7 @@ ** Module to control static tables */ -char *rcs_table="$Id: table.c,v 2.32 1995/09/15 20:47:53 roberto Exp $"; +char *rcs_table="$Id: table.c,v 2.33 1995/10/04 14:20:26 roberto Exp roberto $"; #include @@ -119,9 +119,8 @@ Word luaI_findsymbolbyname (char *name) /* -** Given a name, search it at constant table and return its index. If not -** found, allocate it. -** On error, return -1. +** Given a tree node, check it is has a correspondent constant index. If not, +** allocate it. */ Word luaI_findconstant (TreeNode *t) { @@ -146,6 +145,12 @@ Word luaI_findconstant (TreeNode *t) } +Word luaI_findconstantbyname (char *name) +{ + return luaI_findconstant(lua_constcreate(name)); +} + + /* ** Traverse symbol table objects */ -- cgit v1.2.3-55-g6feb