a84eb0599fa1d796206eaed65c4e3239f0799276Timo Sirainen { SET_STR + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
a84eb0599fa1d796206eaed65c4e3239f0799276Timo Sirainen ((struct struct_name *)0)->name, const char *), \
a84eb0599fa1d796206eaed65c4e3239f0799276Timo Sirainen { SET_INT + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
a84eb0599fa1d796206eaed65c4e3239f0799276Timo Sirainen ((struct struct_name *)0)->name, unsigned int), \
a84eb0599fa1d796206eaed65c4e3239f0799276Timo Sirainen { SET_BOOL + COMPILE_ERROR_IF_TYPES_NOT_COMPATIBLE( \
0cb57ee35d4cab9c03434d7abf312c081ed554d4Timo Sirainen/* Return error message. When closing section, key = NULL, value = NULL. */
837f363f04402adf2f8081e6a6cb734e77a0520dTimo Sirainentypedef const char *settings_callback_t(const char *key, const char *value,
0cb57ee35d4cab9c03434d7abf312c081ed554d4Timo Sirainen/* Return TRUE if we want to go inside the section */
6ef7e31619edfaa17ed044b45861d106a86191efTimo Sirainentypedef bool settings_section_callback_t(const char *type, const char *name,
59151b71059df1190acd75d8717ed04a7920c862Timo Sirainenextern settings_section_callback_t *null_settings_section_callback;
7744586e3e0fd60158abfbb03a233d3bd8d6c48bTimo Sirainenparse_setting_from_defs(pool_t pool, const struct setting_def *defs, void *base,
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainenbool settings_read_i(const char *path, const char *section,
803197abb1cc0e81abb668c026c22394bfef820dTimo Sirainen settings_section_callback_t *sect_callback, void *context,
803197abb1cc0e81abb668c026c22394bfef820dTimo Sirainen const char **error_r)
803197abb1cc0e81abb668c026c22394bfef820dTimo Sirainen#define settings_read(path, section, callback, sect_callback, context, error_r) \
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen CALLBACK_TYPECHECK(callback, const char *(*)( \
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen const char *, const char *, typeof(context))) + \
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen const char *, const char *, typeof(context), \
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen const char **)), \
803197abb1cc0e81abb668c026c22394bfef820dTimo Sirainen (settings_section_callback_t *)sect_callback, context, error_r)
803197abb1cc0e81abb668c026c22394bfef820dTimo Sirainen#define settings_read_nosection(path, callback, context, error_r) \
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen CALLBACK_TYPECHECK(callback, const char *(*)( \
27a44fcfd8d19bffe0f267f20a2b5d3fe7600fddTimo Sirainen const char *, const char *, typeof(context))), \