aboutsummaryrefslogtreecommitdiffstats
path: root/camel/string-utils.c
diff options
context:
space:
mode:
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)
{