aboutsummaryrefslogtreecommitdiffstats
path: root/camel/string-utils.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-04-17 01:09:38 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-04-17 01:09:38 +0800
commit8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da (patch)
treece8454bcd1bee579b4fb0977872e85ed8f411358 /camel/string-utils.c
parent62e82291e808731ec8d97fffe4528c641d31d939 (diff)
downloadgsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.tar
gsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.tar.gz
gsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.tar.bz2
gsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.tar.lz
gsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.tar.xz
gsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.tar.zst
gsoc2013-evolution-8cc3a0e4dc9d3664f7b4e54d03d1c5b1936eb2da.zip
Remove the EXTRA_GNOME_CFLAGS include.
2001-04-16 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'camel/string-utils.c')
-rw-r--r--camel/string-utils.c24
1 files changed, 24 insertions, 0 deletions
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;
+}