Windoze fixes
authorVolker Birk <vb@pep-project.org>
Wed, 25 Mar 2015 15:20:25 +0100
changeset 1255119178815d8
parent 124 e2930c783d3c
child 126 13fc88761554
Windoze fixes
pEpEngine.vcxproj
pEpEngine.vcxproj.filters
src/bloblist.c
src/etpan_mime.c
src/identity_list.c
src/message.c
src/message_api.c
src/mime.c
src/pEpEngine.c
src/pEp_internal.h
src/platform_windows.h
src/platform_windows.obj
src/resource.h
src/stringlist.c
src/stringpair.c
src/timestamp.c
src/transport.c
src/wrappers.h
     1.1 --- a/pEpEngine.vcxproj	Wed Mar 25 12:55:15 2015 +0100
     1.2 +++ b/pEpEngine.vcxproj	Wed Mar 25 15:20:25 2015 +0100
     1.3 @@ -81,24 +81,49 @@
     1.4      </Link>
     1.5    </ItemDefinitionGroup>
     1.6    <ItemGroup>
     1.7 +    <ClCompile Include="src\bloblist.c" />
     1.8      <ClCompile Include="src\cryptotech.c" />
     1.9 +    <ClCompile Include="src\email.c" />
    1.10 +    <ClCompile Include="src\etpan_mime.c" />
    1.11 +    <ClCompile Include="src\identity_list.c" />
    1.12      <ClCompile Include="src\keymanagement.c" />
    1.13 +    <ClCompile Include="src\message.c" />
    1.14 +    <ClCompile Include="src\message_api.c" />
    1.15 +    <ClCompile Include="src\mime.c" />
    1.16      <ClCompile Include="src\pEpEngine.c" />
    1.17      <ClCompile Include="src\pgp_gpg.c" />
    1.18      <ClCompile Include="src\platform_windows.cpp" />
    1.19      <ClCompile Include="src\sqlite3.c" />
    1.20 +    <ClCompile Include="src\stringlist.c" />
    1.21 +    <ClCompile Include="src\stringpair.c" />
    1.22 +    <ClCompile Include="src\timestamp.c" />
    1.23      <ClCompile Include="src\transport.c" />
    1.24 +    <ClCompile Include="src\trans_auto.c" />
    1.25    </ItemGroup>
    1.26    <ItemGroup>
    1.27 +    <ClInclude Include="src\bloblist.h" />
    1.28      <ClInclude Include="src\cryptotech.h" />
    1.29 +    <ClInclude Include="src\dynamic_api.h" />
    1.30 +    <ClInclude Include="src\email.h" />
    1.31 +    <ClInclude Include="src\etpan_mime.h" />
    1.32 +    <ClInclude Include="src\identity_list.h" />
    1.33      <ClInclude Include="src\keymanagement.h" />
    1.34 +    <ClInclude Include="src\message.h" />
    1.35 +    <ClInclude Include="src\message_api.h" />
    1.36 +    <ClInclude Include="src\mime.h" />
    1.37      <ClInclude Include="src\pEpEngine.h" />
    1.38      <ClInclude Include="src\pEp_internal.h" />
    1.39      <ClInclude Include="src\pgp_gpg.h" />
    1.40      <ClInclude Include="src\pgp_gpg_internal.h" />
    1.41      <ClInclude Include="src\platform_windows.h" />
    1.42 +    <ClInclude Include="src\resource.h" />
    1.43      <ClInclude Include="src\sqlite3.h" />
    1.44 +    <ClInclude Include="src\stringlist.h" />
    1.45 +    <ClInclude Include="src\stringpair.h" />
    1.46 +    <ClInclude Include="src\timestamp.h" />
    1.47      <ClInclude Include="src\transport.h" />
    1.48 +    <ClInclude Include="src\trans_auto.h" />
    1.49 +    <ClInclude Include="src\wrappers.h" />
    1.50    </ItemGroup>
    1.51    <ItemGroup>
    1.52      <Text Include="LICENSE.txt" />
     2.1 --- a/pEpEngine.vcxproj.filters	Wed Mar 25 12:55:15 2015 +0100
     2.2 +++ b/pEpEngine.vcxproj.filters	Wed Mar 25 15:20:25 2015 +0100
     2.3 @@ -36,6 +36,39 @@
     2.4      <ClCompile Include="src\pgp_gpg.c">
     2.5        <Filter>Quelldateien</Filter>
     2.6      </ClCompile>
     2.7 +    <ClCompile Include="src\email.c">
     2.8 +      <Filter>Quelldateien</Filter>
     2.9 +    </ClCompile>
    2.10 +    <ClCompile Include="src\trans_auto.c">
    2.11 +      <Filter>Quelldateien</Filter>
    2.12 +    </ClCompile>
    2.13 +    <ClCompile Include="src\stringlist.c">
    2.14 +      <Filter>Quelldateien</Filter>
    2.15 +    </ClCompile>
    2.16 +    <ClCompile Include="src\stringpair.c">
    2.17 +      <Filter>Quelldateien</Filter>
    2.18 +    </ClCompile>
    2.19 +    <ClCompile Include="src\timestamp.c">
    2.20 +      <Filter>Quelldateien</Filter>
    2.21 +    </ClCompile>
    2.22 +    <ClCompile Include="src\bloblist.c">
    2.23 +      <Filter>Quelldateien</Filter>
    2.24 +    </ClCompile>
    2.25 +    <ClCompile Include="src\etpan_mime.c">
    2.26 +      <Filter>Quelldateien</Filter>
    2.27 +    </ClCompile>
    2.28 +    <ClCompile Include="src\identity_list.c">
    2.29 +      <Filter>Quelldateien</Filter>
    2.30 +    </ClCompile>
    2.31 +    <ClCompile Include="src\message.c">
    2.32 +      <Filter>Quelldateien</Filter>
    2.33 +    </ClCompile>
    2.34 +    <ClCompile Include="src\message_api.c">
    2.35 +      <Filter>Quelldateien</Filter>
    2.36 +    </ClCompile>
    2.37 +    <ClCompile Include="src\mime.c">
    2.38 +      <Filter>Quelldateien</Filter>
    2.39 +    </ClCompile>
    2.40    </ItemGroup>
    2.41    <ItemGroup>
    2.42      <ClInclude Include="src\keymanagement.h">
    2.43 @@ -65,6 +98,48 @@
    2.44      <ClInclude Include="src\pgp_gpg_internal.h">
    2.45        <Filter>Headerdateien</Filter>
    2.46      </ClInclude>
    2.47 +    <ClInclude Include="src\resource.h">
    2.48 +      <Filter>Ressourcendateien</Filter>
    2.49 +    </ClInclude>
    2.50 +    <ClInclude Include="src\email.h">
    2.51 +      <Filter>Headerdateien</Filter>
    2.52 +    </ClInclude>
    2.53 +    <ClInclude Include="src\stringlist.h">
    2.54 +      <Filter>Headerdateien</Filter>
    2.55 +    </ClInclude>
    2.56 +    <ClInclude Include="src\stringpair.h">
    2.57 +      <Filter>Headerdateien</Filter>
    2.58 +    </ClInclude>
    2.59 +    <ClInclude Include="src\timestamp.h">
    2.60 +      <Filter>Headerdateien</Filter>
    2.61 +    </ClInclude>
    2.62 +    <ClInclude Include="src\trans_auto.h">
    2.63 +      <Filter>Headerdateien</Filter>
    2.64 +    </ClInclude>
    2.65 +    <ClInclude Include="src\wrappers.h">
    2.66 +      <Filter>Headerdateien</Filter>
    2.67 +    </ClInclude>
    2.68 +    <ClInclude Include="src\bloblist.h">
    2.69 +      <Filter>Headerdateien</Filter>
    2.70 +    </ClInclude>
    2.71 +    <ClInclude Include="src\dynamic_api.h">
    2.72 +      <Filter>Headerdateien</Filter>
    2.73 +    </ClInclude>
    2.74 +    <ClInclude Include="src\etpan_mime.h">
    2.75 +      <Filter>Headerdateien</Filter>
    2.76 +    </ClInclude>
    2.77 +    <ClInclude Include="src\identity_list.h">
    2.78 +      <Filter>Headerdateien</Filter>
    2.79 +    </ClInclude>
    2.80 +    <ClInclude Include="src\message.h">
    2.81 +      <Filter>Headerdateien</Filter>
    2.82 +    </ClInclude>
    2.83 +    <ClInclude Include="src\message_api.h">
    2.84 +      <Filter>Headerdateien</Filter>
    2.85 +    </ClInclude>
    2.86 +    <ClInclude Include="src\mime.h">
    2.87 +      <Filter>Headerdateien</Filter>
    2.88 +    </ClInclude>
    2.89    </ItemGroup>
    2.90    <ItemGroup>
    2.91      <Text Include="LICENSE.txt" />
     3.1 --- a/src/bloblist.c	Wed Mar 25 12:55:15 2015 +0100
     3.2 +++ b/src/bloblist.c	Wed Mar 25 15:20:25 2015 +0100
     3.3 @@ -1,3 +1,5 @@
     3.4 +#include "pEp_internal.h"
     3.5 +
     3.6  #include <stdlib.h>
     3.7  #include <assert.h>
     3.8  #include <string.h>
     4.1 --- a/src/etpan_mime.c	Wed Mar 25 12:55:15 2015 +0100
     4.2 +++ b/src/etpan_mime.c	Wed Mar 25 15:20:25 2015 +0100
     4.3 @@ -1,6 +1,8 @@
     4.4  #include <string.h>
     4.5  #include <stdlib.h>
     4.6 +#ifndef WIN32
     4.7  #include <unistd.h>
     4.8 +#endif
     4.9  #include <assert.h>
    4.10  
    4.11  #include "etpan_mime.h"
     5.1 --- a/src/identity_list.c	Wed Mar 25 12:55:15 2015 +0100
     5.2 +++ b/src/identity_list.c	Wed Mar 25 15:20:25 2015 +0100
     5.3 @@ -1,3 +1,5 @@
     5.4 +#include "pEp_internal.h"
     5.5 +
     5.6  #include <stdlib.h>
     5.7  #include <assert.h>
     5.8  
     6.1 --- a/src/message.c	Wed Mar 25 12:55:15 2015 +0100
     6.2 +++ b/src/message.c	Wed Mar 25 15:20:25 2015 +0100
     6.3 @@ -1,3 +1,5 @@
     6.4 +#include "pEp_internal.h"
     6.5 +
     6.6  #include <stdlib.h>
     6.7  #include <string.h>
     6.8  #include <assert.h>
     7.1 --- a/src/message_api.c	Wed Mar 25 12:55:15 2015 +0100
     7.2 +++ b/src/message_api.c	Wed Mar 25 15:20:25 2015 +0100
     7.3 @@ -1,3 +1,4 @@
     7.4 +#include "pEp_internal.h"
     7.5  #include "message_api.h"
     7.6  
     7.7  #ifndef WIN32 // POSIX
     7.8 @@ -11,8 +12,6 @@
     7.9  #include <string.h>
    7.10  #include <stdlib.h>
    7.11  
    7.12 -#define NOT_IMPLEMENTED assert(0); return PEP_UNKNOWN_ERROR;
    7.13 -
    7.14  static char * combine_short_and_long(const char *shortmsg, const char *longmsg)
    7.15  {
    7.16      char * ptext;
    7.17 @@ -228,7 +227,6 @@
    7.18  {
    7.19      PEP_STATUS status = PEP_STATUS_OK;
    7.20      message * msg = NULL;
    7.21 -    message * _src;
    7.22      stringlist_t * keys = NULL;
    7.23      bool free_src = false;
    7.24  
    7.25 @@ -333,6 +331,9 @@
    7.26                  else if (src->longmsg) {
    7.27                      ptext = src->longmsg;
    7.28                  }
    7.29 +                else {
    7.30 +                    ptext = "pEp";
    7.31 +                }
    7.32  
    7.33                  message *_src = calloc(1, sizeof(message));
    7.34                  assert(_src);
     8.1 --- a/src/mime.c	Wed Mar 25 12:55:15 2015 +0100
     8.2 +++ b/src/mime.c	Wed Mar 25 15:20:25 2015 +0100
     8.3 @@ -4,8 +4,9 @@
     8.4  #include <stdlib.h>
     8.5  #include <assert.h>
     8.6  #include <errno.h>
     8.7 +#ifndef WIN32
     8.8  #include <unistd.h>
     8.9 -
    8.10 +#endif
    8.11  #include "etpan_mime.h"
    8.12  #include "wrappers.h"
    8.13  
     9.1 --- a/src/pEpEngine.c	Wed Mar 25 12:55:15 2015 +0100
     9.2 +++ b/src/pEpEngine.c	Wed Mar 25 15:20:25 2015 +0100
     9.3 @@ -1,5 +1,5 @@
     9.4 +#include "pEp_internal.h"
     9.5  #include "dynamic_api.h"
     9.6 -#include "pEp_internal.h"
     9.7  #include "cryptotech.h"
     9.8  #include "transport.h"
     9.9  
    9.10 @@ -377,7 +377,7 @@
    9.11  {
    9.12  	const char *source = fingerprint;
    9.13  	char *buffer;
    9.14 -	char *dest = buffer;
    9.15 +	char *dest;
    9.16  	size_t fsize;
    9.17      PEP_STATUS _status;
    9.18  
    9.19 @@ -394,6 +394,7 @@
    9.20      assert(buffer);
    9.21      if (buffer == NULL)
    9.22          return PEP_OUT_OF_MEMORY;
    9.23 +    dest = buffer;
    9.24  
    9.25  	fsize = strlen(fingerprint);
    9.26  
    10.1 --- a/src/pEp_internal.h	Wed Mar 25 12:55:15 2015 +0100
    10.2 +++ b/src/pEp_internal.h	Wed Mar 25 15:20:25 2015 +0100
    10.3 @@ -54,7 +54,7 @@
    10.4  #include "cryptotech.h"
    10.5  #include "transport.h"
    10.6  
    10.7 -#define NOT_IMPLEMENTED assert(0)
    10.8 +#define NOT_IMPLEMENTED assert(0); return PEP_UNKNOWN_ERROR;
    10.9  
   10.10  typedef struct _pEpSession {
   10.11      const char *version;
    11.1 --- a/src/platform_windows.h	Wed Mar 25 12:55:15 2015 +0100
    11.2 +++ b/src/platform_windows.h	Wed Mar 25 15:20:25 2015 +0100
    11.3 @@ -4,6 +4,8 @@
    11.4  
    11.5  #pragma warning(disable : 4996)
    11.6  
    11.7 +#include <string.h>
    11.8 +
    11.9  #ifdef __cplusplus
   11.10  extern "C" {
   11.11  #endif
   11.12 @@ -38,6 +40,10 @@
   11.13  
   11.14  long random(void);
   11.15  
   11.16 +#ifndef inline
   11.17 +#define inline _inline
   11.18 +#endif
   11.19 +
   11.20  #ifdef __cplusplus
   11.21  }
   11.22  #endif
    12.1 Binary file src/platform_windows.obj has changed
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/src/resource.h	Wed Mar 25 15:20:25 2015 +0100
    13.3 @@ -0,0 +1,14 @@
    13.4 +//{{NO_DEPENDENCIES}}
    13.5 +// Microsoft Visual C++ generated include file.
    13.6 +// Used by pEpEngine.rc
    13.7 +
    13.8 +// Next default values for new objects
    13.9 +// 
   13.10 +#ifdef APSTUDIO_INVOKED
   13.11 +#ifndef APSTUDIO_READONLY_SYMBOLS
   13.12 +#define _APS_NEXT_RESOURCE_VALUE        101
   13.13 +#define _APS_NEXT_COMMAND_VALUE         40001
   13.14 +#define _APS_NEXT_CONTROL_VALUE         1001
   13.15 +#define _APS_NEXT_SYMED_VALUE           101
   13.16 +#endif
   13.17 +#endif
    14.1 --- a/src/stringlist.c	Wed Mar 25 12:55:15 2015 +0100
    14.2 +++ b/src/stringlist.c	Wed Mar 25 15:20:25 2015 +0100
    14.3 @@ -1,3 +1,5 @@
    14.4 +#include "pEp_internal.h"
    14.5 +
    14.6  #include <stdlib.h>
    14.7  #include <string.h>
    14.8  #include <assert.h>
    15.1 --- a/src/stringpair.c	Wed Mar 25 12:55:15 2015 +0100
    15.2 +++ b/src/stringpair.c	Wed Mar 25 15:20:25 2015 +0100
    15.3 @@ -1,3 +1,5 @@
    15.4 +#include "pEp_internal.h"
    15.5 +
    15.6  #include <stdlib.h>
    15.7  #include <assert.h>
    15.8  #include <string.h>
    16.1 --- a/src/timestamp.c	Wed Mar 25 12:55:15 2015 +0100
    16.2 +++ b/src/timestamp.c	Wed Mar 25 15:20:25 2015 +0100
    16.3 @@ -1,3 +1,5 @@
    16.4 +#include "pEp_internal.h"
    16.5 +
    16.6  #include "timestamp.h"
    16.7  
    16.8  #include <stdlib.h>
    17.1 --- a/src/transport.c	Wed Mar 25 12:55:15 2015 +0100
    17.2 +++ b/src/transport.c	Wed Mar 25 15:20:25 2015 +0100
    17.3 @@ -23,7 +23,7 @@
    17.4      return PEP_STATUS_OK;
    17.5  }
    17.6  
    17.7 -DYNAMIC_API void release_transport_system(PEP_SESSION session, bool out_last)
    17.8 +void release_transport_system(PEP_SESSION session, bool out_last)
    17.9  {
   17.10      assert(session);
   17.11      // nothing yet
    18.1 --- a/src/wrappers.h	Wed Mar 25 12:55:15 2015 +0100
    18.2 +++ b/src/wrappers.h	Wed Mar 25 15:20:25 2015 +0100
    18.3 @@ -3,6 +3,10 @@
    18.4  #include <errno.h>
    18.5  #include <stdarg.h>
    18.6  
    18.7 +#ifdef WIN32
    18.8 +#include "platform_windows.h"
    18.9 +#endif
   18.10 +
   18.11  #ifdef EOF // stdio.h
   18.12  
   18.13  static inline FILE * Fopen(const char *filename, const char *mode)