more simplifications and header moves
[apps/madmutt.git] / lib-mime / mime.h
index 90f8c68..91195cc 100644 (file)
@@ -19,6 +19,7 @@
 
 /*
  * Copyright notice from original mutt:
+ * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
  * Copyright (C) 1999-2000 Thomas Roessler <roessler@does-not-exist.org>
  *
  * This file is part of mutt-ng, see http://www.muttng.org/.
 #define MUTT_LIB_MIME_MIME_H
 
 #include <stdlib.h>
+#include <stdio.h>
 
-#include <lib-lib/mem.h>
-#include <lib-lib/list.h>
-
-/* Content-Type */
-enum {
-    TYPEOTHER,
-    TYPEAUDIO,
-    TYPEAPPLICATION,
-    TYPEIMAGE,
-    TYPEMESSAGE,
-    TYPEMODEL,
-    TYPEMULTIPART,
-    TYPETEXT,
-    TYPEVIDEO,
-    TYPEANY
-};
-
-/* Content-Transfer-Encoding */
-enum {
-    ENCOTHER,
-    ENC7BIT,
-    ENC8BIT,
-    ENCQUOTEDPRINTABLE,
-    ENCBASE64,
-    ENCBINARY,
-    ENCUUENCODED
-};
-
-/* Content-Disposition values */
-enum {
-    DISPINLINE,
-    DISPATTACH,
-    DISPFORMDATA
-};
-
-typedef struct parameter {
-    char *attribute;
-    char *value;
-    struct parameter *next;
-} PARAMETER;
+#include "mime-types.h"
 
 extern const char MimeSpecials[];
 extern const char *BodyTypes[];
@@ -90,20 +53,19 @@ extern const char *BodyEncodings[];
 /*                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 *);
+extern const char RFC822Specials[];
 
-DO_NEW(address_t, address);
-DO_DELETE(address_t, address);
-DO_SLIST(address_t, address);
+ssize_t mutt_read_rfc822_line(FILE*, char**, ssize_t*);
+LIST *mutt_parse_references(char *, int);
+int mutt_check_encoding(const char *);
+int mutt_check_mime_type(const char *);
+void mutt_parse_content_type(char *, BODY *);
+BODY *mutt_read_mime_header (FILE *, int);
+void mutt_parse_part(FILE *, BODY *);
+BODY *mutt_parse_messageRFC822(FILE *, BODY *);
+BODY *mutt_parse_multipart (FILE *, const char *, off_t, int);
 
+/*** addresses ***/
 
 address_t *address_dup(address_t *addr);
 address_t *address_list_dup(address_t *addr);
@@ -111,14 +73,25 @@ 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 *);
+ssize_t rfc822_write_address(char *, ssize_t, address_t *, int);
+ssize_t rfc822_write_address_single(char *, ssize_t, address_t *, int);
+ssize_t rfc822_strcpy(char *, ssize_t, const char *, const char *);
 
-extern int RFC822Error;
-extern const char RFC822Specials[];
+/****************************************************************************/
+/* RFC 2047                                                                 */
+/*       MIME (Multipurpose Internet Mail Extensions) Part Three:           */
+/*             Message Header Extensions for Non-ASCII Text                 */
+/****************************************************************************/
+
+char *mutt_choose_charset(const char *fromcode, const char *charsets,
+                          char *u, ssize_t ulen, char **d, ssize_t *dlen);
+
+void rfc2047_encode_string(char **);
+void rfc2047_encode_adrlist(address_t *, const char *);
 
-#define rfc822_error(x) RFC822Errors[x]
+void rfc2047_decode(char **);
+void rfc2047_decode_adrlist(address_t *);
+void rfc2047_decode_envelope(ENVELOPE* e);
 
 /****************************************************************************/
 /* RFC 2231                                                                 */