20 const char *callback_name)
39 const char *callback_name)
58 const char *callback_name)
78 const char *signal_name,
int sindex)
109 return callback.isEmpty() ? nullptr : qstrdup(qUtf8Printable(callback));
const char * api_signal_by_index(lua_State *L, int sindex)
Return the name of the 'index' callback function of the signal with the name 'signal_name'.
bool api_signal_defined(lua_State *L, const char *signal_name, const char *callback_name)
Returns if a callback function to a certain signal is defined.
const char * api_signal_callback_by_index(lua_State *L, const char *signal_name, int sindex)
Return the name of the signal with the given index.
void api_signal_connect(lua_State *L, const char *signal_name, const char *callback_name)
Connects a callback function to a certain signal.
void api_signal_remove(lua_State *L, const char *signal_name, const char *callback_name)
Removes a callback function to a certain signal.
struct fc_lua * luascript_get_fcl(lua_State *L)
Get the freeciv lua struct from a lua state.
#define LUASCRIPT_CHECK_STATE(L,...)
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
#define LUASCRIPT_CHECK(L, check, msg,...)
bool luascript_signal_callback_defined(struct fc_lua *fcl, const char *signal_name, const char *callback_name)
Returns if a callback function to a certain signal is defined.
const char * luascript_signal_callback_by_index(struct fc_lua *fcl, const char *signal_name, int sindex)
Return the name of the 'index' callback function of the signal with the name 'signal_name'.
void luascript_signal_callback(struct fc_lua *fcl, const char *signal_name, const char *callback_name, bool create)
Connects a callback function to a certain signal.
QString luascript_signal_by_index(struct fc_lua *fcl, int sindex)
Return the name of the signal with the given index.
static void static sol::state * fcl
Lua virtual machine state.