[gst-cvs] common: gstdoc-scangobj: output $MODULE.hierarchy sorted alphabetically

Tim Müller tpm at kemper.freedesktop.org
Thu Aug 5 01:05:34 PDT 2010


Module: common
Branch: master
Commit: 74c8476b7aae5d936a72e70d7ce1f61f2c14fa27
URL:    http://cgit.freedesktop.org/gstreamer/common/commit/?id=74c8476b7aae5d936a72e70d7ce1f61f2c14fa27

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Thu Aug  5 02:20:50 2010 +0100

gstdoc-scangobj: output $MODULE.hierarchy sorted alphabetically

Sort hierarchy of types in alphabetical order, so it doesn't
change all the time.

---

 gstdoc-scangobj |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/gstdoc-scangobj b/gstdoc-scangobj
index cc1e294..3b669f0 100755
--- a/gstdoc-scangobj
+++ b/gstdoc-scangobj
@@ -1023,6 +1023,12 @@ output_object_hierarchy (void)
   fclose (fp);
 }
 
+static int
+type_cmp (const void * p1, const void * p2)
+{
+  return strcmp (g_type_name (*((GType *) p1)), g_type_name (*((GType *) p2)));
+}
+
 /* This is called recursively to output the hierarchy of a widget. */
 static void
 output_hierarchy (FILE  *fp,
@@ -1054,6 +1060,8 @@ output_hierarchy (FILE  *fp,
 
   children = g_type_children (type, &n_children);
 
+  qsort (&children[0], n_children, sizeof (GType), type_cmp);
+
   for (i=0; i < n_children; i++) {
     output_hierarchy (fp, children[i], level + 1);
   }





More information about the Gstreamer-commits mailing list