#define SDL_INI_IMPLEMENTATION
int main(int argc, char *argv[])
{
SDL_Init(0);
int w = (int)
INI_GetInt(cfg,
"Video",
"width", 1280);
SDL_Quit();
return 0;
}
Sint64 INI_GetInt(const SDL_ini *ini, const char *section, const char *key, Sint64 default_value)
Get a signed 64-bit integer value from the INI.
Definition SDL_ini.h:1391
bool INI_SetFloat(SDL_ini *ini, const char *section, const char *key, float value)
Set a single-precision floating-point value in the INI.
Definition SDL_ini.h:1527
bool INI_Save(SDL_ini *ini, const char *file)
Save an INI object to a filesystem path.
Definition SDL_ini.h:1261
SDL_ini * INI_Create(void)
Create an empty INI object.
Definition SDL_ini.h:965
bool INI_SetString(SDL_ini *ini, const char *section, const char *key, const char *value)
Set a string value in the INI.
Definition SDL_ini.h:1463
bool INI_SetBoolean(SDL_ini *ini, const char *section, const char *key, bool value)
Set a boolean value in the INI.
Definition SDL_ini.h:1533
bool INI_SetInt(SDL_ini *ini, const char *section, const char *key, Sint64 value)
Set a signed 64-bit integer value in the INI.
Definition SDL_ini.h:1515
bool INI_GetBoolean(const SDL_ini *ini, const char *section, const char *key, bool default_value)
Get a boolean value from the INI.
Definition SDL_ini.h:1431
void INI_Destroy(SDL_ini *ini)
Free an INI object and all associated memory.
Definition SDL_ini.h:1311
SDL_ini * INI_Load(const char *file)
Load an INI file from a filesystem path.
Definition SDL_ini.h:1160
An SDL_ini instance to handle the data for an INI file.
Definition SDL_ini.h:612
const char *
INI_GetString(
const SDL_ini *ini,
const char *section,
const char *key,
const char *default_value);
Sint64
INI_GetInt(
const SDL_ini *ini,
const char *section,
const char *key, Sint64 default_value);
float INI_GetFloat(
const SDL_ini *ini,
const char *section,
const char *key,
float default_value);
double INI_GetDouble(
const SDL_ini *ini,
const char *section,
const char *key,
double default_value);
const char * INI_GetString(const SDL_ini *ini, const char *section, const char *key, const char *default_value)
Get a string value from the INI.
Definition SDL_ini.h:1322
bool INI_RemoveKey(SDL_ini *ini, const char *section, const char *key)
Delete a key from a section.
Definition SDL_ini.h:1537
void INI_SetDirty(SDL_ini *ini, bool dirty)
Manually set or clear the dirty flag.
Definition SDL_ini.h:1385
double INI_GetDouble(const SDL_ini *ini, const char *section, const char *key, double default_value)
Get a double-precision floating-point value from the INI.
Definition SDL_ini.h:1414
void(* INI_EnumerateKeysCallback)(void *userdata, const SDL_ini *ini, const char *section, const char *key, const char *value)
Callback invoked for each key/value pair during enumeration.
Definition SDL_ini.h:424
float INI_GetFloat(const SDL_ini *ini, const char *section, const char *key, float default_value)
Get a floating-point value from the INI.
Definition SDL_ini.h:1427
bool INI_Merge_IO(SDL_ini *dest, SDL_IOStream *src, bool closeio)
Load an INI from an SDL_IOStream and merge it into dest.
Definition SDL_ini.h:1618
const char * INI_GetKey(const SDL_ini *ini, const char *section, int index)
Return the key name at the given index within a section.
Definition SDL_ini.h:1677
bool INI_Merge(SDL_ini *dest, const SDL_ini *src)
Merge all sections and keys from src into dest.
Definition SDL_ini.h:1601
bool INI_HasKey(const SDL_ini *ini, const char *section, const char *key)
Check whether a key exists in a section.
Definition SDL_ini.h:1355
const char * INI_GetKeyValue(const SDL_ini *ini, const char *section, int index)
Return the value at the given key index within a section.
Definition SDL_ini.h:1691
void(* INI_EnumerateSectionsCallback)(void *userdata, const SDL_ini *ini, const char *section)
Callback invoked for each section name during enumeration.
Definition SDL_ini.h:415
SDL_ini * INI_LoadMultiple(const char **files)
Load multiple INI files, merging them in order.
Definition SDL_ini.h:1638
SDL_ini * INI_LoadString(const char *text)
Load an INI from the given string.
Definition SDL_ini.h:1168
bool INI_HasSection(const SDL_ini *ini, const char *section)
Check whether a section exists and contains at least one key.
Definition SDL_ini.h:1337
bool INI_Save_IO(SDL_ini *ini, SDL_IOStream *dst, bool closeio)
Save an INI object to an SDL_IOStream.
Definition SDL_ini.h:1176
int INI_GetSectionCount(const SDL_ini *ini)
Return the number of sections in the INI.
Definition SDL_ini.h:1656
bool INI_HasValue(const SDL_ini *ini, const char *section, const char *key)
Check whether a key exists and has a non-empty value.
Definition SDL_ini.h:1366
bool INI_SetDouble(SDL_ini *ini, const char *section, const char *key, double value)
Set a double-precision floating-point value in the INI.
Definition SDL_ini.h:1521
bool INI_RemoveSection(SDL_ini *ini, const char *section)
Delete an entire section and all its keys.
Definition SDL_ini.h:1560
bool INI_IsDirty(const SDL_ini *ini)
Check whether the INI has been modified since creation or last load.
Definition SDL_ini.h:1378
SDL_ini * INI_Load_IO(SDL_IOStream *src, bool closeio)
Load an INI file from an SDL_IOStream.
Definition SDL_ini.h:973
int INI_GetVersion(void)
Get the version of SDL_ini that is linked against.
Definition SDL_ini.h:961
int INI_GetKeyCount(const SDL_ini *ini, const char *section)
Return the number of key/value entries in a section (comments and blank lines are not counted).
Definition SDL_ini.h:1666
void INI_EnumerateKeys(const SDL_ini *ini, const char *section, INI_EnumerateKeysCallback callback, void *userdata)
Enumerate all key/value pairs in a section.
Definition SDL_ini.h:1586
void INI_EnumerateSections(const SDL_ini *ini, INI_EnumerateSectionsCallback callback, void *userdata)
Enumerate all sections in the INI.
Definition SDL_ini.h:1577
const char * INI_GetSection(const SDL_ini *ini, int index)
Return the name of the section at the given index.
Definition SDL_ini.h:1661
char * INI_SaveString(SDL_ini *ini)
Save an INI object to a newly allocated, NUL-terminated string.
Definition SDL_ini.h:1269
bool INI_MergeFile(SDL_ini *dest, const char *file)
Load an INI from a file and merge it into dest.
Definition SDL_ini.h:1628