view src/lib-imap/imap-bodystructure.h @ 21633:3a88d30ad000

lib-imap: imap-bodystructure: Moved message_part_data header parsing and query functions to their own module in lib-mail. Moved code from imap-bodystructure and imap-envelope.
author Stephan Bosch <stephan.bosch@dovecot.fi>
date Sun, 23 Oct 2016 20:05:33 +0200
parents eff89c5ea738
children 140000f0ba69
line wrap: on
line source

#ifndef IMAP_BODYSTRUCTURE_H
#define IMAP_BODYSTRUCTURE_H

struct message_part;
struct message_header_line;

/* Write a BODY/BODYSTRUCTURE from given message_part. The message_part->data
   field must be set. part->body_size.virtual_size and .lines are also used
   for writing it. */
void imap_bodystructure_write(const struct message_part *part,
			      string_t *dest, bool extended);

/* Parse BODYSTRUCTURE and save the contents to message_part->data for each
   message tree node. Returns 0 if ok, -1 if bodystructure wasn't valid. */
int imap_bodystructure_parse(const char *bodystructure, pool_t pool,
			     struct message_part *parts, const char **error_r);

/* Get BODY part from BODYSTRUCTURE and write it to dest.
   Returns 0 if ok, -1 if bodystructure wasn't valid. */
int imap_body_parse_from_bodystructure(const char *bodystructure,
				       string_t *dest, const char **error_r);

#endif