src/mime.h
author vb
Sun, 08 Feb 2015 11:33:04 -0500
changeset 48 9ff5d2dfa75a
child 54 8f6b3a6b77a8
permissions -rw-r--r--
...
vb@48
     1
#pragma once
vb@48
     2
vb@48
     3
#include "pEpEngine.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@48
    16
//      resulttext (out)        the resulting encoded text
vb@48
    17
//
vb@48
    18
//  return value:
vb@48
    19
//      PEP_STATUS_OK           if everything worked
vb@48
    20
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
vb@48
    21
//      PEP_CANNOT_CREATE_TEMP_FILE
vb@48
    22
//                              if there are issues with temp files; in
vb@48
    23
//                              this case errno will contain the underlying
vb@48
    24
//                              error
vb@48
    25
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
vb@48
    26
//
vb@48
    27
//  caveat:
vb@48
    28
//      the resulttext will go to the ownership of the caller; plaintext
vb@48
    29
//      and htmltext will remain in the ownership of the caller
vb@48
    30
vb@48
    31
DYNAMIC_API PEP_STATUS mime_encode_text(
vb@48
    32
        const char *plaintext,
vb@48
    33
        const char *htmltext,
vb@48
    34
        char **resulttext
vb@48
    35
    );
vb@48
    36
vb@48
    37
#ifdef __cplusplus
vb@48
    38
}
vb@48
    39
#endif
vb@48
    40