struct _atom_frontend
{
void (*map_entries) (AtomCtx *, char **, AtomEntry **, size_t);
+ int (*is_feed) (AtomCtx *, char *);
};
AtomFrontend *
AtomFrontend *frontend;
frontend = g_slice_new (AtomFrontend);
frontend->map_entries = NULL;
+ frontend->is_feed = NULL;
return frontend;
}
frontend->map_entries = map_entries;
}
+void
+atom_frontend_is_feed_set (AtomFrontend *frontend,
+ int is_feed (AtomCtx *, char *))
+{
+ frontend->is_feed = is_feed;
+}
+
void
atom_frontend_map_entries (AtomCtx *ctx, char ** reqs,
AtomEntry ** entries, size_t len)
frontend->map_entries (ctx, reqs, entries, len);
}
}
+
+int
+atom_is_feed (AtomCtx *ctx, char *req)
+{
+ AtomFrontend *frontend;
+ AtomError *aerr;
+ frontend = atom_frontend (ctx);
+ if (frontend && frontend->is_feed)
+ {
+ return frontend->is_feed (ctx, req);
+ }
+ /* If frontend cannot decide if a request is a feed, let's tell it's
+ * not. If the request mapping cannot be done, it will return a "Not
+ * Found" error anyway.
+ */
+ return 0;
+}