Freeciv-3.2
Loading...
Searching...
No Matches
Macros | Functions | Variables
section_file.c File Reference
#include <stdarg.h>
#include "mem.h"
#include "registry.h"
#include "section_file.h"

Go to the source code of this file.

Macros

#define MAX_LEN_ERRORBUF   1024
 
#define DEBUG_ENTRIES(...)   /* log_debug(__VA_ARGS__); */
 

Functions

const charsecfile_error (void)
 
void secfile_log (const struct section_file *secfile, const struct section *psection, const char *file, const char *function, int line, const char *format,...)
 
const charsection_name (const struct section *psection)
 
struct section_filesecfile_new (bool allow_duplicates)
 
void secfile_destroy (struct section_file *secfile)
 
void secfile_allow_digital_boolean (struct section_file *secfile, bool allow_digital_boolean)
 
bool entry_from_token (struct section *psection, const char *name, const char *tok)
 

Variables

static char error_buffer [MAX_LEN_ERRORBUF] = "\0"
 

Macro Definition Documentation

◆ DEBUG_ENTRIES

#define DEBUG_ENTRIES (   ...)    /* log_debug(__VA_ARGS__); */

Definition at line 31 of file section_file.c.

◆ MAX_LEN_ERRORBUF

#define MAX_LEN_ERRORBUF   1024

Definition at line 26 of file section_file.c.

Function Documentation

◆ entry_from_token()

bool entry_from_token ( struct section psection,
const char name,
const char tok 
)

Add entry to section from token.

Definition at line 134 of file section_file.c.

Referenced by entry_from_inf_token().

◆ secfile_allow_digital_boolean()

void secfile_allow_digital_boolean ( struct section_file secfile,
bool  allow_digital_boolean 
)

Set if we could consider values 0 and 1 as boolean. By default, this is not allowed, but we need to keep compatibility with old Freeciv version for savegames, ruleset etc.

Definition at line 124 of file section_file.c.

◆ secfile_destroy()

void secfile_destroy ( struct section_file secfile)

◆ secfile_error()

const char * secfile_error ( void  )

Returns the last error which occurred in a string. It never returns NULL.

Definition at line 36 of file section_file.c.

Referenced by audio_real_init(), boot_help_texts(), color_system_read(), compat_load_020400(), compat_load_020500(), compat_load_020600(), ensure_big_sprite(), handle_single_want_hack_req(), load_command(), load_nation_names(), load_ruleset_buildings(), load_ruleset_game(), load_ruleset_governments(), load_ruleset_nations(), load_ruleset_terrain(), load_ruleset_units(), lookup_req_list(), message_options_load(), openload_luadata_file(), openload_ruleset_file(), reload_rulesets_settings(), rscompat_check_capabilities(), rscompat_settings_do_special_handling(), save_thread_run(), scan_specfile(), scan_specfile(), setting_ruleset_one(), settings_game_load(), sg_load_counters(), sg_load_game(), sg_load_game(), sg_load_history(), sg_load_history(), sg_load_map_owner(), sg_load_map_owner(), 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(), sg_load_savefile(), sg_load_savefile(), sg_load_scenario(), theme_ensure_big_sprite(), theme_read_toplevel(), and tileset_read_toplevel().

◆ secfile_log()

void secfile_log ( const struct section_file secfile,
const struct section psection,
const char file,
const char function,
int  line,
const char format,
  ... 
)

Edit the error_buffer.

Definition at line 44 of file section_file.c.

◆ secfile_new()

struct section_file * secfile_new ( bool  allow_duplicates)

Create a new empty section file.

Definition at line 73 of file section_file.c.

Referenced by create_ruleset_file(), save_game(), secfile_from_input_file(), and send_client_wants_hack().

◆ section_name()

const char * section_name ( const struct section psection)

Variable Documentation

◆ error_buffer

char error_buffer[MAX_LEN_ERRORBUF] = "\0"
static

Definition at line 28 of file section_file.c.

Referenced by secfile_error(), and secfile_log().