├── .appveyor.yml ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── Doxyfile ├── LICENSE ├── README.md ├── deps ├── brotli │ ├── .bintray.json │ ├── .configure-custom.sh │ ├── .gitignore │ ├── .gitmodules │ ├── .travis.sh │ ├── .travis.yml │ ├── BUILD │ ├── CMakeLists.txt │ ├── CONTRIBUTING.md │ ├── LICENSE │ ├── MANIFEST.in │ ├── Makefile │ ├── README.md │ ├── WORKSPACE │ ├── appveyor.yml │ ├── appveyor │ │ ├── install.ps1 │ │ └── run_with_compiler.cmd │ ├── common │ │ ├── constants.h │ │ ├── dictionary.c │ │ ├── dictionary.h │ │ └── version.h │ ├── configure │ ├── configure-cmake │ ├── dec │ │ ├── bit_reader.c │ │ ├── bit_reader.h │ │ ├── context.h │ │ ├── decode.c │ │ ├── huffman.c │ │ ├── huffman.h │ │ ├── port.h │ │ ├── prefix.h │ │ ├── state.c │ │ ├── state.h │ │ └── transform.h │ ├── docs │ │ ├── brotli-comparison-study-2015-09-22.pdf │ │ ├── decode.h.3 │ │ ├── encode.h.3 │ │ └── types.h.3 │ ├── enc │ │ ├── backward_references.c │ │ ├── backward_references.h │ │ ├── backward_references_hq.c │ │ ├── backward_references_hq.h │ │ ├── backward_references_inc.h │ │ ├── bit_cost.c │ │ ├── bit_cost.h │ │ ├── bit_cost_inc.h │ │ ├── block_encoder_inc.h │ │ ├── block_splitter.c │ │ ├── block_splitter.h │ │ ├── block_splitter_inc.h │ │ ├── brotli_bit_stream.c │ │ ├── brotli_bit_stream.h │ │ ├── cluster.c │ │ ├── cluster.h │ │ ├── cluster_inc.h │ │ ├── command.h │ │ ├── compress_fragment.c │ │ ├── compress_fragment.h │ │ ├── compress_fragment_two_pass.c │ │ ├── compress_fragment_two_pass.h │ │ ├── context.h │ │ ├── dictionary_hash.c │ │ ├── dictionary_hash.h │ │ ├── encode.c │ │ ├── entropy_encode.c │ │ ├── entropy_encode.h │ │ ├── entropy_encode_static.h │ │ ├── fast_log.h │ │ ├── find_match_length.h │ │ ├── hash.h │ │ ├── hash_forgetful_chain_inc.h │ │ ├── hash_longest_match64_inc.h │ │ ├── hash_longest_match_inc.h │ │ ├── hash_longest_match_quickly_inc.h │ │ ├── hash_to_binary_tree_inc.h │ │ ├── histogram.c │ │ ├── histogram.h │ │ ├── histogram_inc.h │ │ ├── literal_cost.c │ │ ├── literal_cost.h │ │ ├── memory.c │ │ ├── memory.h │ │ ├── metablock.c │ │ ├── metablock.h │ │ ├── metablock_inc.h │ │ ├── port.h │ │ ├── prefix.h │ │ ├── quality.h │ │ ├── ringbuffer.h │ │ ├── static_dict.c │ │ ├── static_dict.h │ │ ├── static_dict_lut.h │ │ ├── utf8_util.c │ │ ├── utf8_util.h │ │ └── write_bits.h │ ├── fuzz │ │ ├── decode_fuzzer.cc │ │ ├── run_decode_fuzzer.cc │ │ └── test_fuzzer.sh │ ├── go │ │ └── cbrotli │ │ │ ├── BUILD │ │ │ ├── cbrotli.go │ │ │ ├── cbrotli_test.go │ │ │ └── internal │ │ │ ├── BUILD │ │ │ ├── decoder.go │ │ │ └── encoder.go │ ├── include │ │ └── brotli │ │ │ ├── decode.h │ │ │ ├── encode.h │ │ │ ├── port.h │ │ │ └── types.h │ ├── java │ │ └── org │ │ │ └── brotli │ │ │ ├── dec │ │ │ ├── BUILD │ │ │ ├── BitReader.java │ │ │ ├── BitReaderTest.java │ │ │ ├── BrotliInputStream.java │ │ │ ├── BrotliRuntimeException.java │ │ │ ├── Context.java │ │ │ ├── Decode.java │ │ │ ├── DecodeTest.java │ │ │ ├── Dictionary.java │ │ │ ├── DictionaryTest.java │ │ │ ├── EnumTest.java │ │ │ ├── Huffman.java │ │ │ ├── HuffmanTreeGroup.java │ │ │ ├── IntReader.java │ │ │ ├── Prefix.java │ │ │ ├── RunningState.java │ │ │ ├── State.java │ │ │ ├── SynthTest.java │ │ │ ├── Transform.java │ │ │ ├── TransformTest.java │ │ │ ├── Utils.java │ │ │ ├── WordTransformType.java │ │ │ └── pom.xml │ │ │ ├── integration │ │ │ ├── BUILD │ │ │ ├── BundleChecker.java │ │ │ ├── fuzz_data.zip │ │ │ ├── pom.xml │ │ │ └── test_data.zip │ │ │ └── pom.xml │ ├── premake5.lua │ ├── python │ │ ├── Makefile │ │ ├── README.md │ │ ├── _brotli.cc │ │ ├── bro.py │ │ ├── brotli.py │ │ └── tests │ │ │ ├── __init__.py │ │ │ ├── _test_utils.py │ │ │ ├── bro_test.py │ │ │ ├── compress_test.py │ │ │ ├── compressor_test.py │ │ │ └── decompress_test.py │ ├── research │ │ ├── Makefile │ │ ├── README.md │ │ ├── brotlidump.py │ │ ├── draw_diff.cc │ │ ├── draw_histogram.cc │ │ ├── find_opt_references.cc │ │ ├── img │ │ │ ├── enwik9_brotli.png │ │ │ ├── enwik9_diff.png │ │ │ └── enwik9_opt.png │ │ └── read_dist.h │ ├── setup.cfg │ ├── setup.py │ ├── tests │ │ ├── Makefile │ │ ├── compatibility_test.sh │ │ ├── roundtrip_test.sh │ │ ├── run-compatibility-test.cmake │ │ ├── run-roundtrip-test.cmake │ │ └── testdata │ │ │ ├── 10x10y │ │ │ ├── 10x10y.compressed │ │ │ ├── 64x │ │ │ ├── 64x.compressed │ │ │ ├── alice29.txt │ │ │ ├── alice29.txt.compressed │ │ │ ├── asyoulik.txt │ │ │ ├── asyoulik.txt.compressed │ │ │ ├── backward65536 │ │ │ ├── backward65536.compressed │ │ │ ├── bb.binast │ │ │ ├── compressed_file │ │ │ ├── compressed_file.compressed │ │ │ ├── compressed_repeated │ │ │ ├── compressed_repeated.compressed │ │ │ ├── empty │ │ │ ├── empty.compressed │ │ │ ├── empty.compressed.00 │ │ │ ├── empty.compressed.01 │ │ │ ├── empty.compressed.02 │ │ │ ├── empty.compressed.03 │ │ │ ├── empty.compressed.04 │ │ │ ├── empty.compressed.05 │ │ │ ├── empty.compressed.06 │ │ │ ├── empty.compressed.07 │ │ │ ├── empty.compressed.08 │ │ │ ├── empty.compressed.09 │ │ │ ├── empty.compressed.10 │ │ │ ├── empty.compressed.11 │ │ │ ├── empty.compressed.12 │ │ │ ├── empty.compressed.13 │ │ │ ├── empty.compressed.14 │ │ │ ├── empty.compressed.15 │ │ │ ├── empty.compressed.16 │ │ │ ├── empty.compressed.17 │ │ │ ├── empty.compressed.18 │ │ │ ├── lcet10.txt │ │ │ ├── lcet10.txt.compressed │ │ │ ├── mapsdatazrh │ │ │ ├── mapsdatazrh.compressed │ │ │ ├── monkey │ │ │ ├── monkey.compressed │ │ │ ├── plrabn12.txt │ │ │ ├── plrabn12.txt.compressed │ │ │ ├── quickfox │ │ │ ├── quickfox.compressed │ │ │ ├── quickfox_repeated │ │ │ ├── quickfox_repeated.compressed │ │ │ ├── random_chunks │ │ │ ├── random_org_10k.bin │ │ │ ├── random_org_10k.bin.compressed │ │ │ ├── ukkonooa │ │ │ ├── ukkonooa.compressed │ │ │ ├── x │ │ │ ├── x.compressed │ │ │ ├── x.compressed.00 │ │ │ ├── x.compressed.01 │ │ │ ├── x.compressed.02 │ │ │ ├── x.compressed.03 │ │ │ ├── xyzzy │ │ │ ├── xyzzy.compressed │ │ │ ├── zeros │ │ │ └── zeros.compressed │ └── tools │ │ └── bro.c ├── xdelta │ ├── .gitignore │ ├── xdelta1 │ │ ├── AUTHORS │ │ ├── COPYING │ │ ├── INSTALL │ │ ├── Makefile.am │ │ ├── NEWS │ │ ├── README │ │ ├── autogen.sh │ │ ├── configure.in │ │ ├── contrib │ │ │ └── build_hpux │ │ ├── djgpp │ │ │ ├── Makefile.am │ │ │ ├── announce.djg │ │ │ └── readme.djg │ │ ├── doc │ │ │ ├── Makefile.am │ │ │ ├── xdelta.1 │ │ │ └── xdelta.cat │ │ ├── getopt.c │ │ ├── getopt.h │ │ ├── getopt1.c │ │ ├── libedsio │ │ │ ├── Makefile.am │ │ │ ├── base64.c │ │ │ ├── default.c │ │ │ ├── edsio-comp.in │ │ │ ├── edsio.c │ │ │ ├── edsio.el │ │ │ ├── edsio.h │ │ │ ├── edsio.ser │ │ │ ├── edsiotest.c │ │ │ ├── fh.c │ │ │ ├── generic.c │ │ │ ├── library.c │ │ │ ├── maketime.c │ │ │ ├── maketime.h │ │ │ ├── md5c.c │ │ │ ├── partime.c │ │ │ ├── partime.h │ │ │ ├── sha.c │ │ │ └── simple.c │ │ ├── runtest │ │ ├── test │ │ │ ├── Makefile.am │ │ │ ├── README.test │ │ │ └── xdeltatest.c │ │ ├── xd.ser │ │ ├── xdapply.c │ │ ├── xdelta-0.13.README │ │ ├── xdelta-1.1.2.tar.gz │ │ ├── xdelta-1.1.3.tar.gz │ │ ├── xdelta-config.in │ │ ├── xdelta.c │ │ ├── xdelta.h │ │ ├── xdelta.m4 │ │ ├── xdelta.magic │ │ ├── xdelta.prj │ │ ├── xdeltapriv.h │ │ ├── xdmain.c │ │ └── xdrsync.c │ └── xdelta3 │ │ ├── COPYING │ │ ├── Makefile.am │ │ ├── README.md │ │ ├── badcopy.c │ │ ├── configure.ac │ │ ├── cpp-btree │ │ ├── CMakeLists.txt │ │ ├── COPYING │ │ ├── README │ │ ├── btree.h │ │ ├── btree_bench.cc │ │ ├── btree_container.h │ │ ├── btree_map.h │ │ ├── btree_set.h │ │ ├── btree_test.cc │ │ ├── btree_test.h │ │ ├── btree_test_flags.cc │ │ ├── safe_btree.h │ │ ├── safe_btree_map.h │ │ ├── safe_btree_set.h │ │ └── safe_btree_test.cc │ │ ├── draft-korn-vcdiff.txt │ │ ├── examples │ │ ├── Makefile │ │ ├── README.md │ │ ├── compare_test.c │ │ ├── encode_decode_test.c │ │ ├── iOS │ │ │ └── xdelta3-ios-test │ │ │ │ ├── xdelta3-ios-test.xcodeproj │ │ │ │ └── project.pbxproj │ │ │ │ └── xdelta3-ios-test │ │ │ │ ├── Xd3iOSAppDelegate.h │ │ │ │ ├── Xd3iOSAppDelegate.m │ │ │ │ ├── Xd3iOSViewController.h │ │ │ │ ├── Xd3iOSViewController.m │ │ │ │ ├── en.lproj │ │ │ │ ├── InfoPlist.strings │ │ │ │ ├── MainStoryboard_iPad.storyboard │ │ │ │ └── MainStoryboard_iPhone.storyboard │ │ │ │ ├── file_v1.bin │ │ │ │ ├── file_v1_to_v2.bin │ │ │ │ ├── file_v2.bin │ │ │ │ ├── main.m │ │ │ │ ├── xdelta3-ios-test-Info.plist │ │ │ │ └── xdelta3-ios-test-Prefix.pch │ │ ├── small_page_test.c │ │ ├── speed_test.c │ │ └── test.h │ │ ├── go │ │ └── src │ │ │ ├── regtest.go │ │ │ └── xdelta │ │ │ ├── rstream.go │ │ │ ├── run.go │ │ │ ├── test.go │ │ │ └── tgroup.go │ │ ├── install-sh │ │ ├── linkxd3lib.c │ │ ├── m4 │ │ ├── ax_check_aligned_access_required.m4 │ │ ├── ax_pkg_swig.m4 │ │ ├── ax_python_devel.m4 │ │ └── ax_swig_python.m4 │ │ ├── plot.sh │ │ ├── rcs_junk.cc │ │ ├── run_release.sh │ │ ├── testing │ │ ├── Makefile │ │ ├── checksum_test.cc │ │ ├── checksum_test_c.c │ │ ├── cmp.h │ │ ├── delta.h │ │ ├── file.h │ │ ├── modify.h │ │ ├── random.h │ │ ├── regtest.cc │ │ ├── regtest_c.c │ │ ├── run_release.sh │ │ ├── segment.h │ │ ├── sizes.h │ │ ├── test.h │ │ ├── xdelta3-regtest.py │ │ └── xdelta3-test.py │ │ ├── xdelta3-blkcache.h │ │ ├── xdelta3-cfgs.h │ │ ├── xdelta3-decode.h │ │ ├── xdelta3-djw.h │ │ ├── xdelta3-fgk.h │ │ ├── xdelta3-hash.h │ │ ├── xdelta3-internal.h │ │ ├── xdelta3-list.h │ │ ├── xdelta3-lzma.h │ │ ├── xdelta3-main.h │ │ ├── xdelta3-merge.h │ │ ├── xdelta3-second.h │ │ ├── xdelta3-test.h │ │ ├── xdelta3.1 │ │ ├── xdelta3.c │ │ ├── xdelta3.h │ │ ├── xdelta3.i │ │ ├── xdelta3.vcxproj │ │ ├── xdelta3.wxi │ │ └── xdelta3.wxs └── xz │ ├── .gitignore │ ├── AUTHORS │ ├── COPYING │ ├── COPYING.GPLv2 │ ├── COPYING.GPLv3 │ ├── COPYING.LGPLv2.1 │ ├── ChangeLog │ ├── Doxyfile.in │ ├── INSTALL │ ├── INSTALL.generic │ ├── Makefile.am │ ├── NEWS │ ├── PACKAGERS │ ├── README │ ├── THANKS │ ├── TODO │ ├── autogen.sh │ ├── build-aux │ ├── manconv.sh │ └── version.sh │ ├── configure.ac │ ├── debug │ ├── Makefile.am │ ├── README │ ├── crc32.c │ ├── full_flush.c │ ├── hex2bin.c │ ├── known_sizes.c │ ├── memusage.c │ ├── repeat.c │ ├── sync_flush.c │ └── translation.bash │ ├── doc │ ├── examples │ │ ├── 00_README.txt │ │ ├── 01_compress_easy.c │ │ ├── 02_decompress.c │ │ ├── 03_compress_custom.c │ │ ├── 04_compress_easy_mt.c │ │ └── Makefile │ ├── examples_old │ │ ├── xz_pipe_comp.c │ │ └── xz_pipe_decomp.c │ ├── faq.txt │ ├── history.txt │ ├── lzma-file-format.txt │ └── xz-file-format.txt │ ├── dos │ ├── INSTALL.txt │ ├── Makefile │ ├── README.txt │ └── config.h │ ├── extra │ ├── 7z2lzma │ │ └── 7z2lzma.bash │ └── scanlzma │ │ └── scanlzma.c │ ├── lib │ ├── Makefile.am │ ├── getopt.c │ ├── getopt.in.h │ ├── getopt1.c │ └── getopt_int.h │ ├── m4 │ ├── .gitignore │ ├── ax_check_capsicum.m4 │ ├── ax_pthread.m4 │ ├── getopt.m4 │ ├── posix-shell.m4 │ ├── tuklib_common.m4 │ ├── tuklib_cpucores.m4 │ ├── tuklib_integer.m4 │ ├── tuklib_mbstr.m4 │ ├── tuklib_physmem.m4 │ └── tuklib_progname.m4 │ ├── macosx │ └── build.sh │ ├── po │ ├── .gitignore │ ├── LINGUAS │ ├── Makevars │ ├── POTFILES.in │ ├── cs.po │ ├── de.po │ ├── fr.po │ ├── it.po │ ├── pl.po │ └── vi.po │ ├── src │ ├── Makefile.am │ ├── common │ │ ├── common_w32res.rc │ │ ├── mythread.h │ │ ├── sysdefs.h │ │ ├── tuklib_common.h │ │ ├── tuklib_config.h │ │ ├── tuklib_cpucores.c │ │ ├── tuklib_cpucores.h │ │ ├── tuklib_exit.c │ │ ├── tuklib_exit.h │ │ ├── tuklib_gettext.h │ │ ├── tuklib_integer.h │ │ ├── tuklib_mbstr.h │ │ ├── tuklib_mbstr_fw.c │ │ ├── tuklib_mbstr_width.c │ │ ├── tuklib_open_stdxxx.c │ │ ├── tuklib_open_stdxxx.h │ │ ├── tuklib_physmem.c │ │ ├── tuklib_physmem.h │ │ ├── tuklib_progname.c │ │ └── tuklib_progname.h │ ├── liblzma │ │ ├── Makefile.am │ │ ├── api │ │ │ ├── Makefile.am │ │ │ ├── lzma.h │ │ │ └── lzma │ │ │ │ ├── base.h │ │ │ │ ├── bcj.h │ │ │ │ ├── block.h │ │ │ │ ├── check.h │ │ │ │ ├── container.h │ │ │ │ ├── delta.h │ │ │ │ ├── filter.h │ │ │ │ ├── hardware.h │ │ │ │ ├── index.h │ │ │ │ ├── index_hash.h │ │ │ │ ├── lzma12.h │ │ │ │ ├── stream_flags.h │ │ │ │ ├── version.h │ │ │ │ └── vli.h │ │ ├── check │ │ │ ├── Makefile.inc │ │ │ ├── check.c │ │ │ ├── check.h │ │ │ ├── crc32_fast.c │ │ │ ├── crc32_small.c │ │ │ ├── crc32_table.c │ │ │ ├── crc32_table_be.h │ │ │ ├── crc32_table_le.h │ │ │ ├── crc32_tablegen.c │ │ │ ├── crc32_x86.S │ │ │ ├── crc64_fast.c │ │ │ ├── crc64_small.c │ │ │ ├── crc64_table.c │ │ │ ├── crc64_table_be.h │ │ │ ├── crc64_table_le.h │ │ │ ├── crc64_tablegen.c │ │ │ ├── crc64_x86.S │ │ │ ├── crc_macros.h │ │ │ └── sha256.c │ │ ├── common │ │ │ ├── Makefile.inc │ │ │ ├── alone_decoder.c │ │ │ ├── alone_decoder.h │ │ │ ├── alone_encoder.c │ │ │ ├── auto_decoder.c │ │ │ ├── block_buffer_decoder.c │ │ │ ├── block_buffer_encoder.c │ │ │ ├── block_buffer_encoder.h │ │ │ ├── block_decoder.c │ │ │ ├── block_decoder.h │ │ │ ├── block_encoder.c │ │ │ ├── block_encoder.h │ │ │ ├── block_header_decoder.c │ │ │ ├── block_header_encoder.c │ │ │ ├── block_util.c │ │ │ ├── common.c │ │ │ ├── common.h │ │ │ ├── easy_buffer_encoder.c │ │ │ ├── easy_decoder_memusage.c │ │ │ ├── easy_encoder.c │ │ │ ├── easy_encoder_memusage.c │ │ │ ├── easy_preset.c │ │ │ ├── easy_preset.h │ │ │ ├── filter_buffer_decoder.c │ │ │ ├── filter_buffer_encoder.c │ │ │ ├── filter_common.c │ │ │ ├── filter_common.h │ │ │ ├── filter_decoder.c │ │ │ ├── filter_decoder.h │ │ │ ├── filter_encoder.c │ │ │ ├── filter_encoder.h │ │ │ ├── filter_flags_decoder.c │ │ │ ├── filter_flags_encoder.c │ │ │ ├── hardware_cputhreads.c │ │ │ ├── hardware_physmem.c │ │ │ ├── index.c │ │ │ ├── index.h │ │ │ ├── index_decoder.c │ │ │ ├── index_encoder.c │ │ │ ├── index_encoder.h │ │ │ ├── index_hash.c │ │ │ ├── memcmplen.h │ │ │ ├── outqueue.c │ │ │ ├── outqueue.h │ │ │ ├── stream_buffer_decoder.c │ │ │ ├── stream_buffer_encoder.c │ │ │ ├── stream_decoder.c │ │ │ ├── stream_decoder.h │ │ │ ├── stream_encoder.c │ │ │ ├── stream_encoder_mt.c │ │ │ ├── stream_flags_common.c │ │ │ ├── stream_flags_common.h │ │ │ ├── stream_flags_decoder.c │ │ │ ├── stream_flags_encoder.c │ │ │ ├── vli_decoder.c │ │ │ ├── vli_encoder.c │ │ │ └── vli_size.c │ │ ├── delta │ │ │ ├── Makefile.inc │ │ │ ├── delta_common.c │ │ │ ├── delta_common.h │ │ │ ├── delta_decoder.c │ │ │ ├── delta_decoder.h │ │ │ ├── delta_encoder.c │ │ │ ├── delta_encoder.h │ │ │ └── delta_private.h │ │ ├── liblzma.map │ │ ├── liblzma.pc.in │ │ ├── liblzma_w32res.rc │ │ ├── lz │ │ │ ├── Makefile.inc │ │ │ ├── lz_decoder.c │ │ │ ├── lz_decoder.h │ │ │ ├── lz_encoder.c │ │ │ ├── lz_encoder.h │ │ │ ├── lz_encoder_hash.h │ │ │ ├── lz_encoder_hash_table.h │ │ │ └── lz_encoder_mf.c │ │ ├── lzma │ │ │ ├── Makefile.inc │ │ │ ├── fastpos.h │ │ │ ├── fastpos_table.c │ │ │ ├── fastpos_tablegen.c │ │ │ ├── lzma2_decoder.c │ │ │ ├── lzma2_decoder.h │ │ │ ├── lzma2_encoder.c │ │ │ ├── lzma2_encoder.h │ │ │ ├── lzma_common.h │ │ │ ├── lzma_decoder.c │ │ │ ├── lzma_decoder.h │ │ │ ├── lzma_encoder.c │ │ │ ├── lzma_encoder.h │ │ │ ├── lzma_encoder_optimum_fast.c │ │ │ ├── lzma_encoder_optimum_normal.c │ │ │ ├── lzma_encoder_presets.c │ │ │ └── lzma_encoder_private.h │ │ ├── rangecoder │ │ │ ├── Makefile.inc │ │ │ ├── price.h │ │ │ ├── price_table.c │ │ │ ├── price_tablegen.c │ │ │ ├── range_common.h │ │ │ ├── range_decoder.h │ │ │ └── range_encoder.h │ │ ├── simple │ │ │ ├── Makefile.inc │ │ │ ├── arm.c │ │ │ ├── armthumb.c │ │ │ ├── ia64.c │ │ │ ├── powerpc.c │ │ │ ├── simple_coder.c │ │ │ ├── simple_coder.h │ │ │ ├── simple_decoder.c │ │ │ ├── simple_decoder.h │ │ │ ├── simple_encoder.c │ │ │ ├── simple_encoder.h │ │ │ ├── simple_private.h │ │ │ ├── sparc.c │ │ │ └── x86.c │ │ └── validate_map.sh │ ├── lzmainfo │ │ ├── Makefile.am │ │ ├── lzmainfo.1 │ │ ├── lzmainfo.c │ │ └── lzmainfo_w32res.rc │ ├── scripts │ │ ├── Makefile.am │ │ ├── xzdiff.1 │ │ ├── xzdiff.in │ │ ├── xzgrep.1 │ │ ├── xzgrep.in │ │ ├── xzless.1 │ │ ├── xzless.in │ │ ├── xzmore.1 │ │ └── xzmore.in │ ├── xz │ │ ├── Makefile.am │ │ ├── args.c │ │ ├── args.h │ │ ├── coder.c │ │ ├── coder.h │ │ ├── file_io.c │ │ ├── file_io.h │ │ ├── hardware.c │ │ ├── hardware.h │ │ ├── list.c │ │ ├── list.h │ │ ├── main.c │ │ ├── main.h │ │ ├── message.c │ │ ├── message.h │ │ ├── mytime.c │ │ ├── mytime.h │ │ ├── options.c │ │ ├── options.h │ │ ├── private.h │ │ ├── signals.c │ │ ├── signals.h │ │ ├── suffix.c │ │ ├── suffix.h │ │ ├── util.c │ │ ├── util.h │ │ ├── xz.1 │ │ └── xz_w32res.rc │ └── xzdec │ │ ├── Makefile.am │ │ ├── lzmadec_w32res.rc │ │ ├── xzdec.1 │ │ ├── xzdec.c │ │ └── xzdec_w32res.rc │ ├── tests │ ├── Makefile.am │ ├── bcj_test.c │ ├── compress_prepared_bcj_sparc │ ├── compress_prepared_bcj_x86 │ ├── create_compress_files.c │ ├── files │ │ ├── README │ │ ├── bad-0-backward_size.xz │ │ ├── bad-0-empty-truncated.xz │ │ ├── bad-0-footer_magic.xz │ │ ├── bad-0-header_magic.xz │ │ ├── bad-0-nonempty_index.xz │ │ ├── bad-0cat-alone.xz │ │ ├── bad-0cat-header_magic.xz │ │ ├── bad-0catpad-empty.xz │ │ ├── bad-0pad-empty.xz │ │ ├── bad-1-block_header-1.xz │ │ ├── bad-1-block_header-2.xz │ │ ├── bad-1-block_header-3.xz │ │ ├── bad-1-block_header-4.xz │ │ ├── bad-1-block_header-5.xz │ │ ├── bad-1-block_header-6.xz │ │ ├── bad-1-check-crc32.xz │ │ ├── bad-1-check-crc64.xz │ │ ├── bad-1-check-sha256.xz │ │ ├── bad-1-lzma2-1.xz │ │ ├── bad-1-lzma2-2.xz │ │ ├── bad-1-lzma2-3.xz │ │ ├── bad-1-lzma2-4.xz │ │ ├── bad-1-lzma2-5.xz │ │ ├── bad-1-lzma2-6.xz │ │ ├── bad-1-lzma2-7.xz │ │ ├── bad-1-lzma2-8.xz │ │ ├── bad-1-stream_flags-1.xz │ │ ├── bad-1-stream_flags-2.xz │ │ ├── bad-1-stream_flags-3.xz │ │ ├── bad-1-vli-1.xz │ │ ├── bad-1-vli-2.xz │ │ ├── bad-2-compressed_data_padding.xz │ │ ├── bad-2-index-1.xz │ │ ├── bad-2-index-2.xz │ │ ├── bad-2-index-3.xz │ │ ├── bad-2-index-4.xz │ │ ├── bad-2-index-5.xz │ │ ├── good-0-empty.xz │ │ ├── good-0cat-empty.xz │ │ ├── good-0catpad-empty.xz │ │ ├── good-0pad-empty.xz │ │ ├── good-1-3delta-lzma2.xz │ │ ├── good-1-block_header-1.xz │ │ ├── good-1-block_header-2.xz │ │ ├── good-1-block_header-3.xz │ │ ├── good-1-check-crc32.xz │ │ ├── good-1-check-crc64.xz │ │ ├── good-1-check-none.xz │ │ ├── good-1-check-sha256.xz │ │ ├── good-1-delta-lzma2.tiff.xz │ │ ├── good-1-lzma2-1.xz │ │ ├── good-1-lzma2-2.xz │ │ ├── good-1-lzma2-3.xz │ │ ├── good-1-lzma2-4.xz │ │ ├── good-1-lzma2-5.xz │ │ ├── good-1-sparc-lzma2.xz │ │ ├── good-1-x86-lzma2.xz │ │ ├── good-2-lzma2.xz │ │ ├── unsupported-block_header.xz │ │ ├── unsupported-check.xz │ │ ├── unsupported-filter_flags-1.xz │ │ ├── unsupported-filter_flags-2.xz │ │ └── unsupported-filter_flags-3.xz │ ├── test_bcj_exact_size.c │ ├── test_block_header.c │ ├── test_check.c │ ├── test_compress.sh │ ├── test_files.sh │ ├── test_filter_flags.c │ ├── test_index.c │ ├── test_scripts.sh │ ├── test_stream_flags.c │ ├── tests.h │ └── xzgrep_expected_output │ └── windows │ ├── INSTALL-MSVC.txt │ ├── INSTALL-MinGW.txt │ ├── README-Windows.txt │ ├── build.bash │ ├── config.h │ ├── liblzma.vcxproj │ ├── liblzma_dll.vcxproj │ └── xz_win.sln ├── examples └── launcher │ ├── CMakeLists.txt │ ├── borderlesswindow.cpp │ ├── borderlesswindow.h │ ├── content │ ├── Button.qml │ ├── Input.qml │ └── Label.qml │ ├── main.cpp │ ├── main.qml │ ├── mainwindow.cpp │ ├── mainwindow.h │ ├── ressources.qrc │ ├── updatedialog.cpp │ ├── updatedialog.h │ └── updatedialog.ui ├── src ├── CMakeLists.txt ├── common │ ├── jsonutil.cpp │ ├── jsonutil.h │ ├── lzma.cpp │ ├── lzma.h │ ├── package.cpp │ ├── package.h │ ├── packagemetadata.cpp │ ├── packagemetadata.h │ ├── packages.cpp │ ├── packages.h │ ├── utils.cpp │ ├── utils.h │ ├── version.cpp │ ├── version.h │ ├── versions.cpp │ └── versions.h ├── errors │ ├── warning.cpp │ └── warning.h ├── exceptions.h ├── operations │ ├── adddirectoryoperation.cpp │ ├── adddirectoryoperation.h │ ├── addoperation.cpp │ ├── addoperation.h │ ├── operation.cpp │ ├── operation.h │ ├── patchoperation.cpp │ ├── patchoperation.h │ ├── removedirectoryoperation.cpp │ ├── removedirectoryoperation.h │ ├── removeoperation.cpp │ └── removeoperation.h ├── packager.cpp ├── packager.h ├── packager │ ├── compressfiletask.cpp │ ├── compressfiletask.h │ ├── packagertask.cpp │ ├── packagertask.h │ ├── patchfiletask.cpp │ ├── patchfiletask.h │ ├── taskinfo.cpp │ └── taskinfo.h ├── qtupdatesystem_global.h ├── repository.cpp ├── repository.h ├── tools │ ├── brotli.cpp │ ├── brotli.h │ ├── lzma.cpp │ ├── lzma.h │ ├── lzma │ │ └── config.h │ ├── xdelta3.cpp │ └── xdelta3.h ├── updater.cpp ├── updater.h └── updater │ ├── copythread.cpp │ ├── copythread.h │ ├── downloadmanager.cpp │ ├── downloadmanager.h │ ├── filemanager.cpp │ ├── filemanager.h │ ├── localrepository.cpp │ ├── localrepository.h │ └── oneobjectthread.h ├── tests ├── CMakeLists.txt ├── data │ ├── repo_v1_rev1 │ │ ├── complete_1 │ │ ├── complete_1.metadata │ │ ├── current │ │ ├── packages │ │ ├── patch1_2 │ │ ├── patch1_2.metadata │ │ └── versions │ ├── repo_v1_rev2 │ │ ├── complete_1 │ │ ├── complete_1.metadata │ │ ├── current │ │ ├── packages │ │ ├── patch1_2 │ │ ├── patch1_2.metadata │ │ └── versions │ ├── repository_add │ │ ├── expected │ │ │ ├── current │ │ │ ├── packages │ │ │ └── versions │ │ └── init │ │ │ ├── current │ │ │ ├── packages │ │ │ ├── patchREV1_REV2 │ │ │ ├── patchREV1_REV2.metadata │ │ │ └── versions │ ├── repository_new │ │ ├── packages │ │ └── versions │ ├── rev1 │ │ ├── dir2 │ │ │ └── patch_same.txt │ │ ├── path_diff.txt │ │ ├── path_diff2.txt │ │ └── rmfile.txt │ ├── rev1_local │ │ ├── path_diff.txt │ │ └── status.json │ ├── rev2 │ │ ├── add.txt │ │ ├── dir2 │ │ │ └── patch_same.txt │ │ ├── empty_dir │ │ ├── path_diff.txt │ │ └── path_diff2.txt │ ├── updater_copy │ │ ├── init_repo │ │ │ ├── add.txt │ │ │ └── status.json │ │ └── local_repo │ │ │ ├── patch_same.txt │ │ │ ├── path_diff.txt │ │ │ ├── path_diff2.txt │ │ │ ├── rmfile.txt │ │ │ └── status.json │ └── updater_isManaged │ │ ├── patch_same.txt │ │ ├── path_diff.txt │ │ ├── path_diff2.txt │ │ ├── rmfile.txt │ │ └── status.json ├── main.cpp ├── testutils.cpp ├── testutils.h ├── tst_packager.cpp ├── tst_packager.h ├── tst_repository.cpp ├── tst_repository.h ├── tst_updatechain.cpp ├── tst_updatechain.h ├── tst_updater.cpp └── tst_updater.h └── utils ├── CMakeLists.txt ├── packager ├── CMakeLists.txt └── main.cpp ├── repository ├── CMakeLists.txt └── main.cpp └── updater ├── CMakeLists.txt └── main.cpp /.appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | 3 | image: Visual Studio 2015 4 | 5 | environment: 6 | MSBUILD_FLAGS: /verbosity:minimal /maxcpucount 7 | matrix: 8 | - CMAKE_GENERATOR: "Visual Studio 14 2015" 9 | QT5: C:\Qt\5.8\msvc2015 10 | - CMAKE_GENERATOR: "Visual Studio 14 2015 Win64" 11 | QT5: C:\Qt\5.8\msvc2015_64 12 | 13 | matrix: 14 | fast_finish: true 15 | 16 | before_build: 17 | - set Path=%QT5%\bin;%Path% 18 | - cmake -H. -Bbuild -G "%CMAKE_GENERATOR%" -DCMAKE_SYSTEM_VERSION=10.0 "-DCMAKE_PREFIX_PATH=%QT5%" 19 | 20 | build_script: 21 | - if "%APPVEYOR_REPO_TAG%"=="true" (set CONFIGURATION=RelWithDebInfo) else (set CONFIGURATION=Debug) 22 | - cmake --build build --config "%CONFIGURATION%" -- %MSBUILD_FLAGS% 23 | 24 | after_build: 25 | - build\bin\%CONFIGURATION%\tests.exe 26 | 27 | artifacts: 28 | - path: build/bin/ 29 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | tests/data/** binary 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | 3 | *.slo 4 | *.lo 5 | *.o 6 | *.a 7 | *.la 8 | *.lai 9 | *.so 10 | *.dll 11 | *.dylib 12 | 13 | # Qt-es 14 | 15 | *.pro.user 16 | *.pro.user.* 17 | moc_*.cpp 18 | qrc_*.cpp 19 | Makefile 20 | *-build-* 21 | *.vcxproj 22 | *.filters 23 | *.user 24 | Makefile.Debug 25 | *.suo 26 | *.sdf 27 | Makefile.Release 28 | *.pdb 29 | tests/updatechain_testNew/tmp/ 30 | tests/updatechain_testNew/repo/ 31 | tests/updatechain_testNew/local_repo/ 32 | docs/ 33 | tests/tst_* 34 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 2.8.11) 2 | project (QtUpdateSystem) 3 | 4 | set(BUILD_SHARED_LIBS OFF) 5 | 6 | # Instruct CMake to run moc automatically when needed. 7 | set(CMAKE_AUTOMOC ON) 8 | 9 | # Find includes in corresponding build directories 10 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 11 | # Workaround for : http://public.kitware.com/Bug/view.php?id=14292 12 | if(CMAKE_VERSION VERSION_LESS 2.8.12) 13 | if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug") 14 | message(STATUS "cmake version < 2.8.12, adding QT_NO_DEBUG manually") 15 | add_definitions(-DQT_NO_DEBUG) 16 | endif() 17 | endif() 18 | 19 | if(MSVC) 20 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /w34100 /w34189") 21 | else() 22 | # clang || gcc 23 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11") 24 | endif() 25 | 26 | if(NOT DEFINED QtUpdateSystem_NOOUPUTPATH) 27 | set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) 28 | set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) 29 | endif() 30 | 31 | find_package(Qt5Network) 32 | find_package(Qt5Core) 33 | 34 | add_subdirectory (src) 35 | add_subdirectory (deps/brotli) 36 | add_subdirectory (tests) 37 | add_subdirectory (examples/launcher) 38 | if(NOT DEFINED QtUpdateSystem_NOUTILS) 39 | add_subdirectory (utils) 40 | endif() 41 | -------------------------------------------------------------------------------- /deps/brotli/.bintray.json: -------------------------------------------------------------------------------- 1 | { 2 | "package": { 3 | "name": "bin", 4 | "repo": "brotli", 5 | "subject": "eustas" 6 | }, 7 | 8 | "version": {"name": "snapshot"}, 9 | 10 | "files": [ 11 | { 12 | "includePattern": "brotli.zip", 13 | "uploadPattern": "brotli-${TRAVIS_OS_NAME}-${RELEASE_DATE}.zip", 14 | "matrix_params": {"override": 1} 15 | } 16 | ], 17 | 18 | "publish": true 19 | } 20 | -------------------------------------------------------------------------------- /deps/brotli/.configure-custom.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | DISABLE_VARS="shared-libs|0|BUILD_SHARED_LIBS" 4 | DISABLE_BUILD_SHARED_LIBS_DOC="force building static libraries" 5 | -------------------------------------------------------------------------------- /deps/brotli/.gitignore: -------------------------------------------------------------------------------- 1 | # C 2 | *.o 3 | bin/ 4 | buildfiles/ 5 | **/obj/ 6 | dist/ 7 | 8 | # Python 9 | __pycache__/ 10 | *.py[cod] 11 | *.so 12 | *.egg-info/ 13 | 14 | # Tests 15 | *.txt.uncompressed 16 | *.bro 17 | *.unbro 18 | -------------------------------------------------------------------------------- /deps/brotli/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "terryfy"] 2 | path = terryfy 3 | url = https://github.com/MacPython/terryfy.git 4 | [submodule "research/esaxx"] 5 | path = research/esaxx 6 | url = https://github.com/hillbig/esaxx 7 | -------------------------------------------------------------------------------- /deps/brotli/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009, 2010, 2013-2016 by the Brotli Authors. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /deps/brotli/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CONTRIBUTING.md 2 | include common/*.c 3 | include common/*.h 4 | include dec/*.c 5 | include dec/*.h 6 | include enc/*.c 7 | include enc/*.h 8 | include include/brotli/*.h 9 | include LICENSE 10 | include MANIFEST.in 11 | include python/bro.py 12 | include python/brotlimodule.cc 13 | include python/README.md 14 | include README.md 15 | include setup.py 16 | include tools/bro.c 17 | -------------------------------------------------------------------------------- /deps/brotli/Makefile: -------------------------------------------------------------------------------- 1 | OS := $(shell uname) 2 | LIBSOURCES = $(wildcard common/*.c) $(wildcard dec/*.c) $(wildcard enc/*.c) 3 | SOURCES = $(LIBSOURCES) tools/bro.c 4 | BINDIR = bin 5 | OBJDIR = $(BINDIR)/obj 6 | LIBOBJECTS = $(addprefix $(OBJDIR)/, $(LIBSOURCES:.c=.o)) 7 | OBJECTS = $(addprefix $(OBJDIR)/, $(SOURCES:.c=.o)) 8 | LIB_A = libbrotli.a 9 | EXECUTABLE = bro 10 | DIRS = $(OBJDIR)/common $(OBJDIR)/dec $(OBJDIR)/enc \ 11 | $(OBJDIR)/tools $(BINDIR)/tmp 12 | CFLAGS += -O2 13 | ifeq ($(os), Darwin) 14 | CPPFLAGS += -DOS_MACOSX 15 | endif 16 | 17 | all: test 18 | @: 19 | 20 | .PHONY: all clean test 21 | 22 | $(DIRS): 23 | mkdir -p $@ 24 | 25 | $(EXECUTABLE): $(OBJECTS) 26 | $(CC) $(LDFLAGS) $(OBJECTS) -lm -o $(BINDIR)/$(EXECUTABLE) 27 | 28 | lib: $(LIBOBJECTS) 29 | rm -f $(LIB_A) 30 | ar -crs $(LIB_A) $(LIBOBJECTS) 31 | 32 | test: $(EXECUTABLE) 33 | tests/compatibility_test.sh 34 | tests/roundtrip_test.sh 35 | 36 | clean: 37 | rm -rf $(BINDIR) $(LIB_A) 38 | 39 | .SECONDEXPANSION: 40 | $(OBJECTS): $$(patsubst %.o,%.c,$$(patsubst $$(OBJDIR)/%,%,$$@)) | $(DIRS) 41 | $(CC) $(CFLAGS) $(CPPFLAGS) -Iinclude \ 42 | -c $(patsubst %.o,%.c,$(patsubst $(OBJDIR)/%,%,$@)) -o $@ 43 | -------------------------------------------------------------------------------- /deps/brotli/WORKSPACE: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Bazel workspace file for Brotli. 3 | 4 | workspace(name = "org_brotli") 5 | 6 | maven_jar( 7 | name = "junit_junit", 8 | artifact = "junit:junit:4.12", 9 | ) 10 | 11 | git_repository( 12 | name = "io_bazel_rules_go", 13 | remote = "https://github.com/bazelbuild/rules_go.git", 14 | tag = "0.4.1", 15 | ) 16 | load("@io_bazel_rules_go//go:def.bzl", "go_repositories") 17 | 18 | go_repositories() 19 | -------------------------------------------------------------------------------- /deps/brotli/common/version.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Version definition. */ 8 | 9 | #ifndef BROTLI_COMMON_VERSION_H_ 10 | #define BROTLI_COMMON_VERSION_H_ 11 | 12 | /* This macro should only be used when library is compiled together with client. 13 | If library is dynamically linked, use BrotliDecoderVersion and 14 | BrotliEncoderVersion methods. */ 15 | 16 | /* Semantic version, calculated as (MAJOR << 24) | (MINOR << 12) | PATCH */ 17 | #define BROTLI_VERSION 0x0006000 18 | 19 | #endif /* BROTLI_COMMON_VERSION_H_ */ 20 | -------------------------------------------------------------------------------- /deps/brotli/configure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "Use Bazel, CMake or Premake5 to generate projects / build files." 3 | echo " Bazel: http://www.bazel.build/" 4 | echo " CMake: https://cmake.org/" 5 | echo " Premake5: https://premake.github.io/" 6 | echo "Or simply run 'make' to build and test command line tool." 7 | -------------------------------------------------------------------------------- /deps/brotli/docs/brotli-comparison-study-2015-09-22.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/docs/brotli-comparison-study-2015-09-22.pdf -------------------------------------------------------------------------------- /deps/brotli/enc/bit_cost.c: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions to estimate the bit cost of Huffman trees. */ 8 | 9 | #include "./bit_cost.h" 10 | 11 | #include "../common/constants.h" 12 | #include 13 | #include "./fast_log.h" 14 | #include "./histogram.h" 15 | #include "./port.h" 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | #define FN(X) X ## Literal 22 | #include "./bit_cost_inc.h" /* NOLINT(build/include) */ 23 | #undef FN 24 | 25 | #define FN(X) X ## Command 26 | #include "./bit_cost_inc.h" /* NOLINT(build/include) */ 27 | #undef FN 28 | 29 | #define FN(X) X ## Distance 30 | #include "./bit_cost_inc.h" /* NOLINT(build/include) */ 31 | #undef FN 32 | 33 | #if defined(__cplusplus) || defined(c_plusplus) 34 | } /* extern "C" */ 35 | #endif 36 | -------------------------------------------------------------------------------- /deps/brotli/enc/block_encoder_inc.h: -------------------------------------------------------------------------------- 1 | /* NOLINT(build/header_guard) */ 2 | /* Copyright 2014 Google Inc. All Rights Reserved. 3 | 4 | Distributed under MIT license. 5 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 6 | */ 7 | 8 | /* template parameters: FN */ 9 | 10 | #define HistogramType FN(Histogram) 11 | 12 | /* Creates entropy codes for all block types and stores them to the bit 13 | stream. */ 14 | static void FN(BuildAndStoreEntropyCodes)(MemoryManager* m, BlockEncoder* self, 15 | const HistogramType* histograms, const size_t histograms_size, 16 | HuffmanTree* tree, size_t* storage_ix, uint8_t* storage) { 17 | const size_t alphabet_size = self->alphabet_size_; 18 | const size_t table_size = histograms_size * alphabet_size; 19 | self->depths_ = BROTLI_ALLOC(m, uint8_t, table_size); 20 | self->bits_ = BROTLI_ALLOC(m, uint16_t, table_size); 21 | if (BROTLI_IS_OOM(m)) return; 22 | 23 | { 24 | size_t i; 25 | for (i = 0; i < histograms_size; ++i) { 26 | size_t ix = i * alphabet_size; 27 | BuildAndStoreHuffmanTree(&histograms[i].data_[0], alphabet_size, tree, 28 | &self->depths_[ix], &self->bits_[ix], storage_ix, storage); 29 | } 30 | } 31 | } 32 | 33 | #undef HistogramType 34 | -------------------------------------------------------------------------------- /deps/brotli/enc/cluster.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Functions for clustering similar histograms together. */ 8 | 9 | #ifndef BROTLI_ENC_CLUSTER_H_ 10 | #define BROTLI_ENC_CLUSTER_H_ 11 | 12 | #include 13 | #include "./histogram.h" 14 | #include "./memory.h" 15 | #include "./port.h" 16 | 17 | #if defined(__cplusplus) || defined(c_plusplus) 18 | extern "C" { 19 | #endif 20 | 21 | typedef struct HistogramPair { 22 | uint32_t idx1; 23 | uint32_t idx2; 24 | double cost_combo; 25 | double cost_diff; 26 | } HistogramPair; 27 | 28 | #define CODE(X) /* Declaration */; 29 | 30 | #define FN(X) X ## Literal 31 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 32 | #undef FN 33 | 34 | #define FN(X) X ## Command 35 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 36 | #undef FN 37 | 38 | #define FN(X) X ## Distance 39 | #include "./cluster_inc.h" /* NOLINT(build/include) */ 40 | #undef FN 41 | 42 | #undef CODE 43 | 44 | #if defined(__cplusplus) || defined(c_plusplus) 45 | } /* extern "C" */ 46 | #endif 47 | 48 | #endif /* BROTLI_ENC_CLUSTER_H_ */ 49 | -------------------------------------------------------------------------------- /deps/brotli/enc/dictionary_hash.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Hash table on the 4-byte prefixes of static dictionary words. */ 8 | 9 | #ifndef BROTLI_ENC_DICTIONARY_HASH_H_ 10 | #define BROTLI_ENC_DICTIONARY_HASH_H_ 11 | 12 | #include 13 | 14 | #if defined(__cplusplus) || defined(c_plusplus) 15 | extern "C" { 16 | #endif 17 | 18 | extern const uint16_t kStaticDictionaryHash[32768]; 19 | 20 | #if defined(__cplusplus) || defined(c_plusplus) 21 | } /* extern "C" */ 22 | #endif 23 | 24 | #endif /* BROTLI_ENC_DICTIONARY_HASH_H_ */ 25 | -------------------------------------------------------------------------------- /deps/brotli/enc/literal_cost.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Literal cost model to allow backward reference replacement to be efficient. 8 | */ 9 | 10 | #ifndef BROTLI_ENC_LITERAL_COST_H_ 11 | #define BROTLI_ENC_LITERAL_COST_H_ 12 | 13 | #include 14 | #include "./port.h" 15 | 16 | #if defined(__cplusplus) || defined(c_plusplus) 17 | extern "C" { 18 | #endif 19 | 20 | /* Estimates how many bits the literals in the interval [pos, pos + len) in the 21 | ring-buffer (data, mask) will take entropy coded and writes these estimates 22 | to the cost[0..len) array. */ 23 | BROTLI_INTERNAL void BrotliEstimateBitCostsForLiterals( 24 | size_t pos, size_t len, size_t mask, const uint8_t *data, float *cost); 25 | 26 | #if defined(__cplusplus) || defined(c_plusplus) 27 | } /* extern "C" */ 28 | #endif 29 | 30 | #endif /* BROTLI_ENC_LITERAL_COST_H_ */ 31 | -------------------------------------------------------------------------------- /deps/brotli/enc/utf8_util.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2013 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Heuristics for deciding about the UTF8-ness of strings. */ 8 | 9 | #ifndef BROTLI_ENC_UTF8_UTIL_H_ 10 | #define BROTLI_ENC_UTF8_UTIL_H_ 11 | 12 | #include 13 | #include "./port.h" 14 | 15 | #if defined(__cplusplus) || defined(c_plusplus) 16 | extern "C" { 17 | #endif 18 | 19 | static const double kMinUTF8Ratio = 0.75; 20 | 21 | /* Returns 1 if at least min_fraction of the bytes between pos and 22 | pos + length in the (data, mask) ring-buffer is UTF8-encoded, otherwise 23 | returns 0. */ 24 | BROTLI_INTERNAL BROTLI_BOOL BrotliIsMostlyUTF8( 25 | const uint8_t* data, const size_t pos, const size_t mask, 26 | const size_t length, const double min_fraction); 27 | 28 | #if defined(__cplusplus) || defined(c_plusplus) 29 | } /* extern "C" */ 30 | #endif 31 | 32 | #endif /* BROTLI_ENC_UTF8_UTIL_H_ */ 33 | -------------------------------------------------------------------------------- /deps/brotli/fuzz/run_decode_fuzzer.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2016 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | /* Simple runner for decode_fuzzer.cc */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | extern "C" void LLVMFuzzerTestOneInput(const uint8_t* data, size_t size); 15 | 16 | int main(int argc, char* *argv) { 17 | if (argc != 2) { 18 | fprintf(stderr, "Exactly one argument is expected.\n"); 19 | exit(EXIT_FAILURE); 20 | } 21 | 22 | FILE* f = fopen(argv[1], "r"); 23 | if (!f) { 24 | fprintf(stderr, "Failed to open input file."); 25 | exit(EXIT_FAILURE); 26 | } 27 | 28 | size_t max_len = 1 << 20; 29 | unsigned char* tmp = (unsigned char*)malloc(max_len); 30 | size_t len = fread(tmp, 1, max_len, f); 31 | if (ferror(f)) { 32 | fclose(f); 33 | fprintf(stderr, "Failed read input file."); 34 | exit(EXIT_FAILURE); 35 | } 36 | /* Make data after the end "inaccessible". */ 37 | unsigned char* data = (unsigned char*)malloc(len); 38 | memcpy(data, tmp, len); 39 | free(tmp); 40 | 41 | LLVMFuzzerTestOneInput(data, len); 42 | free(data); 43 | exit(EXIT_SUCCESS); 44 | } 45 | -------------------------------------------------------------------------------- /deps/brotli/fuzz/test_fuzzer.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | BROTLI="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )" 4 | 5 | cd $BROTLI 6 | 7 | rm -rf bin 8 | mkdir bin 9 | cd bin 10 | 11 | cmake .. -B./ -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DENABLE_SANITIZER=address 12 | make clean 13 | make -j$(nproc) brotlidec 14 | 15 | c++ -c -std=c++11 ../fuzz/decode_fuzzer.cc -I./include 16 | ar rvs decode_fuzzer.a decode_fuzzer.o 17 | c++ ../fuzz/run_decode_fuzzer.cc -o run_decode_fuzzer -lasan decode_fuzzer.a ./libbrotlidec.a ./libbrotlicommon.a 18 | 19 | mkdir decode_corpora 20 | unzip ../java/org/brotli/integration/fuzz_data.zip -d decode_corpora 21 | 22 | for f in `ls decode_corpora` 23 | do 24 | echo "Testing $f" 25 | ./run_decode_fuzzer decode_corpora/$f 26 | done 27 | 28 | cd $BROTLI 29 | rm -rf bin 30 | -------------------------------------------------------------------------------- /deps/brotli/go/cbrotli/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) # MIT 4 | 5 | load("@io_bazel_rules_go//go:def.bzl", "go_prefix", "go_library", "go_test") 6 | 7 | go_prefix("github.com/google/brotli") 8 | 9 | go_library( 10 | name = "cbrotli", 11 | srcs = ["cbrotli.go"], 12 | deps = [ 13 | "//go/cbrotli/internal:decoder", 14 | "//go/cbrotli/internal:encoder", 15 | ], 16 | ) 17 | 18 | go_test( 19 | name = "cbrotli_test", 20 | size = "small", 21 | srcs = ["cbrotli_test.go"], 22 | library = ":cbrotli", 23 | ) 24 | -------------------------------------------------------------------------------- /deps/brotli/go/cbrotli/internal/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) # MIT 4 | 5 | load("@io_bazel_rules_go//go:def.bzl", "cgo_library") 6 | 7 | cgo_library( 8 | name = "decoder", 9 | srcs = ["decoder.go"], 10 | visibility = ["//go/cbrotli:__subpackages__"], 11 | cdeps = ["//:brotlidec"], 12 | ) 13 | 14 | cgo_library( 15 | name = "encoder", 16 | srcs = ["encoder.go"], 17 | visibility = ["//go/cbrotli:__subpackages__"], 18 | cdeps = ["//:brotlienc"], 19 | ) 20 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/dec/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Java port of Brotli decoder. 3 | 4 | package(default_visibility = ["//visibility:public"]) 5 | 6 | licenses(["notice"]) # MIT 7 | 8 | java_library( 9 | name = "lib", 10 | srcs = glob(["*.java"], exclude = ["*Test*.java"]), 11 | ) 12 | 13 | java_library( 14 | name = "test_lib", 15 | srcs = glob(["*Test*.java"]), 16 | deps = [ 17 | ":lib", 18 | "@junit_junit//jar", 19 | ], 20 | testonly = 1, 21 | ) 22 | 23 | java_test( 24 | name = "BitReaderTest", 25 | test_class = "org.brotli.dec.BitReaderTest", 26 | runtime_deps = [":test_lib"], 27 | ) 28 | 29 | java_test( 30 | name = "DecodeTest", 31 | test_class = "org.brotli.dec.DecodeTest", 32 | runtime_deps = [":test_lib"], 33 | ) 34 | 35 | java_test( 36 | name = "DictionaryTest", 37 | test_class = "org.brotli.dec.DictionaryTest", 38 | runtime_deps = [":test_lib"], 39 | ) 40 | 41 | java_test( 42 | name = "EnumTest", 43 | test_class = "org.brotli.dec.EnumTest", 44 | runtime_deps = [":test_lib"], 45 | ) 46 | 47 | java_test( 48 | name = "SynthTest", 49 | test_class = "org.brotli.dec.SynthTest", 50 | runtime_deps = [":test_lib"], 51 | ) 52 | 53 | java_test( 54 | name = "TransformTest", 55 | test_class = "org.brotli.dec.TransformTest", 56 | runtime_deps = [":test_lib"], 57 | ) 58 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/dec/BitReaderTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | package org.brotli.dec; 8 | 9 | import static org.junit.Assert.fail; 10 | 11 | import java.io.ByteArrayInputStream; 12 | import org.junit.Test; 13 | import org.junit.runner.RunWith; 14 | import org.junit.runners.JUnit4; 15 | 16 | /** 17 | * Tests for {@link BitReader}. 18 | */ 19 | @RunWith(JUnit4.class) 20 | public class BitReaderTest { 21 | 22 | @Test 23 | public void testReadAfterEos() { 24 | BitReader reader = new BitReader(); 25 | BitReader.init(reader, new ByteArrayInputStream(new byte[1])); 26 | BitReader.readBits(reader, 9); 27 | try { 28 | BitReader.checkHealth(reader, false); 29 | } catch (BrotliRuntimeException ex) { 30 | // This exception is expected. 31 | return; 32 | } 33 | fail("BrotliRuntimeException should have been thrown by BitReader.checkHealth"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/dec/BrotliRuntimeException.java: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | package org.brotli.dec; 8 | 9 | /** 10 | * Unchecked exception used internally. 11 | */ 12 | class BrotliRuntimeException extends RuntimeException { 13 | 14 | BrotliRuntimeException(String message) { 15 | super(message); 16 | } 17 | 18 | BrotliRuntimeException(String message, Throwable cause) { 19 | super(message, cause); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/dec/DictionaryTest.java: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | package org.brotli.dec; 8 | 9 | import static org.junit.Assert.assertEquals; 10 | 11 | import java.security.MessageDigest; 12 | import java.security.NoSuchAlgorithmException; 13 | import org.junit.Test; 14 | import org.junit.runner.RunWith; 15 | import org.junit.runners.JUnit4; 16 | 17 | /** 18 | * Tests for {@link Dictionary}. 19 | */ 20 | @RunWith(JUnit4.class) 21 | public class DictionaryTest { 22 | 23 | @Test 24 | public void testGetData() throws NoSuchAlgorithmException { 25 | MessageDigest md = MessageDigest.getInstance("SHA-256"); 26 | md.update(Dictionary.getData()); 27 | byte[] digest = md.digest(); 28 | String sha256 = String.format("%064x", new java.math.BigInteger(1, digest)); 29 | assertEquals("20e42eb1b511c21806d4d227d07e5dd06877d8ce7b3a817f378f313653f35c70", sha256); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/dec/IntReader.java: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | package org.brotli.dec; 8 | 9 | /** 10 | * Byte-to-int conversion magic. 11 | */ 12 | final class IntReader { 13 | 14 | private byte[] byteBuffer; 15 | private int[] intBuffer; 16 | 17 | static void init(IntReader ir, byte[] byteBuffer, int[] intBuffer) { 18 | ir.byteBuffer = byteBuffer; 19 | ir.intBuffer = intBuffer; 20 | } 21 | 22 | /** 23 | * Translates bytes to ints. 24 | * 25 | * NB: intLen == 4 * byteSize! 26 | * NB: intLen should be less or equal to intBuffer length. 27 | */ 28 | static void convert(IntReader ir, int intLen) { 29 | for (int i = 0; i < intLen; ++i) { 30 | ir.intBuffer[i] = ((ir.byteBuffer[i * 4] & 0xFF)) 31 | | ((ir.byteBuffer[(i * 4) + 1] & 0xFF) << 8) 32 | | ((ir.byteBuffer[(i * 4) + 2] & 0xFF) << 16) 33 | | ((ir.byteBuffer[(i * 4) + 3] & 0xFF) << 24); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/dec/RunningState.java: -------------------------------------------------------------------------------- 1 | /* Copyright 2015 Google Inc. All Rights Reserved. 2 | 3 | Distributed under MIT license. 4 | See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | */ 6 | 7 | package org.brotli.dec; 8 | 9 | /** 10 | * Enumeration of decoding state-machine. 11 | */ 12 | final class RunningState { 13 | static final int UNINITIALIZED = 0; 14 | static final int BLOCK_START = 1; 15 | static final int COMPRESSED_BLOCK_START = 2; 16 | static final int MAIN_LOOP = 3; 17 | static final int READ_METADATA = 4; 18 | static final int COPY_UNCOMPRESSED = 5; 19 | static final int INSERT_LOOP = 6; 20 | static final int COPY_LOOP = 7; 21 | static final int COPY_WRAP_BUFFER = 8; 22 | static final int TRANSFORM = 9; 23 | static final int FINISHED = 10; 24 | static final int CLOSED = 11; 25 | static final int WRITE = 12; 26 | } 27 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/integration/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Integration test runner + corpus for Java port of Brotli decoder. 3 | 4 | java_library( 5 | name = "bundle_checker_lib", 6 | srcs = ["BundleChecker.java"], 7 | deps = ["//java/org/brotli/dec:lib"], 8 | ) 9 | 10 | java_binary( 11 | name = "bundle_checker", 12 | main_class = "org.brotli.integration.BundleChecker", 13 | runtime_deps = [":bundle_checker_lib"], 14 | ) 15 | 16 | java_test( 17 | name = "bundle_checker_data_test", 18 | args = ["java/org/brotli/integration/test_data.zip"], 19 | data = ["test_data.zip"], 20 | main_class = "org.brotli.integration.BundleChecker", 21 | use_testrunner = 0, 22 | runtime_deps = [":bundle_checker_lib"], 23 | ) 24 | 25 | java_test( 26 | name = "bundle_checker_fuzz_test", 27 | args = [ 28 | "-s", 29 | "java/org/brotli/integration/fuzz_data.zip" 30 | ], 31 | data = ["fuzz_data.zip"], 32 | main_class = "org.brotli.integration.BundleChecker", 33 | use_testrunner = 0, 34 | runtime_deps = [":bundle_checker_lib"], 35 | ) 36 | -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/integration/fuzz_data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/java/org/brotli/integration/fuzz_data.zip -------------------------------------------------------------------------------- /deps/brotli/java/org/brotli/integration/test_data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/java/org/brotli/integration/test_data.zip -------------------------------------------------------------------------------- /deps/brotli/python/Makefile: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Brotli Authors. All rights reserved. 2 | # 3 | # Distributed under MIT license. 4 | # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | 6 | 7 | # Default 8 | .PHONY: all 9 | # Build 10 | .PHONY: build 11 | # Test 12 | .PHONY: test tests 13 | # Clean 14 | .PHONY: clean 15 | # Format 16 | .PHONY: fix 17 | 18 | 19 | PYTHON ?= python 20 | YAPF ?= yapf 21 | 22 | EXT_SUFFIX=$(shell $(PYTHON) -c 'import sysconfig; print(sysconfig.get_config_var("EXT_SUFFIX"))') 23 | EXT_SOURCES=$(shell find . -name '*.cc') 24 | EXTENSIONS=$(EXT_SOURCES:%.cc=%$(EXT_SUFFIX)) 25 | 26 | 27 | all: build 28 | 29 | build: $(EXTENSIONS) 30 | 31 | $(EXTENSIONS): $(EXT_SOURCES) 32 | @cd .. && $(PYTHON) setup.py develop 33 | 34 | test: tests 35 | 36 | tests: build 37 | @echo 'running tests' 38 | @$(PYTHON) -m unittest discover -p '*_test.py' 39 | 40 | clean: 41 | @cd .. && $(PYTHON) setup.py clean 42 | @find .. -name '*.pyc' | xargs rm -v 43 | @find .. -name '*.so' | xargs rm -v 44 | @find .. -type d -name '__pycache__' | xargs rm -v -r 45 | @find .. -type d -name '*.egg-info' | xargs rm -v -r 46 | 47 | fix: 48 | @echo 'formatting code' 49 | -@$(YAPF) --in-place --recursive --verify . 50 | -------------------------------------------------------------------------------- /deps/brotli/python/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/python/tests/__init__.py -------------------------------------------------------------------------------- /deps/brotli/python/tests/decompress_test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2016 The Brotli Authors. All rights reserved. 2 | # 3 | # Distributed under MIT license. 4 | # See file LICENSE for detail or copy at https://opensource.org/licenses/MIT 5 | 6 | import unittest 7 | 8 | from . import _test_utils 9 | import brotli 10 | 11 | 12 | def _get_original_name(test_data): 13 | return test_data.split('.compressed')[0] 14 | 15 | 16 | class TestDecompress(_test_utils.TestCase): 17 | 18 | def _check_decompression(self, test_data): 19 | # Verify decompression matches the original. 20 | temp_uncompressed = _test_utils.get_temp_uncompressed_name(test_data) 21 | original = _get_original_name(test_data) 22 | self.assertFilesMatch(temp_uncompressed, original) 23 | 24 | def _decompress(self, test_data): 25 | temp_uncompressed = _test_utils.get_temp_uncompressed_name(test_data) 26 | with open(temp_uncompressed, 'wb') as out_file: 27 | with open(test_data, 'rb') as in_file: 28 | out_file.write(brotli.decompress(in_file.read())) 29 | 30 | def _test_decompress(self, test_data): 31 | self._decompress(test_data) 32 | self._check_decompression(test_data) 33 | 34 | 35 | _test_utils.generate_test_methods(TestDecompress, for_decompression=True) 36 | 37 | if __name__ == '__main__': 38 | unittest.main() 39 | -------------------------------------------------------------------------------- /deps/brotli/research/Makefile: -------------------------------------------------------------------------------- 1 | CC = g++ 2 | CFLAGS += -O2 3 | CPPFLAGS += -std=c++11 4 | SOURCES = $(wildcard *.cc) 5 | EXECUTABLES = $(SOURCES:.cc=) 6 | BINDIR = bin 7 | 8 | all: $(EXECUTABLES) 9 | 10 | $(BINDIR): 11 | mkdir -p $@ 12 | 13 | $(EXECUTABLES): $(BINDIR) 14 | $(CC) $(CFLAGS) $(CPPFLAGS) $(addsuffix .cc, $@) -o $(BINDIR)/$@ -lgflags_nothreads 15 | 16 | clean: 17 | rm -rf $(BINDIR) 18 | -------------------------------------------------------------------------------- /deps/brotli/research/img/enwik9_brotli.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/research/img/enwik9_brotli.png -------------------------------------------------------------------------------- /deps/brotli/research/img/enwik9_diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/research/img/enwik9_diff.png -------------------------------------------------------------------------------- /deps/brotli/research/img/enwik9_opt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/research/img/enwik9_opt.png -------------------------------------------------------------------------------- /deps/brotli/setup.cfg: -------------------------------------------------------------------------------- 1 | [build] 2 | build-base=bin 3 | 4 | [yapf] 5 | based_on_style=google 6 | -------------------------------------------------------------------------------- /deps/brotli/tests/Makefile: -------------------------------------------------------------------------------- 1 | #brotli/tests 2 | 3 | BROTLI = .. 4 | 5 | all: test 6 | 7 | test: deps 8 | ./compatibility_test.sh 9 | ./roundtrip_test.sh 10 | 11 | deps : 12 | $(MAKE) -C $(BROTLI) bro 13 | 14 | clean : 15 | rm -f testdata/*.{bro,unbro,uncompressed} 16 | rm -f $(BROTLI)/{enc,dec,tools}/*.{un,}bro 17 | $(MAKE) -C $(BROTLI)/tools clean 18 | -------------------------------------------------------------------------------- /deps/brotli/tests/compatibility_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Test that the brotli command-line tool can decompress old brotli-compressed 4 | # files. 5 | 6 | set -o errexit 7 | 8 | BRO=bin/bro 9 | TMP_DIR=bin/tmp 10 | 11 | for file in tests/testdata/*.compressed*; do 12 | echo "Testing decompression of file $file" 13 | expected=${file%.compressed*} 14 | uncompressed=${TMP_DIR}/${expected##*/}.uncompressed 15 | echo $uncompressed 16 | $BRO -f -d -i $file -o $uncompressed 17 | diff -q $uncompressed $expected 18 | # Test the streaming version 19 | cat $file | $BRO -d > $uncompressed 20 | diff -q $uncompressed $expected 21 | rm -f $uncompressed 22 | done 23 | -------------------------------------------------------------------------------- /deps/brotli/tests/roundtrip_test.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | # 3 | # Roundtrip test for the brotli command-line tool. 4 | 5 | set -o errexit 6 | 7 | BRO=bin/bro 8 | TMP_DIR=bin/tmp 9 | INPUTS=""" 10 | tests/testdata/alice29.txt 11 | tests/testdata/asyoulik.txt 12 | tests/testdata/lcet10.txt 13 | tests/testdata/plrabn12.txt 14 | enc/encode.c 15 | common/dictionary.h 16 | dec/decode.c 17 | $BRO 18 | """ 19 | 20 | for file in $INPUTS; do 21 | for quality in 1 6 9 11; do 22 | echo "Roundtrip testing $file at quality $quality" 23 | compressed=${TMP_DIR}/${file##*/}.bro 24 | uncompressed=${TMP_DIR}/${file##*/}.unbro 25 | $BRO -f -q $quality -i $file -o $compressed 26 | $BRO -f -d -i $compressed -o $uncompressed 27 | diff -q $file $uncompressed 28 | # Test the streaming version 29 | cat $file | $BRO -q $quality | $BRO -d >$uncompressed 30 | diff -q $file $uncompressed 31 | done 32 | done 33 | -------------------------------------------------------------------------------- /deps/brotli/tests/run-compatibility-test.cmake: -------------------------------------------------------------------------------- 1 | string(REGEX REPLACE "([a-zA-Z0-9\\.]+)\\.compressed(\\.[0-9]+)?$" "\\1" REFERENCE_DATA "${INPUT}") 2 | get_filename_component(OUTPUT_NAME "${REFERENCE_DATA}" NAME) 3 | 4 | execute_process( 5 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 6 | COMMAND ${BROTLI_WRAPPER} ${BROTLI_CLI} --force --decompress --input ${INPUT} --output ${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.unbro 7 | RESULT_VARIABLE result) 8 | if(result) 9 | message(FATAL_ERROR "Decompression failed") 10 | endif() 11 | 12 | function(test_file_equality f1 f2) 13 | if(NOT CMAKE_VERSION VERSION_LESS 2.8.7) 14 | file(SHA512 "${f1}" f1_cs) 15 | file(SHA512 "${f2}" f2_cs) 16 | if(NOT "${f1_cs}" STREQUAL "${f2_cs}") 17 | message(FATAL_ERROR "Files do not match") 18 | endif() 19 | else() 20 | file(READ "${f1}" f1_contents) 21 | file(READ "${f2}" f2_contents) 22 | if(NOT "${f1_contents}" STREQUAL "${f2_contents}") 23 | message(FATAL_ERROR "Files do not match") 24 | endif() 25 | endif() 26 | endfunction() 27 | 28 | test_file_equality("${REFERENCE_DATA}" "${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_NAME}.unbro") 29 | -------------------------------------------------------------------------------- /deps/brotli/tests/run-roundtrip-test.cmake: -------------------------------------------------------------------------------- 1 | execute_process( 2 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 3 | COMMAND ${BROTLI_WRAPPER} ${BROTLI_CLI} --force --quality ${QUALITY} --input ${INPUT} --output ${OUTPUT}.bro 4 | RESULT_VARIABLE result 5 | ERROR_VARIABLE result_stderr) 6 | if(result) 7 | message(FATAL_ERROR "Compression failed: ${result_stderr}") 8 | endif() 9 | 10 | execute_process( 11 | WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" 12 | COMMAND ${BROTLI_WRAPPER} ${BROTLI_CLI} --force --decompress --input ${OUTPUT}.bro --output ${OUTPUT}.unbro 13 | RESULT_VARIABLE result) 14 | if(result) 15 | message(FATAL_ERROR "Decompression failed") 16 | endif() 17 | 18 | function(test_file_equality f1 f2) 19 | if(NOT CMAKE_VERSION VERSION_LESS 2.8.7) 20 | file(SHA512 "${f1}" f1_cs) 21 | file(SHA512 "${f2}" f2_cs) 22 | if(NOT "${f1_cs}" STREQUAL "${f2_cs}") 23 | message(FATAL_ERROR "Files do not match") 24 | endif() 25 | else() 26 | file(READ "${f1}" f1_contents) 27 | file(READ "${f2}" f2_contents) 28 | if(NOT "${f1_contents}" STREQUAL "${f2_contents}") 29 | message(FATAL_ERROR "Files do not match") 30 | endif() 31 | endif() 32 | endfunction() 33 | 34 | test_file_equality("${INPUT}" "${OUTPUT}.unbro") 35 | -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/10x10y: -------------------------------------------------------------------------------- 1 | XXXXXXXXXXYYYYYYYYYY -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/10x10y.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/10x10y.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/64x: -------------------------------------------------------------------------------- 1 | XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/64x.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/64x.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/alice29.txt.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/alice29.txt.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/asyoulik.txt.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/asyoulik.txt.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/backward65536.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/backward65536.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/bb.binast: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/bb.binast -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/compressed_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/compressed_file -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/compressed_file.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/compressed_file.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/compressed_repeated: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/compressed_repeated -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/compressed_repeated.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/compressed_repeated.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.00: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.01: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.01 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.02 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.03 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.04: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.04 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.05: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.05 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.06: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.06 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.07: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.07 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.08: -------------------------------------------------------------------------------- 1 | 3 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.09: -------------------------------------------------------------------------------- 1 | 5 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.10: -------------------------------------------------------------------------------- 1 | 7 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.11: -------------------------------------------------------------------------------- 1 | 9 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.12: -------------------------------------------------------------------------------- 1 | ; -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.13: -------------------------------------------------------------------------------- 1 | = -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.14: -------------------------------------------------------------------------------- 1 | ? -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.15: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/empty.compressed.16: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/empty.compressed.16 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/lcet10.txt.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/lcet10.txt.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/mapsdatazrh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/mapsdatazrh -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/mapsdatazrh.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/mapsdatazrh.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/monkey: -------------------------------------------------------------------------------- 1 | znxcvnmz,xvnm.,zxcnv.,xcn.z,vn.zvn.zxcvn.,zxcn.vn.v,znm.,vnzx.,vnzxc.vn.z,vnz.,nv.z,nvmzxc,nvzxcvcnm.,vczxvnzxcnvmxc.zmcnvzm.,nvmc,nzxmc,vn.mnnmzxc,vnxcnmv,znvzxcnmv,.xcnvm,zxcnzxv.zx,qweryweurqioweupropqwutioweupqrioweutiopweuriopweuriopqwurioputiopqwuriowuqerioupqweropuweropqwurweuqriopuropqwuriopuqwriopuqweopruioqweurqweuriouqweopruioupqiytioqtyiowtyqptypryoqweutioioqtweqruowqeytiowquiourowetyoqwupiotweuqiorweuqroipituqwiorqwtioweuriouytuioerytuioweryuitoweytuiweyuityeruirtyuqriqweuropqweiruioqweurioqwuerioqwyuituierwotueryuiotweyrtuiwertyioweryrueioqptyioruyiopqwtjkasdfhlafhlasdhfjklashjkfhasjklfhklasjdfhklasdhfjkalsdhfklasdhjkflahsjdkfhklasfhjkasdfhasfjkasdhfklsdhalghhaf;hdklasfhjklashjklfasdhfasdjklfhsdjklafsd;hkldadfjjklasdhfjasddfjklfhakjklasdjfkl;asdjfasfljasdfhjklasdfhjkaghjkashf;djfklasdjfkljasdklfjklasdjfkljasdfkljaklfj -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/monkey.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/monkey.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/plrabn12.txt.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/plrabn12.txt.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/quickfox: -------------------------------------------------------------------------------- 1 | The quick brown fox jumps over the lazy dog -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/quickfox.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/quickfox.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/quickfox_repeated.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/quickfox_repeated.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/random_chunks: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/random_chunks -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/random_org_10k.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/random_org_10k.bin -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/random_org_10k.bin.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/random_org_10k.bin.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/ukkonooa: -------------------------------------------------------------------------------- 1 | ukko nooa, ukko nooa oli kunnon mies, kun han meni saunaan, pisti laukun naulaan, ukko nooa, ukko nooa oli kunnon mies. -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/ukkonooa.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/ukkonooa.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/x: -------------------------------------------------------------------------------- 1 | X -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/x.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/x.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/x.compressed.00: -------------------------------------------------------------------------------- 1 | X -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/x.compressed.01: -------------------------------------------------------------------------------- 1 | ,XX -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/x.compressed.02: -------------------------------------------------------------------------------- 1 | X -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/x.compressed.03: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/x.compressed.03 -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/xyzzy: -------------------------------------------------------------------------------- 1 | Xyzzy -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/xyzzy.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/xyzzy.compressed -------------------------------------------------------------------------------- /deps/brotli/tests/testdata/zeros.compressed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/brotli/tests/testdata/zeros.compressed -------------------------------------------------------------------------------- /deps/xdelta/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *~ 3 | .deps 4 | .dirstamp 5 | INSTALL 6 | Makefile 7 | Makefile.in 8 | aclocal.m4 9 | autom4te.cache 10 | build 11 | compile 12 | config.guess 13 | config.h 14 | config.h.in 15 | config.log 16 | config.status 17 | config.sub 18 | config.sub 19 | configure 20 | depcomp 21 | libtool 22 | libtool.m4 23 | ltmain.sh 24 | ltoptions.m4 25 | ltsugar.m4 26 | ltversion.m4 27 | lt~obsolete.m4 28 | missing 29 | stamp-h1 30 | xdelta3/xdelta3 31 | xdelta3decode 32 | xdelta3regtest 33 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/AUTHORS: -------------------------------------------------------------------------------- 1 | The author is Joshua MacDonald, . The Rsync 2 | algorithm, which inspired the core delta algorithm, is due to Andrew 3 | Tridgell and Paul Mackerras. 4 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | INCLUDES = -I$(top_srcdir)/libedsio $(GLIB_CFLAGS) 3 | 4 | bin_PROGRAMS = xdelta 5 | bin_SCRIPTS = xdelta-config 6 | 7 | xdelta_SOURCES = xdmain.c getopt.c getopt1.c 8 | 9 | xdelta_LDADD = libxdelta.la \ 10 | $(top_srcdir)/libedsio/libedsio.la \ 11 | $(GLIB_LIBS) \ 12 | -lz 13 | 14 | include_HEADERS = xdelta.h xd_edsio.h 15 | noinst_HEADERS = xdeltapriv.h getopt.h 16 | 17 | lib_LTLIBRARIES = libxdelta.la 18 | 19 | libxdelta_la_SOURCES = xdelta.c xdapply.c $(SER_SOURCES) 20 | libxdelta_la_LIBADD = $(GLIB_LIBS) 21 | 22 | EXTRA_DIST = xd.ser $(SER_OUT) xdelta.magic xdelta.prj xdelta.m4 \ 23 | autogen.sh xdelta.dsp xdelta.dsw stamp-ser xdrsync.c 24 | 25 | SUBDIRS = libedsio . test doc djgpp 26 | 27 | m4datadir = $(datadir)/aclocal 28 | m4data_DATA = xdelta.m4 29 | 30 | ## $Format: "libxdelta_la_LDFLAGS = -version-info $LibCurrent$:$LibRevision$:$LibAge$" $ 31 | libxdelta_la_LDFLAGS = -version-info 2:0:0 32 | 33 | # 34 | # Rules for the generated code 35 | # 36 | 37 | stamp-ser: $(top_srcdir)/libedsio/edsio.el xd.ser 38 | $(top_srcdir)/libedsio/edsio-comp xd.ser 39 | touch stamp-ser 40 | 41 | SER_OUT = xd_edsio.h xd_edsio.c 42 | 43 | $(SER_OUT): stamp-ser 44 | 45 | SER_SOURCES = xd_edsio.c 46 | BUILT_SOURCES = $(SER_SOURCES) 47 | 48 | # 49 | # 50 | # 51 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/contrib/build_hpux: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ksh 2 | # 3 | # Changed configure to install in /usr/local/lib/glib-1.2. 4 | # 5 | # Script was contributed by Klaus Dittrich 6 | 7 | gmake distclean 8 | CC="cc -Ae" \ 9 | CFLAGS="+O2 +Onolimit +DAportable" \ 10 | CPPFLAGS="-I/usr/local/include/glib-1.2 -I/usr/local/include/zlib" \ 11 | LDFLAGS="-L/usr/local/lib/glib-1.2 -L/usr/local/lib/zlib -lz" ./configure 12 | 13 | gmake 14 | gmake check 15 | exit 16 | :> ./TIME 17 | sleep 1 18 | gmake install 19 | mkdir -p /usr/local/docs/glib 20 | find /usr/local/* -newer ./TIME | grep -v `pwd` > THIS_WAS_INSTALLED 21 | gmake distclean 22 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/djgpp/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = readme.djg announce.djg 3 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = xdelta.1 2 | 3 | EXTRA_DIST = xdelta.1 xdelta.cat 4 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/doc/xdelta.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xdelta/xdelta1/doc/xdelta.cat -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/libedsio/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | INCLUDES = $(GLIB_CFLAGS) 3 | 4 | noinst_SCRIPTS = edsio-comp 5 | 6 | lib_LTLIBRARIES = libedsio.la 7 | 8 | noinst_PROGRAMS = edsiotest 9 | 10 | edsiotest_SOURCES = edsiotest.c 11 | 12 | edsiotest_LDADD = libedsio.la $(GLIB_LIBS) 13 | 14 | noinst_HEADERS = maketime.h partime.h 15 | 16 | include_HEADERS = edsio.h edsio_edsio.h 17 | 18 | libedsio_la_LIBADD = $(GLIB_LIBS) 19 | 20 | libedsio_la_SOURCES = \ 21 | library.c \ 22 | simple.c \ 23 | edsio.c \ 24 | edsio_edsio.c \ 25 | sha.c \ 26 | md5c.c \ 27 | fh.c \ 28 | generic.c \ 29 | default.c \ 30 | base64.c \ 31 | maketime.c \ 32 | partime.c 33 | 34 | EXTRA_DIST = edsio.el edsio.ser $(SER_OUT1) edsio-comp.in edsio.prj stamp-ser1 35 | 36 | # 37 | # Rules for the generated code 38 | # 39 | 40 | stamp-ser1: $(top_srcdir)/libedsio/edsio.el edsio.ser 41 | $(top_srcdir)/libedsio/edsio-comp edsio.ser 42 | touch stamp-ser1 43 | 44 | SER_OUT1 = edsio_edsio.c edsio_edsio.h 45 | 46 | $(SER_OUT1): stamp-ser1 47 | 48 | BUILT_SOURCES = edsio_edsio.c 49 | 50 | # 51 | # 52 | # 53 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/libedsio/edsio-comp.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xdelta/xdelta1/libedsio/edsio-comp.in -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/runtest: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OUT1=$TMPDIR/out1 4 | OUT2=$TMPDIR/out2 5 | OUT3=$TMPDIR/out3 6 | XDELTA=./xdelta 7 | 8 | while test $# -gt 1; do 9 | 10 | FROM=$1 11 | TO=$2 12 | 13 | shift 14 | 15 | if test -d $FROM -o -d $TO; then 16 | BOGUS=what 17 | else 18 | echo testing $FROM $TO ... 19 | $XDELTA delta -q0 $FROM $TO $OUT1 20 | $XDELTA patch $OUT1 $FROM $OUT2 21 | cmp $OUT2 $TO 22 | 23 | echo testing $TO $FROM ... 24 | $XDELTA delta -q0 $TO $FROM $OUT1 25 | $XDELTA patch $OUT1 $TO $OUT2 26 | cmp $OUT2 $FROM 27 | 28 | echo testing $TO $TO ... 29 | $XDELTA delta -q0 $TO $TO $OUT1 30 | $XDELTA patch $OUT1 $TO $OUT2 31 | cmp $OUT2 $TO 32 | 33 | echo testing $FROM $TO ... 34 | $XDELTA delta -q6 $FROM $TO $OUT1 35 | $XDELTA patch $OUT1 $FROM $OUT2 36 | cmp $OUT2 $TO 37 | 38 | echo testing $TO $FROM ... 39 | $XDELTA delta -q6 $TO $FROM $OUT1 40 | $XDELTA patch $OUT1 $TO $OUT2 41 | cmp $OUT2 $FROM 42 | 43 | echo testing $TO $TO ... 44 | $XDELTA delta -q6 $TO $TO $OUT1 45 | $XDELTA patch $OUT1 $TO $OUT2 46 | cmp $OUT2 $TO 47 | fi 48 | done; 49 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/test/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = xdeltatest.c README.test 3 | 4 | INCLUDES = -I$(top_srcdir)/libedsio $(GLIB_CFLAGS) 5 | 6 | noinst_PROGRAMS = xdeltatest 7 | 8 | xdeltatest_SOURCES = xdeltatest.c 9 | 10 | xdeltatest_LDADD = $(top_srcdir)/libxdelta.la \ 11 | $(top_srcdir)/libedsio/libedsio.la \ 12 | -lz \ 13 | $(GLIB_LIBS) 14 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/test/README.test: -------------------------------------------------------------------------------- 1 | The code in this directory produces a test for Xdelta. To run it you 2 | have to edit the hard-coded constants at the top of the file, which 3 | include "cmd_data_source", which should be the name of a big file 4 | containing source data that the test uses to construct sample inputs. 5 | This allows you to test on whatever kind of data you want, but the 6 | synthetic edits are still hardcoded. Have a look. 7 | 8 | Of course, a better test would let you run it without any 9 | configuration, but this is not that test. 10 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/xdelta-1.1.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xdelta/xdelta1/xdelta-1.1.2.tar.gz -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/xdelta-1.1.3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xdelta/xdelta1/xdelta-1.1.3.tar.gz -------------------------------------------------------------------------------- /deps/xdelta/xdelta1/xdelta.magic: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------------------------ 2 | # file(1) magic(5) data for xdelta 3 | # 4 | 0 string %XDELTA% XDelta binary patch file 0.14 5 | 0 string %XDZ000% XDelta binary patch file 0.18 6 | 0 string %XDZ001% XDelta binary patch file 0.20 7 | 0 string %XDZ002% XDelta binary patch file 1.0 8 | 0 string %XDZ003% XDelta binary patch file 1.0.4 9 | 0 string %XDZ004% XDelta binary patch file 1.1 10 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/cpp-btree/README: -------------------------------------------------------------------------------- 1 | This library is a C++ template library and, as such, there is no 2 | library to build and install. Copy the .h files and use them! 3 | 4 | See http://code.google.com/p/cpp-btree/wiki/UsageInstructions for 5 | details. 6 | 7 | ---- 8 | 9 | To build and run the provided tests, however, you will need to install 10 | CMake, the Google C++ Test framework, and the Google flags package. 11 | 12 | Download and install CMake from http://www.cmake.org 13 | 14 | Download and build the GoogleTest framework from 15 | http://code.google.com/p/googletest 16 | 17 | Download and install gflags from https://code.google.com/p/gflags 18 | 19 | Set GTEST_ROOT to the directory where GTEST was built. 20 | Set GFLAGS_ROOT to the directory prefix where GFLAGS is installed. 21 | 22 | export GTEST_ROOT=/path/for/gtest-x.y 23 | export GFLAGS_ROOT=/opt 24 | 25 | cmake . -Dbuild_tests=ON 26 | 27 | For example, to build on a Unix system with the clang++ compiler, 28 | 29 | export GTEST_ROOT=$(HOME)/src/googletest 30 | export GFLAGS_ROOT=/opt 31 | cmake . -G "Unix Makefiles" -Dbuild_tests=ON -DCMAKE_CXX_COMPILER=clang++ 32 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/cpp-btree/btree_test_flags.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "gflags/gflags.h" 16 | 17 | DEFINE_int32(test_values, 10000, 18 | "The number of values to use for tests."); 19 | DEFINE_int32(benchmark_values, 1000000, 20 | "The number of values to use for benchmarks."); 21 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -g -Wall -I.. -DXD3_DEBUG=1 -DNDEBUG=0 2 | #CFLAGS = -O3 -Wall -I.. -DXD3_DEBUG=0 -fno-builtin -DNDEBUG=1 3 | # -pg 4 | 5 | SOURCES = small_page_test.c encode_decode_test.c speed_test.c 6 | 7 | DEPS = ../*.h ../*.c *.h 8 | 9 | TARGETS = small_page_test encode_decode_test speed_test32 speed_test64 compare_test checksum_test 10 | 11 | all: $(TARGETS) 12 | 13 | small_page_test: small_page_test.c $(DEPS) 14 | $(CC) $(CFLAGS) small_page_test.c -o small_page_test -DXD3_USE_LARGEFILE64=0 -DSECONDARY_DJW=1 15 | 16 | encode_decode_test: encode_decode_test.c $(DEPS) 17 | $(CC) $(CFLAGS) encode_decode_test.c -o encode_decode_test 18 | 19 | speed_test32: speed_test.c $(DEPS) 20 | $(CC) $(CFLAGS) -DXD3_USE_LARGEFILE64=0 speed_test.c -o speed_test32 21 | 22 | speed_test64: speed_test.c $(DEPS) 23 | $(CC) $(CFLAGS) -DXD3_USE_LARGEFILE64=1 speed_test.c -o speed_test64 24 | 25 | compare_test: compare_test.c 26 | $(CC) $(CFLAGS) compare_test.c -o compare_test 27 | 28 | checksum_test: checksum_test.cc 29 | $(CXX) $(CFLAGS) checksum_test.cc -o checksum_test 30 | 31 | clean: 32 | rm -r -f *.exe *.stackdump $(TARGETS) *.dSYM *~ 33 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/README.md: -------------------------------------------------------------------------------- 1 | Files in this directory demonstrate how to use the Xdelta3 API. Copyrights 2 | are held by the respective authors and these files are not covered by the GPL. 3 | 4 | small_page_test.c -- how to use xdelta3 in an environment such as the kernel 5 | for small pages with little memory 6 | 7 | encode_decode_test.c -- how to use xdelta3 to process (encode/decode) data in 8 | multiple windows with the non-blocking API 9 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // Xd3iOSAppDelegate.h 3 | // xdelta3-ios-test 4 | // 5 | // Created by Joshua MacDonald on 6/16/12. 6 | // Copyright (c) 2011, 2012 Joshua MacDonald. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Xd3iOSAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // Xd3iOSViewController.h 3 | // xdelta3-ios-test 4 | // 5 | // Created by Joshua MacDonald on 6/16/12. 6 | // Copyright (c) 2011, 2012 Joshua MacDonald. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface Xd3iOSViewController : UIViewController { 12 | NSString *inputSeed; 13 | } 14 | - (IBAction)startTest:(id)sender; 15 | @property (weak, nonatomic) IBOutlet UITextField *theSeed; 16 | @property (weak, nonatomic) IBOutlet UITextView *theView; 17 | @property (atomic, retain) NSMutableString *theOutput; 18 | @property (nonatomic) BOOL inTest; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/file_v1_to_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/file_v1_to_v2.bin -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // xdelta3-ios-test 4 | // 5 | // Created by Joshua MacDonald on 6/16/12. 6 | // Copyright (c) 2011, 2012 Joshua MacDonald. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "Xd3iOSAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([Xd3iOSAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/xdelta3-ios-test-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'xdelta3-ios-test' target in the 'xdelta3-ios-test' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/examples/test.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2007 Josh MacDonald */ 2 | 3 | #define NOT_MAIN 1 4 | 5 | #include "xdelta3.h" 6 | #include "xdelta3.c" 7 | 8 | static int read_whole_file(const char *name, 9 | uint8_t **buf_ptr, 10 | size_t *buf_len) { 11 | main_file file; 12 | int ret; 13 | xoff_t len; 14 | usize_t nread; 15 | main_file_init(&file); 16 | file.filename = name; 17 | ret = main_file_open(&file, name, XO_READ); 18 | if (ret != 0) { 19 | fprintf(stderr, "open failed\n"); 20 | goto exit; 21 | } 22 | ret = main_file_stat(&file, &len); 23 | if (ret != 0) { 24 | fprintf(stderr, "stat failed\n"); 25 | goto exit; 26 | } 27 | 28 | (*buf_len) = (size_t)len; 29 | (*buf_ptr) = (uint8_t*) main_malloc(*buf_len); 30 | ret = main_file_read(&file, *buf_ptr, *buf_len, &nread, 31 | "read failed"); 32 | if (ret == 0 && *buf_len == nread) { 33 | ret = 0; 34 | } else { 35 | fprintf(stderr, "invalid read\n"); 36 | ret = XD3_INTERNAL; 37 | } 38 | exit: 39 | main_file_cleanup(&file); 40 | return ret; 41 | } 42 | 43 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/install-sh: -------------------------------------------------------------------------------- 1 | /usr/share/automake-1.14/install-sh -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/linkxd3lib.c: -------------------------------------------------------------------------------- 1 | #include "xdelta3.h" 2 | 3 | extern int VVV; 4 | 5 | int VVV; 6 | 7 | void use(int r) 8 | { 9 | VVV = r; 10 | } 11 | 12 | int main() { 13 | xd3_config config; 14 | xd3_stream stream; 15 | xd3_source source; 16 | 17 | xd3_init_config (& config, 0); 18 | use (xd3_config_stream (&stream, &config)); 19 | use (xd3_close_stream (&stream)); 20 | xd3_abort_stream (&stream); 21 | xd3_free_stream (&stream); 22 | 23 | xd3_avail_input (& stream, NULL, 0); 24 | xd3_consume_output (& stream); 25 | 26 | use (xd3_set_source (& stream, & source)); 27 | xd3_set_flags (& stream, 0); 28 | 29 | use (xd3_decode_stream (& stream, NULL, 0, NULL, NULL, 0)); 30 | use (xd3_decode_input (&stream)); 31 | use (xd3_get_appheader (& stream, NULL, NULL)); 32 | 33 | #if XD3_ENCODER 34 | use (xd3_encode_input (&stream)); 35 | use (xd3_encode_stream (& stream, NULL, 0, NULL, NULL, 0)); 36 | use (xd3_set_appheader (& stream)); 37 | use (xd3_encoder_used_source (& stream)); 38 | use (xd3_encoder_srcbase (& stream)); 39 | use (xd3_encoder_srclen (& stream)); 40 | #endif 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /deps/xdelta/xdelta3/plot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | G=/usr/bin/gnuplot 4 | 5 | D=./output_dir 6 | 7 | I=$1 8 | O=$D/$2 9 | 10 | $G > $O < 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /deps/xz/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.bak 3 | *.bak[0-9] 4 | .gdb_history 5 | 6 | .deps 7 | .libs 8 | *.la 9 | *.lo 10 | *.o 11 | Makefile.in 12 | 13 | /ABOUT-NLS 14 | /autom4te.cache 15 | /Doxyfile 16 | /aclocal.m4 17 | /config.h 18 | /config.h.in 19 | /config.log 20 | /config.status 21 | /configure 22 | /libtool 23 | /stamp-h1 24 | 25 | build-aux/compile 26 | build-aux/config.guess 27 | build-aux/config.rpath 28 | build-aux/config.sub 29 | build-aux/depcomp 30 | build-aux/install-sh 31 | build-aux/ltmain.sh 32 | build-aux/missing 33 | build-aux/test-driver 34 | 35 | /src/liblzma/liblzma.pc 36 | /src/lzmainfo/lzmainfo 37 | /src/xz/xz 38 | /src/xzdec/lzmadec 39 | /src/xzdec/xzdec 40 | 41 | /src/scripts/xzdiff 42 | /src/scripts/xzgrep 43 | /src/scripts/xzless 44 | /src/scripts/xzmore 45 | 46 | /tests/compress_generated_abc 47 | /tests/compress_generated_random 48 | /tests/compress_generated_text 49 | /tests/create_compress_files 50 | /tests/test_block_header 51 | /tests/test_check 52 | /tests/test_filter_flags 53 | /tests/test_index 54 | /tests/test_stream_flags 55 | 56 | /lib/Makefile 57 | /tests/Makefile 58 | /Makefile 59 | /debug/Makefile 60 | /src/scripts/Makefile 61 | /src/xz/Makefile 62 | /src/Makefile 63 | /src/liblzma/Makefile 64 | /src/liblzma/api/Makefile 65 | /src/lzmainfo/Makefile 66 | /src/xzdec/Makefile 67 | -------------------------------------------------------------------------------- /deps/xz/AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | Authors of XZ Utils 3 | =================== 4 | 5 | XZ Utils is developed and maintained by Lasse Collin 6 | . 7 | 8 | Major parts of liblzma are based on code written by Igor Pavlov, 9 | specifically the LZMA SDK . Without 10 | this code, XZ Utils wouldn't exist. 11 | 12 | The SHA-256 implementation in liblzma is based on the code found from 13 | 7-Zip , which has a modified version of the SHA-256 14 | code found from Crypto++ . The SHA-256 code 15 | in Crypto++ was written by Kevin Springle and Wei Dai. 16 | 17 | Some scripts have been adapted from gzip. The original versions 18 | were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. 19 | Andrew Dudman helped adapting the scripts and their man pages for 20 | XZ Utils. 21 | 22 | The GNU Autotools-based build system contains files from many authors, 23 | which I'm not trying to list here. 24 | 25 | Several people have contributed fixes or reported bugs. Most of them 26 | are mentioned in the file THANKS. 27 | 28 | -------------------------------------------------------------------------------- /deps/xz/ChangeLog: -------------------------------------------------------------------------------- 1 | See the commit log in the git repository: 2 | 3 | git clone http://git.tukaani.org/xz.git 4 | 5 | Note that "make dist" doesn't put this tiny file into the package. 6 | Instead, the git commit log is used as ChangeLog. See dist-hook in 7 | Makefile.am for details. 8 | -------------------------------------------------------------------------------- /deps/xz/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ############################################################################### 4 | # 5 | # Author: Lasse Collin 6 | # 7 | # This file has been put into the public domain. 8 | # You can do whatever you want with this file. 9 | # 10 | ############################################################################### 11 | 12 | # The result of using "autoreconf -fi" should be identical to using this 13 | # script. I'm leaving this script here just in case someone finds it useful. 14 | 15 | set -e -x 16 | 17 | ${AUTOPOINT:-autopoint} -f 18 | ${LIBTOOLIZE:-libtoolize} -c -f || glibtoolize -c -f 19 | ${ACLOCAL:-aclocal} -I m4 20 | ${AUTOCONF:-autoconf} 21 | ${AUTOHEADER:-autoheader} 22 | ${AUTOMAKE:-automake} -acf --foreign 23 | -------------------------------------------------------------------------------- /deps/xz/build-aux/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | ############################################################################# 4 | # 5 | # Get the version string from version.h and print it out without 6 | # trailing newline. This makes it suitable for use in configure.ac. 7 | # 8 | ############################################################################# 9 | # 10 | # Author: Lasse Collin 11 | # 12 | # This file has been put into the public domain. 13 | # You can do whatever you want with this file. 14 | # 15 | ############################################################################# 16 | 17 | sed -n 's/LZMA_VERSION_STABILITY_ALPHA/alpha/ 18 | s/LZMA_VERSION_STABILITY_BETA/beta/ 19 | s/LZMA_VERSION_STABILITY_STABLE// 20 | s/^#define LZMA_VERSION_[MPS][AIT][AJNT][A-Z]* //p' \ 21 | src/liblzma/api/lzma/version.h \ 22 | | tr '\n' '|' \ 23 | | sed 's/|/./; s/|/./; s/|//g' \ 24 | | tr -d '\r\n' 25 | -------------------------------------------------------------------------------- /deps/xz/debug/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | EXTRA_DIST = \ 9 | translation.bash 10 | 11 | noinst_PROGRAMS = \ 12 | repeat \ 13 | sync_flush \ 14 | full_flush \ 15 | memusage \ 16 | crc32 \ 17 | known_sizes \ 18 | hex2bin 19 | 20 | AM_CPPFLAGS = \ 21 | -I$(top_srcdir)/src/common \ 22 | -I$(top_srcdir)/src/liblzma/api 23 | 24 | LDADD = $(top_builddir)/src/liblzma/liblzma.la 25 | 26 | if COND_GNULIB 27 | LDADD += $(top_builddir)/lib/libgnu.a 28 | endif 29 | 30 | LDADD += $(LTLIBINTL) 31 | -------------------------------------------------------------------------------- /deps/xz/debug/README: -------------------------------------------------------------------------------- 1 | 2 | Debug tools 3 | ----------- 4 | 5 | This directory contains a few tiny programs that may be helpful when 6 | debugging XZ Utils. 7 | 8 | These tools are not meant to be installed. Often one needs to edit 9 | the source code a little to make the programs do the wanted things. 10 | If you don't know how these programs could help you, it is likely 11 | that they really are useless to you. 12 | 13 | These aren't intended to be used as example programs. They take some 14 | shortcuts here and there, which correct programs should not do. Many 15 | possible errors (especially I/O errors) are ignored. Don't report 16 | bugs or send patches to fix this kind of bugs. 17 | 18 | -------------------------------------------------------------------------------- /deps/xz/debug/crc32.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc32.c 4 | /// \brief Primitive CRC32 calculation tool 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "sysdefs.h" 14 | #include "lzma.h" 15 | #include 16 | 17 | 18 | int 19 | main(void) 20 | { 21 | uint32_t crc = 0; 22 | 23 | do { 24 | uint8_t buf[BUFSIZ]; 25 | const size_t size = fread(buf, 1, sizeof(buf), stdin); 26 | crc = lzma_crc32(buf, size, crc); 27 | } while (!ferror(stdin) && !feof(stdin)); 28 | 29 | //printf("%08" PRIX32 "\n", crc); 30 | 31 | // I want it little endian so it's easy to work with hex editor. 32 | printf("%02" PRIX32 " ", crc & 0xFF); 33 | printf("%02" PRIX32 " ", (crc >> 8) & 0xFF); 34 | printf("%02" PRIX32 " ", (crc >> 16) & 0xFF); 35 | printf("%02" PRIX32 " ", crc >> 24); 36 | printf("\n"); 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /deps/xz/debug/hex2bin.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file hex2bin.c 4 | /// \brief Converts hexadecimal input strings to binary 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "sysdefs.h" 14 | #include 15 | #include 16 | 17 | 18 | static int 19 | getbin(int x) 20 | { 21 | if (x >= '0' && x <= '9') 22 | return x - '0'; 23 | 24 | if (x >= 'A' && x <= 'F') 25 | return x - 'A' + 10; 26 | 27 | return x - 'a' + 10; 28 | } 29 | 30 | 31 | int 32 | main(void) 33 | { 34 | while (true) { 35 | int byte = getchar(); 36 | if (byte == EOF) 37 | return 0; 38 | if (!isxdigit(byte)) 39 | continue; 40 | 41 | const int digit = getchar(); 42 | if (digit == EOF || !isxdigit(digit)) { 43 | fprintf(stderr, "Invalid input\n"); 44 | return 1; 45 | } 46 | 47 | byte = (getbin(byte) << 4) | getbin(digit); 48 | if (putchar(byte) == EOF) { 49 | perror(NULL); 50 | return 1; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /deps/xz/debug/memusage.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file memusage.c 4 | /// \brief Calculates memory usage using lzma_memory_usage() 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "sysdefs.h" 14 | #include "lzma.h" 15 | #include 16 | 17 | int 18 | main(void) 19 | { 20 | lzma_options_lzma lzma = { 21 | .dict_size = (1U << 30) + (1U << 29), 22 | .lc = 3, 23 | .lp = 0, 24 | .pb = 2, 25 | .preset_dict = NULL, 26 | .preset_dict_size = 0, 27 | .mode = LZMA_MODE_NORMAL, 28 | .nice_len = 48, 29 | .mf = LZMA_MF_BT4, 30 | .depth = 0, 31 | }; 32 | 33 | /* 34 | lzma_options_filter filters[] = { 35 | { LZMA_FILTER_LZMA1, 36 | (lzma_options_lzma *)&lzma_preset_lzma[6 - 1] }, 37 | { UINT64_MAX, NULL } 38 | }; 39 | */ 40 | lzma_filter filters[] = { 41 | { LZMA_FILTER_LZMA1, &lzma }, 42 | { UINT64_MAX, NULL } 43 | }; 44 | 45 | printf("Encoder: %10" PRIu64 " B\n", 46 | lzma_raw_encoder_memusage(filters)); 47 | printf("Decoder: %10" PRIu64 " B\n", 48 | lzma_raw_decoder_memusage(filters)); 49 | 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /deps/xz/debug/repeat.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file repeat.c 4 | /// \brief Repeats given string given times 5 | /// 6 | /// This program can be useful when debugging run-length encoder in 7 | /// the Subblock filter, especially the condition when repeat count 8 | /// doesn't fit into 28-bit integer. 9 | // 10 | // Author: Lasse Collin 11 | // 12 | // This file has been put into the public domain. 13 | // You can do whatever you want with this file. 14 | // 15 | /////////////////////////////////////////////////////////////////////////////// 16 | 17 | #include "sysdefs.h" 18 | #include 19 | 20 | 21 | int 22 | main(int argc, char **argv) 23 | { 24 | if (argc != 3) { 25 | fprintf(stderr, "Usage: %s COUNT STRING\n", argv[0]); 26 | exit(1); 27 | } 28 | 29 | unsigned long long count = strtoull(argv[1], NULL, 10); 30 | const size_t size = strlen(argv[2]); 31 | 32 | while (count-- != 0) 33 | fwrite(argv[2], 1, size, stdout); 34 | 35 | return !!(ferror(stdout) || fclose(stdout)); 36 | } 37 | -------------------------------------------------------------------------------- /deps/xz/doc/examples/00_README.txt: -------------------------------------------------------------------------------- 1 | 2 | liblzma example programs 3 | ======================== 4 | 5 | Introduction 6 | 7 | The examples are written so that the same comments aren't 8 | repeated (much) in later files. 9 | 10 | On POSIX systems, the examples should build by just typing "make". 11 | 12 | The examples that use stdin or stdout don't set stdin and stdout 13 | to binary mode. On systems where it matters (e.g. Windows) it is 14 | possible that the examples won't work without modification. 15 | 16 | 17 | List of examples 18 | 19 | 01_compress_easy.c Multi-call compression using 20 | a compression preset 21 | 22 | 02_decompress.c Multi-call decompression 23 | 24 | 03_compress_custom.c Like 01_compress_easy.c but using 25 | a custom filter chain 26 | (x86 BCJ + LZMA2) 27 | 28 | 04_compress_easy_mt.c Multi-threaded multi-call 29 | compression using a compression 30 | preset 31 | 32 | -------------------------------------------------------------------------------- /deps/xz/doc/examples/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Lasse Collin 3 | # 4 | # This file has been put into the public domain. 5 | # You can do whatever you want with this file. 6 | # 7 | 8 | CC = c99 9 | CFLAGS = -g 10 | LDFLAGS = -llzma 11 | 12 | PROGS = \ 13 | 01_compress_easy \ 14 | 02_decompress \ 15 | 03_compress_custom \ 16 | 04_compress_easy_mt 17 | 18 | all: $(PROGS) 19 | 20 | .c: 21 | $(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) 22 | 23 | clean: 24 | -rm -f $(PROGS) 25 | -------------------------------------------------------------------------------- /deps/xz/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## Copyright (C) 2004-2007 Free Software Foundation, Inc. 3 | ## 4 | ## This program is free software; you can redistribute it and/or modify 5 | ## it under the terms of the GNU General Public License as published by 6 | ## the Free Software Foundation; either version 2 of the License, or 7 | ## (at your option) any later version. 8 | ## 9 | ## This program is distributed in the hope that it will be useful, 10 | ## but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | ## GNU General Public License for more details. 13 | ## 14 | 15 | ## Not using gnulib-tool, at least for now. It is likely that we won't 16 | ## need anything else from Gnulib than getopt_long(). 17 | 18 | noinst_LIBRARIES = libgnu.a 19 | 20 | libgnu_a_SOURCES = 21 | libgnu_a_DEPENDENCIES = $(LIBOBJS) 22 | libgnu_a_LIBADD = $(LIBOBJS) 23 | 24 | EXTRA_DIST = getopt.in.h getopt.c getopt1.c getopt_int.h 25 | BUILT_SOURCES = $(GETOPT_H) 26 | MOSTLYCLEANFILES = getopt.h getopt.h-t 27 | 28 | getopt.h: getopt.in.h 29 | { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \ 30 | cat $(srcdir)/getopt.in.h; \ 31 | } > $@-t 32 | mv -f $@-t $@ 33 | -------------------------------------------------------------------------------- /deps/xz/m4/.gitignore: -------------------------------------------------------------------------------- 1 | codeset.m4 2 | fcntl-o.m4 3 | gettext.m4 4 | glibc2.m4 5 | glibc21.m4 6 | iconv.m4 7 | intdiv0.m4 8 | intl.m4 9 | intldir.m4 10 | intlmacosx.m4 11 | intmax.m4 12 | inttypes-pri.m4 13 | inttypes_h.m4 14 | lcmessage.m4 15 | lib-ld.m4 16 | lib-link.m4 17 | lib-prefix.m4 18 | libtool.m4 19 | lock.m4 20 | longdouble.m4 21 | longlong.m4 22 | ltoptions.m4 23 | ltsugar.m4 24 | ltversion.m4 25 | lt~obsolete.m4 26 | nls.m4 27 | po.m4 28 | printf-posix.m4 29 | progtest.m4 30 | size_max.m4 31 | stdint_h.m4 32 | threadlib.m4 33 | uintmax_t.m4 34 | ulonglong.m4 35 | visibility.m4 36 | wchar_t.m4 37 | wint_t.m4 38 | xsize.m4 39 | -------------------------------------------------------------------------------- /deps/xz/m4/tuklib_common.m4: -------------------------------------------------------------------------------- 1 | # 2 | # SYNOPSIS 3 | # 4 | # TUKLIB_COMMON 5 | # 6 | # DESCRIPTION 7 | # 8 | # Common checks for tuklib. 9 | # 10 | # COPYING 11 | # 12 | # Author: Lasse Collin 13 | # 14 | # This file has been put into the public domain. 15 | # You can do whatever you want with this file. 16 | # 17 | 18 | AC_DEFUN_ONCE([TUKLIB_COMMON], [ 19 | AC_REQUIRE([AC_CANONICAL_HOST]) 20 | AC_REQUIRE([AC_PROG_CC_C99]) 21 | AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) 22 | ])dnl 23 | -------------------------------------------------------------------------------- /deps/xz/m4/tuklib_mbstr.m4: -------------------------------------------------------------------------------- 1 | # 2 | # SYNOPSIS 3 | # 4 | # TUKLIB_MBSTR 5 | # 6 | # DESCRIPTION 7 | # 8 | # Check if multibyte and wide character functionality is available 9 | # for use by tuklib_mbstr_* functions. If not enough multibyte string 10 | # support is available in the C library, the functions keep working 11 | # with the assumption that all strings are a in single-byte character 12 | # set without combining characters, e.g. US-ASCII or ISO-8859-*. 13 | # 14 | # This .m4 file and tuklib_mbstr.h are common to all tuklib_mbstr_* 15 | # functions, but each function is put into a separate .c file so 16 | # that it is possible to pick only what is strictly needed. 17 | # 18 | # COPYING 19 | # 20 | # Author: Lasse Collin 21 | # 22 | # This file has been put into the public domain. 23 | # You can do whatever you want with this file. 24 | # 25 | 26 | AC_DEFUN_ONCE([TUKLIB_MBSTR], [ 27 | AC_REQUIRE([TUKLIB_COMMON]) 28 | AC_FUNC_MBRTOWC 29 | AC_CHECK_FUNCS([wcwidth]) 30 | ])dnl 31 | -------------------------------------------------------------------------------- /deps/xz/m4/tuklib_progname.m4: -------------------------------------------------------------------------------- 1 | # 2 | # SYNOPSIS 3 | # 4 | # TUKLIB_PROGNAME 5 | # 6 | # DESCRIPTION 7 | # 8 | # Put argv[0] into a global variable progname. On DOS-like systems, 9 | # modify it so that it looks nice (no full path or .exe suffix). 10 | # 11 | # This .m4 file is needed allow this module to use glibc's 12 | # program_invocation_name. 13 | # 14 | # COPYING 15 | # 16 | # Author: Lasse Collin 17 | # 18 | # This file has been put into the public domain. 19 | # You can do whatever you want with this file. 20 | # 21 | 22 | AC_DEFUN_ONCE([TUKLIB_PROGNAME], [ 23 | AC_REQUIRE([TUKLIB_COMMON]) 24 | AC_CHECK_DECLS([program_invocation_name], [], [], [#include ]) 25 | ])dnl 26 | -------------------------------------------------------------------------------- /deps/xz/po/.gitignore: -------------------------------------------------------------------------------- 1 | # autopoint 2 | Makefile.in.in 3 | Makevars.template 4 | Rules-quot 5 | boldquot.sed 6 | en@boldquot.header 7 | en@quot.header 8 | insert-header.sin 9 | quot.sed 10 | remove-potcdate.sin 11 | 12 | # configure 13 | Makefile.in 14 | Makefile 15 | POTFILES 16 | 17 | # intermediate files (make) 18 | stamp-poT 19 | xz.po 20 | xz.1po 21 | xz.2po 22 | *.new.po 23 | 24 | # make 25 | remove-potcdate.sed 26 | xz.mo 27 | stamp-po 28 | *.gmo 29 | 30 | # cached templates (make) 31 | xz.pot 32 | -------------------------------------------------------------------------------- /deps/xz/po/LINGUAS: -------------------------------------------------------------------------------- 1 | cs 2 | de 3 | fr 4 | it 5 | pl 6 | vi 7 | -------------------------------------------------------------------------------- /deps/xz/po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files which contain translatable strings. 2 | src/xz/args.c 3 | src/xz/coder.c 4 | src/xz/file_io.c 5 | src/xz/hardware.c 6 | src/xz/list.c 7 | src/xz/main.c 8 | src/xz/message.c 9 | src/xz/options.c 10 | src/xz/signals.c 11 | src/xz/suffix.c 12 | src/xz/util.c 13 | src/common/tuklib_exit.c 14 | -------------------------------------------------------------------------------- /deps/xz/src/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | SUBDIRS = liblzma xzdec 9 | 10 | if COND_XZ 11 | SUBDIRS += xz 12 | endif 13 | 14 | if COND_LZMAINFO 15 | SUBDIRS += lzmainfo 16 | endif 17 | 18 | if COND_SCRIPTS 19 | SUBDIRS += scripts 20 | endif 21 | 22 | EXTRA_DIST = \ 23 | common/common_w32res.rc \ 24 | common/mythread.h \ 25 | common/sysdefs.h \ 26 | common/tuklib_common.h \ 27 | common/tuklib_config.h \ 28 | common/tuklib_cpucores.c \ 29 | common/tuklib_cpucores.h \ 30 | common/tuklib_exit.c \ 31 | common/tuklib_exit.h \ 32 | common/tuklib_gettext.h \ 33 | common/tuklib_integer.h \ 34 | common/tuklib_mbstr_fw.c \ 35 | common/tuklib_mbstr.h \ 36 | common/tuklib_mbstr_width.c \ 37 | common/tuklib_open_stdxxx.c \ 38 | common/tuklib_open_stdxxx.h \ 39 | common/tuklib_physmem.c \ 40 | common/tuklib_physmem.h \ 41 | common/tuklib_progname.c \ 42 | common/tuklib_progname.h 43 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_config.h: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | # include "sysdefs.h" 3 | #else 4 | # include 5 | # include 6 | # include 7 | #endif 8 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_cpucores.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_cpucores.h 4 | /// \brief Get the number of CPU cores online 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef TUKLIB_CPUCORES_H 14 | #define TUKLIB_CPUCORES_H 15 | 16 | #include "tuklib_common.h" 17 | TUKLIB_DECLS_BEGIN 18 | 19 | #define tuklib_cpucores TUKLIB_SYMBOL(tuklib_cpucores) 20 | extern uint32_t tuklib_cpucores(void); 21 | 22 | TUKLIB_DECLS_END 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_exit.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_exit.h 4 | /// \brief Close stdout and stderr, and exit 5 | /// \note Requires tuklib_progname and tuklib_gettext modules 6 | // 7 | // Author: Lasse Collin 8 | // 9 | // This file has been put into the public domain. 10 | // You can do whatever you want with this file. 11 | // 12 | /////////////////////////////////////////////////////////////////////////////// 13 | 14 | #ifndef TUKLIB_EXIT_H 15 | #define TUKLIB_EXIT_H 16 | 17 | #include "tuklib_common.h" 18 | TUKLIB_DECLS_BEGIN 19 | 20 | #define tuklib_exit TUKLIB_SYMBOL(tuklib_exit) 21 | extern void tuklib_exit(int status, int err_status, int show_error) 22 | tuklib_attr_noreturn; 23 | 24 | TUKLIB_DECLS_END 25 | #endif 26 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_gettext.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_gettext.h 4 | /// \brief Wrapper for gettext and friends 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef TUKLIB_GETTEXT_H 14 | #define TUKLIB_GETTEXT_H 15 | 16 | #include "tuklib_common.h" 17 | #include 18 | 19 | #ifndef TUKLIB_GETTEXT 20 | # ifdef ENABLE_NLS 21 | # define TUKLIB_GETTEXT 1 22 | # else 23 | # define TUKLIB_GETTEXT 0 24 | # endif 25 | #endif 26 | 27 | #if TUKLIB_GETTEXT 28 | # include 29 | # define tuklib_gettext_init(package, localedir) \ 30 | do { \ 31 | setlocale(LC_ALL, ""); \ 32 | bindtextdomain(package, localedir); \ 33 | textdomain(package); \ 34 | } while (0) 35 | # define _(msgid) gettext(msgid) 36 | #else 37 | # define tuklib_gettext_init(package, localedir) \ 38 | setlocale(LC_ALL, "") 39 | # define _(msgid) (msgid) 40 | # define ngettext(msgid1, msgid2, n) ((n) == 1 ? (msgid1) : (msgid2)) 41 | #endif 42 | #define N_(msgid) msgid 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_mbstr_fw.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_mstr_fw.c 4 | /// \brief Get the field width for printf() e.g. to align table columns 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "tuklib_mbstr.h" 14 | 15 | 16 | extern int 17 | tuklib_mbstr_fw(const char *str, int columns_min) 18 | { 19 | size_t len; 20 | const size_t width = tuklib_mbstr_width(str, &len); 21 | if (width == (size_t)-1) 22 | return -1; 23 | 24 | if (width > (size_t)columns_min) 25 | return 0; 26 | 27 | if (width < (size_t)columns_min) 28 | len += (size_t)columns_min - width; 29 | 30 | return len; 31 | } 32 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_open_stdxxx.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_open_stdxxx.h 4 | /// \brief Make sure that file descriptors 0, 1, and 2 are open 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef TUKLIB_OPEN_STDXXX_H 14 | #define TUKLIB_OPEN_STDXXX_H 15 | 16 | #include "tuklib_common.h" 17 | TUKLIB_DECLS_BEGIN 18 | 19 | #define tuklib_open_stdxx TUKLIB_SYMBOL(tuklib_open_stdxxx) 20 | extern void tuklib_open_stdxxx(int err_status); 21 | 22 | TUKLIB_DECLS_END 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_physmem.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_physmem.h 4 | /// \brief Get the amount of physical memory 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef TUKLIB_PHYSMEM_H 14 | #define TUKLIB_PHYSMEM_H 15 | 16 | #include "tuklib_common.h" 17 | TUKLIB_DECLS_BEGIN 18 | 19 | #define tuklib_physmem TUKLIB_SYMBOL(tuklib_physmem) 20 | extern uint64_t tuklib_physmem(void); 21 | ///< 22 | /// \brief Get the amount of physical memory in bytes 23 | /// 24 | /// \return Amount of physical memory in bytes. On error, zero is 25 | /// returned. 26 | 27 | TUKLIB_DECLS_END 28 | #endif 29 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_progname.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_progname.c 4 | /// \brief Program name to be displayed in messages 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "tuklib_progname.h" 14 | #include 15 | 16 | 17 | #if !HAVE_DECL_PROGRAM_INVOCATION_NAME 18 | char *progname = NULL; 19 | #endif 20 | 21 | 22 | extern void 23 | tuklib_progname_init(char **argv) 24 | { 25 | #ifdef TUKLIB_DOSLIKE 26 | // On these systems, argv[0] always has the full path and .exe 27 | // suffix even if the user just types the plain program name. 28 | // We modify argv[0] to make it nicer to read. 29 | 30 | // Strip the leading path. 31 | char *p = argv[0] + strlen(argv[0]); 32 | while (argv[0] < p && p[-1] != '/' && p[-1] != '\\') 33 | --p; 34 | 35 | argv[0] = p; 36 | 37 | // Strip the .exe suffix. 38 | p = strrchr(p, '.'); 39 | if (p != NULL) 40 | *p = '\0'; 41 | 42 | // Make it lowercase. 43 | for (p = argv[0]; *p != '\0'; ++p) 44 | if (*p >= 'A' && *p <= 'Z') 45 | *p = *p - 'A' + 'a'; 46 | #endif 47 | 48 | progname = argv[0]; 49 | return; 50 | } 51 | -------------------------------------------------------------------------------- /deps/xz/src/common/tuklib_progname.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file tuklib_progname.h 4 | /// \brief Program name to be displayed in messages 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef TUKLIB_PROGNAME_H 14 | #define TUKLIB_PROGNAME_H 15 | 16 | #include "tuklib_common.h" 17 | #include 18 | 19 | TUKLIB_DECLS_BEGIN 20 | 21 | #if HAVE_DECL_PROGRAM_INVOCATION_NAME 22 | # define progname program_invocation_name 23 | #else 24 | # define progname TUKLIB_SYMBOL(tuklib_progname) 25 | extern char *progname; 26 | #endif 27 | 28 | #define tuklib_progname_init TUKLIB_SYMBOL(tuklib_progname_init) 29 | extern void tuklib_progname_init(char **argv); 30 | 31 | TUKLIB_DECLS_END 32 | #endif 33 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/api/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | nobase_include_HEADERS = \ 9 | lzma.h \ 10 | lzma/base.h \ 11 | lzma/bcj.h \ 12 | lzma/block.h \ 13 | lzma/check.h \ 14 | lzma/container.h \ 15 | lzma/delta.h \ 16 | lzma/filter.h \ 17 | lzma/hardware.h \ 18 | lzma/index.h \ 19 | lzma/index_hash.h \ 20 | lzma/lzma12.h \ 21 | lzma/stream_flags.h \ 22 | lzma/version.h \ 23 | lzma/vli.h 24 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/check/Makefile.inc: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | EXTRA_DIST += \ 9 | check/crc32_tablegen.c \ 10 | check/crc64_tablegen.c 11 | 12 | liblzma_la_SOURCES += \ 13 | check/check.c \ 14 | check/check.h \ 15 | check/crc_macros.h 16 | 17 | if COND_CHECK_CRC32 18 | if COND_SMALL 19 | liblzma_la_SOURCES += check/crc32_small.c 20 | else 21 | liblzma_la_SOURCES += \ 22 | check/crc32_table.c \ 23 | check/crc32_table_le.h \ 24 | check/crc32_table_be.h 25 | if COND_ASM_X86 26 | liblzma_la_SOURCES += check/crc32_x86.S 27 | else 28 | liblzma_la_SOURCES += check/crc32_fast.c 29 | endif 30 | endif 31 | endif 32 | 33 | if COND_CHECK_CRC64 34 | if COND_SMALL 35 | liblzma_la_SOURCES += check/crc64_small.c 36 | else 37 | liblzma_la_SOURCES += \ 38 | check/crc64_table.c \ 39 | check/crc64_table_le.h \ 40 | check/crc64_table_be.h 41 | if COND_ASM_X86 42 | liblzma_la_SOURCES += check/crc64_x86.S 43 | else 44 | liblzma_la_SOURCES += check/crc64_fast.c 45 | endif 46 | endif 47 | endif 48 | 49 | if COND_CHECK_SHA256 50 | if COND_INTERNAL_SHA256 51 | liblzma_la_SOURCES += check/sha256.c 52 | endif 53 | endif 54 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/check/crc32_small.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc32_small.c 4 | /// \brief CRC32 calculation (size-optimized) 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "check.h" 14 | 15 | 16 | uint32_t lzma_crc32_table[1][256]; 17 | 18 | 19 | static void 20 | crc32_init(void) 21 | { 22 | static const uint32_t poly32 = UINT32_C(0xEDB88320); 23 | 24 | for (size_t b = 0; b < 256; ++b) { 25 | uint32_t r = b; 26 | for (size_t i = 0; i < 8; ++i) { 27 | if (r & 1) 28 | r = (r >> 1) ^ poly32; 29 | else 30 | r >>= 1; 31 | } 32 | 33 | lzma_crc32_table[0][b] = r; 34 | } 35 | 36 | return; 37 | } 38 | 39 | 40 | extern void 41 | lzma_crc32_init(void) 42 | { 43 | mythread_once(crc32_init); 44 | return; 45 | } 46 | 47 | 48 | extern LZMA_API(uint32_t) 49 | lzma_crc32(const uint8_t *buf, size_t size, uint32_t crc) 50 | { 51 | lzma_crc32_init(); 52 | 53 | crc = ~crc; 54 | 55 | while (size != 0) { 56 | crc = lzma_crc32_table[0][*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); 57 | --size; 58 | } 59 | 60 | return ~crc; 61 | } 62 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/check/crc32_table.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc32_table.c 4 | /// \brief Precalculated CRC32 table with correct endianness 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "common.h" 14 | 15 | #ifdef WORDS_BIGENDIAN 16 | # include "crc32_table_be.h" 17 | #else 18 | # include "crc32_table_le.h" 19 | #endif 20 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/check/crc64_small.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc64_small.c 4 | /// \brief CRC64 calculation (size-optimized) 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "check.h" 14 | 15 | 16 | static uint64_t crc64_table[256]; 17 | 18 | 19 | static void 20 | crc64_init(void) 21 | { 22 | static const uint64_t poly64 = UINT64_C(0xC96C5795D7870F42); 23 | 24 | for (size_t b = 0; b < 256; ++b) { 25 | uint64_t r = b; 26 | for (size_t i = 0; i < 8; ++i) { 27 | if (r & 1) 28 | r = (r >> 1) ^ poly64; 29 | else 30 | r >>= 1; 31 | } 32 | 33 | crc64_table[b] = r; 34 | } 35 | 36 | return; 37 | } 38 | 39 | 40 | extern LZMA_API(uint64_t) 41 | lzma_crc64(const uint8_t *buf, size_t size, uint64_t crc) 42 | { 43 | mythread_once(crc64_init); 44 | 45 | crc = ~crc; 46 | 47 | while (size != 0) { 48 | crc = crc64_table[*buf++ ^ (crc & 0xFF)] ^ (crc >> 8); 49 | --size; 50 | } 51 | 52 | return ~crc; 53 | } 54 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/check/crc64_table.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc64_table.c 4 | /// \brief Precalculated CRC64 table with correct endianness 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "common.h" 14 | 15 | #ifdef WORDS_BIGENDIAN 16 | # include "crc64_table_be.h" 17 | #else 18 | # include "crc64_table_le.h" 19 | #endif 20 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/check/crc_macros.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file crc_macros.h 4 | /// \brief Some endian-dependent macros for CRC32 and CRC64 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifdef WORDS_BIGENDIAN 14 | # define A(x) ((x) >> 24) 15 | # define B(x) (((x) >> 16) & 0xFF) 16 | # define C(x) (((x) >> 8) & 0xFF) 17 | # define D(x) ((x) & 0xFF) 18 | 19 | # define S8(x) ((x) << 8) 20 | # define S32(x) ((x) << 32) 21 | 22 | #else 23 | # define A(x) ((x) & 0xFF) 24 | # define B(x) (((x) >> 8) & 0xFF) 25 | # define C(x) (((x) >> 16) & 0xFF) 26 | # define D(x) ((x) >> 24) 27 | 28 | # define S8(x) ((x) >> 8) 29 | # define S32(x) ((x) >> 32) 30 | #endif 31 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/alone_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file alone_decoder.h 4 | /// \brief Decoder for LZMA_Alone files 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_ALONE_DECODER_H 14 | #define LZMA_ALONE_DECODER_H 15 | 16 | #include "common.h" 17 | 18 | 19 | extern lzma_ret lzma_alone_decoder_init( 20 | lzma_next_coder *next, const lzma_allocator *allocator, 21 | uint64_t memlimit, bool picky); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/block_buffer_encoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file block_buffer_encoder.h 4 | /// \brief Single-call .xz Block encoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_BLOCK_BUFFER_ENCODER_H 14 | #define LZMA_BLOCK_BUFFER_ENCODER_H 15 | 16 | #include "common.h" 17 | 18 | 19 | /// uint64_t version of lzma_block_buffer_bound(). It is used by 20 | /// stream_encoder_mt.c. Probably the original lzma_block_buffer_bound() 21 | /// should have been 64-bit, but fixing it would break the ABI. 22 | extern uint64_t lzma_block_buffer_bound64(uint64_t uncompressed_size); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/block_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file block_decoder.h 4 | /// \brief Decodes .xz Blocks 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_BLOCK_DECODER_H 14 | #define LZMA_BLOCK_DECODER_H 15 | 16 | #include "common.h" 17 | 18 | 19 | extern lzma_ret lzma_block_decoder_init(lzma_next_coder *next, 20 | const lzma_allocator *allocator, lzma_block *block); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/easy_buffer_encoder.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file easy_buffer_encoder.c 4 | /// \brief Easy single-call .xz Stream encoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "easy_preset.h" 14 | 15 | 16 | extern LZMA_API(lzma_ret) 17 | lzma_easy_buffer_encode(uint32_t preset, lzma_check check, 18 | const lzma_allocator *allocator, const uint8_t *in, 19 | size_t in_size, uint8_t *out, size_t *out_pos, size_t out_size) 20 | { 21 | lzma_options_easy opt_easy; 22 | if (lzma_easy_preset(&opt_easy, preset)) 23 | return LZMA_OPTIONS_ERROR; 24 | 25 | return lzma_stream_buffer_encode(opt_easy.filters, check, 26 | allocator, in, in_size, out, out_pos, out_size); 27 | } 28 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/easy_decoder_memusage.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file easy_decoder_memusage.c 4 | /// \brief Decoder memory usage calculation to match easy encoder presets 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "easy_preset.h" 14 | 15 | 16 | extern LZMA_API(uint64_t) 17 | lzma_easy_decoder_memusage(uint32_t preset) 18 | { 19 | lzma_options_easy opt_easy; 20 | if (lzma_easy_preset(&opt_easy, preset)) 21 | return UINT32_MAX; 22 | 23 | return lzma_raw_decoder_memusage(opt_easy.filters); 24 | } 25 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/easy_encoder.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file easy_encoder.c 4 | /// \brief Easy .xz Stream encoder initialization 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "easy_preset.h" 14 | 15 | 16 | extern LZMA_API(lzma_ret) 17 | lzma_easy_encoder(lzma_stream *strm, uint32_t preset, lzma_check check) 18 | { 19 | lzma_options_easy opt_easy; 20 | if (lzma_easy_preset(&opt_easy, preset)) 21 | return LZMA_OPTIONS_ERROR; 22 | 23 | return lzma_stream_encoder(strm, opt_easy.filters, check); 24 | } 25 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/easy_encoder_memusage.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file easy_encoder_memusage.c 4 | /// \brief Easy .xz Stream encoder memory usage calculation 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "easy_preset.h" 14 | 15 | 16 | extern LZMA_API(uint64_t) 17 | lzma_easy_encoder_memusage(uint32_t preset) 18 | { 19 | lzma_options_easy opt_easy; 20 | if (lzma_easy_preset(&opt_easy, preset)) 21 | return UINT32_MAX; 22 | 23 | return lzma_raw_encoder_memusage(opt_easy.filters); 24 | } 25 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/easy_preset.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file easy_preset.c 4 | /// \brief Preset handling for easy encoder and decoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "easy_preset.h" 14 | 15 | 16 | extern bool 17 | lzma_easy_preset(lzma_options_easy *opt_easy, uint32_t preset) 18 | { 19 | if (lzma_lzma_preset(&opt_easy->opt_lzma, preset)) 20 | return true; 21 | 22 | opt_easy->filters[0].id = LZMA_FILTER_LZMA2; 23 | opt_easy->filters[0].options = &opt_easy->opt_lzma; 24 | opt_easy->filters[1].id = LZMA_VLI_UNKNOWN; 25 | 26 | return false; 27 | } 28 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/easy_preset.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file easy_preset.h 4 | /// \brief Preset handling for easy encoder and decoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "common.h" 14 | 15 | 16 | typedef struct { 17 | /// We need to keep the filters array available in case 18 | /// LZMA_FULL_FLUSH is used. 19 | lzma_filter filters[LZMA_FILTERS_MAX + 1]; 20 | 21 | /// Options for LZMA2 22 | lzma_options_lzma opt_lzma; 23 | 24 | // Options for more filters can be added later, so this struct 25 | // is not ready to be put into the public API. 26 | 27 | } lzma_options_easy; 28 | 29 | 30 | /// Set *easy to the settings given by the preset. Returns true on error, 31 | /// false on success. 32 | extern bool lzma_easy_preset(lzma_options_easy *easy, uint32_t preset); 33 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/filter_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file filter_decoder.c 4 | /// \brief Filter ID mapping to filter-specific functions 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_FILTER_DECODER_H 14 | #define LZMA_FILTER_DECODER_H 15 | 16 | #include "common.h" 17 | 18 | 19 | extern lzma_ret lzma_raw_decoder_init( 20 | lzma_next_coder *next, const lzma_allocator *allocator, 21 | const lzma_filter *options); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/filter_encoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file filter_encoder.c 4 | /// \brief Filter ID mapping to filter-specific functions 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_FILTER_ENCODER_H 14 | #define LZMA_FILTER_ENCODER_H 15 | 16 | #include "common.h" 17 | 18 | 19 | // FIXME: Might become a part of the public API. 20 | extern uint64_t lzma_mt_block_size(const lzma_filter *filters); 21 | 22 | 23 | extern lzma_ret lzma_raw_encoder_init( 24 | lzma_next_coder *next, const lzma_allocator *allocator, 25 | const lzma_filter *filters); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/hardware_cputhreads.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file hardware_cputhreads.c 4 | /// \brief Get the number of CPU threads or cores 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "common.h" 14 | 15 | #include "tuklib_cpucores.h" 16 | 17 | 18 | extern LZMA_API(uint32_t) 19 | lzma_cputhreads(void) 20 | { 21 | return tuklib_cpucores(); 22 | } 23 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/hardware_physmem.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file hardware_physmem.c 4 | /// \brief Get the total amount of physical memory (RAM) 5 | // 6 | // Author: Jonathan Nieder 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "common.h" 14 | 15 | #include "tuklib_physmem.h" 16 | 17 | 18 | extern LZMA_API(uint64_t) 19 | lzma_physmem(void) 20 | { 21 | // It is simpler to make lzma_physmem() a wrapper for 22 | // tuklib_physmem() than to hack appropriate symbol visiblity 23 | // support for the tuklib modules. 24 | return tuklib_physmem(); 25 | } 26 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/index_encoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file index_encoder.h 4 | /// \brief Encodes the Index field 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_INDEX_ENCODER_H 14 | #define LZMA_INDEX_ENCODER_H 15 | 16 | #include "common.h" 17 | 18 | 19 | extern lzma_ret lzma_index_encoder_init(lzma_next_coder *next, 20 | const lzma_allocator *allocator, const lzma_index *i); 21 | 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/stream_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file stream_decoder.h 4 | /// \brief Decodes .xz Streams 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_STREAM_DECODER_H 14 | #define LZMA_STREAM_DECODER_H 15 | 16 | #include "common.h" 17 | 18 | extern lzma_ret lzma_stream_decoder_init( 19 | lzma_next_coder *next, const lzma_allocator *allocator, 20 | uint64_t memlimit, uint32_t flags); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/stream_flags_common.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file stream_flags_common.h 4 | /// \brief Common stuff for Stream flags coders 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_STREAM_FLAGS_COMMON_H 14 | #define LZMA_STREAM_FLAGS_COMMON_H 15 | 16 | #include "common.h" 17 | 18 | /// Size of the Stream Flags field 19 | #define LZMA_STREAM_FLAGS_SIZE 2 20 | 21 | extern const uint8_t lzma_header_magic[6]; 22 | extern const uint8_t lzma_footer_magic[2]; 23 | 24 | 25 | static inline bool 26 | is_backward_size_valid(const lzma_stream_flags *options) 27 | { 28 | return options->backward_size >= LZMA_BACKWARD_SIZE_MIN 29 | && options->backward_size <= LZMA_BACKWARD_SIZE_MAX 30 | && (options->backward_size & 3) == 0; 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/common/vli_size.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file vli_size.c 4 | /// \brief Calculates the encoded size of a variable-length integer 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "common.h" 14 | 15 | 16 | extern LZMA_API(uint32_t) 17 | lzma_vli_size(lzma_vli vli) 18 | { 19 | if (vli > LZMA_VLI_MAX) 20 | return 0; 21 | 22 | uint32_t i = 0; 23 | do { 24 | vli >>= 7; 25 | ++i; 26 | } while (vli != 0); 27 | 28 | assert(i <= LZMA_VLI_BYTES_MAX); 29 | return i; 30 | } 31 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/delta/Makefile.inc: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | liblzma_la_SOURCES += \ 9 | delta/delta_common.c \ 10 | delta/delta_common.h \ 11 | delta/delta_private.h 12 | 13 | if COND_ENCODER_DELTA 14 | liblzma_la_SOURCES += \ 15 | delta/delta_encoder.c \ 16 | delta/delta_encoder.h 17 | endif 18 | 19 | if COND_DECODER_DELTA 20 | liblzma_la_SOURCES += \ 21 | delta/delta_decoder.c \ 22 | delta/delta_decoder.h 23 | endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/delta/delta_common.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file delta_common.h 4 | /// \brief Common stuff for Delta encoder and decoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_DELTA_COMMON_H 14 | #define LZMA_DELTA_COMMON_H 15 | 16 | #include "common.h" 17 | 18 | extern uint64_t lzma_delta_coder_memusage(const void *options); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/delta/delta_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file delta_decoder.h 4 | /// \brief Delta filter decoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_DELTA_DECODER_H 14 | #define LZMA_DELTA_DECODER_H 15 | 16 | #include "delta_common.h" 17 | 18 | extern lzma_ret lzma_delta_decoder_init(lzma_next_coder *next, 19 | const lzma_allocator *allocator, 20 | const lzma_filter_info *filters); 21 | 22 | extern lzma_ret lzma_delta_props_decode( 23 | void **options, const lzma_allocator *allocator, 24 | const uint8_t *props, size_t props_size); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/delta/delta_encoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file delta_encoder.h 4 | /// \brief Delta filter encoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_DELTA_ENCODER_H 14 | #define LZMA_DELTA_ENCODER_H 15 | 16 | #include "delta_common.h" 17 | 18 | extern lzma_ret lzma_delta_encoder_init(lzma_next_coder *next, 19 | const lzma_allocator *allocator, 20 | const lzma_filter_info *filters); 21 | 22 | extern lzma_ret lzma_delta_props_encode(const void *options, uint8_t *out); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/delta/delta_private.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file delta_private.h 4 | /// \brief Private common stuff for Delta encoder and decoder 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_DELTA_PRIVATE_H 14 | #define LZMA_DELTA_PRIVATE_H 15 | 16 | #include "delta_common.h" 17 | 18 | typedef struct { 19 | /// Next coder in the chain 20 | lzma_next_coder next; 21 | 22 | /// Delta distance 23 | size_t distance; 24 | 25 | /// Position in history[] 26 | uint8_t pos; 27 | 28 | /// Buffer to hold history of the original data 29 | uint8_t history[LZMA_DELTA_DIST_MAX]; 30 | } lzma_delta_coder; 31 | 32 | 33 | extern lzma_ret lzma_delta_coder_init( 34 | lzma_next_coder *next, const lzma_allocator *allocator, 35 | const lzma_filter_info *filters); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/liblzma.pc.in: -------------------------------------------------------------------------------- 1 | # 2 | # Author: Lasse Collin 3 | # 4 | # This file has been put into the public domain. 5 | # You can do whatever you want with this file. 6 | # 7 | 8 | prefix=@prefix@ 9 | exec_prefix=@exec_prefix@ 10 | libdir=@libdir@ 11 | includedir=@includedir@ 12 | 13 | Name: liblzma 14 | Description: General purpose data compression library 15 | URL: @PACKAGE_URL@ 16 | Version: @PACKAGE_VERSION@ 17 | Cflags: -I${includedir} 18 | Libs: -L${libdir} -llzma 19 | Libs.private: @PTHREAD_CFLAGS@ @LIBS@ 20 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/liblzma_w32res.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Lasse Collin 3 | * 4 | * This file has been put into the public domain. 5 | * You can do whatever you want with this file. 6 | */ 7 | 8 | #define MY_TYPE VFT_DLL 9 | #define MY_NAME "liblzma" 10 | #define MY_SUFFIX ".dll" 11 | #define MY_DESC "liblzma data compression library" 12 | #include "common_w32res.rc" 13 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/lz/Makefile.inc: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | if COND_ENCODER_LZ 9 | liblzma_la_SOURCES += \ 10 | lz/lz_encoder.c \ 11 | lz/lz_encoder.h \ 12 | lz/lz_encoder_hash.h \ 13 | lz/lz_encoder_hash_table.h \ 14 | lz/lz_encoder_mf.c 15 | endif 16 | 17 | 18 | if COND_DECODER_LZ 19 | liblzma_la_SOURCES += \ 20 | lz/lz_decoder.c \ 21 | lz/lz_decoder.h 22 | endif 23 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/lzma/Makefile.inc: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | EXTRA_DIST += lzma/fastpos_tablegen.c 9 | 10 | liblzma_la_SOURCES += lzma/lzma_common.h 11 | 12 | if COND_FILTER_LZMA1 13 | liblzma_la_SOURCES += \ 14 | lzma/lzma_encoder_presets.c 15 | endif 16 | 17 | if COND_ENCODER_LZMA1 18 | liblzma_la_SOURCES += \ 19 | lzma/fastpos.h \ 20 | lzma/lzma_encoder.h \ 21 | lzma/lzma_encoder.c \ 22 | lzma/lzma_encoder_private.h \ 23 | lzma/lzma_encoder_optimum_fast.c \ 24 | lzma/lzma_encoder_optimum_normal.c 25 | 26 | if !COND_SMALL 27 | liblzma_la_SOURCES += lzma/fastpos_table.c 28 | endif 29 | endif 30 | 31 | if COND_DECODER_LZMA1 32 | liblzma_la_SOURCES += \ 33 | lzma/lzma_decoder.c \ 34 | lzma/lzma_decoder.h 35 | endif 36 | 37 | if COND_ENCODER_LZMA2 38 | liblzma_la_SOURCES += \ 39 | lzma/lzma2_encoder.c \ 40 | lzma/lzma2_encoder.h 41 | endif 42 | 43 | if COND_DECODER_LZMA2 44 | liblzma_la_SOURCES += \ 45 | lzma/lzma2_decoder.c \ 46 | lzma/lzma2_decoder.h 47 | endif 48 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/lzma/lzma2_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file lzma2_decoder.h 4 | /// \brief LZMA2 decoder 5 | /// 6 | // Authors: Igor Pavlov 7 | // Lasse Collin 8 | // 9 | // This file has been put into the public domain. 10 | // You can do whatever you want with this file. 11 | // 12 | /////////////////////////////////////////////////////////////////////////////// 13 | 14 | #ifndef LZMA_LZMA2_DECODER_H 15 | #define LZMA_LZMA2_DECODER_H 16 | 17 | #include "common.h" 18 | 19 | extern lzma_ret lzma_lzma2_decoder_init(lzma_next_coder *next, 20 | const lzma_allocator *allocator, 21 | const lzma_filter_info *filters); 22 | 23 | extern uint64_t lzma_lzma2_decoder_memusage(const void *options); 24 | 25 | extern lzma_ret lzma_lzma2_props_decode( 26 | void **options, const lzma_allocator *allocator, 27 | const uint8_t *props, size_t props_size); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/lzma/lzma2_encoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file lzma2_encoder.h 4 | /// \brief LZMA2 encoder 5 | /// 6 | // Authors: Igor Pavlov 7 | // Lasse Collin 8 | // 9 | // This file has been put into the public domain. 10 | // You can do whatever you want with this file. 11 | // 12 | /////////////////////////////////////////////////////////////////////////////// 13 | 14 | #ifndef LZMA_LZMA2_ENCODER_H 15 | #define LZMA_LZMA2_ENCODER_H 16 | 17 | #include "common.h" 18 | 19 | 20 | /// Maximum number of bytes of actual data per chunk (no headers) 21 | #define LZMA2_CHUNK_MAX (UINT32_C(1) << 16) 22 | 23 | /// Maximum uncompressed size of LZMA chunk (no headers) 24 | #define LZMA2_UNCOMPRESSED_MAX (UINT32_C(1) << 21) 25 | 26 | /// Maximum size of LZMA2 headers 27 | #define LZMA2_HEADER_MAX 6 28 | 29 | /// Size of a header for uncompressed chunk 30 | #define LZMA2_HEADER_UNCOMPRESSED 3 31 | 32 | 33 | extern lzma_ret lzma_lzma2_encoder_init( 34 | lzma_next_coder *next, const lzma_allocator *allocator, 35 | const lzma_filter_info *filters); 36 | 37 | extern uint64_t lzma_lzma2_encoder_memusage(const void *options); 38 | 39 | extern lzma_ret lzma_lzma2_props_encode(const void *options, uint8_t *out); 40 | 41 | extern uint64_t lzma_lzma2_block_size(const void *options); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/rangecoder/Makefile.inc: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | EXTRA_DIST += rangecoder/price_tablegen.c 9 | 10 | liblzma_la_SOURCES += rangecoder/range_common.h 11 | 12 | if COND_ENCODER_LZMA1 13 | liblzma_la_SOURCES += \ 14 | rangecoder/range_encoder.h \ 15 | rangecoder/price.h \ 16 | rangecoder/price_table.c 17 | endif 18 | 19 | if COND_DECODER_LZMA1 20 | liblzma_la_SOURCES += rangecoder/range_decoder.h 21 | endif 22 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/rangecoder/price_table.c: -------------------------------------------------------------------------------- 1 | /* This file has been automatically generated by price_tablegen.c. */ 2 | 3 | #include "range_encoder.h" 4 | 5 | const uint8_t lzma_rc_prices[RC_PRICE_TABLE_SIZE] = { 6 | 128, 103, 91, 84, 78, 73, 69, 66, 7 | 63, 61, 58, 56, 54, 52, 51, 49, 8 | 48, 46, 45, 44, 43, 42, 41, 40, 9 | 39, 38, 37, 36, 35, 34, 34, 33, 10 | 32, 31, 31, 30, 29, 29, 28, 28, 11 | 27, 26, 26, 25, 25, 24, 24, 23, 12 | 23, 22, 22, 22, 21, 21, 20, 20, 13 | 19, 19, 19, 18, 18, 17, 17, 17, 14 | 16, 16, 16, 15, 15, 15, 14, 14, 15 | 14, 13, 13, 13, 12, 12, 12, 11, 16 | 11, 11, 11, 10, 10, 10, 10, 9, 17 | 9, 9, 9, 8, 8, 8, 8, 7, 18 | 7, 7, 7, 6, 6, 6, 6, 5, 19 | 5, 5, 5, 5, 4, 4, 4, 4, 20 | 3, 3, 3, 3, 3, 2, 2, 2, 21 | 2, 2, 2, 1, 1, 1, 1, 1 22 | }; 23 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/simple/Makefile.inc: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | liblzma_la_SOURCES += \ 9 | simple/simple_coder.c \ 10 | simple/simple_coder.h \ 11 | simple/simple_private.h 12 | 13 | if COND_ENCODER_SIMPLE 14 | liblzma_la_SOURCES += \ 15 | simple/simple_encoder.c \ 16 | simple/simple_encoder.h 17 | endif 18 | 19 | if COND_DECODER_SIMPLE 20 | liblzma_la_SOURCES += \ 21 | simple/simple_decoder.c \ 22 | simple/simple_decoder.h 23 | endif 24 | 25 | if COND_FILTER_X86 26 | liblzma_la_SOURCES += simple/x86.c 27 | endif 28 | 29 | if COND_FILTER_POWERPC 30 | liblzma_la_SOURCES += simple/powerpc.c 31 | endif 32 | 33 | if COND_FILTER_IA64 34 | liblzma_la_SOURCES += simple/ia64.c 35 | endif 36 | 37 | if COND_FILTER_ARM 38 | liblzma_la_SOURCES += simple/arm.c 39 | endif 40 | 41 | if COND_FILTER_ARMTHUMB 42 | liblzma_la_SOURCES += simple/armthumb.c 43 | endif 44 | 45 | if COND_FILTER_SPARC 46 | liblzma_la_SOURCES += simple/sparc.c 47 | endif 48 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/simple/simple_decoder.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file simple_decoder.c 4 | /// \brief Properties decoder for simple filters 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "simple_decoder.h" 14 | 15 | 16 | extern lzma_ret 17 | lzma_simple_props_decode(void **options, const lzma_allocator *allocator, 18 | const uint8_t *props, size_t props_size) 19 | { 20 | if (props_size == 0) 21 | return LZMA_OK; 22 | 23 | if (props_size != 4) 24 | return LZMA_OPTIONS_ERROR; 25 | 26 | lzma_options_bcj *opt = lzma_alloc( 27 | sizeof(lzma_options_bcj), allocator); 28 | if (opt == NULL) 29 | return LZMA_MEM_ERROR; 30 | 31 | opt->start_offset = unaligned_read32le(props); 32 | 33 | // Don't leave an options structure allocated if start_offset is zero. 34 | if (opt->start_offset == 0) 35 | lzma_free(opt, allocator); 36 | else 37 | *options = opt; 38 | 39 | return LZMA_OK; 40 | } 41 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/simple/simple_decoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file simple_decoder.h 4 | /// \brief Properties decoder for simple filters 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_SIMPLE_DECODER_H 14 | #define LZMA_SIMPLE_DECODER_H 15 | 16 | #include "simple_coder.h" 17 | 18 | extern lzma_ret lzma_simple_props_decode( 19 | void **options, const lzma_allocator *allocator, 20 | const uint8_t *props, size_t props_size); 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/simple/simple_encoder.c: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file simple_encoder.c 4 | /// \brief Properties encoder for simple filters 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #include "simple_encoder.h" 14 | 15 | 16 | extern lzma_ret 17 | lzma_simple_props_size(uint32_t *size, const void *options) 18 | { 19 | const lzma_options_bcj *const opt = options; 20 | *size = (opt == NULL || opt->start_offset == 0) ? 0 : 4; 21 | return LZMA_OK; 22 | } 23 | 24 | 25 | extern lzma_ret 26 | lzma_simple_props_encode(const void *options, uint8_t *out) 27 | { 28 | const lzma_options_bcj *const opt = options; 29 | 30 | // The default start offset is zero, so we don't need to store any 31 | // options unless the start offset is non-zero. 32 | if (opt == NULL || opt->start_offset == 0) 33 | return LZMA_OK; 34 | 35 | unaligned_write32le(out, opt->start_offset); 36 | 37 | return LZMA_OK; 38 | } 39 | -------------------------------------------------------------------------------- /deps/xz/src/liblzma/simple/simple_encoder.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file simple_encoder.c 4 | /// \brief Properties encoder for simple filters 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | #ifndef LZMA_SIMPLE_ENCODER_H 14 | #define LZMA_SIMPLE_ENCODER_H 15 | 16 | #include "simple_coder.h" 17 | 18 | 19 | extern lzma_ret lzma_simple_props_size(uint32_t *size, const void *options); 20 | 21 | extern lzma_ret lzma_simple_props_encode(const void *options, uint8_t *out); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /deps/xz/src/lzmainfo/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | bin_PROGRAMS = lzmainfo 9 | 10 | lzmainfo_SOURCES = \ 11 | lzmainfo.c \ 12 | ../common/tuklib_progname.c \ 13 | ../common/tuklib_exit.c 14 | 15 | if COND_W32 16 | lzmainfo_SOURCES += lzmainfo_w32res.rc 17 | endif 18 | 19 | lzmainfo_CPPFLAGS = \ 20 | -DLOCALEDIR=\"$(localedir)\" \ 21 | -I$(top_srcdir)/src/common \ 22 | -I$(top_srcdir)/src/liblzma/api \ 23 | -I$(top_builddir)/lib 24 | 25 | lzmainfo_LDADD = $(top_builddir)/src/liblzma/liblzma.la 26 | 27 | if COND_GNULIB 28 | lzmainfo_LDADD += $(top_builddir)/lib/libgnu.a 29 | endif 30 | 31 | lzmainfo_LDADD += $(LTLIBINTL) 32 | 33 | 34 | dist_man_MANS = lzmainfo.1 35 | 36 | # Windows resource compiler support 37 | .rc.o: 38 | $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ 39 | $(lzmainfo_CPPFLAGS) $(CPPFLAGS) $(RCFLAGS) -i $< -o $@ 40 | -------------------------------------------------------------------------------- /deps/xz/src/lzmainfo/lzmainfo_w32res.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Lasse Collin 3 | * 4 | * This file has been put into the public domain. 5 | * You can do whatever you want with this file. 6 | */ 7 | 8 | #define MY_TYPE VFT_APP 9 | #define MY_NAME "lzmainfo" 10 | #define MY_SUFFIX ".exe" 11 | #define MY_DESC "lzmainfo shows information about .lzma files" 12 | #include "common_w32res.rc" 13 | -------------------------------------------------------------------------------- /deps/xz/src/xz/args.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file args.h 4 | /// \brief Argument parsing 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | typedef struct { 14 | /// Filenames from command line 15 | char **arg_names; 16 | 17 | /// Number of filenames from command line 18 | unsigned int arg_count; 19 | 20 | /// Name of the file from which to read filenames. This is NULL 21 | /// if --files or --files0 was not used. 22 | char *files_name; 23 | 24 | /// File opened for reading from which filenames are read. This is 25 | /// non-NULL only if files_name is non-NULL. 26 | FILE *files_file; 27 | 28 | /// Delimiter for filenames read from files_file 29 | char files_delim; 30 | 31 | } args_info; 32 | 33 | 34 | extern bool opt_stdout; 35 | extern bool opt_force; 36 | extern bool opt_keep_original; 37 | // extern bool opt_recursive; 38 | extern bool opt_robot; 39 | extern bool opt_ignore_check; 40 | 41 | extern const char stdin_filename[]; 42 | 43 | extern void args_parse(args_info *args, int argc, char **argv); 44 | extern void args_free(void); 45 | -------------------------------------------------------------------------------- /deps/xz/src/xz/list.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file list.h 4 | /// \brief List information about .xz files 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | /// \brief List information about the given .xz file 14 | extern void list_file(const char *filename); 15 | 16 | 17 | /// \brief Show the totals after all files have been listed 18 | extern void list_totals(void); 19 | -------------------------------------------------------------------------------- /deps/xz/src/xz/main.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file main.h 4 | /// \brief Miscellaneous declarations 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | /// Possible exit status values. These are the same as used by gzip and bzip2. 14 | enum exit_status_type { 15 | E_SUCCESS = 0, 16 | E_ERROR = 1, 17 | E_WARNING = 2, 18 | }; 19 | 20 | 21 | /// Sets the exit status after a warning or error has occurred. If new_status 22 | /// is E_WARNING and the old exit status was already E_ERROR, the exit 23 | /// status is not changed. 24 | extern void set_exit_status(enum exit_status_type new_status); 25 | 26 | 27 | /// Use E_SUCCESS instead of E_WARNING if something worth a warning occurs 28 | /// but nothing worth an error has occurred. This is called when --no-warn 29 | /// is specified. 30 | extern void set_exit_no_warn(void); 31 | -------------------------------------------------------------------------------- /deps/xz/src/xz/options.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file options.h 4 | /// \brief Parser for filter-specific options 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | /// \brief Parser for Delta options 14 | /// 15 | /// \return Pointer to allocated options structure. 16 | /// Doesn't return on error. 17 | extern lzma_options_delta *options_delta(const char *str); 18 | 19 | 20 | /// \brief Parser for BCJ options 21 | /// 22 | /// \return Pointer to allocated options structure. 23 | /// Doesn't return on error. 24 | extern lzma_options_bcj *options_bcj(const char *str); 25 | 26 | 27 | /// \brief Parser for LZMA options 28 | /// 29 | /// \return Pointer to allocated options structure. 30 | /// Doesn't return on error. 31 | extern lzma_options_lzma *options_lzma(const char *str); 32 | -------------------------------------------------------------------------------- /deps/xz/src/xz/suffix.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // 3 | /// \file suffix.h 4 | /// \brief Checks filename suffix and creates the destination filename 5 | // 6 | // Author: Lasse Collin 7 | // 8 | // This file has been put into the public domain. 9 | // You can do whatever you want with this file. 10 | // 11 | /////////////////////////////////////////////////////////////////////////////// 12 | 13 | /// \brief Get the name of the destination file 14 | /// 15 | /// Depending on the global variable opt_mode, this tries to find a matching 16 | /// counterpart for src_name. If the name can be constructed, it is allocated 17 | /// and returned (caller must free it). On error, a message is printed and 18 | /// NULL is returned. 19 | extern char *suffix_get_dest_name(const char *src_name); 20 | 21 | 22 | /// \brief Set a custom filename suffix 23 | /// 24 | /// This function calls xstrdup() for the given suffix, thus the caller 25 | /// doesn't need to keep the memory allocated. There can be only one custom 26 | /// suffix, thus if this is called multiple times, the old suffixes are freed 27 | /// and forgotten. 28 | extern void suffix_set(const char *suffix); 29 | -------------------------------------------------------------------------------- /deps/xz/src/xz/xz_w32res.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Lasse Collin 3 | * 4 | * This file has been put into the public domain. 5 | * You can do whatever you want with this file. 6 | */ 7 | 8 | #define MY_TYPE VFT_APP 9 | #define MY_NAME "xz" 10 | #define MY_SUFFIX ".exe" 11 | #define MY_DESC "xz data compression tool for .xz and .lzma files" 12 | #include "common_w32res.rc" 13 | -------------------------------------------------------------------------------- /deps/xz/src/xzdec/lzmadec_w32res.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Lasse Collin 3 | * 4 | * This file has been put into the public domain. 5 | * You can do whatever you want with this file. 6 | */ 7 | 8 | #define MY_TYPE VFT_APP 9 | #define MY_NAME "lzmadec" 10 | #define MY_SUFFIX ".exe" 11 | #define MY_DESC "lzmadec decompression tool for .lzma files" 12 | #include "common_w32res.rc" 13 | -------------------------------------------------------------------------------- /deps/xz/src/xzdec/xzdec_w32res.rc: -------------------------------------------------------------------------------- 1 | /* 2 | * Author: Lasse Collin 3 | * 4 | * This file has been put into the public domain. 5 | * You can do whatever you want with this file. 6 | */ 7 | 8 | #define MY_TYPE VFT_APP 9 | #define MY_NAME "xzdec" 10 | #define MY_SUFFIX ".exe" 11 | #define MY_DESC "xzdec decompression tool for .xz files" 12 | #include "common_w32res.rc" 13 | -------------------------------------------------------------------------------- /deps/xz/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## Author: Lasse Collin 3 | ## 4 | ## This file has been put into the public domain. 5 | ## You can do whatever you want with this file. 6 | ## 7 | 8 | EXTRA_DIST = \ 9 | files \ 10 | tests.h \ 11 | test_files.sh \ 12 | test_compress.sh \ 13 | test_scripts.sh \ 14 | bcj_test.c \ 15 | compress_prepared_bcj_sparc \ 16 | compress_prepared_bcj_x86 \ 17 | xzgrep_expected_output 18 | 19 | AM_CPPFLAGS = \ 20 | -I$(top_srcdir)/src/common \ 21 | -I$(top_srcdir)/src/liblzma/api \ 22 | -I$(top_builddir)/lib 23 | 24 | LDADD = $(top_builddir)/src/liblzma/liblzma.la 25 | 26 | if COND_GNULIB 27 | LDADD += $(top_builddir)/lib/libgnu.a 28 | endif 29 | 30 | LDADD += $(LTLIBINTL) 31 | 32 | check_PROGRAMS = \ 33 | create_compress_files \ 34 | test_check \ 35 | test_stream_flags \ 36 | test_filter_flags \ 37 | test_block_header \ 38 | test_index \ 39 | test_bcj_exact_size 40 | 41 | TESTS = \ 42 | test_check \ 43 | test_stream_flags \ 44 | test_filter_flags \ 45 | test_block_header \ 46 | test_index \ 47 | test_bcj_exact_size \ 48 | test_files.sh \ 49 | test_compress.sh 50 | 51 | if COND_SCRIPTS 52 | TESTS += test_scripts.sh 53 | endif 54 | 55 | clean-local: 56 | -rm -f compress_generated_* \ 57 | xzgrep_test_output xzgrep_test_1.xz xzgrep_test_2.xz 58 | -------------------------------------------------------------------------------- /deps/xz/tests/compress_prepared_bcj_sparc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/compress_prepared_bcj_sparc -------------------------------------------------------------------------------- /deps/xz/tests/compress_prepared_bcj_x86: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/compress_prepared_bcj_x86 -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0-backward_size.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0-backward_size.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0-empty-truncated.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0-empty-truncated.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0-footer_magic.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0-footer_magic.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0-header_magic.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0-header_magic.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0-nonempty_index.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0-nonempty_index.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0cat-alone.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0cat-alone.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0cat-header_magic.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0cat-header_magic.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0catpad-empty.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0catpad-empty.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-0pad-empty.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-0pad-empty.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-block_header-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-block_header-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-block_header-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-block_header-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-block_header-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-block_header-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-block_header-4.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-block_header-4.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-block_header-5.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-block_header-5.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-block_header-6.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-block_header-6.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-check-crc32.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-check-crc32.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-check-crc64.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-check-crc64.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-check-sha256.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-check-sha256.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-4.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-4.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-5.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-5.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-6.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-6.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-7.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-7.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-lzma2-8.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-lzma2-8.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-stream_flags-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-stream_flags-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-stream_flags-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-stream_flags-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-stream_flags-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-stream_flags-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-vli-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-vli-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-1-vli-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-1-vli-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-2-compressed_data_padding.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-2-compressed_data_padding.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-2-index-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-2-index-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-2-index-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-2-index-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-2-index-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-2-index-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-2-index-4.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-2-index-4.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/bad-2-index-5.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/bad-2-index-5.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-0-empty.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-0-empty.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-0cat-empty.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-0cat-empty.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-0catpad-empty.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-0catpad-empty.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-0pad-empty.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-0pad-empty.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-3delta-lzma2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-3delta-lzma2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-block_header-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-block_header-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-block_header-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-block_header-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-block_header-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-block_header-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-check-crc32.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-check-crc32.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-check-crc64.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-check-crc64.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-check-none.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-check-none.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-check-sha256.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-check-sha256.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-delta-lzma2.tiff.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-delta-lzma2.tiff.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-lzma2-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-lzma2-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-lzma2-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-lzma2-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-lzma2-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-lzma2-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-lzma2-4.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-lzma2-4.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-lzma2-5.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-lzma2-5.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-sparc-lzma2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-sparc-lzma2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-1-x86-lzma2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-1-x86-lzma2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/good-2-lzma2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/good-2-lzma2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/unsupported-block_header.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/unsupported-block_header.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/unsupported-check.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/unsupported-check.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/unsupported-filter_flags-1.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/unsupported-filter_flags-1.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/unsupported-filter_flags-2.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/unsupported-filter_flags-2.xz -------------------------------------------------------------------------------- /deps/xz/tests/files/unsupported-filter_flags-3.xz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/deps/xz/tests/files/unsupported-filter_flags-3.xz -------------------------------------------------------------------------------- /deps/xz/tests/test_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ############################################################################### 4 | # 5 | # Author: Lasse Collin 6 | # 7 | # This file has been put into the public domain. 8 | # You can do whatever you want with this file. 9 | # 10 | ############################################################################### 11 | 12 | # If both xz and xzdec were not build, skip this test. 13 | XZ=../src/xz/xz 14 | XZDEC=../src/xzdec/xzdec 15 | test -x "$XZ" || XZ= 16 | test -x "$XZDEC" || XZDEC= 17 | if test -z "$XZ$XZDEC"; then 18 | (exit 77) 19 | exit 77 20 | fi 21 | 22 | for I in "$srcdir"/files/good-*.xz 23 | do 24 | if test -z "$XZ" || "$XZ" -dc "$I" > /dev/null; then 25 | : 26 | else 27 | echo "Good file failed: $I" 28 | (exit 1) 29 | exit 1 30 | fi 31 | 32 | if test -z "$XZDEC" || "$XZDEC" "$I" > /dev/null; then 33 | : 34 | else 35 | echo "Good file failed: $I" 36 | (exit 1) 37 | exit 1 38 | fi 39 | done 40 | 41 | for I in "$srcdir"/files/bad-*.xz 42 | do 43 | if test -n "$XZ" && "$XZ" -dc "$I" > /dev/null 2>&1; then 44 | echo "Bad file succeeded: $I" 45 | (exit 1) 46 | exit 1 47 | fi 48 | 49 | if test -n "$XZDEC" && "$XZDEC" "$I" > /dev/null 2>&1; then 50 | echo "Bad file succeeded: $I" 51 | (exit 1) 52 | exit 1 53 | fi 54 | done 55 | 56 | (exit 0) 57 | exit 0 58 | -------------------------------------------------------------------------------- /deps/xz/tests/xzgrep_expected_output: -------------------------------------------------------------------------------- 1 | => xzgrep el <= 2 | xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut 3 | xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu 4 | xzgrep_test_2.xz:Hello 5 | retval 0 6 | => xzgrep -l el <= 7 | xzgrep_test_1.xz 8 | xzgrep_test_2.xz 9 | retval 0 10 | => xzgrep -h el <= 11 | elit, sed do eiusmod tempor incididunt ut 12 | in voluptate velit esse cillum dolore eu 13 | Hello 14 | retval 0 15 | => xzgrep -H el <= 16 | xzgrep_test_1.xz:elit, sed do eiusmod tempor incididunt ut 17 | xzgrep_test_1.xz:in voluptate velit esse cillum dolore eu 18 | xzgrep_test_2.xz:Hello 19 | retval 0 20 | => xzgrep Hello <= 21 | xzgrep_test_2.xz:Hello 22 | retval 0 23 | => xzgrep -l Hello <= 24 | xzgrep_test_2.xz 25 | retval 0 26 | => xzgrep -h Hello <= 27 | Hello 28 | retval 0 29 | => xzgrep -H Hello <= 30 | xzgrep_test_2.xz:Hello 31 | retval 0 32 | => xzgrep NOMATCH <= 33 | retval 1 34 | => xzgrep -l NOMATCH <= 35 | retval 1 36 | => xzgrep -h NOMATCH <= 37 | retval 1 38 | => xzgrep -H NOMATCH <= 39 | retval 1 40 | -------------------------------------------------------------------------------- /examples/launcher/borderlesswindow.cpp: -------------------------------------------------------------------------------- 1 | #include "borderlesswindow.h" 2 | #include 3 | 4 | #ifdef Q_OS_WIN 5 | # include 6 | # include 7 | #endif 8 | 9 | QuickBorderlessView::QuickBorderlessView(QWindow *parent) : QQuickView(parent) 10 | { 11 | setFlags(Qt::FramelessWindowHint | Qt::Window); 12 | setColor(QColor(Qt::transparent)); 13 | } 14 | 15 | QuickBorderlessView::~QuickBorderlessView() 16 | { 17 | 18 | } 19 | 20 | #ifdef Q_OS_WIN 21 | bool QuickBorderlessView::nativeEvent(const QByteArray &, void *message, long *result) 22 | { 23 | MSG * msg = (MSG *)message; 24 | if(msg->message == WM_NCHITTEST) 25 | { 26 | LRESULT r = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam); 27 | if(r == HTCLIENT && GetAsyncKeyState(MK_LBUTTON) < 0) 28 | { 29 | int xPos = GET_X_LPARAM(msg->lParam) - geometry().x(); 30 | int yPos = GET_Y_LPARAM(msg->lParam) - geometry().y(); 31 | QQuickItem *item = rootObject()->childAt(xPos, yPos); 32 | if(item != 0 && item->objectName() == "caption" && item->childAt(xPos, yPos) == 0) 33 | { 34 | *result = HTCAPTION; 35 | return true; 36 | } 37 | } 38 | } 39 | 40 | return false; 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /examples/launcher/borderlesswindow.h: -------------------------------------------------------------------------------- 1 | #ifndef BORDERLESSWINDOW_H 2 | #define BORDERLESSWINDOW_H 3 | 4 | #include 5 | 6 | class QuickBorderlessView : public QQuickView 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | QuickBorderlessView(QWindow *parent = 0); 12 | virtual ~QuickBorderlessView(); 13 | 14 | #ifdef Q_OS_WIN 15 | protected: 16 | bool nativeEvent(const QByteArray &, void *message, long *result); 17 | #endif 18 | }; 19 | 20 | #endif // BORDERLESSWINDOW_H 21 | -------------------------------------------------------------------------------- /examples/launcher/content/Input.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.1 3 | import QtQuick.Controls.Styles 1.1 4 | import QtQuick.Layouts 1.1 5 | import QtGraphicalEffects 1.0 6 | 7 | TextField { 8 | Layout.fillWidth: true 9 | implicitHeight: 27 10 | style: TextFieldStyle { 11 | background: Item { 12 | /*RectangularGlow { 13 | anchors.fill: parent 14 | anchors.topMargin: 1 15 | anchors.leftMargin: -1 16 | anchors.bottomMargin: -anchors.topMargin 17 | anchors.rightMargin: -anchors.leftMargin 18 | glowRadius: 1 19 | spread: 0.0 20 | color: "black" 21 | cornerRadius: 1 22 | }*/ 23 | Rectangle { 24 | anchors.fill: parent 25 | radius: 1 26 | color: "#131313" 27 | border.width: 1 28 | border.color: "#29292d" 29 | } 30 | } 31 | textColor:"white" 32 | placeholderTextColor: "#a7a7a7" 33 | font.pixelSize: 15 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /examples/launcher/content/Label.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.2 2 | import QtQuick.Controls 1.1 3 | import QtQuick.Controls.Styles 1.1 4 | 5 | Text { 6 | color : "#a7a7a7" 7 | font.pixelSize: 15 8 | } 9 | -------------------------------------------------------------------------------- /examples/launcher/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "mainwindow.h" 6 | #include "updatedialog.h" 7 | 8 | int main(int argc, char *argv[]) 9 | { 10 | #if defined(QT_DEBUG) 11 | QLoggingCategory::setFilterRules(QStringLiteral("updatesystem.*.debug=true")); 12 | #endif 13 | //qInstallMessageHandler(myMessageOutput); 14 | QApplication a(argc, argv); 15 | if(argc >= 4 ) 16 | { 17 | if(QString(argv[1]) == "update") 18 | { 19 | QString source = QApplication::applicationDirPath(); 20 | QString processId(argv[2]); 21 | QString dest(argv[3]); 22 | if(argc > 4) 23 | source = QString(argv[4]); 24 | if(!QFile::exists(dest)) 25 | return -1; 26 | UpdateDialog d(processId, dest, source); 27 | d.show(); 28 | d.update(); 29 | return a.exec(); 30 | } 31 | } 32 | 33 | MainWindow mainwindow; 34 | mainwindow.show(); 35 | return a.exec(); 36 | } 37 | -------------------------------------------------------------------------------- /examples/launcher/ressources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | main.qml 4 | content/Input.qml 5 | content/Label.qml 6 | content/Button.qml 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/launcher/updatedialog.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATEDIALOG_H 2 | #define UPDATEDIALOG_H 3 | 4 | #include 5 | #include 6 | 7 | namespace Ui { 8 | class UpdateDialog; 9 | } 10 | 11 | class RemoteUpdate; 12 | class UpdateDialog : public QDialog 13 | { 14 | Q_OBJECT 15 | 16 | public: 17 | UpdateDialog(QString processId, QString currentVersionPath, QString uptodateVersionPath); 18 | ~UpdateDialog(); 19 | public slots: 20 | void update(); 21 | 22 | private slots: 23 | void copyProgress(qint64 current, qint64 total); 24 | void copyWarning(const Warning &msg); 25 | void copyFinished(); 26 | 27 | private: 28 | QString processId, currentVersionPath, uptodateVersionPath; 29 | Updater m_launcherUpdate; 30 | QString m_exe; 31 | Ui::UpdateDialog *ui; 32 | }; 33 | 34 | #endif // UPDATEDIALOG_H 35 | -------------------------------------------------------------------------------- /src/common/jsonutil.h: -------------------------------------------------------------------------------- 1 | #ifndef JSONUTIL_H 2 | #define JSONUTIL_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace JsonUtil { 10 | void toJsonFile(const QString &filename, const QJsonObject &object, QJsonDocument::JsonFormat format = QJsonDocument::Indented); 11 | QJsonObject fromJsonFile(const QString &filename); 12 | QJsonObject fromJson(const QByteArray & json); 13 | QJsonObject asObject(const QJsonValue &value); 14 | QJsonArray asArray(const QJsonValue &value); 15 | QString asString(const QJsonValue &value); 16 | int asIntString(const QJsonValue &value); 17 | qint64 asInt64String(const QJsonValue &value); 18 | QJsonObject asObject(const QJsonObject &object, QString key); 19 | QJsonArray asArray(const QJsonObject &object, QString key); 20 | QString asString(const QJsonObject &object, QString key); 21 | int asIntString(const QJsonObject & object, QString key); 22 | qint64 asInt64String(const QJsonObject & object, QString key); 23 | } 24 | 25 | #endif // JSONUTIL_H 26 | -------------------------------------------------------------------------------- /src/common/lzma.h: -------------------------------------------------------------------------------- 1 | #ifndef LZMA_H 2 | #define LZMA_H 3 | 4 | #include 5 | 6 | class QIODevice; 7 | 8 | class Lzma 9 | { 10 | public: 11 | Lzma(); 12 | bool compress(QIODevice * input, QIODevice *output); 13 | bool decompress(QIODevice *input, QIODevice *output); 14 | int level() const; 15 | void setLevel(int level); 16 | 17 | QString errorString() const; 18 | 19 | private: 20 | void loop(QIODevice *input, QIODevice *output); 21 | int m_level; 22 | QString m_errorString; 23 | }; 24 | 25 | inline int Lzma::level() const 26 | { 27 | return m_level; 28 | } 29 | 30 | inline void Lzma::setLevel(int level) 31 | { 32 | Q_ASSERT(level >= 0 && level <= 9); 33 | m_level = level; 34 | } 35 | 36 | inline QString Lzma::errorString() const 37 | { 38 | return m_errorString; 39 | } 40 | 41 | #endif // LZMA_H 42 | -------------------------------------------------------------------------------- /src/common/package.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_PACKAGE_H 2 | #define UPDATER_PACKAGE_H 3 | 4 | #include 5 | #include 6 | 7 | class Operation; 8 | 9 | class Package 10 | { 11 | public: 12 | Package(); 13 | Package(const QString &to, const QString &from, qint64 size); 14 | QString to; 15 | QString from; 16 | qint64 size; 17 | 18 | static QString repositoryPackageName(const QString &from, const QString &to); 19 | QString url() const; 20 | QString metadataUrl() const; 21 | void fromJsonObjectV1(const QJsonObject &packageObject); 22 | QJsonObject toJsonObjectV1() const; 23 | bool operator==(const Package &other) const; 24 | }; 25 | 26 | inline QString Package::metadataUrl() const 27 | { 28 | return url() + QStringLiteral(".metadata"); 29 | } 30 | 31 | #endif // UPDATER_PACKAGE_H 32 | -------------------------------------------------------------------------------- /src/common/packages.h: -------------------------------------------------------------------------------- 1 | #ifndef PACKAGES_H 2 | #define PACKAGES_H 3 | 4 | #include 5 | #include 6 | #include "package.h" 7 | 8 | class Packages : public QVector 9 | { 10 | public: 11 | QVector findBestPath(const QString &from, const QString &to); 12 | 13 | void fromJsonObject(const QJsonObject &object); 14 | QJsonObject toJsonObject() const; 15 | 16 | void fromJsonArrayV1(const QJsonArray &packages); 17 | QJsonArray toJsonArrayV1() const; 18 | }; 19 | 20 | #endif // PACKAGES_H 21 | -------------------------------------------------------------------------------- /src/common/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_H 2 | #define UTILS_H 3 | 4 | #include 5 | #include "../qtupdatesystem_global.h" 6 | 7 | namespace Utils { 8 | QTUPDATESYSTEMSHARED_EXPORT QString cleanPath(const QString &pathName, bool separatorAtEnd = true); 9 | QTUPDATESYSTEMSHARED_EXPORT QString formatMs(qint64 millisec); 10 | } 11 | #endif // UTILS_H 12 | -------------------------------------------------------------------------------- /src/common/version.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSION_H 2 | #define VERSION_H 3 | 4 | #include 5 | #include 6 | 7 | class Version 8 | { 9 | public: 10 | Version(const QString &revision = QString(), const QString &description = QString()); 11 | QString revision; 12 | QString description; 13 | void fromJsonObject(const QJsonObject &object); 14 | QJsonObject toJsonObject() const; 15 | 16 | void fromJsonObjectV1(const QJsonObject &object); 17 | QJsonObject toJsonObjectV1() const; 18 | bool operator==(const Version &other) const; 19 | }; 20 | 21 | #endif // VERSION_H 22 | -------------------------------------------------------------------------------- /src/common/versions.cpp: -------------------------------------------------------------------------------- 1 | #include "versions.h" 2 | #include "jsonutil.h" 3 | #include "../exceptions.h" 4 | 5 | #include 6 | 7 | void Versions::fromJsonObject(const QJsonObject & object) 8 | { 9 | const QString version = JsonUtil::asString(object, QStringLiteral("version")); 10 | if(version == "1") 11 | fromJsonArrayV1(JsonUtil::asArray(object, QStringLiteral("versions"))); 12 | else 13 | THROW(UnsupportedVersion, version); 14 | } 15 | 16 | QJsonObject Versions::toJsonObject() const 17 | { 18 | QJsonObject object; 19 | 20 | object.insert(QStringLiteral("version"), QStringLiteral("1")); 21 | object.insert(QStringLiteral("versions"), toJsonArrayV1()); 22 | 23 | return object; 24 | } 25 | 26 | void Versions::fromJsonArrayV1(const QJsonArray &versions) 27 | { 28 | resize(versions.size()); 29 | 30 | for(int i = 0; i < versions.size(); ++i) 31 | { 32 | Version & version = (*this)[i]; 33 | version.fromJsonObjectV1(JsonUtil::asObject(versions[i])); 34 | } 35 | } 36 | 37 | QJsonArray Versions::toJsonArrayV1() const 38 | { 39 | QJsonArray versions; 40 | 41 | for(int i = 0; i < size(); ++i) 42 | { 43 | versions.append(at(i).toJsonObjectV1()); 44 | } 45 | 46 | return versions; 47 | } 48 | -------------------------------------------------------------------------------- /src/common/versions.h: -------------------------------------------------------------------------------- 1 | #ifndef VERSIONS_H 2 | #define VERSIONS_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include "version.h" 8 | 9 | class Versions : public QVector 10 | { 11 | public: 12 | void fromJsonObject(const QJsonObject &object); 13 | QJsonObject toJsonObject() const; 14 | 15 | void fromJsonArrayV1(const QJsonArray &versions); 16 | QJsonArray toJsonArrayV1() const; 17 | }; 18 | 19 | #endif // VERSIONS_H 20 | -------------------------------------------------------------------------------- /src/errors/warning.cpp: -------------------------------------------------------------------------------- 1 | #include "warning.h" 2 | 3 | int WarningMetatypeId = qMetaTypeId(); 4 | 5 | QString Warning::typeString() const 6 | { 7 | switch (type()) { 8 | case OperationPreparation: 9 | return QStringLiteral("OperationPreparation"); 10 | case OperationDownload: 11 | return QStringLiteral("OperationDownload"); 12 | case OperationApply: 13 | return QStringLiteral("OperationApply"); 14 | case RemoveFiles: 15 | return QStringLiteral("RemoveFiles"); 16 | case RemoveDirs: 17 | return QStringLiteral("RemoveDirs"); 18 | case Copy: 19 | return QStringLiteral("Copy"); 20 | case CopyRemove: 21 | return QStringLiteral("CopyRemove"); 22 | case CopyMkPath: 23 | return QStringLiteral("CopyMkPath"); 24 | default: 25 | return QStringLiteral("Unknown"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/operations/adddirectoryoperation.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_AddDirectoryOperation_H 2 | #define UPDATER_AddDirectoryOperation_H 3 | 4 | #include "operation.h" 5 | 6 | class AddDirectoryOperation : public Operation 7 | { 8 | public: 9 | static const QString Action; 10 | virtual FileType fileType() const Q_DECL_OVERRIDE; 11 | void create(const QString &path); 12 | protected: 13 | virtual Status localDataStatus() Q_DECL_OVERRIDE; 14 | virtual void applyData() Q_DECL_OVERRIDE; 15 | virtual QString type() const Q_DECL_OVERRIDE; 16 | }; 17 | 18 | #endif // UPDATER_AddDirectoryOperation_H 19 | -------------------------------------------------------------------------------- /src/operations/addoperation.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_ADDOPERATION_H 2 | #define UPDATER_ADDOPERATION_H 3 | 4 | #include "operation.h" 5 | #include 6 | 7 | class DownloadManager; 8 | class QFile; 9 | 10 | class AddOperation : public Operation 11 | { 12 | public: 13 | AddOperation(); 14 | static const QString Action; 15 | virtual FileType fileType() const Q_DECL_OVERRIDE; 16 | virtual void fromJsonObjectV1(const QJsonObject &object) Q_DECL_OVERRIDE; 17 | void create(const QString &filepath, const QString &newFilename, const QString &tmpDirectory); 18 | protected: 19 | static const QString DataOffset; 20 | static const QString DataSize; 21 | static const QString DataSha1; 22 | static const QString DataCompression; 23 | static const QString FinalSize; 24 | static const QString FinalSha1; 25 | virtual Status localDataStatus() Q_DECL_OVERRIDE; 26 | virtual void applyData() Q_DECL_OVERRIDE; 27 | virtual QString type() const Q_DECL_OVERRIDE; 28 | virtual void fillJsonObjectV1(QJsonObject & object) Q_DECL_OVERRIDE; 29 | void readAll(QIODevice *from, QIODevice *to, QCryptographicHash *hash); 30 | 31 | QString m_compression, m_finalSha1; 32 | qint64 m_finalSize; 33 | }; 34 | 35 | #endif // UPDATER_ADDOPERATION_H 36 | -------------------------------------------------------------------------------- /src/operations/patchoperation.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_PATCHOPERATION_H 2 | #define UPDATER_PATCHOPERATION_H 3 | 4 | #include "addoperation.h" 5 | 6 | class PatchOperation : public AddOperation 7 | { 8 | public: 9 | PatchOperation(); 10 | static const QString Action; 11 | virtual void fromJsonObjectV1(const QJsonObject &object) Q_DECL_OVERRIDE; 12 | void create(const QString &path, const QString &oldFilename, const QString &newFilename, const QString &tmpDirectory); 13 | bool required() const; 14 | protected: 15 | static const QString LocalSize; 16 | static const QString LocalSha1; 17 | static const QString PathType; 18 | virtual Status localDataStatus() Q_DECL_OVERRIDE; 19 | virtual void applyData() Q_DECL_OVERRIDE; 20 | virtual QString type() const Q_DECL_OVERRIDE; 21 | virtual void fillJsonObjectV1(QJsonObject & object) Q_DECL_OVERRIDE; 22 | 23 | QString m_patchtype, m_localSha1; 24 | qint64 m_localSize; 25 | }; 26 | 27 | 28 | #endif // UPDATER_PATCHOPERATION_H 29 | -------------------------------------------------------------------------------- /src/operations/removedirectoryoperation.cpp: -------------------------------------------------------------------------------- 1 | #include "removedirectoryoperation.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | Q_LOGGING_CATEGORY(LOG_RMDIROP, "updatesystem.removedirectoryoperation") 8 | 9 | const QString RemoveDirectoryOperation::Action = QStringLiteral("rmdir"); 10 | 11 | void RemoveDirectoryOperation::create(const QString &path) 12 | { 13 | setPath(path); 14 | } 15 | 16 | Operation::Status RemoveDirectoryOperation::localDataStatus() 17 | { 18 | QFileInfo dirInfo(localFilename()); 19 | if(!dirInfo.isDir()) 20 | { 21 | qCDebug(LOG_RMDIROP) << "Directory " << path() << " was already removed"; 22 | return Valid; 23 | } 24 | 25 | return ApplyRequired; 26 | } 27 | 28 | void RemoveDirectoryOperation::applyData() 29 | { 30 | QFileInfo dirInfo(localFilename()); 31 | if(dirInfo.isDir() && !QDir().rmdir(localFilename())) 32 | { 33 | throwWarning(QObject::tr("Failed to remove directory")); 34 | } 35 | else 36 | { 37 | qCDebug(LOG_RMDIROP) << "Directory removed" << path(); 38 | } 39 | } 40 | 41 | QString RemoveDirectoryOperation::type() const 42 | { 43 | return Action; 44 | } 45 | -------------------------------------------------------------------------------- /src/operations/removedirectoryoperation.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_REMOVEDIRECTORYOPERATION_H 2 | #define UPDATER_REMOVEDIRECTORYOPERATION_H 3 | 4 | #include "operation.h" 5 | 6 | class RemoveDirectoryOperation : public Operation 7 | { 8 | public: 9 | static const QString Action; 10 | void create(const QString &path); 11 | protected: 12 | virtual Status localDataStatus() Q_DECL_OVERRIDE; 13 | virtual void applyData() Q_DECL_OVERRIDE; 14 | virtual QString type() const Q_DECL_OVERRIDE; 15 | }; 16 | 17 | #endif // UPDATER_REMOVEDIRECTORYOPERATION_H 18 | -------------------------------------------------------------------------------- /src/operations/removeoperation.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_REMOVEOPERATION_H 2 | #define UPDATER_REMOVEOPERATION_H 3 | 4 | #include "operation.h" 5 | 6 | class RemoveOperation : public Operation 7 | { 8 | public: 9 | RemoveOperation(); 10 | static const QString Action; 11 | void create(const QString &path, const QString &oldFilename); 12 | virtual void fromJsonObjectV1(const QJsonObject &object) override; 13 | protected: 14 | virtual void fillJsonObjectV1(QJsonObject & object) Q_DECL_OVERRIDE; 15 | virtual Status localDataStatus() Q_DECL_OVERRIDE; 16 | virtual void applyData() Q_DECL_OVERRIDE; 17 | virtual QString type() const Q_DECL_OVERRIDE; 18 | 19 | QString m_localSha1; 20 | qint64 m_localSize; 21 | }; 22 | 23 | #endif // UPDATER_REMOVEOPERATION_H 24 | -------------------------------------------------------------------------------- /src/packager/compressfiletask.h: -------------------------------------------------------------------------------- 1 | #ifndef COMPRESSFILETASK_H 2 | #define COMPRESSFILETASK_H 3 | 4 | #include "taskinfo.h" 5 | #include 6 | 7 | class CompressFileTask : public QRunnable 8 | { 9 | public: 10 | CompressFileTask(TaskInfo * info, const QString &sourceFileName) 11 | { 12 | this->info = info; 13 | this->sourceFilename = sourceFileName; 14 | } 15 | 16 | void run(); 17 | void compress(bool isSourceFinalFile); 18 | protected: 19 | TaskInfo * info; 20 | QString sourceFilename; 21 | }; 22 | 23 | #endif // COMPRESSFILETASK_H 24 | -------------------------------------------------------------------------------- /src/packager/packagertask.h: -------------------------------------------------------------------------------- 1 | #ifndef PACKAGERTASK_H 2 | #define PACKAGERTASK_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | class Operation; 10 | 11 | class PackagerTask : public QObject, public QRunnable 12 | { 13 | Q_OBJECT 14 | public: 15 | enum Type 16 | { 17 | Add, 18 | Patch, 19 | RemoveDir, 20 | RemoveFile, 21 | AddDir 22 | }; 23 | 24 | PackagerTask(Type operationType, QString path, QString oldFilename = QString(), QString newFilename = QString()); 25 | Type operationType; 26 | QString path; 27 | QString oldFilename; 28 | QString newFilename; 29 | QString tmpDirectory; 30 | QString errorString; 31 | QSharedPointer operation; 32 | bool isRunSlow() const; 33 | virtual void run() Q_DECL_OVERRIDE; 34 | signals: 35 | void done(); 36 | private: 37 | Q_DISABLE_COPY(PackagerTask) 38 | }; 39 | 40 | #endif // PACKAGERTASK_H 41 | -------------------------------------------------------------------------------- /src/packager/patchfiletask.h: -------------------------------------------------------------------------------- 1 | #ifndef PATCHFILETASK_H 2 | #define PATCHFILETASK_H 3 | 4 | #include "compressfiletask.h" 5 | 6 | class PatchFileTask : public CompressFileTask 7 | { 8 | public: 9 | PatchFileTask(TaskInfo * info, const QString &sourceFileName, const QString &oldFilename, const QString &tmpFilename) : CompressFileTask(info, sourceFileName) 10 | { 11 | this->tmpFilename = tmpFilename; 12 | this->oldFilename = oldFilename; 13 | } 14 | 15 | void run(); 16 | protected: 17 | QString tmpFilename, oldFilename; 18 | }; 19 | 20 | #endif // PATCHFILETASK_H 21 | -------------------------------------------------------------------------------- /src/packager/taskinfo.cpp: -------------------------------------------------------------------------------- 1 | #include "taskinfo.h" 2 | -------------------------------------------------------------------------------- /src/packager/taskinfo.h: -------------------------------------------------------------------------------- 1 | #ifndef TASKINFO_H 2 | #define TASKINFO_H 3 | 4 | #include 5 | 6 | struct TaskInfo 7 | { 8 | Exception exception; 9 | QJsonObject description; 10 | QString destinationFileName; 11 | }; 12 | 13 | #endif // TASKINFO_H 14 | -------------------------------------------------------------------------------- /src/qtupdatesystem_global.h: -------------------------------------------------------------------------------- 1 | #ifndef QTUPDATESYSTEM_GLOBAL_H 2 | #define QTUPDATESYSTEM_GLOBAL_H 3 | 4 | #include 5 | 6 | #if defined(QTUPDATESYSTEM_LIBRARY) 7 | # define QTUPDATESYSTEMSHARED_EXPORT Q_DECL_EXPORT 8 | #else 9 | # define QTUPDATESYSTEMSHARED_EXPORT Q_DECL_IMPORT 10 | #endif 11 | 12 | #endif // QTUPDATESYSTEM_GLOBAL_H 13 | -------------------------------------------------------------------------------- /src/tools/brotli.h: -------------------------------------------------------------------------------- 1 | #ifndef QTBROTLI_H 2 | #define QTBROTLI_H 3 | 4 | #include 5 | 6 | QIODevice * BrotliCompressor(QIODevice *source, quint32 quality = 9, quint32 lgwin = 0, QObject *parent = nullptr); 7 | QIODevice * BrotliDecompressor(QIODevice *source, QObject *parent = nullptr); 8 | 9 | #endif // QTBROTLI_H 10 | -------------------------------------------------------------------------------- /src/tools/lzma.h: -------------------------------------------------------------------------------- 1 | #ifndef QTLZMA_H 2 | #define QTLZMA_H 3 | 4 | #include 5 | 6 | QIODevice * LZMACompressor(QIODevice *source, quint32 preset = 9, QObject *parent = nullptr); 7 | QIODevice * LZMADecompressor(QIODevice *source, QObject *parent = nullptr); 8 | 9 | #endif // QTLZMA_H 10 | -------------------------------------------------------------------------------- /src/tools/xdelta3.h: -------------------------------------------------------------------------------- 1 | #ifndef QTXDELTA3_H 2 | #define QTXDELTA3_H 3 | 4 | #include 5 | 6 | QIODevice *XDelta3(QIODevice *source, QIODevice *base, bool encode, QObject *parent = nullptr); 7 | 8 | #endif // QTXDELTA3_H 9 | -------------------------------------------------------------------------------- /src/updater/copythread.h: -------------------------------------------------------------------------------- 1 | #ifndef COPYTHREAD_H 2 | #define COPYTHREAD_H 3 | 4 | #include "../errors/warning.h" 5 | #include "localrepository.h" 6 | #include 7 | #include 8 | #include 9 | 10 | 11 | class CopyThread : public QThread 12 | { 13 | Q_OBJECT 14 | public: 15 | CopyThread(const LocalRepository &sourceRepository, const QString &destinationDir, QObject *parent = 0); 16 | 17 | signals: 18 | void warning(const Warning &warning); 19 | void progression(int copiedFileCount, int totalFileCount); 20 | void copyFinished(const QString &errorString); 21 | 22 | protected: 23 | void run() Q_DECL_OVERRIDE; 24 | 25 | private: 26 | LocalRepository m_sourceRepository; 27 | QString m_destinationDir; 28 | 29 | }; 30 | 31 | #endif // COPYTHREAD_H 32 | -------------------------------------------------------------------------------- /src/updater/filemanager.cpp: -------------------------------------------------------------------------------- 1 | #include "filemanager.h" 2 | #include "../operations/operation.h" 3 | 4 | FileManager::FileManager(QObject *parent) : 5 | QObject(parent) 6 | { 7 | } 8 | 9 | FileManager::~FileManager() 10 | { 11 | 12 | } 13 | 14 | void FileManager::prepareOperation(QSharedPointer operation) 15 | { 16 | operation->setWarningListener([=] (const QString &message) { 17 | EMIT_WARNING(OperationPreparation, message, operation); 18 | }); 19 | operation->checkLocalData(); 20 | emit operationPrepared(operation); 21 | } 22 | 23 | void FileManager::applyOperation(QSharedPointer operation) 24 | { 25 | operation->apply(); 26 | emit operationApplied(operation); 27 | } 28 | 29 | void FileManager::downloadFinished() 30 | { 31 | emit applyFinished(); 32 | } 33 | -------------------------------------------------------------------------------- /src/updater/filemanager.h: -------------------------------------------------------------------------------- 1 | #ifndef UPDATER_FILEMANAGER_H 2 | #define UPDATER_FILEMANAGER_H 3 | 4 | #include "../errors/warning.h" 5 | 6 | #include 7 | #include 8 | 9 | class Operation; 10 | 11 | class FileManager : public QObject 12 | { 13 | Q_OBJECT 14 | public: 15 | explicit FileManager(QObject *parent = 0); 16 | ~FileManager(); 17 | 18 | signals: 19 | void operationPrepared(QSharedPointer operation); 20 | void operationApplied(QSharedPointer operation); 21 | void applyFinished(); 22 | void warning(const Warning &warning); 23 | 24 | public slots: 25 | void prepareOperation(QSharedPointer operation); 26 | void applyOperation(QSharedPointer operation); 27 | void downloadFinished(); 28 | }; 29 | 30 | #endif // UPDATER_FILEMANAGER_H 31 | -------------------------------------------------------------------------------- /src/updater/oneobjectthread.h: -------------------------------------------------------------------------------- 1 | #ifndef ONEOBJECTTHREAD_H 2 | #define ONEOBJECTTHREAD_H 3 | 4 | #include 5 | 6 | class OneObjectThread : public QThread 7 | { 8 | Q_OBJECT 9 | public: 10 | OneObjectThread(QObject * parent = 0) : QThread(parent) 11 | { 12 | m_time = 200; 13 | } 14 | 15 | void manage(QObject *object) 16 | { 17 | object->moveToThread(this); 18 | connect(this, &OneObjectThread::destroying, object, &QObject::deleteLater); 19 | connect(object, &QObject::destroyed, [this]() { 20 | quit(); 21 | }); 22 | connect(this, &QThread::finished, this, &QThread::deleteLater); 23 | } 24 | 25 | void setMaxWaitTime(unsigned long time) 26 | { 27 | m_time = time; 28 | } 29 | 30 | ~OneObjectThread() 31 | { 32 | emit destroying(); 33 | wait(m_time); 34 | } 35 | signals: 36 | void destroying(); 37 | private: 38 | unsigned long m_time; 39 | }; 40 | 41 | #endif // ONEOBJECTTHREAD_H 42 | -------------------------------------------------------------------------------- /tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../src) 2 | add_definitions(-DSRCDIR="${CMAKE_CURRENT_LIST_DIR}/") 3 | find_package(Qt5Test) 4 | 5 | add_executable(tests 6 | main.cpp 7 | testutils.cpp 8 | testutils.h 9 | tst_packager.cpp 10 | tst_packager.h 11 | tst_repository.cpp 12 | tst_repository.h 13 | tst_updatechain.cpp 14 | tst_updatechain.h 15 | tst_updater.cpp 16 | tst_updater.h 17 | ) 18 | target_link_libraries(tests QtUpdateSystem) 19 | target_link_libraries(tests Qt5::Core) 20 | target_link_libraries(tests Qt5::Test) 21 | 22 | -------------------------------------------------------------------------------- /tests/data/repo_v1_rev1/complete_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/tests/data/repo_v1_rev1/complete_1 -------------------------------------------------------------------------------- /tests/data/repo_v1_rev1/current: -------------------------------------------------------------------------------- 1 | { 2 | "current": { 3 | "description": "", 4 | "revision": "1" 5 | }, 6 | "version": "1" 7 | } 8 | -------------------------------------------------------------------------------- /tests/data/repo_v1_rev1/packages: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "from": "", 5 | "size": "3637", 6 | "to": "1" 7 | }, 8 | { 9 | "from": "1", 10 | "size": "1642", 11 | "to": "2" 12 | } 13 | ], 14 | "version": "1" 15 | } 16 | -------------------------------------------------------------------------------- /tests/data/repo_v1_rev1/patch1_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/tests/data/repo_v1_rev1/patch1_2 -------------------------------------------------------------------------------- /tests/data/repo_v1_rev1/versions: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "versions": [ 4 | { 5 | "description": "", 6 | "revision": "1" 7 | }, 8 | { 9 | "description": "", 10 | "revision": "2" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/data/repo_v1_rev2/complete_1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/tests/data/repo_v1_rev2/complete_1 -------------------------------------------------------------------------------- /tests/data/repo_v1_rev2/current: -------------------------------------------------------------------------------- 1 | { 2 | "current": { 3 | "description": "", 4 | "revision": "2" 5 | }, 6 | "version": "1" 7 | } 8 | -------------------------------------------------------------------------------- /tests/data/repo_v1_rev2/packages: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "from": "", 5 | "size": "3637", 6 | "to": "1" 7 | }, 8 | { 9 | "from": "1", 10 | "size": "1642", 11 | "to": "2" 12 | } 13 | ], 14 | "version": "1" 15 | } 16 | -------------------------------------------------------------------------------- /tests/data/repo_v1_rev2/patch1_2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/tests/data/repo_v1_rev2/patch1_2 -------------------------------------------------------------------------------- /tests/data/repo_v1_rev2/versions: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "versions": [ 4 | { 5 | "description": "", 6 | "revision": "1" 7 | }, 8 | { 9 | "description": "", 10 | "revision": "2" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/data/repository_add/expected/current: -------------------------------------------------------------------------------- 1 | { 2 | "current": { 3 | "description": "", 4 | "revision": "REV2" 5 | }, 6 | "version": "1" 7 | } 8 | -------------------------------------------------------------------------------- /tests/data/repository_add/expected/packages: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "from": "", 5 | "size": "3637", 6 | "to": "REV1" 7 | }, 8 | { 9 | "from": "REV1", 10 | "size": "1241", 11 | "to": "REV2" 12 | } 13 | ], 14 | "version": "1" 15 | } 16 | -------------------------------------------------------------------------------- /tests/data/repository_add/expected/versions: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "versions": [ 4 | { 5 | "description": "", 6 | "revision": "REV1" 7 | }, 8 | { 9 | "description": "", 10 | "revision": "REV2" 11 | } 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /tests/data/repository_add/init/current: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "current": { 4 | "description": "", 5 | "revision": "REV1" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/data/repository_add/init/packages: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | { 4 | "from": "", 5 | "size": "3637", 6 | "to": "REV1" 7 | } 8 | ], 9 | "version": "1" 10 | } 11 | -------------------------------------------------------------------------------- /tests/data/repository_add/init/patchREV1_REV2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Speedy37/QtUpdateSystem/9a3aea96acba3e672e4f14522758615d0af46071/tests/data/repository_add/init/patchREV1_REV2 -------------------------------------------------------------------------------- /tests/data/repository_add/init/versions: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "versions": [ 4 | { 5 | "description": "", 6 | "revision": "REV1" 7 | } 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /tests/data/repository_new/packages: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | ], 4 | "version": "1" 5 | } 6 | -------------------------------------------------------------------------------- /tests/data/repository_new/versions: -------------------------------------------------------------------------------- 1 | { 2 | "version": "1", 3 | "versions": [ 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /tests/data/rev1/rmfile.txt: -------------------------------------------------------------------------------- 1 | Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec laoreet ante at elit consequat interdum. Ut porta, nunc ut varius ultrices, leo justo mollis sem, sit amet aliquam mauris velit sit amet ante. Duis non metus elit. Ut a arcu sed orci accumsan consectetur eget non purus. Quisque consequat bibendum elementum. Ut laoreet lorem sapien, nec ultricies lacus placerat at. Nulla sem nulla, consectetur luctus mattis a, iaculis non nunc. Etiam nunc elit, rutrum eu fringilla non, sagittis et enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer iaculis nibh luctus nisi accumsan, quis tempus mauris malesuada. Proin pharetra vestibulum nibh, et ornare diam fringilla at. Proin malesuada placerat rhoncus. Suspendisse magna massa, rhoncus eu lectus eget, fringilla posuere nibh. Donec velit purus, interdum molestie dui a, consequat semper lacus. Aenean pulvinar leo ac porttitor malesuada. 2 | 3 | Suspendisse non purus vel justo laoreet faucibus. Duis nunc dolor, vehicula ut nunc in, rhoncus semper est. Integer pulvinar turpis ipsum, ac vehicula arcu posuere nec. Duis eget dui elementum, sodales velit a, ultrices quam. Cras egestas est euismod, scelerisque tortor eu, condimentum turpis. Aliquam vel tincidunt neque. Pellentesque nisi tellus, tincidunt eget augue eget, dignissim placerat velit. -------------------------------------------------------------------------------- /tests/data/rev1_local/status.json: -------------------------------------------------------------------------------- 1 | { 2 | "DirList": [ 3 | "dirs/empty_dir2", 4 | "empty_dir", 5 | "dirs", 6 | "dir2" 7 | ], 8 | "FileList": [ 9 | "dir2/patch_same.txt", 10 | "path_diff2.txt", 11 | "path_diff.txt", 12 | "rmfile.txt" 13 | ], 14 | "Revision": "1", 15 | "UpdateInProgress": false, 16 | "version": "1" 17 | } 18 | -------------------------------------------------------------------------------- /tests/data/rev2/add.txt: -------------------------------------------------------------------------------- 1 | Lool -------------------------------------------------------------------------------- /tests/data/rev2/empty_dir: -------------------------------------------------------------------------------- 1 | Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam eu ligula sit amet tellus auctor mattis non eu tellus. Mauris ultrices, neque a suscipit pretium, nulla nunc scelerisque eros, vitae molestie turpis tellus in lacus. Cras sapien lectus, laoreet id volutpat ac, mattis vel est. Suspendisse vehicula sem commodo pharetra luctus. Pellentesque massa nunc, interdum a fringilla adipiscing, gravida vitae nisl. In cursus turpis in fringilla suscipit. Praesent id enim magna. Duis congue vitae enim eu pretium. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. -------------------------------------------------------------------------------- /tests/data/updater_copy/init_repo/add.txt: -------------------------------------------------------------------------------- 1 | Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec laoreet ante at elit consequat interdum. Ut porta, nunc ut varius ultrices, leo justo mollis sem, sit amet aliquam mauris velit sit amet ante. Duis non metus elit. Ut a arcu sed orci accumsan consectetur eget non purus. Quisque consequat bibendum elementum. Ut laoreet lorem sapien, nec ultricies lacus placerat at. Nulla sem nulla, consectetur luctus mattis a, iaculis non nunc. Etiam nunc elit, rutrum eu fringilla non, sagittis et enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer iaculis nibh luctus nisi accumsan, quis tempus mauris malesuada. Proin pharetra vestibulum nibh, et ornare diam fringilla at. Proin malesuada placerat rhoncus. Suspendisse magna massa, rhoncus eu lectus eget, fringilla posuere nibh. Donec velit purus, interdum molestie dui a, consequat semper lacus. Aenean pulvinar leo ac porttitor malesuada. 2 | 3 | Suspendisse non purus vel justo laoreet faucibus. Duis nunc dolor, vehicula ut nunc in, rhoncus semper est. Integer pulvinar turpis ipsum, ac vehicula arcu posuere nec. Duis eget dui elementum, sodales velit a, ultrices quam. Cras egestas est euismod, scelerisque tortor eu, condimentum turpis. Aliquam vel tincidunt neque. Pellentesque nisi tellus, tincidunt eget augue eget, dignissim placerat velit. -------------------------------------------------------------------------------- /tests/data/updater_copy/init_repo/status.json: -------------------------------------------------------------------------------- 1 | { 2 | "DirList": [], 3 | "FileList": [ 4 | "add.txt" 5 | ], 6 | "Revision": "1", 7 | "version": "1" 8 | } 9 | -------------------------------------------------------------------------------- /tests/data/updater_copy/local_repo/status.json: -------------------------------------------------------------------------------- 1 | { 2 | "DirList": [], 3 | "FileList": [ 4 | "rmfile.txt", 5 | "path_diff2.txt", 6 | "patch_same.txt", 7 | "path_diff.txt" 8 | ], 9 | "Revision": "1", 10 | "version": "1" 11 | } 12 | -------------------------------------------------------------------------------- /tests/data/updater_isManaged/status.json: -------------------------------------------------------------------------------- 1 | { 2 | "DirList": [ 3 | "dirs/empty_dir2", 4 | "empty_dir", 5 | "dirs", 6 | "dir2" 7 | ], 8 | "FileList": [ 9 | "rmfile.txt", 10 | "path_diff2.txt", 11 | "patch_same.txt", 12 | "path_diff.txt" 13 | ], 14 | "Revision": "1", 15 | "version": "1" 16 | } 17 | -------------------------------------------------------------------------------- /tests/testutils.h: -------------------------------------------------------------------------------- 1 | #ifndef TESTUTILS_H 2 | #define TESTUTILS_H 3 | 4 | #include 5 | 6 | #define FORCED_CLEANUP {\ 7 | bool oldValue = TestUtils::cleanup;\ 8 | TestUtils::cleanup = true;\ 9 | cleanupTestCase();\ 10 | TestUtils::cleanup = oldValue;\ 11 | }\ 12 | 13 | class TestUtils 14 | { 15 | public: 16 | static bool cleanup; 17 | static void assertFileEquals(const QString &file1, const QString &file2); 18 | static bool compareJson(const QString &file1, const QString &file2, bool expectParseError = false); 19 | }; 20 | 21 | 22 | const QString testDir = QString(SRCDIR); 23 | const QString dataDir = QString(SRCDIR) + "data"; 24 | 25 | #endif // TESTUTILS_H 26 | -------------------------------------------------------------------------------- /tests/tst_packager.h: -------------------------------------------------------------------------------- 1 | #ifndef TST_PACKAGER_H 2 | #define TST_PACKAGER_H 3 | 4 | #include 5 | 6 | class TestPackager : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | TestPackager() {} 12 | 13 | private Q_SLOTS: 14 | void initTestCase(); 15 | void createPatch(); 16 | void createComplete(); 17 | void cleanupTestCase(); 18 | }; 19 | 20 | #endif // TST_PACKAGER_H 21 | -------------------------------------------------------------------------------- /tests/tst_repository.h: -------------------------------------------------------------------------------- 1 | #ifndef TST_PACKAGEMANAGER_H 2 | #define TST_PACKAGEMANAGER_H 3 | 4 | #include 5 | 6 | class TestRepository : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | TestRepository() {} 12 | 13 | private Q_SLOTS: 14 | void initTestCase(); 15 | void newRepository(); 16 | void addPackage(); 17 | void fixRepository(); 18 | void cleanupTestCase(); 19 | }; 20 | 21 | #endif // TST_PACKAGEMANAGER_H 22 | -------------------------------------------------------------------------------- /tests/tst_updatechain.h: -------------------------------------------------------------------------------- 1 | #ifndef TST_UPDATECHAIN_H 2 | #define TST_UPDATECHAIN_H 3 | 4 | #include 5 | 6 | class TestUpdateChain : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | TestUpdateChain() {} 11 | 12 | private Q_SLOTS: 13 | void initTestCase(); 14 | void newRepository(); 15 | void updateToV1(); 16 | void createPatchV1toV2(); 17 | void updateToV2(); 18 | void fallbackToV1(); 19 | void updateToV2WithFailures(); 20 | void cleanupTestCase(); 21 | void integrityCheck(); 22 | }; 23 | 24 | #endif // TST_UPDATECHAIN_H 25 | -------------------------------------------------------------------------------- /tests/tst_updater.h: -------------------------------------------------------------------------------- 1 | #ifndef TST_UPDATER_H 2 | #define TST_UPDATER_H 3 | 4 | #include 5 | 6 | class TestUpdater : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | TestUpdater() {} 11 | 12 | private Q_SLOTS: 13 | void initTestCase(); 14 | void updaterCopy(); 15 | void updaterIsManaged(); 16 | void updaterRemoveOtherFiles(); 17 | void updateToV1(); 18 | void updateToV2(); 19 | void cleanupTestCase(); 20 | }; 21 | 22 | #endif // TST_UPDATER_H 23 | -------------------------------------------------------------------------------- /utils/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory (packager) 2 | add_subdirectory (repository) 3 | add_subdirectory (updater) 4 | -------------------------------------------------------------------------------- /utils/packager/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../../src) 2 | add_executable(packager main.cpp) 3 | target_link_libraries(packager QtUpdateSystem) 4 | target_link_libraries(packager Qt5::Core) 5 | -------------------------------------------------------------------------------- /utils/repository/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../../src) 2 | add_executable(repository main.cpp) 3 | target_link_libraries(repository QtUpdateSystem) 4 | target_link_libraries(repository Qt5::Core) 5 | -------------------------------------------------------------------------------- /utils/updater/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories(../../src) 2 | add_executable(updater main.cpp) 3 | target_link_libraries(updater QtUpdateSystem) 4 | target_link_libraries(updater Qt5::Core) 5 | --------------------------------------------------------------------------------