Added function to allocate a new context.
authorThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Sat, 26 Jan 2008 23:40:49 +0000 (21:40 -0200)
committerThadeu Lima de Souza Cascardo <cascardo@minaslivre.org>
Sat, 26 Jan 2008 23:40:49 +0000 (21:40 -0200)
include/atompub/ctx.h
src/ctx.c

index 338110e..5fef349 100644 (file)
@@ -22,6 +22,7 @@
 
 typedef struct _atom_ctx AtomCtx;
 
+AtomCtx * atom_ctx_new (void);
 void * atom_config_data (AtomCtx *);
 void atom_config_data_set (AtomCtx *, void *);
 
index 8d219f3..9b81a3b 100644 (file)
--- a/src/ctx.c
+++ b/src/ctx.c
@@ -27,6 +27,16 @@ struct _atom_ctx
   gpointer config_data;
 };
 
+AtomCtx *
+atom_ctx_new ()
+{
+  AtomCtx *ctx;
+  ctx = g_slice_new (AtomCtx);
+  ctx->error = NULL;
+  ctx->config_data = NULL;
+  return ctx;
+}
+
 void
 atom_error_set (AtomCtx *ctx, GError *error)
 {