Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/rscompat.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
rscompat.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
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#ifndef FC__RSCOMPAT_H
14#define FC__RSCOMPAT_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "support.h"
22
23/* server */
24#include "ruleset.h"
25
26#define RULESET_COMPAT_CAP "+Freeciv-3.0-ruleset"
27
28 struct rscompat_info
29{
30 bool compat_mode;
31 rs_conversion_logger log_cb;
32 int version;
33};
34
35void rscompat_init_info(struct rscompat_info *info);
36
37int rscompat_check_capabilities(struct section_file *file, const char *filename,
38 const struct rscompat_info *info);
39bool rscompat_check_cap_and_version(struct section_file *file,
40 const char *filename,
41 const struct rscompat_info *info);
42
43bool rscompat_names(struct rscompat_info *info);
44
45void rscompat_adjust_pre_sanity(struct rscompat_info *info);
46void rscompat_postprocess(struct rscompat_info *info);
47
48/* General upgrade functions that should be kept to avoid regressions in
49 * corner case handling. */
50void rscompat_enablers_add_obligatory_hard_reqs(void);
51
52/* Functions from ruleset.c made visible to rscompat.c */
53struct requirement_vector *lookup_req_list(struct section_file *file,
54 struct rscompat_info *compat,
55 const char *sec,
56 const char *sub,
57 const char *rfor);
58
59/* Functions specific to 3.0 -> 3.1 transition */
60bool rscompat_auto_attack_3_1(struct rscompat_info *compat,
61 struct action_auto_perf *auto_perf,
62 size_t psize,
63 enum unit_type_flag_id *protecor_flag);
64const char *rscompat_req_type_name_3_1(const char *old_type);
65const char *rscompat_req_name_3_1(const char *type,
66 const char *old_name);
67void rscompat_req_vec_adjust_3_1(struct rscompat_info *compat,
68 struct requirement_vector *preqs,
69 int *reqs_count,
70 const char *filename, const char *sec,
71 const char *sub, const char *rfor);
72const char *rscompat_utype_flag_name_3_1(struct rscompat_info *info,
73 const char *old_type);
74const char *rscompat_combat_bonus_name_3_1(struct rscompat_info *compat,
75 const char *old_type);
76bool rscompat_old_effect_3_1(const char *type, struct section_file *file,
77 const char *sec_name, struct rscompat_info *compat);
78void rscompat_uclass_flags_3_1(struct rscompat_info *compat,
79 struct unit_class *pclass);
80void rscompat_extra_adjust_3_1(struct rscompat_info *compat,
81 struct extra_type *pextra);
82enum road_gui_type rscompat_road_gui_type_3_1(struct road_type *proad);
83bool rscompat_old_slow_invasions_3_1(struct rscompat_info *compat,
84 bool slow_invasions);
85
86const char *rscompat_action_ui_name_S3_1(struct rscompat_info *compat,
87 int act_id);
88const char *rscompat_action_max_range_name_S3_1(struct rscompat_info *compat,
89 int act_id);
90
91#ifdef __cplusplus
92}
93#endif /* __cplusplus */
94
95#endif /* FC__RSCOMPAT_H */
type
GType type
Definition repodlgs.c:1312
rscompat_action_ui_name_S3_1
const char * rscompat_action_ui_name_S3_1(struct rscompat_info *compat, int act_id)
Definition rscompat.c:2238
rscompat_adjust_pre_sanity
void rscompat_adjust_pre_sanity(struct rscompat_info *info)
Definition rscompat.c:839
rscompat_road_gui_type_3_1
enum road_gui_type rscompat_road_gui_type_3_1(struct road_type *proad)
Definition rscompat.c:2220
rscompat_extra_adjust_3_1
void rscompat_extra_adjust_3_1(struct rscompat_info *compat, struct extra_type *pextra)
Definition rscompat.c:2204
rscompat_uclass_flags_3_1
void rscompat_uclass_flags_3_1(struct rscompat_info *compat, struct unit_class *pclass)
Definition rscompat.c:2192
rscompat_req_name_3_1
const char * rscompat_req_name_3_1(const char *type, const char *old_name)
Definition rscompat.c:2059
rscompat_auto_attack_3_1
bool rscompat_auto_attack_3_1(struct rscompat_info *compat, struct action_auto_perf *auto_perf, size_t psize, enum unit_type_flag_id *protecor_flag)
Definition rscompat.c:1749
rscompat_old_effect_3_1
bool rscompat_old_effect_3_1(const char *type, struct section_file *file, const char *sec_name, struct rscompat_info *compat)
Definition rscompat.c:806
rscompat_names
bool rscompat_names(struct rscompat_info *info)
Definition rscompat.c:386
rscompat_req_vec_adjust_3_1
void rscompat_req_vec_adjust_3_1(struct rscompat_info *compat, struct requirement_vector *preqs, int *reqs_count, const char *filename, const char *sec, const char *sub, const char *rfor)
Definition rscompat.c:2079
rscompat_old_slow_invasions_3_1
bool rscompat_old_slow_invasions_3_1(struct rscompat_info *compat, bool slow_invasions)
Definition rscompat.c:1908
rscompat_postprocess
void rscompat_postprocess(struct rscompat_info *info)
Definition rscompat.c:859
rscompat_check_capabilities
int rscompat_check_capabilities(struct section_file *file, const char *filename, const struct rscompat_info *info)
Definition rscompat.c:65
rscompat_utype_flag_name_3_1
const char * rscompat_utype_flag_name_3_1(struct rscompat_info *info, const char *old_type)
Definition rscompat.c:2165
lookup_req_list
struct requirement_vector * lookup_req_list(struct section_file *file, struct rscompat_info *compat, const char *sec, const char *sub, const char *rfor)
Definition ruleset.c:645
rscompat_enablers_add_obligatory_hard_reqs
void rscompat_enablers_add_obligatory_hard_reqs(void)
Definition rscompat.c:285
rscompat_action_max_range_name_S3_1
const char * rscompat_action_max_range_name_S3_1(struct rscompat_info *compat, int act_id)
Definition rscompat.c:2253
rscompat_init_info
void rscompat_init_info(struct rscompat_info *info)
Definition rscompat.c:56
rscompat_check_cap_and_version
bool rscompat_check_cap_and_version(struct section_file *file, const char *filename, const struct rscompat_info *info)
Definition rscompat.c:131
rscompat_combat_bonus_name_3_1
const char * rscompat_combat_bonus_name_3_1(struct rscompat_info *compat, const char *old_type)
Definition rscompat.c:2177
rscompat_req_type_name_3_1
const char * rscompat_req_type_name_3_1(const char *old_type)
Definition rscompat.c:2043
ruleset.h
rs_conversion_logger
void(* rs_conversion_logger)(const char *msg)
Definition ruleset.h:40
compat
static struct compatibility compat[]
Definition savecompat.c:101
action_auto_perf
Definition actions.h:568
extra_type
Definition extras.h:85
road_type
Definition road.h:75
rscompat_info
Definition rscompat.h:29
rscompat_info::version
int version
Definition rscompat.h:32
rscompat_info::compat_mode
bool compat_mode
Definition rscompat.h:30
rscompat_info::log_cb
rs_conversion_logger log_cb
Definition rscompat.h:31
section_file
Definition section_file.h:36
unit_class
Definition unittype.h:136
support.h