From 29748a7520497dddc02ec2ee69522b6dd4d1537e Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Thu, 31 Oct 2002 21:57:29 +0000 Subject: Removed hash-table-utils.[c,h] from the build. 2002-10-31 Jeffrey Stedfast * 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 --- camel/ChangeLog | 28 +++++++++++ camel/Makefile.am | 2 - camel/camel-charset-map.c | 2 +- camel/camel-folder-summary.c | 2 +- camel/camel-medium.c | 3 +- camel/camel-mime-message.c | 1 - camel/camel-mime-part.c | 1 - camel/camel-provider.c | 2 +- camel/camel-session.c | 2 +- camel/camel-store-summary.c | 2 +- camel/hash-table-utils.c | 63 ------------------------- camel/hash-table-utils.h | 45 ------------------ camel/providers/imap/camel-imap-store-summary.c | 2 +- camel/string-utils.c | 25 ++++++++++ camel/string-utils.h | 3 ++ 15 files changed, 64 insertions(+), 119 deletions(-) delete mode 100644 camel/hash-table-utils.c delete mode 100644 camel/hash-table-utils.h diff --git a/camel/ChangeLog b/camel/ChangeLog index c504171765..4f5abb9031 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,31 @@ +2002-10-31 Jeffrey Stedfast + + * 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... + 2002-10-31 Jeffrey Stedfast Remove a ton of useless snot. diff --git a/camel/Makefile.am b/camel/Makefile.am index ab2160375b..7b6b45e0e5 100644 --- a/camel/Makefile.am +++ b/camel/Makefile.am @@ -114,7 +114,6 @@ libcamel_la_SOURCES = \ camel-vee-store.c \ camel-vtrash-folder.c \ camel.c \ - hash-table-utils.c \ string-utils.c libcamelinclude_HEADERS = \ @@ -213,7 +212,6 @@ libcamelinclude_HEADERS = \ camel-vee-store.h \ camel-vtrash-folder.h \ camel.h \ - hash-table-utils.h \ string-utils.h libcamel_la_LDFLAGS = -version-info 0:0:0 -rpath $(libdir) diff --git a/camel/camel-charset-map.c b/camel/camel-charset-map.c index 8594f261cf..981a90314f 100644 --- a/camel/camel-charset-map.c +++ b/camel/camel-charset-map.c @@ -199,7 +199,7 @@ int main (void) #include "camel-charset-map.h" #include "camel-charset-map-private.h" -#include "hash-table-utils.h" +#include "string-utils.h" #include #include #include diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index b66b57753e..b68e8995c4 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -50,7 +50,7 @@ #include #include -#include "hash-table-utils.h" +#include "string-utils.h" #include "e-util/md5-utils.h" #include "e-util/e-memory.h" diff --git a/camel/camel-medium.c b/camel/camel-medium.c index 2537989639..afa685326d 100644 --- a/camel/camel-medium.c +++ b/camel/camel-medium.c @@ -22,15 +22,16 @@ * USA */ + #ifdef HAVE_CONFIG_H #include #endif #include #include + #include "camel-medium.h" #include "string-utils.h" -#include "hash-table-utils.h" #define d(x) diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c index 7f7a35466d..428cfd061d 100644 --- a/camel/camel-mime-message.c +++ b/camel/camel-mime-message.c @@ -39,7 +39,6 @@ #include "camel-multipart.h" #include "camel-stream-mem.h" #include "string-utils.h" -#include "hash-table-utils.h" #include "camel-url.h" #include "camel-stream-filter.h" diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index 8d5730c904..b8e259b3e2 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -34,7 +34,6 @@ #include -#include "hash-table-utils.h" #include "camel-mime-parser.h" #include "camel-stream-mem.h" #include "camel-stream-filter.h" diff --git a/camel/camel-provider.c b/camel/camel-provider.c index f8484278d7..6f22795fbd 100644 --- a/camel/camel-provider.c +++ b/camel/camel-provider.c @@ -42,7 +42,7 @@ #include "camel-provider.h" #include "camel-exception.h" -#include "hash-table-utils.h" +#include "string-utils.h" /** * camel_provider_init: diff --git a/camel/camel-session.c b/camel/camel-session.c index a3e94a5f38..750c34c18c 100644 --- a/camel/camel-session.c +++ b/camel/camel-session.c @@ -33,13 +33,13 @@ #include #include #include + #include "camel-session.h" #include "camel-store.h" #include "camel-transport.h" #include "camel-exception.h" #include "string-utils.h" #include "camel-url.h" -#include "hash-table-utils.h" #include "camel-vee-store.h" #include "camel-private.h" diff --git a/camel/camel-store-summary.c b/camel/camel-store-summary.c index f33205dd50..1eb931820f 100644 --- a/camel/camel-store-summary.c +++ b/camel/camel-store-summary.c @@ -35,7 +35,7 @@ #include "camel-file-utils.h" -#include "hash-table-utils.h" +#include "string-utils.h" #include "e-util/md5-utils.h" #include "e-util/e-memory.h" diff --git a/camel/hash-table-utils.c b/camel/hash-table-utils.c deleted file mode 100644 index 195afbee2d..0000000000 --- a/camel/hash-table-utils.c +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* generic utilities for hash tables */ - -/* - * - * Author : - * Bertrand Guiheneuf - * - * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - - -#include -#include - -#include "hash-table-utils.h" - - -/***/ -/* use these two funcs for case insensitive hash table */ - -gint -g_strcase_equal (gconstpointer a, gconstpointer b) -{ - return (strcasecmp ((char *) a, (char *) b) == 0); -} - - -/* modified g_str_hash from glib/gstring.c - because it would have been too slow to - us g_strdown() on the string */ -/* a char* hash function from ASU */ -guint -g_strcase_hash (gconstpointer v) -{ - const char *s = (char*)v; - const char *p; - guint h = 0, g; - - for (p = s; *p != '\0'; p += 1) { - h = (h << 4) + toupper (*p); - if ((g = h & 0xf0000000)) { - h = h ^ (g >> 24); - h = h ^ g; - } - } - - return h; -} diff --git a/camel/hash-table-utils.h b/camel/hash-table-utils.h deleted file mode 100644 index 0d3ab7dce6..0000000000 --- a/camel/hash-table-utils.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* generic utilities for hash tables */ - -/* - * - * Author : - * Bertrand Guiheneuf - * - * Copyright 1999, 2000 Ximian, Inc. (www.ximian.com) - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA - */ - - -#ifndef HASH_TABLE_UTILS_H -#define HASH_TABLE_UTILS_H 1 - - -#ifdef __cplusplus -extern "C" { -#pragma } -#endif /* __cplusplus }*/ - -#include - -gint g_strcase_equal (gconstpointer a, gconstpointer b); -guint g_strcase_hash (gconstpointer v); - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* HASH_TABLE_UTILS_H */ diff --git a/camel/providers/imap/camel-imap-store-summary.c b/camel/providers/imap/camel-imap-store-summary.c index 9cdebba3e9..ed6e5392a4 100644 --- a/camel/providers/imap/camel-imap-store-summary.c +++ b/camel/providers/imap/camel-imap-store-summary.c @@ -32,7 +32,7 @@ #include "camel-file-utils.h" -#include "hash-table-utils.h" +#include "string-utils.h" #include "e-util/md5-utils.h" #include "e-util/e-memory.h" 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 +#include #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) { diff --git a/camel/string-utils.h b/camel/string-utils.h index 76004f03a4..ab881a08fb 100644 --- a/camel/string-utils.h +++ b/camel/string-utils.h @@ -31,6 +31,9 @@ extern "C" { #include +int g_strcase_equal (gconstpointer a, gconstpointer b); +guint g_strcase_hash (gconstpointer v); + void string_list_free (GList *string_list); char *strstrcase (const char *haystack, const char *needle); -- cgit v1.2.3