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.
Files changed (362) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +165 -0
  3. package/binding.gyp +149 -0
  4. package/deps/tiny-aes/.github/workflows/c-cpp.yml +27 -0
  5. package/deps/tiny-aes/CMakeLists.txt +17 -0
  6. package/deps/tiny-aes/Makefile +61 -0
  7. package/deps/tiny-aes/README.md +83 -0
  8. package/deps/tiny-aes/aes.c +572 -0
  9. package/deps/tiny-aes/aes.h +91 -0
  10. package/deps/tiny-aes/aes.hpp +12 -0
  11. package/deps/tiny-aes/conanfile.py +73 -0
  12. package/deps/tiny-aes/library.json +19 -0
  13. package/deps/tiny-aes/library.properties +11 -0
  14. package/deps/tiny-aes/test.c +316 -0
  15. package/deps/tiny-aes/test.cpp +2 -0
  16. package/deps/tiny-aes/test_package/CMakeLists.txt +11 -0
  17. package/deps/tiny-aes/test_package/conanfile.py +17 -0
  18. package/deps/tiny-aes/unlicense.txt +24 -0
  19. package/deps/zlib/.cmake-format.yaml +245 -0
  20. package/deps/zlib/.github/workflows/c-std.yml +268 -0
  21. package/deps/zlib/.github/workflows/cmake.yml +147 -0
  22. package/deps/zlib/.github/workflows/configure.yml +146 -0
  23. package/deps/zlib/.github/workflows/contribs.yml +64 -0
  24. package/deps/zlib/.github/workflows/fuzz.yml +25 -0
  25. package/deps/zlib/.github/workflows/msys-cygwin.yml +92 -0
  26. package/deps/zlib/.github/workflows/others.yml +153 -0
  27. package/deps/zlib/BUILD.bazel +134 -0
  28. package/deps/zlib/CMakeLists.txt +310 -0
  29. package/deps/zlib/ChangeLog +1669 -0
  30. package/deps/zlib/FAQ +371 -0
  31. package/deps/zlib/INDEX +67 -0
  32. package/deps/zlib/LICENSE +22 -0
  33. package/deps/zlib/MODULE.bazel +9 -0
  34. package/deps/zlib/Makefile.in +426 -0
  35. package/deps/zlib/README +115 -0
  36. package/deps/zlib/README-cmake.md +79 -0
  37. package/deps/zlib/adler32.c +164 -0
  38. package/deps/zlib/amiga/Makefile.pup +69 -0
  39. package/deps/zlib/amiga/Makefile.sas +68 -0
  40. package/deps/zlib/compress.c +99 -0
  41. package/deps/zlib/configure +1078 -0
  42. package/deps/zlib/contrib/CMakeLists.txt +61 -0
  43. package/deps/zlib/contrib/README.contrib +57 -0
  44. package/deps/zlib/contrib/ada/CMakeLists.txt +217 -0
  45. package/deps/zlib/contrib/ada/buffer_demo.adb +106 -0
  46. package/deps/zlib/contrib/ada/cmake/Modules/CMakeADACompiler.cmake.in +23 -0
  47. package/deps/zlib/contrib/ada/cmake/Modules/CMakeADAInformation.cmake +133 -0
  48. package/deps/zlib/contrib/ada/cmake/Modules/CMakeDetermineADACompiler.cmake +33 -0
  49. package/deps/zlib/contrib/ada/cmake/Modules/CMakeTestADACompiler.cmake +46 -0
  50. package/deps/zlib/contrib/ada/cmake/binder_helper.cmake +47 -0
  51. package/deps/zlib/contrib/ada/cmake/compile_helper.cmake +32 -0
  52. package/deps/zlib/contrib/ada/cmake/exe_link_helper.cmake +53 -0
  53. package/deps/zlib/contrib/ada/cmake/shared_link_helper.cmake +52 -0
  54. package/deps/zlib/contrib/ada/cmake/static_link_helper.cmake +25 -0
  55. package/deps/zlib/contrib/ada/mtest.adb +156 -0
  56. package/deps/zlib/contrib/ada/read.adb +156 -0
  57. package/deps/zlib/contrib/ada/readme.txt +65 -0
  58. package/deps/zlib/contrib/ada/test.adb +463 -0
  59. package/deps/zlib/contrib/ada/zlib-streams.adb +225 -0
  60. package/deps/zlib/contrib/ada/zlib-streams.ads +114 -0
  61. package/deps/zlib/contrib/ada/zlib-thin.adb +142 -0
  62. package/deps/zlib/contrib/ada/zlib-thin.ads +450 -0
  63. package/deps/zlib/contrib/ada/zlib.adb +701 -0
  64. package/deps/zlib/contrib/ada/zlib.ads +328 -0
  65. package/deps/zlib/contrib/ada/zlib.gpr +20 -0
  66. package/deps/zlib/contrib/blast/CMakeLists.txt +166 -0
  67. package/deps/zlib/contrib/blast/Makefile +14 -0
  68. package/deps/zlib/contrib/blast/README +4 -0
  69. package/deps/zlib/contrib/blast/blast-test.c +42 -0
  70. package/deps/zlib/contrib/blast/blast.c +422 -0
  71. package/deps/zlib/contrib/blast/blast.h +84 -0
  72. package/deps/zlib/contrib/blast/blastConfig.cmake.in +18 -0
  73. package/deps/zlib/contrib/blast/test/CMakeLists.txt +193 -0
  74. package/deps/zlib/contrib/blast/test/add_subdirectory_exclude_test.cmake.in +27 -0
  75. package/deps/zlib/contrib/blast/test/add_subdirectory_test.cmake.in +25 -0
  76. package/deps/zlib/contrib/blast/test/find_package_no_components_test.cmake.in +24 -0
  77. package/deps/zlib/contrib/blast/test/find_package_test.cmake.in +24 -0
  78. package/deps/zlib/contrib/blast/test/find_package_wrong_components_test.cmake.in +24 -0
  79. package/deps/zlib/contrib/blast/test.pk +0 -0
  80. package/deps/zlib/contrib/blast/test.txt +1 -0
  81. package/deps/zlib/contrib/blast/tester.cmake +28 -0
  82. package/deps/zlib/contrib/crc32vx/CMakeLists.txt +67 -0
  83. package/deps/zlib/contrib/crc32vx/README +9 -0
  84. package/deps/zlib/contrib/crc32vx/crc32_vx.c +254 -0
  85. package/deps/zlib/contrib/crc32vx/crc32_vx_hooks.h +9 -0
  86. package/deps/zlib/contrib/delphi/ZLib.pas +557 -0
  87. package/deps/zlib/contrib/delphi/ZLibConst.pas +11 -0
  88. package/deps/zlib/contrib/delphi/readme.txt +76 -0
  89. package/deps/zlib/contrib/delphi/zlibd32.mak +99 -0
  90. package/deps/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
  91. package/deps/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
  92. package/deps/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
  93. package/deps/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
  94. package/deps/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
  95. package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
  96. package/deps/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
  97. package/deps/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
  98. package/deps/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
  99. package/deps/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
  100. package/deps/zlib/contrib/dotzlib/DotZLib.build +33 -0
  101. package/deps/zlib/contrib/dotzlib/DotZLib.chm +0 -0
  102. package/deps/zlib/contrib/dotzlib/DotZLib.sln +21 -0
  103. package/deps/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
  104. package/deps/zlib/contrib/dotzlib/readme.txt +58 -0
  105. package/deps/zlib/contrib/gcc_gvmat64/CMakeLists.txt +19 -0
  106. package/deps/zlib/contrib/gcc_gvmat64/gvmat64.S +570 -0
  107. package/deps/zlib/contrib/infback9/CMakeLists.txt +19 -0
  108. package/deps/zlib/contrib/infback9/README +1 -0
  109. package/deps/zlib/contrib/infback9/infback9.c +603 -0
  110. package/deps/zlib/contrib/infback9/infback9.h +37 -0
  111. package/deps/zlib/contrib/infback9/inffix9.h +107 -0
  112. package/deps/zlib/contrib/infback9/inflate9.h +47 -0
  113. package/deps/zlib/contrib/infback9/inftree9.c +319 -0
  114. package/deps/zlib/contrib/infback9/inftree9.h +61 -0
  115. package/deps/zlib/contrib/iostream/test.cpp +24 -0
  116. package/deps/zlib/contrib/iostream/zfstream.cpp +329 -0
  117. package/deps/zlib/contrib/iostream/zfstream.h +128 -0
  118. package/deps/zlib/contrib/iostream2/zstream.h +306 -0
  119. package/deps/zlib/contrib/iostream2/zstream_test.cpp +25 -0
  120. package/deps/zlib/contrib/iostream3/CMakeLists.txt +200 -0
  121. package/deps/zlib/contrib/iostream3/README +35 -0
  122. package/deps/zlib/contrib/iostream3/TODO +17 -0
  123. package/deps/zlib/contrib/iostream3/iostream3Config.cmake.in +23 -0
  124. package/deps/zlib/contrib/iostream3/test/CMakeLists.txt +191 -0
  125. package/deps/zlib/contrib/iostream3/test/add_subdirectory_exclude_test.cmake.in +27 -0
  126. package/deps/zlib/contrib/iostream3/test/add_subdirectory_test.cmake.in +25 -0
  127. package/deps/zlib/contrib/iostream3/test/find_package_no_components_test.cmake.in +24 -0
  128. package/deps/zlib/contrib/iostream3/test/find_package_test.cmake.in +24 -0
  129. package/deps/zlib/contrib/iostream3/test/find_package_wrong_components_test.cmake.in +24 -0
  130. package/deps/zlib/contrib/iostream3/test.cc +50 -0
  131. package/deps/zlib/contrib/iostream3/zfstream.cc +479 -0
  132. package/deps/zlib/contrib/iostream3/zfstream.h +466 -0
  133. package/deps/zlib/contrib/minizip/CMakeLists.txt +387 -0
  134. package/deps/zlib/contrib/minizip/LICENSE.Info-Zip +58 -0
  135. package/deps/zlib/contrib/minizip/Makefile +33 -0
  136. package/deps/zlib/contrib/minizip/Makefile.am +45 -0
  137. package/deps/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
  138. package/deps/zlib/contrib/minizip/MiniZip64_info.txt +69 -0
  139. package/deps/zlib/contrib/minizip/configure.ac +32 -0
  140. package/deps/zlib/contrib/minizip/crypt.h +125 -0
  141. package/deps/zlib/contrib/minizip/ints.h +57 -0
  142. package/deps/zlib/contrib/minizip/ioapi.c +231 -0
  143. package/deps/zlib/contrib/minizip/ioapi.h +183 -0
  144. package/deps/zlib/contrib/minizip/iowin32.c +447 -0
  145. package/deps/zlib/contrib/minizip/iowin32.h +27 -0
  146. package/deps/zlib/contrib/minizip/make_vms.com +25 -0
  147. package/deps/zlib/contrib/minizip/miniunz.c +647 -0
  148. package/deps/zlib/contrib/minizip/miniunzip.1 +63 -0
  149. package/deps/zlib/contrib/minizip/minizip.1 +46 -0
  150. package/deps/zlib/contrib/minizip/minizip.c +511 -0
  151. package/deps/zlib/contrib/minizip/minizip.pc.in +13 -0
  152. package/deps/zlib/contrib/minizip/minizip.pc.txt +13 -0
  153. package/deps/zlib/contrib/minizip/minizipConfig.cmake.in +27 -0
  154. package/deps/zlib/contrib/minizip/mztools.c +294 -0
  155. package/deps/zlib/contrib/minizip/mztools.h +37 -0
  156. package/deps/zlib/contrib/minizip/skipset.h +366 -0
  157. package/deps/zlib/contrib/minizip/test/CMakeLists.txt +176 -0
  158. package/deps/zlib/contrib/minizip/test/add_subdirectory_exclude_test.cmake.in +29 -0
  159. package/deps/zlib/contrib/minizip/test/add_subdirectory_test.cmake.in +28 -0
  160. package/deps/zlib/contrib/minizip/test/find_package_no_components_test.cmake.in +26 -0
  161. package/deps/zlib/contrib/minizip/test/find_package_test.cmake.in +26 -0
  162. package/deps/zlib/contrib/minizip/test/find_package_wrong_components_test.cmake.in +26 -0
  163. package/deps/zlib/contrib/minizip/test/test_helper.cm +32 -0
  164. package/deps/zlib/contrib/minizip/unzip.c +1984 -0
  165. package/deps/zlib/contrib/minizip/unzip.h +442 -0
  166. package/deps/zlib/contrib/minizip/zip.c +2246 -0
  167. package/deps/zlib/contrib/minizip/zip.h +371 -0
  168. package/deps/zlib/contrib/nuget/nuget.csproj +45 -0
  169. package/deps/zlib/contrib/nuget/nuget.sln +22 -0
  170. package/deps/zlib/contrib/pascal/example.pas +599 -0
  171. package/deps/zlib/contrib/pascal/readme.txt +76 -0
  172. package/deps/zlib/contrib/pascal/zlibd32.mak +99 -0
  173. package/deps/zlib/contrib/pascal/zlibpas.pas +276 -0
  174. package/deps/zlib/contrib/puff/CMakeLists.txt +154 -0
  175. package/deps/zlib/contrib/puff/Makefile +42 -0
  176. package/deps/zlib/contrib/puff/README +63 -0
  177. package/deps/zlib/contrib/puff/bin-writer.c +26 -0
  178. package/deps/zlib/contrib/puff/puff.c +840 -0
  179. package/deps/zlib/contrib/puff/puff.h +35 -0
  180. package/deps/zlib/contrib/puff/puffConfig.cmake.in +18 -0
  181. package/deps/zlib/contrib/puff/pufftest.c +168 -0
  182. package/deps/zlib/contrib/puff/test/CMakeLists.txt +262 -0
  183. package/deps/zlib/contrib/puff/test/add_subdirectory_exclude_test.cmake.in +26 -0
  184. package/deps/zlib/contrib/puff/test/add_subdirectory_test.cmake.in +25 -0
  185. package/deps/zlib/contrib/puff/test/find_package_no_components_test.cmake.in +24 -0
  186. package/deps/zlib/contrib/puff/test/find_package_test.cmake.in +24 -0
  187. package/deps/zlib/contrib/puff/test/find_package_wrong_components_test.cmake.in +24 -0
  188. package/deps/zlib/contrib/puff/test/tester-cov.cmake +58 -0
  189. package/deps/zlib/contrib/puff/test/tester.cmake +16 -0
  190. package/deps/zlib/contrib/puff/zeros.raw +0 -0
  191. package/deps/zlib/contrib/testzlib/CMakeLists.txt +44 -0
  192. package/deps/zlib/contrib/testzlib/testzlib.c +275 -0
  193. package/deps/zlib/contrib/testzlib/testzlib.txt +10 -0
  194. package/deps/zlib/contrib/vstudio/readme.txt +22 -0
  195. package/deps/zlib/contrib/zlib1-dll/CMakeLists.txt +196 -0
  196. package/deps/zlib/contrib/zlib1-dll/readme.txt +21 -0
  197. package/deps/zlib/crc32.c +983 -0
  198. package/deps/zlib/crc32.h +9446 -0
  199. package/deps/zlib/deflate.c +2185 -0
  200. package/deps/zlib/deflate.h +383 -0
  201. package/deps/zlib/doc/algorithm.txt +209 -0
  202. package/deps/zlib/doc/crc-doc.1.0.pdf +0 -0
  203. package/deps/zlib/doc/rfc1950.txt +619 -0
  204. package/deps/zlib/doc/rfc1951.txt +955 -0
  205. package/deps/zlib/doc/rfc1952.txt +675 -0
  206. package/deps/zlib/doc/txtvsbin.txt +107 -0
  207. package/deps/zlib/examples/README.examples +54 -0
  208. package/deps/zlib/examples/enough.c +597 -0
  209. package/deps/zlib/examples/fitblk.c +233 -0
  210. package/deps/zlib/examples/gun.c +702 -0
  211. package/deps/zlib/examples/gzappend.c +504 -0
  212. package/deps/zlib/examples/gzjoin.c +449 -0
  213. package/deps/zlib/examples/gzlog.c +1061 -0
  214. package/deps/zlib/examples/gzlog.h +91 -0
  215. package/deps/zlib/examples/gznorm.c +474 -0
  216. package/deps/zlib/examples/zlib_how.html +550 -0
  217. package/deps/zlib/examples/zpipe.c +206 -0
  218. package/deps/zlib/examples/zran.c +546 -0
  219. package/deps/zlib/examples/zran.h +53 -0
  220. package/deps/zlib/gzclose.c +23 -0
  221. package/deps/zlib/gzguts.h +216 -0
  222. package/deps/zlib/gzlib.c +609 -0
  223. package/deps/zlib/gzread.c +668 -0
  224. package/deps/zlib/gzwrite.c +700 -0
  225. package/deps/zlib/infback.c +581 -0
  226. package/deps/zlib/inffast.c +321 -0
  227. package/deps/zlib/inffast.h +11 -0
  228. package/deps/zlib/inffixed.h +94 -0
  229. package/deps/zlib/inflate.c +1413 -0
  230. package/deps/zlib/inflate.h +126 -0
  231. package/deps/zlib/inftrees.c +424 -0
  232. package/deps/zlib/inftrees.h +64 -0
  233. package/deps/zlib/make_vms.com +867 -0
  234. package/deps/zlib/msdos/Makefile.bor +115 -0
  235. package/deps/zlib/msdos/Makefile.dj2 +104 -0
  236. package/deps/zlib/msdos/Makefile.emx +69 -0
  237. package/deps/zlib/msdos/Makefile.msc +112 -0
  238. package/deps/zlib/msdos/Makefile.tc +100 -0
  239. package/deps/zlib/os400/README400 +48 -0
  240. package/deps/zlib/os400/bndsrc +144 -0
  241. package/deps/zlib/os400/make.sh +383 -0
  242. package/deps/zlib/os400/zlibfixed.rpgle +578 -0
  243. package/deps/zlib/os400/zlibfree.rpgle +634 -0
  244. package/deps/zlib/qnx/package.qpg +141 -0
  245. package/deps/zlib/test/CMakeLists.txt +318 -0
  246. package/deps/zlib/test/add_subdirectory_exclude_test.cmake.in +29 -0
  247. package/deps/zlib/test/add_subdirectory_test.cmake.in +28 -0
  248. package/deps/zlib/test/example.c +552 -0
  249. package/deps/zlib/test/find_package_no_components_test.cmake.in +27 -0
  250. package/deps/zlib/test/find_package_test.cmake.in +27 -0
  251. package/deps/zlib/test/find_package_wrong_components_test.cmake.in +27 -0
  252. package/deps/zlib/test/infcover.c +672 -0
  253. package/deps/zlib/test/minigzip.c +592 -0
  254. package/deps/zlib/treebuild.xml +116 -0
  255. package/deps/zlib/trees.c +1119 -0
  256. package/deps/zlib/trees.h +128 -0
  257. package/deps/zlib/uncompr.c +101 -0
  258. package/deps/zlib/watcom/watcom_f.mak +43 -0
  259. package/deps/zlib/watcom/watcom_l.mak +43 -0
  260. package/deps/zlib/win32/DLL_FAQ.txt +381 -0
  261. package/deps/zlib/win32/Makefile.bor +109 -0
  262. package/deps/zlib/win32/Makefile.gcc +177 -0
  263. package/deps/zlib/win32/Makefile.msc +159 -0
  264. package/deps/zlib/win32/README-WIN32.txt +103 -0
  265. package/deps/zlib/win32/VisualC.txt +3 -0
  266. package/deps/zlib/win32/zlib.def +104 -0
  267. package/deps/zlib/win32/zlib1.rc +37 -0
  268. package/deps/zlib/zconf.h.in +551 -0
  269. package/deps/zlib/zlib.3 +149 -0
  270. package/deps/zlib/zlib.3.pdf +0 -0
  271. package/deps/zlib/zlib.h +2057 -0
  272. package/deps/zlib/zlib.map +116 -0
  273. package/deps/zlib/zlib.pc.cmakein +14 -0
  274. package/deps/zlib/zlib.pc.in +14 -0
  275. package/deps/zlib/zlibConfig.cmake.in +18 -0
  276. package/deps/zlib/zutil.c +313 -0
  277. package/deps/zlib/zutil.h +331 -0
  278. package/dist/index.d.ts +266 -0
  279. package/dist/index.js +1146 -0
  280. package/dist/libwz.js +5632 -0
  281. package/dist/libwz.wasm +0 -0
  282. package/include/wz/CRC32.h +182 -0
  283. package/include/wz/PngUtility.h +72 -0
  284. package/include/wz/PortalType.h +124 -0
  285. package/include/wz/Properties/WzBinaryProperty.h +70 -0
  286. package/include/wz/Properties/WzCanvasProperty.h +55 -0
  287. package/include/wz/Properties/WzConvexProperty.h +34 -0
  288. package/include/wz/Properties/WzDoubleProperty.h +32 -0
  289. package/include/wz/Properties/WzFloatProperty.h +30 -0
  290. package/include/wz/Properties/WzIntProperty.h +30 -0
  291. package/include/wz/Properties/WzLongProperty.h +30 -0
  292. package/include/wz/Properties/WzLuaProperty.h +31 -0
  293. package/include/wz/Properties/WzNullProperty.h +15 -0
  294. package/include/wz/Properties/WzPngProperty.h +53 -0
  295. package/include/wz/Properties/WzRawDataProperty.h +46 -0
  296. package/include/wz/Properties/WzShortProperty.h +31 -0
  297. package/include/wz/Properties/WzStringProperty.h +32 -0
  298. package/include/wz/Properties/WzSubProperty.h +35 -0
  299. package/include/wz/Properties/WzUOLProperty.h +44 -0
  300. package/include/wz/Properties/WzVectorProperty.h +40 -0
  301. package/include/wz/Properties/WzVideoProperty.h +43 -0
  302. package/include/wz/Result.h +58 -0
  303. package/include/wz/Util/Defines.h +16 -0
  304. package/include/wz/Util/ListFileParser.h +20 -0
  305. package/include/wz/Util/WzBinaryReader.h +95 -0
  306. package/include/wz/Util/WzBinaryWriter.h +72 -0
  307. package/include/wz/Util/WzBlobDataSource.h +30 -0
  308. package/include/wz/Util/WzDataSource.h +49 -0
  309. package/include/wz/Util/WzKeyGenerator.h +28 -0
  310. package/include/wz/Util/WzMutableKey.h +39 -0
  311. package/include/wz/Util/WzPath.h +37 -0
  312. package/include/wz/Util/WzStream.h +86 -0
  313. package/include/wz/Util/WzTool.h +42 -0
  314. package/include/wz/WzAESConstant.h +17 -0
  315. package/include/wz/WzDirectory.h +97 -0
  316. package/include/wz/WzEnums.h +76 -0
  317. package/include/wz/WzFile.h +99 -0
  318. package/include/wz/WzHeader.h +47 -0
  319. package/include/wz/WzImage.h +97 -0
  320. package/include/wz/WzImageProperty.h +92 -0
  321. package/include/wz/WzObject.h +55 -0
  322. package/include/wz/WzPropertyCollection.h +115 -0
  323. package/include/wz/wz.h +41 -0
  324. package/include/wz/wz_api.h +432 -0
  325. package/package.json +93 -0
  326. package/src/PngUtility.cpp +328 -0
  327. package/src/Properties/WzBinaryProperty.cpp +183 -0
  328. package/src/Properties/WzCanvasProperty.cpp +262 -0
  329. package/src/Properties/WzConvexProperty.cpp +159 -0
  330. package/src/Properties/WzDoubleProperty.cpp +12 -0
  331. package/src/Properties/WzFloatProperty.cpp +17 -0
  332. package/src/Properties/WzIntProperty.cpp +12 -0
  333. package/src/Properties/WzLongProperty.cpp +12 -0
  334. package/src/Properties/WzLuaProperty.cpp +37 -0
  335. package/src/Properties/WzNullProperty.cpp +11 -0
  336. package/src/Properties/WzPngProperty.cpp +637 -0
  337. package/src/Properties/WzRawDataProperty.cpp +116 -0
  338. package/src/Properties/WzShortProperty.cpp +12 -0
  339. package/src/Properties/WzStringProperty.cpp +44 -0
  340. package/src/Properties/WzSubProperty.cpp +129 -0
  341. package/src/Properties/WzUOLProperty.cpp +136 -0
  342. package/src/Properties/WzVectorProperty.cpp +22 -0
  343. package/src/Properties/WzVideoProperty.cpp +115 -0
  344. package/src/Util/ListFileParser.cpp +48 -0
  345. package/src/Util/WzBinaryReader.cpp +368 -0
  346. package/src/Util/WzBinaryWriter.cpp +305 -0
  347. package/src/Util/WzBlobDataSource.cpp +47 -0
  348. package/src/Util/WzDataSource.cpp +61 -0
  349. package/src/Util/WzKeyGenerator.cpp +43 -0
  350. package/src/Util/WzMutableKey.cpp +59 -0
  351. package/src/Util/WzStream.cpp +196 -0
  352. package/src/Util/WzTool.cpp +266 -0
  353. package/src/WzAESConstant.cpp +12 -0
  354. package/src/WzDirectory.cpp +669 -0
  355. package/src/WzEnums.cpp +20 -0
  356. package/src/WzFile.cpp +450 -0
  357. package/src/WzImage.cpp +350 -0
  358. package/src/WzImageProperty.cpp +469 -0
  359. package/src/WzObject.cpp +174 -0
  360. package/src/WzPropertyCollection.cpp +84 -0
  361. package/src/capi/wz_api.cpp +1996 -0
  362. package/src/node/binding.cpp +1776 -0
@@ -0,0 +1,609 @@
1
+ /* gzlib.c -- zlib functions common to reading and writing gzip files
2
+ * Copyright (C) 2004-2026 Mark Adler
3
+ * For conditions of distribution and use, see copyright notice in zlib.h
4
+ */
5
+
6
+ #include "gzguts.h"
7
+
8
+ #if defined(__DJGPP__)
9
+ # define LSEEK llseek
10
+ #elif defined(_WIN32) && !defined(__BORLANDC__) && !defined(UNDER_CE)
11
+ # define LSEEK _lseeki64
12
+ #elif defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0
13
+ # define LSEEK lseek64
14
+ #else
15
+ # define LSEEK lseek
16
+ #endif
17
+
18
+ #if defined UNDER_CE
19
+
20
+ /* Map the Windows error number in ERROR to a locale-dependent error message
21
+ string and return a pointer to it. Typically, the values for ERROR come
22
+ from GetLastError.
23
+
24
+ The string pointed to shall not be modified by the application, but may be
25
+ overwritten by a subsequent call to gz_strwinerror
26
+
27
+ The gz_strwinerror function does not change the current setting of
28
+ GetLastError. */
29
+ char ZLIB_INTERNAL *gz_strwinerror(DWORD error) {
30
+ static char buf[1024];
31
+
32
+ wchar_t *msgbuf;
33
+ DWORD lasterr = GetLastError();
34
+ DWORD chars = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM
35
+ | FORMAT_MESSAGE_ALLOCATE_BUFFER,
36
+ NULL,
37
+ error,
38
+ 0, /* Default language */
39
+ (LPVOID)&msgbuf,
40
+ 0,
41
+ NULL);
42
+ if (chars != 0) {
43
+ /* If there is an \r\n appended, zap it. */
44
+ if (chars >= 2
45
+ && msgbuf[chars - 2] == '\r' && msgbuf[chars - 1] == '\n') {
46
+ chars -= 2;
47
+ msgbuf[chars] = 0;
48
+ }
49
+
50
+ if (chars > sizeof (buf) - 1) {
51
+ chars = sizeof (buf) - 1;
52
+ msgbuf[chars] = 0;
53
+ }
54
+
55
+ wcstombs(buf, msgbuf, chars + 1); /* assumes buf is big enough */
56
+ LocalFree(msgbuf);
57
+ }
58
+ else {
59
+ sprintf(buf, "unknown win32 error (%ld)", error);
60
+ }
61
+
62
+ SetLastError(lasterr);
63
+ return buf;
64
+ }
65
+
66
+ #endif /* UNDER_CE */
67
+
68
+ /* Reset gzip file state */
69
+ local void gz_reset(gz_statep state) {
70
+ state->x.have = 0; /* no output data available */
71
+ if (state->mode == GZ_READ) { /* for reading ... */
72
+ state->eof = 0; /* not at end of file */
73
+ state->past = 0; /* have not read past end yet */
74
+ state->how = LOOK; /* look for gzip header */
75
+ state->junk = -1; /* mark first member */
76
+ }
77
+ else /* for writing ... */
78
+ state->reset = 0; /* no deflateReset pending */
79
+ state->again = 0; /* no stalled i/o yet */
80
+ state->skip = 0; /* no seek request pending */
81
+ gz_error(state, Z_OK, NULL); /* clear error */
82
+ state->x.pos = 0; /* no uncompressed data yet */
83
+ state->strm.avail_in = 0; /* no input data yet */
84
+ }
85
+
86
+ /* Open a gzip file either by name or file descriptor. */
87
+ local gzFile gz_open(const void *path, int fd, const char *mode) {
88
+ gz_statep state;
89
+ z_size_t len;
90
+ int oflag = 0;
91
+ #ifdef O_EXCL
92
+ int exclusive = 0;
93
+ #endif
94
+
95
+ /* check input */
96
+ if (path == NULL || mode == NULL)
97
+ return NULL;
98
+
99
+ /* allocate gzFile structure to return */
100
+ state = (gz_statep)malloc(sizeof(gz_state));
101
+ if (state == NULL)
102
+ return NULL;
103
+ state->size = 0; /* no buffers allocated yet */
104
+ state->want = GZBUFSIZE; /* requested buffer size */
105
+ state->err = Z_OK; /* no error yet */
106
+ state->msg = NULL; /* no error message yet */
107
+
108
+ /* interpret mode */
109
+ state->mode = GZ_NONE;
110
+ state->level = Z_DEFAULT_COMPRESSION;
111
+ state->strategy = Z_DEFAULT_STRATEGY;
112
+ state->direct = 0;
113
+ while (*mode) {
114
+ if (*mode >= '0' && *mode <= '9')
115
+ state->level = *mode - '0';
116
+ else
117
+ switch (*mode) {
118
+ case 'r':
119
+ state->mode = GZ_READ;
120
+ break;
121
+ #ifndef NO_GZCOMPRESS
122
+ case 'w':
123
+ state->mode = GZ_WRITE;
124
+ break;
125
+ case 'a':
126
+ state->mode = GZ_APPEND;
127
+ break;
128
+ #endif
129
+ case '+': /* can't read and write at the same time */
130
+ free(state);
131
+ return NULL;
132
+ case 'b': /* ignore -- will request binary anyway */
133
+ break;
134
+ #ifdef O_CLOEXEC
135
+ case 'e':
136
+ oflag |= O_CLOEXEC;
137
+ break;
138
+ #endif
139
+ #ifdef O_EXCL
140
+ case 'x':
141
+ exclusive = 1;
142
+ break;
143
+ #endif
144
+ case 'f':
145
+ state->strategy = Z_FILTERED;
146
+ break;
147
+ case 'h':
148
+ state->strategy = Z_HUFFMAN_ONLY;
149
+ break;
150
+ case 'R':
151
+ state->strategy = Z_RLE;
152
+ break;
153
+ case 'F':
154
+ state->strategy = Z_FIXED;
155
+ break;
156
+ case 'G':
157
+ state->direct = -1;
158
+ break;
159
+ #ifdef O_NONBLOCK
160
+ case 'N':
161
+ oflag |= O_NONBLOCK;
162
+ break;
163
+ #endif
164
+ case 'T':
165
+ state->direct = 1;
166
+ break;
167
+ default: /* could consider as an error, but just ignore */
168
+ ;
169
+ }
170
+ mode++;
171
+ }
172
+
173
+ /* must provide an "r", "w", or "a" */
174
+ if (state->mode == GZ_NONE) {
175
+ free(state);
176
+ return NULL;
177
+ }
178
+
179
+ /* direct is 0, 1 if "T", or -1 if "G" (last "G" or "T" wins) */
180
+ if (state->mode == GZ_READ) {
181
+ if (state->direct == 1) {
182
+ /* can't force a transparent read */
183
+ free(state);
184
+ return NULL;
185
+ }
186
+ if (state->direct == 0)
187
+ /* default when reading is auto-detect of gzip vs. transparent --
188
+ start with a transparent assumption in case of an empty file */
189
+ state->direct = 1;
190
+ }
191
+ else if (state->direct == -1) {
192
+ /* "G" has no meaning when writing -- disallow it */
193
+ free(state);
194
+ return NULL;
195
+ }
196
+ /* if reading, direct == 1 for auto-detect, -1 for gzip only; if writing or
197
+ appending, direct == 0 for gzip, 1 for transparent (copy in to out) */
198
+
199
+ /* save the path name for error messages */
200
+ #ifdef WIDECHAR
201
+ if (fd == -2)
202
+ len = wcstombs(NULL, path, 0);
203
+ else
204
+ #endif
205
+ len = strlen((const char *)path);
206
+ state->path = (char *)malloc(len + 1);
207
+ if (state->path == NULL) {
208
+ free(state);
209
+ return NULL;
210
+ }
211
+ #ifdef WIDECHAR
212
+ if (fd == -2) {
213
+ if (len)
214
+ wcstombs(state->path, path, len + 1);
215
+ else
216
+ *(state->path) = 0;
217
+ }
218
+ else
219
+ #endif
220
+ {
221
+ #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
222
+ (void)snprintf(state->path, len + 1, "%s", (const char *)path);
223
+ #else
224
+ strcpy(state->path, path);
225
+ #endif
226
+ }
227
+
228
+ /* compute the flags for open() */
229
+ oflag |=
230
+ #ifdef O_LARGEFILE
231
+ O_LARGEFILE |
232
+ #endif
233
+ #ifdef O_BINARY
234
+ O_BINARY |
235
+ #endif
236
+ (state->mode == GZ_READ ?
237
+ O_RDONLY :
238
+ (O_WRONLY | O_CREAT |
239
+ #ifdef O_EXCL
240
+ (exclusive ? O_EXCL : 0) |
241
+ #endif
242
+ (state->mode == GZ_WRITE ?
243
+ O_TRUNC :
244
+ O_APPEND)));
245
+
246
+ /* open the file with the appropriate flags (or just use fd) */
247
+ if (fd == -1)
248
+ state->fd = open((const char *)path, oflag, 0666);
249
+ #ifdef WIDECHAR
250
+ else if (fd == -2)
251
+ state->fd = _wopen(path, oflag, _S_IREAD | _S_IWRITE);
252
+ #endif
253
+ else {
254
+ #ifdef O_NONBLOCK
255
+ if (oflag & O_NONBLOCK)
256
+ fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
257
+ #endif
258
+ #ifdef O_CLOEXEC
259
+ if (oflag & O_CLOEXEC)
260
+ fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | O_CLOEXEC);
261
+ #endif
262
+ state->fd = fd;
263
+ }
264
+ if (state->fd == -1) {
265
+ free(state->path);
266
+ free(state);
267
+ return NULL;
268
+ }
269
+ if (state->mode == GZ_APPEND) {
270
+ LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */
271
+ state->mode = GZ_WRITE; /* simplify later checks */
272
+ }
273
+
274
+ /* save the current position for rewinding (only if reading) */
275
+ if (state->mode == GZ_READ) {
276
+ state->start = LSEEK(state->fd, 0, SEEK_CUR);
277
+ if (state->start == -1) state->start = 0;
278
+ }
279
+
280
+ /* initialize stream */
281
+ gz_reset(state);
282
+
283
+ /* return stream */
284
+ return (gzFile)state;
285
+ }
286
+
287
+ /* -- see zlib.h -- */
288
+ gzFile ZEXPORT gzopen(const char *path, const char *mode) {
289
+ return gz_open(path, -1, mode);
290
+ }
291
+
292
+ /* -- see zlib.h -- */
293
+ gzFile ZEXPORT gzopen64(const char *path, const char *mode) {
294
+ return gz_open(path, -1, mode);
295
+ }
296
+
297
+ /* -- see zlib.h -- */
298
+ gzFile ZEXPORT gzdopen(int fd, const char *mode) {
299
+ char *path; /* identifier for error messages */
300
+ gzFile gz;
301
+
302
+ if (fd == -1 || (path = (char *)malloc(7 + 3 * sizeof(int))) == NULL)
303
+ return NULL;
304
+ #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
305
+ (void)snprintf(path, 7 + 3 * sizeof(int), "<fd:%d>", fd);
306
+ #else
307
+ sprintf(path, "<fd:%d>", fd); /* for debugging */
308
+ #endif
309
+ gz = gz_open(path, fd, mode);
310
+ free(path);
311
+ return gz;
312
+ }
313
+
314
+ /* -- see zlib.h -- */
315
+ #ifdef WIDECHAR
316
+ gzFile ZEXPORT gzopen_w(const wchar_t *path, const char *mode) {
317
+ return gz_open(path, -2, mode);
318
+ }
319
+ #endif
320
+
321
+ /* -- see zlib.h -- */
322
+ int ZEXPORT gzbuffer(gzFile file, unsigned size) {
323
+ gz_statep state;
324
+
325
+ /* get internal structure and check integrity */
326
+ if (file == NULL)
327
+ return -1;
328
+ state = (gz_statep)file;
329
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
330
+ return -1;
331
+
332
+ /* make sure we haven't already allocated memory */
333
+ if (state->size != 0)
334
+ return -1;
335
+
336
+ /* check and set requested size */
337
+ if ((size << 1) < size)
338
+ return -1; /* need to be able to double it */
339
+ if (size < 8)
340
+ size = 8; /* needed to behave well with flushing */
341
+ state->want = size;
342
+ return 0;
343
+ }
344
+
345
+ /* -- see zlib.h -- */
346
+ int ZEXPORT gzrewind(gzFile file) {
347
+ gz_statep state;
348
+
349
+ /* get internal structure */
350
+ if (file == NULL)
351
+ return -1;
352
+ state = (gz_statep)file;
353
+
354
+ /* check that we're reading and that there's no error */
355
+ if (state->mode != GZ_READ ||
356
+ (state->err != Z_OK && state->err != Z_BUF_ERROR))
357
+ return -1;
358
+
359
+ /* back up and start over */
360
+ if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
361
+ return -1;
362
+ gz_reset(state);
363
+ return 0;
364
+ }
365
+
366
+ /* -- see zlib.h -- */
367
+ z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
368
+ unsigned n;
369
+ z_off64_t ret;
370
+ gz_statep state;
371
+
372
+ /* get internal structure and check integrity */
373
+ if (file == NULL)
374
+ return -1;
375
+ state = (gz_statep)file;
376
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
377
+ return -1;
378
+
379
+ /* check that there's no error */
380
+ if (state->err != Z_OK && state->err != Z_BUF_ERROR)
381
+ return -1;
382
+
383
+ /* can only seek from start or relative to current position */
384
+ if (whence != SEEK_SET && whence != SEEK_CUR)
385
+ return -1;
386
+
387
+ /* normalize offset to a SEEK_CUR specification */
388
+ if (whence == SEEK_SET)
389
+ offset -= state->x.pos;
390
+ else {
391
+ offset += state->past ? 0 : state->skip;
392
+ state->skip = 0;
393
+ }
394
+
395
+ /* if within raw area while reading, just go there */
396
+ if (state->mode == GZ_READ && state->how == COPY &&
397
+ state->x.pos + offset >= 0) {
398
+ ret = LSEEK(state->fd, offset - (z_off64_t)state->x.have, SEEK_CUR);
399
+ if (ret == -1)
400
+ return -1;
401
+ state->x.have = 0;
402
+ state->eof = 0;
403
+ state->past = 0;
404
+ state->skip = 0;
405
+ gz_error(state, Z_OK, NULL);
406
+ state->strm.avail_in = 0;
407
+ state->x.pos += offset;
408
+ return state->x.pos;
409
+ }
410
+
411
+ /* calculate skip amount, rewinding if needed for back seek when reading */
412
+ if (offset < 0) {
413
+ if (state->mode != GZ_READ) /* writing -- can't go backwards */
414
+ return -1;
415
+ offset += state->x.pos;
416
+ if (offset < 0) /* before start of file! */
417
+ return -1;
418
+ if (gzrewind(file) == -1) /* rewind, then skip to offset */
419
+ return -1;
420
+ }
421
+
422
+ /* if reading, skip what's in output buffer (one less gzgetc() check) */
423
+ if (state->mode == GZ_READ) {
424
+ n = GT_OFF(state->x.have) || (z_off64_t)state->x.have > offset ?
425
+ (unsigned)offset : state->x.have;
426
+ state->x.have -= n;
427
+ state->x.next += n;
428
+ state->x.pos += n;
429
+ offset -= n;
430
+ }
431
+
432
+ /* request skip (if not zero) */
433
+ state->skip = offset;
434
+ return state->x.pos + offset;
435
+ }
436
+
437
+ /* -- see zlib.h -- */
438
+ z_off_t ZEXPORT gzseek(gzFile file, z_off_t offset, int whence) {
439
+ z_off64_t ret;
440
+
441
+ ret = gzseek64(file, (z_off64_t)offset, whence);
442
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
443
+ }
444
+
445
+ /* -- see zlib.h -- */
446
+ z_off64_t ZEXPORT gztell64(gzFile file) {
447
+ gz_statep state;
448
+
449
+ /* get internal structure and check integrity */
450
+ if (file == NULL)
451
+ return -1;
452
+ state = (gz_statep)file;
453
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
454
+ return -1;
455
+
456
+ /* return position */
457
+ return state->x.pos + (state->past ? 0 : state->skip);
458
+ }
459
+
460
+ /* -- see zlib.h -- */
461
+ z_off_t ZEXPORT gztell(gzFile file) {
462
+ z_off64_t ret;
463
+
464
+ ret = gztell64(file);
465
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
466
+ }
467
+
468
+ /* -- see zlib.h -- */
469
+ z_off64_t ZEXPORT gzoffset64(gzFile file) {
470
+ z_off64_t offset;
471
+ gz_statep state;
472
+
473
+ /* get internal structure and check integrity */
474
+ if (file == NULL)
475
+ return -1;
476
+ state = (gz_statep)file;
477
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
478
+ return -1;
479
+
480
+ /* compute and return effective offset in file */
481
+ offset = LSEEK(state->fd, 0, SEEK_CUR);
482
+ if (offset == -1)
483
+ return -1;
484
+ if (state->mode == GZ_READ) /* reading */
485
+ offset -= state->strm.avail_in; /* don't count buffered input */
486
+ return offset;
487
+ }
488
+
489
+ /* -- see zlib.h -- */
490
+ z_off_t ZEXPORT gzoffset(gzFile file) {
491
+ z_off64_t ret;
492
+
493
+ ret = gzoffset64(file);
494
+ return ret == (z_off_t)ret ? (z_off_t)ret : -1;
495
+ }
496
+
497
+ /* -- see zlib.h -- */
498
+ int ZEXPORT gzeof(gzFile file) {
499
+ gz_statep state;
500
+
501
+ /* get internal structure and check integrity */
502
+ if (file == NULL)
503
+ return 0;
504
+ state = (gz_statep)file;
505
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
506
+ return 0;
507
+
508
+ /* return end-of-file state */
509
+ return state->mode == GZ_READ ? state->past : 0;
510
+ }
511
+
512
+ /* -- see zlib.h -- */
513
+ const char * ZEXPORT gzerror(gzFile file, int *errnum) {
514
+ gz_statep state;
515
+
516
+ /* get internal structure and check integrity */
517
+ if (file == NULL)
518
+ return NULL;
519
+ state = (gz_statep)file;
520
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
521
+ return NULL;
522
+
523
+ /* return error information */
524
+ if (errnum != NULL)
525
+ *errnum = state->err;
526
+ return state->err == Z_MEM_ERROR ? "out of memory" :
527
+ (state->msg == NULL ? "" : state->msg);
528
+ }
529
+
530
+ /* -- see zlib.h -- */
531
+ void ZEXPORT gzclearerr(gzFile file) {
532
+ gz_statep state;
533
+
534
+ /* get internal structure and check integrity */
535
+ if (file == NULL)
536
+ return;
537
+ state = (gz_statep)file;
538
+ if (state->mode != GZ_READ && state->mode != GZ_WRITE)
539
+ return;
540
+
541
+ /* clear error and end-of-file */
542
+ if (state->mode == GZ_READ) {
543
+ state->eof = 0;
544
+ state->past = 0;
545
+ }
546
+ gz_error(state, Z_OK, NULL);
547
+ }
548
+
549
+ /* Create an error message in allocated memory and set state->err and
550
+ state->msg accordingly. Free any previous error message already there. Do
551
+ not try to free or allocate space if the error is Z_MEM_ERROR (out of
552
+ memory). Simply save the error message as a static string. If there is an
553
+ allocation failure constructing the error message, then convert the error to
554
+ out of memory. */
555
+ void ZLIB_INTERNAL gz_error(gz_statep state, int err, const char *msg) {
556
+ /* free previously allocated message and clear */
557
+ if (state->msg != NULL) {
558
+ if (state->err != Z_MEM_ERROR)
559
+ free(state->msg);
560
+ state->msg = NULL;
561
+ }
562
+
563
+ /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */
564
+ if (err != Z_OK && err != Z_BUF_ERROR && !state->again)
565
+ state->x.have = 0;
566
+
567
+ /* set error code, and if no message, then done */
568
+ state->err = err;
569
+ if (msg == NULL)
570
+ return;
571
+
572
+ /* for an out of memory error, return literal string when requested */
573
+ if (err == Z_MEM_ERROR)
574
+ return;
575
+
576
+ /* construct error message with path */
577
+ if ((state->msg = (char *)malloc(strlen(state->path) + strlen(msg) + 3)) ==
578
+ NULL) {
579
+ state->err = Z_MEM_ERROR;
580
+ return;
581
+ }
582
+ #if !defined(NO_snprintf) && !defined(NO_vsnprintf)
583
+ (void)snprintf(state->msg, strlen(state->path) + strlen(msg) + 3,
584
+ "%s%s%s", state->path, ": ", msg);
585
+ #else
586
+ strcpy(state->msg, state->path);
587
+ strcat(state->msg, ": ");
588
+ strcat(state->msg, msg);
589
+ #endif
590
+ }
591
+
592
+ /* portably return maximum value for an int (when limits.h presumed not
593
+ available) -- we need to do this to cover cases where 2's complement not
594
+ used, since C standard permits 1's complement and sign-bit representations,
595
+ otherwise we could just use ((unsigned)-1) >> 1 */
596
+ unsigned ZLIB_INTERNAL gz_intmax(void) {
597
+ #ifdef INT_MAX
598
+ return INT_MAX;
599
+ #else
600
+ unsigned p = 1, q;
601
+
602
+ do {
603
+ q = p;
604
+ p <<= 1;
605
+ p++;
606
+ } while (p > q);
607
+ return q >> 1;
608
+ #endif
609
+ }