diff options
-rw-r--r-- | lauxlib.c | 8 | ||||
-rw-r--r-- | lauxlib.h | 8 |
2 files changed, 10 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.178 2008/06/13 18:45:35 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.179 2008/07/03 14:21:41 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 | */ |
@@ -52,7 +52,7 @@ LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { | |||
52 | } | 52 | } |
53 | 53 | ||
54 | 54 | ||
55 | LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { | 55 | LUALIB_API int luaL_typeerror (lua_State *L, int narg, const char *tname) { |
56 | const char *msg = lua_pushfstring(L, "%s expected, got %s", | 56 | const char *msg = lua_pushfstring(L, "%s expected, got %s", |
57 | tname, luaL_typename(L, narg)); | 57 | tname, luaL_typename(L, narg)); |
58 | return luaL_argerror(L, narg, msg); | 58 | return luaL_argerror(L, narg, msg); |
@@ -60,7 +60,7 @@ LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { | |||
60 | 60 | ||
61 | 61 | ||
62 | static void tag_error (lua_State *L, int narg, int tag) { | 62 | static void tag_error (lua_State *L, int narg, int tag) { |
63 | luaL_typerror(L, narg, lua_typename(L, tag)); | 63 | luaL_typeerror(L, narg, lua_typename(L, tag)); |
64 | } | 64 | } |
65 | 65 | ||
66 | 66 | ||
@@ -176,7 +176,7 @@ LUALIB_API void *luaL_testudata (lua_State *L, int ud, const char *tname) { | |||
176 | 176 | ||
177 | LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { | 177 | LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { |
178 | void *p = luaL_testudata(L, ud, tname); | 178 | void *p = luaL_testudata(L, ud, tname); |
179 | if (p == NULL) luaL_typerror(L, ud, tname); | 179 | if (p == NULL) luaL_typeerror(L, ud, tname); |
180 | return p; | 180 | return p; |
181 | } | 181 | } |
182 | 182 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.h,v 1.93 2007/06/22 15:39:34 roberto Exp roberto $ | 2 | ** $Id: lauxlib.h,v 1.94 2008/01/03 17:07:59 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 | */ |
@@ -34,7 +34,7 @@ LUALIB_API void (luaL_register) (lua_State *L, const char *libname, | |||
34 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); | 34 | LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); |
35 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); | 35 | LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); |
36 | LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len); | 36 | LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len); |
37 | LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); | 37 | LUALIB_API int (luaL_typeerror) (lua_State *L, int narg, const char *tname); |
38 | LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); | 38 | LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); |
39 | LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, | 39 | LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, |
40 | size_t *l); | 40 | size_t *l); |
@@ -161,6 +161,10 @@ LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); | |||
161 | 161 | ||
162 | #define luaL_reg luaL_Reg | 162 | #define luaL_reg luaL_Reg |
163 | 163 | ||
164 | |||
165 | /* compatibility with previous wrong spelling */ | ||
166 | #define luaL_typerror luaL_typeerror | ||
167 | |||
164 | #endif | 168 | #endif |
165 | 169 | ||
166 | 170 | ||