#include <atompub/entry.h>
#include <atompub/iri.h>
+typedef struct _atom_backend AtomBackend;
+
Atom * atom_retrieve_resource (AtomCtx *, IRI *);
+AtomBackend * atom_backend (AtomCtx *);
+void atom_backend_set (AtomCtx *, AtomBackend *);
#endif
#include <atompub/atom.h>
-extern Atom *giochannel_atom_retrieve_resource (AtomCtx *, IRI *);
+struct _atom_backend
+{
+ Atom * (*retrieve_resource) (AtomCtx *, IRI *);
+};
+
Atom *
atom_retrieve_resource (AtomCtx *ctx, IRI *iri)
{
- return giochannel_atom_retrieve_resource (ctx, iri);
+ AtomBackend *backend;
+ backend = atom_backend (ctx);
+ if (backend && backend->retrieve_resource)
+ return backend->retrieve_resource (ctx, iri);
+ return NULL;
}
{
GError *error;
gpointer config_data;
+ AtomBackend *backend;
};
AtomCtx *
{
ctx->config_data = data;
}
+
+AtomBackend *
+atom_backend (AtomCtx *ctx)
+{
+ return ctx->backend;
+}
+
+void
+atom_backend_set (AtomCtx *ctx, AtomBackend *backend)
+{
+ ctx->backend = backend;
+}