@@ -240,7 +240,7 @@ int xlu_cfg_printf(const XLU_Config *cfg, const char *format, ...)
static XLU_ConfigSetting *find(const XLU_Config *cfg, const char *n) {
XLU_ConfigSetting *set;
- for (set= cfg->settings;
+ for (set = xlu__cfg_get_settings(cfg);
set;
set= set->next)
if (!strcmp(set->name, n))
@@ -267,6 +267,11 @@ static int find_atom(const XLU_Config *cfg, const char *n,
return 0;
}
+XLU_ConfigSetting *xlu__cfg_get_settings(const XLU_Config *cfg)
+{
+ return cfg->settings;
+}
+
enum XLU_ConfigValueType xlu_cfg_value_type(const XLU_ConfigValue *value)
{
@@ -45,6 +45,8 @@ extern int xlu__cfg_readfile(XLU_Config *cfg, FILE *msgfile,
extern int xlu__cfg_readdata(XLU_Config *cfg, FILE *msgfile,
const char *msgprefix, XLU_ConfigSetting **psettings, const char *data,
int length);
+extern XLU_ConfigSetting *xlu__cfg_get_settings(const XLU_Config *cfg)
+ __attribute__((access(read_only, 1)));
#endif /*LIBXLU_INTERNAL_H*/
The better to isolate the shared portion of the interface from the low-level implementation. Signed-off-by: Elliott Mitchell <ehem+xen@m5p.com> --- tools/libs/util/libxlu_cfg.c | 7 ++++++- tools/libs/util/libxlu_internal.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)