src/mime.h
author vb
Wed, 11 Mar 2015 12:25:19 +0100
changeset 101 d90b10cb193d
parent 89 aef5a4bc78f3
child 113 4bee48270834
permissions -rw-r--r--
more
vb@48
     1
#pragma once
vb@48
     2
vb@101
     3
#include "message.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@89
    10
// mime_encode_message() - encode a MIME message
vb@48
    11
//
vb@48
    12
//  parameters:
vb@89
    13
//      msg (in)                message to encode
vb@87
    14
//      mimetext (out)          the resulting encoded text or NULL on any error
vb@48
    15
//
vb@48
    16
//  return value:
vb@48
    17
//      PEP_STATUS_OK           if everything worked
vb@48
    18
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
vb@48
    19
//      PEP_CANNOT_CREATE_TEMP_FILE
vb@48
    20
//                              if there are issues with temp files; in
vb@48
    21
//                              this case errno will contain the underlying
vb@48
    22
//                              error
vb@48
    23
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
vb@48
    24
//
vb@48
    25
//  caveat:
vb@89
    26
//      the resulttext will go to the ownership of the caller
vb@89
    27
//      the message will remain in the ownership of the caller
vb@48
    28
vb@89
    29
DYNAMIC_API PEP_STATUS mime_encode_message(
vb@89
    30
        const message * msg,
vb@87
    31
        char **mimetext
vb@87
    32
    );
vb@87
    33
vb@87
    34
vb@89
    35
// mime_decode_message() - decode a MIME message
vb@87
    36
//
vb@87
    37
//  parameters:
vb@87
    38
//      mimetext (in)           MIME encoded text to decode
vb@89
    39
//      msg (out)               decoded message
vb@87
    40
//
vb@87
    41
//  return value:
vb@87
    42
//      PEP_STATUS_OK           if everything worked
vb@87
    43
//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
vb@87
    44
//      PEP_CANNOT_CREATE_TEMP_FILE
vb@87
    45
//                              if there are issues with temp files; in
vb@87
    46
//                              this case errno will contain the underlying
vb@87
    47
//                              error
vb@87
    48
//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
vb@87
    49
//
vb@87
    50
//  caveat:
vb@89
    51
//      the decoded message will go to the ownership of the caller; mimetext
vb@89
    52
//      will remain in the ownership of the caller
vb@87
    53
vb@89
    54
DYNAMIC_API PEP_STATUS mime_decode_message(
vb@87
    55
        const char *mimetext,
vb@89
    56
        message **msg
vb@48
    57
    );
vb@48
    58
vb@48
    59
#ifdef __cplusplus
vb@48
    60
}
vb@48
    61
#endif
vb@48
    62