message-part-serialize.c revision ab170d6cf8aeb515bac7c07b37e525cbad96c299
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "message-parser.h"
#include "message-part-serialize.h"
/*
Serialized a series of SerializedMessageParts:
root part
root's first children
children's first children
...
root's next children
...
*/
/* struct is 8 byte aligned */
typedef struct {
unsigned int header_lines;
unsigned int body_lines;
unsigned int children_count;
unsigned int flags;
unsigned int *children_count,
{
unsigned int buf_size;
/* make sure we have space */
*size *= 2;
}
/* create serialized part */
spart->children_count = 0;
if (children_count != NULL)
(*children_count)++;
(*pos)++;
}
}
}
{
buf_size = 32;
pos = 0;
return spart_base;
}
static MessagePart *
const SerializedMessagePart **spart_pos,
unsigned int *count, unsigned int child_count)
{
const SerializedMessagePart *spart;
unsigned int i;
first_part = NULL;
for (i = 0; i < child_count && *count > 0; i++) {
(*spart_pos)++;
(*count)--;
if (first_part == NULL)
first_part = part;
}
return first_part;
}
unsigned int size)
{
const SerializedMessagePart *spart;
unsigned int count;
/* make sure it looks valid */
return NULL;
}