aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder-summary.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-08-26 05:01:55 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-08-26 05:01:55 +0800
commite74d9ca1cc1bd40982341aa85600fbc0b4f31824 (patch)
treef247f13df83c3440be8cf03592e1a2c233d16a54 /camel/camel-folder-summary.c
parent0357dde828171cb027545ca577a57a39f23b37f0 (diff)
downloadgsoc2013-evolution-e74d9ca1cc1bd40982341aa85600fbc0b4f31824.tar.gz
gsoc2013-evolution-e74d9ca1cc1bd40982341aa85600fbc0b4f31824.tar.zst
gsoc2013-evolution-e74d9ca1cc1bd40982341aa85600fbc0b4f31824.zip
Namespaced.
2003-08-25 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.[c,h]: Namespaced. * camel-data-wrapper.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-digest-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-driver.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-filter-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-search.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-folder-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-http-stream.h: updated for namespace changed made to camel-mime-utils.[c,h] * camel-internet-address.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-medium.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-message.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-parser.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-mime-part.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-movemail.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-encrypted.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart-signed.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-multipart.c: updated for namespace changed made to camel-mime-utils.[c,h] * camel-search-private.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * camel-types.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-store-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imap/camel-imap-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/imapp/camel-imapp-utils.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-local-summary.[c,h]: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-maildir-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-mbox-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/local/camel-spool-summary.h: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-summary.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/nntp/camel-nntp-utils.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/pop3/camel-pop3-folder.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/sendmail/camel-sendmail-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] * providers/smtp/camel-smtp-transport.c: updated for namespace changed made to camel-mime-utils.[c,h] svn path=/trunk/; revision=22355
Diffstat (limited to 'camel/camel-folder-summary.c')
-rw-r--r--camel/camel-folder-summary.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 5efc369cb5..ac67b29bae 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -90,14 +90,14 @@ static int my_list_size(struct _node **list);
static int summary_header_load(CamelFolderSummary *, FILE *);
static int summary_header_save(CamelFolderSummary *, FILE *);
-static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _header_raw *);
+static CamelMessageInfo * message_info_new(CamelFolderSummary *, struct _camel_header_raw *);
static CamelMessageInfo * message_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
static CamelMessageInfo * message_info_new_from_message(CamelFolderSummary *s, CamelMimeMessage *msg);
static CamelMessageInfo * message_info_load(CamelFolderSummary *, FILE *);
static int message_info_save(CamelFolderSummary *, FILE *, CamelMessageInfo *);
static void message_info_free(CamelFolderSummary *, CamelMessageInfo *);
-static CamelMessageContentInfo * content_info_new(CamelFolderSummary *, struct _header_raw *);
+static CamelMessageContentInfo * content_info_new(CamelFolderSummary *, struct _camel_header_raw *);
static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary *, CamelMimeParser *);
static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummary *s, CamelMimePart *mp);
static CamelMessageContentInfo * content_info_load(CamelFolderSummary *, FILE *);
@@ -810,7 +810,7 @@ void camel_folder_summary_add(CamelFolderSummary *s, CamelMessageInfo *info)
*
* Return value: The newly added record.
**/
-CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _header_raw *h)
+CamelMessageInfo *camel_folder_summary_add_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
{
CamelMessageInfo *info = camel_folder_summary_info_new_from_header(s, h);
@@ -869,7 +869,7 @@ CamelMessageInfo *camel_folder_summary_add_from_message(CamelFolderSummary *s, C
* Return value: Guess? This info record MUST be freed using
* camel_folder_summary_info_free(), camel_message_info_free() will not work.
**/
-CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _header_raw *h)
+CamelMessageInfo *camel_folder_summary_info_new_from_header(CamelFolderSummary *s, struct _camel_header_raw *h)
{
return ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s))) -> message_info_new(s, h);
}
@@ -1475,7 +1475,7 @@ static CamelMessageContentInfo * content_info_new_from_parser(CamelFolderSummary
ci = ((CamelFolderSummaryClass *)(CAMEL_OBJECT_GET_CLASS(s)))->content_info_new(s, camel_mime_parser_headers_raw(mp));
if (ci) {
ci->type = camel_mime_parser_content_type(mp);
- header_content_type_ref(ci->type);
+ camel_content_type_ref(ci->type);
}
break;
default:
@@ -1504,17 +1504,17 @@ static CamelMessageContentInfo * content_info_new_from_message(CamelFolderSummar
}
static char *
-summary_format_address(struct _header_raw *h, const char *name, const char *charset)
+summary_format_address(struct _camel_header_raw *h, const char *name, const char *charset)
{
- struct _header_address *addr;
+ struct _camel_header_address *addr;
const char *text;
char *ret;
- text = header_raw_find (&h, name, NULL);
- addr = header_address_decode (text, charset);
+ text = camel_header_raw_find (&h, name, NULL);
+ addr = camel_header_address_decode (text, charset);
if (addr) {
- ret = header_address_list_format (addr);
- header_address_list_clear (&addr);
+ ret = camel_header_address_list_format (addr);
+ camel_header_address_list_clear (&addr);
} else {
ret = g_strdup (text);
}
@@ -1523,15 +1523,15 @@ summary_format_address(struct _header_raw *h, const char *name, const char *char
}
static char *
-summary_format_string (struct _header_raw *h, const char *name, const char *charset)
+summary_format_string (struct _camel_header_raw *h, const char *name, const char *charset)
{
const char *text;
- text = header_raw_find (&h, name, NULL);
+ text = camel_header_raw_find (&h, name, NULL);
if (text) {
while (isspace ((unsigned) *text))
text++;
- return header_decode_string (text, charset);
+ return camel_header_decode_string (text, charset);
} else {
return NULL;
}
@@ -1593,23 +1593,23 @@ camel_folder_summary_content_info_new(CamelFolderSummary *s)
}
static CamelMessageInfo *
-message_info_new(CamelFolderSummary *s, struct _header_raw *h)
+message_info_new(CamelFolderSummary *s, struct _camel_header_raw *h)
{
CamelMessageInfo *mi;
const char *received;
guchar digest[16];
- struct _header_references *refs, *irt, *scan;
+ struct _camel_header_references *refs, *irt, *scan;
char *msgid;
int count;
char *subject, *from, *to, *cc, *mlist;
- struct _header_content_type *ct = NULL;
+ CamelContentType *ct = NULL;
const char *content, *charset = NULL;
mi = camel_folder_summary_info_new(s);
- if ((content = header_raw_find(&h, "Content-Type", NULL))
- && (ct = header_content_type_decode(content))
- && (charset = header_content_type_param(ct, "charset"))
+ if ((content = camel_header_raw_find(&h, "Content-Type", NULL))
+ && (ct = camel_content_type_decode(content))
+ && (charset = camel_content_type_param(ct, "charset"))
&& (strcasecmp(charset, "us-ascii") == 0))
charset = NULL;
@@ -1619,10 +1619,10 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h)
from = summary_format_address(h, "from", charset);
to = summary_format_address(h, "to", charset);
cc = summary_format_address(h, "cc", charset);
- mlist = header_raw_check_mailing_list(&h);
+ mlist = camel_header_raw_check_mailing_list(&h);
if (ct)
- header_content_type_unref(ct);
+ camel_content_type_unref(ct);
#ifdef DOEPOOLV
e_poolv_set(mi->strings, CAMEL_MESSAGE_INFO_SUBJECT, subject, TRUE);
@@ -1646,16 +1646,16 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h)
mi->user_flags = NULL;
mi->user_tags = NULL;
- mi->date_sent = header_decode_date(header_raw_find(&h, "date", NULL), NULL);
- received = header_raw_find(&h, "received", NULL);
+ mi->date_sent = camel_header_decode_date(camel_header_raw_find(&h, "date", NULL), NULL);
+ received = camel_header_raw_find(&h, "received", NULL);
if (received)
received = strrchr(received, ';');
if (received)
- mi->date_received = header_decode_date(received + 1, NULL);
+ mi->date_received = camel_header_decode_date(received + 1, NULL);
else
mi->date_received = 0;
- msgid = header_msgid_decode(header_raw_find(&h, "message-id", NULL));
+ msgid = camel_header_msgid_decode(camel_header_raw_find(&h, "message-id", NULL));
if (msgid) {
md5_get_digest(msgid, strlen(msgid), digest);
memcpy(mi->message_id.id.hash, digest, sizeof(mi->message_id.id.hash));
@@ -1663,8 +1663,8 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h)
}
/* decode our references and in-reply-to headers */
- refs = header_references_decode (header_raw_find (&h, "references", NULL));
- irt = header_references_inreplyto_decode (header_raw_find (&h, "in-reply-to", NULL));
+ refs = camel_header_references_decode (camel_header_raw_find (&h, "references", NULL));
+ irt = camel_header_references_inreplyto_decode (camel_header_raw_find (&h, "in-reply-to", NULL));
if (refs || irt) {
if (irt) {
/* The References field is populated from the ``References'' and/or ``In-Reply-To''
@@ -1677,7 +1677,7 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h)
refs = irt;
}
- count = header_references_list_size(&refs);
+ count = camel_header_references_list_size(&refs);
mi->references = g_malloc(sizeof(*mi->references) + ((count-1) * sizeof(mi->references->references[0])));
count = 0;
scan = refs;
@@ -1688,7 +1688,7 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h)
scan = scan->next;
}
mi->references->size = count;
- header_references_list_clear(&refs);
+ camel_header_references_list_clear(&refs);
}
return mi;
@@ -1867,7 +1867,7 @@ message_info_free(CamelFolderSummary *s, CamelMessageInfo *mi)
}
static CamelMessageContentInfo *
-content_info_new (CamelFolderSummary *s, struct _header_raw *h)
+content_info_new (CamelFolderSummary *s, struct _camel_header_raw *h)
{
CamelMessageContentInfo *ci;
const char *charset;
@@ -1875,9 +1875,9 @@ content_info_new (CamelFolderSummary *s, struct _header_raw *h)
ci = camel_folder_summary_content_info_new (s);
charset = e_iconv_locale_charset ();
- ci->id = header_msgid_decode (header_raw_find (&h, "content-id", NULL));
- ci->description = header_decode_string (header_raw_find (&h, "content-description", NULL), NULL);
- ci->encoding = header_content_encoding_decode (header_raw_find (&h, "content-transfer-encoding", NULL));
+ ci->id = camel_header_msgid_decode (camel_header_raw_find (&h, "content-id", NULL));
+ ci->description = camel_header_decode_string (camel_header_raw_find (&h, "content-description", NULL), NULL);
+ ci->encoding = camel_header_content_encoding_decode (camel_header_raw_find (&h, "content-transfer-encoding", NULL));
return ci;
}
@@ -1888,7 +1888,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
CamelMessageContentInfo *ci;
char *type, *subtype;
guint32 count, i;
- struct _header_content_type *ct;
+ CamelContentType *ct;
io(printf("Loading content info\n"));
@@ -1896,7 +1896,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
camel_folder_summary_decode_token(in, &type);
camel_folder_summary_decode_token(in, &subtype);
- ct = header_content_type_new(type, subtype);
+ ct = camel_content_type_new(type, subtype);
g_free(type); /* can this be removed? */
g_free(subtype);
if (camel_file_util_decode_uint32(in, &count) == -1 || count > 500)
@@ -1909,7 +1909,7 @@ content_info_load(CamelFolderSummary *s, FILE *in)
if (!(name && value))
goto error;
- header_content_type_set_param(ct, name, value);
+ camel_content_type_set_param(ct, name, value);
/* TODO: do this so we dont have to double alloc/free */
g_free(name);
g_free(value);
@@ -1935,8 +1935,8 @@ content_info_load(CamelFolderSummary *s, FILE *in)
static int
content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
{
- struct _header_content_type *ct;
- struct _header_param *hp;
+ CamelContentType *ct;
+ struct _camel_header_param *hp;
io(printf("Saving content info\n"));
@@ -1965,7 +1965,7 @@ content_info_save(CamelFolderSummary *s, FILE *out, CamelMessageContentInfo *ci)
static void
content_info_free(CamelFolderSummary *s, CamelMessageContentInfo *ci)
{
- header_content_type_unref(ci->type);
+ camel_content_type_unref(ci->type);
g_free(ci->id);
g_free(ci->description);
g_free(ci->encoding);
@@ -1992,7 +1992,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
size_t len;
char *buffer;
CamelMessageContentInfo *info = NULL;
- struct _header_content_type *ct;
+ CamelContentType *ct;
int body;
int enc_id = -1, chr_id = -1, html_id = -1, idx_id = -1;
struct _CamelFolderSummaryPrivate *p = _PRIVATE(s);
@@ -2013,16 +2013,16 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
/* check content type for indexing, then read body */
ct = camel_mime_parser_content_type(mp);
/* update attachments flag as we go */
- if (!header_content_type_is(ct, "text", "*"))
+ if (!camel_content_type_is(ct, "text", "*"))
msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
- if (p->index && header_content_type_is(ct, "text", "*")) {
+ if (p->index && camel_content_type_is(ct, "text", "*")) {
char *encoding;
const char *charset;
d(printf("generating index:\n"));
- encoding = header_content_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
+ encoding = camel_header_content_encoding_decode(camel_mime_parser_header(mp, "content-transfer-encoding", NULL));
if (encoding) {
if (!strcasecmp(encoding, "base64")) {
d(printf(" decoding base64\n"));
@@ -2051,7 +2051,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
g_free(encoding);
}
- charset = header_content_type_param(ct, "charset");
+ charset = camel_content_type_param(ct, "charset");
if (charset!=NULL
&& !(strcasecmp(charset, "us-ascii")==0
|| strcasecmp(charset, "utf-8")==0)) {
@@ -2073,7 +2073,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
/* we do charset conversions before this filter, which isn't strictly correct,
but works in most cases */
- if (header_content_type_is(ct, "text", "html")) {
+ if (camel_content_type_is(ct, "text", "html")) {
if (p->filter_html == NULL)
p->filter_html = camel_mime_filter_html_new();
else
@@ -2097,7 +2097,7 @@ summary_build_content_info(CamelFolderSummary *s, CamelMessageInfo *msginfo, Cam
d(printf("Summarising multipart\n"));
/* update attachments flag as we go */
ct = camel_mime_parser_content_type(mp);
- if (header_content_type_is(ct, "multipart", "mixed"))
+ if (camel_content_type_is(ct, "multipart", "mixed"))
msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
while (camel_mime_parser_step(mp, &buffer, &len) != HSCAN_MULTIPART_END) {
@@ -2154,10 +2154,10 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
add a reference, probably need fixing for multithreading */
/* check for attachments */
- if (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "*")) {
- if (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "mixed"))
+ if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "*")) {
+ if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "multipart", "mixed"))
msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
- } else if (!header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*"))
+ } else if (!camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*"))
msginfo->flags |= CAMEL_MESSAGE_ATTACHMENTS;
/* using the object types is more accurate than using the mime/types */
@@ -2180,11 +2180,11 @@ summary_build_content_info_message(CamelFolderSummary *s, CamelMessageInfo *msgi
my_list_append((struct _node **)&info->childs, (struct _node *)child);
}
} else if (p->filter_stream
- && header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*")) {
+ && camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "*")) {
int html_id = -1, idx_id = -1;
/* pre-attach html filter if required, otherwise just index filter */
- if (header_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "html")) {
+ if (camel_content_type_is(CAMEL_DATA_WRAPPER(containee)->mime_type, "text", "html")) {
if (p->filter_html == NULL)
p->filter_html = camel_mime_filter_html_new();
else
@@ -2588,16 +2588,16 @@ void camel_message_info_ref(CamelMessageInfo *info)
* Returns a new CamelMessageInfo structure populated by the header.
**/
CamelMessageInfo *
-camel_message_info_new_from_header (struct _header_raw *header)
+camel_message_info_new_from_header (struct _camel_header_raw *header)
{
CamelMessageInfo *info;
char *subject, *from, *to, *cc, *mlist;
- struct _header_content_type *ct = NULL;
+ CamelContentType *ct = NULL;
const char *content, *date, *charset = NULL;
- if ((content = header_raw_find(&header, "Content-Type", NULL))
- && (ct = header_content_type_decode(content))
- && (charset = header_content_type_param(ct, "charset"))
+ if ((content = camel_header_raw_find(&header, "Content-Type", NULL))
+ && (ct = camel_content_type_decode(content))
+ && (charset = camel_content_type_param(ct, "charset"))
&& (strcasecmp(charset, "us-ascii") == 0))
charset = NULL;
@@ -2607,11 +2607,11 @@ camel_message_info_new_from_header (struct _header_raw *header)
from = summary_format_address(header, "from", charset);
to = summary_format_address(header, "to", charset);
cc = summary_format_address(header, "cc", charset);
- date = header_raw_find(&header, "date", NULL);
- mlist = header_raw_check_mailing_list(&header);
+ date = camel_header_raw_find(&header, "date", NULL);
+ mlist = camel_header_raw_check_mailing_list(&header);
if (ct)
- header_content_type_unref(ct);
+ camel_content_type_unref(ct);
info = camel_message_info_new();
@@ -2622,16 +2622,16 @@ camel_message_info_new_from_header (struct _header_raw *header)
camel_message_info_set_mlist(info, mlist);
if (date)
- info->date_sent = header_decode_date (date, NULL);
+ info->date_sent = camel_header_decode_date (date, NULL);
else
info->date_sent = time (NULL);
- date = header_raw_find (&header, "received", NULL);
+ date = camel_header_raw_find (&header, "received", NULL);
if (date && (date = strrchr (date, ';')))
date++;
if (date)
- info->date_received = header_decode_date (date, NULL);
+ info->date_received = camel_header_decode_date (date, NULL);
else
info->date_received = time (NULL);