Freeciv21
Develop your civilization from humble roots to a global empire
registry_ini.h File Reference
#include "support.h"
#include <QString>
#include <QVector>
#include <stddef.h>
#include "speclist.h"
+ Include dependency graph for registry_ini.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPECLIST_TAG   section
 
#define section_list_iterate(seclist, psection)    TYPED_LIST_ITERATE(struct section, seclist, psection)
 
#define section_list_iterate_end   LIST_ITERATE_END
 
#define section_list_iterate_rev(seclist, psection)    TYPED_LIST_ITERATE_REV(struct section, seclist, psection)
 
#define section_list_iterate_rev_end   LIST_ITERATE_REV_END
 
#define SPECLIST_TAG   entry
 
#define entry_list_iterate(entlist, pentry)    TYPED_LIST_ITERATE(struct entry, entlist, pentry)
 
#define entry_list_iterate_end   LIST_ITERATE_END
 
#define secfile_insert_bool(secfile, value, path, ...)
 
#define secfile_insert_bool_comment(secfile, value, comment, path, ...)
 
#define secfile_replace_bool(secfile, value, path, ...)
 
#define secfile_replace_bool_comment(secfile, value, comment, path, ...)
 
#define secfile_insert_bool_vec(secfile, values, dim, path, ...)
 
#define secfile_insert_bool_vec_comment(secfile, values, dim, comment, path, ...)
 
#define secfile_replace_bool_vec(secfile, values, dim, path, ...)
 
#define secfile_replace_bool_vec_comment(secfile, values, dim, comment, path, ...)
 
#define secfile_insert_int(secfile, value, path, ...)
 
#define secfile_insert_int_comment(secfile, value, comment, path, ...)
 
#define secfile_replace_int(secfile, value, path, ...)    secfile_insert_int_full(secfile, value, nullptr, true, path, ##__VA_ARGS__)
 
#define secfile_replace_int_comment(secfile, value, comment, path, ...)    secfile_insert_int_full(secfile, value, comment, true, path, ##__VA_ARGS__)
 
#define secfile_insert_int_vec(secfile, values, dim, path, ...)
 
#define secfile_insert_int_vec_comment(secfile, values, dim, comment, path, ...)
 
#define secfile_replace_int_vec(secfile, values, dim, path, ...)
 
#define secfile_replace_int_vec_comment(secfile, values, dim, comment, path, ...)
 
#define secfile_insert_float(secfile, value, path, ...)
 
#define secfile_insert_str(secfile, string, path, ...)
 
#define secfile_insert_str_noescape(secfile, string, path, ...)
 
#define secfile_insert_str_comment(secfile, string, comment, path, ...)
 
#define secfile_insert_str_noescape_comment(secfile, string, comment, path, ...)
 
#define secfile_replace_str(secfile, string, path, ...)
 
#define secfile_replace_str_noescape(secfile, string, path, ...)
 
#define secfile_replace_str_comment(secfile, string, comment, path, ...)
 
#define secfile_replace_str_noescape_comment(secfile, string, comment, path, ...)
 
#define secfile_insert_str_vec(secfile, strings, dim, path, ...)
 
#define secfile_insert_str_vec_noescape(secfile, strings, dim, path, ...)
 
#define secfile_insert_str_vec_comment(secfile, strings, dim, comment, path, ...)
 
#define secfile_insert_str_vec_noescape_comment(secfile, strings, dim, comment, path, ...)
 
#define secfile_replace_str_vec(secfile, strings, dim, path, ...)
 
#define secfile_replace_str_vec_noescape(secfile, strings, dim, path, ...)
 
#define secfile_replace_str_vec_comment(secfile, strings, dim, comment, path, ...)
 
#define secfile_replace_str_vec_noescape_comment(secfile, strings, dim, comment, path, ...)
 
#define secfile_insert_enum_full(secfile, enumerator, specenum_type, comment, allow_replace, path, ...)
 
#define secfile_insert_enum(secfile, enumerator, specenum_type, path, ...)
 
#define secfile_insert_enum_comment(secfile, enumerator, specenum_type, comment, path, ...)
 
#define secfile_replace_enum(secfile, enumerator, specenum_type, path, ...)
 
#define secfile_replace_enum_comment(secfile, enumerator, specenum_type, comment, path, ...)
 
#define secfile_insert_enum_vec_full(secfile, enumerators, dim, specenum_type, comment, allow_replace, path, ...)
 
#define secfile_insert_enum_vec(secfile, enumerators, dim, specenum_type, path, ...)
 
#define secfile_insert_enum_vec_comment(secfile, enumerators, dim, specenum_type, comment, path, ...)
 
#define secfile_replace_enum_vec(secfile, enumerators, dim, specenum_type, path, ...)
 
#define secfile_replace_enum_vec_comment(secfile, enumerators, dim, specenum_type, comment, path, ...)
 
#define secfile_insert_enum_data(secfile, value, bitwise, name_fn, data, path, ...)
 
#define secfile_insert_enum_data_comment(secfile, value, bitwise, name_fn, data, path, ...)
 
#define secfile_replace_enum_data(secfile, value, bitwise, name_fn, data, path, ...)
 
#define secfile_replace_enum_data_comment(secfile, value, bitwise, name_fn, data, path, ...)
 
#define secfile_insert_enum_vec_data(secfile, values, dim, bitwise, name_fn, data, path, ...)
 
#define secfile_insert_enum_vec_data_comment(secfile, values, dim, bitwise, name_fn, data, path, ...)
 
#define secfile_replace_enum_vec_data(secfile, values, dim, bitwise, name_fn, data, path, ...)
 
#define secfile_replace_enum_vec_data_comment( secfile, values, dim, bitwise, name_fn, data, path, ...)
 
#define secfile_lookup_enum(secfile, enumerator, specenum_type, path, ...)
 
#define secfile_lookup_enum_default(secfile, defval, specenum_type, path, ...)
 
#define secfile_lookup_enum_vec(secfile, dim, specenum_type, path, ...)
 

Typedefs

typedef const void * secfile_data_t
 
typedef bool(* secfile_enum_is_valid_fn_t) (int enumerator)
 
typedef const char *(* secfile_enum_name_fn_t) (int enumerator)
 
typedef int(* secfile_enum_by_name_fn_t) (const char *enum_name, int(*strcmp_fn) (const char *, const char *))
 
typedef int(* secfile_enum_iter_fn_t) ()
 
typedef int(* secfile_enum_next_fn_t) (int enumerator)
 
typedef const char *(* secfile_enum_name_data_fn_t) (secfile_data_t data, int enumerator)
 

Enumerations

enum  entry_special_type { EST_NORMAL , EST_INCLUDE , EST_COMMENT }
 
enum  entry_type {
  ENTRY_BOOL , ENTRY_INT , ENTRY_FLOAT , ENTRY_STR ,
  ENTRY_FILEREFERENCE , ENTRY_ILLEGAL
}
 

Functions

struct section_filesecfile_load_section (const QString &filename, const QString &section, bool allow_duplicates)
 Create a section file from a file, read only one particular section. More...
 
struct section_filesecfile_from_stream (QIODevice *stream, bool allow_duplicates)
 Create a section file from a stream. More...
 
bool secfile_save (const struct section_file *secfile, QString filename)
 Save the previously filled in section_file to disk. More...
 
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. More...
 
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. More...
 
struct entrysecfile_insert_bool_full (struct section_file *secfile, bool value, const char *comment, bool allow_replace, const char *path,...) fc__attribute((__format__(__printf__
 
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,...) fc__attribute((__format__(__printf__
 
struct entrysecfile_insert_int_full (struct section_file *secfile, int value, const char *comment, bool allow_replace, const char *path,...) fc__attribute((__format__(__printf__
 
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,...) fc__attribute((__format__(__printf__
 
struct entrysecfile_insert_float_full (struct section_file *secfile, float value, const char *comment, bool allow_replace, const char *path,...) fc__attribute((__format__(__printf__
 
struct sectionsecfile_insert_include (struct section_file *secfile, const char *filename)
 Insert a include entry. More...
 
struct sectionsecfile_insert_long_comment (struct section_file *secfile, const char *comment)
 Insert a long comment entry. More...
 
struct entrysecfile_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,...) fc__attribute((__format__(__printf__
 
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,...) fc__attribute((__format__(__printf__
 
size_t size_t secfile_insert_str_vec_full (struct section_file *secfile, const QVector< QString > &strings, size_t dim, const char *comment, bool allow_replace, bool no_escape, const char *path,...) fc__attribute((__format__(__printf__
 
struct entrysecfile_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,...) fc__attribute((__format__(__printf__
 
struct entry struct entrysecfile_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,...) fc__attribute((__format__(__printf__
 
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,...) fc__attribute((__format__(__printf__
 
size_t 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,...) fc__attribute((__format__(__printf__
 
struct entrysecfile_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,...) fc__attribute((__format__(__printf__
 
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,...) fc__attribute((__format__(__printf__
 
struct entrysecfile_insert_filereference (struct section_file *secfile, const char *filename, const char *path,...) fc__attribute((__format__(__printf__
 
struct entry bool secfile_entry_delete (struct section_file *secfile, const char *path,...) fc__attribute((__format__(__printf__
 
struct entry bool struct entrysecfile_entry_by_path (const struct section_file *secfile, const char *path)
 Returns the entry by the name or nullptr if not matched. More...
 
struct entrysecfile_entry_lookup (const struct section_file *secfile, const char *path,...) fc__attribute((__format__(__printf__
 
struct entry bool secfile_lookup_bool (const struct section_file *secfile, bool *bval, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool secfile_lookup_bool_default (const struct section_file *secfile, bool def, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool secfile_lookup_int (const struct section_file *secfile, int *ival, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int secfile_lookup_int_default (const struct section_file *secfile, int def, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int secfile_lookup_int_def_min_max (const struct section_file *secfile, int defval, int minval, int maxval, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int int * secfile_lookup_int_vec (const struct section_file *secfile, size_t *dim, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int int const char * secfile_lookup_str (const struct section_file *secfile, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int int const char const char * secfile_lookup_str_default (const struct section_file *secfile, const char *def, const char *path,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int int const char const char const char ** secfile_lookup_str_vec (const struct section_file *secfile, size_t *dim, const char *path,...) fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int int const char const char const char 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
struct entry bool bool bool int int int const char const char const char bool 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
int 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
int 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
bool 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
 
bool int struct sectionsecfile_section_by_name (const struct section_file *secfile, const QString &section_name)
 Returns the first section matching the name. More...
 
struct sectionsecfile_section_lookup (const struct section_file *secfile, const char *path,...) fc__attribute((__format__(__printf__
 
struct section const struct section_list * secfile_sections (const struct section_file *secfile)
 Returns the list of sections. More...
 
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. More...
 
struct sectionsecfile_section_new (struct section_file *secfile, const QString &section_name)
 Create a new section in the secfile. More...
 
void section_destroy (struct section *psection)
 Remove this section from the secfile. More...
 
void section_clear_all (struct section *psection)
 Remove all entries. More...
 
const struct entry_list * section_entries (const struct section *psection)
 Returns a list containing all the entries. More...
 
struct entrysection_entry_by_name (const struct section *psection, const QString &entry_name)
 Returns the first entry matching the name. More...
 
struct entrysection_entry_int_new (struct section *psection, const QString &entry_name, int value)
 Returns a new entry of type ENTRY_INT. More...
 
struct entrysection_entry_bool_new (struct section *psection, const QString &entry_name, bool value)
 Returns a new entry of type ENTRY_BOOL. More...
 
struct entrysection_entry_float_new (struct section *psection, const QString &entry_name, float value)
 Returns a new entry of type ENTRY_FLOAT. More...
 
struct entrysection_entry_str_new (struct section *psection, const QString &entry_name, const QString &value, bool escaped)
 Returns a new entry of type ENTRY_STR. More...
 
void entry_destroy (struct entry *pentry)
 Entry structure destructor. More...
 
struct sectionentry_section (const struct entry *pentry)
 Returns the parent section of this entry. More...
 
enum entry_type entry_type_get (const struct entry *pentry)
 Returns the type of this entry or ENTRY_ILLEGAL or error. More...
 
int entry_path (const struct entry *pentry, char *buf, size_t buf_len)
 Build the entry path. More...
 
const char * entry_name (const struct entry *pentry)
 Returns the name of this entry. More...
 
bool entry_set_name (struct entry *pentry, const char *entry_name)
 Sets the name of the entry. More...
 
const char * entry_comment (const struct entry *pentry)
 Returns the comment associated to this entry. More...
 
void entry_set_comment (struct entry *pentry, const QString &comment)
 Sets a comment for the entry. More...
 
bool entry_int_get (const struct entry *pentry, int *value)
 Gets an integer value. More...
 
bool entry_int_set (struct entry *pentry, int value)
 Sets an integer value. More...
 
bool entry_bool_get (const struct entry *pentry, bool *value)
 Gets an boolean value. More...
 
bool entry_bool_set (struct entry *pentry, bool value)
 Sets an boolean value. More...
 
bool entry_float_get (const struct entry *pentry, float *value)
 Gets an floating value. More...
 
bool entry_float_set (struct entry *pentry, float value)
 Sets an floating value. More...
 
bool entry_str_get (const struct entry *pentry, const char **value)
 Gets an string value. More...
 
bool entry_str_set (struct entry *pentry, const char *value)
 Sets an string value. More...
 
bool entry_str_set_gt_marking (struct entry *pentry, bool gt_marking)
 Sets if the string should get gettext marking. More...
 

Macro Definition Documentation

◆ entry_list_iterate

#define entry_list_iterate (   entlist,
  pentry 
)     TYPED_LIST_ITERATE(struct entry, entlist, pentry)

Definition at line 56 of file registry_ini.h.

◆ entry_list_iterate_end

#define entry_list_iterate_end   LIST_ITERATE_END

Definition at line 58 of file registry_ini.h.

◆ secfile_insert_bool

#define secfile_insert_bool (   secfile,
  value,
  path,
  ... 
)
Value:
secfile_insert_bool_full(secfile, value, nullptr, false, path, \
##__VA_ARGS__)
struct entry * secfile_insert_bool_full(struct section_file *secfile, bool value, const char *comment, bool allow_replace, const char *path,...) fc__attribute((__format__(__printf__

Definition at line 79 of file registry_ini.h.

◆ secfile_insert_bool_comment

#define secfile_insert_bool_comment (   secfile,
  value,
  comment,
  path,
  ... 
)
Value:
secfile_insert_bool_full(secfile, value, comment, false, path, \
##__VA_ARGS__)

Definition at line 82 of file registry_ini.h.

◆ secfile_insert_bool_vec

#define secfile_insert_bool_vec (   secfile,
  values,
  dim,
  path,
  ... 
)
Value:
secfile_insert_bool_vec_full(secfile, values, dim, nullptr, false, path, \
##__VA_ARGS__)
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,...) fc__attribute((__format__(__printf__

Definition at line 96 of file registry_ini.h.

◆ secfile_insert_bool_vec_comment

#define secfile_insert_bool_vec_comment (   secfile,
  values,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_bool_vec_full(secfile, values, dim, comment, false, path, \
##__VA_ARGS__)

Definition at line 99 of file registry_ini.h.

◆ secfile_insert_enum

#define secfile_insert_enum (   secfile,
  enumerator,
  specenum_type,
  path,
  ... 
)
Value:
secfile_insert_enum_full(secfile, enumerator, specenum_type, nullptr, \
false, path, ##__VA_ARGS__)
#define secfile_insert_enum_full(secfile, enumerator, specenum_type, comment, allow_replace, path,...)
Definition: registry_ini.h:243

Definition at line 257 of file registry_ini.h.

◆ secfile_insert_enum_comment

#define secfile_insert_enum_comment (   secfile,
  enumerator,
  specenum_type,
  comment,
  path,
  ... 
)
Value:
secfile_insert_enum_full(secfile, enumerator, specenum_type, comment, \
false, path, ##__VA_ARGS__)

Definition at line 260 of file registry_ini.h.

◆ secfile_insert_enum_data

#define secfile_insert_enum_data (   secfile,
  value,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_data_full(secfile, value, bitwise, name_fn, data, \
nullptr, false, path, ##__VA_ARGS__)
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,...) fc__attribute((__format__(__printf__

Definition at line 318 of file registry_ini.h.

◆ secfile_insert_enum_data_comment

#define secfile_insert_enum_data_comment (   secfile,
  value,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_data_full(secfile, value, bitwise, name_fn, data, \
comment, false, path, ##__VA_ARGS__)

Definition at line 322 of file registry_ini.h.

◆ secfile_insert_enum_full

#define secfile_insert_enum_full (   secfile,
  enumerator,
  specenum_type,
  comment,
  allow_replace,
  path,
  ... 
)
Value:
(specenum_type##_is_bitwise() \
secfile, enumerator, \
(secfile_enum_name_fn_t) specenum_type##_name, \
(secfile_enum_iter_fn_t) specenum_type##_begin, \
(secfile_enum_iter_fn_t) specenum_type##_end, \
(secfile_enum_next_fn_t) specenum_type##_next, comment, \
allow_replace, path, ##__VA_ARGS__) \
secfile, enumerator, \
(secfile_enum_name_fn_t) specenum_type##_name, comment, \
allow_replace, path, ##__VA_ARGS__))
struct entry 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,...) fc__attribute((__format__(__printf__
const char *(* secfile_enum_name_fn_t)(int enumerator)
Definition: registry_ini.h:34
int(* secfile_enum_iter_fn_t)()
Definition: registry_ini.h:38
int(* secfile_enum_next_fn_t)(int enumerator)
Definition: registry_ini.h:39
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,...) fc__attribute((__format__(__printf__

Definition at line 243 of file registry_ini.h.

◆ secfile_insert_enum_vec

#define secfile_insert_enum_vec (   secfile,
  enumerators,
  dim,
  specenum_type,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_full(secfile, enumerators, dim, specenum_type, \
nullptr, false, path, ##__VA_ARGS__)
#define secfile_insert_enum_vec_full(secfile, enumerators, dim, specenum_type, comment, allow_replace, path,...)
Definition: registry_ini.h:281

Definition at line 296 of file registry_ini.h.

◆ secfile_insert_enum_vec_comment

#define secfile_insert_enum_vec_comment (   secfile,
  enumerators,
  dim,
  specenum_type,
  comment,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_full(secfile, enumerators, dim, specenum_type, \
comment, false, path, ##__VA_ARGS__)

Definition at line 300 of file registry_ini.h.

◆ secfile_insert_enum_vec_data

#define secfile_insert_enum_vec_data (   secfile,
  values,
  dim,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_data_full(secfile, values, dim, bitwise, name_fn, \
data, nullptr, false, path, \
##__VA_ARGS__)
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,...) fc__attribute((__format__(__printf__

Definition at line 339 of file registry_ini.h.

◆ secfile_insert_enum_vec_data_comment

#define secfile_insert_enum_vec_data_comment (   secfile,
  values,
  dim,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_data_full(secfile, values, dim, bitwise, name_fn, \
data, comment, false, path, \
##__VA_ARGS__)

Definition at line 344 of file registry_ini.h.

◆ secfile_insert_enum_vec_full

#define secfile_insert_enum_vec_full (   secfile,
  enumerators,
  dim,
  specenum_type,
  comment,
  allow_replace,
  path,
  ... 
)
Value:
(specenum_type##_is_bitwise() \
secfile, (const int *) enumerators, dim, \
(secfile_enum_name_fn_t) specenum_type##_name, \
(secfile_enum_iter_fn_t) specenum_type##_begin, \
(secfile_enum_iter_fn_t) specenum_type##_end, \
(secfile_enum_next_fn_t) specenum_type##_next, comment, \
allow_replace, path, ##__VA_ARGS__) \
secfile, (const int *) enumerators, dim, \
(secfile_enum_name_fn_t) specenum_type##_name, comment, \
allow_replace, path, ##__VA_ARGS__))
size_t 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,...) fc__attribute((__format__(__printf__
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,...) fc__attribute((__format__(__printf__

Definition at line 281 of file registry_ini.h.

◆ secfile_insert_float

#define secfile_insert_float (   secfile,
  value,
  path,
  ... 
)
Value:
secfile_insert_float_full(secfile, value, nullptr, false, path, \
##__VA_ARGS__)
struct entry * secfile_insert_float_full(struct section_file *secfile, float value, const char *comment, bool allow_replace, const char *path,...) fc__attribute((__format__(__printf__

Definition at line 151 of file registry_ini.h.

◆ secfile_insert_int

#define secfile_insert_int (   secfile,
  value,
  path,
  ... 
)
Value:
secfile_insert_int_full(secfile, value, nullptr, false, path, \
##__VA_ARGS__)
struct entry * secfile_insert_int_full(struct section_file *secfile, int value, const char *comment, bool allow_replace, const char *path,...) fc__attribute((__format__(__printf__

Definition at line 116 of file registry_ini.h.

◆ secfile_insert_int_comment

#define secfile_insert_int_comment (   secfile,
  value,
  comment,
  path,
  ... 
)
Value:
secfile_insert_int_full(secfile, value, comment, false, path, \
##__VA_ARGS__)

Definition at line 119 of file registry_ini.h.

◆ secfile_insert_int_vec

#define secfile_insert_int_vec (   secfile,
  values,
  dim,
  path,
  ... 
)
Value:
secfile_insert_int_vec_full(secfile, values, dim, nullptr, false, path, \
##__VA_ARGS__)
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,...) fc__attribute((__format__(__printf__

Definition at line 131 of file registry_ini.h.

◆ secfile_insert_int_vec_comment

#define secfile_insert_int_vec_comment (   secfile,
  values,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_int_vec_full(secfile, values, dim, comment, false, path, \
##__VA_ARGS__)

Definition at line 134 of file registry_ini.h.

◆ secfile_insert_str

#define secfile_insert_str (   secfile,
  string,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, nullptr, false, false, \
EST_NORMAL, path, ##__VA_ARGS__)
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,...) fc__attribute((__format__(__printf__
@ EST_NORMAL
Definition: registry_ini.h:71

Definition at line 167 of file registry_ini.h.

◆ secfile_insert_str_comment

#define secfile_insert_str_comment (   secfile,
  string,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, comment, false, true, \
EST_NORMAL, path, ##__VA_ARGS__)

Definition at line 173 of file registry_ini.h.

◆ secfile_insert_str_noescape

#define secfile_insert_str_noescape (   secfile,
  string,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, nullptr, false, true, \
EST_NORMAL, path, ##__VA_ARGS__)

Definition at line 170 of file registry_ini.h.

◆ secfile_insert_str_noescape_comment

#define secfile_insert_str_noescape_comment (   secfile,
  string,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, comment, false, true, \
EST_NORMAL, path, ##__VA_ARGS__)

Definition at line 176 of file registry_ini.h.

◆ secfile_insert_str_vec

#define secfile_insert_str_vec (   secfile,
  strings,
  dim,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, nullptr, false, false, \
path, ##__VA_ARGS__)
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,...) fc__attribute((__format__(__printf__

Definition at line 204 of file registry_ini.h.

◆ secfile_insert_str_vec_comment

#define secfile_insert_str_vec_comment (   secfile,
  strings,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, comment, false, true, \
path, ##__VA_ARGS__)

Definition at line 210 of file registry_ini.h.

◆ secfile_insert_str_vec_noescape

#define secfile_insert_str_vec_noescape (   secfile,
  strings,
  dim,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, nullptr, false, true, \
path, ##__VA_ARGS__)

Definition at line 207 of file registry_ini.h.

◆ secfile_insert_str_vec_noescape_comment

#define secfile_insert_str_vec_noescape_comment (   secfile,
  strings,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, comment, false, true, \
path, ##__VA_ARGS__)

Definition at line 214 of file registry_ini.h.

◆ secfile_lookup_enum

#define secfile_lookup_enum (   secfile,
  enumerator,
  specenum_type,
  path,
  ... 
)
Value:
(specenum_type##_is_bitwise() \
secfile, FC_ENUM_PTR(enumerator), \
(secfile_enum_is_valid_fn_t) specenum_type##_is_valid, \
(secfile_enum_by_name_fn_t) specenum_type##_by_name, path, \
##__VA_ARGS__) \
secfile, FC_ENUM_PTR(enumerator), \
(secfile_enum_is_valid_fn_t) specenum_type##_is_valid, \
(secfile_enum_by_name_fn_t) specenum_type##_by_name, path, \
##__VA_ARGS__))
struct entry bool bool bool int int int const char const char const char 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
bool(* secfile_enum_is_valid_fn_t)(int enumerator)
Definition: registry_ini.h:33
struct entry bool bool bool int int int const char const char const char bool 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
int(* secfile_enum_by_name_fn_t)(const char *enum_name, int(*strcmp_fn)(const char *, const char *))
Definition: registry_ini.h:35

Definition at line 424 of file registry_ini.h.

◆ secfile_lookup_enum_default

#define secfile_lookup_enum_default (   secfile,
  defval,
  specenum_type,
  path,
  ... 
)
Value:
(specenum_type##_is_bitwise() \
secfile, defval, \
(secfile_enum_is_valid_fn_t) specenum_type##_is_valid, \
(secfile_enum_by_name_fn_t) specenum_type##_by_name, path, \
##__VA_ARGS__) \
secfile, defval, \
(secfile_enum_is_valid_fn_t) specenum_type##_is_valid, \
(secfile_enum_by_name_fn_t) specenum_type##_by_name, path, \
##__VA_ARGS__))
int 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
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,...) fc__warn_unused_result fc__attribute((__format__(__printf__

Definition at line 448 of file registry_ini.h.

◆ secfile_lookup_enum_vec

#define secfile_lookup_enum_vec (   secfile,
  dim,
  specenum_type,
  path,
  ... 
)
Value:
(specenum_type##_is_bitwise() \
? (enum specenum_type *) secfile_lookup_bitwise_enum_vec_full( \
secfile, dim, \
(secfile_enum_is_valid_fn_t) specenum_type##_is_valid, \
(secfile_enum_by_name_fn_t) specenum_type##_by_name, path, \
##__VA_ARGS__) \
: (enum specenum_type *) secfile_lookup_plain_enum_vec_full( \
secfile, dim, \
(secfile_enum_is_valid_fn_t) specenum_type##_is_valid, \
(secfile_enum_by_name_fn_t) specenum_type##_by_name, path, \
##__VA_ARGS__))
int 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,...) fc__warn_unused_result fc__attribute((__format__(__printf__
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,...) fc__warn_unused_result fc__attribute((__format__(__printf__

Definition at line 473 of file registry_ini.h.

◆ secfile_replace_bool

#define secfile_replace_bool (   secfile,
  value,
  path,
  ... 
)
Value:
secfile_insert_bool_full(secfile, value, nullptr, true, path, \
##__VA_ARGS__)

Definition at line 85 of file registry_ini.h.

◆ secfile_replace_bool_comment

#define secfile_replace_bool_comment (   secfile,
  value,
  comment,
  path,
  ... 
)
Value:
secfile_insert_bool_full(secfile, value, comment, true, path, \
##__VA_ARGS__)

Definition at line 88 of file registry_ini.h.

◆ secfile_replace_bool_vec

#define secfile_replace_bool_vec (   secfile,
  values,
  dim,
  path,
  ... 
)
Value:
secfile_insert_bool_vec_full(secfile, values, dim, nullptr, true, path, \
##__VA_ARGS__)

Definition at line 103 of file registry_ini.h.

◆ secfile_replace_bool_vec_comment

#define secfile_replace_bool_vec_comment (   secfile,
  values,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_bool_vec_full(secfile, values, comment, true, path, \
##__VA_ARGS__)

Definition at line 106 of file registry_ini.h.

◆ secfile_replace_enum

#define secfile_replace_enum (   secfile,
  enumerator,
  specenum_type,
  path,
  ... 
)
Value:
secfile_insert_enum_full(secfile, enumerator, specenum_type, nullptr, \
true, path, ##__VA_ARGS__)

Definition at line 264 of file registry_ini.h.

◆ secfile_replace_enum_comment

#define secfile_replace_enum_comment (   secfile,
  enumerator,
  specenum_type,
  comment,
  path,
  ... 
)
Value:
secfile_insert_enum_full(secfile, enumerator, specenum_type, comment, \
true, path, ##__VA_ARGS__)

Definition at line 267 of file registry_ini.h.

◆ secfile_replace_enum_data

#define secfile_replace_enum_data (   secfile,
  value,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_data_full(secfile, value, bitwise, name_fn, data, \
nullptr, true, path, ##__VA_ARGS__)

Definition at line 326 of file registry_ini.h.

◆ secfile_replace_enum_data_comment

#define secfile_replace_enum_data_comment (   secfile,
  value,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_data_full(secfile, value, bitwise, name_fn, data, \
comment, true, path, ##__VA_ARGS__)

Definition at line 330 of file registry_ini.h.

◆ secfile_replace_enum_vec

#define secfile_replace_enum_vec (   secfile,
  enumerators,
  dim,
  specenum_type,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_full(secfile, enumerators, dim, specenum_type, \
nullptr, true, path, ##__VA_ARGS__)

Definition at line 304 of file registry_ini.h.

◆ secfile_replace_enum_vec_comment

#define secfile_replace_enum_vec_comment (   secfile,
  enumerators,
  dim,
  specenum_type,
  comment,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_full(secfile, enumerators, dim, specenum_type, \
comment, true, path, ##__VA_ARGS__)

Definition at line 308 of file registry_ini.h.

◆ secfile_replace_enum_vec_data

#define secfile_replace_enum_vec_data (   secfile,
  values,
  dim,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_data_full(secfile, values, dim, bitwise, name_fn, \
data, nullptr, true, path, \
##__VA_ARGS__)

Definition at line 349 of file registry_ini.h.

◆ secfile_replace_enum_vec_data_comment

#define secfile_replace_enum_vec_data_comment (   secfile,
  values,
  dim,
  bitwise,
  name_fn,
  data,
  path,
  ... 
)
Value:
secfile_insert_enum_vec_data_full(secfile, values, dim, bitwise, name_fn, \
data, comment, true, path, \
##__VA_ARGS__)

Definition at line 354 of file registry_ini.h.

◆ secfile_replace_int

#define secfile_replace_int (   secfile,
  value,
  path,
  ... 
)     secfile_insert_int_full(secfile, value, nullptr, true, path, ##__VA_ARGS__)

Definition at line 122 of file registry_ini.h.

◆ secfile_replace_int_comment

#define secfile_replace_int_comment (   secfile,
  value,
  comment,
  path,
  ... 
)     secfile_insert_int_full(secfile, value, comment, true, path, ##__VA_ARGS__)

Definition at line 124 of file registry_ini.h.

◆ secfile_replace_int_vec

#define secfile_replace_int_vec (   secfile,
  values,
  dim,
  path,
  ... 
)
Value:
secfile_insert_int_vec_full(secfile, values, dim, nullptr, true, path, \
##__VA_ARGS__)

Definition at line 138 of file registry_ini.h.

◆ secfile_replace_int_vec_comment

#define secfile_replace_int_vec_comment (   secfile,
  values,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_int_vec_full(secfile, values, dim, comment, true, path, \
##__VA_ARGS__)

Definition at line 141 of file registry_ini.h.

◆ secfile_replace_str

#define secfile_replace_str (   secfile,
  string,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, nullptr, true, false, \
EST_NORMAL, path, ##__VA_ARGS__)

Definition at line 180 of file registry_ini.h.

◆ secfile_replace_str_comment

#define secfile_replace_str_comment (   secfile,
  string,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, comment, true, true, EST_NORMAL, \
path, ##__VA_ARGS__)

Definition at line 186 of file registry_ini.h.

◆ secfile_replace_str_noescape

#define secfile_replace_str_noescape (   secfile,
  string,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, nullptr, true, true, EST_NORMAL, \
path, ##__VA_ARGS__)

Definition at line 183 of file registry_ini.h.

◆ secfile_replace_str_noescape_comment

#define secfile_replace_str_noescape_comment (   secfile,
  string,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_full(secfile, string, comment, true, true, EST_NORMAL, \
path, ##__VA_ARGS__)

Definition at line 189 of file registry_ini.h.

◆ secfile_replace_str_vec

#define secfile_replace_str_vec (   secfile,
  strings,
  dim,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, nullptr, true, false, \
path, ##__VA_ARGS__)

Definition at line 218 of file registry_ini.h.

◆ secfile_replace_str_vec_comment

#define secfile_replace_str_vec_comment (   secfile,
  strings,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, comment, true, true, \
path, ##__VA_ARGS__)

Definition at line 224 of file registry_ini.h.

◆ secfile_replace_str_vec_noescape

#define secfile_replace_str_vec_noescape (   secfile,
  strings,
  dim,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, nullptr, true, true, \
path, ##__VA_ARGS__)

Definition at line 221 of file registry_ini.h.

◆ secfile_replace_str_vec_noescape_comment

#define secfile_replace_str_vec_noescape_comment (   secfile,
  strings,
  dim,
  comment,
  path,
  ... 
)
Value:
secfile_insert_str_vec_full(secfile, strings, dim, comment, true, true, \
path, ##__VA_ARGS__)

Definition at line 228 of file registry_ini.h.

◆ section_list_iterate

#define section_list_iterate (   seclist,
  psection 
)     TYPED_LIST_ITERATE(struct section, seclist, psection)

Definition at line 46 of file registry_ini.h.

◆ section_list_iterate_end

#define section_list_iterate_end   LIST_ITERATE_END

Definition at line 48 of file registry_ini.h.

◆ section_list_iterate_rev

#define section_list_iterate_rev (   seclist,
  psection 
)     TYPED_LIST_ITERATE_REV(struct section, seclist, psection)

Definition at line 49 of file registry_ini.h.

◆ section_list_iterate_rev_end

#define section_list_iterate_rev_end   LIST_ITERATE_REV_END

Definition at line 51 of file registry_ini.h.

◆ SPECLIST_TAG [1/2]

#define SPECLIST_TAG   section

Definition at line 54 of file registry_ini.h.

◆ SPECLIST_TAG [2/2]

#define SPECLIST_TAG   entry

Definition at line 54 of file registry_ini.h.

Typedef Documentation

◆ secfile_data_t

typedef const void* secfile_data_t

Definition at line 31 of file registry_ini.h.

◆ secfile_enum_by_name_fn_t

typedef int(* secfile_enum_by_name_fn_t) (const char *enum_name, int(*strcmp_fn)(const char *, const char *))

Definition at line 35 of file registry_ini.h.

◆ secfile_enum_is_valid_fn_t

typedef bool(* secfile_enum_is_valid_fn_t) (int enumerator)

Definition at line 33 of file registry_ini.h.

◆ secfile_enum_iter_fn_t

typedef int(* secfile_enum_iter_fn_t) ()

Definition at line 38 of file registry_ini.h.

◆ secfile_enum_name_data_fn_t

typedef const char*(* secfile_enum_name_data_fn_t) (secfile_data_t data, int enumerator)

Definition at line 40 of file registry_ini.h.

◆ secfile_enum_name_fn_t

typedef const char*(* secfile_enum_name_fn_t) (int enumerator)

Definition at line 34 of file registry_ini.h.

◆ secfile_enum_next_fn_t

typedef int(* secfile_enum_next_fn_t) (int enumerator)

Definition at line 39 of file registry_ini.h.

Enumeration Type Documentation

◆ entry_special_type

Enumerator
EST_NORMAL 
EST_INCLUDE 
EST_COMMENT 

Definition at line 71 of file registry_ini.h.

◆ entry_type

enum entry_type
Enumerator
ENTRY_BOOL 
ENTRY_INT 
ENTRY_FLOAT 
ENTRY_STR 
ENTRY_FILEREFERENCE 
ENTRY_ILLEGAL 

Definition at line 533 of file registry_ini.h.

Function Documentation

◆ 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 3111 of file registry_ini.cpp.

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 3136 of file registry_ini.cpp.

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 3076 of file registry_ini.cpp.

Referenced by secfile_save().

◆ entry_destroy()

◆ entry_float_get()

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

Gets an floating value.

Returns TRUE on success.

Definition at line 3149 of file registry_ini.cpp.

◆ entry_float_set()

bool entry_float_set ( struct entry pentry,
float  value 
)

Sets an floating value.

Returns TRUE on success.

Definition at line 3165 of file registry_ini.cpp.

Referenced by secfile_insert_float_full().

◆ entry_int_get()

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

Gets an integer value.

Returns TRUE on success.

Definition at line 3179 of file registry_ini.cpp.

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 3194 of file registry_ini.cpp.

Referenced by secfile_insert_int_full().

◆ entry_name()

◆ 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 3010 of file registry_ini.cpp.

Referenced by secfile_hash_delete(), and secfile_hash_insert().

◆ entry_section()

struct section* entry_section ( const struct entry pentry)

◆ entry_set_comment()

void entry_set_comment ( struct entry pentry,
const QString &  comment 
)

◆ 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 3028 of file registry_ini.cpp.

Referenced by compat_load_020400().

◆ entry_str_get()

◆ entry_str_set()

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

Sets an string value.

Returns TRUE on success.

Definition at line 3222 of file registry_ini.cpp.

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_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 3243 of file registry_ini.cpp.

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

◆ entry_type_get()

◆ 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 857 of file registry_ini.cpp.

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(), and tileset_read_toplevel().

◆ secfile_entry_by_path()

◆ secfile_entry_delete()

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

◆ secfile_entry_lookup()

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

◆ secfile_from_stream()

struct section_file* secfile_from_stream ( QIODevice *  stream,
bool  allow_duplicates 
)

Create a section file from a stream.

Returns nullptr on error.

Definition at line 585 of file registry_ini.cpp.

Referenced by netfile_get_section_file(), and parse_metaserver_data().

◆ secfile_insert_bitwise_enum_full()

struct entry 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,
  ... 
)

◆ secfile_insert_bitwise_enum_vec_full()

size_t 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,
  ... 
)

◆ 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,
  ... 
)

◆ 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,
  ... 
)

◆ 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,
  ... 
)

◆ 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,
  ... 
)

◆ secfile_insert_filereference()

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

◆ 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,
  ... 
)

◆ secfile_insert_include()

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

Insert a include entry.

Definition at line 1159 of file registry_ini.cpp.

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,
  ... 
)

◆ 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,
  ... 
)

◆ secfile_insert_long_comment()

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

Insert a long comment entry.

Definition at line 1184 of file registry_ini.cpp.

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,
  ... 
)

◆ 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,
  ... 
)

◆ 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,
  ... 
)

◆ secfile_insert_str_vec_full() [1/2]

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,
  ... 
)

◆ secfile_insert_str_vec_full() [2/2]

size_t size_t secfile_insert_str_vec_full ( struct section_file secfile,
const QVector< QString > &  strings,
size_t  dim,
const char *  comment,
bool  allow_replace,
bool  no_escape,
const char *  path,
  ... 
)

◆ secfile_load_section()

struct section_file* secfile_load_section ( const QString &  filename,
const QString &  section,
bool  allow_duplicates 
)

Create a section file from a file, read only one particular section.

Returns nullptr on error.

Definition at line 573 of file registry_ini.cpp.

Referenced by secfile_load(), show_scenarios(), page_load::slot_selection_changed(), and page_scenario::update_scenarios_page().

◆ secfile_lookup_bitwise_enum_default_full()

int 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,
  ... 
)

◆ secfile_lookup_bitwise_enum_full()

struct entry bool bool bool int int int const char const char const char bool 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,
  ... 
)

◆ secfile_lookup_bitwise_enum_vec_full()

int 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,
  ... 
)

◆ secfile_lookup_bool()

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

◆ secfile_lookup_bool_default()

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

◆ 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,
  ... 
)

◆ secfile_lookup_enum_default_data()

bool 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,
  ... 
)

◆ secfile_lookup_int()

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

◆ secfile_lookup_int_def_min_max()

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

◆ secfile_lookup_int_default()

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

◆ secfile_lookup_int_vec()

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

◆ 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,
  ... 
)

◆ secfile_lookup_plain_enum_full()

struct entry bool bool bool int int int const char const char const char 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,
  ... 
)

◆ 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,
  ... 
)

◆ secfile_lookup_str()

struct entry bool bool bool int int int const char* secfile_lookup_str ( const struct section_file secfile,
const char *  path,
  ... 
)

◆ secfile_lookup_str_default()

struct entry bool bool bool int int int const char const char* secfile_lookup_str_default ( const struct section_file secfile,
const char *  def,
const char *  path,
  ... 
)

◆ secfile_lookup_str_vec()

struct entry bool bool bool int int int const char const char const char** secfile_lookup_str_vec ( const struct section_file secfile,
size_t *  dim,
const char *  path,
  ... 
)

◆ secfile_name()

const char* secfile_name ( const struct section_file secfile)

◆ secfile_save()

bool secfile_save ( const struct section_file secfile,
QString  filename 
)

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.

Definition at line 614 of file registry_ini.cpp.

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

◆ secfile_section_by_name()

bool int struct section* secfile_section_by_name ( const struct section_file secfile,
const QString &  section_name 
)

◆ secfile_section_lookup()

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

◆ secfile_section_new()

struct section* secfile_section_new ( struct section_file secfile,
const QString &  section_name 
)

Create a new section in the secfile.

Definition at line 2694 of file registry_ini.cpp.

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

◆ secfile_sections()

struct section 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 2652 of file registry_ini.cpp.

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 nullptr if no section was found. This list is not owned by the registry module and the user must destroy it when he finished to work with it.

Definition at line 2663 of file registry_ini.cpp.

Referenced by boot_help_texts(), load_building_names(), load_game_names(), load_government_names(), load_nation_names(), 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(), tileset_read_toplevel(), and tileset_setup_options().

◆ section_clear_all()

void section_clear_all ( struct section psection)

Remove all entries.

Definition at line 2766 of file registry_ini.cpp.

Referenced by section_destroy().

◆ section_destroy()

void section_destroy ( struct section psection)

Remove this section from the secfile.

Definition at line 2739 of file registry_ini.cpp.

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 2784 of file registry_ini.cpp.

Referenced by compat_load_020400(), fcdb_load_config(), 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 QString &  entry_name,
bool  value 
)

Returns a new entry of type ENTRY_BOOL.

Definition at line 2876 of file registry_ini.cpp.

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 QString &  entry_name 
)

◆ section_entry_float_new()

struct entry* section_entry_float_new ( struct section psection,
const QString &  entry_name,
float  value 
)

Returns a new entry of type ENTRY_FLOAT.

Definition at line 2892 of file registry_ini.cpp.

Referenced by entry_from_token(), and secfile_insert_float_full().

◆ section_entry_int_new()

struct entry* section_entry_int_new ( struct section psection,
const QString &  entry_name,
int  value 
)

Returns a new entry of type ENTRY_INT.

Definition at line 2860 of file registry_ini.cpp.

Referenced by entry_from_token(), and secfile_insert_int_full().

◆ section_entry_str_new()

struct entry* section_entry_str_new ( struct section psection,
const QString &  entry_name,
const QString &  value,
bool  escaped 
)