#ifndef INIPARSER_H #define INIPARSER_H #ifdef __cplusplus extern "C" { #endif /* Opaque dictionary handle (matches libiniparser ABI) */ typedef struct _dictionary_ { int n; int size; char **val; char **key; unsigned *hash; } dictionary; dictionary * iniparser_load(const char *ininame); void iniparser_freedict(dictionary *d); int iniparser_getint(dictionary *d, const char *key, int notfound); double iniparser_getdouble(dictionary *d, const char *key, double notfound); const char * iniparser_getstring(dictionary *d, const char *key, const char *def); int iniparser_getboolean(dictionary *d, const char *key, int notfound); int iniparser_find_entry(dictionary *d, const char *entry); /* Write/update one key in the dictionary (section:key format). * Returns 0 on success, -1 on failure. */ int iniparser_set(dictionary *d, const char *key, const char *val); /* Dump the dictionary back to a file in INI format. */ void iniparser_dump_ini(const dictionary *d, FILE *f); #ifdef __cplusplus } #endif #endif /* INIPARSER_H */