{
AtomEntry * (*retrieve_entry) (AtomCtx *, AtomID *);
void (*enumerate_entries) (AtomCtx *, char ***, AtomEntry ***, size_t *);
- int (*is_feed) (AtomCtx *, AtomID *);
};
AtomBackend *
backend = g_slice_new (AtomBackend);
backend->retrieve_entry = NULL;
backend->enumerate_entries = NULL;
- backend->is_feed = NULL;
return backend;
}
backend->enumerate_entries = enumerate_entries;
}
-void
-atom_backend_is_feed_set (AtomBackend *backend,
- int is_feed (AtomCtx *, AtomID *))
-{
- backend->is_feed = is_feed;
-}
-
AtomEntry *
atom_retrieve_entry (AtomCtx *ctx, AtomID *id)
{
*len = rlen;
}
-int
-atom_is_feed (AtomCtx *ctx, AtomID *id)
-{
- AtomBackend *backend;
- AtomError *aerr;
- backend = atom_backend (ctx);
- if (backend && backend->is_feed)
- {
- return backend->is_feed (ctx, id);
- }
- /* Frontend may make the decision of whether the requested resource is
- * a feed or not. If it is not able to do so and backend isn't either,
- * it is an error.
- */
- aerr = atom_error_new ();
- atom_error_code_set (aerr, 404);
- atom_error_message_set (aerr, "Not Found");
- atom_error_set (ctx, aerr);
- return 0;
-}
-
AtomFeed *
atom_retrieve_feed (AtomCtx *ctx)
{