diff --git a/ChangeLog b/ChangeLog index 57746487b..a418b0718 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-28 Matthias Clasen + + Bug 544465 – gmarkup makes it hard to use pre-rolled parsers + + * glib/glib.symbols: + * glib/gmarkup.[hc]: Add g_markup_context_get_user_data. + Patch by Ryan Lortie + 2008-07-28 Tor Lillqvist * glib-zip.in: Message catalogs should always get installed into diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index b28d39c9c..140238667 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +2008-07-28 Matthias Clasen + + * glib/glib-sections.txt: Add g_markup_context_get_user_data + 2008-07-28 Matthias Clasen * gio/gio-sections.txt: diff --git a/docs/reference/glib/glib-sections.txt b/docs/reference/glib/glib-sections.txt index 90f9899e5..d311664e5 100644 --- a/docs/reference/glib/glib-sections.txt +++ b/docs/reference/glib/glib-sections.txt @@ -1000,6 +1000,7 @@ g_markup_parse_context_free g_markup_parse_context_get_position g_markup_parse_context_get_element g_markup_parse_context_get_element_stack +g_markup_parse_context_get_user_data g_markup_parse_context_new g_markup_parse_context_parse g_markup_parse_context_push diff --git a/glib/glib.symbols b/glib/glib.symbols index d29d69224..73e2ae110 100644 --- a/glib/glib.symbols +++ b/glib/glib.symbols @@ -683,6 +683,7 @@ g_markup_parse_context_free g_markup_parse_context_get_element g_markup_parse_context_get_element_stack g_markup_parse_context_get_position +g_markup_parse_context_get_user_data g_markup_parse_context_new g_markup_parse_context_parse g_markup_parse_context_push diff --git a/glib/gmarkup.c b/glib/gmarkup.c index 363c57f9b..05cecd549 100644 --- a/glib/gmarkup.c +++ b/glib/gmarkup.c @@ -2019,6 +2019,26 @@ g_markup_parse_context_get_position (GMarkupParseContext *context, *char_number = context->char_number; } +/** + * g_markup_parse_context_get_user_data: + * @context: a #GMarkupParseContext + * + * Returns the user_data associated with @context. This will either + * be the user_data that was provided to g_markup_parse_context_new() + * or to the most recent call of g_markup_parse_context_push(). + * + * Returns: the provided user_data. The returned data belongs to + * the markup context and will be freed when g_markup_context_free() + * is called. + * + * Since: 2.18 + **/ +gpointer +g_markup_parse_context_get_user_data (GMarkupParseContext *context) +{ + return context->user_data; +} + /** * g_markup_parse_context_push: * @context: a #GMarkupParseContext diff --git a/glib/gmarkup.h b/glib/gmarkup.h index 56e87f455..d5fb15837 100644 --- a/glib/gmarkup.h +++ b/glib/gmarkup.h @@ -126,6 +126,7 @@ G_CONST_RETURN GSList *g_markup_parse_context_get_element_stack (GMarkupParseCon void g_markup_parse_context_get_position (GMarkupParseContext *context, gint *line_number, gint *char_number); +gpointer g_markup_parse_context_get_user_data (GMarkupParseContext *context); /* useful when saving */ gchar* g_markup_escape_text (const gchar *text,