glib r7050 - in trunk: . docs/reference/glib glib
- From: chpe svn gnome org
- To: svn-commits-list gnome org
- Subject: glib r7050 - in trunk: . docs/reference/glib glib
- Date: Mon, 16 Jun 2008 16:41:02 +0000 (UTC)
Author: chpe
Date: Mon Jun 16 16:41:01 2008
New Revision: 7050
URL: http://svn.gnome.org/viewvc/glib?rev=7050&view=rev
Log:
Add g_set_error_literal. Bug #535947.
Modified:
trunk/ChangeLog
trunk/docs/reference/glib/glib-sections.txt
trunk/glib/gerror.c
trunk/glib/gerror.h
trunk/glib/glib.symbols
Modified: trunk/docs/reference/glib/glib-sections.txt
==============================================================================
--- trunk/docs/reference/glib/glib-sections.txt (original)
+++ trunk/docs/reference/glib/glib-sections.txt Mon Jun 16 16:41:01 2008
@@ -386,6 +386,7 @@
g_error_copy
g_error_matches
g_set_error
+g_set_error_literal
g_propagate_error
g_clear_error
g_prefix_error
Modified: trunk/glib/gerror.c
==============================================================================
--- trunk/glib/gerror.c (original)
+++ trunk/glib/gerror.c Mon Jun 16 16:41:01 2008
@@ -212,6 +212,37 @@
}
/**
+ * g_set_error_literal:
+ * @err: a return location for a #GError, or %NULL
+ * @domain: error domain
+ * @code: error code
+ * @message: error message
+ *
+ * Does nothing if @err is %NULL; if @err is non-%NULL, then * err must
+ * be %NULL. A new #GError is created and assigned to * err
+ * Unlike g_set_error(), @message is not a printf()-style format string.
+ * Use this function if @message contains text you don't have control over,
+ * that could include printf() escape sequences.
+ **/
+void
+g_set_error_literal (GError **err,
+ GQuark domain,
+ gint code,
+ const gchar *message)
+{
+ GError *new;
+
+ if (err == NULL)
+ return;
+
+ new = g_error_new_literal (domain, code, message);
+ if (*err == NULL)
+ *err = new;
+ else
+ g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
+}
+
+/**
* g_propagate_error:
* @dest: error return location
* @src: error to move into the return location
Modified: trunk/glib/gerror.h
==============================================================================
--- trunk/glib/gerror.h (original)
+++ trunk/glib/gerror.h Mon Jun 16 16:41:01 2008
@@ -63,6 +63,11 @@
const gchar *format,
...) G_GNUC_PRINTF (4, 5);
+void g_set_error_literal (GError **err,
+ GQuark domain,
+ gint code,
+ const gchar *message);
+
/* if (dest) *dest = src; also has some sanity checks.
*/
void g_propagate_error (GError **dest,
Modified: trunk/glib/glib.symbols
==============================================================================
--- trunk/glib/glib.symbols (original)
+++ trunk/glib/glib.symbols Mon Jun 16 16:41:01 2008
@@ -336,6 +336,7 @@
g_error_new_literal
g_propagate_error
g_set_error G_GNUC_PRINTF(4,5)
+g_set_error_literal
g_prefix_error G_GNUC_PRINTF(2,3)
g_propagate_prefixed_error G_GNUC_PRINTF(3,4)
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]