Freeciv-3.2: /fast/freeciv/nightly/S3_2/server/rscompat.h Source File

Freeciv-3.2

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#include "settings.h"
26
27#define RULESET_COMPAT_CAP "+Freeciv-3.1-ruleset"
28
29 struct rscompat_info
30{
31 bool compat_mode;
32 rs_conversion_logger log_cb;
33 int version;
34};
35
36void rscompat_init_info(struct rscompat_info *info);
37
38int rscompat_check_capabilities(struct section_file *file, const char *filename,
39 const struct rscompat_info *info);
40bool rscompat_check_cap_and_version(struct section_file *file,
41 const char *filename,
42 const struct rscompat_info *info);
43
44bool rscompat_names(struct rscompat_info *info);
45
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.1 -> 3.2 transition */
60enum impr_genus_id rscompat_genus_3_2(struct rscompat_info *compat,
61 const bv_impr_flags flags,
62 enum impr_genus_id old_genus);
63const char *rscompat_req_range_3_2(struct rscompat_info *compat,
64 const char *type,
65 const char *old_range);
66void rscompat_req_adjust_3_2(const struct rscompat_info *compat,
67 const char **ptype, const char **pname,
68 bool *ppresent, const char *sec_name);
69int add_user_extra_flags_3_2(int start);
70const char *rscompat_extra_rmcause_3_2(struct extra_type *pextra,
71 const char *old_name);
72void rscompat_extra_adjust_3_2(struct extra_type *pextra);
73bool rscompat_setting_needs_special_handling(const char *name);
74void rscompat_settings_do_special_handling(struct section_file *file,
75 const char *section, void (*setdef)(struct setting *pset));
76bool rscompat_terrain_extra_rmtime_3_2(struct section_file *file,
77 const char *tsection,
78 struct terrain *pterrain);
79const char *rscompat_action_rule_name_3_2(struct rscompat_info *compat,
80 const char *orig);
81const char *rscompat_action_ui_name_3_2(struct rscompat_info *compat,
82 int act_id);
83void rscompat_action_enabler_adjust_3_2(struct rscompat_info *compat,
84 struct action_enabler *enabler,
85 const char *orig_name);
86
87/* In ruleset.c, but should not be in public interface - make static again once
88 * rscompat.c no longer needs. */
89bool lookup_time(const struct section_file *secfile, int *turns,
90 const char *sec_name, const char *property_name,
91 const char *filename, const char *item_name,
92 bool *ok);
93
94#ifdef __cplusplus
95}
96#endif /* __cplusplus */
97
98#endif /* FC__RSCOMPAT_H */
incite_cost
char * incite_cost
Definition comments.c:74
type
GType type
Definition repodlgs.c:1313
name
const char * name
Definition inputfile.c:127
rscompat_settings_do_special_handling
void rscompat_settings_do_special_handling(struct section_file *file, const char *section, void(*setdef)(struct setting *pset))
Definition rscompat.c:632
rscompat_req_range_3_2
const char * rscompat_req_range_3_2(struct rscompat_info *compat, const char *type, const char *old_range)
Definition rscompat.c:466
add_user_extra_flags_3_2
int add_user_extra_flags_3_2(int start)
Definition rscompat.c:559
rscompat_action_ui_name_3_2
const char * rscompat_action_ui_name_3_2(struct rscompat_info *compat, int act_id)
Definition rscompat.c:778
lookup_time
bool lookup_time(const struct section_file *secfile, int *turns, const char *sec_name, const char *property_name, const char *filename, const char *item_name, bool *ok)
Definition ruleset.c:1264
rscompat_terrain_extra_rmtime_3_2
bool rscompat_terrain_extra_rmtime_3_2(struct section_file *file, const char *tsection, struct terrain *pterrain)
Definition rscompat.c:708
rscompat_names
bool rscompat_names(struct rscompat_info *info)
Definition rscompat.c:330
rscompat_setting_needs_special_handling
bool rscompat_setting_needs_special_handling(const char *name)
Definition rscompat.c:618
rscompat_postprocess
void rscompat_postprocess(struct rscompat_info *info)
Definition rscompat.c:381
rscompat_check_capabilities
int rscompat_check_capabilities(struct section_file *file, const char *filename, const struct rscompat_info *info)
Definition rscompat.c:66
rscompat_extra_adjust_3_2
void rscompat_extra_adjust_3_2(struct extra_type *pextra)
Definition rscompat.c:598
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:654
rscompat_enablers_add_obligatory_hard_reqs
void rscompat_enablers_add_obligatory_hard_reqs(void)
Definition rscompat.c:286
rscompat_action_rule_name_3_2
const char * rscompat_action_rule_name_3_2(struct rscompat_info *compat, const char *orig)
Definition rscompat.c:748
rscompat_req_adjust_3_2
void rscompat_req_adjust_3_2(const struct rscompat_info *compat, const char **ptype, const char **pname, bool *ppresent, const char *sec_name)
Definition rscompat.c:493
rscompat_genus_3_2
enum impr_genus_id rscompat_genus_3_2(struct rscompat_info *compat, const bv_impr_flags flags, enum impr_genus_id old_genus)
Definition rscompat.c:450
rscompat_action_enabler_adjust_3_2
void rscompat_action_enabler_adjust_3_2(struct rscompat_info *compat, struct action_enabler *enabler, const char *orig_name)
Definition rscompat.c:763
rscompat_extra_rmcause_3_2
const char * rscompat_extra_rmcause_3_2(struct extra_type *pextra, const char *old_name)
Definition rscompat.c:572
rscompat_init_info
void rscompat_init_info(struct rscompat_info *info)
Definition rscompat.c:57
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
ruleset.h
rs_conversion_logger
void(* rs_conversion_logger)(const char *msg)
Definition ruleset.h:40
compat
static struct compatibility compat[]
Definition savecompat.c:110
settings.h
action_enabler
Definition actions.h:419
extra_type
Definition extras.h:88
rscompat_info
Definition rscompat.h:30
rscompat_info::version
int version
Definition rscompat.h:33
rscompat_info::compat_mode
bool compat_mode
Definition rscompat.h:31
rscompat_info::log_cb
rs_conversion_logger log_cb
Definition rscompat.h:32
section_file
Definition section_file.h:36
section
Definition section_file.h:28
setting
Definition settings.c:92
terrain
Definition terrain.h:182
support.h