~ubuntu-branches/ubuntu/wily/dovecot/wily

« back to all changes in this revision

Viewing changes to src/lib-imap/imap-bodystructure.h

  • Committer: Package Import Robot
  • Author(s): Jaldhar H. Vyas
  • Date: 2013-09-09 00:57:32 UTC
  • mfrom: (1.13.11)
  • mto: (4.8.5 experimental) (1.16.1)
  • mto: This revision was merged to the branch mainline in revision 97.
  • Revision ID: package-import@ubuntu.com-20130909005732-dn1eell8srqbhh0e
Tags: upstream-2.2.5
ImportĀ upstreamĀ versionĀ 2.2.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#ifndef IMAP_BODYSTRUCTURE_H
2
2
#define IMAP_BODYSTRUCTURE_H
3
3
 
 
4
struct message_part_body_data {
 
5
        pool_t pool;
 
6
        /* NOTE: all the strings are stored via imap_quote(), so they contain
 
7
           "quoted-text" or {123}\r\nliterals */
 
8
        const char *content_type, *content_subtype;
 
9
        const char *content_type_params; /* "key" "value" "key2" "value2" .. */
 
10
        const char *content_transfer_encoding;
 
11
        const char *content_id;
 
12
        const char *content_description;
 
13
        const char *content_disposition;
 
14
        const char *content_disposition_params; /* "key" "value" "key2" "value2" .. */
 
15
        const char *content_md5;
 
16
        const char *content_language; /* "lang1" "lang2" "lang3" .. */
 
17
        const char *content_location;
 
18
 
 
19
        /* either one of these is set, but not both: */
 
20
        struct message_part_envelope_data *envelope;
 
21
        const char *envelope_str;
 
22
};
 
23
 
4
24
struct message_part;
5
25
struct message_header_line;
6
26
 
13
33
bool imap_bodystructure_is_plain_7bit(const struct message_part *part)
14
34
        ATTR_PURE;
15
35
 
 
36
/* Write a BODY/BODYSTRUCTURE from given message_part. The
 
37
   message_part->contexts must contain struct message_part_body_data.
 
38
   part->body_size.virtual_size and .lines are also used for writing it. */
16
39
void imap_bodystructure_write(const struct message_part *part,
17
40
                              string_t *dest, bool extended);
18
41
 
19
 
/* Return BODY part from BODYSTRUCTURE */
20
 
bool imap_body_parse_from_bodystructure(const char *bodystructure,
21
 
                                        string_t *dest);
 
42
/* Parse BODYSTRUCTURE and save the contents to message_part->contexts.
 
43
   Returns 0 if ok, -1 if bodystructure wasn't valid. */
 
44
int imap_bodystructure_parse(const char *bodystructure, pool_t pool,
 
45
                             struct message_part *parts, const char **error_r);
 
46
 
 
47
/* Get BODY part from BODYSTRUCTURE and write it to dest.
 
48
   Returns 0 if ok, -1 if bodystructure wasn't valid. */
 
49
int imap_body_parse_from_bodystructure(const char *bodystructure,
 
50
                                       string_t *dest, const char **error_r);
22
51
 
23
52
#endif