diff options
author | bertrand <Bertrand.Guiheneuf@aful.org> | 1999-12-18 03:19:59 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 1999-12-18 03:19:59 +0800 |
commit | 0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82 (patch) | |
tree | 81e907bd7f2cedeabfebecb28d12024ff2d6c513 /camel/camel-exception.c | |
parent | e69ca1a88ce35fb744a0b4233dc5305eaa145d2f (diff) | |
download | gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.tar gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.tar.gz gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.tar.bz2 gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.tar.lz gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.tar.xz gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.tar.zst gsoc2013-evolution-0c6cc80cdf8c85ee86b588c1d49d5cbd4fbe5e82.zip |
use exception mechanism. (camel_folder_set_name): idem.
1999-12-17 bertrand <Bertrand.Guiheneuf@aful.org>
* camel/camel-folder.c (_set_name):
use exception mechanism.
(camel_folder_set_name): idem.
(camel_folder_set_full_name): idem.
(_get_name): idem.
(camel_folder_get_name): idem.
(_get_full_name): idem.
(camel_folder_get_full_name): idem.
(_can_hold_folders): idem.
(_can_hold_messages): idem.
(_exists): idem.
(camel_folder_exists): idem.
(_is_open): idem.
(_get_subfolder): idem.
(camel_folder_get_subfolder): idem.
* camel/camel-exception.c (camel_exception_clear):
New function. Clear an exception.
(camel_exception_get_id):
New function.
(camel_exception_get_description):
New function.
* camel/camel-folder.c (_set_name):
Use the exception system. When the folder
has no parent, don't set its full name
field.
svn path=/trunk/; revision=1499
Diffstat (limited to 'camel/camel-exception.c')
-rw-r--r-- | camel/camel-exception.c | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/camel/camel-exception.c b/camel/camel-exception.c index 254b3046e9..961034cd78 100644 --- a/camel/camel-exception.c +++ b/camel/camel-exception.c @@ -46,6 +46,34 @@ camel_exception_new () return ex; } + +/** + * camel_exception_clear: Clear an exception + * @exception: the exception object + * + * Clear an exception, that is, set the + * exception ID to CAMEL_EXCEPTION_NONE and + * free the description text. + * If the exception is NULL, this funtion just + * returns. + **/ +void +camel_exception_clear (CamelException *exception) +{ + if (!exception) return; + + /* free the description text */ + if (exception->desc) + g_free (exception->desc); + exception->desc = NULL; + + /* set the Exception Id to NULL */ + exception->id = CAMEL_EXCEPTION_NONE; +} + + + + /** * camel_exception_free: Free an exception * @exception: The exception object to free @@ -122,3 +150,49 @@ camel_exception_xfer (CamelException *ex_dst, ex_src->desc = NULL; ex_src->id = CAMEL_EXCEPTION_NONE; } + + + + + + + +/** + * camel_exception_get_id: get the exception id + * @ex: The exception object + * + * Return the id of an exception. + * If @ex is NULL, return CAMEL_EXCEPTION_NONE; + * + * Return value: Exception ID. + **/ +ExceptionId +camel_exception_get_id (CamelException *ex) +{ + if (ex) + return ex->id; + else + return CAMEL_EXCEPTION_NONE; +} + + + + +/** + * camel_exception_get_description: get the description of an exception. + * @ex: The exception object + * + * Return the exception description text. + * If @ex is NULL, return NULL; + * + * + * Return value: Exception description text. + **/ +const gchar * +camel_exception_get_description (CamelException *ex) +{ + if (ex) + return ex->desc; + else + return NULL; +} |