aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-utils.h
diff options
context:
space:
mode:
authorMichael Zucci <zucchi@src.gnome.org>2000-04-24 17:12:31 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-04-24 17:12:31 +0800
commit27937ec41f94720ffded271dff901dc74712845b (patch)
treeba02d3da7d25435df617d6ca166ccd2a360b136b /camel/camel-mime-utils.h
parent0c1a38160f5c97bfee3bad5d177ea3706069b993 (diff)
downloadgsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.gz
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.bz2
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.lz
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.xz
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.tar.zst
gsoc2013-evolution-27937ec41f94720ffded271dff901dc74712845b.zip
Big fixes for the last commit which broke the message creation entirely.
Plus an address decoder/formatter, etc. * camel-mime-message.c (construct_from_parser): Allow MESSAGE_END _or_ EOF as valid termination conditions. * providers/mbox/camel-mbox-summary.c (message_struct_new): Decode and then re-encode the addresses, so they are consistently formatted. * camel-mime-utils.c (header_decode_mailbox): Store the address in a _header_address. And try to get a comment-stored name if there is one. (header_decode_address): Actually return an address. (header_to_decode): Renamed to header_address_decode() (header_mailbox_decode): New function to get a single mailbox. (header_mime_decode): Return the major/minor value, as appropriate. (header_address_new, and friends): Whole bunch of utility functions for working with the address thingies. (header_decode_domain): Free the string header, and dont expand '.' into ' . '. (camel_mime_part_construct_content_from_parser): Oops, this was totally screwed up, try creating the right cotnent on the right object. svn path=/trunk/; revision=2579
Diffstat (limited to 'camel/camel-mime-utils.h')
-rw-r--r--camel/camel-mime-utils.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/camel/camel-mime-utils.h b/camel/camel-mime-utils.h
index febd0f8dbe..f95f76363c 100644
--- a/camel/camel-mime-utils.h
+++ b/camel/camel-mime-utils.h
@@ -52,6 +52,41 @@ typedef struct _CamelMimeDisposition {
unsigned int refcount;
} CamelMimeDisposition;
+enum _header_address_type {
+ HEADER_ADDRESS_NONE, /* uninitialised */
+ HEADER_ADDRESS_NAME,
+ HEADER_ADDRESS_GROUP
+};
+
+struct _header_address {
+ struct _header_address *next;
+ enum _header_address_type type;
+ char *name;
+ union {
+ char *addr;
+ struct _header_address *members;
+ } v;
+ unsigned int refcount;
+};
+
+/* Address lists */
+struct _header_address *header_address_new(void);
+struct _header_address *header_address_new_name(const char *name, const char *addr);
+struct _header_address *header_address_new_group(const char *name);
+void header_address_ref(struct _header_address *);
+void header_address_unref(struct _header_address *);
+void header_address_set_name(struct _header_address *, const char *name);
+void header_address_set_addr(struct _header_address *, const char *addr);
+void header_address_set_members(struct _header_address *, struct _header_address *group);
+void header_address_add_member(struct _header_address *, struct _header_address *member);
+void header_address_list_append_list(struct _header_address **l, struct _header_address **h);
+void header_address_list_append(struct _header_address **, struct _header_address *);
+void header_address_list_clear(struct _header_address **);
+
+struct _header_address *header_address_decode(const char *in);
+struct _header_address *header_mailbox_decode(const char *in);
+char *header_address_list_format(struct _header_address *a);
+
/* structured header prameters */
char *header_param(struct _header_param *p, const char *name);
struct _header_param *header_set_param(struct _header_param **l, const char *name, const char *value);
@@ -102,6 +137,9 @@ char *header_format_date(time_t time, int offset);
/* decode a message id */
char *header_msgid_decode(const char *in);
+/* decode the mime-type header */
+void header_mime_decode(const char *in, int *maj, int *min);
+
/* do incremental base64/quoted-printable (de/en)coding */
int base64_decode_step(unsigned char *in, int len, unsigned char *out, int *state, unsigned int *save);