corinthia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [31/31] incubator-corinthia git commit: Merge branch 'master' into experimentzip
Date Mon, 23 Feb 2015 11:39:34 GMT
Merge branch 'master' into experimentzip

Conflicts:
	DocFormats/headers/DFPlatform.h
	DocFormats/platform/src/ZipWrapper.c


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

Branch: refs/heads/experimentzip
Commit: 1baa03dc2bf2d1069ac3fefaf69b7cbe0bd797df
Parents: 42e48a5 13f9a17
Author: jani <jani@apache.org>
Authored: Mon Feb 23 12:36:47 2015 +0100
Committer: jani <jani@apache.org>
Committed: Mon Feb 23 12:36:47 2015 +0100

----------------------------------------------------------------------
 DocFormats/DocFormats.c                         |   17 +
 DocFormats/api/CMakeLists.txt                   |    1 +
 DocFormats/api/headers/DocFormats/DFError.h     |   35 +-
 DocFormats/api/headers/DocFormats/DFStorage.h   |   25 +-
 .../api/headers/DocFormats/DFXMLForward.h       |   25 +-
 DocFormats/api/headers/DocFormats/DocFormats.h  |   25 +-
 DocFormats/api/headers/DocFormats/Formats.h     |   25 +-
 DocFormats/api/headers/DocFormats/Operations.h  |   25 +-
 DocFormats/api/src/Formats.c                    |   25 +-
 DocFormats/api/src/Operations.c                 |   35 +-
 DocFormats/api/tests/APITests.c                 |   25 +-
 DocFormats/core/src/common/DFBDT.c              |   25 +-
 DocFormats/core/src/common/DFBDT.h              |   25 +-
 DocFormats/core/src/common/DFClassNames.h       |   25 +-
 DocFormats/core/src/common/DFTable.c            |   25 +-
 DocFormats/core/src/common/DFTable.h            |   25 +-
 DocFormats/core/src/css/CSS.c                   |   25 +-
 DocFormats/core/src/css/CSS.h                   |   25 +-
 DocFormats/core/src/css/CSSLength.c             |   25 +-
 DocFormats/core/src/css/CSSLength.h             |   25 +-
 DocFormats/core/src/css/CSSParser.c             |   25 +-
 DocFormats/core/src/css/CSSParser.h             |   25 +-
 DocFormats/core/src/css/CSSProperties.c         |   25 +-
 DocFormats/core/src/css/CSSProperties.h         |   25 +-
 DocFormats/core/src/css/CSSSelector.c           |   25 +-
 DocFormats/core/src/css/CSSSelector.h           |   25 +-
 DocFormats/core/src/css/CSSSheet.c              |   25 +-
 DocFormats/core/src/css/CSSSheet.h              |   25 +-
 DocFormats/core/src/css/CSSStyle.c              |   25 +-
 DocFormats/core/src/css/CSSStyle.h              |   25 +-
 DocFormats/core/src/css/CSSSyntax.c             |   25 +-
 DocFormats/core/src/css/CSSSyntax.h             |   25 +-
 DocFormats/core/src/html/DFHTDocument.c         |   25 +-
 DocFormats/core/src/html/DFHTDocument.h         |   25 +-
 DocFormats/core/src/html/DFHTML.c               |   25 +-
 DocFormats/core/src/html/DFHTML.h               |   25 +-
 DocFormats/core/src/html/DFHTMLNormalization.c  |   25 +-
 DocFormats/core/src/html/DFHTMLNormalization.h  |   25 +-
 DocFormats/core/src/html/DFHTMLTables.c         |   25 +-
 DocFormats/core/src/html/DFHTMLTables.h         |   25 +-
 DocFormats/core/src/html/DFTidyHelper.c         |   25 +-
 DocFormats/core/src/html/DFTidyHelper.h         |   25 +-
 DocFormats/core/src/html/DFTidyWrapper.c        |   25 +-
 DocFormats/core/src/html/DFTidyWrapper.h        |   25 +-
 DocFormats/core/src/lib/DFAllocator.c           |   25 +-
 DocFormats/core/src/lib/DFAllocator.h           |   25 +-
 DocFormats/core/src/lib/DFArray.c               |   25 +-
 DocFormats/core/src/lib/DFArray.h               |   25 +-
 DocFormats/core/src/lib/DFBuffer.c              |   25 +-
 DocFormats/core/src/lib/DFBuffer.h              |   25 +-
 DocFormats/core/src/lib/DFCallback.c            |   25 +-
 DocFormats/core/src/lib/DFCallback.h            |   25 +-
 DocFormats/core/src/lib/DFCharacterSet.c        |   25 +-
 DocFormats/core/src/lib/DFCharacterSet.h        |   25 +-
 DocFormats/core/src/lib/DFError.c               |   25 +-
 DocFormats/core/src/lib/DFFilesystem.c          |   25 +-
 DocFormats/core/src/lib/DFFilesystem.h          |   25 +-
 DocFormats/core/src/lib/DFHashTable.c           |   25 +-
 DocFormats/core/src/lib/DFHashTable.h           |   25 +-
 DocFormats/core/src/lib/DFStorage.c             |   25 +-
 DocFormats/core/src/lib/DFString.c              |   25 +-
 DocFormats/core/src/lib/DFString.h              |   25 +-
 DocFormats/core/src/lib/DFZipFile.c             |   25 +-
 DocFormats/core/src/lib/DFZipFile.h             |   25 +-
 DocFormats/core/src/lib/TextPackage.c           |   25 +-
 DocFormats/core/src/lib/TextPackage.h           |   25 +-
 DocFormats/core/src/xml/DFChanges.c             |   25 +-
 DocFormats/core/src/xml/DFChanges.h             |   25 +-
 DocFormats/core/src/xml/DFDOM.c                 |   25 +-
 DocFormats/core/src/xml/DFDOM.h                 |   25 +-
 DocFormats/core/src/xml/DFMarkupCompatibility.c |   25 +-
 DocFormats/core/src/xml/DFMarkupCompatibility.h |   25 +-
 DocFormats/core/src/xml/DFNameMap.c             |   25 +-
 DocFormats/core/src/xml/DFNameMap.h             |   25 +-
 DocFormats/core/src/xml/DFXML.c                 |   25 +-
 DocFormats/core/src/xml/DFXML.h                 |   25 +-
 DocFormats/core/tests/common/BDTTests.c         |   25 +-
 DocFormats/core/tests/common/BDTTests.h         |   25 +-
 DocFormats/core/tests/css/CSSTests.c            |   25 +-
 DocFormats/core/tests/html/HTMLPlain.c          |   25 +-
 DocFormats/core/tests/html/HTMLPlain.h          |   25 +-
 DocFormats/core/tests/html/HTMLTests.c          |   25 +-
 DocFormats/core/tests/lib/LibTests.c            |   25 +-
 DocFormats/core/tests/xml/XMLTests.c            |   25 +-
 DocFormats/filters/latex/src/HTMLToLaTeX.c      |   25 +-
 DocFormats/filters/latex/src/HTMLToLaTeX.h      |   25 +-
 DocFormats/filters/latex/tests/LaTeXTests.c     |   25 +-
 DocFormats/filters/odf/CMakeLists.txt           |   10 +-
 DocFormats/filters/odf/src/ODF.c                |   25 +-
 DocFormats/filters/odf/src/ODF.h                |   25 +-
 DocFormats/filters/odf/src/ODFManifest.c        |   25 +-
 DocFormats/filters/odf/src/ODFManifest.h        |   25 +-
 DocFormats/filters/odf/src/ODFPackage.c         |   25 +-
 DocFormats/filters/odf/src/ODFPackage.h         |   25 +-
 DocFormats/filters/odf/src/ODFSheet.c           |   25 +-
 DocFormats/filters/odf/src/ODFSheet.h           |   25 +-
 DocFormats/filters/odf/src/text/ODFText.c       |   37 +
 DocFormats/filters/odf/src/text/ODFText.h       |   29 +
 DocFormats/filters/odf/tests/ODFTests.c         |   25 +-
 .../filters/ooxml/src/common/OOXMLTypedefs.h    |   25 +-
 DocFormats/filters/ooxml/src/common/OPC.c       |   25 +-
 DocFormats/filters/ooxml/src/common/OPC.h       |   25 +-
 .../filters/ooxml/src/word/CSSClassNames.c      |   25 +-
 .../filters/ooxml/src/word/CSSClassNames.h      |   25 +-
 DocFormats/filters/ooxml/src/word/Word.c        |   43 +-
 DocFormats/filters/ooxml/src/word/Word.h        |   25 +-
 DocFormats/filters/ooxml/src/word/WordCaption.c |   25 +-
 DocFormats/filters/ooxml/src/word/WordCaption.h |   25 +-
 .../filters/ooxml/src/word/WordConverter.c      |   42 +-
 .../filters/ooxml/src/word/WordConverter.h      |   33 +-
 DocFormats/filters/ooxml/src/word/WordGC.c      |   25 +-
 DocFormats/filters/ooxml/src/word/WordGC.h      |   25 +-
 DocFormats/filters/ooxml/src/word/WordLists.c   |   25 +-
 DocFormats/filters/ooxml/src/word/WordLists.h   |   25 +-
 DocFormats/filters/ooxml/src/word/WordNotes.c   |   25 +-
 DocFormats/filters/ooxml/src/word/WordNotes.h   |   25 +-
 .../filters/ooxml/src/word/WordNumbering.c      |   25 +-
 .../filters/ooxml/src/word/WordNumbering.h      |   25 +-
 DocFormats/filters/ooxml/src/word/WordObjects.c |   25 +-
 DocFormats/filters/ooxml/src/word/WordObjects.h |   25 +-
 DocFormats/filters/ooxml/src/word/WordPackage.c |   25 +-
 DocFormats/filters/ooxml/src/word/WordPackage.h |   25 +-
 DocFormats/filters/ooxml/src/word/WordSection.c |   25 +-
 DocFormats/filters/ooxml/src/word/WordSection.h |   25 +-
 .../filters/ooxml/src/word/WordSettings.c       |   25 +-
 .../filters/ooxml/src/word/WordSettings.h       |   25 +-
 DocFormats/filters/ooxml/src/word/WordSheet.c   |   25 +-
 DocFormats/filters/ooxml/src/word/WordSheet.h   |   25 +-
 DocFormats/filters/ooxml/src/word/WordStyles.c  |   25 +-
 DocFormats/filters/ooxml/src/word/WordStyles.h  |   25 +-
 DocFormats/filters/ooxml/src/word/WordTheme.c   |   25 +-
 DocFormats/filters/ooxml/src/word/WordTheme.h   |   25 +-
 .../filters/ooxml/src/word/WordWhitespace.c     |   25 +-
 .../filters/ooxml/src/word/WordWhitespace.h     |   25 +-
 .../ooxml/src/word/formatting/WordCommonPr.c    |   25 +-
 .../ooxml/src/word/formatting/WordCommonPr.h    |   25 +-
 .../ooxml/src/word/formatting/WordNumPr.c       |   25 +-
 .../ooxml/src/word/formatting/WordNumPr.h       |   25 +-
 .../filters/ooxml/src/word/formatting/WordPPr.c |   25 +-
 .../filters/ooxml/src/word/formatting/WordPPr.h |   25 +-
 .../filters/ooxml/src/word/formatting/WordRPr.c |   25 +-
 .../filters/ooxml/src/word/formatting/WordRPr.h |   25 +-
 .../ooxml/src/word/formatting/WordTblPr.c       |   25 +-
 .../ooxml/src/word/formatting/WordTblPr.h       |   25 +-
 .../ooxml/src/word/lenses/WordBlockLevel.c      |   25 +-
 .../filters/ooxml/src/word/lenses/WordBody.c    |   25 +-
 .../ooxml/src/word/lenses/WordBookmark.c        |   25 +-
 .../ooxml/src/word/lenses/WordBookmark.h        |   25 +-
 .../filters/ooxml/src/word/lenses/WordChange.c  |   25 +-
 .../ooxml/src/word/lenses/WordDocument.c        |   25 +-
 .../filters/ooxml/src/word/lenses/WordDrawing.c |   25 +-
 .../filters/ooxml/src/word/lenses/WordDrawing.h |   25 +-
 .../ooxml/src/word/lenses/WordEquation.c        |   25 +-
 .../filters/ooxml/src/word/lenses/WordField.c   |   25 +-
 .../filters/ooxml/src/word/lenses/WordField.h   |   25 +-
 .../ooxml/src/word/lenses/WordHyperlink.c       |   25 +-
 .../filters/ooxml/src/word/lenses/WordLenses.c  |   25 +-
 .../filters/ooxml/src/word/lenses/WordLenses.h  |   25 +-
 .../ooxml/src/word/lenses/WordParagraph.c       |   25 +-
 .../src/word/lenses/WordParagraphContent.c      |   25 +-
 .../filters/ooxml/src/word/lenses/WordRun.c     |   25 +-
 .../ooxml/src/word/lenses/WordRunContent.c      |   25 +-
 .../ooxml/src/word/lenses/WordSmartTag.c        |   25 +-
 .../filters/ooxml/src/word/lenses/WordTable.c   |   25 +-
 DocFormats/filters/ooxml/tests/word/WordPlain.c |   25 +-
 DocFormats/filters/ooxml/tests/word/WordPlain.h |   25 +-
 DocFormats/filters/ooxml/tests/word/WordTests.c |   25 +-
 DocFormats/headers/DFCommon.h                   |   25 +-
 DocFormats/headers/DFCore.h                     |   25 +-
 DocFormats/headers/DFPlatform.h                 |   74 +-
 DocFormats/headers/DFTypes.h                    |   25 +-
 DocFormats/platform/src/Apple.c                 |   25 +-
 DocFormats/platform/src/Linux.c                 |   25 +-
 DocFormats/platform/src/Unix.c                  |   25 +-
 DocFormats/platform/src/Win32.c                 |   25 +-
 DocFormats/platform/src/ZipWrapper.c            |   26 +-
 DocFormats/platform/tests/OStests.c             |   25 +-
 DocFormats/platform/tests/WrapperTests.c        |   26 +-
 DocFormats/unittest/DFUnitTest.c                |   25 +-
 DocFormats/unittest/DFUnitTest.h                |   25 +-
 Editor/src/3rdparty/showdown/license.txt        |   68 +-
 Editor/src/3rdparty/showdown/showdown.js        | 2604 +++++++++---------
 Editor/src/AutoCorrect.js                       |   25 +-
 Editor/src/ChangeTracking.js                    |   25 +-
 Editor/src/Clipboard.js                         |   25 +-
 Editor/src/Cursor.js                            |   42 +-
 Editor/src/DOM.js                               |   25 +-
 Editor/src/Editor.js                            |   25 +-
 Editor/src/Equations.js                         |   25 +-
 Editor/src/Figures.js                           |   25 +-
 Editor/src/Formatting.js                        |   25 +-
 Editor/src/Hierarchy.js                         |   25 +-
 Editor/src/Input.js                             |   25 +-
 Editor/src/Lists.js                             |   25 +-
 Editor/src/Main.js                              |   25 +-
 Editor/src/Metadata.js                          |   25 +-
 Editor/src/NodeSet.js                           |   25 +-
 Editor/src/Outline.js                           |   25 +-
 Editor/src/Position.js                          |  125 +-
 Editor/src/PostponedActions.js                  |   25 +-
 Editor/src/Preview.js                           |   25 +-
 Editor/src/Range.js                             |   25 +-
 Editor/src/Scan.js                              |   25 +-
 Editor/src/Selection.js                         |   32 +-
 Editor/src/StringBuilder.js                     |   25 +-
 Editor/src/Styles.js                            |   25 +-
 Editor/src/Tables.js                            |   25 +-
 Editor/src/Text.js                              |   25 +-
 Editor/src/UndoManager.js                       |   25 +-
 Editor/src/Viewport.js                          |   25 +-
 Editor/src/first.js                             |   25 +-
 Editor/src/traversal.js                         |   25 +-
 Editor/src/types.js                             |   38 +-
 Editor/src/util.js                              |   25 +-
 Editor/tests/PrettyPrinter.js                   |   25 +-
 Editor/tests/autocorrect/AutoCorrectTests.js    |   25 +-
 .../tests/cursor/insertEndnote07-expected.html  |   11 +
 Editor/tests/cursor/insertEndnote07-input.html  |   15 +
 .../tests/cursor/insertEndnote08-expected.html  |   11 +
 Editor/tests/cursor/insertEndnote08-input.html  |   15 +
 .../tests/cursor/insertEndnote09-expected.html  |   11 +
 Editor/tests/cursor/insertEndnote09-input.html  |   15 +
 .../tests/cursor/insertFootnote07-expected.html |   11 +
 Editor/tests/cursor/insertFootnote07-input.html |   15 +
 .../tests/cursor/insertFootnote08-expected.html |   11 +
 Editor/tests/cursor/insertFootnote08-input.html |   15 +
 .../tests/cursor/insertFootnote09-expected.html |   11 +
 Editor/tests/cursor/insertFootnote09-input.html |   15 +
 Editor/tests/dom/RangeTest.js                   |   25 +-
 Editor/tests/figures/FiguresTest.js             |   25 +-
 Editor/tests/genindex.sh                        |    2 +-
 Editor/tests/index.js                           |   28 +-
 Editor/tests/input/InputTests.js                |   25 +-
 Editor/tests/outline/OutlineTest.js             |   25 +-
 ...sValidCursorPosition-endnote01-expected.html |   11 +
 .../isValidCursorPosition-endnote01-input.html  |   15 +
 ...sValidCursorPosition-endnote02-expected.html |   11 +
 .../isValidCursorPosition-endnote02-input.html  |   15 +
 ...sValidCursorPosition-endnote03-expected.html |   11 +
 .../isValidCursorPosition-endnote03-input.html  |   15 +
 ...sValidCursorPosition-endnote04-expected.html |   11 +
 .../isValidCursorPosition-endnote04-input.html  |   15 +
 ...sValidCursorPosition-endnote05-expected.html |   13 +
 .../isValidCursorPosition-endnote05-input.html  |   15 +
 ...sValidCursorPosition-endnote06-expected.html |   11 +
 .../isValidCursorPosition-endnote06-input.html  |   15 +
 ...sValidCursorPosition-endnote07-expected.html |   11 +
 .../isValidCursorPosition-endnote07-input.html  |   15 +
 ...sValidCursorPosition-endnote08-expected.html |   11 +
 .../isValidCursorPosition-endnote08-input.html  |   15 +
 ...sValidCursorPosition-endnote09-expected.html |   11 +
 .../isValidCursorPosition-endnote09-input.html  |   15 +
 ...sValidCursorPosition-endnote10-expected.html |   13 +
 .../isValidCursorPosition-endnote10-input.html  |   15 +
 ...ValidCursorPosition-footnote01-expected.html |   11 +
 .../isValidCursorPosition-footnote01-input.html |   15 +
 ...ValidCursorPosition-footnote02-expected.html |   11 +
 .../isValidCursorPosition-footnote02-input.html |   15 +
 ...ValidCursorPosition-footnote03-expected.html |   11 +
 .../isValidCursorPosition-footnote03-input.html |   15 +
 ...ValidCursorPosition-footnote04-expected.html |   11 +
 .../isValidCursorPosition-footnote04-input.html |   15 +
 ...ValidCursorPosition-footnote05-expected.html |   13 +
 .../isValidCursorPosition-footnote05-input.html |   15 +
 ...ValidCursorPosition-footnote06-expected.html |   11 +
 .../isValidCursorPosition-footnote06-input.html |   15 +
 ...ValidCursorPosition-footnote07-expected.html |   11 +
 .../isValidCursorPosition-footnote07-input.html |   15 +
 ...ValidCursorPosition-footnote08-expected.html |   11 +
 .../isValidCursorPosition-footnote08-input.html |   15 +
 ...ValidCursorPosition-footnote09-expected.html |   11 +
 .../isValidCursorPosition-footnote09-input.html |   15 +
 ...ValidCursorPosition-footnote10-expected.html |   13 +
 .../isValidCursorPosition-footnote10-input.html |   15 +
 Editor/tests/position/validPositions.js         |   25 +-
 Editor/tests/scan/ScanTests.js                  |   25 +-
 Editor/tests/selection/PositionTests.js         |   25 +-
 Editor/tests/server.js                          |   25 +-
 Editor/tests/tables/TableTests.js               |   25 +-
 Editor/tests/test-structure.html                |   19 +-
 Editor/tests/testharness.js                     |   25 +-
 Editor/tests/testlib.js                         |   25 +-
 Editor/tests/text/TextTests.js                  |   25 +-
 Editor/tests/undo/UndoTests.js                  |   25 +-
 NOTICE.txt                                      |    7 +
 consumers/dfconvert/src/main.c                  |   25 +-
 consumers/dftest/src/main.c                     |   25 +-
 consumers/dfutil/src/Commands.c                 |   27 +-
 consumers/dfutil/src/Commands.h                 |   25 +-
 consumers/dfutil/src/FunctionTests.h            |   25 +-
 consumers/dfutil/src/FunctionTests.m            |   26 +-
 consumers/dfutil/src/StringTests.h              |   25 +-
 consumers/dfutil/src/StringTests.m              |   26 +-
 consumers/dfutil/src/dfutil-Prefix.pch          |    7 -
 consumers/dfutil/src/main.c                     |   25 +-
 external/README.txt                             |    4 +-
 external/external.txt                           |    9 +
 external/extract_downloads.sh                   |   46 -
 external/fetch_downloads.sh                     |   21 -
 schemas/createimpl.js                           |   25 +-
 schemas/relaxng.js                              |   25 +-
 301 files changed, 5634 insertions(+), 4039 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/1baa03dc/DocFormats/core/src/lib/DFZipFile.c
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/1baa03dc/DocFormats/headers/DFPlatform.h
----------------------------------------------------------------------
diff --cc DocFormats/headers/DFPlatform.h
index 1521794,3790545..9f9882d
--- a/DocFormats/headers/DFPlatform.h
+++ b/DocFormats/headers/DFPlatform.h
@@@ -65,20 -71,32 +71,46 @@@ void DFInitOnce(DFOnce *once, DFOnceFun
  
  // Zip functions
  typedef struct {
 -        void *handle;
 -        int   zipFlag;
 -        int   zipFirst;
 +        void                  *handle;
 +        struct DFDirEntryList *zipDirectoryEntries;
          } DFextZipHandle;
+ 
  typedef DFextZipHandle * DFextZipHandleP;
  
++<<<<<<< HEAD
 +DFextZipHandleP DFextZipOpen  (const char     *zipFilename);
 +DFextZipHandleP DFextZipCreate(const char     *zipFilename);
 +int             DFextZipClose (DFextZipHandleP zipHandle);
 +
 +int             DFextZipOpenFileByName(DFextZipHandleP zipHandle, char            *entryName);
 +int             DFextZipOpenFileByPtr (DFextZipHandleP zipHandle, DFextZipHandleP  entryPtr);
 +int             DFextZipAppendNewFile (DFextZipHandleP zipHandle, char            *entryName);
 +int             DFextZipCloseFile     (DFextZipHandleP zipHandle);
 +
 +int DFextZipReadCurrentFile (DFextZipHandleP zipHandle,       void *buf, const int maxLen);
 +int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, const void *buf, const int len);
 +#endif
++=======
+ DFextZipHandleP DFextZipOpen(const char *zipFilename, int doUnzip);
+ 
+ int DFextZipClose(DFextZipHandleP zipHandle);
+ 
+ int DFextZipOpenNextFile(DFextZipHandleP zipHandle,
+                          char *entryName,
+                          const int maxName);
+ 
+ int DFextZipAppendNewFile(DFextZipHandleP zipHandle,
+                           const char *entryName);
+ 
+ int DFextZipCloseFile(DFextZipHandleP zipHandle);
+ 
+ int DFextZipReadCurrentFile(DFextZipHandleP zipHandle,
+                             void *buf,
+                             const int maxLen);
+ 
+ int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle,
+                              const void *buf,
+                              const int len);
+ 
+ #endif // DocFormats_DFPlatform_h
++>>>>>>> master

http://git-wip-us.apache.org/repos/asf/incubator-corinthia/blob/1baa03dc/DocFormats/platform/src/ZipWrapper.c
----------------------------------------------------------------------
diff --cc DocFormats/platform/src/ZipWrapper.c
index e3a9c6a,0000000..26df575
mode 100644,000000..100644
--- a/DocFormats/platform/src/ZipWrapper.c
+++ b/DocFormats/platform/src/ZipWrapper.c
@@@ -1,211 -1,0 +1,223 @@@
++<<<<<<< HEAD:DocFormats/platform/src/ZipWrapper.c
 +// 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
++=======
++// Licensed to the Apache Software Foundation (ASF) under one
++// or more contributor license agreements.  See the NOTICE file
++// distributed with this work for additional information
++// regarding copyright ownership.  The ASF licenses this file
++// to you 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
++//   http://www.apache.org/licenses/LICENSE-2.0
++>>>>>>> master:DocFormats/platform/src/Wrapper.c
 +//
- // 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.
++// 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 <stdlib.h>
 +#include "DFPlatform.h"
 +#include "unzip.h"
 +#include "zip.h"
 +
 +
 +DFextZipHandleP DFextZipOpen(const char *zipFilename)
 +{
 +    DFextZipHandleP zipHandle = malloc(sizeof(DFextZipHandle));
 +
 +    // no more memory
 +    if (!zipHandle)
 +        return NULL;
 +
 +
 +    return zipHandle;
 +}
 +
 +
 +
 +DFextZipHandleP DFextZipCreate(const char *zipFilename)
 +{
 +    return NULL;
 +}
 +
 +
 +
 +int DFextZipClose(DFextZipHandleP zipHandle)
 +{
 +    return 0;
 +}
 +
 +
 +
 +int DFextZipOpenFileByName(DFextZipHandleP zipHandle, char *entryName)
 +{
 +    return 0;
 +}
 +
 +
 +
 +int DFextZipOpenFileByPtr(DFextZipHandleP zipHandle, DFextZipHandleP  entryPtr)
 +{
 +    return 0;
 +}
 +
 +
 +
 +int DFextZipAppendNewFile(DFextZipHandleP zipHandle, char *entryName)
 +{
 +    return 0;
 +}
 +
 +
 +
 +int DFextZipCloseFile(DFextZipHandleP zipHandle)
 +{
 +    return 0;
 +}
 +
 +
 +
 +int DFextZipReadCurrentFile(DFextZipHandleP zipHandle, void *buf, const int maxLen)
 +{
 +    return 0;
 +}
 +
 +
 +
 +int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, const void *buf, const int len)
 +{
 +    return 0;
 +}
 +
 +
 +
 +
 +#ifdef JANI
 +DFextZipHandleP DFextZipOpen(const char *zipFilename, int doUnzip) {
 +    // Open file
 +    zipHandle->zipFirst = 1;
 +    zipHandle->zipFlag = doUnzip;
 +    if (doUnzip)
 +        zipHandle->handle = unzOpen(zipFilename);
 +    else
 +        zipHandle->handle = zipOpen(zipFilename, APPEND_STATUS_CREATE);
 +
 +    if (zipHandle->handle)
 +        return zipHandle;
 +
 +    free(zipHandle);
 +    return NULL;
 +}
 +
 +
 +
 +int DFextZipClose(DFextZipHandleP zipHandle)
 +{
 +    int rc = 0;
 +
 +    if (zipHandle->handle) {
 +        if (zipHandle->zipFlag)
 +            rc = (unzClose(zipHandle->handle) == UNZ_OK);
 +        else
 +            rc = (zipClose(zipHandle->handle, NULL) == ZIP_OK);
 +        zipHandle->handle = NULL;
 +    }
 +
 +    free(zipHandle);
 +    return rc ? 1 : -1;
 +}
 +
 +
 +
 +int DFextZipOpenNextFile(DFextZipHandleP zipHandle, char *entryName, const int maxName)
 +{
 +    int rc;
 +
 +
 +    if (zipHandle->zipFlag) {
 +        unz_file_info info;
 +
 +        // handling of first file and all others are different
 +        if (zipHandle->zipFirst) {
 +            rc = unzGoToFirstFile(zipHandle->handle);
 +            zipHandle->zipFirst = 0;
 +        }
 +        else
 +            rc = unzGoToNextFile(zipHandle->handle);
 +
 +        // Error or past last file
 +        if (rc != UNZ_OK)
 +            return (rc == UNZ_END_OF_LIST_OF_FILE) ? 0 : -1;
 +
 +        // get file name
 +        if (unzGetCurrentFileInfo(zipHandle->handle, &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(zipHandle, entryName, maxName);
 +
 +        // open Regular file
 +        if (unzOpenCurrentFile(zipHandle->handle) != UNZ_OK)
 +            return -1;
 +    }
 +    else {
 +        return -1; // Zip file is open in write-only mode
 +    }
 +
 +    // ready to read
 +    return 1;
 +}
 +
 +int DFextZipAppendNewFile(DFextZipHandleP zipHandle, const char *entryName)
 +{
 +    zip_fileinfo fileinfo;
 +    memset(&fileinfo, 0, sizeof(fileinfo));
 +
 +    if (zipHandle->zipFlag)
 +        return -1; // Zip file is open in read-only mode
 +
 +    if (zipOpenNewFileInZip(zipHandle->handle,
 +                            entryName,
 +                            &fileinfo,
 +                            NULL, 0,
 +                            NULL, 0,
 +                            NULL,
 +                            Z_DEFLATED,
 +                            Z_DEFAULT_COMPRESSION) != ZIP_OK) {
 +        return -1;
 +    }
 +
 +    return 1;
 +}
 +
 +int DFextZipCloseFile(DFextZipHandleP zipHandle)
 +{
 +    if (zipHandle->zipFlag)
 +        return (unzCloseCurrentFile(zipHandle->handle) != UNZ_OK) ? -1 : 1;
 +    else
 +        return (zipCloseFileInZip(zipHandle->handle) != UNZ_OK) ? -1 : 1;
 +}
 +
 +
 + 
 +
 +int DFextZipReadCurrentFile(DFextZipHandleP zipHandle, void *buf, const int maxLen)
 +{
 +    return unzReadCurrentFile(zipHandle->handle, buf, maxLen);
 +}
 +
 +
 +
 +int DFextZipWriteCurrentFile(DFextZipHandleP zipHandle, const void *buf, const int len)
 +{
 +    return (zipWriteInFileInZip(zipHandle->handle, buf, len) == ZIP_OK) ? 1 : -1;
 +}
- #endif
++#endif


Mime
View raw message