NeoMutt  2021-02-05-666-ge300cd
Teaching an old dog new tricks
DOXYGEN
serialize.h
Go to the documentation of this file.
1 
26 #ifndef MUTT_HCACHE_SERIALIZE_H
27 #define MUTT_HCACHE_SERIALIZE_H
28 
29 #include <stddef.h>
30 #include <stdbool.h>
31 #include <stdint.h>
32 #include <sys/types.h>
33 
34 struct AddressList;
35 struct Body;
36 struct Buffer;
37 struct Envelope;
38 struct ListHead;
39 struct ParameterList;
40 struct TagList;
41 
42 unsigned char *serial_dump_address (struct AddressList *al, unsigned char *d, int *off, bool convert);
43 unsigned char *serial_dump_body (struct Body *c, unsigned char *d, int *off, bool convert);
44 unsigned char *serial_dump_tags (const struct TagList *tags, unsigned char *d, int *off);
45 unsigned char *serial_dump_buffer (struct Buffer *buf, unsigned char *d, int *off, bool convert);
46 unsigned char *serial_dump_char (char *c, unsigned char *d, int *off, bool convert);
47 unsigned char *serial_dump_char_size(char *c, ssize_t size, unsigned char *d, int *off, bool convert);
48 unsigned char *serial_dump_envelope (struct Envelope *e, unsigned char *d, int *off, bool convert);
49 unsigned char *serial_dump_int (unsigned int i, unsigned char *d, int *off);
50 unsigned char *serial_dump_uint32_t (uint32_t s, unsigned char *d, int *off);
51 unsigned char *serial_dump_parameter(struct ParameterList *pl, unsigned char *d, int *off, bool convert);
52 unsigned char *serial_dump_stailq (struct ListHead *l, unsigned char *d, int *off, bool convert);
53 
54 void serial_restore_address (struct AddressList *al, const unsigned char *d, int *off, bool convert);
55 void serial_restore_body (struct Body *c, const unsigned char *d, int *off, bool convert);
56 void serial_restore_tags (struct TagList *tags, const unsigned char *d, int *off);
57 void serial_restore_buffer (struct Buffer *buf, const unsigned char *d, int *off, bool convert);
58 void serial_restore_char (char **c, const unsigned char *d, int *off, bool convert);
59 void serial_restore_envelope (struct Envelope *e, const unsigned char *d, int *off, bool convert);
60 void serial_restore_int (unsigned int *i, const unsigned char *d, int *off);
61 void serial_restore_uint32_t (uint32_t *s, const unsigned char *d, int *off);
62 void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert);
63 void serial_restore_stailq (struct ListHead *l, const unsigned char *d, int *off, bool convert);
64 
65 void lazy_realloc(void *ptr, size_t size);
66 
67 #endif /* MUTT_HCACHE_SERIALIZE_H */
void lazy_realloc(void *ptr, size_t size)
Reallocate some memory.
Definition: serialize.c:50
unsigned char * serial_dump_char(char *c, unsigned char *d, int *off, bool convert)
Pack a variable-length string into a binary blob.
Definition: serialize.c:166
void serial_restore_envelope(struct Envelope *e, const unsigned char *d, int *off, bool convert)
Unpack an Envelope from a binary blob.
Definition: serialize.c:539
unsigned char * serial_dump_int(unsigned int i, unsigned char *d, int *off)
Pack an integer into a binary blob.
Definition: serialize.c:67
void serial_restore_address(struct AddressList *al, const unsigned char *d, int *off, bool convert)
Unpack an Address from a binary blob.
Definition: serialize.c:245
void serial_restore_tags(struct TagList *tags, const unsigned char *d, int *off)
Unpack a TagList from a binary blob.
Definition: serialize.c:617
String manipulation buffer.
Definition: buffer.h:33
void serial_restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
Unpack a STAILQ from a binary blob.
Definition: serialize.c:299
void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert)
Unpack a Parameter from a binary blob.
Definition: serialize.c:399
The body of an email.
Definition: body.h:34
unsigned char * serial_dump_char_size(char *c, ssize_t size, unsigned char *d, int *off, bool convert)
Pack a fixed-length string into a binary blob.
Definition: serialize.c:125
unsigned char * serial_dump_body(struct Body *c, unsigned char *d, int *off, bool convert)
Pack an Body into a binary blob.
Definition: serialize.c:425
unsigned char * serial_dump_uint32_t(uint32_t s, unsigned char *d, int *off)
Pack a uint32_t into a binary blob.
Definition: serialize.c:83
void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
Unpack an integer from a binary blob.
Definition: serialize.c:98
void serial_restore_uint32_t(uint32_t *s, const unsigned char *d, int *off)
Unpack an uint32_t from a binary blob.
Definition: serialize.c:110
void serial_restore_body(struct Body *c, const unsigned char *d, int *off, bool convert)
Unpack a Body from a binary blob.
Definition: serialize.c:465
unsigned char * serial_dump_tags(const struct TagList *tags, unsigned char *d, int *off)
Pack a TagList into a binary blob.
Definition: serialize.c:592
void serial_restore_char(char **c, const unsigned char *d, int *off, bool convert)
Unpack a variable-length string from a binary blob.
Definition: serialize.c:178
unsigned char * serial_dump_buffer(struct Buffer *buf, unsigned char *d, int *off, bool convert)
Pack a Buffer into a binary blob.
Definition: serialize.c:322
unsigned char * serial_dump_envelope(struct Envelope *e, unsigned char *d, int *off, bool convert)
Pack an Envelope into a binary blob.
Definition: serialize.c:491
unsigned char * serial_dump_parameter(struct ParameterList *pl, unsigned char *d, int *off, bool convert)
Pack a Parameter into a binary blob.
Definition: serialize.c:371
unsigned char * serial_dump_stailq(struct ListHead *l, unsigned char *d, int *off, bool convert)
Pack a STAILQ into a binary blob.
Definition: serialize.c:273
unsigned char * serial_dump_address(struct AddressList *al, unsigned char *d, int *off, bool convert)
Pack an Address into a binary blob.
Definition: serialize.c:216
void serial_restore_buffer(struct Buffer *buf, const unsigned char *d, int *off, bool convert)
Unpack a Buffer from a binary blob.
Definition: serialize.c:346
The header of an Email.
Definition: envelope.h:54