settings.h revision c25356d5978632df6203437e1953bcb29e0c736f
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;
9e49712b9cddbf47568ea4f3676e59b151489356Timo Sirainenparse_setting_from_defs(pool_t pool, struct setting_def *defs, void *base,
6ef7e31619edfaa17ed044b45861d106a86191efTimo Sirainenbool settings_read(const char *path, const char *section,
6ef7e31619edfaa17ed044b45861d106a86191efTimo Sirainen settings_section_callback_t *sect_callback, void *context);
59151b71059df1190acd75d8717ed04a7920c862Timo Sirainen# define settings_read(path, section, callback, sect_callback, context) \
00efa7d99981e18e286c02b18c1163dde18ee521Timo Sirainen ({(void)(1 ? 0 : callback((const char *)0, (const char *)0, context)); \
00efa7d99981e18e286c02b18c1163dde18ee521Timo Sirainen (void)(1 ? 0 : sect_callback((const char *)0, (const char *)0, \
00efa7d99981e18e286c02b18c1163dde18ee521Timo Sirainen context, (const char **)0)); \
59151b71059df1190acd75d8717ed04a7920c862Timo Sirainen settings_read(path, section, (settings_callback_t *)callback, \
59151b71059df1190acd75d8717ed04a7920c862Timo Sirainen (settings_section_callback_t *)sect_callback, context); })
00efa7d99981e18e286c02b18c1163dde18ee521Timo Sirainen# define settings_read(path, section, callback, sect_callback, context) \
00efa7d99981e18e286c02b18c1163dde18ee521Timo Sirainen settings_read(path, section, (settings_callback_t *)callback, \