26 lines
938 B
C
26 lines
938 B
C
#ifndef ENGINE_CONFIG_H
|
|
#define ENGINE_CONFIG_H
|
|
|
|
#include <stdbool.h>
|
|
#include <rini.h>
|
|
|
|
typedef struct {
|
|
char *path;
|
|
rini_data rini;
|
|
} Config;
|
|
|
|
void InitConfig(Config *config, const char *path);
|
|
int GetConfigInt(Config *config, const char *key);
|
|
int GetConfigIntOrDefault(Config *config, const char *key, int default_value);
|
|
const char *GetConfigString(Config *config, const char *key);
|
|
const char *GetConfigStringOrDefault(Config *config, const char *key, const char *default_value);
|
|
const char *GetConfigDescription(Config *config, const char *key);
|
|
int SetConfigInt(Config *config, const char *key, int value, const char *desc);
|
|
int SetConfigString(Config *config, const char *key, const char *text, const char *desc);
|
|
int SetConfigDescription(Config *config, const char *key, const char *desc);
|
|
int AddCommentLine(Config *config, const char *comment);
|
|
void SaveConfig(Config *config);
|
|
void CleanUpConfig(Config *config);
|
|
|
|
#endif
|