From 3d4f29c7c78f5df88c6f4de8a02c87fb299d4482 Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 8 Nov 2002 02:22:50 +0000 Subject: add prototypes for e_utf8_casefold_collate{_len} 2002-11-07 Chris Toshok * backend/ebook/e-book-util.h: add prototypes for e_utf8_casefold_collate{_len} * backend/ebook/e-book-util.c (e_utf8_casefold_collate_len): move utf8_casefold_collate_len here. (e_utf8_casefold_collate): move utf8_casefold_collate here. svn path=/trunk/; revision=18654 --- addressbook/backend/ebook/e-book-util.c | 23 +++++++++++++++++++++++ addressbook/backend/ebook/e-book-util.h | 3 +++ 2 files changed, 26 insertions(+) (limited to 'addressbook/backend') diff --git a/addressbook/backend/ebook/e-book-util.c b/addressbook/backend/ebook/e-book-util.c index c27ebff497..46fe732f25 100644 --- a/addressbook/backend/ebook/e-book-util.c +++ b/addressbook/backend/ebook/e-book-util.c @@ -752,3 +752,26 @@ e_book_query_address_default (const gchar *email, e_book_use_default_book (have_address_book_open_cb, info); } + +/* bad place for this i know. */ +int +e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len) +{ + gchar *s1 = g_utf8_casefold(str1, len); + gchar *s2 = g_utf8_casefold(str2, len); + int rv; + + rv = g_utf8_collate (s1, s2); + + g_free (s1); + g_free (s2); + + return rv; +} + +int +e_utf8_casefold_collate (const gchar *str1, const gchar *str2) +{ + return e_utf8_casefold_collate_len (str1, str2, -1); +} + diff --git a/addressbook/backend/ebook/e-book-util.h b/addressbook/backend/ebook/e-book-util.h index 71d9cd0c33..3ebea41ef0 100644 --- a/addressbook/backend/ebook/e-book-util.h +++ b/addressbook/backend/ebook/e-book-util.h @@ -85,6 +85,9 @@ void e_book_query_address_default (const gchar EBookHaveAddressCallback cb, gpointer closure); +int e_utf8_casefold_collate_len (const gchar *str1, const gchar *str2, int len); +int e_utf8_casefold_collate (const gchar *str1, const gchar *str2); + G_END_DECLS #endif /* __E_BOOK_UTIL_H__ */ -- cgit