11#ifndef AFPD_INIPARSER_UTIL_H
12#define AFPD_INIPARSER_UTIL_H 1
14#ifdef HAVE_INIPARSER_INIPARSER_H
15#include <iniparser/iniparser.h>
20#ifdef HAVE_INIPARSER_CONST_DICTIONARY
21#define INIPARSER_DICTIONARY const dictionary
23#define INIPARSER_DICTIONARY dictionary
30#define INISEC_GLOBAL "global"
31#define INISEC_HOMES "homes"
33#define INIPARSER_GETSTR(config, section, key, default) ({ \
34 char _option[MAXOPTLEN]; \
35 snprintf(_option, sizeof(_option), "%s:%s", section, key); \
36 iniparser_getstring(config, _option, default); \
39#define INIPARSER_GETSTRDUP(config, section, key, default) ({ \
40 char _option[MAXOPTLEN]; \
41 snprintf(_option, sizeof(_option), "%s:%s", section, key); \
42 const char *_tmp = iniparser_getstring(config, _option, default); \
43 _tmp ? strdup(_tmp) : NULL; \
46#define CONFIG_ARG_FREE(a) do { \