Freeciv-3.3: /fast/freeciv/nightly/main/utility/registry_ini.c File Reference

Freeciv-3.3

Loading...
Searching...
No Matches
Data Structures | Macros | Functions
registry_ini.c File Reference
`#include <stdarg.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include "astring.h"`
`#include "bugs.h"`
`#include "deprecations.h"`
`#include "fcintl.h"`
`#include "inputfile.h"`
`#include "ioz.h"`
`#include "log.h"`
`#include "mem.h"`
`#include "registry.h"`
`#include "section_file.h"`
`#include "shared.h"`
`#include "support.h"`
`#include "registry_ini.h"`
`#include "specvec.h"`

Go to the source code of this file.

## Data Structures

struct | entry

## Macros

#define | MAX_LEN_SECPATH 1024
#define | SAVE_TABLES TRUE
#define | SPECVEC_TAG astring

## Functions

static bool | entry_used (const struct entry *pentry)
static void | entry_use (struct entry *pentry)
static void | entry_to_file (const struct entry *pentry, fz_FILE *fs)
static void | entry_from_inf_token (struct section *psection, const char *name, const char *tok, struct inputfile *file)
static struct entry * | section_entry_filereference_new (struct section *psection, const char *name, const char *value)
static struct entry * | section_entry_comment_new (struct section *psection, const char *comment)
static const char * | datafilename (const char *filename)
static bool | is_secfile_entry_name_valid (const char *name)
static bool | secfile_hash_insert (struct section_file *secfile, struct entry *pentry)
static bool | secfile_hash_delete (struct section_file *secfile, struct entry *pentry)
static struct section_file * | secfile_from_input_file (struct inputfile *inf, const char *filename, const char *section, bool allow_duplicates)
struct section_file * | secfile_load_section (const char *filename, const char *section, bool allow_duplicates)
struct section_file * | secfile_from_stream (fz_FILE *stream, bool allow_duplicates)
static bool | is_legal_table_entry_name (char c, bool num)
bool | secfile_save (const struct section_file *secfile, const char *filename, int compression_level, enum fz_method compression_method)
void | secfile_check_unused (const struct section_file *secfile)
const char * | secfile_name (const struct section_file *secfile)
static struct section * | secfile_insert_base (struct section_file *secfile, const char *path, const char **pent_name)
struct entry * | secfile_insert_bool_full (struct section_file *secfile, bool value, const char *comment, bool allow_replace, const char *path,...)
size_t | secfile_insert_bool_vec_full (struct section_file *secfile, const bool *values, size_t dim, const char *comment, bool allow_replace, const char *path,...)
struct entry * | secfile_insert_int_full (struct section_file *secfile, int value, const char *comment, bool allow_replace, const char *path,...)
size_t | secfile_insert_int_vec_full (struct section_file *secfile, const int *values, size_t dim, const char *comment, bool allow_replace, const char *path,...)
struct entry * | secfile_insert_float_full (struct section_file *secfile, float value, const char *comment, bool allow_replace, const char *path,...)
struct section * | secfile_insert_include (struct section_file *secfile, const char *filename)
struct section * | secfile_insert_long_comment (struct section_file *secfile, const char *comment)
struct entry * | secfile_insert_str_full (struct section_file *secfile, const char *str, const char *comment, bool allow_replace, bool no_escape, enum entry_special_type stype, const char *path,...)
struct entry * | secfile_insert_comment (struct section_file *secfile, const char *str, const char *path,...)
size_t | secfile_insert_str_vec_full (struct section_file *secfile, const char *const *strings, size_t dim, const char *comment, bool allow_replace, bool no_escape, const char *path,...)
struct entry * | secfile_insert_filereference (struct section_file *secfile, const char *filename, const char *path,...)
struct entry * | secfile_insert_plain_enum_full (struct section_file *secfile, int enumerator, secfile_enum_name_fn_t name_fn, const char *comment, bool allow_replace, const char *path,...)
size_t | secfile_insert_plain_enum_vec_full (struct section_file *secfile, const int *enumurators, size_t dim, secfile_enum_name_fn_t name_fn, const char *comment, bool allow_replace, const char *path,...)
struct entry * | secfile_insert_bitwise_enum_full (struct section_file *secfile, int bitwise_val, secfile_enum_name_fn_t name_fn, secfile_enum_iter_fn_t begin_fn, secfile_enum_iter_fn_t end_fn, secfile_enum_next_fn_t next_fn, const char *comment, bool allow_replace, const char *path,...)
size_t | secfile_insert_bitwise_enum_vec_full (struct section_file *secfile, const int *bitwise_vals, size_t dim, secfile_enum_name_fn_t name_fn, secfile_enum_iter_fn_t begin_fn, secfile_enum_iter_fn_t end_fn, secfile_enum_next_fn_t next_fn, const char *comment, bool allow_replace, const char *path,...)
struct entry * | secfile_insert_enum_data_full (struct section_file *secfile, int value, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *comment, bool allow_replace, const char *path,...)
size_t | secfile_insert_enum_vec_data_full (struct section_file *secfile, const int *values, size_t dim, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *comment, bool allow_replace, const char *path,...)
struct entry * | secfile_entry_by_path (const struct section_file *secfile, const char *path)
bool | secfile_entry_delete (struct section_file *secfile, const char *path,...)
struct entry * | secfile_entry_lookup (const struct section_file *secfile, const char *path,...)
bool | secfile_lookup_bool (const struct section_file *secfile, bool *bval, const char *path,...)
bool | secfile_lookup_bool_default (const struct section_file *secfile, bool def, const char *path,...)
bool * | secfile_lookup_bool_vec (const struct section_file *secfile, size_t *dim, const char *path,...)
bool | secfile_lookup_int (const struct section_file *secfile, int *ival, const char *path,...)
int | secfile_lookup_int_default (const struct section_file *secfile, int def, const char *path,...)
int | secfile_lookup_int_def_min_max (const struct section_file *secfile, int defval, int minval, int maxval, const char *path,...)
int * | secfile_lookup_int_vec (const struct section_file *secfile, size_t *dim, const char *path,...)
bool | secfile_lookup_float (const struct section_file *secfile, float *fval, const char *path,...)
float | secfile_lookup_float_default (const struct section_file *secfile, float def, const char *path,...)
const char * | secfile_lookup_str (const struct section_file *secfile, const char *path,...)
const char * | secfile_lookup_str_default (const struct section_file *secfile, const char *def, const char *path,...)
const char ** | secfile_lookup_str_vec (const struct section_file *secfile, size_t *dim, const char *path,...)
bool | secfile_lookup_plain_enum_full (const struct section_file *secfile, int *penumerator, secfile_enum_is_valid_fn_t is_valid_fn, secfile_enum_by_name_fn_t by_name_fn, const char *path,...)
int | secfile_lookup_plain_enum_default_full (const struct section_file *secfile, int defval, secfile_enum_is_valid_fn_t is_valid_fn, secfile_enum_by_name_fn_t by_name_fn, const char *path,...)
int * | secfile_lookup_plain_enum_vec_full (const struct section_file *secfile, size_t *dim, secfile_enum_is_valid_fn_t is_valid_fn, secfile_enum_by_name_fn_t by_name_fn, const char *path,...)
bool | secfile_lookup_bitwise_enum_full (const struct section_file *secfile, int *penumerator, secfile_enum_is_valid_fn_t is_valid_fn, secfile_enum_by_name_fn_t by_name_fn, const char *path,...)
int | secfile_lookup_bitwise_enum_default_full (const struct section_file *secfile, int defval, secfile_enum_is_valid_fn_t is_valid_fn, secfile_enum_by_name_fn_t by_name_fn, const char *path,...)
int * | secfile_lookup_bitwise_enum_vec_full (const struct section_file *secfile, size_t *dim, secfile_enum_is_valid_fn_t is_valid_fn, secfile_enum_by_name_fn_t by_name_fn, const char *path,...)
bool | secfile_lookup_enum_data (const struct section_file *secfile, int *pvalue, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *path,...)
int | secfile_lookup_enum_default_data (const struct section_file *secfile, int defval, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *path,...)
int * | secfile_lookup_enum_vec_data (const struct section_file *secfile, size_t *dim, bool bitwise, secfile_enum_name_data_fn_t name_fn, secfile_data_t data, const char *path,...)
struct section * | secfile_section_by_name (const struct section_file *secfile, const char *name)
struct section * | secfile_section_lookup (const struct section_file *secfile, const char *path,...)
const struct section_list * | secfile_sections (const struct section_file *secfile)
struct section_list * | secfile_sections_by_name_prefix (const struct section_file *secfile, const char *prefix)
bool | secfile_section_prefix_present (const struct section_file *secfile, const char *prefix)
struct section * | secfile_section_new (struct section_file *secfile, const char *name)
void | section_destroy (struct section *psection)
void | section_clear_all (struct section *psection)
bool | section_set_name (struct section *psection, const char *name)
const struct entry_list * | section_entries (const struct section *psection)
struct entry * | section_entry_by_name (const struct section *psection, const char *name)
struct entry * | section_entry_lookup (const struct section *psection, const char *path,...)
static struct entry * | entry_new (struct section *psection, const char *name)
struct entry * | section_entry_int_new (struct section *psection, const char *name, int value)
struct entry * | section_entry_bool_new (struct section *psection, const char *name, bool value)
struct entry * | section_entry_float_new (struct section *psection, const char *name, float value)
struct entry * | section_entry_str_new (struct section *psection, const char *name, const char *value, bool escaped)
void | entry_destroy (struct entry *pentry)
struct section * | entry_section (const struct entry *pentry)
enum entry_type | entry_type_get (const struct entry *pentry)
int | entry_path (const struct entry *pentry, char *buf, size_t buf_len)
const char * | entry_name (const struct entry *pentry)
bool | entry_set_name (struct entry *pentry, const char *name)
const char * | entry_comment (const struct entry *pentry)
void | entry_set_comment (struct entry *pentry, const char *comment)
bool | entry_bool_get (const struct entry *pentry, bool *value)
bool | entry_bool_set (struct entry *pentry, bool value)
bool | entry_float_get (const struct entry *pentry, float *value)
bool | entry_float_set (struct entry *pentry, float value)
bool | entry_int_get (const struct entry *pentry, int *value)
bool | entry_int_set (struct entry *pentry, int value)
bool | entry_str_get (const struct entry *pentry, const char **value)
bool | entry_str_set (struct entry *pentry, const char *value)
bool | entry_str_escaped (const struct entry *pentry)
bool | entry_str_set_escaped (struct entry *pentry, bool escaped)
bool | entry_str_set_gt_marking (struct entry *pentry, bool gt_marking)

## Macro Definition Documentation

## ◆ MAX_LEN_SECPATH

#define MAX_LEN_SECPATH 1024

Definition at line 175 of file registry_ini.c.

## ◆ SAVE_TABLES

#define SAVE_TABLES TRUE

Definition at line 178 of file registry_ini.c.

## ◆ SPECVEC_TAG

#define SPECVEC_TAG astring

Definition at line 180 of file registry_ini.c.

## Function Documentation

## ◆ datafilename()

static const char * datafilename | ( | const char * | filename | ) |

static

Simplification of fileinfoname().

Definition at line 232 of file registry_ini.c.

Referenced by secfile_from_stream(), and secfile_load_section().

## ◆ entry_bool_get()

bool entry_bool_get | ( | const struct entry * | pentry,
|  | bool * | value
| ) |  |

Gets an boolean value. Returns TRUE on success. On old saved files, 0 and 1 can also be considered as bool.

Definition at line 3454 of file registry_ini.c.

Referenced by lookup_req_list(), secfile_lookup_bool(), secfile_lookup_bool_default(), and settable_options_load().

## ◆ entry_bool_set()

bool entry_bool_set | ( | struct entry * | pentry,
|  | bool | value
| ) |  |

Sets an boolean value. Returns TRUE on success.

Definition at line 3482 of file registry_ini.c.

Referenced by secfile_insert_bool_full().

## ◆ entry_comment()

const char * entry_comment | ( | const struct entry * | pentry | ) |

Returns the comment associated to this entry.

Definition at line 3413 of file registry_ini.c.

Referenced by secfile_save().

## ◆ entry_destroy()

void entry_destroy | ( | struct entry * | pentry | ) |

Entry structure destructor.

Definition at line 3280 of file registry_ini.c.

Referenced by secfile_entry_delete(), secfile_insert_bitwise_enum_full(), secfile_insert_bool_full(), secfile_insert_enum_data_full(), secfile_insert_float_full(), secfile_insert_int_full(), secfile_insert_plain_enum_full(), secfile_insert_str_full(), and secfile_section_new().

## ◆ entry_float_get()

bool entry_float_get | ( | const struct entry * | pentry,
|  | float * | value
| ) |  |

Gets an floating value. Returns TRUE on success.

Definition at line 3495 of file registry_ini.c.

Referenced by secfile_lookup_float(), and secfile_lookup_float_default().

## ◆ entry_float_set()

bool entry_float_set | ( | struct entry * | pentry,
|  | float | value
| ) |  |

Sets an floating value. Returns TRUE on success.

Definition at line 3511 of file registry_ini.c.

Referenced by secfile_insert_float_full().

## ◆ entry_from_inf_token()

static void entry_from_inf_token | ( | struct section * | psection,
|  | const char * | name,
|  | const char * | tok,
|  | struct inputfile * | inf
| ) |  |

static

Creates a new entry from the token.

Definition at line 3686 of file registry_ini.c.

Referenced by secfile_from_input_file().

## ◆ entry_int_get()

bool entry_int_get | ( | const struct entry * | pentry,
|  | int * | value
| ) |  |

Gets an integer value. Returns TRUE on success.

Definition at line 3525 of file registry_ini.c.

Referenced by load_action_range_max(), lookup_req_list(), secfile_lookup_int(), secfile_lookup_int_def_min_max(), secfile_lookup_int_default(), and settable_options_load().

## ◆ entry_int_set()

bool entry_int_set | ( | struct entry * | pentry,
|  | int | value
| ) |  |

Sets an integer value. Returns TRUE on success.

Definition at line 3540 of file registry_ini.c.

Referenced by secfile_insert_int_full().

## ◆ entry_name()

const char * entry_name | ( | const struct entry * | pentry | ) |

Returns the name of this entry.

Definition at line 3357 of file registry_ini.c.

Referenced by compat_load_020400(), entry_path(), load_action_ui_name(), load_ruleset_actions(), options_dialogs_load(), save_action_ui_name(), secfile_check_unused(), secfile_lookup_bitwise_enum_full(), secfile_lookup_enum_data(), secfile_lookup_enum_default_data(), secfile_lookup_plain_enum_full(), secfile_save(), section_entry_by_name(), and settable_options_load().

## ◆ entry_new()

static struct entry * entry_new | ( | struct section * | psection,
|  | const char * | name
| ) |  |

static

Returns a new entry.

Definition at line 3129 of file registry_ini.c.

Referenced by section_entry_bool_new(), section_entry_comment_new(), section_entry_filereference_new(), section_entry_float_new(), section_entry_int_new(), and section_entry_str_new().

## ◆ entry_path()

int entry_path | ( | const struct entry * | pentry,
|  | char * | buf,
|  | size_t | buf_len
| ) |  |

Build the entry path. Returns like snprintf().

Definition at line 3347 of file registry_ini.c.

Referenced by secfile_hash_delete(), and secfile_hash_insert().

## ◆ entry_section()

struct section * entry_section | ( | const struct entry * | pentry | ) |

Returns the parent section of this entry.

Definition at line 3331 of file registry_ini.c.

Referenced by entry_path(), secfile_hash_insert(), secfile_lookup_bitwise_enum_full(), secfile_lookup_enum_data(), secfile_lookup_enum_default_data(), secfile_lookup_int_def_min_max(), secfile_lookup_plain_enum_full(), and section_entry_lookup().

## ◆ entry_set_comment()

void entry_set_comment | ( | struct entry * | pentry,
|  | const char * | comment
| ) |  |

Sets a comment for the entry. Pass NULL to remove the current one.

Definition at line 3421 of file registry_ini.c.

Referenced by secfile_insert_bitwise_enum_full(), secfile_insert_bool_full(), secfile_insert_enum_data_full(), secfile_insert_float_full(), secfile_insert_int_full(), secfile_insert_plain_enum_full(), and secfile_insert_str_full().

## ◆ entry_set_name()

bool entry_set_name | ( | struct entry * | pentry,
|  | const char * | name
| ) |  |

Sets the name of the entry. Returns TRUE on success.

Definition at line 3365 of file registry_ini.c.

Referenced by compat_load_020400().

## ◆ entry_str_escaped()

bool entry_str_escaped | ( | const struct entry * | pentry | ) |

Returns if the string would be escaped.

Definition at line 3589 of file registry_ini.c.

## ◆ entry_str_get()

bool entry_str_get | ( | const struct entry * | pentry,
|  | const char ** | value
| ) |  |

Gets an string value. Returns TRUE on success.

Definition at line 3553 of file registry_ini.c.

Referenced by load_action_range_max(), lookup_req_list(), secfile_lookup_bitwise_enum_default_full(), secfile_lookup_bitwise_enum_full(), secfile_lookup_enum_data(), secfile_lookup_enum_default_data(), secfile_lookup_plain_enum_default_full(), secfile_lookup_plain_enum_full(), secfile_lookup_str(), secfile_lookup_str_default(), and settable_options_load().

## ◆ entry_str_set()

bool entry_str_set | ( | struct entry * | pentry,
|  | const char * | value
| ) |  |

Sets an string value. Returns TRUE on success.

Definition at line 3568 of file registry_ini.c.

Referenced by secfile_insert_bitwise_enum_full(), secfile_insert_enum_data_full(), secfile_insert_plain_enum_full(), and secfile_insert_str_full().

## ◆ entry_str_set_escaped()

bool entry_str_set_escaped | ( | struct entry * | pentry,
|  | bool | escaped
| ) |  |

Sets if the string would be escaped. Returns TRUE on success.

Definition at line 3601 of file registry_ini.c.

## ◆ entry_str_set_gt_marking()

bool entry_str_set_gt_marking | ( | struct entry * | pentry,
|  | bool | gt_marking
| ) |  |

Sets if the string should get gettext marking. Returns TRUE on success.

Definition at line 3614 of file registry_ini.c.

Referenced by save_game_ruleset(), save_name_translation(), and sg_save_scenario().

## ◆ entry_to_file()

static void entry_to_file | ( | const struct entry * | pentry,
|  | fz_FILE * | fs
| ) |  |

static

Push an entry into a file stream.

Definition at line 3628 of file registry_ini.c.

Referenced by secfile_save().

## ◆ entry_type_get()

enum entry_type entry_type_get | ( | const struct entry * | pentry | ) |

Returns the type of this entry or ENTRY_ILLEGAL or error.

Definition at line 3339 of file registry_ini.c.

Referenced by load_action_range_max(), lookup_req_list(), secfile_insert_bitwise_enum_full(), secfile_insert_bool_full(), secfile_insert_enum_data_full(), secfile_insert_float_full(), secfile_insert_int_full(), secfile_insert_plain_enum_full(), secfile_insert_str_full(), and settable_options_load().

## ◆ entry_use()

static void entry_use | ( | struct entry * | pentry | ) |

inlinestatic

Increase the used count.

Definition at line 3445 of file registry_ini.c.

Referenced by secfile_entry_by_path(), secfile_hash_insert(), and section_entry_by_name().

## ◆ entry_used()

static bool entry_used | ( | const struct entry * | pentry | ) |

inlinestatic

Returns TRUE if this entry has been used.

Definition at line 3437 of file registry_ini.c.

Referenced by secfile_check_unused().

## ◆ is_legal_table_entry_name()

static bool is_legal_table_entry_name | ( | char | c,
|  | bool | num
| ) |  |

static

Returns TRUE iff the character is legal in a table entry name.

Definition at line 620 of file registry_ini.c.

Referenced by secfile_save().

## ◆ is_secfile_entry_name_valid()

static bool is_secfile_entry_name_valid | ( | const char * | name | ) |

static

Ensure name is correct to use it as section or entry name.

Definition at line 240 of file registry_ini.c.

Referenced by entry_new(), entry_set_name(), secfile_section_new(), and section_set_name().

## ◆ secfile_check_unused()

void secfile_check_unused | ( | const struct section_file * | secfile | ) |

Print log messages for any entries in the file which have not been looked up – ie, unused or unrecognised entries. To mark an entry as used without actually doing anything with it, you could do something like: section_file_lookup(&file, "foo.bar"); / * unused * /

Definition at line 907 of file registry_ini.c.

Referenced by boot_help_texts(), comments_load(), load_command(), load_ruleset_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_governments(), load_ruleset_nations(), load_ruleset_techs(), load_ruleset_terrain(), load_ruleset_units(), load_rulesetdir(), scan_specfile(), scan_specfile(), theme_read_toplevel(), and tileset_read_toplevel().

## ◆ secfile_entry_by_path()

struct entry * secfile_entry_by_path | ( | const struct section_file * | secfile,
|  | const char * | path
| ) |  |

Returns the entry by the name or NULL if not matched.

Definition at line 1784 of file registry_ini.c.

Referenced by load_action_blocked_by_list(), load_action_names(), load_building_names(), load_game_names(), load_government_names(), load_nation_names(), load_ruleset_actions(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_nations(), load_style_names(), load_tech_names(), load_terrain_names(), load_unit_names(), lookup_bv_actions(), scan_specfile(), secfile_entry_delete(), secfile_entry_lookup(), secfile_lookup_bitwise_enum_default_full(), secfile_lookup_bitwise_enum_full(), secfile_lookup_bool(), secfile_lookup_bool_default(), secfile_lookup_enum_data(), secfile_lookup_enum_default_data(), secfile_lookup_float(), secfile_lookup_float_default(), secfile_lookup_int(), secfile_lookup_int_def_min_max(), secfile_lookup_int_default(), secfile_lookup_plain_enum_default_full(), secfile_lookup_plain_enum_full(), secfile_lookup_str(), secfile_lookup_str_default(), section_entry_lookup(), sg_load_random(), sg_load_random(), sg_load_savefile(), sg_load_savefile(), and theme_read_toplevel().

## ◆ secfile_entry_delete()

bool secfile_entry_delete | ( | struct section_file * | secfile,
|  | const char * | path,
|  |  | ...
| ) |  |

Delete an entry.

Definition at line 1831 of file registry_ini.c.

Referenced by compat_load_020400(), and compat_load_020600().

## ◆ secfile_entry_lookup()

struct entry * secfile_entry_lookup | ( | const struct section_file * | secfile,
|  | const char * | path,
|  |  | ...
| ) |  |

Returns the entry at "fullpath" or NULL if not matched.

Definition at line 1857 of file registry_ini.c.

Referenced by compat_load_030200(), load_action_auto_actions(), load_action_auto_uflag_block(), load_action_range_max(), load_ruleset_governments(), load_ruleset_nations(), lookup_req_list(), scan_specfile(), scan_specfile(), secfile_lookup_bitwise_enum_vec_full(), secfile_lookup_bool_vec(), secfile_lookup_enum_vec_data(), secfile_lookup_int_vec(), secfile_lookup_plain_enum_vec_full(), secfile_lookup_str_vec(), sg_load_game(), sg_load_map(), sg_load_player_city(), sg_load_player_unit(), sg_load_player_unit(), theme_read_toplevel(), worklist_load(), and worklist_load().

## ◆ secfile_from_input_file()

static struct section_file * secfile_from_input_file | ( | struct inputfile * | inf,
|  | const char * | filename,
|  | const char * | section,
|  | bool | allow_duplicates
| ) |  |

static

Base function to load a section file. Note it closes the inputfile.

Definition at line 303 of file registry_ini.c.

Referenced by secfile_from_stream(), and secfile_load_section().

## ◆ secfile_from_stream()

struct section_file * secfile_from_stream | ( | fz_FILE * | stream,
|  | bool | allow_duplicates
| ) |  |

Create a section file from a stream. Returns NULL on error.

Definition at line 610 of file registry_ini.c.

Referenced by netfile_get_section_file().

## ◆ secfile_hash_delete()

static bool secfile_hash_delete | ( | struct section_file * | secfile,
|  | struct entry * | pentry
| ) |  |

static

Delete an entry from the hash table. Returns TRUE on success.

Definition at line 285 of file registry_ini.c.

Referenced by entry_destroy(), entry_set_name(), and section_set_name().

## ◆ secfile_hash_insert()

static bool secfile_hash_insert | ( | struct section_file * | secfile,
|  | struct entry * | pentry
| ) |  |

static

Insert an entry into the hash table. Returns TRUE on success.

Definition at line 256 of file registry_ini.c.

Referenced by entry_new(), entry_set_name(), secfile_from_input_file(), and section_set_name().

## ◆ secfile_insert_base()

static struct section * secfile_insert_base | ( | struct section_file * | secfile,
|  | const char * | path,
|  | const char ** | pent_name
| ) |  |

static

Seperates the section and entry names. Create the section if missing.

Definition at line 957 of file registry_ini.c.

Referenced by secfile_insert_bitwise_enum_full(), secfile_insert_bool_full(), secfile_insert_comment(), secfile_insert_enum_data_full(), secfile_insert_filereference(), secfile_insert_float_full(), secfile_insert_int_full(), secfile_insert_plain_enum_full(), and secfile_insert_str_full().

## ◆ secfile_insert_bitwise_enum_full()

struct entry * secfile_insert_bitwise_enum_full | ( | struct section_file * | secfile,
|  | int | bitwise_val,
|  | secfile_enum_name_fn_t | name_fn,
|  | secfile_enum_iter_fn_t | begin_fn,
|  | secfile_enum_iter_fn_t | end_fn,
|  | secfile_enum_next_fn_t | next_fn,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a bitwise value entry.

Definition at line 1531 of file registry_ini.c.

Referenced by secfile_insert_bitwise_enum_vec_full().

## ◆ secfile_insert_bitwise_enum_vec_full()

size_t secfile_insert_bitwise_enum_vec_full | ( | struct section_file * | secfile,
|  | const int * | bitwise_vals,
|  | size_t | dim,
|  | secfile_enum_name_fn_t | name_fn,
|  | secfile_enum_iter_fn_t | begin_fn,
|  | secfile_enum_iter_fn_t | end_fn,
|  | secfile_enum_next_fn_t | next_fn,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert 'dim' string entries at 'path,0', 'path,1' etc. Returns the number of entries inserted or replaced.

Definition at line 1610 of file registry_ini.c.

## ◆ secfile_insert_bool_full()

struct entry * secfile_insert_bool_full | ( | struct section_file * | secfile,
|  | bool | value,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a boolean entry.

Definition at line 988 of file registry_ini.c.

Referenced by secfile_insert_bool_vec_full().

## ◆ secfile_insert_bool_vec_full()

size_t secfile_insert_bool_vec_full | ( | struct section_file * | secfile,
|  | const bool * | values,
|  | size_t | dim,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert 'dim' boolean entries at 'path,0', 'path,1' etc. Returns the number of entries inserted or replaced.

Definition at line 1039 of file registry_ini.c.

## ◆ secfile_insert_comment()

struct entry * secfile_insert_comment | ( | struct section_file * | secfile,
|  | const char * | str,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a comment entry.

Definition at line 1322 of file registry_ini.c.

Referenced by comment_entry_write().

## ◆ secfile_insert_enum_data_full()

struct entry * secfile_insert_enum_data_full | ( | struct section_file * | secfile,
|  | int | value,
|  | bool | bitwise,
|  | secfile_enum_name_data_fn_t | name_fn,
|  | secfile_data_t | data,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert an enumerator value entry that we only have a name accessor function.

Definition at line 1662 of file registry_ini.c.

Referenced by secfile_insert_enum_vec_data_full().

## ◆ secfile_insert_enum_vec_data_full()

size_t secfile_insert_enum_vec_data_full | ( | struct section_file * | secfile,
|  | const int * | values,
|  | size_t | dim,
|  | bool | bitwise,
|  | secfile_enum_name_data_fn_t | name_fn,
|  | secfile_data_t | data,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert 'dim' entries at 'path,0', 'path,1' etc. Returns the number of entries inserted or replaced.

Definition at line 1740 of file registry_ini.c.

## ◆ secfile_insert_filereference()

struct entry * secfile_insert_filereference | ( | struct section_file * | secfile,
|  | const char * | filename,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a read-from-a-file string entry

Definition at line 1396 of file registry_ini.c.

Referenced by save_game_ruleset().

## ◆ secfile_insert_float_full()

struct entry * secfile_insert_float_full | ( | struct section_file * | secfile,
|  | float | value,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a floating entry.

Definition at line 1162 of file registry_ini.c.

## ◆ secfile_insert_include()

struct section * secfile_insert_include | ( | struct section_file * | secfile,
|  | const char * | filename
| ) |  |

Insert a include entry.

Definition at line 1212 of file registry_ini.c.

Referenced by save_nations_ruleset().

## ◆ secfile_insert_int_full()

struct entry * secfile_insert_int_full | ( | struct section_file * | secfile,
|  | int | value,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a integer entry.

Definition at line 1075 of file registry_ini.c.

Referenced by secfile_insert_int_vec_full().

## ◆ secfile_insert_int_vec_full()

size_t secfile_insert_int_vec_full | ( | struct section_file * | secfile,
|  | const int * | values,
|  | size_t | dim,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert 'dim' integer entries at 'path,0', 'path,1' etc. Returns the number of entries inserted or replaced.

Definition at line 1126 of file registry_ini.c.

## ◆ secfile_insert_long_comment()

struct section * secfile_insert_long_comment | ( | struct section_file * | secfile,
|  | const char * | comment
| ) |  |

Insert a long comment section.

Definition at line 1236 of file registry_ini.c.

Referenced by comment_write().

## ◆ secfile_insert_plain_enum_full()

struct entry * secfile_insert_plain_enum_full | ( | struct section_file * | secfile,
|  | int | enumerator,
|  | secfile_enum_name_fn_t | name_fn,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a enumerator entry.

Definition at line 1432 of file registry_ini.c.

Referenced by secfile_insert_plain_enum_vec_full().

## ◆ secfile_insert_plain_enum_vec_full()

size_t secfile_insert_plain_enum_vec_full | ( | struct section_file * | secfile,
|  | const int * | enumurators,
|  | size_t | dim,
|  | secfile_enum_name_fn_t | name_fn,
|  | const char * | comment,
|  | bool | allow_replace,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert 'dim' string entries at 'path,0', 'path,1' etc. Returns the number of entries inserted or replaced.

Definition at line 1489 of file registry_ini.c.

## ◆ secfile_insert_str_full()

struct entry * secfile_insert_str_full | ( | struct section_file * | secfile,
|  | const char * | str,
|  | const char * | comment,
|  | bool | allow_replace,
|  | bool | no_escape,
|  | enum entry_special_type | stype,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert a string entry.

Definition at line 1260 of file registry_ini.c.

Referenced by secfile_insert_include(), secfile_insert_long_comment(), and secfile_insert_str_vec_full().

## ◆ secfile_insert_str_vec_full()

size_t secfile_insert_str_vec_full | ( | struct section_file * | secfile,
|  | const char *const * | strings,
|  | size_t | dim,
|  | const char * | comment,
|  | bool | allow_replace,
|  | bool | no_escape,
|  | const char * | path,
|  |  | ...
| ) |  |

Insert 'dim' string entries at 'path,0', 'path,1' etc. Returns the number of entries inserted or replaced.

Definition at line 1359 of file registry_ini.c.

## ◆ secfile_load_section()

struct section_file * secfile_load_section | ( | const char * | filename,
|  | const char * | section,
|  | bool | allow_duplicates
| ) |  |

Create a section file from a file, read only one particular section. Returns NULL on error.

Definition at line 596 of file registry_ini.c.

Referenced by secfile_load(), show_scenarios(), fc_client::slot_selection_changed(), update_scenario_page(), and fc_client::update_scenarios_page().

## ◆ secfile_lookup_bitwise_enum_default_full()

int secfile_lookup_bitwise_enum_default_full | ( | const struct section_file * | secfile,
|  | int | defval,
|  | secfile_enum_is_valid_fn_t | is_valid_fn,
|  | secfile_enum_by_name_fn_t | by_name_fn,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup an enumerator value in the secfile. Returns 'defval' on error.

Definition at line 2490 of file registry_ini.c.

## ◆ secfile_lookup_bitwise_enum_full()

bool secfile_lookup_bitwise_enum_full | ( | const struct section_file * | secfile,
|  | int * | penumerator,
|  | secfile_enum_is_valid_fn_t | is_valid_fn,
|  | secfile_enum_by_name_fn_t | by_name_fn,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a bitwise enumerator value in the secfile. Returns FALSE on error.

Definition at line 2425 of file registry_ini.c.

Referenced by secfile_lookup_bitwise_enum_vec_full().

## ◆ secfile_lookup_bitwise_enum_vec_full()

int * secfile_lookup_bitwise_enum_vec_full | ( | const struct section_file * | secfile,
|  | size_t * | dim,
|  | secfile_enum_is_valid_fn_t | is_valid_fn,
|  | secfile_enum_by_name_fn_t | by_name_fn,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a enumerator vector in the secfile. Returns NULL on error. This vector is not owned by the registry module, and should be free by the user.

Definition at line 2554 of file registry_ini.c.

## ◆ secfile_lookup_bool()

bool secfile_lookup_bool | ( | const struct section_file * | secfile,
|  | bool * | bval,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a boolean value in the secfile. Returns TRUE on success.

Definition at line 1875 of file registry_ini.c.

Referenced by client_option_load(), compat_load_020600(), compat_load_030000(), compat_load_030200(), options_dialogs_load(), secfile_lookup_bool_vec(), setting_ruleset_one(), settings_game_load(), sg_load_map(), sg_load_player_city(), sg_load_player_main(), sg_load_player_main(), sg_load_player_unit(), sg_load_researches(), sg_load_scenario(), and tileset_read_toplevel().

## ◆ secfile_lookup_bool_default()

bool secfile_lookup_bool_default | ( | const struct section_file * | secfile,
|  | bool | def,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a boolean value in the secfile. On failure, use the default value.

Definition at line 1900 of file registry_ini.c.

Referenced by compat_load_020400(), compat_load_020500(), compat_load_020600(), compat_load_030000(), compat_load_030100(), compat_load_030200(), dai_city_load(), global_worklist_load(), insert_server_side_agent(), load_action_actor_consuming_always(), load_ruleset_actions(), load_ruleset_cities(), load_ruleset_game(), load_ruleset_nations(), load_ruleset_terrain(), lookup_cbonus_list(), modpack_has_ruleset(), setting_ruleset_one(), settings_game_load(), sg_load_game(), sg_load_game(), sg_load_map(), sg_load_map(), sg_load_map_known(), sg_load_map_known(), sg_load_map_startpos(), sg_load_map_startpos(), sg_load_player_city(), sg_load_player_city(), sg_load_player_main(), sg_load_player_main(), sg_load_player_unit(), sg_load_player_unit(), sg_load_player_vision(), sg_load_player_vision(), sg_load_player_vision_city(), sg_load_player_vision_city(), sg_load_players(), sg_load_players(), sg_load_players_basic(), sg_load_players_basic(), sg_load_random(), sg_load_random(), sg_load_savefile(), sg_load_savefile(), sg_load_scenario(), sg_load_scenario(), sg_load_treaties(), sg_load_treaties(), show_scenarios(), fc_client::slot_selection_changed(), tileset_read_toplevel(), update_scenario_page(), and fc_client::update_scenarios_page().

## ◆ secfile_lookup_bool_vec()

bool * secfile_lookup_bool_vec | ( | const struct section_file * | secfile,
|  | size_t * | dim,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a boolean vector in the secfile. Returns NULL on error. This vector is not owned by the registry module, and should be free by the user.

Definition at line 1930 of file registry_ini.c.

## ◆ secfile_lookup_enum_data()

bool secfile_lookup_enum_data | ( | const struct section_file * | secfile,
|  | int * | pvalue,
|  | bool | bitwise,
|  | secfile_enum_name_data_fn_t | name_fn,
|  | secfile_data_t | data,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a value saved as string in the secfile. Returns FALSE on error.

Definition at line 2609 of file registry_ini.c.

Referenced by client_option_load(), compat_load_020500(), compat_load_030200(), secfile_lookup_enum_vec_data(), setting_ruleset_one(), and settings_game_load().

## ◆ secfile_lookup_enum_default_data()

int secfile_lookup_enum_default_data | ( | const struct section_file * | secfile,
|  | int | defval,
|  | bool | bitwise,
|  | secfile_enum_name_data_fn_t | name_fn,
|  | secfile_data_t | data,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a value saved as string in the secfile. Returns 'defval' on error.

Definition at line 2691 of file registry_ini.c.

Referenced by settings_game_load().

## ◆ secfile_lookup_enum_vec_data()

int * secfile_lookup_enum_vec_data | ( | const struct section_file * | secfile,
|  | size_t * | dim,
|  | bool | bitwise,
|  | secfile_enum_name_data_fn_t | name_fn,
|  | secfile_data_t | data,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a vector in the secfile. Returns NULL on error. This vector is not owned by the registry module, and should be free by the user.

Definition at line 2774 of file registry_ini.c.

## ◆ secfile_lookup_float()

bool secfile_lookup_float | ( | const struct section_file * | secfile,
|  | float * | fval,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a floating point value in the secfile. Returns TRUE on success.

Definition at line 2122 of file registry_ini.c.

## ◆ secfile_lookup_float_default()

float secfile_lookup_float_default | ( | const struct section_file * | secfile,
|  | float | def,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a floating point value in the secfile. On failure, use the default value.

Definition at line 2147 of file registry_ini.c.

## ◆ secfile_lookup_int()

bool secfile_lookup_int | ( | const struct section_file * | secfile,
|  | int * | ival,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a integer value in the secfile. Returns TRUE on success.

Definition at line 1975 of file registry_ini.c.

Referenced by client_option_load(), compat_load_020400(), compat_load_020500(), compat_load_020600(), compat_load_030100(), compat_load_030200(), load_ruleset_buildings(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_nations(), load_ruleset_terrain(), load_ruleset_units(), lookup_cbonus_list(), lookup_time(), message_options_load(), rgbcolor_load(), rscompat_check_capabilities(), scan_specfile(), scan_specfile(), secfile_lookup_int_default_min_max(), secfile_lookup_int_vec(), setting_ruleset_one(), settings_game_load(), sg_load_game(), sg_load_game(), sg_load_map_startpos(), sg_load_map_startpos(), sg_load_player_attributes(), sg_load_player_attributes(), sg_load_player_cities(), sg_load_player_cities(), sg_load_player_city(), sg_load_player_city(), sg_load_player_main(), sg_load_player_main(), sg_load_player_unit(), sg_load_player_unit(), sg_load_player_units(), sg_load_player_units(), sg_load_player_units_transport(), sg_load_player_units_transport(), sg_load_player_vision_city(), sg_load_player_vision_city(), sg_load_players_basic(), sg_load_players_basic(), sg_load_random(), sg_load_random(), sg_load_researches(), sg_load_researches(), and tileset_read_toplevel().

## ◆ secfile_lookup_int_def_min_max()

int secfile_lookup_int_def_min_max | ( | const struct section_file * | secfile,
|  | int | defval,
|  | int | minval,
|  | int | maxval,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a integer value in the secfile. The value will be arranged to match the interval [minval, maxval]. On failure, use the default value.

Definition at line 2030 of file registry_ini.c.

Referenced by load_ruleset_game().

## ◆ secfile_lookup_int_default()

int secfile_lookup_int_default | ( | const struct section_file * | secfile,
|  | int | def,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a integer value in the secfile. On failure, use the default value.

Definition at line 2000 of file registry_ini.c.

Referenced by compat_load_020400(), compat_load_020600(), compat_load_030000(), compat_load_030100(), compat_load_030200(), compat_load_030300(), dai_city_load(), dai_player_load_relations(), dai_unit_load(), event_cache_load(), global_worklist_load(), increase_secfile_turn_int(), insert_server_side_agent(), load_action_range(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_techs(), load_ruleset_terrain(), load_ruleset_units(), message_options_load(), ruleset_load_traits(), scan_specfile(), scan_specfile(), settings_game_load(), sg_load_compat(), sg_load_counters(), sg_load_game(), sg_load_game(), sg_load_history(), sg_load_history(), sg_load_map_startpos(), sg_load_map_startpos(), sg_load_mapimg(), sg_load_mapimg(), sg_load_player_attributes(), sg_load_player_attributes(), sg_load_player_cities(), sg_load_player_cities(), sg_load_player_city(), sg_load_player_city(), sg_load_player_city_citizens(), sg_load_player_city_citizens(), sg_load_player_main(), sg_load_player_main(), sg_load_player_unit(), sg_load_player_unit(), sg_load_player_units(), sg_load_player_units_transport(), sg_load_player_units_transport(), sg_load_player_vision(), sg_load_player_vision(), sg_load_player_vision_city(), sg_load_player_vision_city(), sg_load_players_basic(), sg_load_players_basic(), sg_load_researches(), sg_load_researches(), sg_load_ruledata(), sg_load_ruledata(), sg_load_ruleset(), sg_load_savefile(), sg_load_savefile(), sg_load_scenario(), sg_load_treaties(), sg_load_treaties(), fc_client::slot_selection_changed(), theme_color_system_read(), theme_read_toplevel(), tileset_read_toplevel(), update_scenario_page(), fc_client::update_scenarios_page(), worklist_load(), and worklist_load().

## ◆ secfile_lookup_int_vec()

int * secfile_lookup_int_vec | ( | const struct section_file * | secfile,
|  | size_t * | dim,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a integer vector in the secfile. Returns NULL on error. This vector is not owned by the registry module, and should be free by the user.

Definition at line 2077 of file registry_ini.c.

Referenced by load_ruleset_game(), load_ruleset_terrain(), load_ruleset_veteran(), sg_load_counters(), and sg_load_researches().

## ◆ secfile_lookup_plain_enum_default_full()

int secfile_lookup_plain_enum_default_full | ( | const struct section_file * | secfile,
|  | int | defval,
|  | secfile_enum_is_valid_fn_t | is_valid_fn,
|  | secfile_enum_by_name_fn_t | by_name_fn,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup an enumerator value in the secfile. Returns 'defval' on error.

Definition at line 2328 of file registry_ini.c.

## ◆ secfile_lookup_plain_enum_full()

bool secfile_lookup_plain_enum_full | ( | const struct section_file * | secfile,
|  | int * | penumerator,
|  | secfile_enum_is_valid_fn_t | is_valid_fn,
|  | secfile_enum_by_name_fn_t | by_name_fn,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup an enumerator value in the secfile. Returns FALSE on error.

Definition at line 2285 of file registry_ini.c.

Referenced by secfile_lookup_plain_enum_vec_full().

## ◆ secfile_lookup_plain_enum_vec_full()

int * secfile_lookup_plain_enum_vec_full | ( | const struct section_file * | secfile,
|  | size_t * | dim,
|  | secfile_enum_is_valid_fn_t | is_valid_fn,
|  | secfile_enum_by_name_fn_t | by_name_fn,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a enumerator vector in the secfile. Returns NULL on error. This vector is not owned by the registry module, and should be free by the user.

Definition at line 2371 of file registry_ini.c.

## ◆ secfile_lookup_str()

const char * secfile_lookup_str | ( | const struct section_file * | secfile,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a string value in the secfile. Returns NULL on error.

Definition at line 2175 of file registry_ini.c.

Referenced by audio_play_tag(), boot_help_texts(), check_audiofile_capstr(), check_themespec_capabilities(), check_tilespec_capabilities(), client_option_load(), compat_load_020400(), compat_load_020500(), compat_load_020600(), compat_load_030000(), compat_load_030100(), compat_load_030200(), download_modpack_list(), download_modpack_recursive(), ensure_big_sprite(), event_cache_load(), handle_single_want_hack_req(), load_install_info_list(), load_nation_names(), load_ruleset_actions(), load_ruleset_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_nations(), load_ruleset_styles(), load_ruleset_terrain(), load_ruleset_units(), load_terrain_names(), lookup_cbonus_list(), lookup_req_list(), lookup_string(), lookup_terrain(), message_options_load(), modpack_check_capabilities(), musicspec_load(), rscompat_check_capabilities(), ruleset_load_names(), savegame_load(), scan_specfile(), scan_specfile(), secfile_lookup_str_vec(), setting_ruleset_one(), settings_game_load(), sg_load_history(), sg_load_history(), sg_load_map_altitude(), sg_load_map_owner(), sg_load_map_owner(), sg_load_map_startpos(), sg_load_map_startpos(), sg_load_map_tiles(), sg_load_map_tiles(), sg_load_map_worked(), sg_load_map_worked(), sg_load_mapimg(), sg_load_mapimg(), sg_load_player_attributes(), sg_load_player_attributes(), sg_load_player_cities(), sg_load_player_cities(), sg_load_player_city(), sg_load_player_city(), sg_load_player_main(), sg_load_player_main(), sg_load_player_unit(), sg_load_player_units(), sg_load_player_units(), sg_load_player_vision(), sg_load_player_vision(), sg_load_player_vision_city(), sg_load_player_vision_city(), sg_load_players_basic(), sg_load_players_basic(), sg_load_random(), sg_load_random(), sg_load_researches(), sg_load_researches(), sg_load_savefile(), sg_load_savefile(), sg_load_treaties(), sg_load_treaties(), technology_load(), technology_load(), theme_background_system_read(), theme_ensure_big_sprite(), theme_read_toplevel(), tileset_read_toplevel(), worklist_load(), and worklist_load().

## ◆ secfile_lookup_str_default()

const char * secfile_lookup_str_default | ( | const struct section_file * | secfile,
|  | const char * | def,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a string value in the secfile. If there's no such key, return def. Currently returns def also on failure.

Definition at line 2205 of file registry_ini.c.

Referenced by api_luadata_get_str(), compat_load_020400(), compat_load_020600(), compat_load_030000(), compat_load_030100(), compat_load_030200(), download_modpack_list(), download_modpack_recursive(), global_worklist_load(), load_action_ui_name(), load_building_names(), load_install_info_list(), load_nation_names(), load_ruleset_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_nations(), load_ruleset_styles(), load_ruleset_techs(), load_ruleset_terrain(), load_ruleset_units(), load_tech_names(), load_terrain_names(), load_unit_names(), lookup_cbonus_list(), lookup_government(), lookup_req_list(), lookup_tech(), lookup_unit_type(), luascript_vars_load(), modpack_has_ruleset(), modpack_rulesetdir(), modpack_serv_file(), musicspec_load(), script_client_code_load(), script_server_code_load(), settings_game_load(), settings_ruleset(), sg_load_game(), sg_load_game(), sg_load_map_owner(), sg_load_map_tiles(), sg_load_map_tiles(), sg_load_player_city(), sg_load_player_city(), sg_load_player_main(), sg_load_player_main(), sg_load_player_unit(), sg_load_player_unit(), sg_load_player_vision_city(), sg_load_player_vision_city(), sg_load_ruledata(), sg_load_ruledata(), sg_load_ruleset(), sg_load_savefile(), sg_load_savefile(), sg_load_scenario(), sg_load_scenario(), sg_load_treaties(), sg_load_treaties(), fc_client::slot_selection_changed(), theme_read_toplevel(), tileset_read_toplevel(), update_scenario_page(), fc_client::update_scenarios_page(), worklist_load(), and worklist_load().

## ◆ secfile_lookup_str_vec()

const char ** secfile_lookup_str_vec | ( | const struct section_file * | secfile,
|  | size_t * | dim,
|  | const char * | path,
|  |  | ...
| ) |  |

Lookup a string vector in the secfile. Returns NULL on error. This vector is not owned by the registry module, and should be free by the user, but the string pointers stored inside the vector shouldn't be free.

Definition at line 2239 of file registry_ini.c.

Referenced by boot_help_texts(), compat_load_030100(), compat_load_030200(), compat_load_030300(), load_city_name_list(), load_ruleset_buildings(), load_ruleset_game(), load_ruleset_nations(), load_ruleset_techs(), load_ruleset_terrain(), load_ruleset_units(), load_ruleset_veteran(), lookup_building_list(), lookup_strvec(), lookup_tech_list(), lookup_unit_list(), scan_specfile(), scan_specfile(), sg_load_counters(), sg_load_player_main(), sg_load_player_main(), sg_load_savefile(), sg_load_savefile(), theme_read_toplevel(), and tileset_read_toplevel().

## ◆ secfile_name()

const char * secfile_name | ( | const struct section_file * | secfile | ) |

Return the filename the section file was loaded as, or "(anonymous)" if this sectionfile was created rather than loaded from file. The memory is managed internally, and should not be altered, nor used after secfile_destroy() called for the section file.

Definition at line 943 of file registry_ini.c.

Referenced by load_action_names(), load_building_names(), load_city_name_list(), load_game_names(), load_government_names(), load_nation_names(), load_ruleset_actions(), load_ruleset_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_nations(), load_ruleset_techs(), load_ruleset_terrain(), load_ruleset_units(), load_ruleset_veteran(), load_style_names(), load_tech_names(), load_terrain_names(), load_unit_names(), lookup_cbonus_list(), lookup_req_list(), lookup_terrain(), message_options_load(), ruleset_load_names(), secfile_log(), and settings_ruleset().

## ◆ secfile_save()

bool secfile_save | ( | const struct section_file * | secfile,
|  | const char * | filename,
|  | int | compression_level,
|  | enum fz_method | compression_method
| ) |  |

Save the previously filled in section_file to disk.

There is now limited ability to save in the new tabular format (to give smaller savefiles). The start of a table is detected by an entry with name of the form: (alphabetical_component)(zero)(period)(alphanumeric_component) Eg: u0.id, or c0.id, in the freeciv savefile. The alphabetical component is taken as the "name" of the table, and the component after the period as the first column name. This should be followed by the other column values for u0, and then subsequent u1, u2, etc, in strict order with no omissions, and with all of the columns for all uN in the same order as for u0.

If compression_level is non-zero, then compress using zlib. (Should only supply non-zero compression_level if already know that FREECIV_HAVE_LIBZ.) Below simply specifies FZ_ZLIB method, since fz_fromFile() automatically changes to FZ_PLAIN method when level == 0.

Definition at line 644 of file registry_ini.c.

Referenced by save_luadata(), save_ruleset_file(), save_thread_run(), and send_client_wants_hack().

## ◆ secfile_section_by_name()

struct section * secfile_section_by_name | ( | const struct section_file * | secfile,
|  | const char * | name
| ) |  |

Returns the first section matching the name.

Definition at line 2823 of file registry_ini.c.

Referenced by compat_load_020400(), options_dialogs_load(), secfile_entry_by_path(), secfile_from_input_file(), secfile_insert_base(), secfile_insert_include(), secfile_insert_long_comment(), secfile_section_lookup(), secfile_section_new(), section_set_name(), settable_options_load(), and settings_ruleset().

## ◆ secfile_section_lookup()

struct section * secfile_section_lookup | ( | const struct section_file * | secfile,
|  | const char * | path,
|  |  | ...
| ) |  |

Find a section by path.

Definition at line 2840 of file registry_ini.c.

Referenced by compat_load_020400(), compat_load_020600(), compat_load_030000(), compat_load_030100(), compat_load_030200(), compat_load_030300(), insert_server_side_agent(), sg_load_players_basic(), sg_load_players_basic(), and sg_load_scenario().

## ◆ secfile_section_new()

struct section * secfile_section_new | ( | struct section_file * | secfile,
|  | const char * | name
| ) |  |

Create a new section in the secfile.

Definition at line 2925 of file registry_ini.c.

Referenced by secfile_from_input_file(), secfile_insert_base(), secfile_insert_include(), and secfile_insert_long_comment().

## ◆ secfile_section_prefix_present()

bool secfile_section_prefix_present | ( | const struct section_file * | secfile,
|  | const char * | prefix
| ) |  |

Checks if there's any sections with the given prefix in the secfile.

Definition at line 2900 of file registry_ini.c.

## ◆ secfile_sections()

const struct section_list * secfile_sections | ( | const struct section_file * | secfile | ) |

Returns the list of sections. This list is owned by the registry module and shouldn't be modified and destroyed.

Definition at line 2860 of file registry_ini.c.

Referenced by secfile_check_unused().

## ◆ secfile_sections_by_name_prefix()

struct section_list * secfile_sections_by_name_prefix | ( | const struct section_file * | secfile,
|  | const char * | prefix
| ) |  |

Returns the list of sections which match the name prefix. Returns NULL if no section was found. This list is not owned by the registry module and the user must destroy it when they finished working with it.

Definition at line 2871 of file registry_ini.c.

Referenced by boot_help_texts(), download_modpack_recursive(), load_building_names(), load_game_names(), load_government_names(), load_nation_names(), load_ruleset_actions(), load_ruleset_buildings(), load_ruleset_cities(), load_ruleset_effects(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_nations(), load_ruleset_styles(), load_ruleset_techs(), load_ruleset_units(), load_style_names(), load_tech_names(), load_terrain_names(), load_unit_names(), scan_specfile(), scan_specfile(), and tileset_read_toplevel().

## ◆ section_clear_all()

void section_clear_all | ( | struct section * | psection | ) |

Remove all entries.

Definition at line 2996 of file registry_ini.c.

Referenced by section_destroy().

## ◆ section_destroy()

void section_destroy | ( | struct section * | psection | ) |

Remove this section from the secfile.

Definition at line 2969 of file registry_ini.c.

Referenced by secfile_new().

## ◆ section_entries()

const struct entry_list * section_entries | ( | const struct section * | psection | ) |

Returns a list containing all the entries. This list is owned by the secfile, so don't modify or destroy it.

Definition at line 3073 of file registry_ini.c.

Referenced by compat_load_020400(), options_dialogs_load(), secfile_check_unused(), secfile_from_input_file(), secfile_save(), and settable_options_load().

## ◆ section_entry_bool_new()

struct entry * section_entry_bool_new | ( | struct section * | psection,
|  | const char * | name,
|  | bool | value
| ) |  |

Returns a new entry of type ENTRY_BOOL.

Definition at line 3195 of file registry_ini.c.

Referenced by entry_from_token(), and secfile_insert_bool_full().

## ◆ section_entry_by_name()

struct entry * section_entry_by_name | ( | const struct section * | psection,
|  | const char * | name
| ) |  |

Returns the first entry matching the name.

Definition at line 3081 of file registry_ini.c.

Referenced by entry_new(), entry_set_name(), secfile_entry_by_path(), secfile_insert_bitwise_enum_full(), secfile_insert_bool_full(), secfile_insert_enum_data_full(), secfile_insert_float_full(), secfile_insert_int_full(), secfile_insert_plain_enum_full(), secfile_insert_str_full(), and section_entry_lookup().

## ◆ section_entry_comment_new()

static struct entry * section_entry_comment_new | ( | struct section * | psection,
|  | const char * | comment
| ) |  |

static

Returns a new entry of type ENTRY_LONG_COMMENT.

Definition at line 3264 of file registry_ini.c.

Referenced by secfile_insert_comment().

## ◆ section_entry_filereference_new()

static struct entry * section_entry_filereference_new | ( | struct section * | psection,
|  | const char * | name,
|  | const char * | value
| ) |  |

static

Returns a new entry of type ENTRY_FILEREFERENCE.

Definition at line 3247 of file registry_ini.c.

Referenced by secfile_insert_filereference().

## ◆ section_entry_float_new()

struct entry * section_entry_float_new | ( | struct section * | psection,
|  | const char * | name,
|  | float | value
| ) |  |

Returns a new entry of type ENTRY_FLOAT.

Definition at line 3211 of file registry_ini.c.

Referenced by entry_from_token(), and secfile_insert_float_full().

## ◆ section_entry_int_new()

struct entry * section_entry_int_new | ( | struct section * | psection,
|  | const char * | name,
|  | int | value
| ) |  |

Returns a new entry of type ENTRY_INT.

Definition at line 3179 of file registry_ini.c.

Referenced by entry_from_token(), and secfile_insert_int_full().

## ◆ section_entry_lookup()

struct entry * section_entry_lookup | ( | const struct section * | psection,
|  | const char * | path,
|  |  | ...
| ) |  |

Returns the entry matching the path.

Definition at line 3099 of file registry_ini.c.

## ◆ section_entry_str_new()

struct entry * section_entry_str_new | ( | struct section * | psection,
|  | const char * | name,
|  | const char * | value,
|  | bool | escaped
| ) |  |

Returns a new entry of type ENTRY_STR.

Definition at line 3227 of file registry_ini.c.

Referenced by entry_from_token(), secfile_insert_bitwise_enum_full(), secfile_insert_enum_data_full(), secfile_insert_plain_enum_full(), and secfile_insert_str_full().

## ◆ section_set_name()

bool section_set_name | ( | struct section * | psection,
|  | const char * | name
| ) |  |

Change the section name. Returns TRUE on success.

Definition at line 3013 of file registry_ini.c.