new function luaL_errstr

This commit is contained in:
Roberto Ierusalimschy
2002-02-05 20:36:52 -02:00
parent 0a87d9d334
commit d070506a25
3 changed files with 19 additions and 5 deletions

View File

@@ -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;