NeoMutt  2024-11-14-34-g5aaf0d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
body.h
Go to the documentation of this file.
1
23#ifndef MUTT_EMAIL_BODY_H
24#define MUTT_EMAIL_BODY_H
25
26#include "config.h"
27#include <stdbool.h>
28#include <time.h>
29#include "mutt/lib.h"
30#include "parameter.h"
31
35struct Body
36{
37 // ---------------------------------------------------------------------------
38 // Data that gets stored in the Header Cache
39
40 unsigned int type : 4;
41 unsigned int encoding : 3;
42 unsigned int disposition : 2;
43 bool badsig : 1;
44 bool force_charset : 1;
45 bool goodsig : 1;
46 bool noconv : 1;
47 bool use_disp : 1;
48 bool warnsig : 1;
49#ifdef USE_AUTOCRYPT
50 bool is_autocrypt : 1;
51#endif
52 LOFF_T offset;
53 LOFF_T length;
54
56 char *d_filename;
58 char *content_id;
59 char *filename;
60 char *form_name;
61 char *subtype;
62 char *xtype;
63 struct ParameterList parameter;
64
65 // ---------------------------------------------------------------------------
66 // Management data - Runtime info and glue to hold the objects together
67
68 bool unlink : 1;
69
70 struct Content *content;
72 struct Body *next;
73 struct Body *parts;
74 struct Email *email;
75 struct AttachPtr *aptr;
77 time_t stamp;
78 char *language;
79 char *charset;
83
84 // ---------------------------------------------------------------------------
85 // View data - Used by the GUI
86
88 bool deleted : 1;
89 bool nowrap : 1;
90 bool tagged : 1;
91 signed short attach_count;
92};
93ARRAY_HEAD(BodyArray, struct Body *);
94
101{
116};
117
118bool mutt_body_cmp_strict(const struct Body *b1, const struct Body *b2);
119void mutt_body_free (struct Body **ptr);
120char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
121struct Body *mutt_body_new (void);
122
123#endif /* MUTT_EMAIL_BODY_H */
#define ARRAY_HEAD(name, type)
Define a named struct for arrays of elements of a certain type.
Definition: array.h:47
ExpandoDataBody
Expando UIDs for Bodies.
Definition: body.h:101
@ ED_BOD_DESCRIPTION
Body.description.
Definition: body.h:106
@ ED_BOD_CHARSET_CONVERT
Body.type.
Definition: body.h:104
@ ED_BOD_DELETED
Body.deleted.
Definition: body.h:105
@ ED_BOD_UNLINK
Body.unlink.
Definition: body.h:115
@ ED_BOD_FILE_SIZE
Body.filename.
Definition: body.h:110
@ ED_BOD_DISPOSITION
Body.disposition.
Definition: body.h:107
@ ED_BOD_ATTACH_QUALIFIES
Body.attach_qualifies.
Definition: body.h:103
@ ED_BOD_MIME_MAJOR
Body.type, Body.xtype.
Definition: body.h:112
@ ED_BOD_TAGGED
Body.tagged.
Definition: body.h:114
@ ED_BOD_ATTACH_COUNT
Body.attach_count.
Definition: body.h:102
@ ED_BOD_FILE
Body.filename.
Definition: body.h:108
@ ED_BOD_MIME_MINOR
Body.subtype.
Definition: body.h:113
@ ED_BOD_FILE_DISPOSITION
Body.d_filename.
Definition: body.h:109
@ ED_BOD_MIME_ENCODING
Body.encoding.
Definition: body.h:111
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition: body.c:58
struct Body * mutt_body_new(void)
Create a new Body.
Definition: body.c:44
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body's character set.
Definition: body.c:133
bool mutt_body_cmp_strict(const struct Body *b1, const struct Body *b2)
Strictly compare two email Body's.
Definition: body.c:110
Convenience wrapper for the library headers.
Store attributes associated with a MIME part.
An email to which things will be attached.
Definition: attach.h:37
The body of an email.
Definition: body.h:36
char * language
content-language (RFC8255)
Definition: body.h:78
char * content_id
Content-Id (RFC2392)
Definition: body.h:58
char * d_filename
filename to be used for the content-disposition header If NULL, filename is used instead.
Definition: body.h:56
struct Body * parts
parts of a multipart or message/rfc822
Definition: body.h:73
LOFF_T offset
offset where the actual data begins
Definition: body.h:52
signed short attach_count
Number of attachments.
Definition: body.h:91
char * xtype
content-type if x-unknown
Definition: body.h:62
bool deleted
Attachment marked for deletion.
Definition: body.h:88
bool noconv
Don't do character set conversion.
Definition: body.h:46
bool unlink
If true, filename should be unlink()ed before free()ing this structure.
Definition: body.h:68
bool badsig
Bad cryptographic signature (needed to check encrypted s/mime-signatures)
Definition: body.h:43
time_t stamp
Time stamp of last encoding update.
Definition: body.h:77
struct Envelope * mime_headers
Memory hole protected headers.
Definition: body.h:76
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
Definition: body.h:50
LOFF_T length
length (in bytes) of attachment
Definition: body.h:53
char * charset
Send mode: charset of attached file as stored on disk.
Definition: body.h:79
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:63
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition: body.h:75
bool use_disp
Content-Disposition uses filename= ?
Definition: body.h:47
struct Email * email
header information for message/rfc822
Definition: body.h:74
char * description
content-description
Definition: body.h:55
unsigned int disposition
content-disposition, ContentDisposition
Definition: body.h:42
bool attach_qualifies
This attachment should be counted.
Definition: body.h:87
struct Content * content
Detailed info about the content of the attachment.
Definition: body.h:70
bool tagged
This attachment is tagged.
Definition: body.h:90
bool nowrap
Do not wrap the output in the pager.
Definition: body.h:89
struct Body * next
next attachment in the list
Definition: body.h:72
bool force_charset
Send mode: don't adjust the character set when in send-mode.
Definition: body.h:44
char * subtype
content-type subtype
Definition: body.h:61
unsigned int encoding
content-transfer-encoding, ContentEncoding
Definition: body.h:41
bool goodsig
Good cryptographic signature.
Definition: body.h:45
long hdr_offset
Offset in stream where the headers begin.
Definition: body.h:81
char * form_name
Content-Disposition form-data name param.
Definition: body.h:60
bool warnsig
Maybe good signature.
Definition: body.h:48
unsigned int type
content-type primary type, ContentType
Definition: body.h:40
char * filename
When sending a message, this is the file to which this structure refers.
Definition: body.h:59
Info about an attachment.
Definition: content.h:35
The envelope/body of an email.
Definition: email.h:39
The header of an Email.
Definition: envelope.h:57