From 9fb777241de2aa55d0798622330eea46ecda3814 Mon Sep 17 00:00:00 2001 From: Thadeu Lima de Souza Cascardo Date: Sat, 26 Jan 2008 21:53:32 -0200 Subject: [PATCH] Get context error support. --- include/atompub/error.h | 1 + src/ctx.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/include/atompub/error.h b/include/atompub/error.h index 79614b7..48bb429 100644 --- a/include/atompub/error.h +++ b/include/atompub/error.h @@ -23,6 +23,7 @@ #include #include +GError *atom_error_get (AtomCtx *); void atom_error_set (AtomCtx *, GError *); #endif diff --git a/src/ctx.c b/src/ctx.c index 9b81a3b..7289ab3 100644 --- a/src/ctx.c +++ b/src/ctx.c @@ -40,9 +40,17 @@ atom_ctx_new () void atom_error_set (AtomCtx *ctx, GError *error) { + if (ctx->error) + g_error_free (ctx->error); ctx->error = error; } +GError * +atom_error_get (AtomCtx *ctx) +{ + return ctx->error; +} + void * atom_config_data (AtomCtx *ctx) { -- 2.20.1