aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-05-01 17:48:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-05-01 17:48:12 -0300
commit751cd867d3e0338279fa6f3390c8b7ddc0108659 (patch)
tree726f6f3cd49109382b2c0d7ee6a1e0fea740afbd /lauxlib.c
parentb36b2a061c88be22e36900146cbcad39bab07f5d (diff)
downloadlua-751cd867d3e0338279fa6f3390c8b7ddc0108659.tar.gz
lua-751cd867d3e0338279fa6f3390c8b7ddc0108659.tar.bz2
lua-751cd867d3e0338279fa6f3390c8b7ddc0108659.zip
new way to handle errors
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/lauxlib.c b/lauxlib.c
index d0df881e..46454d83 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.65 2002/04/04 20:25:55 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.66 2002/04/16 12:00:02 roberto Exp roberto $
3** Auxiliary functions for building Lua libraries 3** Auxiliary functions for building Lua libraries
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -21,19 +21,6 @@
21#include "lualib.h" 21#include "lualib.h"
22 22
23 23
24LUALIB_API const char *luaL_errstr (int errcode) {
25 static const char *const errstr[] = {
26 "ok",
27 "run-time error",
28 "cannot read file",
29 "syntax error",
30 "not enough memory",
31 "error in error handling"
32 };
33 return errstr[errcode];
34}
35
36
37LUALIB_API int luaL_findstring (const char *name, const char *const list[]) { 24LUALIB_API int luaL_findstring (const char *name, const char *const list[]) {
38 int i; 25 int i;
39 for (i=0; list[i]; i++) 26 for (i=0; list[i]; i++)
@@ -42,6 +29,7 @@ LUALIB_API int luaL_findstring (const char *name, const char *const list[]) {
42 return -1; /* name not found */ 29 return -1; /* name not found */
43} 30}
44 31
32
45LUALIB_API void luaL_argerror (lua_State *L, int narg, const char *extramsg) { 33LUALIB_API void luaL_argerror (lua_State *L, int narg, const char *extramsg) {
46 lua_Debug ar; 34 lua_Debug ar;
47 lua_getstack(L, 0, &ar); 35 lua_getstack(L, 0, &ar);