From 751cd867d3e0338279fa6f3390c8b7ddc0108659 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 1 May 2002 17:48:12 -0300 Subject: new way to handle errors --- lauxlib.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index d0df881e..46454d83 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -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); -- cgit v1.2.3-55-g6feb