Freeciv-3.2: /fast/freeciv/nightly/S3_2/tools/shared/tools_fc_interface.c Source File

Freeciv-3.2

Loading...
Searching...
No Matches
tools_fc_interface.c
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 2017 - Freeciv Development Team
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 */
19#include "fc_interface.h"
20
21/* server */
22#include "srv_main.h"
23
24
25#include "tools_fc_interface.h"
26
27
28/***********************************************************************/
31 static bool tool_player_tile_vision_get(const struct tile *ptile,
32 const struct player *pplayer,
33 enum vision_layer vision)
34{
35 log_error("Assumed unused function %s called.", __FUNCTION__);
36 return FALSE;
37}
38
39/***********************************************************************/
42 static int tool_player_tile_city_id_get(const struct tile *ptile,
43 const struct player *pplayer)
44{
45 log_error("Assumed unused function %s called.", __FUNCTION__);
46 return IDENTITY_NUMBER_ZERO;
47}
48
49/***********************************************************************/
52 static void tool_gui_color_free(struct color *pcolor)
53{
54 log_error("Assumed unused function %s called.", __FUNCTION__);
55}
56
57/***********************************************************************/
60 void fc_interface_init_tool(void)
61{
62 struct functions *funcs = fc_interface_funcs();
63
64 memset(funcs, 0, sizeof(*funcs));
65
66 /* May be used when generating help texts */
67 funcs->server_setting_by_name = server_ss_by_name;
68 funcs->server_setting_name_get = server_ss_name_get;
69 funcs->server_setting_type_get = server_ss_type_get;
70 funcs->server_setting_val_bool_get = server_ss_val_bool_get;
71 funcs->server_setting_val_int_get = server_ss_val_int_get;
72 funcs->server_setting_val_bitwise_get = server_ss_val_bitwise_get;
73
74 /* Not used. Set to dummy functions. */
75 funcs->player_tile_vision_get = tool_player_tile_vision_get;
76 funcs->player_tile_city_id_get = tool_player_tile_city_id_get;
77 funcs->gui_color_free = tool_gui_color_free;
78
79 /* Keep this function call at the end. It checks if all required functions
80 are defined. */
81 libfreeciv_init(TRUE);
82}
pcolor
struct canvas int int int int struct sprite *sprite struct canvas struct color * pcolor
Definition canvas_g.h:56
incite_cost
char * incite_cost
Definition comments.c:74
libfreeciv_init
void libfreeciv_init(bool check_fc_interface)
Definition fc_interface.c:75
fc_interface_funcs
struct functions * fc_interface_funcs(void)
Definition fc_interface.c:47
fc_interface.h
IDENTITY_NUMBER_ZERO
#define IDENTITY_NUMBER_ZERO
Definition fc_types.h:92
funcs
static struct gui_funcs funcs
Definition gui_interface.c:36
log_error
#define log_error(message,...)
Definition log.h:103
server_ss_name_get
const char * server_ss_name_get(server_setting_id id)
Definition srv_main.c:3635
server_ss_val_bool_get
bool server_ss_val_bool_get(server_setting_id id)
Definition srv_main.c:3665
server_ss_by_name
server_setting_id server_ss_by_name(const char *name)
Definition srv_main.c:3620
server_ss_val_int_get
int server_ss_val_int_get(server_setting_id id)
Definition srv_main.c:3680
server_ss_val_bitwise_get
unsigned int server_ss_val_bitwise_get(server_setting_id id)
Definition srv_main.c:3695
server_ss_type_get
enum sset_type server_ss_type_get(server_setting_id id)
Definition srv_main.c:3650
srv_main.h
color
Definition colors.h:21
functions
Definition fc_interface.h:33
player
Definition player.h:247
tile
Definition tile.h:50
vision
Definition vision.h:85
TRUE
#define TRUE
Definition support.h:46
FALSE
#define FALSE
Definition support.h:47
tool_player_tile_vision_get
static bool tool_player_tile_vision_get(const struct tile *ptile, const struct player *pplayer, enum vision_layer vision)
Definition tools_fc_interface.c:31
tool_player_tile_city_id_get
static int tool_player_tile_city_id_get(const struct tile *ptile, const struct player *pplayer)
Definition tools_fc_interface.c:42
tool_gui_color_free
static void tool_gui_color_free(struct color *pcolor)
Definition tools_fc_interface.c:52
fc_interface_init_tool
void fc_interface_init_tool(void)
Definition tools_fc_interface.c:60
tools_fc_interface.h