}
static unsigned char *dump_char_size(char *c, unsigned char *d, int *off,
- ssize_t size, int convert)
+ ssize_t size, bool convert)
{
char *p = c;
return d;
}
-static unsigned char *dump_char(char *c, unsigned char *d, int *off, int convert)
+static unsigned char *dump_char(char *c, unsigned char *d, int *off, bool convert)
{
return dump_char_size(c, d, off, mutt_strlen(c) + 1, convert);
}
-static void restore_char(char **c, const unsigned char *d, int *off, int convert)
+static void restore_char(char **c, const unsigned char *d, int *off, bool convert)
{
unsigned int size;
restore_int(&size, d, off);
*off += size;
}
-static unsigned char *dump_address(struct Address *a, unsigned char *d, int *off, int convert)
+static unsigned char *dump_address(struct Address *a, unsigned char *d, int *off, bool convert)
{
unsigned int counter = 0;
unsigned int start_off = *off;
while (a)
{
d = dump_char(a->personal, d, off, convert);
- d = dump_char(a->mailbox, d, off, 0);
+ d = dump_char(a->mailbox, d, off, false);
d = dump_int(a->group, d, off);
a = a->next;
counter++;
return d;
}
-static void restore_address(struct Address **a, const unsigned char *d, int *off, int convert)
+static void restore_address(struct Address **a, const unsigned char *d, int *off, bool convert)
{
unsigned int counter;
{
*a = rfc822_new_address();
restore_char(&(*a)->personal, d, off, convert);
- restore_char(&(*a)->mailbox, d, off, 0);
+ restore_char(&(*a)->mailbox, d, off, false);
restore_int((unsigned int *) &(*a)->group, d, off);
a = &(*a)->next;
counter--;
*a = NULL;
}
-static unsigned char *dump_stailq(struct ListHead *l, unsigned char *d, int *off, int convert)
+static unsigned char *dump_stailq(struct ListHead *l, unsigned char *d, int *off, bool convert)
{
unsigned int counter = 0;
unsigned int start_off = *off;
return d;
}
-static void restore_stailq(struct ListHead *l, const unsigned char *d, int *off, int convert)
+static void restore_stailq(struct ListHead *l, const unsigned char *d, int *off, bool convert)
{
unsigned int counter;
}
}
-static unsigned char *dump_buffer(struct Buffer *b, unsigned char *d, int *off, int convert)
+static unsigned char *dump_buffer(struct Buffer *b, unsigned char *d, int *off, bool convert)
{
if (!b)
{
return d;
}
-static void restore_buffer(struct Buffer **b, const unsigned char *d, int *off, int convert)
+static void restore_buffer(struct Buffer **b, const unsigned char *d, int *off, bool convert)
{
unsigned int used;
unsigned int offset;
(*b)->destroy = used;
}
-static unsigned char *dump_parameter(struct Parameter *p, unsigned char *d, int *off, int convert)
+static unsigned char *dump_parameter(struct Parameter *p, unsigned char *d,
+ int *off, bool convert)
{
unsigned int counter = 0;
unsigned int start_off = *off;
while (p)
{
- d = dump_char(p->attribute, d, off, 0);
+ d = dump_char(p->attribute, d, off, false);
d = dump_char(p->value, d, off, convert);
p = p->next;
counter++;
return d;
}
-static void restore_parameter(struct Parameter **p, const unsigned char *d, int *off, int convert)
+static void restore_parameter(struct Parameter **p, const unsigned char *d,
+ int *off, bool convert)
{
unsigned int counter;
while (counter)
{
*p = safe_malloc(sizeof(struct Parameter));
- restore_char(&(*p)->attribute, d, off, 0);
+ restore_char(&(*p)->attribute, d, off, false);
restore_char(&(*p)->value, d, off, convert);
p = &(*p)->next;
counter--;
*p = NULL;
}
-static unsigned char *dump_body(struct Body *c, unsigned char *d, int *off, int convert)
+static unsigned char *dump_body(struct Body *c, unsigned char *d, int *off, bool convert)
{
struct Body nb;
memcpy(d + *off, &nb, sizeof(struct Body));
*off += sizeof(struct Body);
- d = dump_char(nb.xtype, d, off, 0);
- d = dump_char(nb.subtype, d, off, 0);
+ d = dump_char(nb.xtype, d, off, false);
+ d = dump_char(nb.subtype, d, off, false);
d = dump_parameter(nb.parameter, d, off, convert);
return d;
}
-static void restore_body(struct Body *c, const unsigned char *d, int *off, int convert)
+static void restore_body(struct Body *c, const unsigned char *d, int *off, bool convert)
{
memcpy(c, d + *off, sizeof(struct Body));
*off += sizeof(struct Body);
- restore_char(&c->xtype, d, off, 0);
- restore_char(&c->subtype, d, off, 0);
+ restore_char(&c->xtype, d, off, false);
+ restore_char(&c->subtype, d, off, false);
restore_parameter(&c->parameter, d, off, convert);
restore_char(&c->d_filename, d, off, convert);
}
-static unsigned char *dump_envelope(struct Envelope *e, unsigned char *d, int *off, int convert)
+static unsigned char *dump_envelope(struct Envelope *e, unsigned char *d, int *off, bool convert)
{
d = dump_address(e->return_path, d, off, convert);
d = dump_address(e->from, d, off, convert);
else
d = dump_int(-1, d, off);
- d = dump_char(e->message_id, d, off, 0);
- d = dump_char(e->supersedes, d, off, 0);
- d = dump_char(e->date, d, off, 0);
+ d = dump_char(e->message_id, d, off, false);
+ d = dump_char(e->supersedes, d, off, false);
+ d = dump_char(e->date, d, off, false);
d = dump_char(e->x_label, d, off, convert);
d = dump_buffer(e->spam, d, off, convert);
- d = dump_stailq(&e->references, d, off, 0);
- d = dump_stailq(&e->in_reply_to, d, off, 0);
+ d = dump_stailq(&e->references, d, off, false);
+ d = dump_stailq(&e->in_reply_to, d, off, false);
d = dump_stailq(&e->userhdrs, d, off, convert);
#ifdef USE_NNTP
- d = dump_char(e->xref, d, off, 0);
- d = dump_char(e->followup_to, d, off, 0);
+ d = dump_char(e->xref, d, off, false);
+ d = dump_char(e->followup_to, d, off, false);
d = dump_char(e->x_comment_to, d, off, convert);
#endif
return d;
}
-static void restore_envelope(struct Envelope *e, const unsigned char *d, int *off, int convert)
+static void restore_envelope(struct Envelope *e, const unsigned char *d, int *off, bool convert)
{
int real_subj_off;
else
e->real_subj = NULL;
- restore_char(&e->message_id, d, off, 0);
- restore_char(&e->supersedes, d, off, 0);
- restore_char(&e->date, d, off, 0);
+ restore_char(&e->message_id, d, off, false);
+ restore_char(&e->supersedes, d, off, false);
+ restore_char(&e->date, d, off, false);
restore_char(&e->x_label, d, off, convert);
restore_buffer(&e->spam, d, off, convert);
- restore_stailq(&e->references, d, off, 0);
- restore_stailq(&e->in_reply_to, d, off, 0);
+ restore_stailq(&e->references, d, off, false);
+ restore_stailq(&e->in_reply_to, d, off, false);
restore_stailq(&e->userhdrs, d, off, convert);
#ifdef USE_NNTP
- restore_char(&e->xref, d, off, 0);
- restore_char(&e->followup_to, d, off, 0);
+ restore_char(&e->xref, d, off, false);
+ restore_char(&e->followup_to, d, off, false);
restore_char(&e->x_comment_to, d, off, convert);
#endif
}
{
unsigned char *d = NULL;
struct Header nh;
- int convert = !Charset_is_utf8;
+ bool convert = !Charset_is_utf8;
*off = 0;
d = lazy_malloc(sizeof(union Validate));
{
int off = 0;
struct Header *h = mutt_new_header();
- int convert = !Charset_is_utf8;
+ bool convert = !Charset_is_utf8;
/* skip validate */
off += sizeof(union Validate);