mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-31 21:03:10 +02:00
parent
cc8adfaeb8
commit
9c50d657e5
@ -1,3 +1,10 @@
|
|||||||
|
2008-06-16 Christian Persch <chpe@gnome.org>
|
||||||
|
|
||||||
|
* docs/reference/glib/glib-sections.txt:
|
||||||
|
* glib/gerror.c:
|
||||||
|
* glib/gerror.h:
|
||||||
|
* glib/glib.symbols: Add g_set_error_literal. Bug #535947.
|
||||||
|
|
||||||
2008-06-16 Michael Natterer <mitch@imendio.com>
|
2008-06-16 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
* glib/goption.c (dgettext_swapped): changed return value to
|
* glib/goption.c (dgettext_swapped): changed return value to
|
||||||
|
@ -386,6 +386,7 @@ g_error_free
|
|||||||
g_error_copy
|
g_error_copy
|
||||||
g_error_matches
|
g_error_matches
|
||||||
g_set_error
|
g_set_error
|
||||||
|
g_set_error_literal
|
||||||
g_propagate_error
|
g_propagate_error
|
||||||
g_clear_error
|
g_clear_error
|
||||||
g_prefix_error
|
g_prefix_error
|
||||||
|
@ -211,6 +211,37 @@ g_set_error (GError **err,
|
|||||||
g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
|
g_warning (ERROR_OVERWRITTEN_WARNING, new->message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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:
|
* g_propagate_error:
|
||||||
* @dest: error return location
|
* @dest: error return location
|
||||||
|
@ -63,6 +63,11 @@ void g_set_error (GError **err,
|
|||||||
const gchar *format,
|
const gchar *format,
|
||||||
...) G_GNUC_PRINTF (4, 5);
|
...) 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.
|
/* if (dest) *dest = src; also has some sanity checks.
|
||||||
*/
|
*/
|
||||||
void g_propagate_error (GError **dest,
|
void g_propagate_error (GError **dest,
|
||||||
|
@ -336,6 +336,7 @@ g_error_new G_GNUC_PRINTF(3,4)
|
|||||||
g_error_new_literal
|
g_error_new_literal
|
||||||
g_propagate_error
|
g_propagate_error
|
||||||
g_set_error G_GNUC_PRINTF(4,5)
|
g_set_error G_GNUC_PRINTF(4,5)
|
||||||
|
g_set_error_literal
|
||||||
g_prefix_error G_GNUC_PRINTF(2,3)
|
g_prefix_error G_GNUC_PRINTF(2,3)
|
||||||
g_propagate_prefixed_error G_GNUC_PRINTF(3,4)
|
g_propagate_prefixed_error G_GNUC_PRINTF(3,4)
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user