aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-exception.c
diff options
context:
space:
mode:
authorbertrand <Bertrand.Guiheneuf@aful.org>1999-12-17 02:05:41 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-12-17 02:05:41 +0800
commitd376deb02b02fd094a66f7b1495edade60257f95 (patch)
tree4181e3475385a599698dca1b3ab9500876c12d41 /camel/camel-exception.c
parent6bd8382bd68ada82117064bc3576c4b8374cfc04 (diff)
downloadgsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.tar
gsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.tar.gz
gsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.tar.bz2
gsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.tar.lz
gsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.tar.xz
gsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.tar.zst
gsoc2013-evolution-d376deb02b02fd094a66f7b1495edade60257f95.zip
changed the return value. Now returns the list of expunged messages
1999-12-16 bertrand <Bertrand.Guiheneuf@aful.org> * camel/camel-folder.c (camel_folder_expunge): (_expunge): * camel/camel-folder-pt-proxy.c (_expunge): changed the return value. Now returns the list of expunged messages * camel/camel-folder.c (_init_with_store): cleaned up. Use the exception system now. (_open): ditto. (camel_folder_open): ditto. (camel_folder_open_async): ditto. (_close): ditto. (camel_folder_close): ditto. (camel_folder_close_async): ditto. * camel/camel-exception.c (camel_exception_set): When no exception is given, do nothing, just return. (camel_exception_set): documented. (camel_exception_new): idem. (camel_exception_free): idem. (camel_exception_xfer): idem. * camel/camel-folder.c: * camel/camel-folder.h: more clean-ups. Removed message list related code. This was braindead design. svn path=/trunk/; revision=1494
Diffstat (limited to 'camel/camel-exception.c')
-rw-r--r--camel/camel-exception.c69
1 files changed, 59 insertions, 10 deletions
diff --git a/camel/camel-exception.c b/camel/camel-exception.c
index e16c152ff2..254b3046e9 100644
--- a/camel/camel-exception.c
+++ b/camel/camel-exception.c
@@ -27,18 +27,16 @@
#include <config.h>
#include "camel-exception.h"
-void
-camel_exception_free (CamelException *exception)
-{
- if (!exception) return;
-
- if (exception->desc)
- g_free (exception->desc);
-
- g_free (exception);
-}
+/**
+ * camel_exception_new: allocate a new exception object.
+ *
+ * Create and returns a new exception object.
+ *
+ *
+ * Return value: The newly allocated exception object.
+ **/
CamelException *
camel_exception_new ()
{
@@ -48,18 +46,69 @@ camel_exception_new ()
return ex;
}
+/**
+ * camel_exception_free: Free an exception
+ * @exception: The exception object to free
+ *
+ * Free an exception object. If the exception
+ * is NULL, nothing is done, the routine simply
+ * returns.
+ **/
+void
+camel_exception_free (CamelException *exception)
+{
+ if (!exception) return;
+
+ /* free the description text */
+ if (exception->desc)
+ g_free (exception->desc);
+ /* free the exeption itself */
+ g_free (exception);
+}
+/**
+ * camel_exception_set: set an exception
+ * @ex: exception object
+ * @id: exception id
+ * @desc: textual description of the exception
+ *
+ * Set the value of an exception. The exception id is
+ * a unique number representing the exception. The
+ * textual description is a small text explaining
+ * what happened and provoked the exception.
+ *
+ * When @ex is NULL, nothing is done, this routine
+ * simply returns.
+ *
+ **/
void
camel_exception_set (CamelException *ex,
ExceptionId id,
const char *desc)
{
+ /* if no exception is given, do nothing */
+ if (!ex) return;
+
ex->id = id;
+
+ /* remove the previous exception description */
if (ex->desc)
g_free (ex->desc);
ex->desc = g_strdup (desc);
}
+
+
+/**
+ * camel_exception_xfer: transfer an exception
+ * @ex_dst: Destination exception object
+ * @ex_src: Source exception object
+ *
+ * Transfer the content of an exception from
+ * an exception object to another.
+ * The destination exception receives the id and
+ * the description text of the source exception.
+ **/
void
camel_exception_xfer (CamelException *ex_dst,
CamelException *ex_src)