2007-11-07 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib.symbols:
+ * glib/gmarkup.[hc] (g_markup_parse_context_get_element_stack):
+ New function, to get the stack of open elements. (#452887,
+ Ryan Lortie)
+
+2007-11-07 Matthias Clasen <mclasen@redhat.com>
+
* glib/gkeyfile.[hc]: Make some functions that take
a GError return boolean instead of void. (#375651, Matt Barnes)
2007-11-07 Matthias Clasen <mclasen@redhat.com>
+ * glib/glib-sections.txt: Add g_markup_parse_context_get_element_stack
+2007-11-07 Matthias Clasen <mclasen@redhat.com>
+
* glib/building.sgml: Fix a typo
2007-11-07 Matthias Clasen <mclasen@redhat.com>
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_new
g_markup_parse_context_parse
<SUBSECTION Private>
g_markup_parse_context_end_parse
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_new
g_markup_parse_context_parse
*
* Retrieves the name of the currently open element.
*
+ * If called from the start_element or end_element handlers this will
+ * give the element_name as passed to those functions. For the parent
+ * elements, see g_markup_parse_context_get_element_stack().
+ *
* Since: 2.2
**/
G_CONST_RETURN gchar *
}
/**
+ * g_markup_parse_context_get_element_stack:
+ * @context: a #GMarkupParseContext
+ *
+ * Retrieves the element stack from the internal state of the parser.
+ * The returned #GSList is a list of strings where the first item is
+ * the currently open tag (as would be returned by
+ * g_markup_parse_context_get_element()) and the next item is its
+ * immediate parent.
+ *
+ * This function is intended to be used in the start_element and
+ * end_element handlers where g_markup_parse_context_get_element()
+ * would merely return the name of the element that is being
+ * processed.
+ *
+ * Returns: the element stack, which must not be modified
+ *
+ * Since 2.16
+ **/
+G_CONST_RETURN GSList *
+g_markup_parse_context_get_element_stack (GMarkupParseContext *context)
+{
+ g_return_val_if_fail (context != NULL, NULL);
+
+ return context->tag_stack;
+}
+
+/**
* g_markup_parse_context_get_position:
* @context: a #GMarkupParseContext
* @line_number: return location for a line number, or %NULL
gboolean g_markup_parse_context_end_parse (GMarkupParseContext *context,
GError **error);
G_CONST_RETURN gchar *g_markup_parse_context_get_element (GMarkupParseContext *context);
+G_CONST_RETURN GSList *g_markup_parse_context_get_element_stack (GMarkupParseContext *context);
/* For user-constructed error messages, has no precise semantics */
void g_markup_parse_context_get_position (GMarkupParseContext *context,