From 8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 16 Apr 2001 17:09:38 +0000 Subject: Remove the EXTRA_GNOME_CFLAGS include. 2001-04-16 Jeffrey Stedfast * Makefile.am: Remove the EXTRA_GNOME_CFLAGS include. * camel-store.c (camel_mkdir_hier): Convenience function that it seems a number of camel-store implementations used gal for. * providers/nntp/camel-nntp-store.c (ensure_news_dir_exists): Lets not depend on gal for just e_mkdir_hier() - use camel_mkdir_hier() instead. * providers/nntp/camel-imap-store.c: Lets not depend on gal for just e_mkdir_hier() - use camel_mkdir_hier() instead. * camel-session.c (camel_session_get_storage_path): Don't depend on e_mkdir_heir() anymore, use the CamelStore version. * camel-folder-search.h: Removed gal dependency, why was this even there in the first place? * providers/imap/camel-imap-folder.c: Don't need gal/util/e-util.h here, so remove it. * string-utils.c (strstrcase): New function, well more like old function brought back to life so we don't have to depend on gal. * providers/imap/camel-imap-store.c (imap_store_setup_online): Use strstrcase rather than e_strstrcase so we don't depend on gal. (get_unread_online): Same here. * providers/smtp/camel-smtp-transport.c (smtp_helo): Use strstrcase. svn path=/trunk/; revision=9383 --- camel/string-utils.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'camel/string-utils.c') diff --git a/camel/string-utils.c b/camel/string-utils.c index 4a28b199ef..584e2dad0d 100644 --- a/camel/string-utils.c +++ b/camel/string-utils.c @@ -207,3 +207,27 @@ strip (gchar *string, gchar c) return string; } + +char * +strstrcase (char *haystack, const char *needle) +{ + /* find the needle in the haystack neglecting case */ + const char *ptr; + guint len; + + g_return_val_if_fail (haystack != NULL, NULL); + g_return_val_if_fail (needle != NULL, NULL); + + len = strlen (needle); + if (len > strlen (haystack)) + return NULL; + + if (len == 0) + return (char *) haystack; + + for (ptr = haystack; *(ptr + len - 1) != '\0'; ptr++) + if (!g_strncasecmp (ptr, needle, len)) + return (char *) ptr; + + return NULL; +} -- cgit v1.2.3