summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-08-05 02:20:50 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-08-05 02:20:50 +0100
commit74c8476b7aae5d936a72e70d7ce1f61f2c14fa27 (patch)
tree2c81bdc8d64c18caf995d380db8c61c8d5eded8c
parent1f8914bdd3536d63d785aa5e8dbba725e4cad624 (diff)
gstdoc-scangobj: output $MODULE.hierarchy sorted alphabetically
Sort hierarchy of types in alphabetical order, so it doesn't change all the time.
-rwxr-xr-xgstdoc-scangobj8
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);
}