From 68b2e7f763926225cbd07219662215c51858650b Mon Sep 17 00:00:00 2001 From: tqcq <99722391+tqcq@users.noreply.github.com> Date: Mon, 25 Aug 2025 15:24:22 +0800 Subject: [PATCH] fix: breakpad use miniz --- CMakeLists.txt | 23 +- examples/microprofile_demo.cc | 8 +- examples/tracy_demo.cc | 15 + third_party/breakpad/CMakeLists.txt | 4 +- .../breakpad/src/common/dwarf/elf_reader.h | 232 +- .../breakpad/src/common/linux/dump_symbols.cc | 2120 +- .../common/linux/include/asm-mips/README.md | 9 + .../src/common/linux/include/asm-mips/asm.h | 270 + .../common/linux/include/asm-mips/fpregdef.h | 117 + .../common/linux/include/asm-mips/regdef.h | 125 + .../breakpad/src/third_party/miniz/miniz.c | 7833 + .../breakpad/src/third_party/miniz/miniz.h | 1422 + third_party/microprofile/microprofile.cpp | 1 + third_party/tracy/.clang-format | 18 + third_party/tracy/.clang-tidy | 61 + third_party/tracy/.github/FUNDING.yml | 1 + third_party/tracy/.github/sponsor.png | Bin 0 -> 1036 bytes third_party/tracy/.github/workflows/build.yml | 83 + .../tracy/.github/workflows/emscripten.yml | 63 + third_party/tracy/.github/workflows/latex.yml | 24 + third_party/tracy/.github/workflows/linux.yml | 80 + third_party/tracy/.gitignore | 36 + third_party/tracy/.mailmap | 2 + third_party/tracy/.vscode/extensions.json | 7 + third_party/tracy/.vscode/launch.json | 13 + third_party/tracy/.vscode/settings.json | 20 + third_party/tracy/CMakeLists.txt | 273 + third_party/tracy/Config.cmake.in | 6 + third_party/tracy/LICENSE | 27 + third_party/tracy/NEWS | 1331 + third_party/tracy/README.md | 28 + third_party/tracy/capture/CMakeLists.txt | 28 + third_party/tracy/capture/src/capture.cpp | 364 + third_party/tracy/cmake/CPM.cmake | 1269 + .../tracy/cmake/ECMFindModuleHelpers.cmake | 300 + .../tracy/cmake/FindWaylandScanner.cmake | 170 + third_party/tracy/cmake/config.cmake | 62 + .../tracy/cmake/gl3w-extra-symbols.patch | 12 + .../tracy/cmake/imgui-emscripten.patch | 14 + third_party/tracy/cmake/imgui-loader.patch | 56 + third_party/tracy/cmake/ppqsort-nodebug.patch | 14 + third_party/tracy/cmake/server.cmake | 35 + third_party/tracy/cmake/vendor.cmake | 193 + third_party/tracy/cmake/version.cmake | 24 + third_party/tracy/csvexport/CMakeLists.txt | 29 + third_party/tracy/csvexport/src/csvexport.cpp | 454 + third_party/tracy/doc/profiler.png | Bin 0 -> 218265 bytes third_party/tracy/doc/profiler2.png | Bin 0 -> 256370 bytes third_party/tracy/doc/profiler3.png | Bin 0 -> 239265 bytes third_party/tracy/dtl/Diff.hpp | 706 + third_party/tracy/dtl/Diff3.hpp | 245 + third_party/tracy/dtl/Lcs.hpp | 55 + third_party/tracy/dtl/Sequence.hpp | 65 + third_party/tracy/dtl/Ses.hpp | 132 + third_party/tracy/dtl/dtl.hpp | 47 + third_party/tracy/dtl/functors.hpp | 151 + third_party/tracy/dtl/variables.hpp | 142 + .../examples/OpenCLVectorAdd/CMakeLists.txt | 17 + .../OpenCLVectorAdd/OpenCLVectorAdd.cpp | 220 + .../tracy/examples/ToyPathTracer/.gitignore | 1 + .../tracy/examples/ToyPathTracer/README | 4 + .../examples/ToyPathTracer/Source/Config.h | 33 + .../examples/ToyPathTracer/Source/MathSimd.h | 192 + .../examples/ToyPathTracer/Source/Maths.cpp | 203 + .../examples/ToyPathTracer/Source/Maths.h | 436 + .../examples/ToyPathTracer/Source/Test.cpp | 392 + .../examples/ToyPathTracer/Source/Test.h | 17 + .../ToyPathTracer/Source/enkiTS/Atomics.h | 79 + .../Source/enkiTS/LockLessMultiReadPipe.h | 240 + .../Source/enkiTS/TaskScheduler.cpp | 437 + .../Source/enkiTS/TaskScheduler.h | 177 + .../Source/enkiTS/TaskScheduler_c.cpp | 122 + .../Source/enkiTS/TaskScheduler_c.h | 104 + .../ToyPathTracer/Source/enkiTS/Threads.h | 210 + .../ToyPathTracer/Windows/ComputeShader.hlsl | 395 + .../ToyPathTracer/Windows/PixelShader.hlsl | 15 + .../ToyPathTracer/Windows/TestCpu.sln | 31 + .../ToyPathTracer/Windows/TestCpu.vcxproj | 245 + .../Windows/TestCpu.vcxproj.filters | 67 + .../ToyPathTracer/Windows/TestWin.cpp | 567 + .../ToyPathTracer/Windows/VertexShader.hlsl | 13 + .../tracy/examples/ToyPathTracer/license.md | 24 + third_party/tracy/examples/fibers.cpp | 30 + third_party/tracy/extra/color-hot.cpp | 64 + third_party/tracy/extra/color.cpp | 77 + .../tracy/extra/desktop/application-tracy.xml | 14 + third_party/tracy/extra/desktop/tracy.desktop | 13 + third_party/tracy/extra/dxt1divtable.c | 22 + third_party/tracy/extra/dxt1table.c | 36 + third_party/tracy/extra/identify.cpp | 50 + third_party/tracy/extra/make-build.sh | 26 + third_party/tracy/extra/natvis.py | 154 + third_party/tracy/extra/rdotbl.c | 24 + .../extra/uarch/TracyMicroArchitecture.hpp | 46 + third_party/tracy/extra/uarch/uarch.cpp | 326 + .../tracy/extra/update-meson-version.sh | 13 + third_party/tracy/extra/version.cpp | 11 + third_party/tracy/extra/x11_colors.c | 42 + third_party/tracy/extra/zigzag.svg | 67 + third_party/tracy/extra/zigzag01.png | Bin 0 -> 126 bytes third_party/tracy/extra/zigzag02.png | Bin 0 -> 133 bytes third_party/tracy/extra/zigzag04.png | Bin 0 -> 151 bytes third_party/tracy/extra/zigzag08.png | Bin 0 -> 191 bytes third_party/tracy/extra/zigzag16.png | Bin 0 -> 234 bytes third_party/tracy/extra/zigzag32.png | Bin 0 -> 263 bytes third_party/tracy/getopt/getopt.c | 239 + third_party/tracy/getopt/getopt.h | 59 + .../tracy/icon/application-tracy.copying | 12 + third_party/tracy/icon/application-tracy.svg | 35 + third_party/tracy/icon/icon.ico | Bin 0 -> 4810 bytes third_party/tracy/icon/icon.pdf | Bin 0 -> 1585 bytes third_party/tracy/icon/icon.png | Bin 0 -> 854 bytes third_party/tracy/icon/icon.svg | 24 + third_party/tracy/import/CMakeLists.txt | 30 + .../tracy/import/src/import-chrome.cpp | 365 + .../tracy/import/src/import-fuchsia.cpp | 692 + third_party/tracy/import/src/json.hpp | 24765 ++ third_party/tracy/manual/icons/lmb.pdf | Bin 0 -> 1214 bytes third_party/tracy/manual/icons/lmb.svg | 97 + third_party/tracy/manual/icons/mmb.pdf | Bin 0 -> 1177 bytes third_party/tracy/manual/icons/mmb.svg | 92 + third_party/tracy/manual/icons/mouse.svg | 92 + third_party/tracy/manual/icons/rmb.pdf | 74 + third_party/tracy/manual/icons/rmb.svg | 97 + third_party/tracy/manual/icons/scroll.pdf | 74 + third_party/tracy/manual/icons/scroll.svg | 154 + third_party/tracy/manual/images/ryzen.png | Bin 0 -> 808 bytes .../tracy/manual/images/screenshot-hi.png | Bin 0 -> 35843 bytes .../tracy/manual/images/screenshot-lo.png | Bin 0 -> 39167 bytes third_party/tracy/manual/techdoc.tex | 528 + third_party/tracy/manual/tracy.bib | 36 + third_party/tracy/manual/tracy.tex | 4724 + third_party/tracy/meson.build | 230 + third_party/tracy/meson.options | 27 + third_party/tracy/profiler/CMakeLists.txt | 233 + third_party/tracy/profiler/src/Backend.hpp | 34 + .../tracy/profiler/src/BackendEmscripten.cpp | 341 + .../tracy/profiler/src/BackendGlfw.cpp | 216 + .../tracy/profiler/src/BackendWayland.cpp | 1319 + .../tracy/profiler/src/ConnectionHistory.cpp | 87 + .../tracy/profiler/src/ConnectionHistory.hpp | 32 + third_party/tracy/profiler/src/Filters.cpp | 87 + third_party/tracy/profiler/src/Filters.hpp | 28 + third_party/tracy/profiler/src/Fonts.cpp | 59 + third_party/tracy/profiler/src/Fonts.hpp | 12 + .../tracy/profiler/src/HttpRequest.cpp | 134 + .../tracy/profiler/src/HttpRequest.hpp | 8 + .../tracy/profiler/src/ImGuiContext.cpp | 20 + .../tracy/profiler/src/ImGuiContext.hpp | 16 + third_party/tracy/profiler/src/IsElevated.cpp | 41 + third_party/tracy/profiler/src/IsElevated.hpp | 6 + .../tracy/profiler/src/ResolvService.cpp | 65 + .../tracy/profiler/src/ResolvService.hpp | 38 + third_party/tracy/profiler/src/RunQueue.cpp | 31 + third_party/tracy/profiler/src/RunQueue.hpp | 23 + .../tracy/profiler/src/WindowPosition.cpp | 48 + .../tracy/profiler/src/WindowPosition.hpp | 20 + .../tracy/profiler/src/font/DroidSans.hpp | 2821 + .../profiler/src/font/FiraCodeRetina.hpp | 3995 + .../profiler/src/font/FontAwesomeSolid.hpp | 12368 + third_party/tracy/profiler/src/icon.hpp | 25 + third_party/tracy/profiler/src/ini.c | 274 + third_party/tracy/profiler/src/ini.h | 28 + third_party/tracy/profiler/src/main.cpp | 1591 + .../profiler/src/profiler/IconsFontAwesome6.h | 1400 + .../src/profiler/TracyAchievementData.cpp | 202 + .../src/profiler/TracyAchievements.cpp | 225 + .../src/profiler/TracyAchievements.hpp | 82 + .../profiler/src/profiler/TracyBadVersion.cpp | 124 + .../profiler/src/profiler/TracyBadVersion.hpp | 39 + .../profiler/src/profiler/TracyBuzzAnim.hpp | 50 + .../profiler/src/profiler/TracyColor.cpp | 36 + .../profiler/src/profiler/TracyColor.hpp | 57 + .../profiler/src/profiler/TracyConfig.hpp | 29 + .../profiler/src/profiler/TracyDecayValue.hpp | 48 + .../profiler/src/profiler/TracyEventDebug.cpp | 361 + .../profiler/src/profiler/TracyEventDebug.hpp | 10 + .../src/profiler/TracyFileselector.cpp | 126 + .../src/profiler/TracyFileselector.hpp | 18 + .../profiler/src/profiler/TracyFilesystem.cpp | 19 + .../profiler/src/profiler/TracyFilesystem.hpp | 23 + .../profiler/src/profiler/TracyImGui.cpp | 130 + .../profiler/src/profiler/TracyImGui.hpp | 278 + .../src/profiler/TracyLockHelpers.hpp | 28 + .../src/profiler/TracyMicroArchitecture.cpp | 181051 +++++++++++++++ .../src/profiler/TracyMicroArchitecture.hpp | 46 + .../profiler/src/profiler/TracyMouse.cpp | 90 + .../profiler/src/profiler/TracyMouse.hpp | 21 + .../src/profiler/TracyProtoHistory.cpp | 31 + .../src/profiler/TracyProtoHistory.hpp | 20 + .../src/profiler/TracySourceContents.cpp | 106 + .../src/profiler/TracySourceContents.hpp | 51 + .../src/profiler/TracySourceTokenizer.cpp | 421 + .../src/profiler/TracySourceTokenizer.hpp | 72 + .../profiler/src/profiler/TracySourceView.cpp | 5753 + .../profiler/src/profiler/TracySourceView.hpp | 305 + .../profiler/src/profiler/TracyStorage.cpp | 211 + .../profiler/src/profiler/TracyStorage.hpp | 14 + .../profiler/src/profiler/TracyTexture.cpp | 187 + .../profiler/src/profiler/TracyTexture.hpp | 19 + .../src/profiler/TracyTimelineContext.hpp | 23 + .../src/profiler/TracyTimelineController.cpp | 177 + .../src/profiler/TracyTimelineController.hpp | 71 + .../src/profiler/TracyTimelineDraw.hpp | 105 + .../src/profiler/TracyTimelineItem.cpp | 168 + .../src/profiler/TracyTimelineItem.hpp | 77 + .../src/profiler/TracyTimelineItemCpuData.cpp | 259 + .../src/profiler/TracyTimelineItemCpuData.hpp | 47 + .../src/profiler/TracyTimelineItemGpu.cpp | 198 + .../src/profiler/TracyTimelineItemGpu.hpp | 40 + .../src/profiler/TracyTimelineItemPlot.cpp | 252 + .../src/profiler/TracyTimelineItemPlot.hpp | 44 + .../src/profiler/TracyTimelineItemThread.cpp | 1046 + .../src/profiler/TracyTimelineItemThread.hpp | 67 + .../profiler/src/profiler/TracyUserData.cpp | 389 + .../profiler/src/profiler/TracyUserData.hpp | 55 + .../profiler/src/profiler/TracyUtility.cpp | 190 + .../profiler/src/profiler/TracyUtility.hpp | 34 + .../tracy/profiler/src/profiler/TracyView.cpp | 1465 + .../tracy/profiler/src/profiler/TracyView.hpp | 943 + .../profiler/src/profiler/TracyViewData.hpp | 82 + .../src/profiler/TracyView_Annotations.cpp | 158 + .../src/profiler/TracyView_Callstack.cpp | 578 + .../src/profiler/TracyView_Compare.cpp | 1331 + .../profiler/TracyView_ConnectionState.cpp | 249 + .../src/profiler/TracyView_ContextSwitch.cpp | 632 + .../src/profiler/TracyView_CpuData.cpp | 889 + .../src/profiler/TracyView_FindZone.cpp | 2036 + .../src/profiler/TracyView_FlameGraph.cpp | 967 + .../src/profiler/TracyView_FrameOverview.cpp | 452 + .../src/profiler/TracyView_FrameTimeline.cpp | 336 + .../src/profiler/TracyView_FrameTree.cpp | 875 + .../src/profiler/TracyView_GpuTimeline.cpp | 368 + .../profiler/src/profiler/TracyView_Locks.cpp | 660 + .../src/profiler/TracyView_Memory.cpp | 931 + .../src/profiler/TracyView_Messages.cpp | 336 + .../src/profiler/TracyView_Navigation.cpp | 152 + .../profiler/TracyView_NotificationArea.cpp | 272 + .../src/profiler/TracyView_Options.cpp | 829 + .../src/profiler/TracyView_Playback.cpp | 218 + .../profiler/src/profiler/TracyView_Plots.cpp | 386 + .../src/profiler/TracyView_Ranges.cpp | 178 + .../src/profiler/TracyView_Samples.cpp | 1275 + .../src/profiler/TracyView_Statistics.cpp | 986 + .../src/profiler/TracyView_Timeline.cpp | 561 + .../src/profiler/TracyView_TraceInfo.cpp | 978 + .../src/profiler/TracyView_Utility.cpp | 936 + .../src/profiler/TracyView_ZoneInfo.cpp | 2052 + .../src/profiler/TracyView_ZoneTimeline.cpp | 617 + .../tracy/profiler/src/profiler/TracyWeb.cpp | 33 + .../tracy/profiler/src/profiler/TracyWeb.hpp | 11 + third_party/tracy/profiler/src/stb_image.h | 7985 + .../tracy/profiler/src/stb_image_resize.h | 2634 + third_party/tracy/profiler/src/winmain.cpp | 48 + .../profiler/src/winmainArchDiscovery.cpp | 22 + third_party/tracy/profiler/src/zigzag01.hpp | 10 + third_party/tracy/profiler/src/zigzag02.hpp | 10 + third_party/tracy/profiler/src/zigzag04.hpp | 11 + third_party/tracy/profiler/src/zigzag08.hpp | 11 + third_party/tracy/profiler/src/zigzag16.hpp | 12 + third_party/tracy/profiler/src/zigzag32.hpp | 13 + third_party/tracy/profiler/wasm/httpd.py | 17 + third_party/tracy/profiler/wasm/index.html | 154 + .../tracy/profiler/win32/Tracy.manifest | 8 + third_party/tracy/profiler/win32/Tracy.rc | 1 + third_party/tracy/public/TracyClient.F90 | 1292 + third_party/tracy/public/TracyClient.cpp | 61 + .../tracy/public/client/TracyAlloc.cpp | 43 + .../tracy/public/client/TracyArmCpuTable.hpp | 419 + .../tracy/public/client/TracyCallstack.cpp | 1420 + .../tracy/public/client/TracyCallstack.h | 35 + .../tracy/public/client/TracyCallstack.hpp | 155 + .../tracy/public/client/TracyCpuid.hpp | 12 + .../tracy/public/client/TracyDebug.hpp | 11 + third_party/tracy/public/client/TracyDxt1.cpp | 644 + third_party/tracy/public/client/TracyDxt1.hpp | 11 + .../tracy/public/client/TracyFastVector.hpp | 118 + .../tracy/public/client/TracyKCore.cpp | 121 + .../tracy/public/client/TracyKCore.hpp | 37 + third_party/tracy/public/client/TracyLock.hpp | 546 + .../tracy/public/client/TracyOverride.cpp | 26 + .../tracy/public/client/TracyProfiler.cpp | 5007 + .../tracy/public/client/TracyProfiler.hpp | 1089 + .../tracy/public/client/TracyRingBuffer.hpp | 141 + .../tracy/public/client/TracyScoped.hpp | 201 + .../public/client/TracyStringHelpers.hpp | 41 + .../tracy/public/client/TracySysPower.cpp | 164 + .../tracy/public/client/TracySysPower.hpp | 44 + .../tracy/public/client/TracySysTime.cpp | 108 + .../tracy/public/client/TracySysTime.hpp | 36 + .../tracy/public/client/TracySysTrace.cpp | 1646 + .../tracy/public/client/TracySysTrace.hpp | 28 + .../tracy/public/client/TracyThread.hpp | 90 + .../tracy/public/client/tracy_SPSCQueue.h | 148 + .../public/client/tracy_concurrentqueue.h | 1441 + .../tracy/public/client/tracy_rpmalloc.cpp | 3519 + .../tracy/public/client/tracy_rpmalloc.hpp | 363 + .../tracy/public/common/TracyAlign.hpp | 27 + .../tracy/public/common/TracyAlloc.hpp | 72 + third_party/tracy/public/common/TracyApi.h | 16 + .../tracy/public/common/TracyColor.hpp | 690 + .../tracy/public/common/TracyForceInline.hpp | 20 + .../tracy/public/common/TracyMutex.hpp | 24 + .../tracy/public/common/TracyProtocol.hpp | 169 + .../tracy/public/common/TracyQueue.hpp | 926 + .../tracy/public/common/TracySocket.cpp | 752 + .../tracy/public/common/TracySocket.hpp | 155 + .../tracy/public/common/TracyStackFrames.cpp | 122 + .../tracy/public/common/TracyStackFrames.hpp | 22 + .../tracy/public/common/TracySystem.cpp | 349 + .../tracy/public/common/TracySystem.hpp | 43 + third_party/tracy/public/common/TracyUwp.hpp | 11 + .../tracy/public/common/TracyVersion.hpp | 14 + .../tracy/public/common/TracyYield.hpp | 28 + third_party/tracy/public/common/tracy_lz4.cpp | 2720 + third_party/tracy/public/common/tracy_lz4.hpp | 847 + .../tracy/public/common/tracy_lz4hc.cpp | 1636 + .../tracy/public/common/tracy_lz4hc.hpp | 405 + third_party/tracy/public/libbacktrace/LICENSE | 29 + .../tracy/public/libbacktrace/alloc.cpp | 174 + .../tracy/public/libbacktrace/backtrace.hpp | 186 + .../tracy/public/libbacktrace/config.h | 26 + .../tracy/public/libbacktrace/dwarf.cpp | 4455 + third_party/tracy/public/libbacktrace/elf.cpp | 7605 + .../tracy/public/libbacktrace/fileline.cpp | 412 + .../tracy/public/libbacktrace/filenames.hpp | 52 + .../tracy/public/libbacktrace/internal.hpp | 435 + .../tracy/public/libbacktrace/macho.cpp | 1367 + .../tracy/public/libbacktrace/mmapio.cpp | 115 + .../tracy/public/libbacktrace/posix.cpp | 109 + .../tracy/public/libbacktrace/sort.cpp | 113 + .../tracy/public/libbacktrace/state.cpp | 76 + third_party/tracy/public/tracy/Tracy.hpp | 254 + third_party/tracy/public/tracy/TracyC.h | 384 + third_party/tracy/public/tracy/TracyCUDA.hpp | 1325 + third_party/tracy/public/tracy/TracyD3D11.hpp | 466 + third_party/tracy/public/tracy/TracyD3D12.hpp | 500 + third_party/tracy/public/tracy/TracyLua.hpp | 486 + third_party/tracy/public/tracy/TracyMetal.hmm | 644 + .../tracy/public/tracy/TracyOpenCL.hpp | 414 + .../tracy/public/tracy/TracyOpenGL.hpp | 325 + .../tracy/public/tracy/TracyVulkan.hpp | 741 + third_party/tracy/python/.gitignore | 8 + third_party/tracy/python/CMakeLists.txt | 63 + third_party/tracy/python/HeaderFixer.txt | 16 + third_party/tracy/python/bindings/Memory.hpp | 90 + third_party/tracy/python/bindings/Module.cpp | 870 + .../tracy/python/bindings/NameBuffer.hpp | 59 + .../tracy/python/bindings/ScopedZone.hpp | 120 + third_party/tracy/python/setup.py | 57 + .../tracy_client/TracyClientBindings.pyi | 3526 + .../tracy/python/tracy_client/__init__.py | 3 + .../tracy/python/tracy_client/py.typed | 0 .../tracy/python/tracy_client/scoped.py | 119 + .../tracy/python/tracy_client/tracy.py | 36 + third_party/tracy/server/TracyCharUtil.hpp | 76 + third_party/tracy/server/TracyEvent.hpp | 921 + third_party/tracy/server/TracyFileHeader.hpp | 22 + third_party/tracy/server/TracyFileMeta.hpp | 18 + third_party/tracy/server/TracyFileRead.hpp | 600 + third_party/tracy/server/TracyFileWrite.hpp | 303 + third_party/tracy/server/TracyMemory.cpp | 8 + third_party/tracy/server/TracyMemory.hpp | 14 + third_party/tracy/server/TracyMmap.cpp | 38 + third_party/tracy/server/TracyMmap.hpp | 19 + third_party/tracy/server/TracyPopcnt.hpp | 40 + third_party/tracy/server/TracyPrint.cpp | 464 + third_party/tracy/server/TracyPrint.hpp | 152 + third_party/tracy/server/TracyShortPtr.hpp | 82 + third_party/tracy/server/TracySlab.hpp | 159 + third_party/tracy/server/TracySort.hpp | 10 + .../tracy/server/TracySortedVector.hpp | 127 + .../tracy/server/TracyStringDiscovery.hpp | 88 + third_party/tracy/server/TracySysUtil.cpp | 43 + third_party/tracy/server/TracySysUtil.hpp | 13 + .../tracy/server/TracyTaskDispatch.cpp | 88 + .../tracy/server/TracyTaskDispatch.hpp | 40 + .../tracy/server/TracyTextureCompression.cpp | 211 + .../tracy/server/TracyTextureCompression.hpp | 64 + .../tracy/server/TracyThreadCompress.cpp | 72 + .../tracy/server/TracyThreadCompress.hpp | 61 + third_party/tracy/server/TracyVarArray.hpp | 97 + third_party/tracy/server/TracyVector.hpp | 357 + third_party/tracy/server/TracyWorker.cpp | 8681 + third_party/tracy/server/TracyWorker.hpp | 1112 + third_party/tracy/server/tracy_pdqsort.h | 524 + third_party/tracy/server/tracy_robin_hood.h | 2538 + third_party/tracy/server/tracy_xxhash.h | 6773 + third_party/tracy/test/CMakeLists.txt | 31 + third_party/tracy/test/image.jpg | Bin 0 -> 14412 bytes third_party/tracy/test/stb_image.h | 7987 + third_party/tracy/test/test.cpp | 415 + third_party/tracy/update/CMakeLists.txt | 30 + .../update/src/OfflineSymbolResolver.cpp | 171 + .../tracy/update/src/OfflineSymbolResolver.h | 40 + .../src/OfflineSymbolResolverAddr2Line.cpp | 159 + .../src/OfflineSymbolResolverDbgHelper.cpp | 132 + third_party/tracy/update/src/update.cpp | 239 + third_party/zlib-ng/.codecov.yaml | 27 + third_party/zlib-ng/.shellcheckrc | 1 + third_party/zlib-ng/CMakeLists.txt | 1435 + third_party/zlib-ng/FAQ.zlib | 373 + third_party/zlib-ng/INDEX.md | 36 + third_party/zlib-ng/LICENSE.md | 19 + third_party/zlib-ng/Makefile.in | 407 + third_party/zlib-ng/PORTING.md | 111 + third_party/zlib-ng/README.md | 228 + third_party/zlib-ng/adler32.c | 69 + third_party/zlib-ng/adler32_p.h | 70 + third_party/zlib-ng/arch/arm/Makefile.in | 78 + third_party/zlib-ng/arch/arm/acle_intrins.h | 35 + third_party/zlib-ng/arch/arm/adler32_neon.c | 215 + third_party/zlib-ng/arch/arm/arm_features.c | 115 + third_party/zlib-ng/arch/arm/arm_features.h | 16 + third_party/zlib-ng/arch/arm/arm_functions.h | 65 + third_party/zlib-ng/arch/arm/chunkset_neon.c | 94 + .../zlib-ng/arch/arm/compare256_neon.c | 60 + third_party/zlib-ng/arch/arm/crc32_acle.c | 76 + third_party/zlib-ng/arch/arm/neon_intrins.h | 65 + .../zlib-ng/arch/arm/slide_hash_armv6.c | 48 + .../zlib-ng/arch/arm/slide_hash_neon.c | 47 + third_party/zlib-ng/arch/generic/Makefile.in | 75 + third_party/zlib-ng/arch/generic/adler32_c.c | 54 + .../zlib-ng/arch/generic/adler32_fold_c.c | 15 + .../arch/generic/chunk_permute_table.h | 53 + third_party/zlib-ng/arch/generic/chunkset_c.c | 42 + .../zlib-ng/arch/generic/compare256_c.c | 31 + .../zlib-ng/arch/generic/compare256_p.h | 123 + .../zlib-ng/arch/generic/crc32_braid_c.c | 216 + .../zlib-ng/arch/generic/crc32_fold_c.c | 31 + .../zlib-ng/arch/generic/generic_functions.h | 57 + .../zlib-ng/arch/generic/slide_hash_c.c | 52 + third_party/zlib-ng/arch/power/Makefile.in | 93 + .../zlib-ng/arch/power/adler32_power8.c | 153 + third_party/zlib-ng/arch/power/adler32_vmx.c | 186 + .../zlib-ng/arch/power/chunkset_power8.c | 50 + .../zlib-ng/arch/power/compare256_power9.c | 66 + .../zlib-ng/arch/power/crc32_constants.h | 1123 + third_party/zlib-ng/arch/power/crc32_power8.c | 587 + .../zlib-ng/arch/power/power_features.c | 49 + .../zlib-ng/arch/power/power_features.h | 18 + .../zlib-ng/arch/power/power_functions.h | 67 + .../zlib-ng/arch/power/power_intrins.h | 34 + .../zlib-ng/arch/power/slide_hash_power8.c | 12 + .../zlib-ng/arch/power/slide_hash_vmx.c | 10 + .../zlib-ng/arch/power/slide_ppc_tpl.h | 32 + third_party/zlib-ng/arch/riscv/README.md | 45 + third_party/zlib-ng/arch/riscv/adler32_rvv.c | 136 + third_party/zlib-ng/arch/riscv/chunkset_rvv.c | 121 + .../zlib-ng/arch/riscv/compare256_rvv.c | 49 + .../zlib-ng/arch/riscv/riscv_features.c | 71 + .../zlib-ng/arch/riscv/riscv_features.h | 18 + .../zlib-ng/arch/riscv/riscv_functions.h | 49 + .../zlib-ng/arch/riscv/slide_hash_rvv.c | 33 + third_party/zlib-ng/arch/s390/Makefile.in | 48 + third_party/zlib-ng/arch/s390/README.md | 265 + third_party/zlib-ng/arch/s390/crc32-vx.c | 222 + third_party/zlib-ng/arch/s390/dfltcc_common.h | 119 + .../zlib-ng/arch/s390/dfltcc_deflate.c | 383 + .../zlib-ng/arch/s390/dfltcc_deflate.h | 58 + third_party/zlib-ng/arch/s390/dfltcc_detail.h | 275 + .../zlib-ng/arch/s390/dfltcc_inflate.c | 191 + .../zlib-ng/arch/s390/dfltcc_inflate.h | 67 + third_party/zlib-ng/arch/s390/s390_features.c | 14 + third_party/zlib-ng/arch/s390/s390_features.h | 14 + .../zlib-ng/arch/s390/s390_functions.h | 27 + .../s390/self-hosted-builder/actions-runner | 59 + .../actions-runner-rebuild.sh | 54 + .../actions-runner.Dockerfile | 54 + .../actions-runner.service | 18 + .../arch/s390/self-hosted-builder/entrypoint | 30 + third_party/zlib-ng/arch/x86/Makefile.in | 147 + third_party/zlib-ng/arch/x86/adler32_avx2.c | 145 + third_party/zlib-ng/arch/x86/adler32_avx2_p.h | 32 + third_party/zlib-ng/arch/x86/adler32_avx512.c | 108 + .../zlib-ng/arch/x86/adler32_avx512_p.h | 57 + .../zlib-ng/arch/x86/adler32_avx512_vnni.c | 210 + third_party/zlib-ng/arch/x86/adler32_sse42.c | 120 + third_party/zlib-ng/arch/x86/adler32_ssse3.c | 156 + .../zlib-ng/arch/x86/adler32_ssse3_p.h | 29 + third_party/zlib-ng/arch/x86/avx2_tables.h | 44 + third_party/zlib-ng/arch/x86/chunkset_avx2.c | 130 + .../zlib-ng/arch/x86/chunkset_avx512.c | 182 + third_party/zlib-ng/arch/x86/chunkset_sse2.c | 49 + third_party/zlib-ng/arch/x86/chunkset_ssse3.c | 86 + .../zlib-ng/arch/x86/compare256_avx2.c | 64 + .../zlib-ng/arch/x86/compare256_sse2.c | 97 + .../arch/x86/crc32_fold_pclmulqdq_tpl.h | 199 + .../arch/x86/crc32_fold_vpclmulqdq_tpl.h | 107 + .../zlib-ng/arch/x86/crc32_pclmulqdq.c | 30 + .../zlib-ng/arch/x86/crc32_pclmulqdq_tpl.h | 375 + .../zlib-ng/arch/x86/crc32_vpclmulqdq.c | 17 + .../zlib-ng/arch/x86/slide_hash_avx2.c | 40 + .../zlib-ng/arch/x86/slide_hash_sse2.c | 63 + third_party/zlib-ng/arch/x86/x86_features.c | 117 + third_party/zlib-ng/arch/x86/x86_features.h | 29 + third_party/zlib-ng/arch/x86/x86_functions.h | 181 + third_party/zlib-ng/arch/x86/x86_intrins.h | 92 + third_party/zlib-ng/arch_functions.h | 29 + third_party/zlib-ng/chunkset_tpl.h | 283 + third_party/zlib-ng/cmake/detect-arch.c | 115 + third_party/zlib-ng/cmake/detect-arch.cmake | 104 + .../zlib-ng/cmake/detect-coverage.cmake | 46 + .../zlib-ng/cmake/detect-install-dirs.cmake | 43 + .../zlib-ng/cmake/detect-intrinsics.cmake | 604 + .../zlib-ng/cmake/detect-sanitizer.cmake | 157 + .../zlib-ng/cmake/fallback-macros.cmake | 19 + .../zlib-ng/cmake/toolchain-aarch64.cmake | 24 + third_party/zlib-ng/cmake/toolchain-arm.cmake | 29 + .../zlib-ng/cmake/toolchain-armhf.cmake | 25 + .../cmake/toolchain-llvm-mingw-aarch64.cmake | 41 + .../cmake/toolchain-llvm-mingw-armv7.cmake | 41 + .../cmake/toolchain-llvm-mingw-i686.cmake | 41 + .../cmake/toolchain-llvm-mingw-x86_64.cmake | 41 + .../zlib-ng/cmake/toolchain-mingw-i686.cmake | 35 + .../cmake/toolchain-mingw-x86_64.cmake | 34 + .../zlib-ng/cmake/toolchain-mips.cmake | 29 + .../zlib-ng/cmake/toolchain-mips64.cmake | 29 + .../zlib-ng/cmake/toolchain-powerpc.cmake | 25 + .../cmake/toolchain-powerpc64-clang.cmake | 16 + .../cmake/toolchain-powerpc64-power9.cmake | 25 + .../zlib-ng/cmake/toolchain-powerpc64.cmake | 25 + .../cmake/toolchain-powerpc64le-clang.cmake | 16 + .../cmake/toolchain-powerpc64le-power9.cmake | 25 + .../zlib-ng/cmake/toolchain-powerpc64le.cmake | 25 + .../zlib-ng/cmake/toolchain-riscv.cmake | 28 + .../zlib-ng/cmake/toolchain-s390x.cmake | 25 + .../zlib-ng/cmake/toolchain-sparc64.cmake | 25 + third_party/zlib-ng/compare256_rle.h | 133 + third_party/zlib-ng/compress.c | 98 + third_party/zlib-ng/configure | 2218 + third_party/zlib-ng/cpu_features.c | 23 + third_party/zlib-ng/cpu_features.h | 43 + third_party/zlib-ng/crc32.c | 42 + third_party/zlib-ng/crc32.h | 16 + third_party/zlib-ng/crc32_braid_comb.c | 56 + third_party/zlib-ng/crc32_braid_comb_p.h | 42 + third_party/zlib-ng/crc32_braid_p.h | 64 + third_party/zlib-ng/crc32_braid_tbl.h | 9446 + third_party/zlib-ng/deflate.c | 1513 + third_party/zlib-ng/deflate.h | 456 + third_party/zlib-ng/deflate_fast.c | 104 + third_party/zlib-ng/deflate_huff.c | 45 + third_party/zlib-ng/deflate_medium.c | 278 + third_party/zlib-ng/deflate_p.h | 128 + third_party/zlib-ng/deflate_quick.c | 130 + third_party/zlib-ng/deflate_rle.c | 84 + third_party/zlib-ng/deflate_slow.c | 144 + third_party/zlib-ng/deflate_stored.c | 186 + third_party/zlib-ng/doc/algorithm.txt | 209 + third_party/zlib-ng/doc/crc-doc.1.0.pdf | Bin 0 -> 776142 bytes third_party/zlib-ng/doc/crc-pclmulqdq.pdf | Bin 0 -> 384202 bytes third_party/zlib-ng/doc/rfc1950.txt | 619 + third_party/zlib-ng/doc/rfc1951.txt | 955 + third_party/zlib-ng/doc/rfc1952.txt | 675 + third_party/zlib-ng/doc/txtvsbin.txt | 107 + third_party/zlib-ng/fallback_builtins.h | 47 + third_party/zlib-ng/functable.c | 362 + third_party/zlib-ng/functable.h | 55 + third_party/zlib-ng/gzguts.h | 146 + third_party/zlib-ng/gzlib.c | 531 + third_party/zlib-ng/gzread.c.in | 606 + third_party/zlib-ng/gzwrite.c | 526 + third_party/zlib-ng/infback.c | 523 + third_party/zlib-ng/inffast_tpl.h | 332 + third_party/zlib-ng/inffixed_tbl.h | 94 + third_party/zlib-ng/inflate.c | 1462 + third_party/zlib-ng/inflate.h | 172 + third_party/zlib-ng/inflate_p.h | 215 + third_party/zlib-ng/inftrees.c | 295 + third_party/zlib-ng/inftrees.h | 66 + third_party/zlib-ng/insert_string.c | 21 + third_party/zlib-ng/insert_string_roll.c | 24 + third_party/zlib-ng/insert_string_tpl.h | 106 + third_party/zlib-ng/match_tpl.h | 250 + third_party/zlib-ng/test/CMakeLists.txt | 262 + .../zlib-ng/test/CVE-2002-0059/test.gz | Bin 0 -> 4610 bytes .../zlib-ng/test/CVE-2004-0797/test.gz | Bin 0 -> 52 bytes .../zlib-ng/test/CVE-2005-1849/test.gz | Bin 0 -> 52 bytes .../zlib-ng/test/CVE-2005-2096/test.gz | Bin 0 -> 52 bytes .../zlib-ng/test/CVE-2018-25032/default.txt | 1 + .../zlib-ng/test/CVE-2018-25032/fixed.txt | 1 + third_party/zlib-ng/test/GH-1600/packobj.gz | Bin 0 -> 46 bytes third_party/zlib-ng/test/GH-361/test.txt | 4 + third_party/zlib-ng/test/GH-364/test.bin | Bin 0 -> 8 bytes third_party/zlib-ng/test/GH-382/defneg3.dat | 1 + third_party/zlib-ng/test/GH-751/test.txt | 1 + .../zlib-ng/test/GH-979/pigz-2.6.tar.gz | Bin 0 -> 106840 bytes third_party/zlib-ng/test/Makefile.in | 82 + third_party/zlib-ng/test/README.md | 37 + third_party/zlib-ng/test/abi/ignore | 12 + ...c2a18c1281fc-aarch64-unknown-linux-gnu.abi | 1293 + ...c2a18c1281fc-arm-unknown-linux-gnueabi.abi | 1276 + ...a18c1281fc-arm-unknown-linux-gnueabihf.abi | 1276 + ...806c2a18c1281fc-mips-unknown-linux-gnu.abi | 1271 + ...8c1281fc-mips64-unknown-linux-gnuabi64.abi | 1276 + ...c2a18c1281fc-powerpc-unknown-linux-gnu.abi | 1286 + ...a18c1281fc-powerpc64-unknown-linux-gnu.abi | 1275 + ...8c1281fc-powerpc64le-unknown-linux-gnu.abi | 1275 + ...06c2a18c1281fc-x86_64-pc-linux-gnu-m32.abi | 1270 + ...e93806c2a18c1281fc-x86_64-pc-linux-gnu.abi | 1288 + ...4baf80882311-aarch64-unknown-linux-gnu.abi | 1904 + ...4baf80882311-arm-unknown-linux-gnueabi.abi | 1889 + ...af80882311-arm-unknown-linux-gnueabihf.abi | 1881 + ...55e4baf80882311-mips-unknown-linux-gnu.abi | 1241 + ...80882311-mips64-unknown-linux-gnuabi64.abi | 1250 + ...4baf80882311-powerpc-unknown-linux-gnu.abi | 1895 + ...af80882311-powerpc64-unknown-linux-gnu.abi | 1894 + ...80882311-powerpc64le-unknown-linux-gnu.abi | 1886 + ...5e4baf80882311-x86_64-pc-linux-gnu-m32.abi | 2032 + ...3c155e4baf80882311-x86_64-pc-linux-gnu.abi | 2064 + third_party/zlib-ng/test/abicheck.md | 59 + third_party/zlib-ng/test/abicheck.sh | 163 + .../add-subdirectory-project/CMakeLists.txt | 13 + .../test/add-subdirectory-project/main.c | 7 + .../zlib-ng/test/benchmarks/CMakeLists.txt | 116 + third_party/zlib-ng/test/benchmarks/README.md | 47 + .../test/benchmarks/benchmark_adler32.cc | 100 + .../test/benchmarks/benchmark_adler32_copy.cc | 130 + .../test/benchmarks/benchmark_compare256.cc | 93 + .../benchmarks/benchmark_compare256_rle.cc | 69 + .../test/benchmarks/benchmark_compress.cc | 67 + .../test/benchmarks/benchmark_crc32.cc | 83 + .../zlib-ng/test/benchmarks/benchmark_main.cc | 32 + .../test/benchmarks/benchmark_png_decode.cc | 126 + .../test/benchmarks/benchmark_png_encode.cc | 54 + .../test/benchmarks/benchmark_png_shared.h | 146 + .../test/benchmarks/benchmark_slidehash.cc | 98 + .../test/benchmarks/benchmark_uncompress.cc | 94 + .../test/cmake/compress-and-verify.cmake | 287 + .../zlib-ng/test/cmake/run-and-compare.cmake | 72 + .../zlib-ng/test/cmake/run-and-redirect.cmake | 54 + .../zlib-ng/test/cmake/test-cves.cmake | 33 + .../zlib-ng/test/cmake/test-data.cmake | 68 + .../zlib-ng/test/cmake/test-issues.cmake | 84 + .../zlib-ng/test/cmake/test-tools.cmake | 80 + third_party/zlib-ng/test/data/fireworks.jpg | Bin 0 -> 123093 bytes third_party/zlib-ng/test/data/lcet10.txt | 7519 + third_party/zlib-ng/test/data/paper-100k.pdf | 598 + third_party/zlib-ng/test/example.c | 1002 + third_party/zlib-ng/test/fuzz/CMakeLists.txt | 49 + .../zlib-ng/test/fuzz/fuzzer_checksum.c | 81 + .../zlib-ng/test/fuzz/fuzzer_compress.c | 82 + .../zlib-ng/test/fuzz/fuzzer_example_dict.c | 164 + .../zlib-ng/test/fuzz/fuzzer_example_flush.c | 119 + .../zlib-ng/test/fuzz/fuzzer_example_large.c | 137 + .../zlib-ng/test/fuzz/fuzzer_example_small.c | 118 + .../zlib-ng/test/fuzz/fuzzer_minigzip.c | 316 + .../test/fuzz/standalone_fuzz_target_runner.c | 37 + third_party/zlib-ng/test/gh1235.c | 39 + third_party/zlib-ng/test/infcover.c | 679 + third_party/zlib-ng/test/minideflate.c | 367 + third_party/zlib-ng/test/minigzip.c | 367 + third_party/zlib-ng/test/pigz/CMakeLists.txt | 211 + third_party/zlib-ng/test/pkgcheck.sh | 180 + third_party/zlib-ng/test/switchlevels.c | 167 + third_party/zlib-ng/test/test_adler32.cc | 395 + third_party/zlib-ng/test/test_compare256.cc | 92 + .../zlib-ng/test/test_compare256_rle.cc | 60 + third_party/zlib-ng/test/test_compress.cc | 33 + .../zlib-ng/test/test_compress_bound.cc | 59 + .../zlib-ng/test/test_compress_dual.cc | 28 + third_party/zlib-ng/test/test_cpu_features.h | 12 + third_party/zlib-ng/test/test_crc32.cc | 265 + .../zlib-ng/test/test_cve-2003-0107.cc | 28 + .../zlib-ng/test/test_deflate_bound.cc | 99 + .../zlib-ng/test/test_deflate_concurrency.cc | 170 + third_party/zlib-ng/test/test_deflate_copy.cc | 60 + third_party/zlib-ng/test/test_deflate_dict.cc | 54 + .../zlib-ng/test/test_deflate_hash_head_0.cc | 83 + .../zlib-ng/test/test_deflate_header.cc | 71 + .../zlib-ng/test/test_deflate_params.cc | 143 + .../zlib-ng/test/test_deflate_pending.cc | 66 + .../zlib-ng/test/test_deflate_prime.cc | 91 + .../test/test_deflate_quick_bi_valid.cc | 80 + .../test/test_deflate_quick_block_open.cc | 94 + third_party/zlib-ng/test/test_deflate_tune.cc | 56 + third_party/zlib-ng/test/test_dict.cc | 98 + third_party/zlib-ng/test/test_gzio.cc | 106 + .../zlib-ng/test/test_inflate_adler32.cc | 50 + third_party/zlib-ng/test/test_inflate_copy.cc | 31 + third_party/zlib-ng/test/test_inflate_sync.cc | 75 + .../zlib-ng/test/test_large_buffers.cc | 87 + third_party/zlib-ng/test/test_main.cc | 22 + third_party/zlib-ng/test/test_raw.cc | 58 + third_party/zlib-ng/test/test_shared.h | 18 + third_party/zlib-ng/test/test_shared_ng.h | 23 + .../zlib-ng/test/test_small_buffers.cc | 69 + third_party/zlib-ng/test/test_small_window.cc | 67 + third_party/zlib-ng/test/test_version.cc | 27 + third_party/zlib-ng/tools/config.sub | 17 + third_party/zlib-ng/tools/makecrct.c | 244 + third_party/zlib-ng/tools/makefixed.c | 89 + third_party/zlib-ng/tools/maketrees.c | 147 + third_party/zlib-ng/trees.c | 818 + third_party/zlib-ng/trees.h | 40 + third_party/zlib-ng/trees_emit.h | 231 + third_party/zlib-ng/trees_tbl.h | 132 + third_party/zlib-ng/uncompr.c | 80 + third_party/zlib-ng/win32/Makefile.a64 | 252 + third_party/zlib-ng/win32/Makefile.arm | 272 + third_party/zlib-ng/win32/Makefile.msc | 292 + third_party/zlib-ng/win32/depcheck.cpp | 321 + third_party/zlib-ng/win32/replace.vbs | 15 + third_party/zlib-ng/win32/zlib-ng.def.in | 60 + third_party/zlib-ng/win32/zlib-ng1.rc | 36 + third_party/zlib-ng/win32/zlib.def.in | 64 + third_party/zlib-ng/win32/zlib1.rc | 36 + third_party/zlib-ng/win32/zlibcompat.def.in | 97 + third_party/zlib-ng/zbuild.h | 343 + third_party/zlib-ng/zconf-ng.h.in | 176 + third_party/zlib-ng/zconf.h.in | 206 + third_party/zlib-ng/zendian.h | 60 + third_party/zlib-ng/zlib-config.cmake.in | 12 + third_party/zlib-ng/zlib-ng-config.cmake.in | 10 + third_party/zlib-ng/zlib-ng.h.in | 1871 + third_party/zlib-ng/zlib-ng.map | 111 + third_party/zlib-ng/zlib.h.in | 1859 + third_party/zlib-ng/zlib.map | 98 + third_party/zlib-ng/zlib.pc.cmakein | 14 + third_party/zlib-ng/zlib.pc.in | 14 + .../zlib-ng/zlib_name_mangling-ng.h.in | 178 + .../zlib-ng/zlib_name_mangling.h.empty | 8 + third_party/zlib-ng/zlib_name_mangling.h.in | 170 + third_party/zlib-ng/zmemory.h | 99 + third_party/zlib-ng/zutil.c | 111 + third_party/zlib-ng/zutil.h | 140 + third_party/zlib-ng/zutil_p.h | 46 + 728 files changed, 489652 insertions(+), 1211 deletions(-) create mode 100644 examples/tracy_demo.cc create mode 100644 third_party/breakpad/src/common/linux/include/asm-mips/README.md create mode 100644 third_party/breakpad/src/common/linux/include/asm-mips/asm.h create mode 100644 third_party/breakpad/src/common/linux/include/asm-mips/fpregdef.h create mode 100644 third_party/breakpad/src/common/linux/include/asm-mips/regdef.h create mode 100644 third_party/breakpad/src/third_party/miniz/miniz.c create mode 100644 third_party/breakpad/src/third_party/miniz/miniz.h create mode 100644 third_party/tracy/.clang-format create mode 100644 third_party/tracy/.clang-tidy create mode 100644 third_party/tracy/.github/FUNDING.yml create mode 100644 third_party/tracy/.github/sponsor.png create mode 100644 third_party/tracy/.github/workflows/build.yml create mode 100644 third_party/tracy/.github/workflows/emscripten.yml create mode 100644 third_party/tracy/.github/workflows/latex.yml create mode 100644 third_party/tracy/.github/workflows/linux.yml create mode 100644 third_party/tracy/.gitignore create mode 100644 third_party/tracy/.mailmap create mode 100644 third_party/tracy/.vscode/extensions.json create mode 100644 third_party/tracy/.vscode/launch.json create mode 100644 third_party/tracy/.vscode/settings.json create mode 100644 third_party/tracy/CMakeLists.txt create mode 100644 third_party/tracy/Config.cmake.in create mode 100644 third_party/tracy/LICENSE create mode 100644 third_party/tracy/NEWS create mode 100644 third_party/tracy/README.md create mode 100644 third_party/tracy/capture/CMakeLists.txt create mode 100644 third_party/tracy/capture/src/capture.cpp create mode 100644 third_party/tracy/cmake/CPM.cmake create mode 100644 third_party/tracy/cmake/ECMFindModuleHelpers.cmake create mode 100644 third_party/tracy/cmake/FindWaylandScanner.cmake create mode 100644 third_party/tracy/cmake/config.cmake create mode 100644 third_party/tracy/cmake/gl3w-extra-symbols.patch create mode 100644 third_party/tracy/cmake/imgui-emscripten.patch create mode 100644 third_party/tracy/cmake/imgui-loader.patch create mode 100644 third_party/tracy/cmake/ppqsort-nodebug.patch create mode 100644 third_party/tracy/cmake/server.cmake create mode 100644 third_party/tracy/cmake/vendor.cmake create mode 100644 third_party/tracy/cmake/version.cmake create mode 100644 third_party/tracy/csvexport/CMakeLists.txt create mode 100644 third_party/tracy/csvexport/src/csvexport.cpp create mode 100644 third_party/tracy/doc/profiler.png create mode 100644 third_party/tracy/doc/profiler2.png create mode 100644 third_party/tracy/doc/profiler3.png create mode 100644 third_party/tracy/dtl/Diff.hpp create mode 100644 third_party/tracy/dtl/Diff3.hpp create mode 100644 third_party/tracy/dtl/Lcs.hpp create mode 100644 third_party/tracy/dtl/Sequence.hpp create mode 100644 third_party/tracy/dtl/Ses.hpp create mode 100644 third_party/tracy/dtl/dtl.hpp create mode 100644 third_party/tracy/dtl/functors.hpp create mode 100644 third_party/tracy/dtl/variables.hpp create mode 100644 third_party/tracy/examples/OpenCLVectorAdd/CMakeLists.txt create mode 100644 third_party/tracy/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp create mode 100644 third_party/tracy/examples/ToyPathTracer/.gitignore create mode 100644 third_party/tracy/examples/ToyPathTracer/README create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/Config.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/MathSimd.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/Maths.cpp create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/Maths.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/Test.cpp create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/Test.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/Atomics.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/LockLessMultiReadPipe.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/TaskScheduler.cpp create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/TaskScheduler.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/TaskScheduler_c.cpp create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/TaskScheduler_c.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Source/enkiTS/Threads.h create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/ComputeShader.hlsl create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/PixelShader.hlsl create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/TestCpu.sln create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/TestCpu.vcxproj create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/TestCpu.vcxproj.filters create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/TestWin.cpp create mode 100644 third_party/tracy/examples/ToyPathTracer/Windows/VertexShader.hlsl create mode 100644 third_party/tracy/examples/ToyPathTracer/license.md create mode 100644 third_party/tracy/examples/fibers.cpp create mode 100644 third_party/tracy/extra/color-hot.cpp create mode 100644 third_party/tracy/extra/color.cpp create mode 100644 third_party/tracy/extra/desktop/application-tracy.xml create mode 100644 third_party/tracy/extra/desktop/tracy.desktop create mode 100644 third_party/tracy/extra/dxt1divtable.c create mode 100644 third_party/tracy/extra/dxt1table.c create mode 100644 third_party/tracy/extra/identify.cpp create mode 100755 third_party/tracy/extra/make-build.sh create mode 100644 third_party/tracy/extra/natvis.py create mode 100644 third_party/tracy/extra/rdotbl.c create mode 100644 third_party/tracy/extra/uarch/TracyMicroArchitecture.hpp create mode 100644 third_party/tracy/extra/uarch/uarch.cpp create mode 100755 third_party/tracy/extra/update-meson-version.sh create mode 100644 third_party/tracy/extra/version.cpp create mode 100644 third_party/tracy/extra/x11_colors.c create mode 100644 third_party/tracy/extra/zigzag.svg create mode 100644 third_party/tracy/extra/zigzag01.png create mode 100644 third_party/tracy/extra/zigzag02.png create mode 100644 third_party/tracy/extra/zigzag04.png create mode 100644 third_party/tracy/extra/zigzag08.png create mode 100644 third_party/tracy/extra/zigzag16.png create mode 100644 third_party/tracy/extra/zigzag32.png create mode 100644 third_party/tracy/getopt/getopt.c create mode 100644 third_party/tracy/getopt/getopt.h create mode 100644 third_party/tracy/icon/application-tracy.copying create mode 100644 third_party/tracy/icon/application-tracy.svg create mode 100644 third_party/tracy/icon/icon.ico create mode 100644 third_party/tracy/icon/icon.pdf create mode 100644 third_party/tracy/icon/icon.png create mode 100644 third_party/tracy/icon/icon.svg create mode 100644 third_party/tracy/import/CMakeLists.txt create mode 100644 third_party/tracy/import/src/import-chrome.cpp create mode 100644 third_party/tracy/import/src/import-fuchsia.cpp create mode 100644 third_party/tracy/import/src/json.hpp create mode 100644 third_party/tracy/manual/icons/lmb.pdf create mode 100644 third_party/tracy/manual/icons/lmb.svg create mode 100644 third_party/tracy/manual/icons/mmb.pdf create mode 100644 third_party/tracy/manual/icons/mmb.svg create mode 100644 third_party/tracy/manual/icons/mouse.svg create mode 100644 third_party/tracy/manual/icons/rmb.pdf create mode 100644 third_party/tracy/manual/icons/rmb.svg create mode 100644 third_party/tracy/manual/icons/scroll.pdf create mode 100644 third_party/tracy/manual/icons/scroll.svg create mode 100644 third_party/tracy/manual/images/ryzen.png create mode 100644 third_party/tracy/manual/images/screenshot-hi.png create mode 100644 third_party/tracy/manual/images/screenshot-lo.png create mode 100644 third_party/tracy/manual/techdoc.tex create mode 100644 third_party/tracy/manual/tracy.bib create mode 100644 third_party/tracy/manual/tracy.tex create mode 100644 third_party/tracy/meson.build create mode 100644 third_party/tracy/meson.options create mode 100644 third_party/tracy/profiler/CMakeLists.txt create mode 100644 third_party/tracy/profiler/src/Backend.hpp create mode 100644 third_party/tracy/profiler/src/BackendEmscripten.cpp create mode 100644 third_party/tracy/profiler/src/BackendGlfw.cpp create mode 100644 third_party/tracy/profiler/src/BackendWayland.cpp create mode 100644 third_party/tracy/profiler/src/ConnectionHistory.cpp create mode 100644 third_party/tracy/profiler/src/ConnectionHistory.hpp create mode 100644 third_party/tracy/profiler/src/Filters.cpp create mode 100644 third_party/tracy/profiler/src/Filters.hpp create mode 100644 third_party/tracy/profiler/src/Fonts.cpp create mode 100644 third_party/tracy/profiler/src/Fonts.hpp create mode 100644 third_party/tracy/profiler/src/HttpRequest.cpp create mode 100644 third_party/tracy/profiler/src/HttpRequest.hpp create mode 100644 third_party/tracy/profiler/src/ImGuiContext.cpp create mode 100644 third_party/tracy/profiler/src/ImGuiContext.hpp create mode 100644 third_party/tracy/profiler/src/IsElevated.cpp create mode 100644 third_party/tracy/profiler/src/IsElevated.hpp create mode 100644 third_party/tracy/profiler/src/ResolvService.cpp create mode 100644 third_party/tracy/profiler/src/ResolvService.hpp create mode 100644 third_party/tracy/profiler/src/RunQueue.cpp create mode 100644 third_party/tracy/profiler/src/RunQueue.hpp create mode 100644 third_party/tracy/profiler/src/WindowPosition.cpp create mode 100644 third_party/tracy/profiler/src/WindowPosition.hpp create mode 100644 third_party/tracy/profiler/src/font/DroidSans.hpp create mode 100644 third_party/tracy/profiler/src/font/FiraCodeRetina.hpp create mode 100644 third_party/tracy/profiler/src/font/FontAwesomeSolid.hpp create mode 100644 third_party/tracy/profiler/src/icon.hpp create mode 100644 third_party/tracy/profiler/src/ini.c create mode 100644 third_party/tracy/profiler/src/ini.h create mode 100644 third_party/tracy/profiler/src/main.cpp create mode 100644 third_party/tracy/profiler/src/profiler/IconsFontAwesome6.h create mode 100644 third_party/tracy/profiler/src/profiler/TracyAchievementData.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyAchievements.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyAchievements.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyBadVersion.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyBadVersion.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyBuzzAnim.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyColor.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyColor.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyConfig.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyDecayValue.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyEventDebug.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyEventDebug.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyFileselector.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyFileselector.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyFilesystem.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyFilesystem.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyImGui.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyImGui.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyLockHelpers.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyMicroArchitecture.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyMicroArchitecture.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyMouse.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyMouse.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyProtoHistory.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyProtoHistory.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracySourceContents.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracySourceContents.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracySourceTokenizer.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracySourceTokenizer.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracySourceView.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracySourceView.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyStorage.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyStorage.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTexture.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTexture.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineContext.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineController.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineController.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineDraw.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItem.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItem.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemCpuData.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemCpuData.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemGpu.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemGpu.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemPlot.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemPlot.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemThread.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyTimelineItemThread.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyUserData.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyUserData.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyUtility.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyUtility.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyViewData.hpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Annotations.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Callstack.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Compare.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_ConnectionState.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_ContextSwitch.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_CpuData.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_FindZone.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_FlameGraph.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_FrameOverview.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_FrameTimeline.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_FrameTree.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_GpuTimeline.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Locks.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Memory.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Messages.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Navigation.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_NotificationArea.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Options.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Playback.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Plots.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Ranges.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Samples.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Statistics.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Timeline.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_TraceInfo.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_Utility.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_ZoneInfo.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyView_ZoneTimeline.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyWeb.cpp create mode 100644 third_party/tracy/profiler/src/profiler/TracyWeb.hpp create mode 100644 third_party/tracy/profiler/src/stb_image.h create mode 100644 third_party/tracy/profiler/src/stb_image_resize.h create mode 100644 third_party/tracy/profiler/src/winmain.cpp create mode 100644 third_party/tracy/profiler/src/winmainArchDiscovery.cpp create mode 100644 third_party/tracy/profiler/src/zigzag01.hpp create mode 100644 third_party/tracy/profiler/src/zigzag02.hpp create mode 100644 third_party/tracy/profiler/src/zigzag04.hpp create mode 100644 third_party/tracy/profiler/src/zigzag08.hpp create mode 100644 third_party/tracy/profiler/src/zigzag16.hpp create mode 100644 third_party/tracy/profiler/src/zigzag32.hpp create mode 100644 third_party/tracy/profiler/wasm/httpd.py create mode 100644 third_party/tracy/profiler/wasm/index.html create mode 100644 third_party/tracy/profiler/win32/Tracy.manifest create mode 100644 third_party/tracy/profiler/win32/Tracy.rc create mode 100644 third_party/tracy/public/TracyClient.F90 create mode 100644 third_party/tracy/public/TracyClient.cpp create mode 100644 third_party/tracy/public/client/TracyAlloc.cpp create mode 100644 third_party/tracy/public/client/TracyArmCpuTable.hpp create mode 100644 third_party/tracy/public/client/TracyCallstack.cpp create mode 100644 third_party/tracy/public/client/TracyCallstack.h create mode 100644 third_party/tracy/public/client/TracyCallstack.hpp create mode 100644 third_party/tracy/public/client/TracyCpuid.hpp create mode 100644 third_party/tracy/public/client/TracyDebug.hpp create mode 100644 third_party/tracy/public/client/TracyDxt1.cpp create mode 100644 third_party/tracy/public/client/TracyDxt1.hpp create mode 100644 third_party/tracy/public/client/TracyFastVector.hpp create mode 100644 third_party/tracy/public/client/TracyKCore.cpp create mode 100644 third_party/tracy/public/client/TracyKCore.hpp create mode 100644 third_party/tracy/public/client/TracyLock.hpp create mode 100644 third_party/tracy/public/client/TracyOverride.cpp create mode 100644 third_party/tracy/public/client/TracyProfiler.cpp create mode 100644 third_party/tracy/public/client/TracyProfiler.hpp create mode 100644 third_party/tracy/public/client/TracyRingBuffer.hpp create mode 100644 third_party/tracy/public/client/TracyScoped.hpp create mode 100644 third_party/tracy/public/client/TracyStringHelpers.hpp create mode 100644 third_party/tracy/public/client/TracySysPower.cpp create mode 100644 third_party/tracy/public/client/TracySysPower.hpp create mode 100644 third_party/tracy/public/client/TracySysTime.cpp create mode 100644 third_party/tracy/public/client/TracySysTime.hpp create mode 100644 third_party/tracy/public/client/TracySysTrace.cpp create mode 100644 third_party/tracy/public/client/TracySysTrace.hpp create mode 100644 third_party/tracy/public/client/TracyThread.hpp create mode 100644 third_party/tracy/public/client/tracy_SPSCQueue.h create mode 100644 third_party/tracy/public/client/tracy_concurrentqueue.h create mode 100644 third_party/tracy/public/client/tracy_rpmalloc.cpp create mode 100644 third_party/tracy/public/client/tracy_rpmalloc.hpp create mode 100644 third_party/tracy/public/common/TracyAlign.hpp create mode 100644 third_party/tracy/public/common/TracyAlloc.hpp create mode 100644 third_party/tracy/public/common/TracyApi.h create mode 100644 third_party/tracy/public/common/TracyColor.hpp create mode 100644 third_party/tracy/public/common/TracyForceInline.hpp create mode 100644 third_party/tracy/public/common/TracyMutex.hpp create mode 100644 third_party/tracy/public/common/TracyProtocol.hpp create mode 100644 third_party/tracy/public/common/TracyQueue.hpp create mode 100644 third_party/tracy/public/common/TracySocket.cpp create mode 100644 third_party/tracy/public/common/TracySocket.hpp create mode 100644 third_party/tracy/public/common/TracyStackFrames.cpp create mode 100644 third_party/tracy/public/common/TracyStackFrames.hpp create mode 100644 third_party/tracy/public/common/TracySystem.cpp create mode 100644 third_party/tracy/public/common/TracySystem.hpp create mode 100644 third_party/tracy/public/common/TracyUwp.hpp create mode 100644 third_party/tracy/public/common/TracyVersion.hpp create mode 100644 third_party/tracy/public/common/TracyYield.hpp create mode 100644 third_party/tracy/public/common/tracy_lz4.cpp create mode 100644 third_party/tracy/public/common/tracy_lz4.hpp create mode 100644 third_party/tracy/public/common/tracy_lz4hc.cpp create mode 100644 third_party/tracy/public/common/tracy_lz4hc.hpp create mode 100644 third_party/tracy/public/libbacktrace/LICENSE create mode 100644 third_party/tracy/public/libbacktrace/alloc.cpp create mode 100644 third_party/tracy/public/libbacktrace/backtrace.hpp create mode 100644 third_party/tracy/public/libbacktrace/config.h create mode 100644 third_party/tracy/public/libbacktrace/dwarf.cpp create mode 100644 third_party/tracy/public/libbacktrace/elf.cpp create mode 100644 third_party/tracy/public/libbacktrace/fileline.cpp create mode 100644 third_party/tracy/public/libbacktrace/filenames.hpp create mode 100644 third_party/tracy/public/libbacktrace/internal.hpp create mode 100644 third_party/tracy/public/libbacktrace/macho.cpp create mode 100644 third_party/tracy/public/libbacktrace/mmapio.cpp create mode 100644 third_party/tracy/public/libbacktrace/posix.cpp create mode 100644 third_party/tracy/public/libbacktrace/sort.cpp create mode 100644 third_party/tracy/public/libbacktrace/state.cpp create mode 100644 third_party/tracy/public/tracy/Tracy.hpp create mode 100644 third_party/tracy/public/tracy/TracyC.h create mode 100644 third_party/tracy/public/tracy/TracyCUDA.hpp create mode 100644 third_party/tracy/public/tracy/TracyD3D11.hpp create mode 100644 third_party/tracy/public/tracy/TracyD3D12.hpp create mode 100644 third_party/tracy/public/tracy/TracyLua.hpp create mode 100644 third_party/tracy/public/tracy/TracyMetal.hmm create mode 100644 third_party/tracy/public/tracy/TracyOpenCL.hpp create mode 100644 third_party/tracy/public/tracy/TracyOpenGL.hpp create mode 100644 third_party/tracy/public/tracy/TracyVulkan.hpp create mode 100644 third_party/tracy/python/.gitignore create mode 100644 third_party/tracy/python/CMakeLists.txt create mode 100644 third_party/tracy/python/HeaderFixer.txt create mode 100644 third_party/tracy/python/bindings/Memory.hpp create mode 100644 third_party/tracy/python/bindings/Module.cpp create mode 100644 third_party/tracy/python/bindings/NameBuffer.hpp create mode 100644 third_party/tracy/python/bindings/ScopedZone.hpp create mode 100644 third_party/tracy/python/setup.py create mode 100644 third_party/tracy/python/tracy_client/TracyClientBindings.pyi create mode 100644 third_party/tracy/python/tracy_client/__init__.py create mode 100644 third_party/tracy/python/tracy_client/py.typed create mode 100644 third_party/tracy/python/tracy_client/scoped.py create mode 100644 third_party/tracy/python/tracy_client/tracy.py create mode 100644 third_party/tracy/server/TracyCharUtil.hpp create mode 100644 third_party/tracy/server/TracyEvent.hpp create mode 100644 third_party/tracy/server/TracyFileHeader.hpp create mode 100644 third_party/tracy/server/TracyFileMeta.hpp create mode 100644 third_party/tracy/server/TracyFileRead.hpp create mode 100644 third_party/tracy/server/TracyFileWrite.hpp create mode 100644 third_party/tracy/server/TracyMemory.cpp create mode 100644 third_party/tracy/server/TracyMemory.hpp create mode 100644 third_party/tracy/server/TracyMmap.cpp create mode 100644 third_party/tracy/server/TracyMmap.hpp create mode 100644 third_party/tracy/server/TracyPopcnt.hpp create mode 100644 third_party/tracy/server/TracyPrint.cpp create mode 100644 third_party/tracy/server/TracyPrint.hpp create mode 100644 third_party/tracy/server/TracyShortPtr.hpp create mode 100644 third_party/tracy/server/TracySlab.hpp create mode 100644 third_party/tracy/server/TracySort.hpp create mode 100644 third_party/tracy/server/TracySortedVector.hpp create mode 100644 third_party/tracy/server/TracyStringDiscovery.hpp create mode 100644 third_party/tracy/server/TracySysUtil.cpp create mode 100644 third_party/tracy/server/TracySysUtil.hpp create mode 100644 third_party/tracy/server/TracyTaskDispatch.cpp create mode 100644 third_party/tracy/server/TracyTaskDispatch.hpp create mode 100644 third_party/tracy/server/TracyTextureCompression.cpp create mode 100644 third_party/tracy/server/TracyTextureCompression.hpp create mode 100644 third_party/tracy/server/TracyThreadCompress.cpp create mode 100644 third_party/tracy/server/TracyThreadCompress.hpp create mode 100644 third_party/tracy/server/TracyVarArray.hpp create mode 100644 third_party/tracy/server/TracyVector.hpp create mode 100644 third_party/tracy/server/TracyWorker.cpp create mode 100644 third_party/tracy/server/TracyWorker.hpp create mode 100644 third_party/tracy/server/tracy_pdqsort.h create mode 100644 third_party/tracy/server/tracy_robin_hood.h create mode 100644 third_party/tracy/server/tracy_xxhash.h create mode 100644 third_party/tracy/test/CMakeLists.txt create mode 100644 third_party/tracy/test/image.jpg create mode 100644 third_party/tracy/test/stb_image.h create mode 100644 third_party/tracy/test/test.cpp create mode 100644 third_party/tracy/update/CMakeLists.txt create mode 100644 third_party/tracy/update/src/OfflineSymbolResolver.cpp create mode 100644 third_party/tracy/update/src/OfflineSymbolResolver.h create mode 100644 third_party/tracy/update/src/OfflineSymbolResolverAddr2Line.cpp create mode 100644 third_party/tracy/update/src/OfflineSymbolResolverDbgHelper.cpp create mode 100644 third_party/tracy/update/src/update.cpp create mode 100644 third_party/zlib-ng/.codecov.yaml create mode 100644 third_party/zlib-ng/.shellcheckrc create mode 100644 third_party/zlib-ng/CMakeLists.txt create mode 100644 third_party/zlib-ng/FAQ.zlib create mode 100644 third_party/zlib-ng/INDEX.md create mode 100644 third_party/zlib-ng/LICENSE.md create mode 100644 third_party/zlib-ng/Makefile.in create mode 100644 third_party/zlib-ng/PORTING.md create mode 100644 third_party/zlib-ng/README.md create mode 100644 third_party/zlib-ng/adler32.c create mode 100644 third_party/zlib-ng/adler32_p.h create mode 100644 third_party/zlib-ng/arch/arm/Makefile.in create mode 100644 third_party/zlib-ng/arch/arm/acle_intrins.h create mode 100644 third_party/zlib-ng/arch/arm/adler32_neon.c create mode 100644 third_party/zlib-ng/arch/arm/arm_features.c create mode 100644 third_party/zlib-ng/arch/arm/arm_features.h create mode 100644 third_party/zlib-ng/arch/arm/arm_functions.h create mode 100644 third_party/zlib-ng/arch/arm/chunkset_neon.c create mode 100644 third_party/zlib-ng/arch/arm/compare256_neon.c create mode 100644 third_party/zlib-ng/arch/arm/crc32_acle.c create mode 100644 third_party/zlib-ng/arch/arm/neon_intrins.h create mode 100644 third_party/zlib-ng/arch/arm/slide_hash_armv6.c create mode 100644 third_party/zlib-ng/arch/arm/slide_hash_neon.c create mode 100644 third_party/zlib-ng/arch/generic/Makefile.in create mode 100644 third_party/zlib-ng/arch/generic/adler32_c.c create mode 100644 third_party/zlib-ng/arch/generic/adler32_fold_c.c create mode 100644 third_party/zlib-ng/arch/generic/chunk_permute_table.h create mode 100644 third_party/zlib-ng/arch/generic/chunkset_c.c create mode 100644 third_party/zlib-ng/arch/generic/compare256_c.c create mode 100644 third_party/zlib-ng/arch/generic/compare256_p.h create mode 100644 third_party/zlib-ng/arch/generic/crc32_braid_c.c create mode 100644 third_party/zlib-ng/arch/generic/crc32_fold_c.c create mode 100644 third_party/zlib-ng/arch/generic/generic_functions.h create mode 100644 third_party/zlib-ng/arch/generic/slide_hash_c.c create mode 100644 third_party/zlib-ng/arch/power/Makefile.in create mode 100644 third_party/zlib-ng/arch/power/adler32_power8.c create mode 100644 third_party/zlib-ng/arch/power/adler32_vmx.c create mode 100644 third_party/zlib-ng/arch/power/chunkset_power8.c create mode 100644 third_party/zlib-ng/arch/power/compare256_power9.c create mode 100644 third_party/zlib-ng/arch/power/crc32_constants.h create mode 100644 third_party/zlib-ng/arch/power/crc32_power8.c create mode 100644 third_party/zlib-ng/arch/power/power_features.c create mode 100644 third_party/zlib-ng/arch/power/power_features.h create mode 100644 third_party/zlib-ng/arch/power/power_functions.h create mode 100644 third_party/zlib-ng/arch/power/power_intrins.h create mode 100644 third_party/zlib-ng/arch/power/slide_hash_power8.c create mode 100644 third_party/zlib-ng/arch/power/slide_hash_vmx.c create mode 100644 third_party/zlib-ng/arch/power/slide_ppc_tpl.h create mode 100644 third_party/zlib-ng/arch/riscv/README.md create mode 100644 third_party/zlib-ng/arch/riscv/adler32_rvv.c create mode 100644 third_party/zlib-ng/arch/riscv/chunkset_rvv.c create mode 100644 third_party/zlib-ng/arch/riscv/compare256_rvv.c create mode 100644 third_party/zlib-ng/arch/riscv/riscv_features.c create mode 100644 third_party/zlib-ng/arch/riscv/riscv_features.h create mode 100644 third_party/zlib-ng/arch/riscv/riscv_functions.h create mode 100644 third_party/zlib-ng/arch/riscv/slide_hash_rvv.c create mode 100644 third_party/zlib-ng/arch/s390/Makefile.in create mode 100644 third_party/zlib-ng/arch/s390/README.md create mode 100644 third_party/zlib-ng/arch/s390/crc32-vx.c create mode 100644 third_party/zlib-ng/arch/s390/dfltcc_common.h create mode 100644 third_party/zlib-ng/arch/s390/dfltcc_deflate.c create mode 100644 third_party/zlib-ng/arch/s390/dfltcc_deflate.h create mode 100644 third_party/zlib-ng/arch/s390/dfltcc_detail.h create mode 100644 third_party/zlib-ng/arch/s390/dfltcc_inflate.c create mode 100644 third_party/zlib-ng/arch/s390/dfltcc_inflate.h create mode 100644 third_party/zlib-ng/arch/s390/s390_features.c create mode 100644 third_party/zlib-ng/arch/s390/s390_features.h create mode 100644 third_party/zlib-ng/arch/s390/s390_functions.h create mode 100755 third_party/zlib-ng/arch/s390/self-hosted-builder/actions-runner create mode 100644 third_party/zlib-ng/arch/s390/self-hosted-builder/actions-runner-rebuild.sh create mode 100644 third_party/zlib-ng/arch/s390/self-hosted-builder/actions-runner.Dockerfile create mode 100644 third_party/zlib-ng/arch/s390/self-hosted-builder/actions-runner.service create mode 100755 third_party/zlib-ng/arch/s390/self-hosted-builder/entrypoint create mode 100644 third_party/zlib-ng/arch/x86/Makefile.in create mode 100644 third_party/zlib-ng/arch/x86/adler32_avx2.c create mode 100644 third_party/zlib-ng/arch/x86/adler32_avx2_p.h create mode 100644 third_party/zlib-ng/arch/x86/adler32_avx512.c create mode 100644 third_party/zlib-ng/arch/x86/adler32_avx512_p.h create mode 100644 third_party/zlib-ng/arch/x86/adler32_avx512_vnni.c create mode 100644 third_party/zlib-ng/arch/x86/adler32_sse42.c create mode 100644 third_party/zlib-ng/arch/x86/adler32_ssse3.c create mode 100644 third_party/zlib-ng/arch/x86/adler32_ssse3_p.h create mode 100644 third_party/zlib-ng/arch/x86/avx2_tables.h create mode 100644 third_party/zlib-ng/arch/x86/chunkset_avx2.c create mode 100644 third_party/zlib-ng/arch/x86/chunkset_avx512.c create mode 100644 third_party/zlib-ng/arch/x86/chunkset_sse2.c create mode 100644 third_party/zlib-ng/arch/x86/chunkset_ssse3.c create mode 100644 third_party/zlib-ng/arch/x86/compare256_avx2.c create mode 100644 third_party/zlib-ng/arch/x86/compare256_sse2.c create mode 100644 third_party/zlib-ng/arch/x86/crc32_fold_pclmulqdq_tpl.h create mode 100644 third_party/zlib-ng/arch/x86/crc32_fold_vpclmulqdq_tpl.h create mode 100644 third_party/zlib-ng/arch/x86/crc32_pclmulqdq.c create mode 100644 third_party/zlib-ng/arch/x86/crc32_pclmulqdq_tpl.h create mode 100644 third_party/zlib-ng/arch/x86/crc32_vpclmulqdq.c create mode 100644 third_party/zlib-ng/arch/x86/slide_hash_avx2.c create mode 100644 third_party/zlib-ng/arch/x86/slide_hash_sse2.c create mode 100644 third_party/zlib-ng/arch/x86/x86_features.c create mode 100644 third_party/zlib-ng/arch/x86/x86_features.h create mode 100644 third_party/zlib-ng/arch/x86/x86_functions.h create mode 100644 third_party/zlib-ng/arch/x86/x86_intrins.h create mode 100644 third_party/zlib-ng/arch_functions.h create mode 100644 third_party/zlib-ng/chunkset_tpl.h create mode 100644 third_party/zlib-ng/cmake/detect-arch.c create mode 100644 third_party/zlib-ng/cmake/detect-arch.cmake create mode 100644 third_party/zlib-ng/cmake/detect-coverage.cmake create mode 100644 third_party/zlib-ng/cmake/detect-install-dirs.cmake create mode 100644 third_party/zlib-ng/cmake/detect-intrinsics.cmake create mode 100644 third_party/zlib-ng/cmake/detect-sanitizer.cmake create mode 100644 third_party/zlib-ng/cmake/fallback-macros.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-aarch64.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-arm.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-armhf.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-llvm-mingw-aarch64.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-llvm-mingw-armv7.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-llvm-mingw-i686.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-llvm-mingw-x86_64.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-mingw-i686.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-mingw-x86_64.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-mips.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-mips64.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc64-clang.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc64-power9.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc64.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc64le-clang.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc64le-power9.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-powerpc64le.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-riscv.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-s390x.cmake create mode 100644 third_party/zlib-ng/cmake/toolchain-sparc64.cmake create mode 100644 third_party/zlib-ng/compare256_rle.h create mode 100644 third_party/zlib-ng/compress.c create mode 100755 third_party/zlib-ng/configure create mode 100644 third_party/zlib-ng/cpu_features.c create mode 100644 third_party/zlib-ng/cpu_features.h create mode 100644 third_party/zlib-ng/crc32.c create mode 100644 third_party/zlib-ng/crc32.h create mode 100644 third_party/zlib-ng/crc32_braid_comb.c create mode 100644 third_party/zlib-ng/crc32_braid_comb_p.h create mode 100644 third_party/zlib-ng/crc32_braid_p.h create mode 100644 third_party/zlib-ng/crc32_braid_tbl.h create mode 100644 third_party/zlib-ng/deflate.c create mode 100644 third_party/zlib-ng/deflate.h create mode 100644 third_party/zlib-ng/deflate_fast.c create mode 100644 third_party/zlib-ng/deflate_huff.c create mode 100644 third_party/zlib-ng/deflate_medium.c create mode 100644 third_party/zlib-ng/deflate_p.h create mode 100644 third_party/zlib-ng/deflate_quick.c create mode 100644 third_party/zlib-ng/deflate_rle.c create mode 100644 third_party/zlib-ng/deflate_slow.c create mode 100644 third_party/zlib-ng/deflate_stored.c create mode 100644 third_party/zlib-ng/doc/algorithm.txt create mode 100644 third_party/zlib-ng/doc/crc-doc.1.0.pdf create mode 100644 third_party/zlib-ng/doc/crc-pclmulqdq.pdf create mode 100644 third_party/zlib-ng/doc/rfc1950.txt create mode 100644 third_party/zlib-ng/doc/rfc1951.txt create mode 100644 third_party/zlib-ng/doc/rfc1952.txt create mode 100644 third_party/zlib-ng/doc/txtvsbin.txt create mode 100644 third_party/zlib-ng/fallback_builtins.h create mode 100644 third_party/zlib-ng/functable.c create mode 100644 third_party/zlib-ng/functable.h create mode 100644 third_party/zlib-ng/gzguts.h create mode 100644 third_party/zlib-ng/gzlib.c create mode 100644 third_party/zlib-ng/gzread.c.in create mode 100644 third_party/zlib-ng/gzwrite.c create mode 100644 third_party/zlib-ng/infback.c create mode 100644 third_party/zlib-ng/inffast_tpl.h create mode 100644 third_party/zlib-ng/inffixed_tbl.h create mode 100644 third_party/zlib-ng/inflate.c create mode 100644 third_party/zlib-ng/inflate.h create mode 100644 third_party/zlib-ng/inflate_p.h create mode 100644 third_party/zlib-ng/inftrees.c create mode 100644 third_party/zlib-ng/inftrees.h create mode 100644 third_party/zlib-ng/insert_string.c create mode 100644 third_party/zlib-ng/insert_string_roll.c create mode 100644 third_party/zlib-ng/insert_string_tpl.h create mode 100644 third_party/zlib-ng/match_tpl.h create mode 100644 third_party/zlib-ng/test/CMakeLists.txt create mode 100644 third_party/zlib-ng/test/CVE-2002-0059/test.gz create mode 100644 third_party/zlib-ng/test/CVE-2004-0797/test.gz create mode 100644 third_party/zlib-ng/test/CVE-2005-1849/test.gz create mode 100644 third_party/zlib-ng/test/CVE-2005-2096/test.gz create mode 100644 third_party/zlib-ng/test/CVE-2018-25032/default.txt create mode 100644 third_party/zlib-ng/test/CVE-2018-25032/fixed.txt create mode 100644 third_party/zlib-ng/test/GH-1600/packobj.gz create mode 100644 third_party/zlib-ng/test/GH-361/test.txt create mode 100644 third_party/zlib-ng/test/GH-364/test.bin create mode 100644 third_party/zlib-ng/test/GH-382/defneg3.dat create mode 100644 third_party/zlib-ng/test/GH-751/test.txt create mode 100644 third_party/zlib-ng/test/GH-979/pigz-2.6.tar.gz create mode 100644 third_party/zlib-ng/test/Makefile.in create mode 100644 third_party/zlib-ng/test/README.md create mode 100644 third_party/zlib-ng/test/abi/ignore create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-aarch64-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-arm-unknown-linux-gnueabi.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-arm-unknown-linux-gnueabihf.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-mips-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-mips64-unknown-linux-gnuabi64.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-powerpc-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-powerpc64-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-powerpc64le-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-x86_64-pc-linux-gnu-m32.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-04f42ceca40f73e2978b50e93806c2a18c1281fc-x86_64-pc-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-aarch64-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-arm-unknown-linux-gnueabi.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-arm-unknown-linux-gnueabihf.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-mips-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-mips64-unknown-linux-gnuabi64.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-powerpc-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-powerpc64-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-powerpc64le-unknown-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-x86_64-pc-linux-gnu-m32.abi create mode 100644 third_party/zlib-ng/test/abi/zlib-ng-e4614ebcb9b3e5b108dc983c155e4baf80882311-x86_64-pc-linux-gnu.abi create mode 100644 third_party/zlib-ng/test/abicheck.md create mode 100755 third_party/zlib-ng/test/abicheck.sh create mode 100644 third_party/zlib-ng/test/add-subdirectory-project/CMakeLists.txt create mode 100644 third_party/zlib-ng/test/add-subdirectory-project/main.c create mode 100644 third_party/zlib-ng/test/benchmarks/CMakeLists.txt create mode 100644 third_party/zlib-ng/test/benchmarks/README.md create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_adler32.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_adler32_copy.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_compare256.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_compare256_rle.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_compress.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_crc32.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_main.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_png_decode.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_png_encode.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_png_shared.h create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_slidehash.cc create mode 100644 third_party/zlib-ng/test/benchmarks/benchmark_uncompress.cc create mode 100644 third_party/zlib-ng/test/cmake/compress-and-verify.cmake create mode 100644 third_party/zlib-ng/test/cmake/run-and-compare.cmake create mode 100644 third_party/zlib-ng/test/cmake/run-and-redirect.cmake create mode 100644 third_party/zlib-ng/test/cmake/test-cves.cmake create mode 100644 third_party/zlib-ng/test/cmake/test-data.cmake create mode 100644 third_party/zlib-ng/test/cmake/test-issues.cmake create mode 100644 third_party/zlib-ng/test/cmake/test-tools.cmake create mode 100644 third_party/zlib-ng/test/data/fireworks.jpg create mode 100644 third_party/zlib-ng/test/data/lcet10.txt create mode 100644 third_party/zlib-ng/test/data/paper-100k.pdf create mode 100644 third_party/zlib-ng/test/example.c create mode 100644 third_party/zlib-ng/test/fuzz/CMakeLists.txt create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_checksum.c create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_compress.c create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_example_dict.c create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_example_flush.c create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_example_large.c create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_example_small.c create mode 100644 third_party/zlib-ng/test/fuzz/fuzzer_minigzip.c create mode 100644 third_party/zlib-ng/test/fuzz/standalone_fuzz_target_runner.c create mode 100644 third_party/zlib-ng/test/gh1235.c create mode 100644 third_party/zlib-ng/test/infcover.c create mode 100644 third_party/zlib-ng/test/minideflate.c create mode 100644 third_party/zlib-ng/test/minigzip.c create mode 100644 third_party/zlib-ng/test/pigz/CMakeLists.txt create mode 100644 third_party/zlib-ng/test/pkgcheck.sh create mode 100644 third_party/zlib-ng/test/switchlevels.c create mode 100644 third_party/zlib-ng/test/test_adler32.cc create mode 100644 third_party/zlib-ng/test/test_compare256.cc create mode 100644 third_party/zlib-ng/test/test_compare256_rle.cc create mode 100644 third_party/zlib-ng/test/test_compress.cc create mode 100644 third_party/zlib-ng/test/test_compress_bound.cc create mode 100644 third_party/zlib-ng/test/test_compress_dual.cc create mode 100644 third_party/zlib-ng/test/test_cpu_features.h create mode 100644 third_party/zlib-ng/test/test_crc32.cc create mode 100644 third_party/zlib-ng/test/test_cve-2003-0107.cc create mode 100644 third_party/zlib-ng/test/test_deflate_bound.cc create mode 100644 third_party/zlib-ng/test/test_deflate_concurrency.cc create mode 100644 third_party/zlib-ng/test/test_deflate_copy.cc create mode 100644 third_party/zlib-ng/test/test_deflate_dict.cc create mode 100644 third_party/zlib-ng/test/test_deflate_hash_head_0.cc create mode 100644 third_party/zlib-ng/test/test_deflate_header.cc create mode 100644 third_party/zlib-ng/test/test_deflate_params.cc create mode 100644 third_party/zlib-ng/test/test_deflate_pending.cc create mode 100644 third_party/zlib-ng/test/test_deflate_prime.cc create mode 100644 third_party/zlib-ng/test/test_deflate_quick_bi_valid.cc create mode 100644 third_party/zlib-ng/test/test_deflate_quick_block_open.cc create mode 100644 third_party/zlib-ng/test/test_deflate_tune.cc create mode 100644 third_party/zlib-ng/test/test_dict.cc create mode 100644 third_party/zlib-ng/test/test_gzio.cc create mode 100644 third_party/zlib-ng/test/test_inflate_adler32.cc create mode 100644 third_party/zlib-ng/test/test_inflate_copy.cc create mode 100644 third_party/zlib-ng/test/test_inflate_sync.cc create mode 100644 third_party/zlib-ng/test/test_large_buffers.cc create mode 100644 third_party/zlib-ng/test/test_main.cc create mode 100644 third_party/zlib-ng/test/test_raw.cc create mode 100644 third_party/zlib-ng/test/test_shared.h create mode 100644 third_party/zlib-ng/test/test_shared_ng.h create mode 100644 third_party/zlib-ng/test/test_small_buffers.cc create mode 100644 third_party/zlib-ng/test/test_small_window.cc create mode 100644 third_party/zlib-ng/test/test_version.cc create mode 100755 third_party/zlib-ng/tools/config.sub create mode 100644 third_party/zlib-ng/tools/makecrct.c create mode 100644 third_party/zlib-ng/tools/makefixed.c create mode 100644 third_party/zlib-ng/tools/maketrees.c create mode 100644 third_party/zlib-ng/trees.c create mode 100644 third_party/zlib-ng/trees.h create mode 100644 third_party/zlib-ng/trees_emit.h create mode 100644 third_party/zlib-ng/trees_tbl.h create mode 100644 third_party/zlib-ng/uncompr.c create mode 100644 third_party/zlib-ng/win32/Makefile.a64 create mode 100644 third_party/zlib-ng/win32/Makefile.arm create mode 100644 third_party/zlib-ng/win32/Makefile.msc create mode 100644 third_party/zlib-ng/win32/depcheck.cpp create mode 100644 third_party/zlib-ng/win32/replace.vbs create mode 100644 third_party/zlib-ng/win32/zlib-ng.def.in create mode 100644 third_party/zlib-ng/win32/zlib-ng1.rc create mode 100644 third_party/zlib-ng/win32/zlib.def.in create mode 100644 third_party/zlib-ng/win32/zlib1.rc create mode 100644 third_party/zlib-ng/win32/zlibcompat.def.in create mode 100644 third_party/zlib-ng/zbuild.h create mode 100644 third_party/zlib-ng/zconf-ng.h.in create mode 100644 third_party/zlib-ng/zconf.h.in create mode 100644 third_party/zlib-ng/zendian.h create mode 100644 third_party/zlib-ng/zlib-config.cmake.in create mode 100644 third_party/zlib-ng/zlib-ng-config.cmake.in create mode 100644 third_party/zlib-ng/zlib-ng.h.in create mode 100644 third_party/zlib-ng/zlib-ng.map create mode 100644 third_party/zlib-ng/zlib.h.in create mode 100644 third_party/zlib-ng/zlib.map create mode 100644 third_party/zlib-ng/zlib.pc.cmakein create mode 100644 third_party/zlib-ng/zlib.pc.in create mode 100644 third_party/zlib-ng/zlib_name_mangling-ng.h.in create mode 100644 third_party/zlib-ng/zlib_name_mangling.h.empty create mode 100644 third_party/zlib-ng/zlib_name_mangling.h.in create mode 100644 third_party/zlib-ng/zmemory.h create mode 100644 third_party/zlib-ng/zutil.c create mode 100644 third_party/zlib-ng/zutil.h create mode 100644 third_party/zlib-ng/zutil_p.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 736b84e..281e826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ if(CMAKE_CXX_COMPILER_ID endif() +link_libraries(atomic) option( WITH_MICROPROFILE "with MicroProfile" @@ -40,7 +41,13 @@ check_cxx_source_compiles( " HAVE_PTHREAD) -add_subdirectory(third_party/breakpad) +if(NOT + CMAKE_SYSTEM_PROCESSOR + MATCHES + "mips*") + add_subdirectory(third_party/breakpad) +endif() +add_subdirectory(third_party/tracy) if(WITH_MICROPROFILE) add_subdirectory(third_party/microprofile) set(COMM_LINK_MICROPROFILE ON) @@ -63,6 +70,10 @@ CPMAddPackage( if(WITH_EXAMPLES) cc_executable(microprofile_demo SRCS examples/microprofile_demo.cc) + cc_executable( + tracy_demo + SRCS examples/tracy_demo.cc + DEPS PRIVATE TracyClient) endif() enable_testing() @@ -73,10 +84,12 @@ cc_test( spdlog oatpp) -cc_executable( - breakpad_test - SRCS src/breakpad_test.cc - DEPS PUBLIC breakpad) +if(breakpd_ADDED) + cc_executable( + breakpad_test + SRCS src/breakpad_test.cc + DEPS PUBLIC breakpad) +endif() cc_benchmark( calc_benchmark diff --git a/examples/microprofile_demo.cc b/examples/microprofile_demo.cc index 64b6463..b00dd11 100644 --- a/examples/microprofile_demo.cc +++ b/examples/microprofile_demo.cc @@ -8,7 +8,8 @@ MICROPROFILE_DEFINE(MAIN, "MAIN", "Main", MP_AUTO); void Test() { - MICROPROFILE_TIMELINE_SCOPE(MP_AUTO, "one"); + MICROPROFILE_SCOPEI("sleep-test", "sleep_for_ms", MP_AUTO); + std::this_thread::sleep_for(std::chrono::milliseconds(1)); } int main() @@ -17,13 +18,14 @@ int main() MicroProfileSetEnableAllGroups(true); MicroProfileSetForceMetaCounters(true); printf("port: %d\n", MicroProfileWebServerPort()); - MicroProfileStartAutoFlip(30); + // MicroProfileStartAutoFlip(30); while (true) { + MicroProfileFlip(0); + MICROPROFILE_COUNTER_ADD("test_counter", 1); MICROPROFILE_SCOPE(MAIN); Test(); - std::this_thread::sleep_for(std::chrono::milliseconds(1)); } MicroProfileStopAutoFlip(); MicroProfileShutdown(); diff --git a/examples/tracy_demo.cc b/examples/tracy_demo.cc new file mode 100644 index 0000000..efca6ba --- /dev/null +++ b/examples/tracy_demo.cc @@ -0,0 +1,15 @@ +#include +void Test() +{ + std::this_thread::sleep_for(std::chrono::milliseconds(1)); +} + +int main() +{ + ZoneScoped; + while (true) + { + Test(); + } + return 0; +} diff --git a/third_party/breakpad/CMakeLists.txt b/third_party/breakpad/CMakeLists.txt index 1aadbe6..4847410 100644 --- a/third_party/breakpad/CMakeLists.txt +++ b/third_party/breakpad/CMakeLists.txt @@ -8,6 +8,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_POSITION_INDEPENDENT_CODE ON) add_library( breakpad-common STATIC + src/third_party/miniz/miniz.c src/common/linux/breakpad_getcontext.S src/common/dwarf_range_list_handler.cc src/common/stabs_to_module.cc @@ -109,7 +110,8 @@ add_library( src/client/minidump_file_writer.cc) target_include_directories(breakpad-common PUBLIC src/) -target_link_libraries(breakpad-common PRIVATE z) +find_package(Threads REQUIRED) +target_link_libraries(breakpad-common PRIVATE Threads::Threads) target_include_directories(breakpad PUBLIC src/) target_link_libraries(breakpad PRIVATE breakpad-common) diff --git a/third_party/breakpad/src/common/dwarf/elf_reader.h b/third_party/breakpad/src/common/dwarf/elf_reader.h index acc2f4e..74f123e 100644 --- a/third_party/breakpad/src/common/dwarf/elf_reader.h +++ b/third_party/breakpad/src/common/dwarf/elf_reader.h @@ -16,7 +16,6 @@ #define COMMON_DWARF_ELF_READER_H__ #include -#include #include #include "common/dwarf/types.h" @@ -25,149 +24,144 @@ using std::pair; using std::vector; -namespace google_breakpad { +namespace google_breakpad +{ class SymbolMap; class Elf32; class Elf64; -template -class ElfReaderImpl; +template class ElfReaderImpl; -class ElfReader { - public: - explicit ElfReader(const string& path); - ~ElfReader(); +class ElfReader +{ + public: + explicit ElfReader(const string &path); + ~ElfReader(); - // Parse the ELF prologue of this file and return whether it was - // successfully parsed and matches the word size and byte order of - // the current process. - bool IsNativeElfFile() const; + // Parse the ELF prologue of this file and return whether it was + // successfully parsed and matches the word size and byte order of + // the current process. + bool IsNativeElfFile() const; - // Similar to IsNativeElfFile but checks if it's a 32-bit ELF file. - bool IsElf32File() const; + // Similar to IsNativeElfFile but checks if it's a 32-bit ELF file. + bool IsElf32File() const; - // Similar to IsNativeElfFile but checks if it's a 64-bit ELF file. - bool IsElf64File() const; + // Similar to IsNativeElfFile but checks if it's a 64-bit ELF file. + bool IsElf64File() const; - // Checks if it's an ELF file of type ET_DYN (shared object file). - bool IsDynamicSharedObject(); + // Checks if it's an ELF file of type ET_DYN (shared object file). + bool IsDynamicSharedObject(); - // Add symbols in the given ELF file into the provided SymbolMap, - // assuming that the file has been loaded into the specified - // offset. - // - // The remaining arguments are typically taken from a - // ProcMapsIterator (base/sysinfo.h) and describe which portions of - // the ELF file are mapped into which parts of memory: - // - // mem_offset - position at which the segment is mapped into memory - // file_offset - offset in the file where the mapping begins - // length - length of the mapped segment - void AddSymbols(SymbolMap* symbols, - uint64_t mem_offset, - uint64_t file_offset, - uint64_t length); + // Add symbols in the given ELF file into the provided SymbolMap, + // assuming that the file has been loaded into the specified + // offset. + // + // The remaining arguments are typically taken from a + // ProcMapsIterator (base/sysinfo.h) and describe which portions of + // the ELF file are mapped into which parts of memory: + // + // mem_offset - position at which the segment is mapped into memory + // file_offset - offset in the file where the mapping begins + // length - length of the mapped segment + void AddSymbols(SymbolMap *symbols, uint64_t mem_offset, uint64_t file_offset, uint64_t length); - class SymbolSink { - public: - virtual ~SymbolSink() {} - virtual void AddSymbol(const char* name, - uint64_t address, - uint64_t size) = 0; - }; + class SymbolSink + { + public: + virtual ~SymbolSink() + { + } + virtual void AddSymbol(const char *name, uint64_t address, uint64_t size) = 0; + }; - // Like AddSymbols above, but with no address correction. - // Processes any SHT_SYMTAB section, followed by any SHT_DYNSYM section. - void VisitSymbols(SymbolSink* sink); + // Like AddSymbols above, but with no address correction. + // Processes any SHT_SYMTAB section, followed by any SHT_DYNSYM section. + void VisitSymbols(SymbolSink *sink); - // Like VisitSymbols above, but for a specific symbol binding/type. - // A negative value for the binding and type parameters means any - // binding or type. - void VisitSymbols(SymbolSink* sink, int symbol_binding, int symbol_type); + // Like VisitSymbols above, but for a specific symbol binding/type. + // A negative value for the binding and type parameters means any + // binding or type. + void VisitSymbols(SymbolSink *sink, int symbol_binding, int symbol_type); - // Like VisitSymbols above but can optionally export raw symbol values instead - // of adjusted ones. - void VisitSymbols(SymbolSink* sink, - int symbol_binding, - int symbol_type, - bool get_raw_symbol_values); + // Like VisitSymbols above but can optionally export raw symbol values instead + // of adjusted ones. + void VisitSymbols(SymbolSink *sink, int symbol_binding, int symbol_type, bool get_raw_symbol_values); - // p_vaddr of the first PT_LOAD segment (if any), or 0 if no PT_LOAD - // segments are present. This is the address an ELF image was linked - // (by static linker) to be loaded at. Usually (but not always) 0 for - // shared libraries and position-independent executables. - uint64_t VaddrOfFirstLoadSegment(); + // p_vaddr of the first PT_LOAD segment (if any), or 0 if no PT_LOAD + // segments are present. This is the address an ELF image was linked + // (by static linker) to be loaded at. Usually (but not always) 0 for + // shared libraries and position-independent executables. + uint64_t VaddrOfFirstLoadSegment(); - // Return the name of section "shndx". Returns NULL if the section - // is not found. - const char* GetSectionName(int shndx); + // Return the name of section "shndx". Returns NULL if the section + // is not found. + const char *GetSectionName(int shndx); - // Return the number of sections in the given ELF file. - uint64_t GetNumSections(); + // Return the number of sections in the given ELF file. + uint64_t GetNumSections(); - // Get section "shndx" from the given ELF file. On success, return - // the pointer to the section and store the size in "size". - // On error, return NULL. The returned section data is only valid - // until the ElfReader gets destroyed. - const char* GetSectionByIndex(int shndx, size_t* size); + // Get section "shndx" from the given ELF file. On success, return + // the pointer to the section and store the size in "size". + // On error, return NULL. The returned section data is only valid + // until the ElfReader gets destroyed. + const char *GetSectionByIndex(int shndx, size_t *size); - // Get section with "section_name" (ex. ".text", ".symtab") in the - // given ELF file. On success, return the pointer to the section - // and store the size in "size". On error, return NULL. The - // returned section data is only valid until the ElfReader gets - // destroyed. - const char* GetSectionByName(const string& section_name, size_t* size); + // Get section with "section_name" (ex. ".text", ".symtab") in the + // given ELF file. On success, return the pointer to the section + // and store the size in "size". On error, return NULL. The + // returned section data is only valid until the ElfReader gets + // destroyed. + const char *GetSectionByName(const string §ion_name, size_t *size); - // This is like GetSectionByName() but it returns a lot of extra information - // about the section. The SectionInfo structure is almost identical to - // the typedef struct Elf64_Shdr defined in , but is redefined - // here so that the many short macro names in don't have to be - // added to our already cluttered namespace. - struct SectionInfo { - uint32_t type; // Section type (SHT_xxx constant from elf.h). - uint64_t flags; // Section flags (SHF_xxx constants from elf.h). - uint64_t addr; // Section virtual address at execution. - uint64_t offset; // Section file offset. - uint64_t size; // Section size in bytes. - uint32_t link; // Link to another section. - uint32_t info; // Additional section information. - uint64_t addralign; // Section alignment. - uint64_t entsize; // Entry size if section holds a table. - }; - const char* GetSectionInfoByName(const string& section_name, - SectionInfo* info); + // This is like GetSectionByName() but it returns a lot of extra information + // about the section. The SectionInfo structure is almost identical to + // the typedef struct Elf64_Shdr defined in , but is redefined + // here so that the many short macro names in don't have to be + // added to our already cluttered namespace. + struct SectionInfo + { + uint32_t type; // Section type (SHT_xxx constant from elf.h). + uint64_t flags; // Section flags (SHF_xxx constants from elf.h). + uint64_t addr; // Section virtual address at execution. + uint64_t offset; // Section file offset. + uint64_t size; // Section size in bytes. + uint32_t link; // Link to another section. + uint32_t info; // Additional section information. + uint64_t addralign; // Section alignment. + uint64_t entsize; // Entry size if section holds a table. + }; + const char *GetSectionInfoByName(const string §ion_name, SectionInfo *info); - // Check if "path" is an ELF binary that has not been stripped of symbol - // tables. This function supports both 32-bit and 64-bit ELF binaries. - static bool IsNonStrippedELFBinary(const string& path); + // Check if "path" is an ELF binary that has not been stripped of symbol + // tables. This function supports both 32-bit and 64-bit ELF binaries. + static bool IsNonStrippedELFBinary(const string &path); - // Check if "path" is an ELF binary that has not been stripped of debug - // info. Unlike IsNonStrippedELFBinary, this function will return - // false for binaries passed through "strip -S". - static bool IsNonDebugStrippedELFBinary(const string& path); + // Check if "path" is an ELF binary that has not been stripped of debug + // info. Unlike IsNonStrippedELFBinary, this function will return + // false for binaries passed through "strip -S". + static bool IsNonDebugStrippedELFBinary(const string &path); - // Match a requested section name with the section name as it - // appears in the elf-file, adjusting for compressed debug section - // names. For example, returns true if name == ".debug_abbrev" and - // sh_name == ".zdebug_abbrev" - static bool SectionNamesMatch(const std::string& name, - const std::string& sh_name); + // Match a requested section name with the section name as it + // appears in the elf-file, adjusting for compressed debug section + // names. For example, returns true if name == ".debug_abbrev" and + // sh_name == ".zdebug_abbrev" + static bool SectionNamesMatch(const std::string &name, const std::string &sh_name); - private: - // Lazily initialize impl32_ and return it. - ElfReaderImpl* GetImpl32(); - // Ditto for impl64_. - ElfReaderImpl* GetImpl64(); + private: + // Lazily initialize impl32_ and return it. + ElfReaderImpl *GetImpl32(); + // Ditto for impl64_. + ElfReaderImpl *GetImpl64(); - // Path of the file we're reading. - const string path_; - // Read-only file descriptor for the file. May be -1 if there was an - // error during open. - int fd_; - ElfReaderImpl* impl32_; - ElfReaderImpl* impl64_; + // Path of the file we're reading. + const string path_; + // Read-only file descriptor for the file. May be -1 if there was an + // error during open. + int fd_; + ElfReaderImpl *impl32_; + ElfReaderImpl *impl64_; }; -} // namespace google_breakpad +} // namespace google_breakpad -#endif // COMMON_DWARF_ELF_READER_H__ +#endif // COMMON_DWARF_ELF_READER_H__ diff --git a/third_party/breakpad/src/common/linux/dump_symbols.cc b/third_party/breakpad/src/common/linux/dump_symbols.cc index f0680a9..23a961e 100644 --- a/third_party/breakpad/src/common/linux/dump_symbols.cc +++ b/third_party/breakpad/src/common/linux/dump_symbols.cc @@ -32,7 +32,7 @@ // Find all the debugging info in a file and dump it as a Breakpad symbol file. #ifdef HAVE_CONFIG_H -#include // Must come first +#include // Must come first #endif #include "common/linux/dump_symbols.h" @@ -50,7 +50,8 @@ #include #include #include -#include +// #include +#include "third_party/miniz/miniz.h" #ifdef HAVE_LIBZSTD #include #endif @@ -69,9 +70,9 @@ #include "common/dwarf_range_list_handler.h" #include "common/linux/crc32.h" #include "common/linux/eintr_wrapper.h" -#include "common/linux/elfutils.h" -#include "common/linux/elfutils-inl.h" #include "common/linux/elf_symbols_to_module.h" +#include "common/linux/elfutils-inl.h" +#include "common/linux/elfutils.h" #include "common/linux/file_id.h" #include "common/memory_allocator.h" #include "common/module.h" @@ -84,7 +85,8 @@ #include "common/using_std_string.h" // This namespace contains helper functions. -namespace { +namespace +{ using google_breakpad::DumpOptions; using google_breakpad::DwarfCFIToModule; @@ -94,13 +96,13 @@ using google_breakpad::DwarfRangeListHandler; using google_breakpad::ElfClass; using google_breakpad::ElfClass32; using google_breakpad::ElfClass64; -using google_breakpad::elf::FileID; using google_breakpad::FindElfSectionByName; using google_breakpad::GetOffset; using google_breakpad::IsValidElf; -using google_breakpad::elf::kDefaultBuildIdSize; using google_breakpad::Module; using google_breakpad::PageAllocator; +using google_breakpad::elf::FileID; +using google_breakpad::elf::kDefaultBuildIdSize; #ifndef NO_STABS_SUPPORT using google_breakpad::StabsToModule; #endif @@ -108,7 +110,7 @@ using google_breakpad::wasteful_vector; // Define AARCH64 ELF architecture if host machine does not include this define. #ifndef EM_AARCH64 -#define EM_AARCH64 183 +#define EM_AARCH64 183 #endif // Define ZStd compression if host machine does not include this define. @@ -121,24 +123,30 @@ using google_breakpad::wasteful_vector; // // Wrapper class to make sure opened file is closed. // -class FDWrapper { - public: - explicit FDWrapper(int fd) : - fd_(fd) {} - ~FDWrapper() { - if (fd_ != -1) - close(fd_); - } - int get() { - return fd_; - } - int release() { - int fd = fd_; - fd_ = -1; - return fd; - } - private: - int fd_; +class FDWrapper +{ + public: + explicit FDWrapper(int fd) : fd_(fd) + { + } + ~FDWrapper() + { + if (fd_ != -1) + close(fd_); + } + int get() + { + return fd_; + } + int release() + { + int fd = fd_; + fd_ = -1; + return fd; + } + + private: + int fd_; }; // @@ -146,370 +154,347 @@ class FDWrapper { // // Wrapper class to make sure mapped regions are unmapped. // -class MmapWrapper { - public: - MmapWrapper() : is_set_(false) {} - ~MmapWrapper() { - if (is_set_ && base_ != nullptr) { - assert(size_ > 0); - munmap(base_, size_); +class MmapWrapper +{ + public: + MmapWrapper() : is_set_(false) + { + } + ~MmapWrapper() + { + if (is_set_ && base_ != nullptr) + { + assert(size_ > 0); + munmap(base_, size_); + } + } + void set(void *mapped_address, size_t mapped_size) + { + is_set_ = true; + base_ = mapped_address; + size_ = mapped_size; + } + void release() + { + assert(is_set_); + is_set_ = false; + base_ = nullptr; + size_ = 0; } - } - void set(void* mapped_address, size_t mapped_size) { - is_set_ = true; - base_ = mapped_address; - size_ = mapped_size; - } - void release() { - assert(is_set_); - is_set_ = false; - base_ = nullptr; - size_ = 0; - } - private: - bool is_set_; - void* base_; - size_t size_; + private: + bool is_set_; + void *base_; + size_t size_; }; // Find the preferred loading address of the binary. -template -typename ElfClass::Addr GetLoadingAddress( - const typename ElfClass::Phdr* program_headers, - int nheader) { - typedef typename ElfClass::Phdr Phdr; +template +typename ElfClass::Addr GetLoadingAddress(const typename ElfClass::Phdr *program_headers, int nheader) +{ + typedef typename ElfClass::Phdr Phdr; - // For non-PIC executables (e_type == ET_EXEC), the load address is - // the start address of the first PT_LOAD segment. (ELF requires - // the segments to be sorted by load address.) For PIC executables - // and dynamic libraries (e_type == ET_DYN), this address will - // normally be zero. - for (int i = 0; i < nheader; ++i) { - const Phdr& header = program_headers[i]; - if (header.p_type == PT_LOAD) - return header.p_vaddr; - } - return 0; + // For non-PIC executables (e_type == ET_EXEC), the load address is + // the start address of the first PT_LOAD segment. (ELF requires + // the segments to be sorted by load address.) For PIC executables + // and dynamic libraries (e_type == ET_DYN), this address will + // normally be zero. + for (int i = 0; i < nheader; ++i) + { + const Phdr &header = program_headers[i]; + if (header.p_type == PT_LOAD) + return header.p_vaddr; + } + return 0; } // Find the set of address ranges for all PT_LOAD segments. template -vector GetPtLoadSegmentRanges( - const typename ElfClass::Phdr* program_headers, - int nheader) { - typedef typename ElfClass::Phdr Phdr; - vector ranges; +vector GetPtLoadSegmentRanges(const typename ElfClass::Phdr *program_headers, int nheader) +{ + typedef typename ElfClass::Phdr Phdr; + vector ranges; - for (int i = 0; i < nheader; ++i) { - const Phdr& header = program_headers[i]; - if (header.p_type == PT_LOAD) { - ranges.push_back(Module::Range(header.p_vaddr, header.p_memsz)); + for (int i = 0; i < nheader; ++i) + { + const Phdr &header = program_headers[i]; + if (header.p_type == PT_LOAD) + { + ranges.push_back(Module::Range(header.p_vaddr, header.p_memsz)); + } } - } - return ranges; + return ranges; } #ifndef NO_STABS_SUPPORT -template -bool LoadStabs(const typename ElfClass::Ehdr* elf_header, - const typename ElfClass::Shdr* stab_section, - const typename ElfClass::Shdr* stabstr_section, - const bool big_endian, - Module* module) { - // A callback object to handle data from the STABS reader. - StabsToModule handler(module); - // Find the addresses of the STABS data, and create a STABS reader object. - // On Linux, STABS entries always have 32-bit values, regardless of the - // address size of the architecture whose code they're describing, and - // the strings are always "unitized". - const uint8_t* stabs = - GetOffset(elf_header, stab_section->sh_offset); - const uint8_t* stabstr = - GetOffset(elf_header, stabstr_section->sh_offset); - google_breakpad::StabsReader reader(stabs, stab_section->sh_size, - stabstr, stabstr_section->sh_size, - big_endian, 4, true, &handler); - // Read the STABS data, and do post-processing. - if (!reader.Process()) - return false; - handler.Finalize(); - return true; +template +bool LoadStabs(const typename ElfClass::Ehdr *elf_header, const typename ElfClass::Shdr *stab_section, + const typename ElfClass::Shdr *stabstr_section, const bool big_endian, Module *module) +{ + // A callback object to handle data from the STABS reader. + StabsToModule handler(module); + // Find the addresses of the STABS data, and create a STABS reader object. + // On Linux, STABS entries always have 32-bit values, regardless of the + // address size of the architecture whose code they're describing, and + // the strings are always "unitized". + const uint8_t *stabs = GetOffset(elf_header, stab_section->sh_offset); + const uint8_t *stabstr = GetOffset(elf_header, stabstr_section->sh_offset); + google_breakpad::StabsReader reader(stabs, stab_section->sh_size, stabstr, stabstr_section->sh_size, big_endian, 4, + true, &handler); + // Read the STABS data, and do post-processing. + if (!reader.Process()) + return false; + handler.Finalize(); + return true; } -#endif // NO_STABS_SUPPORT +#endif // NO_STABS_SUPPORT // A range handler that accepts rangelist data parsed by // google_breakpad::RangeListReader and populates a range vector (typically // owned by a function) with the results. -class DumperRangesHandler : public DwarfCUToModule::RangesHandler { - public: - DumperRangesHandler(google_breakpad::ByteReader* reader) : - reader_(reader) { } +class DumperRangesHandler : public DwarfCUToModule::RangesHandler +{ + public: + DumperRangesHandler(google_breakpad::ByteReader *reader) : reader_(reader) + { + } - bool ReadRanges( - enum google_breakpad::DwarfForm form, uint64_t data, - google_breakpad::RangeListReader::CURangesInfo* cu_info, - vector* ranges) { - DwarfRangeListHandler handler(ranges); - google_breakpad::RangeListReader range_list_reader(reader_, cu_info, - &handler); - return range_list_reader.ReadRanges(form, data); - } + bool ReadRanges(enum google_breakpad::DwarfForm form, uint64_t data, + google_breakpad::RangeListReader::CURangesInfo *cu_info, vector *ranges) + { + DwarfRangeListHandler handler(ranges); + google_breakpad::RangeListReader range_list_reader(reader_, cu_info, &handler); + return range_list_reader.ReadRanges(form, data); + } - private: - google_breakpad::ByteReader* reader_; + private: + google_breakpad::ByteReader *reader_; }; // A line-to-module loader that accepts line number info parsed by // google_breakpad::LineInfo and populates a Module and a line vector // with the results. -class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler { - public: - // Create a line-to-module converter using BYTE_READER. - explicit DumperLineToModule(google_breakpad::ByteReader* byte_reader) - : byte_reader_(byte_reader) { } - void StartCompilationUnit(const string& compilation_dir) { - compilation_dir_ = compilation_dir; - } - void ReadProgram(const uint8_t* program, - uint64_t length, - const uint8_t* string_section, - uint64_t string_section_length, - const uint8_t* line_string_section, - uint64_t line_string_section_length, - Module* module, - std::vector* lines, - std::map* files) { - DwarfLineToModule handler(module, compilation_dir_, lines, files); - google_breakpad::LineInfo parser(program, length, byte_reader_, - string_section, string_section_length, - line_string_section, - line_string_section_length, - &handler); - parser.Start(); - } - private: - string compilation_dir_; - google_breakpad::ByteReader* byte_reader_; +class DumperLineToModule : public DwarfCUToModule::LineToModuleHandler +{ + public: + // Create a line-to-module converter using BYTE_READER. + explicit DumperLineToModule(google_breakpad::ByteReader *byte_reader) : byte_reader_(byte_reader) + { + } + void StartCompilationUnit(const string &compilation_dir) + { + compilation_dir_ = compilation_dir; + } + void ReadProgram(const uint8_t *program, uint64_t length, const uint8_t *string_section, + uint64_t string_section_length, const uint8_t *line_string_section, + uint64_t line_string_section_length, Module *module, std::vector *lines, + std::map *files) + { + DwarfLineToModule handler(module, compilation_dir_, lines, files); + google_breakpad::LineInfo parser(program, length, byte_reader_, string_section, string_section_length, + line_string_section, line_string_section_length, &handler); + parser.Start(); + } + + private: + string compilation_dir_; + google_breakpad::ByteReader *byte_reader_; }; -template -bool IsCompressedHeader(const typename ElfClass::Shdr* section) { - return (section->sh_flags & SHF_COMPRESSED) != 0; +template bool IsCompressedHeader(const typename ElfClass::Shdr *section) +{ + return (section->sh_flags & SHF_COMPRESSED) != 0; } -template -uint32_t GetCompressionHeader( - typename ElfClass::Chdr& compression_header, - const uint8_t* content, uint64_t size) { - const typename ElfClass::Chdr* header = - reinterpret_cast(content); +template +uint32_t GetCompressionHeader(typename ElfClass::Chdr &compression_header, const uint8_t *content, uint64_t size) +{ + const typename ElfClass::Chdr *header = reinterpret_cast(content); - if (size < sizeof (*header)) { - return 0; - } + if (size < sizeof(*header)) + { + return 0; + } - compression_header = *header; - return sizeof (*header); + compression_header = *header; + return sizeof(*header); } -std::pair UncompressZlibSectionContents( - const uint8_t* compressed_buffer, uint64_t compressed_size, uint64_t uncompressed_size) { - google_breakpad::scoped_array uncompressed_buffer( - new uint8_t[uncompressed_size]); +std::pair UncompressZlibSectionContents(const uint8_t *compressed_buffer, uint64_t compressed_size, + uint64_t uncompressed_size) +{ + google_breakpad::scoped_array uncompressed_buffer(new uint8_t[uncompressed_size]); - uLongf size = static_cast(uncompressed_size); + uLongf size = static_cast(uncompressed_size); - int status = uncompress( - uncompressed_buffer.get(), &size, compressed_buffer, compressed_size); + int status = uncompress(uncompressed_buffer.get(), &size, compressed_buffer, compressed_size); - return status != Z_OK - ? std::make_pair(nullptr, 0) - : std::make_pair(uncompressed_buffer.release(), uncompressed_size); + return status != Z_OK ? std::make_pair(nullptr, 0) + : std::make_pair(uncompressed_buffer.release(), uncompressed_size); } #ifdef HAVE_LIBZSTD -std::pair UncompressZstdSectionContents( - const uint8_t* compressed_buffer, uint64_t compressed_size,uint64_t uncompressed_size) { +std::pair UncompressZstdSectionContents(const uint8_t *compressed_buffer, uint64_t compressed_size, + uint64_t uncompressed_size) +{ + + google_breakpad::scoped_array uncompressed_buffer(new uint8_t[uncompressed_size]); + size_t out_size = ZSTD_decompress(uncompressed_buffer.get(), uncompressed_size, compressed_buffer, compressed_size); + if (ZSTD_isError(out_size)) + { + return std::make_pair(nullptr, 0); + } + assert(out_size == uncompressed_size); + return std::make_pair(uncompressed_buffer.release(), uncompressed_size); +} +#endif + +std::pair UncompressSectionContents(uint64_t compression_type, const uint8_t *compressed_buffer, + uint64_t compressed_size, uint64_t uncompressed_size) +{ + if (compression_type == ELFCOMPRESS_ZLIB) + { + return UncompressZlibSectionContents(compressed_buffer, compressed_size, uncompressed_size); + } + +#ifdef HAVE_LIBZSTD + if (compression_type == ELFCOMPRESS_ZSTD) + { + return UncompressZstdSectionContents(compressed_buffer, compressed_size, uncompressed_size); + } +#endif - google_breakpad::scoped_array uncompressed_buffer(new uint8_t[uncompressed_size]); - size_t out_size = ZSTD_decompress(uncompressed_buffer.get(), uncompressed_size, - compressed_buffer, compressed_size); - if (ZSTD_isError(out_size)) { return std::make_pair(nullptr, 0); - } - assert(out_size == uncompressed_size); - return std::make_pair(uncompressed_buffer.release(), uncompressed_size); -} -#endif - -std::pair UncompressSectionContents( - uint64_t compression_type, const uint8_t* compressed_buffer, - uint64_t compressed_size, uint64_t uncompressed_size) { - if (compression_type == ELFCOMPRESS_ZLIB) { - return UncompressZlibSectionContents(compressed_buffer, compressed_size, uncompressed_size); - } - -#ifdef HAVE_LIBZSTD - if (compression_type == ELFCOMPRESS_ZSTD) { - return UncompressZstdSectionContents(compressed_buffer, compressed_size, uncompressed_size); - } -#endif - - return std::make_pair(nullptr, 0); } -void StartProcessSplitDwarf(google_breakpad::CompilationUnit* reader, - Module* module, - google_breakpad::Endianness endianness, - bool handle_inter_cu_refs, - bool handle_inline) { - std::string split_file; - google_breakpad::SectionMap split_sections; - google_breakpad::ByteReader split_byte_reader(endianness); - uint64_t cu_offset = 0; - if (!reader->ProcessSplitDwarf(split_file, split_sections, split_byte_reader, - cu_offset)) - return; - DwarfCUToModule::FileContext file_context(split_file, module, - handle_inter_cu_refs); - for (auto section : split_sections) - file_context.AddSectionToSectionMap(section.first, section.second.first, - section.second.second); - // Because DWP/DWO file doesn't have .debug_addr/.debug_line/.debug_line_str, - // its debug info will refer to .debug_addr/.debug_line in the main binary. - if (file_context.section_map().find(".debug_addr") == - file_context.section_map().end()) - file_context.AddSectionToSectionMap(".debug_addr", reader->GetAddrBuffer(), - reader->GetAddrBufferLen()); - if (file_context.section_map().find(".debug_line") == - file_context.section_map().end()) - file_context.AddSectionToSectionMap(".debug_line", reader->GetLineBuffer(), - reader->GetLineBufferLen()); - if (file_context.section_map().find(".debug_line_str") == - file_context.section_map().end()) - file_context.AddSectionToSectionMap(".debug_line_str", - reader->GetLineStrBuffer(), - reader->GetLineStrBufferLen()); +void StartProcessSplitDwarf(google_breakpad::CompilationUnit *reader, Module *module, + google_breakpad::Endianness endianness, bool handle_inter_cu_refs, bool handle_inline) +{ + std::string split_file; + google_breakpad::SectionMap split_sections; + google_breakpad::ByteReader split_byte_reader(endianness); + uint64_t cu_offset = 0; + if (!reader->ProcessSplitDwarf(split_file, split_sections, split_byte_reader, cu_offset)) + return; + DwarfCUToModule::FileContext file_context(split_file, module, handle_inter_cu_refs); + for (auto section : split_sections) + file_context.AddSectionToSectionMap(section.first, section.second.first, section.second.second); + // Because DWP/DWO file doesn't have .debug_addr/.debug_line/.debug_line_str, + // its debug info will refer to .debug_addr/.debug_line in the main binary. + if (file_context.section_map().find(".debug_addr") == file_context.section_map().end()) + file_context.AddSectionToSectionMap(".debug_addr", reader->GetAddrBuffer(), reader->GetAddrBufferLen()); + if (file_context.section_map().find(".debug_line") == file_context.section_map().end()) + file_context.AddSectionToSectionMap(".debug_line", reader->GetLineBuffer(), reader->GetLineBufferLen()); + if (file_context.section_map().find(".debug_line_str") == file_context.section_map().end()) + file_context.AddSectionToSectionMap(".debug_line_str", reader->GetLineStrBuffer(), + reader->GetLineStrBufferLen()); - DumperRangesHandler ranges_handler(&split_byte_reader); - DumperLineToModule line_to_module(&split_byte_reader); - DwarfCUToModule::WarningReporter reporter(split_file, cu_offset); - DwarfCUToModule root_handler( - &file_context, &line_to_module, &ranges_handler, &reporter, handle_inline, - reader->GetLowPC(), reader->GetAddrBase(), reader->HasSourceLineInfo(), - reader->GetSourceLineOffset()); - google_breakpad::DIEDispatcher die_dispatcher(&root_handler); - google_breakpad::CompilationUnit split_reader( - split_file, file_context.section_map(), cu_offset, &split_byte_reader, - &die_dispatcher); - split_reader.SetSplitDwarf(reader->GetAddrBase(), reader->GetDWOID()); - split_reader.Start(); - // Normally, it won't happen unless we have transitive reference. - if (split_reader.ShouldProcessSplitDwarf()) { - StartProcessSplitDwarf(&split_reader, module, endianness, - handle_inter_cu_refs, handle_inline); - } -} - -template -bool LoadDwarf(const string& dwarf_filename, - const typename ElfClass::Ehdr* elf_header, - const bool big_endian, - bool handle_inter_cu_refs, - bool handle_inline, - Module* module) { - typedef typename ElfClass::Shdr Shdr; - - const google_breakpad::Endianness endianness = big_endian ? - google_breakpad::ENDIANNESS_BIG : google_breakpad::ENDIANNESS_LITTLE; - google_breakpad::ByteReader byte_reader(endianness); - - // Construct a context for this file. - DwarfCUToModule::FileContext file_context(dwarf_filename, - module, - handle_inter_cu_refs); - - // Build a map of the ELF file's sections. - const Shdr* sections = - GetOffset(elf_header, elf_header->e_shoff); - int num_sections = elf_header->e_shnum; - const Shdr* section_names = sections + elf_header->e_shstrndx; - for (int i = 0; i < num_sections; i++) { - const Shdr* section = §ions[i]; - string name = GetOffset(elf_header, - section_names->sh_offset) + - section->sh_name; - const uint8_t* contents = GetOffset(elf_header, - section->sh_offset); - uint64_t size = section->sh_size; - - if (!IsCompressedHeader(section)) { - file_context.AddSectionToSectionMap(name, contents, size); - continue; - } - - typename ElfClass::Chdr chdr; - - uint32_t compression_header_size = - GetCompressionHeader(chdr, contents, size); - - if (compression_header_size == 0 || chdr.ch_size == 0) { - continue; - } - - contents += compression_header_size; - size -= compression_header_size; - - std::pair uncompressed = - UncompressSectionContents(chdr.ch_type, contents, size, chdr.ch_size); - - if (uncompressed.first != nullptr && uncompressed.second != 0) { - file_context.AddManagedSectionToSectionMap(name, uncompressed.first, uncompressed.second); - } - } - - // .debug_ranges and .debug_rnglists reader - DumperRangesHandler ranges_handler(&byte_reader); - - // Parse all the compilation units in the .debug_info section. - DumperLineToModule line_to_module(&byte_reader); - google_breakpad::SectionMap::const_iterator debug_info_entry = - file_context.section_map().find(".debug_info"); - assert(debug_info_entry != file_context.section_map().end()); - const std::pair& debug_info_section = - debug_info_entry->second; - // This should never have been called if the file doesn't have a - // .debug_info section. - assert(debug_info_section.first); - uint64_t debug_info_length = debug_info_section.second; - for (uint64_t offset = 0; offset < debug_info_length;) { - // Make a handler for the root DIE that populates MODULE with the - // data that was found. - DwarfCUToModule::WarningReporter reporter(dwarf_filename, offset); - DwarfCUToModule root_handler(&file_context, &line_to_module, - &ranges_handler, &reporter, handle_inline); - // Make a Dwarf2Handler that drives the DIEHandler. + DumperRangesHandler ranges_handler(&split_byte_reader); + DumperLineToModule line_to_module(&split_byte_reader); + DwarfCUToModule::WarningReporter reporter(split_file, cu_offset); + DwarfCUToModule root_handler(&file_context, &line_to_module, &ranges_handler, &reporter, handle_inline, + reader->GetLowPC(), reader->GetAddrBase(), reader->HasSourceLineInfo(), + reader->GetSourceLineOffset()); google_breakpad::DIEDispatcher die_dispatcher(&root_handler); - // Make a DWARF parser for the compilation unit at OFFSET. - google_breakpad::CompilationUnit reader(dwarf_filename, - file_context.section_map(), - offset, - &byte_reader, - &die_dispatcher); - // Process the entire compilation unit; get the offset of the next. - uint64_t result = reader.Start(); - if (result == 0) { - return false; + google_breakpad::CompilationUnit split_reader(split_file, file_context.section_map(), cu_offset, &split_byte_reader, + &die_dispatcher); + split_reader.SetSplitDwarf(reader->GetAddrBase(), reader->GetDWOID()); + split_reader.Start(); + // Normally, it won't happen unless we have transitive reference. + if (split_reader.ShouldProcessSplitDwarf()) + { + StartProcessSplitDwarf(&split_reader, module, endianness, handle_inter_cu_refs, handle_inline); } - offset += result; - // Start to process split dwarf file. - if (reader.ShouldProcessSplitDwarf()) { - StartProcessSplitDwarf(&reader, module, endianness, handle_inter_cu_refs, - handle_inline); +} + +template +bool LoadDwarf(const string &dwarf_filename, const typename ElfClass::Ehdr *elf_header, const bool big_endian, + bool handle_inter_cu_refs, bool handle_inline, Module *module) +{ + typedef typename ElfClass::Shdr Shdr; + + const google_breakpad::Endianness endianness = + big_endian ? google_breakpad::ENDIANNESS_BIG : google_breakpad::ENDIANNESS_LITTLE; + google_breakpad::ByteReader byte_reader(endianness); + + // Construct a context for this file. + DwarfCUToModule::FileContext file_context(dwarf_filename, module, handle_inter_cu_refs); + + // Build a map of the ELF file's sections. + const Shdr *sections = GetOffset(elf_header, elf_header->e_shoff); + int num_sections = elf_header->e_shnum; + const Shdr *section_names = sections + elf_header->e_shstrndx; + for (int i = 0; i < num_sections; i++) + { + const Shdr *section = §ions[i]; + string name = GetOffset(elf_header, section_names->sh_offset) + section->sh_name; + const uint8_t *contents = GetOffset(elf_header, section->sh_offset); + uint64_t size = section->sh_size; + + if (!IsCompressedHeader(section)) + { + file_context.AddSectionToSectionMap(name, contents, size); + continue; + } + + typename ElfClass::Chdr chdr; + + uint32_t compression_header_size = GetCompressionHeader(chdr, contents, size); + + if (compression_header_size == 0 || chdr.ch_size == 0) + { + continue; + } + + contents += compression_header_size; + size -= compression_header_size; + + std::pair uncompressed = + UncompressSectionContents(chdr.ch_type, contents, size, chdr.ch_size); + + if (uncompressed.first != nullptr && uncompressed.second != 0) + { + file_context.AddManagedSectionToSectionMap(name, uncompressed.first, uncompressed.second); + } } - } - return true; + + // .debug_ranges and .debug_rnglists reader + DumperRangesHandler ranges_handler(&byte_reader); + + // Parse all the compilation units in the .debug_info section. + DumperLineToModule line_to_module(&byte_reader); + google_breakpad::SectionMap::const_iterator debug_info_entry = file_context.section_map().find(".debug_info"); + assert(debug_info_entry != file_context.section_map().end()); + const std::pair &debug_info_section = debug_info_entry->second; + // This should never have been called if the file doesn't have a + // .debug_info section. + assert(debug_info_section.first); + uint64_t debug_info_length = debug_info_section.second; + for (uint64_t offset = 0; offset < debug_info_length;) + { + // Make a handler for the root DIE that populates MODULE with the + // data that was found. + DwarfCUToModule::WarningReporter reporter(dwarf_filename, offset); + DwarfCUToModule root_handler(&file_context, &line_to_module, &ranges_handler, &reporter, handle_inline); + // Make a Dwarf2Handler that drives the DIEHandler. + google_breakpad::DIEDispatcher die_dispatcher(&root_handler); + // Make a DWARF parser for the compilation unit at OFFSET. + google_breakpad::CompilationUnit reader(dwarf_filename, file_context.section_map(), offset, &byte_reader, + &die_dispatcher); + // Process the entire compilation unit; get the offset of the next. + uint64_t result = reader.Start(); + if (result == 0) + { + return false; + } + offset += result; + // Start to process split dwarf file. + if (reader.ShouldProcessSplitDwarf()) + { + StartProcessSplitDwarf(&reader, module, endianness, handle_inter_cu_refs, handle_inline); + } + } + return true; } // Fill REGISTER_NAMES with the register names appropriate to the @@ -517,260 +502,257 @@ bool LoadDwarf(const string& dwarf_filename, // numbers used in DWARF call frame information. Return true on // success, or false if HEADER's machine architecture is not // supported. -template -bool DwarfCFIRegisterNames(const typename ElfClass::Ehdr* elf_header, - std::vector* register_names) { - switch (elf_header->e_machine) { +template +bool DwarfCFIRegisterNames(const typename ElfClass::Ehdr *elf_header, std::vector *register_names) +{ + switch (elf_header->e_machine) + { case EM_386: - *register_names = DwarfCFIToModule::RegisterNames::I386(); - return true; + *register_names = DwarfCFIToModule::RegisterNames::I386(); + return true; case EM_ARM: - *register_names = DwarfCFIToModule::RegisterNames::ARM(); - return true; + *register_names = DwarfCFIToModule::RegisterNames::ARM(); + return true; case EM_AARCH64: - *register_names = DwarfCFIToModule::RegisterNames::ARM64(); - return true; + *register_names = DwarfCFIToModule::RegisterNames::ARM64(); + return true; case EM_MIPS: - *register_names = DwarfCFIToModule::RegisterNames::MIPS(); - return true; + *register_names = DwarfCFIToModule::RegisterNames::MIPS(); + return true; case EM_X86_64: - *register_names = DwarfCFIToModule::RegisterNames::X86_64(); - return true; + *register_names = DwarfCFIToModule::RegisterNames::X86_64(); + return true; case EM_RISCV: - *register_names = DwarfCFIToModule::RegisterNames::RISCV(); - return true; + *register_names = DwarfCFIToModule::RegisterNames::RISCV(); + return true; default: - return false; - } + return false; + } } -template -bool LoadDwarfCFI(const string& dwarf_filename, - const typename ElfClass::Ehdr* elf_header, - const char* section_name, - const typename ElfClass::Shdr* section, - const bool eh_frame, - const typename ElfClass::Shdr* got_section, - const typename ElfClass::Shdr* text_section, - const bool big_endian, - Module* module) { - // Find the appropriate set of register names for this file's - // architecture. - std::vector register_names; - if (!DwarfCFIRegisterNames(elf_header, ®ister_names)) { - fprintf(stderr, "%s: unrecognized ELF machine architecture '%d';" - " cannot convert DWARF call frame information\n", - dwarf_filename.c_str(), elf_header->e_machine); - return false; - } +template +bool LoadDwarfCFI(const string &dwarf_filename, const typename ElfClass::Ehdr *elf_header, const char *section_name, + const typename ElfClass::Shdr *section, const bool eh_frame, + const typename ElfClass::Shdr *got_section, const typename ElfClass::Shdr *text_section, + const bool big_endian, Module *module) +{ + // Find the appropriate set of register names for this file's + // architecture. + std::vector register_names; + if (!DwarfCFIRegisterNames(elf_header, ®ister_names)) + { + fprintf(stderr, + "%s: unrecognized ELF machine architecture '%d';" + " cannot convert DWARF call frame information\n", + dwarf_filename.c_str(), elf_header->e_machine); + return false; + } - const google_breakpad::Endianness endianness = big_endian ? - google_breakpad::ENDIANNESS_BIG : google_breakpad::ENDIANNESS_LITTLE; + const google_breakpad::Endianness endianness = + big_endian ? google_breakpad::ENDIANNESS_BIG : google_breakpad::ENDIANNESS_LITTLE; - // Find the call frame information and its size. - const uint8_t* cfi = - GetOffset(elf_header, section->sh_offset); - size_t cfi_size = section->sh_size; + // Find the call frame information and its size. + const uint8_t *cfi = GetOffset(elf_header, section->sh_offset); + size_t cfi_size = section->sh_size; - // Plug together the parser, handler, and their entourages. - DwarfCFIToModule::Reporter module_reporter(dwarf_filename, section_name); - DwarfCFIToModule handler(module, register_names, &module_reporter); - google_breakpad::ByteReader byte_reader(endianness); + // Plug together the parser, handler, and their entourages. + DwarfCFIToModule::Reporter module_reporter(dwarf_filename, section_name); + DwarfCFIToModule handler(module, register_names, &module_reporter); + google_breakpad::ByteReader byte_reader(endianness); - byte_reader.SetAddressSize(ElfClass::kAddrSize); + byte_reader.SetAddressSize(ElfClass::kAddrSize); - // Provide the base addresses for .eh_frame encoded pointers, if - // possible. - byte_reader.SetCFIDataBase(section->sh_addr, cfi); - if (got_section) - byte_reader.SetDataBase(got_section->sh_addr); - if (text_section) - byte_reader.SetTextBase(text_section->sh_addr); + // Provide the base addresses for .eh_frame encoded pointers, if + // possible. + byte_reader.SetCFIDataBase(section->sh_addr, cfi); + if (got_section) + byte_reader.SetDataBase(got_section->sh_addr); + if (text_section) + byte_reader.SetTextBase(text_section->sh_addr); - google_breakpad::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename, - section_name); - if (!IsCompressedHeader(section)) { - google_breakpad::CallFrameInfo parser(cfi, cfi_size, - &byte_reader, &handler, + google_breakpad::CallFrameInfo::Reporter dwarf_reporter(dwarf_filename, section_name); + if (!IsCompressedHeader(section)) + { + google_breakpad::CallFrameInfo parser(cfi, cfi_size, &byte_reader, &handler, &dwarf_reporter, eh_frame); + parser.Start(); + return true; + } + + typename ElfClass::Chdr chdr; + uint32_t compression_header_size = GetCompressionHeader(chdr, cfi, cfi_size); + + if (compression_header_size == 0 || chdr.ch_size == 0) + { + fprintf(stderr, "%s: decompression failed at header\n", dwarf_filename.c_str()); + return false; + } + if (compression_header_size > cfi_size) + { + fprintf(stderr, "%s: decompression error, compression_header too large\n", dwarf_filename.c_str()); + return false; + } + + cfi += compression_header_size; + cfi_size -= compression_header_size; + + std::pair uncompressed = UncompressSectionContents(chdr.ch_type, cfi, cfi_size, chdr.ch_size); + + if (uncompressed.first == nullptr || uncompressed.second == 0) + { + fprintf(stderr, "%s: decompression failed\n", dwarf_filename.c_str()); + return false; + } + google_breakpad::CallFrameInfo parser(uncompressed.first, uncompressed.second, &byte_reader, &handler, &dwarf_reporter, eh_frame); parser.Start(); return true; - } - - typename ElfClass::Chdr chdr; - uint32_t compression_header_size = - GetCompressionHeader(chdr, cfi, cfi_size); - - if (compression_header_size == 0 || chdr.ch_size == 0) { - fprintf(stderr, "%s: decompression failed at header\n", - dwarf_filename.c_str()); - return false; - } - if (compression_header_size > cfi_size) { - fprintf(stderr, "%s: decompression error, compression_header too large\n", - dwarf_filename.c_str()); - return false; - } - - cfi += compression_header_size; - cfi_size -= compression_header_size; - - std::pair uncompressed = - UncompressSectionContents(chdr.ch_type, cfi, cfi_size, chdr.ch_size); - - if (uncompressed.first == nullptr || uncompressed.second == 0) { - fprintf(stderr, "%s: decompression failed\n", dwarf_filename.c_str()); - return false; - } - google_breakpad::CallFrameInfo parser(uncompressed.first, uncompressed.second, - &byte_reader, &handler, &dwarf_reporter, - eh_frame); - parser.Start(); - return true; } -bool LoadELF(const string& obj_file, MmapWrapper* map_wrapper, - void** elf_header) { - int obj_fd = open(obj_file.c_str(), O_RDONLY); - if (obj_fd < 0) { - fprintf(stderr, "Failed to open ELF file '%s': %s\n", - obj_file.c_str(), strerror(errno)); - return false; - } - FDWrapper obj_fd_wrapper(obj_fd); - struct stat st; - if (fstat(obj_fd, &st) != 0 && st.st_size <= 0) { - fprintf(stderr, "Unable to fstat ELF file '%s': %s\n", - obj_file.c_str(), strerror(errno)); - return false; - } - void* obj_base = mmap(nullptr, st.st_size, - PROT_READ | PROT_WRITE, MAP_PRIVATE, obj_fd, 0); - if (obj_base == MAP_FAILED) { - fprintf(stderr, "Failed to mmap ELF file '%s': %s\n", - obj_file.c_str(), strerror(errno)); - return false; - } - map_wrapper->set(obj_base, st.st_size); - *elf_header = obj_base; - if (!IsValidElf(*elf_header)) { - fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str()); - return false; - } - return true; +bool LoadELF(const string &obj_file, MmapWrapper *map_wrapper, void **elf_header) +{ + int obj_fd = open(obj_file.c_str(), O_RDONLY); + if (obj_fd < 0) + { + fprintf(stderr, "Failed to open ELF file '%s': %s\n", obj_file.c_str(), strerror(errno)); + return false; + } + FDWrapper obj_fd_wrapper(obj_fd); + struct stat st; + if (fstat(obj_fd, &st) != 0 && st.st_size <= 0) + { + fprintf(stderr, "Unable to fstat ELF file '%s': %s\n", obj_file.c_str(), strerror(errno)); + return false; + } + void *obj_base = mmap(nullptr, st.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, obj_fd, 0); + if (obj_base == MAP_FAILED) + { + fprintf(stderr, "Failed to mmap ELF file '%s': %s\n", obj_file.c_str(), strerror(errno)); + return false; + } + map_wrapper->set(obj_base, st.st_size); + *elf_header = obj_base; + if (!IsValidElf(*elf_header)) + { + fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str()); + return false; + } + return true; } // Get the endianness of ELF_HEADER. If it's invalid, return false. -template -bool ElfEndianness(const typename ElfClass::Ehdr* elf_header, - bool* big_endian) { - if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) { - *big_endian = false; - return true; - } - if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) { - *big_endian = true; - return true; - } +template bool ElfEndianness(const typename ElfClass::Ehdr *elf_header, bool *big_endian) +{ + if (elf_header->e_ident[EI_DATA] == ELFDATA2LSB) + { + *big_endian = false; + return true; + } + if (elf_header->e_ident[EI_DATA] == ELFDATA2MSB) + { + *big_endian = true; + return true; + } - fprintf(stderr, "bad data encoding in ELF header: %d\n", - elf_header->e_ident[EI_DATA]); - return false; + fprintf(stderr, "bad data encoding in ELF header: %d\n", elf_header->e_ident[EI_DATA]); + return false; } // Given |left_abspath|, find the absolute path for |right_path| and see if the // two absolute paths are the same. -bool IsSameFile(const char* left_abspath, const string& right_path) { - char right_abspath[PATH_MAX]; - if (!realpath(right_path.c_str(), right_abspath)) - return false; - return strcmp(left_abspath, right_abspath) == 0; +bool IsSameFile(const char *left_abspath, const string &right_path) +{ + char right_abspath[PATH_MAX]; + if (!realpath(right_path.c_str(), right_abspath)) + return false; + return strcmp(left_abspath, right_abspath) == 0; } // Read the .gnu_debuglink and get the debug file name. If anything goes // wrong, return an empty string. -string ReadDebugLink(const uint8_t* debuglink, - const size_t debuglink_size, - const bool big_endian, - const string& obj_file, - const std::vector& debug_dirs) { - // Include '\0' + CRC32 (4 bytes). - size_t debuglink_len = strlen(reinterpret_cast(debuglink)) + 5; - debuglink_len = 4 * ((debuglink_len + 3) / 4); // Round up to 4 bytes. +string ReadDebugLink(const uint8_t *debuglink, const size_t debuglink_size, const bool big_endian, + const string &obj_file, const std::vector &debug_dirs) +{ + // Include '\0' + CRC32 (4 bytes). + size_t debuglink_len = strlen(reinterpret_cast(debuglink)) + 5; + debuglink_len = 4 * ((debuglink_len + 3) / 4); // Round up to 4 bytes. - // Sanity check. - if (debuglink_len != debuglink_size) { - fprintf(stderr, "Mismatched .gnu_debuglink string / section size: " - "%zx %zx\n", debuglink_len, debuglink_size); - return string(); - } - - char obj_file_abspath[PATH_MAX]; - if (!realpath(obj_file.c_str(), obj_file_abspath)) { - fprintf(stderr, "Cannot resolve absolute path for %s\n", obj_file.c_str()); - return string(); - } - - std::vector searched_paths; - string debuglink_path; - std::vector::const_iterator it; - for (it = debug_dirs.begin(); it < debug_dirs.end(); ++it) { - const string& debug_dir = *it; - debuglink_path = debug_dir + "/" + - reinterpret_cast(debuglink); - - // There is the annoying case of /path/to/foo.so having foo.so as the - // debug link file name. Thus this may end up opening /path/to/foo.so again, - // and there is a small chance of the two files having the same CRC. - if (IsSameFile(obj_file_abspath, debuglink_path)) - continue; - - searched_paths.push_back(debug_dir); - int debuglink_fd = open(debuglink_path.c_str(), O_RDONLY); - if (debuglink_fd < 0) - continue; - - FDWrapper debuglink_fd_wrapper(debuglink_fd); - - // The CRC is the last 4 bytes in |debuglink|. - const google_breakpad::Endianness endianness = big_endian ? - google_breakpad::ENDIANNESS_BIG : google_breakpad::ENDIANNESS_LITTLE; - google_breakpad::ByteReader byte_reader(endianness); - uint32_t expected_crc = - byte_reader.ReadFourBytes(&debuglink[debuglink_size - 4]); - - uint32_t actual_crc = 0; - while (true) { - const size_t kReadSize = 4096; - char buf[kReadSize]; - ssize_t bytes_read = HANDLE_EINTR(read(debuglink_fd, &buf, kReadSize)); - if (bytes_read < 0) { - fprintf(stderr, "Error reading debug ELF file %s.\n", - debuglink_path.c_str()); + // Sanity check. + if (debuglink_len != debuglink_size) + { + fprintf(stderr, + "Mismatched .gnu_debuglink string / section size: " + "%zx %zx\n", + debuglink_len, debuglink_size); return string(); - } - if (bytes_read == 0) - break; - actual_crc = google_breakpad::UpdateCrc32(actual_crc, buf, bytes_read); - } - if (actual_crc != expected_crc) { - fprintf(stderr, "Error reading debug ELF file - CRC32 mismatch: %s\n", - debuglink_path.c_str()); - continue; } - // Found debug file. - return debuglink_path; - } + char obj_file_abspath[PATH_MAX]; + if (!realpath(obj_file.c_str(), obj_file_abspath)) + { + fprintf(stderr, "Cannot resolve absolute path for %s\n", obj_file.c_str()); + return string(); + } - // Not found case. - fprintf(stderr, "Failed to find debug ELF file for '%s' after trying:\n", - obj_file.c_str()); - for (it = searched_paths.begin(); it < searched_paths.end(); ++it) { - const string& debug_dir = *it; - fprintf(stderr, " %s/%s\n", debug_dir.c_str(), debuglink); - } - return string(); + std::vector searched_paths; + string debuglink_path; + std::vector::const_iterator it; + for (it = debug_dirs.begin(); it < debug_dirs.end(); ++it) + { + const string &debug_dir = *it; + debuglink_path = debug_dir + "/" + reinterpret_cast(debuglink); + + // There is the annoying case of /path/to/foo.so having foo.so as the + // debug link file name. Thus this may end up opening /path/to/foo.so again, + // and there is a small chance of the two files having the same CRC. + if (IsSameFile(obj_file_abspath, debuglink_path)) + continue; + + searched_paths.push_back(debug_dir); + int debuglink_fd = open(debuglink_path.c_str(), O_RDONLY); + if (debuglink_fd < 0) + continue; + + FDWrapper debuglink_fd_wrapper(debuglink_fd); + + // The CRC is the last 4 bytes in |debuglink|. + const google_breakpad::Endianness endianness = + big_endian ? google_breakpad::ENDIANNESS_BIG : google_breakpad::ENDIANNESS_LITTLE; + google_breakpad::ByteReader byte_reader(endianness); + uint32_t expected_crc = byte_reader.ReadFourBytes(&debuglink[debuglink_size - 4]); + + uint32_t actual_crc = 0; + while (true) + { + const size_t kReadSize = 4096; + char buf[kReadSize]; + ssize_t bytes_read = HANDLE_EINTR(read(debuglink_fd, &buf, kReadSize)); + if (bytes_read < 0) + { + fprintf(stderr, "Error reading debug ELF file %s.\n", debuglink_path.c_str()); + return string(); + } + if (bytes_read == 0) + break; + actual_crc = google_breakpad::UpdateCrc32(actual_crc, buf, bytes_read); + } + if (actual_crc != expected_crc) + { + fprintf(stderr, "Error reading debug ELF file - CRC32 mismatch: %s\n", debuglink_path.c_str()); + continue; + } + + // Found debug file. + return debuglink_path; + } + + // Not found case. + fprintf(stderr, "Failed to find debug ELF file for '%s' after trying:\n", obj_file.c_str()); + for (it = searched_paths.begin(); it < searched_paths.end(); ++it) + { + const string &debug_dir = *it; + fprintf(stderr, " %s/%s\n", debug_dir.c_str(), debuglink); + } + return string(); } // @@ -780,587 +762,559 @@ string ReadDebugLink(const uint8_t* debuglink, // to follow the .gnu_debuglink section and load debug information from a // different file. // -template -class LoadSymbolsInfo { - public: - typedef typename ElfClass::Addr Addr; +template class LoadSymbolsInfo +{ + public: + typedef typename ElfClass::Addr Addr; - explicit LoadSymbolsInfo(const std::vector& dbg_dirs) : - debug_dirs_(dbg_dirs), - has_loading_addr_(false) {} - - // Keeps track of which sections have been loaded so sections don't - // accidentally get loaded twice from two different files. - void LoadedSection(const string& section) { - if (loaded_sections_.count(section) == 0) { - loaded_sections_.insert(section); - } else { - fprintf(stderr, "Section %s has already been loaded.\n", - section.c_str()); - } - } - - // The ELF file and linked debug file are expected to have the same preferred - // loading address. - void set_loading_addr(Addr addr, const string& filename) { - if (!has_loading_addr_) { - loading_addr_ = addr; - loaded_file_ = filename; - return; + explicit LoadSymbolsInfo(const std::vector &dbg_dirs) : debug_dirs_(dbg_dirs), has_loading_addr_(false) + { } - if (addr != loading_addr_) { - fprintf(stderr, - "ELF file '%s' and debug ELF file '%s' " - "have different load addresses.\n", - loaded_file_.c_str(), filename.c_str()); - assert(false); + // Keeps track of which sections have been loaded so sections don't + // accidentally get loaded twice from two different files. + void LoadedSection(const string §ion) + { + if (loaded_sections_.count(section) == 0) + { + loaded_sections_.insert(section); + } + else + { + fprintf(stderr, "Section %s has already been loaded.\n", section.c_str()); + } } - } - // Setters and getters - const std::vector& debug_dirs() const { - return debug_dirs_; - } + // The ELF file and linked debug file are expected to have the same preferred + // loading address. + void set_loading_addr(Addr addr, const string &filename) + { + if (!has_loading_addr_) + { + loading_addr_ = addr; + loaded_file_ = filename; + return; + } - string debuglink_file() const { - return debuglink_file_; - } - void set_debuglink_file(const string& file) { - debuglink_file_ = file; - } + if (addr != loading_addr_) + { + fprintf(stderr, + "ELF file '%s' and debug ELF file '%s' " + "have different load addresses.\n", + loaded_file_.c_str(), filename.c_str()); + assert(false); + } + } - private: - const std::vector& debug_dirs_; // Directories in which to - // search for the debug ELF file. + // Setters and getters + const std::vector &debug_dirs() const + { + return debug_dirs_; + } - string debuglink_file_; // Full path to the debug ELF file. + string debuglink_file() const + { + return debuglink_file_; + } + void set_debuglink_file(const string &file) + { + debuglink_file_ = file; + } - bool has_loading_addr_; // Indicate if LOADING_ADDR_ is valid. + private: + const std::vector &debug_dirs_; // Directories in which to + // search for the debug ELF file. - Addr loading_addr_; // Saves the preferred loading address from the - // first call to LoadSymbols(). + string debuglink_file_; // Full path to the debug ELF file. - string loaded_file_; // Name of the file loaded from the first call to - // LoadSymbols(). + bool has_loading_addr_; // Indicate if LOADING_ADDR_ is valid. - std::set loaded_sections_; // Tracks the Loaded ELF sections - // between calls to LoadSymbols(). + Addr loading_addr_; // Saves the preferred loading address from the + // first call to LoadSymbols(). + + string loaded_file_; // Name of the file loaded from the first call to + // LoadSymbols(). + + std::set loaded_sections_; // Tracks the Loaded ELF sections + // between calls to LoadSymbols(). }; -template -bool LoadSymbols(const string& obj_file, - const bool big_endian, - const typename ElfClass::Ehdr* elf_header, - const bool read_gnu_debug_link, - LoadSymbolsInfo* info, - const DumpOptions& options, - Module* module) { - typedef typename ElfClass::Addr Addr; - typedef typename ElfClass::Phdr Phdr; - typedef typename ElfClass::Shdr Shdr; +template +bool LoadSymbols(const string &obj_file, const bool big_endian, const typename ElfClass::Ehdr *elf_header, + const bool read_gnu_debug_link, LoadSymbolsInfo *info, const DumpOptions &options, + Module *module) +{ + typedef typename ElfClass::Addr Addr; + typedef typename ElfClass::Phdr Phdr; + typedef typename ElfClass::Shdr Shdr; - Addr loading_addr = GetLoadingAddress( - GetOffset(elf_header, elf_header->e_phoff), - elf_header->e_phnum); - module->SetLoadAddress(loading_addr); - info->set_loading_addr(loading_addr, obj_file); + Addr loading_addr = + GetLoadingAddress(GetOffset(elf_header, elf_header->e_phoff), elf_header->e_phnum); + module->SetLoadAddress(loading_addr); + info->set_loading_addr(loading_addr, obj_file); - // Allow filtering of extraneous debug information in partitioned libraries. - // Such libraries contain debug information for all libraries extracted from - // the same combined library, implying extensive duplication. - vector address_ranges = GetPtLoadSegmentRanges( - GetOffset(elf_header, elf_header->e_phoff), - elf_header->e_phnum); - module->SetAddressRanges(address_ranges); + // Allow filtering of extraneous debug information in partitioned libraries. + // Such libraries contain debug information for all libraries extracted from + // the same combined library, implying extensive duplication. + vector address_ranges = GetPtLoadSegmentRanges( + GetOffset(elf_header, elf_header->e_phoff), elf_header->e_phnum); + module->SetAddressRanges(address_ranges); - const Shdr* sections = - GetOffset(elf_header, elf_header->e_shoff); - const Shdr* section_names = sections + elf_header->e_shstrndx; - const char* names = - GetOffset(elf_header, section_names->sh_offset); - const char* names_end = names + section_names->sh_size; - bool found_debug_info_section = false; - bool found_usable_info = false; - bool usable_info_parsed = false; + const Shdr *sections = GetOffset(elf_header, elf_header->e_shoff); + const Shdr *section_names = sections + elf_header->e_shstrndx; + const char *names = GetOffset(elf_header, section_names->sh_offset); + const char *names_end = names + section_names->sh_size; + bool found_debug_info_section = false; + bool found_usable_info = false; + bool usable_info_parsed = false; - if ((options.symbol_data & SYMBOLS_AND_FILES) || - (options.symbol_data & INLINES)) { + if ((options.symbol_data & SYMBOLS_AND_FILES) || (options.symbol_data & INLINES)) + { #ifndef NO_STABS_SUPPORT - // Look for STABS debugging information, and load it if present. - const Shdr* stab_section = - FindElfSectionByName(".stab", SHT_PROGBITS, - sections, names, names_end, - elf_header->e_shnum); - if (stab_section) { - const Shdr* stabstr_section = stab_section->sh_link + sections; - if (stabstr_section) { - found_debug_info_section = true; - found_usable_info = true; - info->LoadedSection(".stab"); - bool result = LoadStabs(elf_header, stab_section, stabstr_section, - big_endian, module); - usable_info_parsed = usable_info_parsed || result; - if (!result) { - fprintf(stderr, "%s: \".stab\" section found, but failed to load" - " STABS debugging information\n", obj_file.c_str()); + // Look for STABS debugging information, and load it if present. + const Shdr *stab_section = + FindElfSectionByName(".stab", SHT_PROGBITS, sections, names, names_end, elf_header->e_shnum); + if (stab_section) + { + const Shdr *stabstr_section = stab_section->sh_link + sections; + if (stabstr_section) + { + found_debug_info_section = true; + found_usable_info = true; + info->LoadedSection(".stab"); + bool result = LoadStabs(elf_header, stab_section, stabstr_section, big_endian, module); + usable_info_parsed = usable_info_parsed || result; + if (!result) + { + fprintf(stderr, + "%s: \".stab\" section found, but failed to load" + " STABS debugging information\n", + obj_file.c_str()); + } + } } - } - } -#endif // NO_STABS_SUPPORT +#endif // NO_STABS_SUPPORT - // See if there are export symbols available. - const Shdr* symtab_section = - FindElfSectionByName(".symtab", SHT_SYMTAB, - sections, names, names_end, - elf_header->e_shnum); - const Shdr* strtab_section = - FindElfSectionByName(".strtab", SHT_STRTAB, - sections, names, names_end, - elf_header->e_shnum); - if (symtab_section && strtab_section) { - info->LoadedSection(".symtab"); + // See if there are export symbols available. + const Shdr *symtab_section = + FindElfSectionByName(".symtab", SHT_SYMTAB, sections, names, names_end, elf_header->e_shnum); + const Shdr *strtab_section = + FindElfSectionByName(".strtab", SHT_STRTAB, sections, names, names_end, elf_header->e_shnum); + if (symtab_section && strtab_section) + { + info->LoadedSection(".symtab"); - const uint8_t* symtab = - GetOffset(elf_header, - symtab_section->sh_offset); - const uint8_t* strtab = - GetOffset(elf_header, - strtab_section->sh_offset); - bool result = - ELFSymbolsToModule(symtab, - symtab_section->sh_size, - strtab, - strtab_section->sh_size, - big_endian, - ElfClass::kAddrSize, - module); - found_usable_info = found_usable_info || result; - } else { - // Look in dynsym only if full symbol table was not available. - const Shdr* dynsym_section = - FindElfSectionByName(".dynsym", SHT_DYNSYM, - sections, names, names_end, - elf_header->e_shnum); - const Shdr* dynstr_section = - FindElfSectionByName(".dynstr", SHT_STRTAB, - sections, names, names_end, - elf_header->e_shnum); - if (dynsym_section && dynstr_section) { - info->LoadedSection(".dynsym"); - - const uint8_t* dynsyms = - GetOffset(elf_header, - dynsym_section->sh_offset); - const uint8_t* dynstrs = - GetOffset(elf_header, - dynstr_section->sh_offset); - bool result = - ELFSymbolsToModule(dynsyms, - dynsym_section->sh_size, - dynstrs, - dynstr_section->sh_size, - big_endian, - ElfClass::kAddrSize, - module); - found_usable_info = found_usable_info || result; - } - } - - // Only Load .debug_info after loading symbol table to avoid duplicate - // PUBLIC records. - // Look for DWARF debugging information, and load it if present. - const Shdr* dwarf_section = - FindElfSectionByName(".debug_info", SHT_PROGBITS, - sections, names, names_end, - elf_header->e_shnum); - - // .debug_info section type is SHT_PROGBITS for mips on pnacl toolchains, - // but MIPS_DWARF for regular gnu toolchains, so both need to be checked - if (elf_header->e_machine == EM_MIPS && !dwarf_section) { - dwarf_section = - FindElfSectionByName(".debug_info", SHT_MIPS_DWARF, - sections, names, names_end, - elf_header->e_shnum); - } - - if (dwarf_section) { - found_debug_info_section = true; - found_usable_info = true; - info->LoadedSection(".debug_info"); - bool result = LoadDwarf(obj_file, elf_header, big_endian, - options.handle_inter_cu_refs, - options.symbol_data & INLINES, module); - usable_info_parsed = usable_info_parsed || result; - if (!result){ - fprintf(stderr, "%s: \".debug_info\" section found, but failed to load " - "DWARF debugging information\n", obj_file.c_str()); - } - } - } - - if (options.symbol_data & CFI) { - // Dwarf Call Frame Information (CFI) is actually independent from - // the other DWARF debugging information, and can be used alone. - const Shdr* dwarf_cfi_section = - FindElfSectionByName(".debug_frame", SHT_PROGBITS, - sections, names, names_end, - elf_header->e_shnum); - - // .debug_frame section type is SHT_PROGBITS for mips on pnacl toolchains, - // but MIPS_DWARF for regular gnu toolchains, so both need to be checked - if (elf_header->e_machine == EM_MIPS && !dwarf_cfi_section) { - dwarf_cfi_section = - FindElfSectionByName(".debug_frame", SHT_MIPS_DWARF, - sections, names, names_end, - elf_header->e_shnum); - } - - if (dwarf_cfi_section) { - // Ignore the return value of this function; even without call frame - // information, the other debugging information could be perfectly - // useful. - info->LoadedSection(".debug_frame"); - bool result = - LoadDwarfCFI(obj_file, elf_header, ".debug_frame", - dwarf_cfi_section, false, 0, 0, big_endian, - module); - found_usable_info = found_usable_info || result; - } - - // Linux C++ exception handling information can also provide - // unwinding data. - const Shdr* eh_frame_section = - FindElfSectionByName(".eh_frame", SHT_PROGBITS, - sections, names, names_end, - elf_header->e_shnum); - if (eh_frame_section) { - // Pointers in .eh_frame data may be relative to the base addresses of - // certain sections. Provide those sections if present. - const Shdr* got_section = - FindElfSectionByName(".got", SHT_PROGBITS, - sections, names, names_end, - elf_header->e_shnum); - const Shdr* text_section = - FindElfSectionByName(".text", SHT_PROGBITS, - sections, names, names_end, - elf_header->e_shnum); - info->LoadedSection(".eh_frame"); - // As above, ignore the return value of this function. - bool result = - LoadDwarfCFI(obj_file, elf_header, ".eh_frame", - eh_frame_section, true, - got_section, text_section, big_endian, module); - found_usable_info = found_usable_info || result; - } - } - - if (!found_debug_info_section) { - fprintf(stderr, "%s: file contains no debugging information" - " (no \".stab\" or \".debug_info\" sections)\n", - obj_file.c_str()); - - // Failed, but maybe there's a .gnu_debuglink section? - if (read_gnu_debug_link) { - const Shdr* gnu_debuglink_section - = FindElfSectionByName(".gnu_debuglink", SHT_PROGBITS, - sections, names, - names_end, elf_header->e_shnum); - if (gnu_debuglink_section) { - if (!info->debug_dirs().empty()) { - const uint8_t* debuglink_contents = - GetOffset(elf_header, - gnu_debuglink_section->sh_offset); - string debuglink_file = - ReadDebugLink(debuglink_contents, - gnu_debuglink_section->sh_size, - big_endian, - obj_file, - info->debug_dirs()); - info->set_debuglink_file(debuglink_file); - } else { - fprintf(stderr, ".gnu_debuglink section found in '%s', " - "but no debug path specified.\n", obj_file.c_str()); + const uint8_t *symtab = GetOffset(elf_header, symtab_section->sh_offset); + const uint8_t *strtab = GetOffset(elf_header, strtab_section->sh_offset); + bool result = ELFSymbolsToModule(symtab, symtab_section->sh_size, strtab, strtab_section->sh_size, + big_endian, ElfClass::kAddrSize, module); + found_usable_info = found_usable_info || result; } - } else { - fprintf(stderr, "%s does not contain a .gnu_debuglink section.\n", + else + { + // Look in dynsym only if full symbol table was not available. + const Shdr *dynsym_section = + FindElfSectionByName(".dynsym", SHT_DYNSYM, sections, names, names_end, elf_header->e_shnum); + const Shdr *dynstr_section = + FindElfSectionByName(".dynstr", SHT_STRTAB, sections, names, names_end, elf_header->e_shnum); + if (dynsym_section && dynstr_section) + { + info->LoadedSection(".dynsym"); + + const uint8_t *dynsyms = GetOffset(elf_header, dynsym_section->sh_offset); + const uint8_t *dynstrs = GetOffset(elf_header, dynstr_section->sh_offset); + bool result = ELFSymbolsToModule(dynsyms, dynsym_section->sh_size, dynstrs, dynstr_section->sh_size, + big_endian, ElfClass::kAddrSize, module); + found_usable_info = found_usable_info || result; + } + } + + // Only Load .debug_info after loading symbol table to avoid duplicate + // PUBLIC records. + // Look for DWARF debugging information, and load it if present. + const Shdr *dwarf_section = FindElfSectionByName(".debug_info", SHT_PROGBITS, sections, names, + names_end, elf_header->e_shnum); + + // .debug_info section type is SHT_PROGBITS for mips on pnacl toolchains, + // but MIPS_DWARF for regular gnu toolchains, so both need to be checked + if (elf_header->e_machine == EM_MIPS && !dwarf_section) + { + dwarf_section = FindElfSectionByName(".debug_info", SHT_MIPS_DWARF, sections, names, names_end, + elf_header->e_shnum); + } + + if (dwarf_section) + { + found_debug_info_section = true; + found_usable_info = true; + info->LoadedSection(".debug_info"); + bool result = LoadDwarf(obj_file, elf_header, big_endian, options.handle_inter_cu_refs, + options.symbol_data & INLINES, module); + usable_info_parsed = usable_info_parsed || result; + if (!result) + { + fprintf(stderr, + "%s: \".debug_info\" section found, but failed to load " + "DWARF debugging information\n", + obj_file.c_str()); + } + } + } + + if (options.symbol_data & CFI) + { + // Dwarf Call Frame Information (CFI) is actually independent from + // the other DWARF debugging information, and can be used alone. + const Shdr *dwarf_cfi_section = FindElfSectionByName(".debug_frame", SHT_PROGBITS, sections, names, + names_end, elf_header->e_shnum); + + // .debug_frame section type is SHT_PROGBITS for mips on pnacl toolchains, + // but MIPS_DWARF for regular gnu toolchains, so both need to be checked + if (elf_header->e_machine == EM_MIPS && !dwarf_cfi_section) + { + dwarf_cfi_section = FindElfSectionByName(".debug_frame", SHT_MIPS_DWARF, sections, names, + names_end, elf_header->e_shnum); + } + + if (dwarf_cfi_section) + { + // Ignore the return value of this function; even without call frame + // information, the other debugging information could be perfectly + // useful. + info->LoadedSection(".debug_frame"); + bool result = LoadDwarfCFI(obj_file, elf_header, ".debug_frame", dwarf_cfi_section, false, 0, 0, + big_endian, module); + found_usable_info = found_usable_info || result; + } + + // Linux C++ exception handling information can also provide + // unwinding data. + const Shdr *eh_frame_section = + FindElfSectionByName(".eh_frame", SHT_PROGBITS, sections, names, names_end, elf_header->e_shnum); + if (eh_frame_section) + { + // Pointers in .eh_frame data may be relative to the base addresses of + // certain sections. Provide those sections if present. + const Shdr *got_section = + FindElfSectionByName(".got", SHT_PROGBITS, sections, names, names_end, elf_header->e_shnum); + const Shdr *text_section = + FindElfSectionByName(".text", SHT_PROGBITS, sections, names, names_end, elf_header->e_shnum); + info->LoadedSection(".eh_frame"); + // As above, ignore the return value of this function. + bool result = LoadDwarfCFI(obj_file, elf_header, ".eh_frame", eh_frame_section, true, got_section, + text_section, big_endian, module); + found_usable_info = found_usable_info || result; + } + } + + if (!found_debug_info_section) + { + fprintf(stderr, + "%s: file contains no debugging information" + " (no \".stab\" or \".debug_info\" sections)\n", obj_file.c_str()); - } - } else { - // Return true if some usable information was found, since the caller - // doesn't want to use .gnu_debuglink. - return found_usable_info; + + // Failed, but maybe there's a .gnu_debuglink section? + if (read_gnu_debug_link) + { + const Shdr *gnu_debuglink_section = FindElfSectionByName(".gnu_debuglink", SHT_PROGBITS, sections, + names, names_end, elf_header->e_shnum); + if (gnu_debuglink_section) + { + if (!info->debug_dirs().empty()) + { + const uint8_t *debuglink_contents = + GetOffset(elf_header, gnu_debuglink_section->sh_offset); + string debuglink_file = ReadDebugLink(debuglink_contents, gnu_debuglink_section->sh_size, + big_endian, obj_file, info->debug_dirs()); + info->set_debuglink_file(debuglink_file); + } + else + { + fprintf(stderr, + ".gnu_debuglink section found in '%s', " + "but no debug path specified.\n", + obj_file.c_str()); + } + } + else + { + fprintf(stderr, "%s does not contain a .gnu_debuglink section.\n", obj_file.c_str()); + } + } + else + { + // Return true if some usable information was found, since the caller + // doesn't want to use .gnu_debuglink. + return found_usable_info; + } + + // No debug info was found, let the user try again with .gnu_debuglink + // if present. + return false; } - // No debug info was found, let the user try again with .gnu_debuglink - // if present. - return false; - } - - return usable_info_parsed; + return usable_info_parsed; } // Return the breakpad symbol file identifier for the architecture of // ELF_HEADER. -template -const char* ElfArchitecture(const typename ElfClass::Ehdr* elf_header) { - typedef typename ElfClass::Half Half; - Half arch = elf_header->e_machine; - switch (arch) { - case EM_386: return "x86"; - case EM_ARM: return "arm"; - case EM_AARCH64: return "arm64"; - case EM_MIPS: return "mips"; - case EM_PPC64: return "ppc64"; - case EM_PPC: return "ppc"; - case EM_S390: return "s390"; - case EM_SPARC: return "sparc"; - case EM_SPARCV9: return "sparcv9"; - case EM_X86_64: return "x86_64"; - case EM_RISCV: return "riscv"; - case EM_NDS32: return "nds32"; - default: return nullptr; - } +template const char *ElfArchitecture(const typename ElfClass::Ehdr *elf_header) +{ + typedef typename ElfClass::Half Half; + Half arch = elf_header->e_machine; + switch (arch) + { + case EM_386: + return "x86"; + case EM_ARM: + return "arm"; + case EM_AARCH64: + return "arm64"; + case EM_MIPS: + return "mips"; + case EM_PPC64: + return "ppc64"; + case EM_PPC: + return "ppc"; + case EM_S390: + return "s390"; + case EM_SPARC: + return "sparc"; + case EM_SPARCV9: + return "sparcv9"; + case EM_X86_64: + return "x86_64"; + case EM_RISCV: + return "riscv"; + case EM_NDS32: + return "nds32"; + default: + return nullptr; + } } -template -bool SanitizeDebugFile(const typename ElfClass::Ehdr* debug_elf_header, - const string& debuglink_file, - const string& obj_filename, - const char* obj_file_architecture, - const bool obj_file_is_big_endian) { - const char* debug_architecture = - ElfArchitecture(debug_elf_header); - if (!debug_architecture) { - fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n", - debuglink_file.c_str(), debug_elf_header->e_machine); - return false; - } - if (strcmp(obj_file_architecture, debug_architecture)) { - fprintf(stderr, "%s with ELF machine architecture %s does not match " - "%s with ELF architecture %s\n", - debuglink_file.c_str(), debug_architecture, - obj_filename.c_str(), obj_file_architecture); - return false; - } - bool debug_big_endian; - if (!ElfEndianness(debug_elf_header, &debug_big_endian)) - return false; - if (debug_big_endian != obj_file_is_big_endian) { - fprintf(stderr, "%s and %s does not match in endianness\n", - obj_filename.c_str(), debuglink_file.c_str()); - return false; - } - return true; +template +bool SanitizeDebugFile(const typename ElfClass::Ehdr *debug_elf_header, const string &debuglink_file, + const string &obj_filename, const char *obj_file_architecture, const bool obj_file_is_big_endian) +{ + const char *debug_architecture = ElfArchitecture(debug_elf_header); + if (!debug_architecture) + { + fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n", debuglink_file.c_str(), + debug_elf_header->e_machine); + return false; + } + if (strcmp(obj_file_architecture, debug_architecture)) + { + fprintf(stderr, + "%s with ELF machine architecture %s does not match " + "%s with ELF architecture %s\n", + debuglink_file.c_str(), debug_architecture, obj_filename.c_str(), obj_file_architecture); + return false; + } + bool debug_big_endian; + if (!ElfEndianness(debug_elf_header, &debug_big_endian)) + return false; + if (debug_big_endian != obj_file_is_big_endian) + { + fprintf(stderr, "%s and %s does not match in endianness\n", obj_filename.c_str(), debuglink_file.c_str()); + return false; + } + return true; } -template -bool InitModuleForElfClass(const typename ElfClass::Ehdr* elf_header, - const string& obj_filename, - const string& obj_os, - const string& module_id, - std::unique_ptr& module, - bool enable_multiple_field) { - PageAllocator allocator; - wasteful_vector identifier(&allocator, kDefaultBuildIdSize); - if (!FileID::ElfFileIdentifierFromMappedFile(elf_header, identifier)) { - fprintf(stderr, "%s: unable to generate file identifier\n", - obj_filename.c_str()); - return false; - } - - const char* architecture = ElfArchitecture(elf_header); - if (!architecture) { - fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n", - obj_filename.c_str(), elf_header->e_machine); - return false; - } - - char name_buf[NAME_MAX] = {}; - std::string name = google_breakpad::ElfFileSoNameFromMappedFile( - elf_header, name_buf, sizeof(name_buf)) - ? name_buf - : google_breakpad::BaseName(obj_filename); - - // Use the provided module_id - string id = module_id.empty() - // Add an extra "0" at the end. PDB files on Windows have an 'age' - // number appended to the end of the file identifier; this isn't - // really used or necessary on other platforms, but be consistent. - ? FileID::ConvertIdentifierToUUIDString(identifier) + "0" - : module_id; - - // This is just the raw Build ID in hex. - string code_id = FileID::ConvertIdentifierToString(identifier); - - module.reset(new Module(name, obj_os, architecture, id, code_id, - enable_multiple_field)); - - return true; -} - -template -bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr* elf_header, - const string& obj_filename, - const string& obj_os, - const string& module_id, - const std::vector& debug_dirs, - const DumpOptions& options, - Module** out_module) { - typedef typename ElfClass::Ehdr Ehdr; - - *out_module = nullptr; - - std::unique_ptr module; - if (!InitModuleForElfClass(elf_header, obj_filename, obj_os, module_id, - module, options.enable_multiple_field)) { - return false; - } - - // Figure out what endianness this file is. - bool big_endian; - if (!ElfEndianness(elf_header, &big_endian)) - return false; - - LoadSymbolsInfo info(debug_dirs); - if (!LoadSymbols(obj_filename, big_endian, elf_header, - !debug_dirs.empty(), &info, - options, module.get())) { - const string debuglink_file = info.debuglink_file(); - if (debuglink_file.empty()) - return false; - - // Load debuglink ELF file. - fprintf(stderr, "Found debugging info in %s\n", debuglink_file.c_str()); - MmapWrapper debug_map_wrapper; - Ehdr* debug_elf_header = nullptr; - if (!LoadELF(debuglink_file, &debug_map_wrapper, - reinterpret_cast(&debug_elf_header)) || - !SanitizeDebugFile(debug_elf_header, debuglink_file, - obj_filename, - module->architecture().c_str(), - big_endian)) { - return false; +template +bool InitModuleForElfClass(const typename ElfClass::Ehdr *elf_header, const string &obj_filename, const string &obj_os, + const string &module_id, std::unique_ptr &module, bool enable_multiple_field) +{ + PageAllocator allocator; + wasteful_vector identifier(&allocator, kDefaultBuildIdSize); + if (!FileID::ElfFileIdentifierFromMappedFile(elf_header, identifier)) + { + fprintf(stderr, "%s: unable to generate file identifier\n", obj_filename.c_str()); + return false; } - if (!LoadSymbols(debuglink_file, big_endian, - debug_elf_header, false, &info, - options, module.get())) { - return false; + const char *architecture = ElfArchitecture(elf_header); + if (!architecture) + { + fprintf(stderr, "%s: unrecognized ELF machine architecture: %d\n", obj_filename.c_str(), elf_header->e_machine); + return false; } - } - *out_module = module.release(); - return true; + char name_buf[NAME_MAX] = {}; + std::string name = google_breakpad::ElfFileSoNameFromMappedFile(elf_header, name_buf, sizeof(name_buf)) + ? name_buf + : google_breakpad::BaseName(obj_filename); + + // Use the provided module_id + string id = module_id.empty() + // Add an extra "0" at the end. PDB files on Windows have an 'age' + // number appended to the end of the file identifier; this isn't + // really used or necessary on other platforms, but be consistent. + ? FileID::ConvertIdentifierToUUIDString(identifier) + "0" + : module_id; + + // This is just the raw Build ID in hex. + string code_id = FileID::ConvertIdentifierToString(identifier); + + module.reset(new Module(name, obj_os, architecture, id, code_id, enable_multiple_field)); + + return true; } -} // namespace +template +bool ReadSymbolDataElfClass(const typename ElfClass::Ehdr *elf_header, const string &obj_filename, const string &obj_os, + const string &module_id, const std::vector &debug_dirs, const DumpOptions &options, + Module **out_module) +{ + typedef typename ElfClass::Ehdr Ehdr; -namespace google_breakpad { + *out_module = nullptr; + + std::unique_ptr module; + if (!InitModuleForElfClass(elf_header, obj_filename, obj_os, module_id, module, + options.enable_multiple_field)) + { + return false; + } + + // Figure out what endianness this file is. + bool big_endian; + if (!ElfEndianness(elf_header, &big_endian)) + return false; + + LoadSymbolsInfo info(debug_dirs); + if (!LoadSymbols(obj_filename, big_endian, elf_header, !debug_dirs.empty(), &info, options, module.get())) + { + const string debuglink_file = info.debuglink_file(); + if (debuglink_file.empty()) + return false; + + // Load debuglink ELF file. + fprintf(stderr, "Found debugging info in %s\n", debuglink_file.c_str()); + MmapWrapper debug_map_wrapper; + Ehdr *debug_elf_header = nullptr; + if (!LoadELF(debuglink_file, &debug_map_wrapper, reinterpret_cast(&debug_elf_header)) || + !SanitizeDebugFile(debug_elf_header, debuglink_file, obj_filename, module->architecture().c_str(), + big_endian)) + { + return false; + } + + if (!LoadSymbols(debuglink_file, big_endian, debug_elf_header, false, &info, options, module.get())) + { + return false; + } + } + + *out_module = module.release(); + return true; +} + +} // namespace + +namespace google_breakpad +{ // Not explicitly exported, but not static so it can be used in unit tests. -bool ReadSymbolDataInternal(const uint8_t* obj_file, - const string& obj_filename, - const string& obj_os, - const string& module_id, - const std::vector& debug_dirs, - const DumpOptions& options, - Module** module) { - if (!IsValidElf(obj_file)) { - fprintf(stderr, "Not a valid ELF file: %s\n", obj_filename.c_str()); +bool ReadSymbolDataInternal(const uint8_t *obj_file, const string &obj_filename, const string &obj_os, + const string &module_id, const std::vector &debug_dirs, const DumpOptions &options, + Module **module) +{ + if (!IsValidElf(obj_file)) + { + fprintf(stderr, "Not a valid ELF file: %s\n", obj_filename.c_str()); + return false; + } + + int elfclass = ElfClass(obj_file); + if (elfclass == ELFCLASS32) + { + return ReadSymbolDataElfClass(reinterpret_cast(obj_file), obj_filename, obj_os, + module_id, debug_dirs, options, module); + } + if (elfclass == ELFCLASS64) + { + return ReadSymbolDataElfClass(reinterpret_cast(obj_file), obj_filename, obj_os, + module_id, debug_dirs, options, module); + } + return false; - } - - int elfclass = ElfClass(obj_file); - if (elfclass == ELFCLASS32) { - return ReadSymbolDataElfClass( - reinterpret_cast(obj_file), obj_filename, obj_os, - module_id, debug_dirs, options, module); - } - if (elfclass == ELFCLASS64) { - return ReadSymbolDataElfClass( - reinterpret_cast(obj_file), obj_filename, obj_os, - module_id, debug_dirs, options, module); - } - - return false; } -bool WriteSymbolFile(const string& load_path, - const string& obj_file, - const string& obj_os, - const string& module_id, - const std::vector& debug_dirs, - const DumpOptions& options, - std::ostream& sym_stream) { - Module* module; - if (!ReadSymbolData(load_path, obj_file, obj_os, module_id, debug_dirs, options, - &module)) - return false; +bool WriteSymbolFile(const string &load_path, const string &obj_file, const string &obj_os, const string &module_id, + const std::vector &debug_dirs, const DumpOptions &options, std::ostream &sym_stream) +{ + Module *module; + if (!ReadSymbolData(load_path, obj_file, obj_os, module_id, debug_dirs, options, &module)) + return false; - bool result = module->Write(sym_stream, options.symbol_data, options.preserve_load_address); - delete module; - return result; + bool result = module->Write(sym_stream, options.symbol_data, options.preserve_load_address); + delete module; + return result; } // Read the selected object file's debugging information, and write out the // header only to |stream|. Return true on success; if an error occurs, report // it and return false. -bool WriteSymbolFileHeader(const string& load_path, - const string& obj_file, - const string& obj_os, - const string& module_id, - std::ostream& sym_stream) { - MmapWrapper map_wrapper; - void* elf_header = nullptr; - if (!LoadELF(load_path, &map_wrapper, &elf_header)) { - fprintf(stderr, "Could not load ELF file: %s\n", obj_file.c_str()); - return false; - } - - if (!IsValidElf(elf_header)) { - fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str()); - return false; - } - - int elfclass = ElfClass(elf_header); - std::unique_ptr module; - if (elfclass == ELFCLASS32) { - if (!InitModuleForElfClass( - reinterpret_cast(elf_header), obj_file, obj_os, - module_id, module, /*enable_multiple_field=*/false)) { - fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str()); - return false; +bool WriteSymbolFileHeader(const string &load_path, const string &obj_file, const string &obj_os, + const string &module_id, std::ostream &sym_stream) +{ + MmapWrapper map_wrapper; + void *elf_header = nullptr; + if (!LoadELF(load_path, &map_wrapper, &elf_header)) + { + fprintf(stderr, "Could not load ELF file: %s\n", obj_file.c_str()); + return false; } - } else if (elfclass == ELFCLASS64) { - if (!InitModuleForElfClass( - reinterpret_cast(elf_header), obj_file, obj_os, - module_id, module, /*enable_multiple_field=*/false)) { - fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str()); - return false; - } - } else { - fprintf(stderr, "Unsupported module file: %s\n", obj_file.c_str()); - return false; - } - return module->Write(sym_stream, ALL_SYMBOL_DATA); + if (!IsValidElf(elf_header)) + { + fprintf(stderr, "Not a valid ELF file: %s\n", obj_file.c_str()); + return false; + } + + int elfclass = ElfClass(elf_header); + std::unique_ptr module; + if (elfclass == ELFCLASS32) + { + if (!InitModuleForElfClass(reinterpret_cast(elf_header), obj_file, obj_os, + module_id, module, /*enable_multiple_field=*/false)) + { + fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str()); + return false; + } + } + else if (elfclass == ELFCLASS64) + { + if (!InitModuleForElfClass(reinterpret_cast(elf_header), obj_file, obj_os, + module_id, module, /*enable_multiple_field=*/false)) + { + fprintf(stderr, "Failed to load ELF module: %s\n", obj_file.c_str()); + return false; + } + } + else + { + fprintf(stderr, "Unsupported module file: %s\n", obj_file.c_str()); + return false; + } + + return module->Write(sym_stream, ALL_SYMBOL_DATA); } -bool ReadSymbolData(const string& load_path, - const string& obj_file, - const string& obj_os, - const string& module_id, - const std::vector& debug_dirs, - const DumpOptions& options, - Module** module) { - MmapWrapper map_wrapper; - void* elf_header = nullptr; - if (!LoadELF(load_path, &map_wrapper, &elf_header)) - return false; +bool ReadSymbolData(const string &load_path, const string &obj_file, const string &obj_os, const string &module_id, + const std::vector &debug_dirs, const DumpOptions &options, Module **module) +{ + MmapWrapper map_wrapper; + void *elf_header = nullptr; + if (!LoadELF(load_path, &map_wrapper, &elf_header)) + return false; - return ReadSymbolDataInternal(reinterpret_cast(elf_header), - obj_file, obj_os, module_id, debug_dirs, options, module); + return ReadSymbolDataInternal(reinterpret_cast(elf_header), obj_file, obj_os, module_id, debug_dirs, + options, module); } -} // namespace google_breakpad +} // namespace google_breakpad diff --git a/third_party/breakpad/src/common/linux/include/asm-mips/README.md b/third_party/breakpad/src/common/linux/include/asm-mips/README.md new file mode 100644 index 0000000..b56ee60 --- /dev/null +++ b/third_party/breakpad/src/common/linux/include/asm-mips/README.md @@ -0,0 +1,9 @@ +# asm-mips + +The files in this directory are almost direct copies from Android NDK r12, with +the exception of changing the include guards to Breakpad ones. They are copied +from the MIPS asm/ directory, but are meant to be used as replacements for both +asm/ and machine/ includes since the files in each are largely duplicates. + +Some MIPS asm/ and all machine/ headers were removed in the move to unified NDK +headers, so Breakpad fails to compile on newer NDK versions without these files. \ No newline at end of file diff --git a/third_party/breakpad/src/common/linux/include/asm-mips/asm.h b/third_party/breakpad/src/common/linux/include/asm-mips/asm.h new file mode 100644 index 0000000..8f086e7 --- /dev/null +++ b/third_party/breakpad/src/common/linux/include/asm-mips/asm.h @@ -0,0 +1,270 @@ +#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_ASM_H +#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_ASM_H + +#if defined(__has_include_next) && __has_include_next() +#include_next +#else + +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ + +#include +#ifndef CAT +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#ifdef __STDC__ +#define __CAT(str1, str2) str1##str2 +#else +#define __CAT(str1, str2) str1 str2 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#define CAT(str1, str2) __CAT(str1, str2) +#endif +#ifdef __PIC__ +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CPRESTORE(register) .cprestore register +#define CPADD(register) .cpadd register +#define CPLOAD(register) .cpload register +#else +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define CPRESTORE(register) +#define CPADD(register) +#define CPLOAD(register) +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LEAF(symbol) .globl symbol; .align 2; .type symbol, @function; .ent symbol, 0; symbol: .frame sp, 0, ra +#define NESTED(symbol, framesize, rpc) .globl symbol; .align 2; .type symbol, @function; .ent symbol, 0; symbol: .frame sp, framesize, rpc +#define END(function) .end function; .size function, .-function +#define EXPORT(symbol) .globl symbol; symbol: +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define FEXPORT(symbol) .globl symbol; .type symbol, @function; symbol: +#define ABS(symbol,value) .globl symbol; symbol = value +#define PANIC(msg) .set push; .set reorder; PTR_LA a0, 8f; jal panic; 9: b 9b; .set pop; TEXT(msg) +#define PRINT(string) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define TEXT(msg) .pushsection .data; 8: .asciiz msg; .popsection; +#define TTABLE(string) .pushsection .text; .word 1f; .popsection .pushsection .data; 1: .asciiz string; .popsection +#define PREF(hint, addr) +#define PREFX(hint, addr) +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#if _MIPS_ISA == _MIPS_ISA_MIPS1 +#define MOVN(rd, rs, rt) .set push; .set reorder; beqz rt, 9f; move rd, rs; .set pop; 9: +#define MOVZ(rd, rs, rt) .set push; .set reorder; bnez rt, 9f; move rd, rs; .set pop; 9: +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#if _MIPS_ISA == _MIPS_ISA_MIPS2 || _MIPS_ISA == _MIPS_ISA_MIPS3 +#define MOVN(rd, rs, rt) .set push; .set noreorder; bnezl rt, 9f; move rd, rs; .set pop; 9: +#define MOVZ(rd, rs, rt) .set push; .set noreorder; beqzl rt, 9f; move rd, rs; .set pop; 9: +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#if _MIPS_ISA == _MIPS_ISA_MIPS4 || _MIPS_ISA == _MIPS_ISA_MIPS5 || _MIPS_ISA == _MIPS_ISA_MIPS32 || _MIPS_ISA == _MIPS_ISA_MIPS64 +#define MOVN(rd, rs, rt) movn rd, rs, rt +#define MOVZ(rd, rs, rt) movz rd, rs, rt +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#if _MIPS_SIM == _MIPS_SIM_ABI32 +#define ALSZ 7 +#define ALMASK ~7 +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64 +#define ALSZ 15 +#define ALMASK ~15 +#endif +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#ifdef __mips64 +#define SZREG 8 +#else +#define SZREG 4 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SIM == _MIPS_SIM_ABI32 +#define REG_S sw +#define REG_L lw +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define REG_SUBU subu +#define REG_ADDU addu +#endif +#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define REG_S sd +#define REG_L ld +#define REG_SUBU dsubu +#define REG_ADDU daddu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SZINT == 32 +#define INT_ADD add +#define INT_ADDU addu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define INT_ADDI addi +#define INT_ADDIU addiu +#define INT_SUB sub +#define INT_SUBU subu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define INT_L lw +#define INT_S sw +#define INT_SLL sll +#define INT_SLLV sllv +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define INT_SRL srl +#define INT_SRLV srlv +#define INT_SRA sra +#define INT_SRAV srav +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SZINT == 64 +#define INT_ADD dadd +#define INT_ADDU daddu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define INT_ADDI daddi +#define INT_ADDIU daddiu +#define INT_SUB dsub +#define INT_SUBU dsubu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define INT_L ld +#define INT_S sd +#define INT_SLL dsll +#define INT_SLLV dsllv +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define INT_SRL dsrl +#define INT_SRLV dsrlv +#define INT_SRA dsra +#define INT_SRAV dsrav +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SZLONG == 32 +#define LONG_ADD add +#define LONG_ADDU addu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG_ADDI addi +#define LONG_ADDIU addiu +#define LONG_SUB sub +#define LONG_SUBU subu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG_L lw +#define LONG_S sw +#define LONG_SLL sll +#define LONG_SLLV sllv +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG_SRL srl +#define LONG_SRLV srlv +#define LONG_SRA sra +#define LONG_SRAV srav +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG .word +#define LONGSIZE 4 +#define LONGMASK 3 +#define LONGLOG 2 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SZLONG == 64 +#define LONG_ADD dadd +#define LONG_ADDU daddu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG_ADDI daddi +#define LONG_ADDIU daddiu +#define LONG_SUB dsub +#define LONG_SUBU dsubu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG_L ld +#define LONG_S sd +#define LONG_SLL dsll +#define LONG_SLLV dsllv +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG_SRL dsrl +#define LONG_SRLV dsrlv +#define LONG_SRA dsra +#define LONG_SRAV dsrav +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define LONG .dword +#define LONGSIZE 8 +#define LONGMASK 7 +#define LONGLOG 3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SZPTR == 32 +#define PTR_ADD add +#define PTR_ADDU addu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_ADDI addi +#define PTR_ADDIU addiu +#define PTR_SUB sub +#define PTR_SUBU subu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_L lw +#define PTR_S sw +#define PTR_LA la +#define PTR_LI li +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_SLL sll +#define PTR_SLLV sllv +#define PTR_SRL srl +#define PTR_SRLV srlv +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_SRA sra +#define PTR_SRAV srav +#define PTR_SCALESHIFT 2 +#define PTR .word +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTRSIZE 4 +#define PTRLOG 2 +#endif +#if _MIPS_SZPTR == 64 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_ADD dadd +#define PTR_ADDU daddu +#define PTR_ADDI daddi +#define PTR_ADDIU daddiu +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_SUB dsub +#define PTR_SUBU dsubu +#define PTR_L ld +#define PTR_S sd +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_LA dla +#define PTR_LI dli +#define PTR_SLL dsll +#define PTR_SLLV dsllv +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_SRL dsrl +#define PTR_SRLV dsrlv +#define PTR_SRA dsra +#define PTR_SRAV dsrav +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define PTR_SCALESHIFT 3 +#define PTR .dword +#define PTRSIZE 8 +#define PTRLOG 3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SIM == _MIPS_SIM_ABI32 +#define MFC0 mfc0 +#define MTC0 mtc0 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#if _MIPS_SIM == _MIPS_SIM_NABI32 || _MIPS_SIM == _MIPS_SIM_ABI64 +#define MFC0 dmfc0 +#define MTC0 dmtc0 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#define SSNOP sll zero, zero, 1 +#define R10KCBARRIER(addr) +#endif // defined(__has_include_next) && __has_include_next() +#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_ASM_H +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ diff --git a/third_party/breakpad/src/common/linux/include/asm-mips/fpregdef.h b/third_party/breakpad/src/common/linux/include/asm-mips/fpregdef.h new file mode 100644 index 0000000..a6eedc0 --- /dev/null +++ b/third_party/breakpad/src/common/linux/include/asm-mips/fpregdef.h @@ -0,0 +1,117 @@ +#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_FPREGDEF_H +#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_FPREGDEF_H + +#if defined(__has_include_next) && __has_include_next() +#include_next +#else + +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ + +#include +#if _MIPS_SIM == _MIPS_SIM_ABI32 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fv0 $f0 +#define fv0f $f1 +#define fv1 $f2 +#define fv1f $f3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fa0 $f12 +#define fa0f $f13 +#define fa1 $f14 +#define fa1f $f15 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ft0 $f4 +#define ft0f $f5 +#define ft1 $f6 +#define ft1f $f7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ft2 $f8 +#define ft2f $f9 +#define ft3 $f10 +#define ft3f $f11 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ft4 $f16 +#define ft4f $f17 +#define ft5 $f18 +#define ft5f $f19 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fs0 $f20 +#define fs0f $f21 +#define fs1 $f22 +#define fs1f $f23 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fs2 $f24 +#define fs2f $f25 +#define fs3 $f26 +#define fs3f $f27 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fs4 $f28 +#define fs4f $f29 +#define fs5 $f30 +#define fs5f $f31 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fcr31 $31 +#endif +#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 +#define fv0 $f0 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fv1 $f2 +#define fa0 $f12 +#define fa1 $f13 +#define fa2 $f14 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fa3 $f15 +#define fa4 $f16 +#define fa5 $f17 +#define fa6 $f18 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fa7 $f19 +#define ft0 $f4 +#define ft1 $f5 +#define ft2 $f6 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ft3 $f7 +#define ft4 $f8 +#define ft5 $f9 +#define ft6 $f10 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ft7 $f11 +#define ft8 $f20 +#define ft9 $f21 +#define ft10 $f22 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define ft11 $f23 +#define ft12 $f1 +#define ft13 $f3 +#define fs0 $f24 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fs1 $f25 +#define fs2 $f26 +#define fs3 $f27 +#define fs4 $f28 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define fs5 $f29 +#define fs6 $f30 +#define fs7 $f31 +#define fcr31 $31 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#endif +#endif // defined(__has_include_next) && __has_include_next() +#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_FPREGDEF_H diff --git a/third_party/breakpad/src/common/linux/include/asm-mips/regdef.h b/third_party/breakpad/src/common/linux/include/asm-mips/regdef.h new file mode 100644 index 0000000..a7fd769 --- /dev/null +++ b/third_party/breakpad/src/common/linux/include/asm-mips/regdef.h @@ -0,0 +1,125 @@ +#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_REGDEF_H +#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_REGDEF_H + +#if defined(__has_include_next) && __has_include_next() +#include_next +#else + +/**************************************************************************** + **************************************************************************** + *** + *** This header was automatically generated from a Linux kernel header + *** of the same name, to make information necessary for userspace to + *** call into the kernel available to libc. It contains only constants, + *** structures, and macros generated from the original header, and thus, + *** contains no copyrightable information. + *** + *** To edit the content of this header, modify the corresponding + *** source file (e.g. under external/kernel-headers/original/) then + *** run bionic/libc/kernel/tools/update_all.py + *** + *** Any manual change here will be lost the next time this script will + *** be run. You've been warned! + *** + **************************************************************************** + ****************************************************************************/ + +#include +#if _MIPS_SIM == _MIPS_SIM_ABI32 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define zero $0 +#define AT $1 +#define v0 $2 +#define v1 $3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define a0 $4 +#define a1 $5 +#define a2 $6 +#define a3 $7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define t0 $8 +#define t1 $9 +#define t2 $10 +#define t3 $11 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define t4 $12 +#define t5 $13 +#define t6 $14 +#define t7 $15 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define s0 $16 +#define s1 $17 +#define s2 $18 +#define s3 $19 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define t8 $24 +#define t9 $25 +#define jp $25 +#define k0 $26 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define k1 $27 +#define gp $28 +#define sp $29 +#define fp $30 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define s8 $30 +#define ra $31 +#endif +#if _MIPS_SIM == _MIPS_SIM_ABI64 || _MIPS_SIM == _MIPS_SIM_NABI32 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define zero $0 +#define AT $at +#define v0 $2 +#define v1 $3 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define a0 $4 +#define a1 $5 +#define a2 $6 +#define a3 $7 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define a4 $8 +#define ta0 $8 +#define a5 $9 +#define ta1 $9 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define a6 $10 +#define ta2 $10 +#define a7 $11 +#define ta3 $11 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define t0 $12 +#define t1 $13 +#define t2 $14 +#define t3 $15 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define s0 $16 +#define s1 $17 +#define s2 $18 +#define s3 $19 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define s4 $20 +#define s5 $21 +#define s6 $22 +#define s7 $23 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define t8 $24 +#define t9 $25 +#define jp $25 +#define k0 $26 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define k1 $27 +#define gp $28 +#define sp $29 +#define fp $30 +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ +#define s8 $30 +#define ra $31 +#endif +#endif // defined(__has_include_next) && __has_include_next() +#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_ASM_MIPS_REGDEF_H +/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ diff --git a/third_party/breakpad/src/third_party/miniz/miniz.c b/third_party/breakpad/src/third_party/miniz/miniz.c new file mode 100644 index 0000000..8d0032f --- /dev/null +++ b/third_party/breakpad/src/third_party/miniz/miniz.c @@ -0,0 +1,7833 @@ +#include "miniz.h" +/************************************************************************** + * + * Copyright 2013-2014 RAD Game Tools and Valve Software + * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + **************************************************************************/ + + + +typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1]; +typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1]; +typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1]; + +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------- zlib-style API's */ + +mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len) +{ + mz_uint32 i, s1 = (mz_uint32)(adler & 0xffff), s2 = (mz_uint32)(adler >> 16); + size_t block_len = buf_len % 5552; + if (!ptr) + return MZ_ADLER32_INIT; + while (buf_len) + { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) + { + s1 += ptr[0], s2 += s1; + s1 += ptr[1], s2 += s1; + s1 += ptr[2], s2 += s1; + s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; + s1 += ptr[5], s2 += s1; + s1 += ptr[6], s2 += s1; + s1 += ptr[7], s2 += s1; + } + for (; i < block_len; ++i) + s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; + buf_len -= block_len; + block_len = 5552; + } + return (s2 << 16) + s1; +} + +/* Karl Malbrain's compact CRC-32. See "A compact CCITT crc16 and crc32 C implementation that balances processor cache usage against speed": http://www.geocities.com/malbrain/ */ +#if 0 + mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len) + { + static const mz_uint32 s_crc32[16] = { 0, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, + 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c }; + mz_uint32 crcu32 = (mz_uint32)crc; + if (!ptr) + return MZ_CRC32_INIT; + crcu32 = ~crcu32; + while (buf_len--) + { + mz_uint8 b = *ptr++; + crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b & 0xF)]; + crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b >> 4)]; + } + return ~crcu32; + } +#elif defined(USE_EXTERNAL_MZCRC) +/* If USE_EXTERNAL_CRC is defined, an external module will export the + * mz_crc32() symbol for us to use, e.g. an SSE-accelerated version. + * Depending on the impl, it may be necessary to ~ the input/output crc values. + */ +mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len); +#else +/* Faster, but larger CPU cache footprint. + */ +mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len) +{ + static const mz_uint32 s_crc_table[256] = + { + 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, + 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, + 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, + 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, + 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, + 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, + 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, + 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, + 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, + 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, + 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, + 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, + 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, + 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, + 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, + 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, + 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, + 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, + 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, + 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, + 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, + 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, + 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, + 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, + 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, + 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, + 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, + 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, + 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, + 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, + 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, + 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, + 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, + 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, + 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, + 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, + 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D + }; + + mz_uint32 crc32 = (mz_uint32)crc ^ 0xFFFFFFFF; + const mz_uint8 *pByte_buf = (const mz_uint8 *)ptr; + + while (buf_len >= 4) + { + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[0]) & 0xFF]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[1]) & 0xFF]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[2]) & 0xFF]; + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[3]) & 0xFF]; + pByte_buf += 4; + buf_len -= 4; + } + + while (buf_len) + { + crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[0]) & 0xFF]; + ++pByte_buf; + --buf_len; + } + + return ~crc32; +} +#endif + +void mz_free(void *p) +{ + MZ_FREE(p); +} + +MINIZ_EXPORT void *miniz_def_alloc_func(void *opaque, size_t items, size_t size) +{ + (void)opaque, (void)items, (void)size; + return MZ_MALLOC(items * size); +} +MINIZ_EXPORT void miniz_def_free_func(void *opaque, void *address) +{ + (void)opaque, (void)address; + MZ_FREE(address); +} +MINIZ_EXPORT void *miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size) +{ + (void)opaque, (void)address, (void)items, (void)size; + return MZ_REALLOC(address, items * size); +} + +const char *mz_version(void) +{ + return MZ_VERSION; +} + +#ifndef MINIZ_NO_ZLIB_APIS + +#ifndef MINIZ_NO_DEFLATE_APIS + +int mz_deflateInit(mz_streamp pStream, int level) +{ + return mz_deflateInit2(pStream, level, MZ_DEFLATED, MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY); +} + +int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy) +{ + tdefl_compressor *pComp; + mz_uint comp_flags = TDEFL_COMPUTE_ADLER32 | tdefl_create_comp_flags_from_zip_params(level, window_bits, strategy); + + if (!pStream) + return MZ_STREAM_ERROR; + if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS))) + return MZ_PARAM_ERROR; + + pStream->data_type = 0; + pStream->adler = MZ_ADLER32_INIT; + pStream->msg = NULL; + pStream->reserved = 0; + pStream->total_in = 0; + pStream->total_out = 0; + if (!pStream->zalloc) + pStream->zalloc = miniz_def_alloc_func; + if (!pStream->zfree) + pStream->zfree = miniz_def_free_func; + + pComp = (tdefl_compressor *)pStream->zalloc(pStream->opaque, 1, sizeof(tdefl_compressor)); + if (!pComp) + return MZ_MEM_ERROR; + + pStream->state = (struct mz_internal_state *)pComp; + + if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY) + { + mz_deflateEnd(pStream); + return MZ_PARAM_ERROR; + } + + return MZ_OK; +} + +int mz_deflateReset(mz_streamp pStream) +{ + if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree)) + return MZ_STREAM_ERROR; + pStream->total_in = pStream->total_out = 0; + tdefl_init((tdefl_compressor *)pStream->state, NULL, NULL, ((tdefl_compressor *)pStream->state)->m_flags); + return MZ_OK; +} + +int mz_deflate(mz_streamp pStream, int flush) +{ + size_t in_bytes, out_bytes; + mz_ulong orig_total_in, orig_total_out; + int mz_status = MZ_OK; + + if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out)) + return MZ_STREAM_ERROR; + if (!pStream->avail_out) + return MZ_BUF_ERROR; + + if (flush == MZ_PARTIAL_FLUSH) + flush = MZ_SYNC_FLUSH; + + if (((tdefl_compressor *)pStream->state)->m_prev_return_status == TDEFL_STATUS_DONE) + return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR; + + orig_total_in = pStream->total_in; + orig_total_out = pStream->total_out; + for (;;) + { + tdefl_status defl_status; + in_bytes = pStream->avail_in; + out_bytes = pStream->avail_out; + + defl_status = tdefl_compress((tdefl_compressor *)pStream->state, pStream->next_in, &in_bytes, pStream->next_out, &out_bytes, (tdefl_flush)flush); + pStream->next_in += (mz_uint)in_bytes; + pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; + pStream->adler = tdefl_get_adler32((tdefl_compressor *)pStream->state); + + pStream->next_out += (mz_uint)out_bytes; + pStream->avail_out -= (mz_uint)out_bytes; + pStream->total_out += (mz_uint)out_bytes; + + if (defl_status < 0) + { + mz_status = MZ_STREAM_ERROR; + break; + } + else if (defl_status == TDEFL_STATUS_DONE) + { + mz_status = MZ_STREAM_END; + break; + } + else if (!pStream->avail_out) + break; + else if ((!pStream->avail_in) && (flush != MZ_FINISH)) + { + if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out)) + break; + return MZ_BUF_ERROR; /* Can't make forward progress without some input. + */ + } + } + return mz_status; +} + +int mz_deflateEnd(mz_streamp pStream) +{ + if (!pStream) + return MZ_STREAM_ERROR; + if (pStream->state) + { + pStream->zfree(pStream->opaque, pStream->state); + pStream->state = NULL; + } + return MZ_OK; +} + +mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len) +{ + (void)pStream; + /* This is really over conservative. (And lame, but it's actually pretty tricky to compute a true upper bound given the way tdefl's blocking works.) */ + return MZ_MAX(128 + (source_len * 110) / 100, 128 + source_len + ((source_len / (31 * 1024)) + 1) * 5); +} + +int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level) +{ + int status; + mz_stream stream; + memset(&stream, 0, sizeof(stream)); + + /* In case mz_ulong is 64-bits (argh I hate longs). */ + if ((mz_uint64)(source_len | *pDest_len) > 0xFFFFFFFFU) + return MZ_PARAM_ERROR; + + stream.next_in = pSource; + stream.avail_in = (mz_uint32)source_len; + stream.next_out = pDest; + stream.avail_out = (mz_uint32)*pDest_len; + + status = mz_deflateInit(&stream, level); + if (status != MZ_OK) + return status; + + status = mz_deflate(&stream, MZ_FINISH); + if (status != MZ_STREAM_END) + { + mz_deflateEnd(&stream); + return (status == MZ_OK) ? MZ_BUF_ERROR : status; + } + + *pDest_len = stream.total_out; + return mz_deflateEnd(&stream); +} + +int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len) +{ + return mz_compress2(pDest, pDest_len, pSource, source_len, MZ_DEFAULT_COMPRESSION); +} + +mz_ulong mz_compressBound(mz_ulong source_len) +{ + return mz_deflateBound(NULL, source_len); +} + +#endif /*#ifndef MINIZ_NO_DEFLATE_APIS*/ + +#ifndef MINIZ_NO_INFLATE_APIS + +typedef struct +{ + tinfl_decompressor m_decomp; + mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed; + int m_window_bits; + mz_uint8 m_dict[TINFL_LZ_DICT_SIZE]; + tinfl_status m_last_status; +} inflate_state; + +int mz_inflateInit2(mz_streamp pStream, int window_bits) +{ + inflate_state *pDecomp; + if (!pStream) + return MZ_STREAM_ERROR; + if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)) + return MZ_PARAM_ERROR; + + pStream->data_type = 0; + pStream->adler = 0; + pStream->msg = NULL; + pStream->total_in = 0; + pStream->total_out = 0; + pStream->reserved = 0; + if (!pStream->zalloc) + pStream->zalloc = miniz_def_alloc_func; + if (!pStream->zfree) + pStream->zfree = miniz_def_free_func; + + pDecomp = (inflate_state *)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state)); + if (!pDecomp) + return MZ_MEM_ERROR; + + pStream->state = (struct mz_internal_state *)pDecomp; + + tinfl_init(&pDecomp->m_decomp); + pDecomp->m_dict_ofs = 0; + pDecomp->m_dict_avail = 0; + pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT; + pDecomp->m_first_call = 1; + pDecomp->m_has_flushed = 0; + pDecomp->m_window_bits = window_bits; + + return MZ_OK; +} + +int mz_inflateInit(mz_streamp pStream) +{ + return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS); +} + +int mz_inflateReset(mz_streamp pStream) +{ + inflate_state *pDecomp; + if (!pStream) + return MZ_STREAM_ERROR; + + pStream->data_type = 0; + pStream->adler = 0; + pStream->msg = NULL; + pStream->total_in = 0; + pStream->total_out = 0; + pStream->reserved = 0; + + pDecomp = (inflate_state *)pStream->state; + + tinfl_init(&pDecomp->m_decomp); + pDecomp->m_dict_ofs = 0; + pDecomp->m_dict_avail = 0; + pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT; + pDecomp->m_first_call = 1; + pDecomp->m_has_flushed = 0; + /* pDecomp->m_window_bits = window_bits */; + + return MZ_OK; +} + +int mz_inflate(mz_streamp pStream, int flush) +{ + inflate_state *pState; + mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32; + size_t in_bytes, out_bytes, orig_avail_in; + tinfl_status status; + + if ((!pStream) || (!pStream->state)) + return MZ_STREAM_ERROR; + if (flush == MZ_PARTIAL_FLUSH) + flush = MZ_SYNC_FLUSH; + if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH)) + return MZ_STREAM_ERROR; + + pState = (inflate_state *)pStream->state; + if (pState->m_window_bits > 0) + decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER; + orig_avail_in = pStream->avail_in; + + first_call = pState->m_first_call; + pState->m_first_call = 0; + if (pState->m_last_status < 0) + return MZ_DATA_ERROR; + + if (pState->m_has_flushed && (flush != MZ_FINISH)) + return MZ_STREAM_ERROR; + pState->m_has_flushed |= (flush == MZ_FINISH); + + if ((flush == MZ_FINISH) && (first_call)) + { + /* MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. */ + decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF; + in_bytes = pStream->avail_in; + out_bytes = pStream->avail_out; + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags); + pState->m_last_status = status; + pStream->next_in += (mz_uint)in_bytes; + pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; + pStream->adler = tinfl_get_adler32(&pState->m_decomp); + pStream->next_out += (mz_uint)out_bytes; + pStream->avail_out -= (mz_uint)out_bytes; + pStream->total_out += (mz_uint)out_bytes; + + if (status < 0) + return MZ_DATA_ERROR; + else if (status != TINFL_STATUS_DONE) + { + pState->m_last_status = TINFL_STATUS_FAILED; + return MZ_BUF_ERROR; + } + return MZ_STREAM_END; + } + /* flush != MZ_FINISH then we must assume there's more input. */ + if (flush != MZ_FINISH) + decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT; + + if (pState->m_dict_avail) + { + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; + pStream->avail_out -= n; + pStream->total_out += n; + pState->m_dict_avail -= n; + pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; + } + + for (;;) + { + in_bytes = pStream->avail_in; + out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs; + + status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags); + pState->m_last_status = status; + + pStream->next_in += (mz_uint)in_bytes; + pStream->avail_in -= (mz_uint)in_bytes; + pStream->total_in += (mz_uint)in_bytes; + pStream->adler = tinfl_get_adler32(&pState->m_decomp); + + pState->m_dict_avail = (mz_uint)out_bytes; + + n = MZ_MIN(pState->m_dict_avail, pStream->avail_out); + memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n); + pStream->next_out += n; + pStream->avail_out -= n; + pStream->total_out += n; + pState->m_dict_avail -= n; + pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1); + + if (status < 0) + return MZ_DATA_ERROR; /* Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). */ + else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in)) + return MZ_BUF_ERROR; /* Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. */ + else if (flush == MZ_FINISH) + { + /* The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. */ + if (status == TINFL_STATUS_DONE) + return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END; + /* status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. */ + else if (!pStream->avail_out) + return MZ_BUF_ERROR; + } + else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail)) + break; + } + + return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK; +} + +int mz_inflateEnd(mz_streamp pStream) +{ + if (!pStream) + return MZ_STREAM_ERROR; + if (pStream->state) + { + pStream->zfree(pStream->opaque, pStream->state); + pStream->state = NULL; + } + return MZ_OK; +} +int mz_uncompress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong *pSource_len) +{ + mz_stream stream; + int status; + memset(&stream, 0, sizeof(stream)); + + /* In case mz_ulong is 64-bits (argh I hate longs). */ + if ((mz_uint64)(*pSource_len | *pDest_len) > 0xFFFFFFFFU) + return MZ_PARAM_ERROR; + + stream.next_in = pSource; + stream.avail_in = (mz_uint32)*pSource_len; + stream.next_out = pDest; + stream.avail_out = (mz_uint32)*pDest_len; + + status = mz_inflateInit(&stream); + if (status != MZ_OK) + return status; + + status = mz_inflate(&stream, MZ_FINISH); + *pSource_len = *pSource_len - stream.avail_in; + if (status != MZ_STREAM_END) + { + mz_inflateEnd(&stream); + return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR : status; + } + *pDest_len = stream.total_out; + + return mz_inflateEnd(&stream); +} + +int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len) +{ + return mz_uncompress2(pDest, pDest_len, pSource, &source_len); +} + +#endif /*#ifndef MINIZ_NO_INFLATE_APIS*/ + +const char *mz_error(int err) +{ + static struct + { + int m_err; + const char *m_pDesc; + } s_error_descs[] = + { + { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" }, { MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" } + }; + mz_uint i; + for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i) + if (s_error_descs[i].m_err == err) + return s_error_descs[i].m_pDesc; + return NULL; +} + +#endif /*MINIZ_NO_ZLIB_APIS */ + +#ifdef __cplusplus +} +#endif + +/* + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR + OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + + For more information, please refer to +*/ +/************************************************************************** + * + * Copyright 2013-2014 RAD Game Tools and Valve Software + * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + **************************************************************************/ + + + +#ifndef MINIZ_NO_DEFLATE_APIS + +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------- Low-level Compression (independent from all decompression API's) */ + +/* Purposely making these tables static for faster init and thread safety. */ +static const mz_uint16 s_tdefl_len_sym[256] = + { + 257, 258, 259, 260, 261, 262, 263, 264, 265, 265, 266, 266, 267, 267, 268, 268, 269, 269, 269, 269, 270, 270, 270, 270, 271, 271, 271, 271, 272, 272, 272, 272, + 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 274, 274, 274, 274, 274, 274, 275, 275, 275, 275, 275, 275, 275, 275, 276, 276, 276, 276, 276, 276, 276, 276, + 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, + 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, + 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 285 + }; + +static const mz_uint8 s_tdefl_len_extra[256] = + { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0 + }; + +static const mz_uint8 s_tdefl_small_dist_sym[512] = + { + 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, + 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, + 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, + 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17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 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7 + }; + +static const mz_uint8 s_tdefl_large_dist_sym[128] = + { + 0, 0, 18, 19, 20, 20, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, + 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, + 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 + }; + +static const mz_uint8 s_tdefl_large_dist_extra[128] = + { + 0, 0, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, + 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, + 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 + }; + +/* Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted values. */ +typedef struct +{ + mz_uint16 m_key, m_sym_index; +} tdefl_sym_freq; +static tdefl_sym_freq *tdefl_radix_sort_syms(mz_uint num_syms, tdefl_sym_freq *pSyms0, tdefl_sym_freq *pSyms1) +{ + mz_uint32 total_passes = 2, pass_shift, pass, i, hist[256 * 2]; + tdefl_sym_freq *pCur_syms = pSyms0, *pNew_syms = pSyms1; + MZ_CLEAR_ARR(hist); + for (i = 0; i < num_syms; i++) + { + mz_uint freq = pSyms0[i].m_key; + hist[freq & 0xFF]++; + hist[256 + ((freq >> 8) & 0xFF)]++; + } + while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256])) + total_passes--; + for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8) + { + const mz_uint32 *pHist = &hist[pass << 8]; + mz_uint offsets[256], cur_ofs = 0; + for (i = 0; i < 256; i++) + { + offsets[i] = cur_ofs; + cur_ofs += pHist[i]; + } + for (i = 0; i < num_syms; i++) + pNew_syms[offsets[(pCur_syms[i].m_key >> pass_shift) & 0xFF]++] = pCur_syms[i]; + { + tdefl_sym_freq *t = pCur_syms; + pCur_syms = pNew_syms; + pNew_syms = t; + } + } + return pCur_syms; +} + +/* tdefl_calculate_minimum_redundancy() originally written by: Alistair Moffat, alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996. */ +static void tdefl_calculate_minimum_redundancy(tdefl_sym_freq *A, int n) +{ + int root, leaf, next, avbl, used, dpth; + if (n == 0) + return; + else if (n == 1) + { + A[0].m_key = 1; + return; + } + A[0].m_key += A[1].m_key; + root = 0; + leaf = 2; + for (next = 1; next < n - 1; next++) + { + if (leaf >= n || A[root].m_key < A[leaf].m_key) + { + A[next].m_key = A[root].m_key; + A[root++].m_key = (mz_uint16)next; + } + else + A[next].m_key = A[leaf++].m_key; + if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key)) + { + A[next].m_key = (mz_uint16)(A[next].m_key + A[root].m_key); + A[root++].m_key = (mz_uint16)next; + } + else + A[next].m_key = (mz_uint16)(A[next].m_key + A[leaf++].m_key); + } + A[n - 2].m_key = 0; + for (next = n - 3; next >= 0; next--) + A[next].m_key = A[A[next].m_key].m_key + 1; + avbl = 1; + used = dpth = 0; + root = n - 2; + next = n - 1; + while (avbl > 0) + { + while (root >= 0 && (int)A[root].m_key == dpth) + { + used++; + root--; + } + while (avbl > used) + { + A[next--].m_key = (mz_uint16)(dpth); + avbl--; + } + avbl = 2 * used; + dpth++; + used = 0; + } +} + +/* Limits canonical Huffman code table's max code size. */ +enum +{ + TDEFL_MAX_SUPPORTED_HUFF_CODESIZE = 32 +}; +static void tdefl_huffman_enforce_max_code_size(int *pNum_codes, int code_list_len, int max_code_size) +{ + int i; + mz_uint32 total = 0; + if (code_list_len <= 1) + return; + for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++) + pNum_codes[max_code_size] += pNum_codes[i]; + for (i = max_code_size; i > 0; i--) + total += (((mz_uint32)pNum_codes[i]) << (max_code_size - i)); + while (total != (1UL << max_code_size)) + { + pNum_codes[max_code_size]--; + for (i = max_code_size - 1; i > 0; i--) + if (pNum_codes[i]) + { + pNum_codes[i]--; + pNum_codes[i + 1] += 2; + break; + } + total--; + } +} + +static void tdefl_optimize_huffman_table(tdefl_compressor *d, int table_num, int table_len, int code_size_limit, int static_table) +{ + int i, j, l, num_codes[1 + TDEFL_MAX_SUPPORTED_HUFF_CODESIZE]; + mz_uint next_code[TDEFL_MAX_SUPPORTED_HUFF_CODESIZE + 1]; + MZ_CLEAR_ARR(num_codes); + if (static_table) + { + for (i = 0; i < table_len; i++) + num_codes[d->m_huff_code_sizes[table_num][i]]++; + } + else + { + tdefl_sym_freq syms0[TDEFL_MAX_HUFF_SYMBOLS], syms1[TDEFL_MAX_HUFF_SYMBOLS], *pSyms; + int num_used_syms = 0; + const mz_uint16 *pSym_count = &d->m_huff_count[table_num][0]; + for (i = 0; i < table_len; i++) + if (pSym_count[i]) + { + syms0[num_used_syms].m_key = (mz_uint16)pSym_count[i]; + syms0[num_used_syms++].m_sym_index = (mz_uint16)i; + } + + pSyms = tdefl_radix_sort_syms(num_used_syms, syms0, syms1); + tdefl_calculate_minimum_redundancy(pSyms, num_used_syms); + + for (i = 0; i < num_used_syms; i++) + num_codes[pSyms[i].m_key]++; + + tdefl_huffman_enforce_max_code_size(num_codes, num_used_syms, code_size_limit); + + MZ_CLEAR_ARR(d->m_huff_code_sizes[table_num]); + MZ_CLEAR_ARR(d->m_huff_codes[table_num]); + for (i = 1, j = num_used_syms; i <= code_size_limit; i++) + for (l = num_codes[i]; l > 0; l--) + d->m_huff_code_sizes[table_num][pSyms[--j].m_sym_index] = (mz_uint8)(i); + } + + next_code[1] = 0; + for (j = 0, i = 2; i <= code_size_limit; i++) + next_code[i] = j = ((j + num_codes[i - 1]) << 1); + + for (i = 0; i < table_len; i++) + { + mz_uint rev_code = 0, code, code_size; + if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0) + continue; + code = next_code[code_size]++; + for (l = code_size; l > 0; l--, code >>= 1) + rev_code = (rev_code << 1) | (code & 1); + d->m_huff_codes[table_num][i] = (mz_uint16)rev_code; + } +} + +#define TDEFL_PUT_BITS(b, l) \ + do \ + { \ + mz_uint bits = b; \ + mz_uint len = l; \ + MZ_ASSERT(bits <= ((1U << len) - 1U)); \ + d->m_bit_buffer |= (bits << d->m_bits_in); \ + d->m_bits_in += len; \ + while (d->m_bits_in >= 8) \ + { \ + if (d->m_pOutput_buf < d->m_pOutput_buf_end) \ + *d->m_pOutput_buf++ = (mz_uint8)(d->m_bit_buffer); \ + d->m_bit_buffer >>= 8; \ + d->m_bits_in -= 8; \ + } \ + } \ + MZ_MACRO_END + +#define TDEFL_RLE_PREV_CODE_SIZE() \ + { \ + if (rle_repeat_count) \ + { \ + if (rle_repeat_count < 3) \ + { \ + d->m_huff_count[2][prev_code_size] = (mz_uint16)(d->m_huff_count[2][prev_code_size] + rle_repeat_count); \ + while (rle_repeat_count--) \ + packed_code_sizes[num_packed_code_sizes++] = prev_code_size; \ + } \ + else \ + { \ + d->m_huff_count[2][16] = (mz_uint16)(d->m_huff_count[2][16] + 1); \ + packed_code_sizes[num_packed_code_sizes++] = 16; \ + packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_repeat_count - 3); \ + } \ + rle_repeat_count = 0; \ + } \ + } + +#define TDEFL_RLE_ZERO_CODE_SIZE() \ + { \ + if (rle_z_count) \ + { \ + if (rle_z_count < 3) \ + { \ + d->m_huff_count[2][0] = (mz_uint16)(d->m_huff_count[2][0] + rle_z_count); \ + while (rle_z_count--) \ + packed_code_sizes[num_packed_code_sizes++] = 0; \ + } \ + else if (rle_z_count <= 10) \ + { \ + d->m_huff_count[2][17] = (mz_uint16)(d->m_huff_count[2][17] + 1); \ + packed_code_sizes[num_packed_code_sizes++] = 17; \ + packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 3); \ + } \ + else \ + { \ + d->m_huff_count[2][18] = (mz_uint16)(d->m_huff_count[2][18] + 1); \ + packed_code_sizes[num_packed_code_sizes++] = 18; \ + packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 11); \ + } \ + rle_z_count = 0; \ + } \ + } + +static const mz_uint8 s_tdefl_packed_code_size_syms_swizzle[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + +static void tdefl_start_dynamic_block(tdefl_compressor *d) +{ + int num_lit_codes, num_dist_codes, num_bit_lengths; + mz_uint i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index; + mz_uint8 code_sizes_to_pack[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], packed_code_sizes[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], prev_code_size = 0xFF; + + d->m_huff_count[0][256] = 1; + + tdefl_optimize_huffman_table(d, 0, TDEFL_MAX_HUFF_SYMBOLS_0, 15, MZ_FALSE); + tdefl_optimize_huffman_table(d, 1, TDEFL_MAX_HUFF_SYMBOLS_1, 15, MZ_FALSE); + + for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--) + if (d->m_huff_code_sizes[0][num_lit_codes - 1]) + break; + for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--) + if (d->m_huff_code_sizes[1][num_dist_codes - 1]) + break; + + memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes); + memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0], num_dist_codes); + total_code_sizes_to_pack = num_lit_codes + num_dist_codes; + num_packed_code_sizes = 0; + rle_z_count = 0; + rle_repeat_count = 0; + + memset(&d->m_huff_count[2][0], 0, sizeof(d->m_huff_count[2][0]) * TDEFL_MAX_HUFF_SYMBOLS_2); + for (i = 0; i < total_code_sizes_to_pack; i++) + { + mz_uint8 code_size = code_sizes_to_pack[i]; + if (!code_size) + { + TDEFL_RLE_PREV_CODE_SIZE(); + if (++rle_z_count == 138) + { + TDEFL_RLE_ZERO_CODE_SIZE(); + } + } + else + { + TDEFL_RLE_ZERO_CODE_SIZE(); + if (code_size != prev_code_size) + { + TDEFL_RLE_PREV_CODE_SIZE(); + d->m_huff_count[2][code_size] = (mz_uint16)(d->m_huff_count[2][code_size] + 1); + packed_code_sizes[num_packed_code_sizes++] = code_size; + } + else if (++rle_repeat_count == 6) + { + TDEFL_RLE_PREV_CODE_SIZE(); + } + } + prev_code_size = code_size; + } + if (rle_repeat_count) + { + TDEFL_RLE_PREV_CODE_SIZE(); + } + else + { + TDEFL_RLE_ZERO_CODE_SIZE(); + } + + tdefl_optimize_huffman_table(d, 2, TDEFL_MAX_HUFF_SYMBOLS_2, 7, MZ_FALSE); + + TDEFL_PUT_BITS(2, 2); + + TDEFL_PUT_BITS(num_lit_codes - 257, 5); + TDEFL_PUT_BITS(num_dist_codes - 1, 5); + + for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--) + if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]]) + break; + num_bit_lengths = MZ_MAX(4, (num_bit_lengths + 1)); + TDEFL_PUT_BITS(num_bit_lengths - 4, 4); + for (i = 0; (int)i < num_bit_lengths; i++) + TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3); + + for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes;) + { + mz_uint code = packed_code_sizes[packed_code_sizes_index++]; + MZ_ASSERT(code < TDEFL_MAX_HUFF_SYMBOLS_2); + TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]); + if (code >= 16) + TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]); + } +} + +static void tdefl_start_static_block(tdefl_compressor *d) +{ + mz_uint i; + mz_uint8 *p = &d->m_huff_code_sizes[0][0]; + + for (i = 0; i <= 143; ++i) + *p++ = 8; + for (; i <= 255; ++i) + *p++ = 9; + for (; i <= 279; ++i) + *p++ = 7; + for (; i <= 287; ++i) + *p++ = 8; + + memset(d->m_huff_code_sizes[1], 5, 32); + + tdefl_optimize_huffman_table(d, 0, 288, 15, MZ_TRUE); + tdefl_optimize_huffman_table(d, 1, 32, 15, MZ_TRUE); + + TDEFL_PUT_BITS(1, 2); +} + +static const mz_uint mz_bitmasks[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS +static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) +{ + mz_uint flags; + mz_uint8 *pLZ_codes; + mz_uint8 *pOutput_buf = d->m_pOutput_buf; + mz_uint8 *pLZ_code_buf_end = d->m_pLZ_code_buf; + mz_uint64 bit_buffer = d->m_bit_buffer; + mz_uint bits_in = d->m_bits_in; + +#define TDEFL_PUT_BITS_FAST(b, l) \ + { \ + bit_buffer |= (((mz_uint64)(b)) << bits_in); \ + bits_in += (l); \ + } + + flags = 1; + for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < pLZ_code_buf_end; flags >>= 1) + { + if (flags == 1) + flags = *pLZ_codes++ | 0x100; + + if (flags & 1) + { + mz_uint s0, s1, n0, n1, sym, num_extra_bits; + mz_uint match_len = pLZ_codes[0]; + mz_uint match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8)); + pLZ_codes += 3; + + MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS_FAST(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]); + + /* This sequence coaxes MSVC into using cmov's vs. jmp's. */ + s0 = s_tdefl_small_dist_sym[match_dist & 511]; + n0 = s_tdefl_small_dist_extra[match_dist & 511]; + s1 = s_tdefl_large_dist_sym[match_dist >> 8]; + n1 = s_tdefl_large_dist_extra[match_dist >> 8]; + sym = (match_dist < 512) ? s0 : s1; + num_extra_bits = (match_dist < 512) ? n0 : n1; + + MZ_ASSERT(d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS_FAST(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits); + } + else + { + mz_uint lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + + if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) + { + flags >>= 1; + lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + + if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end)) + { + flags >>= 1; + lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + } + } + } + + if (pOutput_buf >= d->m_pOutput_buf_end) + return MZ_FALSE; + + memcpy(pOutput_buf, &bit_buffer, sizeof(mz_uint64)); + pOutput_buf += (bits_in >> 3); + bit_buffer >>= (bits_in & ~7); + bits_in &= 7; + } + +#undef TDEFL_PUT_BITS_FAST + + d->m_pOutput_buf = pOutput_buf; + d->m_bits_in = 0; + d->m_bit_buffer = 0; + + while (bits_in) + { + mz_uint32 n = MZ_MIN(bits_in, 16); + TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n); + bit_buffer >>= n; + bits_in -= n; + } + + TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]); + + return (d->m_pOutput_buf < d->m_pOutput_buf_end); +} +#else +static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d) +{ + mz_uint flags; + mz_uint8 *pLZ_codes; + + flags = 1; + for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1) + { + if (flags == 1) + flags = *pLZ_codes++ | 0x100; + if (flags & 1) + { + mz_uint sym, num_extra_bits; + mz_uint match_len = pLZ_codes[0], match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8)); + pLZ_codes += 3; + + MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]); + TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]); + + if (match_dist < 512) + { + sym = s_tdefl_small_dist_sym[match_dist]; + num_extra_bits = s_tdefl_small_dist_extra[match_dist]; + } + else + { + sym = s_tdefl_large_dist_sym[match_dist >> 8]; + num_extra_bits = s_tdefl_large_dist_extra[match_dist >> 8]; + } + MZ_ASSERT(d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]); + TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits); + } + else + { + mz_uint lit = *pLZ_codes++; + MZ_ASSERT(d->m_huff_code_sizes[0][lit]); + TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]); + } + } + + TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]); + + return (d->m_pOutput_buf < d->m_pOutput_buf_end); +} +#endif /* MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS */ + +static mz_bool tdefl_compress_block(tdefl_compressor *d, mz_bool static_block) +{ + if (static_block) + tdefl_start_static_block(d); + else + tdefl_start_dynamic_block(d); + return tdefl_compress_lz_codes(d); +} + +static const mz_uint s_tdefl_num_probes[11]; + +static int tdefl_flush_block(tdefl_compressor *d, int flush) +{ + mz_uint saved_bit_buf, saved_bits_in; + mz_uint8 *pSaved_output_buf; + mz_bool comp_block_succeeded = MZ_FALSE; + int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size; + mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf; + + d->m_pOutput_buf = pOutput_buf_start; + d->m_pOutput_buf_end = d->m_pOutput_buf + TDEFL_OUT_BUF_SIZE - 16; + + MZ_ASSERT(!d->m_output_flush_remaining); + d->m_output_flush_ofs = 0; + d->m_output_flush_remaining = 0; + + *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> d->m_num_flags_left); + d->m_pLZ_code_buf -= (d->m_num_flags_left == 8); + + if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index)) + { + const mz_uint8 cmf = 0x78; + mz_uint8 flg, flevel = 3; + mz_uint header, i, mz_un = sizeof(s_tdefl_num_probes) / sizeof(mz_uint); + + /* Determine compression level by reversing the process in tdefl_create_comp_flags_from_zip_params() */ + for (i = 0; i < mz_un; i++) + if (s_tdefl_num_probes[i] == (d->m_flags & 0xFFF)) break; + + if (i < 2) + flevel = 0; + else if (i < 6) + flevel = 1; + else if (i == 6) + flevel = 2; + + header = cmf << 8 | (flevel << 6); + header += 31 - (header % 31); + flg = header & 0xFF; + + TDEFL_PUT_BITS(cmf, 8); + TDEFL_PUT_BITS(flg, 8); + } + + TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1); + + pSaved_output_buf = d->m_pOutput_buf; + saved_bit_buf = d->m_bit_buffer; + saved_bits_in = d->m_bits_in; + + if (!use_raw_block) + comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48)); + + /* If the block gets expanded, forget the current contents of the output buffer and send a raw block instead. */ + if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) && + ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size)) + { + mz_uint i; + d->m_pOutput_buf = pSaved_output_buf; + d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in; + TDEFL_PUT_BITS(0, 2); + if (d->m_bits_in) + { + TDEFL_PUT_BITS(0, 8 - d->m_bits_in); + } + for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF) + { + TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16); + } + for (i = 0; i < d->m_total_lz_bytes; ++i) + { + TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8); + } + } + /* Check for the extremely unlikely (if not impossible) case of the compressed block not fitting into the output buffer when using dynamic codes. */ + else if (!comp_block_succeeded) + { + d->m_pOutput_buf = pSaved_output_buf; + d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in; + tdefl_compress_block(d, MZ_TRUE); + } + + if (flush) + { + if (flush == TDEFL_FINISH) + { + if (d->m_bits_in) + { + TDEFL_PUT_BITS(0, 8 - d->m_bits_in); + } + if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER) + { + mz_uint i, a = d->m_adler32; + for (i = 0; i < 4; i++) + { + TDEFL_PUT_BITS((a >> 24) & 0xFF, 8); + a <<= 8; + } + } + } + else + { + mz_uint i, z = 0; + TDEFL_PUT_BITS(0, 3); + if (d->m_bits_in) + { + TDEFL_PUT_BITS(0, 8 - d->m_bits_in); + } + for (i = 2; i; --i, z ^= 0xFFFF) + { + TDEFL_PUT_BITS(z & 0xFFFF, 16); + } + } + } + + MZ_ASSERT(d->m_pOutput_buf < d->m_pOutput_buf_end); + + memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); + memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); + + d->m_pLZ_code_buf = d->m_lz_code_buf + 1; + d->m_pLZ_flags = d->m_lz_code_buf; + d->m_num_flags_left = 8; + d->m_lz_code_buf_dict_pos += d->m_total_lz_bytes; + d->m_total_lz_bytes = 0; + d->m_block_index++; + + if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0) + { + if (d->m_pPut_buf_func) + { + *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf; + if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user)) + return (d->m_prev_return_status = TDEFL_STATUS_PUT_BUF_FAILED); + } + else if (pOutput_buf_start == d->m_output_buf) + { + int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs)); + memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf, bytes_to_copy); + d->m_out_buf_ofs += bytes_to_copy; + if ((n -= bytes_to_copy) != 0) + { + d->m_output_flush_ofs = bytes_to_copy; + d->m_output_flush_remaining = n; + } + } + else + { + d->m_out_buf_ofs += n; + } + } + + return d->m_output_flush_remaining; +} + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES +#ifdef MINIZ_UNALIGNED_USE_MEMCPY +static mz_uint16 TDEFL_READ_UNALIGNED_WORD(const mz_uint8* p) +{ + mz_uint16 ret; + memcpy(&ret, p, sizeof(mz_uint16)); + return ret; +} +static mz_uint16 TDEFL_READ_UNALIGNED_WORD2(const mz_uint16* p) +{ + mz_uint16 ret; + memcpy(&ret, p, sizeof(mz_uint16)); + return ret; +} +#else +#define TDEFL_READ_UNALIGNED_WORD(p) *(const mz_uint16 *)(p) +#define TDEFL_READ_UNALIGNED_WORD2(p) *(const mz_uint16 *)(p) +#endif +static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) +{ + mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len; + mz_uint num_probes_left = d->m_max_probes[match_len >= 32]; + const mz_uint16 *s = (const mz_uint16 *)(d->m_dict + pos), *p, *q; + mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]), s01 = TDEFL_READ_UNALIGNED_WORD2(s); + MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); + if (max_match_len <= match_len) + return; + for (;;) + { + for (;;) + { + if (--num_probes_left == 0) + return; +#define TDEFL_PROBE \ + next_probe_pos = d->m_next[probe_pos]; \ + if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) \ + return; \ + probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \ + if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) \ + break; + TDEFL_PROBE; + TDEFL_PROBE; + TDEFL_PROBE; + } + if (!dist) + break; + q = (const mz_uint16 *)(d->m_dict + probe_pos); + if (TDEFL_READ_UNALIGNED_WORD2(q) != s01) + continue; + p = s; + probe_len = 32; + do + { + } while ((TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && + (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0)); + if (!probe_len) + { + *pMatch_dist = dist; + *pMatch_len = MZ_MIN(max_match_len, (mz_uint)TDEFL_MAX_MATCH_LEN); + break; + } + else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q)) > match_len) + { + *pMatch_dist = dist; + if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len) + break; + c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]); + } + } +} +#else +static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len) +{ + mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len; + mz_uint num_probes_left = d->m_max_probes[match_len >= 32]; + const mz_uint8 *s = d->m_dict + pos, *p, *q; + mz_uint8 c0 = d->m_dict[pos + match_len], c1 = d->m_dict[pos + match_len - 1]; + MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN); + if (max_match_len <= match_len) + return; + for (;;) + { + for (;;) + { + if (--num_probes_left == 0) + return; +#define TDEFL_PROBE \ + next_probe_pos = d->m_next[probe_pos]; \ + if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) \ + return; \ + probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \ + if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) \ + break; + TDEFL_PROBE; + TDEFL_PROBE; + TDEFL_PROBE; + } + if (!dist) + break; + p = s; + q = d->m_dict + probe_pos; + for (probe_len = 0; probe_len < max_match_len; probe_len++) + if (*p++ != *q++) + break; + if (probe_len > match_len) + { + *pMatch_dist = dist; + if ((*pMatch_len = match_len = probe_len) == max_match_len) + return; + c0 = d->m_dict[pos + match_len]; + c1 = d->m_dict[pos + match_len - 1]; + } + } +} +#endif /* #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES */ + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN +#ifdef MINIZ_UNALIGNED_USE_MEMCPY +static mz_uint32 TDEFL_READ_UNALIGNED_WORD32(const mz_uint8* p) +{ + mz_uint32 ret; + memcpy(&ret, p, sizeof(mz_uint32)); + return ret; +} +#else +#define TDEFL_READ_UNALIGNED_WORD32(p) *(const mz_uint32 *)(p) +#endif +static mz_bool tdefl_compress_fast(tdefl_compressor *d) +{ + /* Faster, minimally featured LZRW1-style match+parse loop with better register utilization. Intended for applications where raw throughput is valued more highly than ratio. */ + mz_uint lookahead_pos = d->m_lookahead_pos, lookahead_size = d->m_lookahead_size, dict_size = d->m_dict_size, total_lz_bytes = d->m_total_lz_bytes, num_flags_left = d->m_num_flags_left; + mz_uint8 *pLZ_code_buf = d->m_pLZ_code_buf, *pLZ_flags = d->m_pLZ_flags; + mz_uint cur_pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK; + + while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size))) + { + const mz_uint TDEFL_COMP_FAST_LOOKAHEAD_SIZE = 4096; + mz_uint dst_pos = (lookahead_pos + lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK; + mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size); + d->m_src_buf_left -= num_bytes_to_process; + lookahead_size += num_bytes_to_process; + + while (num_bytes_to_process) + { + mz_uint32 n = MZ_MIN(TDEFL_LZ_DICT_SIZE - dst_pos, num_bytes_to_process); + memcpy(d->m_dict + dst_pos, d->m_pSrc, n); + if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) + memcpy(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc, MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos)); + d->m_pSrc += n; + dst_pos = (dst_pos + n) & TDEFL_LZ_DICT_SIZE_MASK; + num_bytes_to_process -= n; + } + + dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - lookahead_size, dict_size); + if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE)) + break; + + while (lookahead_size >= 4) + { + mz_uint cur_match_dist, cur_match_len = 1; + mz_uint8 *pCur_dict = d->m_dict + cur_pos; + mz_uint first_trigram = TDEFL_READ_UNALIGNED_WORD32(pCur_dict) & 0xFFFFFF; + mz_uint hash = (first_trigram ^ (first_trigram >> (24 - (TDEFL_LZ_HASH_BITS - 8)))) & TDEFL_LEVEL1_HASH_SIZE_MASK; + mz_uint probe_pos = d->m_hash[hash]; + d->m_hash[hash] = (mz_uint16)lookahead_pos; + + if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((TDEFL_READ_UNALIGNED_WORD32(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram)) + { + const mz_uint16 *p = (const mz_uint16 *)pCur_dict; + const mz_uint16 *q = (const mz_uint16 *)(d->m_dict + probe_pos); + mz_uint32 probe_len = 32; + do + { + } while ((TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && + (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0)); + cur_match_len = ((mz_uint)(p - (const mz_uint16 *)pCur_dict) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q); + if (!probe_len) + cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0; + + if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U))) + { + cur_match_len = 1; + *pLZ_code_buf++ = (mz_uint8)first_trigram; + *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); + d->m_huff_count[0][(mz_uint8)first_trigram]++; + } + else + { + mz_uint32 s0, s1; + cur_match_len = MZ_MIN(cur_match_len, lookahead_size); + + MZ_ASSERT((cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE)); + + cur_match_dist--; + + pLZ_code_buf[0] = (mz_uint8)(cur_match_len - TDEFL_MIN_MATCH_LEN); +#ifdef MINIZ_UNALIGNED_USE_MEMCPY + memcpy(&pLZ_code_buf[1], &cur_match_dist, sizeof(cur_match_dist)); +#else + *(mz_uint16 *)(&pLZ_code_buf[1]) = (mz_uint16)cur_match_dist; +#endif + pLZ_code_buf += 3; + *pLZ_flags = (mz_uint8)((*pLZ_flags >> 1) | 0x80); + + s0 = s_tdefl_small_dist_sym[cur_match_dist & 511]; + s1 = s_tdefl_large_dist_sym[cur_match_dist >> 8]; + d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++; + + d->m_huff_count[0][s_tdefl_len_sym[cur_match_len - TDEFL_MIN_MATCH_LEN]]++; + } + } + else + { + *pLZ_code_buf++ = (mz_uint8)first_trigram; + *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); + d->m_huff_count[0][(mz_uint8)first_trigram]++; + } + + if (--num_flags_left == 0) + { + num_flags_left = 8; + pLZ_flags = pLZ_code_buf++; + } + + total_lz_bytes += cur_match_len; + lookahead_pos += cur_match_len; + dict_size = MZ_MIN(dict_size + cur_match_len, (mz_uint)TDEFL_LZ_DICT_SIZE); + cur_pos = (cur_pos + cur_match_len) & TDEFL_LZ_DICT_SIZE_MASK; + MZ_ASSERT(lookahead_size >= cur_match_len); + lookahead_size -= cur_match_len; + + if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) + { + int n; + d->m_lookahead_pos = lookahead_pos; + d->m_lookahead_size = lookahead_size; + d->m_dict_size = dict_size; + d->m_total_lz_bytes = total_lz_bytes; + d->m_pLZ_code_buf = pLZ_code_buf; + d->m_pLZ_flags = pLZ_flags; + d->m_num_flags_left = num_flags_left; + if ((n = tdefl_flush_block(d, 0)) != 0) + return (n < 0) ? MZ_FALSE : MZ_TRUE; + total_lz_bytes = d->m_total_lz_bytes; + pLZ_code_buf = d->m_pLZ_code_buf; + pLZ_flags = d->m_pLZ_flags; + num_flags_left = d->m_num_flags_left; + } + } + + while (lookahead_size) + { + mz_uint8 lit = d->m_dict[cur_pos]; + + total_lz_bytes++; + *pLZ_code_buf++ = lit; + *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1); + if (--num_flags_left == 0) + { + num_flags_left = 8; + pLZ_flags = pLZ_code_buf++; + } + + d->m_huff_count[0][lit]++; + + lookahead_pos++; + dict_size = MZ_MIN(dict_size + 1, (mz_uint)TDEFL_LZ_DICT_SIZE); + cur_pos = (cur_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK; + lookahead_size--; + + if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) + { + int n; + d->m_lookahead_pos = lookahead_pos; + d->m_lookahead_size = lookahead_size; + d->m_dict_size = dict_size; + d->m_total_lz_bytes = total_lz_bytes; + d->m_pLZ_code_buf = pLZ_code_buf; + d->m_pLZ_flags = pLZ_flags; + d->m_num_flags_left = num_flags_left; + if ((n = tdefl_flush_block(d, 0)) != 0) + return (n < 0) ? MZ_FALSE : MZ_TRUE; + total_lz_bytes = d->m_total_lz_bytes; + pLZ_code_buf = d->m_pLZ_code_buf; + pLZ_flags = d->m_pLZ_flags; + num_flags_left = d->m_num_flags_left; + } + } + } + + d->m_lookahead_pos = lookahead_pos; + d->m_lookahead_size = lookahead_size; + d->m_dict_size = dict_size; + d->m_total_lz_bytes = total_lz_bytes; + d->m_pLZ_code_buf = pLZ_code_buf; + d->m_pLZ_flags = pLZ_flags; + d->m_num_flags_left = num_flags_left; + return MZ_TRUE; +} +#endif /* MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN */ + +static MZ_FORCEINLINE void tdefl_record_literal(tdefl_compressor *d, mz_uint8 lit) +{ + d->m_total_lz_bytes++; + *d->m_pLZ_code_buf++ = lit; + *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> 1); + if (--d->m_num_flags_left == 0) + { + d->m_num_flags_left = 8; + d->m_pLZ_flags = d->m_pLZ_code_buf++; + } + d->m_huff_count[0][lit]++; +} + +static MZ_FORCEINLINE void tdefl_record_match(tdefl_compressor *d, mz_uint match_len, mz_uint match_dist) +{ + mz_uint32 s0, s1; + + MZ_ASSERT((match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE)); + + d->m_total_lz_bytes += match_len; + + d->m_pLZ_code_buf[0] = (mz_uint8)(match_len - TDEFL_MIN_MATCH_LEN); + + match_dist -= 1; + d->m_pLZ_code_buf[1] = (mz_uint8)(match_dist & 0xFF); + d->m_pLZ_code_buf[2] = (mz_uint8)(match_dist >> 8); + d->m_pLZ_code_buf += 3; + + *d->m_pLZ_flags = (mz_uint8)((*d->m_pLZ_flags >> 1) | 0x80); + if (--d->m_num_flags_left == 0) + { + d->m_num_flags_left = 8; + d->m_pLZ_flags = d->m_pLZ_code_buf++; + } + + s0 = s_tdefl_small_dist_sym[match_dist & 511]; + s1 = s_tdefl_large_dist_sym[(match_dist >> 8) & 127]; + d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++; + d->m_huff_count[0][s_tdefl_len_sym[match_len - TDEFL_MIN_MATCH_LEN]]++; +} + +static mz_bool tdefl_compress_normal(tdefl_compressor *d) +{ + const mz_uint8 *pSrc = d->m_pSrc; + size_t src_buf_left = d->m_src_buf_left; + tdefl_flush flush = d->m_flush; + + while ((src_buf_left) || ((flush) && (d->m_lookahead_size))) + { + mz_uint len_to_move, cur_match_dist, cur_match_len, cur_pos; + /* Update dictionary and hash chains. Keeps the lookahead size equal to TDEFL_MAX_MATCH_LEN. */ + if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1)) + { + mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK, ins_pos = d->m_lookahead_pos + d->m_lookahead_size - 2; + mz_uint hash = (d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK]; + mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size); + const mz_uint8 *pSrc_end = pSrc ? pSrc + num_bytes_to_process : NULL; + src_buf_left -= num_bytes_to_process; + d->m_lookahead_size += num_bytes_to_process; + while (pSrc != pSrc_end) + { + mz_uint8 c = *pSrc++; + d->m_dict[dst_pos] = c; + if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) + d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c; + hash = ((hash << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1); + d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash]; + d->m_hash[hash] = (mz_uint16)(ins_pos); + dst_pos = (dst_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK; + ins_pos++; + } + } + else + { + while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) + { + mz_uint8 c = *pSrc++; + mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK; + src_buf_left--; + d->m_dict[dst_pos] = c; + if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1)) + d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c; + if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN) + { + mz_uint ins_pos = d->m_lookahead_pos + (d->m_lookahead_size - 1) - 2; + mz_uint hash = ((d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << (TDEFL_LZ_HASH_SHIFT * 2)) ^ (d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1); + d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash]; + d->m_hash[hash] = (mz_uint16)(ins_pos); + } + } + } + d->m_dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - d->m_lookahead_size, d->m_dict_size); + if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN)) + break; + + /* Simple lazy/greedy parsing state machine. */ + len_to_move = 1; + cur_match_dist = 0; + cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1); + cur_pos = d->m_lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK; + if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS)) + { + if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))) + { + mz_uint8 c = d->m_dict[(cur_pos - 1) & TDEFL_LZ_DICT_SIZE_MASK]; + cur_match_len = 0; + while (cur_match_len < d->m_lookahead_size) + { + if (d->m_dict[cur_pos + cur_match_len] != c) + break; + cur_match_len++; + } + if (cur_match_len < TDEFL_MIN_MATCH_LEN) + cur_match_len = 0; + else + cur_match_dist = 1; + } + } + else + { + tdefl_find_match(d, d->m_lookahead_pos, d->m_dict_size, d->m_lookahead_size, &cur_match_dist, &cur_match_len); + } + if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5))) + { + cur_match_dist = cur_match_len = 0; + } + if (d->m_saved_match_len) + { + if (cur_match_len > d->m_saved_match_len) + { + tdefl_record_literal(d, (mz_uint8)d->m_saved_lit); + if (cur_match_len >= 128) + { + tdefl_record_match(d, cur_match_len, cur_match_dist); + d->m_saved_match_len = 0; + len_to_move = cur_match_len; + } + else + { + d->m_saved_lit = d->m_dict[cur_pos]; + d->m_saved_match_dist = cur_match_dist; + d->m_saved_match_len = cur_match_len; + } + } + else + { + tdefl_record_match(d, d->m_saved_match_len, d->m_saved_match_dist); + len_to_move = d->m_saved_match_len - 1; + d->m_saved_match_len = 0; + } + } + else if (!cur_match_dist) + tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]); + else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128)) + { + tdefl_record_match(d, cur_match_len, cur_match_dist); + len_to_move = cur_match_len; + } + else + { + d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]; + d->m_saved_match_dist = cur_match_dist; + d->m_saved_match_len = cur_match_len; + } + /* Move the lookahead forward by len_to_move bytes. */ + d->m_lookahead_pos += len_to_move; + MZ_ASSERT(d->m_lookahead_size >= len_to_move); + d->m_lookahead_size -= len_to_move; + d->m_dict_size = MZ_MIN(d->m_dict_size + len_to_move, (mz_uint)TDEFL_LZ_DICT_SIZE); + /* Check if it's time to flush the current LZ codes to the internal output buffer. */ + if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) || + ((d->m_total_lz_bytes > 31 * 1024) && (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >= d->m_total_lz_bytes) || (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS)))) + { + int n; + d->m_pSrc = pSrc; + d->m_src_buf_left = src_buf_left; + if ((n = tdefl_flush_block(d, 0)) != 0) + return (n < 0) ? MZ_FALSE : MZ_TRUE; + } + } + + d->m_pSrc = pSrc; + d->m_src_buf_left = src_buf_left; + return MZ_TRUE; +} + +static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d) +{ + if (d->m_pIn_buf_size) + { + *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf; + } + + if (d->m_pOut_buf_size) + { + size_t n = MZ_MIN(*d->m_pOut_buf_size - d->m_out_buf_ofs, d->m_output_flush_remaining); + memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf + d->m_output_flush_ofs, n); + d->m_output_flush_ofs += (mz_uint)n; + d->m_output_flush_remaining -= (mz_uint)n; + d->m_out_buf_ofs += n; + + *d->m_pOut_buf_size = d->m_out_buf_ofs; + } + + return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY; +} + +tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush) +{ + if (!d) + { + if (pIn_buf_size) + *pIn_buf_size = 0; + if (pOut_buf_size) + *pOut_buf_size = 0; + return TDEFL_STATUS_BAD_PARAM; + } + + d->m_pIn_buf = pIn_buf; + d->m_pIn_buf_size = pIn_buf_size; + d->m_pOut_buf = pOut_buf; + d->m_pOut_buf_size = pOut_buf_size; + d->m_pSrc = (const mz_uint8 *)(pIn_buf); + d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0; + d->m_out_buf_ofs = 0; + d->m_flush = flush; + + if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) || + (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf)) + { + if (pIn_buf_size) + *pIn_buf_size = 0; + if (pOut_buf_size) + *pOut_buf_size = 0; + return (d->m_prev_return_status = TDEFL_STATUS_BAD_PARAM); + } + d->m_wants_to_finish |= (flush == TDEFL_FINISH); + + if ((d->m_output_flush_remaining) || (d->m_finished)) + return (d->m_prev_return_status = tdefl_flush_output_buffer(d)); + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN + if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) && + ((d->m_flags & TDEFL_GREEDY_PARSING_FLAG) != 0) && + ((d->m_flags & (TDEFL_FILTER_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS | TDEFL_RLE_MATCHES)) == 0)) + { + if (!tdefl_compress_fast(d)) + return d->m_prev_return_status; + } + else +#endif /* #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN */ + { + if (!tdefl_compress_normal(d)) + return d->m_prev_return_status; + } + + if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf)) + d->m_adler32 = (mz_uint32)mz_adler32(d->m_adler32, (const mz_uint8 *)pIn_buf, d->m_pSrc - (const mz_uint8 *)pIn_buf); + + if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining)) + { + if (tdefl_flush_block(d, flush) < 0) + return d->m_prev_return_status; + d->m_finished = (flush == TDEFL_FINISH); + if (flush == TDEFL_FULL_FLUSH) + { + MZ_CLEAR_ARR(d->m_hash); + MZ_CLEAR_ARR(d->m_next); + d->m_dict_size = 0; + } + } + + return (d->m_prev_return_status = tdefl_flush_output_buffer(d)); +} + +tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush) +{ + MZ_ASSERT(d->m_pPut_buf_func); + return tdefl_compress(d, pIn_buf, &in_buf_size, NULL, NULL, flush); +} + +tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + d->m_pPut_buf_func = pPut_buf_func; + d->m_pPut_buf_user = pPut_buf_user; + d->m_flags = (mz_uint)(flags); + d->m_max_probes[0] = 1 + ((flags & 0xFFF) + 2) / 3; + d->m_greedy_parsing = (flags & TDEFL_GREEDY_PARSING_FLAG) != 0; + d->m_max_probes[1] = 1 + (((flags & 0xFFF) >> 2) + 2) / 3; + if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG)) + MZ_CLEAR_ARR(d->m_hash); + d->m_lookahead_pos = d->m_lookahead_size = d->m_dict_size = d->m_total_lz_bytes = d->m_lz_code_buf_dict_pos = d->m_bits_in = 0; + d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished = d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0; + d->m_pLZ_code_buf = d->m_lz_code_buf + 1; + d->m_pLZ_flags = d->m_lz_code_buf; + *d->m_pLZ_flags = 0; + d->m_num_flags_left = 8; + d->m_pOutput_buf = d->m_output_buf; + d->m_pOutput_buf_end = d->m_output_buf; + d->m_prev_return_status = TDEFL_STATUS_OKAY; + d->m_saved_match_dist = d->m_saved_match_len = d->m_saved_lit = 0; + d->m_adler32 = 1; + d->m_pIn_buf = NULL; + d->m_pOut_buf = NULL; + d->m_pIn_buf_size = NULL; + d->m_pOut_buf_size = NULL; + d->m_flush = TDEFL_NO_FLUSH; + d->m_pSrc = NULL; + d->m_src_buf_left = 0; + d->m_out_buf_ofs = 0; + if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG)) + MZ_CLEAR_ARR(d->m_dict); + memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0); + memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1); + return TDEFL_STATUS_OKAY; +} + +tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d) +{ + return d->m_prev_return_status; +} + +mz_uint32 tdefl_get_adler32(tdefl_compressor *d) +{ + return d->m_adler32; +} + +mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + tdefl_compressor *pComp; + mz_bool succeeded; + if (((buf_len) && (!pBuf)) || (!pPut_buf_func)) + return MZ_FALSE; + pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); + if (!pComp) + return MZ_FALSE; + succeeded = (tdefl_init(pComp, pPut_buf_func, pPut_buf_user, flags) == TDEFL_STATUS_OKAY); + succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE); + MZ_FREE(pComp); + return succeeded; +} + +typedef struct +{ + size_t m_size, m_capacity; + mz_uint8 *m_pBuf; + mz_bool m_expandable; +} tdefl_output_buffer; + +static mz_bool tdefl_output_buffer_putter(const void *pBuf, int len, void *pUser) +{ + tdefl_output_buffer *p = (tdefl_output_buffer *)pUser; + size_t new_size = p->m_size + len; + if (new_size > p->m_capacity) + { + size_t new_capacity = p->m_capacity; + mz_uint8 *pNew_buf; + if (!p->m_expandable) + return MZ_FALSE; + do + { + new_capacity = MZ_MAX(128U, new_capacity << 1U); + } while (new_size > new_capacity); + pNew_buf = (mz_uint8 *)MZ_REALLOC(p->m_pBuf, new_capacity); + if (!pNew_buf) + return MZ_FALSE; + p->m_pBuf = pNew_buf; + p->m_capacity = new_capacity; + } + memcpy((mz_uint8 *)p->m_pBuf + p->m_size, pBuf, len); + p->m_size = new_size; + return MZ_TRUE; +} + +void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) +{ + tdefl_output_buffer out_buf; + MZ_CLEAR_OBJ(out_buf); + if (!pOut_len) + return MZ_FALSE; + else + *pOut_len = 0; + out_buf.m_expandable = MZ_TRUE; + if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags)) + return NULL; + *pOut_len = out_buf.m_size; + return out_buf.m_pBuf; +} + +size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) +{ + tdefl_output_buffer out_buf; + MZ_CLEAR_OBJ(out_buf); + if (!pOut_buf) + return 0; + out_buf.m_pBuf = (mz_uint8 *)pOut_buf; + out_buf.m_capacity = out_buf_len; + if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags)) + return 0; + return out_buf.m_size; +} + +static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 }; + +/* level may actually range from [0,10] (10 is a "hidden" max level, where we want a bit more compression and it's fine if throughput to fall off a cliff on some files). */ +mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy) +{ + mz_uint comp_flags = s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0); + if (window_bits > 0) + comp_flags |= TDEFL_WRITE_ZLIB_HEADER; + + if (!level) + comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS; + else if (strategy == MZ_FILTERED) + comp_flags |= TDEFL_FILTER_MATCHES; + else if (strategy == MZ_HUFFMAN_ONLY) + comp_flags &= ~TDEFL_MAX_PROBES_MASK; + else if (strategy == MZ_FIXED) + comp_flags |= TDEFL_FORCE_ALL_STATIC_BLOCKS; + else if (strategy == MZ_RLE) + comp_flags |= TDEFL_RLE_MATCHES; + + return comp_flags; +} + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4204) /* nonstandard extension used : non-constant aggregate initializer (also supported by GNU C and C99, so no big deal) */ +#endif + +/* Simple PNG writer function by Alex Evans, 2011. Released into the public domain: https://gist.github.com/908299, more context at + http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/. + This is actually a modification of Alex's original code so PNG files generated by this function pass pngcheck. */ +void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip) +{ + /* Using a local copy of this array here in case MINIZ_NO_ZLIB_APIS was defined. */ + static const mz_uint s_tdefl_png_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 }; + tdefl_compressor *pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); + tdefl_output_buffer out_buf; + int i, bpl = w * num_chans, y, z; + mz_uint32 c; + *pLen_out = 0; + if (!pComp) + return NULL; + MZ_CLEAR_OBJ(out_buf); + out_buf.m_expandable = MZ_TRUE; + out_buf.m_capacity = 57 + MZ_MAX(64, (1 + bpl) * h); + if (NULL == (out_buf.m_pBuf = (mz_uint8 *)MZ_MALLOC(out_buf.m_capacity))) + { + MZ_FREE(pComp); + return NULL; + } + /* write dummy header */ + for (z = 41; z; --z) + tdefl_output_buffer_putter(&z, 1, &out_buf); + /* compress image data */ + tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER); + for (y = 0; y < h; ++y) + { + tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH); + tdefl_compress_buffer(pComp, (mz_uint8 *)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH); + } + if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE) + { + MZ_FREE(pComp); + MZ_FREE(out_buf.m_pBuf); + return NULL; + } + /* write real header */ + *pLen_out = out_buf.m_size - 41; + { + static const mz_uint8 chans[] = { 0x00, 0x00, 0x04, 0x02, 0x06 }; + mz_uint8 pnghdr[41] = { 0x89, 0x50, 0x4e, 0x47, 0x0d, + 0x0a, 0x1a, 0x0a, 0x00, 0x00, + 0x00, 0x0d, 0x49, 0x48, 0x44, + 0x52, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x49, 0x44, 0x41, + 0x54 }; + pnghdr[18] = (mz_uint8)(w >> 8); + pnghdr[19] = (mz_uint8)w; + pnghdr[22] = (mz_uint8)(h >> 8); + pnghdr[23] = (mz_uint8)h; + pnghdr[25] = chans[num_chans]; + pnghdr[33] = (mz_uint8)(*pLen_out >> 24); + pnghdr[34] = (mz_uint8)(*pLen_out >> 16); + pnghdr[35] = (mz_uint8)(*pLen_out >> 8); + pnghdr[36] = (mz_uint8)*pLen_out; + c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, pnghdr + 12, 17); + for (i = 0; i < 4; ++i, c <<= 8) + ((mz_uint8 *)(pnghdr + 29))[i] = (mz_uint8)(c >> 24); + memcpy(out_buf.m_pBuf, pnghdr, 41); + } + /* write footer (IDAT CRC-32, followed by IEND chunk) */ + if (!tdefl_output_buffer_putter("\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16, &out_buf)) + { + *pLen_out = 0; + MZ_FREE(pComp); + MZ_FREE(out_buf.m_pBuf); + return NULL; + } + c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, out_buf.m_pBuf + 41 - 4, *pLen_out + 4); + for (i = 0; i < 4; ++i, c <<= 8) + (out_buf.m_pBuf + out_buf.m_size - 16)[i] = (mz_uint8)(c >> 24); + /* compute final size of file, grab compressed data buffer and return */ + *pLen_out += 57; + MZ_FREE(pComp); + return out_buf.m_pBuf; +} +void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out) +{ + /* Level 6 corresponds to TDEFL_DEFAULT_MAX_PROBES or MZ_DEFAULT_LEVEL (but we can't depend on MZ_DEFAULT_LEVEL being available in case the zlib API's where #defined out) */ + return tdefl_write_image_to_png_file_in_memory_ex(pImage, w, h, num_chans, pLen_out, 6, MZ_FALSE); +} + +#ifndef MINIZ_NO_MALLOC +/* Allocate the tdefl_compressor and tinfl_decompressor structures in C so that */ +/* non-C language bindings to tdefL_ and tinfl_ API don't need to worry about */ +/* structure size and allocation mechanism. */ +tdefl_compressor *tdefl_compressor_alloc(void) +{ + return (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor)); +} + +void tdefl_compressor_free(tdefl_compressor *pComp) +{ + MZ_FREE(pComp); +} +#endif + +#ifdef _MSC_VER +#pragma warning(pop) +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*#ifndef MINIZ_NO_DEFLATE_APIS*/ + /************************************************************************** + * + * Copyright 2013-2014 RAD Game Tools and Valve Software + * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + **************************************************************************/ + + + +#ifndef MINIZ_NO_INFLATE_APIS + +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------- Low-level Decompression (completely independent from all compression API's) */ + +#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l) +#define TINFL_MEMSET(p, c, l) memset(p, c, l) + +#define TINFL_CR_BEGIN \ + switch (r->m_state) \ + { \ + case 0: +#define TINFL_CR_RETURN(state_index, result) \ + do \ + { \ + status = result; \ + r->m_state = state_index; \ + goto common_exit; \ + case state_index:; \ + } \ + MZ_MACRO_END +#define TINFL_CR_RETURN_FOREVER(state_index, result) \ + do \ + { \ + for (;;) \ + { \ + TINFL_CR_RETURN(state_index, result); \ + } \ + } \ + MZ_MACRO_END +#define TINFL_CR_FINISH } + +#define TINFL_GET_BYTE(state_index, c) \ + do \ + { \ + while (pIn_buf_cur >= pIn_buf_end) \ + { \ + TINFL_CR_RETURN(state_index, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS); \ + } \ + c = *pIn_buf_cur++; \ + } \ + MZ_MACRO_END + +#define TINFL_NEED_BITS(state_index, n) \ + do \ + { \ + mz_uint c; \ + TINFL_GET_BYTE(state_index, c); \ + bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); \ + num_bits += 8; \ + } while (num_bits < (mz_uint)(n)) +#define TINFL_SKIP_BITS(state_index, n) \ + do \ + { \ + if (num_bits < (mz_uint)(n)) \ + { \ + TINFL_NEED_BITS(state_index, n); \ + } \ + bit_buf >>= (n); \ + num_bits -= (n); \ + } \ + MZ_MACRO_END +#define TINFL_GET_BITS(state_index, b, n) \ + do \ + { \ + if (num_bits < (mz_uint)(n)) \ + { \ + TINFL_NEED_BITS(state_index, n); \ + } \ + b = bit_buf & ((1 << (n)) - 1); \ + bit_buf >>= (n); \ + num_bits -= (n); \ + } \ + MZ_MACRO_END + +/* TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. */ +/* It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a */ +/* Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the */ +/* bit buffer contains >=15 bits (deflate's max. Huffman code size). */ +#define TINFL_HUFF_BITBUF_FILL(state_index, pLookUp, pTree) \ + do \ + { \ + temp = pLookUp[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \ + if (temp >= 0) \ + { \ + code_len = temp >> 9; \ + if ((code_len) && (num_bits >= code_len)) \ + break; \ + } \ + else if (num_bits > TINFL_FAST_LOOKUP_BITS) \ + { \ + code_len = TINFL_FAST_LOOKUP_BITS; \ + do \ + { \ + temp = pTree[~temp + ((bit_buf >> code_len++) & 1)]; \ + } while ((temp < 0) && (num_bits >= (code_len + 1))); \ + if (temp >= 0) \ + break; \ + } \ + TINFL_GET_BYTE(state_index, c); \ + bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); \ + num_bits += 8; \ + } while (num_bits < 15); + +/* TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read */ +/* beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully */ +/* decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. */ +/* The slow path is only executed at the very end of the input buffer. */ +/* v1.16: The original macro handled the case at the very end of the passed-in input buffer, but we also need to handle the case where the user passes in 1+zillion bytes */ +/* following the deflate data and our non-conservative read-ahead path won't kick in here on this code. This is much trickier. */ +#define TINFL_HUFF_DECODE(state_index, sym, pLookUp, pTree) \ + do \ + { \ + int temp; \ + mz_uint code_len, c; \ + if (num_bits < 15) \ + { \ + if ((pIn_buf_end - pIn_buf_cur) < 2) \ + { \ + TINFL_HUFF_BITBUF_FILL(state_index, pLookUp, pTree); \ + } \ + else \ + { \ + bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); \ + pIn_buf_cur += 2; \ + num_bits += 16; \ + } \ + } \ + if ((temp = pLookUp[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \ + code_len = temp >> 9, temp &= 511; \ + else \ + { \ + code_len = TINFL_FAST_LOOKUP_BITS; \ + do \ + { \ + temp = pTree[~temp + ((bit_buf >> code_len++) & 1)]; \ + } while (temp < 0); \ + } \ + sym = temp; \ + bit_buf >>= code_len; \ + num_bits -= code_len; \ + } \ + MZ_MACRO_END + +static void tinfl_clear_tree(tinfl_decompressor *r) +{ + if (r->m_type == 0) + MZ_CLEAR_ARR(r->m_tree_0); + else if (r->m_type == 1) + MZ_CLEAR_ARR(r->m_tree_1); + else + MZ_CLEAR_ARR(r->m_tree_2); +} + +tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags) +{ + static const mz_uint16 s_length_base[31] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 }; + static const mz_uint8 s_length_extra[31] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0 }; + static const mz_uint16 s_dist_base[32] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0 }; + static const mz_uint8 s_dist_extra[32] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 }; + static const mz_uint8 s_length_dezigzag[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 }; + static const mz_uint16 s_min_table_sizes[3] = { 257, 1, 4 }; + + mz_int16 *pTrees[3]; + mz_uint8 *pCode_sizes[3]; + + tinfl_status status = TINFL_STATUS_FAILED; + mz_uint32 num_bits, dist, counter, num_extra; + tinfl_bit_buf_t bit_buf; + const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size; + mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next ? pOut_buf_next + *pOut_buf_size : NULL; + size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start; + + /* Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). */ + if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start)) + { + *pIn_buf_size = *pOut_buf_size = 0; + return TINFL_STATUS_BAD_PARAM; + } + + pTrees[0] = r->m_tree_0; + pTrees[1] = r->m_tree_1; + pTrees[2] = r->m_tree_2; + pCode_sizes[0] = r->m_code_size_0; + pCode_sizes[1] = r->m_code_size_1; + pCode_sizes[2] = r->m_code_size_2; + + num_bits = r->m_num_bits; + bit_buf = r->m_bit_buf; + dist = r->m_dist; + counter = r->m_counter; + num_extra = r->m_num_extra; + dist_from_out_buf_start = r->m_dist_from_out_buf_start; + TINFL_CR_BEGIN + + bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0; + r->m_z_adler32 = r->m_check_adler32 = 1; + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + TINFL_GET_BYTE(1, r->m_zhdr0); + TINFL_GET_BYTE(2, r->m_zhdr1); + counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8)); + if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) + counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)((size_t)1 << (8U + (r->m_zhdr0 >> 4))))); + if (counter) + { + TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED); + } + } + + do + { + TINFL_GET_BITS(3, r->m_final, 3); + r->m_type = r->m_final >> 1; + if (r->m_type == 0) + { + TINFL_SKIP_BITS(5, num_bits & 7); + for (counter = 0; counter < 4; ++counter) + { + if (num_bits) + TINFL_GET_BITS(6, r->m_raw_header[counter], 8); + else + TINFL_GET_BYTE(7, r->m_raw_header[counter]); + } + if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8)))) + { + TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED); + } + while ((counter) && (num_bits)) + { + TINFL_GET_BITS(51, dist, 8); + while (pOut_buf_cur >= pOut_buf_end) + { + TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT); + } + *pOut_buf_cur++ = (mz_uint8)dist; + counter--; + } + while (counter) + { + size_t n; + while (pOut_buf_cur >= pOut_buf_end) + { + TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT); + } + while (pIn_buf_cur >= pIn_buf_end) + { + TINFL_CR_RETURN(38, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS); + } + n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter); + TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n); + pIn_buf_cur += n; + pOut_buf_cur += n; + counter -= (mz_uint)n; + } + } + else if (r->m_type == 3) + { + TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED); + } + else + { + if (r->m_type == 1) + { + mz_uint8 *p = r->m_code_size_0; + mz_uint i; + r->m_table_sizes[0] = 288; + r->m_table_sizes[1] = 32; + TINFL_MEMSET(r->m_code_size_1, 5, 32); + for (i = 0; i <= 143; ++i) + *p++ = 8; + for (; i <= 255; ++i) + *p++ = 9; + for (; i <= 279; ++i) + *p++ = 7; + for (; i <= 287; ++i) + *p++ = 8; + } + else + { + for (counter = 0; counter < 3; counter++) + { + TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]); + r->m_table_sizes[counter] += s_min_table_sizes[counter]; + } + MZ_CLEAR_ARR(r->m_code_size_2); + for (counter = 0; counter < r->m_table_sizes[2]; counter++) + { + mz_uint s; + TINFL_GET_BITS(14, s, 3); + r->m_code_size_2[s_length_dezigzag[counter]] = (mz_uint8)s; + } + r->m_table_sizes[2] = 19; + } + for (; (int)r->m_type >= 0; r->m_type--) + { + int tree_next, tree_cur; + mz_int16 *pLookUp; + mz_int16 *pTree; + mz_uint8 *pCode_size; + mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16]; + pLookUp = r->m_look_up[r->m_type]; + pTree = pTrees[r->m_type]; + pCode_size = pCode_sizes[r->m_type]; + MZ_CLEAR_ARR(total_syms); + TINFL_MEMSET(pLookUp, 0, sizeof(r->m_look_up[0])); + tinfl_clear_tree(r); + for (i = 0; i < r->m_table_sizes[r->m_type]; ++i) + total_syms[pCode_size[i]]++; + used_syms = 0, total = 0; + next_code[0] = next_code[1] = 0; + for (i = 1; i <= 15; ++i) + { + used_syms += total_syms[i]; + next_code[i + 1] = (total = ((total + total_syms[i]) << 1)); + } + if ((65536 != total) && (used_syms > 1)) + { + TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED); + } + for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index) + { + mz_uint rev_code = 0, l, cur_code, code_size = pCode_size[sym_index]; + if (!code_size) + continue; + cur_code = next_code[code_size]++; + for (l = code_size; l > 0; l--, cur_code >>= 1) + rev_code = (rev_code << 1) | (cur_code & 1); + if (code_size <= TINFL_FAST_LOOKUP_BITS) + { + mz_int16 k = (mz_int16)((code_size << 9) | sym_index); + while (rev_code < TINFL_FAST_LOOKUP_SIZE) + { + pLookUp[rev_code] = k; + rev_code += (1 << code_size); + } + continue; + } + if (0 == (tree_cur = pLookUp[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)])) + { + pLookUp[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next; + tree_cur = tree_next; + tree_next -= 2; + } + rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1); + for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--) + { + tree_cur -= ((rev_code >>= 1) & 1); + if (!pTree[-tree_cur - 1]) + { + pTree[-tree_cur - 1] = (mz_int16)tree_next; + tree_cur = tree_next; + tree_next -= 2; + } + else + tree_cur = pTree[-tree_cur - 1]; + } + tree_cur -= ((rev_code >>= 1) & 1); + pTree[-tree_cur - 1] = (mz_int16)sym_index; + } + if (r->m_type == 2) + { + for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]);) + { + mz_uint s; + TINFL_HUFF_DECODE(16, dist, r->m_look_up[2], r->m_tree_2); + if (dist < 16) + { + r->m_len_codes[counter++] = (mz_uint8)dist; + continue; + } + if ((dist == 16) && (!counter)) + { + TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED); + } + num_extra = "\02\03\07"[dist - 16]; + TINFL_GET_BITS(18, s, num_extra); + s += "\03\03\013"[dist - 16]; + TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s); + counter += s; + } + if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter) + { + TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED); + } + TINFL_MEMCPY(r->m_code_size_0, r->m_len_codes, r->m_table_sizes[0]); + TINFL_MEMCPY(r->m_code_size_1, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]); + } + } + for (;;) + { + mz_uint8 *pSrc; + for (;;) + { + if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2)) + { + TINFL_HUFF_DECODE(23, counter, r->m_look_up[0], r->m_tree_0); + if (counter >= 256) + break; + while (pOut_buf_cur >= pOut_buf_end) + { + TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT); + } + *pOut_buf_cur++ = (mz_uint8)counter; + } + else + { + int sym2; + mz_uint code_len; +#if TINFL_USE_64BIT_BITBUF + if (num_bits < 30) + { + bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits); + pIn_buf_cur += 4; + num_bits += 32; + } +#else + if (num_bits < 15) + { + bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); + pIn_buf_cur += 2; + num_bits += 16; + } +#endif + if ((sym2 = r->m_look_up[0][bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; + do + { + sym2 = r->m_tree_0[~sym2 + ((bit_buf >> code_len++) & 1)]; + } while (sym2 < 0); + } + counter = sym2; + bit_buf >>= code_len; + num_bits -= code_len; + if (counter & 256) + break; + +#if !TINFL_USE_64BIT_BITBUF + if (num_bits < 15) + { + bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits); + pIn_buf_cur += 2; + num_bits += 16; + } +#endif + if ((sym2 = r->m_look_up[0][bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) + code_len = sym2 >> 9; + else + { + code_len = TINFL_FAST_LOOKUP_BITS; + do + { + sym2 = r->m_tree_0[~sym2 + ((bit_buf >> code_len++) & 1)]; + } while (sym2 < 0); + } + bit_buf >>= code_len; + num_bits -= code_len; + + pOut_buf_cur[0] = (mz_uint8)counter; + if (sym2 & 256) + { + pOut_buf_cur++; + counter = sym2; + break; + } + pOut_buf_cur[1] = (mz_uint8)sym2; + pOut_buf_cur += 2; + } + } + if ((counter &= 511) == 256) + break; + + num_extra = s_length_extra[counter - 257]; + counter = s_length_base[counter - 257]; + if (num_extra) + { + mz_uint extra_bits; + TINFL_GET_BITS(25, extra_bits, num_extra); + counter += extra_bits; + } + + TINFL_HUFF_DECODE(26, dist, r->m_look_up[1], r->m_tree_1); + num_extra = s_dist_extra[dist]; + dist = s_dist_base[dist]; + if (num_extra) + { + mz_uint extra_bits; + TINFL_GET_BITS(27, extra_bits, num_extra); + dist += extra_bits; + } + + dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start; + if ((dist == 0 || dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)) + { + TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED); + } + + pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask); + + if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end) + { + while (counter--) + { + while (pOut_buf_cur >= pOut_buf_end) + { + TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT); + } + *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask]; + } + continue; + } +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES + else if ((counter >= 9) && (counter <= dist)) + { + const mz_uint8 *pSrc_end = pSrc + (counter & ~7); + do + { +#ifdef MINIZ_UNALIGNED_USE_MEMCPY + memcpy(pOut_buf_cur, pSrc, sizeof(mz_uint32)*2); +#else + ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0]; + ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1]; +#endif + pOut_buf_cur += 8; + } while ((pSrc += 8) < pSrc_end); + if ((counter &= 7) < 3) + { + if (counter) + { + pOut_buf_cur[0] = pSrc[0]; + if (counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + continue; + } + } +#endif + while(counter>2) + { + pOut_buf_cur[0] = pSrc[0]; + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur[2] = pSrc[2]; + pOut_buf_cur += 3; + pSrc += 3; + counter -= 3; + } + if (counter > 0) + { + pOut_buf_cur[0] = pSrc[0]; + if (counter > 1) + pOut_buf_cur[1] = pSrc[1]; + pOut_buf_cur += counter; + } + } + } + } while (!(r->m_final & 1)); + + /* Ensure byte alignment and put back any bytes from the bitbuf if we've looked ahead too far on gzip, or other Deflate streams followed by arbitrary data. */ + /* I'm being super conservative here. A number of simplifications can be made to the byte alignment part, and the Adler32 check shouldn't ever need to worry about reading from the bitbuf now. */ + TINFL_SKIP_BITS(32, num_bits & 7); + while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8)) + { + --pIn_buf_cur; + num_bits -= 8; + } + bit_buf &= ~(~(tinfl_bit_buf_t)0 << num_bits); + MZ_ASSERT(!num_bits); /* if this assert fires then we've read beyond the end of non-deflate/zlib streams with following data (such as gzip streams). */ + + if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) + { + for (counter = 0; counter < 4; ++counter) + { + mz_uint s; + if (num_bits) + TINFL_GET_BITS(41, s, 8); + else + TINFL_GET_BYTE(42, s); + r->m_z_adler32 = (r->m_z_adler32 << 8) | s; + } + } + TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE); + + TINFL_CR_FINISH + +common_exit: + /* As long as we aren't telling the caller that we NEED more input to make forward progress: */ + /* Put back any bytes from the bitbuf in case we've looked ahead too far on gzip, or other Deflate streams followed by arbitrary data. */ + /* We need to be very careful here to NOT push back any bytes we definitely know we need to make forward progress, though, or we'll lock the caller up into an inf loop. */ + if ((status != TINFL_STATUS_NEEDS_MORE_INPUT) && (status != TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS)) + { + while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8)) + { + --pIn_buf_cur; + num_bits -= 8; + } + } + r->m_num_bits = num_bits; + r->m_bit_buf = bit_buf & ~(~(tinfl_bit_buf_t)0 << num_bits); + r->m_dist = dist; + r->m_counter = counter; + r->m_num_extra = num_extra; + r->m_dist_from_out_buf_start = dist_from_out_buf_start; + *pIn_buf_size = pIn_buf_cur - pIn_buf_next; + *pOut_buf_size = pOut_buf_cur - pOut_buf_next; + if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0)) + { + const mz_uint8 *ptr = pOut_buf_next; + size_t buf_len = *pOut_buf_size; + mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16; + size_t block_len = buf_len % 5552; + while (buf_len) + { + for (i = 0; i + 7 < block_len; i += 8, ptr += 8) + { + s1 += ptr[0], s2 += s1; + s1 += ptr[1], s2 += s1; + s1 += ptr[2], s2 += s1; + s1 += ptr[3], s2 += s1; + s1 += ptr[4], s2 += s1; + s1 += ptr[5], s2 += s1; + s1 += ptr[6], s2 += s1; + s1 += ptr[7], s2 += s1; + } + for (; i < block_len; ++i) + s1 += *ptr++, s2 += s1; + s1 %= 65521U, s2 %= 65521U; + buf_len -= block_len; + block_len = 5552; + } + r->m_check_adler32 = (s2 << 16) + s1; + if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32)) + status = TINFL_STATUS_ADLER32_MISMATCH; + } + return status; +} + +/* Higher level helper functions. */ +void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags) +{ + tinfl_decompressor decomp; + void *pBuf = NULL, *pNew_buf; + size_t src_buf_ofs = 0, out_buf_capacity = 0; + *pOut_len = 0; + tinfl_init(&decomp); + for (;;) + { + size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity; + tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8 *)pBuf, pBuf ? (mz_uint8 *)pBuf + *pOut_len : NULL, &dst_buf_size, + (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT)) + { + MZ_FREE(pBuf); + *pOut_len = 0; + return NULL; + } + src_buf_ofs += src_buf_size; + *pOut_len += dst_buf_size; + if (status == TINFL_STATUS_DONE) + break; + new_out_buf_capacity = out_buf_capacity * 2; + if (new_out_buf_capacity < 128) + new_out_buf_capacity = 128; + pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity); + if (!pNew_buf) + { + MZ_FREE(pBuf); + *pOut_len = 0; + return NULL; + } + pBuf = pNew_buf; + out_buf_capacity = new_out_buf_capacity; + } + return pBuf; +} + +size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags) +{ + tinfl_decompressor decomp; + tinfl_status status; + tinfl_init(&decomp); + status = tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf, &src_buf_len, (mz_uint8 *)pOut_buf, (mz_uint8 *)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF); + return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len; +} + +int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags) +{ + int result = 0; + tinfl_decompressor decomp; + mz_uint8 *pDict = (mz_uint8 *)MZ_MALLOC(TINFL_LZ_DICT_SIZE); + size_t in_buf_ofs = 0, dict_ofs = 0; + if (!pDict) + return TINFL_STATUS_FAILED; + memset(pDict,0,TINFL_LZ_DICT_SIZE); + tinfl_init(&decomp); + for (;;) + { + size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs; + tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size, + (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))); + in_buf_ofs += in_buf_size; + if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user))) + break; + if (status != TINFL_STATUS_HAS_MORE_OUTPUT) + { + result = (status == TINFL_STATUS_DONE); + break; + } + dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1); + } + MZ_FREE(pDict); + *pIn_buf_size = in_buf_ofs; + return result; +} + +#ifndef MINIZ_NO_MALLOC +tinfl_decompressor *tinfl_decompressor_alloc(void) +{ + tinfl_decompressor *pDecomp = (tinfl_decompressor *)MZ_MALLOC(sizeof(tinfl_decompressor)); + if (pDecomp) + tinfl_init(pDecomp); + return pDecomp; +} + +void tinfl_decompressor_free(tinfl_decompressor *pDecomp) +{ + MZ_FREE(pDecomp); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*#ifndef MINIZ_NO_INFLATE_APIS*/ + /************************************************************************** + * + * Copyright 2013-2014 RAD Game Tools and Valve Software + * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC + * Copyright 2016 Martin Raiber + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + **************************************************************************/ + + +#ifndef MINIZ_NO_ARCHIVE_APIS + +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------- .ZIP archive reading */ + +#ifdef MINIZ_NO_STDIO +#define MZ_FILE void * +#else +#include + +#if defined(_MSC_VER) || defined(__MINGW64__) + +#define WIN32_LEAN_AND_MEAN +#include + +static WCHAR* mz_utf8z_to_widechar(const char* str) +{ + int reqChars = MultiByteToWideChar(CP_UTF8, 0, str, -1, NULL, 0); + WCHAR* wStr = (WCHAR*)malloc(reqChars * sizeof(WCHAR)); + MultiByteToWideChar(CP_UTF8, 0, str, -1, wStr, reqChars); + return wStr; +} + +static FILE *mz_fopen(const char *pFilename, const char *pMode) +{ + WCHAR* wFilename = mz_utf8z_to_widechar(pFilename); + WCHAR* wMode = mz_utf8z_to_widechar(pMode); + FILE* pFile = NULL; + errno_t err = _wfopen_s(&pFile, wFilename, wMode); + free(wFilename); + free(wMode); + return err ? NULL : pFile; +} + +static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream) +{ + WCHAR* wPath = mz_utf8z_to_widechar(pPath); + WCHAR* wMode = mz_utf8z_to_widechar(pMode); + FILE* pFile = NULL; + errno_t err = _wfreopen_s(&pFile, wPath, wMode, pStream); + free(wPath); + free(wMode); + return err ? NULL : pFile; +} + +static int mz_stat64(const char *path, struct __stat64 *buffer) +{ + WCHAR* wPath = mz_utf8z_to_widechar(path); + int res = _wstat64(wPath, buffer); + free(wPath); + return res; +} + +#ifndef MINIZ_NO_TIME +#include +#endif +#define MZ_FOPEN mz_fopen +#define MZ_FCLOSE fclose +#define MZ_FREAD fread +#define MZ_FWRITE fwrite +#define MZ_FTELL64 _ftelli64 +#define MZ_FSEEK64 _fseeki64 +#define MZ_FILE_STAT_STRUCT _stat64 +#define MZ_FILE_STAT mz_stat64 +#define MZ_FFLUSH fflush +#define MZ_FREOPEN mz_freopen +#define MZ_DELETE_FILE remove + +#elif defined(__MINGW32__) || defined(__WATCOMC__) +#ifndef MINIZ_NO_TIME +#include +#endif +#define MZ_FOPEN(f, m) fopen(f, m) +#define MZ_FCLOSE fclose +#define MZ_FREAD fread +#define MZ_FWRITE fwrite +#define MZ_FTELL64 _ftelli64 +#define MZ_FSEEK64 _fseeki64 +#define MZ_FILE_STAT_STRUCT stat +#define MZ_FILE_STAT stat +#define MZ_FFLUSH fflush +#define MZ_FREOPEN(f, m, s) freopen(f, m, s) +#define MZ_DELETE_FILE remove + +#elif defined(__TINYC__) +#ifndef MINIZ_NO_TIME +#include +#endif +#define MZ_FOPEN(f, m) fopen(f, m) +#define MZ_FCLOSE fclose +#define MZ_FREAD fread +#define MZ_FWRITE fwrite +#define MZ_FTELL64 ftell +#define MZ_FSEEK64 fseek +#define MZ_FILE_STAT_STRUCT stat +#define MZ_FILE_STAT stat +#define MZ_FFLUSH fflush +#define MZ_FREOPEN(f, m, s) freopen(f, m, s) +#define MZ_DELETE_FILE remove + +#elif defined(__USE_LARGEFILE64) /* gcc, clang */ +#ifndef MINIZ_NO_TIME +#include +#endif +#define MZ_FOPEN(f, m) fopen64(f, m) +#define MZ_FCLOSE fclose +#define MZ_FREAD fread +#define MZ_FWRITE fwrite +#define MZ_FTELL64 ftello64 +#define MZ_FSEEK64 fseeko64 +#define MZ_FILE_STAT_STRUCT stat64 +#define MZ_FILE_STAT stat64 +#define MZ_FFLUSH fflush +#define MZ_FREOPEN(p, m, s) freopen64(p, m, s) +#define MZ_DELETE_FILE remove + +#elif defined(__APPLE__) || defined(__FreeBSD__) +#ifndef MINIZ_NO_TIME +#include +#endif +#define MZ_FOPEN(f, m) fopen(f, m) +#define MZ_FCLOSE fclose +#define MZ_FREAD fread +#define MZ_FWRITE fwrite +#define MZ_FTELL64 ftello +#define MZ_FSEEK64 fseeko +#define MZ_FILE_STAT_STRUCT stat +#define MZ_FILE_STAT stat +#define MZ_FFLUSH fflush +#define MZ_FREOPEN(p, m, s) freopen(p, m, s) +#define MZ_DELETE_FILE remove + +#else +#pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.") +#ifndef MINIZ_NO_TIME +#include +#endif +#define MZ_FOPEN(f, m) fopen(f, m) +#define MZ_FCLOSE fclose +#define MZ_FREAD fread +#define MZ_FWRITE fwrite +#ifdef __STRICT_ANSI__ +#define MZ_FTELL64 ftell +#define MZ_FSEEK64 fseek +#else +#define MZ_FTELL64 ftello +#define MZ_FSEEK64 fseeko +#endif +#define MZ_FILE_STAT_STRUCT stat +#define MZ_FILE_STAT stat +#define MZ_FFLUSH fflush +#define MZ_FREOPEN(f, m, s) freopen(f, m, s) +#define MZ_DELETE_FILE remove +#endif /* #ifdef _MSC_VER */ +#endif /* #ifdef MINIZ_NO_STDIO */ + +#define MZ_TOLOWER(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c) - 'A' + 'a') : (c)) + +/* Various ZIP archive enums. To completely avoid cross platform compiler alignment and platform endian issues, miniz.c doesn't use structs for any of this stuff. */ +enum +{ + /* ZIP archive identifiers and record sizes */ + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06054b50, + MZ_ZIP_CENTRAL_DIR_HEADER_SIG = 0x02014b50, + MZ_ZIP_LOCAL_DIR_HEADER_SIG = 0x04034b50, + MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30, + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46, + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22, + + /* ZIP64 archive identifier and record sizes */ + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06064b50, + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG = 0x07064b50, + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE = 56, + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE = 20, + MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID = 0x0001, + MZ_ZIP_DATA_DESCRIPTOR_ID = 0x08074b50, + MZ_ZIP_DATA_DESCRIPTER_SIZE64 = 24, + MZ_ZIP_DATA_DESCRIPTER_SIZE32 = 16, + + /* Central directory header record offsets */ + MZ_ZIP_CDH_SIG_OFS = 0, + MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4, + MZ_ZIP_CDH_VERSION_NEEDED_OFS = 6, + MZ_ZIP_CDH_BIT_FLAG_OFS = 8, + MZ_ZIP_CDH_METHOD_OFS = 10, + MZ_ZIP_CDH_FILE_TIME_OFS = 12, + MZ_ZIP_CDH_FILE_DATE_OFS = 14, + MZ_ZIP_CDH_CRC32_OFS = 16, + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS = 20, + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS = 24, + MZ_ZIP_CDH_FILENAME_LEN_OFS = 28, + MZ_ZIP_CDH_EXTRA_LEN_OFS = 30, + MZ_ZIP_CDH_COMMENT_LEN_OFS = 32, + MZ_ZIP_CDH_DISK_START_OFS = 34, + MZ_ZIP_CDH_INTERNAL_ATTR_OFS = 36, + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS = 38, + MZ_ZIP_CDH_LOCAL_HEADER_OFS = 42, + + /* Local directory header offsets */ + MZ_ZIP_LDH_SIG_OFS = 0, + MZ_ZIP_LDH_VERSION_NEEDED_OFS = 4, + MZ_ZIP_LDH_BIT_FLAG_OFS = 6, + MZ_ZIP_LDH_METHOD_OFS = 8, + MZ_ZIP_LDH_FILE_TIME_OFS = 10, + MZ_ZIP_LDH_FILE_DATE_OFS = 12, + MZ_ZIP_LDH_CRC32_OFS = 14, + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS = 18, + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22, + MZ_ZIP_LDH_FILENAME_LEN_OFS = 26, + MZ_ZIP_LDH_EXTRA_LEN_OFS = 28, + MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR = 1 << 3, + + /* End of central directory offsets */ + MZ_ZIP_ECDH_SIG_OFS = 0, + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS = 4, + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS = 6, + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 8, + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS = 10, + MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12, + MZ_ZIP_ECDH_CDIR_OFS_OFS = 16, + MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20, + + /* ZIP64 End of central directory locator offsets */ + MZ_ZIP64_ECDL_SIG_OFS = 0, /* 4 bytes */ + MZ_ZIP64_ECDL_NUM_DISK_CDIR_OFS = 4, /* 4 bytes */ + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS = 8, /* 8 bytes */ + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS = 16, /* 4 bytes */ + + /* ZIP64 End of central directory header offsets */ + MZ_ZIP64_ECDH_SIG_OFS = 0, /* 4 bytes */ + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS = 4, /* 8 bytes */ + MZ_ZIP64_ECDH_VERSION_MADE_BY_OFS = 12, /* 2 bytes */ + MZ_ZIP64_ECDH_VERSION_NEEDED_OFS = 14, /* 2 bytes */ + MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS = 16, /* 4 bytes */ + MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS = 20, /* 4 bytes */ + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 24, /* 8 bytes */ + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS = 32, /* 8 bytes */ + MZ_ZIP64_ECDH_CDIR_SIZE_OFS = 40, /* 8 bytes */ + MZ_ZIP64_ECDH_CDIR_OFS_OFS = 48, /* 8 bytes */ + MZ_ZIP_VERSION_MADE_BY_DOS_FILESYSTEM_ID = 0, + MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG = 0x10, + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED = 1, + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG = 32, + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION = 64, + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED = 8192, + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 = 1 << 11 +}; + +typedef struct +{ + void *m_p; + size_t m_size, m_capacity; + mz_uint m_element_size; +} mz_zip_array; + +struct mz_zip_internal_state_tag +{ + mz_zip_array m_central_dir; + mz_zip_array m_central_dir_offsets; + mz_zip_array m_sorted_central_dir_offsets; + + /* The flags passed in when the archive is initially opened. */ + mz_uint32 m_init_flags; + + /* MZ_TRUE if the archive has a zip64 end of central directory headers, etc. */ + mz_bool m_zip64; + + /* MZ_TRUE if we found zip64 extended info in the central directory (m_zip64 will also be slammed to true too, even if we didn't find a zip64 end of central dir header, etc.) */ + mz_bool m_zip64_has_extended_info_fields; + + /* These fields are used by the file, FILE, memory, and memory/heap read/write helpers. */ + MZ_FILE *m_pFile; + mz_uint64 m_file_archive_start_ofs; + + void *m_pMem; + size_t m_mem_size; + size_t m_mem_capacity; +}; + +#define MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(array_ptr, element_size) (array_ptr)->m_element_size = element_size + +#if defined(DEBUG) || defined(_DEBUG) +static MZ_FORCEINLINE mz_uint mz_zip_array_range_check(const mz_zip_array *pArray, mz_uint index) +{ + MZ_ASSERT(index < pArray->m_size); + return index; +} +#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) ((element_type *)((array_ptr)->m_p))[mz_zip_array_range_check(array_ptr, index)] +#else +#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) ((element_type *)((array_ptr)->m_p))[index] +#endif + +static MZ_FORCEINLINE void mz_zip_array_init(mz_zip_array *pArray, mz_uint32 element_size) +{ + memset(pArray, 0, sizeof(mz_zip_array)); + pArray->m_element_size = element_size; +} + +static MZ_FORCEINLINE void mz_zip_array_clear(mz_zip_archive *pZip, mz_zip_array *pArray) +{ + pZip->m_pFree(pZip->m_pAlloc_opaque, pArray->m_p); + memset(pArray, 0, sizeof(mz_zip_array)); +} + +static mz_bool mz_zip_array_ensure_capacity(mz_zip_archive *pZip, mz_zip_array *pArray, size_t min_new_capacity, mz_uint growing) +{ + void *pNew_p; + size_t new_capacity = min_new_capacity; + MZ_ASSERT(pArray->m_element_size); + if (pArray->m_capacity >= min_new_capacity) + return MZ_TRUE; + if (growing) + { + new_capacity = MZ_MAX(1, pArray->m_capacity); + while (new_capacity < min_new_capacity) + new_capacity *= 2; + } + if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity))) + return MZ_FALSE; + pArray->m_p = pNew_p; + pArray->m_capacity = new_capacity; + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_reserve(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_capacity, mz_uint growing) +{ + if (new_capacity > pArray->m_capacity) + { + if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing)) + return MZ_FALSE; + } + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_resize(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_size, mz_uint growing) +{ + if (new_size > pArray->m_capacity) + { + if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing)) + return MZ_FALSE; + } + pArray->m_size = new_size; + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_ensure_room(mz_zip_archive *pZip, mz_zip_array *pArray, size_t n) +{ + return mz_zip_array_reserve(pZip, pArray, pArray->m_size + n, MZ_TRUE); +} + +static MZ_FORCEINLINE mz_bool mz_zip_array_push_back(mz_zip_archive *pZip, mz_zip_array *pArray, const void *pElements, size_t n) +{ + size_t orig_size = pArray->m_size; + if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE)) + return MZ_FALSE; + if (n > 0) + memcpy((mz_uint8 *)pArray->m_p + orig_size * pArray->m_element_size, pElements, n * pArray->m_element_size); + return MZ_TRUE; +} + +#ifndef MINIZ_NO_TIME +static MZ_TIME_T mz_zip_dos_to_time_t(int dos_time, int dos_date) +{ + struct tm tm; + memset(&tm, 0, sizeof(tm)); + tm.tm_isdst = -1; + tm.tm_year = ((dos_date >> 9) & 127) + 1980 - 1900; + tm.tm_mon = ((dos_date >> 5) & 15) - 1; + tm.tm_mday = dos_date & 31; + tm.tm_hour = (dos_time >> 11) & 31; + tm.tm_min = (dos_time >> 5) & 63; + tm.tm_sec = (dos_time << 1) & 62; + return mktime(&tm); +} + +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS +static void mz_zip_time_t_to_dos_time(MZ_TIME_T time, mz_uint16 *pDOS_time, mz_uint16 *pDOS_date) +{ +#ifdef _MSC_VER + struct tm tm_struct; + struct tm *tm = &tm_struct; + errno_t err = localtime_s(tm, &time); + if (err) + { + *pDOS_date = 0; + *pDOS_time = 0; + return; + } +#else + struct tm *tm = localtime(&time); +#endif /* #ifdef _MSC_VER */ + + *pDOS_time = (mz_uint16)(((tm->tm_hour) << 11) + ((tm->tm_min) << 5) + ((tm->tm_sec) >> 1)); + *pDOS_date = (mz_uint16)(((tm->tm_year + 1900 - 1980) << 9) + ((tm->tm_mon + 1) << 5) + tm->tm_mday); +} +#endif /* MINIZ_NO_ARCHIVE_WRITING_APIS */ + +#ifndef MINIZ_NO_STDIO +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS +static mz_bool mz_zip_get_file_modified_time(const char *pFilename, MZ_TIME_T *pTime) +{ + struct MZ_FILE_STAT_STRUCT file_stat; + + /* On Linux with x86 glibc, this call will fail on large files (I think >= 0x80000000 bytes) unless you compiled with _LARGEFILE64_SOURCE. Argh. */ + if (MZ_FILE_STAT(pFilename, &file_stat) != 0) + return MZ_FALSE; + + *pTime = file_stat.st_mtime; + + return MZ_TRUE; +} +#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS*/ + +static mz_bool mz_zip_set_file_times(const char *pFilename, MZ_TIME_T access_time, MZ_TIME_T modified_time) +{ + struct utimbuf t; + + memset(&t, 0, sizeof(t)); + t.actime = access_time; + t.modtime = modified_time; + + return !utime(pFilename, &t); +} +#endif /* #ifndef MINIZ_NO_STDIO */ +#endif /* #ifndef MINIZ_NO_TIME */ + +static MZ_FORCEINLINE mz_bool mz_zip_set_error(mz_zip_archive *pZip, mz_zip_error err_num) +{ + if (pZip) + pZip->m_last_error = err_num; + return MZ_FALSE; +} + +static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip, mz_uint flags) +{ + (void)flags; + if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (!pZip->m_pAlloc) + pZip->m_pAlloc = miniz_def_alloc_func; + if (!pZip->m_pFree) + pZip->m_pFree = miniz_def_free_func; + if (!pZip->m_pRealloc) + pZip->m_pRealloc = miniz_def_realloc_func; + + pZip->m_archive_size = 0; + pZip->m_central_directory_file_ofs = 0; + pZip->m_total_files = 0; + pZip->m_last_error = MZ_ZIP_NO_ERROR; + + if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state)))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32)); + pZip->m_pState->m_init_flags = flags; + pZip->m_pState->m_zip64 = MZ_FALSE; + pZip->m_pState->m_zip64_has_extended_info_fields = MZ_FALSE; + + pZip->m_zip_mode = MZ_ZIP_MODE_READING; + + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_reader_filename_less(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, mz_uint r_index) +{ + const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE; + const mz_uint8 *pR = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, r_index)); + mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS), r_len = MZ_READ_LE16(pR + MZ_ZIP_CDH_FILENAME_LEN_OFS); + mz_uint8 l = 0, r = 0; + pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + pR += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + pE = pL + MZ_MIN(l_len, r_len); + while (pL < pE) + { + if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) + break; + pL++; + pR++; + } + return (pL == pE) ? (l_len < r_len) : (l < r); +} + +#define MZ_SWAP_UINT32(a, b) \ + do \ + { \ + mz_uint32 t = a; \ + a = b; \ + b = t; \ + } \ + MZ_MACRO_END + +/* Heap sort of lowercased filenames, used to help accelerate plain central directory searches by mz_zip_reader_locate_file(). (Could also use qsort(), but it could allocate memory.) */ +static void mz_zip_reader_sort_central_dir_offsets_by_filename(mz_zip_archive *pZip) +{ + mz_zip_internal_state *pState = pZip->m_pState; + const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets; + const mz_zip_array *pCentral_dir = &pState->m_central_dir; + mz_uint32 *pIndices; + mz_uint32 start, end; + const mz_uint32 size = pZip->m_total_files; + + if (size <= 1U) + return; + + pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0); + + start = (size - 2U) >> 1U; + for (;;) + { + mz_uint64 child, root = start; + for (;;) + { + if ((child = (root << 1U) + 1U) >= size) + break; + child += (((child + 1U) < size) && (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U]))); + if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child])) + break; + MZ_SWAP_UINT32(pIndices[root], pIndices[child]); + root = child; + } + if (!start) + break; + start--; + } + + end = size - 1; + while (end > 0) + { + mz_uint64 child, root = 0; + MZ_SWAP_UINT32(pIndices[end], pIndices[0]); + for (;;) + { + if ((child = (root << 1U) + 1U) >= end) + break; + child += (((child + 1U) < end) && mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U])); + if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child])) + break; + MZ_SWAP_UINT32(pIndices[root], pIndices[child]); + root = child; + } + end--; + } +} + +static mz_bool mz_zip_reader_locate_header_sig(mz_zip_archive *pZip, mz_uint32 record_sig, mz_uint32 record_size, mz_int64 *pOfs) +{ + mz_int64 cur_file_ofs; + mz_uint32 buf_u32[4096 / sizeof(mz_uint32)]; + mz_uint8 *pBuf = (mz_uint8 *)buf_u32; + + /* Basic sanity checks - reject files which are too small */ + if (pZip->m_archive_size < record_size) + return MZ_FALSE; + + /* Find the record by scanning the file from the end towards the beginning. */ + cur_file_ofs = MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0); + for (;;) + { + int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs); + + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n) + return MZ_FALSE; + + for (i = n - 4; i >= 0; --i) + { + mz_uint s = MZ_READ_LE32(pBuf + i); + if (s == record_sig) + { + if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size) + break; + } + } + + if (i >= 0) + { + cur_file_ofs += i; + break; + } + + /* Give up if we've searched the entire file, or we've gone back "too far" (~64kb) */ + if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= (MZ_UINT16_MAX + record_size))) + return MZ_FALSE; + + cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0); + } + + *pOfs = cur_file_ofs; + return MZ_TRUE; +} + +static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, mz_uint flags) +{ + mz_uint cdir_size = 0, cdir_entries_on_this_disk = 0, num_this_disk = 0, cdir_disk_index = 0; + mz_uint64 cdir_ofs = 0; + mz_int64 cur_file_ofs = 0; + const mz_uint8 *p; + + mz_uint32 buf_u32[4096 / sizeof(mz_uint32)]; + mz_uint8 *pBuf = (mz_uint8 *)buf_u32; + mz_bool sort_central_dir = ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0); + mz_uint32 zip64_end_of_central_dir_locator_u32[(MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pZip64_locator = (mz_uint8 *)zip64_end_of_central_dir_locator_u32; + + mz_uint32 zip64_end_of_central_dir_header_u32[(MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pZip64_end_of_central_dir = (mz_uint8 *)zip64_end_of_central_dir_header_u32; + + mz_uint64 zip64_end_of_central_dir_ofs = 0; + + /* Basic sanity checks - reject files which are too small, and check the first 4 bytes of the file to make sure a local header is there. */ + if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); + + if (!mz_zip_reader_locate_header_sig(pZip, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE, &cur_file_ofs)) + return mz_zip_set_error(pZip, MZ_ZIP_FAILED_FINDING_CENTRAL_DIR); + + /* Read and verify the end of central directory record. */ + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + + if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); + + if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)) + { + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs - MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE, pZip64_locator, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) + { + if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG) + { + zip64_end_of_central_dir_ofs = MZ_READ_LE64(pZip64_locator + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS); + if (zip64_end_of_central_dir_ofs > (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)) + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); + + if (pZip->m_pRead(pZip->m_pIO_opaque, zip64_end_of_central_dir_ofs, pZip64_end_of_central_dir, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) + { + if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG) + { + pZip->m_pState->m_zip64 = MZ_TRUE; + } + } + } + } + } + + pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS); + cdir_entries_on_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS); + num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS); + cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS); + cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS); + cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS); + + if (pZip->m_pState->m_zip64) + { + mz_uint32 zip64_total_num_of_disks = MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS); + mz_uint64 zip64_cdir_total_entries = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS); + mz_uint64 zip64_cdir_total_entries_on_this_disk = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS); + mz_uint64 zip64_size_of_end_of_central_dir_record = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS); + mz_uint64 zip64_size_of_central_directory = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_SIZE_OFS); + + if (zip64_size_of_end_of_central_dir_record < (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if (zip64_total_num_of_disks != 1U) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); + + /* Check for miniz's practical limits */ + if (zip64_cdir_total_entries > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + + pZip->m_total_files = (mz_uint32)zip64_cdir_total_entries; + + if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + + cdir_entries_on_this_disk = (mz_uint32)zip64_cdir_total_entries_on_this_disk; + + /* Check for miniz's current practical limits (sorry, this should be enough for millions of files) */ + if (zip64_size_of_central_directory > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); + + cdir_size = (mz_uint32)zip64_size_of_central_directory; + + num_this_disk = MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS); + + cdir_disk_index = MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS); + + cdir_ofs = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_OFS_OFS); + } + + if (pZip->m_total_files != cdir_entries_on_this_disk) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); + + if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1))) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); + + if (cdir_size < (mz_uint64)pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + pZip->m_central_directory_file_ofs = cdir_ofs; + + if (pZip->m_total_files) + { + mz_uint i, n; + /* Read the entire central directory into a heap block, and allocate another heap block to hold the unsorted central dir file record offsets, and possibly another to hold the sorted indices. */ + if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) || + (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + if (sort_central_dir) + { + if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE)) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + + /* Now create an index into the central directory file records, do some basic sanity checking on each record */ + p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p; + for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i) + { + mz_uint total_header_size, disk_index, bit_flags, filename_size, ext_data_size; + mz_uint64 comp_size, decomp_size, local_header_ofs; + + if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, i) = (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p); + + if (sort_central_dir) + MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets, mz_uint32, i) = i; + + comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); + decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); + local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS); + filename_size = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + ext_data_size = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS); + + if ((!pZip->m_pState->m_zip64_has_extended_info_fields) && + (ext_data_size) && + (MZ_MAX(MZ_MAX(comp_size, decomp_size), local_header_ofs) == MZ_UINT32_MAX)) + { + /* Attempt to find zip64 extended information field in the entry's extra data */ + mz_uint32 extra_size_remaining = ext_data_size; + + if (extra_size_remaining) + { + const mz_uint8 *pExtra_data; + void* buf = NULL; + + if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size > n) + { + buf = MZ_MALLOC(ext_data_size); + if(buf==NULL) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size, buf, ext_data_size) != ext_data_size) + { + MZ_FREE(buf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + } + + pExtra_data = (mz_uint8*)buf; + } + else + { + pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size; + } + + do + { + mz_uint32 field_id; + mz_uint32 field_data_size; + + if (extra_size_remaining < (sizeof(mz_uint16) * 2)) + { + MZ_FREE(buf); + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + field_id = MZ_READ_LE16(pExtra_data); + field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16)); + + if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining) + { + MZ_FREE(buf); + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) + { + /* Ok, the archive didn't have any zip64 headers but it uses a zip64 extended information field so mark it as zip64 anyway (this can occur with infozip's zip util when it reads compresses files from stdin). */ + pZip->m_pState->m_zip64 = MZ_TRUE; + pZip->m_pState->m_zip64_has_extended_info_fields = MZ_TRUE; + break; + } + + pExtra_data += sizeof(mz_uint16) * 2 + field_data_size; + extra_size_remaining = extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size; + } while (extra_size_remaining); + + MZ_FREE(buf); + } + } + + /* I've seen archives that aren't marked as zip64 that uses zip64 ext data, argh */ + if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX)) + { + if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS); + if ((disk_index == MZ_UINT16_MAX) || ((disk_index != num_this_disk) && (disk_index != 1))) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); + + if (comp_size != MZ_UINT32_MAX) + { + if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + bit_flags = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); + if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); + + if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > n) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + n -= total_header_size; + p += total_header_size; + } + } + + if (sort_central_dir) + mz_zip_reader_sort_central_dir_offsets_by_filename(pZip); + + return MZ_TRUE; +} + +void mz_zip_zero_struct(mz_zip_archive *pZip) +{ + if (pZip) + MZ_CLEAR_PTR(pZip); +} + +static mz_bool mz_zip_reader_end_internal(mz_zip_archive *pZip, mz_bool set_last_error) +{ + mz_bool status = MZ_TRUE; + + if (!pZip) + return MZ_FALSE; + + if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) + { + if (set_last_error) + pZip->m_last_error = MZ_ZIP_INVALID_PARAMETER; + + return MZ_FALSE; + } + + if (pZip->m_pState) + { + mz_zip_internal_state *pState = pZip->m_pState; + pZip->m_pState = NULL; + + mz_zip_array_clear(pZip, &pState->m_central_dir); + mz_zip_array_clear(pZip, &pState->m_central_dir_offsets); + mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets); + +#ifndef MINIZ_NO_STDIO + if (pState->m_pFile) + { + if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE) + { + if (MZ_FCLOSE(pState->m_pFile) == EOF) + { + if (set_last_error) + pZip->m_last_error = MZ_ZIP_FILE_CLOSE_FAILED; + status = MZ_FALSE; + } + } + pState->m_pFile = NULL; + } +#endif /* #ifndef MINIZ_NO_STDIO */ + + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + } + pZip->m_zip_mode = MZ_ZIP_MODE_INVALID; + + return status; +} + +mz_bool mz_zip_reader_end(mz_zip_archive *pZip) +{ + return mz_zip_reader_end_internal(pZip, MZ_TRUE); +} +mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags) +{ + if ((!pZip) || (!pZip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (!mz_zip_reader_init_internal(pZip, flags)) + return MZ_FALSE; + + pZip->m_zip_type = MZ_ZIP_TYPE_USER; + pZip->m_archive_size = size; + + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end_internal(pZip, MZ_FALSE); + return MZ_FALSE; + } + + return MZ_TRUE; +} + +static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n); + memcpy(pBuf, (const mz_uint8 *)pZip->m_pState->m_pMem + file_ofs, s); + return s; +} + +mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags) +{ + if (!pMem) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); + + if (!mz_zip_reader_init_internal(pZip, flags)) + return MZ_FALSE; + + pZip->m_zip_type = MZ_ZIP_TYPE_MEMORY; + pZip->m_archive_size = size; + pZip->m_pRead = mz_zip_mem_read_func; + pZip->m_pIO_opaque = pZip; + pZip->m_pNeeds_keepalive = NULL; + +#ifdef __cplusplus + pZip->m_pState->m_pMem = const_cast(pMem); +#else + pZip->m_pState->m_pMem = (void *)pMem; +#endif + + pZip->m_pState->m_mem_size = size; + + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end_internal(pZip, MZ_FALSE); + return MZ_FALSE; + } + + return MZ_TRUE; +} + +#ifndef MINIZ_NO_STDIO +static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); + + file_ofs += pZip->m_pState->m_file_archive_start_ofs; + + if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET)))) + return 0; + + return MZ_FREAD(pBuf, 1, n, pZip->m_pState->m_pFile); +} + +mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags) +{ + return mz_zip_reader_init_file_v2(pZip, pFilename, flags, 0, 0); +} + +mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size) +{ + mz_uint64 file_size; + MZ_FILE *pFile; + + if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE))) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pFile = MZ_FOPEN(pFilename, "rb"); + if (!pFile) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED); + + file_size = archive_size; + if (!file_size) + { + if (MZ_FSEEK64(pFile, 0, SEEK_END)) + { + MZ_FCLOSE(pFile); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED); + } + + file_size = MZ_FTELL64(pFile); + } + + /* TODO: Better sanity check archive_size and the # of actual remaining bytes */ + + if (file_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + { + MZ_FCLOSE(pFile); + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); + } + + if (!mz_zip_reader_init_internal(pZip, flags)) + { + MZ_FCLOSE(pFile); + return MZ_FALSE; + } + + pZip->m_zip_type = MZ_ZIP_TYPE_FILE; + pZip->m_pRead = mz_zip_file_read_func; + pZip->m_pIO_opaque = pZip; + pZip->m_pState->m_pFile = pFile; + pZip->m_archive_size = file_size; + pZip->m_pState->m_file_archive_start_ofs = file_start_ofs; + + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end_internal(pZip, MZ_FALSE); + return MZ_FALSE; + } + + return MZ_TRUE; +} + +mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags) +{ + mz_uint64 cur_file_ofs; + + if ((!pZip) || (!pFile)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED); + + cur_file_ofs = MZ_FTELL64(pFile); + + if (!archive_size) + { + if (MZ_FSEEK64(pFile, 0, SEEK_END)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED); + + archive_size = MZ_FTELL64(pFile) - cur_file_ofs; + + if (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); + } + + if (!mz_zip_reader_init_internal(pZip, flags)) + return MZ_FALSE; + + pZip->m_zip_type = MZ_ZIP_TYPE_CFILE; + pZip->m_pRead = mz_zip_file_read_func; + + pZip->m_pIO_opaque = pZip; + pZip->m_pState->m_pFile = pFile; + pZip->m_archive_size = archive_size; + pZip->m_pState->m_file_archive_start_ofs = cur_file_ofs; + + if (!mz_zip_reader_read_central_dir(pZip, flags)) + { + mz_zip_reader_end_internal(pZip, MZ_FALSE); + return MZ_FALSE; + } + + return MZ_TRUE; +} + +#endif /* #ifndef MINIZ_NO_STDIO */ + +static MZ_FORCEINLINE const mz_uint8 *mz_zip_get_cdh(mz_zip_archive *pZip, mz_uint file_index) +{ + if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files)) + return NULL; + return &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index)); +} + +mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index) +{ + mz_uint m_bit_flag; + const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index); + if (!p) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + return MZ_FALSE; + } + + m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); + return (m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION)) != 0; +} + +mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index) +{ + mz_uint bit_flag; + mz_uint method; + + const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index); + if (!p) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + return MZ_FALSE; + } + + method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS); + bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); + + if ((method != 0) && (method != MZ_DEFLATED)) + { + mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD); + return MZ_FALSE; + } + + if (bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION)) + { + mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); + return MZ_FALSE; + } + + if (bit_flag & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG) + { + mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE); + return MZ_FALSE; + } + + return MZ_TRUE; +} + +mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index) +{ + mz_uint filename_len, attribute_mapping_id, external_attr; + const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index); + if (!p) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + return MZ_FALSE; + } + + filename_len = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + if (filename_len) + { + if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/') + return MZ_TRUE; + } + + /* Bugfix: This code was also checking if the internal attribute was non-zero, which wasn't correct. */ + /* Most/all zip writers (hopefully) set DOS file/directory attributes in the low 16-bits, so check for the DOS directory flag and ignore the source OS ID in the created by field. */ + /* FIXME: Remove this check? Is it necessary - we already check the filename. */ + attribute_mapping_id = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS) >> 8; + (void)attribute_mapping_id; + + external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS); + if ((external_attr & MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG) != 0) + { + return MZ_TRUE; + } + + return MZ_FALSE; +} + +static mz_bool mz_zip_file_stat_internal(mz_zip_archive *pZip, mz_uint file_index, const mz_uint8 *pCentral_dir_header, mz_zip_archive_file_stat *pStat, mz_bool *pFound_zip64_extra_data) +{ + mz_uint n; + const mz_uint8 *p = pCentral_dir_header; + + if (pFound_zip64_extra_data) + *pFound_zip64_extra_data = MZ_FALSE; + + if ((!p) || (!pStat)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + /* Extract fields from the central directory record. */ + pStat->m_file_index = file_index; + pStat->m_central_dir_ofs = MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index); + pStat->m_version_made_by = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS); + pStat->m_version_needed = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_NEEDED_OFS); + pStat->m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); + pStat->m_method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS); +#ifndef MINIZ_NO_TIME + pStat->m_time = mz_zip_dos_to_time_t(MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_TIME_OFS), MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_DATE_OFS)); +#endif + pStat->m_crc32 = MZ_READ_LE32(p + MZ_ZIP_CDH_CRC32_OFS); + pStat->m_comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); + pStat->m_uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); + pStat->m_internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS); + pStat->m_external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS); + pStat->m_local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS); + + /* Copy as much of the filename and comment as possible. */ + n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE - 1); + memcpy(pStat->m_filename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); + pStat->m_filename[n] = '\0'; + + n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS); + n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1); + pStat->m_comment_size = n; + memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), n); + pStat->m_comment[n] = '\0'; + + /* Set some flags for convienance */ + pStat->m_is_directory = mz_zip_reader_is_file_a_directory(pZip, file_index); + pStat->m_is_encrypted = mz_zip_reader_is_file_encrypted(pZip, file_index); + pStat->m_is_supported = mz_zip_reader_is_file_supported(pZip, file_index); + + /* See if we need to read any zip64 extended information fields. */ + /* Confusingly, these zip64 fields can be present even on non-zip64 archives (Debian zip on a huge files from stdin piped to stdout creates them). */ + if (MZ_MAX(MZ_MAX(pStat->m_comp_size, pStat->m_uncomp_size), pStat->m_local_header_ofs) == MZ_UINT32_MAX) + { + /* Attempt to find zip64 extended information field in the entry's extra data */ + mz_uint32 extra_size_remaining = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS); + + if (extra_size_remaining) + { + const mz_uint8 *pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + + do + { + mz_uint32 field_id; + mz_uint32 field_data_size; + + if (extra_size_remaining < (sizeof(mz_uint16) * 2)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + field_id = MZ_READ_LE16(pExtra_data); + field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16)); + + if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) + { + const mz_uint8 *pField_data = pExtra_data + sizeof(mz_uint16) * 2; + mz_uint32 field_data_remaining = field_data_size; + + if (pFound_zip64_extra_data) + *pFound_zip64_extra_data = MZ_TRUE; + + if (pStat->m_uncomp_size == MZ_UINT32_MAX) + { + if (field_data_remaining < sizeof(mz_uint64)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + pStat->m_uncomp_size = MZ_READ_LE64(pField_data); + pField_data += sizeof(mz_uint64); + field_data_remaining -= sizeof(mz_uint64); + } + + if (pStat->m_comp_size == MZ_UINT32_MAX) + { + if (field_data_remaining < sizeof(mz_uint64)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + pStat->m_comp_size = MZ_READ_LE64(pField_data); + pField_data += sizeof(mz_uint64); + field_data_remaining -= sizeof(mz_uint64); + } + + if (pStat->m_local_header_ofs == MZ_UINT32_MAX) + { + if (field_data_remaining < sizeof(mz_uint64)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + pStat->m_local_header_ofs = MZ_READ_LE64(pField_data); + pField_data += sizeof(mz_uint64); + field_data_remaining -= sizeof(mz_uint64); + } + + break; + } + + pExtra_data += sizeof(mz_uint16) * 2 + field_data_size; + extra_size_remaining = extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size; + } while (extra_size_remaining); + } + } + + return MZ_TRUE; +} + +static MZ_FORCEINLINE mz_bool mz_zip_string_equal(const char *pA, const char *pB, mz_uint len, mz_uint flags) +{ + mz_uint i; + if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE) + return 0 == memcmp(pA, pB, len); + for (i = 0; i < len; ++i) + if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i])) + return MZ_FALSE; + return MZ_TRUE; +} + +static MZ_FORCEINLINE int mz_zip_filename_compare(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, const char *pR, mz_uint r_len) +{ + const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE; + mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS); + mz_uint8 l = 0, r = 0; + pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + pE = pL + MZ_MIN(l_len, r_len); + while (pL < pE) + { + if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR))) + break; + pL++; + pR++; + } + return (pL == pE) ? (int)(l_len - r_len) : (l - r); +} + +static mz_bool mz_zip_locate_file_binary_search(mz_zip_archive *pZip, const char *pFilename, mz_uint32 *pIndex) +{ + mz_zip_internal_state *pState = pZip->m_pState; + const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets; + const mz_zip_array *pCentral_dir = &pState->m_central_dir; + mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0); + const mz_uint32 size = pZip->m_total_files; + const mz_uint filename_len = (mz_uint)strlen(pFilename); + + if (pIndex) + *pIndex = 0; + + if (size) + { + /* yes I could use uint32_t's, but then we would have to add some special case checks in the loop, argh, and */ + /* honestly the major expense here on 32-bit CPU's will still be the filename compare */ + mz_int64 l = 0, h = (mz_int64)size - 1; + + while (l <= h) + { + mz_int64 m = l + ((h - l) >> 1); + mz_uint32 file_index = pIndices[(mz_uint32)m]; + + int comp = mz_zip_filename_compare(pCentral_dir, pCentral_dir_offsets, file_index, pFilename, filename_len); + if (!comp) + { + if (pIndex) + *pIndex = file_index; + return MZ_TRUE; + } + else if (comp < 0) + l = m + 1; + else + h = m - 1; + } + } + + return mz_zip_set_error(pZip, MZ_ZIP_FILE_NOT_FOUND); +} + +int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags) +{ + mz_uint32 index; + if (!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index)) + return -1; + else + return (int)index; +} + +mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *pIndex) +{ + mz_uint file_index; + size_t name_len, comment_len; + + if (pIndex) + *pIndex = 0; + + if ((!pZip) || (!pZip->m_pState) || (!pName)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + /* See if we can use a binary search */ + if (((pZip->m_pState->m_init_flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) && + (pZip->m_zip_mode == MZ_ZIP_MODE_READING) && + ((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_size)) + { + return mz_zip_locate_file_binary_search(pZip, pName, pIndex); + } + + /* Locate the entry by scanning the entire central directory */ + name_len = strlen(pName); + if (name_len > MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + comment_len = pComment ? strlen(pComment) : 0; + if (comment_len > MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + for (file_index = 0; file_index < pZip->m_total_files; file_index++) + { + const mz_uint8 *pHeader = &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index)); + mz_uint filename_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_FILENAME_LEN_OFS); + const char *pFilename = (const char *)pHeader + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE; + if (filename_len < name_len) + continue; + if (comment_len) + { + mz_uint file_extra_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_EXTRA_LEN_OFS), file_comment_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_COMMENT_LEN_OFS); + const char *pFile_comment = pFilename + filename_len + file_extra_len; + if ((file_comment_len != comment_len) || (!mz_zip_string_equal(pComment, pFile_comment, file_comment_len, flags))) + continue; + } + if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len)) + { + int ofs = filename_len - 1; + do + { + if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':')) + break; + } while (--ofs >= 0); + ofs++; + pFilename += ofs; + filename_len -= ofs; + } + if ((filename_len == name_len) && (mz_zip_string_equal(pName, pFilename, filename_len, flags))) + { + if (pIndex) + *pIndex = file_index; + return MZ_TRUE; + } + } + + return mz_zip_set_error(pZip, MZ_ZIP_FILE_NOT_FOUND); +} + +static +mz_bool mz_zip_reader_extract_to_mem_no_alloc1(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size, const mz_zip_archive_file_stat *st) +{ + int status = TINFL_STATUS_DONE; + mz_uint64 needed_size, cur_file_ofs, comp_remaining, out_buf_ofs = 0, read_buf_size, read_buf_ofs = 0, read_buf_avail; + mz_zip_archive_file_stat file_stat; + void *pRead_buf; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + tinfl_decompressor inflator; + + if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (st) { + file_stat = *st; + } else + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + + /* A directory or zero length file */ + if ((file_stat.m_is_directory) || (!file_stat.m_comp_size)) + return MZ_TRUE; + + /* Encryption and patch files are not supported. */ + if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); + + /* This function only supports decompressing stored and deflate. */ + if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD); + + /* Ensure supplied output buffer is large enough. */ + needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size; + if (buf_size < needed_size) + return mz_zip_set_error(pZip, MZ_ZIP_BUF_TOO_SMALL); + + /* Read and parse the local directory entry. */ + cur_file_ofs = file_stat.m_local_header_ofs; + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) + { + /* The file is stored or the caller has requested the compressed data. */ + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) == 0) + { + if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32) + return mz_zip_set_error(pZip, MZ_ZIP_CRC_CHECK_FAILED); + } +#endif + + return MZ_TRUE; + } + + /* Decompress the file either directly from memory or from a file input buffer. */ + tinfl_init(&inflator); + + if (pZip->m_pState->m_pMem) + { + /* Read directly from the archive in memory. */ + pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs; + read_buf_size = read_buf_avail = file_stat.m_comp_size; + comp_remaining = 0; + } + else if (pUser_read_buf) + { + /* Use a user provided read buffer. */ + if (!user_read_buf_size) + return MZ_FALSE; + pRead_buf = (mz_uint8 *)pUser_read_buf; + read_buf_size = user_read_buf_size; + read_buf_avail = 0; + comp_remaining = file_stat.m_comp_size; + } + else + { + /* Temporarily allocate a read buffer. */ + read_buf_size = MZ_MIN(file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE); + if (((sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + read_buf_avail = 0; + comp_remaining = file_stat.m_comp_size; + } + + do + { + /* The size_t cast here should be OK because we've verified that the output buffer is >= file_stat.m_uncomp_size above */ + size_t in_buf_size, out_buf_size = (size_t)(file_stat.m_uncomp_size - out_buf_ofs); + if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) + { + read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + status = TINFL_STATUS_FAILED; + mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED); + break; + } + cur_file_ofs += read_buf_avail; + comp_remaining -= read_buf_avail; + read_buf_ofs = 0; + } + in_buf_size = (size_t)read_buf_avail; + status = tinfl_decompress(&inflator, (mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pBuf, (mz_uint8 *)pBuf + out_buf_ofs, &out_buf_size, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF | (comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0)); + read_buf_avail -= in_buf_size; + read_buf_ofs += in_buf_size; + out_buf_ofs += out_buf_size; + } while (status == TINFL_STATUS_NEEDS_MORE_INPUT); + + if (status == TINFL_STATUS_DONE) + { + /* Make sure the entire file was decompressed, and check its CRC. */ + if (out_buf_ofs != file_stat.m_uncomp_size) + { + mz_zip_set_error(pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE); + status = TINFL_STATUS_FAILED; + } +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + else if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32) + { + mz_zip_set_error(pZip, MZ_ZIP_CRC_CHECK_FAILED); + status = TINFL_STATUS_FAILED; + } +#endif + } + + if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf)) + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + + return status == TINFL_STATUS_DONE; +} + +mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) +{ + return mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf, buf_size, flags, pUser_read_buf, user_read_buf_size, NULL); +} + +mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size) +{ + mz_uint32 file_index; + if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index)) + return MZ_FALSE; + return mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf, buf_size, flags, pUser_read_buf, user_read_buf_size, NULL); +} + +mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags) +{ + return mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf, buf_size, flags, NULL, 0, NULL); +} + +mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags) +{ + return mz_zip_reader_extract_file_to_mem_no_alloc(pZip, pFilename, pBuf, buf_size, flags, NULL, 0); +} + +void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags) +{ + mz_zip_archive_file_stat file_stat; + mz_uint64 alloc_size; + void *pBuf; + + if (pSize) + *pSize = 0; + + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return NULL; + + alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size; + if (((sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF)) + { + mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + return NULL; + } + + if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size))) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + return NULL; + } + + if (!mz_zip_reader_extract_to_mem_no_alloc1(pZip, file_index, pBuf, (size_t)alloc_size, flags, NULL, 0, &file_stat)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return NULL; + } + + if (pSize) + *pSize = (size_t)alloc_size; + return pBuf; +} + +void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags) +{ + mz_uint32 file_index; + if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index)) + { + if (pSize) + *pSize = 0; + return MZ_FALSE; + } + return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags); +} + +mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags) +{ + int status = TINFL_STATUS_DONE; +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + mz_uint file_crc32 = MZ_CRC32_INIT; +#endif + mz_uint64 read_buf_size, read_buf_ofs = 0, read_buf_avail, comp_remaining, out_buf_ofs = 0, cur_file_ofs; + mz_zip_archive_file_stat file_stat; + void *pRead_buf = NULL; + void *pWrite_buf = NULL; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + + if ((!pZip) || (!pZip->m_pState) || (!pCallback) || (!pZip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + + /* A directory or zero length file */ + if ((file_stat.m_is_directory) || (!file_stat.m_comp_size)) + return MZ_TRUE; + + /* Encryption and patch files are not supported. */ + if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); + + /* This function only supports decompressing stored and deflate. */ + if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD); + + /* Read and do some minimal validation of the local directory entry (this doesn't crack the zip64 stuff, which we already have from the central dir) */ + cur_file_ofs = file_stat.m_local_header_ofs; + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + /* Decompress the file either directly from memory or from a file input buffer. */ + if (pZip->m_pState->m_pMem) + { + pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs; + read_buf_size = read_buf_avail = file_stat.m_comp_size; + comp_remaining = 0; + } + else + { + read_buf_size = MZ_MIN(file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE); + if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + read_buf_avail = 0; + comp_remaining = file_stat.m_comp_size; + } + + if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method)) + { + /* The file is stored or the caller has requested the compressed data. */ + if (pZip->m_pState->m_pMem) + { + if (((sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > MZ_UINT32_MAX)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size) + { + mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED); + status = TINFL_STATUS_FAILED; + } + else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + { +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)file_stat.m_comp_size); +#endif + } + + cur_file_ofs += file_stat.m_comp_size; + out_buf_ofs += file_stat.m_comp_size; + comp_remaining = 0; + } + else + { + while (comp_remaining) + { + read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + status = TINFL_STATUS_FAILED; + break; + } + +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + { + file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)read_buf_avail); + } +#endif + + if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED); + status = TINFL_STATUS_FAILED; + break; + } + + cur_file_ofs += read_buf_avail; + out_buf_ofs += read_buf_avail; + comp_remaining -= read_buf_avail; + } + } + } + else + { + tinfl_decompressor inflator; + tinfl_init(&inflator); + + if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE))) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + status = TINFL_STATUS_FAILED; + } + else + { + do + { + mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pWrite_buf + (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); + size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); + if ((!read_buf_avail) && (!pZip->m_pState->m_pMem)) + { + read_buf_avail = MZ_MIN(read_buf_size, comp_remaining); + if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + status = TINFL_STATUS_FAILED; + break; + } + cur_file_ofs += read_buf_avail; + comp_remaining -= read_buf_avail; + read_buf_ofs = 0; + } + + in_buf_size = (size_t)read_buf_avail; + status = tinfl_decompress(&inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size, comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0); + read_buf_avail -= in_buf_size; + read_buf_ofs += in_buf_size; + + if (out_buf_size) + { + if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size) + { + mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED); + status = TINFL_STATUS_FAILED; + break; + } + +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + file_crc32 = (mz_uint32)mz_crc32(file_crc32, pWrite_buf_cur, out_buf_size); +#endif + if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size) + { + mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED); + status = TINFL_STATUS_FAILED; + break; + } + } + } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT)); + } + } + + if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) + { + /* Make sure the entire file was decompressed, and check its CRC. */ + if (out_buf_ofs != file_stat.m_uncomp_size) + { + mz_zip_set_error(pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE); + status = TINFL_STATUS_FAILED; + } +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + else if (file_crc32 != file_stat.m_crc32) + { + mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED); + status = TINFL_STATUS_FAILED; + } +#endif + } + + if (!pZip->m_pState->m_pMem) + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + + if (pWrite_buf) + pZip->m_pFree(pZip->m_pAlloc_opaque, pWrite_buf); + + return status == TINFL_STATUS_DONE; +} + +mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags) +{ + mz_uint32 file_index; + if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index)) + return MZ_FALSE; + + return mz_zip_reader_extract_to_callback(pZip, file_index, pCallback, pOpaque, flags); +} + +mz_zip_reader_extract_iter_state* mz_zip_reader_extract_iter_new(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags) +{ + mz_zip_reader_extract_iter_state *pState; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + + /* Argument sanity check */ + if ((!pZip) || (!pZip->m_pState)) + return NULL; + + /* Allocate an iterator status structure */ + pState = (mz_zip_reader_extract_iter_state*)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_reader_extract_iter_state)); + if (!pState) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + return NULL; + } + + /* Fetch file details */ + if (!mz_zip_reader_file_stat(pZip, file_index, &pState->file_stat)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + + /* Encryption and patch files are not supported. */ + if (pState->file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)) + { + mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + + /* This function only supports decompressing stored and deflate. */ + if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (pState->file_stat.m_method != 0) && (pState->file_stat.m_method != MZ_DEFLATED)) + { + mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + + /* Init state - save args */ + pState->pZip = pZip; + pState->flags = flags; + + /* Init state - reset variables to defaults */ + pState->status = TINFL_STATUS_DONE; +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + pState->file_crc32 = MZ_CRC32_INIT; +#endif + pState->read_buf_ofs = 0; + pState->out_buf_ofs = 0; + pState->pRead_buf = NULL; + pState->pWrite_buf = NULL; + pState->out_blk_remain = 0; + + /* Read and parse the local directory entry. */ + pState->cur_file_ofs = pState->file_stat.m_local_header_ofs; + if (pZip->m_pRead(pZip->m_pIO_opaque, pState->cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + + pState->cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + if ((pState->cur_file_ofs + pState->file_stat.m_comp_size) > pZip->m_archive_size) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + + /* Decompress the file either directly from memory or from a file input buffer. */ + if (pZip->m_pState->m_pMem) + { + pState->pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + pState->cur_file_ofs; + pState->read_buf_size = pState->read_buf_avail = pState->file_stat.m_comp_size; + pState->comp_remaining = pState->file_stat.m_comp_size; + } + else + { + if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method))) + { + /* Decompression required, therefore intermediate read buffer required */ + pState->read_buf_size = MZ_MIN(pState->file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE); + if (NULL == (pState->pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)pState->read_buf_size))) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + } + else + { + /* Decompression not required - we will be reading directly into user buffer, no temp buf required */ + pState->read_buf_size = 0; + } + pState->read_buf_avail = 0; + pState->comp_remaining = pState->file_stat.m_comp_size; + } + + if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method))) + { + /* Decompression required, init decompressor */ + tinfl_init( &pState->inflator ); + + /* Allocate write buffer */ + if (NULL == (pState->pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE))) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + if (pState->pRead_buf) + pZip->m_pFree(pZip->m_pAlloc_opaque, pState->pRead_buf); + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + return NULL; + } + } + + return pState; +} + +mz_zip_reader_extract_iter_state* mz_zip_reader_extract_file_iter_new(mz_zip_archive *pZip, const char *pFilename, mz_uint flags) +{ + mz_uint32 file_index; + + /* Locate file index by name */ + if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index)) + return NULL; + + /* Construct iterator */ + return mz_zip_reader_extract_iter_new(pZip, file_index, flags); +} + +size_t mz_zip_reader_extract_iter_read(mz_zip_reader_extract_iter_state* pState, void* pvBuf, size_t buf_size) +{ + size_t copied_to_caller = 0; + + /* Argument sanity check */ + if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState) || (!pvBuf)) + return 0; + + if ((pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)) + { + /* The file is stored or the caller has requested the compressed data, calc amount to return. */ + copied_to_caller = (size_t)MZ_MIN( buf_size, pState->comp_remaining ); + + /* Zip is in memory....or requires reading from a file? */ + if (pState->pZip->m_pState->m_pMem) + { + /* Copy data to caller's buffer */ + memcpy( pvBuf, pState->pRead_buf, copied_to_caller ); + pState->pRead_buf = ((mz_uint8*)pState->pRead_buf) + copied_to_caller; + } + else + { + /* Read directly into caller's buffer */ + if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pvBuf, copied_to_caller) != copied_to_caller) + { + /* Failed to read all that was asked for, flag failure and alert user */ + mz_zip_set_error(pState->pZip, MZ_ZIP_FILE_READ_FAILED); + pState->status = TINFL_STATUS_FAILED; + copied_to_caller = 0; + } + } + +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + /* Compute CRC if not returning compressed data only */ + if (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + pState->file_crc32 = (mz_uint32)mz_crc32(pState->file_crc32, (const mz_uint8 *)pvBuf, copied_to_caller); +#endif + + /* Advance offsets, dec counters */ + pState->cur_file_ofs += copied_to_caller; + pState->out_buf_ofs += copied_to_caller; + pState->comp_remaining -= copied_to_caller; + } + else + { + do + { + /* Calc ptr to write buffer - given current output pos and block size */ + mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pState->pWrite_buf + (pState->out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); + + /* Calc max output size - given current output pos and block size */ + size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (pState->out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1)); + + if (!pState->out_blk_remain) + { + /* Read more data from file if none available (and reading from file) */ + if ((!pState->read_buf_avail) && (!pState->pZip->m_pState->m_pMem)) + { + /* Calc read size */ + pState->read_buf_avail = MZ_MIN(pState->read_buf_size, pState->comp_remaining); + if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pState->pRead_buf, (size_t)pState->read_buf_avail) != pState->read_buf_avail) + { + mz_zip_set_error(pState->pZip, MZ_ZIP_FILE_READ_FAILED); + pState->status = TINFL_STATUS_FAILED; + break; + } + + /* Advance offsets, dec counters */ + pState->cur_file_ofs += pState->read_buf_avail; + pState->comp_remaining -= pState->read_buf_avail; + pState->read_buf_ofs = 0; + } + + /* Perform decompression */ + in_buf_size = (size_t)pState->read_buf_avail; + pState->status = tinfl_decompress(&pState->inflator, (const mz_uint8 *)pState->pRead_buf + pState->read_buf_ofs, &in_buf_size, (mz_uint8 *)pState->pWrite_buf, pWrite_buf_cur, &out_buf_size, pState->comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0); + pState->read_buf_avail -= in_buf_size; + pState->read_buf_ofs += in_buf_size; + + /* Update current output block size remaining */ + pState->out_blk_remain = out_buf_size; + } + + if (pState->out_blk_remain) + { + /* Calc amount to return. */ + size_t to_copy = MZ_MIN( (buf_size - copied_to_caller), pState->out_blk_remain ); + + /* Copy data to caller's buffer */ + memcpy( (mz_uint8*)pvBuf + copied_to_caller, pWrite_buf_cur, to_copy ); + +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + /* Perform CRC */ + pState->file_crc32 = (mz_uint32)mz_crc32(pState->file_crc32, pWrite_buf_cur, to_copy); +#endif + + /* Decrement data consumed from block */ + pState->out_blk_remain -= to_copy; + + /* Inc output offset, while performing sanity check */ + if ((pState->out_buf_ofs += to_copy) > pState->file_stat.m_uncomp_size) + { + mz_zip_set_error(pState->pZip, MZ_ZIP_DECOMPRESSION_FAILED); + pState->status = TINFL_STATUS_FAILED; + break; + } + + /* Increment counter of data copied to caller */ + copied_to_caller += to_copy; + } + } while ( (copied_to_caller < buf_size) && ((pState->status == TINFL_STATUS_NEEDS_MORE_INPUT) || (pState->status == TINFL_STATUS_HAS_MORE_OUTPUT)) ); + } + + /* Return how many bytes were copied into user buffer */ + return copied_to_caller; +} + +mz_bool mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state* pState) +{ + int status; + + /* Argument sanity check */ + if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState)) + return MZ_FALSE; + + /* Was decompression completed and requested? */ + if ((pState->status == TINFL_STATUS_DONE) && (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) + { + /* Make sure the entire file was decompressed, and check its CRC. */ + if (pState->out_buf_ofs != pState->file_stat.m_uncomp_size) + { + mz_zip_set_error(pState->pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE); + pState->status = TINFL_STATUS_FAILED; + } +#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + else if (pState->file_crc32 != pState->file_stat.m_crc32) + { + mz_zip_set_error(pState->pZip, MZ_ZIP_DECOMPRESSION_FAILED); + pState->status = TINFL_STATUS_FAILED; + } +#endif + } + + /* Free buffers */ + if (!pState->pZip->m_pState->m_pMem) + pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState->pRead_buf); + if (pState->pWrite_buf) + pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState->pWrite_buf); + + /* Save status */ + status = pState->status; + + /* Free context */ + pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState); + + return status == TINFL_STATUS_DONE; +} + +#ifndef MINIZ_NO_STDIO +static size_t mz_zip_file_write_callback(void *pOpaque, mz_uint64 ofs, const void *pBuf, size_t n) +{ + (void)ofs; + + return MZ_FWRITE(pBuf, 1, n, (MZ_FILE *)pOpaque); +} + +mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags) +{ + mz_bool status; + mz_zip_archive_file_stat file_stat; + MZ_FILE *pFile; + + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + + if ((file_stat.m_is_directory) || (!file_stat.m_is_supported)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE); + + pFile = MZ_FOPEN(pDst_filename, "wb"); + if (!pFile) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED); + + status = mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags); + + if (MZ_FCLOSE(pFile) == EOF) + { + if (status) + mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED); + + status = MZ_FALSE; + } + +#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_STDIO) + if (status) + mz_zip_set_file_times(pDst_filename, file_stat.m_time, file_stat.m_time); +#endif + + return status; +} + +mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags) +{ + mz_uint32 file_index; + if (!mz_zip_reader_locate_file_v2(pZip, pArchive_filename, NULL, flags, &file_index)) + return MZ_FALSE; + + return mz_zip_reader_extract_to_file(pZip, file_index, pDst_filename, flags); +} + +mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *pFile, mz_uint flags) +{ + mz_zip_archive_file_stat file_stat; + + if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat)) + return MZ_FALSE; + + if ((file_stat.m_is_directory) || (!file_stat.m_is_supported)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE); + + return mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags); +} + +mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags) +{ + mz_uint32 file_index; + if (!mz_zip_reader_locate_file_v2(pZip, pArchive_filename, NULL, flags, &file_index)) + return MZ_FALSE; + + return mz_zip_reader_extract_to_cfile(pZip, file_index, pFile, flags); +} +#endif /* #ifndef MINIZ_NO_STDIO */ + +static size_t mz_zip_compute_crc32_callback(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) +{ + mz_uint32 *p = (mz_uint32 *)pOpaque; + (void)file_ofs; + *p = (mz_uint32)mz_crc32(*p, (const mz_uint8 *)pBuf, n); + return n; +} + +mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags) +{ + mz_zip_archive_file_stat file_stat; + mz_zip_internal_state *pState; + const mz_uint8 *pCentral_dir_header; + mz_bool found_zip64_ext_data_in_cdir = MZ_FALSE; + mz_bool found_zip64_ext_data_in_ldir = MZ_FALSE; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + mz_uint64 local_header_ofs = 0; + mz_uint32 local_header_filename_len, local_header_extra_len, local_header_crc32; + mz_uint64 local_header_comp_size, local_header_uncomp_size; + mz_uint32 uncomp_crc32 = MZ_CRC32_INIT; + mz_bool has_data_descriptor; + mz_uint32 local_header_bit_flags; + + mz_zip_array file_data_array; + mz_zip_array_init(&file_data_array, 1); + + if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (file_index > pZip->m_total_files) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState = pZip->m_pState; + + pCentral_dir_header = mz_zip_get_cdh(pZip, file_index); + + if (!mz_zip_file_stat_internal(pZip, file_index, pCentral_dir_header, &file_stat, &found_zip64_ext_data_in_cdir)) + return MZ_FALSE; + + /* A directory or zero length file */ + if ((file_stat.m_is_directory) || (!file_stat.m_uncomp_size)) + return MZ_TRUE; + + /* Encryption and patch files are not supported. */ + if (file_stat.m_is_encrypted) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); + + /* This function only supports stored and deflate. */ + if ((file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED)) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD); + + if (!file_stat.m_is_supported) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE); + + /* Read and parse the local directory entry. */ + local_header_ofs = file_stat.m_local_header_ofs; + if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + local_header_filename_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS); + local_header_extra_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + local_header_comp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS); + local_header_uncomp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS); + local_header_crc32 = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_CRC32_OFS); + local_header_bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS); + has_data_descriptor = (local_header_bit_flags & 8) != 0; + + if (local_header_filename_len != strlen(file_stat.m_filename)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if ((local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size) > pZip->m_archive_size) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE)) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + goto handle_failure; + } + + if (local_header_filename_len) + { + if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE, file_data_array.m_p, local_header_filename_len) != local_header_filename_len) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + goto handle_failure; + } + + /* I've seen 1 archive that had the same pathname, but used backslashes in the local dir and forward slashes in the central dir. Do we care about this? For now, this case will fail validation. */ + if (memcmp(file_stat.m_filename, file_data_array.m_p, local_header_filename_len) != 0) + { + mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED); + goto handle_failure; + } + } + + if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX))) + { + mz_uint32 extra_size_remaining = local_header_extra_len; + const mz_uint8 *pExtra_data = (const mz_uint8 *)file_data_array.m_p; + + if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len, file_data_array.m_p, local_header_extra_len) != local_header_extra_len) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + goto handle_failure; + } + + do + { + mz_uint32 field_id, field_data_size, field_total_size; + + if (extra_size_remaining < (sizeof(mz_uint16) * 2)) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + goto handle_failure; + } + + field_id = MZ_READ_LE16(pExtra_data); + field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16)); + field_total_size = field_data_size + sizeof(mz_uint16) * 2; + + if (field_total_size > extra_size_remaining) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + goto handle_failure; + } + + if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) + { + const mz_uint8 *pSrc_field_data = pExtra_data + sizeof(mz_uint32); + + if (field_data_size < sizeof(mz_uint64) * 2) + { + mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + goto handle_failure; + } + + local_header_uncomp_size = MZ_READ_LE64(pSrc_field_data); + local_header_comp_size = MZ_READ_LE64(pSrc_field_data + sizeof(mz_uint64)); + + found_zip64_ext_data_in_ldir = MZ_TRUE; + break; + } + + pExtra_data += field_total_size; + extra_size_remaining -= field_total_size; + } while (extra_size_remaining); + } + + /* TODO: parse local header extra data when local_header_comp_size is 0xFFFFFFFF! (big_descriptor.zip) */ + /* I've seen zips in the wild with the data descriptor bit set, but proper local header values and bogus data descriptors */ + if ((has_data_descriptor) && (!local_header_comp_size) && (!local_header_crc32)) + { + mz_uint8 descriptor_buf[32]; + mz_bool has_id; + const mz_uint8 *pSrc; + mz_uint32 file_crc32; + mz_uint64 comp_size = 0, uncomp_size = 0; + + mz_uint32 num_descriptor_uint32s = ((pState->m_zip64) || (found_zip64_ext_data_in_ldir)) ? 6 : 4; + + if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size, descriptor_buf, sizeof(mz_uint32) * num_descriptor_uint32s) != (sizeof(mz_uint32) * num_descriptor_uint32s)) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + goto handle_failure; + } + + has_id = (MZ_READ_LE32(descriptor_buf) == MZ_ZIP_DATA_DESCRIPTOR_ID); + pSrc = has_id ? (descriptor_buf + sizeof(mz_uint32)) : descriptor_buf; + + file_crc32 = MZ_READ_LE32(pSrc); + + if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir)) + { + comp_size = MZ_READ_LE64(pSrc + sizeof(mz_uint32)); + uncomp_size = MZ_READ_LE64(pSrc + sizeof(mz_uint32) + sizeof(mz_uint64)); + } + else + { + comp_size = MZ_READ_LE32(pSrc + sizeof(mz_uint32)); + uncomp_size = MZ_READ_LE32(pSrc + sizeof(mz_uint32) + sizeof(mz_uint32)); + } + + if ((file_crc32 != file_stat.m_crc32) || (comp_size != file_stat.m_comp_size) || (uncomp_size != file_stat.m_uncomp_size)) + { + mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED); + goto handle_failure; + } + } + else + { + if ((local_header_crc32 != file_stat.m_crc32) || (local_header_comp_size != file_stat.m_comp_size) || (local_header_uncomp_size != file_stat.m_uncomp_size)) + { + mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED); + goto handle_failure; + } + } + + mz_zip_array_clear(pZip, &file_data_array); + + if ((flags & MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY) == 0) + { + if (!mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_compute_crc32_callback, &uncomp_crc32, 0)) + return MZ_FALSE; + + /* 1 more check to be sure, although the extract checks too. */ + if (uncomp_crc32 != file_stat.m_crc32) + { + mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED); + return MZ_FALSE; + } + } + + return MZ_TRUE; + +handle_failure: + mz_zip_array_clear(pZip, &file_data_array); + return MZ_FALSE; +} + +mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags) +{ + mz_zip_internal_state *pState; + mz_uint32 i; + + if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState = pZip->m_pState; + + /* Basic sanity checks */ + if (!pState->m_zip64) + { + if (pZip->m_total_files > MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + + if (pZip->m_archive_size > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + } + else + { + if (pState->m_central_dir.m_size >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + } + + for (i = 0; i < pZip->m_total_files; i++) + { + if (MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG & flags) + { + mz_uint32 found_index; + mz_zip_archive_file_stat stat; + + if (!mz_zip_reader_file_stat(pZip, i, &stat)) + return MZ_FALSE; + + if (!mz_zip_reader_locate_file_v2(pZip, stat.m_filename, NULL, 0, &found_index)) + return MZ_FALSE; + + /* This check can fail if there are duplicate filenames in the archive (which we don't check for when writing - that's up to the user) */ + if (found_index != i) + return mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED); + } + + if (!mz_zip_validate_file(pZip, i, flags)) + return MZ_FALSE; + } + + return MZ_TRUE; +} + +mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr) +{ + mz_bool success = MZ_TRUE; + mz_zip_archive zip; + mz_zip_error actual_err = MZ_ZIP_NO_ERROR; + + if ((!pMem) || (!size)) + { + if (pErr) + *pErr = MZ_ZIP_INVALID_PARAMETER; + return MZ_FALSE; + } + + mz_zip_zero_struct(&zip); + + if (!mz_zip_reader_init_mem(&zip, pMem, size, flags)) + { + if (pErr) + *pErr = zip.m_last_error; + return MZ_FALSE; + } + + if (!mz_zip_validate_archive(&zip, flags)) + { + actual_err = zip.m_last_error; + success = MZ_FALSE; + } + + if (!mz_zip_reader_end_internal(&zip, success)) + { + if (!actual_err) + actual_err = zip.m_last_error; + success = MZ_FALSE; + } + + if (pErr) + *pErr = actual_err; + + return success; +} + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr) +{ + mz_bool success = MZ_TRUE; + mz_zip_archive zip; + mz_zip_error actual_err = MZ_ZIP_NO_ERROR; + + if (!pFilename) + { + if (pErr) + *pErr = MZ_ZIP_INVALID_PARAMETER; + return MZ_FALSE; + } + + mz_zip_zero_struct(&zip); + + if (!mz_zip_reader_init_file_v2(&zip, pFilename, flags, 0, 0)) + { + if (pErr) + *pErr = zip.m_last_error; + return MZ_FALSE; + } + + if (!mz_zip_validate_archive(&zip, flags)) + { + actual_err = zip.m_last_error; + success = MZ_FALSE; + } + + if (!mz_zip_reader_end_internal(&zip, success)) + { + if (!actual_err) + actual_err = zip.m_last_error; + success = MZ_FALSE; + } + + if (pErr) + *pErr = actual_err; + + return success; +} +#endif /* #ifndef MINIZ_NO_STDIO */ + +/* ------------------- .ZIP archive writing */ + +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +static MZ_FORCEINLINE void mz_write_le16(mz_uint8 *p, mz_uint16 v) +{ + p[0] = (mz_uint8)v; + p[1] = (mz_uint8)(v >> 8); +} +static MZ_FORCEINLINE void mz_write_le32(mz_uint8 *p, mz_uint32 v) +{ + p[0] = (mz_uint8)v; + p[1] = (mz_uint8)(v >> 8); + p[2] = (mz_uint8)(v >> 16); + p[3] = (mz_uint8)(v >> 24); +} +static MZ_FORCEINLINE void mz_write_le64(mz_uint8 *p, mz_uint64 v) +{ + mz_write_le32(p, (mz_uint32)v); + mz_write_le32(p + sizeof(mz_uint32), (mz_uint32)(v >> 32)); +} + +#define MZ_WRITE_LE16(p, v) mz_write_le16((mz_uint8 *)(p), (mz_uint16)(v)) +#define MZ_WRITE_LE32(p, v) mz_write_le32((mz_uint8 *)(p), (mz_uint32)(v)) +#define MZ_WRITE_LE64(p, v) mz_write_le64((mz_uint8 *)(p), (mz_uint64)(v)) + +static size_t mz_zip_heap_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + mz_zip_internal_state *pState = pZip->m_pState; + mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size); + + if (!n) + return 0; + + /* An allocation this big is likely to just fail on 32-bit systems, so don't even go there. */ + if ((sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF)) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE); + return 0; + } + + if (new_size > pState->m_mem_capacity) + { + void *pNew_block; + size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity); + + while (new_capacity < new_size) + new_capacity *= 2; + + if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity))) + { + mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + return 0; + } + + pState->m_pMem = pNew_block; + pState->m_mem_capacity = new_capacity; + } + memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n); + pState->m_mem_size = (size_t)new_size; + return n; +} + +static mz_bool mz_zip_writer_end_internal(mz_zip_archive *pZip, mz_bool set_last_error) +{ + mz_zip_internal_state *pState; + mz_bool status = MZ_TRUE; + + if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED))) + { + if (set_last_error) + mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + return MZ_FALSE; + } + + pState = pZip->m_pState; + pZip->m_pState = NULL; + mz_zip_array_clear(pZip, &pState->m_central_dir); + mz_zip_array_clear(pZip, &pState->m_central_dir_offsets); + mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets); + +#ifndef MINIZ_NO_STDIO + if (pState->m_pFile) + { + if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE) + { + if (MZ_FCLOSE(pState->m_pFile) == EOF) + { + if (set_last_error) + mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED); + status = MZ_FALSE; + } + } + + pState->m_pFile = NULL; + } +#endif /* #ifndef MINIZ_NO_STDIO */ + + if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem); + pState->m_pMem = NULL; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pState); + pZip->m_zip_mode = MZ_ZIP_MODE_INVALID; + return status; +} + +mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags) +{ + mz_bool zip64 = (flags & MZ_ZIP_FLAG_WRITE_ZIP64) != 0; + + if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) + { + if (!pZip->m_pRead) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + } + + if (pZip->m_file_offset_alignment) + { + /* Ensure user specified file offset alignment is a power of 2. */ + if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + } + + if (!pZip->m_pAlloc) + pZip->m_pAlloc = miniz_def_alloc_func; + if (!pZip->m_pFree) + pZip->m_pFree = miniz_def_free_func; + if (!pZip->m_pRealloc) + pZip->m_pRealloc = miniz_def_realloc_func; + + pZip->m_archive_size = existing_size; + pZip->m_central_directory_file_ofs = 0; + pZip->m_total_files = 0; + + if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state)))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state)); + + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32)); + MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32)); + + pZip->m_pState->m_zip64 = zip64; + pZip->m_pState->m_zip64_has_extended_info_fields = zip64; + + pZip->m_zip_type = MZ_ZIP_TYPE_USER; + pZip->m_zip_mode = MZ_ZIP_MODE_WRITING; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size) +{ + return mz_zip_writer_init_v2(pZip, existing_size, 0); +} + +mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags) +{ + pZip->m_pWrite = mz_zip_heap_write_func; + pZip->m_pNeeds_keepalive = NULL; + + if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) + pZip->m_pRead = mz_zip_mem_read_func; + + pZip->m_pIO_opaque = pZip; + + if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags)) + return MZ_FALSE; + + pZip->m_zip_type = MZ_ZIP_TYPE_HEAP; + + if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning))) + { + if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size))) + { + mz_zip_writer_end_internal(pZip, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + pZip->m_pState->m_mem_capacity = initial_allocation_size; + } + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size) +{ + return mz_zip_writer_init_heap_v2(pZip, size_to_reserve_at_beginning, initial_allocation_size, 0); +} + +#ifndef MINIZ_NO_STDIO +static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n) +{ + mz_zip_archive *pZip = (mz_zip_archive *)pOpaque; + mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); + + file_ofs += pZip->m_pState->m_file_archive_start_ofs; + + if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET)))) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED); + return 0; + } + + return MZ_FWRITE(pBuf, 1, n, pZip->m_pState->m_pFile); +} + +mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning) +{ + return mz_zip_writer_init_file_v2(pZip, pFilename, size_to_reserve_at_beginning, 0); +} + +mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags) +{ + MZ_FILE *pFile; + + pZip->m_pWrite = mz_zip_file_write_func; + pZip->m_pNeeds_keepalive = NULL; + + if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) + pZip->m_pRead = mz_zip_file_read_func; + + pZip->m_pIO_opaque = pZip; + + if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags)) + return MZ_FALSE; + + if (NULL == (pFile = MZ_FOPEN(pFilename, (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) ? "w+b" : "wb"))) + { + mz_zip_writer_end(pZip); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED); + } + + pZip->m_pState->m_pFile = pFile; + pZip->m_zip_type = MZ_ZIP_TYPE_FILE; + + if (size_to_reserve_at_beginning) + { + mz_uint64 cur_ofs = 0; + char buf[4096]; + + MZ_CLEAR_ARR(buf); + + do + { + size_t n = (size_t)MZ_MIN(sizeof(buf), size_to_reserve_at_beginning); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n) + { + mz_zip_writer_end(pZip); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + cur_ofs += n; + size_to_reserve_at_beginning -= n; + } while (size_to_reserve_at_beginning); + } + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint flags) +{ + pZip->m_pWrite = mz_zip_file_write_func; + pZip->m_pNeeds_keepalive = NULL; + + if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) + pZip->m_pRead = mz_zip_file_read_func; + + pZip->m_pIO_opaque = pZip; + + if (!mz_zip_writer_init_v2(pZip, 0, flags)) + return MZ_FALSE; + + pZip->m_pState->m_pFile = pFile; + pZip->m_pState->m_file_archive_start_ofs = MZ_FTELL64(pZip->m_pState->m_pFile); + pZip->m_zip_type = MZ_ZIP_TYPE_CFILE; + + return MZ_TRUE; +} +#endif /* #ifndef MINIZ_NO_STDIO */ + +mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags) +{ + mz_zip_internal_state *pState; + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (flags & MZ_ZIP_FLAG_WRITE_ZIP64) + { + /* We don't support converting a non-zip64 file to zip64 - this seems like more trouble than it's worth. (What about the existing 32-bit data descriptors that could follow the compressed data?) */ + if (!pZip->m_pState->m_zip64) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + } + + /* No sense in trying to write to an archive that's already at the support max size */ + if (pZip->m_pState->m_zip64) + { + if (pZip->m_total_files == MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + else + { + if (pZip->m_total_files == MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + + if ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE); + } + + pState = pZip->m_pState; + + if (pState->m_pFile) + { +#ifdef MINIZ_NO_STDIO + (void)pFilename; + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); +#else + if (pZip->m_pIO_opaque != pZip) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE) + { + if (!pFilename) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + /* Archive is being read from stdio and was originally opened only for reading. Try to reopen as writable. */ + if (NULL == (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile))) + { + /* The mz_zip_archive is now in a bogus state because pState->m_pFile is NULL, so just close it. */ + mz_zip_reader_end_internal(pZip, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED); + } + } + + pZip->m_pWrite = mz_zip_file_write_func; + pZip->m_pNeeds_keepalive = NULL; +#endif /* #ifdef MINIZ_NO_STDIO */ + } + else if (pState->m_pMem) + { + /* Archive lives in a memory block. Assume it's from the heap that we can resize using the realloc callback. */ + if (pZip->m_pIO_opaque != pZip) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState->m_mem_capacity = pState->m_mem_size; + pZip->m_pWrite = mz_zip_heap_write_func; + pZip->m_pNeeds_keepalive = NULL; + } + /* Archive is being read via a user provided read function - make sure the user has specified a write function too. */ + else if (!pZip->m_pWrite) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + /* Start writing new files at the archive's current central directory location. */ + /* TODO: We could add a flag that lets the user start writing immediately AFTER the existing central dir - this would be safer. */ + pZip->m_archive_size = pZip->m_central_directory_file_ofs; + pZip->m_central_directory_file_ofs = 0; + + /* Clear the sorted central dir offsets, they aren't useful or maintained now. */ + /* Even though we're now in write mode, files can still be extracted and verified, but file locates will be slow. */ + /* TODO: We could easily maintain the sorted central directory offsets. */ + mz_zip_array_clear(pZip, &pZip->m_pState->m_sorted_central_dir_offsets); + + pZip->m_zip_mode = MZ_ZIP_MODE_WRITING; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename) +{ + return mz_zip_writer_init_from_reader_v2(pZip, pFilename, 0); +} + +/* TODO: pArchive_name is a terrible name here! */ +mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags) +{ + return mz_zip_writer_add_mem_ex(pZip, pArchive_name, pBuf, buf_size, NULL, 0, level_and_flags, 0, 0); +} + +typedef struct +{ + mz_zip_archive *m_pZip; + mz_uint64 m_cur_archive_file_ofs; + mz_uint64 m_comp_size; +} mz_zip_writer_add_state; + +static mz_bool mz_zip_writer_add_put_buf_callback(const void *pBuf, int len, void *pUser) +{ + mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser; + if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len) + return MZ_FALSE; + + pState->m_cur_archive_file_ofs += len; + pState->m_comp_size += len; + return MZ_TRUE; +} + +#define MZ_ZIP64_MAX_LOCAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 2) +#define MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 3) +static mz_uint32 mz_zip_writer_create_zip64_extra_data(mz_uint8 *pBuf, mz_uint64 *pUncomp_size, mz_uint64 *pComp_size, mz_uint64 *pLocal_header_ofs) +{ + mz_uint8 *pDst = pBuf; + mz_uint32 field_size = 0; + + MZ_WRITE_LE16(pDst + 0, MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID); + MZ_WRITE_LE16(pDst + 2, 0); + pDst += sizeof(mz_uint16) * 2; + + if (pUncomp_size) + { + MZ_WRITE_LE64(pDst, *pUncomp_size); + pDst += sizeof(mz_uint64); + field_size += sizeof(mz_uint64); + } + + if (pComp_size) + { + MZ_WRITE_LE64(pDst, *pComp_size); + pDst += sizeof(mz_uint64); + field_size += sizeof(mz_uint64); + } + + if (pLocal_header_ofs) + { + MZ_WRITE_LE64(pDst, *pLocal_header_ofs); + pDst += sizeof(mz_uint64); + field_size += sizeof(mz_uint64); + } + + MZ_WRITE_LE16(pBuf + 2, field_size); + + return (mz_uint32)(pDst - pBuf); +} + +static mz_bool mz_zip_writer_create_local_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date) +{ + (void)pZip; + memset(pDst, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_SIG_OFS, MZ_ZIP_LOCAL_DIR_HEADER_SIG); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_BIT_FLAG_OFS, bit_flags); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_METHOD_OFS, method); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_TIME_OFS, dos_time); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_DATE_OFS, dos_date); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_CRC32_OFS, uncomp_crc32); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX)); + MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX)); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILENAME_LEN_OFS, filename_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_EXTRA_LEN_OFS, extra_size); + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_create_central_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, + mz_uint16 filename_size, mz_uint16 extra_size, mz_uint16 comment_size, + mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, + mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, + mz_uint64 local_header_ofs, mz_uint32 ext_attributes) +{ + (void)pZip; + memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_DATE_OFS, dos_date); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_CRC32_OFS, uncomp_crc32); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX)); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX)); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILENAME_LEN_OFS, filename_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_EXTRA_LEN_OFS, extra_size); + MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_COMMENT_LEN_OFS, comment_size); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS, ext_attributes); + MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_MIN(local_header_ofs, MZ_UINT32_MAX)); + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_add_to_central_dir(mz_zip_archive *pZip, const char *pFilename, mz_uint16 filename_size, + const void *pExtra, mz_uint16 extra_size, const void *pComment, mz_uint16 comment_size, + mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, + mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date, + mz_uint64 local_header_ofs, mz_uint32 ext_attributes, + const char *user_extra_data, mz_uint user_extra_data_len) +{ + mz_zip_internal_state *pState = pZip->m_pState; + mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size; + size_t orig_central_dir_size = pState->m_central_dir.m_size; + mz_uint8 central_dir_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE]; + + if (!pZip->m_pState->m_zip64) + { + if (local_header_ofs > 0xFFFFFFFF) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE); + } + + /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */ + if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + extra_size + user_extra_data_len + comment_size) >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); + + if (!mz_zip_writer_create_central_dir_header(pZip, central_dir_header, filename_size, (mz_uint16)(extra_size + user_extra_data_len), comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_header_ofs, ext_attributes)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, user_extra_data, user_extra_data_len)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) || + (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, ¢ral_dir_ofs, 1))) + { + /* Try to resize the central directory array back into its original state. */ + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + return MZ_TRUE; +} + +static mz_bool mz_zip_writer_validate_archive_name(const char *pArchive_name) +{ + /* Basic ZIP archive filename validity checks: Valid filenames cannot start with a forward slash, cannot contain a drive letter, and cannot use DOS-style backward slashes. */ + if (*pArchive_name == '/') + return MZ_FALSE; + + /* Making sure the name does not contain drive letters or DOS style backward slashes is the responsibility of the program using miniz*/ + + return MZ_TRUE; +} + +static mz_uint mz_zip_writer_compute_padding_needed_for_file_alignment(mz_zip_archive *pZip) +{ + mz_uint32 n; + if (!pZip->m_file_offset_alignment) + return 0; + n = (mz_uint32)(pZip->m_archive_size & (pZip->m_file_offset_alignment - 1)); + return (mz_uint)((pZip->m_file_offset_alignment - n) & (pZip->m_file_offset_alignment - 1)); +} + +static mz_bool mz_zip_writer_write_zeros(mz_zip_archive *pZip, mz_uint64 cur_file_ofs, mz_uint32 n) +{ + char buf[4096]; + memset(buf, 0, MZ_MIN(sizeof(buf), n)); + while (n) + { + mz_uint32 s = MZ_MIN(sizeof(buf), n); + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_file_ofs += s; + n -= s; + } + return MZ_TRUE; +} + +mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + mz_uint64 uncomp_size, mz_uint32 uncomp_crc32) +{ + return mz_zip_writer_add_mem_ex_v2(pZip, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, uncomp_size, uncomp_crc32, NULL, NULL, 0, NULL, 0); +} + +mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, + mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, + const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len) +{ + mz_uint16 method = 0, dos_time = 0, dos_date = 0; + mz_uint level, ext_attributes = 0, num_alignment_padding_bytes; + mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, comp_size = 0; + size_t archive_name_size; + mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; + tdefl_compressor *pComp = NULL; + mz_bool store_data_uncompressed; + mz_zip_internal_state *pState; + mz_uint8 *pExtra_data = NULL; + mz_uint32 extra_size = 0; + mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; + mz_uint16 bit_flags = 0; + + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + + if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))) + bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; + + if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME)) + bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; + + level = level_and_flags & 0xF; + store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)); + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState = pZip->m_pState; + + if (pState->m_zip64) + { + if (pZip->m_total_files == MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + else + { + if (pZip->m_total_files == MZ_UINT16_MAX) + { + pState->m_zip64 = MZ_TRUE; + /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */ + } + if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF)) + { + pState->m_zip64 = MZ_TRUE; + /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ + } + } + + if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (!mz_zip_writer_validate_archive_name(pArchive_name)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME); + +#ifndef MINIZ_NO_TIME + if (last_modified != NULL) + { + mz_zip_time_t_to_dos_time(*last_modified, &dos_time, &dos_date); + } + else + { + MZ_TIME_T cur_time; + time(&cur_time); + mz_zip_time_t_to_dos_time(cur_time, &dos_time, &dos_date); + } +#endif /* #ifndef MINIZ_NO_TIME */ + + if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + { + uncomp_crc32 = (mz_uint32)mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, buf_size); + uncomp_size = buf_size; + if (uncomp_size <= 3) + { + level = 0; + store_data_uncompressed = MZ_TRUE; + } + } + + archive_name_size = strlen(pArchive_name); + if (archive_name_size > MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME); + + num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); + + /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */ + if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); + + if (!pState->m_zip64) + { + /* Bail early if the archive would obviously become too large */ + if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + user_extra_data_len + + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + user_extra_data_central_len + + MZ_ZIP_DATA_DESCRIPTER_SIZE32) > 0xFFFFFFFF) + { + pState->m_zip64 = MZ_TRUE; + /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ + } + } + + if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/')) + { + /* Set DOS Subdirectory attribute bit. */ + ext_attributes |= MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG; + + /* Subdirectories cannot contain data. */ + if ((buf_size) || (uncomp_size)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + } + + /* Try to do any allocations before writing to the archive, so if an allocation fails the file remains unmodified. (A good idea if we're doing an in-place modification.) */ + if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + (pState->m_zip64 ? MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE : 0))) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + if ((!store_data_uncompressed) && (buf_size)) + { + if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor)))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return MZ_FALSE; + } + + local_dir_header_ofs += num_alignment_padding_bytes; + if (pZip->m_file_offset_alignment) + { + MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); + } + cur_archive_file_ofs += num_alignment_padding_bytes; + + MZ_CLEAR_ARR(local_dir_header); + + if (!store_data_uncompressed || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) + { + method = MZ_DEFLATED; + } + + if (pState->m_zip64) + { + if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX) + { + pExtra_data = extra_data; + extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL, + (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); + } + + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), 0, 0, 0, method, bit_flags, dos_time, dos_date)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += sizeof(local_dir_header); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + cur_archive_file_ofs += archive_name_size; + + if (pExtra_data != NULL) + { + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += extra_size; + } + } + else + { + if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX)) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)user_extra_data_len, 0, 0, 0, method, bit_flags, dos_time, dos_date)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += sizeof(local_dir_header); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + cur_archive_file_ofs += archive_name_size; + } + + if (user_extra_data_len > 0) + { + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += user_extra_data_len; + } + + if (store_data_uncompressed) + { + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + + cur_archive_file_ofs += buf_size; + comp_size = buf_size; + } + else if (buf_size) + { + mz_zip_writer_add_state state; + + state.m_pZip = pZip; + state.m_cur_archive_file_ofs = cur_archive_file_ofs; + state.m_comp_size = 0; + + if ((tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) || + (tdefl_compress_buffer(pComp, pBuf, buf_size, TDEFL_FINISH) != TDEFL_STATUS_DONE)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + return mz_zip_set_error(pZip, MZ_ZIP_COMPRESSION_FAILED); + } + + comp_size = state.m_comp_size; + cur_archive_file_ofs = state.m_cur_archive_file_ofs; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + pComp = NULL; + + if (uncomp_size) + { + mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64]; + mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32; + + MZ_ASSERT(bit_flags & MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR); + + MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID); + MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32); + if (pExtra_data == NULL) + { + if (comp_size > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + + MZ_WRITE_LE32(local_dir_footer + 8, comp_size); + MZ_WRITE_LE32(local_dir_footer + 12, uncomp_size); + } + else + { + MZ_WRITE_LE64(local_dir_footer + 8, comp_size); + MZ_WRITE_LE64(local_dir_footer + 16, uncomp_size); + local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE64; + } + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size) + return MZ_FALSE; + + cur_archive_file_ofs += local_dir_footer_size; + } + + if (pExtra_data != NULL) + { + extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL, + (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); + } + + if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, (mz_uint16)extra_size, pComment, + comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_dir_header_ofs, ext_attributes, + user_extra_data_central, user_extra_data_central_len)) + return MZ_FALSE; + + pZip->m_total_files++; + pZip->m_archive_size = cur_archive_file_ofs; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_add_read_buf_callback(mz_zip_archive *pZip, const char *pArchive_name, mz_file_read_func read_callback, void* callback_opaque, mz_uint64 max_size, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len) +{ + mz_uint16 gen_flags; + mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes; + mz_uint16 method = 0, dos_time = 0, dos_date = 0, ext_attributes = 0; + mz_uint64 local_dir_header_ofs, cur_archive_file_ofs = pZip->m_archive_size, uncomp_size = 0, comp_size = 0; + size_t archive_name_size; + mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE]; + mz_uint8 *pExtra_data = NULL; + mz_uint32 extra_size = 0; + mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE]; + mz_zip_internal_state *pState; + mz_uint64 file_ofs = 0, cur_archive_header_file_ofs; + + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + level = level_and_flags & 0xF; + + gen_flags = (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE) ? 0 : MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR; + + if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME)) + gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8; + + /* Sanity checks */ + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState = pZip->m_pState; + + if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX)) + { + /* Source file is too large for non-zip64 */ + /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ + pState->m_zip64 = MZ_TRUE; + } + + /* We could support this, but why? */ + if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (!mz_zip_writer_validate_archive_name(pArchive_name)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME); + + if (pState->m_zip64) + { + if (pZip->m_total_files == MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + else + { + if (pZip->m_total_files == MZ_UINT16_MAX) + { + pState->m_zip64 = MZ_TRUE; + /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */ + } + } + + archive_name_size = strlen(pArchive_name); + if (archive_name_size > MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME); + + num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); + + /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */ + if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); + + if (!pState->m_zip64) + { + /* Bail early if the archive would obviously become too large */ + if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + + archive_name_size + comment_size + user_extra_data_len + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 1024 + + MZ_ZIP_DATA_DESCRIPTER_SIZE32 + user_extra_data_central_len) > 0xFFFFFFFF) + { + pState->m_zip64 = MZ_TRUE; + /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */ + } + } + +#ifndef MINIZ_NO_TIME + if (pFile_time) + { + mz_zip_time_t_to_dos_time(*pFile_time, &dos_time, &dos_date); + } +#endif + + if (max_size <= 3) + level = 0; + + if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes)) + { + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + + cur_archive_file_ofs += num_alignment_padding_bytes; + local_dir_header_ofs = cur_archive_file_ofs; + + if (pZip->m_file_offset_alignment) + { + MZ_ASSERT((cur_archive_file_ofs & (pZip->m_file_offset_alignment - 1)) == 0); + } + + if (max_size && level) + { + method = MZ_DEFLATED; + } + + MZ_CLEAR_ARR(local_dir_header); + if (pState->m_zip64) + { + if (max_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX) + { + pExtra_data = extra_data; + if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE) + extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL, + (max_size >= MZ_UINT32_MAX) ? &comp_size : NULL, + (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); + else + extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, NULL, + NULL, + (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); + } + + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), 0, 0, 0, method, gen_flags, dos_time, dos_date)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += sizeof(local_dir_header); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + + cur_archive_file_ofs += archive_name_size; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += extra_size; + } + else + { + if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX)) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += sizeof(local_dir_header); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + + cur_archive_file_ofs += archive_name_size; + } + + if (user_extra_data_len > 0) + { + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_file_ofs += user_extra_data_len; + } + + if (max_size) + { + void *pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, MZ_ZIP_MAX_IO_BUF_SIZE); + if (!pRead_buf) + { + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (!level) + { + while (1) + { + size_t n = read_callback(callback_opaque, file_ofs, pRead_buf, MZ_ZIP_MAX_IO_BUF_SIZE); + if (n == 0) + break; + + if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + } + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + file_ofs += n; + uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n); + cur_archive_file_ofs += n; + } + uncomp_size = file_ofs; + comp_size = uncomp_size; + } + else + { + mz_bool result = MZ_FALSE; + mz_zip_writer_add_state state; + tdefl_compressor *pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor)); + if (!pComp) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + state.m_pZip = pZip; + state.m_cur_archive_file_ofs = cur_archive_file_ofs; + state.m_comp_size = 0; + + if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + } + + for (;;) + { + tdefl_status status; + tdefl_flush flush = TDEFL_NO_FLUSH; + + size_t n = read_callback(callback_opaque, file_ofs, pRead_buf, MZ_ZIP_MAX_IO_BUF_SIZE); + if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size)) + { + mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + break; + } + + file_ofs += n; + uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n); + + if (pZip->m_pNeeds_keepalive != NULL && pZip->m_pNeeds_keepalive(pZip->m_pIO_opaque)) + flush = TDEFL_FULL_FLUSH; + + if (n == 0) + flush = TDEFL_FINISH; + + status = tdefl_compress_buffer(pComp, pRead_buf, n, flush); + if (status == TDEFL_STATUS_DONE) + { + result = MZ_TRUE; + break; + } + else if (status != TDEFL_STATUS_OKAY) + { + mz_zip_set_error(pZip, MZ_ZIP_COMPRESSION_FAILED); + break; + } + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pComp); + + if (!result) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + return MZ_FALSE; + } + + uncomp_size = file_ofs; + comp_size = state.m_comp_size; + cur_archive_file_ofs = state.m_cur_archive_file_ofs; + } + + pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf); + } + + if (!(level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)) + { + mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64]; + mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32; + + MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID); + MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32); + if (pExtra_data == NULL) + { + if (comp_size > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + + MZ_WRITE_LE32(local_dir_footer + 8, comp_size); + MZ_WRITE_LE32(local_dir_footer + 12, uncomp_size); + } + else + { + MZ_WRITE_LE64(local_dir_footer + 8, comp_size); + MZ_WRITE_LE64(local_dir_footer + 16, uncomp_size); + local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE64; + } + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size) + return MZ_FALSE; + + cur_archive_file_ofs += local_dir_footer_size; + } + + if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE) + { + if (pExtra_data != NULL) + { + extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL, + (max_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); + } + + if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, + (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), + (max_size >= MZ_UINT32_MAX) ? MZ_UINT32_MAX : uncomp_size, + (max_size >= MZ_UINT32_MAX) ? MZ_UINT32_MAX : comp_size, + uncomp_crc32, method, gen_flags, dos_time, dos_date)) + return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR); + + cur_archive_header_file_ofs = local_dir_header_ofs; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + if (pExtra_data != NULL) + { + cur_archive_header_file_ofs += sizeof(local_dir_header); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, pArchive_name, archive_name_size) != archive_name_size) + { + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + + cur_archive_header_file_ofs += archive_name_size; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, extra_data, extra_size) != extra_size) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_archive_header_file_ofs += extra_size; + } + } + + if (pExtra_data != NULL) + { + extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL, + (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL); + } + + if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, (mz_uint16)extra_size, pComment, comment_size, + uncomp_size, comp_size, uncomp_crc32, method, gen_flags, dos_time, dos_date, local_dir_header_ofs, ext_attributes, + user_extra_data_central, user_extra_data_central_len)) + return MZ_FALSE; + + pZip->m_total_files++; + pZip->m_archive_size = cur_archive_file_ofs; + + return MZ_TRUE; +} + +#ifndef MINIZ_NO_STDIO + +static size_t mz_file_read_func_stdio(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n) +{ + MZ_FILE *pSrc_file = (MZ_FILE *)pOpaque; + mz_int64 cur_ofs = MZ_FTELL64(pSrc_file); + + if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pSrc_file, (mz_int64)file_ofs, SEEK_SET)))) + return 0; + + return MZ_FREAD(pBuf, 1, n, pSrc_file); +} + +mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 max_size, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len) +{ + return mz_zip_writer_add_read_buf_callback(pZip, pArchive_name, mz_file_read_func_stdio, pSrc_file, max_size, pFile_time, pComment, comment_size, level_and_flags, + user_extra_data, user_extra_data_len, user_extra_data_central, user_extra_data_central_len); +} + +mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags) +{ + MZ_FILE *pSrc_file = NULL; + mz_uint64 uncomp_size = 0; + MZ_TIME_T file_modified_time; + MZ_TIME_T *pFile_time = NULL; + mz_bool status; + + memset(&file_modified_time, 0, sizeof(file_modified_time)); + +#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_STDIO) + pFile_time = &file_modified_time; + if (!mz_zip_get_file_modified_time(pSrc_filename, &file_modified_time)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_STAT_FAILED); +#endif + + pSrc_file = MZ_FOPEN(pSrc_filename, "rb"); + if (!pSrc_file) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED); + + MZ_FSEEK64(pSrc_file, 0, SEEK_END); + uncomp_size = MZ_FTELL64(pSrc_file); + MZ_FSEEK64(pSrc_file, 0, SEEK_SET); + + status = mz_zip_writer_add_cfile(pZip, pArchive_name, pSrc_file, uncomp_size, pFile_time, pComment, comment_size, level_and_flags, NULL, 0, NULL, 0); + + MZ_FCLOSE(pSrc_file); + + return status; +} +#endif /* #ifndef MINIZ_NO_STDIO */ + +static mz_bool mz_zip_writer_update_zip64_extension_block(mz_zip_array *pNew_ext, mz_zip_archive *pZip, const mz_uint8 *pExt, mz_uint32 ext_len, mz_uint64 *pComp_size, mz_uint64 *pUncomp_size, mz_uint64 *pLocal_header_ofs, mz_uint32 *pDisk_start) +{ + /* + 64 should be enough for any new zip64 data */ + if (!mz_zip_array_reserve(pZip, pNew_ext, ext_len + 64, MZ_FALSE)) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + mz_zip_array_resize(pZip, pNew_ext, 0, MZ_FALSE); + + if ((pUncomp_size) || (pComp_size) || (pLocal_header_ofs) || (pDisk_start)) + { + mz_uint8 new_ext_block[64]; + mz_uint8 *pDst = new_ext_block; + mz_write_le16(pDst, MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID); + mz_write_le16(pDst + sizeof(mz_uint16), 0); + pDst += sizeof(mz_uint16) * 2; + + if (pUncomp_size) + { + mz_write_le64(pDst, *pUncomp_size); + pDst += sizeof(mz_uint64); + } + + if (pComp_size) + { + mz_write_le64(pDst, *pComp_size); + pDst += sizeof(mz_uint64); + } + + if (pLocal_header_ofs) + { + mz_write_le64(pDst, *pLocal_header_ofs); + pDst += sizeof(mz_uint64); + } + + if (pDisk_start) + { + mz_write_le32(pDst, *pDisk_start); + pDst += sizeof(mz_uint32); + } + + mz_write_le16(new_ext_block + sizeof(mz_uint16), (mz_uint16)((pDst - new_ext_block) - sizeof(mz_uint16) * 2)); + + if (!mz_zip_array_push_back(pZip, pNew_ext, new_ext_block, pDst - new_ext_block)) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if ((pExt) && (ext_len)) + { + mz_uint32 extra_size_remaining = ext_len; + const mz_uint8 *pExtra_data = pExt; + + do + { + mz_uint32 field_id, field_data_size, field_total_size; + + if (extra_size_remaining < (sizeof(mz_uint16) * 2)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + field_id = MZ_READ_LE16(pExtra_data); + field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16)); + field_total_size = field_data_size + sizeof(mz_uint16) * 2; + + if (field_total_size > extra_size_remaining) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + if (field_id != MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) + { + if (!mz_zip_array_push_back(pZip, pNew_ext, pExtra_data, field_total_size)) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + pExtra_data += field_total_size; + extra_size_remaining -= field_total_size; + } while (extra_size_remaining); + } + + return MZ_TRUE; +} + +/* TODO: This func is now pretty freakin complex due to zip64, split it up? */ +mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index) +{ + mz_uint n, bit_flags, num_alignment_padding_bytes, src_central_dir_following_data_size; + mz_uint64 src_archive_bytes_remaining, local_dir_header_ofs; + mz_uint64 cur_src_file_ofs, cur_dst_file_ofs; + mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)]; + mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32; + mz_uint8 new_central_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE]; + size_t orig_central_dir_size; + mz_zip_internal_state *pState; + void *pBuf; + const mz_uint8 *pSrc_central_header; + mz_zip_archive_file_stat src_file_stat; + mz_uint32 src_filename_len, src_comment_len, src_ext_len; + mz_uint32 local_header_filename_size, local_header_extra_len; + mz_uint64 local_header_comp_size, local_header_uncomp_size; + mz_bool found_zip64_ext_data_in_ldir = MZ_FALSE; + + /* Sanity checks */ + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pSource_zip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState = pZip->m_pState; + + /* Don't support copying files from zip64 archives to non-zip64, even though in some cases this is possible */ + if ((pSource_zip->m_pState->m_zip64) && (!pZip->m_pState->m_zip64)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + /* Get pointer to the source central dir header and crack it */ + if (NULL == (pSrc_central_header = mz_zip_get_cdh(pSource_zip, src_file_index))) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_SIG_OFS) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + src_filename_len = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_FILENAME_LEN_OFS); + src_comment_len = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_COMMENT_LEN_OFS); + src_ext_len = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS); + src_central_dir_following_data_size = src_filename_len + src_ext_len + src_comment_len; + + /* TODO: We don't support central dir's >= MZ_UINT32_MAX bytes right now (+32 fudge factor in case we need to add more extra data) */ + if ((pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_central_dir_following_data_size + 32) >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); + + num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip); + + if (!pState->m_zip64) + { + if (pZip->m_total_files == MZ_UINT16_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + else + { + /* TODO: Our zip64 support still has some 32-bit limits that may not be worth fixing. */ + if (pZip->m_total_files == MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + + if (!mz_zip_file_stat_internal(pSource_zip, src_file_index, pSrc_central_header, &src_file_stat, NULL)) + return MZ_FALSE; + + cur_src_file_ofs = src_file_stat.m_local_header_ofs; + cur_dst_file_ofs = pZip->m_archive_size; + + /* Read the source archive's local dir header */ + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + + if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + + cur_src_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE; + + /* Compute the total size we need to copy (filename+extra data+compressed data) */ + local_header_filename_size = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS); + local_header_extra_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS); + local_header_comp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS); + local_header_uncomp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS); + src_archive_bytes_remaining = local_header_filename_size + local_header_extra_len + src_file_stat.m_comp_size; + + /* Try to find a zip64 extended information field */ + if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX))) + { + mz_zip_array file_data_array; + const mz_uint8 *pExtra_data; + mz_uint32 extra_size_remaining = local_header_extra_len; + + mz_zip_array_init(&file_data_array, 1); + if (!mz_zip_array_resize(pZip, &file_data_array, local_header_extra_len, MZ_FALSE)) + { + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, src_file_stat.m_local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_size, file_data_array.m_p, local_header_extra_len) != local_header_extra_len) + { + mz_zip_array_clear(pZip, &file_data_array); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + } + + pExtra_data = (const mz_uint8 *)file_data_array.m_p; + + do + { + mz_uint32 field_id, field_data_size, field_total_size; + + if (extra_size_remaining < (sizeof(mz_uint16) * 2)) + { + mz_zip_array_clear(pZip, &file_data_array); + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + field_id = MZ_READ_LE16(pExtra_data); + field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16)); + field_total_size = field_data_size + sizeof(mz_uint16) * 2; + + if (field_total_size > extra_size_remaining) + { + mz_zip_array_clear(pZip, &file_data_array); + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) + { + const mz_uint8 *pSrc_field_data = pExtra_data + sizeof(mz_uint32); + + if (field_data_size < sizeof(mz_uint64) * 2) + { + mz_zip_array_clear(pZip, &file_data_array); + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); + } + + local_header_uncomp_size = MZ_READ_LE64(pSrc_field_data); + local_header_comp_size = MZ_READ_LE64(pSrc_field_data + sizeof(mz_uint64)); /* may be 0 if there's a descriptor */ + + found_zip64_ext_data_in_ldir = MZ_TRUE; + break; + } + + pExtra_data += field_total_size; + extra_size_remaining -= field_total_size; + } while (extra_size_remaining); + + mz_zip_array_clear(pZip, &file_data_array); + } + + if (!pState->m_zip64) + { + /* Try to detect if the new archive will most likely wind up too big and bail early (+(sizeof(mz_uint32) * 4) is for the optional descriptor which could be present, +64 is a fudge factor). */ + /* We also check when the archive is finalized so this doesn't need to be perfect. */ + mz_uint64 approx_new_archive_size = cur_dst_file_ofs + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + src_archive_bytes_remaining + (sizeof(mz_uint32) * 4) + + pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_central_dir_following_data_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 64; + + if (approx_new_archive_size >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + } + + /* Write dest archive padding */ + if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes)) + return MZ_FALSE; + + cur_dst_file_ofs += num_alignment_padding_bytes; + + local_dir_header_ofs = cur_dst_file_ofs; + if (pZip->m_file_offset_alignment) + { + MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0); + } + + /* The original zip's local header+ext block doesn't change, even with zip64, so we can just copy it over to the dest zip */ + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + cur_dst_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE; + + /* Copy over the source archive bytes to the dest archive, also ensure we have enough buf space to handle optional data descriptor */ + if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)MZ_MAX(32U, MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining))))) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + while (src_archive_bytes_remaining) + { + n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining); + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + } + cur_src_file_ofs += n; + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + cur_dst_file_ofs += n; + + src_archive_bytes_remaining -= n; + } + + /* Now deal with the optional data descriptor */ + bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS); + if (bit_flags & 8) + { + /* Copy data descriptor */ + if ((pSource_zip->m_pState->m_zip64) || (found_zip64_ext_data_in_ldir)) + { + /* src is zip64, dest must be zip64 */ + + /* name uint32_t's */ + /* id 1 (optional in zip64?) */ + /* crc 1 */ + /* comp_size 2 */ + /* uncomp_size 2 */ + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, (sizeof(mz_uint32) * 6)) != (sizeof(mz_uint32) * 6)) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + } + + n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID) ? 6 : 5); + } + else + { + /* src is NOT zip64 */ + mz_bool has_id; + + if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, sizeof(mz_uint32) * 4) != sizeof(mz_uint32) * 4) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); + } + + has_id = (MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID); + + if (pZip->m_pState->m_zip64) + { + /* dest is zip64, so upgrade the data descriptor */ + const mz_uint8 *pSrc_descriptor = (const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0); + const mz_uint32 src_crc32 = MZ_READ_LE32(pSrc_descriptor); + const mz_uint64 src_comp_size = MZ_READ_LE32(pSrc_descriptor + sizeof(mz_uint32)); + const mz_uint64 src_uncomp_size = MZ_READ_LE32(pSrc_descriptor + 2*sizeof(mz_uint32)); + + mz_write_le32((mz_uint8 *)pBuf, MZ_ZIP_DATA_DESCRIPTOR_ID); + mz_write_le32((mz_uint8 *)pBuf + sizeof(mz_uint32) * 1, src_crc32); + mz_write_le64((mz_uint8 *)pBuf + sizeof(mz_uint32) * 2, src_comp_size); + mz_write_le64((mz_uint8 *)pBuf + sizeof(mz_uint32) * 4, src_uncomp_size); + + n = sizeof(mz_uint32) * 6; + } + else + { + /* dest is NOT zip64, just copy it as-is */ + n = sizeof(mz_uint32) * (has_id ? 4 : 3); + } + } + + if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n) + { + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + } + + cur_src_file_ofs += n; + cur_dst_file_ofs += n; + } + pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf); + + /* Finally, add the new central dir header */ + orig_central_dir_size = pState->m_central_dir.m_size; + + memcpy(new_central_header, pSrc_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE); + + if (pState->m_zip64) + { + /* This is the painful part: We need to write a new central dir header + ext block with updated zip64 fields, and ensure the old fields (if any) are not included. */ + const mz_uint8 *pSrc_ext = pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_filename_len; + mz_zip_array new_ext_block; + + mz_zip_array_init(&new_ext_block, sizeof(mz_uint8)); + + MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_UINT32_MAX); + MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_UINT32_MAX); + MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_UINT32_MAX); + + if (!mz_zip_writer_update_zip64_extension_block(&new_ext_block, pZip, pSrc_ext, src_ext_len, &src_file_stat.m_comp_size, &src_file_stat.m_uncomp_size, &local_dir_header_ofs, NULL)) + { + mz_zip_array_clear(pZip, &new_ext_block); + return MZ_FALSE; + } + + MZ_WRITE_LE16(new_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS, new_ext_block.m_size); + + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) + { + mz_zip_array_clear(pZip, &new_ext_block); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, src_filename_len)) + { + mz_zip_array_clear(pZip, &new_ext_block); + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_ext_block.m_p, new_ext_block.m_size)) + { + mz_zip_array_clear(pZip, &new_ext_block); + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_filename_len + src_ext_len, src_comment_len)) + { + mz_zip_array_clear(pZip, &new_ext_block); + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + mz_zip_array_clear(pZip, &new_ext_block); + } + else + { + /* sanity checks */ + if (cur_dst_file_ofs > MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + + if (local_dir_header_ofs >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); + + MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_dir_header_ofs); + + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, src_central_dir_following_data_size)) + { + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + } + + /* This shouldn't trigger unless we screwed up during the initial sanity checks */ + if (pState->m_central_dir.m_size >= MZ_UINT32_MAX) + { + /* TODO: Support central dirs >= 32-bits in size */ + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); + } + + n = (mz_uint32)orig_central_dir_size; + if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1)) + { + mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE); + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); + } + + pZip->m_total_files++; + pZip->m_archive_size = cur_dst_file_ofs; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip) +{ + mz_zip_internal_state *pState; + mz_uint64 central_dir_ofs, central_dir_size; + mz_uint8 hdr[256]; + + if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + pState = pZip->m_pState; + + if (pState->m_zip64) + { + if ((mz_uint64)pState->m_central_dir.m_size >= MZ_UINT32_MAX) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + else + { + if ((pZip->m_total_files > MZ_UINT16_MAX) || ((pZip->m_archive_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX)) + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); + } + + central_dir_ofs = 0; + central_dir_size = 0; + if (pZip->m_total_files) + { + /* Write central directory */ + central_dir_ofs = pZip->m_archive_size; + central_dir_size = pState->m_central_dir.m_size; + pZip->m_central_directory_file_ofs = central_dir_ofs; + if (pZip->m_pWrite(pZip->m_pIO_opaque, central_dir_ofs, pState->m_central_dir.m_p, (size_t)central_dir_size) != central_dir_size) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + pZip->m_archive_size += central_dir_size; + } + + if (pState->m_zip64) + { + /* Write zip64 end of central directory header */ + mz_uint64 rel_ofs_to_zip64_ecdr = pZip->m_archive_size; + + MZ_CLEAR_ARR(hdr); + MZ_WRITE_LE32(hdr + MZ_ZIP64_ECDH_SIG_OFS, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG); + MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - sizeof(mz_uint32) - sizeof(mz_uint64)); + MZ_WRITE_LE16(hdr + MZ_ZIP64_ECDH_VERSION_MADE_BY_OFS, 0x031E); /* TODO: always Unix */ + MZ_WRITE_LE16(hdr + MZ_ZIP64_ECDH_VERSION_NEEDED_OFS, 0x002D); + MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, pZip->m_total_files); + MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS, pZip->m_total_files); + MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_SIZE_OFS, central_dir_size); + MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_OFS_OFS, central_dir_ofs); + if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + pZip->m_archive_size += MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE; + + /* Write zip64 end of central directory locator */ + MZ_CLEAR_ARR(hdr); + MZ_WRITE_LE32(hdr + MZ_ZIP64_ECDL_SIG_OFS, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG); + MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS, rel_ofs_to_zip64_ecdr); + MZ_WRITE_LE32(hdr + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS, 1); + if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) != MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + + pZip->m_archive_size += MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE; + } + + /* Write end of central directory record */ + MZ_CLEAR_ARR(hdr); + MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_SIG_OFS, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG); + MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files)); + MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files)); + MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_size)); + MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_ofs)); + + if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED); + +#ifndef MINIZ_NO_STDIO + if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF)) + return mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED); +#endif /* #ifndef MINIZ_NO_STDIO */ + + pZip->m_archive_size += MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE; + + pZip->m_zip_mode = MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED; + return MZ_TRUE; +} + +mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize) +{ + if ((!ppBuf) || (!pSize)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + *ppBuf = NULL; + *pSize = 0; + + if ((!pZip) || (!pZip->m_pState)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (pZip->m_pWrite != mz_zip_heap_write_func) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + if (!mz_zip_writer_finalize_archive(pZip)) + return MZ_FALSE; + + *ppBuf = pZip->m_pState->m_pMem; + *pSize = pZip->m_pState->m_mem_size; + pZip->m_pState->m_pMem = NULL; + pZip->m_pState->m_mem_size = pZip->m_pState->m_mem_capacity = 0; + + return MZ_TRUE; +} + +mz_bool mz_zip_writer_end(mz_zip_archive *pZip) +{ + return mz_zip_writer_end_internal(pZip, MZ_TRUE); +} + +#ifndef MINIZ_NO_STDIO +mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags) +{ + return mz_zip_add_mem_to_archive_file_in_place_v2(pZip_filename, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, NULL); +} + +mz_bool mz_zip_add_mem_to_archive_file_in_place_v2(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr) +{ + mz_bool status, created_new_archive = MZ_FALSE; + mz_zip_archive zip_archive; + struct MZ_FILE_STAT_STRUCT file_stat; + mz_zip_error actual_err = MZ_ZIP_NO_ERROR; + + mz_zip_zero_struct(&zip_archive); + if ((int)level_and_flags < 0) + level_and_flags = MZ_DEFAULT_LEVEL; + + if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION)) + { + if (pErr) + *pErr = MZ_ZIP_INVALID_PARAMETER; + return MZ_FALSE; + } + + if (!mz_zip_writer_validate_archive_name(pArchive_name)) + { + if (pErr) + *pErr = MZ_ZIP_INVALID_FILENAME; + return MZ_FALSE; + } + + /* Important: The regular non-64 bit version of stat() can fail here if the file is very large, which could cause the archive to be overwritten. */ + /* So be sure to compile with _LARGEFILE64_SOURCE 1 */ + if (MZ_FILE_STAT(pZip_filename, &file_stat) != 0) + { + /* Create a new archive. */ + if (!mz_zip_writer_init_file_v2(&zip_archive, pZip_filename, 0, level_and_flags)) + { + if (pErr) + *pErr = zip_archive.m_last_error; + return MZ_FALSE; + } + + created_new_archive = MZ_TRUE; + } + else + { + /* Append to an existing archive. */ + if (!mz_zip_reader_init_file_v2(&zip_archive, pZip_filename, level_and_flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0)) + { + if (pErr) + *pErr = zip_archive.m_last_error; + return MZ_FALSE; + } + + if (!mz_zip_writer_init_from_reader_v2(&zip_archive, pZip_filename, level_and_flags)) + { + if (pErr) + *pErr = zip_archive.m_last_error; + + mz_zip_reader_end_internal(&zip_archive, MZ_FALSE); + + return MZ_FALSE; + } + } + + status = mz_zip_writer_add_mem_ex(&zip_archive, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, 0, 0); + actual_err = zip_archive.m_last_error; + + /* Always finalize, even if adding failed for some reason, so we have a valid central directory. (This may not always succeed, but we can try.) */ + if (!mz_zip_writer_finalize_archive(&zip_archive)) + { + if (!actual_err) + actual_err = zip_archive.m_last_error; + + status = MZ_FALSE; + } + + if (!mz_zip_writer_end_internal(&zip_archive, status)) + { + if (!actual_err) + actual_err = zip_archive.m_last_error; + + status = MZ_FALSE; + } + + if ((!status) && (created_new_archive)) + { + /* It's a new archive and something went wrong, so just delete it. */ + int ignoredStatus = MZ_DELETE_FILE(pZip_filename); + (void)ignoredStatus; + } + + if (pErr) + *pErr = actual_err; + + return status; +} + +void *mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename, const char *pArchive_name, const char *pComment, size_t *pSize, mz_uint flags, mz_zip_error *pErr) +{ + mz_uint32 file_index; + mz_zip_archive zip_archive; + void *p = NULL; + + if (pSize) + *pSize = 0; + + if ((!pZip_filename) || (!pArchive_name)) + { + if (pErr) + *pErr = MZ_ZIP_INVALID_PARAMETER; + + return NULL; + } + + mz_zip_zero_struct(&zip_archive); + if (!mz_zip_reader_init_file_v2(&zip_archive, pZip_filename, flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0)) + { + if (pErr) + *pErr = zip_archive.m_last_error; + + return NULL; + } + + if (mz_zip_reader_locate_file_v2(&zip_archive, pArchive_name, pComment, flags, &file_index)) + { + p = mz_zip_reader_extract_to_heap(&zip_archive, file_index, pSize, flags); + } + + mz_zip_reader_end_internal(&zip_archive, p != NULL); + + if (pErr) + *pErr = zip_archive.m_last_error; + + return p; +} + +void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags) +{ + return mz_zip_extract_archive_file_to_heap_v2(pZip_filename, pArchive_name, NULL, pSize, flags, NULL); +} + +#endif /* #ifndef MINIZ_NO_STDIO */ + +#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */ + +/* ------------------- Misc utils */ + +mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip) +{ + return pZip ? pZip->m_zip_mode : MZ_ZIP_MODE_INVALID; +} + +mz_zip_type mz_zip_get_type(mz_zip_archive *pZip) +{ + return pZip ? pZip->m_zip_type : MZ_ZIP_TYPE_INVALID; +} + +mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num) +{ + mz_zip_error prev_err; + + if (!pZip) + return MZ_ZIP_INVALID_PARAMETER; + + prev_err = pZip->m_last_error; + + pZip->m_last_error = err_num; + return prev_err; +} + +mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip) +{ + if (!pZip) + return MZ_ZIP_INVALID_PARAMETER; + + return pZip->m_last_error; +} + +mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip) +{ + return mz_zip_set_last_error(pZip, MZ_ZIP_NO_ERROR); +} + +mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip) +{ + mz_zip_error prev_err; + + if (!pZip) + return MZ_ZIP_INVALID_PARAMETER; + + prev_err = pZip->m_last_error; + + pZip->m_last_error = MZ_ZIP_NO_ERROR; + return prev_err; +} + +const char *mz_zip_get_error_string(mz_zip_error mz_err) +{ + switch (mz_err) + { + case MZ_ZIP_NO_ERROR: + return "no error"; + case MZ_ZIP_UNDEFINED_ERROR: + return "undefined error"; + case MZ_ZIP_TOO_MANY_FILES: + return "too many files"; + case MZ_ZIP_FILE_TOO_LARGE: + return "file too large"; + case MZ_ZIP_UNSUPPORTED_METHOD: + return "unsupported method"; + case MZ_ZIP_UNSUPPORTED_ENCRYPTION: + return "unsupported encryption"; + case MZ_ZIP_UNSUPPORTED_FEATURE: + return "unsupported feature"; + case MZ_ZIP_FAILED_FINDING_CENTRAL_DIR: + return "failed finding central directory"; + case MZ_ZIP_NOT_AN_ARCHIVE: + return "not a ZIP archive"; + case MZ_ZIP_INVALID_HEADER_OR_CORRUPTED: + return "invalid header or archive is corrupted"; + case MZ_ZIP_UNSUPPORTED_MULTIDISK: + return "unsupported multidisk archive"; + case MZ_ZIP_DECOMPRESSION_FAILED: + return "decompression failed or archive is corrupted"; + case MZ_ZIP_COMPRESSION_FAILED: + return "compression failed"; + case MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE: + return "unexpected decompressed size"; + case MZ_ZIP_CRC_CHECK_FAILED: + return "CRC-32 check failed"; + case MZ_ZIP_UNSUPPORTED_CDIR_SIZE: + return "unsupported central directory size"; + case MZ_ZIP_ALLOC_FAILED: + return "allocation failed"; + case MZ_ZIP_FILE_OPEN_FAILED: + return "file open failed"; + case MZ_ZIP_FILE_CREATE_FAILED: + return "file create failed"; + case MZ_ZIP_FILE_WRITE_FAILED: + return "file write failed"; + case MZ_ZIP_FILE_READ_FAILED: + return "file read failed"; + case MZ_ZIP_FILE_CLOSE_FAILED: + return "file close failed"; + case MZ_ZIP_FILE_SEEK_FAILED: + return "file seek failed"; + case MZ_ZIP_FILE_STAT_FAILED: + return "file stat failed"; + case MZ_ZIP_INVALID_PARAMETER: + return "invalid parameter"; + case MZ_ZIP_INVALID_FILENAME: + return "invalid filename"; + case MZ_ZIP_BUF_TOO_SMALL: + return "buffer too small"; + case MZ_ZIP_INTERNAL_ERROR: + return "internal error"; + case MZ_ZIP_FILE_NOT_FOUND: + return "file not found"; + case MZ_ZIP_ARCHIVE_TOO_LARGE: + return "archive is too large"; + case MZ_ZIP_VALIDATION_FAILED: + return "validation failed"; + case MZ_ZIP_WRITE_CALLBACK_FAILED: + return "write callback failed"; + case MZ_ZIP_TOTAL_ERRORS: + return "total errors"; + default: + break; + } + + return "unknown error"; +} + +/* Note: Just because the archive is not zip64 doesn't necessarily mean it doesn't have Zip64 extended information extra field, argh. */ +mz_bool mz_zip_is_zip64(mz_zip_archive *pZip) +{ + if ((!pZip) || (!pZip->m_pState)) + return MZ_FALSE; + + return pZip->m_pState->m_zip64; +} + +size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip) +{ + if ((!pZip) || (!pZip->m_pState)) + return 0; + + return pZip->m_pState->m_central_dir.m_size; +} + +mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip) +{ + return pZip ? pZip->m_total_files : 0; +} + +mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip) +{ + if (!pZip) + return 0; + return pZip->m_archive_size; +} + +mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip) +{ + if ((!pZip) || (!pZip->m_pState)) + return 0; + return pZip->m_pState->m_file_archive_start_ofs; +} + +MZ_FILE *mz_zip_get_cfile(mz_zip_archive *pZip) +{ + if ((!pZip) || (!pZip->m_pState)) + return 0; + return pZip->m_pState->m_pFile; +} + +size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n) +{ + if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pZip->m_pRead)) + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + + return pZip->m_pRead(pZip->m_pIO_opaque, file_ofs, pBuf, n); +} + +mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size) +{ + mz_uint n; + const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index); + if (!p) + { + if (filename_buf_size) + pFilename[0] = '\0'; + mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER); + return 0; + } + n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); + if (filename_buf_size) + { + n = MZ_MIN(n, filename_buf_size - 1); + memcpy(pFilename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n); + pFilename[n] = '\0'; + } + return n + 1; +} + +mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat) +{ + return mz_zip_file_stat_internal(pZip, file_index, mz_zip_get_cdh(pZip, file_index), pStat, NULL); +} + +mz_bool mz_zip_end(mz_zip_archive *pZip) +{ + if (!pZip) + return MZ_FALSE; + + if (pZip->m_zip_mode == MZ_ZIP_MODE_READING) + return mz_zip_reader_end(pZip); +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + else if ((pZip->m_zip_mode == MZ_ZIP_MODE_WRITING) || (pZip->m_zip_mode == MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)) + return mz_zip_writer_end(pZip); +#endif + + return MZ_FALSE; +} + +#ifdef __cplusplus +} +#endif + +#endif /*#ifndef MINIZ_NO_ARCHIVE_APIS*/ diff --git a/third_party/breakpad/src/third_party/miniz/miniz.h b/third_party/breakpad/src/third_party/miniz/miniz.h new file mode 100644 index 0000000..9fcfffc --- /dev/null +++ b/third_party/breakpad/src/third_party/miniz/miniz.h @@ -0,0 +1,1422 @@ +#ifndef MINIZ_EXPORT +#define MINIZ_EXPORT +#endif +/* miniz.c 3.0.0 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing + See "unlicense" statement at the end of this file. + Rich Geldreich , last updated Oct. 13, 2013 + Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt + + Most API's defined in miniz.c are optional. For example, to disable the archive related functions just define + MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros). + + * Low-level Deflate/Inflate implementation notes: + + Compression: Use the "tdefl" API's. The compressor supports raw, static, and dynamic blocks, lazy or + greedy parsing, match length filtering, RLE-only, and Huffman-only streams. It performs and compresses + approximately as well as zlib. + + Decompression: Use the "tinfl" API's. The entire decompressor is implemented as a single function + coroutine: see tinfl_decompress(). It supports decompression into a 32KB (or larger power of 2) wrapping buffer, or into a memory + block large enough to hold the entire file. + + The low-level tdefl/tinfl API's do not make any use of dynamic memory allocation. + + * zlib-style API notes: + + miniz.c implements a fairly large subset of zlib. There's enough functionality present for it to be a drop-in + zlib replacement in many apps: + The z_stream struct, optional memory allocation callbacks + deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound + inflateInit/inflateInit2/inflate/inflateReset/inflateEnd + compress, compress2, compressBound, uncompress + CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly routines. + Supports raw deflate streams or standard zlib streams with adler-32 checking. + + Limitations: + The callback API's are not implemented yet. No support for gzip headers or zlib static dictionaries. + I've tried to closely emulate zlib's various flavors of stream flushing and return status codes, but + there are no guarantees that miniz.c pulls this off perfectly. + + * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function, originally written by + Alex Evans. Supports 1-4 bytes/pixel images. + + * ZIP archive API notes: + + The ZIP archive API's where designed with simplicity and efficiency in mind, with just enough abstraction to + get the job done with minimal fuss. There are simple API's to retrieve file information, read files from + existing archives, create new archives, append new files to existing archives, or clone archive data from + one archive to another. It supports archives located in memory or the heap, on disk (using stdio.h), + or you can specify custom file read/write callbacks. + + - Archive reading: Just call this function to read a single file from a disk archive: + + void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, + size_t *pSize, mz_uint zip_flags); + + For more complex cases, use the "mz_zip_reader" functions. Upon opening an archive, the entire central + directory is located and read as-is into memory, and subsequent file access only occurs when reading individual files. + + - Archives file scanning: The simple way is to use this function to scan a loaded archive for a specific file: + + int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); + + The locate operation can optionally check file comments too, which (as one example) can be used to identify + multiple versions of the same file in an archive. This function uses a simple linear search through the central + directory, so it's not very fast. + + Alternately, you can iterate through all the files in an archive (using mz_zip_reader_get_num_files()) and + retrieve detailed info on each file by calling mz_zip_reader_file_stat(). + + - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer immediately writes compressed file data + to disk and builds an exact image of the central directory in memory. The central directory image is written + all at once at the end of the archive file when the archive is finalized. + + The archive writer can optionally align each file's local header and file data to any power of 2 alignment, + which can be useful when the archive will be read from optical media. Also, the writer supports placing + arbitrary data blobs at the very beginning of ZIP archives. Archives written using either feature are still + readable by any ZIP tool. + + - Archive appending: The simple way to add a single file to an archive is to call this function: + + mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, + const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); + + The archive will be created if it doesn't already exist, otherwise it'll be appended to. + Note the appending is done in-place and is not an atomic operation, so if something goes wrong + during the operation it's possible the archive could be left without a central directory (although the local + file headers and file data will be fine, so the archive will be recoverable). + + For more complex archive modification scenarios: + 1. The safest way is to use a mz_zip_reader to read the existing archive, cloning only those bits you want to + preserve into a new archive using using the mz_zip_writer_add_from_zip_reader() function (which compiles the + compressed file data as-is). When you're done, delete the old archive and rename the newly written archive, and + you're done. This is safe but requires a bunch of temporary disk space or heap memory. + + 2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using mz_zip_writer_init_from_reader(), + append new files as needed, then finalize the archive which will write an updated central directory to the + original archive. (This is basically what mz_zip_add_mem_to_archive_file_in_place() does.) There's a + possibility that the archive's central directory could be lost with this method if anything goes wrong, though. + + - ZIP archive support limitations: + No spanning support. Extraction functions can only handle unencrypted, stored or deflated files. + Requires streams capable of seeking. + + * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the + below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it. + + * Important: For best perf. be sure to customize the below macros for your target platform: + #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 + #define MINIZ_LITTLE_ENDIAN 1 + #define MINIZ_HAS_64BIT_REGISTERS 1 + + * On platforms using glibc, Be sure to "#define _LARGEFILE64_SOURCE 1" before including miniz.c to ensure miniz + uses the 64-bit variants: fopen64(), stat64(), etc. Otherwise you won't be able to process large files + (i.e. 32-bit stat() fails for me on files > 0x7FFFFFFF bytes). +*/ +#pragma once + + + +/* Defines to completely disable specific portions of miniz.c: + If all macros here are defined the only functionality remaining will be CRC-32 and adler-32. */ + +/* Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. */ +/*#define MINIZ_NO_STDIO */ + +/* If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or */ +/* get/set file times, and the C run-time funcs that get/set times won't be called. */ +/* The current downside is the times written to your archives will be from 1979. */ +/*#define MINIZ_NO_TIME */ + +/* Define MINIZ_NO_DEFLATE_APIS to disable all compression API's. */ +/*#define MINIZ_NO_DEFLATE_APIS */ + +/* Define MINIZ_NO_INFLATE_APIS to disable all decompression API's. */ +/*#define MINIZ_NO_INFLATE_APIS */ + +/* Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. */ +/*#define MINIZ_NO_ARCHIVE_APIS */ + +/* Define MINIZ_NO_ARCHIVE_WRITING_APIS to disable all writing related ZIP archive API's. */ +/*#define MINIZ_NO_ARCHIVE_WRITING_APIS */ + +/* Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. */ +/*#define MINIZ_NO_ZLIB_APIS */ + +/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */ +/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */ + +/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc. + Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc + callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user + functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. */ +/*#define MINIZ_NO_MALLOC */ + +#ifdef MINIZ_NO_INFLATE_APIS +#define MINIZ_NO_ARCHIVE_APIS +#endif + +#ifdef MINIZ_NO_DEFLATE_APIS +#define MINIZ_NO_ARCHIVE_WRITING_APIS +#endif + +#if defined(__TINYC__) && (defined(__linux) || defined(__linux__)) +/* TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc on Linux */ +#define MINIZ_NO_TIME +#endif + +#include + +#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS) +#include +#endif + +#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__) +/* MINIZ_X86_OR_X64_CPU is only used to help set the below macros. */ +#define MINIZ_X86_OR_X64_CPU 1 +#else +#define MINIZ_X86_OR_X64_CPU 0 +#endif + +/* Set MINIZ_LITTLE_ENDIAN only if not set */ +#if !defined(MINIZ_LITTLE_ENDIAN) +#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) + +#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) +/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */ +#define MINIZ_LITTLE_ENDIAN 1 +#else +#define MINIZ_LITTLE_ENDIAN 0 +#endif + +#else + +#if MINIZ_X86_OR_X64_CPU +#define MINIZ_LITTLE_ENDIAN 1 +#else +#define MINIZ_LITTLE_ENDIAN 0 +#endif + +#endif +#endif + +/* Using unaligned loads and stores causes errors when using UBSan */ +#if defined(__has_feature) +#if __has_feature(undefined_behavior_sanitizer) +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0 +#endif +#endif + +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */ +#if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES) +#if MINIZ_X86_OR_X64_CPU +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */ +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0 +#define MINIZ_UNALIGNED_USE_MEMCPY +#else +#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0 +#endif +#endif + +#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__) +/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). */ +#define MINIZ_HAS_64BIT_REGISTERS 1 +#else +#define MINIZ_HAS_64BIT_REGISTERS 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* ------------------- zlib-style API Definitions. */ + +/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! */ +typedef unsigned long mz_ulong; + +/* mz_free() internally uses the MZ_FREE() macro (which by default calls free() unless you've modified the MZ_MALLOC macro) to release a block allocated from the heap. */ +MINIZ_EXPORT void mz_free(void *p); + +#define MZ_ADLER32_INIT (1) +/* mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. */ +MINIZ_EXPORT mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len); + +#define MZ_CRC32_INIT (0) +/* mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. */ +MINIZ_EXPORT mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len); + +/* Compression strategies. */ +enum +{ + MZ_DEFAULT_STRATEGY = 0, + MZ_FILTERED = 1, + MZ_HUFFMAN_ONLY = 2, + MZ_RLE = 3, + MZ_FIXED = 4 +}; + +/* Method */ +#define MZ_DEFLATED 8 + +/* Heap allocation callbacks. +Note that mz_alloc_func parameter types purposely differ from zlib's: items/size is size_t, not unsigned long. */ +typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size); +typedef void (*mz_free_func)(void *opaque, void *address); +typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size); + +/* Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. */ +enum +{ + MZ_NO_COMPRESSION = 0, + MZ_BEST_SPEED = 1, + MZ_BEST_COMPRESSION = 9, + MZ_UBER_COMPRESSION = 10, + MZ_DEFAULT_LEVEL = 6, + MZ_DEFAULT_COMPRESSION = -1 +}; + +#define MZ_VERSION "11.0.2" +#define MZ_VERNUM 0xB002 +#define MZ_VER_MAJOR 11 +#define MZ_VER_MINOR 2 +#define MZ_VER_REVISION 0 +#define MZ_VER_SUBREVISION 0 + +#ifndef MINIZ_NO_ZLIB_APIS + +/* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). */ +enum +{ + MZ_NO_FLUSH = 0, + MZ_PARTIAL_FLUSH = 1, + MZ_SYNC_FLUSH = 2, + MZ_FULL_FLUSH = 3, + MZ_FINISH = 4, + MZ_BLOCK = 5 +}; + +/* Return status codes. MZ_PARAM_ERROR is non-standard. */ +enum +{ + MZ_OK = 0, + MZ_STREAM_END = 1, + MZ_NEED_DICT = 2, + MZ_ERRNO = -1, + MZ_STREAM_ERROR = -2, + MZ_DATA_ERROR = -3, + MZ_MEM_ERROR = -4, + MZ_BUF_ERROR = -5, + MZ_VERSION_ERROR = -6, + MZ_PARAM_ERROR = -10000 +}; + +/* Window bits */ +#define MZ_DEFAULT_WINDOW_BITS 15 + +struct mz_internal_state; + +/* Compression/decompression stream struct. */ +typedef struct mz_stream_s +{ + const unsigned char *next_in; /* pointer to next byte to read */ + unsigned int avail_in; /* number of bytes available at next_in */ + mz_ulong total_in; /* total number of bytes consumed so far */ + + unsigned char *next_out; /* pointer to next byte to write */ + unsigned int avail_out; /* number of bytes that can be written to next_out */ + mz_ulong total_out; /* total number of bytes produced so far */ + + char *msg; /* error msg (unused) */ + struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */ + + mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */ + mz_free_func zfree; /* optional heap free function (defaults to free) */ + void *opaque; /* heap alloc function user pointer */ + + int data_type; /* data_type (unused) */ + mz_ulong adler; /* adler32 of the source or uncompressed data */ + mz_ulong reserved; /* not used */ +} mz_stream; + +typedef mz_stream *mz_streamp; + +/* Returns the version string of miniz.c. */ +MINIZ_EXPORT const char *mz_version(void); + +#ifndef MINIZ_NO_DEFLATE_APIS + +/* mz_deflateInit() initializes a compressor with default options: */ +/* Parameters: */ +/* pStream must point to an initialized mz_stream struct. */ +/* level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. */ +/* level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. */ +/* (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) */ +/* Return values: */ +/* MZ_OK on success. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +/* MZ_PARAM_ERROR if the input parameters are bogus. */ +/* MZ_MEM_ERROR on out of memory. */ +MINIZ_EXPORT int mz_deflateInit(mz_streamp pStream, int level); + +/* mz_deflateInit2() is like mz_deflate(), except with more control: */ +/* Additional parameters: */ +/* method must be MZ_DEFLATED */ +/* window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) */ +/* mem_level must be between [1, 9] (it's checked but ignored by miniz.c) */ +MINIZ_EXPORT int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy); + +/* Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). */ +MINIZ_EXPORT int mz_deflateReset(mz_streamp pStream); + +/* mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. */ +/* Parameters: */ +/* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */ +/* flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. */ +/* Return values: */ +/* MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). */ +/* MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +/* MZ_PARAM_ERROR if one of the parameters is invalid. */ +/* MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) */ +MINIZ_EXPORT int mz_deflate(mz_streamp pStream, int flush); + +/* mz_deflateEnd() deinitializes a compressor: */ +/* Return values: */ +/* MZ_OK on success. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +MINIZ_EXPORT int mz_deflateEnd(mz_streamp pStream); + +/* mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. */ +MINIZ_EXPORT mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len); + +/* Single-call compression functions mz_compress() and mz_compress2(): */ +/* Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. */ +MINIZ_EXPORT int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); +MINIZ_EXPORT int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level); + +/* mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). */ +MINIZ_EXPORT mz_ulong mz_compressBound(mz_ulong source_len); + +#endif /*#ifndef MINIZ_NO_DEFLATE_APIS*/ + +#ifndef MINIZ_NO_INFLATE_APIS + +/* Initializes a decompressor. */ +MINIZ_EXPORT int mz_inflateInit(mz_streamp pStream); + +/* mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: */ +/* window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). */ +MINIZ_EXPORT int mz_inflateInit2(mz_streamp pStream, int window_bits); + +/* Quickly resets a compressor without having to reallocate anything. Same as calling mz_inflateEnd() followed by mz_inflateInit()/mz_inflateInit2(). */ +MINIZ_EXPORT int mz_inflateReset(mz_streamp pStream); + +/* Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. */ +/* Parameters: */ +/* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */ +/* flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. */ +/* On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). */ +/* MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. */ +/* Return values: */ +/* MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. */ +/* MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. */ +/* MZ_STREAM_ERROR if the stream is bogus. */ +/* MZ_DATA_ERROR if the deflate stream is invalid. */ +/* MZ_PARAM_ERROR if one of the parameters is invalid. */ +/* MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again */ +/* with more input data, or with more room in the output buffer (except when using single call decompression, described above). */ +MINIZ_EXPORT int mz_inflate(mz_streamp pStream, int flush); + +/* Deinitializes a decompressor. */ +MINIZ_EXPORT int mz_inflateEnd(mz_streamp pStream); + +/* Single-call decompression. */ +/* Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. */ +MINIZ_EXPORT int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len); +MINIZ_EXPORT int mz_uncompress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong *pSource_len); +#endif /*#ifndef MINIZ_NO_INFLATE_APIS*/ + +/* Returns a string description of the specified error code, or NULL if the error code is invalid. */ +MINIZ_EXPORT const char *mz_error(int err); + +/* Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. */ +/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. */ +#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES +typedef unsigned char Byte; +typedef unsigned int uInt; +typedef mz_ulong uLong; +typedef Byte Bytef; +typedef uInt uIntf; +typedef char charf; +typedef int intf; +typedef void *voidpf; +typedef uLong uLongf; +typedef void *voidp; +typedef void *const voidpc; +#define Z_NULL 0 +#define Z_NO_FLUSH MZ_NO_FLUSH +#define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH +#define Z_SYNC_FLUSH MZ_SYNC_FLUSH +#define Z_FULL_FLUSH MZ_FULL_FLUSH +#define Z_FINISH MZ_FINISH +#define Z_BLOCK MZ_BLOCK +#define Z_OK MZ_OK +#define Z_STREAM_END MZ_STREAM_END +#define Z_NEED_DICT MZ_NEED_DICT +#define Z_ERRNO MZ_ERRNO +#define Z_STREAM_ERROR MZ_STREAM_ERROR +#define Z_DATA_ERROR MZ_DATA_ERROR +#define Z_MEM_ERROR MZ_MEM_ERROR +#define Z_BUF_ERROR MZ_BUF_ERROR +#define Z_VERSION_ERROR MZ_VERSION_ERROR +#define Z_PARAM_ERROR MZ_PARAM_ERROR +#define Z_NO_COMPRESSION MZ_NO_COMPRESSION +#define Z_BEST_SPEED MZ_BEST_SPEED +#define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION +#define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION +#define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY +#define Z_FILTERED MZ_FILTERED +#define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY +#define Z_RLE MZ_RLE +#define Z_FIXED MZ_FIXED +#define Z_DEFLATED MZ_DEFLATED +#define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS +#define alloc_func mz_alloc_func +#define free_func mz_free_func +#define internal_state mz_internal_state +#define z_stream mz_stream + +#ifndef MINIZ_NO_DEFLATE_APIS +#define deflateInit mz_deflateInit +#define deflateInit2 mz_deflateInit2 +#define deflateReset mz_deflateReset +#define deflate mz_deflate +#define deflateEnd mz_deflateEnd +#define deflateBound mz_deflateBound +#define compress mz_compress +#define compress2 mz_compress2 +#define compressBound mz_compressBound +#endif /*#ifndef MINIZ_NO_DEFLATE_APIS*/ + +#ifndef MINIZ_NO_INFLATE_APIS +#define inflateInit mz_inflateInit +#define inflateInit2 mz_inflateInit2 +#define inflateReset mz_inflateReset +#define inflate mz_inflate +#define inflateEnd mz_inflateEnd +#define uncompress mz_uncompress +#define uncompress2 mz_uncompress2 +#endif /*#ifndef MINIZ_NO_INFLATE_APIS*/ + +#define crc32 mz_crc32 +#define adler32 mz_adler32 +#define MAX_WBITS 15 +#define MAX_MEM_LEVEL 9 +#define zError mz_error +#define ZLIB_VERSION MZ_VERSION +#define ZLIB_VERNUM MZ_VERNUM +#define ZLIB_VER_MAJOR MZ_VER_MAJOR +#define ZLIB_VER_MINOR MZ_VER_MINOR +#define ZLIB_VER_REVISION MZ_VER_REVISION +#define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION +#define zlibVersion mz_version +#define zlib_version mz_version() +#endif /* #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES */ + +#endif /* MINIZ_NO_ZLIB_APIS */ + +#ifdef __cplusplus +} +#endif + + + + + +#pragma once +#include +#include +#include +#include + + + +/* ------------------- Types and macros */ +typedef unsigned char mz_uint8; +typedef signed short mz_int16; +typedef unsigned short mz_uint16; +typedef unsigned int mz_uint32; +typedef unsigned int mz_uint; +typedef int64_t mz_int64; +typedef uint64_t mz_uint64; +typedef int mz_bool; + +#define MZ_FALSE (0) +#define MZ_TRUE (1) + +/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */ +#ifdef _MSC_VER +#define MZ_MACRO_END while (0, 0) +#else +#define MZ_MACRO_END while (0) +#endif + +#ifdef MINIZ_NO_STDIO +#define MZ_FILE void * +#else +#include +#define MZ_FILE FILE +#endif /* #ifdef MINIZ_NO_STDIO */ + +#ifdef MINIZ_NO_TIME +typedef struct mz_dummy_time_t_tag +{ + mz_uint32 m_dummy1; + mz_uint32 m_dummy2; +} mz_dummy_time_t; +#define MZ_TIME_T mz_dummy_time_t +#else +#define MZ_TIME_T time_t +#endif + +#define MZ_ASSERT(x) assert(x) + +#ifdef MINIZ_NO_MALLOC +#define MZ_MALLOC(x) NULL +#define MZ_FREE(x) (void)x, ((void)0) +#define MZ_REALLOC(p, x) NULL +#else +#define MZ_MALLOC(x) malloc(x) +#define MZ_FREE(x) free(x) +#define MZ_REALLOC(p, x) realloc(p, x) +#endif + +#define MZ_MAX(a, b) (((a) > (b)) ? (a) : (b)) +#define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b)) +#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj)) +#define MZ_CLEAR_ARR(obj) memset((obj), 0, sizeof(obj)) +#define MZ_CLEAR_PTR(obj) memset((obj), 0, sizeof(*obj)) + +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN +#define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) +#define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) +#else +#define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U)) +#define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) +#endif + +#define MZ_READ_LE64(p) (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U)) + +#ifdef _MSC_VER +#define MZ_FORCEINLINE __forceinline +#elif defined(__GNUC__) +#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__)) +#else +#define MZ_FORCEINLINE inline +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +extern MINIZ_EXPORT void *miniz_def_alloc_func(void *opaque, size_t items, size_t size); +extern MINIZ_EXPORT void miniz_def_free_func(void *opaque, void *address); +extern MINIZ_EXPORT void *miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size); + +#define MZ_UINT16_MAX (0xFFFFU) +#define MZ_UINT32_MAX (0xFFFFFFFFU) + +#ifdef __cplusplus +} +#endif + #pragma once + + +#ifndef MINIZ_NO_DEFLATE_APIS + +#ifdef __cplusplus +extern "C" { +#endif +/* ------------------- Low-level Compression API Definitions */ + +/* Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). */ +#define TDEFL_LESS_MEMORY 0 + +/* tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): */ +/* TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). */ +enum +{ + TDEFL_HUFFMAN_ONLY = 0, + TDEFL_DEFAULT_MAX_PROBES = 128, + TDEFL_MAX_PROBES_MASK = 0xFFF +}; + +/* TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. */ +/* TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). */ +/* TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. */ +/* TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). */ +/* TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) */ +/* TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. */ +/* TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. */ +/* TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. */ +/* The low 12 bits are reserved to control the max # of hash probes per dictionary lookup (see TDEFL_MAX_PROBES_MASK). */ +enum +{ + TDEFL_WRITE_ZLIB_HEADER = 0x01000, + TDEFL_COMPUTE_ADLER32 = 0x02000, + TDEFL_GREEDY_PARSING_FLAG = 0x04000, + TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000, + TDEFL_RLE_MATCHES = 0x10000, + TDEFL_FILTER_MATCHES = 0x20000, + TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000, + TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000 +}; + +/* High level compression functions: */ +/* tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). */ +/* On entry: */ +/* pSrc_buf, src_buf_len: Pointer and size of source block to compress. */ +/* flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. */ +/* On return: */ +/* Function returns a pointer to the compressed data, or NULL on failure. */ +/* *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. */ +/* The caller must free() the returned block when it's no longer needed. */ +MINIZ_EXPORT void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +/* tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. */ +/* Returns 0 on failure. */ +MINIZ_EXPORT size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +/* Compresses an image to a compressed PNG file in memory. */ +/* On entry: */ +/* pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. */ +/* The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory. */ +/* level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL */ +/* If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps). */ +/* On return: */ +/* Function returns a pointer to the compressed data, or NULL on failure. */ +/* *pLen_out will be set to the size of the PNG image file. */ +/* The caller must mz_free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. */ +MINIZ_EXPORT void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip); +MINIZ_EXPORT void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out); + +/* Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. */ +typedef mz_bool (*tdefl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser); + +/* tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. */ +MINIZ_EXPORT mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +enum +{ + TDEFL_MAX_HUFF_TABLES = 3, + TDEFL_MAX_HUFF_SYMBOLS_0 = 288, + TDEFL_MAX_HUFF_SYMBOLS_1 = 32, + TDEFL_MAX_HUFF_SYMBOLS_2 = 19, + TDEFL_LZ_DICT_SIZE = 32768, + TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1, + TDEFL_MIN_MATCH_LEN = 3, + TDEFL_MAX_MATCH_LEN = 258 +}; + +/* TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). */ +#if TDEFL_LESS_MEMORY +enum +{ + TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024, + TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10, + TDEFL_MAX_HUFF_SYMBOLS = 288, + TDEFL_LZ_HASH_BITS = 12, + TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, + TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, + TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS +}; +#else +enum +{ + TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024, + TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10, + TDEFL_MAX_HUFF_SYMBOLS = 288, + TDEFL_LZ_HASH_BITS = 15, + TDEFL_LEVEL1_HASH_SIZE_MASK = 4095, + TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3, + TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS +}; +#endif + +/* The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. */ +typedef enum { + TDEFL_STATUS_BAD_PARAM = -2, + TDEFL_STATUS_PUT_BUF_FAILED = -1, + TDEFL_STATUS_OKAY = 0, + TDEFL_STATUS_DONE = 1 +} tdefl_status; + +/* Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums */ +typedef enum { + TDEFL_NO_FLUSH = 0, + TDEFL_SYNC_FLUSH = 2, + TDEFL_FULL_FLUSH = 3, + TDEFL_FINISH = 4 +} tdefl_flush; + +/* tdefl's compression state structure. */ +typedef struct +{ + tdefl_put_buf_func_ptr m_pPut_buf_func; + void *m_pPut_buf_user; + mz_uint m_flags, m_max_probes[2]; + int m_greedy_parsing; + mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size; + mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end; + mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer; + mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish; + tdefl_status m_prev_return_status; + const void *m_pIn_buf; + void *m_pOut_buf; + size_t *m_pIn_buf_size, *m_pOut_buf_size; + tdefl_flush m_flush; + const mz_uint8 *m_pSrc; + size_t m_src_buf_left, m_out_buf_ofs; + mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1]; + mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS]; + mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE]; + mz_uint16 m_next[TDEFL_LZ_DICT_SIZE]; + mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE]; + mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE]; +} tdefl_compressor; + +/* Initializes the compressor. */ +/* There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. */ +/* pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. */ +/* If pBut_buf_func is NULL the user should always call the tdefl_compress() API. */ +/* flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) */ +MINIZ_EXPORT tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +/* Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. */ +MINIZ_EXPORT tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush); + +/* tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. */ +/* tdefl_compress_buffer() always consumes the entire input buffer. */ +MINIZ_EXPORT tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush); + +MINIZ_EXPORT tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d); +MINIZ_EXPORT mz_uint32 tdefl_get_adler32(tdefl_compressor *d); + +/* Create tdefl_compress() flags given zlib-style compression parameters. */ +/* level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) */ +/* window_bits may be -15 (raw deflate) or 15 (zlib) */ +/* strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED */ +MINIZ_EXPORT mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy); + +#ifndef MINIZ_NO_MALLOC +/* Allocate the tdefl_compressor structure in C so that */ +/* non-C language bindings to tdefl_ API don't need to worry about */ +/* structure size and allocation mechanism. */ +MINIZ_EXPORT tdefl_compressor *tdefl_compressor_alloc(void); +MINIZ_EXPORT void tdefl_compressor_free(tdefl_compressor *pComp); +#endif + +#ifdef __cplusplus +} +#endif + +#endif /*#ifndef MINIZ_NO_DEFLATE_APIS*/ + #pragma once + +/* ------------------- Low-level Decompression API Definitions */ + +#ifndef MINIZ_NO_INFLATE_APIS + +#ifdef __cplusplus +extern "C" { +#endif +/* Decompression flags used by tinfl_decompress(). */ +/* TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. */ +/* TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. */ +/* TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). */ +/* TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. */ +enum +{ + TINFL_FLAG_PARSE_ZLIB_HEADER = 1, + TINFL_FLAG_HAS_MORE_INPUT = 2, + TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4, + TINFL_FLAG_COMPUTE_ADLER32 = 8 +}; + +/* High level decompression functions: */ +/* tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). */ +/* On entry: */ +/* pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. */ +/* On return: */ +/* Function returns a pointer to the decompressed data, or NULL on failure. */ +/* *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. */ +/* The caller must call mz_free() on the returned block when it's no longer needed. */ +MINIZ_EXPORT void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags); + +/* tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. */ +/* Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. */ +#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1)) +MINIZ_EXPORT size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags); + +/* tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. */ +/* Returns 1 on success or 0 on failure. */ +typedef int (*tinfl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser); +MINIZ_EXPORT int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags); + +struct tinfl_decompressor_tag; +typedef struct tinfl_decompressor_tag tinfl_decompressor; + +#ifndef MINIZ_NO_MALLOC +/* Allocate the tinfl_decompressor structure in C so that */ +/* non-C language bindings to tinfl_ API don't need to worry about */ +/* structure size and allocation mechanism. */ +MINIZ_EXPORT tinfl_decompressor *tinfl_decompressor_alloc(void); +MINIZ_EXPORT void tinfl_decompressor_free(tinfl_decompressor *pDecomp); +#endif + +/* Max size of LZ dictionary. */ +#define TINFL_LZ_DICT_SIZE 32768 + +/* Return status. */ +typedef enum { + /* This flags indicates the inflator needs 1 or more input bytes to make forward progress, but the caller is indicating that no more are available. The compressed data */ + /* is probably corrupted. If you call the inflator again with more bytes it'll try to continue processing the input but this is a BAD sign (either the data is corrupted or you called it incorrectly). */ + /* If you call it again with no input you'll just get TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS again. */ + TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS = -4, + + /* This flag indicates that one or more of the input parameters was obviously bogus. (You can try calling it again, but if you get this error the calling code is wrong.) */ + TINFL_STATUS_BAD_PARAM = -3, + + /* This flags indicate the inflator is finished but the adler32 check of the uncompressed data didn't match. If you call it again it'll return TINFL_STATUS_DONE. */ + TINFL_STATUS_ADLER32_MISMATCH = -2, + + /* This flags indicate the inflator has somehow failed (bad code, corrupted input, etc.). If you call it again without resetting via tinfl_init() it it'll just keep on returning the same status failure code. */ + TINFL_STATUS_FAILED = -1, + + /* Any status code less than TINFL_STATUS_DONE must indicate a failure. */ + + /* This flag indicates the inflator has returned every byte of uncompressed data that it can, has consumed every byte that it needed, has successfully reached the end of the deflate stream, and */ + /* if zlib headers and adler32 checking enabled that it has successfully checked the uncompressed data's adler32. If you call it again you'll just get TINFL_STATUS_DONE over and over again. */ + TINFL_STATUS_DONE = 0, + + /* This flag indicates the inflator MUST have more input data (even 1 byte) before it can make any more forward progress, or you need to clear the TINFL_FLAG_HAS_MORE_INPUT */ + /* flag on the next call if you don't have any more source data. If the source data was somehow corrupted it's also possible (but unlikely) for the inflator to keep on demanding input to */ + /* proceed, so be sure to properly set the TINFL_FLAG_HAS_MORE_INPUT flag. */ + TINFL_STATUS_NEEDS_MORE_INPUT = 1, + + /* This flag indicates the inflator definitely has 1 or more bytes of uncompressed data available, but it cannot write this data into the output buffer. */ + /* Note if the source compressed data was corrupted it's possible for the inflator to return a lot of uncompressed data to the caller. I've been assuming you know how much uncompressed data to expect */ + /* (either exact or worst case) and will stop calling the inflator and fail after receiving too much. In pure streaming scenarios where you have no idea how many bytes to expect this may not be possible */ + /* so I may need to add some code to address this. */ + TINFL_STATUS_HAS_MORE_OUTPUT = 2 +} tinfl_status; + +/* Initializes the decompressor to its initial state. */ +#define tinfl_init(r) \ + do \ + { \ + (r)->m_state = 0; \ + } \ + MZ_MACRO_END +#define tinfl_get_adler32(r) (r)->m_check_adler32 + +/* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */ +/* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */ +MINIZ_EXPORT tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags); + +/* Internal/private bits follow. */ +enum +{ + TINFL_MAX_HUFF_TABLES = 3, + TINFL_MAX_HUFF_SYMBOLS_0 = 288, + TINFL_MAX_HUFF_SYMBOLS_1 = 32, + TINFL_MAX_HUFF_SYMBOLS_2 = 19, + TINFL_FAST_LOOKUP_BITS = 10, + TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS +}; + +#if MINIZ_HAS_64BIT_REGISTERS +#define TINFL_USE_64BIT_BITBUF 1 +#else +#define TINFL_USE_64BIT_BITBUF 0 +#endif + +#if TINFL_USE_64BIT_BITBUF +typedef mz_uint64 tinfl_bit_buf_t; +#define TINFL_BITBUF_SIZE (64) +#else +typedef mz_uint32 tinfl_bit_buf_t; +#define TINFL_BITBUF_SIZE (32) +#endif + +struct tinfl_decompressor_tag +{ + mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES]; + tinfl_bit_buf_t m_bit_buf; + size_t m_dist_from_out_buf_start; + mz_int16 m_look_up[TINFL_MAX_HUFF_TABLES][TINFL_FAST_LOOKUP_SIZE]; + mz_int16 m_tree_0[TINFL_MAX_HUFF_SYMBOLS_0 * 2]; + mz_int16 m_tree_1[TINFL_MAX_HUFF_SYMBOLS_1 * 2]; + mz_int16 m_tree_2[TINFL_MAX_HUFF_SYMBOLS_2 * 2]; + mz_uint8 m_code_size_0[TINFL_MAX_HUFF_SYMBOLS_0]; + mz_uint8 m_code_size_1[TINFL_MAX_HUFF_SYMBOLS_1]; + mz_uint8 m_code_size_2[TINFL_MAX_HUFF_SYMBOLS_2]; + mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137]; +}; + +#ifdef __cplusplus +} +#endif + +#endif /*#ifndef MINIZ_NO_INFLATE_APIS*/ + +#pragma once + + +/* ------------------- ZIP archive reading/writing */ + +#ifndef MINIZ_NO_ARCHIVE_APIS + +#ifdef __cplusplus +extern "C" { +#endif + +enum +{ + /* Note: These enums can be reduced as needed to save memory or stack space - they are pretty conservative. */ + MZ_ZIP_MAX_IO_BUF_SIZE = 64 * 1024, + MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 512, + MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 512 +}; + +typedef struct +{ + /* Central directory file index. */ + mz_uint32 m_file_index; + + /* Byte offset of this entry in the archive's central directory. Note we currently only support up to UINT_MAX or less bytes in the central dir. */ + mz_uint64 m_central_dir_ofs; + + /* These fields are copied directly from the zip's central dir. */ + mz_uint16 m_version_made_by; + mz_uint16 m_version_needed; + mz_uint16 m_bit_flag; + mz_uint16 m_method; + + /* CRC-32 of uncompressed data. */ + mz_uint32 m_crc32; + + /* File's compressed size. */ + mz_uint64 m_comp_size; + + /* File's uncompressed size. Note, I've seen some old archives where directory entries had 512 bytes for their uncompressed sizes, but when you try to unpack them you actually get 0 bytes. */ + mz_uint64 m_uncomp_size; + + /* Zip internal and external file attributes. */ + mz_uint16 m_internal_attr; + mz_uint32 m_external_attr; + + /* Entry's local header file offset in bytes. */ + mz_uint64 m_local_header_ofs; + + /* Size of comment in bytes. */ + mz_uint32 m_comment_size; + + /* MZ_TRUE if the entry appears to be a directory. */ + mz_bool m_is_directory; + + /* MZ_TRUE if the entry uses encryption/strong encryption (which miniz_zip doesn't support) */ + mz_bool m_is_encrypted; + + /* MZ_TRUE if the file is not encrypted, a patch file, and if it uses a compression method we support. */ + mz_bool m_is_supported; + + /* Filename. If string ends in '/' it's a subdirectory entry. */ + /* Guaranteed to be zero terminated, may be truncated to fit. */ + char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE]; + + /* Comment field. */ + /* Guaranteed to be zero terminated, may be truncated to fit. */ + char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE]; + +#ifdef MINIZ_NO_TIME + MZ_TIME_T m_padding; +#else + MZ_TIME_T m_time; +#endif +} mz_zip_archive_file_stat; + +typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n); +typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n); +typedef mz_bool (*mz_file_needs_keepalive)(void *pOpaque); + +struct mz_zip_internal_state_tag; +typedef struct mz_zip_internal_state_tag mz_zip_internal_state; + +typedef enum { + MZ_ZIP_MODE_INVALID = 0, + MZ_ZIP_MODE_READING = 1, + MZ_ZIP_MODE_WRITING = 2, + MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3 +} mz_zip_mode; + +typedef enum { + MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100, + MZ_ZIP_FLAG_IGNORE_PATH = 0x0200, + MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400, + MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800, + MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG = 0x1000, /* if enabled, mz_zip_reader_locate_file() will be called on each file as its validated to ensure the func finds the file in the central dir (intended for testing) */ + MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY = 0x2000, /* validate the local headers, but don't decompress the entire file and check the crc32 */ + MZ_ZIP_FLAG_WRITE_ZIP64 = 0x4000, /* always use the zip64 file format, instead of the original zip file format with automatic switch to zip64. Use as flags parameter with mz_zip_writer_init*_v2 */ + MZ_ZIP_FLAG_WRITE_ALLOW_READING = 0x8000, + MZ_ZIP_FLAG_ASCII_FILENAME = 0x10000, + /*After adding a compressed file, seek back + to local file header and set the correct sizes*/ + MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE = 0x20000 +} mz_zip_flags; + +typedef enum { + MZ_ZIP_TYPE_INVALID = 0, + MZ_ZIP_TYPE_USER, + MZ_ZIP_TYPE_MEMORY, + MZ_ZIP_TYPE_HEAP, + MZ_ZIP_TYPE_FILE, + MZ_ZIP_TYPE_CFILE, + MZ_ZIP_TOTAL_TYPES +} mz_zip_type; + +/* miniz error codes. Be sure to update mz_zip_get_error_string() if you add or modify this enum. */ +typedef enum { + MZ_ZIP_NO_ERROR = 0, + MZ_ZIP_UNDEFINED_ERROR, + MZ_ZIP_TOO_MANY_FILES, + MZ_ZIP_FILE_TOO_LARGE, + MZ_ZIP_UNSUPPORTED_METHOD, + MZ_ZIP_UNSUPPORTED_ENCRYPTION, + MZ_ZIP_UNSUPPORTED_FEATURE, + MZ_ZIP_FAILED_FINDING_CENTRAL_DIR, + MZ_ZIP_NOT_AN_ARCHIVE, + MZ_ZIP_INVALID_HEADER_OR_CORRUPTED, + MZ_ZIP_UNSUPPORTED_MULTIDISK, + MZ_ZIP_DECOMPRESSION_FAILED, + MZ_ZIP_COMPRESSION_FAILED, + MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE, + MZ_ZIP_CRC_CHECK_FAILED, + MZ_ZIP_UNSUPPORTED_CDIR_SIZE, + MZ_ZIP_ALLOC_FAILED, + MZ_ZIP_FILE_OPEN_FAILED, + MZ_ZIP_FILE_CREATE_FAILED, + MZ_ZIP_FILE_WRITE_FAILED, + MZ_ZIP_FILE_READ_FAILED, + MZ_ZIP_FILE_CLOSE_FAILED, + MZ_ZIP_FILE_SEEK_FAILED, + MZ_ZIP_FILE_STAT_FAILED, + MZ_ZIP_INVALID_PARAMETER, + MZ_ZIP_INVALID_FILENAME, + MZ_ZIP_BUF_TOO_SMALL, + MZ_ZIP_INTERNAL_ERROR, + MZ_ZIP_FILE_NOT_FOUND, + MZ_ZIP_ARCHIVE_TOO_LARGE, + MZ_ZIP_VALIDATION_FAILED, + MZ_ZIP_WRITE_CALLBACK_FAILED, + MZ_ZIP_TOTAL_ERRORS +} mz_zip_error; + +typedef struct +{ + mz_uint64 m_archive_size; + mz_uint64 m_central_directory_file_ofs; + + /* We only support up to UINT32_MAX files in zip64 mode. */ + mz_uint32 m_total_files; + mz_zip_mode m_zip_mode; + mz_zip_type m_zip_type; + mz_zip_error m_last_error; + + mz_uint64 m_file_offset_alignment; + + mz_alloc_func m_pAlloc; + mz_free_func m_pFree; + mz_realloc_func m_pRealloc; + void *m_pAlloc_opaque; + + mz_file_read_func m_pRead; + mz_file_write_func m_pWrite; + mz_file_needs_keepalive m_pNeeds_keepalive; + void *m_pIO_opaque; + + mz_zip_internal_state *m_pState; + +} mz_zip_archive; + +typedef struct +{ + mz_zip_archive *pZip; + mz_uint flags; + + int status; + + mz_uint64 read_buf_size, read_buf_ofs, read_buf_avail, comp_remaining, out_buf_ofs, cur_file_ofs; + mz_zip_archive_file_stat file_stat; + void *pRead_buf; + void *pWrite_buf; + + size_t out_blk_remain; + + tinfl_decompressor inflator; + +#ifdef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS + mz_uint padding; +#else + mz_uint file_crc32; +#endif + +} mz_zip_reader_extract_iter_state; + +/* -------- ZIP reading */ + +/* Inits a ZIP archive reader. */ +/* These functions read and validate the archive's central directory. */ +MINIZ_EXPORT mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags); + +MINIZ_EXPORT mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags); + +#ifndef MINIZ_NO_STDIO +/* Read a archive from a disk file. */ +/* file_start_ofs is the file offset where the archive actually begins, or 0. */ +/* actual_archive_size is the true total size of the archive, which may be smaller than the file's actual size on disk. If zero the entire file is treated as the archive. */ +MINIZ_EXPORT mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags); +MINIZ_EXPORT mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size); + +/* Read an archive from an already opened FILE, beginning at the current file position. */ +/* The archive is assumed to be archive_size bytes long. If archive_size is 0, then the entire rest of the file is assumed to contain the archive. */ +/* The FILE will NOT be closed when mz_zip_reader_end() is called. */ +MINIZ_EXPORT mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags); +#endif + +/* Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. */ +MINIZ_EXPORT mz_bool mz_zip_reader_end(mz_zip_archive *pZip); + +/* -------- ZIP reading or writing */ + +/* Clears a mz_zip_archive struct to all zeros. */ +/* Important: This must be done before passing the struct to any mz_zip functions. */ +MINIZ_EXPORT void mz_zip_zero_struct(mz_zip_archive *pZip); + +MINIZ_EXPORT mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip); +MINIZ_EXPORT mz_zip_type mz_zip_get_type(mz_zip_archive *pZip); + +/* Returns the total number of files in the archive. */ +MINIZ_EXPORT mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip); + +MINIZ_EXPORT mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip); +MINIZ_EXPORT mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip); +MINIZ_EXPORT MZ_FILE *mz_zip_get_cfile(mz_zip_archive *pZip); + +/* Reads n bytes of raw archive data, starting at file offset file_ofs, to pBuf. */ +MINIZ_EXPORT size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n); + +/* All mz_zip funcs set the m_last_error field in the mz_zip_archive struct. These functions retrieve/manipulate this field. */ +/* Note that the m_last_error functionality is not thread safe. */ +MINIZ_EXPORT mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num); +MINIZ_EXPORT mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip); +MINIZ_EXPORT mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip); +MINIZ_EXPORT mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip); +MINIZ_EXPORT const char *mz_zip_get_error_string(mz_zip_error mz_err); + +/* MZ_TRUE if the archive file entry is a directory entry. */ +MINIZ_EXPORT mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index); + +/* MZ_TRUE if the file is encrypted/strong encrypted. */ +MINIZ_EXPORT mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index); + +/* MZ_TRUE if the compression method is supported, and the file is not encrypted, and the file is not a compressed patch file. */ +MINIZ_EXPORT mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index); + +/* Retrieves the filename of an archive file entry. */ +/* Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. */ +MINIZ_EXPORT mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size); + +/* Attempts to locates a file in the archive's central directory. */ +/* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */ +/* Returns -1 if the file cannot be found. */ +MINIZ_EXPORT int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags); +MINIZ_EXPORT mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index); + +/* Returns detailed information about an archive file entry. */ +MINIZ_EXPORT mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat); + +/* MZ_TRUE if the file is in zip64 format. */ +/* A file is considered zip64 if it contained a zip64 end of central directory marker, or if it contained any zip64 extended file information fields in the central directory. */ +MINIZ_EXPORT mz_bool mz_zip_is_zip64(mz_zip_archive *pZip); + +/* Returns the total central directory size in bytes. */ +/* The current max supported size is <= MZ_UINT32_MAX. */ +MINIZ_EXPORT size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip); + +/* Extracts a archive file to a memory buffer using no memory allocation. */ +/* There must be at least enough room on the stack to store the inflator's state (~34KB or so). */ +MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); +MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size); + +/* Extracts a archive file to a memory buffer. */ +MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags); +MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags); + +/* Extracts a archive file to a dynamically allocated heap buffer. */ +/* The memory will be allocated via the mz_zip_archive's alloc/realloc functions. */ +/* Returns NULL and sets the last error on failure. */ +MINIZ_EXPORT void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags); +MINIZ_EXPORT void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags); + +/* Extracts a archive file using a callback function to output the file's data. */ +MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); +MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags); + +/* Extract a file iteratively */ +MINIZ_EXPORT mz_zip_reader_extract_iter_state* mz_zip_reader_extract_iter_new(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags); +MINIZ_EXPORT mz_zip_reader_extract_iter_state* mz_zip_reader_extract_file_iter_new(mz_zip_archive *pZip, const char *pFilename, mz_uint flags); +MINIZ_EXPORT size_t mz_zip_reader_extract_iter_read(mz_zip_reader_extract_iter_state* pState, void* pvBuf, size_t buf_size); +MINIZ_EXPORT mz_bool mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state* pState); + +#ifndef MINIZ_NO_STDIO +/* Extracts a archive file to a disk file and sets its last accessed and modified times. */ +/* This function only extracts files, not archive directory records. */ +MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags); +MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags); + +/* Extracts a archive file starting at the current position in the destination FILE stream. */ +MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *File, mz_uint flags); +MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags); +#endif + +#if 0 +/* TODO */ + typedef void *mz_zip_streaming_extract_state_ptr; + mz_zip_streaming_extract_state_ptr mz_zip_streaming_extract_begin(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags); + mz_uint64 mz_zip_streaming_extract_get_size(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState); + mz_uint64 mz_zip_streaming_extract_get_cur_ofs(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState); + mz_bool mz_zip_streaming_extract_seek(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, mz_uint64 new_ofs); + size_t mz_zip_streaming_extract_read(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, void *pBuf, size_t buf_size); + mz_bool mz_zip_streaming_extract_end(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState); +#endif + +/* This function compares the archive's local headers, the optional local zip64 extended information block, and the optional descriptor following the compressed data vs. the data in the central directory. */ +/* It also validates that each file can be successfully uncompressed unless the MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY is specified. */ +MINIZ_EXPORT mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags); + +/* Validates an entire archive by calling mz_zip_validate_file() on each file. */ +MINIZ_EXPORT mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags); + +/* Misc utils/helpers, valid for ZIP reading or writing */ +MINIZ_EXPORT mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr); +#ifndef MINIZ_NO_STDIO +MINIZ_EXPORT mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr); +#endif + +/* Universal end function - calls either mz_zip_reader_end() or mz_zip_writer_end(). */ +MINIZ_EXPORT mz_bool mz_zip_end(mz_zip_archive *pZip); + +/* -------- ZIP writing */ + +#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS + +/* Inits a ZIP archive writer. */ +/*Set pZip->m_pWrite (and pZip->m_pIO_opaque) before calling mz_zip_writer_init or mz_zip_writer_init_v2*/ +/*The output is streamable, i.e. file_ofs in mz_file_write_func always increases only by n*/ +MINIZ_EXPORT mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size); +MINIZ_EXPORT mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags); + +MINIZ_EXPORT mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size); +MINIZ_EXPORT mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags); + +#ifndef MINIZ_NO_STDIO +MINIZ_EXPORT mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning); +MINIZ_EXPORT mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags); +MINIZ_EXPORT mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint flags); +#endif + +/* Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. */ +/* For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. */ +/* For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). */ +/* Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. */ +/* Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before */ +/* the archive is finalized the file's central directory will be hosed. */ +MINIZ_EXPORT mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename); +MINIZ_EXPORT mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags); + +/* Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. */ +/* To add a directory entry, call this method with an archive name ending in a forwardslash with an empty buffer. */ +/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */ +MINIZ_EXPORT mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags); + +/* Like mz_zip_writer_add_mem(), except you can specify a file comment field, and optionally supply the function with already compressed data. */ +/* uncomp_size/uncomp_crc32 are only used if the MZ_ZIP_FLAG_COMPRESSED_DATA flag is specified. */ +MINIZ_EXPORT mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + mz_uint64 uncomp_size, mz_uint32 uncomp_crc32); + +MINIZ_EXPORT mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, + mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char *user_extra_data_local, mz_uint user_extra_data_local_len, + const char *user_extra_data_central, mz_uint user_extra_data_central_len); + +/* Adds the contents of a file to an archive. This function also records the disk file's modified time into the archive. */ +/* File data is supplied via a read callback function. User mz_zip_writer_add_(c)file to add a file directly.*/ +MINIZ_EXPORT mz_bool mz_zip_writer_add_read_buf_callback(mz_zip_archive *pZip, const char *pArchive_name, mz_file_read_func read_callback, void* callback_opaque, mz_uint64 max_size, + const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len, + const char *user_extra_data_central, mz_uint user_extra_data_central_len); + + +#ifndef MINIZ_NO_STDIO +/* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */ +/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */ +MINIZ_EXPORT mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); + +/* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */ +MINIZ_EXPORT mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 max_size, + const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len, + const char *user_extra_data_central, mz_uint user_extra_data_central_len); +#endif + +/* Adds a file to an archive by fully cloning the data from another archive. */ +/* This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data (it may add or modify the zip64 local header extra data field), and the optional descriptor following the compressed data. */ +MINIZ_EXPORT mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index); + +/* Finalizes the archive by writing the central directory records followed by the end of central directory record. */ +/* After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). */ +/* An archive must be manually finalized by calling this function for it to be valid. */ +MINIZ_EXPORT mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip); + +/* Finalizes a heap archive, returning a pointer to the heap block and its size. */ +/* The heap block will be allocated using the mz_zip_archive's alloc/realloc callbacks. */ +MINIZ_EXPORT mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize); + +/* Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. */ +/* Note for the archive to be valid, it *must* have been finalized before ending (this function will not do it for you). */ +MINIZ_EXPORT mz_bool mz_zip_writer_end(mz_zip_archive *pZip); + +/* -------- Misc. high-level helper functions: */ + +/* mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. */ +/* Note this is NOT a fully safe operation. If it crashes or dies in some way your archive can be left in a screwed up state (without a central directory). */ +/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */ +/* TODO: Perhaps add an option to leave the existing central dir in place in case the add dies? We could then truncate the file (so the old central dir would be at the end) if something goes wrong. */ +MINIZ_EXPORT mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags); +MINIZ_EXPORT mz_bool mz_zip_add_mem_to_archive_file_in_place_v2(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr); + +#ifndef MINIZ_NO_STDIO +/* Reads a single file from an archive into a heap block. */ +/* If pComment is not NULL, only the file with the specified comment will be extracted. */ +/* Returns NULL on failure. */ +MINIZ_EXPORT void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags); +MINIZ_EXPORT void *mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename, const char *pArchive_name, const char *pComment, size_t *pSize, mz_uint flags, mz_zip_error *pErr); +#endif + +#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */ + +#ifdef __cplusplus +} +#endif + +#endif /* MINIZ_NO_ARCHIVE_APIS */ diff --git a/third_party/microprofile/microprofile.cpp b/third_party/microprofile/microprofile.cpp index 328e08a..25b808d 100644 --- a/third_party/microprofile/microprofile.cpp +++ b/third_party/microprofile/microprofile.cpp @@ -62,6 +62,7 @@ void MicroProfileGpuSetCallbacks(MicroProfileGpuInsertTimeStamp_CB InsertTimeSta #define PRIu64 "llu" #define PRId64 "lld" #else +#include #include #endif diff --git a/third_party/tracy/.clang-format b/third_party/tracy/.clang-format new file mode 100644 index 0000000..c2c9d8b --- /dev/null +++ b/third_party/tracy/.clang-format @@ -0,0 +1,18 @@ +# Empirical format config, based on observed style guide +# Use this only as an help to fit the surrounding code style - don't reformat whole files at once +--- +BasedOnStyle: LLVM +AllowShortIfStatementsOnASingleLine: WithoutElse +AllowShortLoopsOnASingleLine: true +AlwaysBreakTemplateDeclarations: Yes +BreakBeforeBraces: Allman +BreakConstructorInitializers: BeforeComma +BreakStringLiterals: false +ColumnLimit: 120 +FixNamespaceComments: false +IndentPPDirectives: AfterHash +IndentWidth: 4 +PointerAlignment: Left +SpaceBeforeParens: Never +SpacesInParentheses: true +TabWidth: 4 diff --git a/third_party/tracy/.clang-tidy b/third_party/tracy/.clang-tidy new file mode 100644 index 0000000..3241eed --- /dev/null +++ b/third_party/tracy/.clang-tidy @@ -0,0 +1,61 @@ +--- +Checks: +' + clang-diagnostic-*, + clang-analyzer-*, + bugprone-*, + google-*, + misc-*, + modernize-*, + performance-*, + readability-*, + -bugprone-easily-swappable-parameters, + -bugprone-implicit-widening-of-multiplication-result, + -bugprone-narrowing-conversions, + -bugprone-reserved-identifier, + -google-readability-braces-around-statements, + -google-readability-casting, + -google-readability-function-size, + -google-readability-todo, + -google-readability-namespace-comments, + -misc-confusable-identifiers, + -misc-no-recursion, + -modernize-avoid-c-arrays, + -modernize-deprecated-headers, + -modernize-use-default-member-init, + -modernize-use-trailing-return-type, + -performance-no-int-to-ptr, + -readability-braces-around-statements, + -readability-else-after-return, + -readability-function-cognitive-complexity, + -readability-identifier-length, + -readability-implicit-bool-conversion, + -readability-isolate-declaration, + -readability-magic-numbers, + -readability-qualified-auto, + -readability-uppercase-literal-suffix +' +WarningsAsErrors: '' +HeaderFilterRegex: '' +FormatStyle: none +CheckOptions: + llvm-else-after-return.WarnOnConditionVariables: 'false' + modernize-loop-convert.MinConfidence: reasonable + modernize-replace-auto-ptr.IncludeStyle: llvm + modernize-pass-by-value.IncludeStyle: llvm + google-readability-namespace-comments.ShortNamespaceLines: '10' + google-readability-namespace-comments.SpacesBeforeComments: '2' + cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: 'true' + google-readability-braces-around-statements.ShortStatementLines: '1' + cert-err33-c.CheckedFunctions: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;' + modernize-loop-convert.MaxCopySize: '16' + cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU' + cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField: 'false' + cert-str34-c.DiagnoseSignedUnsignedCharComparisons: 'false' + modernize-use-nullptr.NullMacros: 'NULL' + llvm-qualified-auto.AddConstToQualified: 'false' + modernize-loop-convert.NamingStyle: CamelCase + llvm-else-after-return.WarnOnUnfixable: 'false' + google-readability-function-size.StatementThreshold: '800' +... + diff --git a/third_party/tracy/.github/FUNDING.yml b/third_party/tracy/.github/FUNDING.yml new file mode 100644 index 0000000..976135c --- /dev/null +++ b/third_party/tracy/.github/FUNDING.yml @@ -0,0 +1 @@ +github: wolfpld diff --git a/third_party/tracy/.github/sponsor.png b/third_party/tracy/.github/sponsor.png new file mode 100644 index 0000000000000000000000000000000000000000..ce689b149a50b86be270cbec5f62732f2c5600f2 GIT binary patch literal 1036 zcmV+n1oQieP)?DX{ay!7_G^Y***>+|yUyYcn9 z)%W@F>GSdQy4Cji)b{w(_4w)P?B?q1^x^O3=<4&}@3r^&wf6b7_V~2*`19B5^4IF} z*6Q%p>GI9x^UUVi+uZWY=JnW{^w^v9*PHRm<=5HT@XF=$*P7PY+Va+#($v+^)YtLA z-_Fz3&Ck)y&d|%w(96xx%gxWp&Ctut&+)d~%FNI3w%f_f&dAKp@3q^=%g)Ek&Bw~k z#>&mc$<4*d&Be*gl-T*i$jp@2`IOiAlh*k1x0>&&*6*p-^tgKSxOwuodG4Um?Ul^# zl+2X4`R~y{BbiM3zy_J}}>}t8}YPjra zxa(=S>tD0#U$g2|uj*5;OqknDm)hz|sYgp900061NklkIcb}a;#_0nO zu9THV>$UKK$#H}b+I?Wr01R-3Ece#d)|=if@0Poe+@gZ#N!-IvoJCan`jDz?b2N1a)B9JrQ2AGyfU8Irg@6yGuZ!i0TFJ7eRDZhF<{)(Ufo41eJh!WqB-iCZ7HsX1}W(zyHNKcTo zIopm}kRV;8U-o^Q?VUC^KWA%{1N8NpQJhZ2zqHvFx9V(WI>PY3CP-%z!aslqgwz5X zN!P#co7W%H$LyvO&xaLX3E3!#(t+KAF&KAJl0UkV>77WC4xAQ@o9V=VO`mwg&IC+8 zW@i$*Bc8Gn(G9Jc%+fPkA-kDTd_-n*Hb8dkG!xye+3*c&Ohsj&tqN5D0000 + diff --git a/third_party/tracy/.vscode/extensions.json b/third_party/tracy/.vscode/extensions.json new file mode 100644 index 0000000..0a0f1b4 --- /dev/null +++ b/third_party/tracy/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "llvm-vs-code-extensions.vscode-clangd", + "vadimcn.vscode-lldb", + "ms-vscode.cmake-tools" + ] +} \ No newline at end of file diff --git a/third_party/tracy/.vscode/launch.json b/third_party/tracy/.vscode/launch.json new file mode 100644 index 0000000..95bd3e5 --- /dev/null +++ b/third_party/tracy/.vscode/launch.json @@ -0,0 +1,13 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch", + "type": "lldb", + "request": "launch", + "program": "${command:cmake.launchTargetPath}", + "args": [], + "cwd": "${workspaceFolder}" + } + ] +} diff --git a/third_party/tracy/.vscode/settings.json b/third_party/tracy/.vscode/settings.json new file mode 100644 index 0000000..52d602c --- /dev/null +++ b/third_party/tracy/.vscode/settings.json @@ -0,0 +1,20 @@ +{ + "cmake.configureOnOpen": true, + "cmake.sourceDirectory": [ + "${workspaceFolder}/profiler", + "${workspaceFolder}/capture", + "${workspaceFolder}/csvexport", + "${workspaceFolder}/import", + "${workspaceFolder}/update", + "${workspaceFolder}/test", + "${workspaceFolder}", + ], + "cmake.buildDirectory": "${sourceDirectory}/build", + "cmake.autoSelectActiveFolder": false, + "cmake.options.advanced": { + "folder": { "statusBarVisibility": "visible" }, + "variant": { "statusBarVisibility": "compact" } + }, + "cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json", + "lldb.launch.initCommands": ["command script import ${workspaceRoot}/extra/natvis.py"], +} diff --git a/third_party/tracy/CMakeLists.txt b/third_party/tracy/CMakeLists.txt new file mode 100644 index 0000000..bef1298 --- /dev/null +++ b/third_party/tracy/CMakeLists.txt @@ -0,0 +1,273 @@ +cmake_minimum_required(VERSION 3.10) + +# Run version helper script +include(cmake/version.cmake) + +project(Tracy LANGUAGES CXX VERSION ${TRACY_VERSION_STRING}) + +file(GENERATE OUTPUT .gitignore CONTENT "*") + +if(${BUILD_SHARED_LIBS}) + set(DEFAULT_STATIC OFF) +else() + set(DEFAULT_STATIC ON) +endif() + +option(TRACY_STATIC "Whether to build Tracy as a static library" ${DEFAULT_STATIC}) +option(TRACY_Fortran "Build Fortran bindings" OFF) +option(TRACY_LTO "Enable Link-Time optimization" OFF) + +if(TRACY_Fortran) + enable_language(Fortran) + set(CMAKE_Fortran_VERSION 2003) +endif() + +if(TRACY_LTO OR CMAKE_INTERPROCEDURAL_OPTIMIZATION) + include(CheckIPOSupported) + check_ipo_supported(RESULT LTO_SUPPORTED) + if(NOT LTO_SUPPORTED) + message(WARNING "LTO is not supported!") + endif() +else() + set(LTO_SUPPORTED OFF) +endif() + +find_package(Threads REQUIRED) + +set(TRACY_PUBLIC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/public) + +if(LTO_SUPPORTED) + set(TRACY_VISIBILITY "OBJECT") +elseif(TRACY_STATIC) + set(TRACY_VISIBILITY "STATIC") +else() + set(TRACY_VISIBILITY "SHARED") +endif() + +add_library(TracyClient ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.cpp") +target_compile_features(TracyClient PUBLIC cxx_std_11) +set_target_properties(TracyClient PROPERTIES INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED}) +target_include_directories(TracyClient SYSTEM PUBLIC + $ + $) +target_link_libraries( + TracyClient + PUBLIC + Threads::Threads + ${CMAKE_DL_LIBS} +) + +if(TRACY_Fortran) + add_library(TracyClientF90 ${TRACY_VISIBILITY} "${TRACY_PUBLIC_DIR}/TracyClient.F90") + target_include_directories(TracyClientF90 PUBLIC + $ + $) + target_link_libraries( + TracyClientF90 + PUBLIC + TracyClient + ) + set_target_properties(TracyClientF90 PROPERTIES Fortran_MODULE_DIRECTORY ${PROJECT_BINARY_DIR} + INTERPROCEDURAL_OPTIMIZATION ${LTO_SUPPORTED}) +endif() + +# Public dependency on some libraries required when using Mingw +if(WIN32 AND ${CMAKE_CXX_COMPILER_ID} MATCHES "GNU|Clang") + target_link_libraries(TracyClient PUBLIC ws2_32 dbghelp) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + find_library(EXECINFO_LIBRARY NAMES execinfo REQUIRED) + target_link_libraries(TracyClient PUBLIC ${EXECINFO_LIBRARY}) +endif() + +if(TRACY_LIBUNWIND_BACKTRACE) + include(FindPkgConfig) + pkg_check_modules(unwind REQUIRED libunwind) + target_include_directories(TracyClient INTERFACE ${unwind_INCLUDE_DIRS}) + target_link_libraries(TracyClient INTERFACE ${unwind_LINK_LIBRARIES}) +endif() + +if(TRACY_DEBUGINFOD) + include(FindPkgConfig) + pkg_check_modules(debuginfod REQUIRED libdebuginfod) + target_include_directories(TracyClient INTERFACE ${debuginfod_INCLUDE_DIRS}) + target_link_libraries(TracyClient INTERFACE ${debuginfod_LINK_LIBRARIES}) +endif() + +add_library(Tracy::TracyClient ALIAS TracyClient) +if(TRACY_Fortran) + add_library(Tracy::TracyClient_Fortran ALIAS TracyClientF90) +endif() + +macro(set_option option help value) + option(${option} ${help} ${value}) + if(${option}) + message(STATUS "${option}: ON") + target_compile_definitions(TracyClient PUBLIC ${option}) + else() + message(STATUS "${option}: OFF") + endif() +endmacro() + +set_option(TRACY_ENABLE "Enable profiling" ON) +set_option(TRACY_ON_DEMAND "On-demand profiling" OFF) +set_option(TRACY_CALLSTACK "Enforce callstack collection for tracy regions" OFF) +set_option(TRACY_NO_CALLSTACK "Disable all callstack related functionality" OFF) +set_option(TRACY_NO_CALLSTACK_INLINES "Disables the inline functions in callstacks" OFF) +set_option(TRACY_ONLY_LOCALHOST "Only listen on the localhost interface" OFF) +set_option(TRACY_NO_BROADCAST "Disable client discovery by broadcast to local network" OFF) +set_option(TRACY_ONLY_IPV4 "Tracy will only accept connections on IPv4 addresses (disable IPv6)" OFF) +set_option(TRACY_NO_CODE_TRANSFER "Disable collection of source code" OFF) +set_option(TRACY_NO_CONTEXT_SWITCH "Disable capture of context switches" OFF) +set_option(TRACY_NO_EXIT "Client executable does not exit until all profile data is sent to server" OFF) +set_option(TRACY_NO_SAMPLING "Disable call stack sampling" OFF) +set_option(TRACY_NO_VERIFY "Disable zone validation for C API" OFF) +set_option(TRACY_NO_VSYNC_CAPTURE "Disable capture of hardware Vsync events" OFF) +set_option(TRACY_NO_FRAME_IMAGE "Disable the frame image support and its thread" OFF) +set_option(TRACY_NO_SYSTEM_TRACING "Disable systrace sampling" OFF) +set_option(TRACY_PATCHABLE_NOPSLEDS "Enable nopsleds for efficient patching by system-level tools (e.g. rr)" OFF) +set_option(TRACY_DELAYED_INIT "Enable delayed initialization of the library (init on first call)" OFF) +set_option(TRACY_MANUAL_LIFETIME "Enable the manual lifetime management of the profile" OFF) +set_option(TRACY_FIBERS "Enable fibers support" OFF) +set_option(TRACY_NO_CRASH_HANDLER "Disable crash handling" OFF) +set_option(TRACY_TIMER_FALLBACK "Use lower resolution timers" OFF) +set_option(TRACY_LIBUNWIND_BACKTRACE "Use libunwind backtracing where supported" OFF) +set_option(TRACY_SYMBOL_OFFLINE_RESOLVE "Instead of full runtime symbol resolution, only resolve the image path and offset to enable offline symbol resolution" OFF) +set_option(TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT "Enable libbacktrace to support dynamically loaded elfs in symbol resolution resolution after the first symbol resolve operation" OFF) +set_option(TRACY_DEBUGINFOD "Enable debuginfod support" OFF) + +# advanced +set_option(TRACY_VERBOSE "[advanced] Verbose output from the profiler" OFF) +mark_as_advanced(TRACY_VERBOSE) +set_option(TRACY_DEMANGLE "[advanced] Don't use default demangling function - You'll need to provide your own" OFF) +mark_as_advanced(TRACY_DEMANGLE) + +# handle incompatible combinations +if(TRACY_MANUAL_LIFETIME AND NOT TRACY_DELAYED_INIT) + message(FATAL_ERROR "TRACY_MANUAL_LIFETIME can not be activated with disabled TRACY_DELAYED_INIT") +endif() + +if(NOT TRACY_STATIC) + target_compile_definitions(TracyClient PRIVATE TRACY_EXPORTS) + target_compile_definitions(TracyClient PUBLIC TRACY_IMPORTS) +endif() + +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) + +set_target_properties(TracyClient PROPERTIES VERSION ${PROJECT_VERSION}) +if(TRACY_Fortran) + set_target_properties(TracyClientF90 PROPERTIES VERSION ${PROJECT_VERSION}) +endif() + +set(tracy_includes + ${TRACY_PUBLIC_DIR}/tracy/TracyC.h + ${TRACY_PUBLIC_DIR}/tracy/Tracy.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyCUDA.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyD3D11.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyD3D12.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyLua.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyMetal.hmm + ${TRACY_PUBLIC_DIR}/tracy/TracyOpenCL.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyOpenGL.hpp + ${TRACY_PUBLIC_DIR}/tracy/TracyVulkan.hpp) + +set(client_includes + ${TRACY_PUBLIC_DIR}/client/tracy_concurrentqueue.h + ${TRACY_PUBLIC_DIR}/client/tracy_rpmalloc.hpp + ${TRACY_PUBLIC_DIR}/client/tracy_SPSCQueue.h + ${TRACY_PUBLIC_DIR}/client/TracyKCore.hpp + ${TRACY_PUBLIC_DIR}/client/TracyArmCpuTable.hpp + ${TRACY_PUBLIC_DIR}/client/TracyCallstack.h + ${TRACY_PUBLIC_DIR}/client/TracyCallstack.hpp + ${TRACY_PUBLIC_DIR}/client/TracyCpuid.hpp + ${TRACY_PUBLIC_DIR}/client/TracyDebug.hpp + ${TRACY_PUBLIC_DIR}/client/TracyDxt1.hpp + ${TRACY_PUBLIC_DIR}/client/TracyFastVector.hpp + ${TRACY_PUBLIC_DIR}/client/TracyLock.hpp + ${TRACY_PUBLIC_DIR}/client/TracyProfiler.hpp + ${TRACY_PUBLIC_DIR}/client/TracyRingBuffer.hpp + ${TRACY_PUBLIC_DIR}/client/TracyScoped.hpp + ${TRACY_PUBLIC_DIR}/client/TracyStringHelpers.hpp + ${TRACY_PUBLIC_DIR}/client/TracySysPower.hpp + ${TRACY_PUBLIC_DIR}/client/TracySysTime.hpp + ${TRACY_PUBLIC_DIR}/client/TracySysTrace.hpp + ${TRACY_PUBLIC_DIR}/client/TracyThread.hpp) + +set(common_includes + ${TRACY_PUBLIC_DIR}/common/tracy_lz4.hpp + ${TRACY_PUBLIC_DIR}/common/tracy_lz4hc.hpp + ${TRACY_PUBLIC_DIR}/common/TracyAlign.hpp + ${TRACY_PUBLIC_DIR}/common/TracyAlloc.hpp + ${TRACY_PUBLIC_DIR}/common/TracyApi.h + ${TRACY_PUBLIC_DIR}/common/TracyColor.hpp + ${TRACY_PUBLIC_DIR}/common/TracyForceInline.hpp + ${TRACY_PUBLIC_DIR}/common/TracyMutex.hpp + ${TRACY_PUBLIC_DIR}/common/TracyProtocol.hpp + ${TRACY_PUBLIC_DIR}/common/TracyQueue.hpp + ${TRACY_PUBLIC_DIR}/common/TracySocket.hpp + ${TRACY_PUBLIC_DIR}/common/TracyStackFrames.hpp + ${TRACY_PUBLIC_DIR}/common/TracySystem.hpp + ${TRACY_PUBLIC_DIR}/common/TracyUwp.hpp + ${TRACY_PUBLIC_DIR}/common/TracyYield.hpp) + +install(TARGETS TracyClient + EXPORT TracyConfig + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT lib) +if(TRACY_Fortran) + install(TARGETS TracyClientF90 + EXPORT TracyConfig + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT lib) +endif() +# Export targets to build tree root +export(TARGETS TracyClient + NAMESPACE Tracy:: + FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake) +if(TRACY_Fortran) + export(TARGETS TracyClientF90 + NAMESPACE Tracy:: + APPEND + FILE ${CMAKE_BINARY_DIR}/TracyTargets.cmake) +endif() +install(FILES ${tracy_includes} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/tracy) +install(FILES ${client_includes} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/client) +install(FILES ${common_includes} + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy/common) +if(TRACY_Fortran) + if(${CMAKE_Fortran_COMPILER_ID} MATCHES "Cray") + install(FILES ${PROJECT_BINARY_DIR}/TRACY.mod + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy) + else() + install(FILES ${PROJECT_BINARY_DIR}/tracy.mod + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/tracy) + endif() +endif() +install(EXPORT TracyConfig + NAMESPACE Tracy:: + FILE TracyTargets.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +include(CMakePackageConfigHelpers) +configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/Config.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/TracyConfig.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) + +option(TRACY_CLIENT_PYTHON "Whether to build Tracy python client library" OFF) + +if(TRACY_CLIENT_PYTHON) + if(TRACY_STATIC) + message(FATAL_ERROR "Python-bindings require a shared client library") + endif() + + add_subdirectory(python) +endif() diff --git a/third_party/tracy/Config.cmake.in b/third_party/tracy/Config.cmake.in new file mode 100644 index 0000000..fc913ab --- /dev/null +++ b/third_party/tracy/Config.cmake.in @@ -0,0 +1,6 @@ +@PACKAGE_INIT@ + +include(CMakeFindDependencyMacro) +find_dependency(Threads REQUIRED) + +include("${CMAKE_CURRENT_LIST_DIR}/TracyTargets.cmake") \ No newline at end of file diff --git a/third_party/tracy/LICENSE b/third_party/tracy/LICENSE new file mode 100644 index 0000000..6201608 --- /dev/null +++ b/third_party/tracy/LICENSE @@ -0,0 +1,27 @@ +Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the +3-clause BSD license. + +Copyright (c) 2017-2025, Bartosz Taudul +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third_party/tracy/NEWS b/third_party/tracy/NEWS new file mode 100644 index 0000000..003fe61 --- /dev/null +++ b/third_party/tracy/NEWS @@ -0,0 +1,1331 @@ +Note: There is no guarantee that version mismatched client and server will +be able to talk with each other. Network protocol breakages won't be listed +here. + +v0.12.2 (2025-06-25) +-------------------- + +- Fixed builds made out of git checkout directory. +- Added range limits for flame graph. +- Fixed wayland include paths for distros that use non-standard package + layouts. +- Workarounded MinGW build problems. Safe symbol retrieval is not available + on this platform. +- Fixed Lua bindings when TRACY_NO_CALLSTACK is defined. + + +v0.12.1 (2025-06-07) +-------------------- + +- Fixed window size calculation on macOS, most notably enabling the vertical + timeline scroll bar. +- Made debug builds of the GUI profiler work with broken Apple compiler. +- Fixed profiler compilation when build directory is outside the source + directory. +- Set proper include path when using CMake integration. +- Added the Tracy Metal and CUDA headers to CMake install configuration. +- Documented flame graphs. + + +v0.12.0 (2025-05-30) +-------------------- + +- Enabled workaround for MSVC runtime library SNAFU, which manifested with + the profiler executables crashing at startup inside mutex code. +- CPU topology data now includes CPU die information. +- Clients running under Wine will now report that in the trace info. +- Added flame graph. +- The Git ref information for the build is now included in the about dialog. +- Added support for clipboard copy and paste on Wayland. +- The welcome dialog client address entry field will now trim the entered + address, so that stray spaces at the start and the end are removed. This + should reduce the amount of user precision required when copy pasting the + address from somewhere else. +- GPU profiling is now available with Metal and CUDA. +- Profiling zones can now optionally inherit their parent color. +- It is no longer needed to have up-to-date copy of wayland-protocols + installed. CMake will download the required version from GitHub. +- Added option to show the top inline in symbol statistics list in stead of + the symbol name. +- Parallel sorting is now performed with PPQSort (which removes potential + dependency on TBB). +- Added CMake option TRACY_DEBUGINFOD to enable use of libdebuginfod to + retrieve symbols on Linux clients. +- Added a "custom" label as an option to select for GPU context type. +- Symbol code retrieval is now protected against reading no longer available + memory. +- Clicking on a symbol in the symbol statistics list will now open a popup + with two options. This change intends to make the useful but quite hidden + disassembly view more discoverable. + - "View symbol" shows the symbol code disassembly. It was previously + available by right-click on the source file name. + - "Sample entry stacks" shows the list window that was previously + opened when the symbol entry was clicked. +- Plots are now extended to the end of the trace, instead of ending at the + last data point. +- Added TracyMemoryDiscard macros to mark that all allocations made in a + certain memory pool were freed. This enables better support for arena + allocators. +- It is now possible to fine-tune horizontal and vertical mouse wheel scroll + sensitivity. +- Added p75 and p90 percentiles in the Find zone window. +- Zone info window will now display (approximate) wall-clock time of when + the zone appeared, in addition to the previously displayed time from the + start of the program. +- Zone values passed via ZoneValue macro will be now also displayed in hex. +- The csvexport utility can now export: + - plots, + - GPU zones, + - zone text. +- Fortran integration is now available. +- Added TRACY_LTO CMake option to enable Link-Time Optimizations. +- Executable image names will now be shortened to just the file name. The + full path is available as a tooltip. Shortening can be disabled with a + "scissors" checkbox. +- Entry stacks can be now also viewed via a button in the symbol view. +- On Wayland the application icon is now set even without the desktop file. +- Lua code can be now automatically instrumented via a hook. +- User text set in zone can be now copied to clipboard. +- The LockMark() macro is now less strict about what object you can pass + to it. It is now possible to pass members, e.g. LockMark(obj.mutex). +- The profiler application now adapts to per-monitor DPI on Windows. +- It is now possible to save the UI scale of the profiler (needs to be + enabled in settings). +- Added thread wakeup visualization. + + +v0.11.1 (2024-08-22) +-------------------- + +- Utilities import-chrome and import-fuchsia now live together in the import + directory. +- Added TRACY_VERBOSE to available CMake options. +- It is now possible to set TRACY_SAMPLING_HZ via a environment variable. +- Thread group hints can be now used to group threads together in the + profiler UI. +- Limit Lua file names to 255 characters, as the source string can contain + the whole script, if loaded with loadstring(). + + +v0.11.0 (2024-07-16) +-------------------- + +- Support for pre-0.9 traces has been dropped. +- The old server-side build system has been replaced by CMake. The client + integration is not affected. Refer to the manual for details. + - Most importantly, a known version of the capstone library is now + downloaded from GitHub. You will need to have git installed for this + to work (there is a CMake option to use the capstone installed on the + system, as was done previously). +- Various Meson fixes. +- Proper way of loading Vulkan calibrated timestamps extension. +- Fixed C API support for GPU tracing when on demand mode is enabled. +- Added a way to resynchronize CPU and GPU timestamps. + - Using calibrated contexts should always be preferred. + - Each synchronization event requires a sync of CPU and GPU, which is + something you always want to avoid. + - This is not exposed as an easy-to-use API available through the GPU + wrappers. +- Added TracyIsStarted macro to check if the profiler has been started. + Using this functionality only makes sense in the manual lifetime mode, + and will always return true in any other mode of operation. +- Added basic QNX support. +- Zmmword is now recognized as an assemble size directive. +- Libunwind can be used for call stack capture on Linux if you build with + the TRACY_LIBUNWIND_BACKTRACE define. +- Preloading symbols for all modules on Windows, which is always performed + on program init, and which can be quite slow, may now be omitted through + the TRACY_NO_DBGHELP_INIT_LOAD define. In this mode, symbols will be + loaded as needed. +- Validation of discontinuous frames has been disabled in on-demand mode. + It's quite likely to connect in the middle of a discontinuous frame, + which resulted in frame end event for a frame that hasn't been started. +- Symbols can be now resolved offline on Windows and Linux. + - Enabled with the TRACY_SYMBOL_OFFLINE_RESOLVE define or env variable. + - The update utility has two additional options: + - -r, which enables resolving symbol and patching stack frames in the + trace. + - -p, which you can use to modify the paths used for symbol resolution. + - Some functionality will be missing if this mode is used. For example, + symbol statistics are unavailable. +- Resolving symbol names on Linux will now use image cache to reduce the + number of dladdr() calls. +- Compiling with the TRACY_LIBBACKTRACE_ELF_DYNLOAD_SUPPORT define will + enable support for run-time updating of known elf ranges in libbacktrace + on Linux. Previously, shared objects dlopened() after libbacktrace init + would not be visible during symbol resolution. +- Zone group count in the Find zone window is now explicitly displayed. +- Instrumentation statistics now display in how many threads each source + location has appeared in. +- Added import tool for fuchsia traces. + - https://fuchsia.dev/fuchsia-src/reference/tracing/trace-format +- Added checks for overflow of source locations. + - As a reminder, Tracy only allows to have 64K unique source locations, + split in half between static and dynamic locations. + - Runtime checks are active during capture and will stop a trace that + goes beyond the limit. + - Load-time checks will stop any broken trace file from loading. +- Opening the source code view that has no associated address in code + (i.e., from the list of instrumented zones, or from the find zone + window) will now search the list of symbols for a function name match. + - In many cases this will result in displaying the full disassembly view + where previously you would only see the source code. + - Matching is performed by string comparisons, which in rare cases may + result in showing false data. + - Press ctrl key while opening source view to keep the old behavior. + - If more than one matching symbol is found (e.g., if two classes have + methods with the same name, or if a template is instantiated in multiple + places in code), it is not possible to tell which of the code locations + the source location corresponds to and only the source code will be + displayed. +- Added TracyNoop macro, which inserts a reference to Tracy's object file + into your application. Use it if you want to use Tracy in sampling mode, + without any manual instrumentation (so no references of your own exist) + and link Tracy as a static library. Linkers will only include library code + if code references it, and this doesn't work as intended with Tracy, as it + ignores global constructors that have side effects. +- ZoneText and ZoneName macros now have a printf-like variant, denoted with + a 'F' postfix. +- The 'tracy_shared_libs' Meson option was removed. Use interface provided + by Meson to set the library type instead. +- Dropped the 'tracy_' prefix from Meson options. The `tracy_enable` option + remains as it was, as it can be inherited from parent projects. +- Fixed display of active / inactive allocations in memory call tree. +- Instrumentation statistics can be now sorted by source location. +- Added option to hide external code frames in call stack view. +- There's now a copy to clipboard button in the statistics view. It copies + the visible rows of either the instrumentation or GPU statistics view to + a CSV string matching a subset of the csvexport format. +- Source file contents can be copied to the clipboard. +- Added key binding for immediate reconnect: Ctrl+Shift+Alt+R. +- Lock markup is now available through the C API. +- Symbol statistics window now allows aggregation of inlined functions in + symbols. +- Cost measurements of inlined functions in the symbol statistics window + can be now relative to the base symbol instead of total program run time. +- ScopedZone and AllocSourceLocation now accept color parameter. Impact on + existing code should be minimal. + - AllocSourceLocation has a new parameter with a default value. + - __tracy_alloc_srcloc and __tracy_alloc_srcloc_name break the existing + API. This can be easily fixed by setting the last parameter to zero. +- To build the profiler GUI with Wayland you now need wayland-scanner and + wayland-protocols to be installed. A reasonably recent release of the + protocols is required, which, as always, is not available on Ubuntu. + Seriously, stop trying to build modern software with that broken distro. +- Fractional DPI scaling is now properly supported on Wayland. +- Added Python bindings. +- The per-line sampling statistics are now also displayed as a percentage + of total program run time. +- The out-of-focus render frame rate reduction can be now disabled in + global settings. +- It is now possible to load source files that are newer than the trace. + The default setting is still to reject such files. +- Memory limit for a capture can be now set, both in the GUI profiler and + in the capture utility. +- Thread list can be now sorted alphabetically. +- It is now possible to adjust plot height. +- Trace comparison statistics were expanded and made more clear. +- Implemented retrieval of kernel symbol code on Linux. +- Added support for multiple compression streams in trace files. This + effectively parallelizes both load and save operations. + - The default save setup is now set to Zstd level 3 with 4 compression + streams. This gives both faster compression time and smaller file size. +- New users will be now eased into the profiler with a set of tutorial + achievements. +- You can now set the timeline options default values in global settings. +- Added a check for program memory being available before symbol retrieval + on Windows. + + +v0.10.0 (2023-10-16) +-------------------- + +- Missed frames region of on-demand captures will be now ignored when + calculating trace time span, zone percentages, etc. + - Due to technicalities information about locks, frame statistics in trace + information window and csvexport utility still include the missed frames + time. +- When source location dynamic zone coloring mode is enabled, collapsed + zones will be now gray-colored. Previously such regions falled back to + showing thread colors, which may have been confusing to users. +- Vulkan contexts can now use VK_EXT_host_query_reset extension. +- System power usage is now reported on x86 Linux. +- Program name displayed in broadcast messages can be now changed with the + TracySetProgramName() macro. +- Zone error markers (red regions and error bars) have been removed for + consistency with how all other profiling events are displayed. +- It is now possible to export messages in the csvexport utility. +- Major overhaul of how timeline items are processed in GUI. + - The process of figuring out what needs to be drawn on the timeline has + been heavily parallelized. + - The impact is especially visible with traces containing large amounts + of data. The framerate improvement in such cases can be ~30x. + - Consequently, the profiler GUI will now produce multi-core spikes when + rendering frames. This may have impact on the profiled application's + performance, if both the application and the profiler GUI are running + on the same machine. If this is a problem, you may consider the capture + utility instead, which is not affected by these changes. Alternatively, + you may disable parallelization in the options menu. + - Most of the timeline item logic has been written from scratch, which + may have taken care of some elusive bugs. +- Added global configuration settings dialog. You can find it in the + profiler's about menu (the wrench icon in the welcome dialog). +- List of found zones in the Find zone menu can be filtered by user text. +- Fixed div-by-zero in cvsexport utility when there was only one zone of + a kind. +- Fixed compatibility problems with FreeBSD. +- Added support for dynamically loaded Vulkan symbols. +- Trace description or filename is now displayed on the window title bar. +- The csvexport utility will now export thread id data. +- Improved compatibility with MSVC projects not defining NOMINMAX. +- Improved compatibility with Linux setups targeting musl as libc. +- Thread safety of Vulkan instrumentation has been reviewed. +- D3D11 and D3D12 instrumentation was rewritten. +- Added support for efficient profiling when running under rr, the record- + replaying debugger. This is enabled with TRACY_PATCHABLE_NOPSLEDS define. +- History of viewed symbols is now preserved and you can go back to + previously displayed entries. + + +v0.9.1 (2023-02-26) +------------------- + +- Support for pre-0.8 traces has been dropped. +- Profiled programs will ignore dlclose() calls. +- Added warning when the profiler interface is run with privilege elevation. + Advice is given to instead run the client with admin rights. +- Switched to official ZEN4 uarch data. +- Handle cases when thread name is set, but not through Tracy facilities. +- Allow customization of source location data through the following macros: + - TracyFunction - defaults to __FUNCTION__ + - TracyFile - defaults to __FILE__ + - TracyLine - defaults to __LINE__ +- Tracy on Linux now targets and requires Wayland by default. + - Please don't ask about window decorations on Gnome. Current behavior is + the intended behavior. Gnome does not want windows to have decorations, + and Tracy respects this choice. If you find this problematic, use a + desktop environment that actually listens to its users. + - Pass LEGACY=1 parameter to make, if you want to instead rely on the GLFW + library, like before. + - Other platforms still use GLFW. +- Compare traces menu can now display source code differences between two + traces. +- Assembly listings saved to files have been improved. + - Listings are now annotated with source line information. + - To improve compatibility with external tools comments are now prefixed + with '#' instead of ';'. +- Histogram tooltip will now also show left/right counts. +- Tracy now actively manages timeline vertical scroll offset in order to keep + the thread under the mouse cursor in the same place on screen. +- Removed support for AT&T assembly syntax. +- Tracy will not display notification if the file selector can't be used. + Possible reasons for failure include lack of xdg-desktop-portal. +- Using the TRACY_NO_CRASH_HANDLER define will disable handling of + application crashes by the profiler. +- Tracy will now query jump and call target addresses. This enables discovery + of target function names, even if such function has no samples and is not + present in any call stack. + + +v0.9.0 (2022-10-26) +------------------- + +- Attention! All the header and source files used for integrating Tracy with + applications were moved to the public/ directory. This will break your + integration! + - To fix this, update the source and include directories lists to point to + the new location. + - Tracy include files directly referenced by the client were moved to + tracy/ subdirectory, to facilitate setups which previously had Tracy + checkout parent directory in the include paths list (i.e. when you + included "tracy/Tracy.hpp"). + - Previously, if you have included the Tracy checkout directory in your + project include directories list (i.e. you could include "Tracy.hpp"), + this could result in third-party library conflicts, e.g. with ImGui. + Such scenarios are no longer the case. +- Tracy macros now require to be terminated with a semicolon. +- The undocumented ___tracy_demangle() function API has been changed. Please + refer to the source code for further instructions. +- The parameter callback and its registration macro have been extended to + include user data pointer. You will need to update your code accordingly. +- Plots visualization has been improved. + - Each plot now has its own color, which can also be defined by the user. + - The area below the plot is now optionally filled with a color. + - Plots can now also be configured to be staircase instead of smooth. This + new setting is appropriate for many inputs where only discrete values + make sense, e.g. the memory allocation plot. + - The API for TracyPlotConfig() macro has been changed. Please refer to + the manual to see how you can fix this. +- Some text labels in the user interface are now more easy to read. +- The profiler will now instruct the user in the UI on what can be done, if + the send queue is slow to process (typically due to symbol resolution). +- If a client with an incompatible protocol is discovered, Tracy will now + try to show which versions can be used to handle the connection. +- Messages list in zone info window can now show messages exclusive to the + zone, filtering out the messages emitted from child zones. +- Added capture of vertical synchronization timings on Linux. +- The range of frame bar colors in the frames overview on top of the screen + can be now controlled with the "Target FPS" entry box in the options menu. + - The "Draw frame targets" option does not need to be selected. + - Previously the hardcoded FPS target thresholds were: 30, 60, 144 FPS. + - Currently the FPS target threshold is: half of target, target, twice the + target. +- Reworked the way zone names are shortened. + - Previously shortening supported only namespace removal, in a way that + didn't consider function parameters or template arguments. + - Shortening to one-letter namespace chains is no longer available. + - The new shortening rules first perform normalization of the function name. + - The function const qualifier is removed. + - Common return types are removed. + - All function parameters and all template arguments are removed. + - The next steps consist of repeated removal of namespaces, starting with + the most outermost one. + - While the old process was all or nothing, the new implementation by + default will dynamically adjust to the space available, trying to show + the most context possible. + - It is also possible to completely disable shortening, or require that it + is always performed in full. + - Function name normalization is enabled by default, even if there is space + to show full function name. This can be changed in options. + - Previously shortening was only applied to the zone names displayed on the + timeline. Currently this process will also apply to all other places in + the UI where function names are displayed. However, in these cases the + function names will only be normalized. + - Full function names are still available as tooltips, or in fine print if + the normalized name is already displayed in a tooltip. + - This functionality is disabled if zone name shortening is disabled. +- Added context menu for timeline labels. Currently the only option is to hide + the selected thread, plot, etc. +- You can now provide custom source file contents through a profiler callback. +- Exposed Tracy version to client applications (available through the + common/TracyVersion.hpp header file). +- D3D12 instrumentation is now thread-safe. +- Timeline can be now navigated with WASD keys. +- Symbol file paths are now normalized on libbacktrace systems. For example, + instead of "/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/12.2.0/../../../../ + include/c++/12.2.0/bits/std_mutex.h" Tracy will now report such file as + "/usr/include/c++/12.2.0/bits/std_mutex.h". +- The import-chrome utility interprets Instant (`i`/`I`) events where the + `name` field contains the word `frame` as a frame event. The `name` is the + frame set name. +- Frame data won't be displayed if there was no frame instrumentation in the + profiling session. + - Note that some automated functionality (e.g. vertical synchronization + capture) may automatically generate frame data, which will force frames to + be displayed. +- Tracy threads will now be collapsed by default on the timeline. +- Clicking on a local thread in the CPU data view will make the thread visible + and uncollapsed on the timeline. +- Assembly view is now in color. +- The profiler UI will no longer unnecessarily redraw the screen if nothing + was changed. This should have a profound impact on power usage. +- Added microarchitecture data for Zen 4. +- Implemented optional propagation of inline cost down the local call stack. + - This feature may be useful when trying to get a general outlook of the + cost at the top-level function in the symbol. + - It is possible to get nonsense data when this is enabled, for example + total cost exceeding 100%. This is by design. + - Assembly line costs are not affected. +- Available clients now also broadcast their PID. +- Reversed mouse button assignments for jumping to source / assembly line in + symbol view. The left mouse button will now focus the target line. +- Assembly lines tooltip will now display local call stack of inline functions + (within the symbol). + - Right-clicking the source location entry in assembly line will show the + local call stack, along with source code preview of each entry and ability + to navigate to any selected inline function. +- The profiler UI will now indicate that it needs attention if the window is + not focused and something interesting happens. For example when a connection + is established, or when a saved trace finishes loading, etc. How the + attention request is indicated depends on the operating system. +- Clicking on the red microarchitecture icon in the symbol view assembly pane + will switch the selected microarchitecture to one the profiled application + was running on. +- Removed option to display instruction latencies in a graphical form. Latency + data is still available in instruction tooltip. + + +v0.8.2 (2022-06-28) +------------------- + +- Added support for debuginfod debug information services. Note that + since this depends on proper system configuration, vendors providing + the debug information, and network retrieval, it is disabled by + default. To enable, compile the profiled application with the + TRACY_DEBUGINFOD define and link with libdebuginfod. +- When Tracy server-side utilities are build with MSVC, the required + libraries will be now automatically retrieved and built with vcpkg. +- Added microarchitecture data for: Bonnell, Airmont, Goldmont, Goldmont + Plus, Tremont. +- Recognize additional CPUIDs of Zen 3, Alder Lake, Ice Lake + microarchitectures. +- Assembly line width will be now extended, if needed. Previously the line + width was calculated for the initial layout and changing amount of + displayed data (especially listing the read/written registers) didn't + affect this, which may have made some lines partially unreadable. +- Added ability to filter call stacks in memory tab by inactive allocations. + Filtering by inactive allocations helps to pinpoint wasteful allocations + in the program. +- Plot graph will no longer display min/max values interpolated for + animation, but rather true values. +- The CPU topology tree structure was replaced by a CPU schematic showing + the same thing in a more concise way. + + +v0.8.1 (2022-04-21) +------------------- + +- Support for pre-0.7 traces has been dropped. +- Update utility can now scan for source files missing in the trace cache, + if the '-c' parameter is given. Found files will be added to the cache. +- Added high-priority queue for fast queries to bypass slow symbol queries. +- Fixed Android documentation to show how to enable context switch tracing. +- Workaround MSVC 2015 stupidity which prevented compilation as C++11. +- Added support for showing branch cost data for CPUs that don't report + branch retirement events (but do report branch misses). +- The right-click context menu available for jump arrows in the symbol view + window will now additionally display jump context, i.e. jump sources and + jump target source code fragments. +- Added freedesktop.org compliant desktop entry and MIME type definition. +- The call stack column in list of messages will now be only displayed when + at least one message on the list has call stack data. +- File dialogs on Unix will be now native to the desktop environment you are + using. Note that this relies on xdg-desktop-portal and dbus. + + +v0.8.0 (2022-03-28) +------------------- + +- Support for Cygwin has been dropped. It was not working for a very long + time and nobody had complained about it. +- Mingw is deprecated due to lack of interest. +- Added TRACY_NO_CALLSTACK_INLINES macro to disable inline functions + resolution in call stacks on Windows. +- Improved function matching algorithm in compare traces view. +- Added CMake integration. +- Reworked rpmalloc initialization. +- Fixed display of messages with newlines on messages list. +- Excluded some uninteresting wrapper functions from call stacks (for + example SIMD pass-through intrinsics to the compiler built-ins). +- Adjusted coloring of instruction hotness in symbol view. +- Properly handle rare cases when sampling on Linux is momentary not able to + resolve time stamps. +- Added Rocket Lake microarchitectural data. +- Updated CPU identifier lists. +- Implemented GPU timer overflow handling heuristics. +- Assembly instructions are now assigned to inline symbols. + - You can not only see the assembly source file and line, but also the + originating function. + - If symbol view is restricted to a single inline function, all assembly + instructions not in this context will be dimmed out. + - Likewise, the navigation in assembly code will be limited just to the + inline context, if a single function is selected. +- Kernel call stacks will be now properly captured and displayed in the + profiler. Kernel functions are marked with the red color. +- The CPU hardware performance counters can be now sampled on Linux. + - Three inferred statistics are displayed for lines in both source and + assembly code in the symbol view window: + - Instructions executed per cycle. + - Branch miss rate. + - Cache miss rate. + - Instruction cost estimation method is no longer tied to software call + stack sampling. +- The image name filter entry field is now providing a list of available + images. +- Reentrant function calls may be now excluded from calculations in the + statistics view. +- Crash handler is now properly removed during profiler destruction. +- Repeatedly right-clicking on the same source line in the symbol view + window will now cycle through assembly blocks associated with this source + line. +- Vulkan headers must be now explicitly included before including + TracyVulkan.hpp. +- The capture utility may now limit capture time to a specified number of + seconds. +- Fixed message thread assignment in the import-chrome utility. +- Sampling data can be now also found in the find zone menu. +- Instrumentation failures may now display their context, e.g. the zone text + that was to be set. +- A warning is now displayed when sampling data is out-of-order. +- Average value for plots can be now viewed. +- Moved symbol resolution to a separate thread. Profiling will no longer be + stuck when there is a large number of symbols to resolve. This not only + improves user experience, but also prevents buildup of data (and memory + consumption) on the client side. +- Android device name will be now reported. +- Added support for capturing fibers. + - Fibers require additional processing, which has to be enabled by adding + the TRACY_FIBERS define on the client side. + - Client code requires additional instrumentation using the new macros + TracyFiberEnter and TracyFiberLeave (or the corresponding C API + variants). + - Fibers are represented in traces as separate threads, and are + distinguished by green color. Faux context switch regions are used to + indicate when a fiber is being run by the worker thread. +- Continuous frame marks no longer need to be issued from a single thread. +- Context switch call stacks are now captured on Windows and Linux. + - Hovering the context switch wait region will now display wait stack, + which may provide additional insight into why the switch happened. + - Wait stacks inspection can be performed in a new view. + - Stacks can be limited to certain threads and to a selected time range. + - Stacks are presented either as a sorted list, or as a bottom-up and + top-down trees. +- Entry call stacks can be now also viewed as a bottom-up and top-down + trees. +- Updated project build files to MSVC 2022. +- Call stack tooltips now also show the executable image name. +- Playback frames can be now changed by interacting with the frame image + slider using the mouse wheel. +- Signal used to handle crashes on Linux can be now redefined. +- Various DPI scaling improvements. +- User interface can be now scaled in run time. +- Symbol code retrieval now also supports kernel on Windows. +- Added low-level C API interface for GPU zones. +- Symbol child calls can be now listed. +- Replaced "restrict time" in memory window with a proper time range limit. +- Added Alder Lake microarchitectural data. +- Added GPU zone statistics. +- Universal Windows Platform support. +- All call stack related functionality can be now disabled with the + TRACY_NO_CALLSTACK macro. +- Added ability to add full-view annotations from the annotations list + window. + + +v0.7.8 (2021-05-19) +------------------- + +- Updated Zen 3 and added Tiger Lake microarchitectural data. +- Manually disconnecting from the server will no longer display erroneous + warning message. +- Added ability to display sample time spent in child function calls. +- Fixed issue which may have prevented sampling on ARM64. +- Added TRACY_NO_FRAME_IMAGE macro to disable frame image compression + thread. +- Ctrl and shift keys will now modify mouse wheel zoom speed. +- Improved user experience in the symbol view window. +- Added support for Direct3D 11 instrumentation. +- Vulkan contexts can be now calibrated on Linux. +- Support loading zstd-compressed chrome traces. +- Chrome traces with multiple PID entries (and possibly conflicting TIDs) + can be now imported. +- Added support for custom source location tag ("loc") in chrome traces. +- Sampling frequency can be now controlled using TRACY_SAMPLING_HZ macro. +- Trace compression can be now selected when saving a trace. +- If a trace cannot be saved, a failure dialog will be displayed. +- Run-time memory usage of frame images can be reduced by calculating + a compression dictionary. This can be only performed when a trace is saved + or through the update utility. + + +v0.7.7 (2021-04-01) +------------------- + +- Linux crash handler will now also catch SIGABRT. +- Fixed invalid name assignment to source files discovered client-side. +- Added ability to check if a zone is active (which may be used to avoid + preparing zone text, etc., as it wouldn't be used anyway). +- Improved sorting behavior of internal vectors. + - Some data will now be always properly displayed during live capture. + This was not particularly visible before, as it mainly concerns edge + cases. + - Sorting is performed only as needed. + - In case of plots the performance during live capture may be decreased, + as these were sorted with at least 0.25 second intervals before. Now + the sorting is performed every frame. + - Some other data, which previously was not sorted, is sorted now. + - In headless capture mode sorting will be only performed when the trace + is saved to disk. +- Fixed some typos in macros. +- Fixed handling of non-ANSI file names on Windows. You can now name your + traces 'ęśąćż.tracy' and it should work as intended. This is supported on + Windows 10 release 1903 and newer. +- Fixed sending GPU context name in on-demand mode. +- Fixed color channel order in ZoneColor() macro. +- Handle failure state when a memory pointer allocation is reported twice, + without an intermediate free. +- Renamed "call stack parents" to "entry call stacks". +- Display number of entry call stacks in assembly line sample count tooltip. +- Added tooltips with preview of source code in various places in the UI. + + +v0.7.6 (2021-02-06) +------------------- + +- Various fixes in build scripts. +- Fixed a faulty rpmalloc initialization path when the first thing the + thread did was sending a message with call stack. +- Added fallback timer define for various virtualized environments, which + may not be able to access the hardware timer registers. This will result + in usage of timer provided by the standard library, with reduced + resolution. +- Further OpenCL improvements. +- Updated libbacktrace. + - Adds Mach-O 64-bit FAT support. + - Fixes memory corruption when processing Mach-O data. + - Fixes missing matching entries during binary search. + - Adds support for MiniDebugInfo. + - Adds fallback to ELF symbol table if no debug info is available. + - Various other fixes. +- Store build time of profiled program in captures. +- GPU contexts can be now named. +- Implemented client -> server source code transfer. + + +v0.7.5 (2021-01-23) +------------------- + +- More robust handling of system tracing on Android. +- Added warning dialog when the connection is lost before all needed data + can be retrieved. +- Fixed handling of NaN plot entries (by skipping them). +- Dynamic zone colors are now supported through the ZoneColor() macro. +- Fixed Arm machine code printout to match the one printed by objdump. +- Fixed client memory corruption when using colored messages. +- Switched to the next-gen ImGui table UI. + - Table columns can have their order rearranged, can be hidden, can be + sorted both in ascending and descending order (where appropriate). + - Table columns state is now preserved between runs. +- Various fixes related to restricting listening to localhost. +- Improved compatibility of ETW tracing with non-MSVC compilers. +- Fixed Vulkan call stack transfer. +- Added support for transient GPU zones (OpenGL, Vulkan, Direct3D 12). +- OpenCL fixes for assert-less builds and non-active zones. +- Added support for thread names and title bar description in traces + imported from chrome tracing format. + + +v0.7.4 (2020-11-15) +------------------- + +- Added support for user-provided locks to keep dbghelp calls thread-safe. +- Call stacks can be now copied to clipboard. +- Allow more control over which automated captures are performed. +- Added textual descriptions for some assembly instructions. +- Profiler memory usage is now also displayed as a percentage of available + physical memory. +- Microarchitecture mismatch is now clearly displayed in the source view + window. +- Added Zen 3 and Cascade Lake microarchitectural data. +- Ghost zones are now supporting all zone coloring modes and namespace + shortening. +- Extend C API to support memory pools. +- Frame rate targets can be now visually represented on the timeline view. + + +v0.7.3 (2020-10-06) +------------------- + +- Properly support DPI scaling on Linux (requires GLFW 3.3). +- Added early checks for output file validity in the capture utility. +- Improvements to presence broadcast handling. +- Custom zone colors can be optionally ignored. +- Added support for tracking multiple memory pools. +- Memory free failure dialog can now show call stack pointing to the failure + location. +- Added support for Wayland on Linux. +- If during the first 5 seconds of the trace there are no frames being + reported, the profiler will switch to following last 5 seconds of the + trace, instead of displaying three last frames. + + +v0.7.2 (2020-09-14) +------------------- + +- Note: the bitbucket repository is obsolete and will soon stop receiving + updates. Migrate to https://github.com/wolfpld/tracy, if you haven't + already. +- The "waiting for connection" dialog no longer has "cancel" button. To + abort connection attempt just use the "close window" button. +- Added update notification. +- The most recent traced events can be now viewed regardless of timeline + zoom level. +- Fixed going-to-line in source view (again). +- Crash handling on client is now not performed, if there is no active + connection. +- Added ability to listen only on IPv4 interfaces. + + +v0.7.1 (2020-08-24) +------------------- + +- Dropped support for pre-v0.6 traces. +- Fixed regression on non-AVX2 CPUs. +- Fixed incorrect calculation of some ghost zones. +- Added list of cached source files. +- Added import of plot data. +- Secure versions of alloc/free macros. +- Automated tracing of vertical synchronization on Windows. +- Fixed attachment of postponed frame images. +- Source location data can be now copied to clipboard from zone info window. +- Zones in find zones menu can be now grouped by zone name. +- Vulkan and D3D12 GPU contexts can be now calibrated. +- Added CSV export utility. +- "Go to frame" popup no longer has a dedicated button. To show it, click on + the frame counter. +- Added macro for checking if profiler is connected. +- Implemented optional data removal from traces in the update utility. +- Allow manual management of profiler lifetime. +- Adjusted priority of ETW threads to time critical. +- Annotations can be now freely adjusted on the timeline. +- Limiting time range for find zone functionality has been significantly + improved. +- Added time range limits for statistics and symbol view. +- Implemented call stack sampling on Linux (including Android). +- Exact time from start of profiling session can be now viewed by hovering + the mouse over the time scale. +- Code transfer can be now compiled-out. +- Added support for zone markup in unloadable modules. +- Added image name filter to sampling statistics results window. + + +v0.7 (2020-06-11) +----------------- + +This is the last release which will be able to load pre-v0.6 traces. Use the +update utility to convert your old traces now! + +- chrome:tracing importer now imports zone metadata from "args" key. +- Added display of statistical mode to find zone menu. +- Automatic stack sampling is now available on windows. +- Properly handle tracing on long-running systems. +- Message list entries can now show associated frame image. +- Call stack window will now display module names. +- Symbol location in call stack window may now also display symbol address. +- Statistics menu can now be used to display call stack sampling data or + list available symbols. +- All call paths leading to the sampled instruction in a call stack can be + now displayed. +- Frame image compression ratio (lossless in-memory compression, not taking + into account DXT compression) is displayed in playback window. +- Allow reconnection straight from the discard data dialog. +- Added ability to set custom names for locks. +- Improved handling of network ports. +- Added time percentage display to instrumentation statistics. +- Display of ghost zones (generated from automated call stack sampling). +- Notify when empty labels display is enabled. +- Small fragments of executable code will be now sent from client to server. +- Added notification about query backlog. +- Fixed performance problem with query backlog. +- Display number of in-flight queries, in addition to query backlog. +- Improved failure reports. +- The capture utility will connect to localhost by default. +- Added optional support for QPC timer on windows. +- Complete rewrite of source file viewer. It is now 100% reliable when going + to a source location. +- Symbol source view was added. + - Extension of source file viewer. + - Can display source file, assembly view, or both at the same time. + - May include display of statistical profiling data. + - Ability to switch between source files which were used to build the + symbol. + - Ability to switch between inlined functions which are incorporated into + the symbol. + - Graphical representation of control flow in program. + - Display of micro-architectural data for each assembly instruction. + - Tracking register dependencies between assembly instructions. + - Disassembly may be saved to a file, in order to be processed by external + tools. +- If the default listening port is occupied, profiler will now try listening + on other ports. +- Added possibility to perform source file names substitution. +- Profiler windows can be now docked. +- CPU usage tooltip now displays a list of running threads. +- Added possibility to filter discovered clients list. +- Source files are now cached during capture. +- Profiler will now display a popup when application crashes. +- Added ability to send simple integral values as extra payload for zones. +- Per-frame zone times on the frames plot can now display self time. +- Ability to bind only on localhost interface. +- OpenCL profiling. +- Direct3D 12 profiling. + + +v0.6.3 (2020-02-13) +------------------- + +- Fixed performance issues with loading saved traces on Ryzen CPUs. +- Profiler window contents are now properly updated during window resize. +- Improved tid to pid mapping on windows. +- Zero length and unfinished zones are no longer taken into account for + statistics. +- Build files for shared library are now available (experimental). +- GPU zones now also have "active" parameter. +- Further reduction of memory usage and on-disk trace size. +- Replaced ska::flat_hash_map with robin-hood-hashing. +- Speed-up rendering of long lists of items. +- Exact event time is displayed in some places in the UI. +- Memory allocation lists can now be sorted. +- Added display of trace file compression ratio. +- Optional Zstd compression of trace files. +- Frame images are now internally compressed using Zstd (instead of LZ4). +- Fix display of continuous frame set tooltips. + + +v0.6.2 (2019-12-30) +------------------- + +- Improved call stack decoding on OSX. +- Collection of CPU topology data. +- C API now supports allocated source locations. +- Added chrome:tracing importer. +- Allow merging of ZoneText() strings. +- Time distribution can now show both exclusive and inclusive times. +- Display proper value of selection time in find zone menu. +- Implemented limiting find zone search to a specified time range. +- Highlight hovered zone from find zone menu zone list on the histogram. +- Allow copying user data directory location to the clipboard. + + +v0.6.1 (2019-11-28) +------------------- + +- Dropped support for pre-v0.5 traces. +- Improve BSD support. +- GPU zone CPU thread highlight will now highlight whole thread, not only + the thread name. +- Added CPU thread highlight for CPU data items. +- Client parameters may be now set from the server. +- Minor UI fixes. + + +v0.6 (2019-11-17) +----------------- + +This is the last release which will be able to load pre-v0.5 traces. Use the +update utility to convert your old traces now! + +- Dropped support for pre-v0.4 traces. +- Major memory usage decrease. +- Significant network bandwidth decrease. +- Implemented context switch capture on selected platforms. + - Zone timings in various UI places can now take into account only the + time when the thread was executing. + - Zone information window can now display regions in which thread was + suspended by the operating system. + - CPUs on which the zone was running are enumerated. + - Thread activity regions can be graphed on the timeline. +- API breakage: SetThreadName() now only works on current thread. +- Fixed thread name retrieval after thread is destroyed. +- Added number of CPU cores to host info. +- Limited number of possible source locations to 64K. +- Limited supported capture length to 1.6 days. +- CPU cores are now displayed on the timeline. + - Thread execution workload is displayed, including threads from external + programs. + - Thread migrations across CPU cores can be graphed. + - System-wide workload distribution is now plotted on the timeline. +- Added "CPU data" window showing programs competing for CPU during the + capture. +- Switched to using native thread identifiers (relatively small numbers), as + opposed to pthreads identifiers, which in reality were pointers. +- Improved thread name discovery if context switch capture is enabled. +- Per-trace state is now preserved between profiling sessions: + - Timeline view position. + - Item categories draw/hide settings. +- Timeline zones will be highlighted using a different color, when a + matching time range is selected on histogram. +- Per-frame zone times are now displayed on the frames plot when a zone is + selected in the find zone menu. +- Zone color is now displayed in zone information window. +- Zone colors can now be determined basing on depth and thread or source + location. +- Thread colors are displayed across the profiler application. +- Frame times can be now compared. +- Expose more lock handling functionality. +- Network port can be now specified by the user. +- Proper handling of multithreaded Vulkan code. +- Added extreme compression level in update utility. +- Added time distribution data in the zone information window. +- Trace file name is now displayed in trace information window. +- Annotations can be now added to the timeline. +- Server now performs network data retrieval and decompression on a dedicated + thread. +- Added examples of Tracy integration. +- Allow grouping of zones in the find zone menu by zone parent or with no + grouping. +- Zone list in the statistics window can be now filtered. +- Implemented configuration of plots. +- Messages can now collect call stacks. + + +v0.5 (2019-08-10) +----------------- + +This is the last release which will be able to load pre-v0.4 traces. Use the +update utility to convert your old traces now! + +- Major decrease of trace dump file size. +- Major optimizations across the board. +- Vcpkg is now used for library management on Windows. +- Display dump file size change in the update utility. +- Added notification area. + - Display trace loading time. + - Display background processing tasks after trace is loaded. + - Display trace save notification. + - Show crash icon, if there was a crash. +- Added C API. +- Profiling session may now gracefully terminate, due to incorrect + instrumentation. A popup with termination reason will be displayed. +- Call stack improvements. + - Call stack frames now have a proper source file and file line + information on Linux. + - Single call stack frame may now have multiple entries, representing + inlined function calls. + - Call stack grouping in the find zone menu now has a special display + mode. + - Call stack memory allocations tree improvements: + - Add top-down variant to complement the previously available bottom-up + one. + - Add ability to group tree nodes by function name. + - Allow restricting tree to display only active allocations. + - Added support for Lua call stack capture. +- Self time of zones may be now displayed in the find zone menu. +- Added ability to disconnect from a client. +- Find zone groups can now be sorted by mean time per call. +- Zones displayed in the find zone menu can be now grouped by order of + appearance, execution time or name. +- Time is now displayed without trailing fractional zeros (e.g. "2.5 ms" + instead of "2.50 ms"). +- Child zones displayed in zone info window can be now grouped by source + location. +- Selected or hovered lock is now highlighted on the timeline. +- Locks are now grouped into single and multithreaded (contended and + uncontended) in the options menu locks list. +- On broken platforms the profiler can now be initialized as needed (and + possible), taking a performance and functionality hit. +- User experience improvements in the graphical profiler. + - Thread position and height is now animated, to eliminate flickering that + was happening when depth of displayed zones was changing. + - Zooming in/out using the mouse wheel is now animated. + - Plot range adjustment is now animated. + - Various other UI improvements. +- System CPU usage is now being monitored. +- Threads that have nothing to display in the current view are now hidden by + default. +- Dimmed-out the timeline outside the profiling area. +- Source file view can now be opened also from statistics menu. +- Display standard deviation in find zone and compare traces menus. +- Display zone messages in zone information window. +- Display order of threads can be changed in the options menu. +- Prevent deadlocks by querying socket send buffer size. +- Frame set statistics can be now limited to frames visible on the screen. +- Messages can be now colored. +- Zone selection in compare traces menu can be now linked to the other + trace. +- Added support for frame image (screen shot) storage. +- Implemented ability to cut off outliers on histograms. +- Zone or frame that is currently hovered by the mouse cursor will be + highlighted on the histogram. +- Server now displays available clients in the local network. +- Source code whitespace visibility can now be enabled or disabled. +- Profiler will now check if proper timer readings can be performed on + x86/x64. +- Application can now log app-specific information, similarly to how the + host info reports system information. +- Message list will automatically scroll down to the most recent message. + - Feature will disable when the list is scrolled by user. + - To re-enable, scroll to the bottom of the list. +- Message list can be now filtered. +- A notification popup will be displayed during trace cleanup. +- Source file view won't be available if a source file is newer than the + capture. +- Added ability to set custom trace descriptions. +- Added frame time target lines. +- FPS counts are now displayed next to frame times. +- GPU drift value can be now automatically measured. +- Connection window is now a popup hidden under a dedicated button. + + +v0.4.1 (2018-12-30) +------------------- + +- Active frame set can be now switched by clicking on a frame set on the + timeline. +- Add ability to go to a specified frame. +- Most commonly used addresses can be now selected from the drop-down menu. +- Fixed corner case problem with profiler initialization on Windows. +- Added third state (stopped) to the pause/resume button. It will be used + after the connection to the client is terminated. +- Active trace can be discarded. +- Call stack capture may be forced through TRACY_CALLSTACK define. +- Lock info window has been added. +- Time of lock creation and termination is now being tracked. +- Menu bar buttons are now toggles that can also close their corresponding + windows. +- Find zone and compare menu improvements. + - Ability to ignore case during search. + - Pressing enter key will now start search, just like pressing the "find" + button. + - Using the ^F keyboard shortcut will open the find zone menu and focus + the input box. +- Added ability to automatically connect to an IP address in the graphical + profiler application (use "-a address" argument to enable). +- Pressing enter key after entering client address in the welcome dialog + will now automatically begin connection process. + + +v0.4 (2018-10-09) +----------------- + +- Renamed "standalone" utility to "profiler". +- Added trace update utility, which will convert files saved in previous + versions of tracy to be up-to-date. + - Optional high compression (--hc) mode is available that will increase + the compression level, at the cost of considerably longer compression + time. +- Fix regression causing varying size of profiler window for different + captures. +- Added support for on-demand tracing. + - If a client application is compiled with the TRACY_ON_DEMAND macro + defined, tracing will not begin until a connection to server is + established. + - Since data is not fully captured in this mode, the resulting trace will + be less precise, until application state is appropriately reset. For + example, locks need to be fully released, zone stacks need to be + flushed. This is an automatic process. + - All tracing macros are able to work in the on-demand mode. +- Improved compatibility with various system setups. +- Aside from using TRACY_NO_EXIT define you can also set the same-named + environmental variable to 1 to get the same effect. +- Added ability to show/hide all threads and plots. +- Performance improvements. +- Improvements to memory data presentation. + - Added memory allocation info window. + - Selecting memory allocation on a plot will draw time range of the + allocation. + - Middle clicking on an memory allocation address (or on a button in + memory allocation info window) will zoom the view to the allocation + range. +- Find zone menu improvements: + - Zones can be now also grouped by call stacks. + - Zone groups can be now also sorted by time spend in each zone. + - Zone groups list now displays group times. + - Average and median zone times are now displayed on the histogram. + - Selected zones will be highlighted on the timeline view. +- Added named versions of tracing macros that allow specifying scoped + variable name. +- The main profiler window is now kept at the bottom of windows stack. +- The "profiler" utility will now use a custom embedded font. +- Microseconds are now displayed using correct symbol ('μ' instead of 'u'). +- Unix builds of the "profiler" utility will now ask for a file name when + saving a trace. +- Progress popup is now displayed when a trace file is loading. +- Zones that share source location with a zone that is hovered over are now + highlighted. +- Added ability to zoom-in to a selection range made using middle mouse + button. + - Holding the ctrl key will switch to zoom-out mode. +- The "profiler" utility will use less resources when its window is + out-of-focus or minimized. +- Added support for cross-DLL profiling. +- Items in options menu (locks, threads, etc.) are now described with number + of events. + - Source location of lock declaration is also provided. +- Created an extensive user manual for the profiler. +- Added ability to capture multiple frame sets. + - Viewer will display multiple frame ranges at once. + - Only one frame set can be active at once. The selected one is used for + the frame navigation graph, frame navigation buttons and drawing frame + separators. + - The active frame set will be highlighted, and the rest will be dimmed + out. + - Frames can now also be discontinuous. +- Frames and zones too small to be displayed will be marked with a zig-zag + pattern. +- General improvements to message list and message markers. + - Hovering over message on a list will highlight its marker (previously it + only worked the other way). + - Left clicking on a message marker will focus the message list on the + selected message. + - Middle clicking on a message marker will center it on screen. +- Added trace information window. + - This includes frame time statistics and histogram. +- Displayed memory sizes are now properly formatted. +- Added call stack tree for memory allocations. + - You can display allocations list for each call stack tree entry. +- The source code of the profiled application may now be viewed in the + profiler. + - BIG FAT WARNING: The actual profiled program source code is not known to + the profiler. It only checks if there is a file on your disk that + matches the file name of the captured source location. Even if the file + is displayed, it may be out of date. + - CPU and GPU zones will have "Source" button, if source file can be + opened. + - Source files for call stack traces can be opened by right-clicking on + the file name. Since in this case there is no button that can be hidden, + a small animation will be played to notify user if the source cannot be + opened. +- The main profiler view will now occupy the whole window. Previous behavior + is still available for embedded use cases. +- Many button labels are now accompanied by icons. +- Fonts should now be less blurry. +- "Go to parent" button in zone info window won't be displayed if there is + no parent to go to. +- Improvements to the compare traces menu. + - There are now colored markers to make it easier to distinguish "this" and + "external" traces. + - The amount of saved time is now displayed (a difference between total + run times of both traces). +- Tracy will now collect host information, like CPU name, amount of system + memory, etc. +- Windows builds of the "profiler" utility will perform a check of supported + CPU instruction set and match it against the one required by the binary + (by default AVX2 is used). If the program cannot be executed on the + processor, a message dialog with workaround instructions will be + displayed. +- Tracy can intercept crashes and finish sending data from a dying process. + - Currently this is only implemented on Windows, Linux and Android. +- Call stack window may now display addresses of the frames, instead of + source file locations. +- Memory events will now properly register their thread. +- Profiler settings are now stored in a persistent location. + - On Windows settings are stored in %APPDATA%/tracy. + - On other platforms settings are stored in $XDG_CONFIG_HOME/tracy or + $HOME/.config/tracy, if the variable is not set. + - The main profiler window position, size and maximized state are saved + and restored. + - The size and position of internal windows now doesn't depend on the + runtime directory of the profiler executable. +- Added connection handshake. + - Server won't be able to connect to client if there's a protocol version + mismatch. + - Client not in on-demand mode will refuse connections after the first + connection was made and the initial event buffers were cleared. +- A single server will no longer try to connect to multiple clients. +- The capture utility will now display time span of the ongoing capture. + + +v0.3 (2018-07-03) +----------------- + +- Breaking change: the format of trace files has changed. + - Previous tracy version will crash when trying to open new traces. + - Loading of traces saved by previous version is supported. + - Tracy will no longer crash when trying to load traces saved by future + versions. Instead, a dialog advising to update will be displayed. + - Tracy will no longer crash in most cases when trying to open files that + are not traces. Some crashes are still possible, due to support of old, + header-less traces. +- Ability to track every memory allocation in profiled program. + - Allocation event queuing must be done in order, which requires exclusive + access to the serialized queue on the client side. This has no effect on + the rest of events, which are stored in a concurrent queue, as before. + - You can search for a memory address and see where it was allocated, for + how long, etc. This lists all matching allocations since the program was + started. + - All active (non-freed) allocations may be listed. This shows the current + memory state by default, but can go back to any point in time. + - Graphical representation of process memory map may be displayed. New + allocations/frees are displayed in a bright color and fade out with + time. This feature also can look back in time. + - Memory usage plot is automatically generated. + - Basic allocation information is displayed in memory plot tooltips. + - A summary of memory events within a zone (and its children) is now + printed in zone info window. +- Support loading profile dumps with no memory allocation data (generated by + v0.2). +- Added ability to display global statistics of a selected zone from the + zone info window. +- Fixed regression with lock announce processing that appeared during + worker/viewer split. +- Allow selecting/unselecting all locks for display. +- Performance improvements. +- Don't save unneeded lock information in trace file. +- Don't save thrash in message list data. +- Allow expanding view span up to one hour, instead of one minute. +- Added trace comparison window. + - An external trace has to be loaded first. + - Zone query in both traces (current and external). + - Both results are overlaid on the same histogram. + - Graphs can be adjusted as-if there was the same number of zones + collected. +- Read time directly from a hardware register on ARM/ARM64, if possible. + - User-space access to the timer needs to be enabled in the kernel, so + tracy will perform run-time checks and fallback to the old method if the + check fails. +- Prevent connections in a TIME-WAIT state from blocking new listen + connections. +- Display y-range of plots. +- Added ability to unload traces loaded from files. To do so close the main + profiler window. You will return to the connect/open selection dialog. + Live captures cannot be terminated this way. +- Zones previously displayed in zone info window are remembered and you can + go back to them. Closing the zone info window or switching between CPU and + GPU zones will clear the memory. +- Improved message list window. + - Messages are now displayed in columns. + - Originating thread of each message is now included in the list. + - Messages can be filtered by the originating thread. +- You can now navigate to next and previous frame. +- Zone statistics can be now displayed using only self times. +- Support for tracing GPU events using Vulkan. +- Timeline will now display "OpenGL context" or "Vulkan context" instead of + "GPU context". +- Fixed regression causing invalid display of GPU context appearance time. +- Fixed regression causing invalid reporting of an active CPU in zone end + events, if MSVC rdtscp optimization was not enabled. +- Ability to collect true call stacks. + - Supported on Windows, Linux, Android. + - The following events can collect call stacks: + - Memory alloc/free. + - Zone begin. + - GPU zone begin. + - Zone stack trace now also displays frames from a real call trace. + - On Linux call stack frame name resolution requires a call to dladdr, + which in turn requires linking with libdl. +- Allow manual entry of GPU time drift value. +- Unix build system no longer shares object files between different build + units. + - Fixes inability to build debug and release versions of a single utility + without "make clean". + - Fixes incompatibility between "standalone" and "capture" utilities due + to different set of used feature flags. +- On Windows "standalone" utility now adapts to system DPI setting. +- Optional per-call zone naming. + + +v0.2 (2018-04-05) +----------------- + +- Fixed broken TRACY_NO_EXIT behavior. +- Visual refresh (new color scheme). +- Added optional support for live in-depth zone analysis. + - Ability to search for zones matching a query. + - Histogram of zone time spans. + - List occurrences of a zone, grouped by thread, or by user text. + - Zone groups can be selected and highlighted on histogram graph. + - Support for linear and logarithmic display of time and values. + - Histogram bins can show zone counts or total execution time. + - Listed zones can be narrowed down by data range selection on histogram. +- Separation of server data handling code from the visualisation. +- Implementation of a command line capture utility. +- Support libraries have been updated. +- Fixed an issue that prevented de-duplication of source location payloads. +- Fixed an issue that prevented the ability to disable threads in settings + menu, if two threads had the same name. +- Performance optimizations. +- Visual clean up of the settings menu. +- Zone info windows improvements. + - Visual improvements to zone info window child list. + - Zone info windows now show zone thread. + - Display zone stack trace. +- Hide pause/resume button if there's no data connection (i.e. trace was + loaded from file). +- Source location statistics view has been added. +- Fixed crash when a saved trace was opened, but no trace capture session + was performed before. +- Standalone server will now open trace files passed as an argument to the + executable. +- Fix possible crash in SetThreadName, that could happen if TLS init was + delayed until first use of thread local variable. +- Store full thread name if pthreads (with 15 character name limit) are + used. +- Properly handle unaligned memory access (no performance impact). +- Fixed broken lock identifiers in try_lock(). + + +v0.1 (2017-12-18) +----------------- + +- Initial release. diff --git a/third_party/tracy/README.md b/third_party/tracy/README.md new file mode 100644 index 0000000..39e878e --- /dev/null +++ b/third_party/tracy/README.md @@ -0,0 +1,28 @@ +# Tracy Profiler + +[![Sponsor](.github/sponsor.png)](https://github.com/sponsors/wolfpld/) + +### A real time, nanosecond resolution, remote telemetry, hybrid frame and sampling profiler for games and other applications. + +Tracy supports profiling CPU (Direct support is provided for C, C++, Lua, Python and Fortran integration. At the same time, third-party bindings to many other languages exist on the internet, such as [Rust](https://github.com/nagisa/rust_tracy_client), [Zig](https://github.com/tealsnow/zig-tracy), [C#](https://github.com/clibequilibrium/Tracy-CSharp), [OCaml](https://github.com/imandra-ai/ocaml-tracy), [Odin](https://github.com/oskarnp/odin-tracy), etc.), GPU (All major graphic APIs: OpenGL, Vulkan, Direct3D 11/12, Metal, OpenCL, CUDA.), memory allocations, locks, context switches, automatically attribute screenshots to captured frames, and much more. + +- [Documentation](https://github.com/wolfpld/tracy/releases/latest/download/tracy.pdf) for usage and build process instructions +- [Releases](https://github.com/wolfpld/tracy/releases) containing the documentation (`tracy.pdf`) and compiled Windows x64 binaries (`Tracy-.7z`) as assets +- [Changelog](NEWS) +- [Interactive demo](https://tracy.nereid.pl/) + +![](doc/profiler.png) + +![](doc/profiler2.png) + +![](doc/profiler3.png) + +[An Introduction to Tracy Profiler in C++ - Marcos Slomp - CppCon 2023](https://youtu.be/ghXk3Bk5F2U?t=37) + +[Introduction to Tracy Profiler v0.2](https://www.youtube.com/watch?v=fB5B46lbapc) +[New features in Tracy Profiler v0.3](https://www.youtube.com/watch?v=3SXpDpDh2Uo) +[New features in Tracy Profiler v0.4](https://www.youtube.com/watch?v=eAkgkaO8B9o) +[New features in Tracy Profiler v0.5](https://www.youtube.com/watch?v=P6E7qLMmzTQ) +[New features in Tracy Profiler v0.6](https://www.youtube.com/watch?v=uJkrFgriuOo) +[New features in Tracy Profiler v0.7](https://www.youtube.com/watch?v=_hU7vw00MZ4) +[New features in Tracy Profiler v0.8](https://www.youtube.com/watch?v=30wpRpHTTag) diff --git a/third_party/tracy/capture/CMakeLists.txt b/third_party/tracy/capture/CMakeLists.txt new file mode 100644 index 0000000..1e1e0e7 --- /dev/null +++ b/third_party/tracy/capture/CMakeLists.txt @@ -0,0 +1,28 @@ +cmake_minimum_required(VERSION 3.16) + +option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF) +option(NO_STATISTICS "Disable calculation of statistics" ON) + +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake) + +set(CMAKE_CXX_STANDARD 20) + +project( + tracy-capture + LANGUAGES C CXX + VERSION ${TRACY_VERSION_STRING} +) + +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake) + +set(PROGRAM_FILES + src/capture.cpp +) + +add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${COMMON_FILES} ${SERVER_FILES}) +target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyGetOpt) +set_property(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) + +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) \ No newline at end of file diff --git a/third_party/tracy/capture/src/capture.cpp b/third_party/tracy/capture/src/capture.cpp new file mode 100644 index 0000000..ff833f7 --- /dev/null +++ b/third_party/tracy/capture/src/capture.cpp @@ -0,0 +1,364 @@ +#ifdef _WIN32 +# include +# include +#else +# include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../public/common/TracyProtocol.hpp" +#include "../../public/common/TracyStackFrames.hpp" +#include "../../server/TracyFileWrite.hpp" +#include "../../server/TracyMemory.hpp" +#include "../../server/TracyPrint.hpp" +#include "../../server/TracySysUtil.hpp" +#include "../../server/TracyWorker.hpp" + +#ifdef _WIN32 +# include "../../getopt/getopt.h" +#endif + + +// This atomic is written by a signal handler (SigInt). Traditionally that would +// have had to be `volatile sig_atomic_t`, and annoyingly, `bool` was +// technically not allowed there, even though in practice it would work. +// The good thing with C++11 atomics is that we can use atomic instead +// here and be on the actually supported path. +static std::atomic s_disconnect { false }; + +void SigInt( int ) +{ + // Relaxed order is closest to a traditional `volatile` write. + // We don't need stronger ordering since this signal handler doesn't do + // anything else that would need to be ordered relatively to this. + s_disconnect.store(true, std::memory_order_relaxed); +} + +static bool s_isStdoutATerminal = false; + +void InitIsStdoutATerminal() { +#ifdef _WIN32 + s_isStdoutATerminal = _isatty( fileno( stdout ) ); +#else + s_isStdoutATerminal = isatty( fileno( stdout ) ); +#endif +} + +bool IsStdoutATerminal() { return s_isStdoutATerminal; } + +#define ANSI_RESET "\033[0m" +#define ANSI_BOLD "\033[1m" +#define ANSI_BLACK "\033[30m" +#define ANSI_RED "\033[31m" +#define ANSI_GREEN "\033[32m" +#define ANSI_YELLOW "\033[33m" +#define ANSI_BLUE "\033[34m" +#define ANSI_MAGENTA "\033[35m" +#define ANSI_CYAN "\033[36m" +#define ANSI_ERASE_LINE "\033[2K" + +// Like printf, but if stdout is a terminal, prepends the output with +// the given `ansiEscape` and appends ANSI_RESET. +void AnsiPrintf( const char* ansiEscape, const char* format, ... ) { + if( IsStdoutATerminal() ) + { + // Prepend ansiEscape and append ANSI_RESET. + char buf[256]; + va_list args; + va_start( args, format ); + vsnprintf( buf, sizeof buf, format, args ); + va_end( args ); + printf( "%s%s" ANSI_RESET, ansiEscape, buf ); + } + else + { + // Just a normal printf. + va_list args; + va_start( args, format ); + vfprintf( stdout, format, args ); + va_end( args ); + } +} + +[[noreturn]] void Usage() +{ + printf( "Usage: capture -o output.tracy [-a address] [-p port] [-f] [-s seconds] [-m memlimit]\n" ); + exit( 1 ); +} + +int main( int argc, char** argv ) +{ +#ifdef _WIN32 + if( !AttachConsole( ATTACH_PARENT_PROCESS ) ) + { + AllocConsole(); + SetConsoleMode( GetStdHandle( STD_OUTPUT_HANDLE ), 0x07 ); + } +#endif + + InitIsStdoutATerminal(); + + bool overwrite = false; + const char* address = "127.0.0.1"; + const char* output = nullptr; + int port = 8086; + int seconds = -1; + int64_t memoryLimit = -1; + + int c; + while( ( c = getopt( argc, argv, "a:o:p:fs:m:" ) ) != -1 ) + { + switch( c ) + { + case 'a': + address = optarg; + break; + case 'o': + output = optarg; + break; + case 'p': + port = atoi( optarg ); + break; + case 'f': + overwrite = true; + break; + case 's': + seconds = atoi(optarg); + break; + case 'm': + memoryLimit = std::clamp( atoll( optarg ), 1ll, 999ll ) * tracy::GetPhysicalMemorySize() / 100; + break; + default: + Usage(); + break; + } + } + + if( !address || !output ) Usage(); + + struct stat st; + if( stat( output, &st ) == 0 && !overwrite ) + { + printf( "Output file %s already exists! Use -f to force overwrite.\n", output ); + return 4; + } + + FILE* test = fopen( output, "wb" ); + if( !test ) + { + printf( "Cannot open output file %s for writing!\n", output ); + return 5; + } + fclose( test ); + unlink( output ); + + printf( "Connecting to %s:%i...", address, port ); + fflush( stdout ); + tracy::Worker worker( address, port, memoryLimit ); + while( !worker.HasData() ) + { + const auto handshake = worker.GetHandshakeStatus(); + if( handshake == tracy::HandshakeProtocolMismatch ) + { + printf( "\nThe client you are trying to connect to uses incompatible protocol version.\nMake sure you are using the same Tracy version on both client and server.\n" ); + return 1; + } + if( handshake == tracy::HandshakeNotAvailable ) + { + printf( "\nThe client you are trying to connect to is no longer able to sent profiling data,\nbecause another server was already connected to it.\nYou can do the following:\n\n 1. Restart the client application.\n 2. Rebuild the client application with on-demand mode enabled.\n" ); + return 2; + } + if( handshake == tracy::HandshakeDropped ) + { + printf( "\nThe client you are trying to connect to has disconnected during the initial\nconnection handshake. Please check your network configuration.\n" ); + return 3; + } + std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) ); + } + printf( "\nQueue delay: %s\nTimer resolution: %s\n", tracy::TimeToString( worker.GetDelay() ), tracy::TimeToString( worker.GetResolution() ) ); + +#ifdef _WIN32 + signal( SIGINT, SigInt ); +#else + struct sigaction sigint, oldsigint; + memset( &sigint, 0, sizeof( sigint ) ); + sigint.sa_handler = SigInt; + sigaction( SIGINT, &sigint, &oldsigint ); +#endif + + const auto firstTime = worker.GetFirstTime(); + auto& lock = worker.GetMbpsDataLock(); + + const auto t0 = std::chrono::high_resolution_clock::now(); + while( worker.IsConnected() ) + { + // Relaxed order is sufficient here because `s_disconnect` is only ever + // set by this thread or by the SigInt handler, and that handler does + // nothing else than storing `s_disconnect`. + if( s_disconnect.load( std::memory_order_relaxed ) ) + { + worker.Disconnect(); + // Relaxed order is sufficient because only this thread ever reads + // this value. + s_disconnect.store(false, std::memory_order_relaxed ); + break; + } + + lock.lock(); + const auto mbps = worker.GetMbpsData().back(); + const auto compRatio = worker.GetCompRatio(); + const auto netTotal = worker.GetDataTransferred(); + lock.unlock(); + + // Output progress info only if destination is a TTY to avoid bloating + // log files (so this is not just about usage of ANSI color codes). + if( IsStdoutATerminal() ) + { + const char* unit = "Mbps"; + float unitsPerMbps = 1.f; + if( mbps < 0.1f ) + { + unit = "Kbps"; + unitsPerMbps = 1000.f; + } + AnsiPrintf( ANSI_ERASE_LINE ANSI_CYAN ANSI_BOLD, "\r%7.2f %s", mbps * unitsPerMbps, unit ); + printf( " /"); + AnsiPrintf( ANSI_CYAN ANSI_BOLD, "%5.1f%%", compRatio * 100.f ); + printf( " ="); + AnsiPrintf( ANSI_YELLOW ANSI_BOLD, "%7.2f Mbps", mbps / compRatio ); + printf( " | "); + AnsiPrintf( ANSI_YELLOW, "Tx: "); + AnsiPrintf( ANSI_GREEN, "%s", tracy::MemSizeToString( netTotal ) ); + printf( " | "); + AnsiPrintf( ANSI_RED ANSI_BOLD, "%s", tracy::MemSizeToString( tracy::memUsage.load( std::memory_order_relaxed ) ) ); + if( memoryLimit > 0 ) + { + printf( " / " ); + AnsiPrintf( ANSI_BLUE ANSI_BOLD, "%s", tracy::MemSizeToString( memoryLimit ) ); + } + printf( " | "); + AnsiPrintf( ANSI_RED, "%s", tracy::TimeToString( worker.GetLastTime() - firstTime ) ); + fflush( stdout ); + } + + std::this_thread::sleep_for( std::chrono::milliseconds( 100 ) ); + if( seconds != -1 ) + { + const auto dur = std::chrono::high_resolution_clock::now() - t0; + if( std::chrono::duration_cast(dur).count() >= seconds ) + { + // Relaxed order is sufficient because only this thread ever reads + // this value. + s_disconnect.store(true, std::memory_order_relaxed ); + } + } + } + const auto t1 = std::chrono::high_resolution_clock::now(); + + const auto& failure = worker.GetFailureType(); + if( failure != tracy::Worker::Failure::None ) + { + AnsiPrintf( ANSI_RED ANSI_BOLD, "\nInstrumentation failure: %s", tracy::Worker::GetFailureString( failure ) ); + auto& fd = worker.GetFailureData(); + if( !fd.message.empty() ) + { + printf( "\nContext: %s", fd.message.c_str() ); + } + if( fd.callstack != 0 ) + { + AnsiPrintf( ANSI_BOLD, "\nFailure callstack:\n" ); + auto& cs = worker.GetCallstack( fd.callstack ); + int fidx = 0; + for( auto& entry : cs ) + { + auto frameData = worker.GetCallstackFrame( entry ); + if( !frameData ) + { + printf( "%3i. %p\n", fidx++, (void*)worker.GetCanonicalPointer( entry ) ); + } + else + { + const auto fsz = frameData->size; + for( uint8_t f=0; fdata[f]; + auto txt = worker.GetString( frame.name ); + + if( fidx == 0 && f != fsz-1 ) + { + auto test = tracy::s_tracyStackFrames; + bool match = false; + do + { + if( strcmp( txt, *test ) == 0 ) + { + match = true; + break; + } + } + while( *++test ); + if( match ) continue; + } + + if( f == fsz-1 ) + { + printf( "%3i. ", fidx++ ); + } + else + { + AnsiPrintf( ANSI_BLACK ANSI_BOLD, "inl. " ); + } + AnsiPrintf( ANSI_CYAN, "%s ", txt ); + txt = worker.GetString( frame.file ); + if( frame.line == 0 ) + { + AnsiPrintf( ANSI_YELLOW, "(%s)", txt ); + } + else + { + AnsiPrintf( ANSI_YELLOW, "(%s:%" PRIu32 ")", txt, frame.line ); + } + if( frameData->imageName.Active() ) + { + AnsiPrintf( ANSI_MAGENTA, " %s\n", worker.GetString( frameData->imageName ) ); + } + else + { + printf( "\n" ); + } + } + } + } + } + } + + printf( "\nFrames: %" PRIu64 "\nTime span: %s\nZones: %s\nElapsed time: %s\nSaving trace...", + worker.GetFrameCount( *worker.GetFramesBase() ), tracy::TimeToString( worker.GetLastTime() - firstTime ), tracy::RealToString( worker.GetZoneCount() ), + tracy::TimeToString( std::chrono::duration_cast( t1 - t0 ).count() ) ); + fflush( stdout ); + auto f = std::unique_ptr( tracy::FileWrite::Open( output, tracy::FileCompression::Zstd, 3, 4 ) ); + if( f ) + { + worker.Write( *f, false ); + AnsiPrintf( ANSI_GREEN ANSI_BOLD, " done!\n" ); + f->Finish(); + const auto stats = f->GetCompressionStatistics(); + printf( "Trace size %s (%.2f%% ratio)\n", tracy::MemSizeToString( stats.second ), 100.f * stats.second / stats.first ); + } + else + { + AnsiPrintf( ANSI_RED ANSI_BOLD, " failed!\n"); + } + + return 0; +} diff --git a/third_party/tracy/cmake/CPM.cmake b/third_party/tracy/cmake/CPM.cmake new file mode 100644 index 0000000..c1c0532 --- /dev/null +++ b/third_party/tracy/cmake/CPM.cmake @@ -0,0 +1,1269 @@ +# CPM.cmake - CMake's missing package manager +# =========================================== +# See https://github.com/cpm-cmake/CPM.cmake for usage and update instructions. +# +# MIT License +# ----------- +#[[ + Copyright (c) 2019-2023 Lars Melchior and contributors + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +]] + +cmake_minimum_required(VERSION 3.14 FATAL_ERROR) + +# Initialize logging prefix +if(NOT CPM_INDENT) + set(CPM_INDENT + "CPM:" + CACHE INTERNAL "" + ) +endif() + +if(NOT COMMAND cpm_message) + function(cpm_message) + message(${ARGV}) + endfunction() +endif() + +set(CURRENT_CPM_VERSION 0.40.2) + +get_filename_component(CPM_CURRENT_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" REALPATH) +if(CPM_DIRECTORY) + if(NOT CPM_DIRECTORY STREQUAL CPM_CURRENT_DIRECTORY) + if(CPM_VERSION VERSION_LESS CURRENT_CPM_VERSION) + message( + AUTHOR_WARNING + "${CPM_INDENT} \ +A dependency is using a more recent CPM version (${CURRENT_CPM_VERSION}) than the current project (${CPM_VERSION}). \ +It is recommended to upgrade CPM to the most recent version. \ +See https://github.com/cpm-cmake/CPM.cmake for more information." + ) + endif() + if(${CMAKE_VERSION} VERSION_LESS "3.17.0") + include(FetchContent) + endif() + return() + endif() + + get_property( + CPM_INITIALIZED GLOBAL "" + PROPERTY CPM_INITIALIZED + SET + ) + if(CPM_INITIALIZED) + return() + endif() +endif() + +if(CURRENT_CPM_VERSION MATCHES "development-version") + message( + WARNING "${CPM_INDENT} Your project is using an unstable development version of CPM.cmake. \ +Please update to a recent release if possible. \ +See https://github.com/cpm-cmake/CPM.cmake for details." + ) +endif() + +set_property(GLOBAL PROPERTY CPM_INITIALIZED true) + +macro(cpm_set_policies) + # the policy allows us to change options without caching + cmake_policy(SET CMP0077 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0077 NEW) + + # the policy allows us to change set(CACHE) without caching + if(POLICY CMP0126) + cmake_policy(SET CMP0126 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0126 NEW) + endif() + + # The policy uses the download time for timestamp, instead of the timestamp in the archive. This + # allows for proper rebuilds when a projects url changes + if(POLICY CMP0135) + cmake_policy(SET CMP0135 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0135 NEW) + endif() + + # treat relative git repository paths as being relative to the parent project's remote + if(POLICY CMP0150) + cmake_policy(SET CMP0150 NEW) + set(CMAKE_POLICY_DEFAULT_CMP0150 NEW) + endif() +endmacro() +cpm_set_policies() + +option(CPM_USE_LOCAL_PACKAGES "Always try to use `find_package` to get dependencies" + $ENV{CPM_USE_LOCAL_PACKAGES} +) +option(CPM_LOCAL_PACKAGES_ONLY "Only use `find_package` to get dependencies" + $ENV{CPM_LOCAL_PACKAGES_ONLY} +) +option(CPM_DOWNLOAD_ALL "Always download dependencies from source" $ENV{CPM_DOWNLOAD_ALL}) +option(CPM_DONT_UPDATE_MODULE_PATH "Don't update the module path to allow using find_package" + $ENV{CPM_DONT_UPDATE_MODULE_PATH} +) +option(CPM_DONT_CREATE_PACKAGE_LOCK "Don't create a package lock file in the binary path" + $ENV{CPM_DONT_CREATE_PACKAGE_LOCK} +) +option(CPM_INCLUDE_ALL_IN_PACKAGE_LOCK + "Add all packages added through CPM.cmake to the package lock" + $ENV{CPM_INCLUDE_ALL_IN_PACKAGE_LOCK} +) +option(CPM_USE_NAMED_CACHE_DIRECTORIES + "Use additional directory of package name in cache on the most nested level." + $ENV{CPM_USE_NAMED_CACHE_DIRECTORIES} +) + +set(CPM_VERSION + ${CURRENT_CPM_VERSION} + CACHE INTERNAL "" +) +set(CPM_DIRECTORY + ${CPM_CURRENT_DIRECTORY} + CACHE INTERNAL "" +) +set(CPM_FILE + ${CMAKE_CURRENT_LIST_FILE} + CACHE INTERNAL "" +) +set(CPM_PACKAGES + "" + CACHE INTERNAL "" +) +set(CPM_DRY_RUN + OFF + CACHE INTERNAL "Don't download or configure dependencies (for testing)" +) + +if(DEFINED ENV{CPM_SOURCE_CACHE}) + set(CPM_SOURCE_CACHE_DEFAULT $ENV{CPM_SOURCE_CACHE}) +else() + set(CPM_SOURCE_CACHE_DEFAULT ${CMAKE_CURRENT_BINARY_DIR}/.cpm-cache) +endif() + +set(CPM_SOURCE_CACHE + ${CPM_SOURCE_CACHE_DEFAULT} + CACHE PATH "Directory to download CPM dependencies" +) + +if(NOT CPM_DONT_UPDATE_MODULE_PATH) + set(CPM_MODULE_PATH + "${CMAKE_BINARY_DIR}/CPM_modules" + CACHE INTERNAL "" + ) + # remove old modules + file(REMOVE_RECURSE ${CPM_MODULE_PATH}) + file(MAKE_DIRECTORY ${CPM_MODULE_PATH}) + # locally added CPM modules should override global packages + set(CMAKE_MODULE_PATH "${CPM_MODULE_PATH};${CMAKE_MODULE_PATH}") +endif() + +if(NOT CPM_DONT_CREATE_PACKAGE_LOCK) + set(CPM_PACKAGE_LOCK_FILE + "${CMAKE_BINARY_DIR}/cpm-package-lock.cmake" + CACHE INTERNAL "" + ) + file(WRITE ${CPM_PACKAGE_LOCK_FILE} + "# CPM Package Lock\n# This file should be committed to version control\n\n" + ) +endif() + +include(FetchContent) + +# Try to infer package name from git repository uri (path or url) +function(cpm_package_name_from_git_uri URI RESULT) + if("${URI}" MATCHES "([^/:]+)/?.git/?$") + set(${RESULT} + ${CMAKE_MATCH_1} + PARENT_SCOPE + ) + else() + unset(${RESULT} PARENT_SCOPE) + endif() +endfunction() + +# Try to infer package name and version from a url +function(cpm_package_name_and_ver_from_url url outName outVer) + if(url MATCHES "[/\\?]([a-zA-Z0-9_\\.-]+)\\.(tar|tar\\.gz|tar\\.bz2|zip|ZIP)(\\?|/|$)") + # We matched an archive + set(filename "${CMAKE_MATCH_1}") + + if(filename MATCHES "([a-zA-Z0-9_\\.-]+)[_-]v?(([0-9]+\\.)*[0-9]+[a-zA-Z0-9]*)") + # We matched - (ie foo-1.2.3) + set(${outName} + "${CMAKE_MATCH_1}" + PARENT_SCOPE + ) + set(${outVer} + "${CMAKE_MATCH_2}" + PARENT_SCOPE + ) + elseif(filename MATCHES "(([0-9]+\\.)+[0-9]+[a-zA-Z0-9]*)") + # We couldn't find a name, but we found a version + # + # In many cases (which we don't handle here) the url would look something like + # `irrelevant/ACTUAL_PACKAGE_NAME/irrelevant/1.2.3.zip`. In such a case we can't possibly + # distinguish the package name from the irrelevant bits. Moreover if we try to match the + # package name from the filename, we'd get bogus at best. + unset(${outName} PARENT_SCOPE) + set(${outVer} + "${CMAKE_MATCH_1}" + PARENT_SCOPE + ) + else() + # Boldly assume that the file name is the package name. + # + # Yes, something like `irrelevant/ACTUAL_NAME/irrelevant/download.zip` will ruin our day, but + # such cases should be quite rare. No popular service does this... we think. + set(${outName} + "${filename}" + PARENT_SCOPE + ) + unset(${outVer} PARENT_SCOPE) + endif() + else() + # No ideas yet what to do with non-archives + unset(${outName} PARENT_SCOPE) + unset(${outVer} PARENT_SCOPE) + endif() +endfunction() + +function(cpm_find_package NAME VERSION) + string(REPLACE " " ";" EXTRA_ARGS "${ARGN}") + find_package(${NAME} ${VERSION} ${EXTRA_ARGS} QUIET) + if(${CPM_ARGS_NAME}_FOUND) + if(DEFINED ${CPM_ARGS_NAME}_VERSION) + set(VERSION ${${CPM_ARGS_NAME}_VERSION}) + endif() + cpm_message(STATUS "${CPM_INDENT} Using local package ${CPM_ARGS_NAME}@${VERSION}") + CPMRegisterPackage(${CPM_ARGS_NAME} "${VERSION}") + set(CPM_PACKAGE_FOUND + YES + PARENT_SCOPE + ) + else() + set(CPM_PACKAGE_FOUND + NO + PARENT_SCOPE + ) + endif() +endfunction() + +# Create a custom FindXXX.cmake module for a CPM package This prevents `find_package(NAME)` from +# finding the system library +function(cpm_create_module_file Name) + if(NOT CPM_DONT_UPDATE_MODULE_PATH) + # erase any previous modules + file(WRITE ${CPM_MODULE_PATH}/Find${Name}.cmake + "include(\"${CPM_FILE}\")\n${ARGN}\nset(${Name}_FOUND TRUE)" + ) + endif() +endfunction() + +# Find a package locally or fallback to CPMAddPackage +function(CPMFindPackage) + set(oneValueArgs NAME VERSION GIT_TAG FIND_PACKAGE_ARGUMENTS) + + cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "" ${ARGN}) + + if(NOT DEFINED CPM_ARGS_VERSION) + if(DEFINED CPM_ARGS_GIT_TAG) + cpm_get_version_from_git_tag("${CPM_ARGS_GIT_TAG}" CPM_ARGS_VERSION) + endif() + endif() + + set(downloadPackage ${CPM_DOWNLOAD_ALL}) + if(DEFINED CPM_DOWNLOAD_${CPM_ARGS_NAME}) + set(downloadPackage ${CPM_DOWNLOAD_${CPM_ARGS_NAME}}) + elseif(DEFINED ENV{CPM_DOWNLOAD_${CPM_ARGS_NAME}}) + set(downloadPackage $ENV{CPM_DOWNLOAD_${CPM_ARGS_NAME}}) + endif() + if(downloadPackage) + CPMAddPackage(${ARGN}) + cpm_export_variables(${CPM_ARGS_NAME}) + return() + endif() + + cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS}) + + if(NOT CPM_PACKAGE_FOUND) + CPMAddPackage(${ARGN}) + cpm_export_variables(${CPM_ARGS_NAME}) + endif() + +endfunction() + +# checks if a package has been added before +function(cpm_check_if_package_already_added CPM_ARGS_NAME CPM_ARGS_VERSION) + if("${CPM_ARGS_NAME}" IN_LIST CPM_PACKAGES) + CPMGetPackageVersion(${CPM_ARGS_NAME} CPM_PACKAGE_VERSION) + if("${CPM_PACKAGE_VERSION}" VERSION_LESS "${CPM_ARGS_VERSION}") + message( + WARNING + "${CPM_INDENT} Requires a newer version of ${CPM_ARGS_NAME} (${CPM_ARGS_VERSION}) than currently included (${CPM_PACKAGE_VERSION})." + ) + endif() + cpm_get_fetch_properties(${CPM_ARGS_NAME}) + set(${CPM_ARGS_NAME}_ADDED NO) + set(CPM_PACKAGE_ALREADY_ADDED + YES + PARENT_SCOPE + ) + cpm_export_variables(${CPM_ARGS_NAME}) + else() + set(CPM_PACKAGE_ALREADY_ADDED + NO + PARENT_SCOPE + ) + endif() +endfunction() + +# Parse the argument of CPMAddPackage in case a single one was provided and convert it to a list of +# arguments which can then be parsed idiomatically. For example gh:foo/bar@1.2.3 will be converted +# to: GITHUB_REPOSITORY;foo/bar;VERSION;1.2.3 +function(cpm_parse_add_package_single_arg arg outArgs) + # Look for a scheme + if("${arg}" MATCHES "^([a-zA-Z]+):(.+)$") + string(TOLOWER "${CMAKE_MATCH_1}" scheme) + set(uri "${CMAKE_MATCH_2}") + + # Check for CPM-specific schemes + if(scheme STREQUAL "gh") + set(out "GITHUB_REPOSITORY;${uri}") + set(packageType "git") + elseif(scheme STREQUAL "gl") + set(out "GITLAB_REPOSITORY;${uri}") + set(packageType "git") + elseif(scheme STREQUAL "bb") + set(out "BITBUCKET_REPOSITORY;${uri}") + set(packageType "git") + # A CPM-specific scheme was not found. Looks like this is a generic URL so try to determine + # type + elseif(arg MATCHES ".git/?(@|#|$)") + set(out "GIT_REPOSITORY;${arg}") + set(packageType "git") + else() + # Fall back to a URL + set(out "URL;${arg}") + set(packageType "archive") + + # We could also check for SVN since FetchContent supports it, but SVN is so rare these days. + # We just won't bother with the additional complexity it will induce in this function. SVN is + # done by multi-arg + endif() + else() + if(arg MATCHES ".git/?(@|#|$)") + set(out "GIT_REPOSITORY;${arg}") + set(packageType "git") + else() + # Give up + message(FATAL_ERROR "${CPM_INDENT} Can't determine package type of '${arg}'") + endif() + endif() + + # For all packages we interpret @... as version. Only replace the last occurrence. Thus URIs + # containing '@' can be used + string(REGEX REPLACE "@([^@]+)$" ";VERSION;\\1" out "${out}") + + # Parse the rest according to package type + if(packageType STREQUAL "git") + # For git repos we interpret #... as a tag or branch or commit hash + string(REGEX REPLACE "#([^#]+)$" ";GIT_TAG;\\1" out "${out}") + elseif(packageType STREQUAL "archive") + # For archives we interpret #... as a URL hash. + string(REGEX REPLACE "#([^#]+)$" ";URL_HASH;\\1" out "${out}") + # We don't try to parse the version if it's not provided explicitly. cpm_get_version_from_url + # should do this at a later point + else() + # We should never get here. This is an assertion and hitting it means there's a problem with the + # code above. A packageType was set, but not handled by this if-else. + message(FATAL_ERROR "${CPM_INDENT} Unsupported package type '${packageType}' of '${arg}'") + endif() + + set(${outArgs} + ${out} + PARENT_SCOPE + ) +endfunction() + +# Check that the working directory for a git repo is clean +function(cpm_check_git_working_dir_is_clean repoPath gitTag isClean) + + find_package(Git REQUIRED) + + if(NOT GIT_EXECUTABLE) + # No git executable, assume directory is clean + set(${isClean} + TRUE + PARENT_SCOPE + ) + return() + endif() + + # check for uncommitted changes + execute_process( + COMMAND ${GIT_EXECUTABLE} status --porcelain + RESULT_VARIABLE resultGitStatus + OUTPUT_VARIABLE repoStatus + OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET + WORKING_DIRECTORY ${repoPath} + ) + if(resultGitStatus) + # not supposed to happen, assume clean anyway + message(WARNING "${CPM_INDENT} Calling git status on folder ${repoPath} failed") + set(${isClean} + TRUE + PARENT_SCOPE + ) + return() + endif() + + if(NOT "${repoStatus}" STREQUAL "") + set(${isClean} + FALSE + PARENT_SCOPE + ) + return() + endif() + + # check for committed changes + execute_process( + COMMAND ${GIT_EXECUTABLE} diff -s --exit-code ${gitTag} + RESULT_VARIABLE resultGitDiff + OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_QUIET + WORKING_DIRECTORY ${repoPath} + ) + + if(${resultGitDiff} EQUAL 0) + set(${isClean} + TRUE + PARENT_SCOPE + ) + else() + set(${isClean} + FALSE + PARENT_SCOPE + ) + endif() + +endfunction() + +# Add PATCH_COMMAND to CPM_ARGS_UNPARSED_ARGUMENTS. This method consumes a list of files in ARGN +# then generates a `PATCH_COMMAND` appropriate for `ExternalProject_Add()`. This command is appended +# to the parent scope's `CPM_ARGS_UNPARSED_ARGUMENTS`. +function(cpm_add_patches) + # Return if no patch files are supplied. + if(NOT ARGN) + return() + endif() + + # Find the patch program. + find_program(PATCH_EXECUTABLE patch) + if(WIN32 AND NOT PATCH_EXECUTABLE) + # The Windows git executable is distributed with patch.exe. Find the path to the executable, if + # it exists, then search `../usr/bin` and `../../usr/bin` for patch.exe. + find_package(Git QUIET) + if(GIT_EXECUTABLE) + get_filename_component(extra_search_path ${GIT_EXECUTABLE} DIRECTORY) + get_filename_component(extra_search_path_1up ${extra_search_path} DIRECTORY) + get_filename_component(extra_search_path_2up ${extra_search_path_1up} DIRECTORY) + find_program( + PATCH_EXECUTABLE patch HINTS "${extra_search_path_1up}/usr/bin" + "${extra_search_path_2up}/usr/bin" + ) + endif() + endif() + if(NOT PATCH_EXECUTABLE) + message(FATAL_ERROR "Couldn't find `patch` executable to use with PATCHES keyword.") + endif() + + # Create a temporary + set(temp_list ${CPM_ARGS_UNPARSED_ARGUMENTS}) + + # Ensure each file exists (or error out) and add it to the list. + set(first_item True) + foreach(PATCH_FILE ${ARGN}) + # Make sure the patch file exists, if we can't find it, try again in the current directory. + if(NOT EXISTS "${PATCH_FILE}") + if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/${PATCH_FILE}") + message(FATAL_ERROR "Couldn't find patch file: '${PATCH_FILE}'") + endif() + set(PATCH_FILE "${CMAKE_CURRENT_LIST_DIR}/${PATCH_FILE}") + endif() + + # Convert to absolute path for use with patch file command. + get_filename_component(PATCH_FILE "${PATCH_FILE}" ABSOLUTE) + + # The first patch entry must be preceded by "PATCH_COMMAND" while the following items are + # preceded by "&&". + if(first_item) + set(first_item False) + list(APPEND temp_list "PATCH_COMMAND") + else() + list(APPEND temp_list "&&") + endif() + # Add the patch command to the list + list(APPEND temp_list "${PATCH_EXECUTABLE}" "-p1" "<" "${PATCH_FILE}") + endforeach() + + # Move temp out into parent scope. + set(CPM_ARGS_UNPARSED_ARGUMENTS + ${temp_list} + PARENT_SCOPE + ) + +endfunction() + +# method to overwrite internal FetchContent properties, to allow using CPM.cmake to overload +# FetchContent calls. As these are internal cmake properties, this method should be used carefully +# and may need modification in future CMake versions. Source: +# https://github.com/Kitware/CMake/blob/dc3d0b5a0a7d26d43d6cfeb511e224533b5d188f/Modules/FetchContent.cmake#L1152 +function(cpm_override_fetchcontent contentName) + cmake_parse_arguments(PARSE_ARGV 1 arg "" "SOURCE_DIR;BINARY_DIR" "") + if(NOT "${arg_UNPARSED_ARGUMENTS}" STREQUAL "") + message(FATAL_ERROR "${CPM_INDENT} Unsupported arguments: ${arg_UNPARSED_ARGUMENTS}") + endif() + + string(TOLOWER ${contentName} contentNameLower) + set(prefix "_FetchContent_${contentNameLower}") + + set(propertyName "${prefix}_sourceDir") + define_property( + GLOBAL + PROPERTY ${propertyName} + BRIEF_DOCS "Internal implementation detail of FetchContent_Populate()" + FULL_DOCS "Details used by FetchContent_Populate() for ${contentName}" + ) + set_property(GLOBAL PROPERTY ${propertyName} "${arg_SOURCE_DIR}") + + set(propertyName "${prefix}_binaryDir") + define_property( + GLOBAL + PROPERTY ${propertyName} + BRIEF_DOCS "Internal implementation detail of FetchContent_Populate()" + FULL_DOCS "Details used by FetchContent_Populate() for ${contentName}" + ) + set_property(GLOBAL PROPERTY ${propertyName} "${arg_BINARY_DIR}") + + set(propertyName "${prefix}_populated") + define_property( + GLOBAL + PROPERTY ${propertyName} + BRIEF_DOCS "Internal implementation detail of FetchContent_Populate()" + FULL_DOCS "Details used by FetchContent_Populate() for ${contentName}" + ) + set_property(GLOBAL PROPERTY ${propertyName} TRUE) +endfunction() + +# Download and add a package from source +function(CPMAddPackage) + cpm_set_policies() + + list(LENGTH ARGN argnLength) + if(argnLength EQUAL 1) + cpm_parse_add_package_single_arg("${ARGN}" ARGN) + + # The shorthand syntax implies EXCLUDE_FROM_ALL and SYSTEM + set(ARGN "${ARGN};EXCLUDE_FROM_ALL;YES;SYSTEM;YES;") + endif() + + set(oneValueArgs + NAME + FORCE + VERSION + GIT_TAG + DOWNLOAD_ONLY + GITHUB_REPOSITORY + GITLAB_REPOSITORY + BITBUCKET_REPOSITORY + GIT_REPOSITORY + SOURCE_DIR + FIND_PACKAGE_ARGUMENTS + NO_CACHE + SYSTEM + GIT_SHALLOW + EXCLUDE_FROM_ALL + SOURCE_SUBDIR + CUSTOM_CACHE_KEY + ) + + set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND PATCHES) + + cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}") + + # Set default values for arguments + + if(NOT DEFINED CPM_ARGS_VERSION) + if(DEFINED CPM_ARGS_GIT_TAG) + cpm_get_version_from_git_tag("${CPM_ARGS_GIT_TAG}" CPM_ARGS_VERSION) + endif() + endif() + + if(CPM_ARGS_DOWNLOAD_ONLY) + set(DOWNLOAD_ONLY ${CPM_ARGS_DOWNLOAD_ONLY}) + else() + set(DOWNLOAD_ONLY NO) + endif() + + if(DEFINED CPM_ARGS_GITHUB_REPOSITORY) + set(CPM_ARGS_GIT_REPOSITORY "https://github.com/${CPM_ARGS_GITHUB_REPOSITORY}.git") + elseif(DEFINED CPM_ARGS_GITLAB_REPOSITORY) + set(CPM_ARGS_GIT_REPOSITORY "https://gitlab.com/${CPM_ARGS_GITLAB_REPOSITORY}.git") + elseif(DEFINED CPM_ARGS_BITBUCKET_REPOSITORY) + set(CPM_ARGS_GIT_REPOSITORY "https://bitbucket.org/${CPM_ARGS_BITBUCKET_REPOSITORY}.git") + endif() + + if(DEFINED CPM_ARGS_GIT_REPOSITORY) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_REPOSITORY ${CPM_ARGS_GIT_REPOSITORY}) + if(NOT DEFINED CPM_ARGS_GIT_TAG) + set(CPM_ARGS_GIT_TAG v${CPM_ARGS_VERSION}) + endif() + + # If a name wasn't provided, try to infer it from the git repo + if(NOT DEFINED CPM_ARGS_NAME) + cpm_package_name_from_git_uri(${CPM_ARGS_GIT_REPOSITORY} CPM_ARGS_NAME) + endif() + endif() + + set(CPM_SKIP_FETCH FALSE) + + if(DEFINED CPM_ARGS_GIT_TAG) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_TAG ${CPM_ARGS_GIT_TAG}) + # If GIT_SHALLOW is explicitly specified, honor the value. + if(DEFINED CPM_ARGS_GIT_SHALLOW) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_SHALLOW ${CPM_ARGS_GIT_SHALLOW}) + endif() + endif() + + if(DEFINED CPM_ARGS_URL) + # If a name or version aren't provided, try to infer them from the URL + list(GET CPM_ARGS_URL 0 firstUrl) + cpm_package_name_and_ver_from_url(${firstUrl} nameFromUrl verFromUrl) + # If we fail to obtain name and version from the first URL, we could try other URLs if any. + # However multiple URLs are expected to be quite rare, so for now we won't bother. + + # If the caller provided their own name and version, they trump the inferred ones. + if(NOT DEFINED CPM_ARGS_NAME) + set(CPM_ARGS_NAME ${nameFromUrl}) + endif() + if(NOT DEFINED CPM_ARGS_VERSION) + set(CPM_ARGS_VERSION ${verFromUrl}) + endif() + + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS URL "${CPM_ARGS_URL}") + endif() + + # Check for required arguments + + if(NOT DEFINED CPM_ARGS_NAME) + message( + FATAL_ERROR + "${CPM_INDENT} 'NAME' was not provided and couldn't be automatically inferred for package added with arguments: '${ARGN}'" + ) + endif() + + # Check if package has been added before + cpm_check_if_package_already_added(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}") + if(CPM_PACKAGE_ALREADY_ADDED) + cpm_export_variables(${CPM_ARGS_NAME}) + return() + endif() + + # Check for manual overrides + if(NOT CPM_ARGS_FORCE AND NOT "${CPM_${CPM_ARGS_NAME}_SOURCE}" STREQUAL "") + set(PACKAGE_SOURCE ${CPM_${CPM_ARGS_NAME}_SOURCE}) + set(CPM_${CPM_ARGS_NAME}_SOURCE "") + CPMAddPackage( + NAME "${CPM_ARGS_NAME}" + SOURCE_DIR "${PACKAGE_SOURCE}" + EXCLUDE_FROM_ALL "${CPM_ARGS_EXCLUDE_FROM_ALL}" + SYSTEM "${CPM_ARGS_SYSTEM}" + PATCHES "${CPM_ARGS_PATCHES}" + OPTIONS "${CPM_ARGS_OPTIONS}" + SOURCE_SUBDIR "${CPM_ARGS_SOURCE_SUBDIR}" + DOWNLOAD_ONLY "${DOWNLOAD_ONLY}" + FORCE True + ) + cpm_export_variables(${CPM_ARGS_NAME}) + return() + endif() + + # Check for available declaration + if(NOT CPM_ARGS_FORCE AND NOT "${CPM_DECLARATION_${CPM_ARGS_NAME}}" STREQUAL "") + set(declaration ${CPM_DECLARATION_${CPM_ARGS_NAME}}) + set(CPM_DECLARATION_${CPM_ARGS_NAME} "") + CPMAddPackage(${declaration}) + cpm_export_variables(${CPM_ARGS_NAME}) + # checking again to ensure version and option compatibility + cpm_check_if_package_already_added(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}") + return() + endif() + + if(NOT CPM_ARGS_FORCE) + if(CPM_USE_LOCAL_PACKAGES OR CPM_LOCAL_PACKAGES_ONLY) + cpm_find_package(${CPM_ARGS_NAME} "${CPM_ARGS_VERSION}" ${CPM_ARGS_FIND_PACKAGE_ARGUMENTS}) + + if(CPM_PACKAGE_FOUND) + cpm_export_variables(${CPM_ARGS_NAME}) + return() + endif() + + if(CPM_LOCAL_PACKAGES_ONLY) + message( + SEND_ERROR + "${CPM_INDENT} ${CPM_ARGS_NAME} not found via find_package(${CPM_ARGS_NAME} ${CPM_ARGS_VERSION})" + ) + endif() + endif() + endif() + + CPMRegisterPackage("${CPM_ARGS_NAME}" "${CPM_ARGS_VERSION}") + + if(DEFINED CPM_ARGS_GIT_TAG) + set(PACKAGE_INFO "${CPM_ARGS_GIT_TAG}") + elseif(DEFINED CPM_ARGS_SOURCE_DIR) + set(PACKAGE_INFO "${CPM_ARGS_SOURCE_DIR}") + else() + set(PACKAGE_INFO "${CPM_ARGS_VERSION}") + endif() + + if(DEFINED FETCHCONTENT_BASE_DIR) + # respect user's FETCHCONTENT_BASE_DIR if set + set(CPM_FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR}) + else() + set(CPM_FETCHCONTENT_BASE_DIR ${CMAKE_BINARY_DIR}/_deps) + endif() + + cpm_add_patches(${CPM_ARGS_PATCHES}) + + if(DEFINED CPM_ARGS_DOWNLOAD_COMMAND) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS DOWNLOAD_COMMAND ${CPM_ARGS_DOWNLOAD_COMMAND}) + elseif(DEFINED CPM_ARGS_SOURCE_DIR) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR ${CPM_ARGS_SOURCE_DIR}) + if(NOT IS_ABSOLUTE ${CPM_ARGS_SOURCE_DIR}) + # Expand `CPM_ARGS_SOURCE_DIR` relative path. This is important because EXISTS doesn't work + # for relative paths. + get_filename_component( + source_directory ${CPM_ARGS_SOURCE_DIR} REALPATH BASE_DIR ${CMAKE_CURRENT_BINARY_DIR} + ) + else() + set(source_directory ${CPM_ARGS_SOURCE_DIR}) + endif() + if(NOT EXISTS ${source_directory}) + string(TOLOWER ${CPM_ARGS_NAME} lower_case_name) + # remove timestamps so CMake will re-download the dependency + file(REMOVE_RECURSE "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-subbuild") + endif() + elseif(CPM_SOURCE_CACHE AND NOT CPM_ARGS_NO_CACHE) + string(TOLOWER ${CPM_ARGS_NAME} lower_case_name) + set(origin_parameters ${CPM_ARGS_UNPARSED_ARGUMENTS}) + list(SORT origin_parameters) + if(CPM_ARGS_CUSTOM_CACHE_KEY) + # Application set a custom unique directory name + set(download_directory ${CPM_SOURCE_CACHE}/${lower_case_name}/${CPM_ARGS_CUSTOM_CACHE_KEY}) + elseif(CPM_USE_NAMED_CACHE_DIRECTORIES) + string(SHA1 origin_hash "${origin_parameters};NEW_CACHE_STRUCTURE_TAG") + set(download_directory ${CPM_SOURCE_CACHE}/${lower_case_name}/${origin_hash}/${CPM_ARGS_NAME}) + else() + string(SHA1 origin_hash "${origin_parameters}") + set(download_directory ${CPM_SOURCE_CACHE}/${lower_case_name}/${origin_hash}) + endif() + # Expand `download_directory` relative path. This is important because EXISTS doesn't work for + # relative paths. + get_filename_component(download_directory ${download_directory} ABSOLUTE) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS SOURCE_DIR ${download_directory}) + + if(CPM_SOURCE_CACHE) + file(LOCK ${download_directory}/../cmake.lock) + endif() + + if(EXISTS ${download_directory}) + if(CPM_SOURCE_CACHE) + file(LOCK ${download_directory}/../cmake.lock RELEASE) + endif() + + cpm_store_fetch_properties( + ${CPM_ARGS_NAME} "${download_directory}" + "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-build" + ) + cpm_get_fetch_properties("${CPM_ARGS_NAME}") + + if(DEFINED CPM_ARGS_GIT_TAG AND NOT (PATCH_COMMAND IN_LIST CPM_ARGS_UNPARSED_ARGUMENTS)) + # warn if cache has been changed since checkout + cpm_check_git_working_dir_is_clean(${download_directory} ${CPM_ARGS_GIT_TAG} IS_CLEAN) + if(NOT ${IS_CLEAN}) + message( + WARNING "${CPM_INDENT} Cache for ${CPM_ARGS_NAME} (${download_directory}) is dirty" + ) + endif() + endif() + + cpm_add_subdirectory( + "${CPM_ARGS_NAME}" + "${DOWNLOAD_ONLY}" + "${${CPM_ARGS_NAME}_SOURCE_DIR}/${CPM_ARGS_SOURCE_SUBDIR}" + "${${CPM_ARGS_NAME}_BINARY_DIR}" + "${CPM_ARGS_EXCLUDE_FROM_ALL}" + "${CPM_ARGS_SYSTEM}" + "${CPM_ARGS_OPTIONS}" + ) + set(PACKAGE_INFO "${PACKAGE_INFO} at ${download_directory}") + + # As the source dir is already cached/populated, we override the call to FetchContent. + set(CPM_SKIP_FETCH TRUE) + cpm_override_fetchcontent( + "${lower_case_name}" SOURCE_DIR "${${CPM_ARGS_NAME}_SOURCE_DIR}/${CPM_ARGS_SOURCE_SUBDIR}" + BINARY_DIR "${${CPM_ARGS_NAME}_BINARY_DIR}" + ) + + else() + # Enable shallow clone when GIT_TAG is not a commit hash. Our guess may not be accurate, but + # it should guarantee no commit hash get mis-detected. + if(NOT DEFINED CPM_ARGS_GIT_SHALLOW) + cpm_is_git_tag_commit_hash("${CPM_ARGS_GIT_TAG}" IS_HASH) + if(NOT ${IS_HASH}) + list(APPEND CPM_ARGS_UNPARSED_ARGUMENTS GIT_SHALLOW TRUE) + endif() + endif() + + # remove timestamps so CMake will re-download the dependency + file(REMOVE_RECURSE ${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-subbuild) + set(PACKAGE_INFO "${PACKAGE_INFO} to ${download_directory}") + endif() + endif() + + cpm_create_module_file(${CPM_ARGS_NAME} "CPMAddPackage(\"${ARGN}\")") + + if(CPM_PACKAGE_LOCK_ENABLED) + if((CPM_ARGS_VERSION AND NOT CPM_ARGS_SOURCE_DIR) OR CPM_INCLUDE_ALL_IN_PACKAGE_LOCK) + cpm_add_to_package_lock(${CPM_ARGS_NAME} "${ARGN}") + elseif(CPM_ARGS_SOURCE_DIR) + cpm_add_comment_to_package_lock(${CPM_ARGS_NAME} "local directory") + else() + cpm_add_comment_to_package_lock(${CPM_ARGS_NAME} "${ARGN}") + endif() + endif() + + cpm_message( + STATUS "${CPM_INDENT} Adding package ${CPM_ARGS_NAME}@${CPM_ARGS_VERSION} (${PACKAGE_INFO})" + ) + + if(NOT CPM_SKIP_FETCH) + # CMake 3.28 added EXCLUDE, SYSTEM (3.25), and SOURCE_SUBDIR (3.18) to FetchContent_Declare. + # Calling FetchContent_MakeAvailable will then internally forward these options to + # add_subdirectory. Up until these changes, we had to call FetchContent_Populate and + # add_subdirectory separately, which is no longer necessary and has been deprecated as of 3.30. + set(fetchContentDeclareExtraArgs "") + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.28.0") + if(${CPM_ARGS_EXCLUDE_FROM_ALL}) + list(APPEND fetchContentDeclareExtraArgs EXCLUDE_FROM_ALL) + endif() + if(${CPM_ARGS_SYSTEM}) + list(APPEND fetchContentDeclareExtraArgs SYSTEM) + endif() + if(DEFINED CPM_ARGS_SOURCE_SUBDIR) + list(APPEND fetchContentDeclareExtraArgs SOURCE_SUBDIR ${CPM_ARGS_SOURCE_SUBDIR}) + endif() + # For CMake version <3.28 OPTIONS are parsed in cpm_add_subdirectory + if(CPM_ARGS_OPTIONS AND NOT DOWNLOAD_ONLY) + foreach(OPTION ${CPM_ARGS_OPTIONS}) + cpm_parse_option("${OPTION}") + set(${OPTION_KEY} "${OPTION_VALUE}") + endforeach() + endif() + endif() + cpm_declare_fetch( + "${CPM_ARGS_NAME}" ${fetchContentDeclareExtraArgs} "${CPM_ARGS_UNPARSED_ARGUMENTS}" + ) + + cpm_fetch_package("${CPM_ARGS_NAME}" ${DOWNLOAD_ONLY} populated ${CPM_ARGS_UNPARSED_ARGUMENTS}) + if(CPM_SOURCE_CACHE AND download_directory) + file(LOCK ${download_directory}/../cmake.lock RELEASE) + endif() + if(${populated} AND ${CMAKE_VERSION} VERSION_LESS "3.28.0") + cpm_add_subdirectory( + "${CPM_ARGS_NAME}" + "${DOWNLOAD_ONLY}" + "${${CPM_ARGS_NAME}_SOURCE_DIR}/${CPM_ARGS_SOURCE_SUBDIR}" + "${${CPM_ARGS_NAME}_BINARY_DIR}" + "${CPM_ARGS_EXCLUDE_FROM_ALL}" + "${CPM_ARGS_SYSTEM}" + "${CPM_ARGS_OPTIONS}" + ) + endif() + cpm_get_fetch_properties("${CPM_ARGS_NAME}") + endif() + + set(${CPM_ARGS_NAME}_ADDED YES) + cpm_export_variables("${CPM_ARGS_NAME}") +endfunction() + +# Fetch a previously declared package +macro(CPMGetPackage Name) + if(DEFINED "CPM_DECLARATION_${Name}") + CPMAddPackage(NAME ${Name}) + else() + message(SEND_ERROR "${CPM_INDENT} Cannot retrieve package ${Name}: no declaration available") + endif() +endmacro() + +# export variables available to the caller to the parent scope expects ${CPM_ARGS_NAME} to be set +macro(cpm_export_variables name) + set(${name}_SOURCE_DIR + "${${name}_SOURCE_DIR}" + PARENT_SCOPE + ) + set(${name}_BINARY_DIR + "${${name}_BINARY_DIR}" + PARENT_SCOPE + ) + set(${name}_ADDED + "${${name}_ADDED}" + PARENT_SCOPE + ) + set(CPM_LAST_PACKAGE_NAME + "${name}" + PARENT_SCOPE + ) +endmacro() + +# declares a package, so that any call to CPMAddPackage for the package name will use these +# arguments instead. Previous declarations will not be overridden. +macro(CPMDeclarePackage Name) + if(NOT DEFINED "CPM_DECLARATION_${Name}") + set("CPM_DECLARATION_${Name}" "${ARGN}") + endif() +endmacro() + +function(cpm_add_to_package_lock Name) + if(NOT CPM_DONT_CREATE_PACKAGE_LOCK) + cpm_prettify_package_arguments(PRETTY_ARGN false ${ARGN}) + file(APPEND ${CPM_PACKAGE_LOCK_FILE} "# ${Name}\nCPMDeclarePackage(${Name}\n${PRETTY_ARGN})\n") + endif() +endfunction() + +function(cpm_add_comment_to_package_lock Name) + if(NOT CPM_DONT_CREATE_PACKAGE_LOCK) + cpm_prettify_package_arguments(PRETTY_ARGN true ${ARGN}) + file(APPEND ${CPM_PACKAGE_LOCK_FILE} + "# ${Name} (unversioned)\n# CPMDeclarePackage(${Name}\n${PRETTY_ARGN}#)\n" + ) + endif() +endfunction() + +# includes the package lock file if it exists and creates a target `cpm-update-package-lock` to +# update it +macro(CPMUsePackageLock file) + if(NOT CPM_DONT_CREATE_PACKAGE_LOCK) + get_filename_component(CPM_ABSOLUTE_PACKAGE_LOCK_PATH ${file} ABSOLUTE) + if(EXISTS ${CPM_ABSOLUTE_PACKAGE_LOCK_PATH}) + include(${CPM_ABSOLUTE_PACKAGE_LOCK_PATH}) + endif() + if(NOT TARGET cpm-update-package-lock) + add_custom_target( + cpm-update-package-lock COMMAND ${CMAKE_COMMAND} -E copy ${CPM_PACKAGE_LOCK_FILE} + ${CPM_ABSOLUTE_PACKAGE_LOCK_PATH} + ) + endif() + set(CPM_PACKAGE_LOCK_ENABLED true) + endif() +endmacro() + +# registers a package that has been added to CPM +function(CPMRegisterPackage PACKAGE VERSION) + list(APPEND CPM_PACKAGES ${PACKAGE}) + set(CPM_PACKAGES + ${CPM_PACKAGES} + CACHE INTERNAL "" + ) + set("CPM_PACKAGE_${PACKAGE}_VERSION" + ${VERSION} + CACHE INTERNAL "" + ) +endfunction() + +# retrieve the current version of the package to ${OUTPUT} +function(CPMGetPackageVersion PACKAGE OUTPUT) + set(${OUTPUT} + "${CPM_PACKAGE_${PACKAGE}_VERSION}" + PARENT_SCOPE + ) +endfunction() + +# declares a package in FetchContent_Declare +function(cpm_declare_fetch PACKAGE) + if(${CPM_DRY_RUN}) + cpm_message(STATUS "${CPM_INDENT} Package not declared (dry run)") + return() + endif() + + FetchContent_Declare(${PACKAGE} ${ARGN}) +endfunction() + +# returns properties for a package previously defined by cpm_declare_fetch +function(cpm_get_fetch_properties PACKAGE) + if(${CPM_DRY_RUN}) + return() + endif() + + set(${PACKAGE}_SOURCE_DIR + "${CPM_PACKAGE_${PACKAGE}_SOURCE_DIR}" + PARENT_SCOPE + ) + set(${PACKAGE}_BINARY_DIR + "${CPM_PACKAGE_${PACKAGE}_BINARY_DIR}" + PARENT_SCOPE + ) +endfunction() + +function(cpm_store_fetch_properties PACKAGE source_dir binary_dir) + if(${CPM_DRY_RUN}) + return() + endif() + + set(CPM_PACKAGE_${PACKAGE}_SOURCE_DIR + "${source_dir}" + CACHE INTERNAL "" + ) + set(CPM_PACKAGE_${PACKAGE}_BINARY_DIR + "${binary_dir}" + CACHE INTERNAL "" + ) +endfunction() + +# adds a package as a subdirectory if viable, according to provided options +function( + cpm_add_subdirectory + PACKAGE + DOWNLOAD_ONLY + SOURCE_DIR + BINARY_DIR + EXCLUDE + SYSTEM + OPTIONS +) + + if(NOT DOWNLOAD_ONLY AND EXISTS ${SOURCE_DIR}/CMakeLists.txt) + set(addSubdirectoryExtraArgs "") + if(EXCLUDE) + list(APPEND addSubdirectoryExtraArgs EXCLUDE_FROM_ALL) + endif() + if("${SYSTEM}" AND "${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.25") + # https://cmake.org/cmake/help/latest/prop_dir/SYSTEM.html#prop_dir:SYSTEM + list(APPEND addSubdirectoryExtraArgs SYSTEM) + endif() + if(OPTIONS) + foreach(OPTION ${OPTIONS}) + cpm_parse_option("${OPTION}") + set(${OPTION_KEY} "${OPTION_VALUE}") + endforeach() + endif() + set(CPM_OLD_INDENT "${CPM_INDENT}") + set(CPM_INDENT "${CPM_INDENT} ${PACKAGE}:") + add_subdirectory(${SOURCE_DIR} ${BINARY_DIR} ${addSubdirectoryExtraArgs}) + set(CPM_INDENT "${CPM_OLD_INDENT}") + endif() +endfunction() + +# downloads a previously declared package via FetchContent and exports the variables +# `${PACKAGE}_SOURCE_DIR` and `${PACKAGE}_BINARY_DIR` to the parent scope +function(cpm_fetch_package PACKAGE DOWNLOAD_ONLY populated) + set(${populated} + FALSE + PARENT_SCOPE + ) + if(${CPM_DRY_RUN}) + cpm_message(STATUS "${CPM_INDENT} Package ${PACKAGE} not fetched (dry run)") + return() + endif() + + FetchContent_GetProperties(${PACKAGE}) + + string(TOLOWER "${PACKAGE}" lower_case_name) + + if(NOT ${lower_case_name}_POPULATED) + if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.28.0") + if(DOWNLOAD_ONLY) + # MakeAvailable will call add_subdirectory internally which is not what we want when + # DOWNLOAD_ONLY is set. Populate will only download the dependency without adding it to the + # build + FetchContent_Populate( + ${PACKAGE} + SOURCE_DIR "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-src" + BINARY_DIR "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-build" + SUBBUILD_DIR "${CPM_FETCHCONTENT_BASE_DIR}/${lower_case_name}-subbuild" + ${ARGN} + ) + else() + FetchContent_MakeAvailable(${PACKAGE}) + endif() + else() + FetchContent_Populate(${PACKAGE}) + endif() + set(${populated} + TRUE + PARENT_SCOPE + ) + endif() + + cpm_store_fetch_properties( + ${CPM_ARGS_NAME} ${${lower_case_name}_SOURCE_DIR} ${${lower_case_name}_BINARY_DIR} + ) + + set(${PACKAGE}_SOURCE_DIR + ${${lower_case_name}_SOURCE_DIR} + PARENT_SCOPE + ) + set(${PACKAGE}_BINARY_DIR + ${${lower_case_name}_BINARY_DIR} + PARENT_SCOPE + ) +endfunction() + +# splits a package option +function(cpm_parse_option OPTION) + string(REGEX MATCH "^[^ ]+" OPTION_KEY "${OPTION}") + string(LENGTH "${OPTION}" OPTION_LENGTH) + string(LENGTH "${OPTION_KEY}" OPTION_KEY_LENGTH) + if(OPTION_KEY_LENGTH STREQUAL OPTION_LENGTH) + # no value for key provided, assume user wants to set option to "ON" + set(OPTION_VALUE "ON") + else() + math(EXPR OPTION_KEY_LENGTH "${OPTION_KEY_LENGTH}+1") + string(SUBSTRING "${OPTION}" "${OPTION_KEY_LENGTH}" "-1" OPTION_VALUE) + endif() + set(OPTION_KEY + "${OPTION_KEY}" + PARENT_SCOPE + ) + set(OPTION_VALUE + "${OPTION_VALUE}" + PARENT_SCOPE + ) +endfunction() + +# guesses the package version from a git tag +function(cpm_get_version_from_git_tag GIT_TAG RESULT) + string(LENGTH ${GIT_TAG} length) + if(length EQUAL 40) + # GIT_TAG is probably a git hash + set(${RESULT} + 0 + PARENT_SCOPE + ) + else() + string(REGEX MATCH "v?([0123456789.]*).*" _ ${GIT_TAG}) + set(${RESULT} + ${CMAKE_MATCH_1} + PARENT_SCOPE + ) + endif() +endfunction() + +# guesses if the git tag is a commit hash or an actual tag or a branch name. +function(cpm_is_git_tag_commit_hash GIT_TAG RESULT) + string(LENGTH "${GIT_TAG}" length) + # full hash has 40 characters, and short hash has at least 7 characters. + if(length LESS 7 OR length GREATER 40) + set(${RESULT} + 0 + PARENT_SCOPE + ) + else() + if(${GIT_TAG} MATCHES "^[a-fA-F0-9]+$") + set(${RESULT} + 1 + PARENT_SCOPE + ) + else() + set(${RESULT} + 0 + PARENT_SCOPE + ) + endif() + endif() +endfunction() + +function(cpm_prettify_package_arguments OUT_VAR IS_IN_COMMENT) + set(oneValueArgs + NAME + FORCE + VERSION + GIT_TAG + DOWNLOAD_ONLY + GITHUB_REPOSITORY + GITLAB_REPOSITORY + BITBUCKET_REPOSITORY + GIT_REPOSITORY + SOURCE_DIR + FIND_PACKAGE_ARGUMENTS + NO_CACHE + SYSTEM + GIT_SHALLOW + EXCLUDE_FROM_ALL + SOURCE_SUBDIR + ) + set(multiValueArgs URL OPTIONS DOWNLOAD_COMMAND) + cmake_parse_arguments(CPM_ARGS "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) + + foreach(oneArgName ${oneValueArgs}) + if(DEFINED CPM_ARGS_${oneArgName}) + if(${IS_IN_COMMENT}) + string(APPEND PRETTY_OUT_VAR "#") + endif() + if(${oneArgName} STREQUAL "SOURCE_DIR") + string(REPLACE ${CMAKE_SOURCE_DIR} "\${CMAKE_SOURCE_DIR}" CPM_ARGS_${oneArgName} + ${CPM_ARGS_${oneArgName}} + ) + endif() + string(APPEND PRETTY_OUT_VAR " ${oneArgName} ${CPM_ARGS_${oneArgName}}\n") + endif() + endforeach() + foreach(multiArgName ${multiValueArgs}) + if(DEFINED CPM_ARGS_${multiArgName}) + if(${IS_IN_COMMENT}) + string(APPEND PRETTY_OUT_VAR "#") + endif() + string(APPEND PRETTY_OUT_VAR " ${multiArgName}\n") + foreach(singleOption ${CPM_ARGS_${multiArgName}}) + if(${IS_IN_COMMENT}) + string(APPEND PRETTY_OUT_VAR "#") + endif() + string(APPEND PRETTY_OUT_VAR " \"${singleOption}\"\n") + endforeach() + endif() + endforeach() + + if(NOT "${CPM_ARGS_UNPARSED_ARGUMENTS}" STREQUAL "") + if(${IS_IN_COMMENT}) + string(APPEND PRETTY_OUT_VAR "#") + endif() + string(APPEND PRETTY_OUT_VAR " ") + foreach(CPM_ARGS_UNPARSED_ARGUMENT ${CPM_ARGS_UNPARSED_ARGUMENTS}) + string(APPEND PRETTY_OUT_VAR " ${CPM_ARGS_UNPARSED_ARGUMENT}") + endforeach() + string(APPEND PRETTY_OUT_VAR "\n") + endif() + + set(${OUT_VAR} + ${PRETTY_OUT_VAR} + PARENT_SCOPE + ) + +endfunction() diff --git a/third_party/tracy/cmake/ECMFindModuleHelpers.cmake b/third_party/tracy/cmake/ECMFindModuleHelpers.cmake new file mode 100644 index 0000000..a5dabb1 --- /dev/null +++ b/third_party/tracy/cmake/ECMFindModuleHelpers.cmake @@ -0,0 +1,300 @@ +#.rst: +# ECMFindModuleHelpers +# -------------------- +# +# Helper macros for find modules: ecm_find_package_version_check(), +# ecm_find_package_parse_components() and +# ecm_find_package_handle_library_components(). +# +# :: +# +# ecm_find_package_version_check() +# +# Prints warnings if the CMake version or the project's required CMake version +# is older than that required by extra-cmake-modules. +# +# :: +# +# ecm_find_package_parse_components( +# RESULT_VAR +# KNOWN_COMPONENTS [ [...]] +# [SKIP_DEPENDENCY_HANDLING]) +# +# This macro will populate with a list of components found in +# _FIND_COMPONENTS, after checking that all those components are in the +# list of KNOWN_COMPONENTS; if there are any unknown components, it will print +# an error or warning (depending on the value of _FIND_REQUIRED) and call +# return(). +# +# The order of components in is guaranteed to match the order they +# are listed in the KNOWN_COMPONENTS argument. +# +# If SKIP_DEPENDENCY_HANDLING is not set, for each component the variable +# __component_deps will be checked for dependent components. +# If is listed in _FIND_COMPONENTS, then all its (transitive) +# dependencies will also be added to . +# +# :: +# +# ecm_find_package_handle_library_components( +# COMPONENTS [ [...]] +# [SKIP_DEPENDENCY_HANDLING]) +# [SKIP_PKG_CONFIG]) +# +# Creates an imported library target for each component. The operation of this +# macro depends on the presence of a number of CMake variables. +# +# The __lib variable should contain the name of this library, +# and __header variable should contain the name of a header +# file associated with it (whatever relative path is normally passed to +# '#include'). __header_subdir variable can be used to specify +# which subdirectory of the include path the headers will be found in. +# ecm_find_package_components() will then search for the library +# and include directory (creating appropriate cache variables) and create an +# imported library target named ::. +# +# Additional variables can be used to provide additional information: +# +# If SKIP_PKG_CONFIG, the __pkg_config variable is set, and +# pkg-config is found, the pkg-config module given by +# __pkg_config will be searched for and used to help locate the +# library and header file. It will also be used to set +# __VERSION. +# +# Note that if version information is found via pkg-config, +# __FIND_VERSION can be set to require a particular version +# for each component. +# +# If SKIP_DEPENDENCY_HANDLING is not set, the INTERFACE_LINK_LIBRARIES property +# of the imported target for will be set to contain the imported +# targets for the components listed in __component_deps. +# _FOUND will also be set to false if any of the components in +# __component_deps are not found. This requires the components +# in __component_deps to be listed before in the +# COMPONENTS argument. +# +# The following variables will be set: +# +# ``_TARGETS`` +# the imported targets +# ``_LIBRARIES`` +# the found libraries +# ``_INCLUDE_DIRS`` +# the combined required include directories for the components +# ``_DEFINITIONS`` +# the "other" CFLAGS provided by pkg-config, if any +# ``_VERSION`` +# the value of ``__VERSION`` for the first component that +# has this variable set (note that components are searched for in the order +# they are passed to the macro), although if it is already set, it will not +# be altered +# +# Note that these variables are never cleared, so if +# ecm_find_package_handle_library_components() is called multiple times with +# different components (typically because of multiple find_package() calls) then +# ``_TARGETS``, for example, will contain all the targets found in any +# call (although no duplicates). +# +# Since pre-1.0.0. + +#============================================================================= +# Copyright 2014 Alex Merry +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +macro(ecm_find_package_version_check module_name) + if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "CMake 2.8.12 is required by Find${module_name}.cmake") + endif() + if(CMAKE_MINIMUM_REQUIRED_VERSION VERSION_LESS 2.8.12) + message(AUTHOR_WARNING "Your project should require at least CMake 2.8.12 to use Find${module_name}.cmake") + endif() +endmacro() + +macro(ecm_find_package_parse_components module_name) + set(ecm_fppc_options SKIP_DEPENDENCY_HANDLING) + set(ecm_fppc_oneValueArgs RESULT_VAR) + set(ecm_fppc_multiValueArgs KNOWN_COMPONENTS DEFAULT_COMPONENTS) + cmake_parse_arguments(ECM_FPPC "${ecm_fppc_options}" "${ecm_fppc_oneValueArgs}" "${ecm_fppc_multiValueArgs}" ${ARGN}) + + if(ECM_FPPC_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unexpected arguments to ecm_find_package_parse_components: ${ECM_FPPC_UNPARSED_ARGUMENTS}") + endif() + if(NOT ECM_FPPC_RESULT_VAR) + message(FATAL_ERROR "Missing RESULT_VAR argument to ecm_find_package_parse_components") + endif() + if(NOT ECM_FPPC_KNOWN_COMPONENTS) + message(FATAL_ERROR "Missing KNOWN_COMPONENTS argument to ecm_find_package_parse_components") + endif() + if(NOT ECM_FPPC_DEFAULT_COMPONENTS) + set(ECM_FPPC_DEFAULT_COMPONENTS ${ECM_FPPC_KNOWN_COMPONENTS}) + endif() + + if(${module_name}_FIND_COMPONENTS) + set(ecm_fppc_requestedComps ${${module_name}_FIND_COMPONENTS}) + + if(NOT ECM_FPPC_SKIP_DEPENDENCY_HANDLING) + # Make sure deps are included + foreach(ecm_fppc_comp ${ecm_fppc_requestedComps}) + foreach(ecm_fppc_dep_comp ${${module_name}_${ecm_fppc_comp}_component_deps}) + list(FIND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}" ecm_fppc_index) + if("${ecm_fppc_index}" STREQUAL "-1") + if(NOT ${module_name}_FIND_QUIETLY) + message(STATUS "${module_name}: ${ecm_fppc_comp} requires ${${module_name}_${ecm_fppc_comp}_component_deps}") + endif() + list(APPEND ecm_fppc_requestedComps "${ecm_fppc_dep_comp}") + endif() + endforeach() + endforeach() + else() + message(STATUS "Skipping dependency handling for ${module_name}") + endif() + list(REMOVE_DUPLICATES ecm_fppc_requestedComps) + + # This makes sure components are listed in the same order as + # KNOWN_COMPONENTS (potentially important for inter-dependencies) + set(${ECM_FPPC_RESULT_VAR}) + foreach(ecm_fppc_comp ${ECM_FPPC_KNOWN_COMPONENTS}) + list(FIND ecm_fppc_requestedComps "${ecm_fppc_comp}" ecm_fppc_index) + if(NOT "${ecm_fppc_index}" STREQUAL "-1") + list(APPEND ${ECM_FPPC_RESULT_VAR} "${ecm_fppc_comp}") + list(REMOVE_AT ecm_fppc_requestedComps ${ecm_fppc_index}) + endif() + endforeach() + # if there are any left, they are unknown components + if(ecm_fppc_requestedComps) + set(ecm_fppc_msgType STATUS) + if(${module_name}_FIND_REQUIRED) + set(ecm_fppc_msgType FATAL_ERROR) + endif() + if(NOT ${module_name}_FIND_QUIETLY) + message(${ecm_fppc_msgType} "${module_name}: requested unknown components ${ecm_fppc_requestedComps}") + endif() + return() + endif() + else() + set(${ECM_FPPC_RESULT_VAR} ${ECM_FPPC_DEFAULT_COMPONENTS}) + endif() +endmacro() + +macro(ecm_find_package_handle_library_components module_name) + set(ecm_fpwc_options SKIP_PKG_CONFIG SKIP_DEPENDENCY_HANDLING) + set(ecm_fpwc_oneValueArgs) + set(ecm_fpwc_multiValueArgs COMPONENTS) + cmake_parse_arguments(ECM_FPWC "${ecm_fpwc_options}" "${ecm_fpwc_oneValueArgs}" "${ecm_fpwc_multiValueArgs}" ${ARGN}) + + if(ECM_FPWC_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unexpected arguments to ecm_find_package_handle_components: ${ECM_FPWC_UNPARSED_ARGUMENTS}") + endif() + if(NOT ECM_FPWC_COMPONENTS) + message(FATAL_ERROR "Missing COMPONENTS argument to ecm_find_package_handle_components") + endif() + + include(FindPackageHandleStandardArgs) + find_package(PkgConfig QUIET) + foreach(ecm_fpwc_comp ${ECM_FPWC_COMPONENTS}) + set(ecm_fpwc_dep_vars) + set(ecm_fpwc_dep_targets) + if(NOT SKIP_DEPENDENCY_HANDLING) + foreach(ecm_fpwc_dep ${${module_name}_${ecm_fpwc_comp}_component_deps}) + list(APPEND ecm_fpwc_dep_vars "${module_name}_${ecm_fpwc_dep}_FOUND") + list(APPEND ecm_fpwc_dep_targets "${module_name}::${ecm_fpwc_dep}") + endforeach() + endif() + + if(NOT ECM_FPWC_SKIP_PKG_CONFIG AND ${module_name}_${ecm_fpwc_comp}_pkg_config) + pkg_check_modules(PKG_${module_name}_${ecm_fpwc_comp} QUIET + ${${module_name}_${ecm_fpwc_comp}_pkg_config}) + endif() + + find_path(${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR + NAMES ${${module_name}_${ecm_fpwc_comp}_header} + HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_INCLUDE_DIRS} + PATH_SUFFIXES ${${module_name}_${ecm_fpwc_comp}_header_subdir} + ) + find_library(${module_name}_${ecm_fpwc_comp}_LIBRARY + NAMES ${${module_name}_${ecm_fpwc_comp}_lib} + HINTS ${PKG_${module_name}_${ecm_fpwc_comp}_LIBRARY_DIRS} + ) + + set(${module_name}_${ecm_fpwc_comp}_VERSION "${PKG_${module_name}_${ecm_fpwc_comp}_VERSION}") + if(NOT ${module_name}_VERSION) + set(${module_name}_VERSION ${${module_name}_${ecm_fpwc_comp}_VERSION}) + endif() + + set(_name_mismatched_arg) + if(NOT CMAKE_VERSION VERSION_LESS 3.17) + set(_name_mismatched_arg NAME_MISMATCHED) + endif() + find_package_handle_standard_args(${module_name}_${ecm_fpwc_comp} + FOUND_VAR + ${module_name}_${ecm_fpwc_comp}_FOUND + REQUIRED_VARS + ${module_name}_${ecm_fpwc_comp}_LIBRARY + ${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR + ${ecm_fpwc_dep_vars} + VERSION_VAR + ${module_name}_${ecm_fpwc_comp}_VERSION + ${_name_mismatched_arg} + ) + + mark_as_advanced( + ${module_name}_${ecm_fpwc_comp}_LIBRARY + ${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR + ) + + if(${module_name}_${ecm_fpwc_comp}_FOUND) + list(APPEND ${module_name}_LIBRARIES + "${${module_name}_${ecm_fpwc_comp}_LIBRARY}") + list(APPEND ${module_name}_INCLUDE_DIRS + "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}") + set(${module_name}_DEFINITIONS + ${${module_name}_DEFINITIONS} + ${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}) + if(NOT TARGET ${module_name}::${ecm_fpwc_comp}) + add_library(${module_name}::${ecm_fpwc_comp} UNKNOWN IMPORTED) + set_target_properties(${module_name}::${ecm_fpwc_comp} PROPERTIES + IMPORTED_LOCATION "${${module_name}_${ecm_fpwc_comp}_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PKG_${module_name}_${ecm_fpwc_comp}_DEFINITIONS}" + INTERFACE_INCLUDE_DIRECTORIES "${${module_name}_${ecm_fpwc_comp}_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${ecm_fpwc_dep_targets}" + ) + endif() + list(APPEND ${module_name}_TARGETS + "${module_name}::${ecm_fpwc_comp}") + endif() + endforeach() + if(${module_name}_LIBRARIES) + list(REMOVE_DUPLICATES ${module_name}_LIBRARIES) + endif() + if(${module_name}_INCLUDE_DIRS) + list(REMOVE_DUPLICATES ${module_name}_INCLUDE_DIRS) + endif() + if(${module_name}_DEFINITIONS) + list(REMOVE_DUPLICATES ${module_name}_DEFINITIONS) + endif() + if(${module_name}_TARGETS) + list(REMOVE_DUPLICATES ${module_name}_TARGETS) + endif() +endmacro() diff --git a/third_party/tracy/cmake/FindWaylandScanner.cmake b/third_party/tracy/cmake/FindWaylandScanner.cmake new file mode 100644 index 0000000..e164a63 --- /dev/null +++ b/third_party/tracy/cmake/FindWaylandScanner.cmake @@ -0,0 +1,170 @@ +#.rst: +# FindWaylandScanner +# ------------------ +# +# Try to find wayland-scanner. +# +# If the wayland-scanner executable is not in your PATH, you can provide +# an alternative name or full path location with the ``WaylandScanner_EXECUTABLE`` +# variable. +# +# This will define the following variables: +# +# ``WaylandScanner_FOUND`` +# True if wayland-scanner is available. +# +# ``WaylandScanner_EXECUTABLE`` +# The wayland-scanner executable. +# +# If ``WaylandScanner_FOUND`` is TRUE, it will also define the following imported +# target: +# +# ``Wayland::Scanner`` +# The wayland-scanner executable. +# +# This module provides the following functions to generate C protocol +# implementations: +# +# - ``ecm_add_wayland_client_protocol`` +# - ``ecm_add_wayland_server_protocol`` +# +# :: +# +# ecm_add_wayland_client_protocol( +# PROTOCOL +# BASENAME ) +# +# Generate Wayland client protocol files from ```` XML +# definition for the ```` interface and append those files +# to ````. +# +# :: +# +# ecm_add_wayland_server_protocol( +# PROTOCOL +# BASENAME ) +# +# Generate Wayland server protocol files from ```` XML +# definition for the ```` interface and append those files +# to ````. +# +# Since 1.4.0. + +#============================================================================= +# Copyright 2012-2014 Pier Luigi Fiorini +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= + +include(${CMAKE_CURRENT_LIST_DIR}/ECMFindModuleHelpers.cmake) + +ecm_find_package_version_check(WaylandScanner) + +# Find wayland-scanner +find_program(WaylandScanner_EXECUTABLE NAMES wayland-scanner) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WaylandScanner + FOUND_VAR + WaylandScanner_FOUND + REQUIRED_VARS + WaylandScanner_EXECUTABLE +) + +mark_as_advanced(WaylandScanner_EXECUTABLE) + +if(NOT TARGET Wayland::Scanner AND WaylandScanner_FOUND) + add_executable(Wayland::Scanner IMPORTED) + set_target_properties(Wayland::Scanner PROPERTIES + IMPORTED_LOCATION "${WaylandScanner_EXECUTABLE}" + ) +endif() + +include(FeatureSummary) +set_package_properties(WaylandScanner PROPERTIES + URL "https://wayland.freedesktop.org/" + DESCRIPTION "Executable that converts XML protocol files to C code" +) + +function(ecm_add_wayland_client_protocol out_var) + # Parse arguments + set(oneValueArgs PROTOCOL BASENAME) + cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) + + if(ARGS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_client_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") + endif() + + get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) + set(_client_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-client-protocol.h") + set(_code "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-protocol.c") + + set_source_files_properties(${_client_header} GENERATED) + set_source_files_properties(${_code} GENERATED) + set_property(SOURCE ${_client_header} PROPERTY SKIP_AUTOMOC ON) + + add_custom_command(OUTPUT "${_client_header}" + COMMAND ${WaylandScanner_EXECUTABLE} client-header ${_infile} ${_client_header} + DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile} + VERBATIM + ) + + add_custom_command(OUTPUT "${_code}" + COMMAND ${WaylandScanner_EXECUTABLE} private-code ${_infile} ${_code} + DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile} ${_client_header} + VERBATIM + ) + + list(APPEND ${out_var} "${_client_header}" "${_code}") + set(${out_var} ${${out_var}} PARENT_SCOPE) +endfunction() + + +function(ecm_add_wayland_server_protocol out_var) + # Parse arguments + set(oneValueArgs PROTOCOL BASENAME) + cmake_parse_arguments(ARGS "" "${oneValueArgs}" "" ${ARGN}) + + if(ARGS_UNPARSED_ARGUMENTS) + message(FATAL_ERROR "Unknown keywords given to ecm_add_wayland_server_protocol(): \"${ARGS_UNPARSED_ARGUMENTS}\"") + endif() + + ecm_add_wayland_client_protocol(${out_var} + PROTOCOL ${ARGS_PROTOCOL} + BASENAME ${ARGS_BASENAME}) + + get_filename_component(_infile ${ARGS_PROTOCOL} ABSOLUTE) + set(_server_header "${CMAKE_CURRENT_BINARY_DIR}/wayland-${ARGS_BASENAME}-server-protocol.h") + set_property(SOURCE ${_server_header} PROPERTY SKIP_AUTOMOC ON) + set_source_files_properties(${_server_header} GENERATED) + + add_custom_command(OUTPUT "${_server_header}" + COMMAND ${WaylandScanner_EXECUTABLE} server-header ${_infile} ${_server_header} + DEPENDS ${WaylandScanner_EXECUTABLE} ${_infile} + VERBATIM + ) + + list(APPEND ${out_var} "${_server_header}") + set(${out_var} ${${out_var}} PARENT_SCOPE) +endfunction() diff --git a/third_party/tracy/cmake/config.cmake b/third_party/tracy/cmake/config.cmake new file mode 100644 index 0000000..d563c22 --- /dev/null +++ b/third_party/tracy/cmake/config.cmake @@ -0,0 +1,62 @@ +if (NOT NO_ISA_EXTENSIONS) + include(CheckCXXCompilerFlag) + if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "arm64") + CHECK_CXX_COMPILER_FLAG("-mcpu=native" COMPILER_SUPPORTS_MCPU_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + add_compile_options(-mcpu=native) + endif() + else() + CHECK_CXX_COMPILER_FLAG("-march=native" COMPILER_SUPPORTS_MARCH_NATIVE) + if(COMPILER_SUPPORTS_MARCH_NATIVE) + add_compile_options(-march=native) + endif() + endif() + if(WIN32) + add_compile_options(/arch:AVX2) + endif() +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND NOT LEGACY) + set(USE_WAYLAND ON) +else() + set(USE_WAYLAND OFF) +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + add_compile_options($<$:-fexperimental-library>) + endif() +endif() + +if(WIN32) + add_definitions(-DNOMINMAX -DWIN32_LEAN_AND_MEAN -D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR) + add_compile_options(/MP) +endif() + +if(EMSCRIPTEN) + add_compile_options(-pthread -DIMGUI_IMPL_OPENGL_ES2) +endif() + +if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug" AND NOT EMSCRIPTEN) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL "Linux") + find_program(MOLD_LINKER mold) + if(MOLD_LINKER) + set(CMAKE_LINKER_TYPE "MOLD") + endif() + if (CMAKE_BUILD_TYPE STREQUAL "Debug") + add_compile_options(-fno-eliminate-unused-debug-types) + endif() +endif() + +find_program(CCACHE ccache) +if(CCACHE) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +endif() + +file(GENERATE OUTPUT .gitignore CONTENT "*") + +set(CMAKE_COLOR_DIAGNOSTICS ON) diff --git a/third_party/tracy/cmake/gl3w-extra-symbols.patch b/third_party/tracy/cmake/gl3w-extra-symbols.patch new file mode 100644 index 0000000..6d394dd --- /dev/null +++ b/third_party/tracy/cmake/gl3w-extra-symbols.patch @@ -0,0 +1,12 @@ +diff --git a/extra_symbols.txt b/extra_symbols.txt +index b95bb58..6b8f616 100644 +--- a/extra_symbols.txt ++++ b/extra_symbols.txt +@@ -1,3 +1,7 @@ ++glCompressedTexImage2D ++GL_LINEAR_MIPMAP_LINEAR ++GL_TEXTURE_WRAP_S ++GL_TEXTURE_WRAP_T + glReadPixels + glClearColor + glClear diff --git a/third_party/tracy/cmake/imgui-emscripten.patch b/third_party/tracy/cmake/imgui-emscripten.patch new file mode 100644 index 0000000..f9c1c08 --- /dev/null +++ b/third_party/tracy/cmake/imgui-emscripten.patch @@ -0,0 +1,14 @@ +diff '--color=auto' -ruN 72d8f61727dc878102157113d1998f86b852d20e/imconfig.h new/imconfig.h +--- 72d8f61727dc878102157113d1998f86b852d20e/imconfig.h 2024-09-27 14:28:05.568760349 +0200 ++++ new/imconfig.h 2024-09-27 14:29:47.310243707 +0200 +@@ -113,6 +113,10 @@ + // Read about ImGuiBackendFlags_RendererHasVtxOffset for details. + //#define ImDrawIdx unsigned int + ++#ifdef __EMSCRIPTEN__ ++#define ImDrawIdx unsigned int ++#endif ++ + //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly) + //struct ImDrawList; + //struct ImDrawCmd; diff --git a/third_party/tracy/cmake/imgui-loader.patch b/third_party/tracy/cmake/imgui-loader.patch new file mode 100644 index 0000000..a00f479 --- /dev/null +++ b/third_party/tracy/cmake/imgui-loader.patch @@ -0,0 +1,56 @@ +diff --git a/backends/imgui_impl_opengl3_loader.h b/backends/imgui_impl_opengl3_loader.h +index d6ffa5a2d..e48372c64 100644 +--- a/backends/imgui_impl_opengl3_loader.h ++++ b/backends/imgui_impl_opengl3_loader.h +@@ -179,6 +179,7 @@ typedef khronos_uint8_t GLubyte; + #define GL_VERSION 0x1F02 + #define GL_EXTENSIONS 0x1F03 + #define GL_LINEAR 0x2601 ++#define GL_LINEAR_MIPMAP_LINEAR 0x2703 + #define GL_TEXTURE_MAG_FILTER 0x2800 + #define GL_TEXTURE_MIN_FILTER 0x2801 + #define GL_TEXTURE_WRAP_S 0x2802 +@@ -241,8 +242,10 @@ GLAPI void APIENTRY glGenTextures (GLsizei n, GLuint *textures); + #define GL_TEXTURE0 0x84C0 + #define GL_ACTIVE_TEXTURE 0x84E0 + typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); ++typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); + #ifdef GL_GLEXT_PROTOTYPES + GLAPI void APIENTRY glActiveTexture (GLenum texture); ++GLAPI void APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data); + #endif + #endif /* GL_VERSION_1_3 */ + #ifndef GL_VERSION_1_4 +@@ -478,7 +481,7 @@ GL3W_API GL3WglProc imgl3wGetProcAddress(const char *proc); + + /* gl3w internal state */ + union ImGL3WProcs { +- GL3WglProc ptr[59]; ++ GL3WglProc ptr[60]; + struct { + PFNGLACTIVETEXTUREPROC ActiveTexture; + PFNGLATTACHSHADERPROC AttachShader; +@@ -494,6 +497,7 @@ union ImGL3WProcs { + PFNGLCLEARPROC Clear; + PFNGLCLEARCOLORPROC ClearColor; + PFNGLCOMPILESHADERPROC CompileShader; ++ PFNGLCOMPRESSEDTEXIMAGE2DPROC CompressedTexImage2D; + PFNGLCREATEPROGRAMPROC CreateProgram; + PFNGLCREATESHADERPROC CreateShader; + PFNGLDELETEBUFFERSPROC DeleteBuffers; +@@ -559,6 +563,7 @@ GL3W_API extern union ImGL3WProcs imgl3wProcs; + #define glClear imgl3wProcs.gl.Clear + #define glClearColor imgl3wProcs.gl.ClearColor + #define glCompileShader imgl3wProcs.gl.CompileShader ++#define glCompressedTexImage2D imgl3wProcs.gl.CompressedTexImage2D + #define glCreateProgram imgl3wProcs.gl.CreateProgram + #define glCreateShader imgl3wProcs.gl.CreateShader + #define glDeleteBuffers imgl3wProcs.gl.DeleteBuffers +@@ -854,6 +859,7 @@ static const char *proc_names[] = { + "glClear", + "glClearColor", + "glCompileShader", ++ "glCompressedTexImage2D", + "glCreateProgram", + "glCreateShader", + "glDeleteBuffers", diff --git a/third_party/tracy/cmake/ppqsort-nodebug.patch b/third_party/tracy/cmake/ppqsort-nodebug.patch new file mode 100644 index 0000000..57003db --- /dev/null +++ b/third_party/tracy/cmake/ppqsort-nodebug.patch @@ -0,0 +1,14 @@ +diff --git i/include/ppqsort/parameters.h w/include/ppqsort/parameters.h +index 115c3a1..3f4b669 100644 +--- i/include/ppqsort/parameters.h ++++ w/include/ppqsort/parameters.h +@@ -3,7 +3,8 @@ + #include + #include + +-#ifndef NDEBUG ++//#ifndef NDEBUG ++#if 0 + #include + #include + #include diff --git a/third_party/tracy/cmake/server.cmake b/third_party/tracy/cmake/server.cmake new file mode 100644 index 0000000..a76d1c1 --- /dev/null +++ b/third_party/tracy/cmake/server.cmake @@ -0,0 +1,35 @@ +set(TRACY_COMMON_DIR ${CMAKE_CURRENT_LIST_DIR}/../public/common) + +set(TRACY_COMMON_SOURCES + tracy_lz4.cpp + tracy_lz4hc.cpp + TracySocket.cpp + TracyStackFrames.cpp + TracySystem.cpp +) + +list(TRANSFORM TRACY_COMMON_SOURCES PREPEND "${TRACY_COMMON_DIR}/") + + +set(TRACY_SERVER_DIR ${CMAKE_CURRENT_LIST_DIR}/../server) + +set(TRACY_SERVER_SOURCES + TracyMemory.cpp + TracyMmap.cpp + TracyPrint.cpp + TracySysUtil.cpp + TracyTaskDispatch.cpp + TracyTextureCompression.cpp + TracyThreadCompress.cpp + TracyWorker.cpp +) + +list(TRANSFORM TRACY_SERVER_SOURCES PREPEND "${TRACY_SERVER_DIR}/") + + +add_library(TracyServer STATIC EXCLUDE_FROM_ALL ${TRACY_COMMON_SOURCES} ${TRACY_SERVER_SOURCES}) +target_include_directories(TracyServer PUBLIC ${TRACY_COMMON_DIR} ${TRACY_SERVER_DIR}) +target_link_libraries(TracyServer PUBLIC TracyCapstone libzstd PPQSort::PPQSort) +if(NO_STATISTICS) + target_compile_definitions(TracyServer PUBLIC TRACY_NO_STATISTICS) +endif() diff --git a/third_party/tracy/cmake/vendor.cmake b/third_party/tracy/cmake/vendor.cmake new file mode 100644 index 0000000..b519de6 --- /dev/null +++ b/third_party/tracy/cmake/vendor.cmake @@ -0,0 +1,193 @@ +# Vendor Specific CMake +# The Tracy project keeps most vendor source locally + +set (ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../") + +# Dependencies are taken from the system first and if not found, they are pulled with CPM and built from source + +include(FindPkgConfig) +include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake) + +option(DOWNLOAD_CAPSTONE "Force download capstone" ON) +option(DOWNLOAD_GLFW "Force download glfw" OFF) +option(DOWNLOAD_FREETYPE "Force download freetype" OFF) + +# capstone + +pkg_check_modules(CAPSTONE capstone) +if(CAPSTONE_FOUND AND NOT DOWNLOAD_CAPSTONE) + message(STATUS "Capstone found: ${CAPSTONE}") + add_library(TracyCapstone INTERFACE) + target_include_directories(TracyCapstone INTERFACE ${CAPSTONE_INCLUDE_DIRS}) + target_link_libraries(TracyCapstone INTERFACE ${CAPSTONE_LINK_LIBRARIES}) +else() + CPMAddPackage( + NAME capstone + GITHUB_REPOSITORY capstone-engine/capstone + GIT_TAG 6.0.0-Alpha1 + OPTIONS + "CAPSTONE_X86_ATT_DISABLE ON" + "CAPSTONE_ALPHA_SUPPORT OFF" + "CAPSTONE_HPPA_SUPPORT OFF" + "CAPSTONE_LOONGARCH_SUPPORT OFF" + "CAPSTONE_M680X_SUPPORT OFF" + "CAPSTONE_M68K_SUPPORT OFF" + "CAPSTONE_MIPS_SUPPORT OFF" + "CAPSTONE_MOS65XX_SUPPORT OFF" + "CAPSTONE_PPC_SUPPORT OFF" + "CAPSTONE_SPARC_SUPPORT OFF" + "CAPSTONE_SYSTEMZ_SUPPORT OFF" + "CAPSTONE_XCORE_SUPPORT OFF" + "CAPSTONE_TRICORE_SUPPORT OFF" + "CAPSTONE_TMS320C64X_SUPPORT OFF" + "CAPSTONE_M680X_SUPPORT OFF" + "CAPSTONE_EVM_SUPPORT OFF" + "CAPSTONE_WASM_SUPPORT OFF" + "CAPSTONE_BPF_SUPPORT OFF" + "CAPSTONE_RISCV_SUPPORT OFF" + "CAPSTONE_SH_SUPPORT OFF" + "CAPSTONE_XTENSA_SUPPORT OFF" + "CAPSTONE_BUILD_MACOS_THIN ON" + EXCLUDE_FROM_ALL TRUE + ) + add_library(TracyCapstone INTERFACE) + target_include_directories(TracyCapstone INTERFACE ${capstone_SOURCE_DIR}/include/capstone) + target_link_libraries(TracyCapstone INTERFACE capstone) +endif() + +# GLFW + +if(NOT USE_WAYLAND AND NOT EMSCRIPTEN) + pkg_check_modules(GLFW glfw3) + if (GLFW_FOUND AND NOT DOWNLOAD_GLFW) + add_library(TracyGlfw3 INTERFACE) + target_include_directories(TracyGlfw3 INTERFACE ${GLFW_INCLUDE_DIRS}) + target_link_libraries(TracyGlfw3 INTERFACE ${GLFW_LINK_LIBRARIES}) + else() + CPMAddPackage( + NAME glfw + GITHUB_REPOSITORY glfw/glfw + GIT_TAG 3.4 + OPTIONS + "GLFW_BUILD_EXAMPLES OFF" + "GLFW_BUILD_TESTS OFF" + "GLFW_BUILD_DOCS OFF" + "GLFW_INSTALL OFF" + EXCLUDE_FROM_ALL TRUE + ) + add_library(TracyGlfw3 INTERFACE) + target_link_libraries(TracyGlfw3 INTERFACE glfw) + endif() +endif() + +# freetype + +pkg_check_modules(FREETYPE freetype2) +if (FREETYPE_FOUND AND NOT DOWNLOAD_FREETYPE) + add_library(TracyFreetype INTERFACE) + target_include_directories(TracyFreetype INTERFACE ${FREETYPE_INCLUDE_DIRS}) + target_link_libraries(TracyFreetype INTERFACE ${FREETYPE_LINK_LIBRARIES}) +else() + CPMAddPackage( + NAME freetype + GITHUB_REPOSITORY freetype/freetype + GIT_TAG VER-2-13-3 + OPTIONS + "FT_DISABLE_HARFBUZZ ON" + "FT_WITH_HARFBUZZ OFF" + EXCLUDE_FROM_ALL TRUE + ) + add_library(TracyFreetype INTERFACE) + target_link_libraries(TracyFreetype INTERFACE freetype) +endif() + +# Zstd + +CPMAddPackage( + NAME zstd + GITHUB_REPOSITORY facebook/zstd + GIT_TAG v1.5.7 + OPTIONS + "ZSTD_BUILD_SHARED OFF" + EXCLUDE_FROM_ALL TRUE + SOURCE_SUBDIR build/cmake +) + +# Diff Template Library + +set(DTL_DIR "${ROOT_DIR}/dtl") +file(GLOB_RECURSE DTL_HEADERS CONFIGURE_DEPENDS RELATIVE ${DTL_DIR} "*.hpp") +add_library(TracyDtl INTERFACE) +target_sources(TracyDtl INTERFACE ${DTL_HEADERS}) +target_include_directories(TracyDtl INTERFACE ${DTL_DIR}) + +# Get Opt + +set(GETOPT_DIR "${ROOT_DIR}/getopt") +set(GETOPT_SOURCES ${GETOPT_DIR}/getopt.c) +set(GETOPT_HEADERS ${GETOPT_DIR}/getopt.h) +add_library(TracyGetOpt STATIC EXCLUDE_FROM_ALL ${GETOPT_SOURCES} ${GETOPT_HEADERS}) +target_include_directories(TracyGetOpt PUBLIC ${GETOPT_DIR}) + +# ImGui + +CPMAddPackage( + NAME ImGui + GITHUB_REPOSITORY ocornut/imgui + GIT_TAG v1.91.9b-docking + DOWNLOAD_ONLY TRUE + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/imgui-emscripten.patch" + "${CMAKE_CURRENT_LIST_DIR}/imgui-loader.patch" +) + +set(IMGUI_SOURCES + imgui_widgets.cpp + imgui_draw.cpp + imgui_demo.cpp + imgui.cpp + imgui_tables.cpp + misc/freetype/imgui_freetype.cpp + backends/imgui_impl_opengl3.cpp +) + +list(TRANSFORM IMGUI_SOURCES PREPEND "${ImGui_SOURCE_DIR}/") + +add_library(TracyImGui STATIC EXCLUDE_FROM_ALL ${IMGUI_SOURCES}) +target_include_directories(TracyImGui PUBLIC ${ImGui_SOURCE_DIR}) +target_link_libraries(TracyImGui PUBLIC TracyFreetype) +target_compile_definitions(TracyImGui PRIVATE "IMGUI_ENABLE_FREETYPE") + +if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") + target_compile_definitions(TracyImGui PRIVATE "IMGUI_DISABLE_DEBUG_TOOLS") +endif() + +# NFD + +if(NOT NO_FILESELECTOR AND NOT EMSCRIPTEN) + if(GTK_FILESELECTOR) + set(NFD_PORTAL OFF) + else() + set(NFD_PORTAL ON) + endif() + + CPMAddPackage( + NAME nfd + GITHUB_REPOSITORY btzy/nativefiledialog-extended + GIT_TAG v1.2.1 + EXCLUDE_FROM_ALL TRUE + OPTIONS + "NFD_PORTAL ${NFD_PORTAL}" + ) +endif() + +# PPQSort + +CPMAddPackage( + NAME PPQSort + GITHUB_REPOSITORY GabTux/PPQSort + VERSION 1.0.5 + PATCHES + "${CMAKE_CURRENT_LIST_DIR}/ppqsort-nodebug.patch" + EXCLUDE_FROM_ALL TRUE +) diff --git a/third_party/tracy/cmake/version.cmake b/third_party/tracy/cmake/version.cmake new file mode 100644 index 0000000..03813b4 --- /dev/null +++ b/third_party/tracy/cmake/version.cmake @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 3.10) + +message("Parsing public/common/TracyVersion.hpp file") + +file(READ "${CMAKE_CURRENT_LIST_DIR}/../public/common/TracyVersion.hpp" version) + +# Note: This looks for a specific pattern in TracyVersion.hpp, if it changes +# this needs updating. +string(REGEX MATCH "Major = ([0-9]+)" _ ${version}) + +# This works do to the above () subexpression selection. See +# https://cmake.org/cmake/help/latest/command/string.html#regex-match for more +# details +set(TRACY_VERSION_MAJOR ${CMAKE_MATCH_1}) + +string(REGEX MATCH "Minor = ([0-9]+)" _ ${version}) +set(TRACY_VERSION_MINOR ${CMAKE_MATCH_1}) + +string(REGEX MATCH "Patch = ([0-9]+)" _ ${version}) +set(TRACY_VERSION_PATCH ${CMAKE_MATCH_1}) + +set(TRACY_VERSION_STRING "${TRACY_VERSION_MAJOR}.${TRACY_VERSION_MINOR}.${TRACY_VERSION_PATCH}") + +message("VERSION ${TRACY_VERSION_STRING}") diff --git a/third_party/tracy/csvexport/CMakeLists.txt b/third_party/tracy/csvexport/CMakeLists.txt new file mode 100644 index 0000000..00ec72e --- /dev/null +++ b/third_party/tracy/csvexport/CMakeLists.txt @@ -0,0 +1,29 @@ +cmake_minimum_required(VERSION 3.16) + +option(NO_ISA_EXTENSIONS "Disable ISA extensions (don't pass -march=native or -mcpu=native to the compiler)" OFF) + +set(NO_STATISTICS OFF) + +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/version.cmake) + +set(CMAKE_CXX_STANDARD 20) + +project( + tracy-csvexport + LANGUAGES C CXX + VERSION ${TRACY_VERSION_STRING} +) + +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/config.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/vendor.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../cmake/server.cmake) + +set(PROGRAM_FILES + src/csvexport.cpp +) + +add_executable(${PROJECT_NAME} ${PROGRAM_FILES} ${COMMON_FILES} ${SERVER_FILES}) +target_link_libraries(${PROJECT_NAME} PRIVATE TracyServer TracyGetOpt) +set_property(DIRECTORY ${CMAKE_CURRENT_LIST_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) + +install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) \ No newline at end of file diff --git a/third_party/tracy/csvexport/src/csvexport.cpp b/third_party/tracy/csvexport/src/csvexport.cpp new file mode 100644 index 0000000..dae1140 --- /dev/null +++ b/third_party/tracy/csvexport/src/csvexport.cpp @@ -0,0 +1,454 @@ +#ifdef _WIN32 +# include +#endif + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "../../server/TracyFileRead.hpp" +#include "../../server/TracyWorker.hpp" +#include "../../getopt/getopt.h" + +void print_usage_exit(int e) +{ + fprintf(stderr, "Extract statistics from a trace to a CSV format\n"); + fprintf(stderr, "Usage:\n"); + fprintf(stderr, " extract [OPTION...] \n"); + fprintf(stderr, "\n"); + fprintf(stderr, " -h, --help Print usage\n"); + fprintf(stderr, " -f, --filter arg Filter zone names (default: "")\n"); + fprintf(stderr, " -s, --sep arg CSV separator (default: ,)\n"); + fprintf(stderr, " -c, --case Case sensitive filtering\n"); + fprintf(stderr, " -e, --self Get self times\n"); + fprintf(stderr, " -u, --unwrap Report each cpu zone event\n"); + fprintf(stderr, " -g, --gpu Report each gpu zone event\n" ); + fprintf(stderr, " -m, --messages Report only messages\n"); + fprintf(stderr, " -p, --plot Report plot data (only with -u)\n"); + + exit(e); +} + +struct Args { + const char* filter; + const char* separator; + const char* trace_file; + bool case_sensitive; + bool self_time; + bool unwrap; + bool show_gpu; + bool unwrapMessages; + bool plot; +}; + +Args parse_args(int argc, char** argv) +{ + if (argc == 1) + { + print_usage_exit(1); + } + + Args args = { "", ",", "", false, false, false, false, false, false }; + + struct option long_opts[] = { + { "help", no_argument, NULL, 'h' }, + { "filter", optional_argument, NULL, 'f' }, + { "sep", optional_argument, NULL, 's' }, + { "case", no_argument, NULL, 'c' }, + { "self", no_argument, NULL, 'e' }, + { "unwrap", no_argument, NULL, 'u' }, + { "gpu", no_argument, NULL, 'g' }, + { "messages", no_argument, NULL, 'm' }, + { "plot", no_argument, NULL, 'p' }, + { NULL, 0, NULL, 0 } + }; + + int c; + while ((c = getopt_long(argc, argv, "hf:s:ceugmp", long_opts, NULL)) != -1) + { + switch (c) + { + case 'h': + print_usage_exit(0); + break; + case 'f': + args.filter = optarg; + break; + case 's': + args.separator = optarg; + break; + case 'c': + args.case_sensitive = true; + break; + case 'e': + args.self_time = true; + break; + case 'u': + args.unwrap = true; + break; + case 'g': + args.show_gpu = true; + break; + case 'm': + args.unwrapMessages = true; + break; + case 'p': + args.plot = true; + break; + default: + print_usage_exit(1); + break; + } + } + + if (argc != optind + 1) + { + print_usage_exit(1); + } + + args.trace_file = argv[optind]; + + return args; +} + +bool is_substring( + const char* term, + const char* s, + bool case_sensitive = false +){ + auto new_term = std::string(term); + auto new_s = std::string(s); + + if (!case_sensitive) { + std::transform( + new_term.begin(), + new_term.end(), + new_term.begin(), + [](unsigned char c){ return std::tolower(c); } + ); + + std::transform( + new_s.begin(), + new_s.end(), + new_s.begin(), + [](unsigned char c){ return std::tolower(c); } + ); + } + + return new_s.find(new_term) != std::string::npos; +} + +const char* get_name(int32_t id, const tracy::Worker& worker) +{ + auto& srcloc = worker.GetSourceLocation(id); + return worker.GetString(srcloc.name.active ? srcloc.name : srcloc.function); +} + +template +std::string join(const T& v, const char* sep) { + std::ostringstream s; + for (const auto& i : v) { + if (&i != &v[0]) { + s << sep; + } + s << i; + } + return s.str(); +} + +// From TracyView.cpp +int64_t GetZoneChildTimeFast( + const tracy::Worker& worker, + const tracy::ZoneEvent& zone +){ + int64_t time = 0; + if( zone.HasChildren() ) + { + auto& children = worker.GetZoneChildren( zone.Child() ); + if( children.is_magic() ) + { + auto& vec = *(tracy::Vector*)&children; + for( auto& v : vec ) + { + assert( v.IsEndValid() ); + time += v.End() - v.Start(); + } + } + else + { + for( auto& v : children ) + { + assert( v->IsEndValid() ); + time += v->End() - v->Start(); + } + } + } + return time; +} + +int main(int argc, char** argv) +{ +#ifdef _WIN32 + if (!AttachConsole(ATTACH_PARENT_PROCESS)) + { + AllocConsole(); + SetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), 0x07); + } +#endif + + Args args = parse_args(argc, argv); + + auto f = std::unique_ptr( + tracy::FileRead::Open(args.trace_file) + ); + if (!f) + { + fprintf(stderr, "Could not open file %s\n", args.trace_file); + return 1; + } + + auto worker = tracy::Worker(*f); + + if (args.unwrapMessages) + { + const auto& msgs = worker.GetMessages(); + + if (msgs.size() > 0) + { + std::vector columnsForMessages; + columnsForMessages = { + "MessageName", "total_ns" + }; + std::string headerForMessages = join(columnsForMessages, args.separator); + printf("%s\n", headerForMessages.data()); + + for(auto& it : msgs) + { + std::vector values(columnsForMessages.size()); + + values[0] = worker.GetString(it->ref); + values[1] = std::to_string(it->time); + + std::string row = join(values, args.separator); + printf("%s\n", row.data()); + } + } + else + { + printf("There are currently no messages!\n"); + } + + return 0; + } + + while (!worker.AreSourceLocationZonesReady()) + { + std::this_thread::sleep_for(std::chrono::milliseconds(10)); + } + + if (args.show_gpu) + { + auto& gpu_slz = worker.GetGpuSourceLocationZones(); + tracy::Vector gpu_slz_selected; + gpu_slz_selected.reserve( gpu_slz.size() ); + + uint32_t total_cnt = 0; + for (auto it = gpu_slz.begin(); it != gpu_slz.end(); ++it) + { + if (it->second.total != 0) + { + ++total_cnt; + if (args.filter[0] == '\0') + { + gpu_slz_selected.push_back_no_space_check( it ); + } + else + { + auto name = get_name( it->first, worker ); + if (is_substring( args.filter, name, args.case_sensitive)) + { + gpu_slz_selected.push_back_no_space_check( it ); + } + } + } + } + + std::vector columns; + columns = {"name", "src_file", "Time from start of program", "GPU execution time"}; + + std::string header = join(columns, args.separator); + printf("%s\n", header.data()); + + const auto last_time = worker.GetLastTime(); + for (auto& it : gpu_slz_selected) + { + std::vector values( columns.size() ); + + values[0] = get_name( it->first, worker ); + + const auto& srcloc = worker.GetSourceLocation( it->first ); + values[1] = worker.GetString( srcloc.file ); + + const auto& zone_data = it->second; + for (const auto& zone_thread_data : zone_data.zones) + { + tracy::GpuEvent* gpu_event = zone_thread_data.Zone(); + const auto start = gpu_event->GpuStart(); + const auto end = gpu_event->GpuEnd(); + + values[2] = std::to_string( start ); + + auto timespan = end - start; + values[3] = std::to_string( timespan ); + + std::string row = join( values, args.separator ); + printf( "%s\n", row.data() ); + } + } + return 0; + } + + auto& slz = worker.GetSourceLocationZones(); + tracy::Vector slz_selected; + slz_selected.reserve(slz.size()); + + uint32_t total_cnt = 0; + for(auto it = slz.begin(); it != slz.end(); ++it) + { + if(it->second.total != 0) + { + ++total_cnt; + if(args.filter[0] == '\0') + { + slz_selected.push_back_no_space_check(it); + } + else + { + auto name = get_name(it->first, worker); + if(is_substring(args.filter, name, args.case_sensitive)) + { + slz_selected.push_back_no_space_check(it); + } + } + } + } + + std::vector columns; + if (args.unwrap) + { + columns = { + "name", "src_file", "src_line", "ns_since_start", "exec_time_ns", "thread", "value" + }; + } + else + { + columns = { + "name", "src_file", "src_line", "total_ns", "total_perc", + "counts", "mean_ns", "min_ns", "max_ns", "std_ns" + }; + } + std::string header = join(columns, args.separator); + printf("%s\n", header.data()); + + const auto last_time = worker.GetLastTime(); + for(auto& it : slz_selected) + { + std::vector values(columns.size()); + + values[0] = get_name(it->first, worker); + + const auto& srcloc = worker.GetSourceLocation(it->first); + values[1] = worker.GetString(srcloc.file); + values[2] = std::to_string(srcloc.line); + + const auto& zone_data = it->second; + + if (args.unwrap) + { + int i = 0; + for (const auto& zone_thread_data : zone_data.zones) { + const auto zone_event = zone_thread_data.Zone(); + const auto tId = zone_thread_data.Thread(); + const auto start = zone_event->Start(); + const auto end = zone_event->End(); + + values[3] = std::to_string(start); + + auto timespan = end - start; + if (args.self_time) { + timespan -= GetZoneChildTimeFast(worker, *zone_event); + } + values[4] = std::to_string(timespan); + values[5] = std::to_string(tId); + if (worker.HasZoneExtra(*zone_event)) { + const auto& text = worker.GetZoneExtra(*zone_event).text; + if (text.Active()) { + values[6] = worker.GetString(text); + } + } + + std::string row = join(values, args.separator); + printf("%s\n", row.data()); + } + } + else + { + const auto time = args.self_time ? zone_data.selfTotal : zone_data.total; + values[3] = std::to_string(time); + values[4] = std::to_string(100. * time / last_time); + + values[5] = std::to_string(zone_data.zones.size()); + + const auto avg = (args.self_time ? zone_data.selfTotal : zone_data.total) + / zone_data.zones.size(); + values[6] = std::to_string(avg); + + const auto tmin = args.self_time ? zone_data.selfMin : zone_data.min; + const auto tmax = args.self_time ? zone_data.selfMax : zone_data.max; + values[7] = std::to_string(tmin); + values[8] = std::to_string(tmax); + + const auto sz = zone_data.zones.size(); + const auto ss = zone_data.sumSq + - 2. * zone_data.total * avg + + avg * avg * sz; + double std = 0; + if( sz > 1 ) + std = sqrt(ss / (sz - 1)); + values[9] = std::to_string(std); + + std::string row = join(values, args.separator); + printf("%s\n", row.data()); + } + } + + if(args.plot && args.unwrap) + { + auto& plots = worker.GetPlots(); + for(const auto& plot : plots) + { + std::vector values(columns.size()); + values[0] = worker.GetString(plot->name); + + for(const auto& val : plot->data) + { + if (args.unwrap) + { + values[3] = std::to_string(val.time.Val()); + values[6] = std::to_string(val.val); + } + std::string row = join(values, args.separator); + printf("%s\n", row.data()); + } + } + } + + return 0; +} diff --git a/third_party/tracy/doc/profiler.png b/third_party/tracy/doc/profiler.png new file mode 100644 index 0000000000000000000000000000000000000000..a790d47a603ca06828f2bfd083bed822ca98c1db GIT binary patch literal 218265 zcmeFYWl)^avMxNhyZhko3^I6dA6!BR?(Xgu2=4Cg7Qr6ZnypF6sxA454 z5M1Syq!4zY;P6SYbY&jg000JRZw(z+H6st8qqBp#m8}`j)yvTgXy$2U4gh#Alw?~a zl6{^qeKEo7fE|WnK`7Ea%}-nXo**Sxoa<*^mxZf4@b=amn$z{IAe1W_b6;1DY$=^M-u?^5?@PD7EReXB;E9~J{nA)R1rav1;r``QR){_g$ zrSJOyk(Z1hQRRT`o8OHu*A9K&ZH{@kn{t$1&#@JLD6$Vp`oz9CE334fX?MAN=N_^* zE}W6obZ4-SexFX|dzT7I1s?~8`=7{9e zCD=ux+JP8$OpqXS-x(3vWukS=pyj=a)rq^VYF+~rf^y?E*=KP-wSi-z@2Nj&%Fz+0A_uO@Y77cCeL zta+V>1zhT}&Kdn!%)Tw_pVq6w#90oKeq$H!V|TC!=QN#v-}5Y8mKaw4Iajr2rZ3c& zv$+2jH2@#WV^sFj=$yN?<>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I>@W9qStR9&=kfF5`+n^O2)qM#7=O z*xj`&EMEiXnWO)i%f6gvmDIBsIK!9v)&2NSM}2{d8z0=SJ&g4h| z##FQ#0#|?ud&pCrySD>@owhZuF1`n41hdw4 zxR!_`E<;`*t1x*ca9`|Yi>@}#^fb_wPA5Hkoo9kCL;hOUJMq+vW>XWjnBKh$@06TK zyE^YRf5y%=C88^*2IZE4m&zLv9WRng@qQ#1G3$XyPpj7XJF-F}QY>XuoCSje4M zTRYS$CMV=s3r$VXo8!swy{CM7$q#O+iGfO1En0_Wm_4XjrS_{h?r!5|l__@d7aPv1 zUhnuJ1D-rqy!(CDRk31=rc(wNTOQxK`R`eBZr72B+QQEIkmG?d9hU!@w0C`w70z88 zUwlX5-xKg8VNG}acYEL+-Tm)M=ZHOzT)$3rS0wNz^8fV=az_f>RyQ7F00K`}KbLh* G2~7Y1M(+Or literal 0 HcmV?d00001 diff --git a/third_party/tracy/doc/profiler2.png b/third_party/tracy/doc/profiler2.png new file mode 100644 index 0000000000000000000000000000000000000000..583fb2b15d518958bae9bc3844444106d7349909 GIT binary patch literal 256370 zcmeFZbx>SSw>COJaF^ij5`1uXcXtK`AKWFlyF0-NA$VYLCj^2+Ai&^|APF8U*d=*? z=bZQ4`~7pO?)Tr>Ra3in_gc^D^{mxvdRO&KoTj=0CK@Rk006*LQk2yO0MH=-zzaVV zgy){?G+Bn{8?u*@njG>T93mk(>%JcJpwxb%5AVd-=QBP}}%9 z*a854E0qOCKI9#(a!=f7*l=PT(Gfm%0tna}chou_N|nXubShwd9%8uF??Ax*RNvD{ zXUN&CF<*|#hZU#Gpxrltl|@@Zn7zd0$S&M!0E6@YBv6N9IOwYOuJ( zw6ua4-;ZJ>K({L}NWn#d^~=%;NS_@p19vV2@)I4uOg`mH2Iv)_^VX=fYkO z5)#yFvM=ZG_d6HY*x&fl2FjS<%L#`S6`M@pJtn+3U=Vf(ZQZ>+m4^tNr0^U6=pSD)>^>FJv}FCRMnY@bJx@L6+) z9S0V=F;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