"findname" moved from lobject.c to lauxlib.c (so libraries may use it).
This commit is contained in:
11
lauxlib.c
11
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 <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* 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;
|
||||
|
||||
Reference in New Issue
Block a user