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)
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__SAVECOMPAT_H
14 #define FC__SAVECOMPAT_H
27 enum tile_special_type
{
35 /* internal values not saved */
46 struct section_file
*file
;
47 const char *secfile_options
;
50 /* loaded in sg_load_savefile(); needed in sg_load_player() */
55 /* loaded in sg_load_savefile(); needed in sg_load_player() */
60 /* loaded in sg_load_savefile(); needed in sg_load_player() */
65 /* loaded in sg_load_savefile(); needed in sg_load_map(), ... */
67 struct extra_type
**order
;
70 /* loaded in sg_load_savefile(); needed in sg_load_players_basic() */
72 struct multiplier
**order
;
75 /* loaded in sg_load_savefile(); needed in sg_load_map(), ... */
77 enum tile_special_type
*order
;
80 /* loaded in sg_load_savefile(); needed in sg_load_map(), ... */
82 struct base_type
**order
;
85 /* loaded in sg_load_savefile(); needed in sg_load_map(), ... */
87 struct road_type
**order
;
90 /* loaded in sg_load_savefile(); needed in sg_load_(), ... */
92 struct specialist
**order
;
95 /* loaded in sg_load_savefile(); needed in sg_load_player_main(), ... */
97 enum diplstate_type
*order
;
101 /* loaded in sg_load_game(); needed in sg_load_random(), ... */
102 enum server_states server_state
;
104 /* loaded in sg_load_random(); needed in sg_load_sanitycheck() */
107 /* loaded in sg_load_map_worked(); needed in sg_load_player_cities() */
111 #define log_sg log_error
113 #define sg_check_ret(...) \
117 #define sg_check_ret_val(_val) \
122 #define sg_warn(condition, message, ...) \
123 if (!(condition)) { \
124 log_sg(message, ## __VA_ARGS__); \
126 #define sg_warn_ret(condition, message, ...) \
127 if (!(condition)) { \
128 log_sg(message, ## __VA_ARGS__); \
131 #define sg_warn_ret_val(condition, _val, message, ...) \
132 if (!(condition)) { \
133 log_sg(message, ## __VA_ARGS__); \
137 #define sg_failure_ret(condition, message, ...) \
138 if (!(condition)) { \
139 sg_success = FALSE; \
140 log_sg(message, ## __VA_ARGS__); \
143 #define sg_failure_ret_val(condition, _val, message, ...) \
144 if (!(condition)) { \
145 sg_success = FALSE; \
146 log_sg(message, ## __VA_ARGS__); \
147 sg_check_ret_val(_val); \
150 void sg_load_compat(struct loaddata
*loading
);
151 int current_compat_ver(void);
153 #define hex_chars "0123456789abcdef"
155 char bin2ascii_hex(int value
, int halfbyte_wanted
);
156 int ascii_hex2bin(char ch
, int halfbyte
);
158 enum tile_special_type
special_by_rule_name(const char *name
);
159 const char *special_rule_name(enum tile_special_type type
);
161 enum ai_level
ai_level_convert(int old_level
);
162 enum barbarian_type
barb_type_convert(int old_type
);
164 #endif /* FC__SAVECOMPAT_H */