From 2e98622454d996f3e515ae6c8ead2228eb010303 Mon Sep 17 00:00:00 2001 From: sindoring Date: Fri, 7 Aug 2026 17:47:58 +0400 Subject: [PATCH] warcraftxl without submodukle --- .gitmodules | 4 - vendor/warcraftxl | 1 - vendor/warcraftxl/.gitignore | 69 + vendor/warcraftxl/CMakeLists.txt | 205 + vendor/warcraftxl/COPYING | 674 + vendor/warcraftxl/LICENSE | 674 + vendor/warcraftxl/README.md | 126 + vendor/warcraftxl/build.ps1 | 135 + vendor/warcraftxl/deps/README | 9 + .../deps/flatbuffers/.bazelci/presubmit.yml | 60 + .../warcraftxl/deps/flatbuffers/.bazelignore | 5 + vendor/warcraftxl/deps/flatbuffers/.bazelrc | 18 + .../warcraftxl/deps/flatbuffers/.clang-format | 5 + .../warcraftxl/deps/flatbuffers/.clang-tidy | 347 + .../warcraftxl/deps/flatbuffers/.editorconfig | 8 + .../deps/flatbuffers/.gitattributes | 2 + .../deps/flatbuffers/.github/CODEOWNERS | 5 + .../flatbuffers/.github/ISSUE_TEMPLATE.md | 12 + .../.github/ISSUE_TEMPLATE/404-doc.md | 11 + .../.github/PULL_REQUEST_TEMPLATE.md | 19 + .../deps/flatbuffers/.github/dependabot.yml | 6 + .../deps/flatbuffers/.github/labeler.yml | 137 + .../flatbuffers/.github/workflows/build.yml | 643 + .../flatbuffers/.github/workflows/docs.yml | 36 + .../flatbuffers/.github/workflows/label.yml | 24 + .../flatbuffers/.github/workflows/main.yml | 34 + .../flatbuffers/.github/workflows/release.yml | 152 + .../flatbuffers/.github/workflows/stale.yml | 37 + vendor/warcraftxl/deps/flatbuffers/.gitignore | 162 + vendor/warcraftxl/deps/flatbuffers/.npmrc | 1 + vendor/warcraftxl/deps/flatbuffers/LICENSE | 202 + .../flatbuffers/include/codegen/BUILD.bazel | 39 + .../flatbuffers/include/codegen/idl_namer.h | 181 + .../deps/flatbuffers/include/codegen/namer.h | 286 + .../flatbuffers/include/codegen/python.cc | 79 + .../deps/flatbuffers/include/codegen/python.h | 100 + .../include/flatbuffers/allocator.h | 68 + .../flatbuffers/include/flatbuffers/array.h | 258 + .../flatbuffers/include/flatbuffers/base.h | 503 + .../flatbuffers/include/flatbuffers/buffer.h | 225 + .../include/flatbuffers/buffer_ref.h | 54 + .../include/flatbuffers/code_generator.h | 99 + .../include/flatbuffers/code_generators.h | 238 + .../include/flatbuffers/default_allocator.h | 64 + .../include/flatbuffers/detached_buffer.h | 121 + .../include/flatbuffers/file_manager.h | 70 + .../include/flatbuffers/flatbuffer_builder.h | 1518 ++ .../include/flatbuffers/flatbuffers.h | 284 + .../flatbuffers/include/flatbuffers/flatc.h | 131 + .../include/flatbuffers/flex_flat_util.h | 37 + .../include/flatbuffers/flexbuffers.h | 2086 ++ .../flatbuffers/include/flatbuffers/grpc.h | 303 + .../flatbuffers/include/flatbuffers/hash.h | 135 + .../flatbuffers/include/flatbuffers/idl.h | 1329 ++ .../include/flatbuffers/minireflect.h | 441 + .../include/flatbuffers/pch/flatc_pch.h | 39 + .../flatbuffers/include/flatbuffers/pch/pch.h | 38 + .../include/flatbuffers/reflection.h | 530 + .../flatbuffers/reflection_generated.h | 1541 ++ .../include/flatbuffers/registry.h | 130 + .../include/flatbuffers/stl_emulation.h | 516 + .../flatbuffers/include/flatbuffers/string.h | 69 + .../flatbuffers/include/flatbuffers/struct.h | 55 + .../flatbuffers/include/flatbuffers/table.h | 263 + .../flatbuffers/include/flatbuffers/util.h | 781 + .../flatbuffers/include/flatbuffers/vector.h | 455 + .../include/flatbuffers/vector_downward.h | 298 + .../include/flatbuffers/verifier.h | 370 + .../warcraftxl/deps/flatbuffers/src/util.cpp | 492 + vendor/warcraftxl/deps/imgui/ImGuizmo.cpp | 3423 +++ vendor/warcraftxl/deps/imgui/ImGuizmo.h | 343 + vendor/warcraftxl/deps/imgui/LICENSE.txt | 21 + vendor/warcraftxl/deps/imgui/imconfig.h | 149 + vendor/warcraftxl/deps/imgui/imgui.cpp | 18385 ++++++++++++++++ vendor/warcraftxl/deps/imgui/imgui.h | 4256 ++++ vendor/warcraftxl/deps/imgui/imgui_draw.cpp | 6809 ++++++ .../warcraftxl/deps/imgui/imgui_impl_dx9.cpp | 491 + vendor/warcraftxl/deps/imgui/imgui_impl_dx9.h | 37 + .../deps/imgui/imgui_impl_win32.cpp | 1008 + .../warcraftxl/deps/imgui/imgui_impl_win32.h | 53 + vendor/warcraftxl/deps/imgui/imgui_internal.h | 4027 ++++ vendor/warcraftxl/deps/imgui/imgui_tables.cpp | 4665 ++++ .../warcraftxl/deps/imgui/imgui_widgets.cpp | 10992 +++++++++ vendor/warcraftxl/deps/imgui/imstb_rectpack.h | 627 + vendor/warcraftxl/deps/imgui/imstb_textedit.h | 1527 ++ vendor/warcraftxl/deps/imgui/imstb_truetype.h | 5085 +++++ vendor/warcraftxl/deps/minhook/.editorconfig | 26 + .../minhook/.github/workflows/msbuild.yml | 59 + vendor/warcraftxl/deps/minhook/.gitignore | 44 + vendor/warcraftxl/deps/minhook/AUTHORS.txt | 8 + vendor/warcraftxl/deps/minhook/CMakeLists.txt | 141 + vendor/warcraftxl/deps/minhook/LICENSE.txt | 81 + vendor/warcraftxl/deps/minhook/README.md | 94 + .../minhook/cmake/minhook-config.cmake.in | 39 + .../deps/minhook/dll_resources/MinHook.def | 14 + .../deps/minhook/dll_resources/MinHook.rc | 32 + .../warcraftxl/deps/minhook/include/MinHook.h | 185 + vendor/warcraftxl/deps/minhook/src/buffer.c | 312 + vendor/warcraftxl/deps/minhook/src/buffer.h | 42 + .../warcraftxl/deps/minhook/src/hde/hde32.c | 324 + .../warcraftxl/deps/minhook/src/hde/hde32.h | 105 + .../warcraftxl/deps/minhook/src/hde/hde64.c | 335 + .../warcraftxl/deps/minhook/src/hde/hde64.h | 112 + .../warcraftxl/deps/minhook/src/hde/pstdint.h | 39 + .../warcraftxl/deps/minhook/src/hde/table32.h | 73 + .../warcraftxl/deps/minhook/src/hde/table64.h | 74 + vendor/warcraftxl/deps/minhook/src/hook.c | 939 + .../warcraftxl/deps/minhook/src/trampoline.c | 320 + .../warcraftxl/deps/minhook/src/trampoline.h | 105 + vendor/warcraftxl/deps/stormlib/.gitignore | 170 + .../stormlib/.vscode/c_cpp_properties.json | 26 + .../deps/stormlib/.vscode/launch.json | 34 + .../deps/stormlib/.vscode/settings.json | 7 + .../deps/stormlib/.vscode/tasks.json | 28 + .../warcraftxl/deps/stormlib/CMakeLists.txt | 418 + vendor/warcraftxl/deps/stormlib/Info.plist | 22 + vendor/warcraftxl/deps/stormlib/LICENSE | 21 + vendor/warcraftxl/deps/stormlib/Premake5.lua | 132 + vendor/warcraftxl/deps/stormlib/README.md | 78 + vendor/warcraftxl/deps/stormlib/StormLib.sln | 162 + .../warcraftxl/deps/stormlib/StormLib.vcxproj | 1025 + .../deps/stormlib/StormLib.vcxproj.filters | 224 + .../deps/stormlib/StormLib_dll.vcxproj | 351 + .../stormlib/StormLib_dll.vcxproj.filters | 232 + .../deps/stormlib/StormLib_test.vcxproj | 361 + .../stormlib/StormLib_test.vcxproj.filters | 233 + vendor/warcraftxl/deps/stormlib/make-msvc.bat | 102 + vendor/warcraftxl/deps/stormlib/make.bat | 52 + vendor/warcraftxl/deps/stormlib/sources | 14 + vendor/warcraftxl/deps/stormlib/src/DllMain.c | 24 + .../warcraftxl/deps/stormlib/src/DllMain.def | 83 + .../warcraftxl/deps/stormlib/src/DllMain.rc | 110 + .../deps/stormlib/src/FileStream.cpp | 2909 +++ .../warcraftxl/deps/stormlib/src/FileStream.h | 217 + .../deps/stormlib/src/LibTomCrypt.c | 85 + .../warcraftxl/deps/stormlib/src/LibTomMath.c | 125 + .../deps/stormlib/src/LibTomMathDesc.c | 4 + .../deps/stormlib/src/SBaseCommon.cpp | 2072 ++ .../deps/stormlib/src/SBaseDumpData.cpp | 183 + .../deps/stormlib/src/SBaseFileTable.cpp | 3206 +++ .../deps/stormlib/src/SBaseSubTypes.cpp | 688 + .../deps/stormlib/src/SCompression.cpp | 1193 + .../deps/stormlib/src/SFileAddFile.cpp | 1360 ++ .../deps/stormlib/src/SFileAttributes.cpp | 573 + .../deps/stormlib/src/SFileCompactArchive.cpp | 661 + .../deps/stormlib/src/SFileCreateArchive.cpp | 286 + .../deps/stormlib/src/SFileExtractFile.cpp | 64 + .../deps/stormlib/src/SFileFindFile.cpp | 486 + .../deps/stormlib/src/SFileGetFileInfo.cpp | 627 + .../deps/stormlib/src/SFileListFile.cpp | 750 + .../deps/stormlib/src/SFileOpenArchive.cpp | 786 + .../deps/stormlib/src/SFileOpenFileEx.cpp | 431 + .../deps/stormlib/src/SFilePatchArchives.cpp | 1175 + .../deps/stormlib/src/SFileReadFile.cpp | 940 + .../deps/stormlib/src/SFileVerify.cpp | 1062 + .../warcraftxl/deps/stormlib/src/SMemUtf8.cpp | 582 + .../deps/stormlib/src/StormCommon.h | 533 + .../warcraftxl/deps/stormlib/src/StormLib.exp | 75 + .../warcraftxl/deps/stormlib/src/StormLib.h | 1187 + .../warcraftxl/deps/stormlib/src/StormPort.h | 480 + .../deps/stormlib/src/adpcm/adpcm.cpp | 543 + .../deps/stormlib/src/adpcm/adpcm.h | 27 + .../deps/stormlib/src/bzip2/blocksort.c | 1094 + .../deps/stormlib/src/bzip2/bzlib.c | 1573 ++ .../deps/stormlib/src/bzip2/bzlib.h | 282 + .../deps/stormlib/src/bzip2/bzlib_private.h | 509 + .../deps/stormlib/src/bzip2/compress.c | 672 + .../deps/stormlib/src/bzip2/crctable.c | 104 + .../deps/stormlib/src/bzip2/decompress.c | 626 + .../deps/stormlib/src/bzip2/huffman.c | 205 + .../deps/stormlib/src/bzip2/randtable.c | 84 + .../deps/stormlib/src/huffman/huff.cpp | 916 + .../deps/stormlib/src/huffman/huff.h | 155 + .../deps/stormlib/src/jenkins/lookup.h | 24 + .../deps/stormlib/src/jenkins/lookup3.c | 1003 + .../src/libtomcrypt/src/hashes/hash_memory.c | 69 + .../stormlib/src/libtomcrypt/src/hashes/md5.c | 368 + .../src/libtomcrypt/src/hashes/sha1.c | 288 + .../src/libtomcrypt/src/hashes/sha256.c | 340 + .../src/libtomcrypt/src/headers/tomcrypt.h | 91 + .../libtomcrypt/src/headers/tomcrypt_argchk.h | 38 + .../libtomcrypt/src/headers/tomcrypt_cfg.h | 144 + .../libtomcrypt/src/headers/tomcrypt_cipher.h | 891 + .../libtomcrypt/src/headers/tomcrypt_custom.h | 424 + .../libtomcrypt/src/headers/tomcrypt_hash.h | 378 + .../libtomcrypt/src/headers/tomcrypt_mac.h | 384 + .../libtomcrypt/src/headers/tomcrypt_macros.h | 424 + .../libtomcrypt/src/headers/tomcrypt_math.h | 500 + .../libtomcrypt/src/headers/tomcrypt_misc.h | 23 + .../src/libtomcrypt/src/headers/tomcrypt_pk.h | 558 + .../libtomcrypt/src/headers/tomcrypt_pkcs.h | 89 + .../libtomcrypt/src/headers/tomcrypt_prng.h | 199 + .../src/libtomcrypt/src/math/ltm_desc.c | 483 + .../stormlib/src/libtomcrypt/src/math/multi.c | 61 + .../src/libtomcrypt/src/math/rand_prime.c | 87 + .../src/libtomcrypt/src/misc/base64_decode.c | 104 + .../src/libtomcrypt/src/misc/crypt_argchk.c | 30 + .../libtomcrypt/src/misc/crypt_find_hash.c | 40 + .../libtomcrypt/src/misc/crypt_find_prng.c | 41 + .../src/misc/crypt_hash_descriptor.c | 27 + .../src/misc/crypt_hash_is_valid.c | 36 + .../src/libtomcrypt/src/misc/crypt_libc.c | 43 + .../src/misc/crypt_ltc_mp_descriptor.c | 13 + .../src/misc/crypt_prng_descriptor.c | 26 + .../src/misc/crypt_prng_is_valid.c | 36 + .../src/misc/crypt_register_hash.c | 54 + .../src/misc/crypt_register_prng.c | 54 + .../src/libtomcrypt/src/misc/zeromem.c | 34 + .../src/pk/asn1/der_decode_bit_string.c | 102 + .../src/pk/asn1/der_decode_boolean.c | 47 + .../src/pk/asn1/der_decode_choice.c | 182 + .../src/pk/asn1/der_decode_ia5_string.c | 96 + .../src/pk/asn1/der_decode_integer.c | 110 + .../pk/asn1/der_decode_object_identifier.c | 99 + .../src/pk/asn1/der_decode_octet_string.c | 91 + .../src/pk/asn1/der_decode_printable_string.c | 96 + .../src/pk/asn1/der_decode_sequence_ex.c | 287 + .../src/pk/asn1/der_decode_sequence_flexi.c | 386 + .../src/pk/asn1/der_decode_sequence_multi.c | 139 + .../src/pk/asn1/der_decode_short_integer.c | 68 + .../src/pk/asn1/der_decode_utctime.c | 127 + .../src/pk/asn1/der_decode_utf8_string.c | 111 + .../src/pk/asn1/der_encode_bit_string.c | 89 + .../src/pk/asn1/der_encode_boolean.c | 51 + .../src/pk/asn1/der_encode_ia5_string.c | 85 + .../src/pk/asn1/der_encode_integer.c | 130 + .../pk/asn1/der_encode_object_identifier.c | 111 + .../src/pk/asn1/der_encode_octet_string.c | 86 + .../src/pk/asn1/der_encode_printable_string.c | 85 + .../src/pk/asn1/der_encode_sequence_ex.c | 335 + .../src/pk/asn1/der_encode_sequence_multi.c | 138 + .../libtomcrypt/src/pk/asn1/der_encode_set.c | 103 + .../src/pk/asn1/der_encode_setof.c | 162 + .../src/pk/asn1/der_encode_short_integer.c | 97 + .../src/pk/asn1/der_encode_utctime.c | 83 + .../src/pk/asn1/der_encode_utf8_string.c | 105 + .../src/pk/asn1/der_length_bit_string.c | 54 + .../src/pk/asn1/der_length_boolean.c | 35 + .../src/pk/asn1/der_length_ia5_string.c | 194 + .../src/pk/asn1/der_length_integer.c | 82 + .../pk/asn1/der_length_object_identifier.c | 89 + .../src/pk/asn1/der_length_octet_string.c | 53 + .../src/pk/asn1/der_length_printable_string.c | 166 + .../src/pk/asn1/der_length_sequence.c | 169 + .../src/pk/asn1/der_length_short_integer.c | 70 + .../src/pk/asn1/der_length_utctime.c | 46 + .../src/pk/asn1/der_length_utf8_string.c | 83 + .../src/pk/asn1/der_sequence_free.c | 65 + .../src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c | 76 + .../libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c | 207 + .../libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c | 222 + .../libtomcrypt/src/pk/ecc/ltc_ecc_points.c | 60 + .../src/pk/ecc/ltc_ecc_projective_add_point.c | 196 + .../src/pk/ecc/ltc_ecc_projective_dbl_point.c | 147 + .../libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c | 108 + .../src/pk/pkcs1/pkcs_1_oaep_decode.c | 189 + .../src/pk/pkcs1/pkcs_1_pss_decode.c | 177 + .../src/pk/pkcs1/pkcs_1_pss_encode.c | 175 + .../src/pk/pkcs1/pkcs_1_v1_5_decode.c | 110 + .../src/pk/pkcs1/pkcs_1_v1_5_encode.c | 111 + .../src/libtomcrypt/src/pk/rsa/rsa_exptmod.c | 113 + .../src/libtomcrypt/src/pk/rsa/rsa_free.c | 34 + .../src/libtomcrypt/src/pk/rsa/rsa_import.c | 143 + .../src/libtomcrypt/src/pk/rsa/rsa_make_key.c | 112 + .../libtomcrypt/src/pk/rsa/rsa_sign_hash.c | 134 + .../libtomcrypt/src/pk/rsa/rsa_verify_hash.c | 167 + .../src/pk/rsa/rsa_verify_simple.c | 87 + .../src/libtommath/bn_fast_mp_invmod.c | 148 + .../libtommath/bn_fast_mp_montgomery_reduce.c | 172 + .../src/libtommath/bn_fast_s_mp_mul_digs.c | 107 + .../libtommath/bn_fast_s_mp_mul_high_digs.c | 98 + .../src/libtommath/bn_fast_s_mp_sqr.c | 114 + .../stormlib/src/libtommath/bn_mp_2expt.c | 48 + .../deps/stormlib/src/libtommath/bn_mp_abs.c | 43 + .../deps/stormlib/src/libtommath/bn_mp_add.c | 53 + .../stormlib/src/libtommath/bn_mp_add_d.c | 112 + .../stormlib/src/libtommath/bn_mp_addmod.c | 41 + .../deps/stormlib/src/libtommath/bn_mp_and.c | 57 + .../stormlib/src/libtommath/bn_mp_clamp.c | 44 + .../stormlib/src/libtommath/bn_mp_clear.c | 44 + .../src/libtommath/bn_mp_clear_multi.c | 34 + .../deps/stormlib/src/libtommath/bn_mp_cmp.c | 43 + .../stormlib/src/libtommath/bn_mp_cmp_d.c | 44 + .../stormlib/src/libtommath/bn_mp_cmp_mag.c | 55 + .../stormlib/src/libtommath/bn_mp_cnt_lsb.c | 53 + .../deps/stormlib/src/libtommath/bn_mp_copy.c | 68 + .../src/libtommath/bn_mp_count_bits.c | 45 + .../deps/stormlib/src/libtommath/bn_mp_div.c | 292 + .../stormlib/src/libtommath/bn_mp_div_2.c | 68 + .../stormlib/src/libtommath/bn_mp_div_2d.c | 97 + .../stormlib/src/libtommath/bn_mp_div_3.c | 79 + .../stormlib/src/libtommath/bn_mp_div_d.c | 115 + .../src/libtommath/bn_mp_dr_is_modulus.c | 43 + .../stormlib/src/libtommath/bn_mp_dr_reduce.c | 94 + .../stormlib/src/libtommath/bn_mp_dr_setup.c | 32 + .../deps/stormlib/src/libtommath/bn_mp_exch.c | 34 + .../stormlib/src/libtommath/bn_mp_expt_d.c | 57 + .../stormlib/src/libtommath/bn_mp_exptmod.c | 112 + .../src/libtommath/bn_mp_exptmod_fast.c | 321 + .../stormlib/src/libtommath/bn_mp_exteuclid.c | 82 + .../stormlib/src/libtommath/bn_mp_fread.c | 67 + .../stormlib/src/libtommath/bn_mp_fwrite.c | 52 + .../deps/stormlib/src/libtommath/bn_mp_gcd.c | 105 + .../stormlib/src/libtommath/bn_mp_get_int.c | 45 + .../deps/stormlib/src/libtommath/bn_mp_grow.c | 57 + .../deps/stormlib/src/libtommath/bn_mp_init.c | 46 + .../stormlib/src/libtommath/bn_mp_init_copy.c | 32 + .../src/libtommath/bn_mp_init_multi.c | 59 + .../stormlib/src/libtommath/bn_mp_init_set.c | 32 + .../src/libtommath/bn_mp_init_set_int.c | 31 + .../stormlib/src/libtommath/bn_mp_init_size.c | 48 + .../stormlib/src/libtommath/bn_mp_invmod.c | 43 + .../src/libtommath/bn_mp_invmod_slow.c | 175 + .../stormlib/src/libtommath/bn_mp_is_square.c | 109 + .../stormlib/src/libtommath/bn_mp_jacobi.c | 105 + .../src/libtommath/bn_mp_karatsuba_mul.c | 167 + .../src/libtommath/bn_mp_karatsuba_sqr.c | 121 + .../deps/stormlib/src/libtommath/bn_mp_lcm.c | 60 + .../deps/stormlib/src/libtommath/bn_mp_lshd.c | 67 + .../deps/stormlib/src/libtommath/bn_mp_mod.c | 48 + .../stormlib/src/libtommath/bn_mp_mod_2d.c | 55 + .../stormlib/src/libtommath/bn_mp_mod_d.c | 27 + .../bn_mp_montgomery_calc_normalization.c | 59 + .../src/libtommath/bn_mp_montgomery_reduce.c | 118 + .../src/libtommath/bn_mp_montgomery_setup.c | 59 + .../deps/stormlib/src/libtommath/bn_mp_mul.c | 66 + .../stormlib/src/libtommath/bn_mp_mul_2.c | 82 + .../stormlib/src/libtommath/bn_mp_mul_2d.c | 85 + .../stormlib/src/libtommath/bn_mp_mul_d.c | 79 + .../stormlib/src/libtommath/bn_mp_mulmod.c | 40 + .../stormlib/src/libtommath/bn_mp_n_root.c | 132 + .../deps/stormlib/src/libtommath/bn_mp_neg.c | 40 + .../deps/stormlib/src/libtommath/bn_mp_or.c | 50 + .../src/libtommath/bn_mp_prime_fermat.c | 62 + .../src/libtommath/bn_mp_prime_is_divisible.c | 50 + .../src/libtommath/bn_mp_prime_is_prime.c | 83 + .../src/libtommath/bn_mp_prime_miller_rabin.c | 103 + .../src/libtommath/bn_mp_prime_next_prime.c | 170 + .../bn_mp_prime_rabin_miller_trials.c | 52 + .../src/libtommath/bn_mp_prime_random_ex.c | 125 + .../src/libtommath/bn_mp_radix_size.c | 78 + .../src/libtommath/bn_mp_radix_smap.c | 24 + .../deps/stormlib/src/libtommath/bn_mp_rand.c | 55 + .../src/libtommath/bn_mp_read_radix.c | 85 + .../src/libtommath/bn_mp_read_signed_bin.c | 41 + .../src/libtommath/bn_mp_read_unsigned_bin.c | 55 + .../stormlib/src/libtommath/bn_mp_reduce.c | 100 + .../stormlib/src/libtommath/bn_mp_reduce_2k.c | 61 + .../src/libtommath/bn_mp_reduce_2k_l.c | 62 + .../src/libtommath/bn_mp_reduce_2k_setup.c | 47 + .../src/libtommath/bn_mp_reduce_2k_setup_l.c | 44 + .../src/libtommath/bn_mp_reduce_is_2k.c | 52 + .../src/libtommath/bn_mp_reduce_is_2k_l.c | 44 + .../src/libtommath/bn_mp_reduce_setup.c | 34 + .../deps/stormlib/src/libtommath/bn_mp_rshd.c | 72 + .../deps/stormlib/src/libtommath/bn_mp_set.c | 29 + .../stormlib/src/libtommath/bn_mp_set_int.c | 48 + .../stormlib/src/libtommath/bn_mp_shrink.c | 35 + .../src/libtommath/bn_mp_signed_bin_size.c | 27 + .../deps/stormlib/src/libtommath/bn_mp_sqr.c | 58 + .../stormlib/src/libtommath/bn_mp_sqrmod.c | 41 + .../deps/stormlib/src/libtommath/bn_mp_sqrt.c | 81 + .../deps/stormlib/src/libtommath/bn_mp_sub.c | 59 + .../stormlib/src/libtommath/bn_mp_sub_d.c | 93 + .../stormlib/src/libtommath/bn_mp_submod.c | 42 + .../src/libtommath/bn_mp_to_signed_bin.c | 33 + .../src/libtommath/bn_mp_to_signed_bin_n.c | 31 + .../src/libtommath/bn_mp_to_unsigned_bin.c | 48 + .../src/libtommath/bn_mp_to_unsigned_bin_n.c | 31 + .../stormlib/src/libtommath/bn_mp_toom_mul.c | 284 + .../stormlib/src/libtommath/bn_mp_toom_sqr.c | 226 + .../stormlib/src/libtommath/bn_mp_toradix.c | 75 + .../stormlib/src/libtommath/bn_mp_toradix_n.c | 88 + .../src/libtommath/bn_mp_unsigned_bin_size.c | 28 + .../deps/stormlib/src/libtommath/bn_mp_xor.c | 51 + .../deps/stormlib/src/libtommath/bn_mp_zero.c | 36 + .../stormlib/src/libtommath/bn_prime_tab.c | 61 + .../deps/stormlib/src/libtommath/bn_reverse.c | 39 + .../stormlib/src/libtommath/bn_s_mp_add.c | 109 + .../stormlib/src/libtommath/bn_s_mp_exptmod.c | 252 + .../src/libtommath/bn_s_mp_mul_digs.c | 90 + .../src/libtommath/bn_s_mp_mul_high_digs.c | 81 + .../stormlib/src/libtommath/bn_s_mp_sqr.c | 84 + .../stormlib/src/libtommath/bn_s_mp_sub.c | 89 + .../deps/stormlib/src/libtommath/bncore.c | 36 + .../deps/stormlib/src/libtommath/tommath.h | 584 + .../stormlib/src/libtommath/tommath_class.h | 999 + .../src/libtommath/tommath_superclass.h | 76 + .../deps/stormlib/src/lzma/C/LzFind.c | 761 + .../deps/stormlib/src/lzma/C/LzFind.h | 115 + .../deps/stormlib/src/lzma/C/LzFindMt.c | 793 + .../deps/stormlib/src/lzma/C/LzFindMt.h | 105 + .../deps/stormlib/src/lzma/C/LzHash.h | 54 + .../deps/stormlib/src/lzma/C/LzmaDec.c | 999 + .../deps/stormlib/src/lzma/C/LzmaDec.h | 231 + .../deps/stormlib/src/lzma/C/LzmaEnc.c | 2268 ++ .../deps/stormlib/src/lzma/C/LzmaEnc.h | 80 + .../deps/stormlib/src/lzma/C/Threads.c | 84 + .../deps/stormlib/src/lzma/C/Threads.h | 59 + .../deps/stormlib/src/lzma/C/Types.h | 236 + .../deps/stormlib/src/lzma/info.txt | 1 + .../deps/stormlib/src/pklib/crc32.c | 66 + .../deps/stormlib/src/pklib/explode.c | 521 + .../deps/stormlib/src/pklib/implode.c | 674 + .../deps/stormlib/src/pklib/pklib.h | 160 + .../warcraftxl/deps/stormlib/src/resource.h | 15 + .../deps/stormlib/src/sparse/sparse.cpp | 287 + .../deps/stormlib/src/sparse/sparse.h | 17 + .../deps/stormlib/src/wdk/sources-cpp.cpp | 27 + .../deps/stormlib/src/wdk/sources-wdk-bzip2.c | 13 + .../deps/stormlib/src/wdk/sources-wdk-ltc.c | 4 + .../deps/stormlib/src/wdk/sources-wdk-lzma.c | 8 + .../deps/stormlib/src/wdk/sources-wdk-misc.c | 6 + .../stormlib/src/wdk/sources-wdk-tomcrypt.c | 82 + .../stormlib/src/wdk/sources-wdk-tommath.c | 123 + .../deps/stormlib/src/wdk/sources-wdk-zlib.c | 21 + .../deps/stormlib/src/zlib/adler32.c | 169 + .../deps/stormlib/src/zlib/compress.c | 80 + .../deps/stormlib/src/zlib/compress_zlib.c | 5 + .../warcraftxl/deps/stormlib/src/zlib/crc32.c | 442 + .../warcraftxl/deps/stormlib/src/zlib/crc32.h | 441 + .../deps/stormlib/src/zlib/deflate.c | 1834 ++ .../deps/stormlib/src/zlib/deflate.h | 342 + .../deps/stormlib/src/zlib/gzguts.h | 218 + .../deps/stormlib/src/zlib/inffast.c | 340 + .../deps/stormlib/src/zlib/inffast.h | 11 + .../deps/stormlib/src/zlib/inffixed.h | 94 + .../deps/stormlib/src/zlib/inflate.c | 1480 ++ .../deps/stormlib/src/zlib/inflate.h | 130 + .../deps/stormlib/src/zlib/inftrees.c | 330 + .../deps/stormlib/src/zlib/inftrees.h | 67 + .../warcraftxl/deps/stormlib/src/zlib/trees.c | 1244 ++ .../warcraftxl/deps/stormlib/src/zlib/trees.h | 128 + .../warcraftxl/deps/stormlib/src/zlib/zconf.h | 428 + .../warcraftxl/deps/stormlib/src/zlib/zlib.h | 1613 ++ .../warcraftxl/deps/stormlib/src/zlib/zutil.c | 318 + .../warcraftxl/deps/stormlib/src/zlib/zutil.h | 274 + vendor/warcraftxl/docs/WarcraftXL.cfg.example | 78 + vendor/warcraftxl/src/common/Config.cpp | 156 + vendor/warcraftxl/src/common/Config.hpp | 88 + vendor/warcraftxl/src/common/Log.cpp | 203 + vendor/warcraftxl/src/common/Log.hpp | 112 + vendor/warcraftxl/src/common/Mem.hpp | 64 + vendor/warcraftxl/src/core/Hook.cpp | 85 + vendor/warcraftxl/src/core/Hook.hpp | 88 + vendor/warcraftxl/src/core/Logger.hpp | 65 + vendor/warcraftxl/src/core/Main.cpp | 107 + vendor/warcraftxl/src/core/Mem.cpp | 48 + vendor/warcraftxl/src/core/Mem.hpp | 42 + vendor/warcraftxl/src/events/Event.cpp | 71 + vendor/warcraftxl/src/events/Event.hpp | 271 + vendor/warcraftxl/src/events/EventScript.hpp | 57 + vendor/warcraftxl/src/game/Binding.cpp | 57 + vendor/warcraftxl/src/game/Binding.hpp | 65 + vendor/warcraftxl/src/game/Catalog.cpp | 44 + vendor/warcraftxl/src/game/Catalog.hpp | 28 + vendor/warcraftxl/src/game/adt/Adt.hpp | 72 + vendor/warcraftxl/src/game/camera/Camera.hpp | 66 + vendor/warcraftxl/src/game/doodad/Doodad.hpp | 453 + vendor/warcraftxl/src/game/gx/Gx.cpp | 167 + vendor/warcraftxl/src/game/gx/Gx.hpp | 294 + vendor/warcraftxl/src/game/io/Io.hpp | 99 + vendor/warcraftxl/src/game/m2/M2.hpp | 285 + vendor/warcraftxl/src/game/mem/Mem.hpp | 64 + vendor/warcraftxl/src/game/sound/Sound.hpp | 59 + vendor/warcraftxl/src/game/ui/Ui.hpp | 60 + vendor/warcraftxl/src/game/unit/Unit.hpp | 55 + vendor/warcraftxl/src/game/wmo/Wmo.hpp | 173 + vendor/warcraftxl/src/game/world/Loading.hpp | 174 + vendor/warcraftxl/src/game/world/Pick.hpp | 110 + vendor/warcraftxl/src/game/world/World.hpp | 74 + vendor/warcraftxl/src/gpu/Capture.cpp | 530 + vendor/warcraftxl/src/gpu/Capture.hpp | 82 + vendor/warcraftxl/src/gpu/Device.cpp | 173 + vendor/warcraftxl/src/gpu/Device.hpp | 57 + vendor/warcraftxl/src/gpu/Present.cpp | 632 + vendor/warcraftxl/src/gpu/Present.hpp | 62 + vendor/warcraftxl/src/gpu/Proxy.cpp | 191 + vendor/warcraftxl/src/gpu/Proxy.def | 9 + vendor/warcraftxl/src/gpu/Proxy.hpp | 39 + vendor/warcraftxl/src/host/Host.cpp | 746 + vendor/warcraftxl/src/host/Host.hpp | 213 + vendor/warcraftxl/src/host/Profile.cpp | 332 + vendor/warcraftxl/src/host/Profile.hpp | 97 + vendor/warcraftxl/src/host/ipc/Protocol.hpp | 170 + vendor/warcraftxl/src/host/ipc/ShmServer.cpp | 170 + vendor/warcraftxl/src/host/ipc/ShmServer.hpp | 62 + vendor/warcraftxl/src/host/main.cpp | 1216 + vendor/warcraftxl/src/host/mpq/MpqStore.cpp | 591 + vendor/warcraftxl/src/host/mpq/MpqStore.hpp | 131 + vendor/warcraftxl/src/offsets/Offsets.hpp | 31 + .../warcraftxl/src/offsets/engine/Camera.hpp | 33 + vendor/warcraftxl/src/offsets/engine/Draw.hpp | 42 + .../warcraftxl/src/offsets/engine/Frame.hpp | 32 + vendor/warcraftxl/src/offsets/engine/Gx.hpp | 237 + vendor/warcraftxl/src/offsets/engine/Io.hpp | 78 + vendor/warcraftxl/src/offsets/engine/Lua.hpp | 55 + vendor/warcraftxl/src/offsets/engine/Mem.hpp | 32 + .../warcraftxl/src/offsets/engine/Shader.hpp | 105 + .../warcraftxl/src/offsets/engine/Sound.hpp | 64 + vendor/warcraftxl/src/offsets/engine/Ui.hpp | 44 + vendor/warcraftxl/src/offsets/game/ADT.hpp | 258 + vendor/warcraftxl/src/offsets/game/DB2.hpp | 119 + vendor/warcraftxl/src/offsets/game/Doodad.hpp | 160 + .../src/offsets/game/GroundEffect.hpp | 54 + vendor/warcraftxl/src/offsets/game/M2.hpp | 456 + vendor/warcraftxl/src/offsets/game/Unit.hpp | 123 + vendor/warcraftxl/src/offsets/game/WMO.hpp | 192 + vendor/warcraftxl/src/offsets/game/World.hpp | 206 + .../src/offsets/game/WorldScene.hpp | 96 + vendor/warcraftxl/src/overlay/Panels.cpp | 37 + vendor/warcraftxl/src/overlay/Panels.hpp | 46 + vendor/warcraftxl/src/patcher/Main.cpp | 134 + vendor/warcraftxl/src/patcher/PatchScript.cpp | 53 + vendor/warcraftxl/src/patcher/PatchScript.hpp | 66 + vendor/warcraftxl/src/patcher/PeImage.cpp | 258 + vendor/warcraftxl/src/patcher/PeImage.hpp | 97 + .../warcraftxl/src/runtime/AssetProfile.cpp | 209 + .../warcraftxl/src/runtime/AssetProfile.hpp | 37 + vendor/warcraftxl/src/runtime/GameHooks.cpp | 1724 ++ vendor/warcraftxl/src/runtime/GameHooks.hpp | 58 + vendor/warcraftxl/src/runtime/InputHooks.cpp | 114 + vendor/warcraftxl/src/runtime/InputHooks.hpp | 28 + vendor/warcraftxl/src/runtime/LuaBindings.cpp | 434 + vendor/warcraftxl/src/runtime/LuaBindings.hpp | 43 + .../warcraftxl/src/runtime/ModuleInstall.cpp | 117 + .../warcraftxl/src/runtime/ModuleInstall.hpp | 69 + .../warcraftxl/src/runtime/PhasingHooks.cpp | 160 + .../warcraftxl/src/runtime/PhasingHooks.hpp | 27 + vendor/warcraftxl/src/runtime/RenderHooks.cpp | 999 + vendor/warcraftxl/src/runtime/RenderHooks.hpp | 36 + vendor/warcraftxl/src/runtime/db2/Db2.cpp | 201 + vendor/warcraftxl/src/runtime/db2/Db2.hpp | 109 + .../src/runtime/db2/ItemDisplayIndex.cpp | 31 + .../src/runtime/db2/ItemDisplayIndex.hpp | 67 + vendor/warcraftxl/src/runtime/db2/Wdc5.cpp | 455 + vendor/warcraftxl/src/runtime/db2/Wdc5.hpp | 50 + .../src/runtime/storage/ShmClient.cpp | 797 + .../src/runtime/storage/ShmClient.hpp | 113 + .../src/runtime/storage/StorageHook.cpp | 933 + .../src/runtime/storage/StorageHook.hpp | 67 + .../warcraftxl/src/structure/m2/M2Format.hpp | 282 + vendor/warcraftxl/wxl.json | 82 + 543 files changed, 179801 insertions(+), 5 deletions(-) delete mode 160000 vendor/warcraftxl create mode 100644 vendor/warcraftxl/.gitignore create mode 100644 vendor/warcraftxl/CMakeLists.txt create mode 100644 vendor/warcraftxl/COPYING create mode 100644 vendor/warcraftxl/LICENSE create mode 100644 vendor/warcraftxl/README.md create mode 100644 vendor/warcraftxl/build.ps1 create mode 100644 vendor/warcraftxl/deps/README create mode 100644 vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.bazelignore create mode 100644 vendor/warcraftxl/deps/flatbuffers/.bazelrc create mode 100644 vendor/warcraftxl/deps/flatbuffers/.clang-format create mode 100644 vendor/warcraftxl/deps/flatbuffers/.clang-tidy create mode 100644 vendor/warcraftxl/deps/flatbuffers/.editorconfig create mode 100644 vendor/warcraftxl/deps/flatbuffers/.gitattributes create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml create mode 100644 vendor/warcraftxl/deps/flatbuffers/.gitignore create mode 100644 vendor/warcraftxl/deps/flatbuffers/.npmrc create mode 100644 vendor/warcraftxl/deps/flatbuffers/LICENSE create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffers.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatc.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flex_flat_util.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flexbuffers.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/grpc.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/hash.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/idl.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/minireflect.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/pch/flatc_pch.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/pch/pch.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/reflection.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/reflection_generated.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/registry.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/stl_emulation.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/string.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/struct.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/table.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/util.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/vector.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/vector_downward.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/verifier.h create mode 100644 vendor/warcraftxl/deps/flatbuffers/src/util.cpp create mode 100644 vendor/warcraftxl/deps/imgui/ImGuizmo.cpp create mode 100644 vendor/warcraftxl/deps/imgui/ImGuizmo.h create mode 100644 vendor/warcraftxl/deps/imgui/LICENSE.txt create mode 100644 vendor/warcraftxl/deps/imgui/imconfig.h create mode 100644 vendor/warcraftxl/deps/imgui/imgui.cpp create mode 100644 vendor/warcraftxl/deps/imgui/imgui.h create mode 100644 vendor/warcraftxl/deps/imgui/imgui_draw.cpp create mode 100644 vendor/warcraftxl/deps/imgui/imgui_impl_dx9.cpp create mode 100644 vendor/warcraftxl/deps/imgui/imgui_impl_dx9.h create mode 100644 vendor/warcraftxl/deps/imgui/imgui_impl_win32.cpp create mode 100644 vendor/warcraftxl/deps/imgui/imgui_impl_win32.h create mode 100644 vendor/warcraftxl/deps/imgui/imgui_internal.h create mode 100644 vendor/warcraftxl/deps/imgui/imgui_tables.cpp create mode 100644 vendor/warcraftxl/deps/imgui/imgui_widgets.cpp create mode 100644 vendor/warcraftxl/deps/imgui/imstb_rectpack.h create mode 100644 vendor/warcraftxl/deps/imgui/imstb_textedit.h create mode 100644 vendor/warcraftxl/deps/imgui/imstb_truetype.h create mode 100644 vendor/warcraftxl/deps/minhook/.editorconfig create mode 100644 vendor/warcraftxl/deps/minhook/.github/workflows/msbuild.yml create mode 100644 vendor/warcraftxl/deps/minhook/.gitignore create mode 100644 vendor/warcraftxl/deps/minhook/AUTHORS.txt create mode 100644 vendor/warcraftxl/deps/minhook/CMakeLists.txt create mode 100644 vendor/warcraftxl/deps/minhook/LICENSE.txt create mode 100644 vendor/warcraftxl/deps/minhook/README.md create mode 100644 vendor/warcraftxl/deps/minhook/cmake/minhook-config.cmake.in create mode 100644 vendor/warcraftxl/deps/minhook/dll_resources/MinHook.def create mode 100644 vendor/warcraftxl/deps/minhook/dll_resources/MinHook.rc create mode 100644 vendor/warcraftxl/deps/minhook/include/MinHook.h create mode 100644 vendor/warcraftxl/deps/minhook/src/buffer.c create mode 100644 vendor/warcraftxl/deps/minhook/src/buffer.h create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/hde32.c create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/hde32.h create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/hde64.c create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/hde64.h create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/pstdint.h create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/table32.h create mode 100644 vendor/warcraftxl/deps/minhook/src/hde/table64.h create mode 100644 vendor/warcraftxl/deps/minhook/src/hook.c create mode 100644 vendor/warcraftxl/deps/minhook/src/trampoline.c create mode 100644 vendor/warcraftxl/deps/minhook/src/trampoline.h create mode 100644 vendor/warcraftxl/deps/stormlib/.gitignore create mode 100644 vendor/warcraftxl/deps/stormlib/.vscode/c_cpp_properties.json create mode 100644 vendor/warcraftxl/deps/stormlib/.vscode/launch.json create mode 100644 vendor/warcraftxl/deps/stormlib/.vscode/settings.json create mode 100644 vendor/warcraftxl/deps/stormlib/.vscode/tasks.json create mode 100644 vendor/warcraftxl/deps/stormlib/CMakeLists.txt create mode 100644 vendor/warcraftxl/deps/stormlib/Info.plist create mode 100644 vendor/warcraftxl/deps/stormlib/LICENSE create mode 100644 vendor/warcraftxl/deps/stormlib/Premake5.lua create mode 100644 vendor/warcraftxl/deps/stormlib/README.md create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib.sln create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib.vcxproj create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib.vcxproj.filters create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib_dll.vcxproj create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib_dll.vcxproj.filters create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib_test.vcxproj create mode 100644 vendor/warcraftxl/deps/stormlib/StormLib_test.vcxproj.filters create mode 100644 vendor/warcraftxl/deps/stormlib/make-msvc.bat create mode 100644 vendor/warcraftxl/deps/stormlib/make.bat create mode 100644 vendor/warcraftxl/deps/stormlib/sources create mode 100644 vendor/warcraftxl/deps/stormlib/src/DllMain.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/DllMain.def create mode 100644 vendor/warcraftxl/deps/stormlib/src/DllMain.rc create mode 100644 vendor/warcraftxl/deps/stormlib/src/FileStream.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/FileStream.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/LibTomCrypt.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/LibTomMath.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/LibTomMathDesc.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/SBaseCommon.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SBaseDumpData.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SBaseFileTable.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SBaseSubTypes.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SCompression.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileAddFile.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileAttributes.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileCompactArchive.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileCreateArchive.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileExtractFile.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileFindFile.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileGetFileInfo.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileListFile.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileOpenArchive.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileOpenFileEx.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFilePatchArchives.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileReadFile.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SFileVerify.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/SMemUtf8.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/StormCommon.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/StormLib.exp create mode 100644 vendor/warcraftxl/deps/stormlib/src/StormLib.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/StormPort.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/adpcm/adpcm.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/adpcm/adpcm.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/blocksort.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/bzlib.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/bzlib.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/bzlib_private.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/compress.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/crctable.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/decompress.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/huffman.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/bzip2/randtable.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/huffman/huff.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/huffman/huff.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/jenkins/lookup.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/jenkins/lookup3.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/hashes/hash_memory.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/hashes/md5.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/hashes/sha1.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/hashes/sha256.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_argchk.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_cfg.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_cipher.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_custom.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_hash.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_mac.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_macros.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_math.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_misc.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_pk.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_pkcs.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/headers/tomcrypt_prng.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/math/ltm_desc.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/math/multi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/math/rand_prime.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/base64_decode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_argchk.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_find_hash.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_find_prng.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_hash_descriptor.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_hash_is_valid.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_libc.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_ltc_mp_descriptor.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_prng_descriptor.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_prng_is_valid.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_register_hash.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/crypt_register_prng.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/misc/zeromem.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_bit_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_boolean.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_choice.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_ia5_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_integer.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_object_identifier.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_octet_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_printable_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_ex.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_flexi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_sequence_multi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_short_integer.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_utctime.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_decode_utf8_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_bit_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_boolean.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_ia5_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_integer.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_object_identifier.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_octet_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_printable_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_sequence_ex.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_sequence_multi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_set.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_setof.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_short_integer.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_utctime.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_encode_utf8_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_bit_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_boolean.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_ia5_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_integer.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_object_identifier.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_octet_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_printable_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_sequence.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_short_integer.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_utctime.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_length_utf8_string.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/asn1/der_sequence_free.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/ecc/ltc_ecc_map.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mul2add.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/ecc/ltc_ecc_mulmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/ecc/ltc_ecc_points.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_add_point.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/ecc/ltc_ecc_projective_dbl_point.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_mgf1.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_oaep_decode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_decode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_pss_encode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_decode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/pkcs1/pkcs_1_v1_5_encode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_exptmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_free.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_import.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_make_key.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_sign_hash.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_verify_hash.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtomcrypt/src/pk/rsa/rsa_verify_simple.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_fast_mp_invmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_fast_mp_montgomery_reduce.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_fast_s_mp_mul_digs.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_fast_s_mp_mul_high_digs.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_fast_s_mp_sqr.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_2expt.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_abs.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_add.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_add_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_addmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_and.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_clamp.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_clear.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_clear_multi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_cmp.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_cmp_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_cmp_mag.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_cnt_lsb.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_copy.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_count_bits.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_div.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_div_2.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_div_2d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_div_3.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_div_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_dr_is_modulus.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_dr_reduce.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_dr_setup.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_exch.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_expt_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_exptmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_exptmod_fast.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_exteuclid.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_fread.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_fwrite.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_gcd.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_get_int.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_grow.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_init.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_init_copy.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_init_multi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_init_set.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_init_set_int.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_init_size.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_invmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_invmod_slow.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_is_square.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_jacobi.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_karatsuba_mul.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_karatsuba_sqr.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_lcm.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_lshd.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mod_2d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mod_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_montgomery_calc_normalization.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_montgomery_reduce.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_montgomery_setup.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mul.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mul_2.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mul_2d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mul_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_mulmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_n_root.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_neg.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_or.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_fermat.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_is_divisible.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_is_prime.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_miller_rabin.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_next_prime.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_rabin_miller_trials.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_prime_random_ex.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_radix_size.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_radix_smap.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_rand.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_read_radix.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_read_signed_bin.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_read_unsigned_bin.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_2k.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_2k_l.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_2k_setup.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_2k_setup_l.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_is_2k.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_is_2k_l.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_reduce_setup.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_rshd.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_set.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_set_int.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_shrink.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_signed_bin_size.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_sqr.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_sqrmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_sqrt.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_sub.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_sub_d.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_submod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_to_signed_bin.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_to_signed_bin_n.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_to_unsigned_bin.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_to_unsigned_bin_n.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_toom_mul.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_toom_sqr.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_toradix.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_toradix_n.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_unsigned_bin_size.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_xor.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_mp_zero.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_prime_tab.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_reverse.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_s_mp_add.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_s_mp_exptmod.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_s_mp_mul_digs.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_s_mp_mul_high_digs.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_s_mp_sqr.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bn_s_mp_sub.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/bncore.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/tommath.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/tommath_class.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/libtommath/tommath_superclass.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzFind.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzFind.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzFindMt.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzFindMt.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzHash.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzmaDec.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzmaDec.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzmaEnc.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/LzmaEnc.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/Threads.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/Threads.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/C/Types.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/lzma/info.txt create mode 100644 vendor/warcraftxl/deps/stormlib/src/pklib/crc32.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/pklib/explode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/pklib/implode.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/pklib/pklib.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/resource.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/sparse/sparse.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/sparse/sparse.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-cpp.cpp create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-bzip2.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-ltc.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-lzma.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-misc.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-tomcrypt.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-tommath.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/wdk/sources-wdk-zlib.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/adler32.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/compress.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/compress_zlib.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/crc32.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/crc32.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/deflate.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/deflate.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/gzguts.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inffast.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inffast.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inffixed.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inflate.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inflate.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inftrees.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/inftrees.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/trees.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/trees.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/zconf.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/zlib.h create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/zutil.c create mode 100644 vendor/warcraftxl/deps/stormlib/src/zlib/zutil.h create mode 100644 vendor/warcraftxl/docs/WarcraftXL.cfg.example create mode 100644 vendor/warcraftxl/src/common/Config.cpp create mode 100644 vendor/warcraftxl/src/common/Config.hpp create mode 100644 vendor/warcraftxl/src/common/Log.cpp create mode 100644 vendor/warcraftxl/src/common/Log.hpp create mode 100644 vendor/warcraftxl/src/common/Mem.hpp create mode 100644 vendor/warcraftxl/src/core/Hook.cpp create mode 100644 vendor/warcraftxl/src/core/Hook.hpp create mode 100644 vendor/warcraftxl/src/core/Logger.hpp create mode 100644 vendor/warcraftxl/src/core/Main.cpp create mode 100644 vendor/warcraftxl/src/core/Mem.cpp create mode 100644 vendor/warcraftxl/src/core/Mem.hpp create mode 100644 vendor/warcraftxl/src/events/Event.cpp create mode 100644 vendor/warcraftxl/src/events/Event.hpp create mode 100644 vendor/warcraftxl/src/events/EventScript.hpp create mode 100644 vendor/warcraftxl/src/game/Binding.cpp create mode 100644 vendor/warcraftxl/src/game/Binding.hpp create mode 100644 vendor/warcraftxl/src/game/Catalog.cpp create mode 100644 vendor/warcraftxl/src/game/Catalog.hpp create mode 100644 vendor/warcraftxl/src/game/adt/Adt.hpp create mode 100644 vendor/warcraftxl/src/game/camera/Camera.hpp create mode 100644 vendor/warcraftxl/src/game/doodad/Doodad.hpp create mode 100644 vendor/warcraftxl/src/game/gx/Gx.cpp create mode 100644 vendor/warcraftxl/src/game/gx/Gx.hpp create mode 100644 vendor/warcraftxl/src/game/io/Io.hpp create mode 100644 vendor/warcraftxl/src/game/m2/M2.hpp create mode 100644 vendor/warcraftxl/src/game/mem/Mem.hpp create mode 100644 vendor/warcraftxl/src/game/sound/Sound.hpp create mode 100644 vendor/warcraftxl/src/game/ui/Ui.hpp create mode 100644 vendor/warcraftxl/src/game/unit/Unit.hpp create mode 100644 vendor/warcraftxl/src/game/wmo/Wmo.hpp create mode 100644 vendor/warcraftxl/src/game/world/Loading.hpp create mode 100644 vendor/warcraftxl/src/game/world/Pick.hpp create mode 100644 vendor/warcraftxl/src/game/world/World.hpp create mode 100644 vendor/warcraftxl/src/gpu/Capture.cpp create mode 100644 vendor/warcraftxl/src/gpu/Capture.hpp create mode 100644 vendor/warcraftxl/src/gpu/Device.cpp create mode 100644 vendor/warcraftxl/src/gpu/Device.hpp create mode 100644 vendor/warcraftxl/src/gpu/Present.cpp create mode 100644 vendor/warcraftxl/src/gpu/Present.hpp create mode 100644 vendor/warcraftxl/src/gpu/Proxy.cpp create mode 100644 vendor/warcraftxl/src/gpu/Proxy.def create mode 100644 vendor/warcraftxl/src/gpu/Proxy.hpp create mode 100644 vendor/warcraftxl/src/host/Host.cpp create mode 100644 vendor/warcraftxl/src/host/Host.hpp create mode 100644 vendor/warcraftxl/src/host/Profile.cpp create mode 100644 vendor/warcraftxl/src/host/Profile.hpp create mode 100644 vendor/warcraftxl/src/host/ipc/Protocol.hpp create mode 100644 vendor/warcraftxl/src/host/ipc/ShmServer.cpp create mode 100644 vendor/warcraftxl/src/host/ipc/ShmServer.hpp create mode 100644 vendor/warcraftxl/src/host/main.cpp create mode 100644 vendor/warcraftxl/src/host/mpq/MpqStore.cpp create mode 100644 vendor/warcraftxl/src/host/mpq/MpqStore.hpp create mode 100644 vendor/warcraftxl/src/offsets/Offsets.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Camera.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Draw.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Frame.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Gx.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Io.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Lua.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Mem.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Shader.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Sound.hpp create mode 100644 vendor/warcraftxl/src/offsets/engine/Ui.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/ADT.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/DB2.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/Doodad.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/GroundEffect.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/M2.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/Unit.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/WMO.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/World.hpp create mode 100644 vendor/warcraftxl/src/offsets/game/WorldScene.hpp create mode 100644 vendor/warcraftxl/src/overlay/Panels.cpp create mode 100644 vendor/warcraftxl/src/overlay/Panels.hpp create mode 100644 vendor/warcraftxl/src/patcher/Main.cpp create mode 100644 vendor/warcraftxl/src/patcher/PatchScript.cpp create mode 100644 vendor/warcraftxl/src/patcher/PatchScript.hpp create mode 100644 vendor/warcraftxl/src/patcher/PeImage.cpp create mode 100644 vendor/warcraftxl/src/patcher/PeImage.hpp create mode 100644 vendor/warcraftxl/src/runtime/AssetProfile.cpp create mode 100644 vendor/warcraftxl/src/runtime/AssetProfile.hpp create mode 100644 vendor/warcraftxl/src/runtime/GameHooks.cpp create mode 100644 vendor/warcraftxl/src/runtime/GameHooks.hpp create mode 100644 vendor/warcraftxl/src/runtime/InputHooks.cpp create mode 100644 vendor/warcraftxl/src/runtime/InputHooks.hpp create mode 100644 vendor/warcraftxl/src/runtime/LuaBindings.cpp create mode 100644 vendor/warcraftxl/src/runtime/LuaBindings.hpp create mode 100644 vendor/warcraftxl/src/runtime/ModuleInstall.cpp create mode 100644 vendor/warcraftxl/src/runtime/ModuleInstall.hpp create mode 100644 vendor/warcraftxl/src/runtime/PhasingHooks.cpp create mode 100644 vendor/warcraftxl/src/runtime/PhasingHooks.hpp create mode 100644 vendor/warcraftxl/src/runtime/RenderHooks.cpp create mode 100644 vendor/warcraftxl/src/runtime/RenderHooks.hpp create mode 100644 vendor/warcraftxl/src/runtime/db2/Db2.cpp create mode 100644 vendor/warcraftxl/src/runtime/db2/Db2.hpp create mode 100644 vendor/warcraftxl/src/runtime/db2/ItemDisplayIndex.cpp create mode 100644 vendor/warcraftxl/src/runtime/db2/ItemDisplayIndex.hpp create mode 100644 vendor/warcraftxl/src/runtime/db2/Wdc5.cpp create mode 100644 vendor/warcraftxl/src/runtime/db2/Wdc5.hpp create mode 100644 vendor/warcraftxl/src/runtime/storage/ShmClient.cpp create mode 100644 vendor/warcraftxl/src/runtime/storage/ShmClient.hpp create mode 100644 vendor/warcraftxl/src/runtime/storage/StorageHook.cpp create mode 100644 vendor/warcraftxl/src/runtime/storage/StorageHook.hpp create mode 100644 vendor/warcraftxl/src/structure/m2/M2Format.hpp create mode 100644 vendor/warcraftxl/wxl.json diff --git a/.gitmodules b/.gitmodules index 461366c..15911c0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,3 @@ -[submodule "vendor/warcraftxl"] - path = vendor/warcraftxl - url = https://github.com/WarcraftXL/wxl-core.git - branch = main [submodule "vendor/modules/wxl-modern-assets"] path = vendor/modules/wxl-modern-assets url = https://github.com/WarcraftXL/wxl-modern-assets.git diff --git a/vendor/warcraftxl b/vendor/warcraftxl deleted file mode 160000 index ee9d8a9..0000000 --- a/vendor/warcraftxl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ee9d8a92a34faf708678873a643a4bfe8ec1cea5 diff --git a/vendor/warcraftxl/.gitignore b/vendor/warcraftxl/.gitignore new file mode 100644 index 0000000..b2262d0 --- /dev/null +++ b/vendor/warcraftxl/.gitignore @@ -0,0 +1,69 @@ +# Prerequisites +*.d + +# Compiled Object files +*.slo +*.lo +*.o +*.obj + +# Precompiled Headers +*.gch +*.pch + +# Linker files +*.ilk + +# Debugger Files +*.pdb + +# Compiled Dynamic libraries +*.so +*.dylib +*.dll +*.so.* + + +# Fortran module files +*.mod +*.smod + +# Compiled Static libraries +*.lai +*.la +*.a +*.lib + +# Executables +*.exe +*.out +*.app + +# Build directories +build/ +Build/ +build-*/ + +# CMake generated files +CMakeFiles/ +CMakeCache.txt +cmake_install.cmake +Makefile +install_manifest.txt +compile_commands.json + +# Temporary files +*.tmp +*.log +*.bak +*.swp + +# vcpkg +vcpkg_installed/ + +# debug information files +*.dwo + +# test output & cache +Testing/ +.cache/ \ No newline at end of file diff --git a/vendor/warcraftxl/CMakeLists.txt b/vendor/warcraftxl/CMakeLists.txt new file mode 100644 index 0000000..58683e2 --- /dev/null +++ b/vendor/warcraftxl/CMakeLists.txt @@ -0,0 +1,205 @@ +# WarcraftXL. Two artifact families share this tree and cannot share one toolchain platform, so the file +# is platform-aware: configure -A Win32 for the injected DLL + patcher + proxy (32-bit), and -A x64 with +# -DWXL_BUILD_HOST=ON for the asset host (64-bit). build.ps1 drives both. +# Copyright (C) 2026 WarcraftXL. GPLv3 (see source headers). + +cmake_minimum_required(VERSION 3.20) +project(WarcraftXL LANGUAGES CXX) + +# Static CRT everywhere: the DLLs load inside the player's Wow.exe and the host runs standalone on +# machines that have no reason to carry the toolset's brand-new VC++ redistributable. A dynamic CRT +# turns a missing/stale redist into a loader failure at process start (0xc0000142) with no log at all. +set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>") + +# The 64-bit asset host (WarcraftXLHost.exe) is opt-in: OFF by default so a contributor who only wants the +# DLL needs no x64 toolchain and pays no build/deploy cost. build.ps1 -Host flips it on in an x64 configure. +option(WXL_BUILD_HOST "Build WarcraftXLHost.exe (64-bit asset host)" OFF) + +# wxl-modern-assets per-format toggles: exclude an entire format pipeline (source down-convert, both its +# DLL and host halves) at configure time, without touching source. common/ and textures/dds stay in +# unconditionally (shared infrastructure, not format-specific). ADT gets WXL_MODERN_ADT here once it +# migrates into wxl-modern-assets. +option(WXL_MODERN_M2 "Build wxl-modern-assets M2 support" ON) +option(WXL_MODERN_M3 "Build wxl-modern-assets M3 support" ON) +option(WXL_MODERN_WMO "Build wxl-modern-assets WMO support" ON) +option(WXL_MODERN_BLP "Build wxl-modern-assets BLP/texture support" ON) + +set(WXL_MODERN_ASSETS_EXCLUDE_REGEX "") +if(NOT WXL_MODERN_M2) + string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/models/m2/") +endif() +if(NOT WXL_MODERN_M3) + string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/models/m3/") +endif() +if(NOT WXL_MODERN_WMO) + string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/models/wmo/") +endif() +if(NOT WXL_MODERN_BLP) + string(APPEND WXL_MODERN_ASSETS_EXCLUDE_REGEX "|/wxl-modern-assets/(shared|host|src)/textures/blp/") +endif() +string(REGEX REPLACE "^\\|" "" WXL_MODERN_ASSETS_EXCLUDE_REGEX "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # feeds the IDE the real C++20 flags + +set(WXL_DEFS WIN32_LEAN_AND_MEAN NOMINMAX _CRT_SECURE_NO_WARNINGS) + +# Client directory to deploy the built artifacts into. Passed by build.ps1 (-DCLIENT_PATH=...) and cached. +set(CLIENT_PATH "" CACHE PATH "Client folder the built artifacts are copied into after each build") + +# ============================================================================= +# 32-bit family (injected into the client): WarcraftXL.dll + wxl-patcher.exe + d3d9.dll +# ============================================================================= +if(CMAKE_SIZEOF_VOID_P EQUAL 4) + # --- Automatic, recursive source discovery (no hand-written paths) ----------------------------- + # CONFIGURE_DEPENDS re-globs at build time, so dropping a file (or a whole script) needs no edit here. + # The DLL excludes the patcher/host/gpu trees; the host (64-bit) takes its own slice in the EQUAL 8 block. + file(GLOB_RECURSE WXL_CORE_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp") + list(FILTER WXL_CORE_SRC EXCLUDE REGEX "/src/(patcher|host|gpu)/") + + # ========================================================================= + # Target 1: WarcraftXL.dll (32-bit, injected) = SDK + runtime scripts + # runtime scripts live in scripts/*/src/*.cpp; the cross-target byte-transform a module shares with + # the host lives in scripts/*/shared/*.cpp. Both compile straight into the DLL (self-registering). + # ========================================================================= + file(GLOB_RECURSE WXL_RUNTIME_SCRIPT CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/src/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/shared/*.cpp") + if(WXL_MODERN_ASSETS_EXCLUDE_REGEX) + list(FILTER WXL_RUNTIME_SCRIPT EXCLUDE REGEX "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") + endif() + + # Vendored ImGui (core + dx9/win32 backends). Compiled in but DORMANT until a script wires it up. + file(GLOB WXL_IMGUI CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/deps/imgui/*.cpp") + + # FlatBuffers runtime (flexbuffers string utils) for the host IPC client (runtime/storage). + set(WXL_FLATBUFFERS "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/src/util.cpp") + + add_library(WarcraftXL SHARED ${WXL_CORE_SRC} ${WXL_RUNTIME_SCRIPT} ${WXL_IMGUI} ${WXL_FLATBUFFERS}) + set_target_properties(WarcraftXL PROPERTIES OUTPUT_NAME "WarcraftXL" PREFIX "") + target_include_directories(WarcraftXL PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/src" + "${CMAKE_CURRENT_SOURCE_DIR}/deps/minhook/include" + "${CMAKE_CURRENT_SOURCE_DIR}/deps/imgui" + "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/include") + + add_subdirectory(deps/minhook) + target_link_libraries(WarcraftXL PRIVATE minhook d3d9 d3dcompiler shell32 delayimp) + # D3D12 and the shader compiler are feature-path dependencies (post-fx, grass capture, liquid + # shaders), not boot dependencies. Delay-loading keeps the DLL loadable on machines without them; + # every call site resolves or guards availability before touching those paths. + target_link_options(WarcraftXL PRIVATE "/DELAYLOAD:d3d12.dll" "/DELAYLOAD:d3dcompiler_47.dll") + target_compile_definitions(WarcraftXL PRIVATE ${WXL_DEFS}) + + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${WXL_CORE_SRC} ${WXL_RUNTIME_SCRIPT}) + + # Deploy: copy the freshly linked DLL into the client folder after every build. + if(CLIENT_PATH) + add_custom_command(TARGET WarcraftXL POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${CLIENT_PATH}/WarcraftXL.dll" + COMMENT "Deploy WarcraftXL.dll -> ${CLIENT_PATH}") + endif() + + # Per-module CMake hook: a module may ship scripts//module.cmake to extend the WarcraftXL target + # (add a vendored library, extra include dirs, link libraries). The file runs with the target defined + # and ${CMAKE_CURRENT_LIST_DIR} pointing at the module folder. Optional; most modules need none. + file(GLOB WXL_MODULE_CMAKES CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/module.cmake") + foreach(_wxl_module ${WXL_MODULE_CMAKES}) + include("${_wxl_module}") + endforeach() + + # ========================================================================= + # Target 2: wxl-patcher.exe = the offline PE patcher + patcher scripts + # ========================================================================= + file(GLOB WXL_PATCHER_CORE CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/patcher/*.cpp") + file(GLOB_RECURSE WXL_PATCHER_SCRIPT CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/patcher/*.cpp") + + # src/common/ compiles into every binary (leveled logger, env config, shared helpers): the + # patcher and proxy do not link core, and the host is another architecture, so the shared + # infrastructure is object-level, not a link dependency. + file(GLOB WXL_COMMON_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.cpp") + + add_executable(wxl-patcher ${WXL_PATCHER_CORE} ${WXL_PATCHER_SCRIPT} ${WXL_COMMON_SRC}) + set_target_properties(wxl-patcher PROPERTIES OUTPUT_NAME "wxl-patcher") + target_include_directories(wxl-patcher PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") + target_compile_definitions(wxl-patcher PRIVATE ${WXL_DEFS}) + + # ========================================================================= + # Target 3: d3d9.dll = the D3D9On12 proxy + # ========================================================================= + file(GLOB WXL_GPU_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/*.cpp") + + add_library(d3d9 SHARED ${WXL_GPU_SRC} ${WXL_COMMON_SRC}) + set_target_properties(d3d9 PROPERTIES OUTPUT_NAME "d3d9" PREFIX "") + target_include_directories(d3d9 PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/src") + target_link_libraries(d3d9 PRIVATE d3d12 dxgi dcomp d3dcompiler delayimp) + # The proxy must load on every machine Wow.exe runs on -- it shadows a static import of the exe, so + # a hard dependency of the proxy is a hard dependency of the game (loader failure 0xc0000142 on + # machines without D3D12). All On12/D3D12 machinery is delay-loaded; EnsureDevice() checks that + # d3d12.dll is actually present before the first delay-loaded call, else the proxy runs as a pure + # native pass-through. + target_link_options(d3d9 PRIVATE "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/src/gpu/Proxy.def" + "/DELAYLOAD:d3d12.dll" "/DELAYLOAD:dxgi.dll" "/DELAYLOAD:dcomp.dll" "/DELAYLOAD:d3dcompiler_47.dll") + target_compile_definitions(d3d9 PRIVATE ${WXL_DEFS}) + + # Deploy: copy the freshly linked proxy into the client folder after every build. + if(CLIENT_PATH) + add_custom_command(TARGET d3d9 POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${CLIENT_PATH}/d3d9.dll" + COMMENT "Deploy d3d9.dll -> ${CLIENT_PATH}") + endif() +endif() + +# ============================================================================= +# 64-bit family (opt-in): WarcraftXLHost.exe = archive owner + IPC transport. +# Format-blind: src/host/ + the modules' scripts/*/host/ handlers + their scripts/*/shared/ transforms. +# StormLib + FlatBuffers (deps/). Requires an x64 toolchain. +# ============================================================================= +if(WXL_BUILD_HOST AND CMAKE_SIZEOF_VOID_P EQUAL 8) + # StormLib (vendored) supplies MPQ reading. Static, read-only use; no install/tests. + set(STORM_SKIP_INSTALL ON CACHE BOOL "" FORCE) + set(STORM_BUILD_TESTS OFF CACHE BOOL "" FORCE) + set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE) + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/deps/stormlib" "${CMAKE_BINARY_DIR}/stormlib") + + file(GLOB_RECURSE WXL_HOST_CORE CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/host/*.cpp") + file(GLOB_RECURSE WXL_HOST_SCRIPT CONFIGURE_DEPENDS + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/host/*.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/scripts/*/shared/*.cpp") + if(WXL_MODERN_ASSETS_EXCLUDE_REGEX) + list(FILTER WXL_HOST_SCRIPT EXCLUDE REGEX "${WXL_MODERN_ASSETS_EXCLUDE_REGEX}") + endif() + + # The shared infrastructure (leveled logger, env config) compiles straight into the host too. + file(GLOB WXL_COMMON_SRC CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/common/*.cpp") + + add_executable(WarcraftXLHost + ${WXL_HOST_CORE} + ${WXL_HOST_SCRIPT} + ${WXL_COMMON_SRC} + "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/src/util.cpp") + set_target_properties(WarcraftXLHost PROPERTIES OUTPUT_NAME "WarcraftXLHost") + target_include_directories(WarcraftXLHost PRIVATE + "${CMAKE_CURRENT_SOURCE_DIR}/src" + "${CMAKE_CURRENT_SOURCE_DIR}/src/host" + "${CMAKE_CURRENT_SOURCE_DIR}/deps/flatbuffers/include" + "${CMAKE_CURRENT_SOURCE_DIR}/deps/stormlib/src") + target_link_libraries(WarcraftXLHost PRIVATE storm) + target_compile_definitions(WarcraftXLHost PRIVATE ${WXL_DEFS} WXL_HOST=1) + + source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES ${WXL_HOST_CORE} ${WXL_HOST_SCRIPT}) + + # Deploy the host into the client's Utils folder after build. + if(CLIENT_PATH) + add_custom_command(TARGET WarcraftXLHost POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${CLIENT_PATH}/Utils" + COMMAND ${CMAKE_COMMAND} -E copy_if_different "$" "${CLIENT_PATH}/Utils/WarcraftXLHost.exe" + COMMENT "Deploy WarcraftXLHost.exe -> ${CLIENT_PATH}/Utils") + endif() +endif() + +# A 64-bit configure that did not ask for the host builds nothing; nudge toward the right flags. +if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT WXL_BUILD_HOST) + message(WARNING "x64 configure without -DWXL_BUILD_HOST=ON builds nothing; the 32-bit family needs -A Win32.") +endif() diff --git a/vendor/warcraftxl/COPYING b/vendor/warcraftxl/COPYING new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/vendor/warcraftxl/COPYING @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/vendor/warcraftxl/LICENSE b/vendor/warcraftxl/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/vendor/warcraftxl/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/vendor/warcraftxl/README.md b/vendor/warcraftxl/README.md new file mode 100644 index 0000000..dc7788a --- /dev/null +++ b/vendor/warcraftxl/README.md @@ -0,0 +1,126 @@ +# WarcraftXL + +**A modding framework for the World of Warcraft 3.3.5a (build 12340) client.** + +WarcraftXL loads into the running client and gives mods a clean, typed way to talk to the engine - +the same idea as RED4ext for Cyberpunk 2077 or SKSE for Skyrim. The framework owns the hard, +repetitive parts (getting into the process, the hook engine, client offsets, engine bindings, an +event bus, file-format contracts); your mods - here called **modules / scripts** - own the actual features. + +> **Core principle.** If something is needed everywhere and always works the same way, it belongs in +> the core. Anything that is a *feature* - a decision, an effect, an editor - is a module. The core +> stays small and reusable; the modules stay free to do whatever they want. + +## How it works + +`WarcraftXL.dll` is the framework. It boots inside the client, brings up the hook engine, and raises +a set of events. Each module is a small self-contained unit under `scripts/` that subscribes to those +events and uses the core's bindings to read and drive the game. Drop a module in, rebuild, and it is +live - no separate injector, no patched data files. + +The core is organised as four pillars, so a module never touches a raw address itself: + +| Pillar | Namespace | What it gives a module | +|---|---|---| +| **Offsets** | `wxl::offsets` | The curated client addresses and struct layouts. Internal - modules never include these directly. | +| **Bindings** | `wxl::game` | Typed, zero-overhead calls into engine functions (`Native(addr)(args...)`) plus an enumerable catalog of `{name, address, signature}`. | +| **Events** | `wxl::events` | A POD-dispatch event bus. A module subclasses `EventScript` and binds member functions with `on<&Self::OnEndScene>(Event::OnEndScene)`. | +| **Assets** | `wxl::asset` | In-memory contracts for the client's file formats (ADT, WMO, M2, WDT, WDL) so modules read structured data, not byte soup. | + +A module looks like this - bind in the constructor, react in the handler: + +```cpp +class MyModule final : public wxl::events::EventScript { +public: + MyModule() { on<&MyModule::OnEndScene>(wxl::events::Event::OnEndScene); } + void OnEndScene(const wxl::events::EndSceneArgs& a) { /* draw, read world, edit... */ } +}; +MyModule g_myModule; // file-scope instance self-registers at load +``` + +## Layout + +``` +src/ +├── core/ Hook · Logger · Mem · Main process bring-up, hook engine, entry point +├── offsets/ engine/ · game/ client addresses + struct layouts (internal) +├── game/ camera · doodad · world · ui typed engine bindings (the wxl::game pillar) +│ m2 · wmo · adt · unit · gx · +│ io · mem ... +├── events/ Event · EventScript the event bus + the module base class +├── asset/ adt · wmo · m2 · wdt · wdl file-format contracts +├── services/ asset higher-level services over the pillars +└── runtime/ RenderHooks per-frame / device hooks the events ride on + +scripts/ the modules (each builds into WarcraftXL.dll) +├── wxl-mini-noggit an in-client map editor (ImGui + 3D gizmo): pick a doodad, move/rotate/scale it +├── wxl-unit-outline a unit outline / highlight effect +└── wxl-glue-unlock glue-screen unlock + +deps/ vendored: MinHook, Dear ImGui + ImGuizmo, StormLib, FlatBuffers +``` + +Every address the bindings rely on lives in `src/offsets/`, named and annotated. The reasoning behind +each one is kept in the project's RE documentation - the code follows it. + +## Building + +The target client is a 32-bit process, so everything builds **Win32**. + +**Requirements** +- CMake ≥ 3.25 +- A Win32 C++17 toolchain (Visual Studio 2022 recommended) +- A legally-obtained 3.3.5a (12340) client + +```sh +cmake -B build +cmake --build build --config Release --target WarcraftXL +``` + +Output: `WarcraftXL.dll`. Vendored dependencies build with the project. + +## Install + +1. Place `WarcraftXL.dll` next to `Wow.exe` and load it into the client (import-table entry / loader). +2. Launch. The framework writes a startup log on bootstrap - check it to confirm modules came up. + +Each client process launches its own `WarcraftXLHost.exe` session (IPC named objects are scoped by +the Wow.exe PID), so multiple concurrent clients do not share a mailbox. + +> Modifying a client binary is on you: work on a **copy**, keep an untouched backup, and only point +> this at a client and server you are permitted to modify and connect to. + +## Contributors + +Thanks to everyone who has helped shape WarcraftXL, with code, reverse-engineering, ideas, or feedback: + +- [Furioz](https://github.com/Furioz420) +- [Tester](https://github.com/TesterWoWDev) +- [Duskhaven](https://git.duskhaven.net/Duskhaven) + +## Support + +**WarcraftXL is free, and it always will be - forever.** Nothing here is gated, and nothing ever +will be. Sponsoring is completely optional - just a way to support the project and the time behind +it, if you want to and can. + +

+ Sponsor iThorgrim +

+ +## Legal + +WarcraftXL is an **interoperability project**. It distributes no Blizzard code and no game assets, and +runs only against a client you supply and own, reading that client's own files at runtime. +Reverse-engineering is limited to what is necessary for interoperability. + +World of Warcraft and Wrath of the Lich King are trademarks of Blizzard Entertainment. This project is +not affiliated with or endorsed by Blizzard. + +## License + +Released under the **GNU General Public License v3.0** - see [LICENSE](LICENSE). + +Bundles [MinHook](https://github.com/TsudaKageyu/minhook) (© Tsuda Kageyu, BSD 2-Clause), +[Dear ImGui](https://github.com/ocornut/imgui) + [ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo), +and [StormLib](https://github.com/ladislav-zezula/StormLib) under `deps/`, with their licenses retained. diff --git a/vendor/warcraftxl/build.ps1 b/vendor/warcraftxl/build.ps1 new file mode 100644 index 0000000..66ce14b --- /dev/null +++ b/vendor/warcraftxl/build.ps1 @@ -0,0 +1,135 @@ +#requires -Version 5.1 +<# +.SYNOPSIS + Build + deploy WarcraftXL: WarcraftXL.dll (injected), d3d9.dll (proxy) and wxl-patcher.exe (32-bit). + +.PARAMETER Config + Build configuration. Default: Release. + +.PARAMETER ClientPath + Client directory to deploy into. Optional once it has been cached by a first run. + +.PARAMETER Clean + Delete the build directory before configuring (forces a from-scratch build). + +.PARAMETER AutoPatch + After the build, run wxl-patcher on the client's Wow.exe. The patcher is idempotent + (it skips an already-patched exe and backs the original up to Wow.exe.orig on first run). + +.EXAMPLE + .\build.ps1 +.EXAMPLE + .\build.ps1 -ClientPath "D:\Path\To\Client" -Clean +.EXAMPLE + .\build.ps1 -AutoPatch +#> +param( + [string]$Config = "Release", + [string]$ClientPath, + [switch]$Clean, + [switch]$AutoPatch = true, + [switch]$BuildHost +) + +$ErrorActionPreference = "Stop" + +$root = $PSScriptRoot +$buildDir = Join-Path $root "build\dll" +$buildHostDir = Join-Path $root "build\host" + +if (-not (Test-Path (Join-Path $root "CMakeLists.txt"))) { + throw "CMakeLists.txt is missing from '$root'. Place build.ps1 in the project root directory (next to CMakeLists.txt)." +} + +function Get-CachedClientPath([string]$cacheDir) { + $cache = Join-Path $cacheDir "CMakeCache.txt" + if (Test-Path $cache) { + $hit = Select-String -Path $cache -Pattern '^CLIENT_PATH:PATH=(.+)$' | Select-Object -First 1 + if ($hit) { return $hit.Matches[0].Groups[1].Value.Trim() } + } + return $null +} + +if (-not $ClientPath) { + $ClientPath = Get-CachedClientPath $buildDir +} +if (-not $ClientPath) { + throw "No client path is known. Run the command once with -ClientPath '' (it will be stored in the CMake cache)." +} +if (-not (Test-Path $ClientPath)) { + throw "Client path not found: $ClientPath" +} + +Write-Host "Project : $root" +Write-Host "Client : $ClientPath" +Write-Host "Config : $Config" +Write-Host "" + +function Invoke-Native([string]$exe, [string[]]$cmdArgs) { + Write-Host ">> $exe $($cmdArgs -join ' ')" -ForegroundColor Cyan + $prev = $ErrorActionPreference + $ErrorActionPreference = "Continue" + try { & $exe @cmdArgs } finally { $ErrorActionPreference = $prev } + if ($LASTEXITCODE -ne 0) { throw "Failure ($LASTEXITCODE): $exe $($cmdArgs -join ' ')" } +} + +function Build-Dll { + Write-Host "=== WarcraftXL.dll (32-bit) ===" -ForegroundColor Green + + if ($Clean -and (Test-Path $buildDir)) { + Write-Host "Clean $buildDir" -ForegroundColor Yellow + Remove-Item -Recurse -Force $buildDir + } + + $needConfigure = $Clean ` + -or $PSBoundParameters.ContainsKey('ClientPath') ` + -or (-not (Test-Path (Join-Path $buildDir "CMakeCache.txt"))) + if ($needConfigure) { + Invoke-Native "cmake" @("-S", $root, "-B", $buildDir, "-A", "Win32", "-DCLIENT_PATH=$ClientPath") + } + + Invoke-Native "cmake" @("--build", $buildDir, "--config", $Config, "--parallel") + Write-Host "" +} + +function Build-Host { + Write-Host "=== WarcraftXLHost.exe (64-bit) ===" -ForegroundColor Green + + if ($Clean -and (Test-Path $buildHostDir)) { + Write-Host "Clean $buildHostDir" -ForegroundColor Yellow + Remove-Item -Recurse -Force $buildHostDir + } + + $needConfigure = $Clean ` + -or $PSBoundParameters.ContainsKey('ClientPath') ` + -or (-not (Test-Path (Join-Path $buildHostDir "CMakeCache.txt"))) + if ($needConfigure) { + Invoke-Native "cmake" @("-S", $root, "-B", $buildHostDir, "-A", "x64", "-DWXL_BUILD_HOST=ON", "-DCLIENT_PATH=$ClientPath") + } + + Invoke-Native "cmake" @("--build", $buildHostDir, "--config", $Config, "--parallel") + Write-Host "" +} + +function Invoke-AutoPatch { + $patcher = Join-Path $buildDir "$Config\wxl-patcher.exe" + if (-not (Test-Path $patcher)) { $patcher = Join-Path $ClientPath "wxl-patcher.exe" } + if (-not (Test-Path $patcher)) { + throw "wxl-patcher.exe not found. Build first (.\build.ps1)." + } + $wow = Join-Path $ClientPath "Wow.exe" + if (-not (Test-Path $wow)) { throw "Wow.exe not found: $wow" } + + Write-Host "=== AutoPatch ===" -ForegroundColor Green + Invoke-Native $patcher @($wow) + Write-Host "" +} + +$sw = [System.Diagnostics.Stopwatch]::StartNew() + +Build-Dll +if ($BuildHost) { Build-Host } +if ($AutoPatch) { Invoke-AutoPatch } + +$sw.Stop() +Write-Host "OK - build + deploy in $([int]$sw.Elapsed.TotalSeconds)s -> $ClientPath" -ForegroundColor Green diff --git a/vendor/warcraftxl/deps/README b/vendor/warcraftxl/deps/README new file mode 100644 index 0000000..69d8db0 --- /dev/null +++ b/vendor/warcraftxl/deps/README @@ -0,0 +1,9 @@ +Vendored third-party dependencies (self-contained). + +Contents: + stormlib/ - MPQ archive access. Used by: host (MpqStore). Built via add_subdirectory. + flatbuffers/ - FlexBuffers payloads for the IPC contract. Used by: host + DLL (ipc/). + Header-only for our use plus src/util.cpp compiled into the host. + minhook/ - inline detour engine. Used by: DLL only (core/Hook). Wired with the DLL target. + +These are the only external dependencies. \ No newline at end of file diff --git a/vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml b/vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml new file mode 100644 index 0000000..7c07ba6 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.bazelci/presubmit.yml @@ -0,0 +1,60 @@ +--- +buildifier: latest +matrix: + bazel: + - 7.x + - 8.x +tasks: + verify_ubuntu2004: + platform: ubuntu2004 + bazel: ${{ bazel }} + environment: + CC: clang + SWIFT_VERSION: "5.10" + SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" + PATH: "$PATH:$SWIFT_HOME/usr/bin" + shell_commands: + - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" + - "mkdir $SWIFT_HOME" + - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2004/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu20.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" + build_targets: + - "//..." + test_targets: + - "//..." + verify_ubuntu2204: + platform: ubuntu2204 + bazel: ${{ bazel }} + environment: + CC: clang + SWIFT_VERSION: "5.10" + SWIFT_HOME: "$HOME/swift-$SWIFT_VERSION" + PATH: "$PATH:$SWIFT_HOME/usr/bin" + shell_commands: + - "echo --- Downloading and extracting Swift $SWIFT_VERSION to $SWIFT_HOME" + - "mkdir $SWIFT_HOME" + - "curl https://download.swift.org/swift-${SWIFT_VERSION}-release/ubuntu2204/swift-${SWIFT_VERSION}-RELEASE/swift-${SWIFT_VERSION}-RELEASE-ubuntu22.04.tar.gz | tar xvz --strip-components=1 -C $SWIFT_HOME" + build_targets: + - "//..." + test_targets: + - "//..." + test_module_cpp: + platform: ubuntu2204 + bazel: ${{ bazel }} + working_directory: tests/bazel_repository_test_dir + build_targets: + - "//..." + test_module_ts: + platform: ubuntu2204 + bazel: ${{ bazel }} + working_directory: tests/ts/bazel_repository_test_dir + test_targets: + - "//..." + verify_macos: + platform: macos + bazel: ${{ bazel }} + xcode_version: "15.2" + build_targets: + - "//:flatbuffers" + - "//:flatc" + test_targets: + - "//tests:flatbuffers_test" diff --git a/vendor/warcraftxl/deps/flatbuffers/.bazelignore b/vendor/warcraftxl/deps/flatbuffers/.bazelignore new file mode 100644 index 0000000..874adf9 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.bazelignore @@ -0,0 +1,5 @@ +ts/node_modules + +# Test workspaces +tests/bazel_repository_test_dir +tests/ts/bazel_repository_test_dir diff --git a/vendor/warcraftxl/deps/flatbuffers/.bazelrc b/vendor/warcraftxl/deps/flatbuffers/.bazelrc new file mode 100644 index 0000000..a02667e --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.bazelrc @@ -0,0 +1,18 @@ +# We cannot use "common" here because the "version" command doesn't support +# --deleted_packages. We need to specify it for both build and query instead. +build --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir +query --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir +# Point tools such as coursier (used in rules_jvm_external) to Bazel's internal JDK +# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445 +common --repo_env=JAVA_HOME=../bazel_tools/jdk +common --action_env=JAVA_HOME=../bazel_tools/jdk +# Workaround "Error: need --enable_runfiles on Windows for to support rules_js" +common:windows --enable_runfiles +# Swift is not required on Windows +common:windows --deleted_packages=swift +# Ignore warnings in external dependencies +build --per_file_copt=external/.*@-Wno-everything --host_per_file_copt=external/.*@-Wno-everything +# Honor the setting of `skipLibCheck` in the tsconfig.json file. +common --@aspect_rules_ts//ts:skipLibCheck=honor_tsconfig +# Use "tsc" as the transpiler when ts_project has no `transpiler` set. +common --@aspect_rules_ts//ts:default_to_tsc_transpiler diff --git a/vendor/warcraftxl/deps/flatbuffers/.clang-format b/vendor/warcraftxl/deps/flatbuffers/.clang-format new file mode 100644 index 0000000..bb2e344 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: Google +... + diff --git a/vendor/warcraftxl/deps/flatbuffers/.clang-tidy b/vendor/warcraftxl/deps/flatbuffers/.clang-tidy new file mode 100644 index 0000000..7e9c1b7 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.clang-tidy @@ -0,0 +1,347 @@ +--- +FormatStyle: "file" +WarningsAsErrors: "*" +HeaderFilterRegex: ".*" +Checks: "google-build-explicit-make-pair, + google-build-namespaces, + google-build-using-namespace, + google-default-arguments, + google-explicit-constructor, + google-global-names-in-headers, + google-objc-avoid-nsobject-new, + google-objc-avoid-throwing-exception, + google-objc-function-naming, + google-objc-global-variable-declaration, + google-readability-avoid-underscore-in-googletest-name, + google-readability-braces-around-statements, + google-readability-casting, + google-readability-function-size, + google-readability-namespace-comments, + google-runtime-int, + google-runtime-operator, + google-upgrade-googletest-case, + clang-analyzer-apiModeling.StdCLibraryFunctions, + clang-analyzer-apiModeling.TrustNonnull, + clang-analyzer-apiModeling.google.GTest, + clang-analyzer-apiModeling.llvm.CastValue, + clang-analyzer-apiModeling.llvm.ReturnValue, + clang-analyzer-core.CallAndMessage, + clang-analyzer-core.CallAndMessageModeling, + clang-analyzer-core.DivideZero, + clang-analyzer-core.DynamicTypePropagation, + clang-analyzer-core.NonNullParamChecker, + clang-analyzer-core.NonnilStringConstants, + clang-analyzer-core.NullDereference, + clang-analyzer-core.StackAddrEscapeBase, + clang-analyzer-core.StackAddressEscape, + clang-analyzer-core.UndefinedBinaryOperatorResult, + clang-analyzer-core.VLASize, + clang-analyzer-core.builtin.BuiltinFunctions, + clang-analyzer-core.builtin.NoReturnFunctions, + clang-analyzer-core.uninitialized.ArraySubscript, + clang-analyzer-core.uninitialized.Assign, + clang-analyzer-core.uninitialized.Branch, + clang-analyzer-core.uninitialized.CapturedBlockVariable, + clang-analyzer-core.uninitialized.UndefReturn, + clang-analyzer-cplusplus.InnerPointer, + clang-analyzer-cplusplus.Move, + clang-analyzer-cplusplus.NewDelete, + clang-analyzer-cplusplus.NewDeleteLeaks, + clang-analyzer-cplusplus.PlacementNew, + clang-analyzer-cplusplus.PureVirtualCall, + clang-analyzer-cplusplus.SelfAssignment, + clang-analyzer-cplusplus.SmartPtrModeling, + clang-analyzer-cplusplus.StringChecker, + clang-analyzer-cplusplus.VirtualCallModeling, + clang-analyzer-deadcode.DeadStores, + clang-analyzer-fuchsia.HandleChecker, + clang-analyzer-nullability.NullPassedToNonnull, + clang-analyzer-nullability.NullReturnedFromNonnull, + clang-analyzer-nullability.NullabilityBase, + clang-analyzer-nullability.NullableDereferenced, + clang-analyzer-nullability.NullablePassedToNonnull, + clang-analyzer-nullability.NullableReturnedFromNonnull, + clang-analyzer-optin.cplusplus.UninitializedObject, + clang-analyzer-optin.cplusplus.VirtualCall, + clang-analyzer-optin.mpi.MPI-Checker, + clang-analyzer-optin.osx.OSObjectCStyleCast, + clang-analyzer-optin.osx.cocoa.localizability.EmptyLocalizationContextChecker, + clang-analyzer-optin.osx.cocoa.localizability.NonLocalizedStringChecker, + clang-analyzer-optin.performance.GCDAntipattern, + clang-analyzer-optin.performance.Padding, + clang-analyzer-optin.portability.UnixAPI, + clang-analyzer-osx.API, + clang-analyzer-osx.MIG, + clang-analyzer-osx.NSOrCFErrorDerefChecker, + clang-analyzer-osx.NumberObjectConversion, + clang-analyzer-osx.OSObjectRetainCount, + clang-analyzer-osx.ObjCProperty, + clang-analyzer-osx.SecKeychainAPI, + clang-analyzer-osx.cocoa.AtSync, + clang-analyzer-osx.cocoa.AutoreleaseWrite, + clang-analyzer-osx.cocoa.ClassRelease, + clang-analyzer-osx.cocoa.Dealloc, + clang-analyzer-osx.cocoa.IncompatibleMethodTypes, + clang-analyzer-osx.cocoa.Loops, + clang-analyzer-osx.cocoa.MissingSuperCall, + clang-analyzer-osx.cocoa.NSAutoreleasePool, + clang-analyzer-osx.cocoa.NSError, + clang-analyzer-osx.cocoa.NilArg, + clang-analyzer-osx.cocoa.NonNilReturnValue, + clang-analyzer-osx.cocoa.ObjCGenerics, + clang-analyzer-osx.cocoa.RetainCount, + clang-analyzer-osx.cocoa.RetainCountBase, + clang-analyzer-osx.cocoa.RunLoopAutoreleaseLeak, + clang-analyzer-osx.cocoa.SelfInit, + clang-analyzer-osx.cocoa.SuperDealloc, + clang-analyzer-osx.cocoa.UnusedIvars, + clang-analyzer-osx.cocoa.VariadicMethodTypes, + clang-analyzer-osx.coreFoundation.CFError, + clang-analyzer-osx.coreFoundation.CFNumber, + clang-analyzer-osx.coreFoundation.CFRetainRelease, + clang-analyzer-osx.coreFoundation.containers.OutOfBounds, + clang-analyzer-osx.coreFoundation.containers.PointerSizedValues, + clang-analyzer-security.FloatLoopCounter, + clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling, + clang-analyzer-security.insecureAPI.SecuritySyntaxChecker, + clang-analyzer-security.insecureAPI.UncheckedReturn, + clang-analyzer-security.insecureAPI.bcmp, + clang-analyzer-security.insecureAPI.bcopy, + clang-analyzer-security.insecureAPI.bzero, + clang-analyzer-security.insecureAPI.decodeValueOfObjCType, + clang-analyzer-security.insecureAPI.getpw, + clang-analyzer-security.insecureAPI.gets, + clang-analyzer-security.insecureAPI.mkstemp, + clang-analyzer-security.insecureAPI.mktemp, + clang-analyzer-security.insecureAPI.rand, + clang-analyzer-security.insecureAPI.strcpy, + clang-analyzer-security.insecureAPI.vfork, + clang-analyzer-unix.API, + clang-analyzer-unix.DynamicMemoryModeling, + clang-analyzer-unix.Malloc, + clang-analyzer-unix.MallocSizeof, + clang-analyzer-unix.MismatchedDeallocator, + clang-analyzer-unix.Vfork, + clang-analyzer-unix.cstring.BadSizeArg, + clang-analyzer-unix.cstring.CStringModeling, + clang-analyzer-unix.cstring.NullArg, + clang-analyzer-valist.CopyToSelf, + clang-analyzer-valist.Uninitialized, + clang-analyzer-valist.Unterminated, + clang-analyzer-valist.ValistBase, + clang-analyzer-webkit.NoUncountedMemberChecker, + clang-analyzer-webkit.RefCntblBaseVirtualDtor, + clang-analyzer-webkit.UncountedLambdaCapturesChecker, + +################################################ Optional checks ################################################ + + #google-readability-todo, + #bugprone-argument-comment, + #bugprone-assert-side-effect, + #bugprone-bad-signal-to-kill-thread, + #bugprone-bool-pointer-implicit-conversion, + #bugprone-branch-clone, + #bugprone-copy-constructor-init, + #bugprone-dangling-handle, + #bugprone-dynamic-static-initializers, + #bugprone-easily-swappable-parameters, + #bugprone-exception-escape, + #bugprone-fold-init-type, + #bugprone-forward-declaration-namespace, + #bugprone-forwarding-reference-overload, + #bugprone-implicit-widening-of-multiplication-result, + #bugprone-inaccurate-erase, + #bugprone-incorrect-roundings, + #bugprone-infinite-loop, + #bugprone-integer-division, + #bugprone-lambda-function-name, + #bugprone-macro-parentheses, + #bugprone-macro-repeated-side-effects, + #bugprone-misplaced-operator-in-strlen-in-alloc, + #bugprone-misplaced-pointer-arithmetic-in-alloc, + #bugprone-misplaced-widening-cast, + #bugprone-move-forwarding-reference, + #bugprone-multiple-statement-macro, + #bugprone-narrowing-conversions, + #bugprone-no-escape, + #bugprone-not-null-terminated-result, + #bugprone-parent-virtual-call, + #bugprone-posix-return, + #bugprone-redundant-branch-condition, + #bugprone-reserved-identifier, + #bugprone-signal-handler, + #bugprone-signed-char-misuse, + #bugprone-sizeof-container, + #bugprone-sizeof-expression, + #bugprone-spuriously-wake-up-functions, + #bugprone-string-constructor, + #bugprone-string-integer-assignment, + #bugprone-string-literal-with-embedded-nul, + #bugprone-stringview-nullptr, + #bugprone-suspicious-enum-usage, + #bugprone-suspicious-include, + #bugprone-suspicious-memory-comparison, + #bugprone-suspicious-memset-usage, + #bugprone-suspicious-missing-comma, + #bugprone-suspicious-semicolon, + #bugprone-suspicious-string-compare, + #bugprone-swapped-arguments, + #bugprone-terminating-continue, + #bugprone-throw-keyword-missing, + #bugprone-too-small-loop-variable, + #bugprone-undefined-memory-manipulation, + #bugprone-undelegated-constructor, + #bugprone-unhandled-exception-at-new, + #bugprone-unhandled-self-assignment, + #bugprone-unused-raii, + #bugprone-unused-return-value, + #bugprone-use-after-move, + #bugprone-virtual-near-miss, + #cppcoreguidelines-avoid-c-arrays, + #cppcoreguidelines-avoid-goto, + #cppcoreguidelines-avoid-magic-numbers, + #cppcoreguidelines-avoid-non-const-global-variables, + #cppcoreguidelines-c-copy-assignment-signature, + #cppcoreguidelines-explicit-virtual-functions, + #cppcoreguidelines-init-variables, + #cppcoreguidelines-interfaces-global-init, + #cppcoreguidelines-macro-usage, + #cppcoreguidelines-narrowing-conversions, + #cppcoreguidelines-no-malloc, + #cppcoreguidelines-non-private-member-variables-in-classes, + #cppcoreguidelines-owning-memory, + #cppcoreguidelines-prefer-member-initializer, + #cppcoreguidelines-pro-bounds-array-to-pointer-decay, + #cppcoreguidelines-pro-bounds-constant-array-index, + #cppcoreguidelines-pro-bounds-pointer-arithmetic, + #cppcoreguidelines-pro-type-const-cast, + #cppcoreguidelines-pro-type-cstyle-cast, + #cppcoreguidelines-pro-type-member-init, + #cppcoreguidelines-pro-type-reinterpret-cast, + #cppcoreguidelines-pro-type-static-cast-downcast, + #cppcoreguidelines-pro-type-union-access, + #cppcoreguidelines-pro-type-vararg, + #cppcoreguidelines-slicing, + #cppcoreguidelines-special-member-functions, + #cppcoreguidelines-virtual-class-destructor, + #hicpp-avoid-c-arrays, + #hicpp-avoid-goto, + #hicpp-braces-around-statements, + #hicpp-deprecated-headers, + #hicpp-exception-baseclass, + #hicpp-explicit-conversions, + #hicpp-function-size, + #hicpp-invalid-access-moved, + #hicpp-member-init, + #hicpp-move-const-arg, + #hicpp-multiway-paths-covered, + #hicpp-named-parameter, + #hicpp-new-delete-operators, + #hicpp-no-array-decay, + #hicpp-no-assembler, + #hicpp-no-malloc, + #hicpp-noexcept-move, + #hicpp-signed-bitwise, + #hicpp-special-member-functions, + #hicpp-static-assert, + #hicpp-undelegated-constructor, + #hicpp-uppercase-literal-suffix, + #hicpp-use-auto, + #hicpp-use-emplace, + #hicpp-use-equals-default, + #hicpp-use-equals-delete, + #hicpp-use-noexcept, + #hicpp-use-nullptr, + #hicpp-use-override, + #hicpp-vararg, + #modernize-avoid-bind, + #modernize-avoid-c-arrays, + #modernize-concat-nested-namespaces, + #modernize-deprecated-headers, + #modernize-deprecated-ios-base-aliases, + #modernize-loop-convert, + #modernize-make-shared, + #modernize-make-unique, + #modernize-pass-by-value, + #modernize-raw-string-literal, + #modernize-redundant-void-arg, + #modernize-replace-auto-ptr, + #modernize-replace-disallow-copy-and-assign-macro, + #modernize-replace-random-shuffle, + #modernize-return-braced-init-list, + #modernize-shrink-to-fit, + #modernize-unary-static-assert, + #modernize-use-auto, + #modernize-use-bool-literals, + #modernize-use-default-member-init, + #modernize-use-emplace, + #modernize-use-equals-default, + #modernize-use-equals-delete, + #modernize-use-nodiscard, + #modernize-use-noexcept, + #modernize-use-nullptr, + #modernize-use-override, + #modernize-use-trailing-return-type, + #modernize-use-transparent-functors, + #modernize-use-uncaught-exceptions, + #modernize-use-using, + #performance-faster-string-find, + #performance-for-range-copy, + #performance-implicit-conversion-in-loop, + #performance-inefficient-algorithm, + #performance-inefficient-string-concatenation, + #performance-inefficient-vector-operation, + #performance-move-const-arg, + #performance-move-constructor-init, + #performance-no-automatic-move, + #performance-no-int-to-ptr, + #performance-noexcept-move-constructor, + #performance-trivially-destructible, + #performance-type-promotion-in-math-fn, + #performance-unnecessary-copy-initialization, + #performance-unnecessary-value-param, + #portability-restrict-system-includes, + #portability-simd-intrinsics, + #readability-avoid-const-params-in-decls, + #readability-braces-around-statements, + #readability-const-return-type, + #readability-container-contains, + #readability-container-data-pointer, + #readability-container-size-empty, + #readability-convert-member-functions-to-static, + #readability-delete-null-pointer, + #readability-duplicate-include, + #readability-else-after-return, + #readability-function-cognitive-complexity, + #readability-function-size, + #readability-identifier-length, + #readability-identifier-naming, + #readability-implicit-bool-conversion, + #readability-inconsistent-declaration-parameter-name, + #readability-isolate-declaration, + #readability-magic-numbers, + #readability-make-member-function-const, + #readability-misleading-indentation, + #readability-misplaced-array-index, + #readability-named-parameter, + #readability-non-const-parameter, + #readability-qualified-auto, + #readability-redundant-access-specifiers, + #readability-redundant-control-flow, + #readability-redundant-declaration, + #readability-redundant-function-ptr-dereference, + #readability-redundant-member-init, + #readability-redundant-preprocessor, + #readability-redundant-smartptr-get, + #readability-redundant-string-cstr, + #readability-redundant-string-init, + #readability-simplify-boolean-expr, + #readability-simplify-subscript-expr, + #readability-static-accessed-through-instance, + #readability-static-definition-in-anonymous-namespace, + #readability-string-compare, + #readability-suspicious-call-argument, + #readability-uniqueptr-delete-release, + #readability-uppercase-literal-suffix, + #readability-use-anyofallof + " diff --git a/vendor/warcraftxl/deps/flatbuffers/.editorconfig b/vendor/warcraftxl/deps/flatbuffers/.editorconfig new file mode 100644 index 0000000..6689bab --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.editorconfig @@ -0,0 +1,8 @@ +root = true +# Don't set line endings to avoid conflict with core.autocrlf flag. +# Line endings on checkout/checkin are controlled by .gitattributes file. +[*] +indent_style = space +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true diff --git a/vendor/warcraftxl/deps/flatbuffers/.gitattributes b/vendor/warcraftxl/deps/flatbuffers/.gitattributes new file mode 100644 index 0000000..4cab1f4 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.gitattributes @@ -0,0 +1,2 @@ +# Set the default behavior, in case people don't have core.autocrlf set. +* text=auto diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS b/vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS new file mode 100644 index 0000000..d84592d --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/CODEOWNERS @@ -0,0 +1,5 @@ +# Default owner +* @dbaileychess derekbailey@google.com + +# Prevent modification of this file +.github/CODEOWNERS @dbaileychess derekbailey@google.com diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md b/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..a053fe4 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,12 @@ +Thank you for submitting an issue! + +Please make sure you include the names of the affected language(s), compiler version(s), operating system version(s), and FlatBuffers version(s) in your issue title. + +This helps us get the correct maintainers to look at your issue. Here are examples of good titles: + +- Crash when accessing FlatBuffer [C++, gcc 4.8, OS X, master] +- Flatc converts a protobuf 'bytes' field to 'string' in fbs schema file [all languages, FlatBuffers 1.4] + +Include other details as appropriate. + +Thanks! diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md b/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md new file mode 100644 index 0000000..c394d38 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/ISSUE_TEMPLATE/404-doc.md @@ -0,0 +1,11 @@ +--- +name: 404 Doc +about: To fix broken documentation links +title: "[Doc 404]" +labels: documentation +assignees: dbaileychess + +--- + +Target URL: +[Optional] Source Site: diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md b/vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..b8cc0ce --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,19 @@ +Thank you for submitting a PR! + +Please delete this standard text once you've created your own description. + +If you make changes to any of the code generators (`src/idl_gen*`) be sure to +[build](https://google.github.io/flatbuffers/flatbuffers_guide_building.html) your project, as it will generate code based on the changes. If necessary +the code generation script can be directly run (`scripts/generate_code.py`), +requires Python3. This allows us to better see the effect of the PR. + +If your PR includes C++ code, please adhere to the +[Google C++ Style Guide](https://google.github.io/styleguide/cppguide.html), +and don't forget we try to support older compilers (e.g. VS2010, GCC 4.6.3), +so only some C++11 support is available. + +For any C++ changes, please make sure to run `sh scripts/clang-format-git.sh` + +Include other details as appropriate. + +Thanks! diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml b/vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml b/vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml new file mode 100644 index 0000000..ccc9757 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/labeler.yml @@ -0,0 +1,137 @@ +# Configuration for Auto Labeler during pull request +# +# See https://github.com/actions/labeler for file format +# and https://github.com/google/flatbuffers/labels for a list of valid labels +# +# See .github/workflows/label.yml for Github Action workflow script + +"c#": + - changed-files: + - any-glob-to-any-file: + - '**/*.cs' + - 'net/**/*' + - 'tests/FlatBuffers.Test/**/*' + - 'tests/FlatBuffers.Benchmarks/**/*' + - 'src/idl_gen_csharp.cpp' + +swift: + - changed-files: + - any-glob-to-any-file: + - '**/*.swift' + - 'swift/**/*' + - 'tests/swift/**' + - 'src/idl_gen_swift.cpp' + +nim: + - changed-files: + - any-glob-to-any-file: + - '**/*.nim' + - 'nim/**/*' + - 'src/idl_gen_nim.cpp' + - 'src/bfbs_gen_nim.cpp' + +javascript: + - changed-files: + - any-glob-to-any-file: + - '**/*.js' + - 'src/idl_gen_ts.cpp' + +typescript: + - changed-files: + - any-glob-to-any-file: + - '**/*.ts' + - 'src/idl_gen_ts.cpp' + - 'grpc/flatbuffers-js-grpc/**/*.ts' + +golang: + - changed-files: + - any-glob-to-any-file: + - '**/*.go' + - 'src/idl_gen_go.cpp' + +python: + - changed-files: + - any-glob-to-any-file: + - '**/*.py' + - 'src/idl_gen_python.cpp' + +java: + - changed-files: + - any-glob-to-any-file: + - '**/*.java' + - 'src/idl_gen_java.cpp' + +kotlin: + - changed-files: + - any-glob-to-any-file: + - '**/*.kt' + - 'src/idl_gen_kotlin.cpp' + - 'src/idl_gen_kotlin_kmp.cpp' + +lua: + - changed-files: + - any-glob-to-any-file: + - '**/*.lua' + - 'lua/**/*' + - 'src/bfbs_gen_lua.cpp' + +lobster: + - changed-files: + - any-glob-to-any-file: + - '**/*.lobster' + - 'src/idl_gen_lobster.cpp' + +php: + - changed-files: + - any-glob-to-any-file: + - '**/*.php' + - 'src/idl_gen_php.cpp' + +rust: + - changed-files: + - any-glob-to-any-file: + - '**/*.rs' + - 'rust/**/*' + - 'src/idl_gen_rust.cpp' + +dart: + - changed-files: + - any-glob-to-any-file: + - '**/*.dart' + - 'src/idl_gen_dart.cpp' + +"c++": + - changed-files: + - any-glob-to-any-file: + - '**/*.cc' + - '**/*.cpp' + - '**/*.h' + +json: + - changed-files: + - any-glob-to-any-file: + - '**/*.json' + - 'src/idl_gen_json_schema.cpp' + +codegen: + - changed-files: + - any-glob-to-any-file: + - 'src/**/*' + +documentation: + - changed-files: + - any-glob-to-any-file: + - 'docs/**/*' + - '**/*.md' + +CI: + - changed-files: + - any-glob-to-any-file: + - '.github/**/*' + - '.bazelci/**/*' + +grpc: + - changed-files: + - any-glob-to-any-file: + - 'grpc/**/*' + - 'src/idl_gen_grpc.cpp' diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml new file mode 100644 index 0000000..810d515 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/build.yml @@ -0,0 +1,643 @@ +name: CI +permissions: read-all + +on: + # For manual tests. + workflow_dispatch: + push: + tags: + - "*" # new tag version, like `0.8.4` or else + branches: + - master + pull_request: + branches: + - master + schedule: + # Run daily at 4:45 A.M. to catch dependencies that break us. + - cron: '45 4 * * *' + +jobs: + build-linux: + permissions: + contents: write + outputs: + digests-gcc: ${{ steps.hash-gcc.outputs.hashes }} + digests-clang: ${{ steps.hash-clang.outputs.hashes }} + name: Build Linux + runs-on: ubuntu-24.04 + strategy: + matrix: + cxx: [g++-13, clang++-18] + fail-fast: false + steps: + - uses: actions/checkout@v6 + - name: cmake + run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_STATIC_FLATC=ON . + - name: build + run: make -j + - name: test + run: ./flattests + - name: make flatc executable + run: | + chmod +x flatc + ./flatc --version + - name: upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: Linux flatc binary ${{ matrix.cxx }} + path: flatc + # Below if only for release. + - name: Zip file + if: startsWith(github.ref, 'refs/tags/') + run: zip Linux.flatc.binary.${{ matrix.cxx }}.zip flatc + - name: Release zip file + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: Linux.flatc.binary.${{ matrix.cxx }}.zip + - name: Generate SLSA subjects - clang + if: matrix.cxx == 'clang++-18' && startsWith(github.ref, 'refs/tags/') + id: hash-clang + run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT + - name: Generate SLSA subjects - gcc + if: matrix.cxx == 'g++-13' && startsWith(github.ref, 'refs/tags/') + id: hash-gcc + run: echo "hashes=$(sha256sum Linux.flatc.binary.${{ matrix.cxx }}.zip | base64 -w0)" >> $GITHUB_OUTPUT + + build-linux-no-file-tests: + name: Build Linux with -DFLATBUFFERS_NO_FILE_TESTS + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: cmake + run: CXX=clang++-18 cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON -DFLATBUFFERS_CXX_FLAGS="-DFLATBUFFERS_NO_FILE_TESTS" . + - name: build + run: make -j + - name: test + run: ./flattests + + build-linux-out-of-source: + name: Build Linux with out-of-source build location + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: make build directory + run: mkdir build + - name: cmake + working-directory: build + run: > + CXX=clang++-18 cmake .. -G "Unix Makefiles" -DFLATBUFFERS_STRICT_MODE=ON + -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_CPP_STD=17 + - name: build + working-directory: build + run: make -j + - name: test + working-directory: build + run: pwd && ./flattests + - name: test C++17 + working-directory: build + run: ./flattests_cpp17 + + build-linux-cpp-std: + name: Build Linux C++ + runs-on: ubuntu-24.04 + strategy: + fail-fast: false + matrix: + std: [11, 14, 17, 20, 23] + cxx: [g++-13, clang++-18] + exclude: + # Clang++15 10.3.0 stdlibc++ doesn't fully support std 23 + - cxx: clang++-18 + std: 23 + + steps: + - uses: actions/checkout@v6 + - name: cmake + run: > + CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" + -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON + -DFLATBUFFERS_CPP_STD=${{ matrix.std }} + -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}} + - name: build + run: make -j + - name: test + run: ./flattests + - name: test C++17 + if: matrix.std >= 17 + run: ./flattests_cpp17 + + build-cpp-std: + name: Build Windows C++ + runs-on: windows-2022 + strategy: + matrix: + std: [11, 14, 17, 20, 23] + fail-fast: false + steps: + - uses: actions/checkout@v6 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + - name: cmake + run: > + cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release + -DFLATBUFFERS_STRICT_MODE=ON + -DFLATBUFFERS_CPP_STD=${{ matrix.std }} + -DFLATBUFFERS_BUILD_CPP17=${{ matrix.std >= 17 && 'On' || 'Off'}} + - name: build + run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 + - name: test + run: Release\flattests.exe + - name: test C++17 + if: matrix.std >= 17 + run: Release\flattests_cpp17.exe + + build-windows: + permissions: + contents: write + outputs: + digests: ${{ steps.hash.outputs.hashes }} + name: Build Windows 2022 + runs-on: windows-2022 + steps: + - uses: actions/checkout@v6 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + - name: cmake + run: cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON . + - name: build + run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 + - name: test + run: Release\flattests.exe + - name: upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: Windows flatc binary + path: Release\flatc.exe + # Below if only for release. + - name: Zip file + if: startsWith(github.ref, 'refs/tags/') + run: move Release/flatc.exe . && Compress-Archive flatc.exe Windows.flatc.binary.zip + - name: Release binary + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: Windows.flatc.binary.zip + - name: Generate SLSA subjects + if: startsWith(github.ref, 'refs/tags/') + id: hash + shell: bash + run: echo "hashes=$(sha256sum Windows.flatc.binary.zip | base64 -w0)" >> $GITHUB_OUTPUT + + build-dotnet-windows: + name: Build .NET Windows + runs-on: windows-2022 + strategy: + matrix: + configuration: [ + '', + '-p:UnsafeByteBuffer=true', + '-p:EnableSpanT=true,UnsafeByteBuffer=true' + ] + steps: + - uses: actions/checkout@v6 + - name: Setup .NET Core SDK + uses: actions/setup-dotnet@v5 + with: + dotnet-version: '8.0.x' + - name: Build + run: | + cd tests\FlatBuffers.Test + dotnet new sln --force --name FlatBuffers.Test --format sln + dotnet sln FlatBuffers.Test.sln add FlatBuffers.Test.csproj + dotnet build -c Release ${{matrix.configuration}} FlatBuffers.Test.sln + - name: Run net6.0 + run: | + cd tests\FlatBuffers.Test\bin\Release\net6.0 + dir + .\FlatBuffers.Test.exe + - name: Run net8.0 + run: | + cd tests\FlatBuffers.Test\bin\Release\net8.0 + .\FlatBuffers.Test.exe + + build-mac-intel: + permissions: + contents: write + outputs: + digests: ${{ steps.hash.outputs.hashes }} + name: Build Mac (for Intel) + runs-on: macos-15-intel + steps: + - uses: actions/checkout@v6 + - name: cmake + run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . + - name: build + run: xcodebuild -toolchain clang -configuration Release -target flattests + - name: check that the binary is x86_64 + run: | + info=$(file Release/flatc) + echo $info + echo $info | grep "Mach-O 64-bit executable x86_64" + - name: test + run: Release/flattests + - name: make flatc executable + run: | + chmod +x Release/flatc + Release/flatc --version + - name: upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: Mac flatc binary Intel + path: Release/flatc + # Below if only for release. + - name: Zip file + if: startsWith(github.ref, 'refs/tags/') + run: mv Release/flatc . && zip MacIntel.flatc.binary.zip flatc + - name: Release binary + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: MacIntel.flatc.binary.zip + - name: Generate SLSA subjects + if: startsWith(github.ref, 'refs/tags/') + id: hash + run: echo "hashes=$(shasum -a 256 MacIntel.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT + + build-mac-universal: + permissions: + contents: write + outputs: + digests: ${{ steps.hash.outputs.hashes }} + name: Build Mac (universal build) + runs-on: macos-latest + steps: + - uses: actions/checkout@v6 + - name: cmake + run: cmake -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . + - name: build + run: xcodebuild -toolchain clang -configuration Release -target flattests + - name: check that the binary is "universal" + run: | + info=$(file Release/flatc) + echo $info + echo $info | grep "Mach-O universal binary with 2 architectures" + - name: test + run: Release/flattests + - name: make flatc executable + run: | + chmod +x Release/flatc + Release/flatc --version + - name: upload build artifacts + uses: actions/upload-artifact@v7 + with: + name: Mac flatc binary Universal + path: Release/flatc + # Below if only for release. + - name: Zip file + if: startsWith(github.ref, 'refs/tags/') + run: mv Release/flatc . && zip Mac.flatc.binary.zip flatc + - name: Release binary + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: Mac.flatc.binary.zip + - name: Generate SLSA subjects + if: startsWith(github.ref, 'refs/tags/') + id: hash + run: echo "hashes=$(shasum -a 256 Mac.flatc.binary.zip | base64)" >> $GITHUB_OUTPUT + + build-android: + name: Build Android (on Linux) + if: false #disabled due to continual failure + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: set up Java + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + - name: set up Gradle + uses: gradle/actions/setup-gradle@v5 + - name: set up flatc + run: | + cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . + make -j + echo "${PWD}" >> $GITHUB_PATH + - name: build + working-directory: android + run: gradle clean build + + build-generator: + name: Check Generated Code + runs-on: ubuntu-24.04 + strategy: + matrix: + cxx: [g++-13, clang++-18] + steps: + - uses: actions/checkout@v6 + - name: cmake + run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j + - name: Generate + run: scripts/check_generate_code.py + - name: Generate gRPC + run: scripts/check-grpc-generated-code.py + + build-generator-windows: + name: Check Generated Code on Windows + runs-on: windows-2022 + steps: + - uses: actions/checkout@v6 + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + - name: cmake + run: cmake -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_CPP17=ON -DFLATBUFFERS_STRICT_MODE=ON . + - name: build + run: msbuild.exe FlatBuffers.sln /p:Configuration=Release /p:Platform=x64 + - name: Generate + run: python3 scripts/check_generate_code.py --flatc Release\flatc.exe + - name: Generate gRPC + run: python3 scripts/check-grpc-generated-code.py --flatc Release\flatc.exe + + build-benchmarks: + name: Build Benchmarks (on Linux) + runs-on: ubuntu-24.04 + strategy: + matrix: + cxx: [g++-13] + steps: + - uses: actions/checkout@v6 + - name: cmake + run: CXX=${{ matrix.cxx }} cmake -G "Unix Makefiles" -DFLATBUFFERS_CXX_FLAGS="-Wno-unused-parameter -fno-aligned-new" -DFLATBUFFERS_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_STRICT_MODE=ON . && make -j + - name: Run benchmarks + run: ./flatbenchmark --benchmark_repetitions=5 --benchmark_display_aggregates_only=true --benchmark_out_format=console --benchmark_out=benchmarks/results_${{matrix.cxx}} + - name: Upload benchmarks results + uses: actions/upload-artifact@v7 + with: + name: Linux flatbenchmark results ${{matrix.cxx}} + path: benchmarks/results_${{matrix.cxx}} + + build-java: + name: Build Java + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: test + working-directory: java + run: mvn test + + build-kotlin-macos: + name: Build Kotlin MacOS + runs-on: macos-15 + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: set up Java + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + - name: set up Gradle + uses: gradle/actions/setup-gradle@v5 + - name: Build flatc + run: | + cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . + make -j + echo "${PWD}" >> $GITHUB_PATH + - name: Build + working-directory: kotlin + run: ./gradlew clean iosSimulatorArm64Test macosX64Test macosArm64Test + + build-kotlin-linux: + name: Build Kotlin Linux + if: false #disabled due to continual failure + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v6 + - name: set up Java + uses: actions/setup-java@v5 + with: + distribution: temurin + java-version: 17 + - name: set up Gradle + uses: gradle/actions/setup-gradle@v5 + - name: Build flatc + run: | + cmake -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . + make -j + echo "${PWD}" >> $GITHUB_PATH + - name: Build + working-directory: kotlin + # we are using docker's version of gradle + # so no need for wrapper validation or user + # gradlew + run: gradle jvmMainClasses jvmTest jsTest jsBrowserTest + + build-rust-linux: + name: Build Rust Linux + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: test + working-directory: tests + run: bash RustTest.sh + + build-rust-windows: + name: Build Rust Windows + runs-on: windows-2022 + steps: + - uses: actions/checkout@v6 + - name: test + working-directory: tests + run: ./RustTest.bat + + build-python: + name: Build Python + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: flatc + # FIXME: make test script not rely on flatc + run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j + - name: test + working-directory: tests + run: bash PythonTest.sh + + build-go: + name: Build Go + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: flatc + # FIXME: make test script not rely on flatc + run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j + - name: test + working-directory: tests + run: bash GoTest.sh + + build-php: + name: Build PHP + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: flatc + # FIXME: make test script not rely on flatc + run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j + - name: test + working-directory: tests + run: | + php phpTest.php + sh phpUnionVectorTest.sh + + build-swift: + name: Test Swift Linux + strategy: + matrix: + swift: ["6.0", "6.1", "6.2"] + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - uses: swift-actions/setup-swift@v2 + with: + swift-version: ${{ matrix.swift }} + - name: Get swift version + run: swift --version + - name: test + run: swift test + + build-swift-windows: + name: Test swift windows + runs-on: windows-latest + steps: + - uses: actions/checkout@v6 + - uses: SwiftyLab/setup-swift@latest + with: + swift-version: '6.1' + - run: swift build + - run: swift test + + build-swift-wasm: + name: Test Swift Wasm + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - uses: swift-actions/setup-swift@v2 + with: + swift-version: 6.2.1 + - uses: bytecodealliance/actions/wasmtime/setup@v1 + - name: Install Swift SDK + run: swift sdk install https://download.swift.org/swift-6.2.1-release/wasm-sdk/swift-6.2.1-RELEASE/swift-6.2.1-RELEASE_wasm.artifactbundle.tar.gz --checksum 482b9f95462b87bedfafca94a092cf9ec4496671ca13b43745097122d20f18af + - name: Test + working-directory: tests/swift/Wasm.tests + run: | + swift sdk list + swift build --build-tests --swift-sdk swift-6.2.1-RELEASE_wasm + wasmtime --dir . .build/wasm32-unknown-wasip1/debug/FlatBuffers.Test.Swift.WasmPackageTests.xctest --testing-library swift-testing + + build-ts: + name: Build TS + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: flatc + # FIXME: make test script not rely on flatc + run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j + - name: pnpm + run: npm install -g pnpm + - name: deps + run: pnpm i + - name: compile + run: pnpm compile + - name: test + working-directory: tests/ts + run: | + python3 TypeScriptTest.py + + build-dart: + name: Build Dart + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - uses: dart-lang/setup-dart@v1 + with: + sdk: stable + - name: flatc + # FIXME: make test script not rely on flatc + run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF -DFLATBUFFERS_STRICT_MODE=ON . && make -j + - name: test + working-directory: tests + run: bash DartTest.sh + + build-nim: + name: Build Nim + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + - name: flatc + # FIXME: make test script not rely on flatc + run: cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DFLATBUFFERS_BUILD_TESTS=OFF -DFLATBUFFERS_INSTALL=OFF -DFLATBUFFERS_BUILD_FLATLIB=OFF -DFLATBUFFERS_BUILD_FLATHASH=OFF . && make -j + - uses: jiro4989/setup-nim-action@v2 + - name: install library + working-directory: nim + run: nimble -y develop && nimble install + - name: test + working-directory: tests/nim + run: python3 testnim.py + + bazel: + name: Bazel + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v6 + # Explicitly use 8.5.1 until we can update or https://github.com/actions/runner-images/issues/13564 is fixed. + - name: Set env + run: > + echo "USE_BAZEL_VERSION=8.5.1" >> $GITHUB_ENV + - name: bazel build + run: > + bazel build + //:flatc + //:flatbuffers + //tests:flatbuffers_test + - name: bazel test + run: > + bazel test + //tests:flatbuffers_test + + release-digests: + if: startsWith(github.ref, 'refs/tags/') + needs: [build-linux, build-windows, build-mac-intel, build-mac-universal] + outputs: + digests: ${{ steps.hash.outputs.digests }} + runs-on: ubuntu-24.04 + steps: + - name: Merge results + id: hash + env: + LINUXGCC_DIGESTS: "${{ needs.build-linux.outputs.digests-gcc }}" + LINUXCLANG_DIGESTS: "${{ needs.build-linux.outputs.digests-clang }}" + MAC_DIGESTS: "${{ needs.build-mac-universal.outputs.digests }}" + MACINTEL_DIGESTS: "${{ needs.build-mac-intel.outputs.digests }}" + WINDOWS_DIGESTS: "${{ needs.build-windows.outputs.digests }}" + run: | + set -euo pipefail + echo "$LINUXGCC_DIGESTS" | base64 -d > checksums.txt + echo "$LINUXCLANG_DIGESTS" | base64 -d >> checksums.txt + echo "$MAC_DIGESTS" | base64 -d >> checksums.txt + echo "$MACINTEL_DIGESTS" | base64 -d >> checksums.txt + echo "$WINDOWS_DIGESTS" | base64 -d >> checksums.txt + echo "digests=$(cat checksums.txt | base64 -w0)" >> $GITHUB_OUTPUT + + provenance: + if: startsWith(github.ref, 'refs/tags/') + needs: [release-digests] + permissions: + actions: read # To read the workflow path. + id-token: write # To sign the provenance. + contents: write # To add assets to a release. + uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0 + with: + base64-subjects: "${{ needs.release-digests.outputs.digests }}" + upload-assets: true # Optional: Upload to a new release diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml new file mode 100644 index 0000000..d92859c --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/docs.yml @@ -0,0 +1,36 @@ +name: docs +on: + # For manual pushes. + workflow_dispatch: + + # Pushes to main that touch the documentation directory. + push: + branches: + - master + paths: + - 'docs/**' + +permissions: + contents: write +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Configure Git Credentials + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + - uses: actions/setup-python@v6 + with: + python-version: 3.x + - run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV + - uses: actions/cache@v5 + with: + key: mkdocs-material-${{ env.cache_id }} + path: .cache + restore-keys: | + mkdocs-material- + - run: pip install mkdocs-material + - run: pip install mkdocs-redirects + - run: mkdocs gh-deploy --force -f docs/mkdocs.yml diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml new file mode 100644 index 0000000..d01947b --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/label.yml @@ -0,0 +1,24 @@ +# This workflow will triage pull requests and apply a label based on the +# paths that are modified in the pull request. +# +# To use this workflow, you will need to set up a .github/labeler.yml +# file with configuration. For more information, see: +# https://github.com/actions/labeler + +name: Labeler +permissions: read-all + +on: [pull_request_target] + +jobs: + label: + permissions: + contents: read + pull-requests: write + + runs-on: ubuntu-latest + + steps: + - uses: actions/labeler@v6 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml new file mode 100644 index 0000000..eb08715 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: OSS-Fuzz +permissions: read-all + +on: + pull_request: + branches: + - master + paths: + - include/** + - src/** + - tests/**.cpp + - tests/**.h +jobs: + Fuzzing: + runs-on: ubuntu-latest + steps: + - name: Build Fuzzers + id: build + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'flatbuffers' + language: c++ + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'flatbuffers' + language: c++ + fuzz-seconds: 60 + - name: Upload Crash + uses: actions/upload-artifact@v7 + if: failure() && steps.build.outcome == 'success' + with: + name: artifacts + path: ./out/artifacts diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml new file mode 100644 index 0000000..5463e5b --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/release.yml @@ -0,0 +1,152 @@ +name: Release +permissions: read-all + +on: + # For manual tests. + workflow_dispatch: + release: + types: [published] + +jobs: + publish-npm: + name: Publish NPM + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: '20.x' + registry-url: 'https://registry.npmjs.org' + + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish-pypi: + name: Publish PyPi + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./python + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: '3.10' + + - name: Install Dependencies + run: | + python3 -m pip install --upgrade pip + python3 -m pip install build twine + + - name: Build + run: | + python3 -m build . + + - name: Upload to PyPi + run: | + python3 -m twine upload dist/* + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }} + + publish-nuget: + name: Publish NuGet + runs-on: windows-latest + defaults: + run: + working-directory: ./net/flatbuffers + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-dotnet@v5 + with: + dotnet-version: '8.0.x' + - name: Build + run: | + dotnet build Google.FlatBuffers.csproj -c Release + + - name: Pack + run: | + dotnet pack Google.FlatBuffers.csproj -c Release + + - name: Upload to NuGet + run: | + dotnet nuget push .\bin\Release\Google.FlatBuffers.*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json + + publish-maven: + name: Publish Maven + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./java + steps: + - uses: actions/checkout@v6 + + - name: Set up Maven Central Repository + uses: actions/setup-java@v5 + with: + java-version: '11' + distribution: 'adopt' + cache: 'maven' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var + + - name: Publish Maven + run: mvn --batch-mode clean deploy + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USER_V2 }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN_V2 }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + publish-maven-kotlin: + name: Publish Maven - Kotlin + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./kotlin + steps: + - uses: actions/checkout@v6 + - name: Set up Maven Central Repository + uses: actions/setup-java@v5 + with: + java-version: '11' + distribution: 'adopt' + cache: 'maven' + server-id: ossrh + server-username: OSSRH_USERNAME + server-password: OSSRH_PASSWORD + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE # this needs to be an env var + + - name: Publish Kotlin Library on Maven + run: ./gradlew publishAllPublicationsToSonatypeRepository + env: + OSSRH_USERNAME: ${{ secrets.OSSRH_USER_V2 }} + OSSRH_PASSWORD: ${{ secrets.OSSRH_TOKEN_V2 }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + + + publish-crates: + name: Publish crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish Flatbuffers + uses: katyo/publish-crates@v2 + with: + path: ./rust/flatbuffers + registry-token: ${{ secrets.CARGO_TOKEN }} + + - name: Publish Flexbuffers + uses: katyo/publish-crates@v2 + with: + path: ./rust/flexbuffers + registry-token: ${{ secrets.CARGO_TOKEN }} diff --git a/vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml new file mode 100644 index 0000000..1d35cd4 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.github/workflows/stale.yml @@ -0,0 +1,37 @@ +name: Mark stale issues and pull requests +permissions: + issues: write + pull-requests: write + +on: + # For manual tests. + workflow_dispatch: + schedule: + - cron: "30 20 * * *" + +jobs: + stale: + + runs-on: ubuntu-latest + + steps: + - uses: actions/stale@v10 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + operations-per-run: 500 + exempt-all-milestones: true + remove-stale-when-updated: true + + stale-issue-message: 'This issue is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.' + close-issue-message: 'This issue was automatically closed due to no activity for 6 months plus the 14 day notice period.' + days-before-issue-stale: 182 # 6 months + days-before-issue-close: 14 # 2 weeks + exempt-issue-labels: not-stale + + stale-pr-message: 'This pull request is stale because it has been open 6 months with no activity. Please comment or label `not-stale`, or this will be closed in 14 days.' + close-pr-message: 'This pull request was automatically closed due to no activity for 6 months plus the 14 day notice period.' + days-before-pr-stale: 182 # 6 months + days-before-pr-close: 14 # 2 week + exempt-pr-labels: not-stale + exempt-draft-pr: false + diff --git a/vendor/warcraftxl/deps/flatbuffers/.gitignore b/vendor/warcraftxl/deps/flatbuffers/.gitignore new file mode 100644 index 0000000..f27c9b4 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.gitignore @@ -0,0 +1,162 @@ +*_wire.txt +*_wire.bin +.DS_Store +**/.build +build +**/Packages +/*.xcodeproj +**/xcuserdata/ +**/xcshareddata/ +**/.swiftpm/ +*.o +*.o.d +*.class +*.a +*.swp +*~ +*.vcxproj +*.vcxproj.filters +*.vcxproj.user +*.sln +*.suo +*.opendb +*.keystore +**/.vs/** +**/bin/** +!tests/rust_usage_test/bin/** +**/gen/** +**/libs/** +**/obj/** +**/*.dir/** +**/CMakeFiles/** +**/cmake_install.cmake +**/install_manifest.txt +**/CMakeCache.txt +**/CMakeTestfile.cmake +**/CPackConfig.cmake +**/CPackSourceConfig.cmake +**/compile_commands.json +**/Debug/** +**/Release/** +**/RelWithDebInfo/** +**/x64/ #build artifacts from VS +build.xml +local.properties +project.properties +proguard-project.txt +linklint_results +Makefile +flatbenchmark +flatbenchmark.exe +flatc +flatc.exe +flathash +flathash.exe +flattests +flattests.exe +flattests_cpp17 +flattests_cpp17.exe +flatsamplebinary +flatsamplebinary.exe +flatsampletext +flatsampletext.exe +flatsamplebfbs +flatsamplebfbs.exe +grpctest +grpctest.exe +snapshot.sh +tags +tests/dart_gen +tests/go_gen +tests/monsterdata_java_wire.mon +tests/monsterdata_java_wire_sp.mon +tests/monsterdata_go_wire.mon +tests/monsterdata_javascript_wire.mon +tests/monsterdata_lobster_wire.mon +tests/monsterdata_rust_wire.mon +tests/php/ +CMakeLists.txt.user +CMakeScripts/** +CTestTestfile.cmake +flatbuffers-config-version.cmake +FlatBuffers.cbp +build/Xcode/FlatBuffers.xcodeproj/project.xcworkspace/** +build/Xcode/FlatBuffers.xcodeproj/xcuserdata/** +FlatBuffers.xcodeproj/ +java/.idea +java/*.iml +.idea +*.iml +target +java/target +**/*.pyc +build/VS2010/FlatBuffers.sdf +build/VS2010/FlatBuffers.opensdf +build/VS2010/ipch/**/*.ipch +*.so +Testing/Temporary +.cproject +.settings/ +.project +net/**/obj +node_modules/ +android/.externalNativeBuild/ +android/.gradle/ +android/build/ +samples/android/.externalNativeBuild/ +samples/android/.gradle/ +samples/android/build/ +js/**/*.js +js/**/*.d.ts +mjs/**/*.js +mjs/**/*.d.ts +/bazel-bin +/bazel-flatbuffers +/bazel-genfiles +/bazel-out +/bazel-testlogs +.ninja_deps +.ninja_log +build.ninja +rules.ninja +.vscode +dart/.pub/ +dart/.packages +dart/pubspec.lock +dart/.dart_tool/ +dart/build/ +dart/doc/api/ +Cargo.lock +.corpus** +.seed** +.crash** +grpc/google/ +**/Package.resolved +.clangd/** +package-lock.json +/*.ilk +/*.pdb +.clwb +yarn-error.log +.cache/ +/flatbuffers.lib +.cmake/ +**/dist +**/vendor +**/go.sum +flatbuffers.pc +**/FlatBuffers.Test.Swift.xcodeproj +**/html/** +**/latex/** +# https://cmake.org/cmake/help/latest/module/FetchContent.html#variable:FETCHCONTENT_BASE_DIR +cmake-build-debug/ +_deps/ +**/.gradle/** +kotlin/**/generated +MODULE.bazel.lock + +# Ignore the generated docs +docs/site + +# Ignore generated files +*.fbs.h diff --git a/vendor/warcraftxl/deps/flatbuffers/.npmrc b/vendor/warcraftxl/deps/flatbuffers/.npmrc new file mode 100644 index 0000000..84ff079 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/.npmrc @@ -0,0 +1 @@ +hoist=false diff --git a/vendor/warcraftxl/deps/flatbuffers/LICENSE b/vendor/warcraftxl/deps/flatbuffers/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/LICENSE @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel b/vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel new file mode 100644 index 0000000..196181b --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/codegen/BUILD.bazel @@ -0,0 +1,39 @@ +load("@rules_cc//cc:defs.bzl", "cc_library") + +package( + default_visibility = ["//visibility:private"], +) + +filegroup( + name = "distribution", + srcs = [ + "BUILD.bazel", + ] + glob([ + "*.cc", + "*.h", + ]), + visibility = ["//visibility:public"], +) + +cc_library( + name = "namer", + hdrs = [ + "idl_namer.h", + "namer.h", + ], + strip_include_prefix = "/include", + visibility = ["//:__subpackages__"], + deps = ["//:runtime_cc"], +) + +cc_library( + name = "python", + srcs = ["python.cc"], + hdrs = ["python.h"], + strip_include_prefix = "/include", + visibility = [ + "//grpc:__subpackages__", + "//src:__subpackages__", + ], + deps = [":namer"], +) diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h b/vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h new file mode 100644 index 0000000..2aa716e --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/codegen/idl_namer.h @@ -0,0 +1,181 @@ +#ifndef FLATBUFFERS_INCLUDE_CODEGEN_IDL_NAMER_H_ +#define FLATBUFFERS_INCLUDE_CODEGEN_IDL_NAMER_H_ + +#include "codegen/namer.h" +#include "flatbuffers/idl.h" + +namespace flatbuffers { + +// Provides Namer capabilities to types defined in the flatbuffers IDL. +class IdlNamer : public Namer { + public: + explicit IdlNamer(Config config, std::set keywords) + : Namer(config, std::move(keywords)) {} + + using Namer::Constant; + using Namer::Directories; + using Namer::Field; + using Namer::File; + using Namer::Function; + using Namer::Method; + using Namer::Namespace; + using Namer::NamespacedType; + using Namer::ObjectType; + using Namer::Type; + using Namer::Variable; + using Namer::Variant; + + std::string Constant(const FieldDef& d) const { return Constant(d.name); } + + // Types are always structs or enums so we can only expose these two + // overloads. + std::string Type(const StructDef& d) const { return Type(d.name); } + std::string Type(const EnumDef& d) const { return Type(d.name); } + + std::string Function(const Definition& s) const { return Function(s.name); } + std::string Function(const std::string& prefix, const Definition& s) const { + return Function(prefix + s.name); + } + + std::string Field(const FieldDef& s) const { return Field(s.name); } + std::string Field(const FieldDef& d, const std::string& s) const { + return Field(d.name + "_" + s); + } + + std::string Variable(const FieldDef& s) const { return Variable(s.name); } + + std::string Variable(const StructDef& s) const { return Variable(s.name); } + + std::string Variant(const EnumVal& s) const { return Variant(s.name); } + + std::string EnumVariant(const EnumDef& e, const EnumVal& v) const { + return Type(e) + config_.enum_variant_seperator + Variant(v); + } + + std::string ObjectType(const StructDef& d) const { + return ObjectType(d.name); + } + std::string ObjectType(const EnumDef& d) const { return ObjectType(d.name); } + + std::string Method(const FieldDef& d, const std::string& suffix) const { + return Method(d.name, suffix); + } + std::string Method(const std::string& prefix, const StructDef& d) const { + return Method(prefix, d.name); + } + std::string Method(const std::string& prefix, const FieldDef& d) const { + return Method(prefix, d.name); + } + std::string Method(const std::string& prefix, const FieldDef& d, + const std::string& suffix) const { + return Method(prefix, d.name, suffix); + } + + std::string Namespace(const struct Namespace& ns) const { + return Namespace(ns.components); + } + + std::string NamespacedEnumVariant(const EnumDef& e, const EnumVal& v) const { + return NamespacedString(e.defined_namespace, EnumVariant(e, v)); + } + + std::string NamespacedType(const Definition& def) const { + return NamespacedString(def.defined_namespace, Type(def.name)); + } + + std::string NamespacedObjectType(const Definition& def) const { + return NamespacedString(def.defined_namespace, ObjectType(def.name)); + } + + std::string Directories(const struct Namespace& ns, + SkipDir skips = SkipDir::None, + Case input_case = Case::kUpperCamel) const { + return Directories(ns.components, skips, input_case); + } + + // Legacy fields do not really follow the usual config and should be + // considered for deprecation. + + std::string LegacyRustNativeVariant(const EnumVal& v) const { + return ConvertCase(EscapeKeyword(v.name), Case::kUpperCamel); + } + + std::string LegacyRustFieldOffsetName(const FieldDef& field) const { + return "VT_" + ConvertCase(EscapeKeyword(field.name), Case::kAllUpper); + } + std::string LegacyRustUnionTypeOffsetName(const FieldDef& field) const { + return "VT_" + + ConvertCase(EscapeKeyword(field.name + "_type"), Case::kAllUpper); + } + + std::string LegacySwiftVariant(const EnumVal& ev) const { + auto name = ev.name; + if (isupper(name.front())) { + std::transform(name.begin(), name.end(), name.begin(), CharToLower); + } + return EscapeKeyword(ConvertCase(name, Case::kLowerCamel)); + } + + // Also used by Kotlin, lol. + std::string LegacyJavaMethod2(const std::string& prefix, const StructDef& sd, + const std::string& suffix) const { + return prefix + sd.name + suffix; + } + + std::string LegacyKotlinVariant(EnumVal& ev) const { + // Namer assumes the input case is snake case which is wrong... + return ConvertCase(EscapeKeyword(ev.name), Case::kLowerCamel); + } + // Kotlin methods escapes keywords after case conversion but before + // prefixing and suffixing. + std::string LegacyKotlinMethod(const std::string& prefix, const FieldDef& d, + const std::string& suffix) const { + return prefix + ConvertCase(EscapeKeyword(d.name), Case::kUpperCamel) + + suffix; + } + std::string LegacyKotlinMethod(const std::string& prefix, const StructDef& d, + const std::string& suffix) const { + return prefix + ConvertCase(EscapeKeyword(d.name), Case::kUpperCamel) + + suffix; + } + + // This is a mix of snake case and keep casing, when Ts should be using + // lower camel case. + std::string LegacyTsMutateMethod(const FieldDef& d) { + return "mutate_" + d.name; + } + + std::string LegacyRustUnionTypeMethod(const FieldDef& d) { + // assert d is a union + // d should convert case but not escape keywords due to historical reasons + return ConvertCase(d.name, config_.fields, Case::kLowerCamel) + "_type"; + } + + private: + std::string NamespacedString(const struct Namespace* ns, + const std::string& str) const { + std::string ret; + if (ns != nullptr) { + ret += Namespace(ns->components); + } + if (!ret.empty()) ret += config_.namespace_seperator; + return ret + str; + } +}; + +// This is a temporary helper function for code generators to call until all +// flag-overriding logic into flatc.cpp +inline Namer::Config WithFlagOptions(const Namer::Config& input, + const IDLOptions& opts, + const std::string& path) { + Namer::Config result = input; + result.object_prefix = opts.object_prefix; + result.object_suffix = opts.object_suffix; + result.output_path = path; + result.filename_suffix = opts.filename_suffix; + return result; +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_INCLUDE_CODEGEN_IDL_NAMER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h b/vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h new file mode 100644 index 0000000..d447b56 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/codegen/namer.h @@ -0,0 +1,286 @@ +#ifndef FLATBUFFERS_INCLUDE_CODEGEN_NAMER_H_ +#define FLATBUFFERS_INCLUDE_CODEGEN_NAMER_H_ + +#include "flatbuffers/util.h" + +namespace flatbuffers { + +// Options for Namer::File. +enum class SkipFile { + None = 0, + Suffix = 1, + Extension = 2, + SuffixAndExtension = 3, +}; +inline SkipFile operator&(SkipFile a, SkipFile b) { + return static_cast(static_cast(a) & static_cast(b)); +} +// Options for Namer::Directories +enum class SkipDir { + None = 0, + // Skip prefixing the -o $output_path. + OutputPath = 1, + // Skip trailing path seperator. + TrailingPathSeperator = 2, + OutputPathAndTrailingPathSeparator = 3, +}; +inline SkipDir operator&(SkipDir a, SkipDir b) { + return static_cast(static_cast(a) & static_cast(b)); +} + +// `Namer` applies style configuration to symbols in generated code. It manages +// casing, escapes keywords, and object API naming. +// TODO: Refactor all code generators to use this. +class Namer { + public: + struct Config { + // Symbols in code. + + // Case style for flatbuffers-defined types. + // e.g. `class TableA {}` + Case types; + // Case style for flatbuffers-defined constants. + // e.g. `uint64_t ENUM_A_MAX`; + Case constants; + // Case style for flatbuffers-defined methods. + // e.g. `class TableA { int field_a(); }` + Case methods; + // Case style for flatbuffers-defined functions. + // e.g. `TableA* get_table_a_root()`; + Case functions; + // Case style for flatbuffers-defined fields. + // e.g. `struct Struct { int my_field; }` + Case fields; + // Case style for flatbuffers-defined variables. + // e.g. `int my_variable = 2` + Case variables; + // Case style for flatbuffers-defined variants. + // e.g. `enum class Enum { MyVariant, }` + Case variants; + // Seperator for qualified enum names. + // e.g. `Enum::MyVariant` uses `::`. + std::string enum_variant_seperator; + + // Configures, when formatting code, whether symbols are checked against + // keywords and escaped before or after case conversion. It does not make + // sense to do so before, but its legacy behavior. :shrug: + // TODO(caspern): Deprecate. + enum class Escape { + BeforeConvertingCase, + AfterConvertingCase, + }; + Escape escape_keywords; + + // Namespaces + + // e.g. `namespace my_namespace {}` + Case namespaces; + // The seperator between namespaces in a namespace path. + std::string namespace_seperator; + + // Object API. + // Native versions flatbuffers types have this prefix. + // e.g. "" (it's usually empty string) + std::string object_prefix; + // Native versions flatbuffers types have this suffix. + // e.g. "T" + std::string object_suffix; + + // Keywords. + // Prefix used to escape keywords. It is usually empty string. + std::string keyword_prefix; + // Suffix used to escape keywords. It is usually "_". + std::string keyword_suffix; + // The casing used for keywords when escaping. For most languages, keywords + // are case sensitive. PHP is an instance where some keywords are case + // insensitive. + enum class KeywordsCasing { + CaseSensitive, + CaseInsensitive, + }; + KeywordsCasing keywords_casing; + + // Files. + + // Case style for filenames. e.g. `foo_bar_generated.rs` + Case filenames; + // Case style for directories, e.g. `output_files/foo_bar/baz/` + Case directories; + // The directory within which we will generate files. + std::string output_path; + // Suffix for generated file names, e.g. "_generated". + std::string filename_suffix; + // Extension for generated files, e.g. ".cpp" or ".rs". + std::string filename_extension; + }; + Namer(Config config, std::set keywords) + : config_(config), keywords_(std::move(keywords)) {} + + virtual ~Namer() {} + + template + std::string Method(const T& s) const { + return Method(s.name); + } + + virtual std::string Method(const std::string& pre, const std::string& mid, + const std::string& suf) const { + return Format(pre + "_" + mid + "_" + suf, config_.methods); + } + virtual std::string Method(const std::string& pre, + const std::string& suf) const { + return Format(pre + "_" + suf, config_.methods); + } + virtual std::string Method(const std::string& s) const { + return Format(s, config_.methods); + } + + virtual std::string Constant(const std::string& s) const { + return Format(s, config_.constants); + } + + virtual std::string Function(const std::string& s) const { + return Format(s, config_.functions); + } + + virtual std::string Variable(const std::string& s) const { + return Format(s, config_.variables); + } + + template + std::string Variable(const std::string& p, const T& s) const { + return Format(p + "_" + s.name, config_.variables); + } + virtual std::string Variable(const std::string& p, + const std::string& s) const { + return Format(p + "_" + s, config_.variables); + } + + virtual std::string Namespace(const std::string& s) const { + return Format(s, config_.namespaces); + } + + virtual std::string Namespace(const std::vector& ns) const { + std::string result; + for (auto it = ns.begin(); it != ns.end(); it++) { + if (it != ns.begin()) result += config_.namespace_seperator; + result += Namespace(*it); + } + return result; + } + + virtual std::string NamespacedType(const std::vector& ns, + const std::string& s) const { + return (ns.empty() ? "" : (Namespace(ns) + config_.namespace_seperator)) + + Type(s); + } + + // Returns `filename` with the right casing, suffix, and extension. + virtual std::string File(const std::string& filename, + SkipFile skips = SkipFile::None) const { + const bool skip_suffix = (skips & SkipFile::Suffix) != SkipFile::None; + const bool skip_ext = (skips & SkipFile::Extension) != SkipFile::None; + return ConvertCase(filename, config_.filenames, Case::kUpperCamel) + + (skip_suffix ? "" : config_.filename_suffix) + + (skip_ext ? "" : config_.filename_extension); + } + template + std::string File(const T& f, SkipFile skips = SkipFile::None) const { + return File(f.name, skips); + } + + // Formats `directories` prefixed with the output_path and joined with the + // right seperator. Output path prefixing and the trailing separator may be + // skiped using `skips`. + // Callers may want to use `EnsureDirExists` with the result. + // input_case is used to tell how to modify namespace. e.g. kUpperCamel will + // add a underscode between case changes, so MyGame turns into My_Game + // (depending also on the output_case). + virtual std::string Directories(const std::vector& directories, + SkipDir skips = SkipDir::None, + Case input_case = Case::kUpperCamel) const { + const bool skip_output_path = + (skips & SkipDir::OutputPath) != SkipDir::None; + const bool skip_trailing_seperator = + (skips & SkipDir::TrailingPathSeperator) != SkipDir::None; + std::string result = skip_output_path ? "" : config_.output_path; + for (auto d = directories.begin(); d != directories.end(); d++) { + result += ConvertCase(*d, config_.directories, input_case); + result.push_back(kPathSeparator); + } + if (skip_trailing_seperator && !result.empty()) result.pop_back(); + return result; + } + + virtual std::string NormalizeKeywordCase(const std::string& name) const { + if (config_.keywords_casing == Config::KeywordsCasing::CaseInsensitive) { + return ConvertCase(name, Case::kAllLower); + } else { + return name; + } + } + + virtual std::string EscapeKeyword(const std::string& name) const { + if (keywords_.find(NormalizeKeywordCase(name)) == keywords_.end()) { + return name; + } else { + return config_.keyword_prefix + name + config_.keyword_suffix; + } + } + + virtual std::string Type(const std::string& s) const { + return Format(s, config_.types); + } + virtual std::string Type(const std::string& t, const std::string& s) const { + return Format(t + "_" + s, config_.types); + } + + virtual std::string ObjectType(const std::string& s) const { + return config_.object_prefix + Type(s) + config_.object_suffix; + } + + virtual std::string Field(const std::string& s) const { + return Format(s, config_.fields); + } + + virtual std::string Variant(const std::string& s) const { + return Format(s, config_.variants); + } + + virtual std::string Format(const std::string& s, Case casing) const { + if (config_.escape_keywords == Config::Escape::BeforeConvertingCase) { + return ConvertCase(EscapeKeyword(s), casing, Case::kLowerCamel); + } else { + return EscapeKeyword(ConvertCase(s, casing, Case::kLowerCamel)); + } + } + + // Denamespaces a string (e.g. The.Quick.Brown.Fox) by returning the last part + // after the `delimiter` (Fox) and placing the rest in `namespace_prefix` + // (The.Quick.Brown). + virtual std::string Denamespace(const std::string& s, + std::string& namespace_prefix, + const char delimiter = '.') const { + const size_t pos = s.find_last_of(delimiter); + if (pos == std::string::npos) { + namespace_prefix = ""; + return s; + } + namespace_prefix = s.substr(0, pos); + return s.substr(pos + 1); + } + + // Same as above, but disregards the prefix. + virtual std::string Denamespace(const std::string& s, + const char delimiter = '.') const { + std::string prefix; + return Denamespace(s, prefix, delimiter); + } + + const Config config_; + const std::set keywords_; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_INCLUDE_CODEGEN_NAMER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc b/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc new file mode 100644 index 0000000..3225371 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.cc @@ -0,0 +1,79 @@ +#include "codegen/python.h" + +#include +#include +#include +#include + +namespace flatbuffers { +namespace python { +Version::Version(const std::string& version) { + std::stringstream ss(version); + char dot; + ss >> major >> dot >> minor >> dot >> micro; +} + +bool Version::IsValid() const { + return (major == 0 || major == 2 || major == 3) && minor >= 0 && micro >= 0; +} + +std::set Keywords(const Version& version) { + switch (version.major) { + case 2: + // https://docs.python.org/2/reference/lexical_analysis.html#keywords + return { + "and", "as", "assert", "break", "class", "continue", "def", + "del", "elif", "else", "except", "exec", "finally", "for", + "from", "global", "if", "import", "in", "is", "lambda", + "not", "or", "pass", "print", "raise", "return", "try", + "while", "with", "yield", + }; + case 0: + case 3: + // https://docs.python.org/3/reference/lexical_analysis.html#keywords + return { + "and", "as", "assert", "async", "await", "break", + "class", "continue", "def", "del", "elif", "else", + "except", "False", "finally", "for", "from", "global", + "if", "import", "in", "is", "lambda", "None", + "nonlocal", "not", "or", "pass", "raise", "return", + "True", "try", "while", "with", "yield", + }; + default: + return {}; + } +} + +const python::Import& python::Imports::Import(const std::string& module) { + python::Import import; + import.module = module; + imports.push_back(std::move(import)); + return imports.back(); +} + +const python::Import& python::Imports::Import(const std::string& module, + const std::string& name) { + python::Import import; + import.module = module; + import.name = name; + imports.push_back(std::move(import)); + return imports.back(); +} + +const python::Import& python::Imports::Export(const std::string& module) { + python::Import import; + import.module = module; + exports.push_back(std::move(import)); + return exports.back(); +} + +const python::Import& python::Imports::Export(const std::string& module, + const std::string& name) { + python::Import import; + import.module = module; + import.name = name; + exports.push_back(std::move(import)); + return exports.back(); +} +} // namespace python +} // namespace flatbuffers diff --git a/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h b/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h new file mode 100644 index 0000000..a0a1ba8 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/codegen/python.h @@ -0,0 +1,100 @@ +#ifndef FLATBUFFERS_INCLUDE_CODEGEN_PYTHON_H_ +#define FLATBUFFERS_INCLUDE_CODEGEN_PYTHON_H_ + +#include +#include +#include +#include + +#include "codegen/namer.h" + +namespace flatbuffers { +namespace python { +static const Namer::Config kConfig = { + /*types=*/Case::kKeep, + /*constants=*/Case::kScreamingSnake, + /*methods=*/Case::kUpperCamel, + /*functions=*/Case::kUpperCamel, + /*fields=*/Case::kLowerCamel, + /*variable=*/Case::kLowerCamel, + /*variants=*/Case::kKeep, + /*enum_variant_seperator=*/".", + /*escape_keywords=*/Namer::Config::Escape::AfterConvertingCase, + /*namespaces=*/Case::kKeep, // Packages in python. + /*namespace_seperator=*/".", + /*object_prefix=*/"", + /*object_suffix=*/"T", + /*keyword_prefix=*/"", + /*keyword_suffix=*/"_", + /*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive, + /*filenames=*/Case::kKeep, + /*directories=*/Case::kKeep, + /*output_path=*/"", + /*filename_suffix=*/"", + /*filename_extension=*/".py", +}; + +static const Namer::Config kStubConfig = { + /*types=*/Case::kKeep, + /*constants=*/Case::kScreamingSnake, + /*methods=*/Case::kUpperCamel, + /*functions=*/Case::kUpperCamel, + /*fields=*/Case::kLowerCamel, + /*variables=*/Case::kLowerCamel, + /*variants=*/Case::kKeep, + /*enum_variant_seperator=*/".", + /*escape_keywords=*/Namer::Config::Escape::AfterConvertingCase, + /*namespaces=*/Case::kKeep, // Packages in python. + /*namespace_seperator=*/".", + /*object_prefix=*/"", + /*object_suffix=*/"T", + /*keyword_prefix=*/"", + /*keyword_suffix=*/"_", + /*keywords_casing=*/Namer::Config::KeywordsCasing::CaseSensitive, + /*filenames=*/Case::kKeep, + /*directories=*/Case::kKeep, + /*output_path=*/"", + /*filename_suffix=*/"", + /*filename_extension=*/".pyi", +}; + +// `Version` represent a Python version. +// +// The zero value (i.e. `Version{}`) represents both Python2 and Python3. +// +// https://docs.python.org/3/faq/general.html#how-does-the-python-version-numbering-scheme-work +struct Version { + explicit Version(const std::string& version); + + bool IsValid() const; + + int16_t major = 0; + int16_t minor = 0; + int16_t micro = 0; +}; + +std::set Keywords(const Version& version); + +struct Import { + bool IsLocal() const { return module == "."; } + + std::string module; + std::string name; +}; + +struct Imports { + const python::Import& Import(const std::string& module); + const python::Import& Import(const std::string& module, + const std::string& name); + + const python::Import& Export(const std::string& module); + const python::Import& Export(const std::string& module, + const std::string& name); + + std::vector imports; + std::vector exports; +}; +} // namespace python +} // namespace flatbuffers + +#endif // FLATBUFFERS_INCLUDE_CODEGEN_PYTHON_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h new file mode 100644 index 0000000..d451818 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/allocator.h @@ -0,0 +1,68 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_ALLOCATOR_H_ +#define FLATBUFFERS_ALLOCATOR_H_ + +#include "flatbuffers/base.h" + +namespace flatbuffers { + +// Allocator interface. This is flatbuffers-specific and meant only for +// `vector_downward` usage. +class Allocator { + public: + virtual ~Allocator() {} + + // Allocate `size` bytes of memory. + virtual uint8_t* allocate(size_t size) = 0; + + // Deallocate `size` bytes of memory at `p` allocated by this allocator. + virtual void deallocate(uint8_t* p, size_t size) = 0; + + // Reallocate `new_size` bytes of memory, replacing the old region of size + // `old_size` at `p`. In contrast to a normal realloc, this grows downwards, + // and is intended specifcally for `vector_downward` use. + // `in_use_back` and `in_use_front` indicate how much of `old_size` is + // actually in use at each end, and needs to be copied. + virtual uint8_t* reallocate_downward(uint8_t* old_p, size_t old_size, + size_t new_size, size_t in_use_back, + size_t in_use_front) { + FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows + uint8_t* new_p = allocate(new_size); + memcpy_downward(old_p, old_size, new_p, new_size, in_use_back, + in_use_front); + deallocate(old_p, old_size); + return new_p; + } + + protected: + // Called by `reallocate_downward` to copy memory from `old_p` of `old_size` + // to `new_p` of `new_size`. Only memory of size `in_use_front` and + // `in_use_back` will be copied from the front and back of the old memory + // allocation. + void memcpy_downward(uint8_t* old_p, size_t old_size, uint8_t* new_p, + size_t new_size, size_t in_use_back, + size_t in_use_front) { + memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back, + in_use_back); + memcpy(new_p, old_p, in_use_front); + } +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_ALLOCATOR_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h new file mode 100644 index 0000000..163d8c3 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/array.h @@ -0,0 +1,258 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_ARRAY_H_ +#define FLATBUFFERS_ARRAY_H_ + +#include +#include + +#include "flatbuffers/base.h" +#include "flatbuffers/stl_emulation.h" +#include "flatbuffers/vector.h" + +namespace flatbuffers { + +// This is used as a helper type for accessing arrays. +template +class Array { + // Array can carry only POD data types (scalars or structs). + typedef typename flatbuffers::bool_constant::value> + scalar_tag; + + public: + typedef uint16_t size_type; + typedef typename IndirectHelper::return_type return_type; + typedef VectorConstIterator const_iterator; + typedef VectorReverseIterator const_reverse_iterator; + + // If T is a non-pointer and a LE-scalar or a struct (!scalar_tag::value). + static FLATBUFFERS_CONSTEXPR bool is_span_observable = + !std::is_pointer::value && + ((scalar_tag::value && (FLATBUFFERS_LITTLEENDIAN || sizeof(T) == 1)) || + !scalar_tag::value); + + FLATBUFFERS_CONSTEXPR uint16_t size() const { return length; } + + return_type Get(uoffset_t i) const { + FLATBUFFERS_ASSERT(i < size()); + return IndirectHelper::Read(Data(), i); + } + + return_type operator[](uoffset_t i) const { return Get(i); } + + // If this is a Vector of enums, T will be its storage type, not the enum + // type. This function makes it convenient to retrieve value with enum + // type E. + template + E GetEnum(uoffset_t i) const { + return static_cast(Get(i)); + } + + const_iterator begin() const { return const_iterator(Data(), 0); } + const_iterator end() const { return const_iterator(Data(), size()); } + + const_reverse_iterator rbegin() const { + return const_reverse_iterator(end()); + } + const_reverse_iterator rend() const { + return const_reverse_iterator(begin()); + } + + const_iterator cbegin() const { return begin(); } + const_iterator cend() const { return end(); } + + const_reverse_iterator crbegin() const { return rbegin(); } + const_reverse_iterator crend() const { return rend(); } + + // Get a mutable pointer to elements inside this array. + // This method used to mutate arrays of structs followed by a @p Mutate + // operation. For primitive types use @p Mutate directly. + // @warning Assignments and reads to/from the dereferenced pointer are not + // automatically converted to the correct endianness. + typename flatbuffers::conditional::type + GetMutablePointer(uoffset_t i) const { + FLATBUFFERS_ASSERT(i < size()); + return const_cast(&data()[i]); + } + + // Change elements if you have a non-const pointer to this object. + void Mutate(uoffset_t i, const T& val) { MutateImpl(scalar_tag(), i, val); } + + // The raw data in little endian format. Use with care. + const uint8_t* Data() const { return data_; } + + uint8_t* Data() { return data_; } + + // Similarly, but typed, much like std::vector::data + const T* data() const { return reinterpret_cast(Data()); } + T* data() { return reinterpret_cast(Data()); } + + // Copy data from a span with endian conversion. + // If this Array and the span overlap, the behavior is undefined. + void CopyFromSpan(flatbuffers::span src) { + const auto p1 = reinterpret_cast(src.data()); + const auto p2 = Data(); + FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) && + !(p2 >= p1 && p2 < (p1 + length))); + (void)p1; + (void)p2; + CopyFromSpanImpl(flatbuffers::bool_constant(), src); + } + + protected: + void MutateImpl(flatbuffers::true_type, uoffset_t i, const T& val) { + FLATBUFFERS_ASSERT(i < size()); + WriteScalar(data() + i, val); + } + + void MutateImpl(flatbuffers::false_type, uoffset_t i, const T& val) { + *(GetMutablePointer(i)) = val; + } + + void CopyFromSpanImpl(flatbuffers::true_type, + flatbuffers::span src) { + // Use std::memcpy() instead of std::copy() to avoid performance degradation + // due to aliasing if T is char or unsigned char. + // The size is known at compile time, so memcpy would be inlined. + std::memcpy(data(), src.data(), length * sizeof(T)); + } + + // Copy data from flatbuffers::span with endian conversion. + void CopyFromSpanImpl(flatbuffers::false_type, + flatbuffers::span src) { + for (size_type k = 0; k < length; k++) { + Mutate(k, src[k]); + } + } + + // This class is only used to access pre-existing data. Don't ever + // try to construct these manually. + // 'constexpr' allows us to use 'size()' at compile time. + // @note Must not use 'FLATBUFFERS_CONSTEXPR' here, as const is not allowed on + // a constructor. +#if defined(__cpp_constexpr) + constexpr Array(); +#else + Array(); +#endif + + uint8_t data_[length * sizeof(T)]; + + private: + // This class is a pointer. Copying will therefore create an invalid object. + // Private and unimplemented copy constructor. + Array(const Array&); + Array& operator=(const Array&); +}; + +// Specialization for Array[struct] with access using Offset pointer. +// This specialization used by idl_gen_text.cpp. +template class OffsetT> +class Array, length> { + static_assert(flatbuffers::is_same::value, "unexpected type T"); + + public: + typedef const void* return_type; + typedef uint16_t size_type; + + const uint8_t* Data() const { return data_; } + + // Make idl_gen_text.cpp::PrintContainer happy. + return_type operator[](uoffset_t) const { + FLATBUFFERS_ASSERT(false); + return nullptr; + } + + private: + // This class is only used to access pre-existing data. + Array(); + Array(const Array&); + Array& operator=(const Array&); + + uint8_t data_[1]; +}; + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span(Array& arr) + FLATBUFFERS_NOEXCEPT { + static_assert( + Array::is_span_observable, + "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); + return span(arr.data(), N); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span make_span( + const Array& arr) FLATBUFFERS_NOEXCEPT { + static_assert( + Array::is_span_observable, + "wrong type U, only plain struct, LE-scalar, or byte types are allowed"); + return span(arr.data(), N); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span +make_bytes_span(Array& arr) FLATBUFFERS_NOEXCEPT { + static_assert(Array::is_span_observable, + "internal error, Array might hold only scalars or structs"); + return span(arr.Data(), sizeof(U) * N); +} + +template +FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span +make_bytes_span(const Array& arr) FLATBUFFERS_NOEXCEPT { + static_assert(Array::is_span_observable, + "internal error, Array might hold only scalars or structs"); + return span(arr.Data(), sizeof(U) * N); +} + +// Cast a raw T[length] to a raw flatbuffers::Array +// without endian conversion. Use with care. +// TODO: move these Cast-methods to `internal` namespace. +template +Array& CastToArray(T (&arr)[length]) { + return *reinterpret_cast*>(arr); +} + +template +const Array& CastToArray(const T (&arr)[length]) { + return *reinterpret_cast*>(arr); +} + +template +Array& CastToArrayOfEnum(T (&arr)[length]) { + static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); + return *reinterpret_cast*>(arr); +} + +template +const Array& CastToArrayOfEnum(const T (&arr)[length]) { + static_assert(sizeof(E) == sizeof(T), "invalid enum type E"); + return *reinterpret_cast*>(arr); +} + +template +bool operator==(const Array& lhs, + const Array& rhs) noexcept { + return std::addressof(lhs) == std::addressof(rhs) || + (lhs.size() == rhs.size() && + std::memcmp(lhs.Data(), rhs.Data(), rhs.size() * sizeof(T)) == 0); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_ARRAY_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h new file mode 100644 index 0000000..1d2ab58 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/base.h @@ -0,0 +1,503 @@ +#ifndef FLATBUFFERS_BASE_H_ +#define FLATBUFFERS_BASE_H_ + +// clang-format off + +// If activate should be declared and included first. +#if defined(FLATBUFFERS_MEMORY_LEAK_TRACKING) && \ + defined(_MSC_VER) && defined(_DEBUG) + // The _CRTDBG_MAP_ALLOC inside will replace + // calloc/free (etc) to its debug version using #define directives. + #define _CRTDBG_MAP_ALLOC + #include + #include + // Replace operator new by trace-enabled version. + #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__) + #define new DEBUG_NEW +#endif + +#if !defined(FLATBUFFERS_ASSERT) +#include +#define FLATBUFFERS_ASSERT assert +#elif defined(FLATBUFFERS_ASSERT_INCLUDE) +// Include file with forward declaration +#include FLATBUFFERS_ASSERT_INCLUDE +#endif + +#ifndef ARDUINO +#include +#endif + +#include +#include +#include + +#if defined(ARDUINO) && !defined(ARDUINOSTL_M_H) && defined(__AVR__) + #include +#else + #include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__unix__) && !defined(FLATBUFFERS_LOCALE_INDEPENDENT) + #include +#endif + +#ifdef __ANDROID__ + #include +#endif + +#if defined(__ICCARM__) +#include +#endif + +// Note the __clang__ check is needed, because clang presents itself +// as an older GNUC compiler (4.2). +// Clang 3.3 and later implement all of the ISO C++ 2011 standard. +// Clang 3.4 and later implement all of the ISO C++ 2014 standard. +// http://clang.llvm.org/cxx_status.html + +// Note the MSVC value '__cplusplus' may be incorrect: +// The '__cplusplus' predefined macro in the MSVC stuck at the value 199711L, +// indicating (erroneously!) that the compiler conformed to the C++98 Standard. +// This value should be correct starting from MSVC2017-15.7-Preview-3. +// The '__cplusplus' will be valid only if MSVC2017-15.7-P3 and the `/Zc:__cplusplus` switch is set. +// Workaround (for details see MSDN): +// Use the _MSC_VER and _MSVC_LANG definition instead of the __cplusplus for compatibility. +// The _MSVC_LANG macro reports the Standard version regardless of the '/Zc:__cplusplus' switch. + +#if defined(__GNUC__) && !defined(__clang__) + #define FLATBUFFERS_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) +#else + #define FLATBUFFERS_GCC 0 +#endif + +#if defined(__clang__) + #define FLATBUFFERS_CLANG (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) +#else + #define FLATBUFFERS_CLANG 0 +#endif + +/// @cond FLATBUFFERS_INTERNAL +#if __cplusplus <= 199711L && \ + (!defined(_MSC_VER) || _MSC_VER < 1600) && \ + (!defined(__GNUC__) || \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40400)) + #error A C++11 compatible compiler with support for the auto typing is \ + required for FlatBuffers. + #error __cplusplus _MSC_VER __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__ +#endif + +#if !defined(__clang__) && \ + defined(__GNUC__) && \ + (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 40600) + // Backwards compatibility for g++ 4.4, and 4.5 which don't have the nullptr + // and constexpr keywords. Note the __clang__ check is needed, because clang + // presents itself as an older GNUC compiler. + #ifndef nullptr_t + const class nullptr_t { + public: + template inline operator T*() const { return 0; } + private: + void operator&() const; + } nullptr = {}; + #endif + #ifndef constexpr + #define constexpr const + #endif +#endif + +// The wire format uses a little endian encoding (since that's efficient for +// the common platforms). +#if defined(__s390x__) + #define FLATBUFFERS_LITTLEENDIAN 0 +#endif // __s390x__ +#if !defined(FLATBUFFERS_LITTLEENDIAN) + #if defined(__GNUC__) || defined(__clang__) || defined(__ICCARM__) + #if (defined(__BIG_ENDIAN__) || \ + (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)) + #define FLATBUFFERS_LITTLEENDIAN 0 + #else + #define FLATBUFFERS_LITTLEENDIAN 1 + #endif // __BIG_ENDIAN__ + #elif defined(_MSC_VER) + #if defined(_M_PPC) + #define FLATBUFFERS_LITTLEENDIAN 0 + #else + #define FLATBUFFERS_LITTLEENDIAN 1 + #endif + #else + #error Unable to determine endianness, define FLATBUFFERS_LITTLEENDIAN. + #endif +#endif // !defined(FLATBUFFERS_LITTLEENDIAN) + +#define FLATBUFFERS_VERSION_MAJOR 25 +#define FLATBUFFERS_VERSION_MINOR 12 +#define FLATBUFFERS_VERSION_REVISION 19 +#define FLATBUFFERS_STRING_EXPAND(X) #X +#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X) +namespace flatbuffers { + // Returns version as string "MAJOR.MINOR.REVISION". + const char* FLATBUFFERS_VERSION(); +} + +#if (!defined(_MSC_VER) || _MSC_VER > 1600) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 407)) || \ + defined(__clang__) + #define FLATBUFFERS_FINAL_CLASS final + #define FLATBUFFERS_OVERRIDE override + #define FLATBUFFERS_EXPLICIT_CPP11 explicit + #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE : ::flatbuffers::voffset_t +#else + #define FLATBUFFERS_FINAL_CLASS + #define FLATBUFFERS_OVERRIDE + #define FLATBUFFERS_EXPLICIT_CPP11 + #define FLATBUFFERS_VTABLE_UNDERLYING_TYPE +#endif + +#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \ + (defined(__cpp_constexpr) && __cpp_constexpr >= 200704) + #define FLATBUFFERS_CONSTEXPR constexpr + #define FLATBUFFERS_CONSTEXPR_CPP11 constexpr + #define FLATBUFFERS_CONSTEXPR_DEFINED +#else + #define FLATBUFFERS_CONSTEXPR const + #define FLATBUFFERS_CONSTEXPR_CPP11 +#endif + +#if (defined(__cplusplus) && __cplusplus >= 201402L) || \ + (defined(__cpp_constexpr) && __cpp_constexpr >= 201304) + #define FLATBUFFERS_CONSTEXPR_CPP14 FLATBUFFERS_CONSTEXPR_CPP11 +#else + #define FLATBUFFERS_CONSTEXPR_CPP14 +#endif + +#if (defined(__GXX_EXPERIMENTAL_CXX0X__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) || \ + (defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 190023026)) || \ + defined(__clang__) + #define FLATBUFFERS_NOEXCEPT noexcept +#else + #define FLATBUFFERS_NOEXCEPT +#endif + +// NOTE: the FLATBUFFERS_DELETE_FUNC macro may change the access mode to +// private, so be sure to put it at the end or reset access mode explicitly. +#if (!defined(_MSC_VER) || _MSC_FULL_VER >= 180020827) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 404)) || \ + defined(__clang__) + #define FLATBUFFERS_DELETE_FUNC(func) func = delete +#else + #define FLATBUFFERS_DELETE_FUNC(func) private: func +#endif + +#if (!defined(_MSC_VER) || _MSC_VER >= 1900) && \ + (!defined(__GNUC__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \ + defined(__clang__) + #define FLATBUFFERS_DEFAULT_DECLARATION +#endif + +// Check if we can use template aliases +// Not possible if Microsoft Compiler before 2012 +// Possible is the language feature __cpp_alias_templates is defined well +// Or possible if the C++ std is C+11 or newer +#if (defined(_MSC_VER) && _MSC_VER > 1700 /* MSVC2012 */) \ + || (defined(__cpp_alias_templates) && __cpp_alias_templates >= 200704) \ + || (defined(__cplusplus) && __cplusplus >= 201103L) + #define FLATBUFFERS_TEMPLATES_ALIASES +#endif + +#ifndef FLATBUFFERS_HAS_STRING_VIEW + // Only provide flatbuffers::string_view if __has_include can be used + // to detect a header that provides an implementation + #if defined(__has_include) + // Check for std::string_view (in c++17) + #if __has_include() && (__cplusplus >= 201606 || (defined(_HAS_CXX17) && _HAS_CXX17)) + #include + namespace flatbuffers { + typedef std::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for std::experimental::string_view (in c++14, compiler-dependent) + #elif __has_include() && (__cplusplus >= 201411) + #include + namespace flatbuffers { + typedef std::experimental::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + // Check for absl::string_view + #elif __has_include("absl/strings/string_view.h") && \ + __has_include("absl/base/config.h") && \ + (__cplusplus >= 201411) + #include "absl/base/config.h" + #if !defined(ABSL_USES_STD_STRING_VIEW) + #include "absl/strings/string_view.h" + namespace flatbuffers { + typedef absl::string_view string_view; + } + #define FLATBUFFERS_HAS_STRING_VIEW 1 + #endif + #endif + #endif // __has_include +#endif // !FLATBUFFERS_HAS_STRING_VIEW + +#ifndef FLATBUFFERS_GENERAL_HEAP_ALLOC_OK + // Allow heap allocations to be used + #define FLATBUFFERS_GENERAL_HEAP_ALLOC_OK 1 +#endif // !FLATBUFFERS_GENERAL_HEAP_ALLOC_OK + +#ifndef FLATBUFFERS_HAS_NEW_STRTOD + // Modern (C++11) strtod and strtof functions are available for use. + // 1) nan/inf strings as argument of strtod; + // 2) hex-float as argument of strtod/strtof. + #if (defined(_MSC_VER) && _MSC_VER >= 1900) || \ + (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || \ + (defined(__clang__)) + #define FLATBUFFERS_HAS_NEW_STRTOD 1 + #endif +#endif // !FLATBUFFERS_HAS_NEW_STRTOD + +#ifndef FLATBUFFERS_LOCALE_INDEPENDENT + // Enable locale independent functions {strtof_l, strtod_l,strtoll_l, + // strtoull_l} on platforms that support them. + #if (defined(_MSC_VER) && _MSC_VER >= 1800) || \ + (defined(__ANDROID__) && defined(__ANDROID_API__) && __ANDROID_API__>= 26) || \ + (defined(_XOPEN_VERSION) && (_XOPEN_VERSION >= 700)) && \ + !defined(__Fuchsia__) + #define FLATBUFFERS_LOCALE_INDEPENDENT 1 + #else + #define FLATBUFFERS_LOCALE_INDEPENDENT 0 + #endif +#endif // !FLATBUFFERS_LOCALE_INDEPENDENT + +// Suppress Undefined Behavior Sanitizer (recoverable only). Usage: +// - FLATBUFFERS_SUPPRESS_UBSAN("undefined") +// - FLATBUFFERS_SUPPRESS_UBSAN("signed-integer-overflow") +#if defined(__clang__) && (__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >=7)) + #define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize(type))) +#elif defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409) + #define FLATBUFFERS_SUPPRESS_UBSAN(type) __attribute__((no_sanitize_undefined)) +#else + #define FLATBUFFERS_SUPPRESS_UBSAN(type) +#endif + +namespace flatbuffers { + // This is constexpr function used for checking compile-time constants. + // Avoid `#pragma warning(disable: 4127) // C4127: expression is constant`. + template FLATBUFFERS_CONSTEXPR inline bool IsConstTrue(T t) { + return !!t; + } +} + +// Enable C++ attribute [[]] if std:c++17 or higher. +#if ((__cplusplus >= 201703L) \ + || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201703L))) + // All attributes unknown to an implementation are ignored without causing an error. + #define FLATBUFFERS_ATTRIBUTE(attr) attr + + #define FLATBUFFERS_FALLTHROUGH() [[fallthrough]] +#else + #define FLATBUFFERS_ATTRIBUTE(attr) + + #if FLATBUFFERS_CLANG >= 30800 + #define FLATBUFFERS_FALLTHROUGH() [[clang::fallthrough]] + #elif FLATBUFFERS_GCC >= 70300 + #define FLATBUFFERS_FALLTHROUGH() [[gnu::fallthrough]] + #else + #define FLATBUFFERS_FALLTHROUGH() + #endif +#endif + +/// @endcond + +/// @file +namespace flatbuffers { + +/// @cond FLATBUFFERS_INTERNAL +// Our default offset / size type, 32bit on purpose on 64bit systems. +// Also, using a consistent offset type maintains compatibility of serialized +// offset values between 32bit and 64bit systems. +typedef uint32_t uoffset_t; +typedef uint64_t uoffset64_t; + +// Signed offsets for references that can go in both directions. +typedef int32_t soffset_t; +typedef int64_t soffset64_t; + +// Offset/index used in v-tables, can be changed to uint8_t in +// format forks to save a bit of space if desired. +typedef uint16_t voffset_t; + +typedef uintmax_t largest_scalar_t; + +// In 32bits, this evaluates to 2GB - 1 +#define FLATBUFFERS_MAX_BUFFER_SIZE (std::numeric_limits<::flatbuffers::soffset_t>::max)() +#define FLATBUFFERS_MAX_64_BUFFER_SIZE (std::numeric_limits<::flatbuffers::soffset64_t>::max)() + +// The minimum size buffer that can be a valid flatbuffer. +// Includes the offset to the root table (uoffset_t), the offset to the vtable +// of the root table (soffset_t), the size of the vtable (uint16_t), and the +// size of the referring table (uint16_t). +#define FLATBUFFERS_MIN_BUFFER_SIZE sizeof(::flatbuffers::uoffset_t) + \ + sizeof(::flatbuffers::soffset_t) + sizeof(uint16_t) + sizeof(uint16_t) + +// We support aligning the contents of buffers up to this size. +#ifndef FLATBUFFERS_MAX_ALIGNMENT + #define FLATBUFFERS_MAX_ALIGNMENT 32 +#endif + +/// @brief The length of a FlatBuffer file header. +static const size_t kFileIdentifierLength = 4; + +inline bool VerifyAlignmentRequirements(size_t align, size_t min_align = 1) { + return (min_align <= align) && (align <= (FLATBUFFERS_MAX_ALIGNMENT)) && + (align & (align - 1)) == 0; // must be power of 2 +} + +#if defined(_MSC_VER) + #pragma warning(push) + #pragma warning(disable: 4127) // C4127: conditional expression is constant +#endif + +template T EndianSwap(T t) { + #if defined(_MSC_VER) + #define FLATBUFFERS_BYTESWAP16 _byteswap_ushort + #define FLATBUFFERS_BYTESWAP32 _byteswap_ulong + #define FLATBUFFERS_BYTESWAP64 _byteswap_uint64 + #elif defined(__ICCARM__) + #define FLATBUFFERS_BYTESWAP16 __REV16 + #define FLATBUFFERS_BYTESWAP32 __REV + #define FLATBUFFERS_BYTESWAP64(x) \ + ((__REV(static_cast(x >> 32U))) | (static_cast(__REV(static_cast(x)))) << 32U) + #else + #if defined(__GNUC__) && __GNUC__ * 100 + __GNUC_MINOR__ < 408 && !defined(__clang__) + // __builtin_bswap16 was missing prior to GCC 4.8. + #define FLATBUFFERS_BYTESWAP16(x) \ + static_cast(__builtin_bswap32(static_cast(x) << 16)) + #else + #define FLATBUFFERS_BYTESWAP16 __builtin_bswap16 + #endif + #define FLATBUFFERS_BYTESWAP32 __builtin_bswap32 + #define FLATBUFFERS_BYTESWAP64 __builtin_bswap64 + #endif + if (sizeof(T) == 1) { // Compile-time if-then's. + return t; + } else if (sizeof(T) == 2) { + union { T t; uint16_t i; } u = { t }; + u.i = FLATBUFFERS_BYTESWAP16(u.i); + return u.t; + } else if (sizeof(T) == 4) { + union { T t; uint32_t i; } u = { t }; + u.i = FLATBUFFERS_BYTESWAP32(u.i); + return u.t; + } else if (sizeof(T) == 8) { + union { T t; uint64_t i; } u = { t }; + u.i = FLATBUFFERS_BYTESWAP64(u.i); + return u.t; + } else { + FLATBUFFERS_ASSERT(0); + return t; + } +} + +#if defined(_MSC_VER) + #pragma warning(pop) +#endif + + +template T EndianScalar(T t) { + #if FLATBUFFERS_LITTLEENDIAN + return t; + #else + return EndianSwap(t); + #endif +} + +template +// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details. +FLATBUFFERS_SUPPRESS_UBSAN("alignment") +T ReadScalar(const void *p) { + return EndianScalar(*reinterpret_cast(p)); +} + +// See https://github.com/google/flatbuffers/issues/5950 + +#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wstringop-overflow" +#endif + +template +// UBSAN: C++ aliasing type rules, see std::bit_cast<> for details. +FLATBUFFERS_SUPPRESS_UBSAN("alignment") +void WriteScalar(void *p, T t) { + *reinterpret_cast(p) = EndianScalar(t); +} + +template struct Offset; +template FLATBUFFERS_SUPPRESS_UBSAN("alignment") void WriteScalar(void *p, Offset t) { + *reinterpret_cast(p) = EndianScalar(t.o); +} + +#if (FLATBUFFERS_GCC >= 100000) && (FLATBUFFERS_GCC < 110000) + #pragma GCC diagnostic pop +#endif + +// Computes how many bytes you'd have to pad to be able to write an +// "scalar_size" scalar if the buffer had grown to "buf_size" (downwards in +// memory). +FLATBUFFERS_SUPPRESS_UBSAN("unsigned-integer-overflow") +inline size_t PaddingBytes(size_t buf_size, size_t scalar_size) { + return ((~buf_size) + 1) & (scalar_size - 1); +} + +#if !defined(_MSC_VER) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wfloat-equal" +#endif +// Generic 'operator==' with conditional specialisations. +// T e - new value of a scalar field. +// T def - default of scalar (is known at compile-time). +template inline bool IsTheSameAs(T e, T def) { return e == def; } +#if !defined(_MSC_VER) + #pragma GCC diagnostic pop +#endif + +#if defined(FLATBUFFERS_NAN_DEFAULTS) && \ + defined(FLATBUFFERS_HAS_NEW_STRTOD) && (FLATBUFFERS_HAS_NEW_STRTOD > 0) +// Like `operator==(e, def)` with weak NaN if T=(float|double). +template inline bool IsFloatTheSameAs(T e, T def) { + return (e == def) || ((def != def) && (e != e)); +} +template<> inline bool IsTheSameAs(float e, float def) { + return IsFloatTheSameAs(e, def); +} +template<> inline bool IsTheSameAs(double e, double def) { + return IsFloatTheSameAs(e, def); +} +#endif + +// Check 'v' is out of closed range [low; high]. +// Workaround for GCC warning [-Werror=type-limits]: +// comparison is always true due to limited range of data type. +template +inline bool IsOutRange(const T &v, const T &low, const T &high) { + return (v < low) || (high < v); +} + +// Check 'v' is in closed range [low; high]. +template +inline bool IsInRange(const T &v, const T &low, const T &high) { + return !IsOutRange(v, low, high); +} + +} // namespace flatbuffers +#endif // FLATBUFFERS_BASE_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h new file mode 100644 index 0000000..154d187 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer.h @@ -0,0 +1,225 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_BUFFER_H_ +#define FLATBUFFERS_BUFFER_H_ + +#include + +#include "flatbuffers/base.h" +#include "flatbuffers/stl_emulation.h" + +namespace flatbuffers { + +// Wrapper for uoffset_t to allow safe template specialization. +// Value is allowed to be 0 to indicate a null object (see e.g. AddOffset). +template +struct Offset { + // The type of offset to use. + typedef uoffset_t offset_type; + + offset_type o; + Offset() : o(0) {} + Offset(const offset_type _o) : o(_o) {} + Offset<> Union() const { return o; } + bool IsNull() const { return !o; } +}; + +template +struct is_specialisation_of_Offset : false_type {}; +template +struct is_specialisation_of_Offset> : true_type {}; + +// Wrapper for uoffset64_t Offsets. +template +struct Offset64 { + // The type of offset to use. + typedef uoffset64_t offset_type; + + offset_type o; + Offset64() : o(0) {} + Offset64(const offset_type offset) : o(offset) {} + Offset64<> Union() const { return o; } + bool IsNull() const { return !o; } +}; + +template +struct is_specialisation_of_Offset64 : false_type {}; +template +struct is_specialisation_of_Offset64> : true_type {}; + +// Litmus check for ensuring the Offsets are the expected size. +static_assert(sizeof(Offset<>) == 4, "Offset has wrong size"); +static_assert(sizeof(Offset64<>) == 8, "Offset64 has wrong size"); + +inline void EndianCheck() { + int endiantest = 1; + // If this fails, see FLATBUFFERS_LITTLEENDIAN above. + FLATBUFFERS_ASSERT(*reinterpret_cast(&endiantest) == + FLATBUFFERS_LITTLEENDIAN); + (void)endiantest; +} + +template +FLATBUFFERS_CONSTEXPR size_t AlignOf() { + // clang-format off + #ifdef _MSC_VER + return __alignof(T); + #else + #ifndef alignof + return __alignof__(T); + #else + return alignof(T); + #endif + #endif + // clang-format on +} + +// Lexicographically compare two strings (possibly containing nulls), and +// return true if the first is less than the second. +static inline bool StringLessThan(const char* a_data, uoffset_t a_size, + const char* b_data, uoffset_t b_size) { + const auto cmp = memcmp(a_data, b_data, (std::min)(a_size, b_size)); + return cmp == 0 ? a_size < b_size : cmp < 0; +} + +// When we read serialized data from memory, in the case of most scalars, +// we want to just read T, but in the case of Offset, we want to actually +// perform the indirection and return a pointer. +// The template specialization below does just that. +// It is wrapped in a struct since function templates can't overload on the +// return type like this. +// The typedef is for the convenience of callers of this function +// (avoiding the need for a trailing return decltype) +template +struct IndirectHelper { + typedef T return_type; + typedef T mutable_return_type; + static const size_t element_stride = sizeof(T); + + static return_type Read(const uint8_t* p, const size_t i) { + return EndianScalar((reinterpret_cast(p))[i]); + } + static mutable_return_type Read(uint8_t* p, const size_t i) { + return reinterpret_cast( + Read(const_cast(p), i)); + } +}; + +// For vector of Offsets. +template class OffsetT> +struct IndirectHelper> { + typedef const T* return_type; + typedef T* mutable_return_type; + typedef typename OffsetT::offset_type offset_type; + static const offset_type element_stride = sizeof(offset_type); + + static return_type Read(const uint8_t* const p, const offset_type i) { + // Offsets are relative to themselves, so first update the pointer to + // point to the offset location. + const uint8_t* const offset_location = p + i * element_stride; + + // Then read the scalar value of the offset (which may be 32 or 64-bits) and + // then determine the relative location from the offset location. + return reinterpret_cast( + offset_location + ReadScalar(offset_location)); + } + static mutable_return_type Read(uint8_t* const p, const offset_type i) { + // Offsets are relative to themselves, so first update the pointer to + // point to the offset location. + uint8_t* const offset_location = p + i * element_stride; + + // Then read the scalar value of the offset (which may be 32 or 64-bits) and + // then determine the relative location from the offset location. + return reinterpret_cast( + offset_location + ReadScalar(offset_location)); + } +}; + +// For vector of structs. +template +struct IndirectHelper< + T, typename std::enable_if< + !std::is_scalar::type>::value && + !is_specialisation_of_Offset::value && + !is_specialisation_of_Offset64::value>::type> { + private: + typedef typename std::remove_pointer::type>::type + pointee_type; + + public: + typedef const pointee_type* return_type; + typedef pointee_type* mutable_return_type; + static const size_t element_stride = sizeof(pointee_type); + + static return_type Read(const uint8_t* const p, const size_t i) { + // Structs are stored inline, relative to the first struct pointer. + return reinterpret_cast(p + i * element_stride); + } + static mutable_return_type Read(uint8_t* const p, const size_t i) { + // Structs are stored inline, relative to the first struct pointer. + return reinterpret_cast(p + i * element_stride); + } +}; + +/// @brief Get a pointer to the file_identifier section of the buffer. +/// @return Returns a const char pointer to the start of the file_identifier +/// characters in the buffer. The returned char * has length +/// 'flatbuffers::FlatBufferBuilder::kFileIdentifierLength'. +/// This function is UNDEFINED for FlatBuffers whose schema does not include +/// a file_identifier (likely points at padding or the start of a the root +/// vtable). +inline const char* GetBufferIdentifier(const void* buf, + bool size_prefixed = false) { + return reinterpret_cast(buf) + + ((size_prefixed) ? 2 * sizeof(uoffset_t) : sizeof(uoffset_t)); +} + +// Helper to see if the identifier in a buffer has the expected value. +inline bool BufferHasIdentifier(const void* buf, const char* identifier, + bool size_prefixed = false) { + return strncmp(GetBufferIdentifier(buf, size_prefixed), identifier, + flatbuffers::kFileIdentifierLength) == 0; +} + +/// @cond FLATBUFFERS_INTERNAL +// Helpers to get a typed pointer to the root object contained in the buffer. +template +T* GetMutableRoot(void* buf) { + if (!buf) return nullptr; + EndianCheck(); + return reinterpret_cast(reinterpret_cast(buf) + + EndianScalar(*reinterpret_cast(buf))); +} + +template +T* GetMutableSizePrefixedRoot(void* buf) { + return GetMutableRoot(reinterpret_cast(buf) + sizeof(SizeT)); +} + +template +const T* GetRoot(const void* buf) { + return GetMutableRoot(const_cast(buf)); +} + +template +const T* GetSizePrefixedRoot(const void* buf) { + return GetRoot(reinterpret_cast(buf) + sizeof(SizeT)); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_BUFFER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h new file mode 100644 index 0000000..746903e --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/buffer_ref.h @@ -0,0 +1,54 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_BUFFER_REF_H_ +#define FLATBUFFERS_BUFFER_REF_H_ + +#include "flatbuffers/base.h" +#include "flatbuffers/verifier.h" + +namespace flatbuffers { + +// Convenient way to bundle a buffer and its length, to pass it around +// typed by its root. +// A BufferRef does not own its buffer. +struct BufferRefBase {}; // for std::is_base_of + +template +struct BufferRef : BufferRefBase { + BufferRef() : buf(nullptr), len(0), must_free(false) {} + BufferRef(uint8_t* _buf, uoffset_t _len) + : buf(_buf), len(_len), must_free(false) {} + + ~BufferRef() { + if (must_free) free(buf); + } + + const T* GetRoot() const { return flatbuffers::GetRoot(buf); } + + bool Verify() { + Verifier verifier(buf, len); + return verifier.VerifyBuffer(nullptr); + } + + uint8_t* buf; + uoffset_t len; + bool must_free; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_BUFFER_REF_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h new file mode 100644 index 0000000..bfd771d --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generator.h @@ -0,0 +1,99 @@ +/* + * Copyright 2023 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_CODE_GENERATOR_H_ +#define FLATBUFFERS_CODE_GENERATOR_H_ + +#include + +#include "flatbuffers/file_manager.h" +#include "flatbuffers/idl.h" + +namespace flatbuffers { + +struct CodeGenOptions { + std::string output_path; + FileSaver* file_saver{nullptr}; +}; + +// A code generator interface for producing converting flatbuffer schema into +// code. +class CodeGenerator { + public: + virtual ~CodeGenerator() = default; + + enum Status { + OK = 0, + ERROR = 1, + FAILED_VERIFICATION = 2, + NOT_IMPLEMENTED = 3 + }; + + std::string status_detail; + + // Generate code from the provided `parser`. + // + // DEPRECATED: prefer using the other overload of GenerateCode for bfbs. + virtual Status GenerateCode(const Parser& parser, const std::string& path, + const std::string& filename) = 0; + + // Generate code from the provided `parser` and place it in the output. + virtual Status GenerateCodeString(const Parser& parser, + const std::string& filename, + std::string& output) { + (void)parser; + (void)filename; + (void)output; + return Status::NOT_IMPLEMENTED; + } + + // Generate code from the provided `buffer` of given `length`. The buffer is a + // serialized reflection.fbs. + virtual Status GenerateCode(const uint8_t* buffer, int64_t length, + const CodeGenOptions& options) = 0; + + virtual Status GenerateMakeRule(const Parser& parser, const std::string& path, + const std::string& filename, + std::string& output) = 0; + + virtual Status GenerateGrpcCode(const Parser& parser, const std::string& path, + const std::string& filename) = 0; + + virtual Status GenerateRootFile(const Parser& parser, + const std::string& path) = 0; + + virtual bool IsSchemaOnly() const = 0; + + virtual bool SupportsBfbsGeneration() const = 0; + + virtual bool SupportsRootFileGeneration() const = 0; + + virtual IDLOptions::Language Language() const = 0; + + virtual std::string LanguageName() const = 0; + + protected: + CodeGenerator() = default; + + private: + // Copying is not supported. + CodeGenerator(const CodeGenerator&) = delete; + CodeGenerator& operator=(const CodeGenerator&) = delete; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_CODE_GENERATOR_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h new file mode 100644 index 0000000..d284ac5 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/code_generators.h @@ -0,0 +1,238 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_CODE_GENERATORS_H_ +#define FLATBUFFERS_CODE_GENERATORS_H_ + +#include +#include + +#include "flatbuffers/idl.h" + +namespace flatbuffers { + +// Utility class to assist in generating code through use of text templates. +// +// Example code: +// CodeWriter code("\t"); +// code.SetValue("NAME", "Foo"); +// code += "void {{NAME}}() { printf("%s", "{{NAME}}"); }"; +// code.SetValue("NAME", "Bar"); +// code += "void {{NAME}}() { printf("%s", "{{NAME}}"); }"; +// std::cout << code.ToString() << std::endl; +// +// Output: +// void Foo() { printf("%s", "Foo"); } +// void Bar() { printf("%s", "Bar"); } +class CodeWriter { + public: + CodeWriter(std::string pad = std::string()) + : pad_(pad), cur_ident_lvl_(0), ignore_ident_(false) {} + + // Clears the current "written" code. + void Clear() { + stream_.str(""); + stream_.clear(); + } + + // Associates a key with a value. All subsequent calls to operator+=, where + // the specified key is contained in {{ and }} delimiters will be replaced by + // the given value. + void SetValue(const std::string& key, const std::string& value) { + value_map_[key] = value; + } + + std::string GetValue(const std::string& key) const { + const auto it = value_map_.find(key); + return it == value_map_.end() ? "" : it->second; + } + + // Appends the given text to the generated code as well as a newline + // character. Any text within {{ and }} delimiters is replaced by values + // previously stored in the CodeWriter by calling SetValue above. The newline + // will be suppressed if the text ends with the \\ character. + void operator+=(std::string text); + + // Returns the current contents of the CodeWriter as a std::string. + std::string ToString() const { return stream_.str(); } + + // Increase ident level for writing code + void IncrementIdentLevel() { cur_ident_lvl_++; } + // Decrease ident level for writing code + void DecrementIdentLevel() { + if (cur_ident_lvl_) cur_ident_lvl_--; + } + + void SetPadding(const std::string& padding) { pad_ = padding; } + + private: + std::map value_map_; + std::stringstream stream_; + std::string pad_; + int cur_ident_lvl_; + bool ignore_ident_; + + // Add ident padding (tab or space) based on ident level + void AppendIdent(std::stringstream& stream); +}; + +class BaseGenerator { + public: + virtual bool generate() = 0; + + static std::string NamespaceDir(const Parser& parser, const std::string& path, + const Namespace& ns, + const bool dasherize = false); + + std::string GeneratedFileName(const std::string& path, + const std::string& file_name, + const IDLOptions& options) const; + + protected: + BaseGenerator(const Parser& parser, const std::string& path, + const std::string& file_name, std::string qualifying_start, + std::string qualifying_separator, std::string default_extension) + : parser_(parser), + path_(path), + file_name_(file_name), + qualifying_start_(qualifying_start), + qualifying_separator_(qualifying_separator), + default_extension_(default_extension) {} + virtual ~BaseGenerator() {} + + // No copy/assign. + BaseGenerator& operator=(const BaseGenerator&); + BaseGenerator(const BaseGenerator&); + + std::string NamespaceDir(const Namespace& ns, + const bool dasherize = false) const; + + static const char* FlatBuffersGeneratedWarning(); + + static std::string FullNamespace(const char* separator, const Namespace& ns); + + static std::string LastNamespacePart(const Namespace& ns); + + // tracks the current namespace for early exit in WrapInNameSpace + // c++, java and csharp returns a different namespace from + // the following default (no early exit, always fully qualify), + // which works for js and php + virtual const Namespace* CurrentNameSpace() const { return nullptr; } + + // Ensure that a type is prefixed with its namespace even within + // its own namespace to avoid conflict between generated method + // names and similarly named classes or structs + std::string WrapInNameSpace(const Namespace* ns, + const std::string& name) const; + + std::string WrapInNameSpace(const Definition& def, + const std::string& suffix = "") const; + + std::string GetNameSpace(const Definition& def) const; + + const Parser& parser_; + const std::string& path_; + const std::string& file_name_; + const std::string qualifying_start_; + const std::string qualifying_separator_; + const std::string default_extension_; +}; + +struct CommentConfig { + const char* first_line; + const char* content_line_prefix; + const char* last_line; +}; + +extern void GenComment(const std::vector& dc, + std::string* code_ptr, const CommentConfig* config, + const char* prefix = ""); + +class FloatConstantGenerator { + public: + virtual ~FloatConstantGenerator() {} + std::string GenFloatConstant(const FieldDef& field) const; + + private: + virtual std::string Value(double v, const std::string& src) const = 0; + virtual std::string Inf(double v) const = 0; + virtual std::string NaN(double v) const = 0; + + virtual std::string Value(float v, const std::string& src) const = 0; + virtual std::string Inf(float v) const = 0; + virtual std::string NaN(float v) const = 0; + + template + std::string GenFloatConstantImpl(const FieldDef& field) const; +}; + +class SimpleFloatConstantGenerator : public FloatConstantGenerator { + public: + SimpleFloatConstantGenerator(const char* nan_number, + const char* pos_inf_number, + const char* neg_inf_number); + + private: + std::string Value(double v, + const std::string& src) const FLATBUFFERS_OVERRIDE; + std::string Inf(double v) const FLATBUFFERS_OVERRIDE; + std::string NaN(double v) const FLATBUFFERS_OVERRIDE; + + std::string Value(float v, const std::string& src) const FLATBUFFERS_OVERRIDE; + std::string Inf(float v) const FLATBUFFERS_OVERRIDE; + std::string NaN(float v) const FLATBUFFERS_OVERRIDE; + + const std::string nan_number_; + const std::string pos_inf_number_; + const std::string neg_inf_number_; +}; + +// C++, C#, Java like generator. +class TypedFloatConstantGenerator : public FloatConstantGenerator { + public: + TypedFloatConstantGenerator(const char* double_prefix, + const char* single_prefix, const char* nan_number, + const char* pos_inf_number, + const char* neg_inf_number = ""); + + private: + std::string Value(double v, + const std::string& src) const FLATBUFFERS_OVERRIDE; + std::string Inf(double v) const FLATBUFFERS_OVERRIDE; + + std::string NaN(double v) const FLATBUFFERS_OVERRIDE; + + std::string Value(float v, const std::string& src) const FLATBUFFERS_OVERRIDE; + std::string Inf(float v) const FLATBUFFERS_OVERRIDE; + std::string NaN(float v) const FLATBUFFERS_OVERRIDE; + + std::string MakeNaN(const std::string& prefix) const; + std::string MakeInf(bool neg, const std::string& prefix) const; + + const std::string double_prefix_; + const std::string single_prefix_; + const std::string nan_number_; + const std::string pos_inf_number_; + const std::string neg_inf_number_; +}; + +std::string JavaCSharpMakeRule(const bool java, const Parser& parser, + const std::string& path, + const std::string& file_name); + +} // namespace flatbuffers + +#endif // FLATBUFFERS_CODE_GENERATORS_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h new file mode 100644 index 0000000..d1cab08 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/default_allocator.h @@ -0,0 +1,64 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_DEFAULT_ALLOCATOR_H_ +#define FLATBUFFERS_DEFAULT_ALLOCATOR_H_ + +#include "flatbuffers/allocator.h" +#include "flatbuffers/base.h" + +namespace flatbuffers { + +// DefaultAllocator uses new/delete to allocate memory regions +class DefaultAllocator : public Allocator { + public: + uint8_t* allocate(size_t size) FLATBUFFERS_OVERRIDE { + return new uint8_t[size]; + } + + void deallocate(uint8_t* p, size_t) FLATBUFFERS_OVERRIDE { delete[] p; } + + static void dealloc(void* p, size_t) { delete[] static_cast(p); } +}; + +// These functions allow for a null allocator to mean use the default allocator, +// as used by DetachedBuffer and vector_downward below. +// This is to avoid having a statically or dynamically allocated default +// allocator, or having to move it between the classes that may own it. +inline uint8_t* Allocate(Allocator* allocator, size_t size) { + return allocator ? allocator->allocate(size) + : DefaultAllocator().allocate(size); +} + +inline void Deallocate(Allocator* allocator, uint8_t* p, size_t size) { + if (allocator) + allocator->deallocate(p, size); + else + DefaultAllocator().deallocate(p, size); +} + +inline uint8_t* ReallocateDownward(Allocator* allocator, uint8_t* old_p, + size_t old_size, size_t new_size, + size_t in_use_back, size_t in_use_front) { + return allocator ? allocator->reallocate_downward(old_p, old_size, new_size, + in_use_back, in_use_front) + : DefaultAllocator().reallocate_downward( + old_p, old_size, new_size, in_use_back, in_use_front); +} + +} // namespace flatbuffers + +#endif // FLATBUFFERS_DEFAULT_ALLOCATOR_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h new file mode 100644 index 0000000..0577a42 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/detached_buffer.h @@ -0,0 +1,121 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_DETACHED_BUFFER_H_ +#define FLATBUFFERS_DETACHED_BUFFER_H_ + +#include "flatbuffers/allocator.h" +#include "flatbuffers/base.h" +#include "flatbuffers/default_allocator.h" + +namespace flatbuffers { + +// DetachedBuffer is a finished flatbuffer memory region, detached from its +// builder. The original memory region and allocator are also stored so that +// the DetachedBuffer can manage the memory lifetime. +class DetachedBuffer { + public: + DetachedBuffer() + : allocator_(nullptr), + own_allocator_(false), + buf_(nullptr), + reserved_(0), + cur_(nullptr), + size_(0) {} + + DetachedBuffer(Allocator* allocator, bool own_allocator, uint8_t* buf, + size_t reserved, uint8_t* cur, size_t sz) + : allocator_(allocator), + own_allocator_(own_allocator), + buf_(buf), + reserved_(reserved), + cur_(cur), + size_(sz) {} + + DetachedBuffer(DetachedBuffer&& other) noexcept + : allocator_(other.allocator_), + own_allocator_(other.own_allocator_), + buf_(other.buf_), + reserved_(other.reserved_), + cur_(other.cur_), + size_(other.size_) { + other.reset(); + } + + DetachedBuffer& operator=(DetachedBuffer&& other) noexcept { + if (this == &other) return *this; + + destroy(); + + allocator_ = other.allocator_; + own_allocator_ = other.own_allocator_; + buf_ = other.buf_; + reserved_ = other.reserved_; + cur_ = other.cur_; + size_ = other.size_; + + other.reset(); + + return *this; + } + + ~DetachedBuffer() { destroy(); } + + const uint8_t* data() const { return cur_; } + + uint8_t* data() { return cur_; } + + size_t size() const { return size_; } + + uint8_t* begin() { return data(); } + const uint8_t* begin() const { return data(); } + uint8_t* end() { return data() + size(); } + const uint8_t* end() const { return data() + size(); } + + // These may change access mode, leave these at end of public section + FLATBUFFERS_DELETE_FUNC(DetachedBuffer(const DetachedBuffer& other)); + FLATBUFFERS_DELETE_FUNC( + DetachedBuffer& operator=(const DetachedBuffer& other)); + + protected: + Allocator* allocator_; + bool own_allocator_; + uint8_t* buf_; + size_t reserved_; + uint8_t* cur_; + size_t size_; + + inline void destroy() { + if (buf_) Deallocate(allocator_, buf_, reserved_); + if (own_allocator_ && allocator_) { + delete allocator_; + } + reset(); + } + + inline void reset() { + allocator_ = nullptr; + own_allocator_ = false; + buf_ = nullptr; + reserved_ = 0; + cur_ = nullptr; + size_ = 0; + } +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_DETACHED_BUFFER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h new file mode 100644 index 0000000..bafe6f2 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/file_manager.h @@ -0,0 +1,70 @@ +/* + * Copyright 2023 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_FILE_MANAGER_H_ +#define FLATBUFFERS_FILE_MANAGER_H_ + +#include +#include +#include + +namespace flatbuffers { + +// A File interface to write data to file by default or +// save only file names +class FileSaver { + public: + FileSaver() = default; + virtual ~FileSaver() = default; + + virtual bool SaveFile(const char* name, const char* buf, size_t len, + bool binary) = 0; + + bool SaveFile(const char* name, const std::string& buf, bool binary) { + return SaveFile(name, buf.c_str(), buf.size(), binary); + } + + virtual void Finish() {} + + private: + // Copying is not supported. + FileSaver(const FileSaver&) = delete; + FileSaver& operator=(const FileSaver&) = delete; + // Rule of 5 + FileSaver(FileSaver&&) = default; + FileSaver& operator=(FileSaver&&) = default; +}; + +class RealFileSaver final : public FileSaver { + public: + bool SaveFile(const char* name, const char* buf, size_t len, + bool binary) final; +}; + +class FileNameSaver final : public FileSaver { + public: + bool SaveFile(const char* name, const char* buf, size_t len, + bool binary) final; + + void Finish() final; + + private: + std::set file_names_{}; +}; + +} // namespace flatbuffers + +#endif // FLATBUFFERS_FILE_MANAGER_H_ diff --git a/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h new file mode 100644 index 0000000..636d377 --- /dev/null +++ b/vendor/warcraftxl/deps/flatbuffers/include/flatbuffers/flatbuffer_builder.h @@ -0,0 +1,1518 @@ +/* + * Copyright 2021 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FLATBUFFERS_FLATBUFFER_BUILDER_H_ +#define FLATBUFFERS_FLATBUFFER_BUILDER_H_ + +#include +#include +#include +#include +#include + +#include "flatbuffers/allocator.h" +#include "flatbuffers/array.h" +#include "flatbuffers/base.h" +#include "flatbuffers/buffer.h" +#include "flatbuffers/buffer_ref.h" +#include "flatbuffers/default_allocator.h" +#include "flatbuffers/detached_buffer.h" +#include "flatbuffers/stl_emulation.h" +#include "flatbuffers/string.h" +#include "flatbuffers/struct.h" +#include "flatbuffers/table.h" +#include "flatbuffers/vector.h" +#include "flatbuffers/vector_downward.h" +#include "flatbuffers/verifier.h" + +namespace flatbuffers { + +// Converts a Field ID to a virtual table offset. +inline voffset_t FieldIndexToOffset(voffset_t field_id) { + // Should correspond to what EndTable() below builds up. + const voffset_t fixed_fields = + 2 * sizeof(voffset_t); // Vtable size and Object Size. + size_t offset = fixed_fields + field_id * sizeof(voffset_t); + FLATBUFFERS_ASSERT(offset < std::numeric_limits::max()); + return static_cast(offset); +} + +template > +const T* data(const std::vector& v) { + // Eventually the returned pointer gets passed down to memcpy, so + // we need it to be non-null to avoid undefined behavior. + static uint8_t t; + return v.empty() ? reinterpret_cast(&t) : &v.front(); +} +template > +T* data(std::vector& v) { + // Eventually the returned pointer gets passed down to memcpy, so + // we need it to be non-null to avoid undefined behavior. + static uint8_t t; + return v.empty() ? reinterpret_cast(&t) : &v.front(); +} + +/// @addtogroup flatbuffers_cpp_api +/// @{ +/// @class FlatBufferBuilder +/// @brief Helper class to hold data needed in creation of a FlatBuffer. +/// To serialize data, you typically call one of the `Create*()` functions in +/// the generated code, which in turn call a sequence of `StartTable`/ +/// `PushElement`/`AddElement`/`EndTable`, or the builtin `CreateString`/ +/// `CreateVector` functions. Do this is depth-first order to build up a tree to +/// the root. `Finish()` wraps up the buffer ready for transport. +template +class FlatBufferBuilderImpl { + public: + // This switches the size type of the builder, based on if its 64-bit aware + // (uoffset64_t) or not (uoffset_t). + typedef + typename std::conditional::type SizeT; + + /// @brief Default constructor for FlatBufferBuilder. + /// @param[in] initial_size The initial size of the buffer, in bytes. Defaults + /// to `1024`. + /// @param[in] allocator An `Allocator` to use. If null will use + /// `DefaultAllocator`. + /// @param[in] own_allocator Whether the builder/vector should own the + /// allocator. Defaults to / `false`. + /// @param[in] buffer_minalign Force the buffer to be aligned to the given + /// minimum alignment upon reallocation. Only needed if you intend to store + /// types with custom alignment AND you wish to read the buffer in-place + /// directly after creation. + explicit FlatBufferBuilderImpl( + size_t initial_size = 1024, Allocator* allocator = nullptr, + bool own_allocator = false, + size_t buffer_minalign = AlignOf()) + : buf_(initial_size, allocator, own_allocator, buffer_minalign, + static_cast(Is64Aware ? FLATBUFFERS_MAX_64_BUFFER_SIZE + : FLATBUFFERS_MAX_BUFFER_SIZE)), + num_field_loc(0), + max_voffset_(0), + length_of_64_bit_region_(0), + nested(false), + finished(false), + minalign_(1), + force_defaults_(false), + dedup_vtables_(true), + string_pool(nullptr) { + EndianCheck(); + } + + /// @brief Move constructor for FlatBufferBuilder. + FlatBufferBuilderImpl(FlatBufferBuilderImpl&& other) noexcept + : buf_(1024, nullptr, false, AlignOf(), + static_cast(Is64Aware ? FLATBUFFERS_MAX_64_BUFFER_SIZE + : FLATBUFFERS_MAX_BUFFER_SIZE)), + num_field_loc(0), + max_voffset_(0), + length_of_64_bit_region_(0), + nested(false), + finished(false), + minalign_(1), + force_defaults_(false), + dedup_vtables_(true), + string_pool(nullptr) { + EndianCheck(); + // Default construct and swap idiom. + // Lack of delegating constructors in vs2010 makes it more verbose than + // needed. + Swap(other); + } + + /// @brief Move assignment operator for FlatBufferBuilder. + FlatBufferBuilderImpl& operator=(FlatBufferBuilderImpl&& other) noexcept { + // Move construct a temporary and swap idiom + FlatBufferBuilderImpl temp(std::move(other)); + Swap(temp); + return *this; + } + + void Swap(FlatBufferBuilderImpl& other) { + using std::swap; + buf_.swap(other.buf_); + swap(num_field_loc, other.num_field_loc); + swap(max_voffset_, other.max_voffset_); + swap(length_of_64_bit_region_, other.length_of_64_bit_region_); + swap(nested, other.nested); + swap(finished, other.finished); + swap(minalign_, other.minalign_); + swap(force_defaults_, other.force_defaults_); + swap(dedup_vtables_, other.dedup_vtables_); + swap(string_pool, other.string_pool); + } + + ~FlatBufferBuilderImpl() { + if (string_pool) delete string_pool; + } + + void Reset() { + Clear(); // clear builder state + buf_.reset(); // deallocate buffer + } + + /// @brief Reset all the state in this FlatBufferBuilder so it can be reused + /// to construct another buffer. + void Clear() { + ClearOffsets(); + buf_.clear(); + nested = false; + finished = false; + minalign_ = 1; + length_of_64_bit_region_ = 0; + if (string_pool) string_pool->clear(); + } + + /// @brief The current size of the serialized buffer, counting from the end. + /// @return Returns an `SizeT` with the current size of the buffer. + SizeT GetSize() const { return buf_.size(); } + + /// @brief The current size of the serialized buffer relative to the end of + /// the 32-bit region. + /// @return Returns an `uoffset_t` with the current size of the buffer. + template + // Only enable this method for the 64-bit builder, as only that builder is + // concerned with the 32/64-bit boundary, and should be the one to bare any + // run time costs. + typename std::enable_if::type GetSizeRelative32BitRegion() + const { + //[32-bit region][64-bit region] + // [XXXXXXXXXXXXXXXXXXX] GetSize() + // [YYYYYYYYYYYYY] length_of_64_bit_region_ + // [ZZZZ] return size + return static_cast(GetSize() - length_of_64_bit_region_); + } + + template + // Only enable this method for the 32-bit builder. + typename std::enable_if::type GetSizeRelative32BitRegion() + const { + return static_cast(GetSize()); + } + + /// @brief Get the serialized buffer (after you call `Finish()`). + /// @return Returns an `uint8_t` pointer to the FlatBuffer data inside the + /// buffer. + uint8_t* GetBufferPointer() const { + Finished(); + return buf_.data(); + } + + /// @brief Get the serialized buffer (after you call `Finish()`) as a span. + /// @return Returns a constructed flatbuffers::span that is a view over the + /// FlatBuffer data inside the buffer. + flatbuffers::span GetBufferSpan() const { + Finished(); + return flatbuffers::span(buf_.data(), buf_.size()); + } + + /// @brief Get a pointer to an unfinished buffer. + /// @return Returns a `uint8_t` pointer to the unfinished buffer. + uint8_t* GetCurrentBufferPointer() const { return buf_.data(); } + + /// @brief Get the released DetachedBuffer. + /// @return A `DetachedBuffer` that owns the buffer and its allocator. + DetachedBuffer Release() { + Finished(); + DetachedBuffer buffer = buf_.release(); + Clear(); + return buffer; + } + + /// @brief Get the released pointer to the serialized buffer. + /// @param size The size of the memory block containing + /// the serialized `FlatBuffer`. + /// @param offset The offset from the released pointer where the finished + /// `FlatBuffer` starts. + /// @return A raw pointer to the start of the memory block containing + /// the serialized `FlatBuffer`. + /// @remark If the allocator is owned, it gets deleted when the destructor is + /// called. + uint8_t* ReleaseRaw(size_t& size, size_t& offset) { + Finished(); + uint8_t* raw = buf_.release_raw(size, offset); + Clear(); + return raw; + } + + /// @brief get the minimum alignment this buffer needs to be accessed + /// properly. This is only known once all elements have been written (after + /// you call Finish()). You can use this information if you need to embed + /// a FlatBuffer in some other buffer, such that you can later read it + /// without first having to copy it into its own buffer. + size_t GetBufferMinAlignment() const { + Finished(); + return minalign_; + } + + /// @cond FLATBUFFERS_INTERNAL + void Finished() const { + // If you get this assert, you're attempting to get access a buffer + // which hasn't been finished yet. Be sure to call + // FlatBufferBuilder::Finish with your root table. + // If you really need to access an unfinished buffer, call + // GetCurrentBufferPointer instead. + FLATBUFFERS_ASSERT(finished); + } + /// @endcond + + /// @brief In order to save space, fields that are set to their default value + /// don't get serialized into the buffer. + /// @param[in] fd When set to `true`, always serializes default values that + /// are set. Optional fields which are not set explicitly, will still not be + /// serialized. + void ForceDefaults(bool fd) { force_defaults_ = fd; } + + /// @brief By default vtables are deduped in order to save space. + /// @param[in] dedup When set to `true`, dedup vtables. + void DedupVtables(bool dedup) { dedup_vtables_ = dedup; } + + /// @cond FLATBUFFERS_INTERNAL + void Pad(size_t num_bytes) { buf_.fill(num_bytes); } + + void TrackMinAlign(size_t elem_size) { + if (elem_size > minalign_) minalign_ = elem_size; + } + + void Align(size_t elem_size) { + TrackMinAlign(elem_size); + buf_.fill(PaddingBytes(buf_.size(), elem_size)); + } + + void PushFlatBuffer(const uint8_t* bytes, size_t size) { + PushBytes(bytes, size); + finished = true; + } + + void PushBytes(const uint8_t* bytes, size_t size) { buf_.push(bytes, size); } + + void PopBytes(size_t amount) { buf_.pop(amount); } + + template + void AssertScalarT() { + // The code assumes power of 2 sizes and endian-swap-ability. + static_assert(flatbuffers::is_scalar::value, "T must be a scalar type"); + } + + // Write a single aligned scalar to the buffer + template + ReturnT PushElement(T element) { + AssertScalarT(); + Align(sizeof(T)); + buf_.push_small(EndianScalar(element)); + return CalculateOffset(); + } + + template class OffsetT = Offset> + uoffset_t PushElement(OffsetT off) { + // Special case for offsets: see ReferTo below. + return PushElement(ReferTo(off.o)); + } + + // When writing fields, we track where they are, so we can create correct + // vtables later. + void TrackField(voffset_t field, uoffset_t off) { + FieldLoc fl = {off, field}; + buf_.scratch_push_small(fl); + num_field_loc++; + if (field > max_voffset_) { + max_voffset_ = field; + } + } + + // Like PushElement, but additionally tracks the field this represents. + template + void AddElement(voffset_t field, T e, T def) { + // We don't serialize values equal to the default. + if (IsTheSameAs(e, def) && !force_defaults_) return; + TrackField(field, PushElement(e)); + } + + template + void AddElement(voffset_t field, T e) { + TrackField(field, PushElement(e)); + } + + template + void AddOffset(voffset_t field, Offset off) { + if (off.IsNull()) return; // Don't store. + AddElement(field, ReferTo(off.o), static_cast(0)); + } + + template + void AddOffset(voffset_t field, Offset64 off) { + if (off.IsNull()) return; // Don't store. + AddElement(field, ReferTo(off.o), static_cast(0)); + } + + template + void AddStruct(voffset_t field, const T* structptr) { + if (!structptr) return; // Default, don't store. + Align(AlignOf()); + buf_.push_small(*structptr); + TrackField(field, CalculateOffset()); + } + + void AddStructOffset(voffset_t field, uoffset_t off) { + TrackField(field, off); + } + + // Offsets initially are relative to the end of the buffer (downwards). + // This function converts them to be relative to the current location + // in the buffer (when stored here), pointing upwards. + uoffset_t ReferTo(uoffset_t off) { + // Align to ensure GetSizeRelative32BitRegion() below is correct. + Align(sizeof(uoffset_t)); + // 32-bit offsets are relative to the tail of the 32-bit region of the + // buffer. For most cases (without 64-bit entities) this is equivalent to + // size of the whole buffer (e.g. GetSize()) + return ReferTo(off, GetSizeRelative32BitRegion()); + } + + uoffset64_t ReferTo(uoffset64_t off) { + // Align to ensure GetSize() below is correct. + Align(sizeof(uoffset64_t)); + // 64-bit offsets are relative to tail of the whole buffer + return ReferTo(off, GetSize()); + } + + template + T ReferTo(const T off, const T2 size) { + FLATBUFFERS_ASSERT(off && off <= size); + return size - off + static_cast(sizeof(T)); + } + + template + T ReferTo(const T off, const T size) { + FLATBUFFERS_ASSERT(off && off <= size); + return size - off + static_cast(sizeof(T)); + } + + void NotNested() { + // If you hit this, you're trying to construct a Table/Vector/String + // during the construction of its parent table (between the MyTableBuilder + // and table.Finish(). + // Move the creation of these sub-objects to above the MyTableBuilder to + // not get this assert. + // Ignoring this assert may appear to work in simple cases, but the reason + // it is here is that storing objects in-line may cause vtable offsets + // to not fit anymore. It also leads to vtable duplication. + FLATBUFFERS_ASSERT(!nested); + // If you hit this, fields were added outside the scope of a table. + FLATBUFFERS_ASSERT(!num_field_loc); + } + + // From generated code (or from the parser), we call StartTable/EndTable + // with a sequence of AddElement calls in between. + uoffset_t StartTable() { + NotNested(); + nested = true; + return GetSizeRelative32BitRegion(); + } + + // This finishes one serialized object by generating the vtable if it's a + // table, comparing it against existing vtables, and writing the + // resulting vtable offset. + uoffset_t EndTable(uoffset_t start) { + // If you get this assert, a corresponding StartTable wasn't called. + FLATBUFFERS_ASSERT(nested); + // Write the vtable offset, which is the start of any Table. + // We fill its value later. + // This is relative to the end of the 32-bit region. + const uoffset_t vtable_offset_loc = + static_cast(PushElement(0)); + // Write a vtable, which consists entirely of voffset_t elements. + // It starts with the number of offsets, followed by a type id, followed + // by the offsets themselves. In reverse: + // Include space for the last offset and ensure empty tables have a + // minimum size. + max_voffset_ = + (std::max)(static_cast(max_voffset_ + sizeof(voffset_t)), + FieldIndexToOffset(0)); + buf_.fill_big(max_voffset_); + const uoffset_t table_object_size = vtable_offset_loc - start; + // Vtable use 16bit offsets. + FLATBUFFERS_ASSERT(table_object_size < 0x10000); + WriteScalar(buf_.data() + sizeof(voffset_t), + static_cast(table_object_size)); + WriteScalar(buf_.data(), max_voffset_); + // Write the offsets into the table + for (auto it = buf_.scratch_end() - num_field_loc * sizeof(FieldLoc); + it < buf_.scratch_end(); it += sizeof(FieldLoc)) { + auto field_location = reinterpret_cast(it); + const voffset_t pos = + static_cast(vtable_offset_loc - field_location->off); + // If this asserts, it means you've set a field twice. + FLATBUFFERS_ASSERT( + !ReadScalar(buf_.data() + field_location->id)); + WriteScalar(buf_.data() + field_location->id, pos); + } + ClearOffsets(); + auto vt1 = reinterpret_cast(buf_.data()); + auto vt1_size = ReadScalar(vt1); + auto vt_use = GetSizeRelative32BitRegion(); + // See if we already have generated a vtable with this exact same + // layout before. If so, make it point to the old one, remove this one. + if (dedup_vtables_) { + for (auto it = buf_.scratch_data(); it < buf_.scratch_end(); + it += sizeof(uoffset_t)) { + auto vt_offset_ptr = reinterpret_cast(it); + auto vt2 = reinterpret_cast( + buf_.data_at(*vt_offset_ptr + length_of_64_bit_region_)); + auto vt2_size = ReadScalar(vt2); + if (vt1_size != vt2_size || 0 != memcmp(vt2, vt1, vt1_size)) continue; + vt_use = *vt_offset_ptr; + buf_.pop(GetSizeRelative32BitRegion() - vtable_offset_loc); + break; + } + } + // If this is a new vtable, remember it. + if (vt_use == GetSizeRelative32BitRegion()) { + buf_.scratch_push_small(vt_use); + } + // Fill the vtable offset we created above. + // The offset points from the beginning of the object to where the vtable is + // stored. + // Offsets default direction is downward in memory for future format + // flexibility (storing all vtables at the start of the file). + WriteScalar(buf_.data_at(vtable_offset_loc + length_of_64_bit_region_), + static_cast(vt_use) - + static_cast(vtable_offset_loc)); + nested = false; + return vtable_offset_loc; + } + + FLATBUFFERS_ATTRIBUTE([[deprecated("call the version above instead")]]) + uoffset_t EndTable(uoffset_t start, voffset_t /*numfields*/) { + return EndTable(start); + } + + // This checks a required field has been set in a given table that has + // just been constructed. + template + void Required(Offset table, voffset_t field) { + auto table_ptr = reinterpret_cast(buf_.data_at(table.o)); + bool ok = table_ptr->GetOptionalFieldOffset(field) != 0; + // If this fails, the caller will show what field needs to be set. + FLATBUFFERS_ASSERT(ok); + (void)ok; + } + + uoffset_t StartStruct(size_t alignment) { + Align(alignment); + return GetSizeRelative32BitRegion(); + } + + uoffset_t EndStruct() { return GetSizeRelative32BitRegion(); } + + void ClearOffsets() { + buf_.scratch_pop(num_field_loc * sizeof(FieldLoc)); + num_field_loc = 0; + max_voffset_ = 0; + } + + // Aligns such that when "len" bytes are written, an object can be written + // after it (forward in the buffer) with "alignment" without padding. + void PreAlign(size_t len, size_t alignment) { + if (len == 0) return; + TrackMinAlign(alignment); + buf_.fill(PaddingBytes(GetSize() + len, alignment)); + } + + // Aligns such than when "len" bytes are written, an object of type `AlignT` + // can be written after it (forward in the buffer) without padding. + template + void PreAlign(size_t len) { + AssertScalarT(); + PreAlign(len, AlignOf()); + } + /// @endcond + + /// @brief Store a string in the buffer, which can contain any binary data. + /// @param[in] str A const char pointer to the data to be stored as a string. + /// @param[in] len The number of bytes that should be stored from `str`. + /// @return Returns the offset in the buffer where the string starts. + template