src/etpan_mime.h
author vb
Mon, 09 Mar 2015 23:20:08 +0100
changeset 94 9ec29aa10b58
parent 90 42b5eb9d5af2
child 114 7a006f74365d
permissions -rw-r--r--
...
vb@48
     1
#pragma once
vb@48
     2
vb@48
     3
#include <libetpan/libetpan.h>
vb@94
     4
#include <libetpan/mailmime.h>
vb@94
     5
#include <libetpan/mailmime_encode.h>
vb@48
     6
vb@48
     7
struct mailmime * part_new_empty(
vb@48
     8
        struct mailmime_content * content,
vb@48
     9
        struct mailmime_fields * mime_fields,
vb@48
    10
        const char * boundary_prefix,
vb@48
    11
        int force_single
vb@48
    12
    );
vb@48
    13
vb@48
    14
struct mailmime * get_text_part(
vb@48
    15
        const char * mime_type,
vb@48
    16
        const char * text,
vb@48
    17
        size_t length,
vb@48
    18
        int encoding_type
vb@48
    19
    );
vb@48
    20
vb@59
    21
struct mailmime * get_file_part(
vb@59
    22
        const char * filename,
vb@59
    23
        const char * mime_type,
vb@59
    24
        char * data,
vb@59
    25
        size_t length
vb@59
    26
    );
vb@59
    27
vb@48
    28
struct mailmime * part_multiple_new(
vb@48
    29
        const char * type,
vb@48
    30
        const char * boundary_prefix
vb@48
    31
    );
vb@48
    32
vb@89
    33
typedef void *(*_new_func_t)(void *);
vb@89
    34
vb@89
    35
struct mailimf_field * _new_field(
vb@89
    36
        int type,
vb@89
    37
        _new_func_t new_func,
vb@89
    38
        void *value
vb@89
    39
    );
vb@89
    40
vb@89
    41
void _free_field(struct mailimf_field *field);
vb@89
    42
vb@89
    43
int _append_field(
vb@89
    44
        clist *list,
vb@89
    45
        int type,
vb@89
    46
        _new_func_t new_func,
vb@89
    47
        void *value
vb@89
    48
    );
vb@89
    49
vb@89
    50
struct mailimf_date_time * timestamp_to_etpantime(const struct tm *ts);
vb@89
    51
struct tm * etpantime_to_timestamp(const struct mailimf_date_time *et);
vb@89
    52
vb@90
    53
struct mailimf_mailbox * mailbox_from_string(
vb@90
    54
        const char *name,
vb@90
    55
        const char *address
vb@90
    56
    );
vb@90
    57
vb@94
    58
struct mailimf_field * create_optional_field(
vb@94
    59
        const char *field,
vb@94
    60
        const char *value
vb@94
    61
    );
vb@94
    62
vb@94
    63
int _append_optional_field(
vb@94
    64
        clist *list,
vb@94
    65
        const char *field,
vb@94
    66
        const char *value
vb@94
    67
    );
vb@94
    68