Commit 65cad5c9 authored by Sam Thursfield's avatar Sam Thursfield Committed by Carlos Garnacho

libtracker-sparql: Don't use 'namespace' as a parameter name

This header was unusable from C++ code as 'namespace' is a reserved
keyword there.

Based on a patch by Santtu Lakkala from
https://bugzilla.gnome.org/show_bug.cgi?id=791510
parent b7b6aea5
......@@ -211,7 +211,7 @@ tracker_namespace_manager_lookup_prefix (TrackerNamespaceManager *self,
* tracker_namespace_manager_add_prefix:
* @self: a #TrackerNamespaceManager
* @prefix: a short, unique prefix to identify @namespace
* @namespace: the URL of the given namespace
* @ns: the URL of the given namespace
*
* Adds @prefix as the recognised abbreviaton of @namespace.
*
......@@ -223,14 +223,14 @@ tracker_namespace_manager_lookup_prefix (TrackerNamespaceManager *self,
void
tracker_namespace_manager_add_prefix (TrackerNamespaceManager *self,
const char *prefix,
const char *namespace)
const char *ns)
{
TrackerNamespaceManagerPrivate *priv;
const char *str;
g_return_if_fail (TRACKER_IS_NAMESPACE_MANAGER (self));
g_return_if_fail (prefix != NULL);
g_return_if_fail (namespace != NULL);
g_return_if_fail (ns != NULL);
priv = GET_PRIVATE (TRACKER_NAMESPACE_MANAGER (self));
......@@ -245,14 +245,14 @@ tracker_namespace_manager_add_prefix (TrackerNamespaceManager *self,
return;
}
str = g_hash_table_lookup (priv->namespace_to_prefix, namespace);
str = g_hash_table_lookup (priv->namespace_to_prefix, ns);
if (str) {
g_error ("Namespace %s already has prefix %s", namespace, str);
g_error ("Namespace %s already has prefix %s", ns, str);
return;
}
g_hash_table_insert (priv->prefix_to_namespace, g_strdup (prefix), g_strdup (namespace));
g_hash_table_insert (priv->namespace_to_prefix, g_strdup (namespace), g_strdup (prefix));
g_hash_table_insert (priv->prefix_to_namespace, g_strdup (prefix), g_strdup (ns));
g_hash_table_insert (priv->namespace_to_prefix, g_strdup (ns), g_strdup (prefix));
}
/**
......
......@@ -39,7 +39,7 @@ char *tracker_namespace_manager_expand_uri (TrackerNamespaceManager *self, const
gboolean tracker_namespace_manager_has_prefix (TrackerNamespaceManager *self, const char *prefix);
const char *tracker_namespace_manager_lookup_prefix (TrackerNamespaceManager *self, const char *prefix);
void tracker_namespace_manager_add_prefix (TrackerNamespaceManager *self, const char *prefix, const char *namespace);
void tracker_namespace_manager_add_prefix (TrackerNamespaceManager *self, const char *prefix, const char *ns);
char *tracker_namespace_manager_print_turtle (TrackerNamespaceManager *self);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment