+2003-07-07 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-session.c (camel_session_init): Updated for string-utils
+ namespace changes.
+
+ * camel-provider.c: Updated for string-utils namespace changes.
+
+ * camel-mime-part.c (init_header_name_table): Updated for
+ string-utils namespace changes.
+
+ * camel-mime-message.c (camel_mime_message_class_init): Updated
+ for string-utils namespace changes.
+ (camel_mime_message_init): Same.
+
+ * camel-mime-filter-enriched.c
+ (camel_mime_filter_enriched_class_init): Updated for string-utils
+ namespace changes.
+
+ * camel-folder-summary.c (camel_folder_summary_init): Updated for
+ string-utils namespace changes.
+
+ * camel-string-utils.[c,h]: Renamed from string-utils.[c,h] and
+ also namespaced all functions.
+
2003-07-01 Jeffrey Stedfast <fejj@ximian.com>
* camel-sasl-digest-md5.c (digest_response): Don't quote the
camel-stream-mem.c \
camel-stream-null.c \
camel-stream.c \
+ camel-string-utils.c \
camel-text-index.c \
camel-tcp-stream-raw.c \
camel-tcp-stream-ssl.c \
camel-vee-folder.c \
camel-vee-store.c \
camel-vtrash-folder.c \
- camel.c \
- string-utils.c
+ camel.c
libcamelinclude_HEADERS = \
broken-date-parser.h \
camel-stream-mem.h \
camel-stream-null.h \
camel-stream.h \
+ camel-string-utils.h \
camel-text-index.h \
camel-tcp-stream-raw.h \
camel-tcp-stream-ssl.h \
camel-vee-folder.h \
camel-vee-store.h \
camel-vtrash-folder.h \
- camel.h \
- string-utils.h
+ camel.h
libcamel_la_LDFLAGS = -version-info 0:0:0
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; -*- */
-
/*
* Authors:
* Michael Zucchi <notzed@ximian.com>
#include "camel-charset-map.h"
#include "camel-charset-map-private.h"
-#include "string-utils.h"
#include <glib.h>
#include <glib/gunicode.h>
#include <glib.h>
#include "camel-folder-search.h"
-#include "string-utils.h"
#include "camel-exception.h"
#include "camel-medium.h"
#include <camel/camel-stream-null.h>
#include <camel/camel-stream-filter.h>
-#include "string-utils.h"
+#include <camel/camel-string-utils.h>
+
#include "e-util/md5-utils.h"
#include "e-util/e-memory.h"
p = _PRIVATE(s) = g_malloc0(sizeof(*p));
- p->filter_charset = g_hash_table_new(g_strcase_hash, g_strcase_equal);
+ p->filter_charset = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
s->message_info_size = sizeof(CamelMessageInfo);
s->content_info_size = sizeof(CamelMessageContentInfo);
#endif
#include <string.h>
+
#include "camel-folder.h"
#include "camel-exception.h"
#include "camel-store.h"
#include "camel-mime-message.h"
-#include "string-utils.h"
+
#include "e-util/e-memory.h"
#include "camel-operation.h"
#include <ctype.h>
#include "camel-medium.h"
-#include "string-utils.h"
#define d(x)
#include <stdio.h>
#include <string.h>
-#include "string-utils.h"
+#include <camel/camel-string-utils.h>
#include "camel-mime-filter-enriched.h"
filter_class->complete = filter_complete;
if (!enriched_hash) {
- enriched_hash = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+ enriched_hash = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i = 0; i < NUM_ENRICHED_TAGS; i++)
g_hash_table_insert (enriched_hash, enriched_tags[i].enriched,
enriched_tags[i].html);
#include "camel-mime-message.h"
#include "camel-multipart.h"
#include "camel-stream-mem.h"
-#include "string-utils.h"
+#include "camel-string-utils.h"
#include "camel-url.h"
#include "camel-stream-filter.h"
parent_class = CAMEL_MIME_PART_CLASS(camel_type_get_global_classfuncs (camel_mime_part_get_type ()));
- header_name_table = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+ header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i=0;header_names[i];i++)
g_hash_table_insert (header_name_table, header_names[i], GINT_TO_POINTER(i+1));
camel_data_wrapper_set_mime_type (CAMEL_DATA_WRAPPER (object), "message/rfc822");
- mime_message->recipients = g_hash_table_new(g_strcase_hash, g_strcase_equal);
+ mime_message->recipients = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
for (i=0;recipient_names[i];i++) {
g_hash_table_insert(mime_message->recipients, recipient_names[i], camel_internet_address_new());
}
#include <gal/util/e-iconv.h>
-#include "string-utils.h"
#include "camel-charset-map.h"
#include "camel-mime-part-utils.h"
#include "camel-mime-message.h"
#include "camel-mime-utils.h"
#include "camel-exception.h"
#include "camel-charset-map.h"
-#include "string-utils.h"
+#include "camel-string-utils.h"
#define d(x) /*(printf("%s(%d): ", __FILE__, __LINE__),(x))*/
static void
init_header_name_table()
{
- header_name_table = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+ header_name_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
g_hash_table_insert (header_name_table, "Content-Description", (gpointer)HEADER_DESCRIPTION);
g_hash_table_insert (header_name_table, "Content-Disposition", (gpointer)HEADER_DISPOSITION);
g_hash_table_insert (header_name_table, "Content-id", (gpointer)HEADER_CONTENT_ID);
g_hash_table_insert (header_name_table, "Content-Location", (gpointer)HEADER_CONTENT_LOCATION);
g_hash_table_insert (header_name_table, "Content-Type", (gpointer)HEADER_CONTENT_TYPE);
- header_formatted_table = g_hash_table_new(g_strcase_hash, g_strcase_equal);
+ header_formatted_table = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
g_hash_table_insert(header_formatted_table, "Content-Type", write_raw);
g_hash_table_insert(header_formatted_table, "Content-Disposition", write_raw);
g_hash_table_insert(header_formatted_table, "To", write_raw);
g_free (mime_part->content_id);
g_free (mime_part->content_MD5);
g_free (mime_part->content_location);
- string_list_free (mime_part->content_languages);
+ camel_string_list_free (mime_part->content_languages);
header_disposition_unref(mime_part->disposition);
if (mime_part->content_type)
void
camel_mime_part_set_content_languages (CamelMimePart *mime_part, GList *content_languages)
{
- if (mime_part->content_languages) string_list_free (mime_part->content_languages);
+ if (mime_part->content_languages)
+ camel_string_list_free (mime_part->content_languages);
+
mime_part->content_languages = content_languages;
/* FIXME: translate to a header and set it */
#include "camel-provider.h"
#include "camel-exception.h"
-#include "string-utils.h"
+#include "camel-string-utils.h"
/**
struct dirent *d;
char *p, *name, buf[80];
- providers = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+ providers = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
dir = opendir (CAMEL_PROVIDERDIR);
if (!dir) {
g_error ("Could not open camel provider directory: %s",
- strerror (errno));
+ g_strerror (errno));
return NULL;
}
fp = fopen (name, "r");
if (!fp) {
g_warning ("Could not read provider info file %s: %s",
- name, strerror (errno));
+ name, g_strerror (errno));
g_free (name);
continue;
}
* Jeffrey Stedfast <fejj@ximian.com>
* Bertrand Guiheneuf <bertrand@helixcode.com>
*
- * Copyright 1999 - 2001 Ximian, Inc.
+ * Copyright 1999 - 2003 Ximian, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
#include "camel-store.h"
#include "camel-transport.h"
#include "camel-exception.h"
-#include "string-utils.h"
+#include "camel-string-utils.h"
#include "camel-url.h"
#include "camel-vee-store.h"
{
session->online = TRUE;
session->modules = camel_provider_init ();
- session->providers = g_hash_table_new (g_strcase_hash, g_strcase_equal);
+ session->providers = g_hash_table_new (camel_strcase_hash, camel_strcase_equal);
session->priv = g_malloc0(sizeof(*session->priv));
#ifdef ENABLE_THREADS
session->priv->lock = g_mutex_new();
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
- * Copyright (C) 2001 Ximian Inc.
+ * Copyright (C) 2001-2003 Ximian Inc.
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
#include "camel-file-utils.h"
-#include "string-utils.h"
#include "e-util/md5-utils.h"
#include "e-util/e-memory.h"
#endif
#include <string.h>
-#include <ctype.h>
-#include "string-utils.h"
+#include "camel-string-utils.h"
-int
-g_strcase_equal (gconstpointer a, gconstpointer b)
+int
+camel_strcase_equal (gconstpointer a, gconstpointer b)
{
- return (strcasecmp ((const char *) a, (const char *) b) == 0);
+ return (g_ascii_strcasecmp ((const char *) a, (const char *) b) == 0);
}
guint
-g_strcase_hash (gconstpointer v)
+camel_strcase_hash (gconstpointer v)
{
const char *p = (char *) v;
guint h = 0, g;
for ( ; *p != '\0'; p++) {
- h = (h << 4) + toupper (*p);
+ h = (h << 4) + g_ascii_toupper (*p);
if ((g = h & 0xf0000000)) {
h = h ^ (g >> 24);
h = h ^ g;
g_free (string);
}
-void
-string_list_free (GList *string_list)
+void
+camel_string_list_free (GList *string_list)
{
if (string_list == NULL)
return;
*/
-#ifndef STRING_UTIL_H
-#define STRING_UTIL_H 1
+#ifndef __CAMEL_STRING_UTILS_H__
+#define __CAMEL_STRING_UTILS_H__
#ifdef __cplusplus
extern "C" {
#include <glib.h>
-int g_strcase_equal (gconstpointer a, gconstpointer b);
-guint g_strcase_hash (gconstpointer v);
+int camel_strcase_equal (gconstpointer a, gconstpointer b);
+guint camel_strcase_hash (gconstpointer v);
-void string_list_free (GList *string_list);
+void camel_string_list_free (GList *string_list);
char *camel_strstrcase (const char *haystack, const char *needle);
}
#endif /* __cplusplus */
-#endif /* STRING_UTIL_H */
+#endif /* __CAMEL_STRING_UTILS_H__ */
#include <string.h>
#include "camel-url.h"
-#include "string-utils.h"
#include "camel-exception.h"
#include "camel-mime-utils.h"
#include "camel-object.h"
#include "camel-stream-filter.h"
#include "camel-stream-mem.h"
#include "camel-stream.h"
-#include "string-utils.h"
#include "camel-private.h"
+#include "camel-string-utils.h"
#define d(x)
#include "camel-file-utils.h"
-#include "string-utils.h"
#include "e-util/md5-utils.h"
#include "e-util/e-memory.h"
#include "camel-url.h"
#include "camel-sasl.h"
#include "camel-utf8.h"
-#include "string-utils.h"
+#include "camel-string-utils.h"
#include "camel-imap-private.h"
#include "camel-private.h"
tcp_stream = camel_tcp_stream_raw_new ();
#endif /* HAVE_SSL */
+ printf ("trying to connect to %s:%d...", service->url->host, port);
+
ret = camel_tcp_stream_connect (CAMEL_TCP_STREAM (tcp_stream), h, port);
camel_free_host (h);
if (ret == -1) {
_("Could not connect to %s (port %d): %s"),
service->url->host, port, g_strerror (errno));
+ printf ("failed: %s\n", g_strerror (errno));
+
camel_object_unref (CAMEL_OBJECT (tcp_stream));
return FALSE;
}
+ printf ("connected...");
+
store->ostream = tcp_stream;
store->istream = camel_stream_buffer_new (tcp_stream, CAMEL_STREAM_BUFFER_READ);
/* Read the greeting, if any. FIXME: deal with PREAUTH */
if (camel_imap_store_readline (store, &buf, ex) < 0) {
+ printf ("failed when trying to read greeting: %s\n", g_strerror (errno));
+
if (store->istream) {
camel_object_unref (CAMEL_OBJECT (store->istream));
store->istream = NULL;
}
store->connected = FALSE;
+
return FALSE;
}
g_free (buf);
/* get the imap server capabilities */
if (!imap_get_capability (service, ex)) {
+ printf ("failed to get capabilities: %s\n", g_strerror (errno));
+
if (store->istream) {
camel_object_unref (CAMEL_OBJECT (store->istream));
store->istream = NULL;
}
#endif /* HAVE_SSL */
+ printf ("success\n");
+
return TRUE;
#ifdef HAVE_SSL
response = camel_imap_command (store, NULL, ex, "STARTTLS");
if (!response) {
+ printf ("STARTTLS command failed: %s\n", g_strerror (errno));
camel_object_unref (CAMEL_OBJECT (store->istream));
camel_object_unref (CAMEL_OBJECT (store->ostream));
store->istream = store->ostream = NULL;
/* Okay, now toggle SSL/TLS mode */
if (camel_tcp_stream_ssl_enable_ssl (CAMEL_TCP_STREAM_SSL (tcp_stream)) == -1) {
+ printf ("failed toggling into STARTTLS mode: %s\n", g_strerror (errno));
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
_("Failed to connect to IMAP server %s in secure mode: %s"),
service->url->host, _("SSL negotiations failed"));
/* rfc2595, section 4 states that after a successful STLS
command, the client MUST discard prior CAPA responses */
if (!imap_get_capability (service, ex)) {
+ printf ("failed getting capabilities after STARTLS: %s\n", g_strerror (errno));
+
if (store->istream) {
camel_object_unref (CAMEL_OBJECT (store->istream));
store->istream = NULL;
return FALSE;
}
+ printf ("success\n");
+
return TRUE;
exception:
#include "camel-imap-summary.h"
#include "camel-imap-store.h"
#include "camel-folder.h"
-#include "string-utils.h"
+#include "camel-string-utils.h"
#include "camel-utf8.h"
#define d(x)
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
- * Copyright (C) 1999, 2000 Ximian Inc.
+ * Copyright (C) 1999, 2003 Ximian Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
#include "camel-local-folder.h"
#include "camel-local-store.h"
-#include "string-utils.h"
#include "camel-stream-fs.h"
#include "camel-local-summary.h"
#include "camel-data-wrapper.h"
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
- * Copyright (C) 1999, 2000 Ximian Inc.
+ * Copyright (C) 1999, 2003 Ximian Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
#include "camel-maildir-folder.h"
#include "camel-maildir-store.h"
-#include "string-utils.h"
#include "camel-stream-fs.h"
#include "camel-maildir-summary.h"
#include "camel-data-wrapper.h"
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
- * Copyright (C) 1999, 2000 Ximian Inc.
+ * Copyright (C) 1999, 2003 Ximian Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
#include "camel-mbox-folder.h"
#include "camel-mbox-store.h"
-#include "string-utils.h"
#include "camel-stream-fs.h"
#include "camel-mbox-summary.h"
#include "camel-data-wrapper.h"
xevtmp = header_unfold(xevnew);
/* the raw header contains a leading ' ', so (dis)count that too */
if (strlen(xev)-1 != strlen(xevtmp)) {
+ printf ("strlen(xev)-1 = %d; strlen(xevtmp) = %d\n", strlen(xev)-1, strlen(xevtmp));
+ printf ("xev='%s'; xevtmp='%s'\n", xev, xevtmp);
g_free(xevnew);
g_free(xevtmp);
g_warning("Hmm, the xev headers shouldn't have changed size, but they did");
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
- * Copyright (C) 1999, 2000 Ximian Inc.
+ * Copyright (C) 1999, 2003 Ximian Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU General Public
#include "camel-mh-folder.h"
#include "camel-mh-store.h"
-#include "string-utils.h"
#include "camel-stream-fs.h"
#include "camel-mh-summary.h"
#include "camel-data-wrapper.h"
*
* Authors: Michael Zucchi <notzed@ximian.com>
*
- * Copyright (C) 2001 Ximian Inc (www.ximian.com/)
+ * Copyright (C) 2001-2003 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
#include "camel-spool-folder.h"
#include "camel-spool-store.h"
-#include "string-utils.h"
#include "camel-stream-fs.h"
#include "camel-spool-summary.h"
#include "camel-data-wrapper.h"
#include "camel-session.h"
#include "camel-exception.h"
#include "camel-sasl.h"
-#include "string-utils.h"
extern int camel_verbose_debug;