ns/main/source/scriptengine/AvHLUAUtil.h
tankefugl d995257c31 Initial script engine implementation.
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@282 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-07-14 18:26:04 +00:00

29 lines
No EOL
698 B
C

#ifndef AVHLUAUTIL_H
#define AVHLUAUTIL_H
extern "C" {
#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
}
#define newtable(L) (lua_newtable(L), lua_gettop(L))
/*
void UTIL_LUATablePair(char *key, const char *value);
void UTIL_LUATablePair(char *key, lua_Number value);
void UTIL_LUATablePair(char *key, bool value);
void UTIL_LUATablePair(char *key, lua_CFunction function);
*/
void UTIL_LUARegisterObject(lua_State *L, const luaL_reg *mainmethods, const luaL_reg *metamethods, char *objName);
void AvHLUA_OnError(const char *errorMsg);
#define AvHLUA_Pcall(L, a, b) \
if (lua_pcall(L, a, b, 0)) \
{ \
AvHLUA_OnError(lua_tostring(L, -1)); \
}
#endif