NeoMutt  2024-04-25-100-gcb3684
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
serialize.h
Go to the documentation of this file.
1
24#ifndef MUTT_HCACHE_SERIALIZE_H
25#define MUTT_HCACHE_SERIALIZE_H
26
27#include <stdbool.h>
28#include <stddef.h>
29#include <stdint.h>
30#include <sys/types.h>
31
32struct AddressList;
33struct Body;
34struct Buffer;
35struct Envelope;
36struct ListHead;
37struct ParameterList;
38struct TagList;
39
40unsigned char *serial_dump_address (const struct AddressList *al, unsigned char *d, int *off, bool convert);
41unsigned char *serial_dump_body (const struct Body *b, unsigned char *d, int *off, bool convert);
42unsigned char *serial_dump_tags (const struct TagList *tl, unsigned char *d, int *off);
43unsigned char *serial_dump_buffer (const struct Buffer *buf, unsigned char *d, int *off, bool convert);
44unsigned char *serial_dump_char (const char *c, unsigned char *d, int *off, bool convert);
45unsigned char *serial_dump_char_size(const char *c, ssize_t size, unsigned char *d, int *off, bool convert);
46unsigned char *serial_dump_envelope (const struct Envelope *env, unsigned char *d, int *off, bool convert);
47unsigned char *serial_dump_int (const unsigned int i, unsigned char *d, int *off);
48unsigned char *serial_dump_uint32_t (const uint32_t s, unsigned char *d, int *off);
49unsigned char *serial_dump_uint64_t (const uint64_t s, unsigned char *d, int *off);
50unsigned char *serial_dump_parameter(const struct ParameterList *pl, unsigned char *d, int *off, bool convert);
51unsigned char *serial_dump_stailq (const struct ListHead *l, unsigned char *d, int *off, bool convert);
52
53void serial_restore_address (struct AddressList *al, const unsigned char *d, int *off, bool convert);
54void serial_restore_body (struct Body *b, const unsigned char *d, int *off, bool convert);
55void serial_restore_tags (struct TagList *tl, const unsigned char *d, int *off);
56void serial_restore_buffer (struct Buffer *buf, const unsigned char *d, int *off, bool convert);
57void serial_restore_char (char **c, const unsigned char *d, int *off, bool convert);
58void serial_restore_envelope (struct Envelope *env, const unsigned char *d, int *off, bool convert);
59void serial_restore_int (unsigned int *i, const unsigned char *d, int *off);
60void serial_restore_uint32_t (uint32_t *s, const unsigned char *d, int *off);
61void serial_restore_uint64_t (uint64_t *s, const unsigned char *d, int *off);
62void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert);
63void serial_restore_stailq (struct ListHead *l, const unsigned char *d, int *off, bool convert);
64
65void lazy_realloc(void *ptr, size_t size);
66
67#endif /* MUTT_HCACHE_SERIALIZE_H */
unsigned char * serial_dump_body(const struct Body *b, unsigned char *d, int *off, bool convert)
Pack an Body into a binary blob.
Definition: serialize.c:519
unsigned char * serial_dump_tags(const struct TagList *tl, unsigned char *d, int *off)
Pack a TagList into a binary blob.
Definition: serialize.c:686
void serial_restore_tags(struct TagList *tl, const unsigned char *d, int *off)
Unpack a TagList from a binary blob.
Definition: serialize.c:711
unsigned char * serial_dump_uint64_t(const uint64_t s, unsigned char *d, int *off)
Pack a uint64_t into a binary blob.
Definition: serialize.c:99
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:202
unsigned char * serial_dump_int(const unsigned int i, unsigned char *d, int *off)
Pack an integer into a binary blob.
Definition: serialize.c:67
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:382
void serial_restore_envelope(struct Envelope *env, const unsigned char *d, int *off, bool convert)
Unpack an Envelope from a binary blob.
Definition: serialize.c:632
unsigned char * serial_dump_envelope(const struct Envelope *env, unsigned char *d, int *off, bool convert)
Pack an Envelope into a binary blob.
Definition: serialize.c:584
unsigned char * serial_dump_buffer(const struct Buffer *buf, unsigned char *d, int *off, bool convert)
Pack a Buffer into a binary blob.
Definition: serialize.c:359
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:336
unsigned char * serial_dump_address(const struct AddressList *al, unsigned char *d, int *off, bool convert)
Pack an Address into a binary blob.
Definition: serialize.c:239
void serial_restore_uint64_t(uint64_t *s, const unsigned char *d, int *off)
Unpack an uint64_t from a binary blob.
Definition: serialize.c:138
void lazy_realloc(void *ptr, size_t size)
Reallocate some memory.
Definition: serialize.c:50
unsigned char * serial_dump_parameter(const struct ParameterList *pl, unsigned char *d, int *off, bool convert)
Pack a Parameter into a binary blob.
Definition: serialize.c:406
void serial_restore_body(struct Body *b, const unsigned char *d, int *off, bool convert)
Unpack a Body from a binary blob.
Definition: serialize.c:550
unsigned char * serial_dump_uint32_t(const uint32_t s, unsigned char *d, int *off)
Pack a uint32_t into a binary blob.
Definition: serialize.c:83
unsigned char * serial_dump_stailq(const struct ListHead *l, unsigned char *d, int *off, bool convert)
Pack a STAILQ into a binary blob.
Definition: serialize.c:309
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:434
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.
Definition: serialize.c:153
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:268
void serial_restore_int(unsigned int *i, const unsigned char *d, int *off)
Unpack an integer from a binary blob.
Definition: serialize.c:114
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:126
unsigned char * serial_dump_char(const char *c, unsigned char *d, int *off, bool convert)
Pack a variable-length string into a binary blob.
Definition: serialize.c:190
The body of an email.
Definition: body.h:36
String manipulation buffer.
Definition: buffer.h:36
The header of an Email.
Definition: envelope.h:57