From c9902be294f5c2dca8a67a67fd324f91e4352c0a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 18 Jun 1998 13:57:03 -0300 Subject: "findname" moved from lobject.c to lauxlib.c (so libraries may use it). --- lauxlib.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index 0a7475b1..0fa745e4 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.9 1998/03/06 16:54:42 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.10 1998/03/06 18:47:42 roberto Exp roberto $ ** Auxiliar functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -7,6 +7,7 @@ #include #include +#include /* Please Notice: This file uses only the oficial API of Lua ** Any function declared here could be written as an application @@ -18,6 +19,14 @@ +int luaL_findstring (char *name, char *list[]) { + int i; + for (i=0; list[i]; i++) + if (strcmp(list[i], name) == 0) + return i; + return -1; /* name not found */ +} + void luaL_argerror (int numarg, char *extramsg) { char *funcname; -- cgit v1.2.3-55-g6feb