src/mime.h
author vb
Mon, 09 Feb 2015 09:49:26 -0500
changeset 59 88429085f8da
parent 54 8f6b3a6b77a8
child 87 060a95de62a8
permissions -rw-r--r--
...
vb@48
     1
#pragma once
vb@48
     2
vb@59
     3
#include "transport.h"
vb@48
     4
vb@48
     5
#ifdef __cplusplus
vb@48
     6
extern "C" {
vb@48
     7
#endif
vb@48
     8
vb@48
     9
vb@48
    10
// mime_encode_text() - encode a MIME message
vb@48
    11
//
vb@48
    12
//  parameters:
vb@48
    13
//      plaintext (in)          plaintext of message as UTF-8 string
vb@48
    14
//      htmltext (in)           optional HTML version of message as UTF-8
vb@48
    15
//                              string or NULL if it does not apply
vb@59
    16
//      attachments (in)        attatchments or NULL if there are none
vb@54
    17
//      resulttext (out)        the resulting encoded text or NULL on any error
vb@48
    18
//
vb@48
    19
//  return value:
vb@48
    20
//      PEP_STATUS_OK           if everything worked
vb@48
    21
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
vb@48
    22
//      PEP_CANNOT_CREATE_TEMP_FILE
vb@48
    23
//                              if there are issues with temp files; in
vb@48
    24
//                              this case errno will contain the underlying
vb@48
    25
//                              error
vb@48
    26
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
vb@48
    27
//
vb@48
    28
//  caveat:
vb@59
    29
//      the resulttext will go to the ownership of the caller; plaintext,
vb@59
    30
//      htmltext and attachments will remain in the ownership of the caller
vb@48
    31
vb@48
    32
DYNAMIC_API PEP_STATUS mime_encode_text(
vb@48
    33
        const char *plaintext,
vb@48
    34
        const char *htmltext,
vb@59
    35
        bloblist_t *attachments,
vb@48
    36
        char **resulttext
vb@48
    37
    );
vb@48
    38
vb@48
    39
#ifdef __cplusplus
vb@48
    40
}
vb@48
    41
#endif
vb@48
    42