52 void **p = (
void **) ptr;
54 if (p && (size < 4096))
70 memcpy(d + *off, &i,
sizeof(
int));
71 (*off) +=
sizeof(int);
86 memcpy(d + *off, &s,
sizeof(uint32_t));
87 (*off) +=
sizeof(uint32_t);
102 memcpy(d + *off, &s,
sizeof(uint64_t));
103 (*off) +=
sizeof(uint64_t);
116 memcpy(i, d + *off,
sizeof(
int));
117 (*off) +=
sizeof(int);
128 memcpy(s, d + *off,
sizeof(uint32_t));
129 (*off) +=
sizeof(uint32_t);
140 memcpy(s, d + *off,
sizeof(uint64_t));
141 (*off) +=
sizeof(uint64_t);
154 unsigned char *d,
int *off,
bool convert)
158 if (!c || (*c ==
'\0') || (size == 0))
174 memcpy(d + *off, p ? p : c, size);
204 unsigned int size = 0;
214 memcpy(*c, d + *off, size);
240 unsigned char *d,
int *off,
bool convert)
242 unsigned int counter = 0;
243 unsigned int start_off = *off;
256 memcpy(d + start_off, &counter,
sizeof(
int));
269 int *off,
bool convert)
271 unsigned int counter = 0;
310 int *off,
bool convert)
312 unsigned int counter = 0;
313 unsigned int start_off = *off;
324 memcpy(d + start_off, &counter,
sizeof(
int));
338 unsigned int counter = 0;
360 int *off,
bool convert)
386 unsigned int used = 0;
407 unsigned char *d,
int *off,
bool convert)
409 unsigned int counter = 0;
410 unsigned int start_off = *off;
422 memcpy(d + start_off, &counter,
sizeof(
int));
435 int *off,
bool convert)
437 unsigned int counter = 0;
465 uint32_t packed = b->
type +
495 b->
type = (packed & ((1 << 4) - 1));
496 b->
encoding = ((packed >> 4) & ((1 << 3) - 1));
499 b->
badsig = (packed & (1 << 9));
501 b->
goodsig = (packed & (1 << 11));
502 b->
noconv = (packed & (1 << 12));
504 b->
warnsig = (packed & (1 << 14));
587 unsigned char *d,
int *off,
bool convert)
636 int real_subj_off = 0;
652 if (c_auto_subscribe)
659 if ((real_subj_off < 0) || (real_subj_off >= len))
690 unsigned int counter = 0;
691 unsigned int start_off = *off;
695 struct Tag *tag = NULL;
702 memcpy(d + start_off, &counter,
sizeof(
int));
715 unsigned int counter = 0;
void mutt_addrlist_append(struct AddressList *al, struct Address *a)
Append an Address to an AddressList.
struct Address * mutt_addr_new(void)
Create a new Address.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
void buf_free(struct Buffer **ptr)
Deallocates a buffer.
struct Buffer * buf_new(const char *str)
Allocate a new Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
void buf_alloc(struct Buffer *buf, size_t new_size)
Make sure a buffer can store at least new_size bytes.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
const char * cc_charset(void)
Get the cached value of $charset.
Convenience wrapper for the core headers.
Structs that make up an email.
void mutt_auto_subscribe(const char *mailto)
Check if user is subscribed to mailing list.
struct ListNode * mutt_list_insert_tail(struct ListHead *h, char *s)
Append a string to the end of a List.
void mutt_mem_realloc(void *pptr, size_t size)
Resize a block of memory on the heap.
#define MUTT_MEM_MALLOC(n, type)
int mutt_ch_convert_string(char **ps, const char *from, const char *to, uint8_t flags)
Convert a string between encodings.
#define MUTT_ICONV_NO_FLAGS
No flags are set.
Convenience wrapper for the library headers.
char * mutt_strn_dup(const char *begin, size_t len)
Duplicate a sub-string.
char * mutt_str_dup(const char *str)
Copy a string, safely.
bool mutt_str_is_ascii(const char *str, size_t len)
Is a string ASCII (7-bit)?
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
struct Parameter * mutt_param_new(void)
Create a new Parameter.
#define TAILQ_FOREACH(var, head, field)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define STAILQ_FOREACH(var, head, field)
unsigned char * serial_dump_body(const struct Body *b, unsigned char *d, int *off, bool convert)
Pack an Body into a binary blob.
unsigned char * serial_dump_tags(const struct TagList *tl, unsigned char *d, int *off)
Pack a TagList into a binary blob.
void serial_restore_tags(struct TagList *tl, const unsigned char *d, int *off)
Unpack a TagList from a binary blob.
unsigned char * serial_dump_uint64_t(const uint64_t s, unsigned char *d, int *off)
Pack a uint64_t into a binary blob.
void serial_restore_char(char **c, const unsigned char *d, int *off, bool convert)
Unpack a variable-length string from a binary blob.
unsigned char * serial_dump_int(const unsigned int i, unsigned char *d, int *off)
Pack an integer into a binary blob.
void serial_restore_buffer(struct Buffer *buf, const unsigned char *d, int *off, bool convert)
Unpack a Buffer from a binary blob.
void serial_restore_envelope(struct Envelope *env, const unsigned char *d, int *off, bool convert)
Unpack an Envelope from a binary blob.
unsigned char * serial_dump_envelope(const struct Envelope *env, unsigned char *d, int *off, bool convert)
Pack an Envelope into a binary blob.
static uint32_t body_pack_flags(const struct Body *b)
Pack the Body flags into a uint32_t.
unsigned char * serial_dump_buffer(const struct Buffer *buf, unsigned char *d, int *off, bool convert)
Pack a Buffer into a binary blob.
void serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
Unpack a STAILQ from a binary blob.
unsigned char * serial_dump_address(const struct AddressList *al, unsigned char *d, int *off, bool convert)
Pack an Address into a binary blob.
void serial_restore_uint64_t(uint64_t *s, const unsigned char *d, int *off)
Unpack an uint64_t from a binary blob.
void lazy_realloc(void *ptr, size_t size)
Reallocate some memory.
unsigned char * serial_dump_parameter(const struct ParameterList *pl, unsigned char *d, int *off, bool convert)
Pack a Parameter into a binary blob.
void serial_restore_body(struct Body *b, const unsigned char *d, int *off, bool convert)
Unpack a Body from a binary blob.
unsigned char * serial_dump_uint32_t(const uint32_t s, unsigned char *d, int *off)
Pack a uint32_t into a binary blob.
unsigned char * serial_dump_stailq(const struct ListHead *l, unsigned char *d, int *off, bool convert)
Pack a STAILQ into a binary blob.
void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert)
Unpack a Parameter from a binary blob.
unsigned char * serial_dump_char_size(const char *c, ssize_t size, unsigned char *d, int *off, bool convert)
Pack a fixed-length string into a binary blob.
static void body_unpack_flags(struct Body *b, uint32_t packed)
Unpack the Body flags from a uint32_t.
void serial_restore_address(struct AddressList *al, const unsigned char *d, int *off, bool convert)
Unpack an Address from a binary blob.
void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
Unpack an integer from a binary blob.
void serial_restore_uint32_t(uint32_t *s, const unsigned char *d, int *off)
Unpack an uint32_t from a binary blob.
unsigned char * serial_dump_char(const char *c, unsigned char *d, int *off, bool convert)
Pack a variable-length string into a binary blob.
struct Buffer * personal
Real name of address.
struct Buffer * mailbox
Mailbox and host address.
char * content_id
Content-Id (RFC2392)
char * d_filename
filename to be used for the content-disposition header If NULL, filename is used instead.
LOFF_T offset
offset where the actual data begins
char * xtype
content-type if x-unknown
bool noconv
Don't do character set conversion.
bool badsig
Bad cryptographic signature (needed to check encrypted s/mime-signatures)
bool is_autocrypt
Flag autocrypt-decrypted messages for replying.
LOFF_T length
length (in bytes) of attachment
struct ParameterList parameter
Parameters of the content-type.
bool use_disp
Content-Disposition uses filename= ?
char * description
content-description
unsigned int disposition
content-disposition, ContentDisposition
bool force_charset
Send mode: don't adjust the character set when in send-mode.
char * subtype
content-type subtype
unsigned int encoding
content-transfer-encoding, ContentEncoding
bool goodsig
Good cryptographic signature.
char * form_name
Content-Disposition form-data name param.
bool warnsig
Maybe good signature.
unsigned int type
content-type primary type, ContentType
char * filename
When sending a message, this is the file to which this structure refers.
String manipulation buffer.
char * data
Pointer to data.
struct ListHead userhdrs
user defined headers
char * supersedes
Supersedes header.
char * list_subscribe
This stores a mailto URL, or nothing.
struct AddressList return_path
Return path for the Email.
char *const subject
Email's subject.
struct AddressList to
Email's 'To' list.
char * followup_to
List of 'followup-to' fields.
struct AddressList reply_to
Email's 'reply-to'.
char * message_id
Message ID.
char * x_comment_to
List of 'X-comment-to' fields.
struct AddressList mail_followup_to
Email's 'mail-followup-to'.
struct AddressList cc
Email's 'Cc' list.
struct AddressList sender
Email's sender.
struct ListHead references
message references (in reverse order)
struct Buffer spam
Spam header.
struct ListHead in_reply_to
in-reply-to header content
struct AddressList bcc
Email's 'Bcc' list.
char * xref
List of cross-references.
char * organization
Organisation header.
char * list_post
This stores a mailto URL, or nothing.
char *const real_subj
Offset of the real subject.
char * list_unsubscribe
This stores a mailto URL, or nothing.
struct AddressList from
Email's 'From' list.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
Attribute associated with a MIME part.
char * attribute
Parameter name.
char * value
Parameter value.