From: Thadeu Lima de Souza Cascardo Date: Mon, 13 Oct 2008 02:48:24 +0000 (-0300) Subject: Added get_request function to the frontend X-Git-Url: http://git.cascardo.eti.br/?p=cascardo%2Fatompub.git;a=commitdiff_plain;h=4a1a4691fe9acaa20428e19256f9ec6dc2485485 Added get_request function to the frontend --- diff --git a/atom/frontend.c b/atom/frontend.c index ed0faad..e530aa8 100644 --- a/atom/frontend.c +++ b/atom/frontend.c @@ -27,6 +27,7 @@ struct _atom_frontend { void (*map_entries) (AtomCtx *, char **, AtomEntry **, size_t); int (*is_feed) (AtomCtx *, char *); + AtomRequest * (*get_request) (AtomCtx *); }; AtomFrontend * @@ -36,6 +37,7 @@ atom_frontend_new () frontend = g_slice_new (AtomFrontend); frontend->map_entries = NULL; frontend->is_feed = NULL; + frontend->get_request = NULL; return frontend; } @@ -62,6 +64,13 @@ atom_frontend_is_feed_set (AtomFrontend *frontend, frontend->is_feed = is_feed; } +void +atom_frontend_get_request_set (AtomFrontend *frontend, + AtomRequest * get_request (AtomCtx *)) +{ + frontend->get_request = get_request; +} + void atom_frontend_map_entries (AtomCtx *ctx, char ** reqs, AtomEntry ** entries, size_t len) @@ -90,3 +99,15 @@ atom_is_feed (AtomCtx *ctx, char *req) */ return 0; } + +AtomRequest * +atom_get_request (AtomCtx *ctx) +{ + AtomFrontend *frontend; + frontend = atom_frontend (ctx); + if (frontend && frontend->get_request) + { + return frontend->get_request (ctx); + } + return NULL; +} diff --git a/include/atompub/frontend.h b/include/atompub/frontend.h index b04d8ec..e3b97d5 100644 --- a/include/atompub/frontend.h +++ b/include/atompub/frontend.h @@ -30,8 +30,11 @@ void atom_frontend_map_entries_set (AtomFrontend *, void (AtomCtx *, char **, AtomEntry **, size_t)); void atom_frontend_is_feed_set (AtomFrontend *, int (AtomCtx *, char *)); +void atom_frontend_get_request_set (AtomFrontend *, + AtomRequest * (AtomCtx *)); void atom_map_entries (AtomCtx *, char **, AtomEntry **, size_t); int atom_is_feed (AtomCtx *, char *); +AtomRequest * atom_get_request (AtomCtx *); AtomFrontend * atom_frontend (AtomCtx *); void atom_frontend_set (AtomCtx *, AtomFrontend *);