#include <glib.h>
#include "string.h"

gchar *config_data = \
"[A]                                        \n"
"foo=bar                                    \n"
"[B]                                        \n"
"foo=baz                                    \n"
"[A]                                        \n"
"foo=goo";

int main(int argc, gchar **argv)
{
    GKeyFile *config = g_key_file_new();
    gboolean success = g_key_file_load_from_data(config, 
                                                 config_data, 
                                                 strlen(config_data), 
                                                 G_KEY_FILE_NONE, NULL);
    if (!success) g_error("Parse error");
    g_message("Group 'B' defines 'foo' as '%s'", 
              g_key_file_get_string(config, "B", "foo", NULL));
    return 0;
}
