aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/backend/ebook/e-book-util.c23
-rw-r--r--addressbook/backend/ebook/e-book-util.h3
3 files changed, 34 insertions, 0 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 4858078bb6..445ffcb63c 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2002-11-07 Chris Toshok <toshok@ximian.com>
+
+ * 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.
+
2002-11-06 Chris Toshok <toshok@ximian.com>
* printing/e-contact-print-envelope.c: port this to
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__ */