From bf9f54f9615c1b7b5c8ce5c434d0f78a99f5845b Mon Sep 17 00:00:00 2001 From: bertrand Date: Wed, 13 Oct 1999 21:16:55 +0000 Subject: A lot of changes. The thread proxy mechanism is now functional. The signal proxy needs to be tested though. The thread proxy folder is being implemented. A rough summary : 1999-10-13 bertrand * camel/camel-folder.c (camel_folder_close): the folder->close method is now asynchronous. * camel/camel-folder-pt-proxy.c (_folder_open_cb): (_open): (_folder_open_cb): (_open): open/close method implemented in the thread proxy folder. More to come. * camel/camel-exception.c (camel_exception_xfer): new utility func. * camel/camel-marshal-utils.c: some new marshallers * camel/camel-folder-pt-proxy.c: Some explanations on the thread proxy system. 1999-10-11 bertrand * camel/camel-marshal-utils.c: camel/camel-marshal-utils.h: Handles operation marshalling. * camel/camel-thread-proxy.c: camel/camel-thread-proxy.h: new files. Generic proxy system. * camel/camel-folder-pt-proxy.c moved all proxy related code in dedicated files. (camel_folder_pt_proxy_init): removed proxy initialisation code (_finalize): removed proxy finalization code * camel/camel-exception.c (camel_exception_new): (camel_exception_set): (camel_exception_free): New funcs. svn path=/trunk/; revision=1328 --- camel/camel-exception.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'camel/camel-exception.c') diff --git a/camel/camel-exception.c b/camel/camel-exception.c index 47261945d5..8b8c70fa10 100644 --- a/camel/camel-exception.c +++ b/camel/camel-exception.c @@ -24,3 +24,49 @@ #include #include "camel-exception.h" +void +camel_exception_free (CamelException *exception) +{ + if (!exception) return; + + if (exception->desc) + g_free (exception->desc); + + g_free (exception); +} + + +CamelException * +camel_exception_new () +{ + CamelException *ex; + + ex = g_new (CamelException, 1); + return ex; +} + + +void +camel_exception_set (CamelException *ex, + ExceptionId id, + const char *desc) +{ + ex->id = id; + if (ex->desc) + g_free (ex->desc); + ex->desc = g_strdup (desc); +} + +void +camel_exception_xfer (CamelException *ex_dst, + CamelException *ex_src) +{ + if (ex_dst->desc) + g_free (ex_dst->desc); + + ex_dst->id = ex_src->id; + ex_dst->desc = ex_src->desc; + + ex_src->desc = NULL; + ex_src->id = CAMEL_EXCEPTION_NONE; +} -- cgit