53 void **p = (
void **) ptr;
55 if (p && (size < 4096))
71 memcpy(d + *off, &i,
sizeof(
int));
72 (*off) +=
sizeof(int);
87 memcpy(d + *off, &s,
sizeof(uint32_t));
88 (*off) +=
sizeof(uint32_t);
103 memcpy(d + *off, &s,
sizeof(uint64_t));
104 (*off) +=
sizeof(uint64_t);
117 memcpy(i, d + *off,
sizeof(
int));
118 (*off) +=
sizeof(int);
129 memcpy(s, d + *off,
sizeof(uint32_t));
130 (*off) +=
sizeof(uint32_t);
141 memcpy(s, d + *off,
sizeof(uint64_t));
142 (*off) +=
sizeof(uint64_t);
155 unsigned char *d,
int *off,
bool convert)
159 if (!c || (*c ==
'\0') || (size == 0))
175 memcpy(d + *off, p ? p : c, size);
205 unsigned int size = 0;
215 memcpy(*c, d + *off, size);
241 unsigned char *d,
int *off,
bool convert)
243 unsigned int counter = 0;
244 unsigned int start_off = *off;
257 memcpy(d + start_off, &counter,
sizeof(
int));
270 int *off,
bool convert)
272 unsigned int counter = 0;
311 int *off,
bool convert)
313 unsigned int counter = 0;
314 unsigned int start_off = *off;
325 memcpy(d + start_off, &counter,
sizeof(
int));
339 unsigned int counter = 0;
361 int *off,
bool convert)
387 unsigned int used = 0;
408 unsigned char *d,
int *off,
bool convert)
410 unsigned int counter = 0;
411 unsigned int start_off = *off;
423 memcpy(d + start_off, &counter,
sizeof(
int));
436 int *off,
bool convert)
438 unsigned int counter = 0;
466 uint32_t packed = b->
type +
496 b->
type = (packed & ((1 << 4) - 1));
497 b->
encoding = ((packed >> 4) & ((1 << 3) - 1));
500 b->
badsig = (packed & (1 << 9));
502 b->
goodsig = (packed & (1 << 11));
503 b->
noconv = (packed & (1 << 12));
505 b->
warnsig = (packed & (1 << 14));
586 unsigned char *d,
int *off,
bool convert)
637 int real_subj_off = 0;
653 if (c_auto_subscribe)
660 if ((real_subj_off < 0) || (real_subj_off >= len))
693 unsigned int counter = 0;
694 unsigned int start_off = *off;
698 struct Tag *t = NULL;
705 memcpy(d + start_off, &counter,
sizeof(
int));
718 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_malloc(size_t size)
Allocate memory on the heap.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
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.
void serial_restore_tags(struct TagList *tags, 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.
unsigned char * serial_dump_tags(const struct TagList *tags, unsigned char *d, int *off)
Pack a TagList into 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 * 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.
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
char * subject
Email's subject.
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 * 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.