|
102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
|
#include "config_internal.h"#include <dttr_log.h>#include <dttr_path.h>#include <khash.h>#include <stddef.h>#include <stdio.h>#include <string.h>Go to the source code of this file.
Macros | |
| #define | CONFIG_LOOKUP_KEY_CAPACITY 64 |
| #define | FIELD(_section, _key, _field, _type) |
| #define | FIELD_TOP(_key, _field, _type) |
| #define | FIELD_GAMEPAD_AXIS(_key, _index) |
| #define | FIELD_GAMEPAD_DEADZONE(_key, _index) |
| #define | CONFIG_SCHEMA_COUNT ((int)SDL_arraysize(config_schema)) |
| #define | CONFIG_ASSIGN_TYPES(X) |
| #define | CONFIG_ASSIGN_FN(value_type, type, default_val, parse_fn, fn_name) |
| #define | CONFIG_ASSIGN_CASE(value_type, type, default_val, parse_fn, fn_name) |
Functions | |
| static | khash_t (dttr_config_lookup) |
| int | DTTR_Config_SchemaCount () |
| const DTTR_ConfigFieldSpec * | DTTR_Config_SchemaGet (int index) |
| static const char * | config_field_bytes (const DTTR_Config *config, const DTTR_ConfigFieldSpec *spec) |
| bool | DTTR_Config_FieldChanged (const DTTR_Config *current, const DTTR_Config *base, const DTTR_ConfigFieldSpec *spec) |
| bool | DTTR_Config_SchemaChanged (const DTTR_Config *current, const DTTR_Config *base) |
| static void | config_schema_init () |
| const DTTR_ConfigFieldSpec * | config_schema_find (const char *section, const char *key) |
| static bool | config_assign_string (char *field, size_t field_size, const char *value) |
| bool | config_apply_entry (DTTR_Config *config, const char *section, const char *key, const char *value) |
Variables | |
| static const DTTR_ConfigFieldSpec | config_schema [] |
| #define CONFIG_ASSIGN_CASE | ( | value_type, | |
| type, | |||
| default_val, | |||
| parse_fn, | |||
| fn_name ) |
Referenced by config_apply_entry().
| #define CONFIG_ASSIGN_FN | ( | value_type, | |
| type, | |||
| default_val, | |||
| parse_fn, | |||
| fn_name ) |
| #define CONFIG_ASSIGN_TYPES | ( | X | ) |
Definition at line 193 of file schema.c.
Referenced by config_apply_entry().
| #define CONFIG_LOOKUP_KEY_CAPACITY 64 |
Definition at line 11 of file schema.c.
Referenced by config_schema_find(), and khash_t().
| #define CONFIG_SCHEMA_COUNT ((int)SDL_arraysize(config_schema)) |
Definition at line 72 of file schema.c.
Referenced by config_schema_init(), DTTR_Config_SchemaChanged(), DTTR_Config_SchemaCount(), DTTR_Config_SchemaGet(), and khash_t().
| #define FIELD | ( | _section, | |
| _key, | |||
| _field, | |||
| _type ) |
| #define FIELD_GAMEPAD_AXIS | ( | _key, | |
| _index ) |
| #define FIELD_GAMEPAD_DEADZONE | ( | _key, | |
| _index ) |
| #define FIELD_TOP | ( | _key, | |
| _field, | |||
| _type ) |
| bool config_apply_entry | ( | DTTR_Config * | config, |
| const char * | section, | ||
| const char * | key, | ||
| const char * | value ) |
Definition at line 252 of file schema.c.
References CONFIG_ASSIGN_CASE, config_assign_string(), CONFIG_ASSIGN_TYPES, config_schema_find(), CONFIG_STRING, DTTR_ConfigFieldSpec::offset, DTTR_ConfigFieldSpec::size, and DTTR_ConfigFieldSpec::value_type.
Referenced by config_apply_json_value().
|
static |
Definition at line 248 of file schema.c.
References config_parse_string().
Referenced by config_apply_entry().
|
static |
Definition at line 103 of file schema.c.
References DTTR_ConfigFieldSpec::offset.
Referenced by DTTR_Config_FieldChanged().
| const DTTR_ConfigFieldSpec * config_schema_find | ( | const char * | section, |
| const char * | key ) |
Definition at line 173 of file schema.c.
References CONFIG_LOOKUP_KEY_CAPACITY, config_schema_init(), DTTR_Config_SchemaGet(), and NULL.
Referenced by apply_section(), and config_apply_entry().
|
static |
Definition at line 139 of file schema.c.
References config_schema, CONFIG_SCHEMA_COUNT, DTTR_ConfigFieldSpec::key, and DTTR_ConfigFieldSpec::section.
Referenced by config_schema_find().
| bool DTTR_Config_FieldChanged | ( | const DTTR_Config * | current, |
| const DTTR_Config * | base, | ||
| const DTTR_ConfigFieldSpec * | spec ) |
Definition at line 110 of file schema.c.
References config_field_bytes(), DTTR_CONFIG_VALUE_STRING, DTTR_Path_MatchesNormalized(), DTTR_ConfigFieldSpec::size, and DTTR_ConfigFieldSpec::value_type.
Referenced by DTTR_Config_SchemaChanged().
| bool DTTR_Config_SchemaChanged | ( | const DTTR_Config * | current, |
| const DTTR_Config * | base ) |
Definition at line 128 of file schema.c.
References config_schema, CONFIG_SCHEMA_COUNT, and DTTR_Config_FieldChanged().
Referenced by config_has_unsaved_changes().
| int DTTR_Config_SchemaCount | ( | ) |
Definition at line 91 of file schema.c.
References CONFIG_SCHEMA_COUNT.
Referenced by config_add_schema_fields().
| const DTTR_ConfigFieldSpec * DTTR_Config_SchemaGet | ( | int | index | ) |
Definition at line 95 of file schema.c.
References config_schema, CONFIG_SCHEMA_COUNT, and NULL.
Referenced by config_add_schema_fields(), and config_schema_find().
|
static |
Definition at line 77 of file schema.c.
References CONFIG_LOOKUP_KEY_CAPACITY, CONFIG_SCHEMA_COUNT, and NULL.
Referenced by khash_t().
|
static |
Definition at line 31 of file schema.c.
Referenced by config_schema_init(), DTTR_Config_SchemaChanged(), and DTTR_Config_SchemaGet().