[Xfce4-commits] <midori:master> Remove unused katze_collfold and katze_utf8_stristr
Christian Dywan
noreply at xfce.org
Sat Sep 18 02:00:03 CEST 2010
Updating branch refs/heads/master
to 016b6a6306e0756acce3c88235735dfbac13263a (commit)
from d0e2433f867938145e0f7694a9e3a36c869ce9ca (commit)
commit 016b6a6306e0756acce3c88235735dfbac13263a
Author: Christian Dywan <christian at twotoasts.de>
Date: Sat Sep 18 01:48:55 2010 +0200
Remove unused katze_collfold and katze_utf8_stristr
katze/katze-utils.c | 92 ---------------------------------------------------
katze/katze-utils.h | 7 ----
2 files changed, 0 insertions(+), 99 deletions(-)
diff --git a/katze/katze-utils.c b/katze/katze-utils.c
index 5d12592..134a7d8 100644
--- a/katze/katze-utils.c
+++ b/katze/katze-utils.c
@@ -1539,95 +1539,3 @@ katze_load_cached_icon (const gchar* uri,
GTK_STOCK_FILE, GTK_ICON_SIZE_MENU, NULL);
}
-/**
- * katze_collfold:
- * @str: a non-NULL UTF-8 string
- *
- * Computes a string without case and decomposited so
- * it can be used for comparison.
- *
- * Return value: a normalized string
- *
- * Since: 0.2.3
- **/
-gchar*
-katze_collfold (const gchar* str)
-{
- GString* result = g_string_new (NULL);
- const gchar* p = str;
-
- while (*p)
- {
- gunichar ch = g_unichar_tolower (g_utf8_get_char (p));
- gsize len;
- gunichar* sch = g_unicode_canonical_decomposition (ch, &len);
- guint i = 0;
- while (i < len)
- g_string_append_unichar (result, sch[i++]);
-
- p = g_utf8_next_char (p);
- }
-
- return g_string_free (result, FALSE);
-}
-
-/**
- * katze_utf8_stristr:
- * @haystack: a non-NULL UTF-8 string
- * @needle: a normalized non-NULL UTF-8 string
- *
- * Determines whether @needle is in @haystack, disregarding
- * differences in case.
- *
- * Return value: %TRUE if @needle is found in @haystack
- *
- * Since: 0.2.3
- **/
-gboolean
-katze_utf8_stristr (const gchar* haystack,
- const gchar* needle)
-{
- #if 0 /* 0,000159 seconds */
- /* Too slow for use in completion */
- gchar* nhaystack = g_utf8_normalize (haystack, -1, G_NORMALIZE_DEFAULT);
- const gchar *p = nhaystack;
- gsize len = strlen (needle);
- gsize i;
-
- while (*p)
- {
- for (i = 0; i < len; i++)
- if (g_unichar_tolower (g_utf8_get_char (p + i))
- != g_unichar_tolower (g_utf8_get_char (needle + i)))
- goto next;
-
- g_free (nhaystack);
- return TRUE;
-
- next:
- p = g_utf8_next_char (p);
- }
-
- g_free (nhaystack);
- return FALSE;
- #else /* 0,000044 seconds */
- /* No unicode matching */
- const gchar *p = haystack;
- gsize len = strlen (needle);
- gsize i;
-
- while (*p)
- {
- for (i = 0; i < len; i++)
- if (g_ascii_tolower (p[i]) != g_ascii_tolower (needle[i]))
- goto next;
-
- return TRUE;
-
- next:
- p++;
- }
-
- return FALSE;
- #endif
-}
diff --git a/katze/katze-utils.h b/katze/katze-utils.h
index 03a462d..5382173 100644
--- a/katze/katze-utils.h
+++ b/katze/katze-utils.h
@@ -139,13 +139,6 @@ GdkPixbuf*
katze_load_cached_icon (const gchar* uri,
GtkWidget* widget);
-gchar*
-katze_collfold (const gchar* str);
-
-gboolean
-katze_utf8_stristr (const gchar* haystack,
- const gchar* needle);
-
G_END_DECLS
#endif /* __KATZE_UTILS_H__ */
More information about the Xfce4-commits
mailing list