Path: blob/master/dependencies/all/iniparser/iniparser.h
774 views
/*-------------------------------------------------------------------------*/1/**2@file iniparser.h3@author N. Devillard4@brief Parser for ini files.5*/6/*--------------------------------------------------------------------------*/78#ifndef _INIPARSER_H_9#define _INIPARSER_H_1011/*---------------------------------------------------------------------------12Includes13---------------------------------------------------------------------------*/1415#include <stdio.h>16#include <stdlib.h>17#include <string.h>1819/*20* The following #include is necessary on many Unixes but not Linux.21* It is not needed for Windows platforms.22* Uncomment it if needed.23*/24/* #include <unistd.h> */2526#include "dictionary.h"2728#ifdef __cplusplus29extern "C" {30#endif3132/*-------------------------------------------------------------------------*/33/**34@brief Configure a function to receive the error messages.35@param errback Function to call.3637By default, the error will be printed on stderr. If a null pointer is passed38as errback the error callback will be switched back to default.39*/40/*--------------------------------------------------------------------------*/4142void iniparser_set_error_callback(int (*errback)(const char *, ...));43444546int iniparser_getnsec(const dictionary * d);4748495051const char * iniparser_getsecname(const dictionary * d, int n);5253545556void iniparser_dump_ini(const dictionary * d, FILE * f);575859void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f);606162void iniparser_dump(const dictionary * d, FILE * f);6364int iniparser_getsecnkeys(const dictionary * d, const char * s);656667const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys);686970const char * iniparser_getstring(const dictionary * d, const char * key, const char * def);7172int iniparser_getint(const dictionary * d, const char * key, int notfound);7374long int iniparser_getlongint(const dictionary * d, const char * key, long int notfound);7576double iniparser_getdouble(const dictionary * d, const char * key, double notfound);7778int iniparser_getboolean(const dictionary * d, const char * key, int notfound);798081int iniparser_set(dictionary * ini, const char * entry, const char * val);828384void iniparser_unset(dictionary * ini, const char * entry);85868788int iniparser_find_entry(const dictionary * ini, const char * entry) ;899091dictionary * iniparser_load(const char * ininame);9293void iniparser_freedict(dictionary * d);9495#ifdef __cplusplus96}97#endif9899#endif100101