Freeciv21
Develop your civilization from humble roots to a global empire
fc_interface.cpp
Go to the documentation of this file.
1 /*
2 _ ._ Copyright (c) 1996-2021 Freeciv21 and Freeciv contributors.
3  \ | This file is part of Freeciv21. Freeciv21 is free software: you
4  \_| can redistribute it and/or modify it under the terms of the
5  .' '. GNU General Public License as published by the Free
6  :O O: Software Foundation, either version 3 of the License,
7  '/ \' or (at your option) any later version. You should have
8  :X: received a copy of the GNU General Public License along with
9  :X: Freeciv21. If not, see https://www.gnu.org/licenses/.
10  */
11 
12 // utility
13 #include "shared.h"
14 
15 // common
16 #include "player.h"
17 #include "tile.h"
18 
19 #include "fc_interface.h"
20 
21 /* Struct with functions pointers; the functions are defined in
22  ./client/client_main.c:init_client_functions() and
23  ./server/srv_main.c:init_server_functions(). */
24 struct functions fc_functions;
25 
26 // The functions are accessed via this pointer.
27 const struct functions *fc_funcs = nullptr;
28 /* After this is set to TRUE (in interface_init()), the functions are
29  available via fc_funcs. */
30 bool fc_funcs_defined = false;
31 
37 {
39 
40  return &fc_functions;
41 }
42 
48 {
50 
51  // Test the existence of each required function here!
60 
61  fc_funcs_defined = true;
62 
64 }
65 
70 {
73 }
const struct functions * fc_funcs
void free_libfreeciv()
Free misc resources allocated for libfreeciv.
struct functions * fc_interface_funcs()
Return the function pointer.
struct functions fc_functions
bool fc_funcs_defined
void fc_interface_init()
Test and initialize the functions.
#define fc_assert_exit(condition)
Definition: log.h:117
void diplrel_mess_close()
Free diplrel_mess.
Definition: player.cpp:1701
void free_multicast_group()
Free multicast group resources.
Definition: shared.cpp:1091
int(* player_tile_city_id_get)(const struct tile *ptile, const struct player *pplayer)
Definition: fc_interface.h:42
int(* server_setting_val_int_get)(server_setting_id id)
Definition: fc_interface.h:29
bool(* player_tile_vision_get)(const struct tile *ptile, const struct player *pplayer, enum vision_layer vision)
Definition: fc_interface.h:36
const char *(* server_setting_name_get)(server_setting_id id)
Definition: fc_interface.h:26
bool(* server_setting_val_bool_get)(server_setting_id id)
Definition: fc_interface.h:28
server_setting_id(* server_setting_by_name)(const char *name)
Definition: fc_interface.h:25
unsigned int(* server_setting_val_bitwise_get)(server_setting_id id)
Definition: fc_interface.h:30
enum sset_type(* server_setting_type_get)(server_setting_id id)
Definition: fc_interface.h:27
void setup_real_activities_array()
Setup array of real activities.
Definition: unit.cpp:556