@patleeman/pi-boy 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +189 -0
- package/index.ts +1 -0
- package/mgba-bridge/build.sh +31 -0
- package/mgba-bridge/src/main.c +740 -0
- package/mgba-bridge/vendor/mgba/.clang-format +34 -0
- package/mgba-bridge/vendor/mgba/.gitlab-ci.yml +267 -0
- package/mgba-bridge/vendor/mgba/CHANGES +2094 -0
- package/mgba-bridge/vendor/mgba/CMakeLists.txt +1373 -0
- package/mgba-bridge/vendor/mgba/CMakePresets.json +21 -0
- package/mgba-bridge/vendor/mgba/CONTRIBUTING.md +196 -0
- package/mgba-bridge/vendor/mgba/LICENSE +373 -0
- package/mgba-bridge/vendor/mgba/Makefile +1 -0
- package/mgba-bridge/vendor/mgba/Makefile.libretro +490 -0
- package/mgba-bridge/vendor/mgba/PORTING.md +21 -0
- package/mgba-bridge/vendor/mgba/README.md +270 -0
- package/mgba-bridge/vendor/mgba/README_DE.md +255 -0
- package/mgba-bridge/vendor/mgba/README_ES.md +255 -0
- package/mgba-bridge/vendor/mgba/README_JP.md +268 -0
- package/mgba-bridge/vendor/mgba/README_ZH_CN.md +268 -0
- package/mgba-bridge/vendor/mgba/Tupfile +3 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/bitmap-cache.h +64 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/cache-set.h +38 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/cheats.h +130 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/config.h +118 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/core.h +232 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/cpu.h +40 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/directories.h +42 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/input.h +91 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/interface.h +199 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/library.h +62 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/lockstep.h +77 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/log.h +88 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/map-cache.h +82 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/mem-search.h +62 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/rewind.h +47 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/scripting.h +65 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/serialize.h +61 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/sync.h +44 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/thread.h +135 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/tile-cache.h +63 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/timing.h +55 -0
- package/mgba-bridge/vendor/mgba/include/mgba/core/version.h +27 -0
- package/mgba-bridge/vendor/mgba/include/mgba/debugger/debugger.h +267 -0
- package/mgba-bridge/vendor/mgba/include/mgba/feature/commandline.h +71 -0
- package/mgba-bridge/vendor/mgba/include/mgba/feature/proxy-backend.h +83 -0
- package/mgba-bridge/vendor/mgba/include/mgba/feature/thread-proxy.h +41 -0
- package/mgba-bridge/vendor/mgba/include/mgba/feature/updater.h +51 -0
- package/mgba-bridge/vendor/mgba/include/mgba/feature/video-backend.h +81 -0
- package/mgba-bridge/vendor/mgba/include/mgba/feature/video-logger.h +145 -0
- package/mgba-bridge/vendor/mgba/include/mgba/gb/core.h +21 -0
- package/mgba-bridge/vendor/mgba/include/mgba/gb/interface.h +112 -0
- package/mgba-bridge/vendor/mgba/include/mgba/gba/core.h +21 -0
- package/mgba-bridge/vendor/mgba/include/mgba/gba/interface.h +168 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/arm.h +217 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/debugger/cli-debugger.h +18 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/debugger/debugger.h +52 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/debugger/memory-debugger.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/decoder-inlines.h +37 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/decoder.h +231 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/emitter-arm.h +336 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/emitter-inlines.h +32 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/emitter-thumb.h +113 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/isa-arm.h +22 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/isa-inlines.h +186 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/isa-thumb.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/arm/macros.h +18 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/access-logger.h +57 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/cli-debugger.h +108 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/cli-el-backend.h +21 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/gdb-stub.h +62 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/parser.h +81 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/stack-trace.h +32 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/debugger/symbols.h +29 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/defines.h +31 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/audio.h +257 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/cheats.h +26 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/debugger/cli.h +28 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/debugger/debugger.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/debugger/symbols.h +19 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/gb.h +202 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/input.h +31 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/io.h +127 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/mbc.h +72 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/memory.h +385 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/overrides.h +21 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/renderers/cache-set.h +23 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/renderers/proxy.h +29 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/renderers/software.h +72 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/serialize.h +536 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/sio/lockstep.h +49 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/sio/printer.h +74 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/sio.h +52 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/timer.h +45 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gb/video.h +201 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/audio.h +291 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/bios.h +73 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/ereader.h +127 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/gpio.h +110 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/matrix.h +35 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cart/unlicensed.h +77 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/cheats.h +175 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/debugger/cli.h +30 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/dma.h +73 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/gba.h +194 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/input.h +34 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/io.h +190 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/memory.h +184 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/overrides.h +21 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/cache-set.h +22 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/common.h +27 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/gl.h +218 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/proxy.h +29 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/renderers/video-software.h +160 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/savedata.h +130 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/serialize.h +496 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sharkport.h +27 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio/dolphin.h +41 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio/gbp.h +38 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio/lockstep.h +95 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/sio.h +98 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/timer.h +36 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/gba/video.h +251 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/script/lua.h +12 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/script/socket.h +31 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/script/types.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/debugger/cli-debugger.h +18 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/debugger/debugger.h +43 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/debugger/memory-debugger.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/decoder.h +113 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/emitter-sm83.h +528 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/isa-sm83.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba/internal/sm83/sm83.h +174 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/base.h +28 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/canvas.h +24 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/console.h +51 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/context.h +126 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/input.h +272 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/macros.h +680 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/storage.h +28 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script/types.h +400 -0
- package/mgba-bridge/vendor/mgba/include/mgba/script.h +18 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/audio-buffer.h +34 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/audio-resampler.h +42 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/circle-buffer.h +39 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/common.h +352 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/configuration.h +50 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/convolve.h +33 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/crc32.h +26 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/dllexports.h +19 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/elf-read.h +45 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/formatting.h +36 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/geometry.h +31 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/gui/file-select.h +21 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/gui/font-metrics.h +15 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/gui/font.h +149 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/gui/menu.h +126 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/gui.h +136 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/hash.h +17 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/image/export.h +20 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/image/png-io.h +54 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/image.h +442 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/interpolator.h +51 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/macros.h +92 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/math.h +145 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/md5.h +34 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/memory.h +18 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/patch/fast.h +38 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/patch/ips.h +19 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/patch/ups.h +19 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/patch.h +26 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/3ds/3ds-vfs.h +17 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/3ds/threading.h +88 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/posix/threading.h +125 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/psp2/sce-vfs.h +18 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/psp2/threading.h +161 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/switch/threading.h +88 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/windows/getopt.h +609 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/platform/windows/threading.h +106 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/ring-fifo.h +30 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/sfo.h +30 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/sha1.h +33 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/socket.h +542 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/string.h +55 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/table.h +93 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/text-codec.h +36 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/threading.h +123 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/vector.h +128 -0
- package/mgba-bridge/vendor/mgba/include/mgba-util/vfs.h +125 -0
- package/mgba-bridge/vendor/mgba/intl/activate.py +70 -0
- package/mgba-bridge/vendor/mgba/intl/core_option_regex.py +95 -0
- package/mgba-bridge/vendor/mgba/intl/core_option_translation.py +633 -0
- package/mgba-bridge/vendor/mgba/intl/crowdin.yaml +13 -0
- package/mgba-bridge/vendor/mgba/intl/crowdin_prep.py +30 -0
- package/mgba-bridge/vendor/mgba/intl/crowdin_source_upload.py +93 -0
- package/mgba-bridge/vendor/mgba/intl/crowdin_translate.py +39 -0
- package/mgba-bridge/vendor/mgba/intl/crowdin_translation_download.py +93 -0
- package/mgba-bridge/vendor/mgba/intl/download_workflow.py +16 -0
- package/mgba-bridge/vendor/mgba/intl/initial_sync.py +125 -0
- package/mgba-bridge/vendor/mgba/intl/remove_initial_cycle.py +30 -0
- package/mgba-bridge/vendor/mgba/intl/upload_workflow.py +15 -0
- package/mgba-bridge/vendor/mgba/intl/v1_to_v2_converter.py +483 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_arm64-v8a +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_armeabi +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_armeabi-v7a +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_mips +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_mips64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_x86 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.android_x86_64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.common +156 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux-portable_x86 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux-portable_x86_64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux_x86 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.linux_x86_64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.mingw_x86 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.mingw_x86_64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.osx_x86 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.osx_x86_64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.rules +45 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.vita_arm +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.wii_ppc +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.windows_x86 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/Makefile.windows_x86_64 +96 -0
- package/mgba-bridge/vendor/mgba/libretro-build/include/libz/zconf.h +511 -0
- package/mgba-bridge/vendor/mgba/libretro-build/jni/Android.mk +23 -0
- package/mgba-bridge/vendor/mgba/libretro-build/jni/Application.mk +2 -0
- package/mgba-bridge/vendor/mgba/libretro-build/link.T +5 -0
- package/mgba-bridge/vendor/mgba/link.T +4 -0
- package/mgba-bridge/vendor/mgba/opt/libgba/mgba.c +94 -0
- package/mgba-bridge/vendor/mgba/opt/libgba/mgba.h +46 -0
- package/mgba-bridge/vendor/mgba/src/arm/CMakeLists.txt +19 -0
- package/mgba-bridge/vendor/mgba/src/arm/arm.c +264 -0
- package/mgba-bridge/vendor/mgba/src/arm/debugger/cli-debugger.c +187 -0
- package/mgba-bridge/vendor/mgba/src/arm/debugger/debugger.c +588 -0
- package/mgba-bridge/vendor/mgba/src/arm/debugger/memory-debugger.c +158 -0
- package/mgba-bridge/vendor/mgba/src/arm/decoder-arm.c +466 -0
- package/mgba-bridge/vendor/mgba/src/arm/decoder-thumb.c +344 -0
- package/mgba-bridge/vendor/mgba/src/arm/decoder.c +601 -0
- package/mgba-bridge/vendor/mgba/src/arm/isa-arm.c +784 -0
- package/mgba-bridge/vendor/mgba/src/arm/isa-thumb.c +417 -0
- package/mgba-bridge/vendor/mgba/src/core/CMakeLists.txt +47 -0
- package/mgba-bridge/vendor/mgba/src/core/bitmap-cache.c +187 -0
- package/mgba-bridge/vendor/mgba/src/core/cache-set.c +83 -0
- package/mgba-bridge/vendor/mgba/src/core/cheats.c +807 -0
- package/mgba-bridge/vendor/mgba/src/core/config.c +548 -0
- package/mgba-bridge/vendor/mgba/src/core/core-serialize.c +585 -0
- package/mgba-bridge/vendor/mgba/src/core/core.c +539 -0
- package/mgba-bridge/vendor/mgba/src/core/directories.c +196 -0
- package/mgba-bridge/vendor/mgba/src/core/flags.h.in +204 -0
- package/mgba-bridge/vendor/mgba/src/core/input.c +677 -0
- package/mgba-bridge/vendor/mgba/src/core/interface.c +154 -0
- package/mgba-bridge/vendor/mgba/src/core/library.c +584 -0
- package/mgba-bridge/vendor/mgba/src/core/lockstep.c +43 -0
- package/mgba-bridge/vendor/mgba/src/core/log.c +294 -0
- package/mgba-bridge/vendor/mgba/src/core/map-cache.c +219 -0
- package/mgba-bridge/vendor/mgba/src/core/mem-search.c +342 -0
- package/mgba-bridge/vendor/mgba/src/core/rewind.c +186 -0
- package/mgba-bridge/vendor/mgba/src/core/scripting.c +1481 -0
- package/mgba-bridge/vendor/mgba/src/core/sync.c +121 -0
- package/mgba-bridge/vendor/mgba/src/core/thread.c +726 -0
- package/mgba-bridge/vendor/mgba/src/core/tile-cache.c +283 -0
- package/mgba-bridge/vendor/mgba/src/core/timing.c +137 -0
- package/mgba-bridge/vendor/mgba/src/core/version.c.in +14 -0
- package/mgba-bridge/vendor/mgba/src/debugger/CMakeLists.txt +30 -0
- package/mgba-bridge/vendor/mgba/src/debugger/access-logger.c +592 -0
- package/mgba-bridge/vendor/mgba/src/debugger/cli-debugger-scripting.c +137 -0
- package/mgba-bridge/vendor/mgba/src/debugger/cli-debugger.c +1482 -0
- package/mgba-bridge/vendor/mgba/src/debugger/cli-el-backend.c +248 -0
- package/mgba-bridge/vendor/mgba/src/debugger/debugger.c +327 -0
- package/mgba-bridge/vendor/mgba/src/debugger/gdb-stub.c +918 -0
- package/mgba-bridge/vendor/mgba/src/debugger/parser.c +902 -0
- package/mgba-bridge/vendor/mgba/src/debugger/stack-trace.c +133 -0
- package/mgba-bridge/vendor/mgba/src/debugger/symbols.c +109 -0
- package/mgba-bridge/vendor/mgba/src/feature/CMakeLists.txt +24 -0
- package/mgba-bridge/vendor/mgba/src/feature/commandline.c +404 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-common.h +95 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-decoder.c +204 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-decoder.h +45 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-encoder.c +960 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-encoder.h +91 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-scale.c +36 -0
- package/mgba-bridge/vendor/mgba/src/feature/ffmpeg/ffmpeg-scale.h +21 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/cheats.c +195 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/cheats.h +18 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/gui-config.c +438 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/gui-config.h +19 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/gui-runner.c +853 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/gui-runner.h +114 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/remap.c +88 -0
- package/mgba-bridge/vendor/mgba/src/feature/gui/remap.h +27 -0
- package/mgba-bridge/vendor/mgba/src/feature/proxy-backend.c +286 -0
- package/mgba-bridge/vendor/mgba/src/feature/thread-proxy.c +213 -0
- package/mgba-bridge/vendor/mgba/src/feature/updater.c +227 -0
- package/mgba-bridge/vendor/mgba/src/feature/video-backend.c +45 -0
- package/mgba-bridge/vendor/mgba/src/feature/video-logger.c +1092 -0
- package/mgba-bridge/vendor/mgba/src/gb/CMakeLists.txt +53 -0
- package/mgba-bridge/vendor/mgba/src/gb/audio.c +1149 -0
- package/mgba-bridge/vendor/mgba/src/gb/cheats.c +190 -0
- package/mgba-bridge/vendor/mgba/src/gb/core.c +1539 -0
- package/mgba-bridge/vendor/mgba/src/gb/debugger/cli.c +115 -0
- package/mgba-bridge/vendor/mgba/src/gb/debugger/debugger.c +46 -0
- package/mgba-bridge/vendor/mgba/src/gb/debugger/symbols.c +61 -0
- package/mgba-bridge/vendor/mgba/src/gb/extra/proxy.c +328 -0
- package/mgba-bridge/vendor/mgba/src/gb/gb.c +1261 -0
- package/mgba-bridge/vendor/mgba/src/gb/input.c +29 -0
- package/mgba-bridge/vendor/mgba/src/gb/io.c +735 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/huc-3.c +218 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/licensed.c +84 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/mbc-private.h +66 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/mbc.c +583 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/pocket-cam.c +142 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/tama5.c +433 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc/unlicensed.c +601 -0
- package/mgba-bridge/vendor/mgba/src/gb/mbc.c +650 -0
- package/mgba-bridge/vendor/mgba/src/gb/memory.c +1079 -0
- package/mgba-bridge/vendor/mgba/src/gb/overrides.c +939 -0
- package/mgba-bridge/vendor/mgba/src/gb/renderers/cache-set.c +129 -0
- package/mgba-bridge/vendor/mgba/src/gb/renderers/software.c +1169 -0
- package/mgba-bridge/vendor/mgba/src/gb/serialize.c +310 -0
- package/mgba-bridge/vendor/mgba/src/gb/sio/lockstep.c +284 -0
- package/mgba-bridge/vendor/mgba/src/gb/sio/printer.c +237 -0
- package/mgba-bridge/vendor/mgba/src/gb/sio.c +106 -0
- package/mgba-bridge/vendor/mgba/src/gb/timer.c +150 -0
- package/mgba-bridge/vendor/mgba/src/gb/video.c +1216 -0
- package/mgba-bridge/vendor/mgba/src/gba/CMakeLists.txt +62 -0
- package/mgba-bridge/vendor/mgba/src/gba/audio.c +555 -0
- package/mgba-bridge/vendor/mgba/src/gba/bios.c +981 -0
- package/mgba-bridge/vendor/mgba/src/gba/cart/ereader.c +1639 -0
- package/mgba-bridge/vendor/mgba/src/gba/cart/gpio.c +584 -0
- package/mgba-bridge/vendor/mgba/src/gba/cart/matrix.c +134 -0
- package/mgba-bridge/vendor/mgba/src/gba/cart/unlicensed.c +255 -0
- package/mgba-bridge/vendor/mgba/src/gba/cart/vfame.c +320 -0
- package/mgba-bridge/vendor/mgba/src/gba/cheats/codebreaker.c +323 -0
- package/mgba-bridge/vendor/mgba/src/gba/cheats/gameshark.c +318 -0
- package/mgba-bridge/vendor/mgba/src/gba/cheats/gameshark.h +32 -0
- package/mgba-bridge/vendor/mgba/src/gba/cheats/parv3.c +442 -0
- package/mgba-bridge/vendor/mgba/src/gba/cheats/parv3.h +21 -0
- package/mgba-bridge/vendor/mgba/src/gba/cheats.c +386 -0
- package/mgba-bridge/vendor/mgba/src/gba/core.c +1822 -0
- package/mgba-bridge/vendor/mgba/src/gba/debugger/cli.c +116 -0
- package/mgba-bridge/vendor/mgba/src/gba/dma.c +363 -0
- package/mgba-bridge/vendor/mgba/src/gba/extra/battlechip.c +171 -0
- package/mgba-bridge/vendor/mgba/src/gba/extra/proxy.c +408 -0
- package/mgba-bridge/vendor/mgba/src/gba/gba.c +1095 -0
- package/mgba-bridge/vendor/mgba/src/gba/hle-bios-src.s +400 -0
- package/mgba-bridge/vendor/mgba/src/gba/hle-bios.c +103 -0
- package/mgba-bridge/vendor/mgba/src/gba/hle-bios.h +17 -0
- package/mgba-bridge/vendor/mgba/src/gba/hle-bios.make +18 -0
- package/mgba-bridge/vendor/mgba/src/gba/input.c +31 -0
- package/mgba-bridge/vendor/mgba/src/gba/io.c +1085 -0
- package/mgba-bridge/vendor/mgba/src/gba/memory.c +1974 -0
- package/mgba-bridge/vendor/mgba/src/gba/overrides.c +435 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/cache-set.c +219 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/common.c +59 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/gl.c +2137 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/software-bg.c +228 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/software-mode0.c +576 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/software-obj.c +431 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/software-private.h +283 -0
- package/mgba-bridge/vendor/mgba/src/gba/renderers/video-software.c +1117 -0
- package/mgba-bridge/vendor/mgba/src/gba/savedata.c +792 -0
- package/mgba-bridge/vendor/mgba/src/gba/serialize.c +242 -0
- package/mgba-bridge/vendor/mgba/src/gba/sharkport.c +389 -0
- package/mgba-bridge/vendor/mgba/src/gba/sio/dolphin.c +217 -0
- package/mgba-bridge/vendor/mgba/src/gba/sio/gbp.c +150 -0
- package/mgba-bridge/vendor/mgba/src/gba/sio/lockstep.c +1063 -0
- package/mgba-bridge/vendor/mgba/src/gba/sio.c +493 -0
- package/mgba-bridge/vendor/mgba/src/gba/timer.c +153 -0
- package/mgba-bridge/vendor/mgba/src/gba/video.c +470 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/DMGOverrides.cmake.in +6 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/DebugStrip.cmake +12 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/ExportDirectory.cmake +7 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/FindFeature.cmake +88 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/FindFunction.cmake +14 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/FindSDL2.cmake +164 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/Findepoxy.cmake +10 -0
- package/mgba-bridge/vendor/mgba/src/platform/cmake/devkitPro.cmake +44 -0
- package/mgba-bridge/vendor/mgba/src/platform/example/client-server/client.c +160 -0
- package/mgba-bridge/vendor/mgba/src/platform/example/client-server/server.c +168 -0
- package/mgba-bridge/vendor/mgba/src/platform/headless-main.c +379 -0
- package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro.c +2611 -0
- package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro.h +7846 -0
- package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro_core_options.h +721 -0
- package/mgba-bridge/vendor/mgba/src/platform/libretro/libretro_core_options_intl.h +17798 -0
- package/mgba-bridge/vendor/mgba/src/platform/libretro/memory.c +22 -0
- package/mgba-bridge/vendor/mgba/src/platform/libretro/retro_inline.h +39 -0
- package/mgba-bridge/vendor/mgba/src/platform/opengl/gl.c +304 -0
- package/mgba-bridge/vendor/mgba/src/platform/opengl/gl.h +40 -0
- package/mgba-bridge/vendor/mgba/src/platform/opengl/gles2.c +1230 -0
- package/mgba-bridge/vendor/mgba/src/platform/opengl/gles2.h +117 -0
- package/mgba-bridge/vendor/mgba/src/platform/posix/memory.c +37 -0
- package/mgba-bridge/vendor/mgba/src/script/CMakeLists.txt +38 -0
- package/mgba-bridge/vendor/mgba/src/script/canvas.c +292 -0
- package/mgba-bridge/vendor/mgba/src/script/console.c +141 -0
- package/mgba-bridge/vendor/mgba/src/script/context.c +492 -0
- package/mgba-bridge/vendor/mgba/src/script/engines/lua.c +1617 -0
- package/mgba-bridge/vendor/mgba/src/script/image.c +338 -0
- package/mgba-bridge/vendor/mgba/src/script/input.c +612 -0
- package/mgba-bridge/vendor/mgba/src/script/socket.c +284 -0
- package/mgba-bridge/vendor/mgba/src/script/stdlib.c +306 -0
- package/mgba-bridge/vendor/mgba/src/script/storage.c +557 -0
- package/mgba-bridge/vendor/mgba/src/script/test.h +29 -0
- package/mgba-bridge/vendor/mgba/src/script/types.c +1886 -0
- package/mgba-bridge/vendor/mgba/src/sm83/CMakeLists.txt +16 -0
- package/mgba-bridge/vendor/mgba/src/sm83/debugger/cli-debugger.c +110 -0
- package/mgba-bridge/vendor/mgba/src/sm83/debugger/debugger.c +266 -0
- package/mgba-bridge/vendor/mgba/src/sm83/debugger/memory-debugger.c +84 -0
- package/mgba-bridge/vendor/mgba/src/sm83/decoder.c +608 -0
- package/mgba-bridge/vendor/mgba/src/sm83/isa-sm83.c +817 -0
- package/mgba-bridge/vendor/mgba/src/sm83/sm83.c +199 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/.clang-format +92 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/CMakeLists.txt +18 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/LICENSE +19 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/README.md +152 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/discord_register.h +26 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/discord_rpc.h +87 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/LICENSE +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/README.md +41 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/condition_variable +549 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/mutex +474 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/shared_mutex +497 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/mingw-std-threads/thread +410 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/allocators.h +271 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/document.h +2573 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/encodedstream.h +299 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/encodings.h +716 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/error/en.h +74 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/error/error.h +155 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/filereadstream.h +99 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/filewritestream.h +104 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/fwd.h +151 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/biginteger.h +290 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/diyfp.h +258 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/dtoa.h +245 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/ieee754.h +78 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/itoa.h +304 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/meta.h +181 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/pow10.h +55 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/regex.h +701 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/stack.h +230 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/strfunc.h +55 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/strtod.h +269 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/internal/swap.h +46 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/istreamwrapper.h +115 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/license.txt +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/memorybuffer.h +70 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/memorystream.h +71 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/msinttypes/inttypes.h +316 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/msinttypes/stdint.h +300 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/ostreamwrapper.h +81 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/pointer.h +1358 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/prettywriter.h +255 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/rapidjson.h +615 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/reader.h +1879 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/schema.h +2006 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/stream.h +179 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/stringbuffer.h +117 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/include/rapidjson/writer.h +610 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/CMakeLists.txt +90 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/backoff.h +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/connection.h +19 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/connection_unix.cpp +125 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/connection_win.cpp +128 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_register_linux.cpp +102 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_register_osx.m +80 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_register_win.cpp +185 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/discord_rpc.cpp +504 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/dllmain.cpp +8 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/msg_queue.h +36 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/rpc_connection.cpp +137 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/rpc_connection.h +59 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/serialization.cpp +245 -0
- package/mgba-bridge/vendor/mgba/src/third-party/discord-rpc/src/serialization.h +215 -0
- package/mgba-bridge/vendor/mgba/src/third-party/inih/LICENSE.txt +27 -0
- package/mgba-bridge/vendor/mgba/src/third-party/inih/README.md +157 -0
- package/mgba-bridge/vendor/mgba/src/third-party/inih/ini.c +288 -0
- package/mgba-bridge/vendor/mgba/src/third-party/inih/ini.h +148 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/ANNOUNCE +47 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/AUTHORS +45 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/CHANGES +6109 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/CMakeLists.txt +931 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/INSTALL +465 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/LICENSE +134 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/Makefile.am +393 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/Makefile.in +2428 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/README +183 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/TODO +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/TRADEMARK +8 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/aclocal.m4 +1196 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/arm_init.c +136 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/filter_neon.S +253 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/filter_neon_intrinsics.c +402 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/arm/palette_neon_intrinsics.c +149 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/autogen.sh +225 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/compile +348 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/config.guess +1476 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/config.h.in +126 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/config.sub +1801 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/configure +16116 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/configure.ac +532 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/README.txt +5 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/README +83 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/android-ndk.c +39 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/linux-auxv.c +120 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/arm-neon/linux.c +161 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/README +49 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/pngcp.dfa +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/read.dfa +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/s_read.dfa +35 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/s_write.dfa +33 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/simple.dfa +36 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/conftest/write.dfa +45 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/README.txt +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/iccfrompng.c +185 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/pngpixel.c +371 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/pngtopng.c +98 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/examples/simpleover.c +648 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/COPYING +340 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/LICENSE +50 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.mingw32 +131 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.sgi +105 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.unx +134 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/Makefile.w32 +114 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/README +186 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/makevms.com +132 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng.c +323 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng.h +88 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng2.c +521 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readpng2.h +116 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/readppm.c +188 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng-win.c +735 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng-x.c +911 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng2-win.c +1261 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/rpng2-x.c +2143 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/toucan.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/wpng.c +865 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/writepng.c +401 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/gregbook/writepng.h +133 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/fakepng.c +65 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/gentests.sh +102 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/makepng.c +1941 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngimage.c +1712 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngstest-errors.h +165 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngstest.c +3828 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngunknown.c +1294 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/pngvalid.c +12230 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/readpng.c +115 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/tarith.c +999 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/libtests/timepng.c +608 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/mips-msa/README +83 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/mips-msa/linux.c +64 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/Dockerfile +25 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/README.txt +37 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/build.sh +51 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/libpng_read_fuzzer.cc +190 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/libpng_read_fuzzer.options +2 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/oss-fuzz/png.dict +39 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/README +5 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/README +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/makefile +151 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/pngusr.dfa +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/decoder/pngusr.h +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/README +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/makefile +150 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/pngusr.dfa +39 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/encoder/pngusr.h +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/README +15 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/makefile +166 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/pngusr.dfa +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminim/preader/pngusr.h +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/CHANGES.txt +13 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/CMakeLists.txt +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/LICENSE.txt +22 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/Makefile +62 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/README.txt +120 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/makevms.com +92 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/png2pnm.bat +41 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/png2pnm.c +427 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/png2pnm.sh +42 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pngminus.bat +4 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pngminus.sh +5 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pnm2png.bat +41 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pnm2png.c +620 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngminus/pnm2png.sh +42 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/README +107 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/bad_interlace_conversions.txt +9 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g01.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g02.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g04.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn0g16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn2c08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn2c16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p01.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p02.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p04.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn4a08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn4a16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn6a08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/basn6a16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn0g01.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn0g02.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn0g04.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn2c16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbbn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbgn2c16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbgn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbrn2c08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbwn0g16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbwn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftbyn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp0n0g08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp0n2c08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp0n3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ftp1n3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn0g08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn0g16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn2c08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn2c16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn4a08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn4a16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn6a08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/ibasn6a16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbbn2c16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbbn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbgn2c16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbgn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbrn2c08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbwn0g16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbwn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftbyn3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp0n0g08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp0n2c08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp0n3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/iftp1n3p08.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/README +2 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn0g01.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn0g02.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn0g04.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn3p01.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn3p02.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/ibasn3p04.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/iftbbn0g01.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/iftbbn0g02.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/pngsuite/interlaced/iftbbn0g04.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/powerpc-vsx/README +81 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/powerpc-vsx/linux.c +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/powerpc-vsx/linux_aux.c +34 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/bad_iCCP.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/badadler.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/badcrc.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/empty_ancillary_chunks.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_IDAT.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_bKGD_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_cHRM_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_eXIf_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_gAMA_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_hIST_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_iCCP_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_iTXt_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_juNK_unsafe_to_copy.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_juNk_safe_to_copy.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_pCAL_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_pHYs_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sCAL_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sPLT_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sRGB_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_sTER_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_tEXt_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_tIME_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/crashers/huge_zTXt_chunk.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-1.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-2.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-4.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/gray-alpha-8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/makepngs.sh +94 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-1.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-2.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-4.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/palette-8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-1.8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-linear-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-sRGB-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8-tRNS.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-16.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8-1.8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8-linear.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8-sRGB.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/testpngs/rgb-alpha-8.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/README.txt +27 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/checksum-icc.c +102 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/chkfmt +144 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/cvtcolor.c +188 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/genpng.c +881 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/intgamma.sh +110 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/makesRGB.c +430 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/png-fix-itxt.c +164 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/pngcp.c +2453 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/pngfix.c +4049 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/reindent +25 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/tools/sRGB.h +48 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/PngFile.c +454 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/PngFile.h +30 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/README.txt +61 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.c +978 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.dsp +147 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.dsw +29 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.ico +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/VisualPng.rc +152 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/cexcept.h +248 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/contrib/visupng/resource.h +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/depcomp +791 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/example.c +1040 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/install-sh +518 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/intel/filter_sse2_intrinsics.c +391 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/intel/intel_init.c +52 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng-config.in +127 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng-manual.txt +5409 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng.3 +6052 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpng.pc.in +12 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/libpngpf.3 +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/ltmain.sh +11147 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/mips/filter_msa_intrinsics.c +808 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/mips/mips_init.c +130 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/missing +215 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/png.5 +84 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/png.c +4607 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/png.h +3247 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngbar.jpg +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngbar.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngconf.h +623 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngdebug.h +153 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngerror.c +963 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngget.c +1249 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pnginfo.h +267 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngmem.c +284 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngnow.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngpread.c +1096 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngpriv.h +2152 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngread.c +4225 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngrio.c +120 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngrtran.c +5044 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngrutil.c +4681 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngset.c +1802 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngstruct.h +489 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngtest.c +2158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngtest.png +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngtrans.c +864 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngusr.dfa +14 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwio.c +168 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwrite.c +2395 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwtran.c +575 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/pngwutil.c +2781 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/powerpc/filter_vsx_intrinsics.c +768 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/powerpc/powerpc_init.c +126 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/libpng.tgt +383 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/libpng.wpj +112 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngconfig.mak +160 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngstest.tgt +219 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngtest.tgt +179 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/owatcom/pngvalid.tgt +210 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/PRJ0041.mak +21 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/README.txt +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/README_zlib.txt +44 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/libpng.sln +60 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/libpng.vcproj +419 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/pngtest.vcproj +267 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/visualc71/zlib.vcproj +391 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/libpng/libpng.vcxproj +234 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pnglibconf/pnglibconf.vcxproj +61 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngstest/pngstest.vcxproj +219 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngtest/pngtest.vcxproj +220 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngunknown/pngunknown.vcxproj +219 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/pngvalid/pngvalid.vcxproj +219 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/vstudio.sln +109 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/zlib/zlib.vcxproj +175 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/projects/vstudio/zlib.props +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/README.txt +79 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/SCOPTIONS.ppc +7 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/checksym.awk +173 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/descrip.mms +52 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/dfn.awk +203 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/genchk.cmake.in +37 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/genout.cmake.in +93 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/gensrc.cmake.in +138 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/intprefix.c +22 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libpng-config-body.in +96 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libpng-config-head.in +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libpng.pc.in +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/libtool.m4 +8369 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/ltoptions.m4 +437 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/ltsugar.m4 +124 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/ltversion.m4 +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/lt~obsolete.m4 +99 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/macro.lst +3 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.32sunu +244 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.64sunu +244 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.acorn +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.aix +116 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.amiga +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.atari +71 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.bc32 +158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.beos +222 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.cegcc +116 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.clang +87 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.clang-asan +87 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.darwin +225 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.dec +210 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.dj2 +72 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.freebsd +69 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.gcc +87 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.gcc-asan +87 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.hp64 +231 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.hpgcc +234 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.hpux +229 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.ibmc +90 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.intel +115 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.linux +246 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.linux-opt +265 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.mips +103 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.msys +202 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.netbsd +55 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.openbsd +86 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sco +226 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sggcc +236 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sgi +237 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.so9 +247 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.solaris +243 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.std +134 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.sunos +115 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makefile.vcwin32 +113 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/makevms.com +142 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/options.awk +898 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pnglibconf.dfa +920 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pnglibconf.h.prebuilt +219 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pnglibconf.mak +55 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/pngwin.rc +112 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/prefix.c +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/smakefile.ppc +34 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/sym.c +15 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/symbols.c +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/symbols.def +255 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/test.cmake.in +31 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/scripts/vers.c +19 -0
- package/mgba-bridge/vendor/mgba/src/third-party/libpng/test-driver +148 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7z.h +202 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zAlloc.c +80 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zAlloc.h +19 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zArcIn.c +1771 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zBuf.c +36 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zBuf.h +35 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zBuf2.c +52 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zCrc.c +128 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zCrc.h +25 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zCrcOpt.c +115 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zDec.c +591 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zFile.c +286 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zFile.h +83 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zStream.c +176 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zTypes.h +375 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zVersion.h +27 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/7zVersion.rc +55 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Aes.c +306 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Aes.h +38 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/AesOpt.c +184 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Alloc.c +455 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Alloc.h +51 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bcj2.c +257 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bcj2.h +146 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bcj2Enc.c +311 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bra.c +230 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bra.h +64 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Bra86.c +82 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/BraIA64.c +53 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Compiler.h +33 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/CpuArch.c +218 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/CpuArch.h +336 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Delta.c +64 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Delta.h +19 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/DllSecur.c +108 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/DllSecur.h +20 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFind.c +1127 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFind.h +121 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFindMt.c +853 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzFindMt.h +101 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzHash.h +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Dec.c +488 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Dec.h +120 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2DecMt.c +1082 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2DecMt.h +79 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Enc.c +803 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma2Enc.h +55 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma86.h +111 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma86Dec.c +54 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Lzma86Enc.c +106 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaDec.c +1185 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaDec.h +234 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaEnc.c +2976 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaEnc.h +76 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaLib.c +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/LzmaLib.h +131 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtCoder.c +601 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtCoder.h +141 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtDec.c +1138 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/MtDec.h +201 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd.h +85 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7.c +712 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7.h +142 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7Dec.c +191 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Ppmd7Enc.c +187 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Precomp.h +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/RotateDefs.h +30 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sha256.c +248 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sha256.h +26 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sort.c +141 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Sort.h +18 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Threads.c +95 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Threads.h +68 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/7z.dsp +241 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/7z.dsw +29 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/7zMain.c +686 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/Precomp.c +4 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/Precomp.h +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/makefile +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/7z/makefile.gcc +75 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/LzmaUtil.c +258 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/LzmaUtil.dsp +168 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/LzmaUtil.dsw +29 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/makefile +28 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/Lzma/makefile.gcc +44 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLib.def +4 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLib.dsp +178 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLib.dsw +29 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/LzmaLibExports.c +14 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/makefile +34 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/LzmaLib/resource.rc +3 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/Precomp.c +4 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/Precomp.h +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/SfxSetup.c +640 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/SfxSetup.dsp +231 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/SfxSetup.dsw +29 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/makefile +37 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/makefile_con +38 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/resource.rc +5 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Util/SfxSetup/setup.ico +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Xz.c +90 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/Xz.h +460 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzCrc64.c +86 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzCrc64.h +26 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzCrc64Opt.c +69 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzDec.c +2766 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzEnc.c +1329 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzEnc.h +60 -0
- package/mgba-bridge/vendor/mgba/src/third-party/lzma/XzIn.c +319 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/CMakeLists.txt +249 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/ChangeLog +1578 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/FAQ +368 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/INDEX +68 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/Makefile +5 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/Makefile.in +408 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/README +118 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/adler32.c +186 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/amiga/Makefile.pup +69 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/amiga/Makefile.sas +68 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/compress.c +86 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/configure +927 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/README.contrib +57 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/buffer_demo.adb +106 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/mtest.adb +156 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/read.adb +156 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/readme.txt +65 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/test.adb +463 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-streams.adb +225 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-streams.ads +114 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-thin.adb +141 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib-thin.ads +450 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib.adb +701 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib.ads +328 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/ada/zlib.gpr +20 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/Makefile +8 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/README +4 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/blast.c +466 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/blast.h +83 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/test.pk +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/blast/test.txt +1 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/ZLib.pas +557 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/ZLibConst.pas +11 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/readme.txt +76 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/delphi/zlibd32.mak +99 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/AssemblyInfo.cs +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/ChecksumImpl.cs +202 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/CircularBuffer.cs +83 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/CodecBase.cs +198 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/Deflater.cs +106 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/DotZLib.cs +288 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/DotZLib.csproj +141 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/GZipStream.cs +301 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/Inflater.cs +105 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs +274 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib.build +33 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib.chm +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/DotZLib.sln +21 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/LICENSE_1_0.txt +23 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/dotzlib/readme.txt +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/gcc_gvmat64/gvmat64.S +574 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/README +1 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/infback9.c +615 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/infback9.h +37 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inffix9.h +107 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inflate9.h +47 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inftree9.c +324 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/infback9/inftree9.h +61 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream/test.cpp +24 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream/zfstream.cpp +329 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream/zfstream.h +128 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream2/zstream.h +307 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream2/zstream_test.cpp +25 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/README +35 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/TODO +17 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/test.cc +50 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/zfstream.cc +479 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/iostream3/zfstream.h +466 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/Makefile +29 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/Makefile.am +45 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/MiniZip64_Changes.txt +6 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/MiniZip64_info.txt +74 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/configure.ac +32 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/crypt.h +132 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/ioapi.c +257 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/ioapi.h +210 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/iowin32.c +462 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/iowin32.h +28 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/make_vms.com +25 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/miniunz.c +659 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/miniunzip.1 +63 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/minizip.1 +46 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/minizip.c +521 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/minizip.pc.in +12 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/mztools.c +291 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/mztools.h +37 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/unzip.c +2128 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/unzip.h +437 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/zip.c +2007 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/minizip/zip.h +367 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/example.pas +599 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/readme.txt +76 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/zlibd32.mak +99 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/pascal/zlibpas.pas +276 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/Makefile +42 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/README +63 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/puff.c +840 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/puff.h +35 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/pufftest.c +165 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/puff/zeros.raw +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/testzlib/testzlib.c +275 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/testzlib/testzlib.txt +10 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/untgz/Makefile +14 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/untgz/Makefile.msc +17 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/untgz/untgz.c +674 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/readme.txt +78 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/miniunz.vcxproj +310 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters +22 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/minizip.vcxproj +307 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters +22 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlib.vcxproj +420 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters +58 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj +310 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters +22 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlib.rc +32 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj +473 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters +77 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.def +158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.sln +135 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj +657 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters +118 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/miniunz.vcxproj +314 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/minizip.vcxproj +311 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/testzlib.vcxproj +426 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/testzlibdll.vcxproj +314 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlib.rc +32 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibstat.vcxproj +464 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibvc.def +158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibvc.sln +117 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc11/zlibvc.vcxproj +688 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/miniunz.vcxproj +316 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/minizip.vcxproj +313 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/testzlib.vcxproj +430 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/testzlibdll.vcxproj +316 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlib.rc +32 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibstat.vcxproj +467 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibvc.def +158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibvc.sln +119 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc12/zlibvc.vcxproj +692 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/miniunz.vcxproj +316 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/minizip.vcxproj +313 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/testzlib.vcxproj +430 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/testzlibdll.vcxproj +316 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlib.rc +32 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibstat.vcxproj +467 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibvc.def +158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibvc.sln +119 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc14/zlibvc.vcxproj +692 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/miniunz.vcproj +565 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/minizip.vcproj +562 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/testzlib.vcproj +852 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/testzlibdll.vcproj +565 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlib.rc +32 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibstat.vcproj +835 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibvc.def +158 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibvc.sln +144 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/contrib/vstudio/vc9/zlibvc.vcproj +1156 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/crc32.c +1116 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/crc32.h +9446 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/deflate.c +2211 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/deflate.h +346 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/algorithm.txt +209 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/crc-doc.1.0.pdf +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/rfc1950.txt +619 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/rfc1951.txt +955 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/rfc1952.txt +675 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/doc/txtvsbin.txt +107 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/README.examples +54 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/enough.c +597 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/fitblk.c +233 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gun.c +702 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzappend.c +504 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzjoin.c +449 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzlog.c +1061 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gzlog.h +91 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/gznorm.c +470 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zlib_how.html +545 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zpipe.c +205 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zran.c +479 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/examples/zran.h +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzclose.c +25 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzguts.h +219 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzlib.c +639 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzread.c +652 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/gzwrite.c +677 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/infback.c +641 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inffast.c +323 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inffast.h +11 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inffixed.h +94 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inflate.c +1592 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inflate.h +126 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inftrees.c +304 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/inftrees.h +62 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/make_vms.com +867 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.bor +115 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.dj2 +104 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.emx +69 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.msc +112 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/msdos/Makefile.tc +100 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/nintendods/Makefile +126 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/nintendods/README +5 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/Makefile.emx +69 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/Makefile.riscos +151 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/README +3 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/descrip.mms +48 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/os2/Makefile.os2 +136 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/os2/zlib.def +51 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/old/visual-basic.txt +160 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/README400 +48 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/bndsrc +119 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/make.sh +366 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/os400/zlib.inc +527 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/qnx/package.qpg +141 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/treebuild.xml +116 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/trees.c +1182 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/trees.h +128 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/uncompr.c +93 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/watcom/watcom_f.mak +43 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/watcom/watcom_l.mak +43 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/DLL_FAQ.txt +397 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/Makefile.bor +109 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/Makefile.gcc +177 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/Makefile.msc +159 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/README-WIN32.txt +103 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/VisualC.txt +3 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/zlib.def +97 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/win32/zlib1.rc +40 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zconf.h +534 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zconf.h.cmakein +536 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zconf.h.in +534 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.3 +149 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.3.pdf +0 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.h +1935 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.map +100 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.pc.cmakein +13 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib.pc.in +13 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zlib2ansi +152 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zutil.c +325 -0
- package/mgba-bridge/vendor/mgba/src/third-party/zlib/zutil.h +274 -0
- package/mgba-bridge/vendor/mgba/src/tools/docgen.c +541 -0
- package/mgba-bridge/vendor/mgba/src/tools/font-sdf.c +136 -0
- package/mgba-bridge/vendor/mgba/src/tools/updater-main.c +377 -0
- package/mgba-bridge/vendor/mgba/src/util/CMakeLists.txt +68 -0
- package/mgba-bridge/vendor/mgba/src/util/audio-buffer.c +62 -0
- package/mgba-bridge/vendor/mgba/src/util/audio-resampler.c +109 -0
- package/mgba-bridge/vendor/mgba/src/util/circle-buffer.c +274 -0
- package/mgba-bridge/vendor/mgba/src/util/configuration.c +233 -0
- package/mgba-bridge/vendor/mgba/src/util/convolve.c +182 -0
- package/mgba-bridge/vendor/mgba/src/util/crc32.c +138 -0
- package/mgba-bridge/vendor/mgba/src/util/elf-read.c +128 -0
- package/mgba-bridge/vendor/mgba/src/util/formatting.c +87 -0
- package/mgba-bridge/vendor/mgba/src/util/gbk-table.c +129 -0
- package/mgba-bridge/vendor/mgba/src/util/geometry.c +94 -0
- package/mgba-bridge/vendor/mgba/src/util/gui/file-select.c +236 -0
- package/mgba-bridge/vendor/mgba/src/util/gui/font-metrics.c +199 -0
- package/mgba-bridge/vendor/mgba/src/util/gui/font.c +169 -0
- package/mgba-bridge/vendor/mgba/src/util/gui/menu.c +412 -0
- package/mgba-bridge/vendor/mgba/src/util/gui.c +81 -0
- package/mgba-bridge/vendor/mgba/src/util/hash.c +108 -0
- package/mgba-bridge/vendor/mgba/src/util/image/export.c +81 -0
- package/mgba-bridge/vendor/mgba/src/util/image/font.c +274 -0
- package/mgba-bridge/vendor/mgba/src/util/image/png-io.c +730 -0
- package/mgba-bridge/vendor/mgba/src/util/image.c +1109 -0
- package/mgba-bridge/vendor/mgba/src/util/interpolator.c +116 -0
- package/mgba-bridge/vendor/mgba/src/util/md5.c +228 -0
- package/mgba-bridge/vendor/mgba/src/util/memory.c +15 -0
- package/mgba-bridge/vendor/mgba/src/util/patch-fast.c +130 -0
- package/mgba-bridge/vendor/mgba/src/util/patch-ips.c +93 -0
- package/mgba-bridge/vendor/mgba/src/util/patch-ups.c +254 -0
- package/mgba-bridge/vendor/mgba/src/util/patch.c +25 -0
- package/mgba-bridge/vendor/mgba/src/util/ring-fifo.c +104 -0
- package/mgba-bridge/vendor/mgba/src/util/sfo.c +229 -0
- package/mgba-bridge/vendor/mgba/src/util/sha1.c +258 -0
- package/mgba-bridge/vendor/mgba/src/util/string.c +652 -0
- package/mgba-bridge/vendor/mgba/src/util/table.c +682 -0
- package/mgba-bridge/vendor/mgba/src/util/text-codec.c +197 -0
- package/mgba-bridge/vendor/mgba/src/util/vector.c +18 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-devlist.c +104 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-dirent.c +173 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-fd.c +282 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-fifo.c +102 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-file.c +159 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-lzma.c +404 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-mem.c +331 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs/vfs-zip.c +804 -0
- package/mgba-bridge/vendor/mgba/src/util/vfs.c +320 -0
- package/mgba-bridge/vendor/mgba/tools/deploy-mac.py +178 -0
- package/mgba-bridge/vendor/mgba/tools/deploy-win.sh +27 -0
- package/mgba-bridge/vendor/mgba/tools/dlls.gdb +3 -0
- package/mgba-bridge/vendor/mgba/tools/make-dotcode.py +154 -0
- package/mgba-bridge/vendor/mgba/tools/perf.py +230 -0
- package/mgba-bridge/vendor/mgba/tools/sanitize-deb.sh +74 -0
- package/mgba-bridge/vendor/mgba/tools/snes-tile.py +94 -0
- package/mgba-bridge/vendor/mgba/version.cmake +62 -0
- package/package.json +47 -0
- package/src/audio-output.ts +387 -0
- package/src/config.ts +114 -0
- package/src/constants.ts +37 -0
- package/src/extension.ts +570 -0
- package/src/gameboy-mgba.ts +133 -0
- package/src/gameboy-types.ts +24 -0
- package/src/gameboy.ts +33 -0
- package/src/index.ts +1 -0
- package/src/mgba/bridge-bin.ts +66 -0
- package/src/mgba/bridge.ts +145 -0
- package/src/mgba/protocol.ts +30 -0
- package/src/mgba/stdio.ts +74 -0
- package/src/notify.ts +12 -0
- package/src/pi-boy-component.ts +372 -0
- package/src/render/ansi.ts +239 -0
- package/src/render/kitty.ts +154 -0
- package/src/roms.ts +163 -0
- package/src/runtime.ts +36 -0
- package/src/save-state.ts +94 -0
- package/src/terminal.ts +18 -0
- package/tsconfig.json +11 -0
- package/types/shims.d.ts +121 -0
|
@@ -0,0 +1,2006 @@
|
|
|
1
|
+
// Tencent is pleased to support the open source community by making RapidJSON available->
|
|
2
|
+
//
|
|
3
|
+
// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved->
|
|
4
|
+
//
|
|
5
|
+
// Licensed under the MIT License (the "License"); you may not use this file except
|
|
6
|
+
// in compliance with the License-> You may obtain a copy of the License at
|
|
7
|
+
//
|
|
8
|
+
// http://opensource->org/licenses/MIT
|
|
9
|
+
//
|
|
10
|
+
// Unless required by applicable law or agreed to in writing, software distributed
|
|
11
|
+
// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
12
|
+
// CONDITIONS OF ANY KIND, either express or implied-> See the License for the
|
|
13
|
+
// specific language governing permissions and limitations under the License->
|
|
14
|
+
|
|
15
|
+
#ifndef RAPIDJSON_SCHEMA_H_
|
|
16
|
+
#define RAPIDJSON_SCHEMA_H_
|
|
17
|
+
|
|
18
|
+
#include "document.h"
|
|
19
|
+
#include "pointer.h"
|
|
20
|
+
#include <cmath> // abs, floor
|
|
21
|
+
|
|
22
|
+
#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX)
|
|
23
|
+
#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1
|
|
24
|
+
#else
|
|
25
|
+
#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && !defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800))
|
|
29
|
+
#define RAPIDJSON_SCHEMA_USE_STDREGEX 1
|
|
30
|
+
#else
|
|
31
|
+
#define RAPIDJSON_SCHEMA_USE_STDREGEX 0
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
|
|
35
|
+
#include "internal/regex.h"
|
|
36
|
+
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
|
|
37
|
+
#include <regex>
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX || RAPIDJSON_SCHEMA_USE_STDREGEX
|
|
41
|
+
#define RAPIDJSON_SCHEMA_HAS_REGEX 1
|
|
42
|
+
#else
|
|
43
|
+
#define RAPIDJSON_SCHEMA_HAS_REGEX 0
|
|
44
|
+
#endif
|
|
45
|
+
|
|
46
|
+
#ifndef RAPIDJSON_SCHEMA_VERBOSE
|
|
47
|
+
#define RAPIDJSON_SCHEMA_VERBOSE 0
|
|
48
|
+
#endif
|
|
49
|
+
|
|
50
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
51
|
+
#include "stringbuffer.h"
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
RAPIDJSON_DIAG_PUSH
|
|
55
|
+
|
|
56
|
+
#if defined(__GNUC__)
|
|
57
|
+
RAPIDJSON_DIAG_OFF(effc++)
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
#ifdef __clang__
|
|
61
|
+
RAPIDJSON_DIAG_OFF(weak-vtables)
|
|
62
|
+
RAPIDJSON_DIAG_OFF(exit-time-destructors)
|
|
63
|
+
RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
|
|
64
|
+
RAPIDJSON_DIAG_OFF(variadic-macros)
|
|
65
|
+
#endif
|
|
66
|
+
|
|
67
|
+
#ifdef _MSC_VER
|
|
68
|
+
RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
|
|
69
|
+
#endif
|
|
70
|
+
|
|
71
|
+
RAPIDJSON_NAMESPACE_BEGIN
|
|
72
|
+
|
|
73
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
74
|
+
// Verbose Utilities
|
|
75
|
+
|
|
76
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
77
|
+
|
|
78
|
+
namespace internal {
|
|
79
|
+
|
|
80
|
+
inline void PrintInvalidKeyword(const char* keyword) {
|
|
81
|
+
printf("Fail keyword: %s\n", keyword);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
inline void PrintInvalidKeyword(const wchar_t* keyword) {
|
|
85
|
+
wprintf(L"Fail keyword: %ls\n", keyword);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
inline void PrintInvalidDocument(const char* document) {
|
|
89
|
+
printf("Fail document: %s\n\n", document);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
inline void PrintInvalidDocument(const wchar_t* document) {
|
|
93
|
+
wprintf(L"Fail document: %ls\n\n", document);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
inline void PrintValidatorPointers(unsigned depth, const char* s, const char* d) {
|
|
97
|
+
printf("S: %*s%s\nD: %*s%s\n\n", depth * 4, " ", s, depth * 4, " ", d);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
inline void PrintValidatorPointers(unsigned depth, const wchar_t* s, const wchar_t* d) {
|
|
101
|
+
wprintf(L"S: %*ls%ls\nD: %*ls%ls\n\n", depth * 4, L" ", s, depth * 4, L" ", d);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
} // namespace internal
|
|
105
|
+
|
|
106
|
+
#endif // RAPIDJSON_SCHEMA_VERBOSE
|
|
107
|
+
|
|
108
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
109
|
+
// RAPIDJSON_INVALID_KEYWORD_RETURN
|
|
110
|
+
|
|
111
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
112
|
+
#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword) internal::PrintInvalidKeyword(keyword)
|
|
113
|
+
#else
|
|
114
|
+
#define RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword)
|
|
115
|
+
#endif
|
|
116
|
+
|
|
117
|
+
#define RAPIDJSON_INVALID_KEYWORD_RETURN(keyword)\
|
|
118
|
+
RAPIDJSON_MULTILINEMACRO_BEGIN\
|
|
119
|
+
context.invalidKeyword = keyword.GetString();\
|
|
120
|
+
RAPIDJSON_INVALID_KEYWORD_VERBOSE(keyword.GetString());\
|
|
121
|
+
return false;\
|
|
122
|
+
RAPIDJSON_MULTILINEMACRO_END
|
|
123
|
+
|
|
124
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
125
|
+
// Forward declarations
|
|
126
|
+
|
|
127
|
+
template <typename ValueType, typename Allocator>
|
|
128
|
+
class GenericSchemaDocument;
|
|
129
|
+
|
|
130
|
+
namespace internal {
|
|
131
|
+
|
|
132
|
+
template <typename SchemaDocumentType>
|
|
133
|
+
class Schema;
|
|
134
|
+
|
|
135
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
136
|
+
// ISchemaValidator
|
|
137
|
+
|
|
138
|
+
class ISchemaValidator {
|
|
139
|
+
public:
|
|
140
|
+
virtual ~ISchemaValidator() {}
|
|
141
|
+
virtual bool IsValid() const = 0;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
145
|
+
// ISchemaStateFactory
|
|
146
|
+
|
|
147
|
+
template <typename SchemaType>
|
|
148
|
+
class ISchemaStateFactory {
|
|
149
|
+
public:
|
|
150
|
+
virtual ~ISchemaStateFactory() {}
|
|
151
|
+
virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&) = 0;
|
|
152
|
+
virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0;
|
|
153
|
+
virtual void* CreateHasher() = 0;
|
|
154
|
+
virtual uint64_t GetHashCode(void* hasher) = 0;
|
|
155
|
+
virtual void DestroryHasher(void* hasher) = 0;
|
|
156
|
+
virtual void* MallocState(size_t size) = 0;
|
|
157
|
+
virtual void FreeState(void* p) = 0;
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
161
|
+
// Hasher
|
|
162
|
+
|
|
163
|
+
// For comparison of compound value
|
|
164
|
+
template<typename Encoding, typename Allocator>
|
|
165
|
+
class Hasher {
|
|
166
|
+
public:
|
|
167
|
+
typedef typename Encoding::Ch Ch;
|
|
168
|
+
|
|
169
|
+
Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {}
|
|
170
|
+
|
|
171
|
+
bool Null() { return WriteType(kNullType); }
|
|
172
|
+
bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); }
|
|
173
|
+
bool Int(int i) { Number n; n.u.i = i; n.d = static_cast<double>(i); return WriteNumber(n); }
|
|
174
|
+
bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast<double>(u); return WriteNumber(n); }
|
|
175
|
+
bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast<double>(i); return WriteNumber(n); }
|
|
176
|
+
bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast<double>(u); return WriteNumber(n); }
|
|
177
|
+
bool Double(double d) {
|
|
178
|
+
Number n;
|
|
179
|
+
if (d < 0) n.u.i = static_cast<int64_t>(d);
|
|
180
|
+
else n.u.u = static_cast<uint64_t>(d);
|
|
181
|
+
n.d = d;
|
|
182
|
+
return WriteNumber(n);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
bool RawNumber(const Ch* str, SizeType len, bool) {
|
|
186
|
+
WriteBuffer(kNumberType, str, len * sizeof(Ch));
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
bool String(const Ch* str, SizeType len, bool) {
|
|
191
|
+
WriteBuffer(kStringType, str, len * sizeof(Ch));
|
|
192
|
+
return true;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
bool StartObject() { return true; }
|
|
196
|
+
bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); }
|
|
197
|
+
bool EndObject(SizeType memberCount) {
|
|
198
|
+
uint64_t h = Hash(0, kObjectType);
|
|
199
|
+
uint64_t* kv = stack_.template Pop<uint64_t>(memberCount * 2);
|
|
200
|
+
for (SizeType i = 0; i < memberCount; i++)
|
|
201
|
+
h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive
|
|
202
|
+
*stack_.template Push<uint64_t>() = h;
|
|
203
|
+
return true;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
bool StartArray() { return true; }
|
|
207
|
+
bool EndArray(SizeType elementCount) {
|
|
208
|
+
uint64_t h = Hash(0, kArrayType);
|
|
209
|
+
uint64_t* e = stack_.template Pop<uint64_t>(elementCount);
|
|
210
|
+
for (SizeType i = 0; i < elementCount; i++)
|
|
211
|
+
h = Hash(h, e[i]); // Use hash to achieve element order sensitive
|
|
212
|
+
*stack_.template Push<uint64_t>() = h;
|
|
213
|
+
return true;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); }
|
|
217
|
+
|
|
218
|
+
uint64_t GetHashCode() const {
|
|
219
|
+
RAPIDJSON_ASSERT(IsValid());
|
|
220
|
+
return *stack_.template Top<uint64_t>();
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
private:
|
|
224
|
+
static const size_t kDefaultSize = 256;
|
|
225
|
+
struct Number {
|
|
226
|
+
union U {
|
|
227
|
+
uint64_t u;
|
|
228
|
+
int64_t i;
|
|
229
|
+
}u;
|
|
230
|
+
double d;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
bool WriteType(Type type) { return WriteBuffer(type, 0, 0); }
|
|
234
|
+
|
|
235
|
+
bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); }
|
|
236
|
+
|
|
237
|
+
bool WriteBuffer(Type type, const void* data, size_t len) {
|
|
238
|
+
// FNV-1a from http://isthe.com/chongo/tech/comp/fnv/
|
|
239
|
+
uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type);
|
|
240
|
+
const unsigned char* d = static_cast<const unsigned char*>(data);
|
|
241
|
+
for (size_t i = 0; i < len; i++)
|
|
242
|
+
h = Hash(h, d[i]);
|
|
243
|
+
*stack_.template Push<uint64_t>() = h;
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
static uint64_t Hash(uint64_t h, uint64_t d) {
|
|
248
|
+
static const uint64_t kPrime = RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3);
|
|
249
|
+
h ^= d;
|
|
250
|
+
h *= kPrime;
|
|
251
|
+
return h;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
Stack<Allocator> stack_;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
258
|
+
// SchemaValidationContext
|
|
259
|
+
|
|
260
|
+
template <typename SchemaDocumentType>
|
|
261
|
+
struct SchemaValidationContext {
|
|
262
|
+
typedef Schema<SchemaDocumentType> SchemaType;
|
|
263
|
+
typedef ISchemaStateFactory<SchemaType> SchemaValidatorFactoryType;
|
|
264
|
+
typedef typename SchemaType::ValueType ValueType;
|
|
265
|
+
typedef typename ValueType::Ch Ch;
|
|
266
|
+
|
|
267
|
+
enum PatternValidatorType {
|
|
268
|
+
kPatternValidatorOnly,
|
|
269
|
+
kPatternValidatorWithProperty,
|
|
270
|
+
kPatternValidatorWithAdditionalProperty
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
SchemaValidationContext(SchemaValidatorFactoryType& f, const SchemaType* s) :
|
|
274
|
+
factory(f),
|
|
275
|
+
schema(s),
|
|
276
|
+
valueSchema(),
|
|
277
|
+
invalidKeyword(),
|
|
278
|
+
hasher(),
|
|
279
|
+
arrayElementHashCodes(),
|
|
280
|
+
validators(),
|
|
281
|
+
validatorCount(),
|
|
282
|
+
patternPropertiesValidators(),
|
|
283
|
+
patternPropertiesValidatorCount(),
|
|
284
|
+
patternPropertiesSchemas(),
|
|
285
|
+
patternPropertiesSchemaCount(),
|
|
286
|
+
valuePatternValidatorType(kPatternValidatorOnly),
|
|
287
|
+
propertyExist(),
|
|
288
|
+
inArray(false),
|
|
289
|
+
valueUniqueness(false),
|
|
290
|
+
arrayUniqueness(false)
|
|
291
|
+
{
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
~SchemaValidationContext() {
|
|
295
|
+
if (hasher)
|
|
296
|
+
factory.DestroryHasher(hasher);
|
|
297
|
+
if (validators) {
|
|
298
|
+
for (SizeType i = 0; i < validatorCount; i++)
|
|
299
|
+
factory.DestroySchemaValidator(validators[i]);
|
|
300
|
+
factory.FreeState(validators);
|
|
301
|
+
}
|
|
302
|
+
if (patternPropertiesValidators) {
|
|
303
|
+
for (SizeType i = 0; i < patternPropertiesValidatorCount; i++)
|
|
304
|
+
factory.DestroySchemaValidator(patternPropertiesValidators[i]);
|
|
305
|
+
factory.FreeState(patternPropertiesValidators);
|
|
306
|
+
}
|
|
307
|
+
if (patternPropertiesSchemas)
|
|
308
|
+
factory.FreeState(patternPropertiesSchemas);
|
|
309
|
+
if (propertyExist)
|
|
310
|
+
factory.FreeState(propertyExist);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
SchemaValidatorFactoryType& factory;
|
|
314
|
+
const SchemaType* schema;
|
|
315
|
+
const SchemaType* valueSchema;
|
|
316
|
+
const Ch* invalidKeyword;
|
|
317
|
+
void* hasher; // Only validator access
|
|
318
|
+
void* arrayElementHashCodes; // Only validator access this
|
|
319
|
+
ISchemaValidator** validators;
|
|
320
|
+
SizeType validatorCount;
|
|
321
|
+
ISchemaValidator** patternPropertiesValidators;
|
|
322
|
+
SizeType patternPropertiesValidatorCount;
|
|
323
|
+
const SchemaType** patternPropertiesSchemas;
|
|
324
|
+
SizeType patternPropertiesSchemaCount;
|
|
325
|
+
PatternValidatorType valuePatternValidatorType;
|
|
326
|
+
PatternValidatorType objectPatternValidatorType;
|
|
327
|
+
SizeType arrayElementIndex;
|
|
328
|
+
bool* propertyExist;
|
|
329
|
+
bool inArray;
|
|
330
|
+
bool valueUniqueness;
|
|
331
|
+
bool arrayUniqueness;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
335
|
+
// Schema
|
|
336
|
+
|
|
337
|
+
template <typename SchemaDocumentType>
|
|
338
|
+
class Schema {
|
|
339
|
+
public:
|
|
340
|
+
typedef typename SchemaDocumentType::ValueType ValueType;
|
|
341
|
+
typedef typename SchemaDocumentType::AllocatorType AllocatorType;
|
|
342
|
+
typedef typename SchemaDocumentType::PointerType PointerType;
|
|
343
|
+
typedef typename ValueType::EncodingType EncodingType;
|
|
344
|
+
typedef typename EncodingType::Ch Ch;
|
|
345
|
+
typedef SchemaValidationContext<SchemaDocumentType> Context;
|
|
346
|
+
typedef Schema<SchemaDocumentType> SchemaType;
|
|
347
|
+
typedef GenericValue<EncodingType, AllocatorType> SValue;
|
|
348
|
+
friend class GenericSchemaDocument<ValueType, AllocatorType>;
|
|
349
|
+
|
|
350
|
+
Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator) :
|
|
351
|
+
allocator_(allocator),
|
|
352
|
+
enum_(),
|
|
353
|
+
enumCount_(),
|
|
354
|
+
not_(),
|
|
355
|
+
type_((1 << kTotalSchemaType) - 1), // typeless
|
|
356
|
+
validatorCount_(),
|
|
357
|
+
properties_(),
|
|
358
|
+
additionalPropertiesSchema_(),
|
|
359
|
+
patternProperties_(),
|
|
360
|
+
patternPropertyCount_(),
|
|
361
|
+
propertyCount_(),
|
|
362
|
+
minProperties_(),
|
|
363
|
+
maxProperties_(SizeType(~0)),
|
|
364
|
+
additionalProperties_(true),
|
|
365
|
+
hasDependencies_(),
|
|
366
|
+
hasRequired_(),
|
|
367
|
+
hasSchemaDependencies_(),
|
|
368
|
+
additionalItemsSchema_(),
|
|
369
|
+
itemsList_(),
|
|
370
|
+
itemsTuple_(),
|
|
371
|
+
itemsTupleCount_(),
|
|
372
|
+
minItems_(),
|
|
373
|
+
maxItems_(SizeType(~0)),
|
|
374
|
+
additionalItems_(true),
|
|
375
|
+
uniqueItems_(false),
|
|
376
|
+
pattern_(),
|
|
377
|
+
minLength_(0),
|
|
378
|
+
maxLength_(~SizeType(0)),
|
|
379
|
+
exclusiveMinimum_(false),
|
|
380
|
+
exclusiveMaximum_(false)
|
|
381
|
+
{
|
|
382
|
+
typedef typename SchemaDocumentType::ValueType ValueType;
|
|
383
|
+
typedef typename ValueType::ConstValueIterator ConstValueIterator;
|
|
384
|
+
typedef typename ValueType::ConstMemberIterator ConstMemberIterator;
|
|
385
|
+
|
|
386
|
+
if (!value.IsObject())
|
|
387
|
+
return;
|
|
388
|
+
|
|
389
|
+
if (const ValueType* v = GetMember(value, GetTypeString())) {
|
|
390
|
+
type_ = 0;
|
|
391
|
+
if (v->IsString())
|
|
392
|
+
AddType(*v);
|
|
393
|
+
else if (v->IsArray())
|
|
394
|
+
for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr)
|
|
395
|
+
AddType(*itr);
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
if (const ValueType* v = GetMember(value, GetEnumString()))
|
|
399
|
+
if (v->IsArray() && v->Size() > 0) {
|
|
400
|
+
enum_ = static_cast<uint64_t*>(allocator_->Malloc(sizeof(uint64_t) * v->Size()));
|
|
401
|
+
for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) {
|
|
402
|
+
typedef Hasher<EncodingType, MemoryPoolAllocator<> > EnumHasherType;
|
|
403
|
+
char buffer[256 + 24];
|
|
404
|
+
MemoryPoolAllocator<> hasherAllocator(buffer, sizeof(buffer));
|
|
405
|
+
EnumHasherType h(&hasherAllocator, 256);
|
|
406
|
+
itr->Accept(h);
|
|
407
|
+
enum_[enumCount_++] = h.GetHashCode();
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
if (schemaDocument) {
|
|
412
|
+
AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document);
|
|
413
|
+
AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document);
|
|
414
|
+
AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document);
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
if (const ValueType* v = GetMember(value, GetNotString())) {
|
|
418
|
+
schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document);
|
|
419
|
+
notValidatorIndex_ = validatorCount_;
|
|
420
|
+
validatorCount_++;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
// Object
|
|
424
|
+
|
|
425
|
+
const ValueType* properties = GetMember(value, GetPropertiesString());
|
|
426
|
+
const ValueType* required = GetMember(value, GetRequiredString());
|
|
427
|
+
const ValueType* dependencies = GetMember(value, GetDependenciesString());
|
|
428
|
+
{
|
|
429
|
+
// Gather properties from properties/required/dependencies
|
|
430
|
+
SValue allProperties(kArrayType);
|
|
431
|
+
|
|
432
|
+
if (properties && properties->IsObject())
|
|
433
|
+
for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr)
|
|
434
|
+
AddUniqueElement(allProperties, itr->name);
|
|
435
|
+
|
|
436
|
+
if (required && required->IsArray())
|
|
437
|
+
for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
|
|
438
|
+
if (itr->IsString())
|
|
439
|
+
AddUniqueElement(allProperties, *itr);
|
|
440
|
+
|
|
441
|
+
if (dependencies && dependencies->IsObject())
|
|
442
|
+
for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
|
|
443
|
+
AddUniqueElement(allProperties, itr->name);
|
|
444
|
+
if (itr->value.IsArray())
|
|
445
|
+
for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i)
|
|
446
|
+
if (i->IsString())
|
|
447
|
+
AddUniqueElement(allProperties, *i);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
if (allProperties.Size() > 0) {
|
|
451
|
+
propertyCount_ = allProperties.Size();
|
|
452
|
+
properties_ = static_cast<Property*>(allocator_->Malloc(sizeof(Property) * propertyCount_));
|
|
453
|
+
for (SizeType i = 0; i < propertyCount_; i++) {
|
|
454
|
+
new (&properties_[i]) Property();
|
|
455
|
+
properties_[i].name = allProperties[i];
|
|
456
|
+
properties_[i].schema = GetTypeless();
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
if (properties && properties->IsObject()) {
|
|
462
|
+
PointerType q = p.Append(GetPropertiesString(), allocator_);
|
|
463
|
+
for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) {
|
|
464
|
+
SizeType index;
|
|
465
|
+
if (FindPropertyIndex(itr->name, &index))
|
|
466
|
+
schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) {
|
|
471
|
+
PointerType q = p.Append(GetPatternPropertiesString(), allocator_);
|
|
472
|
+
patternProperties_ = static_cast<PatternProperty*>(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount()));
|
|
473
|
+
patternPropertyCount_ = 0;
|
|
474
|
+
|
|
475
|
+
for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) {
|
|
476
|
+
new (&patternProperties_[patternPropertyCount_]) PatternProperty();
|
|
477
|
+
patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name);
|
|
478
|
+
schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, q.Append(itr->name, allocator_), itr->value, document);
|
|
479
|
+
patternPropertyCount_++;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (required && required->IsArray())
|
|
484
|
+
for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
|
|
485
|
+
if (itr->IsString()) {
|
|
486
|
+
SizeType index;
|
|
487
|
+
if (FindPropertyIndex(*itr, &index)) {
|
|
488
|
+
properties_[index].required = true;
|
|
489
|
+
hasRequired_ = true;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if (dependencies && dependencies->IsObject()) {
|
|
494
|
+
PointerType q = p.Append(GetDependenciesString(), allocator_);
|
|
495
|
+
hasDependencies_ = true;
|
|
496
|
+
for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
|
|
497
|
+
SizeType sourceIndex;
|
|
498
|
+
if (FindPropertyIndex(itr->name, &sourceIndex)) {
|
|
499
|
+
if (itr->value.IsArray()) {
|
|
500
|
+
properties_[sourceIndex].dependencies = static_cast<bool*>(allocator_->Malloc(sizeof(bool) * propertyCount_));
|
|
501
|
+
std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_);
|
|
502
|
+
for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) {
|
|
503
|
+
SizeType targetIndex;
|
|
504
|
+
if (FindPropertyIndex(*targetItr, &targetIndex))
|
|
505
|
+
properties_[sourceIndex].dependencies[targetIndex] = true;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
else if (itr->value.IsObject()) {
|
|
509
|
+
hasSchemaDependencies_ = true;
|
|
510
|
+
schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document);
|
|
511
|
+
properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_;
|
|
512
|
+
validatorCount_++;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) {
|
|
519
|
+
if (v->IsBool())
|
|
520
|
+
additionalProperties_ = v->GetBool();
|
|
521
|
+
else if (v->IsObject())
|
|
522
|
+
schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
AssignIfExist(minProperties_, value, GetMinPropertiesString());
|
|
526
|
+
AssignIfExist(maxProperties_, value, GetMaxPropertiesString());
|
|
527
|
+
|
|
528
|
+
// Array
|
|
529
|
+
if (const ValueType* v = GetMember(value, GetItemsString())) {
|
|
530
|
+
PointerType q = p.Append(GetItemsString(), allocator_);
|
|
531
|
+
if (v->IsObject()) // List validation
|
|
532
|
+
schemaDocument->CreateSchema(&itemsList_, q, *v, document);
|
|
533
|
+
else if (v->IsArray()) { // Tuple validation
|
|
534
|
+
itemsTuple_ = static_cast<const Schema**>(allocator_->Malloc(sizeof(const Schema*) * v->Size()));
|
|
535
|
+
SizeType index = 0;
|
|
536
|
+
for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++)
|
|
537
|
+
schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document);
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
AssignIfExist(minItems_, value, GetMinItemsString());
|
|
542
|
+
AssignIfExist(maxItems_, value, GetMaxItemsString());
|
|
543
|
+
|
|
544
|
+
if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) {
|
|
545
|
+
if (v->IsBool())
|
|
546
|
+
additionalItems_ = v->GetBool();
|
|
547
|
+
else if (v->IsObject())
|
|
548
|
+
schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
AssignIfExist(uniqueItems_, value, GetUniqueItemsString());
|
|
552
|
+
|
|
553
|
+
// String
|
|
554
|
+
AssignIfExist(minLength_, value, GetMinLengthString());
|
|
555
|
+
AssignIfExist(maxLength_, value, GetMaxLengthString());
|
|
556
|
+
|
|
557
|
+
if (const ValueType* v = GetMember(value, GetPatternString()))
|
|
558
|
+
pattern_ = CreatePattern(*v);
|
|
559
|
+
|
|
560
|
+
// Number
|
|
561
|
+
if (const ValueType* v = GetMember(value, GetMinimumString()))
|
|
562
|
+
if (v->IsNumber())
|
|
563
|
+
minimum_.CopyFrom(*v, *allocator_);
|
|
564
|
+
|
|
565
|
+
if (const ValueType* v = GetMember(value, GetMaximumString()))
|
|
566
|
+
if (v->IsNumber())
|
|
567
|
+
maximum_.CopyFrom(*v, *allocator_);
|
|
568
|
+
|
|
569
|
+
AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString());
|
|
570
|
+
AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString());
|
|
571
|
+
|
|
572
|
+
if (const ValueType* v = GetMember(value, GetMultipleOfString()))
|
|
573
|
+
if (v->IsNumber() && v->GetDouble() > 0.0)
|
|
574
|
+
multipleOf_.CopyFrom(*v, *allocator_);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
~Schema() {
|
|
578
|
+
if (allocator_) {
|
|
579
|
+
allocator_->Free(enum_);
|
|
580
|
+
}
|
|
581
|
+
if (properties_) {
|
|
582
|
+
for (SizeType i = 0; i < propertyCount_; i++)
|
|
583
|
+
properties_[i].~Property();
|
|
584
|
+
AllocatorType::Free(properties_);
|
|
585
|
+
}
|
|
586
|
+
if (patternProperties_) {
|
|
587
|
+
for (SizeType i = 0; i < patternPropertyCount_; i++)
|
|
588
|
+
patternProperties_[i].~PatternProperty();
|
|
589
|
+
AllocatorType::Free(patternProperties_);
|
|
590
|
+
}
|
|
591
|
+
AllocatorType::Free(itemsTuple_);
|
|
592
|
+
#if RAPIDJSON_SCHEMA_HAS_REGEX
|
|
593
|
+
if (pattern_) {
|
|
594
|
+
pattern_->~RegexType();
|
|
595
|
+
allocator_->Free(pattern_);
|
|
596
|
+
}
|
|
597
|
+
#endif
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
bool BeginValue(Context& context) const {
|
|
601
|
+
if (context.inArray) {
|
|
602
|
+
if (uniqueItems_)
|
|
603
|
+
context.valueUniqueness = true;
|
|
604
|
+
|
|
605
|
+
if (itemsList_)
|
|
606
|
+
context.valueSchema = itemsList_;
|
|
607
|
+
else if (itemsTuple_) {
|
|
608
|
+
if (context.arrayElementIndex < itemsTupleCount_)
|
|
609
|
+
context.valueSchema = itemsTuple_[context.arrayElementIndex];
|
|
610
|
+
else if (additionalItemsSchema_)
|
|
611
|
+
context.valueSchema = additionalItemsSchema_;
|
|
612
|
+
else if (additionalItems_)
|
|
613
|
+
context.valueSchema = GetTypeless();
|
|
614
|
+
else
|
|
615
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetItemsString());
|
|
616
|
+
}
|
|
617
|
+
else
|
|
618
|
+
context.valueSchema = GetTypeless();
|
|
619
|
+
|
|
620
|
+
context.arrayElementIndex++;
|
|
621
|
+
}
|
|
622
|
+
return true;
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const {
|
|
626
|
+
if (context.patternPropertiesValidatorCount > 0) {
|
|
627
|
+
bool otherValid = false;
|
|
628
|
+
SizeType count = context.patternPropertiesValidatorCount;
|
|
629
|
+
if (context.objectPatternValidatorType != Context::kPatternValidatorOnly)
|
|
630
|
+
otherValid = context.patternPropertiesValidators[--count]->IsValid();
|
|
631
|
+
|
|
632
|
+
bool patternValid = true;
|
|
633
|
+
for (SizeType i = 0; i < count; i++)
|
|
634
|
+
if (!context.patternPropertiesValidators[i]->IsValid()) {
|
|
635
|
+
patternValid = false;
|
|
636
|
+
break;
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) {
|
|
640
|
+
if (!patternValid)
|
|
641
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString());
|
|
642
|
+
}
|
|
643
|
+
else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) {
|
|
644
|
+
if (!patternValid || !otherValid)
|
|
645
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString());
|
|
646
|
+
}
|
|
647
|
+
else if (!patternValid && !otherValid) // kPatternValidatorWithAdditionalProperty)
|
|
648
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternPropertiesString());
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
if (enum_) {
|
|
652
|
+
const uint64_t h = context.factory.GetHashCode(context.hasher);
|
|
653
|
+
for (SizeType i = 0; i < enumCount_; i++)
|
|
654
|
+
if (enum_[i] == h)
|
|
655
|
+
goto foundEnum;
|
|
656
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetEnumString());
|
|
657
|
+
foundEnum:;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (allOf_.schemas)
|
|
661
|
+
for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++)
|
|
662
|
+
if (!context.validators[i]->IsValid())
|
|
663
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetAllOfString());
|
|
664
|
+
|
|
665
|
+
if (anyOf_.schemas) {
|
|
666
|
+
for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++)
|
|
667
|
+
if (context.validators[i]->IsValid())
|
|
668
|
+
goto foundAny;
|
|
669
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetAnyOfString());
|
|
670
|
+
foundAny:;
|
|
671
|
+
}
|
|
672
|
+
|
|
673
|
+
if (oneOf_.schemas) {
|
|
674
|
+
bool oneValid = false;
|
|
675
|
+
for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++)
|
|
676
|
+
if (context.validators[i]->IsValid()) {
|
|
677
|
+
if (oneValid)
|
|
678
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString());
|
|
679
|
+
else
|
|
680
|
+
oneValid = true;
|
|
681
|
+
}
|
|
682
|
+
if (!oneValid)
|
|
683
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetOneOfString());
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
if (not_ && context.validators[notValidatorIndex_]->IsValid())
|
|
687
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetNotString());
|
|
688
|
+
|
|
689
|
+
return true;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
bool Null(Context& context) const {
|
|
693
|
+
if (!(type_ & (1 << kNullSchemaType)))
|
|
694
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
695
|
+
return CreateParallelValidator(context);
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
bool Bool(Context& context, bool) const {
|
|
699
|
+
if (!(type_ & (1 << kBooleanSchemaType)))
|
|
700
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
701
|
+
return CreateParallelValidator(context);
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
bool Int(Context& context, int i) const {
|
|
705
|
+
if (!CheckInt(context, i))
|
|
706
|
+
return false;
|
|
707
|
+
return CreateParallelValidator(context);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
bool Uint(Context& context, unsigned u) const {
|
|
711
|
+
if (!CheckUint(context, u))
|
|
712
|
+
return false;
|
|
713
|
+
return CreateParallelValidator(context);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
bool Int64(Context& context, int64_t i) const {
|
|
717
|
+
if (!CheckInt(context, i))
|
|
718
|
+
return false;
|
|
719
|
+
return CreateParallelValidator(context);
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
bool Uint64(Context& context, uint64_t u) const {
|
|
723
|
+
if (!CheckUint(context, u))
|
|
724
|
+
return false;
|
|
725
|
+
return CreateParallelValidator(context);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
bool Double(Context& context, double d) const {
|
|
729
|
+
if (!(type_ & (1 << kNumberSchemaType)))
|
|
730
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
731
|
+
|
|
732
|
+
if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d))
|
|
733
|
+
return false;
|
|
734
|
+
|
|
735
|
+
if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d))
|
|
736
|
+
return false;
|
|
737
|
+
|
|
738
|
+
if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d))
|
|
739
|
+
return false;
|
|
740
|
+
|
|
741
|
+
return CreateParallelValidator(context);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
bool String(Context& context, const Ch* str, SizeType length, bool) const {
|
|
745
|
+
if (!(type_ & (1 << kStringSchemaType)))
|
|
746
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
747
|
+
|
|
748
|
+
if (minLength_ != 0 || maxLength_ != SizeType(~0)) {
|
|
749
|
+
SizeType count;
|
|
750
|
+
if (internal::CountStringCodePoint<EncodingType>(str, length, &count)) {
|
|
751
|
+
if (count < minLength_)
|
|
752
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinLengthString());
|
|
753
|
+
if (count > maxLength_)
|
|
754
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxLengthString());
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
if (pattern_ && !IsPatternMatch(pattern_, str, length))
|
|
759
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetPatternString());
|
|
760
|
+
|
|
761
|
+
return CreateParallelValidator(context);
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
bool StartObject(Context& context) const {
|
|
765
|
+
if (!(type_ & (1 << kObjectSchemaType)))
|
|
766
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
767
|
+
|
|
768
|
+
if (hasDependencies_ || hasRequired_) {
|
|
769
|
+
context.propertyExist = static_cast<bool*>(context.factory.MallocState(sizeof(bool) * propertyCount_));
|
|
770
|
+
std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_);
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
if (patternProperties_) { // pre-allocate schema array
|
|
774
|
+
SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType
|
|
775
|
+
context.patternPropertiesSchemas = static_cast<const SchemaType**>(context.factory.MallocState(sizeof(const SchemaType*) * count));
|
|
776
|
+
context.patternPropertiesSchemaCount = 0;
|
|
777
|
+
std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count);
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
return CreateParallelValidator(context);
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
bool Key(Context& context, const Ch* str, SizeType len, bool) const {
|
|
784
|
+
if (patternProperties_) {
|
|
785
|
+
context.patternPropertiesSchemaCount = 0;
|
|
786
|
+
for (SizeType i = 0; i < patternPropertyCount_; i++)
|
|
787
|
+
if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len))
|
|
788
|
+
context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
SizeType index;
|
|
792
|
+
if (FindPropertyIndex(ValueType(str, len).Move(), &index)) {
|
|
793
|
+
if (context.patternPropertiesSchemaCount > 0) {
|
|
794
|
+
context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema;
|
|
795
|
+
context.valueSchema = GetTypeless();
|
|
796
|
+
context.valuePatternValidatorType = Context::kPatternValidatorWithProperty;
|
|
797
|
+
}
|
|
798
|
+
else
|
|
799
|
+
context.valueSchema = properties_[index].schema;
|
|
800
|
+
|
|
801
|
+
if (context.propertyExist)
|
|
802
|
+
context.propertyExist[index] = true;
|
|
803
|
+
|
|
804
|
+
return true;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
if (additionalPropertiesSchema_) {
|
|
808
|
+
if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) {
|
|
809
|
+
context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_;
|
|
810
|
+
context.valueSchema = GetTypeless();
|
|
811
|
+
context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty;
|
|
812
|
+
}
|
|
813
|
+
else
|
|
814
|
+
context.valueSchema = additionalPropertiesSchema_;
|
|
815
|
+
return true;
|
|
816
|
+
}
|
|
817
|
+
else if (additionalProperties_) {
|
|
818
|
+
context.valueSchema = GetTypeless();
|
|
819
|
+
return true;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
if (context.patternPropertiesSchemaCount == 0) // patternProperties are not additional properties
|
|
823
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetAdditionalPropertiesString());
|
|
824
|
+
|
|
825
|
+
return true;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
bool EndObject(Context& context, SizeType memberCount) const {
|
|
829
|
+
if (hasRequired_)
|
|
830
|
+
for (SizeType index = 0; index < propertyCount_; index++)
|
|
831
|
+
if (properties_[index].required)
|
|
832
|
+
if (!context.propertyExist[index])
|
|
833
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetRequiredString());
|
|
834
|
+
|
|
835
|
+
if (memberCount < minProperties_)
|
|
836
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinPropertiesString());
|
|
837
|
+
|
|
838
|
+
if (memberCount > maxProperties_)
|
|
839
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxPropertiesString());
|
|
840
|
+
|
|
841
|
+
if (hasDependencies_) {
|
|
842
|
+
for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++)
|
|
843
|
+
if (context.propertyExist[sourceIndex]) {
|
|
844
|
+
if (properties_[sourceIndex].dependencies) {
|
|
845
|
+
for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++)
|
|
846
|
+
if (properties_[sourceIndex].dependencies[targetIndex] && !context.propertyExist[targetIndex])
|
|
847
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString());
|
|
848
|
+
}
|
|
849
|
+
else if (properties_[sourceIndex].dependenciesSchema)
|
|
850
|
+
if (!context.validators[properties_[sourceIndex].dependenciesValidatorIndex]->IsValid())
|
|
851
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetDependenciesString());
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
return true;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
bool StartArray(Context& context) const {
|
|
859
|
+
if (!(type_ & (1 << kArraySchemaType)))
|
|
860
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
861
|
+
|
|
862
|
+
context.arrayElementIndex = 0;
|
|
863
|
+
context.inArray = true;
|
|
864
|
+
|
|
865
|
+
return CreateParallelValidator(context);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
bool EndArray(Context& context, SizeType elementCount) const {
|
|
869
|
+
context.inArray = false;
|
|
870
|
+
|
|
871
|
+
if (elementCount < minItems_)
|
|
872
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinItemsString());
|
|
873
|
+
|
|
874
|
+
if (elementCount > maxItems_)
|
|
875
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaxItemsString());
|
|
876
|
+
|
|
877
|
+
return true;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
// Generate functions for string literal according to Ch
|
|
881
|
+
#define RAPIDJSON_STRING_(name, ...) \
|
|
882
|
+
static const ValueType& Get##name##String() {\
|
|
883
|
+
static const Ch s[] = { __VA_ARGS__, '\0' };\
|
|
884
|
+
static const ValueType v(s, sizeof(s) / sizeof(Ch) - 1);\
|
|
885
|
+
return v;\
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l')
|
|
889
|
+
RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n')
|
|
890
|
+
RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't')
|
|
891
|
+
RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y')
|
|
892
|
+
RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g')
|
|
893
|
+
RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r')
|
|
894
|
+
RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r')
|
|
895
|
+
RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e')
|
|
896
|
+
RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm')
|
|
897
|
+
RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f')
|
|
898
|
+
RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f')
|
|
899
|
+
RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f')
|
|
900
|
+
RAPIDJSON_STRING_(Not, 'n', 'o', 't')
|
|
901
|
+
RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
|
|
902
|
+
RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd')
|
|
903
|
+
RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's')
|
|
904
|
+
RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
|
|
905
|
+
RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
|
|
906
|
+
RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
|
|
907
|
+
RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
|
|
908
|
+
RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's')
|
|
909
|
+
RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's')
|
|
910
|
+
RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's')
|
|
911
|
+
RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's')
|
|
912
|
+
RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's')
|
|
913
|
+
RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h')
|
|
914
|
+
RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h')
|
|
915
|
+
RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n')
|
|
916
|
+
RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm')
|
|
917
|
+
RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm')
|
|
918
|
+
RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm')
|
|
919
|
+
RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm')
|
|
920
|
+
RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f')
|
|
921
|
+
|
|
922
|
+
#undef RAPIDJSON_STRING_
|
|
923
|
+
|
|
924
|
+
private:
|
|
925
|
+
enum SchemaValueType {
|
|
926
|
+
kNullSchemaType,
|
|
927
|
+
kBooleanSchemaType,
|
|
928
|
+
kObjectSchemaType,
|
|
929
|
+
kArraySchemaType,
|
|
930
|
+
kStringSchemaType,
|
|
931
|
+
kNumberSchemaType,
|
|
932
|
+
kIntegerSchemaType,
|
|
933
|
+
kTotalSchemaType
|
|
934
|
+
};
|
|
935
|
+
|
|
936
|
+
#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
|
|
937
|
+
typedef internal::GenericRegex<EncodingType> RegexType;
|
|
938
|
+
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
|
|
939
|
+
typedef std::basic_regex<Ch> RegexType;
|
|
940
|
+
#else
|
|
941
|
+
typedef char RegexType;
|
|
942
|
+
#endif
|
|
943
|
+
|
|
944
|
+
struct SchemaArray {
|
|
945
|
+
SchemaArray() : schemas(), count() {}
|
|
946
|
+
~SchemaArray() { AllocatorType::Free(schemas); }
|
|
947
|
+
const SchemaType** schemas;
|
|
948
|
+
SizeType begin; // begin index of context.validators
|
|
949
|
+
SizeType count;
|
|
950
|
+
};
|
|
951
|
+
|
|
952
|
+
static const SchemaType* GetTypeless() {
|
|
953
|
+
static SchemaType typeless(0, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), 0);
|
|
954
|
+
return &typeless;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
template <typename V1, typename V2>
|
|
958
|
+
void AddUniqueElement(V1& a, const V2& v) {
|
|
959
|
+
for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
|
|
960
|
+
if (*itr == v)
|
|
961
|
+
return;
|
|
962
|
+
V1 c(v, *allocator_);
|
|
963
|
+
a.PushBack(c, *allocator_);
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
static const ValueType* GetMember(const ValueType& value, const ValueType& name) {
|
|
967
|
+
typename ValueType::ConstMemberIterator itr = value.FindMember(name);
|
|
968
|
+
return itr != value.MemberEnd() ? &(itr->value) : 0;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) {
|
|
972
|
+
if (const ValueType* v = GetMember(value, name))
|
|
973
|
+
if (v->IsBool())
|
|
974
|
+
out = v->GetBool();
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) {
|
|
978
|
+
if (const ValueType* v = GetMember(value, name))
|
|
979
|
+
if (v->IsUint64() && v->GetUint64() <= SizeType(~0))
|
|
980
|
+
out = static_cast<SizeType>(v->GetUint64());
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) {
|
|
984
|
+
if (const ValueType* v = GetMember(value, name)) {
|
|
985
|
+
if (v->IsArray() && v->Size() > 0) {
|
|
986
|
+
PointerType q = p.Append(name, allocator_);
|
|
987
|
+
out.count = v->Size();
|
|
988
|
+
out.schemas = static_cast<const Schema**>(allocator_->Malloc(out.count * sizeof(const Schema*)));
|
|
989
|
+
memset(out.schemas, 0, sizeof(Schema*)* out.count);
|
|
990
|
+
for (SizeType i = 0; i < out.count; i++)
|
|
991
|
+
schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document);
|
|
992
|
+
out.begin = validatorCount_;
|
|
993
|
+
validatorCount_ += out.count;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
|
|
999
|
+
template <typename ValueType>
|
|
1000
|
+
RegexType* CreatePattern(const ValueType& value) {
|
|
1001
|
+
if (value.IsString()) {
|
|
1002
|
+
RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString());
|
|
1003
|
+
if (!r->IsValid()) {
|
|
1004
|
+
r->~RegexType();
|
|
1005
|
+
AllocatorType::Free(r);
|
|
1006
|
+
r = 0;
|
|
1007
|
+
}
|
|
1008
|
+
return r;
|
|
1009
|
+
}
|
|
1010
|
+
return 0;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) {
|
|
1014
|
+
return pattern->Search(str);
|
|
1015
|
+
}
|
|
1016
|
+
#elif RAPIDJSON_SCHEMA_USE_STDREGEX
|
|
1017
|
+
template <typename ValueType>
|
|
1018
|
+
RegexType* CreatePattern(const ValueType& value) {
|
|
1019
|
+
if (value.IsString())
|
|
1020
|
+
try {
|
|
1021
|
+
return new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
|
|
1022
|
+
}
|
|
1023
|
+
catch (const std::regex_error&) {
|
|
1024
|
+
}
|
|
1025
|
+
return 0;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) {
|
|
1029
|
+
std::match_results<const Ch*> r;
|
|
1030
|
+
return std::regex_search(str, str + length, r, *pattern);
|
|
1031
|
+
}
|
|
1032
|
+
#else
|
|
1033
|
+
template <typename ValueType>
|
|
1034
|
+
RegexType* CreatePattern(const ValueType&) { return 0; }
|
|
1035
|
+
|
|
1036
|
+
static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; }
|
|
1037
|
+
#endif // RAPIDJSON_SCHEMA_USE_STDREGEX
|
|
1038
|
+
|
|
1039
|
+
void AddType(const ValueType& type) {
|
|
1040
|
+
if (type == GetNullString() ) type_ |= 1 << kNullSchemaType;
|
|
1041
|
+
else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType;
|
|
1042
|
+
else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType;
|
|
1043
|
+
else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType;
|
|
1044
|
+
else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType;
|
|
1045
|
+
else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType;
|
|
1046
|
+
else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType);
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
bool CreateParallelValidator(Context& context) const {
|
|
1050
|
+
if (enum_ || context.arrayUniqueness)
|
|
1051
|
+
context.hasher = context.factory.CreateHasher();
|
|
1052
|
+
|
|
1053
|
+
if (validatorCount_) {
|
|
1054
|
+
RAPIDJSON_ASSERT(context.validators == 0);
|
|
1055
|
+
context.validators = static_cast<ISchemaValidator**>(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_));
|
|
1056
|
+
context.validatorCount = validatorCount_;
|
|
1057
|
+
|
|
1058
|
+
if (allOf_.schemas)
|
|
1059
|
+
CreateSchemaValidators(context, allOf_);
|
|
1060
|
+
|
|
1061
|
+
if (anyOf_.schemas)
|
|
1062
|
+
CreateSchemaValidators(context, anyOf_);
|
|
1063
|
+
|
|
1064
|
+
if (oneOf_.schemas)
|
|
1065
|
+
CreateSchemaValidators(context, oneOf_);
|
|
1066
|
+
|
|
1067
|
+
if (not_)
|
|
1068
|
+
context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_);
|
|
1069
|
+
|
|
1070
|
+
if (hasSchemaDependencies_) {
|
|
1071
|
+
for (SizeType i = 0; i < propertyCount_; i++)
|
|
1072
|
+
if (properties_[i].dependenciesSchema)
|
|
1073
|
+
context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
return true;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
void CreateSchemaValidators(Context& context, const SchemaArray& schemas) const {
|
|
1081
|
+
for (SizeType i = 0; i < schemas.count; i++)
|
|
1082
|
+
context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i]);
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
// O(n)
|
|
1086
|
+
bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const {
|
|
1087
|
+
SizeType len = name.GetStringLength();
|
|
1088
|
+
const Ch* str = name.GetString();
|
|
1089
|
+
for (SizeType index = 0; index < propertyCount_; index++)
|
|
1090
|
+
if (properties_[index].name.GetStringLength() == len &&
|
|
1091
|
+
(std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0))
|
|
1092
|
+
{
|
|
1093
|
+
*outIndex = index;
|
|
1094
|
+
return true;
|
|
1095
|
+
}
|
|
1096
|
+
return false;
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
bool CheckInt(Context& context, int64_t i) const {
|
|
1100
|
+
if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType))))
|
|
1101
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
1102
|
+
|
|
1103
|
+
if (!minimum_.IsNull()) {
|
|
1104
|
+
if (minimum_.IsInt64()) {
|
|
1105
|
+
if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64())
|
|
1106
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString());
|
|
1107
|
+
}
|
|
1108
|
+
else if (minimum_.IsUint64()) {
|
|
1109
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString()); // i <= max(int64_t) < minimum.GetUint64()
|
|
1110
|
+
}
|
|
1111
|
+
else if (!CheckDoubleMinimum(context, static_cast<double>(i)))
|
|
1112
|
+
return false;
|
|
1113
|
+
}
|
|
1114
|
+
|
|
1115
|
+
if (!maximum_.IsNull()) {
|
|
1116
|
+
if (maximum_.IsInt64()) {
|
|
1117
|
+
if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64())
|
|
1118
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString());
|
|
1119
|
+
}
|
|
1120
|
+
else if (maximum_.IsUint64())
|
|
1121
|
+
/* do nothing */; // i <= max(int64_t) < maximum_.GetUint64()
|
|
1122
|
+
else if (!CheckDoubleMaximum(context, static_cast<double>(i)))
|
|
1123
|
+
return false;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
if (!multipleOf_.IsNull()) {
|
|
1127
|
+
if (multipleOf_.IsUint64()) {
|
|
1128
|
+
if (static_cast<uint64_t>(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0)
|
|
1129
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString());
|
|
1130
|
+
}
|
|
1131
|
+
else if (!CheckDoubleMultipleOf(context, static_cast<double>(i)))
|
|
1132
|
+
return false;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
return true;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
bool CheckUint(Context& context, uint64_t i) const {
|
|
1139
|
+
if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType))))
|
|
1140
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetTypeString());
|
|
1141
|
+
|
|
1142
|
+
if (!minimum_.IsNull()) {
|
|
1143
|
+
if (minimum_.IsUint64()) {
|
|
1144
|
+
if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64())
|
|
1145
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString());
|
|
1146
|
+
}
|
|
1147
|
+
else if (minimum_.IsInt64())
|
|
1148
|
+
/* do nothing */; // i >= 0 > minimum.Getint64()
|
|
1149
|
+
else if (!CheckDoubleMinimum(context, static_cast<double>(i)))
|
|
1150
|
+
return false;
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
if (!maximum_.IsNull()) {
|
|
1154
|
+
if (maximum_.IsUint64()) {
|
|
1155
|
+
if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64())
|
|
1156
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString());
|
|
1157
|
+
}
|
|
1158
|
+
else if (maximum_.IsInt64())
|
|
1159
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString()); // i >= 0 > maximum_
|
|
1160
|
+
else if (!CheckDoubleMaximum(context, static_cast<double>(i)))
|
|
1161
|
+
return false;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
if (!multipleOf_.IsNull()) {
|
|
1165
|
+
if (multipleOf_.IsUint64()) {
|
|
1166
|
+
if (i % multipleOf_.GetUint64() != 0)
|
|
1167
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString());
|
|
1168
|
+
}
|
|
1169
|
+
else if (!CheckDoubleMultipleOf(context, static_cast<double>(i)))
|
|
1170
|
+
return false;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
return true;
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
bool CheckDoubleMinimum(Context& context, double d) const {
|
|
1177
|
+
if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble())
|
|
1178
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMinimumString());
|
|
1179
|
+
return true;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
bool CheckDoubleMaximum(Context& context, double d) const {
|
|
1183
|
+
if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble())
|
|
1184
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMaximumString());
|
|
1185
|
+
return true;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
bool CheckDoubleMultipleOf(Context& context, double d) const {
|
|
1189
|
+
double a = std::abs(d), b = std::abs(multipleOf_.GetDouble());
|
|
1190
|
+
double q = std::floor(a / b);
|
|
1191
|
+
double r = a - q * b;
|
|
1192
|
+
if (r > 0.0)
|
|
1193
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(GetMultipleOfString());
|
|
1194
|
+
return true;
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
struct Property {
|
|
1198
|
+
Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {}
|
|
1199
|
+
~Property() { AllocatorType::Free(dependencies); }
|
|
1200
|
+
SValue name;
|
|
1201
|
+
const SchemaType* schema;
|
|
1202
|
+
const SchemaType* dependenciesSchema;
|
|
1203
|
+
SizeType dependenciesValidatorIndex;
|
|
1204
|
+
bool* dependencies;
|
|
1205
|
+
bool required;
|
|
1206
|
+
};
|
|
1207
|
+
|
|
1208
|
+
struct PatternProperty {
|
|
1209
|
+
PatternProperty() : schema(), pattern() {}
|
|
1210
|
+
~PatternProperty() {
|
|
1211
|
+
if (pattern) {
|
|
1212
|
+
pattern->~RegexType();
|
|
1213
|
+
AllocatorType::Free(pattern);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
const SchemaType* schema;
|
|
1217
|
+
RegexType* pattern;
|
|
1218
|
+
};
|
|
1219
|
+
|
|
1220
|
+
AllocatorType* allocator_;
|
|
1221
|
+
uint64_t* enum_;
|
|
1222
|
+
SizeType enumCount_;
|
|
1223
|
+
SchemaArray allOf_;
|
|
1224
|
+
SchemaArray anyOf_;
|
|
1225
|
+
SchemaArray oneOf_;
|
|
1226
|
+
const SchemaType* not_;
|
|
1227
|
+
unsigned type_; // bitmask of kSchemaType
|
|
1228
|
+
SizeType validatorCount_;
|
|
1229
|
+
SizeType notValidatorIndex_;
|
|
1230
|
+
|
|
1231
|
+
Property* properties_;
|
|
1232
|
+
const SchemaType* additionalPropertiesSchema_;
|
|
1233
|
+
PatternProperty* patternProperties_;
|
|
1234
|
+
SizeType patternPropertyCount_;
|
|
1235
|
+
SizeType propertyCount_;
|
|
1236
|
+
SizeType minProperties_;
|
|
1237
|
+
SizeType maxProperties_;
|
|
1238
|
+
bool additionalProperties_;
|
|
1239
|
+
bool hasDependencies_;
|
|
1240
|
+
bool hasRequired_;
|
|
1241
|
+
bool hasSchemaDependencies_;
|
|
1242
|
+
|
|
1243
|
+
const SchemaType* additionalItemsSchema_;
|
|
1244
|
+
const SchemaType* itemsList_;
|
|
1245
|
+
const SchemaType** itemsTuple_;
|
|
1246
|
+
SizeType itemsTupleCount_;
|
|
1247
|
+
SizeType minItems_;
|
|
1248
|
+
SizeType maxItems_;
|
|
1249
|
+
bool additionalItems_;
|
|
1250
|
+
bool uniqueItems_;
|
|
1251
|
+
|
|
1252
|
+
RegexType* pattern_;
|
|
1253
|
+
SizeType minLength_;
|
|
1254
|
+
SizeType maxLength_;
|
|
1255
|
+
|
|
1256
|
+
SValue minimum_;
|
|
1257
|
+
SValue maximum_;
|
|
1258
|
+
SValue multipleOf_;
|
|
1259
|
+
bool exclusiveMinimum_;
|
|
1260
|
+
bool exclusiveMaximum_;
|
|
1261
|
+
};
|
|
1262
|
+
|
|
1263
|
+
template<typename Stack, typename Ch>
|
|
1264
|
+
struct TokenHelper {
|
|
1265
|
+
RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
|
|
1266
|
+
*documentStack.template Push<Ch>() = '/';
|
|
1267
|
+
char buffer[21];
|
|
1268
|
+
size_t length = static_cast<size_t>((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer);
|
|
1269
|
+
for (size_t i = 0; i < length; i++)
|
|
1270
|
+
*documentStack.template Push<Ch>() = buffer[i];
|
|
1271
|
+
}
|
|
1272
|
+
};
|
|
1273
|
+
|
|
1274
|
+
// Partial specialized version for char to prevent buffer copying.
|
|
1275
|
+
template <typename Stack>
|
|
1276
|
+
struct TokenHelper<Stack, char> {
|
|
1277
|
+
RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
|
|
1278
|
+
if (sizeof(SizeType) == 4) {
|
|
1279
|
+
char *buffer = documentStack.template Push<char>(1 + 10); // '/' + uint
|
|
1280
|
+
*buffer++ = '/';
|
|
1281
|
+
const char* end = internal::u32toa(index, buffer);
|
|
1282
|
+
documentStack.template Pop<char>(static_cast<size_t>(10 - (end - buffer)));
|
|
1283
|
+
}
|
|
1284
|
+
else {
|
|
1285
|
+
char *buffer = documentStack.template Push<char>(1 + 20); // '/' + uint64
|
|
1286
|
+
*buffer++ = '/';
|
|
1287
|
+
const char* end = internal::u64toa(index, buffer);
|
|
1288
|
+
documentStack.template Pop<char>(static_cast<size_t>(20 - (end - buffer)));
|
|
1289
|
+
}
|
|
1290
|
+
}
|
|
1291
|
+
};
|
|
1292
|
+
|
|
1293
|
+
} // namespace internal
|
|
1294
|
+
|
|
1295
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
1296
|
+
// IGenericRemoteSchemaDocumentProvider
|
|
1297
|
+
|
|
1298
|
+
template <typename SchemaDocumentType>
|
|
1299
|
+
class IGenericRemoteSchemaDocumentProvider {
|
|
1300
|
+
public:
|
|
1301
|
+
typedef typename SchemaDocumentType::Ch Ch;
|
|
1302
|
+
|
|
1303
|
+
virtual ~IGenericRemoteSchemaDocumentProvider() {}
|
|
1304
|
+
virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0;
|
|
1305
|
+
};
|
|
1306
|
+
|
|
1307
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
1308
|
+
// GenericSchemaDocument
|
|
1309
|
+
|
|
1310
|
+
//! JSON schema document.
|
|
1311
|
+
/*!
|
|
1312
|
+
A JSON schema document is a compiled version of a JSON schema.
|
|
1313
|
+
It is basically a tree of internal::Schema.
|
|
1314
|
+
|
|
1315
|
+
\note This is an immutable class (i.e. its instance cannot be modified after construction).
|
|
1316
|
+
\tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding.
|
|
1317
|
+
\tparam Allocator Allocator type for allocating memory of this document.
|
|
1318
|
+
*/
|
|
1319
|
+
template <typename ValueT, typename Allocator = CrtAllocator>
|
|
1320
|
+
class GenericSchemaDocument {
|
|
1321
|
+
public:
|
|
1322
|
+
typedef ValueT ValueType;
|
|
1323
|
+
typedef IGenericRemoteSchemaDocumentProvider<GenericSchemaDocument> IRemoteSchemaDocumentProviderType;
|
|
1324
|
+
typedef Allocator AllocatorType;
|
|
1325
|
+
typedef typename ValueType::EncodingType EncodingType;
|
|
1326
|
+
typedef typename EncodingType::Ch Ch;
|
|
1327
|
+
typedef internal::Schema<GenericSchemaDocument> SchemaType;
|
|
1328
|
+
typedef GenericPointer<ValueType, Allocator> PointerType;
|
|
1329
|
+
friend class internal::Schema<GenericSchemaDocument>;
|
|
1330
|
+
template <typename, typename, typename>
|
|
1331
|
+
friend class GenericSchemaValidator;
|
|
1332
|
+
|
|
1333
|
+
//! Constructor.
|
|
1334
|
+
/*!
|
|
1335
|
+
Compile a JSON document into schema document.
|
|
1336
|
+
|
|
1337
|
+
\param document A JSON document as source.
|
|
1338
|
+
\param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null.
|
|
1339
|
+
\param allocator An optional allocator instance for allocating memory. Can be null.
|
|
1340
|
+
*/
|
|
1341
|
+
explicit GenericSchemaDocument(const ValueType& document, IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) :
|
|
1342
|
+
remoteProvider_(remoteProvider),
|
|
1343
|
+
allocator_(allocator),
|
|
1344
|
+
ownAllocator_(),
|
|
1345
|
+
root_(),
|
|
1346
|
+
schemaMap_(allocator, kInitialSchemaMapSize),
|
|
1347
|
+
schemaRef_(allocator, kInitialSchemaRefSize)
|
|
1348
|
+
{
|
|
1349
|
+
if (!allocator_)
|
|
1350
|
+
ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator());
|
|
1351
|
+
|
|
1352
|
+
// Generate root schema, it will call CreateSchema() to create sub-schemas,
|
|
1353
|
+
// And call AddRefSchema() if there are $ref.
|
|
1354
|
+
CreateSchemaRecursive(&root_, PointerType(), document, document);
|
|
1355
|
+
|
|
1356
|
+
// Resolve $ref
|
|
1357
|
+
while (!schemaRef_.Empty()) {
|
|
1358
|
+
SchemaRefEntry* refEntry = schemaRef_.template Pop<SchemaRefEntry>(1);
|
|
1359
|
+
if (const SchemaType* s = GetSchema(refEntry->target)) {
|
|
1360
|
+
if (refEntry->schema)
|
|
1361
|
+
*refEntry->schema = s;
|
|
1362
|
+
|
|
1363
|
+
// Create entry in map if not exist
|
|
1364
|
+
if (!GetSchema(refEntry->source)) {
|
|
1365
|
+
new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(refEntry->source, const_cast<SchemaType*>(s), false, allocator_);
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
refEntry->~SchemaRefEntry();
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
RAPIDJSON_ASSERT(root_ != 0);
|
|
1372
|
+
|
|
1373
|
+
schemaRef_.ShrinkToFit(); // Deallocate all memory for ref
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
|
|
1377
|
+
//! Move constructor in C++11
|
|
1378
|
+
GenericSchemaDocument(GenericSchemaDocument&& rhs) RAPIDJSON_NOEXCEPT :
|
|
1379
|
+
remoteProvider_(rhs.remoteProvider_),
|
|
1380
|
+
allocator_(rhs.allocator_),
|
|
1381
|
+
ownAllocator_(rhs.ownAllocator_),
|
|
1382
|
+
root_(rhs.root_),
|
|
1383
|
+
schemaMap_(std::move(rhs.schemaMap_)),
|
|
1384
|
+
schemaRef_(std::move(rhs.schemaRef_))
|
|
1385
|
+
{
|
|
1386
|
+
rhs.remoteProvider_ = 0;
|
|
1387
|
+
rhs.allocator_ = 0;
|
|
1388
|
+
rhs.ownAllocator_ = 0;
|
|
1389
|
+
}
|
|
1390
|
+
#endif
|
|
1391
|
+
|
|
1392
|
+
//! Destructor
|
|
1393
|
+
~GenericSchemaDocument() {
|
|
1394
|
+
while (!schemaMap_.Empty())
|
|
1395
|
+
schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry();
|
|
1396
|
+
|
|
1397
|
+
RAPIDJSON_DELETE(ownAllocator_);
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
//! Get the root schema.
|
|
1401
|
+
const SchemaType& GetRoot() const { return *root_; }
|
|
1402
|
+
|
|
1403
|
+
private:
|
|
1404
|
+
//! Prohibit copying
|
|
1405
|
+
GenericSchemaDocument(const GenericSchemaDocument&);
|
|
1406
|
+
//! Prohibit assignment
|
|
1407
|
+
GenericSchemaDocument& operator=(const GenericSchemaDocument&);
|
|
1408
|
+
|
|
1409
|
+
struct SchemaRefEntry {
|
|
1410
|
+
SchemaRefEntry(const PointerType& s, const PointerType& t, const SchemaType** outSchema, Allocator *allocator) : source(s, allocator), target(t, allocator), schema(outSchema) {}
|
|
1411
|
+
PointerType source;
|
|
1412
|
+
PointerType target;
|
|
1413
|
+
const SchemaType** schema;
|
|
1414
|
+
};
|
|
1415
|
+
|
|
1416
|
+
struct SchemaEntry {
|
|
1417
|
+
SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {}
|
|
1418
|
+
~SchemaEntry() {
|
|
1419
|
+
if (owned) {
|
|
1420
|
+
schema->~SchemaType();
|
|
1421
|
+
Allocator::Free(schema);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
PointerType pointer;
|
|
1425
|
+
SchemaType* schema;
|
|
1426
|
+
bool owned;
|
|
1427
|
+
};
|
|
1428
|
+
|
|
1429
|
+
void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) {
|
|
1430
|
+
if (schema)
|
|
1431
|
+
*schema = SchemaType::GetTypeless();
|
|
1432
|
+
|
|
1433
|
+
if (v.GetType() == kObjectType) {
|
|
1434
|
+
const SchemaType* s = GetSchema(pointer);
|
|
1435
|
+
if (!s)
|
|
1436
|
+
CreateSchema(schema, pointer, v, document);
|
|
1437
|
+
|
|
1438
|
+
for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr)
|
|
1439
|
+
CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document);
|
|
1440
|
+
}
|
|
1441
|
+
else if (v.GetType() == kArrayType)
|
|
1442
|
+
for (SizeType i = 0; i < v.Size(); i++)
|
|
1443
|
+
CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document);
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
void CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document) {
|
|
1447
|
+
RAPIDJSON_ASSERT(pointer.IsValid());
|
|
1448
|
+
if (v.IsObject()) {
|
|
1449
|
+
if (!HandleRefSchema(pointer, schema, v, document)) {
|
|
1450
|
+
SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_);
|
|
1451
|
+
new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(pointer, s, true, allocator_);
|
|
1452
|
+
if (schema)
|
|
1453
|
+
*schema = s;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
|
|
1458
|
+
bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document) {
|
|
1459
|
+
static const Ch kRefString[] = { '$', 'r', 'e', 'f', '\0' };
|
|
1460
|
+
static const ValueType kRefValue(kRefString, 4);
|
|
1461
|
+
|
|
1462
|
+
typename ValueType::ConstMemberIterator itr = v.FindMember(kRefValue);
|
|
1463
|
+
if (itr == v.MemberEnd())
|
|
1464
|
+
return false;
|
|
1465
|
+
|
|
1466
|
+
if (itr->value.IsString()) {
|
|
1467
|
+
SizeType len = itr->value.GetStringLength();
|
|
1468
|
+
if (len > 0) {
|
|
1469
|
+
const Ch* s = itr->value.GetString();
|
|
1470
|
+
SizeType i = 0;
|
|
1471
|
+
while (i < len && s[i] != '#') // Find the first #
|
|
1472
|
+
i++;
|
|
1473
|
+
|
|
1474
|
+
if (i > 0) { // Remote reference, resolve immediately
|
|
1475
|
+
if (remoteProvider_) {
|
|
1476
|
+
if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(s, i - 1)) {
|
|
1477
|
+
PointerType pointer(&s[i], len - i, allocator_);
|
|
1478
|
+
if (pointer.IsValid()) {
|
|
1479
|
+
if (const SchemaType* sc = remoteDocument->GetSchema(pointer)) {
|
|
1480
|
+
if (schema)
|
|
1481
|
+
*schema = sc;
|
|
1482
|
+
return true;
|
|
1483
|
+
}
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
else if (s[i] == '#') { // Local reference, defer resolution
|
|
1489
|
+
PointerType pointer(&s[i], len - i, allocator_);
|
|
1490
|
+
if (pointer.IsValid()) {
|
|
1491
|
+
if (const ValueType* nv = pointer.Get(document))
|
|
1492
|
+
if (HandleRefSchema(source, schema, *nv, document))
|
|
1493
|
+
return true;
|
|
1494
|
+
|
|
1495
|
+
new (schemaRef_.template Push<SchemaRefEntry>()) SchemaRefEntry(source, pointer, schema, allocator_);
|
|
1496
|
+
return true;
|
|
1497
|
+
}
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
return false;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
const SchemaType* GetSchema(const PointerType& pointer) const {
|
|
1505
|
+
for (const SchemaEntry* target = schemaMap_.template Bottom<SchemaEntry>(); target != schemaMap_.template End<SchemaEntry>(); ++target)
|
|
1506
|
+
if (pointer == target->pointer)
|
|
1507
|
+
return target->schema;
|
|
1508
|
+
return 0;
|
|
1509
|
+
}
|
|
1510
|
+
|
|
1511
|
+
PointerType GetPointer(const SchemaType* schema) const {
|
|
1512
|
+
for (const SchemaEntry* target = schemaMap_.template Bottom<SchemaEntry>(); target != schemaMap_.template End<SchemaEntry>(); ++target)
|
|
1513
|
+
if (schema == target->schema)
|
|
1514
|
+
return target->pointer;
|
|
1515
|
+
return PointerType();
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
static const size_t kInitialSchemaMapSize = 64;
|
|
1519
|
+
static const size_t kInitialSchemaRefSize = 64;
|
|
1520
|
+
|
|
1521
|
+
IRemoteSchemaDocumentProviderType* remoteProvider_;
|
|
1522
|
+
Allocator *allocator_;
|
|
1523
|
+
Allocator *ownAllocator_;
|
|
1524
|
+
const SchemaType* root_; //!< Root schema.
|
|
1525
|
+
internal::Stack<Allocator> schemaMap_; // Stores created Pointer -> Schemas
|
|
1526
|
+
internal::Stack<Allocator> schemaRef_; // Stores Pointer from $ref and schema which holds the $ref
|
|
1527
|
+
};
|
|
1528
|
+
|
|
1529
|
+
//! GenericSchemaDocument using Value type.
|
|
1530
|
+
typedef GenericSchemaDocument<Value> SchemaDocument;
|
|
1531
|
+
//! IGenericRemoteSchemaDocumentProvider using SchemaDocument.
|
|
1532
|
+
typedef IGenericRemoteSchemaDocumentProvider<SchemaDocument> IRemoteSchemaDocumentProvider;
|
|
1533
|
+
|
|
1534
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
1535
|
+
// GenericSchemaValidator
|
|
1536
|
+
|
|
1537
|
+
//! JSON Schema Validator.
|
|
1538
|
+
/*!
|
|
1539
|
+
A SAX style JSON schema validator.
|
|
1540
|
+
It uses a \c GenericSchemaDocument to validate SAX events.
|
|
1541
|
+
It delegates the incoming SAX events to an output handler.
|
|
1542
|
+
The default output handler does nothing.
|
|
1543
|
+
It can be reused multiple times by calling \c Reset().
|
|
1544
|
+
|
|
1545
|
+
\tparam SchemaDocumentType Type of schema document.
|
|
1546
|
+
\tparam OutputHandler Type of output handler. Default handler does nothing.
|
|
1547
|
+
\tparam StateAllocator Allocator for storing the internal validation states.
|
|
1548
|
+
*/
|
|
1549
|
+
template <
|
|
1550
|
+
typename SchemaDocumentType,
|
|
1551
|
+
typename OutputHandler = BaseReaderHandler<typename SchemaDocumentType::SchemaType::EncodingType>,
|
|
1552
|
+
typename StateAllocator = CrtAllocator>
|
|
1553
|
+
class GenericSchemaValidator :
|
|
1554
|
+
public internal::ISchemaStateFactory<typename SchemaDocumentType::SchemaType>,
|
|
1555
|
+
public internal::ISchemaValidator
|
|
1556
|
+
{
|
|
1557
|
+
public:
|
|
1558
|
+
typedef typename SchemaDocumentType::SchemaType SchemaType;
|
|
1559
|
+
typedef typename SchemaDocumentType::PointerType PointerType;
|
|
1560
|
+
typedef typename SchemaType::EncodingType EncodingType;
|
|
1561
|
+
typedef typename EncodingType::Ch Ch;
|
|
1562
|
+
|
|
1563
|
+
//! Constructor without output handler.
|
|
1564
|
+
/*!
|
|
1565
|
+
\param schemaDocument The schema document to conform to.
|
|
1566
|
+
\param allocator Optional allocator for storing internal validation states.
|
|
1567
|
+
\param schemaStackCapacity Optional initial capacity of schema path stack.
|
|
1568
|
+
\param documentStackCapacity Optional initial capacity of document path stack.
|
|
1569
|
+
*/
|
|
1570
|
+
GenericSchemaValidator(
|
|
1571
|
+
const SchemaDocumentType& schemaDocument,
|
|
1572
|
+
StateAllocator* allocator = 0,
|
|
1573
|
+
size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
|
|
1574
|
+
size_t documentStackCapacity = kDefaultDocumentStackCapacity)
|
|
1575
|
+
:
|
|
1576
|
+
schemaDocument_(&schemaDocument),
|
|
1577
|
+
root_(schemaDocument.GetRoot()),
|
|
1578
|
+
outputHandler_(GetNullHandler()),
|
|
1579
|
+
stateAllocator_(allocator),
|
|
1580
|
+
ownStateAllocator_(0),
|
|
1581
|
+
schemaStack_(allocator, schemaStackCapacity),
|
|
1582
|
+
documentStack_(allocator, documentStackCapacity),
|
|
1583
|
+
valid_(true)
|
|
1584
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1585
|
+
, depth_(0)
|
|
1586
|
+
#endif
|
|
1587
|
+
{
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
//! Constructor with output handler.
|
|
1591
|
+
/*!
|
|
1592
|
+
\param schemaDocument The schema document to conform to.
|
|
1593
|
+
\param allocator Optional allocator for storing internal validation states.
|
|
1594
|
+
\param schemaStackCapacity Optional initial capacity of schema path stack.
|
|
1595
|
+
\param documentStackCapacity Optional initial capacity of document path stack.
|
|
1596
|
+
*/
|
|
1597
|
+
GenericSchemaValidator(
|
|
1598
|
+
const SchemaDocumentType& schemaDocument,
|
|
1599
|
+
OutputHandler& outputHandler,
|
|
1600
|
+
StateAllocator* allocator = 0,
|
|
1601
|
+
size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
|
|
1602
|
+
size_t documentStackCapacity = kDefaultDocumentStackCapacity)
|
|
1603
|
+
:
|
|
1604
|
+
schemaDocument_(&schemaDocument),
|
|
1605
|
+
root_(schemaDocument.GetRoot()),
|
|
1606
|
+
outputHandler_(outputHandler),
|
|
1607
|
+
stateAllocator_(allocator),
|
|
1608
|
+
ownStateAllocator_(0),
|
|
1609
|
+
schemaStack_(allocator, schemaStackCapacity),
|
|
1610
|
+
documentStack_(allocator, documentStackCapacity),
|
|
1611
|
+
valid_(true)
|
|
1612
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1613
|
+
, depth_(0)
|
|
1614
|
+
#endif
|
|
1615
|
+
{
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1618
|
+
//! Destructor.
|
|
1619
|
+
~GenericSchemaValidator() {
|
|
1620
|
+
Reset();
|
|
1621
|
+
RAPIDJSON_DELETE(ownStateAllocator_);
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
//! Reset the internal states.
|
|
1625
|
+
void Reset() {
|
|
1626
|
+
while (!schemaStack_.Empty())
|
|
1627
|
+
PopSchema();
|
|
1628
|
+
documentStack_.Clear();
|
|
1629
|
+
valid_ = true;
|
|
1630
|
+
}
|
|
1631
|
+
|
|
1632
|
+
//! Checks whether the current state is valid.
|
|
1633
|
+
// Implementation of ISchemaValidator
|
|
1634
|
+
virtual bool IsValid() const { return valid_; }
|
|
1635
|
+
|
|
1636
|
+
//! Gets the JSON pointer pointed to the invalid schema.
|
|
1637
|
+
PointerType GetInvalidSchemaPointer() const {
|
|
1638
|
+
return schemaStack_.Empty() ? PointerType() : schemaDocument_->GetPointer(&CurrentSchema());
|
|
1639
|
+
}
|
|
1640
|
+
|
|
1641
|
+
//! Gets the keyword of invalid schema.
|
|
1642
|
+
const Ch* GetInvalidSchemaKeyword() const {
|
|
1643
|
+
return schemaStack_.Empty() ? 0 : CurrentContext().invalidKeyword;
|
|
1644
|
+
}
|
|
1645
|
+
|
|
1646
|
+
//! Gets the JSON pointer pointed to the invalid value.
|
|
1647
|
+
PointerType GetInvalidDocumentPointer() const {
|
|
1648
|
+
return documentStack_.Empty() ? PointerType() : PointerType(documentStack_.template Bottom<Ch>(), documentStack_.GetSize() / sizeof(Ch));
|
|
1649
|
+
}
|
|
1650
|
+
|
|
1651
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1652
|
+
#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_() \
|
|
1653
|
+
RAPIDJSON_MULTILINEMACRO_BEGIN\
|
|
1654
|
+
*documentStack_.template Push<Ch>() = '\0';\
|
|
1655
|
+
documentStack_.template Pop<Ch>(1);\
|
|
1656
|
+
internal::PrintInvalidDocument(documentStack_.template Bottom<Ch>());\
|
|
1657
|
+
RAPIDJSON_MULTILINEMACRO_END
|
|
1658
|
+
#else
|
|
1659
|
+
#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_()
|
|
1660
|
+
#endif
|
|
1661
|
+
|
|
1662
|
+
#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\
|
|
1663
|
+
if (!valid_) return false; \
|
|
1664
|
+
if (!BeginValue() || !CurrentSchema().method arg1) {\
|
|
1665
|
+
RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_();\
|
|
1666
|
+
return valid_ = false;\
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\
|
|
1670
|
+
for (Context* context = schemaStack_.template Bottom<Context>(); context != schemaStack_.template End<Context>(); context++) {\
|
|
1671
|
+
if (context->hasher)\
|
|
1672
|
+
static_cast<HasherType*>(context->hasher)->method arg2;\
|
|
1673
|
+
if (context->validators)\
|
|
1674
|
+
for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\
|
|
1675
|
+
static_cast<GenericSchemaValidator*>(context->validators[i_])->method arg2;\
|
|
1676
|
+
if (context->patternPropertiesValidators)\
|
|
1677
|
+
for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\
|
|
1678
|
+
static_cast<GenericSchemaValidator*>(context->patternPropertiesValidators[i_])->method arg2;\
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\
|
|
1682
|
+
return valid_ = EndValue() && outputHandler_.method arg2
|
|
1683
|
+
|
|
1684
|
+
#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \
|
|
1685
|
+
RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\
|
|
1686
|
+
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\
|
|
1687
|
+
RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2)
|
|
1688
|
+
|
|
1689
|
+
bool Null() { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext() ), ( )); }
|
|
1690
|
+
bool Bool(bool b) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); }
|
|
1691
|
+
bool Int(int i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); }
|
|
1692
|
+
bool Uint(unsigned u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); }
|
|
1693
|
+
bool Int64(int64_t i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); }
|
|
1694
|
+
bool Uint64(uint64_t u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); }
|
|
1695
|
+
bool Double(double d) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); }
|
|
1696
|
+
bool RawNumber(const Ch* str, SizeType length, bool copy)
|
|
1697
|
+
{ RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
|
|
1698
|
+
bool String(const Ch* str, SizeType length, bool copy)
|
|
1699
|
+
{ RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
|
|
1700
|
+
|
|
1701
|
+
bool StartObject() {
|
|
1702
|
+
RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext()));
|
|
1703
|
+
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ());
|
|
1704
|
+
return valid_ = outputHandler_.StartObject();
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
bool Key(const Ch* str, SizeType len, bool copy) {
|
|
1708
|
+
if (!valid_) return false;
|
|
1709
|
+
AppendToken(str, len);
|
|
1710
|
+
if (!CurrentSchema().Key(CurrentContext(), str, len, copy)) return valid_ = false;
|
|
1711
|
+
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy));
|
|
1712
|
+
return valid_ = outputHandler_.Key(str, len, copy);
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
bool EndObject(SizeType memberCount) {
|
|
1716
|
+
if (!valid_) return false;
|
|
1717
|
+
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount));
|
|
1718
|
+
if (!CurrentSchema().EndObject(CurrentContext(), memberCount)) return valid_ = false;
|
|
1719
|
+
RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount));
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
bool StartArray() {
|
|
1723
|
+
RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext()));
|
|
1724
|
+
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ());
|
|
1725
|
+
return valid_ = outputHandler_.StartArray();
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
bool EndArray(SizeType elementCount) {
|
|
1729
|
+
if (!valid_) return false;
|
|
1730
|
+
RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount));
|
|
1731
|
+
if (!CurrentSchema().EndArray(CurrentContext(), elementCount)) return valid_ = false;
|
|
1732
|
+
RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount));
|
|
1733
|
+
}
|
|
1734
|
+
|
|
1735
|
+
#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_VERBOSE_
|
|
1736
|
+
#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_
|
|
1737
|
+
#undef RAPIDJSON_SCHEMA_HANDLE_PARALLEL_
|
|
1738
|
+
#undef RAPIDJSON_SCHEMA_HANDLE_VALUE_
|
|
1739
|
+
|
|
1740
|
+
// Implementation of ISchemaStateFactory<SchemaType>
|
|
1741
|
+
virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root) {
|
|
1742
|
+
return new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root,
|
|
1743
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1744
|
+
depth_ + 1,
|
|
1745
|
+
#endif
|
|
1746
|
+
&GetStateAllocator());
|
|
1747
|
+
}
|
|
1748
|
+
|
|
1749
|
+
virtual void DestroySchemaValidator(ISchemaValidator* validator) {
|
|
1750
|
+
GenericSchemaValidator* v = static_cast<GenericSchemaValidator*>(validator);
|
|
1751
|
+
v->~GenericSchemaValidator();
|
|
1752
|
+
StateAllocator::Free(v);
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
virtual void* CreateHasher() {
|
|
1756
|
+
return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator());
|
|
1757
|
+
}
|
|
1758
|
+
|
|
1759
|
+
virtual uint64_t GetHashCode(void* hasher) {
|
|
1760
|
+
return static_cast<HasherType*>(hasher)->GetHashCode();
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
virtual void DestroryHasher(void* hasher) {
|
|
1764
|
+
HasherType* h = static_cast<HasherType*>(hasher);
|
|
1765
|
+
h->~HasherType();
|
|
1766
|
+
StateAllocator::Free(h);
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
virtual void* MallocState(size_t size) {
|
|
1770
|
+
return GetStateAllocator().Malloc(size);
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
virtual void FreeState(void* p) {
|
|
1774
|
+
return StateAllocator::Free(p);
|
|
1775
|
+
}
|
|
1776
|
+
|
|
1777
|
+
private:
|
|
1778
|
+
typedef typename SchemaType::Context Context;
|
|
1779
|
+
typedef GenericValue<UTF8<>, StateAllocator> HashCodeArray;
|
|
1780
|
+
typedef internal::Hasher<EncodingType, StateAllocator> HasherType;
|
|
1781
|
+
|
|
1782
|
+
GenericSchemaValidator(
|
|
1783
|
+
const SchemaDocumentType& schemaDocument,
|
|
1784
|
+
const SchemaType& root,
|
|
1785
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1786
|
+
unsigned depth,
|
|
1787
|
+
#endif
|
|
1788
|
+
StateAllocator* allocator = 0,
|
|
1789
|
+
size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
|
|
1790
|
+
size_t documentStackCapacity = kDefaultDocumentStackCapacity)
|
|
1791
|
+
:
|
|
1792
|
+
schemaDocument_(&schemaDocument),
|
|
1793
|
+
root_(root),
|
|
1794
|
+
outputHandler_(GetNullHandler()),
|
|
1795
|
+
stateAllocator_(allocator),
|
|
1796
|
+
ownStateAllocator_(0),
|
|
1797
|
+
schemaStack_(allocator, schemaStackCapacity),
|
|
1798
|
+
documentStack_(allocator, documentStackCapacity),
|
|
1799
|
+
valid_(true)
|
|
1800
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1801
|
+
, depth_(depth)
|
|
1802
|
+
#endif
|
|
1803
|
+
{
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
StateAllocator& GetStateAllocator() {
|
|
1807
|
+
if (!stateAllocator_)
|
|
1808
|
+
stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator());
|
|
1809
|
+
return *stateAllocator_;
|
|
1810
|
+
}
|
|
1811
|
+
|
|
1812
|
+
bool BeginValue() {
|
|
1813
|
+
if (schemaStack_.Empty())
|
|
1814
|
+
PushSchema(root_);
|
|
1815
|
+
else {
|
|
1816
|
+
if (CurrentContext().inArray)
|
|
1817
|
+
internal::TokenHelper<internal::Stack<StateAllocator>, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex);
|
|
1818
|
+
|
|
1819
|
+
if (!CurrentSchema().BeginValue(CurrentContext()))
|
|
1820
|
+
return false;
|
|
1821
|
+
|
|
1822
|
+
SizeType count = CurrentContext().patternPropertiesSchemaCount;
|
|
1823
|
+
const SchemaType** sa = CurrentContext().patternPropertiesSchemas;
|
|
1824
|
+
typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType;
|
|
1825
|
+
bool valueUniqueness = CurrentContext().valueUniqueness;
|
|
1826
|
+
if (CurrentContext().valueSchema)
|
|
1827
|
+
PushSchema(*CurrentContext().valueSchema);
|
|
1828
|
+
|
|
1829
|
+
if (count > 0) {
|
|
1830
|
+
CurrentContext().objectPatternValidatorType = patternValidatorType;
|
|
1831
|
+
ISchemaValidator**& va = CurrentContext().patternPropertiesValidators;
|
|
1832
|
+
SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount;
|
|
1833
|
+
va = static_cast<ISchemaValidator**>(MallocState(sizeof(ISchemaValidator*) * count));
|
|
1834
|
+
for (SizeType i = 0; i < count; i++)
|
|
1835
|
+
va[validatorCount++] = CreateSchemaValidator(*sa[i]);
|
|
1836
|
+
}
|
|
1837
|
+
|
|
1838
|
+
CurrentContext().arrayUniqueness = valueUniqueness;
|
|
1839
|
+
}
|
|
1840
|
+
return true;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
bool EndValue() {
|
|
1844
|
+
if (!CurrentSchema().EndValue(CurrentContext()))
|
|
1845
|
+
return false;
|
|
1846
|
+
|
|
1847
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1848
|
+
GenericStringBuffer<EncodingType> sb;
|
|
1849
|
+
schemaDocument_->GetPointer(&CurrentSchema()).Stringify(sb);
|
|
1850
|
+
|
|
1851
|
+
*documentStack_.template Push<Ch>() = '\0';
|
|
1852
|
+
documentStack_.template Pop<Ch>(1);
|
|
1853
|
+
internal::PrintValidatorPointers(depth_, sb.GetString(), documentStack_.template Bottom<Ch>());
|
|
1854
|
+
#endif
|
|
1855
|
+
|
|
1856
|
+
uint64_t h = CurrentContext().arrayUniqueness ? static_cast<HasherType*>(CurrentContext().hasher)->GetHashCode() : 0;
|
|
1857
|
+
|
|
1858
|
+
PopSchema();
|
|
1859
|
+
|
|
1860
|
+
if (!schemaStack_.Empty()) {
|
|
1861
|
+
Context& context = CurrentContext();
|
|
1862
|
+
if (context.valueUniqueness) {
|
|
1863
|
+
HashCodeArray* a = static_cast<HashCodeArray*>(context.arrayElementHashCodes);
|
|
1864
|
+
if (!a)
|
|
1865
|
+
CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType);
|
|
1866
|
+
for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr)
|
|
1867
|
+
if (itr->GetUint64() == h)
|
|
1868
|
+
RAPIDJSON_INVALID_KEYWORD_RETURN(SchemaType::GetUniqueItemsString());
|
|
1869
|
+
a->PushBack(h, GetStateAllocator());
|
|
1870
|
+
}
|
|
1871
|
+
}
|
|
1872
|
+
|
|
1873
|
+
// Remove the last token of document pointer
|
|
1874
|
+
while (!documentStack_.Empty() && *documentStack_.template Pop<Ch>(1) != '/')
|
|
1875
|
+
;
|
|
1876
|
+
|
|
1877
|
+
return true;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
void AppendToken(const Ch* str, SizeType len) {
|
|
1881
|
+
documentStack_.template Reserve<Ch>(1 + len * 2); // worst case all characters are escaped as two characters
|
|
1882
|
+
*documentStack_.template PushUnsafe<Ch>() = '/';
|
|
1883
|
+
for (SizeType i = 0; i < len; i++) {
|
|
1884
|
+
if (str[i] == '~') {
|
|
1885
|
+
*documentStack_.template PushUnsafe<Ch>() = '~';
|
|
1886
|
+
*documentStack_.template PushUnsafe<Ch>() = '0';
|
|
1887
|
+
}
|
|
1888
|
+
else if (str[i] == '/') {
|
|
1889
|
+
*documentStack_.template PushUnsafe<Ch>() = '~';
|
|
1890
|
+
*documentStack_.template PushUnsafe<Ch>() = '1';
|
|
1891
|
+
}
|
|
1892
|
+
else
|
|
1893
|
+
*documentStack_.template PushUnsafe<Ch>() = str[i];
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
|
|
1897
|
+
RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push<Context>()) Context(*this, &schema); }
|
|
1898
|
+
|
|
1899
|
+
RAPIDJSON_FORCEINLINE void PopSchema() {
|
|
1900
|
+
Context* c = schemaStack_.template Pop<Context>(1);
|
|
1901
|
+
if (HashCodeArray* a = static_cast<HashCodeArray*>(c->arrayElementHashCodes)) {
|
|
1902
|
+
a->~HashCodeArray();
|
|
1903
|
+
StateAllocator::Free(a);
|
|
1904
|
+
}
|
|
1905
|
+
c->~Context();
|
|
1906
|
+
}
|
|
1907
|
+
|
|
1908
|
+
const SchemaType& CurrentSchema() const { return *schemaStack_.template Top<Context>()->schema; }
|
|
1909
|
+
Context& CurrentContext() { return *schemaStack_.template Top<Context>(); }
|
|
1910
|
+
const Context& CurrentContext() const { return *schemaStack_.template Top<Context>(); }
|
|
1911
|
+
|
|
1912
|
+
static OutputHandler& GetNullHandler() {
|
|
1913
|
+
static OutputHandler nullHandler;
|
|
1914
|
+
return nullHandler;
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
static const size_t kDefaultSchemaStackCapacity = 1024;
|
|
1918
|
+
static const size_t kDefaultDocumentStackCapacity = 256;
|
|
1919
|
+
const SchemaDocumentType* schemaDocument_;
|
|
1920
|
+
const SchemaType& root_;
|
|
1921
|
+
OutputHandler& outputHandler_;
|
|
1922
|
+
StateAllocator* stateAllocator_;
|
|
1923
|
+
StateAllocator* ownStateAllocator_;
|
|
1924
|
+
internal::Stack<StateAllocator> schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *)
|
|
1925
|
+
internal::Stack<StateAllocator> documentStack_; //!< stack to store the current path of validating document (Ch)
|
|
1926
|
+
bool valid_;
|
|
1927
|
+
#if RAPIDJSON_SCHEMA_VERBOSE
|
|
1928
|
+
unsigned depth_;
|
|
1929
|
+
#endif
|
|
1930
|
+
};
|
|
1931
|
+
|
|
1932
|
+
typedef GenericSchemaValidator<SchemaDocument> SchemaValidator;
|
|
1933
|
+
|
|
1934
|
+
///////////////////////////////////////////////////////////////////////////////
|
|
1935
|
+
// SchemaValidatingReader
|
|
1936
|
+
|
|
1937
|
+
//! A helper class for parsing with validation.
|
|
1938
|
+
/*!
|
|
1939
|
+
This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate().
|
|
1940
|
+
|
|
1941
|
+
\tparam parseFlags Combination of \ref ParseFlag.
|
|
1942
|
+
\tparam InputStream Type of input stream, implementing Stream concept.
|
|
1943
|
+
\tparam SourceEncoding Encoding of the input stream.
|
|
1944
|
+
\tparam SchemaDocumentType Type of schema document.
|
|
1945
|
+
\tparam StackAllocator Allocator type for stack.
|
|
1946
|
+
*/
|
|
1947
|
+
template <
|
|
1948
|
+
unsigned parseFlags,
|
|
1949
|
+
typename InputStream,
|
|
1950
|
+
typename SourceEncoding,
|
|
1951
|
+
typename SchemaDocumentType = SchemaDocument,
|
|
1952
|
+
typename StackAllocator = CrtAllocator>
|
|
1953
|
+
class SchemaValidatingReader {
|
|
1954
|
+
public:
|
|
1955
|
+
typedef typename SchemaDocumentType::PointerType PointerType;
|
|
1956
|
+
typedef typename InputStream::Ch Ch;
|
|
1957
|
+
|
|
1958
|
+
//! Constructor
|
|
1959
|
+
/*!
|
|
1960
|
+
\param is Input stream.
|
|
1961
|
+
\param sd Schema document.
|
|
1962
|
+
*/
|
|
1963
|
+
SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), isValid_(true) {}
|
|
1964
|
+
|
|
1965
|
+
template <typename Handler>
|
|
1966
|
+
bool operator()(Handler& handler) {
|
|
1967
|
+
GenericReader<SourceEncoding, typename SchemaDocumentType::EncodingType, StackAllocator> reader;
|
|
1968
|
+
GenericSchemaValidator<SchemaDocumentType, Handler> validator(sd_, handler);
|
|
1969
|
+
parseResult_ = reader.template Parse<parseFlags>(is_, validator);
|
|
1970
|
+
|
|
1971
|
+
isValid_ = validator.IsValid();
|
|
1972
|
+
if (isValid_) {
|
|
1973
|
+
invalidSchemaPointer_ = PointerType();
|
|
1974
|
+
invalidSchemaKeyword_ = 0;
|
|
1975
|
+
invalidDocumentPointer_ = PointerType();
|
|
1976
|
+
}
|
|
1977
|
+
else {
|
|
1978
|
+
invalidSchemaPointer_ = validator.GetInvalidSchemaPointer();
|
|
1979
|
+
invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword();
|
|
1980
|
+
invalidDocumentPointer_ = validator.GetInvalidDocumentPointer();
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
return parseResult_;
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
const ParseResult& GetParseResult() const { return parseResult_; }
|
|
1987
|
+
bool IsValid() const { return isValid_; }
|
|
1988
|
+
const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; }
|
|
1989
|
+
const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; }
|
|
1990
|
+
const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; }
|
|
1991
|
+
|
|
1992
|
+
private:
|
|
1993
|
+
InputStream& is_;
|
|
1994
|
+
const SchemaDocumentType& sd_;
|
|
1995
|
+
|
|
1996
|
+
ParseResult parseResult_;
|
|
1997
|
+
PointerType invalidSchemaPointer_;
|
|
1998
|
+
const Ch* invalidSchemaKeyword_;
|
|
1999
|
+
PointerType invalidDocumentPointer_;
|
|
2000
|
+
bool isValid_;
|
|
2001
|
+
};
|
|
2002
|
+
|
|
2003
|
+
RAPIDJSON_NAMESPACE_END
|
|
2004
|
+
RAPIDJSON_DIAG_POP
|
|
2005
|
+
|
|
2006
|
+
#endif // RAPIDJSON_SCHEMA_H_
|