ini

An ini configuration file parser
git clone https://noulin.net/git/ini.git
Log | Files | Refs | LICENSE

ini.h (792B)


      1 #ifndef _INI_H_
      2 #define _INI_H_
      3 
      4 #include "libsheepyObject.h"
      5 
      6 #define BUFFER_SIZE 16384
      7 
      8 /**
      9  * @brief Parse an ini file.
     10  * @details Parse an ini file. Passes values to a callback function.
     11  * No dynamic memory is allocated.
     12  *
     13  * @param fp Open file pointer to read INI file from
     14  * @param callback Callback function accepting three arguments:
     15  * section, variable, and value strings.
     16  * @return 0 on success, error code on failure
     17  */
     18 int ini_parse_file(FILE* fp, int (*callback)(char* section, char* variable, char* value));
     19 
     20 smallDictt *parseIni(const char *filename);
     21 bool saveIni(smallDictt *ini, const char *path);
     22 #endif
     23 
     24 #define isIniCompiledWithCurrentLisheepyVersion checkLibsheepyVersionIni(LIBSHEEPY_VERSION)
     25 bool checkLibsheepyVersionIni(const char *currentLibsheepyVersion);