You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@corinthia.apache.org by ja...@apache.org on 2015/01/01 11:10:23 UTC

[01/19] incubator-corinthia git commit: work

Repository: incubator-corinthia
Updated Branches:
  refs/heads/RTC_platform [created] a84b00b72


work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/9debb846
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/9debb846
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/9debb846

Branch: refs/heads/RTC_platform
Commit: 9debb846d52261b405c026159c2dc9f92791c977
Parents: 145000d
Author: jani <ja...@apache.org>
Authored: Thu Dec 25 22:00:17 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Thu Dec 25 22:00:17 2014 +0100

----------------------------------------------------------------------
 DocFormats/CMakeLists.txt                 |  3 +--
 DocFormats/platform/CMakeLists.txt        |  6 ++++--
 DocFormats/platform/tests/OStests.c       | 27 ++++++++++++++++++++++++++
 DocFormats/platform/tests/PlatformTests.c |  7 -------
 DocFormats/platform/tests/WrapperTests.c  | 20 +++++++++++++++++++
 5 files changed, 52 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9debb846/DocFormats/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/CMakeLists.txt b/DocFormats/CMakeLists.txt
index 7bb39bb..ce72d7b 100644
--- a/DocFormats/CMakeLists.txt
+++ b/DocFormats/CMakeLists.txt
@@ -52,8 +52,7 @@ set(GroupObjRoot
     $<TARGET_OBJECTS:ooxml>
     $<TARGET_OBJECTS:latex>
     $<TARGET_OBJECTS:odf>
-    $<TARGET_OBJECTS:platform>
-    $<TARGET_OBJECTS:core>)
+    $<TARGET_OBJECTS:platform>)
 
 
 

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9debb846/DocFormats/platform/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/platform/CMakeLists.txt b/DocFormats/platform/CMakeLists.txt
index dcf9471..85e4cb2 100644
--- a/DocFormats/platform/CMakeLists.txt
+++ b/DocFormats/platform/CMakeLists.txt
@@ -102,7 +102,9 @@ set(GroupSrc
     src/Win32.c)
 
 set(GroupTests
-    tests/PlatformTests.c)
+    tests/PlatformTests.c
+    tests/OStests.c
+    tests/WrapperTests.c)
 
 
 
@@ -125,7 +127,7 @@ include_directories(../unittest)
 ###
 add_library(platform OBJECT
     ${GroupMinizip}
-	${GroupHtml5}
+    ${GroupHtml5}
     ${GroupHeaders}
     ${GroupSrc}
     ${GroupTests})

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9debb846/DocFormats/platform/tests/OStests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/OStests.c b/DocFormats/platform/tests/OStests.c
new file mode 100644
index 0000000..b792dc3
--- /dev/null
+++ b/DocFormats/platform/tests/OStests.c
@@ -0,0 +1,27 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "DFUnitTest.h"
+#include <stddef.h>
+
+static void test_sample(void)
+{
+}
+
+TestGroup PlatformTests = {
+    "platform", {
+        { "sample", PlainTest, test_sample },
+        { NULL, PlainTest, NULL }
+    }
+};

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9debb846/DocFormats/platform/tests/PlatformTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/PlatformTests.c b/DocFormats/platform/tests/PlatformTests.c
index b792dc3..b5ebf0c 100644
--- a/DocFormats/platform/tests/PlatformTests.c
+++ b/DocFormats/platform/tests/PlatformTests.c
@@ -13,15 +13,8 @@
 // limitations under the License.
 
 #include "DFUnitTest.h"
-#include <stddef.h>
 
 static void test_sample(void)
 {
 }
 
-TestGroup PlatformTests = {
-    "platform", {
-        { "sample", PlainTest, test_sample },
-        { NULL, PlainTest, NULL }
-    }
-};

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/9debb846/DocFormats/platform/tests/WrapperTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/WrapperTests.c b/DocFormats/platform/tests/WrapperTests.c
new file mode 100644
index 0000000..b5ebf0c
--- /dev/null
+++ b/DocFormats/platform/tests/WrapperTests.c
@@ -0,0 +1,20 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "DFUnitTest.h"
+
+static void test_sample(void)
+{
+}
+


[02/19] incubator-corinthia git commit: prepare for removal of minizip

Posted by ja...@apache.org.
prepare for removal of minizip


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/8d2865f8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/8d2865f8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/8d2865f8

Branch: refs/heads/RTC_platform
Commit: 8d2865f8aa98cf602cb61df169659204592508c6
Parents: 9debb84
Author: jani <ja...@apache.org>
Authored: Sat Dec 27 19:02:45 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sat Dec 27 19:02:45 2014 +0100

----------------------------------------------------------------------
 DocFormats/api/CMakeLists.txt            | 1 -
 DocFormats/core/CMakeLists.txt           | 1 -
 DocFormats/core/src/lib/DFZipFile.c      | 3 +--
 DocFormats/filters/latex/CMakeLists.txt  | 1 -
 DocFormats/filters/odf/CMakeLists.txt    | 1 -
 DocFormats/filters/ooxml/CMakeLists.txt  | 1 -
 DocFormats/platform/CMakeLists.txt       | 3 ++-
 DocFormats/platform/headers/DFPlatform.h | 5 +++++
 DocFormats/unittest/CMakeLists.txt       | 1 -
 9 files changed, 8 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/api/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/api/CMakeLists.txt b/DocFormats/api/CMakeLists.txt
index 8032b33..4df69cc 100644
--- a/DocFormats/api/CMakeLists.txt
+++ b/DocFormats/api/CMakeLists.txt
@@ -44,7 +44,6 @@ set(GroupTests
 include_directories(/usr/include/libxml2)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/include)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/src)
-include_directories(../../DocFormats/3rdparty/external/minizip)
 
 include_directories(SYSTEM ${INCLUDE_DIRS})
 include_directories(SYSTEM ../api/headers)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/core/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/core/CMakeLists.txt b/DocFormats/core/CMakeLists.txt
index 927dff0..d348045 100644
--- a/DocFormats/core/CMakeLists.txt
+++ b/DocFormats/core/CMakeLists.txt
@@ -152,7 +152,6 @@ include_directories()
 include_directories(/usr/include/libxml2)
 include_directories(../../DocFormats/platform/3rdparty/w3c-tidy-html5/include)
 include_directories(../../DocFormats/platform/3rdparty//w3c-tidy-html5/src)
-include_directories(../../DocFormats/platform/3rdparty/minizip)
 include_directories(SYSTEM ${INCLUDE_DIRS})
 include_directories(SYSTEM ../api/headers)
 include_directories(../platform/headers)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index 651b43b..60b810a 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -13,8 +13,7 @@
 // limitations under the License.
 
 #include "DFZipFile.h"
-#include "unzip.h"
-#include "zip.h"
+#include "platform.h"
 #include "DFFilesystem.h"
 #include "DFString.h"
 #include "DFCommon.h"

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/filters/latex/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/filters/latex/CMakeLists.txt b/DocFormats/filters/latex/CMakeLists.txt
index a02e559..0aca5e3 100644
--- a/DocFormats/filters/latex/CMakeLists.txt
+++ b/DocFormats/filters/latex/CMakeLists.txt
@@ -31,7 +31,6 @@ include_directories()
 include_directories(/usr/include/libxml2)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/include)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/src)
-include_directories(../../DocFormats/3rdparty/external/minizip)
 
 include_directories(SYSTEM ${INCLUDE_DIRS})
 include_directories(SYSTEM ../../api/headers)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/filters/odf/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/filters/odf/CMakeLists.txt b/DocFormats/filters/odf/CMakeLists.txt
index fac5ee9..4673096 100644
--- a/DocFormats/filters/odf/CMakeLists.txt
+++ b/DocFormats/filters/odf/CMakeLists.txt
@@ -37,7 +37,6 @@ include_directories()
 include_directories(/usr/include/libxml2)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/include)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/src)
-include_directories(../../DocFormats/3rdparty/external/minizip)
 
 include_directories(SYSTEM ${INCLUDE_DIRS})
 include_directories(SYSTEM ../../api/headers)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/filters/ooxml/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/filters/ooxml/CMakeLists.txt b/DocFormats/filters/ooxml/CMakeLists.txt
index 1c1a937..acc28c2 100644
--- a/DocFormats/filters/ooxml/CMakeLists.txt
+++ b/DocFormats/filters/ooxml/CMakeLists.txt
@@ -123,7 +123,6 @@ include_directories()
 include_directories(/usr/include/libxml2)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/include)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/src)
-include_directories(../../DocFormats/3rdparty/external/minizip)
 
 include_directories(SYSTEM ${INCLUDE_DIRS})
 include_directories(SYSTEM ../../api/headers)

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/platform/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/platform/CMakeLists.txt b/DocFormats/platform/CMakeLists.txt
index 85e4cb2..6fdbc07 100644
--- a/DocFormats/platform/CMakeLists.txt
+++ b/DocFormats/platform/CMakeLists.txt
@@ -99,7 +99,8 @@ set(GroupSrc
     src/Apple.c
     src/Linux.c
     src/Unix.c
-    src/Win32.c)
+    src/Win32.c
+    src/Wrapper.c)
 
 set(GroupTests
     tests/PlatformTests.c

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/platform/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/platform/headers/DFPlatform.h b/DocFormats/platform/headers/DFPlatform.h
index a14350d..e53b4b1 100755
--- a/DocFormats/platform/headers/DFPlatform.h
+++ b/DocFormats/platform/headers/DFPlatform.h
@@ -34,4 +34,9 @@ typedef int DFOnce;
 typedef void (*DFOnceFunction)(void);
 void DFInitOnce(DFOnce *once, DFOnceFunction fun);
 
+// Zip functions
+int DFextZipOpen(const char *zipFilename);
+int DFextZipOpenNextFile(const char *zipFile, char *entryName, const int maxName);
+int DFextZipReadCurrentFile(char *buf, const int maxLen);
+int DFextZipClose(void);
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8d2865f8/DocFormats/unittest/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/unittest/CMakeLists.txt b/DocFormats/unittest/CMakeLists.txt
index b780cd7..f1d7d7e 100644
--- a/DocFormats/unittest/CMakeLists.txt
+++ b/DocFormats/unittest/CMakeLists.txt
@@ -28,7 +28,6 @@ include_directories()
 include_directories(/usr/include/libxml2)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/include)
 include_directories(../../DocFormats/3rdparty/external/w3c-tidy-html5/src)
-include_directories(../../DocFormats/3rdparty/external/minizip)
 
 include_directories(SYSTEM ${INCLUDE_DIRS})
 include_directories(SYSTEM ../api/headers)


[04/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/783e6f7d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/783e6f7d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/783e6f7d

Branch: refs/heads/RTC_platform
Commit: 783e6f7d41fc547d8d13c93db58e769b6fd0b6ec
Parents: 8c2b64a
Author: jani <ja...@apache.org>
Authored: Sun Dec 28 12:42:44 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sun Dec 28 12:42:44 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/src/lib/DFZipFile.c      | 56 ++++++++++++---------------
 DocFormats/platform/headers/DFPlatform.h |  8 ++--
 2 files changed, 30 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/783e6f7d/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index 60b810a..56da721 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -34,9 +34,8 @@ static int zipError(DFError **error, const char *format, ...)
 
 int DFUnzip(const char *zipFilename, DFStorage *storage, DFError **error)
 {
-    unzFile zipFile = unzOpen(zipFilename);
-    if (zipFile == NULL)
-        return zipError(error,"Cannot open file");
+  if (DFextZipOpen(zipFilename, 1) <= 0)
+    return zipError(error,"Cannot open file");
 
     int ret;
     for (ret = unzGoToFirstFile(zipFile); ret == UNZ_OK; ret = unzGoToNextFile(zipFile)) {
@@ -77,8 +76,7 @@ int DFUnzip(const char *zipFilename, DFStorage *storage, DFError **error)
     if (UNZ_END_OF_LIST_OF_FILE != ret)
         return zipError(error,"Zip directory is corrupt");
 
-    if (UNZ_OK != unzClose(zipFile))
-        return zipError(error,"Cannot close file");
+    DFextZipClose();
 
     return 1;
 }
@@ -112,40 +110,36 @@ static int zipAddFile(zipFile zip, const char *dest, DFBuffer *content, DFError
 int DFZip(const char *zipFilename, DFStorage *storage, DFError **error)
 {
     const char **allPaths = NULL;
-    zipFile zip = NULL;
     DFBuffer *content = NULL;
     int ok = 0;
 
     allPaths = DFStorageList(storage,error);
-    if (allPaths == NULL)
-        goto end;
-
-    zip = zipOpen(zipFilename,APPEND_STATUS_CREATE);
-    if (zip == NULL) {
-        DFErrorFormat(error,"Cannot create file");
-        goto end;
+    if (allPaths == NULL || DFextZipOpen(zipFilename, 0) <= 0)
+    {
+      DFErrorFormat(error,"Cannot create file");
+      goto end;
     }
-
-    for (int i = 0; allPaths[i]; i++) {
-        const char *path = allPaths[i];
-
-        DFBufferRelease(content);
-        content = DFBufferReadFromStorage(storage,path,error);
-        if (content == NULL) {
-            DFErrorFormat(error,"%s: %s",path,DFErrorMessage(error));
-            goto end;
-        }
-
-        if (!zipAddFile(zip,path,content,error))
-            goto end;
+    else
+    {
+      for (int i = 0; allPaths[i]; i++) {
+          const char *path = allPaths[i];
+
+          DFBufferRelease(content);
+          content = DFBufferReadFromStorage(storage,path,error);
+          if (content == NULL) {
+              DFErrorFormat(error,"%s: %s",path,DFErrorMessage(error));
+              goto end;
+          }
+
+          if (!zipAddFile(zip,path,content,error))
+              goto end;
+      }
+
+      ok = 1;
     }
 
-    ok = 1;
-
-end:
     DFBufferRelease(content);
     free(allPaths);
-    if ((zip != NULL) && (ZIP_OK != zipClose(zip,NULL)))
-        return zipError(error,"Cannot close file");
+    DFextZipClose();
     return ok;
 }

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/783e6f7d/DocFormats/platform/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/platform/headers/DFPlatform.h b/DocFormats/platform/headers/DFPlatform.h
index 577fcff..8ce3281 100755
--- a/DocFormats/platform/headers/DFPlatform.h
+++ b/DocFormats/platform/headers/DFPlatform.h
@@ -35,9 +35,11 @@ typedef void (*DFOnceFunction)(void);
 void DFInitOnce(DFOnce *once, DFOnceFunction fun);
 
 // Zip functions
-int DFextZipOpenRead(const char *zipFilename);
-int DFextZipOpenCreate(const char *zipFilename);
+int  DFextZipOpen(const char *zipFilename, int doUnzip);
+void DFextZipClose(void);
+
+
+
 int DFextZipOpenNextFile(const char *zipFile, char *entryName, const int maxName);
 int DFextZipReadCurrentFile(char *buf, const int maxLen);
-int DFextZipClose(void);
 #endif


[11/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/826c423f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/826c423f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/826c423f

Branch: refs/heads/RTC_platform
Commit: 826c423fa0d4bfb8a69ada4bb7f9e16c7ef28d5e
Parents: 48a40e1
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 16:53:39 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 16:53:39 2014 +0100

----------------------------------------------------------------------
 consumers/dftest/src/main.c   |   2 +-
 external/.gitignore           |   3 +-
 external/README.txt           | 167 +++++++++++++++++++++++++++++++++++--
 external/extract_downloads.sh |  45 ++++++++++
 external/fetch_downloads.sh   |  21 +++++
 external/include/README.txt   |  81 ------------------
 external/include/unistd.h     |   3 -
 external/lib/README.txt       |  10 ---
 8 files changed, 229 insertions(+), 103 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/consumers/dftest/src/main.c
----------------------------------------------------------------------
diff --git a/consumers/dftest/src/main.c b/consumers/dftest/src/main.c
index c7e5418..e736e2f 100644
--- a/consumers/dftest/src/main.c
+++ b/consumers/dftest/src/main.c
@@ -353,7 +353,7 @@ int main(int argc, const char **argv)
         TestGroup *singleGroup[] = { NULL, NULL };
         int        i = 0;
 
-        for (i; allGroups[i] && strcmp(argv[2], allGroups[i]->name); i++) ;
+        for (; allGroups[i] && strcmp(argv[2], allGroups[i]->name); i++) ;
         if (allGroups[i]) {
           singleGroup[0] = allGroups[i];
           utrun(singleGroup, 1, 0, NULL);

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/.gitignore
----------------------------------------------------------------------
diff --git a/external/.gitignore b/external/.gitignore
index 2739ff0..ca1dc4d 100644
--- a/external/.gitignore
+++ b/external/.gitignore
@@ -9,6 +9,7 @@
 
 
 # Build results
+bin/
 lib/
 include/
-
+download/

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/README.txt
----------------------------------------------------------------------
diff --git a/external/README.txt b/external/README.txt
index fa95d9a..5067bdc 100644
--- a/external/README.txt
+++ b/external/README.txt
@@ -2,14 +2,167 @@ Download external developer libraries to here, and you dont need to modify CMake
 
 in order to compile on windows you need:
 
-Zlib developer files from http://gnuwin32.sourceforge.net/packages/zlib.htm
-Iconv developer files from http://gnuwin32.sourceforge.net/packages/libiconv.htm
-libxml2 developer files from ftp://ftp.zlatkovic.com/libxml/64bit/
-SDL2 developer files from https://www.libsdl.org/download-2.0.php
-SDL2_image developer files from https://www.libsdl.org/projects/SDL_image/
+Zlib developer files:
+    http://zlib.net/zlib128-dll.zip
 
-you might also need:
-unistd.h from http://sourceforge.net/p/mingw/mingw-org-wsl/ci/master/tree/include/
+Iconv developer files:
+    ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip
 
+libxml2 developer files:
+    ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip
+
+SDL2 developer files:
+    https://www.libsdl.org/release/SDL2-devel-2.0.3-VC.zip
+
+SDL2_image developer files:
+    https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.0-VC.zip
 
 We are working on reducing these dependencies.
+
+On a Unix system (and possibly under cygwin), you can run the
+fetch_downloads.sh script to download these. The extract_downloads.sh
+script places all the files in the bin, lib, and include
+directories. The result should look like this the listing below.
+
+After building Corinthia, you will need to copy all of the DLL files from
+external/bin into the bin directory within your build directory,
+alongside dfconvert and dftest.
+
+bin/SDL2.dll
+bin/SDL2_image.dll
+bin/iconv.dll
+bin/iconv.exe
+bin/libjpeg-9.dll
+bin/libpng16-16.dll
+bin/libtiff-5.dll
+bin/libwebp-4.dll
+bin/libxml2.dll
+bin/xmlcatalog.exe
+bin/xmllint.exe
+bin/zlib1.dll
+include/SDL.h
+include/SDL_assert.h
+include/SDL_atomic.h
+include/SDL_audio.h
+include/SDL_bits.h
+include/SDL_blendmode.h
+include/SDL_clipboard.h
+include/SDL_config.h
+include/SDL_cpuinfo.h
+include/SDL_endian.h
+include/SDL_error.h
+include/SDL_events.h
+include/SDL_filesystem.h
+include/SDL_gamecontroller.h
+include/SDL_gesture.h
+include/SDL_haptic.h
+include/SDL_hints.h
+include/SDL_image.h
+include/SDL_joystick.h
+include/SDL_keyboard.h
+include/SDL_keycode.h
+include/SDL_loadso.h
+include/SDL_log.h
+include/SDL_main.h
+include/SDL_messagebox.h
+include/SDL_mouse.h
+include/SDL_mutex.h
+include/SDL_name.h
+include/SDL_opengl.h
+include/SDL_opengles.h
+include/SDL_opengles2.h
+include/SDL_pixels.h
+include/SDL_platform.h
+include/SDL_power.h
+include/SDL_quit.h
+include/SDL_rect.h
+include/SDL_render.h
+include/SDL_revision.h
+include/SDL_rwops.h
+include/SDL_scancode.h
+include/SDL_shape.h
+include/SDL_stdinc.h
+include/SDL_surface.h
+include/SDL_system.h
+include/SDL_syswm.h
+include/SDL_test.h
+include/SDL_test_assert.h
+include/SDL_test_common.h
+include/SDL_test_compare.h
+include/SDL_test_crc32.h
+include/SDL_test_font.h
+include/SDL_test_fuzzer.h
+include/SDL_test_harness.h
+include/SDL_test_images.h
+include/SDL_test_log.h
+include/SDL_test_md5.h
+include/SDL_test_random.h
+include/SDL_thread.h
+include/SDL_timer.h
+include/SDL_touch.h
+include/SDL_types.h
+include/SDL_version.h
+include/SDL_video.h
+include/begin_code.h
+include/close_code.h
+include/iconv.h
+include/libxml/DOCBparser.h
+include/libxml/HTMLparser.h
+include/libxml/HTMLtree.h
+include/libxml/SAX.h
+include/libxml/SAX2.h
+include/libxml/c14n.h
+include/libxml/catalog.h
+include/libxml/chvalid.h
+include/libxml/debugXML.h
+include/libxml/dict.h
+include/libxml/encoding.h
+include/libxml/entities.h
+include/libxml/globals.h
+include/libxml/hash.h
+include/libxml/list.h
+include/libxml/nanoftp.h
+include/libxml/nanohttp.h
+include/libxml/parser.h
+include/libxml/parserInternals.h
+include/libxml/pattern.h
+include/libxml/relaxng.h
+include/libxml/schemasInternals.h
+include/libxml/schematron.h
+include/libxml/threads.h
+include/libxml/tree.h
+include/libxml/uri.h
+include/libxml/valid.h
+include/libxml/xinclude.h
+include/libxml/xlink.h
+include/libxml/xmlIO.h
+include/libxml/xmlautomata.h
+include/libxml/xmlerror.h
+include/libxml/xmlexports.h
+include/libxml/xmlmemory.h
+include/libxml/xmlmodule.h
+include/libxml/xmlreader.h
+include/libxml/xmlregexp.h
+include/libxml/xmlsave.h
+include/libxml/xmlschemas.h
+include/libxml/xmlschemastypes.h
+include/libxml/xmlstring.h
+include/libxml/xmlunicode.h
+include/libxml/xmlversion.h
+include/libxml/xmlwriter.h
+include/libxml/xpath.h
+include/libxml/xpathInternals.h
+include/libxml/xpointer.h
+include/zconf.h
+include/zlib.h
+lib/SDL2.lib
+lib/SDL2_image.lib
+lib/SDL2main.lib
+lib/SDL2test.lib
+lib/iconv.lib
+lib/iconv_a.lib
+lib/libxml2.lib
+lib/libxml2_a.lib
+lib/libxml2_a_dll.lib
+lib/zdll.lib
+lib/zlib.def

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/extract_downloads.sh
----------------------------------------------------------------------
diff --git a/external/extract_downloads.sh b/external/extract_downloads.sh
new file mode 100755
index 0000000..0d151e3
--- /dev/null
+++ b/external/extract_downloads.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+
+set -e
+
+mkdir packages
+
+mkdir packages/SDL2
+mkdir packages/SDL2_image
+mkdir packages/iconv
+mkdir packages/libxml2
+mkdir packages/zlib
+
+(cd packages/SDL2 && unzip ../../download/SDL2-devel-2.0.3-VC.zip)
+(cd packages/SDL2_image && unzip ../../download/SDL2_image-devel-2.0.0-VC.zip)
+(cd packages/iconv && unzip ../../download/iconv-1.9.2.win32.zip)
+(cd packages/libxml2 && unzip ../../download/libxml2-2.7.8.win32.zip)
+(cd packages/zlib && unzip ../../download/zlib128-dll.zip)
+chmod -R u+w packages/zlib
+
+for i in bin lib include; do
+    if [ ! -d $i ]; then
+        mkdir $i
+    fi
+done
+
+mv packages/SDL2/SDL2-2.0.3/include/* include
+mv packages/SDL2/SDL2-2.0.3/lib/x86/*.lib lib
+mv packages/SDL2/SDL2-2.0.3/lib/x86/*.dll bin
+
+mv packages/SDL2_image/SDL2_image-2.0.0/include/* include
+mv packages/SDL2_image/SDL2_image-2.0.0/lib/x86/*.lib lib
+mv packages/SDL2_image/SDL2_image-2.0.0/lib/x86/*.dll bin
+
+mv packages/iconv/iconv-1.9.2.win32/include/* include
+mv packages/iconv/iconv-1.9.2.win32/lib/* lib
+mv packages/iconv/iconv-1.9.2.win32/bin/* bin
+
+mv packages/libxml2/libxml2-2.7.8.win32/include/* include
+mv packages/libxml2/libxml2-2.7.8.win32/lib/* lib
+mv packages/libxml2/libxml2-2.7.8.win32/bin/* bin
+
+mv packages/zlib/include/* include
+mv packages/zlib/lib/* lib
+
+rm -rf packages

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/fetch_downloads.sh
----------------------------------------------------------------------
diff --git a/external/fetch_downloads.sh b/external/fetch_downloads.sh
new file mode 100755
index 0000000..c03b9b3
--- /dev/null
+++ b/external/fetch_downloads.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+set -e
+if [ ! -d download ]; then
+    mkdir download
+fi
+
+URLS="http://zlib.net/zlib128-dll.zip \
+      ftp://ftp.zlatkovic.com/libxml/iconv-1.9.2.win32.zip \
+      ftp://ftp.zlatkovic.com/libxml/libxml2-2.7.8.win32.zip \
+      https://www.libsdl.org/release/SDL2-devel-2.0.3-VC.zip \
+      https://www.libsdl.org/projects/SDL_image/release/SDL2_image-devel-2.0.0-VC.zip"
+
+cd download
+for url in $URLS; do
+    if [ ! -f $(basename $url) ]; then
+        wget $url
+    fi
+done
+
+cd ..

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/include/README.txt
----------------------------------------------------------------------
diff --git a/external/include/README.txt b/external/include/README.txt
deleted file mode 100644
index 83b370f..0000000
--- a/external/include/README.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-put the downloaded external header files here.
-
-The content should be:
-   zlib.h
-   zconf.h
-
-   SDL.h
-   SDL_main.h
-   SDL_image.h
-   SDL_stdinc.h
-   SDL_config.h
-   SDL_platform.h
-   SDL_assert.h
-   SDL_atomic.h
-   SDL_audio.h
-   SDL_error.h
-   SDL_endian.h
-   SDL_mutex.h
-   SDL_thread.h
-   SDL_rwops.h
-   SDL_clipboard.h
-   SDL_cpuinfo.h
-   SDL_events.h
-   SDL_video.h
-   SDL_pixels.h
-   SDL_rect.h
-   SDL_surface.h
-   SDL_blendmode.h
-   SDL_keyboard.h
-   SDL_mouse.h
-   SDL_joystick.h
-   SDL_gamecontroller.h
-   SDL_quit.h
-   SDL_gesture.h
-   SDL_touch.h
-   SDL_keycode.h
-   SDL_scancode.h
-   SDL_filesystem.h
-   SDL_haptic.h
-   SDL_hints.h
-   SDL_loadso.h
-   SDL_log.h
-   SDL_messagebox.h
-   SDL_power.h
-   SDL_render.h
-   SDL_system.h
-   SDL_timer.h
-   SDL_version.h
-   begin_code.h
-   close_code.h
- 
-   libxml/tree.h
-   libxml/xmlwriter.h
-   libxml/xmlversion.h
-   libxml/xmlexports.h
-   libxml/xmlstring.h
-   libxml/xmlregexp.h
-   libxml/dict.h
-   libxml/xmlmemory.h
-   libxml/thread.h
-   libxml/globals.h
-   libxml/parser.h
-   libxml/hash.h
-   libxml/valid.h
-   libxml/xmlerror.h
-   libxml/list.h
-   libxml/xmlautomata.h
-   libxml/entities.h
-   libxml/encoding.h
-   libxml/xmlIO.h
-   libxml/SAX.h
-   libxml/SAX2.h
-   libxml/xlink.h
-
-   iconv.h
-
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/include/unistd.h
----------------------------------------------------------------------
diff --git a/external/include/unistd.h b/external/include/unistd.h
deleted file mode 100644
index 5f82577..0000000
--- a/external/include/unistd.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/**
- Dummy file to satisfy zconf.h includes
- **/

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/826c423f/external/lib/README.txt
----------------------------------------------------------------------
diff --git a/external/lib/README.txt b/external/lib/README.txt
deleted file mode 100644
index d20f6ad..0000000
--- a/external/lib/README.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-Put the downloaded external libraries here.
-
-The content should be:
-   libxml2.lib
-   zlib.h
-   libiconv.lib
-   SDL2.lib
-   SDL2_image.lib
-
-


[19/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/a84b00b7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/a84b00b7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/a84b00b7

Branch: refs/heads/RTC_platform
Commit: a84b00b72bb66208a9ea28f9b4269f830ff30830
Parents: 47cbcd6
Author: jani <ja...@apache.org>
Authored: Wed Dec 31 00:02:04 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Wed Dec 31 00:02:04 2014 +0100

----------------------------------------------------------------------
 DocFormats/platform/tests/OStests.c      | 13 +++++++++++++
 DocFormats/platform/tests/WrapperTests.c | 18 ++++++++++++++++++
 2 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/a84b00b7/DocFormats/platform/tests/OStests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/OStests.c b/DocFormats/platform/tests/OStests.c
index ad6edb9..4706916 100644
--- a/DocFormats/platform/tests/OStests.c
+++ b/DocFormats/platform/tests/OStests.c
@@ -18,24 +18,37 @@
 
 static void test_DFGetImageDimensions(void)
 {
+#if 0
+    int DFGetImageDimensions(const void *data, size_t len, const char *ext,
+        unsigned int *width, unsigned int *height, char **errmsg)
+#endif
 }
 
 
 
 static void test_DFInitOnce(void)
 {
+#if 0
+    void DFInitOnce(DFOnce *once, DFOnceFunction fun)
+#endif
 }
 
 
 
 static void test_DFMkdirIfAbsent(void)
 {
+#if 0
+    int DFMkdirIfAbsent(const char *path, char **errmsg)
+#endif
 }
 
 
 
 static void test_DFAddDirContents(void)
 {
+#if 0
+    int DFAddDirContents(const char *absPath, const char *relPath, int recursive, DFDirEntryList ***list, char **errmsg)
+#endif
 }
 
 

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/a84b00b7/DocFormats/platform/tests/WrapperTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/WrapperTests.c b/DocFormats/platform/tests/WrapperTests.c
index edd8358..f2a8f2b 100644
--- a/DocFormats/platform/tests/WrapperTests.c
+++ b/DocFormats/platform/tests/WrapperTests.c
@@ -18,36 +18,54 @@
 
 static void test_DFextZipOpen(void)
 {
+#if 0
+    int DFextZipOpen(const char *zipFilename, int doUnzip) {
+#endif
 }
 
 
 
 static void test_DFextZipClose(void)
 {
+#if 0
+    int DFextZipClose(void)
+#endif
 }
 
 
 
 static void test_DFextZipOpenNextFile(void)
 {
+#if 0
+    int DFextZipOpenNextFile(char *entryName, const int maxName)
+#endif
 }
 
 
 
 static void test_DFextZipCloseFile(void)
 {
+#if 0
+    int DFextZipCloseFile(void)
+#endif
 }
 
 
 
 static void test_DFextZipReadCurrentFile(void)
 {
+#if 0
+    int DFextZipReadCurrentFile(char *buf, const int maxLen)
+#endif
 }
 
 
 
 static void test_DFextZipWriteCurrentFile(void)
 {
+#if 0
+    int DFextZipWriteCurrentFile(char *buf, const int len)
+#endif
 }
 
 


[09/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/f92c3112
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/f92c3112
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/f92c3112

Branch: refs/heads/RTC_platform
Commit: f92c3112e8364478ba14c74bbbb750217496fcc2
Parents: 3686a74
Author: jani <ja...@apache.org>
Authored: Mon Dec 29 22:08:31 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Mon Dec 29 22:08:31 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/src/lib/DFZipFile.c      | 25 +++++++------------------
 DocFormats/core/tests/names/NamesTests.c |  2 +-
 2 files changed, 8 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f92c3112/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index b916794..7a4ff43 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -72,33 +72,21 @@ int DFUnzip(const char *zipFilename, DFStorage *storage, DFError **error)
     return 1;
 }
 
-#if 0
-static int zipAddFile(zipFile zip, const char *dest, DFBuffer *content, DFError **error)
+static int zipAddFile(const char *dest, DFBuffer *content, DFError **error)
 {
-    zip_fileinfo fileinfo;
-    bzero(&fileinfo,sizeof(fileinfo));
-
-    if (ZIP_OK != zipOpenNewFileInZip(zip,
-                                      dest,
-                                      &fileinfo,
-                                      NULL,0,
-                                      NULL,0,
-                                      NULL,
-                                      Z_DEFLATED,
-                                      Z_DEFAULT_COMPRESSION)) {
+    if (DFextZipOpenNextFile(dest, 0) < 0)
         return zipError(error,"%s: Cannot create entry in zip file",dest);
-    }
 
+#if 0
     if (ZIP_OK != zipWriteInFileInZip(zip,content->data,(unsigned int)content->len))
         return zipError(error,"%s: Error writing to entry in zip file",dest);
 
 
-    if (ZIP_OK != zipCloseFileInZip(zip))
+#endif
+    if (DFextZipCloseFile() <0)
         return zipError(error,"%s: Error closing entry in zip file",dest);
-
     return 1;
 }
-#endif
 
 
 
@@ -125,13 +113,14 @@ int DFZip(const char *zipFilename, DFStorage *storage, DFError **error)
               goto end;
           }
 
-          if (!zipAddFile(zip,path,content,error))
+          if (!zipAddFile(path,content,error))
               goto end;
       }
 
       ok = 1;
     }
 
+end:
     DFBufferRelease(content);
     free(allPaths);
     DFextZipClose();

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f92c3112/DocFormats/core/tests/names/NamesTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/tests/names/NamesTests.c b/DocFormats/core/tests/names/NamesTests.c
index cbf3bc7..2e94015 100644
--- a/DocFormats/core/tests/names/NamesTests.c
+++ b/DocFormats/core/tests/names/NamesTests.c
@@ -19,7 +19,7 @@ static void test_sample(void)
 {
 }
 
-TestGroup LibTests = {
+TestGroup NamesTests = {
     "core.lib", {
         { "sample", PlainTest, test_sample },
         { NULL, PlainTest, NULL }


[15/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/a0e6aa15
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/a0e6aa15
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/a0e6aa15

Branch: refs/heads/RTC_platform
Commit: a0e6aa15f1874424faf795ae9e51ea73c48ab817
Parents: f3d20d1
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 18:14:06 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 18:14:06 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/tests/names/NamesTests.c | 27 ---------------------------
 1 file changed, 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/a0e6aa15/DocFormats/core/tests/names/NamesTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/tests/names/NamesTests.c b/DocFormats/core/tests/names/NamesTests.c
deleted file mode 100644
index 2e94015..0000000
--- a/DocFormats/core/tests/names/NamesTests.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2012-2014 UX Productivity Pty Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "DFUnitTest.h"
-#include <stddef.h>
-
-static void test_sample(void)
-{
-}
-
-TestGroup NamesTests = {
-    "core.lib", {
-        { "sample", PlainTest, test_sample },
-        { NULL, PlainTest, NULL }
-    }
-};


[10/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/48a40e1c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/48a40e1c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/48a40e1c

Branch: refs/heads/RTC_platform
Commit: 48a40e1c1f91670f5930c9052f25b8f14e5ec0a2
Parents: f92c311
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 16:29:51 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 16:29:51 2014 +0100

----------------------------------------------------------------------
 DocFormats/platform/src/Wrapper.c | 133 +++++++++++++++++++++++++++++++++
 1 file changed, 133 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/48a40e1c/DocFormats/platform/src/Wrapper.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/src/Wrapper.c b/DocFormats/platform/src/Wrapper.c
new file mode 100644
index 0000000..b9df21a
--- /dev/null
+++ b/DocFormats/platform/src/Wrapper.c
@@ -0,0 +1,133 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include <string.h>
+#include "DFPlatform.h"
+#include "unzip.h"
+#include "zip.h"
+
+
+// This file contains functions to isolate external libraries
+static unzFile myZipFile;
+static int     myZipFlag;
+static int     myZipFirst;
+
+
+int DFextZipOpen(const char *zipFilename, int doUnzip) {
+    // Check if already in use
+    if (myZipFile)
+        return 0;
+
+    // Open file
+    myZipFirst = 1;
+    myZipFlag  = doUnzip;
+    if (myZipFlag)
+      myZipFile = unzOpen(zipFilename);
+    else
+      myZipFile = zipOpen(zipFilename, APPEND_STATUS_CREATE);
+
+    return (myZipFile == NULL) ? -1 : 1;
+}
+
+
+
+int DFextZipClose(void)
+{
+    int rc;
+
+    if (myZipFile) {
+      if (myZipFlag)
+          rc = (unzClose(myZipFile) == UNZ_OK);
+      else
+          rc = (zipClose(myZipFile, NULL) == ZIP_OK);
+      myZipFile = NULL;
+    }
+
+    return rc ? 0 : -1;
+}
+
+
+
+int DFextZipOpenNextFile(char *entryName, const int maxName)
+{
+    int rc;
+
+
+    if (myZipFlag) {
+        unz_file_info info;
+
+        // handling of first file and all others are different
+        if (myZipFirst) {
+            rc = unzGoToFirstFile(myZipFile);
+            myZipFirst = 0;
+        }
+        else
+            rc = unzGoToNextFile(myZipFile);
+
+        // Error or past last file
+        if (rc != UNZ_OK)
+            return (rc == UNZ_END_OF_LIST_OF_FILE) ? 0 : -1;
+
+        // get file name
+        if (unzGetCurrentFileInfo(myZipFile, &info, entryName, maxName, NULL, 0, NULL, 0) != UNZ_OK)
+            return -1;
+
+        // check for prefix "/" and if present skip file
+        if (entryName[strlen(entryName) - 1] == '/')
+            return DFextZipOpenNextFile(entryName, maxName);
+
+        // open Regular file
+        if (unzOpenCurrentFile(myZipFile) != UNZ_OK)
+            return -1;
+    }
+    else {
+        zip_fileinfo fileinfo;
+        memset(&fileinfo, 0, sizeof(fileinfo));
+
+        if (zipOpenNewFileInZip(myZipFile,
+            entryName,
+            &fileinfo,
+            NULL, 0,
+            NULL, 0,
+            NULL,
+            Z_DEFLATED,
+            Z_DEFAULT_COMPRESSION) != ZIP_OK)
+            return -1;
+    }
+
+    // ready to read
+    return 1;
+}
+
+
+
+int DFextZipCloseFile(void)
+{
+    if (myZipFlag)
+        return (unzCloseCurrentFile(myZipFile) != UNZ_OK) ? -1 : 1;
+    else
+        return (zipCloseFileInZip(myZipFile) != UNZ_OK) ? -1 : 1;
+}
+
+
+ 
+
+int DFextZipReadCurrentFile(char *buf, const int maxLen)
+{
+    return unzReadCurrentFile(myZipFile, buf, maxLen);
+}
+
+
+
+
+


[03/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/8c2b64a2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/8c2b64a2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/8c2b64a2

Branch: refs/heads/RTC_platform
Commit: 8c2b64a283def3c77b5c243d7041c1c78bbefe64
Parents: 8d2865f
Author: jani <ja...@apache.org>
Authored: Sat Dec 27 21:28:28 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sat Dec 27 21:28:28 2014 +0100

----------------------------------------------------------------------
 DocFormats/platform/headers/DFPlatform.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/8c2b64a2/DocFormats/platform/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/platform/headers/DFPlatform.h b/DocFormats/platform/headers/DFPlatform.h
index e53b4b1..577fcff 100755
--- a/DocFormats/platform/headers/DFPlatform.h
+++ b/DocFormats/platform/headers/DFPlatform.h
@@ -35,7 +35,8 @@ typedef void (*DFOnceFunction)(void);
 void DFInitOnce(DFOnce *once, DFOnceFunction fun);
 
 // Zip functions
-int DFextZipOpen(const char *zipFilename);
+int DFextZipOpenRead(const char *zipFilename);
+int DFextZipOpenCreate(const char *zipFilename);
 int DFextZipOpenNextFile(const char *zipFile, char *entryName, const int maxName);
 int DFextZipReadCurrentFile(char *buf, const int maxLen);
 int DFextZipClose(void);


[12/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/15f8e7f3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/15f8e7f3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/15f8e7f3

Branch: refs/heads/RTC_platform
Commit: 15f8e7f375197f5f08ddd8b2d95bf059985e97a5
Parents: 826c423
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 17:03:24 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 17:03:24 2014 +0100

----------------------------------------------------------------------
 CMakeLists.txt                           |  2 +-
 DocFormats/core/tests/names/NamesTests.c | 27 ---------------------------
 2 files changed, 1 insertion(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/15f8e7f3/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 274f230..9d1d41a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,7 +45,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
         ${PROJECT_SOURCE_DIR}/external/include)
     set(LIB_DIRS
         ${PROJECT_SOURCE_DIR}/external/lib)
-    set(LIBS ${LIBS} libxml2 zlib libiconv SDL2 SDL2_image)
+    set(LIBS ${LIBS} libxml2 zdll iconv SDL2 SDL2_image)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4090 /wd4996")
 endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
 

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/15f8e7f3/DocFormats/core/tests/names/NamesTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/tests/names/NamesTests.c b/DocFormats/core/tests/names/NamesTests.c
deleted file mode 100644
index 2e94015..0000000
--- a/DocFormats/core/tests/names/NamesTests.c
+++ /dev/null
@@ -1,27 +0,0 @@
-// Copyright 2012-2014 UX Productivity Pty Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#include "DFUnitTest.h"
-#include <stddef.h>
-
-static void test_sample(void)
-{
-}
-
-TestGroup NamesTests = {
-    "core.lib", {
-        { "sample", PlainTest, test_sample },
-        { NULL, PlainTest, NULL }
-    }
-};


[18/19] incubator-corinthia git commit: ready to fill out test cases

Posted by ja...@apache.org.
ready to fill out test cases


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/47cbcd6c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/47cbcd6c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/47cbcd6c

Branch: refs/heads/RTC_platform
Commit: 47cbcd6c3583507ea7749e24cac54be2230b7cd3
Parents: fc8cbd7
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 23:47:49 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 23:47:49 2014 +0100

----------------------------------------------------------------------
 DocFormats/platform/CMakeLists.txt        |  1 -
 DocFormats/platform/src/Win32.c           |  4 +--
 DocFormats/platform/tests/OStests.c       | 28 ++++++++++++++++--
 DocFormats/platform/tests/PlatformTests.c | 29 -------------------
 DocFormats/platform/tests/WrapperTests.c  | 39 ++++++++++++++++++++++++--
 consumers/dftest/src/main.c               |  2 --
 6 files changed, 64 insertions(+), 39 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/47cbcd6c/DocFormats/platform/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/DocFormats/platform/CMakeLists.txt b/DocFormats/platform/CMakeLists.txt
index 6fdbc07..f3752e9 100644
--- a/DocFormats/platform/CMakeLists.txt
+++ b/DocFormats/platform/CMakeLists.txt
@@ -103,7 +103,6 @@ set(GroupSrc
     src/Wrapper.c)
 
 set(GroupTests
-    tests/PlatformTests.c
     tests/OStests.c
     tests/WrapperTests.c)
 

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/47cbcd6c/DocFormats/platform/src/Win32.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/src/Win32.c b/DocFormats/platform/src/Win32.c
index aa918da..d5a0ff5 100755
--- a/DocFormats/platform/src/Win32.c
+++ b/DocFormats/platform/src/Win32.c
@@ -26,7 +26,7 @@
 #define snprintf _snprintf
 #endif
 
-void DFErrorMsgSetWin32(char **errmsg, DWORD code)
+static void DFErrorMsgSetWin32(char **errmsg, DWORD code)
 {
     if (errmsg == NULL)
         return;
@@ -62,7 +62,7 @@ static int testAndSet(int *var,int value,HANDLE lock)
     return oldValue;
 }
 
-BOOL CALLBACK initOnceMutex(PINIT_ONCE initOnce,PVOID Parameter,PVOID *Context)
+static BOOL CALLBACK initOnceMutex(PINIT_ONCE initOnce,PVOID Parameter,PVOID *Context)
 {
     onceMutex = CreateMutex(NULL,FALSE,NULL);
     return TRUE;

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/47cbcd6c/DocFormats/platform/tests/OStests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/OStests.c b/DocFormats/platform/tests/OStests.c
index 1a6f2cd..ad6edb9 100644
--- a/DocFormats/platform/tests/OStests.c
+++ b/DocFormats/platform/tests/OStests.c
@@ -15,7 +15,26 @@
 #include "DFUnitTest.h"
 #include <stddef.h>
 
-static void test_sample(void)
+
+static void test_DFGetImageDimensions(void)
+{
+}
+
+
+
+static void test_DFInitOnce(void)
+{
+}
+
+
+
+static void test_DFMkdirIfAbsent(void)
+{
+}
+
+
+
+static void test_DFAddDirContents(void)
 {
 }
 
@@ -23,7 +42,10 @@ static void test_sample(void)
 
 TestGroup PlatformOSTests = {
     "platform.os", {
-        { "sample", PlainTest, test_sample },
-        { NULL, PlainTest, NULL }
+        { "DFGetImageDimensions", PlainTest, test_DFGetImageDimensions },
+        { "DFInitOnce",           PlainTest, test_DFInitOnce },
+        { "DFMkdirIfAbsent",      PlainTest, test_DFMkdirIfAbsent },
+        { "DFAddDirContents",     PlainTest, test_DFAddDirContents },
+        { NULL,                   PlainTest, NULL }
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/47cbcd6c/DocFormats/platform/tests/PlatformTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/PlatformTests.c b/DocFormats/platform/tests/PlatformTests.c
deleted file mode 100644
index 3e8c968..0000000
--- a/DocFormats/platform/tests/PlatformTests.c
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2012-2014 UX Productivity Pty Ltd
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-#include "DFUnitTest.h"
-#include <stddef.h>
-
-static void test_sample(void)
-{
-}
-
-
-
-TestGroup PlatformTests = {
-    "platform", {
-            { "sample", PlainTest, test_sample },
-            { NULL, PlainTest, NULL }
-    }
-};
-

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/47cbcd6c/DocFormats/platform/tests/WrapperTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/WrapperTests.c b/DocFormats/platform/tests/WrapperTests.c
index f7b9532..edd8358 100644
--- a/DocFormats/platform/tests/WrapperTests.c
+++ b/DocFormats/platform/tests/WrapperTests.c
@@ -16,7 +16,37 @@
 
 
 
-static void test_sample(void)
+static void test_DFextZipOpen(void)
+{
+}
+
+
+
+static void test_DFextZipClose(void)
+{
+}
+
+
+
+static void test_DFextZipOpenNextFile(void)
+{
+}
+
+
+
+static void test_DFextZipCloseFile(void)
+{
+}
+
+
+
+static void test_DFextZipReadCurrentFile(void)
+{
+}
+
+
+
+static void test_DFextZipWriteCurrentFile(void)
 {
 }
 
@@ -24,7 +54,12 @@ static void test_sample(void)
 
 TestGroup PlatformWrapperTests = {
     "platform.wrapper", {
-            { "sample", PlainTest, test_sample },
+            { "DFextZipOpen",            PlainTest, test_DFextZipOpen   },
+            { "DFextZipClose",           PlainTest, test_DFextZipClose },
+            { "DFextZipOpenNextFile",    PlainTest, test_DFextZipOpenNextFile },
+            { "DFextZipCloseFile",       PlainTest, test_DFextZipCloseFile },
+            { "DFextZipReadCurrentFile", PlainTest, test_DFextZipReadCurrentFile },
+            { "DFextZipWriteCurrentFile", PlainTest, test_DFextZipWriteCurrentFile },
             { NULL, PlainTest, NULL }
     }
 };

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/47cbcd6c/consumers/dftest/src/main.c
----------------------------------------------------------------------
diff --git a/consumers/dftest/src/main.c b/consumers/dftest/src/main.c
index d0a4e28..737bf7f 100644
--- a/consumers/dftest/src/main.c
+++ b/consumers/dftest/src/main.c
@@ -36,7 +36,6 @@ extern TestGroup XMLTests;
 extern TestGroup LaTeXTests;
 extern TestGroup ODFTests;
 extern TestGroup WordTests;
-extern TestGroup PlatformTests;
 extern TestGroup PlatformOSTests;
 extern TestGroup PlatformWrapperTests;
 extern TestGroup BDTTests;
@@ -51,7 +50,6 @@ TestGroup *allGroups[] = {
     &LaTeXTests,
     &ODFTests,
     &WordTests,
-    &PlatformTests,
     &PlatformOSTests,
     &PlatformWrapperTests,
     NULL


[17/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/fc8cbd78
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/fc8cbd78
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/fc8cbd78

Branch: refs/heads/RTC_platform
Commit: fc8cbd78ea57d6b53eba0000b47ce17e836f8cfc
Parents: 479f00f
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 21:55:36 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 21:55:36 2014 +0100

----------------------------------------------------------------------
 DocFormats/platform/tests/OStests.c       |  6 ++++--
 DocFormats/platform/tests/PlatformTests.c | 11 ++++++++++-
 DocFormats/platform/tests/WrapperTests.c  | 12 +++++++++++-
 consumers/dftest/src/main.c               |  4 ++++
 4 files changed, 29 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/fc8cbd78/DocFormats/platform/tests/OStests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/OStests.c b/DocFormats/platform/tests/OStests.c
index b792dc3..1a6f2cd 100644
--- a/DocFormats/platform/tests/OStests.c
+++ b/DocFormats/platform/tests/OStests.c
@@ -19,8 +19,10 @@ static void test_sample(void)
 {
 }
 
-TestGroup PlatformTests = {
-    "platform", {
+
+
+TestGroup PlatformOSTests = {
+    "platform.os", {
         { "sample", PlainTest, test_sample },
         { NULL, PlainTest, NULL }
     }

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/fc8cbd78/DocFormats/platform/tests/PlatformTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/PlatformTests.c b/DocFormats/platform/tests/PlatformTests.c
index b5ebf0c..3e8c968 100644
--- a/DocFormats/platform/tests/PlatformTests.c
+++ b/DocFormats/platform/tests/PlatformTests.c
@@ -11,10 +11,19 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-
 #include "DFUnitTest.h"
+#include <stddef.h>
 
 static void test_sample(void)
 {
 }
 
+
+
+TestGroup PlatformTests = {
+    "platform", {
+            { "sample", PlainTest, test_sample },
+            { NULL, PlainTest, NULL }
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/fc8cbd78/DocFormats/platform/tests/WrapperTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/tests/WrapperTests.c b/DocFormats/platform/tests/WrapperTests.c
index b5ebf0c..f7b9532 100644
--- a/DocFormats/platform/tests/WrapperTests.c
+++ b/DocFormats/platform/tests/WrapperTests.c
@@ -11,10 +11,20 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
-
 #include "DFUnitTest.h"
+#include <stddef.h>
+
+
 
 static void test_sample(void)
 {
 }
 
+
+
+TestGroup PlatformWrapperTests = {
+    "platform.wrapper", {
+            { "sample", PlainTest, test_sample },
+            { NULL, PlainTest, NULL }
+    }
+};

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/fc8cbd78/consumers/dftest/src/main.c
----------------------------------------------------------------------
diff --git a/consumers/dftest/src/main.c b/consumers/dftest/src/main.c
index e736e2f..d0a4e28 100644
--- a/consumers/dftest/src/main.c
+++ b/consumers/dftest/src/main.c
@@ -37,6 +37,8 @@ extern TestGroup LaTeXTests;
 extern TestGroup ODFTests;
 extern TestGroup WordTests;
 extern TestGroup PlatformTests;
+extern TestGroup PlatformOSTests;
+extern TestGroup PlatformWrapperTests;
 extern TestGroup BDTTests;
 
 TestGroup *allGroups[] = {
@@ -50,6 +52,8 @@ TestGroup *allGroups[] = {
     &ODFTests,
     &WordTests,
     &PlatformTests,
+    &PlatformOSTests,
+    &PlatformWrapperTests,
     NULL
 };
 


[14/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/f3d20d18
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/f3d20d18
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/f3d20d18

Branch: refs/heads/RTC_platform
Commit: f3d20d18f48ecce80d92da9f2b1fea800f389679
Parents: b35d634 7403026
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 17:10:09 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 17:10:09 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/CMakeLists.txt | 5 -----
 1 file changed, 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/f3d20d18/DocFormats/core/CMakeLists.txt
----------------------------------------------------------------------


[05/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/b1a66b99
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/b1a66b99
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/b1a66b99

Branch: refs/heads/RTC_platform
Commit: b1a66b99c02dd33d670d8c7e0c8a2bb936ca09dc
Parents: 783e6f7
Author: jani <ja...@apache.org>
Authored: Sun Dec 28 13:27:02 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sun Dec 28 13:27:02 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/src/lib/DFZipFile.c | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/b1a66b99/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index 56da721..87e4d54 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -117,7 +117,6 @@ int DFZip(const char *zipFilename, DFStorage *storage, DFError **error)
     if (allPaths == NULL || DFextZipOpen(zipFilename, 0) <= 0)
     {
       DFErrorFormat(error,"Cannot create file");
-      goto end;
     }
     else
     {


[13/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/b35d634e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/b35d634e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/b35d634e

Branch: refs/heads/RTC_platform
Commit: b35d634eff543b63c39e3895d74e71d110d0a09a
Parents: 15f8e7f
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 17:03:43 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 17:03:43 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/tests/names/NamesTests.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/b35d634e/DocFormats/core/tests/names/NamesTests.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/tests/names/NamesTests.c b/DocFormats/core/tests/names/NamesTests.c
new file mode 100644
index 0000000..2e94015
--- /dev/null
+++ b/DocFormats/core/tests/names/NamesTests.c
@@ -0,0 +1,27 @@
+// Copyright 2012-2014 UX Productivity Pty Ltd
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "DFUnitTest.h"
+#include <stddef.h>
+
+static void test_sample(void)
+{
+}
+
+TestGroup NamesTests = {
+    "core.lib", {
+        { "sample", PlainTest, test_sample },
+        { NULL, PlainTest, NULL }
+    }
+};


[06/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/5fc315e1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/5fc315e1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/5fc315e1

Branch: refs/heads/RTC_platform
Commit: 5fc315e1981b27b3a7881977896c2ac511ffac1b
Parents: b1a66b9
Author: jani <ja...@apache.org>
Authored: Sun Dec 28 18:12:56 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sun Dec 28 18:12:56 2014 +0100

----------------------------------------------------------------------
 DocFormats/platform/headers/DFPlatform.h | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/5fc315e1/DocFormats/platform/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/platform/headers/DFPlatform.h b/DocFormats/platform/headers/DFPlatform.h
index 8ce3281..7a3d508 100755
--- a/DocFormats/platform/headers/DFPlatform.h
+++ b/DocFormats/platform/headers/DFPlatform.h
@@ -35,11 +35,13 @@ typedef void (*DFOnceFunction)(void);
 void DFInitOnce(DFOnce *once, DFOnceFunction fun);
 
 // Zip functions
-int  DFextZipOpen(const char *zipFilename, int doUnzip);
-void DFextZipClose(void);
+int DFextZipOpen(const char *zipFilename, int doUnzip);
+int DFextZipClose(void);
+
+int DFextZipOpenNextFile(char *entryName, const int maxName);
+int DFextZipCloseFile(void);
 
 
 
-int DFextZipOpenNextFile(const char *zipFile, char *entryName, const int maxName);
 int DFextZipReadCurrentFile(char *buf, const int maxLen);
 #endif


[08/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/3686a740
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/3686a740
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/3686a740

Branch: refs/heads/RTC_platform
Commit: 3686a74050148fad419f471b3a920acc2bd18478
Parents: 4524f15
Author: jani <ja...@apache.org>
Authored: Sun Dec 28 19:15:47 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sun Dec 28 19:15:47 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/src/lib/DFZipFile.c | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/3686a740/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index 63b6202..b916794 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -72,6 +72,7 @@ int DFUnzip(const char *zipFilename, DFStorage *storage, DFError **error)
     return 1;
 }
 
+#if 0
 static int zipAddFile(zipFile zip, const char *dest, DFBuffer *content, DFError **error)
 {
     zip_fileinfo fileinfo;
@@ -97,6 +98,9 @@ static int zipAddFile(zipFile zip, const char *dest, DFBuffer *content, DFError
 
     return 1;
 }
+#endif
+
+
 
 int DFZip(const char *zipFilename, DFStorage *storage, DFError **error)
 {


[16/19] incubator-corinthia git commit: Start to make tests.

Posted by ja...@apache.org.
Start to make tests.


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/479f00f1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/479f00f1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/479f00f1

Branch: refs/heads/RTC_platform
Commit: 479f00f1328acef4698a1c547308219ee7106c81
Parents: a0e6aa1
Author: jani <ja...@apache.org>
Authored: Tue Dec 30 20:31:18 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Tue Dec 30 20:31:18 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/src/lib/DFZipFile.c      | 5 +----
 DocFormats/platform/headers/DFPlatform.h | 3 +--
 DocFormats/platform/src/Wrapper.c        | 6 ++++--
 external/extract_downloads.sh            | 1 +
 4 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/479f00f1/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index 7a4ff43..8d54522 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -77,12 +77,9 @@ static int zipAddFile(const char *dest, DFBuffer *content, DFError **error)
     if (DFextZipOpenNextFile(dest, 0) < 0)
         return zipError(error,"%s: Cannot create entry in zip file",dest);
 
-#if 0
-    if (ZIP_OK != zipWriteInFileInZip(zip,content->data,(unsigned int)content->len))
+    if (DFextZipWriteCurrentFile(content->data,(unsigned int)content->len) < 0)
         return zipError(error,"%s: Error writing to entry in zip file",dest);
 
-
-#endif
     if (DFextZipCloseFile() <0)
         return zipError(error,"%s: Error closing entry in zip file",dest);
     return 1;

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/479f00f1/DocFormats/platform/headers/DFPlatform.h
----------------------------------------------------------------------
diff --git a/DocFormats/platform/headers/DFPlatform.h b/DocFormats/platform/headers/DFPlatform.h
index 7a3d508..81d8a74 100755
--- a/DocFormats/platform/headers/DFPlatform.h
+++ b/DocFormats/platform/headers/DFPlatform.h
@@ -41,7 +41,6 @@ int DFextZipClose(void);
 int DFextZipOpenNextFile(char *entryName, const int maxName);
 int DFextZipCloseFile(void);
 
-
-
 int DFextZipReadCurrentFile(char *buf, const int maxLen);
+int DFextZipWriteCurrentFile(char *buf, const int len);
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/479f00f1/DocFormats/platform/src/Wrapper.c
----------------------------------------------------------------------
diff --git a/DocFormats/platform/src/Wrapper.c b/DocFormats/platform/src/Wrapper.c
index b9df21a..f138cbe 100644
--- a/DocFormats/platform/src/Wrapper.c
+++ b/DocFormats/platform/src/Wrapper.c
@@ -129,5 +129,7 @@ int DFextZipReadCurrentFile(char *buf, const int maxLen)
 
 
 
-
-
+int DFextZipWriteCurrentFile(char *buf, const int len)
+{
+    return (zipWriteInFileInZip(myZipFile, buf, len) == ZIP_OK) ? 1 : -1;
+}

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/479f00f1/external/extract_downloads.sh
----------------------------------------------------------------------
diff --git a/external/extract_downloads.sh b/external/extract_downloads.sh
index 0d151e3..38b9d6e 100755
--- a/external/extract_downloads.sh
+++ b/external/extract_downloads.sh
@@ -41,5 +41,6 @@ mv packages/libxml2/libxml2-2.7.8.win32/bin/* bin
 
 mv packages/zlib/include/* include
 mv packages/zlib/lib/* lib
+mv packages/zlib/*.dll bin
 
 rm -rf packages


[07/19] incubator-corinthia git commit: work

Posted by ja...@apache.org.
work


Project: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/commit/4524f155
Tree: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/tree/4524f155
Diff: http://git-wip-us.apache.org/repos/asf/incubator-corinthia/diff/4524f155

Branch: refs/heads/RTC_platform
Commit: 4524f155e19b34f080d5a40bf266bcf6aa55f351
Parents: 5fc315e
Author: jani <ja...@apache.org>
Authored: Sun Dec 28 19:02:52 2014 +0100
Committer: jani <ja...@apache.org>
Committed: Sun Dec 28 19:02:52 2014 +0100

----------------------------------------------------------------------
 DocFormats/core/src/lib/DFZipFile.c | 59 ++++++++++++++------------------
 1 file changed, 25 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/4524f155/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------
diff --git a/DocFormats/core/src/lib/DFZipFile.c b/DocFormats/core/src/lib/DFZipFile.c
index 87e4d54..63b6202 100644
--- a/DocFormats/core/src/lib/DFZipFile.c
+++ b/DocFormats/core/src/lib/DFZipFile.c
@@ -13,7 +13,7 @@
 // limitations under the License.
 
 #include "DFZipFile.h"
-#include "platform.h"
+#include "DFPlatform.h"
 #include "DFFilesystem.h"
 #include "DFString.h"
 #include "DFCommon.h"
@@ -34,46 +34,37 @@ static int zipError(DFError **error, const char *format, ...)
 
 int DFUnzip(const char *zipFilename, DFStorage *storage, DFError **error)
 {
-  if (DFextZipOpen(zipFilename, 1) <= 0)
+    char entryName[4096];
+
+    if (DFextZipOpen(zipFilename, 1) <= 0)
     return zipError(error,"Cannot open file");
 
     int ret;
-    for (ret = unzGoToFirstFile(zipFile); ret == UNZ_OK; ret = unzGoToNextFile(zipFile)) {
-        unz_file_info info;
-        char entryName[4096];
-        if (UNZ_OK != unzGetCurrentFileInfo(zipFile,&info,entryName,4096,NULL,0,NULL,0))
-            return zipError(error,"Zip directory is corrupt");
-
-        if (!DFStringHasSuffix(entryName,"/")) {
-            // Regular file
-            if (UNZ_OK != unzOpenCurrentFile(zipFile))
-                return zipError(error,"%s: Cannot open zip entry",entryName);;
-
-            DFBuffer *content = DFBufferNew();
-
-            unsigned char buf[4096];
-            int r;
-            while (0 < (r = unzReadCurrentFile(zipFile,buf,4096)))
-                DFBufferAppendData(content,(void *)buf,r);
-            if (0 > r) {
-                DFBufferRelease(content);
-                return zipError(error,"%s: decompression failed",entryName);
-            }
-
-            if (UNZ_OK != unzCloseCurrentFile(zipFile)) {
-                DFBufferRelease(content);
-                return zipError(error,"%s: decompression failed",entryName);
-            }
-
-            if (!DFBufferWriteToStorage(content,storage,entryName,error)) {
-                DFBufferRelease(content);
-                return zipError(error,"%s: %s",entryName,DFErrorMessage(error));
-            }
+    for (;  (ret = DFextZipOpenNextFile(entryName, sizeof(entryName))) > 0;) {
+        DFBuffer *content = DFBufferNew();
+
+        unsigned char buf[4096];
+        int r;
+        while (0 < (r = DFextZipReadCurrentFile(buf, sizeof(buf))))
+            DFBufferAppendData(content,(void *)buf,r);
+        if (0 > r) {
+            DFBufferRelease(content);
+            return zipError(error,"%s: decompression failed",entryName);
+        }
+
+        if (DFextZipCloseFile() < 0) {
+            DFBufferRelease(content);
+            return zipError(error,"%s: decompression failed",entryName);
+        }
+
+        if (!DFBufferWriteToStorage(content,storage,entryName,error)) {
             DFBufferRelease(content);
+            return zipError(error,"%s: %s",entryName,DFErrorMessage(error));
         }
+        DFBufferRelease(content);
     }
 
-    if (UNZ_END_OF_LIST_OF_FILE != ret)
+    if (ret < 0)
         return zipError(error,"Zip directory is corrupt");
 
     DFextZipClose();