aboutsummaryrefslogtreecommitdiffstats
path: root/camel/string-utils.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-11-01 05:57:29 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-11-01 05:57:29 +0800
commit29748a7520497dddc02ec2ee69522b6dd4d1537e (patch)
tree4b5039f01455eeb1c457db4b00b2dc93d83ea97b /camel/string-utils.c
parentf48db35928c31854f828f04d52b5ee9df858e4e5 (diff)
downloadgsoc2013-evolution-29748a7520497dddc02ec2ee69522b6dd4d1537e.tar.gz
gsoc2013-evolution-29748a7520497dddc02ec2ee69522b6dd4d1537e.tar.zst
gsoc2013-evolution-29748a7520497dddc02ec2ee69522b6dd4d1537e.zip
Removed hash-table-utils.[c,h] from the build.
2002-10-31 Jeffrey Stedfast <fejj@ximian.com> * Makefile.am: Removed hash-table-utils.[c,h] from the build. * hash-table-utils.[c,h]: Removed. * string-util.c: Imported g_strcase[hash,equal] into here so we can remove hash-table-utils.[c,h]. * camel-medium.c: Removed #include "hash-table-utils.h" * camel-mime-message.c: Same here. * camel-mime-part.c: And here. * camel-session.c: Here too. * providers/imap/camel-imap-store-summary.c: #include string-utils.h instead of hash-table-utils.h * camel-charset-map.c: Same. * camel-folder-summary.c: Here too. * camel-provider.c: Again here. * camel-store-summary.c: And again... svn path=/trunk/; revision=18473
Diffstat (limited to 'camel/string-utils.c')
-rw-r--r--camel/string-utils.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/camel/string-utils.c b/camel/string-utils.c
index 02cfded80c..8fa82ed4ec 100644
--- a/camel/string-utils.c
+++ b/camel/string-utils.c
@@ -26,10 +26,35 @@
#endif
#include <string.h>
+#include <ctype.h>
#include "string-utils.h"
+int
+g_strcase_equal (gconstpointer a, gconstpointer b)
+{
+ return (strcasecmp ((const char *) a, (const char *) b) == 0);
+}
+
+guint
+g_strcase_hash (gconstpointer v)
+{
+ const char *p = (char *) v;
+ guint h = 0, g;
+
+ for ( ; *p != '\0'; p++) {
+ h = (h << 4) + toupper (*p);
+ if ((g = h & 0xf0000000)) {
+ h = h ^ (g >> 24);
+ h = h ^ g;
+ }
+ }
+
+ return h;
+}
+
+
static void
free_string (gpointer string, gpointer user_data)
{