void hlua_unref(lua_State *L, int ref);
struct hlua *hlua_gethlua(lua_State *L);
void hlua_yieldk(lua_State *L, int nresults, lua_KContext ctx, lua_KFunction k, int timeout, unsigned int flags);
+int hlua_pusherror(lua_State *L, const char *fmt, ...);
+
+__LJMP static inline void hlua_check_args(lua_State *L, int nb, char *fcn)
+{
+ if (lua_gettop(L) == nb)
+ return;
+ WILL_LJMP(luaL_error(L, "'%s' needs %d arguments", fcn, nb));
+}
+#define check_args hlua_check_args
#else /* USE_LUA */
* stack. If the number of arguments available is not the same
* then <nb> an error is thrown.
*/
-__LJMP static inline void check_args(lua_State *L, int nb, char *fcn)
-{
- if (lua_gettop(L) == nb)
- return;
- WILL_LJMP(luaL_error(L, "'%s' needs %d arguments", fcn, nb));
-}
-
/* This function pushes an error string prefixed by the file name
* and the line number where the error is encountered.
*
return 1;
}
-static int hlua_pusherror(lua_State *L, const char *fmt, ...)
+int hlua_pusherror(lua_State *L, const char *fmt, ...)
{
va_list argp;
int ret = 1;