Freeciv-3.2
Loading...
Searching...
No Matches
tolua_fcdb_gen.c
Go to the documentation of this file.
1/*
2** Lua binding: fcdb
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 "luascript_types.h"
25#include "api_fcdb_auth.h"
26#include "api_fcdb_base.h"
27#include "script_fcdb.h"
28
29/* function to register type */
31{
32 tolua_usertype(tolua_S,"Connection");
33}
34
35/* function: api_auth_get_username */
37{
38#ifndef TOLUA_RELEASE
40 if (
41 !tolua_isusertype(tolua_S,1,"Connection",0,&tolua_err) ||
43 )
44 goto tolua_lerror;
45 else
46#endif
47 {
50 {
51 const char* tolua_ret = (const char*) api_auth_get_username(L,pconn);
53 }
54 }
55 return 1;
56#ifndef TOLUA_RELEASE
58 tolua_error(tolua_S,"#ferror in function 'get_username'.",&tolua_err);
59 return 0;
60#endif
61}
62
63/* function: api_auth_get_ipaddr */
65{
66#ifndef TOLUA_RELEASE
68 if (
69 !tolua_isusertype(tolua_S,1,"Connection",0,&tolua_err) ||
71 )
72 goto tolua_lerror;
73 else
74#endif
75 {
78 {
79 const char* tolua_ret = (const char*) api_auth_get_ipaddr(L,pconn);
81 }
82 }
83 return 1;
84#ifndef TOLUA_RELEASE
86 tolua_error(tolua_S,"#ferror in function 'get_ipaddr'.",&tolua_err);
87 return 0;
88#endif
89}
90
91/* function: api_auth_get_cmdlevel */
93{
94#ifndef TOLUA_RELEASE
96 if (
97 !tolua_isusertype(tolua_S,1,"Connection",0,&tolua_err) ||
99 )
100 goto tolua_lerror;
101 else
102#endif
103 {
106 {
109 }
110 }
111 return 1;
112#ifndef TOLUA_RELEASE
114 tolua_error(tolua_S,"#ferror in function 'get_cmdlevel'.",&tolua_err);
115 return 0;
116#endif
117}
118
119/* function: api_auth_set_cmdlevel */
121{
122#ifndef TOLUA_RELEASE
124 if (
125 !tolua_isusertype(tolua_S,1,"Connection",0,&tolua_err) ||
128 )
129 goto tolua_lerror;
130 else
131#endif
132 {
135 int level = ((int) tolua_tonumber(tolua_S,2,0));
136 {
138 }
139 }
140 return 0;
141#ifndef TOLUA_RELEASE
143 tolua_error(tolua_S,"#ferror in function 'set_cmdlevel'.",&tolua_err);
144 return 0;
145#endif
146}
147
148/* function: api_fcdb_option */
150{
151#ifndef TOLUA_RELEASE
153 if (
156 )
157 goto tolua_lerror;
158 else
159#endif
160 {
162 const char* name = ((const char*) tolua_tostring(tolua_S,1,0));
163 {
164 const char* tolua_ret = (const char*) api_fcdb_option(L,name);
165 tolua_pushstring(tolua_S,(const char*)tolua_ret);
166 }
167 }
168 return 1;
169#ifndef TOLUA_RELEASE
171 tolua_error(tolua_S,"#ferror in function 'option'.",&tolua_err);
172 return 0;
173#endif
174}
175
176/* Open lib function */
178{
183 tolua_module(tolua_S,"auth",0);
190 tolua_module(tolua_S,"fcdb",0);
194
195 { /* begin embedded lua code */
196 static unsigned char B[] = {
197 10,102, 99,100, 98, 91, 34,112, 97,114, 97,109, 34, 93, 32,
198 61, 32,123, 10, 72, 79, 83, 84, 32, 61, 32, 34, 35,100,101,
199 112,114,101, 99, 97,116,101,100, 46,104,111,115,116, 34, 44,
200 10, 85, 83, 69, 82, 32, 61, 32, 34, 35,100,101,112,114,101,
201 99, 97,116,101,100, 46,117,115,101,114, 34, 44, 10, 80, 79,
202 82, 84, 32, 61, 32, 34, 35,100,101,112,114,101, 99, 97,116,
203 101,100, 46,112,111,114,116, 34, 44, 10, 80, 65, 83, 83, 87,
204 79, 82, 68, 32, 61, 32, 34, 35,100,101,112,114,101, 99, 97,
205 116,101,100, 46,112, 97,115,115,119,111,114,100, 34, 44, 10,
206 68, 65, 84, 65, 66, 65, 83, 69, 32, 61, 32, 34, 35,100,101,
207 112,114,101, 99, 97,116,101,100, 46,100, 97,116, 97, 98, 97,
208 115,101, 34, 44, 10, 84, 65, 66, 76, 69, 95, 85, 83, 69, 82,
209 32, 61, 32, 34, 35,100,101,112,114,101, 99, 97,116,101,100,
210 46,116, 97, 98,108,101, 95,117,115,101,114, 34, 44, 10, 84,
211 65, 66, 76, 69, 95, 76, 79, 71, 32, 61, 32, 34, 35,100,101,
212 112,114,101, 99, 97,116,101,100, 46,116, 97, 98,108,101, 95,
213 108,111,103, 34, 44, 10, 66, 65, 67, 75, 69, 78, 68, 32, 61,
214 32, 34, 35,100,101,112,114,101, 99, 97,116,101,100, 46, 98,
215 97, 99,107,101,110,100, 34, 10,125,32
216 };
217 if (luaL_loadbuffer(tolua_S,(char*)B,sizeof(B),"tolua: embedded Lua code") == LUA_OK)
219 } /* end of embedded lua code */
220
222 return 1;
223}
224/* Open tolua function */
const char * api_auth_get_username(lua_State *L, Connection *pconn)
void api_auth_set_cmdlevel(lua_State *L, Connection *pconn, int level)
int api_auth_get_cmdlevel(lua_State *L, Connection *pconn)
const char * api_auth_get_ipaddr(lua_State *L, Connection *pconn)
const char * api_fcdb_option(lua_State *L, const char *type)
char * incite_cost
Definition comments.c:75
const char * name
Definition inputfile.c:127
struct setting_list * level[OLEVELS_NUM]
Definition settings.c:190
static int tolua_fcdb_auth_get_cmdlevel00(lua_State *tolua_S)
LUALIB_API int luaopen_fcdb(lua_State *tolua_S)
static int tolua_fcdb_auth_get_username00(lua_State *tolua_S)
TOLUA_API int tolua_fcdb_open(lua_State *tolua_S)
static void tolua_reg_types(lua_State *tolua_S)
static int tolua_fcdb_fcdb_option00(lua_State *tolua_S)
int tolua_bnd_takeownership(lua_State *L)
static int tolua_fcdb_auth_set_cmdlevel00(lua_State *tolua_S)
static int tolua_fcdb_auth_get_ipaddr00(lua_State *tolua_S)