Freeciv-3.3: /fast/freeciv/nightly/main/server/ruleset/rscompat.h File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Functions
rscompat.h File Reference
`#include "support.h"`
`#include "ruleload.h"`
`#include "settings.h"`

Go to the source code of this file.

## Data Structures

struct | rscompat_info

## Macros

#define | RULESET_COMPAT_CAP "+Freeciv-ruleset-3.2-Devel-2022.Feb.02"

## Functions

void | rscompat_init_info (struct rscompat_info *info)
int | rscompat_check_capabilities (struct section_file *file, const char *filename, const struct rscompat_info *info)
bool | rscompat_check_cap_and_version (struct section_file *file, const char *filename, const struct rscompat_info *info)
bool | rscompat_names (struct rscompat_info *info)
void | rscompat_postprocess (struct rscompat_info *info)
void | rscompat_enablers_add_obligatory_hard_reqs (void)
struct requirement_vector * | lookup_req_list (struct section_file *file, struct rscompat_info *compat, const char *sec, const char *sub, const char *rfor)
const char * | rscompat_utype_flag_name_3_3 (const char *old_name)

## Macro Definition Documentation

## ◆ RULESET_COMPAT_CAP

#define RULESET_COMPAT_CAP "+Freeciv-ruleset-3.2-Devel-2022.Feb.02"

Definition at line 27 of file rscompat.h.

## Function Documentation

## ◆ 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
| ) |  |

Load a requirement list. The list is returned as a static vector (callers need not worry about freeing anything).

Definition at line 654 of file ruleload.c.

Referenced by load_ruleset_actions(), load_ruleset_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_styles(), load_ruleset_techs(), load_ruleset_terrain(), and load_ruleset_units().

## ◆ rscompat_check_cap_and_version()

bool rscompat_check_cap_and_version | ( | struct section_file * | file,
|  | const char * | filename,
|  | const struct rscompat_info * | info
| ) |  |

Different ruleset files within a ruleset directory should all have identical datafile.format_version This checks the file version against the expected version.

See also rscompat_check_capabilities

Definition at line 131 of file rscompat.c.

Referenced by load_action_names(), load_building_names(), load_government_names(), load_nation_names(), load_ruleset_cities(), load_ruleset_effects(), load_style_names(), load_tech_names(), load_terrain_names(), and load_unit_names().

## ◆ rscompat_check_capabilities()

int rscompat_check_capabilities | ( | struct section_file * | file,
|  | const char * | filename,
|  | const struct rscompat_info * | info
| ) |  |

Ruleset files should have a capabilities string datafile.options This checks the string and that the required capabilities are satisfied.

Definition at line 66 of file rscompat.c.

Referenced by load_game_names(), and rscompat_check_cap_and_version().

## ◆ rscompat_enablers_add_obligatory_hard_reqs()

void rscompat_enablers_add_obligatory_hard_reqs | ( | void |  | ) |

Update existing action enablers for new hard obligatory requirements. Disable those that can't be upgraded.

Definition at line 286 of file rscompat.c.

Referenced by rscompat_postprocess(), and ruleset_purge_redundant_reqs().

## ◆ rscompat_init_info()

void rscompat_init_info | ( | struct rscompat_info * | info | ) |

Initialize rscompat information structure

Definition at line 57 of file rscompat.c.

Referenced by load_rulesetdir(), and tab_misc::sanity_check().

## ◆ rscompat_names()

bool rscompat_names | ( | struct rscompat_info * | info | ) |

Do compatibility things with names before they are referred to. Runs after names are loaded from the ruleset but before the ruleset objects that may refer to them are loaded.

This is needed when previously hard coded items that are referred to in the ruleset them self becomes ruleset defined.

Returns FALSE if an error occurs.

Definition at line 341 of file rscompat.c.

Referenced by load_rulesetdir().

## ◆ rscompat_postprocess()

void rscompat_postprocess | ( | struct rscompat_info * | info | ) |

Do compatibility things after regular ruleset loading.

Definition at line 405 of file rscompat.c.

Referenced by load_rulesetdir().

## ◆ rscompat_utype_flag_name_3_3()

const char * rscompat_utype_flag_name_3_3 | ( | const char * | old_name | ) |

Convert 3.2 unit type flag name to 3.3 one.

Definition at line 472 of file rscompat.c.

Referenced by load_ruleset_units().