From db649cbfd5cc0da9e3476aea4dda9b280ef71b54 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 9 Aug 2008 00:37:31 -0300 Subject: [PATCH] Given a GFile, return an Atom, so we can use it for enumeration When enumerating/summarizing many entries into one feed, we may need to read each entry. Making it easier to do this with a function and using it for retrieving the resource itself. --- backend/gio/gio.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/backend/gio/gio.c b/backend/gio/gio.c index 84a801a..a8b3fab 100644 --- a/backend/gio/gio.c +++ b/backend/gio/gio.c @@ -35,14 +35,12 @@ gio_iri_to_file (AtomCtx *ctx, IRI *iri) } static Atom * -gio_atom_retrieve_resource (AtomCtx *ctx, IRI *iri) +gio_file_to_atom (AtomCtx *ctx, GFile *file) { - GFile *file; GError *error = NULL; gchar *data; gsize len; Atom *atom; - file = gio_iri_to_file (ctx, iri); error = NULL; if (!g_file_load_contents (file, NULL, &data, &len, NULL, &error)) { @@ -58,6 +56,14 @@ gio_atom_retrieve_resource (AtomCtx *ctx, IRI *iri) return atom; } +static Atom * +gio_atom_retrieve_resource (AtomCtx *ctx, IRI *iri) +{ + GFile *file; + file = gio_iri_to_file (ctx, iri); + return gio_file_to_atom (ctx, file); +} + AtomBackend * gio_backend (void) { -- 2.20.1