Freeciv-3.3
Loading...
Searching...
No Matches
tolua_signal_gen.c
Go to the documentation of this file.
1/*
2** Lua binding: signal
3*/
4
5#include "tolua.h"
6
7#ifndef __cplusplus
8#include <stdlib.h>
9#endif
10#ifdef __cplusplus
11 extern "C" int tolua_bnd_takeownership (lua_State* L); // from tolua_map.c
12#else
13 int tolua_bnd_takeownership (lua_State* L); /* from tolua_map.c */
14#endif
15#include <string.h>
16
17/* Exported function */
20
21#ifdef HAVE_CONFIG_H
22#include <fc_config.h>
23#endif
24#include "api_signal_base.h"
25#include "luascript_types.h"
26
27/* function to register type */
29{
30}
31
32/* function: api_signal_connect */
34{
35#ifndef TOLUA_RELEASE
37 if (
41 )
42 goto tolua_lerror;
43 else
44#endif
45 {
47 const char* signal_name = ((const char*) tolua_tostring(tolua_S,1,0));
48 const char* callback_name = ((const char*) tolua_tostring(tolua_S,2,0));
49 {
51 }
52 }
53 return 0;
54#ifndef TOLUA_RELEASE
56 tolua_error(tolua_S,"#ferror in function 'connect'.",&tolua_err);
57 return 0;
58#endif
59}
60
61/* function: api_signal_remove */
63{
64#ifndef TOLUA_RELEASE
66 if (
70 )
71 goto tolua_lerror;
72 else
73#endif
74 {
76 const char* signal_name = ((const char*) tolua_tostring(tolua_S,1,0));
77 const char* callback_name = ((const char*) tolua_tostring(tolua_S,2,0));
78 {
80 }
81 }
82 return 0;
83#ifndef TOLUA_RELEASE
85 tolua_error(tolua_S,"#ferror in function 'remove'.",&tolua_err);
86 return 0;
87#endif
88}
89
90/* function: api_signal_defined */
92{
93#ifndef TOLUA_RELEASE
95 if (
99 )
100 goto tolua_lerror;
101 else
102#endif
103 {
105 const char* signal_name = ((const char*) tolua_tostring(tolua_S,1,0));
106 const char* callback_name = ((const char*) tolua_tostring(tolua_S,2,0));
107 {
110 }
111 }
112 return 1;
113#ifndef TOLUA_RELEASE
115 tolua_error(tolua_S,"#ferror in function 'defined'.",&tolua_err);
116 return 0;
117#endif
118}
119
120/* function: api_signal_by_index */
122{
123#ifndef TOLUA_RELEASE
125 if (
128 )
129 goto tolua_lerror;
130 else
131#endif
132 {
134 int sindex = ((int) tolua_tonumber(tolua_S,1,0));
135 {
136 const char* tolua_ret = (const char*) api_signal_by_index(L,sindex);
137 tolua_pushstring(tolua_S,(const char*)tolua_ret);
138 }
139 }
140 return 1;
141#ifndef TOLUA_RELEASE
143 tolua_error(tolua_S,"#ferror in function 'signal'.",&tolua_err);
144 return 0;
145#endif
146}
147
148/* function: api_signal_callback_by_index */
150{
151#ifndef TOLUA_RELEASE
153 if (
157 )
158 goto tolua_lerror;
159 else
160#endif
161 {
163 const char* signal_name = ((const char*) tolua_tostring(tolua_S,1,0));
164 int sindex = ((int) tolua_tonumber(tolua_S,2,0));
165 {
166 const char* tolua_ret = (const char*) api_signal_callback_by_index(L,signal_name,sindex);
167 tolua_pushstring(tolua_S,(const char*)tolua_ret);
168 }
169 }
170 return 1;
171#ifndef TOLUA_RELEASE
173 tolua_error(tolua_S,"#ferror in function 'signal_callback'.",&tolua_err);
174 return 0;
175#endif
176}
177
178/* Open lib function */
180{
185 tolua_module(tolua_S,"signal",0);
186 tolua_beginmodule(tolua_S,"signal");
191
192 { /* begin embedded lua code */
193 static unsigned char B[] = {
194 10,102,117,110, 99,116,105,111,110, 32,115,105,103,110, 97,
195 108, 46,108,105,115,116, 40, 41, 10,108,111, 99, 97,108, 32,
196 115,105,103,110, 97,108, 95,105,100, 32, 61, 32, 48, 59, 10,
197 108,111, 99, 97,108, 32,115,105,103,110, 97,108, 95,110, 97,
198 109,101, 32, 61, 32,110,105,108, 59, 10,108,111,103, 46,110,
199 111,114,109, 97,108, 40, 34, 76,105,115,116, 32,111,102, 32,
200 115,105,103,110, 97,108,115, 58, 34, 41, 59, 10,114,101,112,
201 101, 97,116, 10,108,111, 99, 97,108, 32,115,105,103,110, 97,
202 108, 95,110, 97,109,101, 32, 61, 32,102,105,110,100, 46,115,
203 105,103,110, 97,108, 40,115,105,103,110, 97,108, 95,105,100,
204 41, 59, 10,105,102, 32, 40,115,105,103,110, 97,108, 95,110,
205 97,109,101, 41, 32,116,104,101,110, 10,108,111, 99, 97,108,
206 32, 99, 97,108,108, 98, 97, 99,107, 95,105,100, 32, 61, 32,
207 48, 59, 10,108,111, 99, 97,108, 32, 99, 97,108,108, 98, 97,
208 99,107, 95,110, 97,109,101, 32, 61, 32,110,105,108, 59, 10,
209 108,111,103, 46,110,111,114,109, 97,108, 40, 34, 45, 32, 99,
210 97,108,108, 98, 97, 99,107,115, 32,102,111,114, 32,115,105,
211 103,110, 97,108, 32, 39, 37,115, 39, 58, 34, 44, 32,115,105,
212 103,110, 97,108, 95,110, 97,109,101, 41, 59, 10,114,101,112,
213 101, 97,116, 10,108,111, 99, 97,108, 32, 99, 97,108,108, 98,
214 97, 99,107, 95,110, 97,109,101, 32, 61, 32,102,105,110,100,
215 46,115,105,103,110, 97,108, 95, 99, 97,108,108, 98, 97, 99,
216 107, 40,115,105,103,110, 97,108, 95,110, 97,109,101, 44, 32,
217 99, 97,108,108, 98, 97, 99,107, 95,105,100, 41, 59, 10,105,
218 102, 32, 40, 99, 97,108,108, 98, 97, 99,107, 95,110, 97,109,
219 101, 41, 32,116,104,101,110, 10,108,111,103, 46,110,111,114,
220 109, 97,108, 40, 34, 32, 91, 37, 51,100, 93, 32, 39, 37,115,
221 39, 34, 44, 32, 99, 97,108,108, 98, 97, 99,107, 95,105,100,
222 44, 32, 99, 97,108,108, 98, 97, 99,107, 95,110, 97,109,101,
223 41, 59, 10,101,110,100, 10, 99, 97,108,108, 98, 97, 99,107,
224 95,105,100, 32, 61, 32, 99, 97,108,108, 98, 97, 99,107, 95,
225 105,100, 32, 43, 32, 49, 59, 10,117,110,116,105,108, 32, 40,
226 99, 97,108,108, 98, 97, 99,107, 95,110, 97,109,101, 32, 61,
227 61, 32,110,105,108, 41, 59, 10,115,105,103,110, 97,108, 95,
228 105,100, 32, 61, 32,115,105,103,110, 97,108, 95,105,100, 32,
229 43, 32, 49, 59, 10,101,110,100, 10,117,110,116,105,108, 32,
230 40,115,105,103,110, 97,108, 95,110, 97,109,101, 32, 61, 61,
231 32,110,105,108, 41, 59, 10,101,110,100, 10,102,117,110, 99,
232 116,105,111,110, 32,115,105,103,110, 97,108, 46,114,101,112,
233 108, 97, 99,101, 40,115,105,103,110, 97,108, 95,110, 97,109,
234 101, 44, 32, 99, 97,108,108, 98, 97, 99,107, 95,110, 97,109,
235 101, 41, 10,105,102, 32,115,105,103,110, 97,108, 46,100,101,
236 102,105,110,101,100, 40,115,105,103,110, 97,108, 95,110, 97,
237 109,101, 44, 32, 99, 97,108,108, 98, 97, 99,107, 95,110, 97,
238 109,101, 41, 32,116,104,101,110, 10,115,105,103,110, 97,108,
239 46,114,101,109,111,118,101, 40,115,105,103,110, 97,108, 95,
240 110, 97,109,101, 44, 32, 99, 97,108,108, 98, 97, 99,107, 95,
241 110, 97,109,101, 41, 10,101,110,100, 10,115,105,103,110, 97,
242 108, 46, 99,111,110,110,101, 99,116, 40,115,105,103,110, 97,
243 108, 95,110, 97,109,101, 44, 32, 99, 97,108,108, 98, 97, 99,
244 107, 95,110, 97,109,101, 41, 10,101,110,100,32
245 };
246 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
248 } /* end of embedded lua code */
249
250 tolua_module(tolua_S,"find",0);
256 return 1;
257}
258/* Open tolua function */
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:76
#define bool
Definition support.h:71
static int tolua_signal_signal_connect00(lua_State *tolua_S)
static int tolua_signal_signal_remove00(lua_State *tolua_S)
static int tolua_signal_find_signal_callback00(lua_State *tolua_S)
LUALIB_API int luaopen_signal(lua_State *tolua_S)
static void tolua_reg_types(lua_State *tolua_S)
static int tolua_signal_signal_defined00(lua_State *tolua_S)
int tolua_bnd_takeownership(lua_State *L)
static int tolua_signal_find_signal00(lua_State *tolua_S)
TOLUA_API int tolua_signal_open(lua_State *tolua_S)