Freeciv-3.4
Loading...
Searching...
No Matches
api_signal_base.c
Go to the documentation of this file.
1/*****************************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12*****************************************************************************/
13
14#ifdef HAVE_CONFIG_H
15#include <fc_config.h>
16#endif
17
18/* common/scriptcore */
19#include "luascript_signal.h"
20#include "luascript.h"
21
22#include "api_signal_base.h"
23
24/**********************************************************************/
28 const char *callback_name)
29{
30 struct fc_lua *fcl;
31
35
37
38 LUASCRIPT_CHECK(L, fcl != nullptr, "Undefined Freeciv lua state!");
39
41}
42
43/**********************************************************************/
47 const char *callback_name)
48{
49 struct fc_lua *fcl;
50
54
56
57 LUASCRIPT_CHECK(L, fcl != nullptr, "Undefined Freeciv lua state!");
58
60}
61
62/**********************************************************************/
66 const char *callback_name)
67{
68 struct fc_lua *fcl;
69
73
75
76 LUASCRIPT_CHECK(L, fcl != nullptr, "Undefined Freeciv lua state!", FALSE);
77
79}
80
81/**********************************************************************/
86 const char *signal_name,
87 int sindex)
88{
89 struct fc_lua *fcl;
90
91 LUASCRIPT_CHECK_STATE(L, nullptr);
92 LUASCRIPT_CHECK_ARG_NIL(L, signal_name, 2, string, nullptr);
93
95
96 LUASCRIPT_CHECK(L, fcl != nullptr,
97 "Undefined Freeciv lua state!", nullptr);
98
100}
101
102/**********************************************************************/
106{
107 struct fc_lua *fcl;
108
109 LUASCRIPT_CHECK_STATE(L, nullptr);
110
112
113 LUASCRIPT_CHECK(L, fcl != nullptr,
114 "Undefined Freeciv lua state!", nullptr);
115
117}
const char * api_signal_callback_by_index(lua_State *L, const char *signal_name, int sindex)
bool api_signal_defined(lua_State *L, const char *signal_name, const char *callback_name)
const char * api_signal_by_index(lua_State *L, int sindex)
void api_signal_connect(lua_State *L, const char *signal_name, const char *callback_name)
void api_signal_remove(lua_State *L, const char *signal_name, const char *callback_name)
char * incite_cost
Definition comments.c:77
struct fc_lua * luascript_get_fcl(lua_State *L)
Definition luascript.c:366
#define LUASCRIPT_CHECK_STATE(L,...)
Definition luascript.h:117
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
Definition luascript.h:138
#define LUASCRIPT_CHECK(L, check, msg,...)
Definition luascript.h:124
bool luascript_signal_callback_defined(struct fc_lua *fcl, const char *signal_name, const char *callback_name)
const char * luascript_signal_by_index(struct fc_lua *fcl, int sindex)
const char * luascript_signal_callback_by_index(struct fc_lua *fcl, const char *signal_name, int sindex)
void luascript_signal_callback(struct fc_lua *fcl, const char *signal_name, const char *callback_name, bool create)
#define TRUE
Definition support.h:46
#define FALSE
Definition support.h:47