src/etpan_mime.h
author Krista Bennett <krista@pep-project.org>
Wed, 15 Mar 2017 18:02:46 +0100
changeset 1674 5639f969866a
parent 1513 e7f7e42385b5
child 1714 a6712af7a964
permissions -rw-r--r--
Added pgp_encrypt_only stubs for NetPGP
     1 // This file is under GNU General Public License 3.0
     2 // see LICENSE.txt
     3 
     4 #pragma once
     5 
     6 #include <libetpan/libetpan.h>
     7 #include <libetpan/mailmime.h>
     8 #include <libetpan/mailmime_encode.h>
     9 
    10 struct mailmime * part_new_empty(
    11         struct mailmime_content * content,
    12         struct mailmime_fields * mime_fields,
    13         int force_single
    14     );
    15 
    16 struct mailmime * get_pgp_encrypted_part(void);
    17 
    18 struct mailmime * get_text_part(
    19         const char * filename,
    20         const char * mime_type,
    21         const char * text,
    22         size_t length,
    23         int encoding_type
    24     );
    25 
    26 struct mailmime * get_file_part(
    27         const char * filename,
    28         const char * mime_type,
    29         char * data,
    30         size_t length
    31     );
    32 
    33 struct mailmime * part_multiple_new(const char *type);
    34 
    35 typedef void *(*_new_func_t)(void *);
    36 
    37 struct mailimf_field * _new_field(
    38         int type,
    39         _new_func_t new_func,
    40         void *value
    41     );
    42 
    43 void _free_field(struct mailimf_field *field);
    44 
    45 int _append_field(
    46         clist *list,
    47         int type,
    48         _new_func_t new_func,
    49         void *value
    50     );
    51 
    52 struct mailimf_date_time * timestamp_to_etpantime(const struct tm *ts);
    53 struct tm * etpantime_to_timestamp(const struct mailimf_date_time *et);
    54 
    55 struct mailimf_mailbox * mailbox_from_string(
    56         const char *name,
    57         const char *address
    58     );
    59 
    60 struct mailimf_field * create_optional_field(
    61         const char *field,
    62         const char *value
    63     );
    64 
    65 int _append_optional_field(
    66         clist *list,
    67         const char *field,
    68         const char *value
    69     );
    70 
    71 clist * _get_fields(struct mailmime * mime);
    72 struct mailmime_content * _get_content(struct mailmime * mime);
    73 char * _get_filename(struct mailmime *mime);
    74 bool _is_multipart(struct mailmime_content *content, const char *subtype);
    75 bool _is_PGP_MIME(struct mailmime_content *content);
    76 bool _is_text_part(struct mailmime_content *content, const char *subtype);
    77 
    78 int _get_content_type(
    79         const struct mailmime_content *content,
    80         char **type,
    81         char **charset
    82     );
    83