From: Matthias Clasen Date: Mon, 15 Jul 2002 21:33:18 +0000 (+0000) Subject: New function to get the currently open element. (#70448) X-Git-Tag: R_2_0_core~55 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a064bd7952dbbe85bd1bb4aa98301d75a1478ce;p=platform%2Fupstream%2Fglib.git New function to get the currently open element. (#70448) * glib/gmarkup.h: * glib/gmarkup.c (g_markup_parse_context_get_element): New function to get the currently open element. (#70448) --- diff --git a/ChangeLog b/ChangeLog index f1d12fd..758f220 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f1d12fd..758f220 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/ChangeLog.pre-2-12 b/ChangeLog.pre-2-12 index f1d12fd..758f220 100644 --- a/ChangeLog.pre-2-12 +++ b/ChangeLog.pre-2-12 @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f1d12fd..758f220 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f1d12fd..758f220 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f1d12fd..758f220 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f1d12fd..758f220 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,9 @@ +2002-07-15 Matthias Clasen + + * glib/gmarkup.h: + * glib/gmarkup.c (g_markup_parse_context_get_element): New + function to get the currently open element. (#70448) + 2002-07-04 Sebastian Wilhelmi * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN diff --git a/glib/gmarkup.c b/glib/gmarkup.c index f7a2cbf..f0ff3d4 100644 --- a/glib/gmarkup.c +++ b/glib/gmarkup.c @@ -1706,6 +1706,24 @@ g_markup_parse_context_end_parse (GMarkupParseContext *context, } /** + * g_markup_parse_context_get_element: + * @context: a #GMarkupParseContext + * @returns: the name of the currently open element, or %NULL + * + * Retrieves the name of the currently open element. + **/ +G_CONST_RETURN gchar * +g_markup_parse_context_get_element (GMarkupParseContext *context) +{ + g_return_if_fail (context != NULL); + + if (context->tag_stack == NULL) + return NULL; + else + return current_element (context); +} + +/** * g_markup_parse_context_get_position: * @context: a #GMarkupParseContext * @line_number: return location for a line number, or %NULL diff --git a/glib/gmarkup.h b/glib/gmarkup.h index 2e533f2..5938d70 100644 --- a/glib/gmarkup.h +++ b/glib/gmarkup.h @@ -107,6 +107,7 @@ gboolean g_markup_parse_context_parse (GMarkupParseContext *context, gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context, GError **error); +G_CONST_RETURN gchar *g_markup_parse_context_get_element (GMarkupParseContext *context); /* For user-constructed error messages, has no precise semantics */ void g_markup_parse_context_get_position (GMarkupParseContext *context,