Freeciv-3.3: /fast/freeciv/nightly/main/server/scripting/api_server_luadata.c Source File

Freeciv-3.3

Loading...
Searching...
No Matches
api_server_luadata.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/* utility */
19#include "registry_ini.h"
20
21/* common */
22#include "game.h"
23
24/* common/scriptcore */
25#include "luascript.h"
26
27/* server/scripting */
28#include "script_server.h"
29
30#include "api_server_luadata.h"
31
32/**********************************************************************/
35 const char *api_luadata_get_str(lua_State *L, const char *field)
36{
37 LUASCRIPT_CHECK_STATE(L, NULL);
38
39 if (game.server.luadata == NULL) {
40 return NULL;
41 }
42
43 return secfile_lookup_str_default(game.server.luadata, NULL, "%s", field);
44}
api_luadata_get_str
const char * api_luadata_get_str(lua_State *L, const char *field)
Definition api_server_luadata.c:35
api_server_luadata.h
incite_cost
char * incite_cost
Definition comments.c:74
game
struct civ_game game
Definition game.c:61
game.h
luascript.h
LUASCRIPT_CHECK_STATE
#define LUASCRIPT_CHECK_STATE(L,...)
Definition luascript.h:117
secfile_lookup_str_default
const char * secfile_lookup_str_default(const struct section_file *secfile, const char *def, const char *path,...)
Definition registry_ini.c:2210
registry_ini.h
script_server.h
civ_game::luadata
struct section_file * luadata
Definition game.h:247
civ_game::server
struct civ_game::@31::@35 server