libwz 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +165 -0
- package/binding.gyp +149 -0
- package/deps/tiny-aes/.github/workflows/c-cpp.yml +27 -0
- package/deps/tiny-aes/CMakeLists.txt +17 -0
- package/deps/tiny-aes/Makefile +61 -0
- package/deps/tiny-aes/README.md +83 -0
- package/deps/tiny-aes/aes.c +572 -0
- package/deps/tiny-aes/aes.h +91 -0
- package/deps/tiny-aes/aes.hpp +12 -0
- package/deps/tiny-aes/conanfile.py +73 -0
- package/deps/tiny-aes/library.json +19 -0
- package/deps/tiny-aes/library.properties +11 -0
- package/deps/tiny-aes/test.c +316 -0
- package/deps/tiny-aes/test.cpp +2 -0
- package/deps/tiny-aes/test_package/CMakeLists.txt +11 -0
- package/deps/tiny-aes/test_package/conanfile.py +17 -0
- package/deps/tiny-aes/unlicense.txt +24 -0
- package/deps/zlib/.cmake-format.yaml +245 -0
- package/deps/zlib/.github/workflows/c-std.yml +268 -0
- package/deps/zlib/.github/workflows/cmake.yml +147 -0
- package/deps/zlib/.github/workflows/configure.yml +146 -0
- package/deps/zlib/.github/workflows/contribs.yml +64 -0
- package/deps/zlib/.github/workflows/fuzz.yml +25 -0
- package/deps/zlib/.github/workflows/msys-cygwin.yml +92 -0
- package/deps/zlib/.github/workflows/others.yml +153 -0
- package/deps/zlib/BUILD.bazel +134 -0
- package/deps/zlib/CMakeLists.txt +310 -0
- package/deps/zlib/ChangeLog +1669 -0
- package/deps/zlib/FAQ +371 -0
- package/deps/zlib/INDEX +67 -0
- package/deps/zlib/LICENSE +22 -0
- package/deps/zlib/MODULE.bazel +9 -0
- package/deps/zlib/Makefile.in +426 -0
- package/deps/zlib/README +115 -0
- package/deps/zlib/README-cmake.md +79 -0
- package/deps/zlib/adler32.c +164 -0
- package/deps/zlib/amiga/Makefile.pup +69 -0
- package/deps/zlib/amiga/Makefile.sas +68 -0
- package/deps/zlib/compress.c +99 -0
- package/deps/zlib/configure +1078 -0
- package/deps/zlib/contrib/CMakeLists.txt +61 -0
- package/deps/zlib/contrib/README.contrib +57 -0
- package/deps/zlib/contrib/ada/CMakeLists.txt +217 -0
- package/deps/zlib/contrib/ada/buffer_demo.adb +106 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeADACompiler.cmake.in +23 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeADAInformation.cmake +133 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeDetermineADACompiler.cmake +33 -0
- package/deps/zlib/contrib/ada/cmake/Modules/CMakeTestADACompiler.cmake +46 -0
- package/deps/zlib/contrib/ada/cmake/binder_helper.cmake +47 -0
- package/deps/zlib/contrib/ada/cmake/compile_helper.cmake +32 -0
- package/deps/zlib/contrib/ada/cmake/exe_link_helper.cmake +53 -0
- package/deps/zlib/contrib/ada/cmake/shared_link_helper.cmake +52 -0
- package/deps/zlib/contrib/ada/cmake/static_link_helper.cmake +25 -0
- package/deps/zlib/contrib/ada/mtest.adb +156 -0
- package/deps/zlib/contrib/ada/read.adb +156 -0
- package/deps/zlib/contrib/ada/readme.txt +65 -0
- package/deps/zlib/contrib/ada/test.adb +463 -0
- package/deps/zlib/contrib/ada/zlib-streams.adb +225 -0
- package/deps/zlib/contrib/ada/zlib-streams.ads +114 -0
- package/deps/zlib/contrib/ada/zlib-thin.adb +142 -0
- package/deps/zlib/contrib/ada/zlib-thin.ads +450 -0
- package/deps/zlib/contrib/ada/zlib.adb +701 -0
- package/deps/zlib/contrib/ada/zlib.ads +328 -0
- package/deps/zlib/contrib/ada/zlib.gpr +20 -0
- package/deps/zlib/contrib/blast/CMakeLists.txt +166 -0
- package/deps/zlib/contrib/blast/Makefile +14 -0
- package/deps/zlib/contrib/blast/README +4 -0
- package/deps/zlib/contrib/blast/blast-test.c +42 -0
- package/deps/zlib/contrib/blast/blast.c +422 -0
- package/deps/zlib/contrib/blast/blast.h +84 -0
- package/deps/zlib/contrib/blast/blastConfig.cmake.in +18 -0
- package/deps/zlib/contrib/blast/test/CMakeLists.txt +193 -0
- package/deps/zlib/contrib/blast/test/add_subdirectory_exclude_test.cmake.in +27 -0
- package/deps/zlib/contrib/blast/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/blast/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/blast/test.pk +0 -0
- package/deps/zlib/contrib/blast/test.txt +1 -0
- package/deps/zlib/contrib/blast/tester.cmake +28 -0
- package/deps/zlib/contrib/crc32vx/CMakeLists.txt +67 -0
- package/deps/zlib/contrib/crc32vx/README +9 -0
- package/deps/zlib/contrib/crc32vx/crc32_vx.c +254 -0
- package/deps/zlib/contrib/crc32vx/crc32_vx_hooks.h +9 -0
- package/deps/zlib/contrib/delphi/ZLib.pas +557 -0
- package/deps/zlib/contrib/delphi/ZLibConst.pas +11 -0
- package/deps/zlib/contrib/delphi/readme.txt +76 -0
- package/deps/zlib/contrib/delphi/zlibd32.mak +99 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
- package/deps/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.build +33 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.chm +0 -0
- package/deps/zlib/contrib/dotzlib/DotZLib.sln +21 -0
- package/deps/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- package/deps/zlib/contrib/dotzlib/readme.txt +58 -0
- package/deps/zlib/contrib/gcc_gvmat64/CMakeLists.txt +19 -0
- package/deps/zlib/contrib/gcc_gvmat64/gvmat64.S +570 -0
- package/deps/zlib/contrib/infback9/CMakeLists.txt +19 -0
- package/deps/zlib/contrib/infback9/README +1 -0
- package/deps/zlib/contrib/infback9/infback9.c +603 -0
- package/deps/zlib/contrib/infback9/infback9.h +37 -0
- package/deps/zlib/contrib/infback9/inffix9.h +107 -0
- package/deps/zlib/contrib/infback9/inflate9.h +47 -0
- package/deps/zlib/contrib/infback9/inftree9.c +319 -0
- package/deps/zlib/contrib/infback9/inftree9.h +61 -0
- package/deps/zlib/contrib/iostream/test.cpp +24 -0
- package/deps/zlib/contrib/iostream/zfstream.cpp +329 -0
- package/deps/zlib/contrib/iostream/zfstream.h +128 -0
- package/deps/zlib/contrib/iostream2/zstream.h +306 -0
- package/deps/zlib/contrib/iostream2/zstream_test.cpp +25 -0
- package/deps/zlib/contrib/iostream3/CMakeLists.txt +200 -0
- package/deps/zlib/contrib/iostream3/README +35 -0
- package/deps/zlib/contrib/iostream3/TODO +17 -0
- package/deps/zlib/contrib/iostream3/iostream3Config.cmake.in +23 -0
- package/deps/zlib/contrib/iostream3/test/CMakeLists.txt +191 -0
- package/deps/zlib/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in +27 -0
- package/deps/zlib/contrib/iostream3/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/iostream3/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/iostream3/test.cc +50 -0
- package/deps/zlib/contrib/iostream3/zfstream.cc +479 -0
- package/deps/zlib/contrib/iostream3/zfstream.h +466 -0
- package/deps/zlib/contrib/minizip/CMakeLists.txt +387 -0
- package/deps/zlib/contrib/minizip/LICENSE.Info-Zip +58 -0
- package/deps/zlib/contrib/minizip/Makefile +33 -0
- package/deps/zlib/contrib/minizip/Makefile.am +45 -0
- package/deps/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
- package/deps/zlib/contrib/minizip/MiniZip64_info.txt +69 -0
- package/deps/zlib/contrib/minizip/configure.ac +32 -0
- package/deps/zlib/contrib/minizip/crypt.h +125 -0
- package/deps/zlib/contrib/minizip/ints.h +57 -0
- package/deps/zlib/contrib/minizip/ioapi.c +231 -0
- package/deps/zlib/contrib/minizip/ioapi.h +183 -0
- package/deps/zlib/contrib/minizip/iowin32.c +447 -0
- package/deps/zlib/contrib/minizip/iowin32.h +27 -0
- package/deps/zlib/contrib/minizip/make_vms.com +25 -0
- package/deps/zlib/contrib/minizip/miniunz.c +647 -0
- package/deps/zlib/contrib/minizip/miniunzip.1 +63 -0
- package/deps/zlib/contrib/minizip/minizip.1 +46 -0
- package/deps/zlib/contrib/minizip/minizip.c +511 -0
- package/deps/zlib/contrib/minizip/minizip.pc.in +13 -0
- package/deps/zlib/contrib/minizip/minizip.pc.txt +13 -0
- package/deps/zlib/contrib/minizip/minizipConfig.cmake.in +27 -0
- package/deps/zlib/contrib/minizip/mztools.c +294 -0
- package/deps/zlib/contrib/minizip/mztools.h +37 -0
- package/deps/zlib/contrib/minizip/skipset.h +366 -0
- package/deps/zlib/contrib/minizip/test/CMakeLists.txt +176 -0
- package/deps/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -0
- package/deps/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -0
- package/deps/zlib/contrib/minizip/test/find_package_no_components_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/find_package_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/find_package_wrong_components_test.cmake.in +26 -0
- package/deps/zlib/contrib/minizip/test/test_helper.cm +32 -0
- package/deps/zlib/contrib/minizip/unzip.c +1984 -0
- package/deps/zlib/contrib/minizip/unzip.h +442 -0
- package/deps/zlib/contrib/minizip/zip.c +2246 -0
- package/deps/zlib/contrib/minizip/zip.h +371 -0
- package/deps/zlib/contrib/nuget/nuget.csproj +45 -0
- package/deps/zlib/contrib/nuget/nuget.sln +22 -0
- package/deps/zlib/contrib/pascal/example.pas +599 -0
- package/deps/zlib/contrib/pascal/readme.txt +76 -0
- package/deps/zlib/contrib/pascal/zlibd32.mak +99 -0
- package/deps/zlib/contrib/pascal/zlibpas.pas +276 -0
- package/deps/zlib/contrib/puff/CMakeLists.txt +154 -0
- package/deps/zlib/contrib/puff/Makefile +42 -0
- package/deps/zlib/contrib/puff/README +63 -0
- package/deps/zlib/contrib/puff/bin-writer.c +26 -0
- package/deps/zlib/contrib/puff/puff.c +840 -0
- package/deps/zlib/contrib/puff/puff.h +35 -0
- package/deps/zlib/contrib/puff/puffConfig.cmake.in +18 -0
- package/deps/zlib/contrib/puff/pufftest.c +168 -0
- package/deps/zlib/contrib/puff/test/CMakeLists.txt +262 -0
- package/deps/zlib/contrib/puff/test/add_subdirectory_exclude_test.cmake.in +26 -0
- package/deps/zlib/contrib/puff/test/add_subdirectory_test.cmake.in +25 -0
- package/deps/zlib/contrib/puff/test/find_package_no_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/find_package_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/find_package_wrong_components_test.cmake.in +24 -0
- package/deps/zlib/contrib/puff/test/tester-cov.cmake +58 -0
- package/deps/zlib/contrib/puff/test/tester.cmake +16 -0
- package/deps/zlib/contrib/puff/zeros.raw +0 -0
- package/deps/zlib/contrib/testzlib/CMakeLists.txt +44 -0
- package/deps/zlib/contrib/testzlib/testzlib.c +275 -0
- package/deps/zlib/contrib/testzlib/testzlib.txt +10 -0
- package/deps/zlib/contrib/vstudio/readme.txt +22 -0
- package/deps/zlib/contrib/zlib1-dll/CMakeLists.txt +196 -0
- package/deps/zlib/contrib/zlib1-dll/readme.txt +21 -0
- package/deps/zlib/crc32.c +983 -0
- package/deps/zlib/crc32.h +9446 -0
- package/deps/zlib/deflate.c +2185 -0
- package/deps/zlib/deflate.h +383 -0
- package/deps/zlib/doc/algorithm.txt +209 -0
- package/deps/zlib/doc/crc-doc.1.0.pdf +0 -0
- package/deps/zlib/doc/rfc1950.txt +619 -0
- package/deps/zlib/doc/rfc1951.txt +955 -0
- package/deps/zlib/doc/rfc1952.txt +675 -0
- package/deps/zlib/doc/txtvsbin.txt +107 -0
- package/deps/zlib/examples/README.examples +54 -0
- package/deps/zlib/examples/enough.c +597 -0
- package/deps/zlib/examples/fitblk.c +233 -0
- package/deps/zlib/examples/gun.c +702 -0
- package/deps/zlib/examples/gzappend.c +504 -0
- package/deps/zlib/examples/gzjoin.c +449 -0
- package/deps/zlib/examples/gzlog.c +1061 -0
- package/deps/zlib/examples/gzlog.h +91 -0
- package/deps/zlib/examples/gznorm.c +474 -0
- package/deps/zlib/examples/zlib_how.html +550 -0
- package/deps/zlib/examples/zpipe.c +206 -0
- package/deps/zlib/examples/zran.c +546 -0
- package/deps/zlib/examples/zran.h +53 -0
- package/deps/zlib/gzclose.c +23 -0
- package/deps/zlib/gzguts.h +216 -0
- package/deps/zlib/gzlib.c +609 -0
- package/deps/zlib/gzread.c +668 -0
- package/deps/zlib/gzwrite.c +700 -0
- package/deps/zlib/infback.c +581 -0
- package/deps/zlib/inffast.c +321 -0
- package/deps/zlib/inffast.h +11 -0
- package/deps/zlib/inffixed.h +94 -0
- package/deps/zlib/inflate.c +1413 -0
- package/deps/zlib/inflate.h +126 -0
- package/deps/zlib/inftrees.c +424 -0
- package/deps/zlib/inftrees.h +64 -0
- package/deps/zlib/make_vms.com +867 -0
- package/deps/zlib/msdos/Makefile.bor +115 -0
- package/deps/zlib/msdos/Makefile.dj2 +104 -0
- package/deps/zlib/msdos/Makefile.emx +69 -0
- package/deps/zlib/msdos/Makefile.msc +112 -0
- package/deps/zlib/msdos/Makefile.tc +100 -0
- package/deps/zlib/os400/README400 +48 -0
- package/deps/zlib/os400/bndsrc +144 -0
- package/deps/zlib/os400/make.sh +383 -0
- package/deps/zlib/os400/zlibfixed.rpgle +578 -0
- package/deps/zlib/os400/zlibfree.rpgle +634 -0
- package/deps/zlib/qnx/package.qpg +141 -0
- package/deps/zlib/test/CMakeLists.txt +318 -0
- package/deps/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -0
- package/deps/zlib/test/add_subdirectory_test.cmake.in +28 -0
- package/deps/zlib/test/example.c +552 -0
- package/deps/zlib/test/find_package_no_components_test.cmake.in +27 -0
- package/deps/zlib/test/find_package_test.cmake.in +27 -0
- package/deps/zlib/test/find_package_wrong_components_test.cmake.in +27 -0
- package/deps/zlib/test/infcover.c +672 -0
- package/deps/zlib/test/minigzip.c +592 -0
- package/deps/zlib/treebuild.xml +116 -0
- package/deps/zlib/trees.c +1119 -0
- package/deps/zlib/trees.h +128 -0
- package/deps/zlib/uncompr.c +101 -0
- package/deps/zlib/watcom/watcom_f.mak +43 -0
- package/deps/zlib/watcom/watcom_l.mak +43 -0
- package/deps/zlib/win32/DLL_FAQ.txt +381 -0
- package/deps/zlib/win32/Makefile.bor +109 -0
- package/deps/zlib/win32/Makefile.gcc +177 -0
- package/deps/zlib/win32/Makefile.msc +159 -0
- package/deps/zlib/win32/README-WIN32.txt +103 -0
- package/deps/zlib/win32/VisualC.txt +3 -0
- package/deps/zlib/win32/zlib.def +104 -0
- package/deps/zlib/win32/zlib1.rc +37 -0
- package/deps/zlib/zconf.h.in +551 -0
- package/deps/zlib/zlib.3 +149 -0
- package/deps/zlib/zlib.3.pdf +0 -0
- package/deps/zlib/zlib.h +2057 -0
- package/deps/zlib/zlib.map +116 -0
- package/deps/zlib/zlib.pc.cmakein +14 -0
- package/deps/zlib/zlib.pc.in +14 -0
- package/deps/zlib/zlibConfig.cmake.in +18 -0
- package/deps/zlib/zutil.c +313 -0
- package/deps/zlib/zutil.h +331 -0
- package/dist/index.d.ts +266 -0
- package/dist/index.js +1146 -0
- package/dist/libwz.js +5632 -0
- package/dist/libwz.wasm +0 -0
- package/include/wz/CRC32.h +182 -0
- package/include/wz/PngUtility.h +72 -0
- package/include/wz/PortalType.h +124 -0
- package/include/wz/Properties/WzBinaryProperty.h +70 -0
- package/include/wz/Properties/WzCanvasProperty.h +55 -0
- package/include/wz/Properties/WzConvexProperty.h +34 -0
- package/include/wz/Properties/WzDoubleProperty.h +32 -0
- package/include/wz/Properties/WzFloatProperty.h +30 -0
- package/include/wz/Properties/WzIntProperty.h +30 -0
- package/include/wz/Properties/WzLongProperty.h +30 -0
- package/include/wz/Properties/WzLuaProperty.h +31 -0
- package/include/wz/Properties/WzNullProperty.h +15 -0
- package/include/wz/Properties/WzPngProperty.h +53 -0
- package/include/wz/Properties/WzRawDataProperty.h +46 -0
- package/include/wz/Properties/WzShortProperty.h +31 -0
- package/include/wz/Properties/WzStringProperty.h +32 -0
- package/include/wz/Properties/WzSubProperty.h +35 -0
- package/include/wz/Properties/WzUOLProperty.h +44 -0
- package/include/wz/Properties/WzVectorProperty.h +40 -0
- package/include/wz/Properties/WzVideoProperty.h +43 -0
- package/include/wz/Result.h +58 -0
- package/include/wz/Util/Defines.h +16 -0
- package/include/wz/Util/ListFileParser.h +20 -0
- package/include/wz/Util/WzBinaryReader.h +95 -0
- package/include/wz/Util/WzBinaryWriter.h +72 -0
- package/include/wz/Util/WzBlobDataSource.h +30 -0
- package/include/wz/Util/WzDataSource.h +49 -0
- package/include/wz/Util/WzKeyGenerator.h +28 -0
- package/include/wz/Util/WzMutableKey.h +39 -0
- package/include/wz/Util/WzPath.h +37 -0
- package/include/wz/Util/WzStream.h +86 -0
- package/include/wz/Util/WzTool.h +42 -0
- package/include/wz/WzAESConstant.h +17 -0
- package/include/wz/WzDirectory.h +97 -0
- package/include/wz/WzEnums.h +76 -0
- package/include/wz/WzFile.h +99 -0
- package/include/wz/WzHeader.h +47 -0
- package/include/wz/WzImage.h +97 -0
- package/include/wz/WzImageProperty.h +92 -0
- package/include/wz/WzObject.h +55 -0
- package/include/wz/WzPropertyCollection.h +115 -0
- package/include/wz/wz.h +41 -0
- package/include/wz/wz_api.h +432 -0
- package/package.json +93 -0
- package/src/PngUtility.cpp +328 -0
- package/src/Properties/WzBinaryProperty.cpp +183 -0
- package/src/Properties/WzCanvasProperty.cpp +262 -0
- package/src/Properties/WzConvexProperty.cpp +159 -0
- package/src/Properties/WzDoubleProperty.cpp +12 -0
- package/src/Properties/WzFloatProperty.cpp +17 -0
- package/src/Properties/WzIntProperty.cpp +12 -0
- package/src/Properties/WzLongProperty.cpp +12 -0
- package/src/Properties/WzLuaProperty.cpp +37 -0
- package/src/Properties/WzNullProperty.cpp +11 -0
- package/src/Properties/WzPngProperty.cpp +637 -0
- package/src/Properties/WzRawDataProperty.cpp +116 -0
- package/src/Properties/WzShortProperty.cpp +12 -0
- package/src/Properties/WzStringProperty.cpp +44 -0
- package/src/Properties/WzSubProperty.cpp +129 -0
- package/src/Properties/WzUOLProperty.cpp +136 -0
- package/src/Properties/WzVectorProperty.cpp +22 -0
- package/src/Properties/WzVideoProperty.cpp +115 -0
- package/src/Util/ListFileParser.cpp +48 -0
- package/src/Util/WzBinaryReader.cpp +368 -0
- package/src/Util/WzBinaryWriter.cpp +305 -0
- package/src/Util/WzBlobDataSource.cpp +47 -0
- package/src/Util/WzDataSource.cpp +61 -0
- package/src/Util/WzKeyGenerator.cpp +43 -0
- package/src/Util/WzMutableKey.cpp +59 -0
- package/src/Util/WzStream.cpp +196 -0
- package/src/Util/WzTool.cpp +266 -0
- package/src/WzAESConstant.cpp +12 -0
- package/src/WzDirectory.cpp +669 -0
- package/src/WzEnums.cpp +20 -0
- package/src/WzFile.cpp +450 -0
- package/src/WzImage.cpp +350 -0
- package/src/WzImageProperty.cpp +469 -0
- package/src/WzObject.cpp +174 -0
- package/src/WzPropertyCollection.cpp +84 -0
- package/src/capi/wz_api.cpp +1996 -0
- package/src/node/binding.cpp +1776 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
#CMAKE_ARGV0 = /path/to/cmake
|
|
2
|
+
#CMAKE_ARGV1 = -P
|
|
3
|
+
#CMAKE_ARGV2 = path/to/this/file
|
|
4
|
+
#CMAKE_ARGV3 = binder
|
|
5
|
+
#CMAKE_ARGV4 = ali
|
|
6
|
+
|
|
7
|
+
if(NOT CMAKE_ARGV3)
|
|
8
|
+
message(FATAL_ERROR "binder not set")
|
|
9
|
+
endif(NOT CMAKE_ARGV3)
|
|
10
|
+
|
|
11
|
+
string(REPLACE ".o" ".ali" ALI ${CMAKE_ARGV4})
|
|
12
|
+
|
|
13
|
+
set (REACHED_FLAGS FALSE)
|
|
14
|
+
#iterate over additional objects, only the main one is needed
|
|
15
|
+
foreach(arg RANGE 5 ${CMAKE_ARGC})
|
|
16
|
+
if(CMAKE_ARGV${arg} STREQUAL FLAGS)
|
|
17
|
+
set(REACHED_FLAGS TRUE)
|
|
18
|
+
continue()
|
|
19
|
+
endif(CMAKE_ARGV${arg} STREQUAL FLAGS)
|
|
20
|
+
|
|
21
|
+
string(SUBSTRING "${CMAKE_ARGV${arg}}" 0 2 start)
|
|
22
|
+
|
|
23
|
+
if(start STREQUAL "-O")
|
|
24
|
+
continue()
|
|
25
|
+
endif(start STREQUAL "-O")
|
|
26
|
+
|
|
27
|
+
if(REACHED_FLAGS)
|
|
28
|
+
list(APPEND FLAGS ${CMAKE_ARGV${arg}})
|
|
29
|
+
endif(REACHED_FLAGS)
|
|
30
|
+
endforeach(arg RANGE 5 CMAKE_ARGC)
|
|
31
|
+
|
|
32
|
+
#first see if there is a main function
|
|
33
|
+
execute_process(COMMAND ${CMAKE_ARGV3} bind ${ALI} ${FLAGS}
|
|
34
|
+
RESULT_VARIABLE MAIN_RESULT
|
|
35
|
+
OUTPUT_VARIABLE dont_care
|
|
36
|
+
ERROR_VARIABLE ERROR)
|
|
37
|
+
|
|
38
|
+
if(MAIN_RESULT)
|
|
39
|
+
execute_process(COMMAND ${CMAKE_ARGV3} bind -n ${ALI} ${FLAGS}
|
|
40
|
+
RESULT_VARIABLE RESULT
|
|
41
|
+
OUTPUT_VARIABLE dont_care
|
|
42
|
+
ERROR_VARIABLE ERROR)
|
|
43
|
+
endif(MAIN_RESULT)
|
|
44
|
+
|
|
45
|
+
if(RESULT)
|
|
46
|
+
message(FATAL_ERROR ${RESULT} ${ERROR})
|
|
47
|
+
endif(RESULT)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#CMAKE_ARGV0 = /path/to/cmake
|
|
2
|
+
#CMAKE_ARGV1 = -P
|
|
3
|
+
#CMAKE_ARGV2 = path/to/this/file
|
|
4
|
+
#CMAKE_ARGV3 = compiler
|
|
5
|
+
#CMAKE_ARGV4 = OBJECT-DIR
|
|
6
|
+
#CMAKE_ARGV5 = source-file
|
|
7
|
+
|
|
8
|
+
if(NOT CMAKE_ARGV3)
|
|
9
|
+
message(FATAL_ERROR "compiler not set")
|
|
10
|
+
endif(NOT CMAKE_ARGV3)
|
|
11
|
+
|
|
12
|
+
if(NOT CMAKE_ARGV4)
|
|
13
|
+
message(FATAL_ERROR "object dir not set")
|
|
14
|
+
endif(NOT CMAKE_ARGV4)
|
|
15
|
+
|
|
16
|
+
if(NOT CMAKE_ARGV5)
|
|
17
|
+
message(FATAL_ERROR "source not set")
|
|
18
|
+
endif(NOT CMAKE_ARGV5)
|
|
19
|
+
|
|
20
|
+
foreach(arg RANGE 6 ${CMAKE_ARGC})
|
|
21
|
+
list(APPEND FLAGS "${CMAKE_ARGV${arg}}")
|
|
22
|
+
endforeach(arg RANGE 6 ${CMAKE_ARGC})
|
|
23
|
+
|
|
24
|
+
execute_process(COMMAND ${CMAKE_ARGV3} compile ${FLAGS} ${CMAKE_ARGV5}
|
|
25
|
+
WORKING_DIRECTORY ${CMAKE_ARGV4}
|
|
26
|
+
RESULT_VARIABLE RESULT
|
|
27
|
+
OUTPUT_VARIABLE dont_care
|
|
28
|
+
ERROR_VARIABLE ERROR)
|
|
29
|
+
|
|
30
|
+
if(RESULT)
|
|
31
|
+
message(FATAL_ERROR ${RESULT} ${ERROR})
|
|
32
|
+
endif(RESULT)
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#CMAKE_ARGV0 = /path/to/cmake
|
|
2
|
+
#CMAKE_ARGV1 = -P
|
|
3
|
+
#CMAKE_ARGV2 = path/to/this/file
|
|
4
|
+
#CMAKE_ARGV3 = linker
|
|
5
|
+
#CMAKE_ARGV4 = output-name
|
|
6
|
+
#CMAKE_ARGV5...CMAKE_AGVN = OBJECTS
|
|
7
|
+
#CMAKE_ARGVN+1 = LIBS
|
|
8
|
+
#CMAKE_ARGVN+2...CMAKE_ARGVM libraries
|
|
9
|
+
|
|
10
|
+
if(NOT CMAKE_ARGV3)
|
|
11
|
+
message(FATAL_ERROR "linker not set")
|
|
12
|
+
endif(NOT CMAKE_ARGV3)
|
|
13
|
+
|
|
14
|
+
set(REACHED_LIBS FALSE)
|
|
15
|
+
set(REACHED_OBJ FALSE)
|
|
16
|
+
foreach(arg RANGE 5 ${CMAKE_ARGC})
|
|
17
|
+
if(CMAKE_ARGV${arg} STREQUAL LIBS)
|
|
18
|
+
set(REACHED_LIBS TRUE)
|
|
19
|
+
set(REACHED_OBJ FALSE)
|
|
20
|
+
continue()
|
|
21
|
+
endif(CMAKE_ARGV${arg} STREQUAL LIBS)
|
|
22
|
+
|
|
23
|
+
if(CMAKE_ARGV${arg} STREQUAL OBJ)
|
|
24
|
+
set(REACHED_LIBS FALSE)
|
|
25
|
+
set(REACHED_OBJ TRUE)
|
|
26
|
+
continue()
|
|
27
|
+
endif(CMAKE_ARGV${arg} STREQUAL OBJ)
|
|
28
|
+
|
|
29
|
+
if(CMAKE_ARGC EQUAL arg)
|
|
30
|
+
continue()
|
|
31
|
+
endif(CMAKE_ARGC EQUAL arg)
|
|
32
|
+
|
|
33
|
+
if(REACHED_LIBS)
|
|
34
|
+
list(APPEND LIBS "${CMAKE_ARGV${arg}}")
|
|
35
|
+
elseif(REACHED_OBJ AND NOT ALI)
|
|
36
|
+
string(REPLACE ".o" ".ali" ALI "${CMAKE_ARGV${arg}}")
|
|
37
|
+
else(REACHED_LIBS)
|
|
38
|
+
string(SUBSTRING "${CMAKE_ARGV${arg}}" 0 3 start)
|
|
39
|
+
|
|
40
|
+
if(NOT start STREQUAL -aO)
|
|
41
|
+
list(APPEND FLAGS "${CMAKE_ARGV${arg}}")
|
|
42
|
+
endif(NOT start STREQUAL -aO)
|
|
43
|
+
endif(REACHED_LIBS)
|
|
44
|
+
endforeach(arg RANGE 5 ${CMAKE_ARGC})
|
|
45
|
+
|
|
46
|
+
execute_process(COMMAND ${CMAKE_ARGV3} link ${ALI} -o ${CMAKE_ARGV4} ${FLAGS} ${OTHER_OBJECTS} ${LIBS}
|
|
47
|
+
RESULT_VARIABLE RESULT
|
|
48
|
+
OUTPUT_VARIABLE dont_care
|
|
49
|
+
ERROR_VARIABLE ERROR)
|
|
50
|
+
|
|
51
|
+
if(RESULT)
|
|
52
|
+
message(FATAL_ERROR ${RESULT} ${ERROR})
|
|
53
|
+
endif(RESULT)
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#CMAKE_ARGV0 = /path/to/cmake
|
|
2
|
+
#CMAKE_ARGV1 = -P
|
|
3
|
+
#CMAKE_ARGV2 = path/to/this/file
|
|
4
|
+
#CMAKE_ARGV3 = linker
|
|
5
|
+
#CMAKE_ARGV4 = output-name
|
|
6
|
+
#CMAKE_ARGV5...CMAKE_AGVN = OBJECTS
|
|
7
|
+
#CMAKE_ARGVN+1 = LIBS
|
|
8
|
+
#CMAKE_ARGVN+2...CMAKE_ARGVM libraries
|
|
9
|
+
|
|
10
|
+
if(NOT CMAKE_ARGV3)
|
|
11
|
+
message(FATAL_ERROR "linker not set")
|
|
12
|
+
endif(NOT CMAKE_ARGV3)
|
|
13
|
+
|
|
14
|
+
set(REACHED_FILES FALSE)
|
|
15
|
+
foreach(arg RANGE 5 ${CMAKE_ARGC})
|
|
16
|
+
if(CMAKE_ARGV${arg} STREQUAL "LIBS")
|
|
17
|
+
set(REACHED_FILES TRUE)
|
|
18
|
+
continue()
|
|
19
|
+
endif(CMAKE_ARGV${arg} STREQUAL "LIBS")
|
|
20
|
+
|
|
21
|
+
if(CMAKE_ARGC EQUAL arg)
|
|
22
|
+
continue()
|
|
23
|
+
endif(CMAKE_ARGC EQUAL arg)
|
|
24
|
+
|
|
25
|
+
if(REACHED_LIBS)
|
|
26
|
+
list(APPEND LIBS "${CMAKE_ARGV${arg}} ")
|
|
27
|
+
else(REACHED_LIBS)
|
|
28
|
+
list(APPEND OBJECT_FILES "${CMAKE_ARGV${arg}}")
|
|
29
|
+
endif(REACHED_LIBS)
|
|
30
|
+
endforeach(arg RANGE 5 ${CMAKE_ARGC})
|
|
31
|
+
|
|
32
|
+
file(WRITE dummylib.adb
|
|
33
|
+
"procedure dummylib is\n"
|
|
34
|
+
"begin\n"
|
|
35
|
+
" null;\n"
|
|
36
|
+
"end;\n")
|
|
37
|
+
|
|
38
|
+
execute_process(COMMAND ${CMAKE_ARGV3} compile -fPIC dummylib.adb
|
|
39
|
+
OUTPUT_VARIABLE dont_care
|
|
40
|
+
ERROR_VARIABLE ERROR)
|
|
41
|
+
execute_process(COMMAND ${CMAKE_ARGV3} bind -n dummylib.ali
|
|
42
|
+
OUTPUT_VARIABLE dont_care
|
|
43
|
+
ERROR_VARIABLE ERROR)
|
|
44
|
+
|
|
45
|
+
execute_process(COMMAND ${CMAKE_ARGV3} link -shared dummylib.ali -o ${CMAKE_ARGV4} ${OBJECT_FILES} ${LIBS}
|
|
46
|
+
RESULT_VARIABLE RESULT
|
|
47
|
+
OUTPUT_VARIABLE dont_care
|
|
48
|
+
ERROR_VARIABLE ERROR)
|
|
49
|
+
|
|
50
|
+
if(RESULT)
|
|
51
|
+
message(FATAL_ERROR ${RESULT} ${ERROR})
|
|
52
|
+
endif(RESULT)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#CMAKE_ARGV0 = /path/to/cmake
|
|
2
|
+
#CMAKE_ARGV1 = -P
|
|
3
|
+
#CMAKE_ARGV2 = path/to/this/file
|
|
4
|
+
#CMAKE_ARGV3 = path/to/ar
|
|
5
|
+
#CMAKE_ARGV4 = output-name
|
|
6
|
+
#CMAKE_ARGV5...CMAKE_AGVN = OBJECTS
|
|
7
|
+
|
|
8
|
+
if(NOT CMAKE_ARGV3)
|
|
9
|
+
message(FATAL_ERROR "linker not set")
|
|
10
|
+
endif(NOT CMAKE_ARGV3)
|
|
11
|
+
|
|
12
|
+
foreach(arg RANGE 5 ${CMAKE_ARGC})
|
|
13
|
+
if(NOT CMAKE_ARGC EQUAL arg)
|
|
14
|
+
list(APPEND OBJECT_FILES "${CMAKE_ARGV${arg}}")
|
|
15
|
+
endif(NOT CMAKE_ARGC EQUAL arg)
|
|
16
|
+
endforeach(arg RANGE 6 ${CMAKE_ARGC})
|
|
17
|
+
|
|
18
|
+
execute_process(COMMAND ${CMAKE_ARGV3} rcs ${CMAKE_ARGV4} ${OBJECT_FILES}
|
|
19
|
+
RESULT_VARIABLE RESULT
|
|
20
|
+
OUTPUT_VARIABLE dont_care
|
|
21
|
+
ERROR_VARIABLE ERROR)
|
|
22
|
+
|
|
23
|
+
if(RESULT)
|
|
24
|
+
message(FATAL_ERROR ${RESULT} ${ERROR})
|
|
25
|
+
endif(RESULT)
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
----------------------------------------------------------------
|
|
2
|
+
-- ZLib for Ada thick binding. --
|
|
3
|
+
-- --
|
|
4
|
+
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
|
|
5
|
+
-- --
|
|
6
|
+
-- Open source license information is in the zlib.ads file. --
|
|
7
|
+
----------------------------------------------------------------
|
|
8
|
+
-- Continuous test for ZLib multithreading. If the test would fail
|
|
9
|
+
-- we should provide thread safe allocation routines for the Z_Stream.
|
|
10
|
+
--
|
|
11
|
+
-- $Id: mtest.adb,v 1.4 2004/07/23 07:49:54 vagul Exp $
|
|
12
|
+
|
|
13
|
+
with ZLib;
|
|
14
|
+
with Ada.Streams;
|
|
15
|
+
with Ada.Numerics.Discrete_Random;
|
|
16
|
+
with Ada.Text_IO;
|
|
17
|
+
with Ada.Exceptions;
|
|
18
|
+
with Ada.Task_Identification;
|
|
19
|
+
|
|
20
|
+
procedure MTest is
|
|
21
|
+
use Ada.Streams;
|
|
22
|
+
use ZLib;
|
|
23
|
+
|
|
24
|
+
Stop : Boolean := False;
|
|
25
|
+
|
|
26
|
+
pragma Atomic (Stop);
|
|
27
|
+
|
|
28
|
+
subtype Visible_Symbols is Stream_Element range 16#20# .. 16#7E#;
|
|
29
|
+
|
|
30
|
+
package Random_Elements is
|
|
31
|
+
new Ada.Numerics.Discrete_Random (Visible_Symbols);
|
|
32
|
+
|
|
33
|
+
task type Test_Task;
|
|
34
|
+
|
|
35
|
+
task body Test_Task is
|
|
36
|
+
Buffer : Stream_Element_Array (1 .. 100_000);
|
|
37
|
+
Gen : Random_Elements.Generator;
|
|
38
|
+
|
|
39
|
+
Buffer_First : Stream_Element_Offset;
|
|
40
|
+
Compare_First : Stream_Element_Offset;
|
|
41
|
+
|
|
42
|
+
Deflate : Filter_Type;
|
|
43
|
+
Inflate : Filter_Type;
|
|
44
|
+
|
|
45
|
+
procedure Further (Item : in Stream_Element_Array);
|
|
46
|
+
|
|
47
|
+
procedure Read_Buffer
|
|
48
|
+
(Item : out Ada.Streams.Stream_Element_Array;
|
|
49
|
+
Last : out Ada.Streams.Stream_Element_Offset);
|
|
50
|
+
|
|
51
|
+
-------------
|
|
52
|
+
-- Further --
|
|
53
|
+
-------------
|
|
54
|
+
|
|
55
|
+
procedure Further (Item : in Stream_Element_Array) is
|
|
56
|
+
|
|
57
|
+
procedure Compare (Item : in Stream_Element_Array);
|
|
58
|
+
|
|
59
|
+
-------------
|
|
60
|
+
-- Compare --
|
|
61
|
+
-------------
|
|
62
|
+
|
|
63
|
+
procedure Compare (Item : in Stream_Element_Array) is
|
|
64
|
+
Next_First : Stream_Element_Offset := Compare_First + Item'Length;
|
|
65
|
+
begin
|
|
66
|
+
if Buffer (Compare_First .. Next_First - 1) /= Item then
|
|
67
|
+
raise Program_Error;
|
|
68
|
+
end if;
|
|
69
|
+
|
|
70
|
+
Compare_First := Next_First;
|
|
71
|
+
end Compare;
|
|
72
|
+
|
|
73
|
+
procedure Compare_Write is new ZLib.Write (Write => Compare);
|
|
74
|
+
begin
|
|
75
|
+
Compare_Write (Inflate, Item, No_Flush);
|
|
76
|
+
end Further;
|
|
77
|
+
|
|
78
|
+
-----------------
|
|
79
|
+
-- Read_Buffer --
|
|
80
|
+
-----------------
|
|
81
|
+
|
|
82
|
+
procedure Read_Buffer
|
|
83
|
+
(Item : out Ada.Streams.Stream_Element_Array;
|
|
84
|
+
Last : out Ada.Streams.Stream_Element_Offset)
|
|
85
|
+
is
|
|
86
|
+
Buff_Diff : Stream_Element_Offset := Buffer'Last - Buffer_First;
|
|
87
|
+
Next_First : Stream_Element_Offset;
|
|
88
|
+
begin
|
|
89
|
+
if Item'Length <= Buff_Diff then
|
|
90
|
+
Last := Item'Last;
|
|
91
|
+
|
|
92
|
+
Next_First := Buffer_First + Item'Length;
|
|
93
|
+
|
|
94
|
+
Item := Buffer (Buffer_First .. Next_First - 1);
|
|
95
|
+
|
|
96
|
+
Buffer_First := Next_First;
|
|
97
|
+
else
|
|
98
|
+
Last := Item'First + Buff_Diff;
|
|
99
|
+
Item (Item'First .. Last) := Buffer (Buffer_First .. Buffer'Last);
|
|
100
|
+
Buffer_First := Buffer'Last + 1;
|
|
101
|
+
end if;
|
|
102
|
+
end Read_Buffer;
|
|
103
|
+
|
|
104
|
+
procedure Translate is new Generic_Translate
|
|
105
|
+
(Data_In => Read_Buffer,
|
|
106
|
+
Data_Out => Further);
|
|
107
|
+
|
|
108
|
+
begin
|
|
109
|
+
Random_Elements.Reset (Gen);
|
|
110
|
+
|
|
111
|
+
Buffer := (others => 20);
|
|
112
|
+
|
|
113
|
+
Main : loop
|
|
114
|
+
for J in Buffer'Range loop
|
|
115
|
+
Buffer (J) := Random_Elements.Random (Gen);
|
|
116
|
+
|
|
117
|
+
Deflate_Init (Deflate);
|
|
118
|
+
Inflate_Init (Inflate);
|
|
119
|
+
|
|
120
|
+
Buffer_First := Buffer'First;
|
|
121
|
+
Compare_First := Buffer'First;
|
|
122
|
+
|
|
123
|
+
Translate (Deflate);
|
|
124
|
+
|
|
125
|
+
if Compare_First /= Buffer'Last + 1 then
|
|
126
|
+
raise Program_Error;
|
|
127
|
+
end if;
|
|
128
|
+
|
|
129
|
+
Ada.Text_IO.Put_Line
|
|
130
|
+
(Ada.Task_Identification.Image
|
|
131
|
+
(Ada.Task_Identification.Current_Task)
|
|
132
|
+
& Stream_Element_Offset'Image (J)
|
|
133
|
+
& ZLib.Count'Image (Total_Out (Deflate)));
|
|
134
|
+
|
|
135
|
+
Close (Deflate);
|
|
136
|
+
Close (Inflate);
|
|
137
|
+
|
|
138
|
+
exit Main when Stop;
|
|
139
|
+
end loop;
|
|
140
|
+
end loop Main;
|
|
141
|
+
exception
|
|
142
|
+
when E : others =>
|
|
143
|
+
Ada.Text_IO.Put_Line (Ada.Exceptions.Exception_Information (E));
|
|
144
|
+
Stop := True;
|
|
145
|
+
end Test_Task;
|
|
146
|
+
|
|
147
|
+
Test : array (1 .. 4) of Test_Task;
|
|
148
|
+
|
|
149
|
+
pragma Unreferenced (Test);
|
|
150
|
+
|
|
151
|
+
Dummy : Character;
|
|
152
|
+
|
|
153
|
+
begin
|
|
154
|
+
Ada.Text_IO.Get_Immediate (Dummy);
|
|
155
|
+
Stop := True;
|
|
156
|
+
end MTest;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
----------------------------------------------------------------
|
|
2
|
+
-- ZLib for Ada thick binding. --
|
|
3
|
+
-- --
|
|
4
|
+
-- Copyright (C) 2002-2003 Dmitriy Anisimkov --
|
|
5
|
+
-- --
|
|
6
|
+
-- Open source license information is in the zlib.ads file. --
|
|
7
|
+
----------------------------------------------------------------
|
|
8
|
+
|
|
9
|
+
-- $Id: read.adb,v 1.8 2004/05/31 10:53:40 vagul Exp $
|
|
10
|
+
|
|
11
|
+
-- Test/demo program for the generic read interface.
|
|
12
|
+
|
|
13
|
+
with Ada.Numerics.Discrete_Random;
|
|
14
|
+
with Ada.Streams;
|
|
15
|
+
with Ada.Text_IO;
|
|
16
|
+
|
|
17
|
+
with ZLib;
|
|
18
|
+
|
|
19
|
+
procedure Read is
|
|
20
|
+
|
|
21
|
+
use Ada.Streams;
|
|
22
|
+
|
|
23
|
+
------------------------------------
|
|
24
|
+
-- Test configuration parameters --
|
|
25
|
+
------------------------------------
|
|
26
|
+
|
|
27
|
+
File_Size : Stream_Element_Offset := 100_000;
|
|
28
|
+
|
|
29
|
+
Continuous : constant Boolean := False;
|
|
30
|
+
-- If this constant is True, the test would be repeated again and again,
|
|
31
|
+
-- with increment File_Size for every iteration.
|
|
32
|
+
|
|
33
|
+
Header : constant ZLib.Header_Type := ZLib.Default;
|
|
34
|
+
-- Do not use Header other than Default in ZLib versions 1.1.4 and older.
|
|
35
|
+
|
|
36
|
+
Init_Random : constant := 8;
|
|
37
|
+
-- We are using the same random sequence, in case of we catch bug,
|
|
38
|
+
-- so we would be able to reproduce it.
|
|
39
|
+
|
|
40
|
+
-- End --
|
|
41
|
+
|
|
42
|
+
Pack_Size : Stream_Element_Offset;
|
|
43
|
+
Offset : Stream_Element_Offset;
|
|
44
|
+
|
|
45
|
+
Filter : ZLib.Filter_Type;
|
|
46
|
+
|
|
47
|
+
subtype Visible_Symbols
|
|
48
|
+
is Stream_Element range 16#20# .. 16#7E#;
|
|
49
|
+
|
|
50
|
+
package Random_Elements is new
|
|
51
|
+
Ada.Numerics.Discrete_Random (Visible_Symbols);
|
|
52
|
+
|
|
53
|
+
Gen : Random_Elements.Generator;
|
|
54
|
+
Period : constant Stream_Element_Offset := 200;
|
|
55
|
+
-- Period constant variable for random generator not to be very random.
|
|
56
|
+
-- Bigger period, harder random.
|
|
57
|
+
|
|
58
|
+
Read_Buffer : Stream_Element_Array (1 .. 2048);
|
|
59
|
+
Read_First : Stream_Element_Offset;
|
|
60
|
+
Read_Last : Stream_Element_Offset;
|
|
61
|
+
|
|
62
|
+
procedure Reset;
|
|
63
|
+
|
|
64
|
+
procedure Read
|
|
65
|
+
(Item : out Stream_Element_Array;
|
|
66
|
+
Last : out Stream_Element_Offset);
|
|
67
|
+
-- this procedure is for generic instantiation of
|
|
68
|
+
-- ZLib.Read
|
|
69
|
+
-- reading data from the File_In.
|
|
70
|
+
|
|
71
|
+
procedure Read is new ZLib.Read
|
|
72
|
+
(Read,
|
|
73
|
+
Read_Buffer,
|
|
74
|
+
Rest_First => Read_First,
|
|
75
|
+
Rest_Last => Read_Last);
|
|
76
|
+
|
|
77
|
+
----------
|
|
78
|
+
-- Read --
|
|
79
|
+
----------
|
|
80
|
+
|
|
81
|
+
procedure Read
|
|
82
|
+
(Item : out Stream_Element_Array;
|
|
83
|
+
Last : out Stream_Element_Offset) is
|
|
84
|
+
begin
|
|
85
|
+
Last := Stream_Element_Offset'Min
|
|
86
|
+
(Item'Last,
|
|
87
|
+
Item'First + File_Size - Offset);
|
|
88
|
+
|
|
89
|
+
for J in Item'First .. Last loop
|
|
90
|
+
if J < Item'First + Period then
|
|
91
|
+
Item (J) := Random_Elements.Random (Gen);
|
|
92
|
+
else
|
|
93
|
+
Item (J) := Item (J - Period);
|
|
94
|
+
end if;
|
|
95
|
+
|
|
96
|
+
Offset := Offset + 1;
|
|
97
|
+
end loop;
|
|
98
|
+
end Read;
|
|
99
|
+
|
|
100
|
+
-----------
|
|
101
|
+
-- Reset --
|
|
102
|
+
-----------
|
|
103
|
+
|
|
104
|
+
procedure Reset is
|
|
105
|
+
begin
|
|
106
|
+
Random_Elements.Reset (Gen, Init_Random);
|
|
107
|
+
Pack_Size := 0;
|
|
108
|
+
Offset := 1;
|
|
109
|
+
Read_First := Read_Buffer'Last + 1;
|
|
110
|
+
Read_Last := Read_Buffer'Last;
|
|
111
|
+
end Reset;
|
|
112
|
+
|
|
113
|
+
begin
|
|
114
|
+
Ada.Text_IO.Put_Line ("ZLib " & ZLib.Version);
|
|
115
|
+
|
|
116
|
+
loop
|
|
117
|
+
for Level in ZLib.Compression_Level'Range loop
|
|
118
|
+
|
|
119
|
+
Ada.Text_IO.Put ("Level ="
|
|
120
|
+
& ZLib.Compression_Level'Image (Level));
|
|
121
|
+
|
|
122
|
+
-- Deflate using generic instantiation.
|
|
123
|
+
|
|
124
|
+
ZLib.Deflate_Init
|
|
125
|
+
(Filter,
|
|
126
|
+
Level,
|
|
127
|
+
Header => Header);
|
|
128
|
+
|
|
129
|
+
Reset;
|
|
130
|
+
|
|
131
|
+
Ada.Text_IO.Put
|
|
132
|
+
(Stream_Element_Offset'Image (File_Size) & " ->");
|
|
133
|
+
|
|
134
|
+
loop
|
|
135
|
+
declare
|
|
136
|
+
Buffer : Stream_Element_Array (1 .. 1024);
|
|
137
|
+
Last : Stream_Element_Offset;
|
|
138
|
+
begin
|
|
139
|
+
Read (Filter, Buffer, Last);
|
|
140
|
+
|
|
141
|
+
Pack_Size := Pack_Size + Last - Buffer'First + 1;
|
|
142
|
+
|
|
143
|
+
exit when Last < Buffer'Last;
|
|
144
|
+
end;
|
|
145
|
+
end loop;
|
|
146
|
+
|
|
147
|
+
Ada.Text_IO.Put_Line (Stream_Element_Offset'Image (Pack_Size));
|
|
148
|
+
|
|
149
|
+
ZLib.Close (Filter);
|
|
150
|
+
end loop;
|
|
151
|
+
|
|
152
|
+
exit when not Continuous;
|
|
153
|
+
|
|
154
|
+
File_Size := File_Size + 1;
|
|
155
|
+
end loop;
|
|
156
|
+
end Read;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
ZLib for Ada thick binding (ZLib.Ada)
|
|
2
|
+
Release 1.3
|
|
3
|
+
|
|
4
|
+
ZLib.Ada is a thick binding interface to the popular ZLib data
|
|
5
|
+
compression library, available at https://zlib.net/.
|
|
6
|
+
It provides Ada-style access to the ZLib C library.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Here are the main changes since ZLib.Ada 1.2:
|
|
10
|
+
|
|
11
|
+
- Attention: ZLib.Read generic routine have a initialization requirement
|
|
12
|
+
for Read_Last parameter now. It is a bit incompatible with previous version,
|
|
13
|
+
but extends functionality, we could use new parameters Allow_Read_Some and
|
|
14
|
+
Flush now.
|
|
15
|
+
|
|
16
|
+
- Added Is_Open routines to ZLib and ZLib.Streams packages.
|
|
17
|
+
|
|
18
|
+
- Add pragma Assert to check Stream_Element is 8 bit.
|
|
19
|
+
|
|
20
|
+
- Fix extraction to buffer with exact known decompressed size. Error reported by
|
|
21
|
+
Steve Sangwine.
|
|
22
|
+
|
|
23
|
+
- Fix definition of ULong (changed to unsigned_long), fix regression on 64 bits
|
|
24
|
+
computers. Patch provided by Pascal Obry.
|
|
25
|
+
|
|
26
|
+
- Add Status_Error exception definition.
|
|
27
|
+
|
|
28
|
+
- Add pragma Assertion that Ada.Streams.Stream_Element size is 8 bit.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
How to build ZLib.Ada under GNAT
|
|
32
|
+
|
|
33
|
+
You should have the ZLib library already build on your computer, before
|
|
34
|
+
building ZLib.Ada. Make the directory of ZLib.Ada sources current and
|
|
35
|
+
issue the command:
|
|
36
|
+
|
|
37
|
+
gnatmake test -largs -L<directory where libz.a is> -lz
|
|
38
|
+
|
|
39
|
+
Or use the GNAT project file build for GNAT 3.15 or later:
|
|
40
|
+
|
|
41
|
+
gnatmake -Pzlib.gpr -L<directory where libz.a is>
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
How to build ZLib.Ada under Aonix ObjectAda for Win32 7.2.2
|
|
45
|
+
|
|
46
|
+
1. Make a project with all *.ads and *.adb files from the distribution.
|
|
47
|
+
2. Build the libz.a library from the ZLib C sources.
|
|
48
|
+
3. Rename libz.a to z.lib.
|
|
49
|
+
4. Add the library z.lib to the project.
|
|
50
|
+
5. Add the libc.lib library from the ObjectAda distribution to the project.
|
|
51
|
+
6. Build the executable using test.adb as a main procedure.
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
How to use ZLib.Ada
|
|
55
|
+
|
|
56
|
+
The source files test.adb and read.adb are small demo programs that show
|
|
57
|
+
the main functionality of ZLib.Ada.
|
|
58
|
+
|
|
59
|
+
The routines from the package specifications are commented.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
Homepage: https://zlib-ada.sourceforge.net/
|
|
63
|
+
Author: Dmitriy Anisimkov <anisimkov@yahoo.com>
|
|
64
|
+
|
|
65
|
+
Contributors: Pascal Obry <pascal@obry.org>, Steve Sangwine <sjs@essex.ac.uk>
|