Create frontend structure with map_entries function
[cascardo/atompub.git] / atom / ctx.c
index a472dae..8519b31 100644 (file)
@@ -26,6 +26,7 @@ struct _atom_ctx
   AtomError *error;
   gpointer config_data;
   AtomBackend *backend;
+  AtomFrontend *frontend;
   GHashTable *bemap;
 };
 
@@ -37,6 +38,7 @@ atom_ctx_new ()
   ctx->error = NULL;
   ctx->config_data = NULL;
   ctx->backend = NULL;
+  ctx->frontend = NULL;
   ctx->bemap = g_hash_table_new_full (g_str_hash, g_str_equal,
                                       g_free, g_free);
   return ctx;
@@ -49,6 +51,8 @@ atom_ctx_delete (AtomCtx *ctx)
     atom_error_delete (ctx->error);
   if (ctx->backend)
     atom_backend_delete (ctx->backend);
+  if (ctx->frontend)
+    atom_frontend_delete (ctx->frontend);
   if (ctx->bemap)
     g_hash_table_destroy (ctx->bemap);
   g_slice_free (AtomCtx, ctx);
@@ -92,6 +96,18 @@ atom_backend_set (AtomCtx *ctx, AtomBackend *backend)
   ctx->backend = backend;
 }
 
+AtomFrontend *
+atom_frontend (AtomCtx *ctx)
+{
+  return ctx->frontend;
+}
+
+void
+atom_frontend_set (AtomCtx *ctx, AtomFrontend *frontend)
+{
+  ctx->frontend = frontend;
+}
+
 void
 atom_map_backend_requests (AtomCtx *ctx, char **reqs,
                            AtomEntry **entries, size_t len)