#ifndef MUTT_LIB_MIME_MIME_H
#define MUTT_LIB_MIME_MIME_H
+#include <stdlib.h>
+
+#include <lib-lib/mem.h>
+#include <lib-lib/list.h>
+
/* Content-Type */
enum {
TYPEOTHER,
struct parameter *next;
} PARAMETER;
+extern const char MimeSpecials[];
+extern const char *BodyTypes[];
+extern const char *BodyEncodings[];
+
/* MIME encoding/decoding global vars */
#define is_multipart(x) \
((x)->type == TYPEMULTIPART \
|| ((x)->type == TYPEMESSAGE && (!strcasecmp((x)->subtype, "rfc822") \
|| !strcasecmp((x)->subtype, "news"))))
-
-extern const char *BodyTypes[];
-extern const char *BodyEncodings[];
-
#define TYPE(X) ((X->type == TYPEOTHER) && (X->xtype != NULL) ? X->xtype : BodyTypes[(X->type)])
#define ENCODING(X) BodyEncodings[(X)]
-/* other MIME-related global variables */
-#ifndef _SENDLIB_C
-extern char MimeSpecials[];
-#endif
+/****************************************************************************/
+/* RFC 822 */
+/* Standard for ARPA Internet Text Messages */
+/****************************************************************************/
+
+typedef struct address_t {
+ char *personal; /* real name of address */
+ char *mailbox; /* mailbox and host address */
+ int group; /* group mailbox? */
+ struct address_t *next;
+} address_t;
+
+DO_INIT(address_t, address);
+void address_wipe(address_t *);
+
+DO_NEW(address_t, address);
+DO_DELETE(address_t, address);
+DO_SLIST(address_t, address);
+
+
+address_t *address_dup(address_t *addr);
+address_t *address_list_dup(address_t *addr);
+void rfc822_qualify(address_t *, const char *);
+
+address_t *rfc822_parse_adrlist(address_t *, const char *s);
+
+void rfc822_write_address(char *, size_t, address_t *, int);
+void rfc822_write_address_single(char *, size_t, address_t *, int);
+void rfc822_cat(char *, size_t, const char *, const char *);
+
+extern int RFC822Error;
+extern const char RFC822Specials[];
+
+#define rfc822_error(x) RFC822Errors[x]
+
+/****************************************************************************/
+/* RFC 2231 */
+/* MIME Parameter Value and Encoded Word Extensions: */
+/* Character Sets, Languages, and Continuations */
+/****************************************************************************/
-void rfc2231_decode_parameters (PARAMETER **);
-int rfc2231_encode_string (char **);
+int rfc2231_encode_string(char **);
+void rfc2231_decode_parameters(PARAMETER **);
#endif /* MUTT_LIB_MIME_MIME_H */