struct _atom_backend
{
- AtomEntry * (*retrieve_entry) (AtomCtx *, AtomID *);
+ AtomEntry * (*retrieve_entry) (AtomCtx *, char *);
void (*enumerate_entries) (AtomCtx *, char ***, AtomEntry ***, size_t *);
};
void
atom_backend_retrieve_entry_set (AtomBackend *backend,
AtomEntry *retrieve_entry (AtomCtx *,
- AtomID *))
+ char *))
{
backend->retrieve_entry = retrieve_entry;
}
}
AtomEntry *
-atom_retrieve_entry (AtomCtx *ctx, AtomID *id)
+atom_retrieve_entry (AtomCtx *ctx, char *req)
{
AtomBackend *backend;
backend = atom_backend (ctx);
if (backend && backend->retrieve_entry)
- return backend->retrieve_entry (ctx, id);
+ return backend->retrieve_entry (ctx, req);
return NULL;
}
#include <atompub/atom-glib.h>
static gchar *
-giochannel_id_to_filename (AtomCtx *ctx, AtomID *id)
+giochannel_req_to_filename (AtomCtx *ctx, char *req)
{
gchar *root = atom_config_get_str (ctx, "giochannel", "root");
- gchar *path = atom_id_string (id);
- gchar *filename = g_build_filename (root, path, NULL);
+ gchar *filename = g_build_filename (root, req, NULL);
g_free (root);
return filename;
}
static AtomEntry *
-giochannel_atom_retrieve_entry (AtomCtx *ctx, AtomID *id)
+giochannel_atom_retrieve_entry (AtomCtx *ctx, char *req)
{
gchar *filename;
GIOChannel *channel;
gchar *data;
gsize len;
AtomEntry *atom;
- filename = giochannel_id_to_filename (ctx, id);
+ filename = giochannel_req_to_filename (ctx, req);
channel = g_io_channel_new_file ((const gchar *) filename, "r", &error);
g_free (filename);
if (channel == NULL)
#include <string.h>
static GFile *
-gio_id_to_file (AtomCtx *ctx, AtomID *id)
+gio_req_to_file (AtomCtx *ctx, char *req)
{
gchar *root = atom_config_get_str (ctx, "gio", "root");
- gchar *path = atom_id_string (id);
- gchar *filename = g_build_filename (root, path, NULL);
+ gchar *filename = g_build_filename (root, req, NULL);
GFile *file = g_file_new_for_path (filename);
g_free (root);
g_free (filename);
}
static AtomEntry *
-gio_atom_retrieve_entry (AtomCtx *ctx, AtomID *id)
+gio_atom_retrieve_entry (AtomCtx *ctx, char *req)
{
GFile *file;
AtomEntry *atom;
- file = gio_id_to_file (ctx, id);
+ file = gio_req_to_file (ctx, req);
atom = gio_file_to_atom (ctx, file);
g_object_unref (file);
return atom;
AtomBackend *atom_backend_new (void);
void atom_backend_delete (AtomBackend *);
void atom_backend_retrieve_entry_set (AtomBackend *,
- AtomEntry * (AtomCtx *, AtomID *));
+ AtomEntry * (AtomCtx *, char *));
void atom_backend_enumerate_entries_set (AtomBackend *,
void (AtomCtx *, char ***,
AtomEntry ***, size_t *));
-AtomEntry * atom_retrieve_entry (AtomCtx *, AtomID *);
+AtomEntry * atom_retrieve_entry (AtomCtx *, char *);
void atom_enumerate_entries (AtomCtx *, char ***, AtomEntry ***, size_t *);
AtomFeed * atom_retrieve_feed (AtomCtx *);
AtomBackend * atom_backend (AtomCtx *);