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

#define GROUP   "Another Group"
#define KEY     NULL

char *text="[Another Group]";

int main ()
{
    GKeyFile *gkf=NULL;
    gchar *ret_cmnt=NULL;

    gkf=g_key_file_new();
    g_key_file_load_from_data(gkf, text, strlen(text), 
        G_KEY_FILE_KEEP_COMMENTS, NULL);
    g_key_file_set_comment(gkf, GROUP, KEY, "new_comment", NULL);

    ret_cmnt=g_key_file_get_comment(gkf, GROUP, KEY, NULL);
    printf ("comment = \"%s\" end of comment\n", ret_cmnt);
    return 0;
}