aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-exception.c
diff options
context:
space:
mode:
authorBertrand Guiheneuf <bertrand@src.gnome.org>1999-12-27 17:25:21 +0800
committerBertrand Guiheneuf <bertrand@src.gnome.org>1999-12-27 17:25:21 +0800
commit23185a25463ccce06e1db8fd9babd4575629f39f (patch)
tree7e00b74451d86a78e6cfb65853d3fdefb12e9e52 /camel/camel-exception.c
parent9c84a9253936ded67c4ab3d8fb9a8b357a533411 (diff)
downloadgsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.tar
gsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.tar.gz
gsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.tar.bz2
gsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.tar.lz
gsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.tar.xz
gsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.tar.zst
gsoc2013-evolution-23185a25463ccce06e1db8fd9babd4575629f39f.zip
Backup sync.
svn path=/trunk/; revision=1520
Diffstat (limited to 'camel/camel-exception.c')
-rw-r--r--camel/camel-exception.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/camel/camel-exception.c b/camel/camel-exception.c
index 961034cd78..e385e6c8a0 100644
--- a/camel/camel-exception.c
+++ b/camel/camel-exception.c
@@ -126,6 +126,60 @@ camel_exception_set (CamelException *ex,
}
+/**
+ * camel_exception_setv: set an exception
+ * @ex: exception object
+ * @id: exception id
+ * @format: format of the description string. The format string is used as in printf().
+ *
+ * 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.
+ * In this version, the string is created from the format
+ * string and the variable argument list.
+ *
+ * When @ex is NULL, nothing is done, this routine
+ * simply returns.
+ *
+ **/
+void
+camel_exception_setv (CamelException *ex,
+ ExceptionId id,
+ const char *format,
+ ...)
+{
+ va_list args;
+ gchar *tmp_desc_string;
+
+
+ /* if no exception is given, do nothing */
+ if (!ex) return;
+
+
+ /* create the temporary exception string */
+ va_start(args, format);
+ tmp_desc_string = g_strdup_vprintf (format, args);
+ va_end (args);
+
+
+ /* now set the exception. We don't call
+ camel_exception_set because we want to
+ avoid a useless strdup () */
+ ex->id = id;
+
+ /* remove the previous exception description */
+ if (ex->desc)
+ g_free (ex->desc);
+ ex->desc = g_strdup (tmp_desc_string);
+
+}
+
+
+
+
+
+
/**
* camel_exception_xfer: transfer an exception