src/etpan_mime.h
author Volker Birk <vb@pep-project.org>
Wed, 29 Apr 2015 14:51:33 +0200
changeset 229 313d152239bf
parent 159 ad6d0993d1ab
child 1513 e7f7e42385b5
permissions -rw-r--r--
fixing preprocessor
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
        int force_single
vb@48
    11
    );
vb@48
    12
vb@114
    13
struct mailmime * get_pgp_encrypted_part(void);
vb@114
    14
vb@48
    15
struct mailmime * get_text_part(
vb@114
    16
        const char * filename,
vb@48
    17
        const char * mime_type,
vb@48
    18
        const char * text,
vb@48
    19
        size_t length,
vb@48
    20
        int encoding_type
vb@48
    21
    );
vb@48
    22
vb@59
    23
struct mailmime * get_file_part(
vb@59
    24
        const char * filename,
vb@59
    25
        const char * mime_type,
vb@59
    26
        char * data,
vb@59
    27
        size_t length
vb@59
    28
    );
vb@59
    29
vb@116
    30
struct mailmime * part_multiple_new(const char *type);
vb@48
    31
vb@89
    32
typedef void *(*_new_func_t)(void *);
vb@89
    33
vb@89
    34
struct mailimf_field * _new_field(
vb@89
    35
        int type,
vb@89
    36
        _new_func_t new_func,
vb@89
    37
        void *value
vb@89
    38
    );
vb@89
    39
vb@89
    40
void _free_field(struct mailimf_field *field);
vb@89
    41
vb@89
    42
int _append_field(
vb@89
    43
        clist *list,
vb@89
    44
        int type,
vb@89
    45
        _new_func_t new_func,
vb@89
    46
        void *value
vb@89
    47
    );
vb@89
    48
vb@89
    49
struct mailimf_date_time * timestamp_to_etpantime(const struct tm *ts);
vb@89
    50
struct tm * etpantime_to_timestamp(const struct mailimf_date_time *et);
vb@89
    51
vb@90
    52
struct mailimf_mailbox * mailbox_from_string(
vb@90
    53
        const char *name,
vb@90
    54
        const char *address
vb@90
    55
    );
vb@90
    56
vb@94
    57
struct mailimf_field * create_optional_field(
vb@94
    58
        const char *field,
vb@94
    59
        const char *value
vb@94
    60
    );
vb@94
    61
vb@94
    62
int _append_optional_field(
vb@94
    63
        clist *list,
vb@94
    64
        const char *field,
vb@94
    65
        const char *value
vb@94
    66
    );
vb@94
    67
vb@147
    68
clist * _get_fields(struct mailmime * mime);
vb@147
    69
struct mailmime_content * _get_content(struct mailmime * mime);
vb@154
    70
char * _get_filename(struct mailmime *mime);
vb@151
    71
bool _is_multipart(struct mailmime_content *content, const char *subtype);
vb@147
    72
bool _is_PGP_MIME(struct mailmime_content *content);
vb@152
    73
bool _is_text_part(struct mailmime_content *content, const char *subtype);
vb@147
    74
vb@159
    75
int _get_content_type(
vb@159
    76
        const struct mailmime_content *content,
vb@159
    77
        char **type,
vb@159
    78
        char **charset
vb@159
    79
    );
vb@159
    80