New function to get the currently open element. (#70448)
authorMatthias Clasen <matthiasc@src.gnome.org>
Mon, 15 Jul 2002 21:33:18 +0000 (21:33 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Mon, 15 Jul 2002 21:33:18 +0000 (21:33 +0000)
* glib/gmarkup.h:
* glib/gmarkup.c (g_markup_parse_context_get_element): New
function to get the currently open element.  (#70448)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-12
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
glib/gmarkup.c
glib/gmarkup.h

index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f1d12fd430937651642610f00d6f43c3b9672743..758f220ce85bf14d1c7c47f29c9ff2e492b25cf9 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-15  Matthias Clasen  <maclas@gmx.de>
+
+       * 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  <wilhelmi@ira.uka.de>
 
        * tests/*.c: Added #undef G_DISABLE_ASSERT and #undef G_LOG_DOMAIN
index f7a2cbf48e8c9ea3cdb305c35abefc9052650338..f0ff3d457817c75c977d0d10e6731fd1791dbda6 100644 (file)
@@ -1705,6 +1705,24 @@ g_markup_parse_context_end_parse (GMarkupParseContext *context,
   return context->state != STATE_ERROR;
 }
 
+/**
+ * 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
index 2e533f24cfd8d802189f0d298a82a348231dfe7f..5938d703992c6b8f99a6855af6453c91b1e021eb 100644 (file)
@@ -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,