X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-mime%2Fmime-types.h;h=ac99d8760f456dc1b214a0fb45cdc10612b7f16c;hp=513f121d2d39bdf9165df2e894015d0ac501d693;hb=cfd5f411041c7ef44087b032751792fadc74586d;hpb=108f3c7ab59844591f7540347914ea57be5245e2 diff --git a/lib-mime/mime-types.h b/lib-mime/mime-types.h index 513f121..ac99d87 100644 --- a/lib-mime/mime-types.h +++ b/lib-mime/mime-types.h @@ -30,13 +30,7 @@ #ifndef MUTT_LIB_MIME_MIME_TYPES_H #define MUTT_LIB_MIME_MIME_TYPES_H -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include +#include /* Content-Type */ enum { @@ -75,10 +69,10 @@ enum { /****************************************************************************/ typedef struct address_t { + struct address_t *next; 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); @@ -95,22 +89,28 @@ DO_SLIST(address_t, address, address_delete); /* rfc822 header parameters */ /****************************************************************************/ -typedef struct parameter { +typedef struct parameter_t { + struct parameter_t *next; char *attribute; char *value; - struct parameter *next; -} PARAMETER; +} parameter_t; -DO_INIT(PARAMETER, parameter); -static inline void parameter_wipe(PARAMETER *param) { +DO_INIT(parameter_t, parameter); +static inline void parameter_wipe(parameter_t *param) { p_delete(¶m->attribute); p_delete(¶m->value); } -DO_NEW(PARAMETER, parameter); -DO_DELETE(PARAMETER, parameter); -DO_SLIST(PARAMETER, parameter, parameter_delete); +DO_NEW(parameter_t, parameter); +DO_DELETE(parameter_t, parameter); +DO_SLIST(parameter_t, parameter, parameter_delete); +char *parameter_getval(parameter_t *, const char *); +void parameter_setval(parameter_t **, const char *, const char *); +void parameter_delval(parameter_t ** p, const char *); +void parameter_set_boundary(parameter_t **); + +int parameter_equal(const parameter_t *, const parameter_t *); /****************************************************************************/ /* rfc822 envelopes */ @@ -133,12 +133,6 @@ typedef struct envelope_t { char *date; char *x_label; char *organization; -#ifdef USE_NNTP - char *newsgroups; - char *xref; - char *followup_to; - char *x_comment_to; -#endif BUFFER *spam; string_list_t *references; /* message references (in reverse order) */ string_list_t *in_reply_to; /* in-reply-to header content */ @@ -177,9 +171,11 @@ typedef struct content { /****************************************************************************/ typedef struct body { + struct body *next; /* next attachment in the list */ + char *xtype; /* content-type if x-unknown */ char *subtype; /* content-type subtype */ - PARAMETER *parameter; /* parameters of the content-type */ + parameter_t *parameter; /* parameters of the content-type */ char *description; /* content-description */ char *form_name; /* Content-Disposition form-data name param */ off_t hdr_offset; /* offset in stream where the headers begin. @@ -203,7 +199,6 @@ typedef struct body { * to determine what content-transfer-encoding * is required when sending mail. */ - struct body *next; /* next attachment in the list */ struct body *parts; /* parts of a multipart or message/rfc822 */ struct header *hdr; /* header information for message/rfc822 */ @@ -247,6 +242,17 @@ typedef struct body { unsigned int attach_qualifies:1; } BODY; +static inline BODY *body_init(BODY *b) { + b->disposition = DISPATTACH; + b->use_disp = 1; + return b; +} +void body_wipe(BODY *); + +DO_NEW(BODY, body); +DO_DELETE(BODY, body); +DO_SLIST(BODY, body, body_delete); + /****************************************************************************/ /* rfc822 Headers */ @@ -311,19 +317,12 @@ see: crypt.h pgplib.h, smime.h */ ENVELOPE *env; /* envelope information */ BODY *content; /* list of MIME parts */ char *path; -#ifdef USE_NNTP - int article_num; -#endif char *tree; /* character string to print thread tree */ struct thread *thread; short attach_total; -#ifdef MIXMASTER - string_list_t *chain; -#endif - int refno; /* message number on server */ void *data; /* driver-specific data */