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