File: tools_fc_interface.c

package info (click to toggle)
freeciv 3.2.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 286,492 kB
  • sloc: ansic: 484,452; cpp: 37,766; sh: 10,374; makefile: 7,425; python: 2,938; xml: 652; sed: 11
file content (82 lines) | stat: -rw-r--r-- 3,163 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/***********************************************************************
 Freeciv - Copyright (C) 2017 - Freeciv Development Team
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2, or (at your option)
   any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.
***********************************************************************/

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

/* common */
#include "fc_interface.h"

/* server */
#include "srv_main.h"


#include "tools_fc_interface.h"


/***********************************************************************//**
  Unused but required by fc_interface_init()
***************************************************************************/
static bool tool_player_tile_vision_get(const struct tile *ptile,
                                        const struct player *pplayer,
                                        enum vision_layer vision)
{
  log_error("Assumed unused function %s called.",  __FUNCTION__);
  return FALSE;
}

/***********************************************************************//**
  Unused but required by fc_interface_init()
***************************************************************************/
static int tool_player_tile_city_id_get(const struct tile *ptile,
                                        const struct player *pplayer)
{
  log_error("Assumed unused function %s called.",  __FUNCTION__);
  return IDENTITY_NUMBER_ZERO;
}

/***********************************************************************//**
  Unused but required by fc_interface_init()
***************************************************************************/
static void tool_gui_color_free(struct color *pcolor)
{
  log_error("Assumed unused function %s called.",  __FUNCTION__);
}

/***********************************************************************//**
  Initialize tool specific functions.
***************************************************************************/
void fc_interface_init_tool(void)
{
  struct functions *funcs = fc_interface_funcs();

  memset(funcs, 0, sizeof(*funcs));

  /* May be used when generating help texts */
  funcs->server_setting_by_name = server_ss_by_name;
  funcs->server_setting_name_get = server_ss_name_get;
  funcs->server_setting_type_get = server_ss_type_get;
  funcs->server_setting_val_bool_get = server_ss_val_bool_get;
  funcs->server_setting_val_int_get = server_ss_val_int_get;
  funcs->server_setting_val_bitwise_get = server_ss_val_bitwise_get;

  /* Not used. Set to dummy functions. */
  funcs->player_tile_vision_get = tool_player_tile_vision_get;
  funcs->player_tile_city_id_get = tool_player_tile_city_id_get;
  funcs->gui_color_free = tool_gui_color_free;

  /* Keep this function call at the end. It checks if all required functions
     are defined. */
  libfreeciv_init(TRUE);
}