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
     1 #pragma once
     2 
     3 #include <libetpan/libetpan.h>
     4 #include <libetpan/mailmime.h>
     5 #include <libetpan/mailmime_encode.h>
     6 
     7 struct mailmime * part_new_empty(
     8         struct mailmime_content * content,
     9         struct mailmime_fields * mime_fields,
    10         int force_single
    11     );
    12 
    13 struct mailmime * get_pgp_encrypted_part(void);
    14 
    15 struct mailmime * get_text_part(
    16         const char * filename,
    17         const char * mime_type,
    18         const char * text,
    19         size_t length,
    20         int encoding_type
    21     );
    22 
    23 struct mailmime * get_file_part(
    24         const char * filename,
    25         const char * mime_type,
    26         char * data,
    27         size_t length
    28     );
    29 
    30 struct mailmime * part_multiple_new(const char *type);
    31 
    32 typedef void *(*_new_func_t)(void *);
    33 
    34 struct mailimf_field * _new_field(
    35         int type,
    36         _new_func_t new_func,
    37         void *value
    38     );
    39 
    40 void _free_field(struct mailimf_field *field);
    41 
    42 int _append_field(
    43         clist *list,
    44         int type,
    45         _new_func_t new_func,
    46         void *value
    47     );
    48 
    49 struct mailimf_date_time * timestamp_to_etpantime(const struct tm *ts);
    50 struct tm * etpantime_to_timestamp(const struct mailimf_date_time *et);
    51 
    52 struct mailimf_mailbox * mailbox_from_string(
    53         const char *name,
    54         const char *address
    55     );
    56 
    57 struct mailimf_field * create_optional_field(
    58         const char *field,
    59         const char *value
    60     );
    61 
    62 int _append_optional_field(
    63         clist *list,
    64         const char *field,
    65         const char *value
    66     );
    67 
    68 clist * _get_fields(struct mailmime * mime);
    69 struct mailmime_content * _get_content(struct mailmime * mime);
    70 char * _get_filename(struct mailmime *mime);
    71 bool _is_multipart(struct mailmime_content *content, const char *subtype);
    72 bool _is_PGP_MIME(struct mailmime_content *content);
    73 bool _is_text_part(struct mailmime_content *content, const char *subtype);
    74 
    75 int _get_content_type(
    76         const struct mailmime_content *content,
    77         char **type,
    78         char **charset
    79     );
    80