new way to handle errors

This commit is contained in:
Roberto Ierusalimschy
2002-05-01 17:48:12 -03:00
parent b36b2a061c
commit 751cd867d3
13 changed files with 283 additions and 292 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lauxlib.c,v 1.65 2002/04/04 20:25:55 roberto Exp roberto $
** $Id: lauxlib.c,v 1.66 2002/04/16 12:00:02 roberto Exp roberto $
** Auxiliary functions for building Lua libraries
** See Copyright Notice in lua.h
*/
@@ -21,19 +21,6 @@
#include "lualib.h"
LUALIB_API const char *luaL_errstr (int errcode) {
static const char *const errstr[] = {
"ok",
"run-time error",
"cannot read file",
"syntax error",
"not enough memory",
"error in error handling"
};
return errstr[errcode];
}
LUALIB_API int luaL_findstring (const char *name, const char *const list[]) {
int i;
for (i=0; list[i]; i++)
@@ -42,6 +29,7 @@ LUALIB_API int luaL_findstring (const char *name, const char *const list[]) {
return -1; /* name not found */
}
LUALIB_API void luaL_argerror (lua_State *L, int narg, const char *extramsg) {
lua_Debug ar;
lua_getstack(L, 0, &ar);