new header 'auxlib.h' + new function luaL_verror

This commit is contained in:
Roberto Ierusalimschy
1997-03-18 12:30:50 -03:00
parent fa08b42dd8
commit 2de803c250
6 changed files with 41 additions and 36 deletions

View File

@@ -3,7 +3,7 @@
** String library to LUA
*/
char *rcs_strlib="$Id: strlib.c,v 1.35 1997/02/21 15:21:34 roberto Exp roberto $";
char *rcs_strlib="$Id: strlib.c,v 1.36 1997/03/17 17:01:10 roberto Exp roberto $";
#include <string.h>
#include <stdio.h>
@@ -11,6 +11,7 @@ char *rcs_strlib="$Id: strlib.c,v 1.35 1997/02/21 15:21:34 roberto Exp roberto $
#include <ctype.h>
#include "lua.h"
#include "auxlib.h"
#include "lualib.h"
@@ -518,15 +519,7 @@ static void str_format (void)
}
void luaI_openlib (struct lua_reg *l, int n)
{
int i;
for (i=0; i<n; i++)
lua_register(l[i].name, l[i].func);
}
static struct lua_reg strlib[] = {
static struct luaL_reg strlib[] = {
{"strtok", str_tok},
{"strlen", str_len},
{"strsub", str_sub},
@@ -546,5 +539,5 @@ static struct lua_reg strlib[] = {
*/
void strlib_open (void)
{
luaI_openlib(strlib, (sizeof(strlib)/sizeof(strlib[0])));
luaL_openlib(strlib, (sizeof(strlib)/sizeof(strlib[0])));
}