From d376deb02b02fd094a66f7b1495edade60257f95 Mon Sep 17 00:00:00 2001 From: bertrand Date: Thu, 16 Dec 1999 18:05:41 +0000 Subject: changed the return value. Now returns the list of expunged messages 1999-12-16 bertrand * 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 --- camel/camel-exception.c | 69 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 59 insertions(+), 10 deletions(-) (limited to 'camel/camel-exception.c') 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 #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) -- cgit v1.2.3