aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2002-11-08 10:22:50 +0800
committerChris Toshok <toshok@src.gnome.org>2002-11-08 10:22:50 +0800
commit3d4f29c7c78f5df88c6f4de8a02c87fb299d4482 (patch)
tree6cada83f76a969f170e3e6888c2045690be07dcd
parentf7f7e443ed5ad285fb29cf0fc579dd76bd9fffe4 (diff)
downloadgsoc2013-evolution-3d4f29c7c78f5df88c6f4de8a02c87fb299d4482.tar.gz
gsoc2013-evolution-3d4f29c7c78f5df88c6f4de8a02c87fb299d4482.tar.zst
gsoc2013-evolution-3d4f29c7c78f5df88c6f4de8a02c87fb299d4482.zip
add prototypes for e_utf8_casefold_collate{_len}
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. svn path=/trunk/; revision=18654
-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__ */