From d070506a255cc7cc33842a7bb97e1405cfb048aa Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 5 Feb 2002 20:36:52 -0200 Subject: new function luaL_errstr --- lauxlib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lauxlib.c') diff --git a/lauxlib.c b/lauxlib.c index b6903013..831d3e34 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -21,6 +21,18 @@ #include "lualib.h" +LUALIB_API const char *luaL_errstr (int errcode) { + static const char *const errstr[] = { + "ok", + "run-time error", + "cannot open file", + "syntax error", + "memory allocation error", + "error in error handling" + }; + return errstr[errcode]; +} + LUALIB_API int luaL_findstring (const char *name, const char *const list[]) { int i; -- cgit v1.2.3-55-g6feb