forked from neomutt/neomutt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serialize.h
67 lines (60 loc) · 3.49 KB
/
serialize.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* @file
* Email-object serialiser
*
* @authors
* Copyright (C) 2018-2023 Richard Russon <[email protected]>
* Copyright (C) 2021 Pietro Cerutti <[email protected]>
*
* @copyright
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU General Public License as published by the Free Software
* Foundation, either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MUTT_HCACHE_SERIALIZE_H
#define MUTT_HCACHE_SERIALIZE_H
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/types.h>
struct AddressList;
struct Body;
struct Buffer;
struct Envelope;
struct ListHead;
struct ParameterList;
struct TagList;
unsigned char *serial_dump_address (const struct AddressList *al, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_body (const struct Body *b, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_tags (const struct TagList *tl, unsigned char *d, int *off);
unsigned char *serial_dump_buffer (const struct Buffer *buf, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_char (const char *c, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_char_size(const char *c, ssize_t size, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_envelope (const struct Envelope *env, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_int (const unsigned int i, unsigned char *d, int *off);
unsigned char *serial_dump_uint32_t (const uint32_t s, unsigned char *d, int *off);
unsigned char *serial_dump_uint64_t (const uint64_t s, unsigned char *d, int *off);
unsigned char *serial_dump_parameter(const struct ParameterList *pl, unsigned char *d, int *off, bool convert);
unsigned char *serial_dump_stailq (const struct ListHead *l, unsigned char *d, int *off, bool convert);
void serial_restore_address (struct AddressList *al, const unsigned char *d, int *off, bool convert);
void serial_restore_body (struct Body *b, const unsigned char *d, int *off, bool convert);
void serial_restore_tags (struct TagList *tl, const unsigned char *d, int *off);
void serial_restore_buffer (struct Buffer *buf, const unsigned char *d, int *off, bool convert);
void serial_restore_char (char **c, const unsigned char *d, int *off, bool convert);
void serial_restore_envelope (struct Envelope *env, const unsigned char *d, int *off, bool convert);
void serial_restore_int (unsigned int *i, const unsigned char *d, int *off);
void serial_restore_uint32_t (uint32_t *s, const unsigned char *d, int *off);
void serial_restore_uint64_t (uint64_t *s, const unsigned char *d, int *off);
void serial_restore_parameter(struct ParameterList *pl, const unsigned char *d, int *off, bool convert);
void serial_restore_stailq (struct ListHead *l, const unsigned char *d, int *off, bool convert);
void lazy_realloc(void *ptr, size_t size);
#endif /* MUTT_HCACHE_SERIALIZE_H */