- if((LttvTime *)a->tv_sec > (LttvTime *)b->tv_sec) return 1;
- if((LttvTime *)a->tv_sec < (LttvTime *)b->tv_sec) return -1;
- if((LttvTime *)a->tv_nsec > (LttvTime *)b->tv_nsec) return 1;
- if((LttvTime *)a->tv_nsec < (LttvTime *)b->tv_nsec) return -1;
+ static GType type = 0;
+ if (type == 0) {
+ static const GTypeInfo info = {
+ sizeof (LttvTracefileContextClass),
+ NULL, /* base_init */
+ NULL, /* base_finalize */
+ (GClassInitFunc) tracefile_context_class_init, /* class_init */
+ NULL, /* class_finalize */
+ NULL, /* class_data */
+ sizeof (LttvTracefileContext),
+ 0, /* n_preallocs */
+ (GInstanceInitFunc) tracefile_context_instance_init /* instance_init */
+ };
+
+ type = g_type_register_static (G_TYPE_OBJECT, "LttvTracefileContextType",
+ &info, 0);
+ }
+ return type;
+}
+
+
+gint compare_tracefile(gconstpointer a, gconstpointer b)
+{
+ if(((LttvTime *)a)->tv_sec > ((LttvTime *)b)->tv_sec) return 1;
+ if(((LttvTime *)a)->tv_sec < ((LttvTime *)b)->tv_sec) return -1;
+ if(((LttvTime *)a)->tv_nsec > ((LttvTime *)b)->tv_nsec) return 1;
+ if(((LttvTime *)a)->tv_nsec < ((LttvTime *)b)->tv_nsec) return -1;