mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
"findname" moved from lobject.c to lauxlib.c (so libraries may use it).
This commit is contained in:
parent
112c9d53ab
commit
c9902be294
6 changed files with 21 additions and 23 deletions
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue