[tracker] docs: Various codestyle fixes



commit 1fbc06bfcc4b1f53494470493ac8bed5fc41ea8c
Author: Philip Van Hoof <philip codeminded be>
Date:   Thu Sep 16 17:39:53 2010 +0200

    docs: Various codestyle fixes

 docs/tools/ontology-graph.c                       |  557 ++++++++++-----------
 docs/tools/qname.c                                |   24 +-
 docs/tools/ttl2sgml.c                             |    8 +-
 docs/tools/ttl_loader.h                           |   12 +-
 docs/tools/ttl_model.c                            |   34 +-
 docs/tools/ttl_model.h                            |   12 +-
 src/libtracker-data/tracker-db-interface-sqlite.h |    2 +
 7 files changed, 321 insertions(+), 328 deletions(-)
---
diff --git a/docs/tools/ontology-graph.c b/docs/tools/ontology-graph.c
index 42f1830..99ae73a 100644
--- a/docs/tools/ontology-graph.c
+++ b/docs/tools/ontology-graph.c
@@ -46,26 +46,26 @@ static gint   indenting = 0;
 static GList *context = NULL;
 
 enum {
-        CONTEXT_GRAPH,
-        CONTEXT_SUBGRAPH,
-        CONTEXT_PROPERTY
+	CONTEXT_GRAPH,
+	CONTEXT_SUBGRAPH,
+	CONTEXT_PROPERTY
 };
 
-static gchar *colors[] = {
-        "#dd0000",
-        "#00dd00",
-        "#0000dd",
-        "#dd00dd",
-        "#dddd00",
-        "#00dddd",
-        "#dddddd"
-        "#bb0000",
-        "#00bb00",
-        "#0000bb",
-        "#bb00bb",
-        "#bbbb00",
-        "#00bbbb",
-        "#bbbbbb"
+static const gchar *colors[] = {
+	"#dd0000",
+	"#00dd00",
+	"#0000dd",
+	"#dd00dd",
+	"#dddd00",
+	"#00dddd",
+	"#dddddd"
+	"#bb0000",
+	"#00bb00",
+	"#0000bb",
+	"#bb00bb",
+	"#bbbb00",
+	"#00bbbb",
+	"#bbbbbb"
 };
 
 static GOptionEntry   entries[] = {
@@ -85,7 +85,7 @@ static void
 load_ontology_file_from_path (const gchar	 *ontology_file)
 {
 	TrackerTurtleReader *reader;
-	GError              *error = NULL;
+	GError *error = NULL;
 
 	reader = tracker_turtle_reader_new (ontology_file, &error);
 	if (error) {
@@ -299,80 +299,80 @@ load_ontology_file_from_path (const gchar	 *ontology_file)
 static void
 load_ontology_file (GFile *file)
 {
-        gchar *path;
+	gchar *path;
 
-        path = g_file_get_path (file);
-        load_ontology_file_from_path (path);
-        g_free (path);
+	path = g_file_get_path (file);
+	load_ontology_file_from_path (path);
+	g_free (path);
 }
 
 static gboolean
 load_ontology_dir (GFile *dir)
 {
-        GFileEnumerator *enumerator;
-        GFileInfo *info;
-        GList *files, *f;
-        const gchar *name;
-
-        enumerator = g_file_enumerate_children (dir,
-                                                G_FILE_ATTRIBUTE_STANDARD_NAME,
-                                                G_FILE_QUERY_INFO_NONE,
-                                                NULL, NULL);
-
-        if (!enumerator) {
-                return FALSE;
-        }
-
-        files = NULL;
+	GFileEnumerator *enumerator;
+	GFileInfo *info;
+	GList *files, *f;
+	const gchar *name;
+
+	enumerator = g_file_enumerate_children (dir,
+	                                        G_FILE_ATTRIBUTE_STANDARD_NAME,
+	                                        G_FILE_QUERY_INFO_NONE,
+	                                        NULL, NULL);
+	
+	if (!enumerator) {
+		return FALSE;
+	}
 
-        while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) {
-                name = g_file_info_get_name (info);
+	files = NULL;
+	
+	while ((info = g_file_enumerator_next_file (enumerator, NULL, NULL)) != NULL) {
+		name = g_file_info_get_name (info);
 
-                if (g_str_has_suffix (name, ".ontology")) {
-                        files = g_list_insert_sorted (files, g_strdup (name),
-                                                      (GCompareFunc) g_strcmp0);
-                }
+		if (g_str_has_suffix (name, ".ontology")) {
+			files = g_list_insert_sorted (files, g_strdup (name),
+			                              (GCompareFunc) g_strcmp0);
+		}
 
-                g_object_unref (info);
-        }
+		g_object_unref (info);
+	}
 
-        g_object_unref (enumerator);
+	g_object_unref (enumerator);
 
-        for (f = files; f; f = f->next) {
-                GFile *child;
+	for (f = files; f; f = f->next) {
+		GFile *child;
 
-                child = g_file_get_child (dir, f->data);
-                load_ontology_file (child);
-                g_object_unref (child);
-        }
+		child = g_file_get_child (dir, f->data);
+		load_ontology_file (child);
+		g_object_unref (child);
+	}
 
-        g_list_foreach (files, (GFunc) g_free, NULL);
-        g_list_free (files);
+	g_list_foreach (files, (GFunc) g_free, NULL);
+	g_list_free (files);
 
-        return TRUE;
+	return TRUE;
 }
 
 static const gchar *
 snip_name (const gchar *name)
 {
-        const gchar *subname;
+	const gchar *subname;
 
-        subname = strchr (name, ':');
-        subname++;
+	subname = strchr (name, ':');
+	subname++;
 
-        return subname;
+	return subname;
 }
 
 static gchar *
 get_prefix (const gchar *name)
 {
-        const gchar *str;
-        gchar *prefix;
+	const gchar *str;
+	gchar *prefix;
 
-        str = strchr (name, ':');
-        prefix = g_strndup (name, str - name);
+	str = strchr (name, ':');
+	prefix = g_strndup (name, str - name);
 
-        return prefix;
+	return prefix;
 }
 
 static void
@@ -380,17 +380,17 @@ print_string (FILE        *f,
               const gchar *format,
               ...)
 {
-        va_list args;
+	va_list args;
 
-        va_start (args, format);
-
-        if (indenting > 0) {
-                g_fprintf (f, "%*s", indenting, " ");
-        }
-        g_vfprintf (f, format, args);
-        g_fprintf (f, "\n");
+	va_start (args, format);
+	
+	if (indenting > 0) {
+		g_fprintf (f, "%*s", indenting, " ");
+	}
+	g_vfprintf (f, format, args);
+	g_fprintf (f, "\n");
 
-        va_end (args);
+	va_end (args);
 }
 
 static void
@@ -398,50 +398,49 @@ push_context_graph (FILE        *f,
                     const gchar *name,
                     gboolean     directed)
 {
-        if (directed) {
-                print_string (f, "digraph %s {", name);
-        } else {
-                print_string (f, "graph %s {", name);
-        }
-
-        indenting += 2;
-        context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_GRAPH));
+	if (directed) {
+		print_string (f, "digraph %s {", name);
+	} else {
+		print_string (f, "graph %s {", name);
+	}
+
+	indenting += 2;
+	context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_GRAPH));
 }
 
 static void
 push_context_subgraph (FILE        *f,
                        const gchar *name)
 {
-        print_string (f, "subgraph \"%s\" {", name);
-        indenting += 2;
-        context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_SUBGRAPH));
+	print_string (f, "subgraph \"%s\" {", name);
+	indenting += 2;
+	context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_SUBGRAPH));
 }
 
 static void
 pop_context (FILE *f)
 {
-        guint c;
-
-        g_assert (context != NULL);
-
-        c = GPOINTER_TO_INT (context->data);
-        context = g_list_remove (context, context);
-
-        indenting -= 2;
-        g_assert (indenting >= 0);
-
-        switch (c) {
-        case CONTEXT_GRAPH:
-        case CONTEXT_SUBGRAPH:
-                print_string (f, "}\n");
-                break;
-        case CONTEXT_PROPERTY:
-                print_string (f, "];\n");
-                break;
-        default:
-                g_assert_not_reached ();
-        }
-
+	guint c;
+
+	g_assert (context != NULL);
+
+	c = GPOINTER_TO_INT (context->data);
+	context = g_list_remove (context, context);
+
+	indenting -= 2;
+	g_assert (indenting >= 0);
+
+	switch (c) {
+	case CONTEXT_GRAPH:
+	case CONTEXT_SUBGRAPH:
+		print_string (f, "}\n");
+		break;
+	case CONTEXT_PROPERTY:
+		print_string (f, "];\n");
+		break;
+	default:
+		g_assert_not_reached ();
+	}
 }
 
 static void
@@ -449,22 +448,20 @@ print_properties (FILE        *f,
                   const gchar *separator,
                   ...)
 {
-        va_list args;
-        const gchar *prop, *value;
-
-        va_start (args, separator);
+	va_list args;
+	const gchar *prop, *value;
 
-        prop = va_arg (args, gchar *);
+	va_start (args, separator);
 
-        while (prop) {
-                value = va_arg (args, gchar *);
+	prop = va_arg (args, gchar *);
 
-                print_string (f, "%s = \"%s\"%s", prop, value, separator);
-
-                prop = va_arg (args, gchar *);
-        }
+	while (prop) {
+		value = va_arg (args, gchar *);
+		print_string (f, "%s = \"%s\"%s", prop, value, separator);
+		prop = va_arg (args, gchar *);
+	}
 
-        va_end (args);
+	va_end (args);
 }
 
 static void
@@ -472,13 +469,13 @@ print_element (FILE        *f,
                const gchar *name,
                gboolean     push_property)
 {
-        if (push_property) {
-                print_string (f, "%s [", name);
-                context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_PROPERTY));
-                indenting += 2;
-        } else {
-                print_string (f, "%s;", name);
-        }
+	if (push_property) {
+		print_string (f, "%s [", name);
+		context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_PROPERTY));
+		indenting += 2;
+	} else {
+		print_string (f, "%s;", name);
+	}
 }
 
 static void
@@ -488,168 +485,168 @@ print_relation (FILE        *f,
                 gboolean     directed,
                 gboolean     push_property)
 {
-        if (directed) {
-                if (push_property) {
-                        print_string (f, "%s -> %s [", from, to);
-                } else {
-                        print_string (f, "%s -> %s;", from, to);
-                }
-        } else {
-                if (push_property) {
-                        print_string (f, "%s -- %s [", from, to);
-                } else {
-                        print_string (f, "%s -- %s;", from, to);
-                }
-        }
-
-        if (push_property) {
-                context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_PROPERTY));
-                indenting += 2;
-        }
+	if (directed) {
+		if (push_property) {
+			print_string (f, "%s -> %s [", from, to);
+		} else {
+			print_string (f, "%s -> %s;", from, to);
+		}
+	} else {
+		if (push_property) {
+			print_string (f, "%s -- %s [", from, to);
+		} else {
+			print_string (f, "%s -- %s;", from, to);
+		}
+	}
+
+	if (push_property) {
+		context = g_list_prepend (context, GINT_TO_POINTER (CONTEXT_PROPERTY));
+		indenting += 2;
+	}
 }
 
 static void
 generate_class_info (FILE *f)
 {
-        TrackerClass **classes;
-        GHashTable *info;
-        guint length, i, j;
-        GHashTableIter iter;
-        gpointer key, value;
-        gint cur_color = 0;
-
-        info = g_hash_table_new_full (g_str_hash,
-                                      g_str_equal,
-                                      NULL, NULL);
-
-        classes = tracker_ontologies_get_classes (&length);
-
-        push_context_graph (f, "G", FALSE);
-
-        print_properties (f, ";",
-                          "size", "22,22",
-                          "shape", "record",
-                          "ratio", "1.0",
-                          "concentrate", "true",
-                          "compound", "true",
-                          "dim", "10",
-                          "rankdir", "LR",
-                          NULL);
-
-        for (i = 0; i < length; i++) {
-                const gchar *name;
-                TrackerClass **superclasses;
-                gchar *prefix;
-                GList *subgraph_elements;
-                gchar *elem_name, *elem_label;
-
-                name = snip_name (tracker_class_get_name (classes[i]));
-                prefix = get_prefix (tracker_class_get_name (classes[i]));
-                superclasses = tracker_class_get_super_classes (classes[i]);
-
-                subgraph_elements = g_hash_table_lookup (info, prefix);
-                subgraph_elements = g_list_prepend (subgraph_elements, (gpointer) name);
-                g_hash_table_replace (info, prefix, subgraph_elements);
-
-                elem_name = g_strdup_printf ("%s_%s", prefix, name);
-                elem_label = g_strdup_printf ("%s:%s", prefix, name);
-
-                print_element (f, elem_name, TRUE);
-
-                print_properties (f, ",",
-                                  "label", elem_label,
-                                  "style", "filled",
-                                  NULL);
-
-                pop_context (f);
-
-                g_free (elem_name);
-                g_free (elem_label);
-
-                for (j = 0; superclasses[j]; j++) {
-                        const gchar *super_name;
-                        gchar *super_prefix;
-                        gchar *from_name, *to_name;
-
-                        super_name = snip_name (tracker_class_get_name (superclasses[j]));
-                        super_prefix = get_prefix (tracker_class_get_name (superclasses[j]));
-
-                        from_name = g_strdup_printf ("%s_%s", prefix, name);
-                        to_name = g_strdup_printf ("%s_%s", super_prefix, super_name);
-
-                        print_relation (f, from_name, to_name, FALSE, TRUE);
-                        print_properties (f, ",", "dir", "forward", NULL);
-
-                        if (g_strcmp0 (prefix, super_prefix) != 0) {
-                                gchar *cluster_from, *cluster_to;
-
-                                cluster_from = g_strdup_printf ("cluster_%s", prefix);
-                                cluster_to = g_strdup_printf ("cluster_%s", super_prefix);
-
-                                print_properties (f, ",",
-                                                  "ltail", cluster_from,
-                                                  "lhead", cluster_to,
-                                                  NULL);
-
-                                g_free (cluster_from);
-                                g_free (cluster_to);
-                        }
+	TrackerClass **classes;
+	GHashTable *info;
+	guint length, i, j;
+	GHashTableIter iter;
+	gpointer key, value;
+	gint cur_color = 0;
+
+	info = g_hash_table_new_full (g_str_hash,
+	                              g_str_equal,
+	                              NULL, NULL);
+
+	classes = tracker_ontologies_get_classes (&length);
+
+	push_context_graph (f, "G", FALSE);
+
+	print_properties (f, ";",
+	                  "size", "22,22",
+	                  "shape", "record",
+	                  "ratio", "1.0",
+	                  "concentrate", "true",
+	                  "compound", "true",
+	                  "dim", "10",
+	                  "rankdir", "LR",
+	                  NULL);
+
+	for (i = 0; i < length; i++) {
+		const gchar *name;
+		TrackerClass **superclasses;
+		gchar *prefix;
+		GList *subgraph_elements;
+		gchar *elem_name, *elem_label;
+
+		name = snip_name (tracker_class_get_name (classes[i]));
+		prefix = get_prefix (tracker_class_get_name (classes[i]));
+		superclasses = tracker_class_get_super_classes (classes[i]);
+
+		subgraph_elements = g_hash_table_lookup (info, prefix);
+		subgraph_elements = g_list_prepend (subgraph_elements, (gpointer) name);
+		g_hash_table_replace (info, prefix, subgraph_elements);
+
+		elem_name = g_strdup_printf ("%s_%s", prefix, name);
+		elem_label = g_strdup_printf ("%s:%s", prefix, name);
+
+		print_element (f, elem_name, TRUE);
+
+		print_properties (f, ",",
+		                  "label", elem_label,
+		                  "style", "filled",
+		                  NULL);
+
+		pop_context (f);
+
+		g_free (elem_name);
+		g_free (elem_label);
+
+		for (j = 0; superclasses[j]; j++) {
+			const gchar *super_name;
+			gchar *super_prefix;
+			gchar *from_name, *to_name;
+
+			super_name = snip_name (tracker_class_get_name (superclasses[j]));
+			super_prefix = get_prefix (tracker_class_get_name (superclasses[j]));
+
+			from_name = g_strdup_printf ("%s_%s", prefix, name);
+			to_name = g_strdup_printf ("%s_%s", super_prefix, super_name);
+	
+			print_relation (f, from_name, to_name, FALSE, TRUE);
+			print_properties (f, ",", "dir", "forward", NULL);
+
+			if (g_strcmp0 (prefix, super_prefix) != 0) {
+				gchar *cluster_from, *cluster_to;
+	
+				cluster_from = g_strdup_printf ("cluster_%s", prefix);
+				cluster_to = g_strdup_printf ("cluster_%s", super_prefix);
+
+					print_properties (f, ",",
+					                  "ltail", cluster_from,
+					                  "lhead", cluster_to,
+					                  NULL);
+
+				g_free (cluster_from);
+				g_free (cluster_to);
+			}
 
-                        pop_context (f);
-                        g_free (super_prefix);
-                }
-        }
+			pop_context (f);
+			g_free (super_prefix);
+		}
+	}
 
-        g_hash_table_iter_init (&iter, info);
+	g_hash_table_iter_init (&iter, info);
 
-        while (g_hash_table_iter_next (&iter, &key, &value)) {
-                gchar *prefix = key;
-                gchar *subgraph_name, *subgraph_label;
-                GList *subgraph_elements = value;
+	while (g_hash_table_iter_next (&iter, &key, &value)) {
+		gchar *prefix = key;
+		gchar *subgraph_name, *subgraph_label;
+		GList *subgraph_elements = value;
 
-                subgraph_name = g_strdup_printf ("cluster_%s", prefix);
-                subgraph_label = g_strdup_printf ("%s ontology", prefix);
+		subgraph_name = g_strdup_printf ("cluster_%s", prefix);
+		subgraph_label = g_strdup_printf ("%s ontology", prefix);
 
-                push_context_subgraph (f, subgraph_name);
+		push_context_subgraph (f, subgraph_name);
 
-                print_properties (f, ";",
-                                  "label", subgraph_label,
-                                  "fontsize", "30",
-                                  "bgcolor", colors[cur_color],
-                                  NULL);
+		print_properties (f, ";",
+		                  "label", subgraph_label,
+		                  "fontsize", "30",
+		                  "bgcolor", colors[cur_color],
+		                  NULL);
 
-                while (subgraph_elements) {
-                        gchar *subelement_name;
+		while (subgraph_elements) {
+			gchar *subelement_name;
 
-                        subelement_name = g_strdup_printf ("%s_%s", prefix, (gchar *) subgraph_elements->data);
-                        print_element (f, subelement_name, FALSE);
-                        g_free (subelement_name);
+			subelement_name = g_strdup_printf ("%s_%s", prefix, (gchar *) subgraph_elements->data);
+			print_element (f, subelement_name, FALSE);
+			g_free (subelement_name);
 
-                        subgraph_elements = subgraph_elements->next;
-                }
+			subgraph_elements = subgraph_elements->next;
+		}
 
-                pop_context (f);
+		pop_context (f);
 
-                cur_color++;
+		cur_color++;
 
-                if (cur_color >= G_N_ELEMENTS (colors)) {
-                        cur_color = 0;
-                }
-        }
+		if (cur_color >= G_N_ELEMENTS (colors)) {
+				cur_color = 0;
+		}
+	}
 
-        g_hash_table_destroy (info);
+	g_hash_table_destroy (info);
 
-        pop_context (f);
+	pop_context (f);
 }
 
 int
 main (int argc, char *argv[])
 {
-        GOptionContext *context;
-        FILE *f = NULL;
-        GFile *dir;
+	GOptionContext *context;
+	FILE *f = NULL;
+	GFile *dir;
 
-        g_type_init ();
+	g_type_init ();
 
 	/* Translators: this messagge will apper immediately after the	*/
 	/* usage string - Usage: COMMAND [OPTION]... <THIS_MESSAGE>	*/
@@ -660,11 +657,11 @@ main (int argc, char *argv[])
 	g_option_context_add_main_entries (context, entries, NULL);
 	g_option_context_parse (context, &argc, &argv, NULL);
 
-        if (!ontology_dir) {
+	if (!ontology_dir) {
 		gchar *help;
 
 		g_printerr ("%s\n\n",
-			    "Ontology dir is mandatory");
+		            "Ontology dir is mandatory");
 
 		help = g_option_context_get_help (context, TRUE, NULL);
 		g_option_context_free (context);
@@ -672,26 +669,26 @@ main (int argc, char *argv[])
 		g_free (help);
 
 		return -1;
-        }
+	}
 
-        if (output_file) {
-                f = fopen (output_file, "w");
-        } else {
-                f = stdout;
-        }
-        g_assert (f != NULL);
+	if (output_file) {
+		f = fopen (output_file, "w");
+	} else {
+		f = stdout;
+	}
+	g_assert (f != NULL);
 
-        tracker_ontologies_init ();
+	tracker_ontologies_init ();
 
-        dir = g_file_new_for_commandline_arg (ontology_dir);
-        load_ontology_dir (dir);
-        g_object_unref (dir);
+	dir = g_file_new_for_commandline_arg (ontology_dir);
+	load_ontology_dir (dir);
+	g_object_unref (dir);
 
-        generate_class_info (f);
+	generate_class_info (f);
 
-        tracker_ontologies_shutdown ();
+	tracker_ontologies_shutdown ();
 
-        fclose (f);
+	fclose (f);
 
-        return 0;
+	return 0;
 }
diff --git a/docs/tools/qname.c b/docs/tools/qname.c
index 3711095..525e836 100644
--- a/docs/tools/qname.c
+++ b/docs/tools/qname.c
@@ -21,12 +21,12 @@
 #include <glib/gstdio.h>
 #include <string.h>
 
-//static gchar *local_uri = NULL;
-//static gchar *local_prefix = NULL;
+/* static gchar *local_uri = NULL;
+ * static gchar *local_prefix = NULL; */
 
 typedef struct {
-	gchar *namespace;
-	gchar *uri;
+	const gchar *namespace;
+	const gchar *uri;
 } Namespace;
 
 static GHashTable *class_deffile = NULL;
@@ -61,8 +61,9 @@ qname_init (const gchar *luri, const gchar *lprefix, const gchar *class_location
 
 	if (NAMESPACES[0].namespace || NAMESPACES[0].uri) {
 		g_warning ("Reinitializing qname_module");
-		g_free (NAMESPACES[0].namespace);
-		g_free (NAMESPACES[0].uri);
+		/* The strange casting is checked */
+		g_free ((gchar *) NAMESPACES[0].namespace);
+		g_free ((gchar *) NAMESPACES[0].uri);
 		if (class_deffile) {
 			g_hash_table_destroy (class_deffile);
 		}
@@ -90,11 +91,12 @@ qname_init (const gchar *luri, const gchar *lprefix, const gchar *class_location
 
 		lines = g_strsplit (raw_content, "\n", -1);
 		for (i = 0; lines[i] != NULL; i++) {
+			gchar **pieces = NULL;
+
 			if (strlen (lines[i]) < 1) {
 				continue;
 			}
 
-			gchar **pieces = NULL;
 
 			pieces = g_strsplit (lines[i], " ", -1);
 			g_assert (g_strv_length (pieces) == 2);
@@ -113,10 +115,11 @@ qname_init (const gchar *luri, const gchar *lprefix, const gchar *class_location
 void
 qname_shutdown (void)
 {
-	g_free (NAMESPACES[0].namespace);
+	/* The strange casting is checked */
+	g_free ((gchar*) NAMESPACES[0].namespace);
 	NAMESPACES[0].namespace = NULL;
 
-	g_free (NAMESPACES[0].uri);
+	g_free ((gchar*) NAMESPACES[0].uri);
 	NAMESPACES[0].uri = NULL;
 
 	if (class_deffile) {
@@ -231,6 +234,7 @@ qname_to_classname (const gchar *qname) {
 	classname = g_strdup (pieces[1]);
 	g_strfreev (pieces);
 	g_free (shortname);
+
 	return classname;
 }
 
@@ -238,11 +242,13 @@ gboolean
 qname_is_basic_type (const gchar *qname)
 {
 	gint i;
+
 	/* dc: or xsd: are basic types */
 	for (i = 1; NAMESPACES[i].namespace != NULL && i < 3; i++) {
 		if (g_str_has_prefix (qname, NAMESPACES[i].uri)) {
 			return TRUE;
 		}
 	}
+
 	return FALSE;
 }
diff --git a/docs/tools/ttl2sgml.c b/docs/tools/ttl2sgml.c
index 50d4500..898d75c 100644
--- a/docs/tools/ttl2sgml.c
+++ b/docs/tools/ttl2sgml.c
@@ -59,7 +59,7 @@ main (gint argc, gchar **argv)
 	gchar *ttl_file = NULL;
 	gchar *dirname = NULL;
 	FILE *f = NULL;
-        FILE *fts = NULL;
+	FILE *fts = NULL;
 
 	g_type_init ();
 
@@ -93,9 +93,9 @@ main (gint argc, gchar **argv)
 	}
 	g_assert (f != NULL);
 
-        if (fts_properties_file) {
+	if (fts_properties_file) {
 		fts = fopen (fts_properties_file, "a");
-        } 
+	} 
 
 	description = ttl_loader_load_description (desc_file);
 
@@ -116,7 +116,7 @@ main (gint argc, gchar **argv)
 	g_option_context_free (context);
 
 	fclose (f);
-        fclose (fts);
+	fclose (fts);
 
 	return 0;
 }
diff --git a/docs/tools/ttl_loader.h b/docs/tools/ttl_loader.h
index c703980..72fcb1e 100644
--- a/docs/tools/ttl_loader.h
+++ b/docs/tools/ttl_loader.h
@@ -25,14 +25,14 @@
 
 G_BEGIN_DECLS
 
-void      ttl_loader_init (void);
-void      ttl_loader_shutdown (void);
+void                  ttl_loader_init             (void);
+void                  ttl_loader_shutdown         (void);
 
-Ontology    *ttl_loader_load_ontology (const gchar *filename);
-OntologyDescription *ttl_loader_load_description (const gchar *filename);
+Ontology            * ttl_loader_load_ontology    (const gchar *filename);
+OntologyDescription * ttl_loader_load_description (const gchar *filename);
 
-void      ttl_loader_free_ontology (Ontology *ontology);
-void      ttl_loader_free_description (OntologyDescription *desc);
+void                  ttl_loader_free_ontology    (Ontology *ontology);
+void                  ttl_loader_free_description (OntologyDescription *desc);
 
 
 G_END_DECLS
diff --git a/docs/tools/ttl_model.c b/docs/tools/ttl_model.c
index ee8a07b..ec95928 100644
--- a/docs/tools/ttl_model.c
+++ b/docs/tools/ttl_model.c
@@ -35,24 +35,22 @@ ttl_model_class_new (const gchar *classname)
 	def->instances = NULL;
 	def->notify = FALSE;
 	def->deprecated = FALSE;
+
 	return def;
 }
 
 void
 ttl_model_class_free (OntologyClass *def)
 {
-	if (def->classname) {
-		g_free (def->classname);
-	}
+	g_free (def->classname);
 
 	g_list_foreach (def->superclasses, (GFunc) g_free, NULL);
 	g_list_foreach (def->subclasses, (GFunc) g_free, NULL);
 	g_list_foreach (def->in_domain_of, (GFunc) g_free, NULL);
 	g_list_foreach (def->in_range_of, (GFunc) g_free, NULL);
 
-	if (def->description) {
-		g_free (def->description);
-	}
+	g_free (def->description);
+
 	g_list_foreach (def->instances, (GFunc) g_free, NULL);
 
 	g_free (def);
@@ -74,17 +72,16 @@ ttl_model_property_new (const gchar *propname)
 	prop->max_cardinality = NULL;
 	prop->description = NULL;
 	prop->deprecated = FALSE;
-        prop->fulltextIndexed = FALSE ;
-        prop->weight = NULL;
+	prop->fulltextIndexed = FALSE ;
+	prop->weight = NULL;
+
 	return prop;
 }
 
 void
 ttl_model_property_free (OntologyProperty *def)
 {
-	if (def->propertyname) {
-		g_free (def->propertyname);
-	}
+	g_free (def->propertyname);
 
 	g_list_foreach (def->type, (GFunc) g_free, NULL);
 	g_list_foreach (def->domain, (GFunc) g_free, NULL);
@@ -92,18 +89,9 @@ ttl_model_property_free (OntologyProperty *def)
 	g_list_foreach (def->superproperties, (GFunc) g_free, NULL);
 	g_list_foreach (def->subproperties, (GFunc) g_free, NULL);
 
-	if (def->max_cardinality) {
-		g_free (def->max_cardinality);
-	}
-
-	if (def->description) {
-		g_free (def->description);
-	}
-
-        if (def->weight) {
-                g_free (def->weight);
-        }
-
+	g_free (def->max_cardinality);
+	g_free (def->description);
+	g_free (def->weight);
 	g_free (def);
 }
 
diff --git a/docs/tools/ttl_model.h b/docs/tools/ttl_model.h
index f777959..219c607 100644
--- a/docs/tools/ttl_model.h
+++ b/docs/tools/ttl_model.h
@@ -70,14 +70,14 @@ typedef struct {
 } Ontology;
 
 
-OntologyClass * ttl_model_class_new (const gchar *classname);
-void            ttl_model_class_free (OntologyClass *klass);
+OntologyClass *       ttl_model_class_new        (const gchar *classname);
+void                  ttl_model_class_free       (OntologyClass *klass);
 
-OntologyDescription *ttl_model_description_new (void);
-void                 ttl_model_description_free (OntologyDescription *desc);
+OntologyDescription * ttl_model_description_new  (void);
+void                  ttl_model_description_free (OntologyDescription *desc);
 
-OntologyProperty *ttl_model_property_new (const gchar *propname);
-void              ttl_model_property_free (OntologyProperty *property);
+OntologyProperty *    ttl_model_property_new     (const gchar *propname);
+void                  ttl_model_property_free    (OntologyProperty *property);
 
 G_END_DECLS
 
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.h b/src/libtracker-data/tracker-db-interface-sqlite.h
index cf8741e..071a1b9 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.h
+++ b/src/libtracker-data/tracker-db-interface-sqlite.h
@@ -20,6 +20,8 @@
 #ifndef __LIBTRACKER_DB_INTERFACE_SQLITE_H__
 #define __LIBTRACKER_DB_INTERFACE_SQLITE_H__
 
+#include "config.h"
+
 #include "tracker-db-interface.h"
 
 G_BEGIN_DECLS



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]