typedef struct _atom_backend AtomBackend;
AtomBackend *atom_backend_new (void);
+void atom_backend_delete (AtomBackend *);
void atom_backend_retrieve_resource_set (AtomBackend *,
Atom * (AtomCtx *, IRI *));
Atom * atom_retrieve_resource (AtomCtx *, IRI *);
typedef struct _atom_ctx AtomCtx;
AtomCtx * atom_ctx_new (void);
+void atom_ctx_delete (AtomCtx *);
void * atom_config_data (AtomCtx *);
void atom_config_data_set (AtomCtx *, void *);
return backend;
}
+void
+atom_backend_delete (AtomBackend *backend)
+{
+ g_slice_free (AtomBackend, backend);
+}
+
void
atom_backend_retrieve_resource_set (AtomBackend *backend,
Atom *retrieve_resource (AtomCtx *,
ctx = g_slice_new (AtomCtx);
ctx->error = NULL;
ctx->config_data = NULL;
+ ctx->backend = NULL;
return ctx;
}
+void
+atom_ctx_delete (AtomCtx *ctx)
+{
+ if (ctx->error)
+ g_error_free (ctx->error);
+ if (ctx->backend)
+ atom_backend_delete (ctx->backend);
+ g_slice_free (AtomCtx, ctx);
+}
+
void
atom_error_set (AtomCtx *ctx, GError *error)
{
exit (1);
}
cgi_serve_request (ctx);
+ atom_ctx_delete (ctx);
return 0;
}