From 016b6a6306e0756acce3c88235735dfbac13263a Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sat, 18 Sep 2010 01:48:55 +0200 Subject: [PATCH] Remove unused katze_collfold and katze_utf8_stristr --- katze/katze-utils.c | 92 --------------------------------------------- katze/katze-utils.h | 7 ---- 2 files changed, 99 deletions(-) diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 5d12592b..134a7d83 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 03a462dd..5382173f 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__ */ -- 2.39.5