+
+
+/*
+ * A GFunc for g_queue_foreach()
+ *
+ * Args:
+ * data Point*, a convex hull point
+ * user_data GArray*, an array of convex hull point absisca values, as
+ * double
+ */
+static void gfAddAbsiscaToArray(gpointer data, gpointer user_data)
+{
+ Point* p= data;
+ GArray* a= user_data;
+ double v= p->x;
+
+ g_array_append_val(a, v);
+}
+
+
+/*
+ * A GCompareFunc for g_array_sort()
+ *
+ * Args:
+ * a, b double*, absisca values
+ *
+ * Returns:
+ * "returns less than zero for first arg is less than second arg, zero for
+ * equal, greater zero if first arg is greater than second arg"
+ * - the great glib documentation
+ */
+static gint gcfCompareDouble(gconstpointer a, gconstpointer b)
+{
+ if (*(double*) a < *(double*) b)
+ {
+ return -1;
+ }
+ else if (*(double*) a > *(double*) b)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}