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