Support namespace in the config interface.
authorThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Sat, 26 Jan 2008 23:59:21 +0000 (21:59 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Sat, 26 Jan 2008 23:59:21 +0000 (21:59 -0200)
backend/files/giochannel.c
config/gkeyfile.c
include/atompub/config.h
src/config.c

index 94f8e77..669165f 100644 (file)
@@ -22,7 +22,7 @@
 
 gchar *giochannel_iri_to_filename (AtomCtx *ctx, IRI *iri)
 {
-  gchar *root = atom_config_get_str (ctx, "root");
+  gchar *root = atom_config_get_str (ctx, "giochannel", "root");
   gchar *path = iri_get_path (iri);
   gchar *filename = g_build_filename (root, path, NULL);
   g_free (root);
index 9023d83..33e54e7 100644 (file)
 #include <glib.h>
 
 gchar *
-gkeyfile_atom_config_get_str (AtomCtx *ctx, gchar * key)
+gkeyfile_atom_config_get_str (AtomCtx *ctx, gchar *group, gchar * key)
 {
   GKeyFile *keyfile;
   gchar *value;
   GError *error = NULL;
   keyfile = atom_config_data (ctx);
-  value = g_key_file_get_string (keyfile, "", key, &error);
+  value = g_key_file_get_string (keyfile, group, key, &error);
   if (value == NULL)
     {
       atom_error_set (ctx, error);
index 5dca307..d5f3fad 100644 (file)
@@ -23,6 +23,6 @@
 #include <atompub/ctx.h>
 
 void atom_config_init (AtomCtx *);
-char *atom_config_get_str (AtomCtx *, char *);
+char *atom_config_get_str (AtomCtx *, char *, char *);
 
 #endif
index 523e5b9..833ae18 100644 (file)
@@ -20,7 +20,7 @@
 #include <atompub/atom.h>
 
 extern void gkeyfile_atom_config_init (AtomCtx *);
-extern char *gkeyfile_atom_config_get_str (AtomCtx *, char *);
+extern char *gkeyfile_atom_config_get_str (AtomCtx *, char *, char *);
 
 void
 atom_config_init (AtomCtx *ctx)
@@ -29,7 +29,7 @@ atom_config_init (AtomCtx *ctx)
 }
 
 char *
-atom_config_get_str (AtomCtx *ctx, char *key)
+atom_config_get_str (AtomCtx *ctx, char *namespace, char *key)
 {
-  return gkeyfile_atom_config_get_str (ctx, key);
+  return gkeyfile_atom_config_get_str (ctx, namespace, key);
 }