NeoMutt  2022-04-29-145-g9b6a0e
Teaching an old dog new tricks
DOXYGEN
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 
35 struct 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 
55  char *description;
56  char *d_filename;
58  char *filename;
59  char *form_name;
60  char *subtype;
61  char *xtype;
62  struct ParameterList parameter;
63 
64  // ---------------------------------------------------------------------------
65  // Management data - Runtime info and glue to hold the objects together
66 
67  bool unlink : 1;
68 
69  struct Content *content;
71  struct Body *next;
72  struct Body *parts;
73  struct Email *email;
74  struct AttachPtr *aptr;
76  time_t stamp;
77  char *language;
78  char *charset;
80  long hdr_offset;
82 
83  // ---------------------------------------------------------------------------
84  // View data - Used by the GUI
85 
86  bool attach_qualifies : 1;
87  bool deleted : 1;
88  bool nowrap : 1;
89  bool tagged : 1;
90  signed short attach_count;
91 };
92 ARRAY_HEAD(BodyArray, struct Body *);
93 
94 bool mutt_body_cmp_strict(const struct Body *b1, const struct Body *b2);
95 void mutt_body_free (struct Body **ptr);
96 char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen);
97 struct Body *mutt_body_new (void);
98 
99 #endif /* MUTT_EMAIL_BODY_H */
void mutt_body_free(struct Body **ptr)
Free a Body.
Definition: body.c:57
ARRAY_HEAD(BodyArray, struct Body *)
char * mutt_body_get_charset(struct Body *b, char *buf, size_t buflen)
Get a body's character set.
Definition: body.c:131
struct Body * mutt_body_new(void)
Create a new Body.
Definition: body.c:43
bool mutt_body_cmp_strict(const struct Body *b1, const struct Body *b2)
Strictly compare two email Body's.
Definition: body.c:108
Convenience wrapper for the library headers.
Store attributes associated with a MIME part.
An email to which things will be attached.
Definition: attach.h:35
The body of an email.
Definition: body.h:36
char * language
content-language (RFC8255)
Definition: body.h:77
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:72
LOFF_T offset
offset where the actual data begins
Definition: body.h:52
signed short attach_count
Number of attachments.
Definition: body.h:90
char * xtype
content-type if x-unknown
Definition: body.h:61
bool deleted
Attachment marked for deletion.
Definition: body.h:87
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:67
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:76
struct Envelope * mime_headers
Memory hole protected headers.
Definition: body.h:75
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:78
struct ParameterList parameter
Parameters of the content-type.
Definition: body.h:62
struct AttachPtr * aptr
Menu information, used in recvattach.c.
Definition: body.h:74
bool use_disp
Content-Disposition uses filename= ?
Definition: body.h:47
struct Email * email
header information for message/rfc822
Definition: body.h:73
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:86
struct Content * content
Detailed info about the content of the attachment.
Definition: body.h:69
bool tagged
This attachment is tagged.
Definition: body.h:89
bool nowrap
Do not wrap the output in the pager.
Definition: body.h:88
struct Body * next
next attachment in the list
Definition: body.h:71
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:60
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:80
char * form_name
Content-Disposition form-data name param.
Definition: body.h:59
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:58
Info about an attachment.
Definition: content.h:35
The envelope/body of an email.
Definition: email.h:37
The header of an Email.
Definition: envelope.h:57