src/etpan_mime.h
author vb
Sun, 15 Mar 2015 13:06:38 +0100
changeset 114 7a006f74365d
parent 94 9ec29aa10b58
child 116 e4d286e7b300
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@114
    14
struct mailmime * get_pgp_encrypted_part(void);
vb@114
    15
vb@48
    16
struct mailmime * get_text_part(
vb@114
    17
        const char * filename,
vb@48
    18
        const char * mime_type,
vb@48
    19
        const char * text,
vb@48
    20
        size_t length,
vb@48
    21
        int encoding_type
vb@48
    22
    );
vb@48
    23
vb@59
    24
struct mailmime * get_file_part(
vb@59
    25
        const char * filename,
vb@59
    26
        const char * mime_type,
vb@59
    27
        char * data,
vb@59
    28
        size_t length
vb@59
    29
    );
vb@59
    30
vb@48
    31
struct mailmime * part_multiple_new(
vb@48
    32
        const char * type,
vb@48
    33
        const char * boundary_prefix
vb@48
    34
    );
vb@48
    35
vb@89
    36
typedef void *(*_new_func_t)(void *);
vb@89
    37
vb@89
    38
struct mailimf_field * _new_field(
vb@89
    39
        int type,
vb@89
    40
        _new_func_t new_func,
vb@89
    41
        void *value
vb@89
    42
    );
vb@89
    43
vb@89
    44
void _free_field(struct mailimf_field *field);
vb@89
    45
vb@89
    46
int _append_field(
vb@89
    47
        clist *list,
vb@89
    48
        int type,
vb@89
    49
        _new_func_t new_func,
vb@89
    50
        void *value
vb@89
    51
    );
vb@89
    52
vb@89
    53
struct mailimf_date_time * timestamp_to_etpantime(const struct tm *ts);
vb@89
    54
struct tm * etpantime_to_timestamp(const struct mailimf_date_time *et);
vb@89
    55
vb@90
    56
struct mailimf_mailbox * mailbox_from_string(
vb@90
    57
        const char *name,
vb@90
    58
        const char *address
vb@90
    59
    );
vb@90
    60
vb@94
    61
struct mailimf_field * create_optional_field(
vb@94
    62
        const char *field,
vb@94
    63
        const char *value
vb@94
    64
    );
vb@94
    65
vb@94
    66
int _append_optional_field(
vb@94
    67
        clist *list,
vb@94
    68
        const char *field,
vb@94
    69
        const char *value
vb@94
    70
    );
vb@94
    71