fixing Makefile
authorvb
Wed, 04 Mar 2015 10:39:29 +0100
changeset 87060a95de62a8
parent 86 0e08645f7230
child 88 ac617f70bd7f
fixing Makefile
Makefile
src/mime.c
src/mime.h
     1.1 --- a/Makefile	Tue Mar 03 17:10:28 2015 +0100
     1.2 +++ b/Makefile	Wed Mar 04 10:39:29 2015 +0100
     1.3 @@ -18,8 +18,8 @@
     1.4  test: all
     1.5  	$(MAKE) -C test test
     1.6  
     1.7 -unittest: all
     1.8 -	$(MAKE) -C test unittest
     1.9 +unit_tests: all
    1.10 +	$(MAKE) -C test unit_tests
    1.11  
    1.12  package: clean
    1.13  	cd .. ; COPYFILE_DISABLE=true tar cjf pEpEngine.tar.bz2 pEpEngine
     2.1 --- a/src/mime.c	Tue Mar 03 17:10:28 2015 +0100
     2.2 +++ b/src/mime.c	Wed Mar 04 10:39:29 2015 +0100
     2.3 @@ -14,7 +14,7 @@
     2.4          const char *plaintext,
     2.5          const char *htmltext,
     2.6          bloblist_t *attachments,
     2.7 -        char **resulttext
     2.8 +        char **mimetext
     2.9      )
    2.10  {
    2.11      struct mailmime * mime = NULL;
    2.12 @@ -28,9 +28,9 @@
    2.13      PEP_STATUS error;
    2.14  
    2.15      assert(plaintext);
    2.16 -    assert(resulttext);
    2.17 +    assert(mimetext);
    2.18  
    2.19 -    *resulttext = NULL;
    2.20 +    *mimetext = NULL;
    2.21  
    2.22      if (htmltext) {
    2.23          mime = part_multiple_new("multipart/alternative", NULL);
    2.24 @@ -199,7 +199,7 @@
    2.25      assert(r == 0);
    2.26  
    2.27      mailmime_free(mime);
    2.28 -    *resulttext = buf;
    2.29 +    *mimetext = buf;
    2.30      return PEP_STATUS_OK;
    2.31  
    2.32  err_buffer:
     3.1 --- a/src/mime.h	Tue Mar 03 17:10:28 2015 +0100
     3.2 +++ b/src/mime.h	Wed Mar 04 10:39:29 2015 +0100
     3.3 @@ -14,7 +14,7 @@
     3.4  //      htmltext (in)           optional HTML version of message as UTF-8
     3.5  //                              string or NULL if it does not apply
     3.6  //      attachments (in)        attatchments or NULL if there are none
     3.7 -//      resulttext (out)        the resulting encoded text or NULL on any error
     3.8 +//      mimetext (out)          the resulting encoded text or NULL on any error
     3.9  //
    3.10  //  return value:
    3.11  //      PEP_STATUS_OK           if everything worked
    3.12 @@ -33,7 +33,37 @@
    3.13          const char *plaintext,
    3.14          const char *htmltext,
    3.15          bloblist_t *attachments,
    3.16 -        char **resulttext
    3.17 +        char **mimetext
    3.18 +    );
    3.19 +
    3.20 +
    3.21 +// mime_decode_text() - decode a MIME message
    3.22 +//
    3.23 +//  parameters:
    3.24 +//      mimetext (in)           MIME encoded text to decode
    3.25 +//      plaintext (out)         plaintext of message as UTF-8 string
    3.26 +//      htmltext (out)          optional HTML version of message as UTF-8
    3.27 +//                              string or NULL if it does not apply
    3.28 +//      attachments (out)       attatchments or NULL if there are none
    3.29 +//
    3.30 +//  return value:
    3.31 +//      PEP_STATUS_OK           if everything worked
    3.32 +//      PEP_BUFFER_TOO_SMALL    if encoded message size is too big to handle
    3.33 +//      PEP_CANNOT_CREATE_TEMP_FILE
    3.34 +//                              if there are issues with temp files; in
    3.35 +//                              this case errno will contain the underlying
    3.36 +//                              error
    3.37 +//      PEP_OUT_OF_MEMORY       if not enough memory could be allocated
    3.38 +//
    3.39 +//  caveat:
    3.40 +//      plaintext, htmltext and attachments will go to the ownership of the
    3.41 +//      caller; mimetext will remain in the ownership of the caller
    3.42 +
    3.43 +DYNAMIC_API PEP_STATUS mime_decode_text(
    3.44 +        const char *mimetext,
    3.45 +        char **plaintext,
    3.46 +        char **htmltext,
    3.47 +        bloblist_t **attachments
    3.48      );
    3.49  
    3.50  #ifdef __cplusplus