aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-05 20:36:52 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-02-05 20:36:52 -0200
commitd070506a255cc7cc33842a7bb97e1405cfb048aa (patch)
treeb6230d87e080a17d675ecb88586eb6a6f1e7404a /lauxlib.c
parent0a87d9d3346bcf74d84e4d6bae775bceecef096f (diff)
downloadlua-d070506a255cc7cc33842a7bb97e1405cfb048aa.tar.gz
lua-d070506a255cc7cc33842a7bb97e1405cfb048aa.tar.bz2
lua-d070506a255cc7cc33842a7bb97e1405cfb048aa.zip
new function luaL_errstr
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lauxlib.c b/lauxlib.c
index b6903013..831d3e34 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -21,6 +21,18 @@
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 open file",
29 "syntax error",
30 "memory allocation error",
31 "error in error handling"
32 };
33 return errstr[errcode];
34}
35
24 36
25LUALIB_API int luaL_findstring (const char *name, const char *const list[]) { 37LUALIB_API int luaL_findstring (const char *name, const char *const list[]) {
26 int i; 38 int i;