2023-06-17 21:06:25 +00:00
|
|
|
/* date = June 17th 2023 10:48 pm */
|
|
|
|
|
|
|
|
#ifndef VN_CONFIG_H
|
|
|
|
#define VN_CONFIG_H
|
|
|
|
|
2023-06-18 10:09:36 +00:00
|
|
|
enum config_entry_type
|
|
|
|
{
|
|
|
|
Config_Entry_S32,
|
|
|
|
Config_Entry_S64,
|
|
|
|
Config_Entry_B32,
|
|
|
|
};
|
|
|
|
|
2023-06-17 21:06:25 +00:00
|
|
|
struct config_entry
|
|
|
|
{
|
|
|
|
string Name;
|
2023-06-18 10:09:36 +00:00
|
|
|
void *Target;
|
|
|
|
config_entry_type Type;
|
2023-06-17 21:06:25 +00:00
|
|
|
|
|
|
|
config_entry *Next;
|
|
|
|
config_entry *Prev;
|
|
|
|
};
|
|
|
|
|
2023-06-18 10:09:36 +00:00
|
|
|
struct config_entry_bucket
|
2023-06-17 21:06:25 +00:00
|
|
|
{
|
|
|
|
config_entry *First;
|
|
|
|
config_entry *Last;
|
|
|
|
};
|
|
|
|
|
2023-06-18 10:09:36 +00:00
|
|
|
struct config
|
|
|
|
{
|
|
|
|
memory_arena Arena;
|
|
|
|
config_entry_bucket EntryBuckets[32];
|
|
|
|
};
|
|
|
|
|
|
|
|
static config_entry *Config_FindEntryByName(config *Config, string Name);
|
|
|
|
|
2023-06-17 21:06:25 +00:00
|
|
|
static void Config_ReadFile(config *Config, string Path);
|
|
|
|
static void Config_WriteFile(config *Config);
|
|
|
|
|
2023-06-18 10:09:36 +00:00
|
|
|
static void Config_BindEntry(config *Config, string Name, config_entry_type, void *Target);
|
2023-06-17 21:06:25 +00:00
|
|
|
|
|
|
|
#endif //VN_CONFIG_H
|