diff options
Diffstat (limited to 'lauxlib.c')
| -rw-r--r-- | lauxlib.c | 12 |
1 files changed, 12 insertions, 0 deletions
| @@ -21,6 +21,18 @@ | |||
| 21 | #include "lualib.h" | 21 | #include "lualib.h" |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | LUALIB_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 | ||
| 25 | LUALIB_API int luaL_findstring (const char *name, const char *const list[]) { | 37 | LUALIB_API int luaL_findstring (const char *name, const char *const list[]) { |
| 26 | int i; | 38 | int i; |
