23
23
#include <string.h>
24
24
#include "libbalsa-conf.h"
26
#if !GLIB_CHECK_VERSION(2, 6, 0)
28
#define BALSA_CONFIG_PREFIX "balsa/"
31
* Call @func for each section name that begins with @prefix.
32
* @func is called with arguments:
33
* const gchar * @key the section;
34
* const gchar * @value the trailing part of the section name,
35
* following the @prefix;
36
* gpointer @data the @data passed in.
37
* Iteration terminates when @func returns TRUE.
40
libbalsa_conf_foreach_group(const gchar * prefix,
41
LibBalsaConfForeachFunc func, gpointer data)
47
pref_len = strlen(prefix);
48
iterator = gnome_config_init_iterator_sections(BALSA_CONFIG_PREFIX);
49
while ((iterator = gnome_config_iterator_next(iterator, &key, NULL))) {
50
if (strncmp(key, prefix, pref_len) == 0
51
&& func(key, key + pref_len, data)) {
61
libbalsa_conf_push_group(const char *group)
63
gchar *prefix = g_strconcat(BALSA_CONFIG_PREFIX, group, "/", NULL);
64
gnome_config_push_prefix(prefix);
69
libbalsa_conf_remove_group_(const char *group, gboolean priv)
71
gchar *prefix = g_strconcat(BALSA_CONFIG_PREFIX, group, "/", NULL);
72
gnome_config_clean_section_(prefix, priv);
77
libbalsa_conf_has_group(const char *group)
79
gchar *prefix = g_strconcat(BALSA_CONFIG_PREFIX, group, "/", NULL);
80
gboolean retval = gnome_config_has_section(prefix);
85
#else /* !GLIB_CHECK_VERSION(2, 6, 0) */
87
26
#include <sys/types.h>
88
27
#include <sys/stat.h>