├── .gitignore ├── .gitmodules ├── ADL_SDK ├── .gitignore └── readme.txt ├── API.class ├── API.java ├── COPYING ├── MCast.class ├── MCast.java ├── Makefile.am ├── README.md ├── adl.c ├── adl.h ├── adl_functions.h ├── algorithm.c ├── algorithm.h ├── algorithm ├── animecoin.c ├── animecoin.h ├── bitblock.c ├── bitblock.h ├── blake256.c ├── blake256.h ├── blakecoin.c ├── blakecoin.h ├── cn-aes-tbls.h ├── credits.c ├── credits.h ├── cryptonight.c ├── cryptonight.h ├── darkcoin.c ├── darkcoin.h ├── equihash.c ├── equihash.h ├── eth-sha3.c ├── eth-sha3.h ├── ethash.c ├── ethash.h ├── ethgencache.c ├── fresh.c ├── fresh.h ├── fuguecoin.c ├── fuguecoin.h ├── groestlcoin.c ├── groestlcoin.h ├── inkcoin.c ├── inkcoin.h ├── lbry.c ├── lbry.h ├── lyra2.c ├── lyra2.h ├── lyra2Z.c ├── lyra2Z.h ├── lyra2h.c ├── lyra2h.h ├── lyra2re.c ├── lyra2re.h ├── lyra2rev2.c ├── lyra2rev2.h ├── marucoin.c ├── marucoin.h ├── maxcoin.c ├── maxcoin.h ├── mtp_algo.c ├── mtp_algo.h ├── myriadcoin-groestl.c ├── myriadcoin-groestl.h ├── neoscrypt.c ├── neoscrypt.h ├── pluck.c ├── pluck.h ├── quarkcoin.c ├── quarkcoin.h ├── qubitcoin.c ├── qubitcoin.h ├── scrypt.c ├── scrypt.h ├── sifcoin.c ├── sifcoin.h ├── sponge.c ├── sponge.h ├── sysendian.h ├── talkcoin.c ├── talkcoin.h ├── twecoin.c ├── twecoin.h ├── whirlcoin.c ├── whirlcoin.h ├── whirlpoolx.c ├── whirlpoolx.h ├── x14.c ├── x14.h ├── yescrypt-opt.c ├── yescrypt.c ├── yescrypt.h ├── yescrypt_core.h └── yescryptcommon.c ├── api-example.c ├── api-example.php ├── api-example.py ├── api.c ├── api.h ├── arg-nonnull.h ├── argon2ref ├── argon2.c ├── argon2.h ├── blake2-impl.h ├── blake2.h ├── blake2b-load-sse2.h ├── blake2b-load-sse41.h ├── blake2b-round.h ├── blake2ba.c ├── blamka-round-opt.h ├── blamka-round-ref.h ├── core.c ├── core.h ├── encoding.c ├── encoding.h ├── ref.c ├── thread.c └── thread.h ├── authors.md ├── autogen.sh ├── bench_block.h ├── c++defs.h ├── ccan ├── Makefile.am ├── compiler │ ├── LICENSE │ ├── _info │ ├── compiler.h │ └── test │ │ ├── compile_fail-printf.c │ │ └── run-is_compile_constant.c ├── opt │ ├── LICENSE │ ├── _info │ ├── helpers.c │ ├── opt.c │ ├── opt.h │ ├── parse.c │ ├── private.h │ ├── test │ │ ├── compile_ok-const-arg.c │ │ ├── run-checkopt.c │ │ ├── run-correct-reporting.c │ │ ├── run-helpers.c │ │ ├── run-iter.c │ │ ├── run-no-options.c │ │ ├── run-usage.c │ │ ├── run.c │ │ ├── utils.c │ │ └── utils.h │ └── usage.c └── typesafe_cb │ ├── LICENSE │ ├── _info │ ├── test │ ├── compile_fail-cast_if_type-promotable.c │ ├── compile_fail-typesafe_cb-int.c │ ├── compile_fail-typesafe_cb.c │ ├── compile_fail-typesafe_cb_cast-multi.c │ ├── compile_fail-typesafe_cb_cast.c │ ├── compile_fail-typesafe_cb_postargs.c │ ├── compile_fail-typesafe_cb_preargs.c │ ├── compile_ok-typesafe_cb-NULL.c │ ├── compile_ok-typesafe_cb-undefined.c │ ├── compile_ok-typesafe_cb-vars.c │ ├── compile_ok-typesafe_cb_cast.c │ └── run.c │ └── typesafe_cb.h ├── compat.h ├── config_parser.c ├── config_parser.h ├── configure.ac ├── doc ├── API.md ├── BUGS.md ├── FAQ.md ├── GPU.md ├── MINING.md ├── coding.md ├── configuration.md ├── cygwin-build.txt ├── kernel.md └── windows-build.txt ├── driver-opencl.c ├── driver-opencl.h ├── elist.h ├── events.c ├── events.h ├── example.conf ├── findnonce.c ├── findnonce.h ├── gbt-util.c ├── gbt-util.h ├── hexdump.c ├── kernel ├── aes_helper.cl ├── alexkarnew.cl ├── alexkarold.cl ├── animecoin.cl ├── arebyp.cl ├── bitblock.cl ├── bitblockold.cl ├── blake.cl ├── blake256.cl ├── blake256r14.cl ├── blake256r8.cl ├── bmw.cl ├── bmw256.cl ├── bufius.cl ├── ckolivas.cl ├── credits.cl ├── cryptonight.cl ├── cubehash.cl ├── cubehash256.cl ├── darkcoin-mod.cl ├── darkcoin.cl ├── diamond.cl ├── echo.cl ├── equihash-param.h ├── equihash.cl ├── ethash-genoil.cl ├── ethash-new.cl ├── ethash.cl ├── fresh.cl ├── fugue.cl ├── fuguecoin.cl ├── groestl.cl ├── groestl256.cl ├── groestlcoin-v1.cl ├── groestlcoin.cl ├── hamsi.cl ├── hamsi_helper.cl ├── hamsi_helper_big.cl ├── inkcoin.cl ├── jh.cl ├── keccak.cl ├── keccak1600.cl ├── luffa.cl ├── lyra2.cl ├── lyra2Z.cl ├── lyra2h.cl ├── lyra2re.cl ├── lyra2rev2.cl ├── lyra2v16.cl ├── lyra2v16h.cl ├── lyra2v2.cl ├── marucoin-mod.cl ├── marucoin-modold.cl ├── marucoin.cl ├── maxcoin.cl ├── mtp.cl ├── mtp_nvidia.cl ├── mtp_vega.cl ├── myriadcoin-groestl.cl ├── neoscrypt.cl ├── panama.cl ├── pluck.cl ├── psw.cl ├── quarkcoin.cl ├── qubitcoin.cl ├── shabal.cl ├── shavite.cl ├── sifcoin.cl ├── simd.cl ├── skein.cl ├── skein256.cl ├── talkcoin-mod.cl ├── twecoin.cl ├── vanilla.cl ├── whirlcoin.cl ├── whirlpool.cl ├── whirlpoolx.cl ├── wolf-aes.cl ├── wolf-skein.cl ├── x14.cl ├── x14old.cl ├── yescrypt-multi.cl ├── yescrypt.cl ├── yescrypt_essential.cl └── zuikkis.cl ├── lib ├── Makefile.am ├── dummy.c ├── memchr.c ├── memchr.valgrind ├── memmem.c ├── sig-handler.h ├── sigaction.c ├── signal.in.h ├── sigprocmask.c ├── stddef.in.h ├── stdint.in.h ├── str-two-way.h └── string.in.h ├── logging.c ├── logging.h ├── m4 ├── 00gnulib.m4 ├── extensions.m4 ├── gnulib-cache.m4 ├── gnulib-common.m4 ├── gnulib-comp.m4 ├── gnulib-tool.m4 ├── include_next.m4 ├── longlong.m4 ├── memchr.m4 ├── memmem.m4 ├── mmap-anon.m4 ├── multiarch.m4 ├── onceonly.m4 ├── sigaction.m4 ├── signal_h.m4 ├── signalblocking.m4 ├── stddef_h.m4 ├── stdint.m4 ├── string_h.m4 ├── warn-on-use.m4 └── wchar_t.m4 ├── man └── sgminer.1 ├── merkletree ├── LICENSE ├── README.md ├── byteswap.h ├── definition.h ├── endian.h ├── merkle-tree.cpp ├── merkle-tree.cpp_old ├── merkle-tree.hpp ├── merkle-tree.hpp_old ├── mtp.cpp ├── mtp.h ├── prevector.h └── zeroafterfree.h ├── miner.h ├── miner.php ├── mknsis.sh ├── ocl.c ├── ocl.h ├── ocl ├── binary_kernel.c ├── binary_kernel.h ├── build_kernel.c └── build_kernel.h ├── pool.c ├── pool.h ├── roadmap.md ├── sgminer.c ├── sha2.c ├── sha2.h ├── sph ├── Makefile.am ├── aes_helper.c ├── blake.c ├── bmw.c ├── cubehash.c ├── echo.c ├── fugue.c ├── groestl.c ├── hamsi.c ├── hamsi_helper.c ├── jh.c ├── keccak.c ├── luffa.c ├── md_helper.c ├── panama.c ├── ripemd.c ├── sha2.c ├── sha256_Y.c ├── sha256_Y.h ├── sha2big.c ├── shabal.c ├── shavite.c ├── simd.c ├── skein.c ├── sph_blake.h ├── sph_bmw.h ├── sph_cubehash.h ├── sph_echo.h ├── sph_fugue.h ├── sph_groestl.h ├── sph_hamsi.h ├── sph_jh.h ├── sph_keccak.h ├── sph_luffa.h ├── sph_panama.h ├── sph_ripemd.h ├── sph_sha2.h ├── sph_shabal.h ├── sph_shavite.h ├── sph_simd.h ├── sph_skein.h ├── sph_types.h ├── sph_whirlpool.h └── whirlpool.c ├── submodules ├── Makefile.am └── jansson │ ├── .gitignore │ ├── .travis.yml │ ├── Android.mk │ ├── CHANGES │ ├── CMakeLists.txt │ ├── CleanSpec.mk │ ├── LICENSE │ ├── Makefile.am │ ├── README.rst │ ├── android │ └── jansson_config.h │ ├── appveyor.yml │ ├── cmake │ ├── CheckFunctionKeywords.cmake │ ├── FindSphinx.cmake │ ├── JanssonConfig.cmake.in │ ├── JanssonConfigVersion.cmake.in │ ├── jansson_config.h.cmake │ └── jansson_private_config.h.cmake │ ├── configure.ac │ ├── doc │ ├── .gitignore │ ├── Makefile.am │ ├── README │ ├── apiref.rst │ ├── changes.rst │ ├── conf.py │ ├── conformance.rst │ ├── ext │ │ └── refcounting.py │ ├── gettingstarted.rst │ ├── github_commits.c │ ├── index.rst │ ├── portability.rst │ ├── tutorial.rst │ └── upgrading.rst │ ├── jansson.pc.in │ ├── release.sh │ ├── src │ ├── Makefile.am │ ├── bos_deserializer.c │ ├── bos_serializer.c │ ├── bosjansson.def │ ├── bosjansson.h │ ├── configure.ac │ ├── dump.c │ ├── error.c │ ├── hashtable.c │ ├── hashtable.h │ ├── hashtable_seed.c │ ├── jansson.def │ ├── jansson.h │ ├── jansson_config.h.in │ ├── jansson_private.h │ ├── jansson_private_config.h │ ├── load.c │ ├── lookup3.h │ ├── memory.c │ ├── pack_unpack.c │ ├── strbuffer.c │ ├── strbuffer.h │ ├── strconv.c │ ├── utf.c │ ├── utf.h │ └── value.c │ └── test │ ├── .gitignore │ ├── Makefile.am │ ├── bin │ ├── Makefile.am │ └── json_process.c │ ├── run-suites │ ├── scripts │ ├── run-tests.sh │ └── valgrind.sh │ └── suites │ ├── .gitattributes │ ├── Makefile.am │ ├── api │ ├── Makefile.am │ ├── check-exports │ ├── run │ ├── test_array.c │ ├── test_copy.c │ ├── test_dump.c │ ├── test_dump_callback.c │ ├── test_equal.c │ ├── test_load.c │ ├── test_load_callback.c │ ├── test_loadb.c │ ├── test_memory_funcs.c │ ├── test_number.c │ ├── test_object.c │ ├── test_pack.c │ ├── test_simple.c │ ├── test_unpack.c │ └── util.h │ ├── encoding-flags │ ├── array │ │ ├── input │ │ └── output │ ├── compact-array │ │ ├── env │ │ ├── input │ │ └── output │ ├── compact-object │ │ ├── env │ │ ├── input │ │ └── output │ ├── ensure-ascii │ │ ├── env │ │ ├── input │ │ └── output │ ├── indent-array │ │ ├── env │ │ ├── input │ │ └── output │ ├── indent-compact-array │ │ ├── env │ │ ├── input │ │ └── output │ ├── indent-compact-object │ │ ├── env │ │ ├── input │ │ └── output │ ├── indent-object │ │ ├── env │ │ ├── input │ │ └── output │ ├── object │ │ ├── env │ │ ├── input │ │ └── output │ ├── preserve-order │ │ ├── env │ │ ├── input │ │ └── output │ ├── real-precision │ │ ├── env │ │ ├── input │ │ └── output │ ├── run │ └── sort-keys │ │ ├── env │ │ ├── input │ │ └── output │ ├── invalid-unicode │ ├── encoded-surrogate-half │ │ ├── error │ │ └── input │ ├── invalid-utf-8-after-backslash │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-array │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-bigger-int │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-escape │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-exponent │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-identifier │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-int │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-real-after-e │ │ ├── error │ │ └── input │ ├── invalid-utf-8-in-string │ │ ├── error │ │ └── input │ ├── lone-invalid-utf-8 │ │ ├── error │ │ └── input │ ├── lone-utf-8-continuation-byte │ │ ├── error │ │ └── input │ ├── not-in-unicode-range │ │ ├── error │ │ └── input │ ├── overlong-3-byte-encoding │ │ ├── error │ │ └── input │ ├── overlong-4-byte-encoding │ │ ├── error │ │ └── input │ ├── overlong-ascii-encoding │ │ ├── error │ │ └── input │ ├── restricted-utf-8 │ │ ├── error │ │ └── input │ ├── run │ └── truncated-utf-8 │ │ ├── error │ │ └── input │ ├── invalid │ ├── apostrophe │ │ ├── error │ │ └── input │ ├── ascii-unicode-identifier │ │ ├── error │ │ └── input │ ├── brace-comma │ │ ├── error │ │ └── input │ ├── bracket-comma │ │ ├── error │ │ └── input │ ├── bracket-one-comma │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── empty │ │ ├── error │ │ └── input │ ├── extra-comma-in-array │ │ ├── error │ │ └── input │ ├── extra-comma-in-multiline-array │ │ ├── error │ │ └── input │ ├── garbage-after-newline │ │ ├── error │ │ └── input │ ├── garbage-at-the-end │ │ ├── error │ │ └── input │ ├── integer-starting-with-zero │ │ ├── error │ │ └── input │ ├── invalid-escape │ │ ├── error │ │ └── input │ ├── invalid-identifier │ │ ├── error │ │ └── input │ ├── invalid-negative-integer │ │ ├── error │ │ └── input │ ├── invalid-negative-real │ │ ├── error │ │ └── input │ ├── invalid-second-surrogate │ │ ├── error │ │ └── input │ ├── lone-open-brace │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── lone-open-bracket │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── lone-second-surrogate │ │ ├── error │ │ └── input │ ├── minus-sign-without-number │ │ ├── error │ │ └── input │ ├── negative-integer-starting-with-zero │ │ ├── error │ │ └── input │ ├── null-byte-in-object-key │ │ ├── error │ │ └── input │ ├── null-byte-in-string │ │ ├── error │ │ ├── input │ │ └── nostrip │ ├── null-byte-outside-string │ │ ├── error │ │ ├── input │ │ └── nostrip │ ├── null │ │ ├── error │ │ └── input │ ├── object-apostrophes │ │ ├── error │ │ └── input │ ├── object-garbage-at-end │ │ ├── error │ │ └── input │ ├── object-in-unterminated-array │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── object-no-colon │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── object-no-value │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── object-unterminated-value │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── real-garbage-after-e │ │ ├── error │ │ └── input │ ├── real-negative-overflow │ │ ├── error │ │ └── input │ ├── real-positive-overflow │ │ ├── error │ │ └── input │ ├── real-truncated-at-e │ │ ├── error │ │ └── input │ ├── real-truncated-at-point │ │ ├── error │ │ └── input │ ├── run │ ├── tab-character-in-string │ │ ├── error │ │ └── input │ ├── too-big-negative-integer │ │ ├── error │ │ └── input │ ├── too-big-positive-integer │ │ ├── error │ │ └── input │ ├── truncated-unicode-surrogate │ │ ├── error │ │ └── input │ ├── unicode-identifier │ │ ├── error │ │ └── input │ ├── unterminated-array-and-object │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── unterminated-array │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── unterminated-empty-key │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── unterminated-key │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ ├── unterminated-object-and-array │ │ ├── error │ │ └── input │ └── unterminated-string │ │ ├── error.normal │ │ ├── error.strip │ │ └── input │ └── valid │ ├── complex-array │ ├── env │ ├── input │ └── output │ ├── empty-array │ ├── input │ └── output │ ├── empty-object-in-array │ ├── input │ └── output │ ├── empty-object │ ├── input │ └── output │ ├── empty-string │ ├── input │ └── output │ ├── escaped-utf-control-char │ ├── input │ └── output │ ├── false │ ├── input │ └── output │ ├── negative-int │ ├── input │ └── output │ ├── negative-one │ ├── input │ └── output │ ├── negative-zero │ ├── input │ └── output │ ├── null │ ├── input │ └── output │ ├── one-byte-utf-8 │ ├── input │ └── output │ ├── real-capital-e-negative-exponent │ ├── input │ └── output │ ├── real-capital-e-positive-exponent │ ├── input │ └── output │ ├── real-capital-e │ ├── input │ └── output │ ├── real-exponent │ ├── input │ └── output │ ├── real-fraction-exponent │ ├── input │ └── output │ ├── real-negative-exponent │ ├── input │ └── output │ ├── real-positive-exponent │ ├── input │ └── output │ ├── real-subnormal-number │ ├── input │ └── output │ ├── real-underflow │ ├── input │ └── output │ ├── run │ ├── short-string │ ├── input │ └── output │ ├── simple-ascii-string │ ├── input │ └── output │ ├── simple-int-0 │ ├── input │ └── output │ ├── simple-int-1 │ ├── input │ └── output │ ├── simple-int-123 │ ├── input │ └── output │ ├── simple-object │ ├── input │ └── output │ ├── simple-real │ ├── input │ └── output │ ├── string-escapes │ ├── input │ └── output │ ├── three-byte-utf-8 │ ├── input │ └── output │ ├── true │ ├── input │ └── output │ ├── two-byte-utf-8 │ ├── input │ └── output │ ├── utf-8-string │ ├── input │ └── output │ └── utf-surrogate-four-byte-encoding │ ├── input │ └── output ├── sysfs-gpu-controls.c ├── sysfs-gpu-controls.h ├── test.bat ├── tools └── update_changelog.sh ├── uint256.h ├── uthash.h ├── util.c ├── util.h ├── warn-on-use.h └── winbuild ├── MakefileBuild.vc ├── README.txt ├── dist ├── dll │ ├── x64 │ │ └── OpenCL.dll │ └── x86 │ │ └── OpenCL.dll ├── include │ ├── CL │ │ ├── cl.h │ │ ├── cl.hpp │ │ ├── cl_d3d10.h │ │ ├── cl_d3d11.h │ │ ├── cl_dx9_media_sharing.h │ │ ├── cl_ext.h │ │ ├── cl_gl.h │ │ ├── cl_gl_ext.h │ │ ├── cl_platform.h │ │ └── opencl.h │ ├── config.h │ ├── curl │ │ ├── curl.h │ │ ├── curlbuild.h │ │ ├── curlrules.h │ │ ├── curlver.h │ │ ├── easy.h │ │ ├── mprintf.h │ │ ├── multi.h │ │ ├── stdcheaders.h │ │ └── typecheck-gcc.h │ ├── curses.h │ ├── gitversion.h │ ├── inttypes.h │ ├── jansson_config.h │ ├── jansson_private_config.h │ ├── libgen.h │ ├── pthread.h │ ├── sched.h │ ├── semaphore.h │ ├── stdbool.h │ ├── sys │ │ └── time.h │ ├── unistd.h │ └── winbuild.h └── lib │ ├── x64 │ ├── OpenCL.lib │ ├── libcurl_a.lib │ ├── pdcurses.lib │ ├── pthreadVC2.lib │ └── zlibstat.lib │ └── x86 │ ├── OpenCL.lib │ ├── libcurl_a.lib │ ├── libeay32MT.lib │ ├── libeay32MTd.lib │ ├── panel.lib │ ├── pdcurses.lib │ ├── pthreadVC2.lib │ ├── ssleay32MT.lib │ ├── ssleay32MTd.lib │ └── zlibstat.lib ├── jansson ├── Debug │ ├── x64 │ │ └── jansson.lib │ └── x86 │ │ └── jansson.lib ├── Makefile.am ├── Release │ └── x64 │ │ └── jansson.lib ├── bos_deserializer.c ├── bos_serializer.c ├── bosjansson.def ├── bosjansson.h ├── configure.ac ├── dump.c ├── error.c ├── hashtable.c ├── hashtable.h ├── hashtable_seed.c ├── jansson.def ├── jansson.h ├── jansson.vcxproj ├── jansson.vcxproj.filters ├── jansson_config.h ├── jansson_config.h.in ├── jansson_private.h ├── jansson_private_config.h ├── load.c ├── lookup3.h ├── memory.c ├── pack_unpack.c ├── src │ ├── Makefile.am │ ├── bos_deserializer.c │ ├── bos_serializer.c │ ├── bosjansson.def │ ├── bosjansson.h │ ├── configure.ac │ ├── dump.c │ ├── error.c │ ├── hashtable.c │ ├── hashtable.h │ ├── hashtable_seed.c │ ├── jansson.def │ ├── jansson.h │ ├── jansson_config.h │ ├── jansson_config.h.in │ ├── jansson_private.h │ ├── jansson_private_config.h │ ├── load.c │ ├── lookup3.h │ ├── memory.c │ ├── pack_unpack.c │ ├── strbuffer.c │ ├── strbuffer.h │ ├── strconv.c │ ├── utf.c │ ├── utf.h │ └── value.c ├── strbuffer.c ├── strbuffer.h ├── strconv.c ├── utf.c ├── utf.h └── value.c ├── output └── x64 │ └── Release │ ├── kernel │ ├── aes_helper.cl │ ├── alexkarnew.cl │ ├── alexkarold.cl │ ├── animecoin.cl │ ├── arebyp.cl │ ├── bitblock.cl │ ├── bitblockold.cl │ ├── blake.cl │ ├── blake256.cl │ ├── blake256r14.cl │ ├── blake256r8.cl │ ├── bmw.cl │ ├── bmw256.cl │ ├── bufius.cl │ ├── ckolivas.cl │ ├── credits.cl │ ├── cryptonight.cl │ ├── cubehash.cl │ ├── cubehash256.cl │ ├── darkcoin-mod.cl │ ├── darkcoin.cl │ ├── diamond.cl │ ├── echo.cl │ ├── equihash-param.h │ ├── equihash.cl │ ├── ethash-genoil.cl │ ├── ethash-new.cl │ ├── ethash.cl │ ├── fresh.cl │ ├── fugue.cl │ ├── fuguecoin.cl │ ├── groestl.cl │ ├── groestl256.cl │ ├── groestlcoin-v1.cl │ ├── groestlcoin.cl │ ├── hamsi.cl │ ├── hamsi_helper.cl │ ├── hamsi_helper_big.cl │ ├── inkcoin.cl │ ├── jh.cl │ ├── keccak.cl │ ├── keccak1600.cl │ ├── luffa.cl │ ├── lyra2.cl │ ├── lyra2Z.cl │ ├── lyra2h.cl │ ├── lyra2re.cl │ ├── lyra2rev2.cl │ ├── lyra2v16.cl │ ├── lyra2v16h.cl │ ├── lyra2v2.cl │ ├── marucoin-mod.cl │ ├── marucoin-modold.cl │ ├── marucoin.cl │ ├── maxcoin.cl │ ├── mtp.cl │ ├── mtp_nvidia.cl │ ├── mtp_vega.cl │ ├── myriadcoin-groestl.cl │ ├── neoscrypt.cl │ ├── panama.cl │ ├── pluck.cl │ ├── psw.cl │ ├── quarkcoin.cl │ ├── qubitcoin.cl │ ├── shabal.cl │ ├── shavite.cl │ ├── sifcoin.cl │ ├── simd.cl │ ├── skein.cl │ ├── skein256.cl │ ├── talkcoin-mod.cl │ ├── twecoin.cl │ ├── vanilla.cl │ ├── whirlcoin.cl │ ├── whirlpool.cl │ ├── whirlpoolx.cl │ ├── wolf-aes.cl │ ├── wolf-skein.cl │ ├── x14.cl │ ├── x14old.cl │ ├── yescrypt-multi.cl │ ├── yescrypt.cl │ ├── yescrypt_essential.cl │ └── zuikkis.cl │ ├── sgminer.conf │ ├── sgminer.exp │ ├── sgminer.lib │ ├── sgminer.zip │ └── test.bat ├── sgminer.sln ├── sgminer.vcxproj ├── sgminer.vcxproj.filters └── sgminer.vcxproj.user /.gitignore: -------------------------------------------------------------------------------- 1 | cgminer 2 | cgminer.exe 3 | minerd 4 | minerd.exe 5 | *.o 6 | *.lo 7 | *.bin 8 | *.db 9 | *.opendb 10 | 11 | autom4te.cache 12 | .deps 13 | 14 | Makefile 15 | Makefile.in 16 | INSTALL 17 | aclocal.m4 18 | configure 19 | depcomp 20 | missing 21 | install-sh 22 | stamp-h1 23 | cpuminer-config.h* 24 | compile 25 | config.log 26 | config.status 27 | config.guess 28 | config.sub 29 | 30 | mingw32-config.cache 31 | 32 | *~ 33 | 34 | ext_deps 35 | config.h.in 36 | config.h 37 | 38 | ccan/libccan.a 39 | lib/arg-nonnull.h 40 | lib/c++defs.h 41 | lib/libgnu.a 42 | lib/signal.h 43 | lib/string.h 44 | lib/stdint.h 45 | lib/warn-on-use.h 46 | 47 | mkinstalldirs 48 | 49 | *.swp 50 | *.opendb 51 | *.db 52 | 53 | *.db 54 | winbuild/.vs/sgminer/v14/.suo 55 | *.obj 56 | *.log 57 | *.pdb 58 | *.tlog 59 | *.ipdb 60 | *.iobj 61 | *.exe 62 | *.idb 63 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "jansson"] 2 | path = submodules/jansson 3 | url = https://github.com/akheron/jansson.git 4 | -------------------------------------------------------------------------------- /ADL_SDK/.gitignore: -------------------------------------------------------------------------------- 1 | adl_defines.h 2 | adl_sdk.h 3 | adl_structures.h 4 | -------------------------------------------------------------------------------- /ADL_SDK/readme.txt: -------------------------------------------------------------------------------- 1 | Please insert AMD ADL files adl_defines.h adl_sdk.h adl_structures.h here. 2 | 3 | They can be found at 4 | http://developer.amd.com/tools-and-sdks/graphics-development/display-library-adl-sdk/ 5 | -------------------------------------------------------------------------------- /API.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/API.class -------------------------------------------------------------------------------- /MCast.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/MCast.class -------------------------------------------------------------------------------- /adl.h: -------------------------------------------------------------------------------- 1 | #ifndef ADL_H 2 | #define ADL_H 3 | 4 | extern bool adl_active; 5 | extern bool opt_reorder; 6 | extern int opt_hysteresis; 7 | extern int opt_targettemp; 8 | extern int opt_overheattemp; 9 | 10 | #ifdef HAVE_ADL 11 | 12 | void init_adl(int nDevs); 13 | float adl_gpu_temp(int gpu); 14 | int adl_gpu_engineclock(int gpu); 15 | int adl_gpu_memclock(int gpu); 16 | float adl_gpu_vddc(int gpu); 17 | int adl_gpu_activity(int gpu); 18 | int adl_gpu_fanspeed(int gpu); 19 | float adl_gpu_fanpercent(int gpu); 20 | int adl_set_powertune(int gpu, int iPercentage); 21 | bool adl_gpu_stats(int gpu, float *temp, int *engineclock, int *memclock, float *vddc, 22 | int *activity, int *fanspeed, int *fanpercent, int *powertune); 23 | void change_gpusettings(int gpu); 24 | void adl_gpu_autotune(int gpu, enum dev_enable *denable); 25 | void clear_adl(int nDevs); 26 | 27 | #else /* HAVE_ADL */ 28 | 29 | #define adl_active (0) 30 | static inline void init_adl(__maybe_unused int nDevs) {} 31 | static inline void change_gpusettings(__maybe_unused int gpu) { } 32 | static inline void clear_adl(__maybe_unused int nDevs) {} 33 | 34 | #endif /* HAVE_ADL */ 35 | 36 | #endif /* ADL_H */ 37 | -------------------------------------------------------------------------------- /algorithm/animecoin.h: -------------------------------------------------------------------------------- 1 | #ifndef ANIMECOIN_H 2 | #define ANIMECOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int animecoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void animecoin_regenhash(struct work *work); 9 | 10 | #endif /* ANIMECOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/bitblock.h: -------------------------------------------------------------------------------- 1 | #ifndef BITBLOCK_H 2 | #define BITBLOCK_H 3 | 4 | #include "miner.h" 5 | 6 | extern int bitblock_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void bitblock_regenhash(struct work *work); 9 | 10 | #endif /* BITBLOCK_H */ 11 | -------------------------------------------------------------------------------- /algorithm/blake256.h: -------------------------------------------------------------------------------- 1 | #ifndef BLAKE256_H 2 | #define BLAKE256_H 3 | 4 | #include "miner.h" 5 | 6 | extern int blake256_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 7 | extern void precalc_hash_blake256(dev_blk_ctx *blk, uint32_t *state, uint32_t *pdata); 8 | extern void blake256_regenhash(struct work *work); 9 | 10 | #endif /* BLAKE256_H */ -------------------------------------------------------------------------------- /algorithm/blakecoin.h: -------------------------------------------------------------------------------- 1 | #ifndef BLAKECOIN_H 2 | #define BLAKECOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int blakecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 7 | extern void precalc_hash_blakecoin(dev_blk_ctx *blk, uint32_t *state, uint32_t *data); 8 | extern void blakecoin_regenhash(struct work *work); 9 | 10 | #endif /* BLAKECOIN_H */ -------------------------------------------------------------------------------- /algorithm/credits.h: -------------------------------------------------------------------------------- 1 | #ifndef CREDITS_H 2 | #define CREDITS_H 3 | 4 | #include "miner.h" 5 | 6 | 7 | extern int credits_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 8 | extern void credits_regenhash(struct work *work); 9 | 10 | #endif /* CREDITS_H */ 11 | -------------------------------------------------------------------------------- /algorithm/cryptonight.h: -------------------------------------------------------------------------------- 1 | #ifndef __CRYPTONIGHT_H 2 | #define __CRYPTONIGHT_H 3 | 4 | typedef struct _CryptonightCtx 5 | { 6 | uint64_t State[25]; 7 | uint64_t Scratchpad[1 << 18]; 8 | } CryptonightCtx; 9 | 10 | void cryptonight_regenhash(struct work *work); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /algorithm/darkcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef DARKCOIN_H 2 | #define DARKCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int darkcoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void darkcoin_regenhash(struct work *work); 9 | 10 | #endif /* DARKCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/equihash.h: -------------------------------------------------------------------------------- 1 | #ifndef __EQUIHASH_H 2 | #define __EQUIHASH_H 3 | 4 | #include 5 | #include "miner.h" 6 | #include "kernel/equihash-param.h" 7 | 8 | uint32_t equihash_verify_sol(struct work *work, sols_t *sols, int sol_i); 9 | void equihash_calc_mid_hash(uint64_t[8], uint8_t*); 10 | void equihash_regenhash(struct work *work); 11 | int64_t equihash_scanhash(struct thr_info *thr, struct work *work, int64_t *last_nonce, int64_t __maybe_unused max_nonce); 12 | 13 | #endif // __EQUIHASH_H 14 | -------------------------------------------------------------------------------- /algorithm/eth-sha3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | //#include "compiler.h" 8 | #include 9 | #include 10 | 11 | struct ethash_h256; 12 | 13 | #define decsha3(bits) \ 14 | int sha3_##bits(uint8_t*, size_t, uint8_t const*, size_t); 15 | 16 | decsha3(256) 17 | decsha3(512) 18 | 19 | static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t const size) 20 | { 21 | sha3_256((uint8_t*)ret, 32, data, size); 22 | } 23 | 24 | static inline void SHA3_512(uint8_t* ret, uint8_t const* data, size_t const size) 25 | { 26 | sha3_512(ret, 64, data, size); 27 | } 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /algorithm/ethgencache.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "miner.h" 4 | #include "sph/sph_keccak.h" 5 | #include "algorithm/ethash.h" 6 | #include "algorithm/eth-sha3.h" 7 | 8 | typedef union node 9 | { 10 | uint8_t bytes[16 * 4]; 11 | uint32_t words[16]; 12 | uint64_t double_words[16 / 2]; 13 | } node; 14 | 15 | // Output (cache_nodes) MUST have at least cache_size bytes 16 | static void EthGenerateCache(uint8_t *cache_nodes_in, const uint8_t *seedhash, uint64_t cache_size) 17 | { 18 | uint32_t const num_nodes = (uint32_t)(cache_size / sizeof(node)); 19 | node *cache_nodes = (node *)cache_nodes_in; 20 | 21 | SHA3_512(cache_nodes[0].bytes, seedhash, 32); 22 | 23 | for(uint32_t i = 1; i != num_nodes; ++i) { 24 | SHA3_512(cache_nodes[i].bytes, cache_nodes[i - 1].bytes, 64); 25 | } 26 | 27 | for(uint32_t j = 0; j < 3; j++) { // this one can be unrolled entirely, ETHASH_CACHE_ROUNDS is constant 28 | for(uint32_t i = 0; i != num_nodes; i++) { 29 | uint32_t const idx = cache_nodes[i].words[0] % num_nodes; 30 | node data; 31 | data = cache_nodes[(num_nodes - 1 + i) % num_nodes]; 32 | for(uint32_t w = 0; w != 16; ++w) { // this one can be unrolled entirely as well 33 | data.words[w] ^= cache_nodes[idx].words[w]; 34 | } 35 | 36 | SHA3_512(cache_nodes[i].bytes, data.bytes, sizeof(data)); 37 | } 38 | } 39 | } 40 | 41 | 42 | void eth_gen_cache(struct pool *pool) { 43 | size_t cache_size = EthGetCacheSize(pool->eth_cache.current_epoch); 44 | pool->eth_cache.dag_cache = (uint8_t*)realloc(pool->eth_cache.dag_cache, cache_size); 45 | EthGenerateCache(pool->eth_cache.dag_cache, pool->eth_cache.seed_hash, cache_size); 46 | } 47 | -------------------------------------------------------------------------------- /algorithm/fresh.h: -------------------------------------------------------------------------------- 1 | #ifndef FRESHH_H 2 | #define FRESHH_H 3 | 4 | #include "miner.h" 5 | 6 | extern int fresh_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 7 | extern void fresh_regenhash(struct work *work); 8 | 9 | #endif /* FRESHH_H */ -------------------------------------------------------------------------------- /algorithm/fuguecoin.h: -------------------------------------------------------------------------------- 1 | #ifndef FUGUECOIN_H 2 | #define FUGUECOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int fuguecoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void fuguecoin_regenhash(struct work *work); 9 | 10 | #endif /* FUGUECOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/groestlcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef GROESTLCOIN_H 2 | #define GROESTLCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int groestlcoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void groestlcoin_regenhash(struct work *work); 9 | 10 | #endif /* GROESTLCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/inkcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef INKCOIN_H 2 | #define INKCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int inkcoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void inkcoin_regenhash(struct work *work); 9 | 10 | #endif /* INKCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/lbry.h: -------------------------------------------------------------------------------- 1 | #ifndef LBRY_H 2 | #define LBRY_H 3 | 4 | #include "miner.h" 5 | 6 | extern void lbry_regenhash(struct work *work); 7 | extern void precalc_hash_sha256(dev_blk_ctx *blk, uint32_t *state, uint32_t *pdata); 8 | #endif 9 | -------------------------------------------------------------------------------- /algorithm/lyra2Z.h: -------------------------------------------------------------------------------- 1 | #ifndef LYRA2Z_H 2 | #define LYRA2Z_H 3 | 4 | #include "miner.h" 5 | //#define LYRA2Z_SCRATCHBUF_SIZE (24576) // matrix size [12][4][4] uint64_t or equivalent 6 | #define LYRA2Z_SCRATCHBUF_SIZE (12*8*8) 7 | // #define LYRA_SCRATCHBUF_SIZE (1536) 8 | #define LYRA_SECBUF_SIZE (4) // (not used) 9 | extern int lyra2Z_test(unsigned char *pdata, const unsigned char *ptarget, 10 | uint32_t nonce); 11 | extern void lyra2Z_regenhash(struct work *work); 12 | 13 | #endif /* LYRA2REV2_H */ 14 | -------------------------------------------------------------------------------- /algorithm/lyra2h.h: -------------------------------------------------------------------------------- 1 | #ifndef LYRA2H_H 2 | #define LYRA2H_H 3 | 4 | #include "miner.h" 5 | //#define LYRA2H_SCRATCHBUF_SIZE (24576) // matrix size [12][16][16] uint64_t or equivalent 6 | #define LYRA2H_SCRATCHBUF_SIZE (12*16*16) 7 | // #define LYRA_SCRATCHBUF_SIZE (1536) 8 | #define LYRA_SECBUF_SIZE (4) // (not used) 9 | extern int lyra2h_test(unsigned char *pdata, const unsigned char *ptarget, 10 | uint32_t nonce); 11 | extern void lyra2h_regenhash(struct work *work); 12 | 13 | #endif /* LYRA2H_H */ 14 | -------------------------------------------------------------------------------- /algorithm/lyra2re.h: -------------------------------------------------------------------------------- 1 | #ifndef LYRA2RE_H 2 | #define LYRA2RE_H 3 | 4 | #include "miner.h" 5 | 6 | extern int lyra2re_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void lyra2re_regenhash(struct work *work); 9 | 10 | #endif /* LYRA2RE_H */ 11 | -------------------------------------------------------------------------------- /algorithm/lyra2rev2.h: -------------------------------------------------------------------------------- 1 | #ifndef LYRA2REV2_H 2 | #define LYRA2REV2_H 3 | 4 | #include "miner.h" 5 | #define LYRA_SCRATCHBUF_SIZE (1536) // matrix size [12][4][4] uint64_t or equivalent 6 | #define LYRA_SECBUF_SIZE (4) // (not used) 7 | extern int lyra2rev2_test(unsigned char *pdata, const unsigned char *ptarget, 8 | uint32_t nonce); 9 | extern void lyra2rev2_regenhash(struct work *work); 10 | 11 | #endif /* LYRA2REV2_H */ 12 | -------------------------------------------------------------------------------- /algorithm/marucoin.h: -------------------------------------------------------------------------------- 1 | #ifndef MARUCOIN_H 2 | #define MARUCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int marucoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void marucoin_regenhash(struct work *work); 9 | 10 | #endif /* MARUCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/maxcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef MAXCOIN_H 2 | #define MAXCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | // extern int maxcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 7 | extern void maxcoin_regenhash(struct work *work); 8 | 9 | #endif /* MAXCOIN_H */ 10 | -------------------------------------------------------------------------------- /algorithm/mtp_algo.h: -------------------------------------------------------------------------------- 1 | #ifndef MTP_ALGO_H 2 | #define MTP_ALGO_H 3 | 4 | #include "miner.h" 5 | #define MTP_MEMCOST 4*1024*1024 6 | #define MTP_SCRATCH 256 * MTP_MEMCOST * 4 7 | #define MTP_TREE_SIZE 2 * 1048576 * 4 * 8 8 | 9 | //#define LYRA2H_SCRATCHBUF_SIZE (24576) // matrix size [12][16][16] uint64_t or equivalent 10 | #define LYRA2H_SCRATCHBUF_SIZE (12*16*16) 11 | // #define LYRA_SCRATCHBUF_SIZE (1536) 12 | #define LYRA_SECBUF_SIZE (4) // (not used) 13 | extern int mtp_test(unsigned char *pdata, const unsigned char *ptarget, 14 | uint32_t nonce); 15 | extern void mtp_regenhash(struct work *work); 16 | 17 | #endif /* LYRA2H_H */ 18 | -------------------------------------------------------------------------------- /algorithm/myriadcoin-groestl.h: -------------------------------------------------------------------------------- 1 | #ifndef MYRIADCOIN_GROESTL_H 2 | #define MYRIADCOIN_GROESTL_H 3 | 4 | #include "miner.h" 5 | 6 | extern int myriadcoin_groestl_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void myriadcoin_groestl_regenhash(struct work *work); 9 | 10 | #endif /* MYRIADCOIN_GROESTL_H */ 11 | -------------------------------------------------------------------------------- /algorithm/neoscrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef NEOSCRYPT_H 2 | #define NEOSCRYPT_H 3 | 4 | #include "miner.h" 5 | 6 | /* The neoscrypt scratch buffer needs 32kBytes memory. */ 7 | #define NEOSCRYPT_SCRATCHBUF_SIZE (32 * 1024) 8 | /* These routines are always available. */ 9 | extern void neoscrypt_regenhash(struct work *work); 10 | extern void neoscrypt(const unsigned char *input, unsigned char *output, unsigned int profile); 11 | 12 | #endif /* NEOSCRYPT_H */ -------------------------------------------------------------------------------- /algorithm/pluck.h: -------------------------------------------------------------------------------- 1 | #ifndef PLUCK_H 2 | #define PLUCK_H 3 | 4 | #include "miner.h" 5 | #define PLUCK_SCRATCHBUF_SIZE (128 * 1024) 6 | #define PLUCK_SECBUF_SIZE (64 * 1024) 7 | 8 | extern int pluck_test(unsigned char *pdata, const unsigned char *ptarget, 9 | uint32_t nonce); 10 | extern void pluck_regenhash(struct work *work); 11 | 12 | #endif /* PLUCK_H */ 13 | -------------------------------------------------------------------------------- /algorithm/quarkcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef QUARKCOIN_H 2 | #define QUARKCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int quarkcoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void quarkcoin_regenhash(struct work *work); 9 | 10 | #endif /* QUARKCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/qubitcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef QUBITCOIN_H 2 | #define QUBITCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int qubitcoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void qubitcoin_regenhash(struct work *work); 9 | 10 | #endif /* QUBITCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/scrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef SCRYPT_H 2 | #define SCRYPT_H 3 | 4 | #include "miner.h" 5 | 6 | /* extern int scrypt_test(unsigned char *pdata, const unsigned char *ptarget, */ 7 | /* uint32_t nonce); */ 8 | extern void scrypt_regenhash(struct work *work); 9 | 10 | #endif /* SCRYPT_H */ 11 | -------------------------------------------------------------------------------- /algorithm/sifcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef SIFCOIN_H 2 | #define SIFCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int sifcoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void sifcoin_regenhash(struct work *work); 9 | 10 | #endif /* SIFCOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/talkcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef TALKCOIN_H 2 | #define TALKCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int talkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 7 | extern void talkcoin_regenhash(struct work *work); 8 | 9 | #endif /* TALKCOIN_H */ 10 | -------------------------------------------------------------------------------- /algorithm/twecoin.h: -------------------------------------------------------------------------------- 1 | #ifndef TWECOIN_H 2 | #define TWECOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int twecoin_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void twecoin_regenhash(struct work *work); 9 | 10 | #endif /* TWECOIN_H */ 11 | -------------------------------------------------------------------------------- /algorithm/whirlcoin.h: -------------------------------------------------------------------------------- 1 | #ifndef WHIRLCOIN_H 2 | #define WHIRLCOIN_H 3 | 4 | #include "miner.h" 5 | 6 | extern int whirlcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 7 | extern void whirlcoin_regenhash(struct work *work); 8 | 9 | #endif /* W_H */ -------------------------------------------------------------------------------- /algorithm/x14.h: -------------------------------------------------------------------------------- 1 | #ifndef X14_H 2 | #define X14_H 3 | 4 | #include "miner.h" 5 | 6 | extern int x14_test(unsigned char *pdata, const unsigned char *ptarget, 7 | uint32_t nonce); 8 | extern void x14_regenhash(struct work *work); 9 | 10 | #endif /* X14_H */ -------------------------------------------------------------------------------- /algorithm/yescrypt.h: -------------------------------------------------------------------------------- 1 | #ifndef YESCRYPT_H 2 | #define YESCRYPT_H 3 | 4 | #include "miner.h" 5 | #define YESCRYPT_SCRATCHBUF_SIZE (128 * 2048 * 8 ) //uchar 6 | #define YESCRYP_SECBUF_SIZE (128*64*8) 7 | extern int yescrypt_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t nonce); 8 | extern void yescrypt_regenhash(struct work *work); 9 | 10 | #endif /* YESCRYPT_H */ 11 | -------------------------------------------------------------------------------- /api-example.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2.7 2 | 3 | # Copyright 2013 Setkeh Mkfr 4 | # 5 | # This program is free software; you can redistribute it and/or modify it under 6 | # the terms of the GNU General Public License as published by the Free Software 7 | # Foundation; either version 3 of the License, or (at your option) any later 8 | # version. See COPYING for more details. 9 | 10 | #Short Python Example for connecting to The sgminer API 11 | #Written By: setkeh 12 | #Thanks to Jezzz for all his Support. 13 | #NOTE: When adding a param with a pipe | in bash or ZSH you must wrap the arg in quotes 14 | #E.G "pga|0" 15 | 16 | import socket 17 | import json 18 | import sys 19 | 20 | def linesplit(socket): 21 | buffer = socket.recv(4096) 22 | done = False 23 | while not done: 24 | more = socket.recv(4096) 25 | if not more: 26 | done = True 27 | else: 28 | buffer = buffer+more 29 | if buffer: 30 | return buffer 31 | 32 | api_command = sys.argv[1].split('|') 33 | 34 | if len(sys.argv) < 3: 35 | api_ip = '127.0.0.1' 36 | api_port = 4028 37 | else: 38 | api_ip = sys.argv[2] 39 | api_port = sys.argv[3] 40 | 41 | s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) 42 | s.connect((api_ip,int(api_port))) 43 | if len(api_command) == 2: 44 | s.send(json.dumps({"command":api_command[0],"parameter":api_command[1]})) 45 | else: 46 | s.send(json.dumps({"command":api_command[0]})) 47 | 48 | response = linesplit(s) 49 | response = response.replace('\x00','') 50 | response = json.loads(response) 51 | print response 52 | s.close() 53 | -------------------------------------------------------------------------------- /arg-nonnull.h: -------------------------------------------------------------------------------- 1 | /* A C macro for declaring that specific arguments must not be NULL. 2 | Copyright (C) 2009-2011 Free Software Foundation, Inc. 3 | 4 | This program is free software: you can redistribute it and/or modify it 5 | under the terms of the GNU General Public License as published 6 | by the Free Software Foundation; either version 3 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 GNU 12 | General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . */ 16 | 17 | /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools 18 | that the values passed as arguments n, ..., m must be non-NULL pointers. 19 | n = 1 stands for the first argument, n = 2 for the second argument etc. */ 20 | #ifndef _GL_ARG_NONNULL 21 | # if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3 22 | # define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params)) 23 | # else 24 | # define _GL_ARG_NONNULL(params) 25 | # endif 26 | #endif 27 | -------------------------------------------------------------------------------- /argon2ref/thread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Argon2 reference source code package - reference C implementations 3 | * 4 | * Copyright 2015 5 | * Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves 6 | * 7 | * You may use this work under the terms of a Creative Commons CC0 1.0 8 | * License/Waiver or the Apache Public License 2.0, at your option. The terms of 9 | * these licenses can be found at: 10 | * 11 | * - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 12 | * - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * You should have received a copy of both of these licenses along with this 15 | * software. If not, they may be obtained at the above URLs. 16 | */ 17 | 18 | #if !defined(ARGON2_NO_THREADS) 19 | 20 | #include "argon2ref/thread.h" 21 | #if defined(_WIN32) 22 | #include 23 | #endif 24 | 25 | int argon2_thread_create(argon2_thread_handle_t *handle, 26 | argon2_thread_func_t func, void *args) { 27 | if (NULL == handle || func == NULL) { 28 | return -1; 29 | } 30 | #if defined(_WIN32) 31 | *handle = _beginthreadex(NULL, 0, func, args, 0, NULL); 32 | return *handle != 0 ? 0 : -1; 33 | #else 34 | return pthread_create(handle, NULL, func, args); 35 | #endif 36 | } 37 | 38 | int argon2_thread_join(argon2_thread_handle_t handle) { 39 | #if defined(_WIN32) 40 | if (WaitForSingleObject((HANDLE)handle, INFINITE) == WAIT_OBJECT_0) { 41 | return CloseHandle((HANDLE)handle) != 0 ? 0 : -1; 42 | } 43 | return -1; 44 | #else 45 | return pthread_join(handle, NULL); 46 | #endif 47 | } 48 | 49 | void argon2_thread_exit(void) { 50 | #if defined(_WIN32) 51 | _endthreadex(0); 52 | #else 53 | pthread_exit(NULL); 54 | #endif 55 | } 56 | 57 | #endif /* ARGON2_NO_THREADS */ 58 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | bs_dir="$(dirname $(readlink -f $0))" 3 | 4 | #Some versions of libtoolize don't like there being no ltmain.sh file already 5 | touch "${bs_dir}"/ltmain.sh 6 | autoreconf -fi "${bs_dir}" 7 | -------------------------------------------------------------------------------- /ccan/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libccan.a 2 | 3 | libccan_a_SOURCES = compiler/compiler.h opt/helpers.c opt/opt.c opt/opt.h opt/parse.c opt/private.h opt/usage.c typesafe_cb/typesafe_cb.h 4 | libccan_a_CPPFLAGS = -I$(top_srcdir) 5 | -------------------------------------------------------------------------------- /ccan/compiler/_info: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "config.h" 4 | 5 | /** 6 | * compiler - macros for common compiler extensions 7 | * 8 | * Abstracts away some compiler hints. Currently these include: 9 | * - COLD 10 | * For functions not called in fast paths (aka. cold functions) 11 | * - PRINTF_FMT 12 | * For functions which take printf-style parameters. 13 | * - IDEMPOTENT 14 | * For functions which return the same value for same parameters. 15 | * - NEEDED 16 | * For functions and variables which must be emitted even if unused. 17 | * - UNNEEDED 18 | * For functions and variables which need not be emitted if unused. 19 | * - UNUSED 20 | * For parameters which are not used. 21 | * - IS_COMPILE_CONSTANT 22 | * For using different tradeoffs for compiletime vs runtime evaluation. 23 | * 24 | * License: LGPL (3 or any later version) 25 | * Author: Rusty Russell 26 | * 27 | * Example: 28 | * #include 29 | * #include 30 | * #include 31 | * 32 | * // Example of a (slow-path) logging function. 33 | * static int log_threshold = 2; 34 | * static void COLD PRINTF_FMT(2,3) 35 | * logger(int level, const char *fmt, ...) 36 | * { 37 | * va_list ap; 38 | * va_start(ap, fmt); 39 | * if (level >= log_threshold) 40 | * vfprintf(stderr, fmt, ap); 41 | * va_end(ap); 42 | * } 43 | * 44 | * int main(int argc, char *argv[]) 45 | * { 46 | * if (argc != 1) { 47 | * logger(3, "Don't want %i arguments!\n", argc-1); 48 | * return 1; 49 | * } 50 | * return 0; 51 | * } 52 | */ 53 | int main(int argc, char *argv[]) 54 | { 55 | /* Expect exactly one argument */ 56 | if (argc != 2) 57 | return 1; 58 | 59 | if (strcmp(argv[1], "depends") == 0) { 60 | return 0; 61 | } 62 | 63 | return 1; 64 | } 65 | -------------------------------------------------------------------------------- /ccan/compiler/test/compile_fail-printf.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static void PRINTF_FMT(2,3) my_printf(int x, const char *fmt, ...) 4 | { 5 | } 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | unsigned int i = 0; 10 | 11 | my_printf(1, "Not a pointer " 12 | #ifdef FAIL 13 | "%p", 14 | #if !HAVE_ATTRIBUTE_PRINTF 15 | #error "Unfortunately we don't fail if !HAVE_ATTRIBUTE_PRINTF." 16 | #endif 17 | #else 18 | "%i", 19 | #endif 20 | i); 21 | return 0; 22 | } 23 | -------------------------------------------------------------------------------- /ccan/compiler/test/run-is_compile_constant.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | plan_tests(2); 7 | 8 | ok1(!IS_COMPILE_CONSTANT(argc)); 9 | #if HAVE_BUILTIN_CONSTANT_P 10 | ok1(IS_COMPILE_CONSTANT(7)); 11 | #else 12 | pass("If !HAVE_BUILTIN_CONSTANT_P, IS_COMPILE_CONSTANT always false"); 13 | #endif 14 | return exit_status(); 15 | } 16 | -------------------------------------------------------------------------------- /ccan/opt/_info: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "config.h" 4 | 5 | /** 6 | * opt - simple command line parsing 7 | * 8 | * Simple but powerful command line parsing. 9 | * 10 | * Example: 11 | * #include 12 | * #include 13 | * #include 14 | * 15 | * static bool someflag; 16 | * static int verbose; 17 | * static char *somestring; 18 | * 19 | * static struct opt_table opts[] = { 20 | * OPT_WITHOUT_ARG("--verbose|-v", opt_inc_intval, &verbose, 21 | * "Verbose mode (can be specified more than once)"), 22 | * OPT_WITHOUT_ARG("--someflag", opt_set_bool, &someflag, 23 | * "Set someflag"), 24 | * OPT_WITH_ARG("--somefile=", opt_set_charp, opt_show_charp, 25 | * &somestring, "Set somefile to "), 26 | * OPT_WITHOUT_ARG("--usage|--help|-h", opt_usage_and_exit, 27 | * "args...\nA silly test program.", 28 | * "Print this message."), 29 | * OPT_ENDTABLE 30 | * }; 31 | * 32 | * int main(int argc, char *argv[]) 33 | * { 34 | * int i; 35 | * 36 | * opt_register_table(opts, NULL); 37 | * // For fun, register an extra one. 38 | * opt_register_noarg("--no-someflag", opt_set_invbool, &someflag, 39 | * "Unset someflag"); 40 | * if (!opt_parse(&argc, argv, opt_log_stderr)) 41 | * exit(1); 42 | * 43 | * printf("someflag = %i, verbose = %i, somestring = %s\n", 44 | * someflag, verbose, somestring); 45 | * printf("%u args left over:", argc - 1); 46 | * for (i = 1; i < argc; i++) 47 | * printf(" %s", argv[i]); 48 | * printf("\n"); 49 | * return 0; 50 | * } 51 | * 52 | * License: GPL (2 or any later version) 53 | * Author: Rusty Russell 54 | */ 55 | int main(int argc, char *argv[]) 56 | { 57 | if (argc != 2) 58 | return 1; 59 | 60 | if (strcmp(argv[1], "depends") == 0) { 61 | printf("ccan/typesafe_cb\n"); 62 | printf("ccan/compiler\n"); 63 | return 0; 64 | } 65 | 66 | return 1; 67 | } 68 | -------------------------------------------------------------------------------- /ccan/opt/private.h: -------------------------------------------------------------------------------- 1 | #ifndef CCAN_OPT_PRIVATE_H 2 | #define CCAN_OPT_PRIVATE_H 3 | 4 | extern struct opt_table *opt_table; 5 | extern unsigned int opt_count, opt_num_short, opt_num_short_arg, opt_num_long; 6 | 7 | extern const char *opt_argv0; 8 | 9 | #define subtable_of(entry) ((struct opt_table *)((entry)->names)) 10 | 11 | const char *first_sopt(unsigned *i); 12 | const char *next_sopt(const char *names, unsigned *i); 13 | const char *first_lopt(unsigned *i, unsigned *len); 14 | const char *next_lopt(const char *p, unsigned *i, unsigned *len); 15 | 16 | int parse_one(int *argc, char *argv[], unsigned *offset, 17 | void (*errlog)(const char *fmt, ...)); 18 | 19 | #endif /* CCAN_OPT_PRIVATE_H */ 20 | -------------------------------------------------------------------------------- /ccan/opt/test/compile_ok-const-arg.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | opt_register_noarg("-v", opt_version_and_exit, 10 | (const char *)"1.2.3", 11 | (const char *)"Print version"); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /ccan/opt/test/run-correct-reporting.c: -------------------------------------------------------------------------------- 1 | /* Make sure when multiple equivalent options, correct one is used for errors */ 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "utils.h" 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | plan_tests(12); 14 | 15 | /* --aaa without args. */ 16 | opt_register_arg("-a|--aaa", test_arg, NULL, "aaa", ""); 17 | ok1(!parse_args(&argc, &argv, "--aaa", NULL)); 18 | ok1(strstr(err_output, ": --aaa: requires an argument")); 19 | free(err_output); 20 | err_output = NULL; 21 | ok1(!parse_args(&argc, &argv, "-a", NULL)); 22 | ok1(strstr(err_output, ": -a: requires an argument")); 23 | free(err_output); 24 | err_output = NULL; 25 | 26 | /* Multiple */ 27 | opt_register_arg("--bbb|-b|-c|--ccc", test_arg, NULL, "aaa", ""); 28 | ok1(!parse_args(&argc, &argv, "--bbb", NULL)); 29 | ok1(strstr(err_output, ": --bbb: requires an argument")); 30 | free(err_output); 31 | err_output = NULL; 32 | ok1(!parse_args(&argc, &argv, "-b", NULL)); 33 | ok1(strstr(err_output, ": -b: requires an argument")); 34 | free(err_output); 35 | err_output = NULL; 36 | ok1(!parse_args(&argc, &argv, "-c", NULL)); 37 | ok1(strstr(err_output, ": -c: requires an argument")); 38 | free(err_output); 39 | err_output = NULL; 40 | ok1(!parse_args(&argc, &argv, "--ccc", NULL)); 41 | ok1(strstr(err_output, ": --ccc: requires an argument")); 42 | free(err_output); 43 | err_output = NULL; 44 | 45 | /* parse_args allocates argv */ 46 | free(argv); 47 | return exit_status(); 48 | } 49 | 50 | -------------------------------------------------------------------------------- /ccan/opt/test/run-no-options.c: -------------------------------------------------------------------------------- 1 | /* Make sure we still work with no options registered */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "utils.h" 9 | 10 | int main(int argc, char *argv[]) 11 | { 12 | const char *myname = argv[0]; 13 | 14 | plan_tests(7); 15 | 16 | /* Simple short arg.*/ 17 | ok1(!parse_args(&argc, &argv, "-a", NULL)); 18 | /* Simple long arg.*/ 19 | ok1(!parse_args(&argc, &argv, "--aaa", NULL)); 20 | 21 | /* Extra arguments preserved. */ 22 | ok1(parse_args(&argc, &argv, "extra", "args", NULL)); 23 | ok1(argc == 3); 24 | ok1(argv[0] == myname); 25 | ok1(strcmp(argv[1], "extra") == 0); 26 | ok1(strcmp(argv[2], "args") == 0); 27 | 28 | /* parse_args allocates argv */ 29 | free(argv); 30 | 31 | return exit_status(); 32 | } 33 | 34 | -------------------------------------------------------------------------------- /ccan/opt/test/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef CCAN_OPT_TEST_UTILS_H 2 | #define CCAN_OPT_TEST_UTILS_H 3 | #include 4 | #include 5 | 6 | bool parse_args(int *argc, char ***argv, ...); 7 | extern char *err_output; 8 | void save_err_output(const char *fmt, ...); 9 | 10 | extern unsigned int test_cb_called; 11 | char *test_noarg(void *arg); 12 | char *test_arg(const char *optarg, const char *arg); 13 | void show_arg(char buf[OPT_SHOW_LEN], const char *arg); 14 | 15 | extern struct opt_table short_table[]; 16 | extern struct opt_table long_table[]; 17 | extern struct opt_table long_and_short_table[]; 18 | extern struct opt_table subtables[]; 19 | #endif /* CCAN_OPT_TEST_UTILS_H */ 20 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-cast_if_type-promotable.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void _set_some_value(void *val) 5 | { 6 | } 7 | 8 | #define set_some_value(expr) \ 9 | _set_some_value(typesafe_cb_cast(void *, long, (expr))) 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | #ifdef FAIL 14 | bool x = 0; 15 | #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P 16 | #error "Unfortunately we don't fail if typesafe_cb_cast is a noop." 17 | #endif 18 | #else 19 | long x = 0; 20 | #endif 21 | set_some_value(x); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-typesafe_cb-int.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void _callback(void (*fn)(void *arg), void *arg); 5 | void _callback(void (*fn)(void *arg), void *arg) 6 | { 7 | fn(arg); 8 | } 9 | 10 | /* Callback is set up to warn if arg isn't a pointer (since it won't 11 | * pass cleanly to _callback's second arg. */ 12 | #define callback(fn, arg) \ 13 | _callback(typesafe_cb(void, (fn), (arg)), (arg)) 14 | 15 | void my_callback(int something); 16 | void my_callback(int something) 17 | { 18 | } 19 | 20 | int main(int argc, char *argv[]) 21 | { 22 | #ifdef FAIL 23 | /* This fails due to arg, not due to cast. */ 24 | callback(my_callback, 100); 25 | #endif 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-typesafe_cb.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void _register_callback(void (*cb)(void *arg), void *arg) 5 | { 6 | } 7 | 8 | #define register_callback(cb, arg) \ 9 | _register_callback(typesafe_cb(void, void *, (cb), (arg)), (arg)) 10 | 11 | static void my_callback(char *p) 12 | { 13 | } 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | char str[] = "hello world"; 18 | #ifdef FAIL 19 | int *p; 20 | #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P 21 | #error "Unfortunately we don't fail if typesafe_cb_cast is a noop." 22 | #endif 23 | #else 24 | char *p; 25 | #endif 26 | p = NULL; 27 | 28 | /* This should work always. */ 29 | register_callback(my_callback, str); 30 | 31 | /* This will fail with FAIL defined */ 32 | register_callback(my_callback, p); 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast-multi.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct foo { 5 | int x; 6 | }; 7 | 8 | struct bar { 9 | int x; 10 | }; 11 | 12 | struct baz { 13 | int x; 14 | }; 15 | 16 | struct any { 17 | int x; 18 | }; 19 | 20 | struct other { 21 | int x; 22 | }; 23 | 24 | static void take_any(struct any *any) 25 | { 26 | } 27 | 28 | int main(int argc, char *argv[]) 29 | { 30 | #ifdef FAIL 31 | struct other 32 | #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P 33 | #error "Unfortunately we don't fail if typesafe_cb_cast is a noop." 34 | #endif 35 | #else 36 | struct foo 37 | #endif 38 | *arg = NULL; 39 | take_any(typesafe_cb_cast3(struct any *, 40 | struct foo *, struct bar *, struct baz *, 41 | arg)); 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-typesafe_cb_cast.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void _set_some_value(void *val); 4 | 5 | void _set_some_value(void *val) 6 | { 7 | } 8 | 9 | #define set_some_value(expr) \ 10 | _set_some_value(typesafe_cb_cast(void *, unsigned long, (expr))) 11 | 12 | int main(int argc, char *argv[]) 13 | { 14 | #ifdef FAIL 15 | int x = 0; 16 | set_some_value(x); 17 | #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P 18 | #error "Unfortunately we don't fail if typesafe_cb_cast is a noop." 19 | #endif 20 | #else 21 | void *p = 0; 22 | set_some_value(p); 23 | #endif 24 | return 0; 25 | } 26 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-typesafe_cb_postargs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void _register_callback(void (*cb)(void *arg, int x), void *arg) 5 | { 6 | } 7 | #define register_callback(cb, arg) \ 8 | _register_callback(typesafe_cb_postargs(void, void *, (cb), (arg), int), (arg)) 9 | 10 | static void my_callback(char *p, int x) 11 | { 12 | } 13 | 14 | int main(int argc, char *argv[]) 15 | { 16 | #ifdef FAIL 17 | int *p; 18 | #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P 19 | #error "Unfortunately we don't fail if typesafe_cb_cast is a noop." 20 | #endif 21 | #else 22 | char *p; 23 | #endif 24 | p = NULL; 25 | register_callback(my_callback, p); 26 | return 0; 27 | } 28 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_fail-typesafe_cb_preargs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static void _register_callback(void (*cb)(int x, void *arg), void *arg) 5 | { 6 | } 7 | 8 | #define register_callback(cb, arg) \ 9 | _register_callback(typesafe_cb_preargs(void, void *, (cb), (arg), int), (arg)) 10 | 11 | static void my_callback(int x, char *p) 12 | { 13 | } 14 | 15 | int main(int argc, char *argv[]) 16 | { 17 | #ifdef FAIL 18 | int *p; 19 | #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P 20 | #error "Unfortunately we don't fail if typesafe_cb_cast is a noop." 21 | #endif 22 | #else 23 | char *p; 24 | #endif 25 | p = NULL; 26 | register_callback(my_callback, p); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_ok-typesafe_cb-NULL.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* NULL args for callback function should be OK for normal and _def. */ 5 | 6 | static void _register_callback(void (*cb)(const void *arg), const void *arg) 7 | { 8 | } 9 | 10 | #define register_callback(cb, arg) \ 11 | _register_callback(typesafe_cb(void, const void *, (cb), (arg)), (arg)) 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | register_callback(NULL, "hello world"); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_ok-typesafe_cb-undefined.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* const args in callbacks should be OK. */ 5 | 6 | static void _register_callback(void (*cb)(void *arg), void *arg) 7 | { 8 | } 9 | 10 | #define register_callback(cb, arg) \ 11 | _register_callback(typesafe_cb(void, void *, (cb), (arg)), (arg)) 12 | 13 | static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg) 14 | { 15 | } 16 | 17 | #define register_callback_pre(cb, arg) \ 18 | _register_callback_pre(typesafe_cb_preargs(void, void *, (cb), (arg), int), (arg)) 19 | 20 | static void _register_callback_post(void (*cb)(void *arg, int x), void *arg) 21 | { 22 | } 23 | 24 | #define register_callback_post(cb, arg) \ 25 | _register_callback_post(typesafe_cb_postargs(void, void *, (cb), (arg), int), (arg)) 26 | 27 | struct undefined; 28 | 29 | static void my_callback(struct undefined *undef) 30 | { 31 | } 32 | 33 | static void my_callback_pre(int x, struct undefined *undef) 34 | { 35 | } 36 | 37 | static void my_callback_post(struct undefined *undef, int x) 38 | { 39 | } 40 | 41 | int main(int argc, char *argv[]) 42 | { 43 | struct undefined *handle = NULL; 44 | 45 | register_callback(my_callback, handle); 46 | register_callback_pre(my_callback_pre, handle); 47 | register_callback_post(my_callback_post, handle); 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_ok-typesafe_cb-vars.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | /* const args in callbacks should be OK. */ 5 | 6 | static void _register_callback(void (*cb)(void *arg), void *arg) 7 | { 8 | } 9 | 10 | #define register_callback(cb, arg) \ 11 | _register_callback(typesafe_cb(void, void *, (cb), (arg)), (arg)) 12 | 13 | static void _register_callback_pre(void (*cb)(int x, void *arg), void *arg) 14 | { 15 | } 16 | 17 | #define register_callback_pre(cb, arg) \ 18 | _register_callback_pre(typesafe_cb_preargs(void, void *, (cb), (arg), int), (arg)) 19 | 20 | static void _register_callback_post(void (*cb)(void *arg, int x), void *arg) 21 | { 22 | } 23 | 24 | #define register_callback_post(cb, arg) \ 25 | _register_callback_post(typesafe_cb_postargs(void, void *, (cb), (arg), int), (arg)) 26 | 27 | struct undefined; 28 | 29 | static void my_callback(struct undefined *undef) 30 | { 31 | } 32 | 33 | static void my_callback_pre(int x, struct undefined *undef) 34 | { 35 | } 36 | 37 | static void my_callback_post(struct undefined *undef, int x) 38 | { 39 | } 40 | 41 | int main(int argc, char *argv[]) 42 | { 43 | struct undefined *handle = NULL; 44 | void (*cb)(struct undefined *undef) = my_callback; 45 | void (*pre)(int x, struct undefined *undef) = my_callback_pre; 46 | void (*post)(struct undefined *undef, int x) = my_callback_post; 47 | 48 | register_callback(cb, handle); 49 | register_callback_pre(pre, handle); 50 | register_callback_post(post, handle); 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /ccan/typesafe_cb/test/compile_ok-typesafe_cb_cast.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | struct foo { 5 | int x; 6 | }; 7 | 8 | struct bar { 9 | int x; 10 | }; 11 | 12 | struct baz { 13 | int x; 14 | }; 15 | 16 | struct any { 17 | int x; 18 | }; 19 | 20 | static void take_any(struct any *any) 21 | { 22 | } 23 | 24 | int main(int argc, char *argv[]) 25 | { 26 | /* Otherwise we get unused warnings for these. */ 27 | struct foo *foo = NULL; 28 | struct bar *bar = NULL; 29 | struct baz *baz = NULL; 30 | 31 | take_any(typesafe_cb_cast3(struct any *, 32 | struct foo *, struct bar *, struct baz *, 33 | foo)); 34 | take_any(typesafe_cb_cast3(struct any *, 35 | struct foo *, struct bar *, struct baz *, 36 | bar)); 37 | take_any(typesafe_cb_cast3(struct any *, 38 | struct foo *, struct bar *, struct baz *, 39 | baz)); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /doc/BUGS.md: -------------------------------------------------------------------------------- 1 | # Bug reporting 2 | 3 | First and foremost, see `README.md` and other documentation in `doc`. 4 | Although the documentation might be outdated, a lot of it is still 5 | relevant. 6 | 7 | The [issue tracker](https://github.com/veox/sgminer/issues) is there 8 | specifically for reporting bugs, issues and proposed improvements. Other 9 | communication channels are not necessarily monitored. 10 | 11 | Search the issue list to see if it has already been reported. 12 | 13 | Make the title of your report informative. 14 | 15 | Information that may be relevant, depending on the nature of your issue: 16 | 17 | * OS version; 18 | * Catalyst driver version; 19 | * AMD APP SDK version; 20 | * AMD ADL version; 21 | * GPUs used (`sgminer --ndevs`); 22 | * whether you're using a pre-compiled binary or built from source; 23 | * `sgminer` version (`sgminer --version` and/or `git describe`); 24 | * contents of the configuration file and pool connection info; 25 | * launch procedure (manual or via script); 26 | * steps to repeat; 27 | * expected result; 28 | * actual result; 29 | * debug output (`sgminer --text-only --debug --verbose`). 30 | 31 | Be careful when posting the contents of your configuration file: although 32 | pool connection and protocol information is relevant in a certain sub-class 33 | of issues, login credentials (username and password) are most often not. Run 34 | with `--incognito` if possible. 35 | 36 | If there is a need to provide more than a screenfull of log 37 | data, it is preferred that a link is given instead. Try 38 | [gist](https://gist.github.com). 39 | -------------------------------------------------------------------------------- /doc/coding.md: -------------------------------------------------------------------------------- 1 | Coding style 2 | ==================== 3 | 4 | - K&R Stroustrup variant 5 | - 2 space indenting, no tabs 6 | - Each function has its opening brace at the next line on the same indentation level as its header, the statements within the braces are indented, and the closing brace at the end is on the same indentation level as the header of the function at a line of its own. The blocks inside a function, however, have their opening braces at the same line as their respective control statements; closing braces remain in a line of their own. 7 | - Else is on the same indentation level as its accompanying ```if``` statement at a line of its own. 8 | - Curly brackets even for one-line blocks 9 | - No extra spaces inside parenthesis; please don't do ```( this )``` 10 | - No space after function names, one space after ```if```, ```for``` and ```while``` 11 | 12 | ```c++ 13 | int main(int argc, char *argv[]) 14 | { 15 | ... 16 | while (x == y) { 17 | something(); 18 | somethingelse(); 19 | 20 | if (some_error) { 21 | do_correct(); 22 | } 23 | else { 24 | continue_as_usual(); 25 | return false; 26 | } 27 | } 28 | 29 | finalthing(); 30 | ... 31 | } 32 | ``` 33 | 34 | A-Style example command line: 35 | ``` 36 | --style=stroustrup --indent=spaces=2 --break-closing-brackets --add-brackets --convert-tabs --mode=c 37 | ``` 38 | -------------------------------------------------------------------------------- /driver-opencl.h: -------------------------------------------------------------------------------- 1 | #ifndef DEVICE_GPU_H 2 | #define DEVICE_GPU_H 3 | 4 | #include "miner.h" 5 | 6 | 7 | extern void print_ndevs(int *ndevs); 8 | extern void *reinit_gpu(void *userdata); 9 | extern char *set_gpu_map(char *arg); 10 | extern char *set_gpu_threads(const char *arg); 11 | extern char *set_gpu_engine(const char *arg); 12 | extern char *set_gpu_fan(const char *arg); 13 | extern char *set_gpu_memclock(const char *arg); 14 | extern char *set_gpu_memdiff(char *arg); 15 | extern char *set_gpu_powertune(char *arg); 16 | extern char *set_gpu_vddc(char *arg); 17 | extern char *set_temp_overheat(char *arg); 18 | extern char *set_temp_target(char *arg); 19 | extern char *set_intensity(const char *arg); 20 | extern char *set_xintensity(const char *arg); 21 | extern char *set_rawintensity(const char *arg); 22 | extern char *set_vector(char *arg); 23 | extern char *set_worksize(const char *arg); 24 | extern char *set_shaders(char *arg); 25 | extern char *set_lookup_gap(char *arg); 26 | extern char *set_thread_concurrency(const char *arg); 27 | void manage_gpu(void); 28 | extern void pause_dynamic_threads(int gpu); 29 | 30 | extern int opt_platform_id; 31 | 32 | extern struct device_drv opencl_drv; 33 | 34 | #endif /* DEVICE_GPU_H */ 35 | -------------------------------------------------------------------------------- /events.h: -------------------------------------------------------------------------------- 1 | #ifndef EVENTS_H 2 | #define EVENTS_H 3 | 4 | typedef struct event { 5 | unsigned int id; 6 | const char *event_type; 7 | const char *runcmd; 8 | bool reboot; 9 | unsigned int reboot_delay; 10 | bool quit; 11 | const char *quit_msg; 12 | struct event *prev, *next; 13 | } event_t; 14 | 15 | extern char *set_event_type(const char *event_type); 16 | extern char *set_event_runcmd(const char *cmd); 17 | extern char *set_event_reboot(const char *arg); 18 | extern char *set_event_reboot_delay(const char *delay); 19 | extern char *set_event_quit(const char *arg); 20 | extern char *set_event_quit_message(const char *msg); 21 | extern void event_notify(const char *event_type); 22 | 23 | #endif /* EVENTS_H */ -------------------------------------------------------------------------------- /example.conf: -------------------------------------------------------------------------------- 1 | { 2 | "pools": 3 | [ 4 | { 5 | "name": "MoneroPool", 6 | "url": "stratum+tcp://mine.moneropool.com:3333", 7 | "user": "x", 8 | "pass": "x", 9 | "priority": "0", 10 | "profile": "xmr" 11 | } 12 | ], 13 | "profiles": 14 | [ 15 | { 16 | "name": "xmr", 17 | "algorithm": "cryptonight", 18 | "rawintensity": "1024", 19 | "worksize": "8", 20 | "gpu-engine": "1000,1050,1050,1000", 21 | "gpu-memclock": "1500,500,1500,1500", 22 | "gpu-powertune": "20,50,50,50", 23 | "gpu-threads": "1", 24 | "gpu-fan": "100" 25 | } 26 | ], 27 | "default-profile": "xmr", 28 | "no-submit-stale": true, 29 | "no-extranonce": true 30 | } -------------------------------------------------------------------------------- /findnonce.h: -------------------------------------------------------------------------------- 1 | #ifndef FINDNONCE_H 2 | #define FINDNONCE_H 3 | 4 | #include "miner.h" 5 | #include "config.h" 6 | 7 | #define MAXTHREADS (0xFFFFFFFEULL) 8 | #define MAXBUFFERS (0x100) 9 | #define BUFFERSIZE (sizeof(uint32_t) * MAXBUFFERS) 10 | 11 | extern void precalc_hash(dev_blk_ctx *blk, uint32_t *state, uint32_t *data); 12 | extern void postcalc_hash_async(struct thr_info *thr, struct work *work, uint32_t *res); 13 | 14 | #endif /*FINDNONCE_H*/ 15 | -------------------------------------------------------------------------------- /gbt-util.h: -------------------------------------------------------------------------------- 1 | #ifndef __GBT_UTIL_H 2 | #define __GBT_UTIL_H 3 | 4 | 5 | int add_var_int(uint8_t*, uint64_t); 6 | bool set_coinbasetxn(struct pool *, uint32_t, uint64_t, uint64_t, const char *); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /kernel/whirlpoolx.cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/kernel/whirlpoolx.cl -------------------------------------------------------------------------------- /lib/dummy.c: -------------------------------------------------------------------------------- 1 | /* A dummy file, to prevent empty libraries from breaking builds. 2 | Copyright (C) 2004, 2007, 2009-2011 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 3 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 | You should have received a copy of the GNU General Public License 15 | along with this program. If not, see . */ 16 | 17 | /* Some systems, reportedly OpenBSD and Mac OS X, refuse to create 18 | libraries without any object files. You might get an error like: 19 | 20 | > ar cru .libs/libgl.a 21 | > ar: no archive members specified 22 | 23 | Compiling this file, and adding its object file to the library, will 24 | prevent the library from being empty. */ 25 | 26 | /* Some systems, such as Solaris with cc 5.0, refuse to work with libraries 27 | that don't export any symbol. You might get an error like: 28 | 29 | > cc ... libgnu.a 30 | > ild: (bad file) garbled symbol table in archive ../gllib/libgnu.a 31 | 32 | Compiling this file, and adding its object file to the library, will 33 | prevent the library from exporting no symbols. */ 34 | 35 | #ifdef __sun 36 | /* This declaration ensures that the library will export at least 1 symbol. */ 37 | int gl_dummy_symbol; 38 | #else 39 | /* This declaration is solely to ensure that after preprocessing 40 | this file is never empty. */ 41 | typedef int dummy; 42 | #endif 43 | -------------------------------------------------------------------------------- /lib/memchr.valgrind: -------------------------------------------------------------------------------- 1 | # Suppress a valgrind message about use of uninitialized memory in memchr(). 2 | # POSIX states that when the character is found, memchr must not read extra 3 | # bytes in an overestimated length (for example, where memchr is used to 4 | # implement strnlen). However, we use a safe word read to provide a speedup. 5 | { 6 | memchr-value4 7 | Memcheck:Value4 8 | fun:rpl_memchr 9 | } 10 | { 11 | memchr-value8 12 | Memcheck:Value8 13 | fun:rpl_memchr 14 | } 15 | -------------------------------------------------------------------------------- /lib/sig-handler.h: -------------------------------------------------------------------------------- 1 | /* Convenience declarations when working with . 2 | 3 | Copyright (C) 2008-2011 Free Software Foundation, Inc. 4 | 5 | This program is free software: you can redistribute it and/or modify 6 | it under the terms of the GNU General Public License as published by 7 | the Free Software Foundation; either version 3 of the License, or 8 | (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program. If not, see . */ 17 | 18 | #ifndef _GL_SIG_HANDLER_H 19 | #define _GL_SIG_HANDLER_H 20 | 21 | #include 22 | 23 | /* Convenience type when working with signal handlers. */ 24 | typedef void (*sa_handler_t) (int); 25 | 26 | /* Return the handler of a signal, as a sa_handler_t value regardless 27 | of its true type. The resulting function can be compared to 28 | special values like SIG_IGN but it is not portable to call it. */ 29 | static inline sa_handler_t 30 | get_handler (struct sigaction const *a) 31 | { 32 | #ifdef SA_SIGINFO 33 | /* POSIX says that special values like SIG_IGN can only occur when 34 | action.sa_flags does not contain SA_SIGINFO. But in Linux 2.4, 35 | for example, sa_sigaction and sa_handler are aliases and a signal 36 | is ignored if sa_sigaction (after casting) equals SIG_IGN. So 37 | use (and cast) sa_sigaction in that case. */ 38 | if (a->sa_flags & SA_SIGINFO) 39 | return (sa_handler_t) a->sa_sigaction; 40 | #endif 41 | return a->sa_handler; 42 | } 43 | 44 | #endif /* _GL_SIG_HANDLER_H */ 45 | -------------------------------------------------------------------------------- /m4/00gnulib.m4: -------------------------------------------------------------------------------- 1 | # 00gnulib.m4 serial 2 2 | dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl This file must be named something that sorts before all other 8 | dnl gnulib-provided .m4 files. It is needed until such time as we can 9 | dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics. 10 | 11 | # AC_DEFUN_ONCE([NAME], VALUE) 12 | # ---------------------------- 13 | # Define NAME to expand to VALUE on the first use (whether by direct 14 | # expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. 15 | # Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This 16 | # definition is slower than the version in Autoconf 2.64, because it 17 | # can only use interfaces that existed since 2.59; but it achieves the 18 | # same effect. Quoting is necessary to avoid confusing Automake. 19 | m4_version_prereq([2.63.263], [], 20 | [m4_define([AC][_DEFUN_ONCE], 21 | [AC][_DEFUN([$1], 22 | [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], 23 | [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl 24 | [AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) 25 | 26 | # gl_00GNULIB 27 | # ----------- 28 | # Witness macro that this file has been included. Needed to force 29 | # Automake to include this file prior to all other gnulib .m4 files. 30 | AC_DEFUN([gl_00GNULIB]) 31 | -------------------------------------------------------------------------------- /m4/gnulib-cache.m4: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2002-2011 Free Software Foundation, Inc. 2 | # 3 | # This file is free software, distributed under the terms of the GNU 4 | # General Public License. As a special exception to the GNU General 5 | # Public License, this file may be distributed as part of a program 6 | # that contains a configuration script generated by Autoconf, under 7 | # the same distribution terms as the rest of that program. 8 | # 9 | # Generated by gnulib-tool. 10 | # 11 | # This file represents the specification of how gnulib-tool is used. 12 | # It acts as a cache: It is written and read by gnulib-tool. 13 | # In projects that use version control, this file is meant to be put under 14 | # version control, like the configure.ac and various Makefile.am files. 15 | 16 | 17 | # Specification in the form of a command-line invocation: 18 | # gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files memmem sigaction signal 19 | 20 | # Specification in the form of a few gnulib-tool.m4 macro invocations: 21 | gl_LOCAL_DIR([]) 22 | gl_MODULES([ 23 | memmem 24 | sigaction 25 | signal 26 | ]) 27 | gl_AVOID([]) 28 | gl_SOURCE_BASE([lib]) 29 | gl_M4_BASE([m4]) 30 | gl_PO_BASE([]) 31 | gl_DOC_BASE([doc]) 32 | gl_TESTS_BASE([tests]) 33 | gl_LIB([libgnu]) 34 | gl_MAKEFILE_NAME([]) 35 | gl_MACRO_PREFIX([gl]) 36 | gl_PO_DOMAIN([]) 37 | gl_WITNESS_C_DOMAIN([]) 38 | gl_VC_FILES([false]) 39 | -------------------------------------------------------------------------------- /m4/gnulib-tool.m4: -------------------------------------------------------------------------------- 1 | # gnulib-tool.m4 serial 2 2 | dnl Copyright (C) 2004-2005, 2009-2011 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl The following macros need not be invoked explicitly. 8 | dnl Invoking them does nothing except to declare default arguments 9 | dnl for "gnulib-tool --import". 10 | 11 | dnl Usage: gl_LOCAL_DIR([DIR]) 12 | AC_DEFUN([gl_LOCAL_DIR], []) 13 | 14 | dnl Usage: gl_MODULES([module1 module2 ...]) 15 | AC_DEFUN([gl_MODULES], []) 16 | 17 | dnl Usage: gl_AVOID([module1 module2 ...]) 18 | AC_DEFUN([gl_AVOID], []) 19 | 20 | dnl Usage: gl_SOURCE_BASE([DIR]) 21 | AC_DEFUN([gl_SOURCE_BASE], []) 22 | 23 | dnl Usage: gl_M4_BASE([DIR]) 24 | AC_DEFUN([gl_M4_BASE], []) 25 | 26 | dnl Usage: gl_PO_BASE([DIR]) 27 | AC_DEFUN([gl_PO_BASE], []) 28 | 29 | dnl Usage: gl_DOC_BASE([DIR]) 30 | AC_DEFUN([gl_DOC_BASE], []) 31 | 32 | dnl Usage: gl_TESTS_BASE([DIR]) 33 | AC_DEFUN([gl_TESTS_BASE], []) 34 | 35 | dnl Usage: gl_WITH_TESTS 36 | AC_DEFUN([gl_WITH_TESTS], []) 37 | 38 | dnl Usage: gl_LIB([LIBNAME]) 39 | AC_DEFUN([gl_LIB], []) 40 | 41 | dnl Usage: gl_LGPL or gl_LGPL([VERSION]) 42 | AC_DEFUN([gl_LGPL], []) 43 | 44 | dnl Usage: gl_MAKEFILE_NAME([FILENAME]) 45 | AC_DEFUN([gl_MAKEFILE_NAME], []) 46 | 47 | dnl Usage: gl_LIBTOOL 48 | AC_DEFUN([gl_LIBTOOL], []) 49 | 50 | dnl Usage: gl_MACRO_PREFIX([PREFIX]) 51 | AC_DEFUN([gl_MACRO_PREFIX], []) 52 | 53 | dnl Usage: gl_PO_DOMAIN([DOMAIN]) 54 | AC_DEFUN([gl_PO_DOMAIN], []) 55 | 56 | dnl Usage: gl_VC_FILES([BOOLEAN]) 57 | AC_DEFUN([gl_VC_FILES], []) 58 | -------------------------------------------------------------------------------- /m4/sigaction.m4: -------------------------------------------------------------------------------- 1 | # sigaction.m4 serial 6 2 | dnl Copyright (C) 2008-2011 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Determine if sigaction interface is present. 8 | AC_DEFUN([gl_SIGACTION], 9 | [ 10 | AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) 11 | AC_CHECK_FUNCS_ONCE([sigaction]) 12 | if test $ac_cv_func_sigaction = yes; then 13 | AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , , 14 | [[#include ]]) 15 | if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then 16 | HAVE_STRUCT_SIGACTION_SA_SIGACTION=0 17 | fi 18 | else 19 | HAVE_SIGACTION=0 20 | fi 21 | ]) 22 | 23 | # Prerequisites of the part of lib/signal.in.h and of lib/sigaction.c. 24 | AC_DEFUN([gl_PREREQ_SIGACTION], 25 | [ 26 | AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) 27 | AC_REQUIRE([AC_C_RESTRICT]) 28 | AC_REQUIRE([AC_TYPE_UID_T]) 29 | AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H]) 30 | AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt]) 31 | AC_CHECK_TYPES([siginfo_t], [], [], [[ 32 | #include 33 | ]]) 34 | if test $ac_cv_type_siginfo_t = no; then 35 | HAVE_SIGINFO_T=0 36 | fi 37 | ]) 38 | 39 | # Prerequisites of lib/sig-handler.h. 40 | AC_DEFUN([gl_PREREQ_SIG_HANDLER_H], 41 | [ 42 | AC_REQUIRE([AC_C_INLINE]) 43 | ]) 44 | -------------------------------------------------------------------------------- /m4/signalblocking.m4: -------------------------------------------------------------------------------- 1 | # signalblocking.m4 serial 11 2 | dnl Copyright (C) 2001-2002, 2006-2011 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | # Determine available signal blocking primitives. Three different APIs exist: 8 | # 1) POSIX: sigemptyset, sigaddset, sigprocmask 9 | # 2) SYSV: sighold, sigrelse 10 | # 3) BSD: sigblock, sigsetmask 11 | # For simplicity, here we check only for the POSIX signal blocking. 12 | AC_DEFUN([gl_SIGNALBLOCKING], 13 | [ 14 | AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) 15 | signals_not_posix= 16 | AC_EGREP_HEADER([sigset_t], [signal.h], , [signals_not_posix=1]) 17 | if test -z "$signals_not_posix"; then 18 | AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1]) 19 | fi 20 | if test -z "$gl_cv_func_sigprocmask"; then 21 | HAVE_POSIX_SIGNALBLOCKING=0 22 | fi 23 | ]) 24 | 25 | # Prerequisites of the part of lib/signal.in.h and of lib/sigprocmask.c. 26 | AC_DEFUN([gl_PREREQ_SIGPROCMASK], 27 | [ 28 | AC_REQUIRE([gl_SIGNAL_H_DEFAULTS]) 29 | AC_CHECK_TYPES([sigset_t], 30 | [gl_cv_type_sigset_t=yes], [gl_cv_type_sigset_t=no], 31 | [#include 32 | /* Mingw defines sigset_t not in , but in . */ 33 | #include ]) 34 | if test $gl_cv_type_sigset_t != yes; then 35 | HAVE_SIGSET_T=0 36 | fi 37 | dnl HAVE_SIGSET_T is 1 if the system lacks the sigprocmask function but has 38 | dnl the sigset_t type. 39 | AC_SUBST([HAVE_SIGSET_T]) 40 | ]) 41 | -------------------------------------------------------------------------------- /m4/stddef_h.m4: -------------------------------------------------------------------------------- 1 | dnl A placeholder for POSIX 2008 , for platforms that have issues. 2 | # stddef_h.m4 serial 4 3 | dnl Copyright (C) 2009-2011 Free Software Foundation, Inc. 4 | dnl This file is free software; the Free Software Foundation 5 | dnl gives unlimited permission to copy and/or distribute it, 6 | dnl with or without modifications, as long as this notice is preserved. 7 | 8 | AC_DEFUN([gl_STDDEF_H], 9 | [ 10 | AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) 11 | AC_REQUIRE([gt_TYPE_WCHAR_T]) 12 | STDDEF_H= 13 | if test $gt_cv_c_wchar_t = no; then 14 | HAVE_WCHAR_T=0 15 | STDDEF_H=stddef.h 16 | fi 17 | AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions], 18 | [gl_cv_decl_null_works], 19 | [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include 20 | int test[2 * (sizeof NULL == sizeof (void *)) -1]; 21 | ]])], 22 | [gl_cv_decl_null_works=yes], 23 | [gl_cv_decl_null_works=no])]) 24 | if test $gl_cv_decl_null_works = no; then 25 | REPLACE_NULL=1 26 | STDDEF_H=stddef.h 27 | fi 28 | AC_SUBST([STDDEF_H]) 29 | AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"]) 30 | if test -n "$STDDEF_H"; then 31 | gl_NEXT_HEADERS([stddef.h]) 32 | fi 33 | ]) 34 | 35 | AC_DEFUN([gl_STDDEF_MODULE_INDICATOR], 36 | [ 37 | dnl Use AC_REQUIRE here, so that the default settings are expanded once only. 38 | AC_REQUIRE([gl_STDDEF_H_DEFAULTS]) 39 | gl_MODULE_INDICATOR_SET_VARIABLE([$1]) 40 | ]) 41 | 42 | AC_DEFUN([gl_STDDEF_H_DEFAULTS], 43 | [ 44 | dnl Assume proper GNU behavior unless another module says otherwise. 45 | REPLACE_NULL=0; AC_SUBST([REPLACE_NULL]) 46 | HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T]) 47 | ]) 48 | -------------------------------------------------------------------------------- /m4/wchar_t.m4: -------------------------------------------------------------------------------- 1 | # wchar_t.m4 serial 4 (gettext-0.18.2) 2 | dnl Copyright (C) 2002-2003, 2008-2011 Free Software Foundation, Inc. 3 | dnl This file is free software; the Free Software Foundation 4 | dnl gives unlimited permission to copy and/or distribute it, 5 | dnl with or without modifications, as long as this notice is preserved. 6 | 7 | dnl From Bruno Haible. 8 | dnl Test whether has the 'wchar_t' type. 9 | dnl Prerequisite: AC_PROG_CC 10 | 11 | AC_DEFUN([gt_TYPE_WCHAR_T], 12 | [ 13 | AC_CACHE_CHECK([for wchar_t], [gt_cv_c_wchar_t], 14 | [AC_COMPILE_IFELSE( 15 | [AC_LANG_PROGRAM( 16 | [[#include 17 | wchar_t foo = (wchar_t)'\0';]], 18 | [[]])], 19 | [gt_cv_c_wchar_t=yes], 20 | [gt_cv_c_wchar_t=no])]) 21 | if test $gt_cv_c_wchar_t = yes; then 22 | AC_DEFINE([HAVE_WCHAR_T], [1], [Define if you have the 'wchar_t' type.]) 23 | fi 24 | ]) 25 | -------------------------------------------------------------------------------- /merkletree/LICENSE: -------------------------------------------------------------------------------- 1 | /* 2 | * ---------------------------------------------------------------------------- 3 | * "THE BEER-WARE LICENSE" (Revision 42): 4 | * wrote this file. As long as you retain this notice you 5 | * can do whatever you want with this stuff. If we meet some day, and you think 6 | * this stuff is worth it, you can buy me a beer in return. Panu Suksumonsin 7 | * ---------------------------------------------------------------------------- 8 | */ 9 | -------------------------------------------------------------------------------- /merkletree/README.md: -------------------------------------------------------------------------------- 1 | ## New Feature 2 | Push new leaf to merkletree 3 | 4 | ## Usage 5 | 6 | ```cpp 7 | #include "merkletree.h" 8 | 9 | using namespace std; 10 | 11 | int main(){ 12 | 13 | // initialize leaves 14 | vector leaves(5); 15 | leaves[0] = "5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9"; 16 | leaves[1] = "6b86b273ff34fce19d6b804eff5a3f5747ada4eaa22f1d49c01e52ddb7875b4b"; 17 | leaves[2] = "d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35"; 18 | leaves[3] = "4e07408562bedb8b60ce05c1decfe3ad16b72230967de01f640b7e4729b49fce"; 19 | leaves[4] = "4b227777d4dd1fc61c6f884f48641d02b4d121d3fd328cb08b5531fcacdabf8a"; 20 | 21 | // initialize merkletree 22 | merkletree mtree = merkletree(leaves); 23 | char* root = mtree.root(); 24 | 25 | // get proof 26 | char* sample_leaf = leaves[0]; 27 | vector proof = mtree.proof(sample_leaf); 28 | printf("root: %s\n",mtree.root()); 29 | 30 | // verify proof 31 | bool verified = verifyProof(sample_leaf,root,proof); 32 | printf("ver: %d\n",verified); 33 | 34 | // Push leaf 35 | // This will change value of some nodes 36 | char* newleaf = "370b126df07859afa569cd82582bc43dfb2ce3ba8069dbbcbef6b7215b7a76c6"; // sha256 of "anakin" 37 | mtree.pushleaf(newleaf); 38 | 39 | char* newroot = mtree.root(); 40 | printf("new root : %s\n",mtree.root()); 41 | 42 | // verify new leaf 43 | vector newproof = mtree.proof(newleaf); 44 | bool newverified = verifyProof(newleaf,newroot,newproof); 45 | 46 | printf("new ver : %d\n",newverified); 47 | } 48 | ``` 49 | ## To-do 50 | 51 | ## Inspiration 52 | https://github.com/argon_blockai/merkletree 53 | -------------------------------------------------------------------------------- /merkletree/definition.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Copyright (c) 2016-2017 The Zcoin Core developers 4 | // Distributed under the MIT software license, see the accompanying 5 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 6 | 7 | #ifndef BTZC_DEFINITION_H 8 | #define BTZC_DEFINITION_H 9 | 10 | enum { 11 | // primary version 12 | argon_block_VERSION_DEFAULT = (1 << 0), 13 | // modifiers 14 | argon_block_VERSION_AUXPOW = (1 << 8), 15 | // bits allocated for chain ID 16 | argon_block_VERSION_CHAIN_START = (1 << 16), 17 | argon_block_VERSION_CHAIN_END = (1 << 30), 18 | }; 19 | static const int64_t nStartRewardTime = 1475020800; 20 | 21 | #endif //BTZC_DEFINITION_H 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /merkletree/zeroafterfree.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2009-2010 Satoshi Nakamoto 2 | // Copyright (c) 2009-2015 The Bitcoin Core developers 3 | // Distributed under the MIT software license, see the accompanying 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. 5 | 6 | #ifndef BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H 7 | #define BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H 8 | 9 | //#include "support/cleanse.h" 10 | 11 | #include 12 | #include 13 | 14 | template 15 | struct zero_after_free_allocator : public std::allocator { 16 | // MSVC8 default copy constructor is broken 17 | typedef std::allocator base; 18 | typedef typename base::size_type size_type; 19 | typedef typename base::difference_type difference_type; 20 | typedef typename base::pointer pointer; 21 | typedef typename base::const_pointer const_pointer; 22 | typedef typename base::reference reference; 23 | typedef typename base::const_reference const_reference; 24 | typedef typename base::value_type value_type; 25 | zero_after_free_allocator() throw() {} 26 | zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) {} 27 | template 28 | zero_after_free_allocator(const zero_after_free_allocator& a) throw() : base(a) 29 | { 30 | } 31 | ~zero_after_free_allocator() throw() {} 32 | template 33 | struct rebind { 34 | typedef zero_after_free_allocator<_Other> other; 35 | }; 36 | 37 | void deallocate(T* p, std::size_t n) 38 | { 39 | /* if (p != NULL) 40 | memory_cleanse(p, sizeof(T) * n); 41 | std::allocator::deallocate(p, n); 42 | */ 43 | } 44 | }; 45 | 46 | // Byte-vector that clears its contents before deletion. 47 | typedef std::vector > CSerializeData; 48 | 49 | #endif // BITCOIN_SUPPORT_ALLOCATORS_ZEROAFTERFREE_H 50 | -------------------------------------------------------------------------------- /mknsis.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | MINGW_PATH=/usr/i686-pc-mingw32/sys-root/mingw/bin 4 | 5 | OUT_BASE="cpuminer-installer" 6 | OUT_EXE="$OUT_BASE.exe" 7 | 8 | PATH=$PATH:$MINGW_PATH \ 9 | nsiswrapper --run \ 10 | --name "CPU miner" \ 11 | --outfile "$OUT_EXE" \ 12 | minerd.exe \ 13 | $MINGW_PATH/libcurl-4.dll=libcurl-4.dll \ 14 | $MINGW_PATH/pthreadgc2.dll=pthreadgc2.dll \ 15 | $MINGW_PATH/libidn-11.dll=libidn-11.dll \ 16 | $MINGW_PATH/libssh2-1.dll=libssh2-1.dll \ 17 | $MINGW_PATH/libssl-10.dll=libssl-10.dll \ 18 | $MINGW_PATH/zlib1.dll=zlib1.dll \ 19 | $MINGW_PATH/libcrypto-10.dll=libcrypto-10.dll \ 20 | $MINGW_PATH/libiconv-2.dll=libiconv-2.dll \ 21 | $MINGW_PATH/libintl-8.dll=libintl-8.dll 22 | 23 | chmod 0755 "$OUT_EXE" 24 | zip -9 "$OUT_BASE" "$OUT_EXE" 25 | rm -f "$OUT_EXE" 26 | 27 | chmod 0644 "$OUT_BASE.zip" 28 | 29 | echo -n "SHA1: " 30 | sha1sum "$OUT_BASE.zip" 31 | 32 | echo -n "MD5: " 33 | md5sum "$OUT_BASE.zip" 34 | 35 | -------------------------------------------------------------------------------- /ocl.h: -------------------------------------------------------------------------------- 1 | #ifndef OCL_H 2 | #define OCL_H 3 | 4 | #include "config.h" 5 | 6 | #include 7 | #ifdef __APPLE_CC__ 8 | #include 9 | #else 10 | #include 11 | #endif 12 | 13 | #include "algorithm.h" 14 | 15 | typedef struct __clState { 16 | cl_context context; 17 | cl_kernel kernel; 18 | cl_kernel *extra_kernels; 19 | cl_kernel GenerateDAG; 20 | /// mtp kernels 21 | cl_kernel mtp_0; //initialization 22 | cl_kernel mtp_1; //initialization 23 | cl_kernel mtp_2; //initialization 24 | cl_kernel mtp_3; //initialization 25 | 26 | 27 | cl_kernel mtp_fc; //initialization 28 | cl_kernel mtp_yloop_init; // main kernel 29 | cl_kernel mtp_yloop; // main kernel 30 | 31 | size_t n_extra_kernels; 32 | cl_command_queue commandQueue; 33 | cl_program program; 34 | cl_mem outputBuffer; 35 | cl_mem CLbuffer0; 36 | cl_mem MidstateBuf; 37 | cl_mem padbuffer8; 38 | cl_mem BranchBuffer[4]; 39 | cl_mem Scratchpads; 40 | cl_mem States; 41 | cl_mem buffer1; 42 | cl_mem buffer2; 43 | cl_mem buffer3; 44 | cl_mem index_buf[9]; 45 | unsigned char cldata[168]; 46 | bool goffset; 47 | cl_uint vwidth; 48 | int devid; 49 | size_t max_work_size; 50 | size_t wsize; 51 | size_t compute_shaders; 52 | } _clState; 53 | 54 | extern int clDevicesNum(void); 55 | extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *algorithm); 56 | 57 | #endif /* OCL_H */ 58 | -------------------------------------------------------------------------------- /ocl/binary_kernel.h: -------------------------------------------------------------------------------- 1 | #ifndef BINARY_KERNEL_H 2 | #define BINARY_KERNEL_H 3 | 4 | #ifdef __APPLE_CC__ 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | #include "build_kernel.h" 11 | 12 | cl_program load_opencl_binary_kernel(build_kernel_data *data); 13 | 14 | #endif /* BINARY_KERNEL_H */ 15 | -------------------------------------------------------------------------------- /ocl/build_kernel.h: -------------------------------------------------------------------------------- 1 | #ifndef BUILD_KERNEL_H 2 | #define BUILD_KERNEL_H 3 | 4 | #include 5 | #include "logging.h" 6 | 7 | #ifdef __APPLE_CC__ 8 | #include 9 | #else 10 | #include 11 | #endif 12 | 13 | typedef struct _build_kernel_data { 14 | char source_filename[255]; 15 | char binary_filename[255]; 16 | char compiler_options[512]; 17 | 18 | cl_context context; 19 | cl_device_id *device; 20 | 21 | // for compiler options 22 | char platform[64]; 23 | char sgminer_path[255]; 24 | const char *kernel_path; 25 | size_t work_size; 26 | float opencl_version; 27 | } build_kernel_data; 28 | 29 | cl_program build_opencl_kernel(build_kernel_data *data, const char *filename); 30 | bool save_opencl_kernel(build_kernel_data *data, cl_program program); 31 | void set_base_compiler_options(build_kernel_data *data); 32 | 33 | #endif /* BUILD_KERNEL_H */ 34 | -------------------------------------------------------------------------------- /pool.h: -------------------------------------------------------------------------------- 1 | #ifndef POOL_H 2 | #define POOL_H 3 | 4 | #include "miner.h" 5 | 6 | extern char* get_pool_name(struct pool *pool); 7 | extern char* get_pool_user(struct pool *pool); 8 | 9 | #endif /* POOL_H */ 10 | -------------------------------------------------------------------------------- /roadmap.md: -------------------------------------------------------------------------------- 1 | This project is being *actively* developed by Genesis Mining. Here's our projected timeline - this is not set in stone, and will be updated to keep the community updated. 2 | 3 | ### November, 2016 4 | 5 | + Integrate Zcash miner with Stratum support 6 | + Polish and optimize SilentArmy kernel. 7 | + Add fan control and temperature monitoring. 8 | + Clean up, and combine, the ZCash, Ethereum and XMR branches. 9 | 10 | ### December, 2016 11 | 12 | + Integrate optimized kernels for AES, Shabal, Groestl and Echo. 13 | + Performance increases for ZCash, and XMR. 14 | + Bug Fixes. 15 | 16 | ### January, 2017 17 | 18 | + Integrate optimized kernels for Cubehash, Fugue, Hamsi. 19 | + Integrate HODLCoin, Espers and LBRY. 20 | + Look into integrating community requests. 21 | 22 | ### February, 2017 23 | 24 | + Integrate optimized kernels for JH, Luffa, Shavite. 25 | + Performance increases for various miners. 26 | + Integrate control and finetuning for memory clocks for GPUs. 27 | + Add CPU mining 28 | 29 | ### March, 2017 30 | 31 | + Integrate optimized kernels for SIMD, Skein, Whirlpool. 32 | + Performance increases and bug fixes. 33 | + Slow rewrite of SGMiner, replacing else/if statements with function pointers (in scanhash_opencl) and removing the various goto statements. 34 | 35 | ### April, 2017 36 | 37 | + Create an updated manual for SGMiner-GM, including a detailed walkthrough of setting it up on various systems (Arch Linux, Linux Mint, Ubuntu, PiMP and EthOS). 38 | + Addition of a GUI for those who prefer it. 39 | + Performance increases for various kernels and coins. 40 | -------------------------------------------------------------------------------- /sph/Makefile.am: -------------------------------------------------------------------------------- 1 | noinst_LIBRARIES = libsph.a 2 | 3 | libsph_a_SOURCES = bmw.c echo.c jh.c luffa.c simd.c blake.c cubehash.c groestl.c keccak.c shavite.c skein.c sha2.c sha2big.c fugue.c hamsi.c panama.c shabal.c whirlpool.c sha256_Y.c 4 | -------------------------------------------------------------------------------- /submodules/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = jansson 3 | 4 | -------------------------------------------------------------------------------- /submodules/jansson/.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.o 3 | *.a 4 | .libs 5 | .deps 6 | Makefile 7 | Makefile.in 8 | aclocal.m4 9 | autom4te.cache 10 | config.guess 11 | config.h 12 | config.h.in 13 | config.log 14 | config.status 15 | config.sub 16 | configure 17 | depcomp 18 | install-sh 19 | libtool 20 | ltmain.sh 21 | missing 22 | compile 23 | test-driver 24 | *.lo 25 | *.la 26 | stamp-h1 27 | *.pyc 28 | *.pc 29 | /src/jansson_config.h 30 | /jansson_private_config.h.in 31 | /jansson_private_config.h 32 | /build 33 | *.exe 34 | -------------------------------------------------------------------------------- /submodules/jansson/.travis.yml: -------------------------------------------------------------------------------- 1 | env: 2 | matrix: 3 | - JANSSON_BUILD_METHOD=cmake JANSSON_CMAKE_OPTIONS="-DJANSSON_TEST_WITH_VALGRIND=ON" JANSSON_EXTRA_INSTALL="valgrind" 4 | - JANSSON_BUILD_METHOD=autotools 5 | language: c 6 | compiler: 7 | - gcc 8 | - clang 9 | install: 10 | - sudo apt-get update -qq 11 | - sudo apt-get install -y -qq cmake $JANSSON_EXTRA_INSTALL 12 | script: 13 | - if [ "$JANSSON_BUILD_METHOD" = "autotools" ]; then autoreconf -f -i && CFLAGS=-Werror ./configure && make check; fi 14 | - if [ "$JANSSON_BUILD_METHOD" = "cmake" ]; then mkdir build && cd build && cmake .. $JANSSON_CMAKE_OPTIONS && cmake --build . && ctest --output-on-failure; fi 15 | -------------------------------------------------------------------------------- /submodules/jansson/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH:= $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_ARM_MODE := arm 5 | 6 | LOCAL_SRC_FILES := \ 7 | src/dump.c \ 8 | src/error.c \ 9 | src/hashtable.c \ 10 | src/hashtable_seed.c \ 11 | src/load.c \ 12 | src/memory.c \ 13 | src/pack_unpack.c \ 14 | src/strbuffer.c \ 15 | src/strconv.c \ 16 | src/utf.c \ 17 | src/value.c 18 | 19 | LOCAL_C_INCLUDES += \ 20 | $(LOCAL_PATH) \ 21 | $(LOCAL_PATH)/android \ 22 | $(LOCAL_PATH)/src 23 | 24 | LOCAL_MODULE_TAGS := optional 25 | LOCAL_SHARED_LIBRARIES := libc 26 | LOCAL_CFLAGS += -O3 -DHAVE_STDINT_H=1 27 | 28 | LOCAL_MODULE:= libjansson 29 | 30 | include $(BUILD_SHARED_LIBRARY) 31 | -------------------------------------------------------------------------------- /submodules/jansson/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2014 Petri Lehtinen 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 | -------------------------------------------------------------------------------- /submodules/jansson/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = CHANGES LICENSE README.rst CMakeLists.txt cmake android 2 | SUBDIRS = doc src test 3 | 4 | # "make distcheck" builds the dvi target, so use it to check that the 5 | # documentation is built correctly. 6 | dvi: 7 | $(MAKE) SPHINXOPTS_EXTRA=-W html 8 | 9 | pkgconfigdir = $(libdir)/pkgconfig 10 | pkgconfig_DATA = jansson.pc 11 | -------------------------------------------------------------------------------- /submodules/jansson/README.rst: -------------------------------------------------------------------------------- 1 | Jansson README 2 | ============== 3 | 4 | .. image:: https://travis-ci.org/akheron/jansson.png 5 | :target: https://travis-ci.org/akheron/jansson 6 | 7 | .. image:: https://ci.appveyor.com/api/projects/status/lmhkkc4q8cwc65ko 8 | :target: https://ci.appveyor.com/project/akheron/jansson 9 | 10 | Jansson_ is a C library for encoding, decoding and manipulating JSON 11 | data. Its main features and design principles are: 12 | 13 | - Simple and intuitive API and data model 14 | 15 | - Comprehensive documentation 16 | 17 | - No dependencies on other libraries 18 | 19 | - Full Unicode support (UTF-8) 20 | 21 | - Extensive test suite 22 | 23 | Jansson is licensed under the `MIT license`_; see LICENSE in the 24 | source distribution for details. 25 | 26 | 27 | Compilation and Installation 28 | ---------------------------- 29 | 30 | If you obtained a source tarball, just use the standard autotools 31 | commands:: 32 | 33 | $ ./configure 34 | $ make 35 | $ make install 36 | 37 | To run the test suite, invoke:: 38 | 39 | $ make check 40 | 41 | If the source has been checked out from a Git repository, the 42 | ./configure script has to be generated first. The easiest way is to 43 | use autoreconf:: 44 | 45 | $ autoreconf -i 46 | 47 | 48 | Documentation 49 | ------------- 50 | 51 | Documentation is available at http://jansson.readthedocs.org/en/latest/. 52 | 53 | The documentation source is in the ``doc/`` subdirectory. To generate 54 | HTML documentation, invoke:: 55 | 56 | $ make html 57 | 58 | Then, point your browser to ``doc/_build/html/index.html``. Sphinx_ 59 | 1.0 or newer is required to generate the documentation. 60 | 61 | 62 | .. _Jansson: http://www.digip.org/jansson/ 63 | .. _`MIT license`: http://www.opensource.org/licenses/mit-license.php 64 | .. _Sphinx: http://sphinx.pocoo.org/ 65 | -------------------------------------------------------------------------------- /submodules/jansson/android/jansson_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2014 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * jansson.h. 11 | * 12 | * The configure script copies this file to jansson_config.h and 13 | * replaces @var@ substitutions by values that fit your system. If you 14 | * cannot run the configure script, you can do the value substitution 15 | * by hand. 16 | */ 17 | 18 | #ifndef JANSSON_CONFIG_H 19 | #define JANSSON_CONFIG_H 20 | 21 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 22 | defined to `inline', otherwise empty. In C++, the inline is always 23 | supported. */ 24 | #ifdef __cplusplus 25 | #define JSON_INLINE inline 26 | #else 27 | #define JSON_INLINE inline 28 | #endif 29 | 30 | /* If your compiler supports the `long long` type and the strtoll() 31 | library function, JSON_INTEGER_IS_LONG_LONG is defined to 1, 32 | otherwise to 0. */ 33 | #define JSON_INTEGER_IS_LONG_LONG 1 34 | 35 | /* If locale.h and localeconv() are available, define to 1, 36 | otherwise to 0. */ 37 | #define JSON_HAVE_LOCALECONV 0 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /submodules/jansson/appveyor.yml: -------------------------------------------------------------------------------- 1 | build_script: 2 | - md build 3 | - cd build 4 | - cmake .. 5 | - cmake --build . --config Release 6 | - ctest --output-on-failure -------------------------------------------------------------------------------- /submodules/jansson/cmake/CheckFunctionKeywords.cmake: -------------------------------------------------------------------------------- 1 | include(CheckCSourceCompiles) 2 | 3 | macro(check_function_keywords _wordlist) 4 | set(${_result} "") 5 | foreach(flag ${_wordlist}) 6 | string(REGEX REPLACE "[-+/ ()]" "_" flagname "${flag}") 7 | string(TOUPPER "${flagname}" flagname) 8 | set(have_flag "HAVE_${flagname}") 9 | check_c_source_compiles("${flag} void func(); void func() { } int main() { func(); return 0; }" ${have_flag}) 10 | if(${have_flag} AND NOT ${_result}) 11 | set(${_result} "${flag}") 12 | # break() 13 | endif(${have_flag} AND NOT ${_result}) 14 | endforeach(flag) 15 | endmacro(check_function_keywords) 16 | -------------------------------------------------------------------------------- /submodules/jansson/cmake/JanssonConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # - Config file for the jansson package 2 | # It defines the following variables 3 | # JANSSON_INCLUDE_DIRS - include directories for FooBar 4 | # JANSSON_LIBRARIES - libraries to link against 5 | 6 | # Get the path of the current file. 7 | get_filename_component(JANSSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) 8 | 9 | # Set the include directories. 10 | set(JANSSON_INCLUDE_DIRS "@JANSSON__INCLUDE_DIRS@") 11 | 12 | # Include the project Targets file, this contains definitions for IMPORTED targets. 13 | include(${JANSSON_CMAKE_DIR}/JanssonTargets.cmake) 14 | 15 | # IMPORTED targets from JanssonTargets.cmake 16 | set(JANSSON_LIBRARIES jansson) 17 | 18 | -------------------------------------------------------------------------------- /submodules/jansson/cmake/JanssonConfigVersion.cmake.in: -------------------------------------------------------------------------------- 1 | set(PACKAGE_VERSION "@JANSSON_DISPLAY_VERSION@") 2 | 3 | # Check whether the requested PACKAGE_FIND_VERSION is compatible 4 | if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") 5 | set(PACKAGE_VERSION_COMPATIBLE FALSE) 6 | else() 7 | set(PACKAGE_VERSION_COMPATIBLE TRUE) 8 | if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") 9 | set(PACKAGE_VERSION_EXACT TRUE) 10 | endif() 11 | endif() 12 | -------------------------------------------------------------------------------- /submodules/jansson/cmake/jansson_private_config.h.cmake: -------------------------------------------------------------------------------- 1 | #cmakedefine HAVE_ENDIAN_H 1 2 | #cmakedefine HAVE_FCNTL_H 1 3 | #cmakedefine HAVE_SCHED_H 1 4 | #cmakedefine HAVE_UNISTD_H 1 5 | #cmakedefine HAVE_SYS_PARAM_H 1 6 | #cmakedefine HAVE_SYS_STAT_H 1 7 | #cmakedefine HAVE_SYS_TIME_H 1 8 | #cmakedefine HAVE_SYS_TYPES_H 1 9 | #cmakedefine HAVE_STDINT_H 1 10 | 11 | #cmakedefine HAVE_CLOSE 1 12 | #cmakedefine HAVE_GETPID 1 13 | #cmakedefine HAVE_GETTIMEOFDAY 1 14 | #cmakedefine HAVE_OPEN 1 15 | #cmakedefine HAVE_READ 1 16 | #cmakedefine HAVE_SCHED_YIELD 1 17 | 18 | #cmakedefine HAVE_SYNC_BUILTINS 1 19 | #cmakedefine HAVE_ATOMIC_BUILTINS 1 20 | 21 | #cmakedefine HAVE_LOCALE_H 1 22 | #cmakedefine HAVE_SETLOCALE 1 23 | 24 | #cmakedefine HAVE_INT32_T 1 25 | #ifndef HAVE_INT32_T 26 | # define int32_t @JSON_INT32@ 27 | #endif 28 | 29 | #cmakedefine HAVE_UINT32_T 1 30 | #ifndef HAVE_UINT32_T 31 | # define uint32_t @JSON_UINT32@ 32 | #endif 33 | 34 | #cmakedefine HAVE_UINT16_T 1 35 | #ifndef HAVE_UINT16_T 36 | # define uint16_t @JSON_UINT16@ 37 | #endif 38 | 39 | #cmakedefine HAVE_UINT8_T 1 40 | #ifndef HAVE_UINT8_T 41 | # define uint8_t @JSON_UINT8@ 42 | #endif 43 | 44 | #cmakedefine HAVE_SSIZE_T 1 45 | 46 | #ifndef HAVE_SSIZE_T 47 | # define ssize_t @JSON_SSIZE@ 48 | #endif 49 | 50 | #cmakedefine HAVE_SNPRINTF 1 51 | 52 | #ifndef HAVE_SNPRINTF 53 | # define snprintf @JSON_SNPRINTF@ 54 | #endif 55 | 56 | #cmakedefine HAVE_VSNPRINTF 57 | 58 | #cmakedefine USE_URANDOM 1 59 | #cmakedefine USE_WINDOWS_CRYPTOAPI 1 60 | -------------------------------------------------------------------------------- /submodules/jansson/doc/.gitignore: -------------------------------------------------------------------------------- 1 | _build/ 2 | -------------------------------------------------------------------------------- /submodules/jansson/doc/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = conf.py apiref.rst changes.rst conformance.rst \ 2 | gettingstarted.rst github_commits.c index.rst portability.rst \ 3 | tutorial.rst upgrading.rst ext/refcounting.py 4 | 5 | SPHINXBUILD = sphinx-build 6 | SPHINXOPTS = -d _build/doctrees $(SPHINXOPTS_EXTRA) 7 | 8 | html-local: 9 | $(SPHINXBUILD) -b html $(SPHINXOPTS) $(srcdir) _build/html 10 | 11 | install-html-local: html 12 | mkdir -p $(DESTDIR)$(htmldir) 13 | cp -r _build/html $(DESTDIR)$(htmldir) 14 | 15 | uninstall-local: 16 | rm -rf $(DESTDIR)$(htmldir) 17 | 18 | clean-local: 19 | rm -rf _build 20 | rm -f ext/refcounting.pyc 21 | -------------------------------------------------------------------------------- /submodules/jansson/doc/README: -------------------------------------------------------------------------------- 1 | To build the documentation, invoke 2 | 3 | make html 4 | 5 | Then point your browser to _build/html/index.html. 6 | -------------------------------------------------------------------------------- /submodules/jansson/doc/changes.rst: -------------------------------------------------------------------------------- 1 | ****************** 2 | Changes in Jansson 3 | ****************** 4 | 5 | .. include:: ../CHANGES 6 | -------------------------------------------------------------------------------- /submodules/jansson/doc/index.rst: -------------------------------------------------------------------------------- 1 | Jansson Documentation 2 | ===================== 3 | 4 | This is the documentation for Jansson_ |release|, last updated |today|. 5 | 6 | Introduction 7 | ------------ 8 | 9 | Jansson_ is a C library for encoding, decoding and manipulating JSON 10 | data. Its main features and design principles are: 11 | 12 | - Simple and intuitive API and data model 13 | 14 | - Comprehensive documentation 15 | 16 | - No dependencies on other libraries 17 | 18 | - Full Unicode support (UTF-8) 19 | 20 | - Extensive test suite 21 | 22 | Jansson is licensed under the `MIT license`_; see LICENSE in the 23 | source distribution for details. 24 | 25 | Jansson is used in production and its API is stable. It works on 26 | numerous platforms, including numerous Unix like systems and Windows. 27 | It's suitable for use on any system, including desktop, server, and 28 | small embedded systems. 29 | 30 | 31 | .. _`MIT license`: http://www.opensource.org/licenses/mit-license.php 32 | .. _Jansson: http://www.digip.org/jansson/ 33 | 34 | Contents 35 | -------- 36 | 37 | .. toctree:: 38 | :maxdepth: 2 39 | 40 | gettingstarted 41 | upgrading 42 | tutorial 43 | conformance 44 | portability 45 | apiref 46 | changes 47 | 48 | 49 | Indices and Tables 50 | ================== 51 | 52 | * :ref:`genindex` 53 | * :ref:`search` 54 | -------------------------------------------------------------------------------- /submodules/jansson/jansson.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=${prefix}/include 5 | 6 | Name: Jansson 7 | Description: Library for encoding, decoding and manipulating JSON data 8 | Version: @VERSION@ 9 | Libs: -L${libdir} -ljansson 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /submodules/jansson/release.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Use this script to easily make releases of Jansson. It configures 4 | # the source tree, and builds and signs all tarballs. 5 | 6 | die() { 7 | echo $1 >&2 8 | exit 1 9 | } 10 | 11 | confirm() { 12 | local answer 13 | read -p "$1 [yN]: " answer 14 | [ "$answer" = "Y" -o "$answer" = "y" ] || exit 0 15 | } 16 | 17 | set -e 18 | [ -f configure.ac ] || die "Must be run at project root directory" 19 | 20 | # Determine version 21 | v=$(grep AC_INIT configure.ac | sed -r 's/.*, \[(.+?)\],.*/\1/') 22 | [ -n "$v" ] || die "Unable to determine version" 23 | confirm "Version is $v, proceed?" 24 | 25 | # Sanity checks 26 | vi=$(grep version-info src/Makefile.am | sed 's/^[ \t]*//g' | cut -d" " -f2) 27 | confirm "Libtool version-info is $vi, proceed?" 28 | 29 | r=$(grep 'Released ' CHANGES | head -n 1) 30 | confirm "Last CHANGES entry says \"$r\", proceed??" 31 | 32 | dv=$(grep ^version doc/conf.py | sed -r "s/.*'(.*)'.*/\1/") 33 | if [ "$dv" != "$v" ]; then 34 | die "Documentation version ($dv) doesn't match library version" 35 | fi 36 | 37 | [ -f Makefile ] && make distclean || true 38 | rm -f jansson-$v.tar.* 39 | rm -rf jansson-$v-doc 40 | rm -f jansson-$v-doc.tar.* 41 | 42 | autoreconf -fi 43 | ./configure 44 | 45 | # Run tests and make gz source tarball 46 | : ${VALGRIND:=1} 47 | export VALGRIND 48 | make distcheck 49 | 50 | # Make bzip2 source tarball 51 | make dist-bzip2 52 | 53 | # Sign source tarballs 54 | for s in gz bz2; do 55 | gpg --detach-sign --armor jansson-$v.tar.$s 56 | done 57 | 58 | # Build documentation 59 | make html 60 | mv doc/_build/html jansson-$v-doc 61 | 62 | # Make and sign documentation tarballs 63 | for s in gz bz2; do 64 | [ $s = gz ] && compress=gzip 65 | [ $s = bz2 ] && compress=bzip2 66 | tar cf - jansson-$v-doc | $compress -9 -c > jansson-$v-doc.tar.$s 67 | gpg --detach-sign --armor jansson-$v-doc.tar.$s 68 | done 69 | 70 | echo "All done" 71 | -------------------------------------------------------------------------------- /submodules/jansson/src/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = bosjansson.def 2 | 3 | include_HEADERS = bosjansson.h 4 | nodist_include_HEADERS = jansson_config.h 5 | 6 | noinst_LIBRARIES = libbosjansson.a 7 | 8 | ###lib_LTLIBRARIES = libbosjansson.la 9 | libbosjansson_a_SOURCES = \ 10 | bos_deserializer.c \ 11 | bos_serializer.c \ 12 | dump.c \ 13 | error.c \ 14 | hashtable.c \ 15 | hashtable.h \ 16 | hashtable_seed.c \ 17 | jansson_private.h \ 18 | load.c \ 19 | lookup3.h \ 20 | memory.c \ 21 | pack_unpack.c \ 22 | strbuffer.c \ 23 | strbuffer.h \ 24 | strconv.c \ 25 | utf.c \ 26 | utf.h \ 27 | value.c 28 | #libbosjansson_a_LDFLAGS = \ 29 | # -no-undefined \ 30 | # -export-symbols-regex '^json_' \ 31 | # -version-info 15:0:11 \ 32 | # @JSON_BSYMBOLIC_LDFLAGS@ 33 | 34 | -------------------------------------------------------------------------------- /submodules/jansson/src/jansson.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | json_delete 3 | json_true 4 | json_false 5 | json_null 6 | json_string 7 | json_stringn 8 | json_string_nocheck 9 | json_stringn_nocheck 10 | json_string_value 11 | json_string_length 12 | json_string_set 13 | json_string_setn 14 | json_string_set_nocheck 15 | json_string_setn_nocheck 16 | json_integer 17 | json_integer_value 18 | json_integer_set 19 | json_real 20 | json_real_value 21 | json_real_set 22 | json_number_value 23 | json_array 24 | json_array_size 25 | json_array_get 26 | json_array_set_new 27 | json_array_append_new 28 | json_array_insert_new 29 | json_array_remove 30 | json_array_clear 31 | json_array_extend 32 | json_object 33 | json_object_size 34 | json_object_get 35 | json_object_set_new 36 | json_object_set_new_nocheck 37 | json_object_del 38 | json_object_clear 39 | json_object_update 40 | json_object_update_existing 41 | json_object_update_missing 42 | json_object_iter 43 | json_object_iter_at 44 | json_object_iter_next 45 | json_object_iter_key 46 | json_object_iter_value 47 | json_object_iter_set_new 48 | json_object_key_to_iter 49 | json_object_seed 50 | json_dumps 51 | json_dumpf 52 | json_dump_file 53 | json_dump_callback 54 | json_loads 55 | json_loadb 56 | json_loadf 57 | json_load_file 58 | json_load_callback 59 | json_equal 60 | json_copy 61 | json_deep_copy 62 | json_pack 63 | json_pack_ex 64 | json_vpack_ex 65 | json_unpack 66 | json_unpack_ex 67 | json_vunpack_ex 68 | json_set_alloc_funcs 69 | 70 | -------------------------------------------------------------------------------- /submodules/jansson/src/jansson_private_config.h: -------------------------------------------------------------------------------- 1 | /* #undef HAVE_ENDIAN_H */ 2 | #define HAVE_CONFIG_H 1 3 | #define HAVE_FCNTL_H 1 4 | /* #undef HAVE_SCHED_H */ 5 | /* #undef HAVE_UNISTD_H */ 6 | /* #undef HAVE_SYS_PARAM_H */ 7 | #define HAVE_SYS_STAT_H 1 8 | /* #undef HAVE_SYS_TIME_H */ 9 | #define HAVE_SYS_TYPES_H 1 10 | #define HAVE_STDINT_H 1 11 | 12 | #define HAVE_CLOSE 1 13 | #define HAVE_GETPID 1 14 | /* #undef HAVE_GETTIMEOFDAY */ 15 | #define HAVE_OPEN 1 16 | #define HAVE_READ 1 17 | /* #undef HAVE_SCHED_YIELD */ 18 | 19 | /* #undef HAVE_SYNC_BUILTINS */ 20 | /* #undef HAVE_ATOMIC_BUILTINS */ 21 | 22 | #define HAVE_LOCALE_H 1 23 | #define HAVE_SETLOCALE 1 24 | 25 | #define HAVE_INT32_T 1 26 | #ifndef HAVE_INT32_T 27 | # define int32_t int32_t 28 | #endif 29 | 30 | #define HAVE_UINT32_T 1 31 | #ifndef HAVE_UINT32_T 32 | # define uint32_t uint32_t 33 | #endif 34 | 35 | #define HAVE_UINT16_T 1 36 | #ifndef HAVE_UINT16_T 37 | # define uint16_t uint16_t 38 | #endif 39 | 40 | #define HAVE_UINT8_T 1 41 | #ifndef HAVE_UINT8_T 42 | # define uint8_t uint8_t 43 | #endif 44 | 45 | /* #undef HAVE_SSIZE_T */ 46 | #define HAVE_SSIZE_T 0 47 | #ifndef HAVE_SSIZE_T 48 | # define ssize_t int 49 | #endif 50 | 51 | #define USE_URANDOM 1 52 | #define USE_WINDOWS_CRYPTOAPI 1 53 | 54 | #define INITIAL_HASHTABLE_ORDER 3 55 | -------------------------------------------------------------------------------- /submodules/jansson/src/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * Copyright (c) 2011-2012 Basile Starynkevitch 4 | * 5 | * Jansson is free software; you can redistribute it and/or modify it 6 | * under the terms of the MIT license. See LICENSE for details. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | #include "bosjansson.h" 13 | #include "jansson_private.h" 14 | 15 | /* C89 allows these to be macros */ 16 | #undef malloc 17 | #undef free 18 | 19 | /* memory function pointers */ 20 | static json_malloc_t do_malloc = malloc; 21 | static json_free_t do_free = free; 22 | 23 | void *jsonp_malloc(size_t size) 24 | { 25 | if(!size) 26 | return NULL; 27 | 28 | return (*do_malloc)(size); 29 | } 30 | 31 | void jsonp_free(void *ptr) 32 | { 33 | if(!ptr) 34 | return; 35 | 36 | (*do_free)(ptr); 37 | } 38 | 39 | char *jsonp_strdup(const char *str) 40 | { 41 | return jsonp_strndup(str, strlen(str)); 42 | } 43 | 44 | char *jsonp_strndup(const char *str, size_t len) 45 | { 46 | char *new_str; 47 | 48 | new_str = jsonp_malloc(len + 1); 49 | if(!new_str) 50 | return NULL; 51 | 52 | memcpy(new_str, str, len); 53 | new_str[len] = '\0'; 54 | return new_str; 55 | } 56 | 57 | void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) 58 | { 59 | do_malloc = malloc_fn; 60 | do_free = free_fn; 61 | } 62 | 63 | void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn) 64 | { 65 | if (malloc_fn) 66 | *malloc_fn = do_malloc; 67 | if (free_fn) 68 | *free_fn = do_free; 69 | } 70 | -------------------------------------------------------------------------------- /submodules/jansson/src/strbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef STRBUFFER_H 9 | #define STRBUFFER_H 10 | 11 | #include 12 | 13 | typedef struct { 14 | char *value; 15 | size_t length; /* bytes used */ 16 | size_t size; /* bytes allocated */ 17 | } strbuffer_t; 18 | 19 | int strbuffer_init(strbuffer_t *strbuff) JANSSON_ATTRS(warn_unused_result); 20 | void strbuffer_close(strbuffer_t *strbuff); 21 | 22 | void strbuffer_clear(strbuffer_t *strbuff); 23 | 24 | const char *strbuffer_value(const strbuffer_t *strbuff); 25 | 26 | /* Steal the value and close the strbuffer */ 27 | char *strbuffer_steal_value(strbuffer_t *strbuff); 28 | 29 | int strbuffer_append_byte(strbuffer_t *strbuff, char byte); 30 | int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size); 31 | 32 | char strbuffer_pop(strbuffer_t *strbuff); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /submodules/jansson/src/utf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef UTF_H 9 | #define UTF_H 10 | 11 | #ifdef HAVE_CONFIG_H 12 | #include 13 | #endif 14 | 15 | #ifdef HAVE_STDINT_H 16 | #include 17 | #endif 18 | 19 | int utf8_encode(int32_t codepoint, char *buffer, size_t *size); 20 | 21 | size_t utf8_check_first(char byte); 22 | size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint); 23 | const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint); 24 | 25 | int utf8_check_string(const char *string, size_t length); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /submodules/jansson/test/.gitignore: -------------------------------------------------------------------------------- 1 | logs 2 | bin/json_process 3 | suites/api/test_array 4 | suites/api/test_copy 5 | suites/api/test_cpp 6 | suites/api/test_dump 7 | suites/api/test_dump_callback 8 | suites/api/test_equal 9 | suites/api/test_load 10 | suites/api/test_loadb 11 | suites/api/test_memory_funcs 12 | suites/api/test_number 13 | suites/api/test_object 14 | suites/api/test_pack 15 | suites/api/test_simple 16 | suites/api/test_unpack 17 | suites/api/test_load_callback 18 | -------------------------------------------------------------------------------- /submodules/jansson/test/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = bin suites 2 | EXTRA_DIST = scripts run-suites 3 | 4 | TESTS = run-suites 5 | TESTS_ENVIRONMENT = \ 6 | top_srcdir=$(top_srcdir) \ 7 | top_builddir=$(top_builddir) 8 | 9 | clean-local: 10 | rm -rf logs 11 | -------------------------------------------------------------------------------- /submodules/jansson/test/bin/Makefile.am: -------------------------------------------------------------------------------- 1 | check_PROGRAMS = json_process 2 | 3 | AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src 4 | LDFLAGS = -static # for speed and Valgrind 5 | LDADD = $(top_builddir)/src/libjansson.la 6 | -------------------------------------------------------------------------------- /submodules/jansson/test/run-suites: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | while [ -n "$1" ]; do 4 | suite=$1 5 | if [ -x $top_srcdir/test/suites/$suite/run ]; then 6 | SUITES="$SUITES $suite" 7 | else 8 | echo "No such suite: $suite" 9 | exit 1 10 | fi 11 | shift 12 | done 13 | 14 | if [ -z "$SUITES" ]; then 15 | suitedirs=$top_srcdir/test/suites/* 16 | for suitedir in $suitedirs; do 17 | if [ -d $suitedir ]; then 18 | SUITES="$SUITES `basename $suitedir`" 19 | fi 20 | done 21 | fi 22 | 23 | [ -z "$STOP" ] && STOP=0 24 | 25 | suites_srcdir=$top_srcdir/test/suites 26 | suites_builddir=suites 27 | scriptdir=$top_srcdir/test/scripts 28 | logdir=logs 29 | bindir=bin 30 | export suites_srcdir suites_builddir scriptdir logdir bindir 31 | 32 | passed=0 33 | failed=0 34 | for suite in $SUITES; do 35 | echo "Suite: $suite" 36 | if $suites_srcdir/$suite/run $suite; then 37 | passed=`expr $passed + 1` 38 | else 39 | failed=`expr $failed + 1` 40 | [ $STOP -eq 1 ] && break 41 | fi 42 | done 43 | 44 | if [ $failed -gt 0 ]; then 45 | echo "$failed of `expr $passed + $failed` test suites failed" 46 | exit 1 47 | else 48 | echo "$passed test suites passed" 49 | rm -rf $logdir 50 | fi 51 | -------------------------------------------------------------------------------- /submodules/jansson/test/scripts/valgrind.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009-2014 Petri Lehtinen 2 | # 3 | # Jansson is free software; you can redistribute it and/or modify 4 | # it under the terms of the MIT license. See LICENSE for details. 5 | 6 | [ -z "$VALGRIND" ] && VALGRIND=0 7 | 8 | VALGRIND_CMDLINE="valgrind --leak-check=full --show-reachable=yes --track-origins=yes -q" 9 | 10 | if [ $VALGRIND -eq 1 ]; then 11 | test_runner="$VALGRIND_CMDLINE" 12 | json_process="$VALGRIND_CMDLINE $json_process" 13 | else 14 | test_runner="" 15 | fi 16 | 17 | valgrind_check() { 18 | if [ $VALGRIND -eq 1 ]; then 19 | # Check for Valgrind error output. The valgrind option 20 | # --error-exitcode is not enough because Valgrind doesn't 21 | # think unfreed allocs are errors. 22 | if grep -E -q '^==[0-9]+== ' $1; then 23 | touch $test_log/valgrind_error 24 | return 1 25 | fi 26 | fi 27 | } 28 | 29 | valgrind_show_error() { 30 | if [ $VALGRIND -eq 1 -a -f $test_log/valgrind_error ]; then 31 | echo "valgrind detected an error" 32 | return 0 33 | fi 34 | return 1 35 | } 36 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/.gitattributes: -------------------------------------------------------------------------------- 1 | api/ text=auto 2 | * text eol=lf -------------------------------------------------------------------------------- /submodules/jansson/test/suites/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = api 2 | EXTRA_DIST = invalid invalid-unicode valid 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/api/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = run check-exports 2 | 3 | check_PROGRAMS = \ 4 | test_array \ 5 | test_copy \ 6 | test_dump \ 7 | test_dump_callback \ 8 | test_equal \ 9 | test_load \ 10 | test_loadb \ 11 | test_load_callback \ 12 | test_memory_funcs \ 13 | test_number \ 14 | test_object \ 15 | test_pack \ 16 | test_simple \ 17 | test_unpack 18 | 19 | test_array_SOURCES = test_array.c util.h 20 | test_copy_SOURCES = test_copy.c util.h 21 | test_dump_SOURCES = test_dump.c util.h 22 | test_dump_callback_SOURCES = test_dump_callback.c util.h 23 | test_load_SOURCES = test_load.c util.h 24 | test_loadb_SOURCES = test_loadb.c util.h 25 | test_memory_funcs_SOURCES = test_memory_funcs.c util.h 26 | test_number_SOURCES = test_number.c util.h 27 | test_object_SOURCES = test_object.c util.h 28 | test_pack_SOURCES = test_pack.c util.h 29 | test_simple_SOURCES = test_simple.c util.h 30 | test_unpack_SOURCES = test_unpack.c util.h 31 | 32 | AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src 33 | LDFLAGS = -static # for speed and Valgrind 34 | LDADD = $(top_builddir)/src/libjansson.la 35 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/api/check-exports: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # This test checks that libjansson.so exports the correct symbols. 4 | # 5 | 6 | SOFILE="../src/.libs/libjansson.so" 7 | 8 | # The list of symbols, which the shared object should export, is read 9 | # from the def file, which is used in Windows builds 10 | grep 'json_' $top_srcdir/src/jansson.def \ 11 | | sed -e 's/ //g' \ 12 | | sort \ 13 | >$test_log/exports 14 | 15 | nm -D $SOFILE >/dev/null >$test_log/symbols 2>/dev/null \ 16 | || exit 77 # Skip if "nm -D" doesn't seem to work 17 | 18 | grep ' [DT] ' $test_log/symbols | cut -d' ' -f3 | grep -v '^_' | sort >$test_log/output 19 | 20 | if ! cmp -s $test_log/exports $test_log/output; then 21 | diff -u $test_log/exports $test_log/output >&2 22 | exit 1 23 | fi 24 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/api/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2009-2014 Petri Lehtinen 4 | # 5 | # Jansson is free software; you can redistribute it and/or modify 6 | # it under the terms of the MIT license. See LICENSE for details. 7 | 8 | is_test() { 9 | case "$test_name" in 10 | *.c|check-exports) 11 | return 0 12 | ;; 13 | *) 14 | return 1 15 | ;; 16 | esac 17 | } 18 | 19 | run_test() { 20 | if [ "$test_name" = "check-exports" ]; then 21 | test_log=$test_log $test_path >$test_log/stdout 2>$test_log/stderr 22 | else 23 | $test_runner $suite_builddir/${test_name%.c} \ 24 | >$test_log/stdout \ 25 | 2>$test_log/stderr \ 26 | || return 1 27 | valgrind_check $test_log/stderr || return 1 28 | fi 29 | } 30 | 31 | show_error() { 32 | valgrind_show_error && return 33 | cat $test_log/stderr 34 | } 35 | 36 | . $top_srcdir/test/scripts/run-tests.sh 37 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/api/test_loadb.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #include 9 | #include 10 | #include "util.h" 11 | 12 | static void run_tests() 13 | { 14 | json_t *json; 15 | json_error_t error; 16 | const char str[] = "[\"A\", {\"B\": \"C\"}, 1, 2, 3]garbage"; 17 | size_t len = strlen(str) - strlen("garbage"); 18 | 19 | json = json_loadb(str, len, 0, &error); 20 | if(!json) { 21 | fail("json_loadb failed on a valid JSON buffer"); 22 | } 23 | json_decref(json); 24 | 25 | json = json_loadb(str, len - 1, 0, &error); 26 | if (json) { 27 | json_decref(json); 28 | fail("json_loadb should have failed on an incomplete buffer, but it didn't"); 29 | } 30 | if(error.line != 1) { 31 | fail("json_loadb returned an invalid line number on fail"); 32 | } 33 | if(strcmp(error.text, "']' expected near end of file") != 0) { 34 | fail("json_loadb returned an invalid error message for an unclosed top-level array"); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/api/test_memory_funcs.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "util.h" 5 | 6 | static int malloc_called = 0; 7 | static int free_called = 0; 8 | 9 | /* helper */ 10 | static void create_and_free_complex_object() 11 | { 12 | json_t *obj; 13 | 14 | obj = json_pack("{s:i,s:n,s:b,s:b,s:{s:s},s:[i,i,i]", 15 | "foo", 42, 16 | "bar", 17 | "baz", 1, 18 | "qux", 0, 19 | "alice", "bar", "baz", 20 | "bob", 9, 8, 7); 21 | 22 | json_decref(obj); 23 | } 24 | 25 | static void *my_malloc(size_t size) 26 | { 27 | malloc_called = 1; 28 | return malloc(size); 29 | } 30 | 31 | static void my_free(void *ptr) 32 | { 33 | free_called = 1; 34 | free(ptr); 35 | } 36 | 37 | static void test_simple() 38 | { 39 | json_set_alloc_funcs(my_malloc, my_free); 40 | create_and_free_complex_object(); 41 | 42 | if(malloc_called != 1 || free_called != 1) 43 | fail("Custom allocation failed"); 44 | } 45 | 46 | 47 | /* 48 | Test the secure memory functions code given in the API reference 49 | documentation, but by using plain memset instead of 50 | guaranteed_memset(). 51 | */ 52 | 53 | static void *secure_malloc(size_t size) 54 | { 55 | /* Store the memory area size in the beginning of the block */ 56 | void *ptr = malloc(size + 8); 57 | *((size_t *)ptr) = size; 58 | return (char *)ptr + 8; 59 | } 60 | 61 | static void secure_free(void *ptr) 62 | { 63 | size_t size; 64 | 65 | ptr = (char *)ptr - 8; 66 | size = *((size_t *)ptr); 67 | 68 | /*guaranteed_*/memset(ptr, 0, size + 8); 69 | free(ptr); 70 | } 71 | 72 | static void test_secure_funcs(void) 73 | { 74 | json_set_alloc_funcs(secure_malloc, secure_free); 75 | create_and_free_complex_object(); 76 | } 77 | 78 | static void run_tests() 79 | { 80 | test_simple(); 81 | test_secure_funcs(); 82 | } 83 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/api/test_number.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2014 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #include 9 | #include 10 | #include "util.h" 11 | 12 | static void run_tests() 13 | { 14 | json_t *integer, *real; 15 | json_int_t i; 16 | double d; 17 | 18 | integer = json_integer(5); 19 | real = json_real(100.1); 20 | 21 | if(!integer) 22 | fail("unable to create integer"); 23 | if(!real) 24 | fail("unable to create real"); 25 | 26 | i = json_integer_value(integer); 27 | if(i != 5) 28 | fail("wrong integer value"); 29 | 30 | d = json_real_value(real); 31 | if(d != 100.1) 32 | fail("wrong real value"); 33 | 34 | d = json_number_value(integer); 35 | if(d != 5.0) 36 | fail("wrong number value"); 37 | d = json_number_value(real); 38 | if(d != 100.1) 39 | fail("wrong number value"); 40 | 41 | json_decref(integer); 42 | json_decref(real); 43 | 44 | #ifdef NAN 45 | real = json_real(NAN); 46 | if(real != NULL) 47 | fail("could construct a real from NaN"); 48 | 49 | real = json_real(1.0); 50 | if(json_real_set(real, NAN) != -1) 51 | fail("could set a real to NaN"); 52 | 53 | if(json_real_value(real) != 1.0) 54 | fail("real value changed unexpectedly"); 55 | 56 | json_decref(real); 57 | #endif 58 | 59 | #ifdef INFINITY 60 | real = json_real(INFINITY); 61 | if(real != NULL) 62 | fail("could construct a real from Inf"); 63 | 64 | real = json_real(1.0); 65 | if(json_real_set(real, INFINITY) != -1) 66 | fail("could set a real to Inf"); 67 | 68 | if(json_real_value(real) != 1.0) 69 | fail("real value changed unexpectedly"); 70 | 71 | json_decref(real); 72 | #endif 73 | } 74 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/array/input: -------------------------------------------------------------------------------- 1 | [1, 2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/array/output: -------------------------------------------------------------------------------- 1 | [1, 2] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/compact-array/env: -------------------------------------------------------------------------------- 1 | JSON_COMPACT=1 2 | export JSON_COMPACT 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/compact-array/input: -------------------------------------------------------------------------------- 1 | [1, 2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/compact-array/output: -------------------------------------------------------------------------------- 1 | [1,2] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/compact-object/env: -------------------------------------------------------------------------------- 1 | JSON_COMPACT=1 2 | HASHSEED=1 3 | export JSON_COMPACT HASHSEED 4 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/compact-object/input: -------------------------------------------------------------------------------- 1 | {"a": 1, "b": 2} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/compact-object/output: -------------------------------------------------------------------------------- 1 | {"a":1,"b":2} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/ensure-ascii/env: -------------------------------------------------------------------------------- 1 | JSON_ENSURE_ASCII=1 2 | export JSON_ENSURE_ASCII 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/ensure-ascii/input: -------------------------------------------------------------------------------- 1 | [ 2 | "foo", 3 | "å ä ö", 4 | "foo åä", 5 | "åä foo", 6 | "å foo ä", 7 | "clef g: 𝄞" 8 | ] 9 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/ensure-ascii/output: -------------------------------------------------------------------------------- 1 | ["foo", "\u00E5 \u00E4 \u00F6", "foo \u00E5\u00E4", "\u00E5\u00E4 foo", "\u00E5 foo \u00E4", "clef g: \uD834\uDD1E"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-array/env: -------------------------------------------------------------------------------- 1 | JSON_INDENT=4 2 | export JSON_INDENT 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-array/input: -------------------------------------------------------------------------------- 1 | [1, 2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-array/output: -------------------------------------------------------------------------------- 1 | [ 2 | 1, 3 | 2 4 | ] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-compact-array/env: -------------------------------------------------------------------------------- 1 | JSON_INDENT=4 2 | JSON_COMPACT=1 3 | export JSON_INDENT JSON_COMPACT 4 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-compact-array/input: -------------------------------------------------------------------------------- 1 | [1, 2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-compact-array/output: -------------------------------------------------------------------------------- 1 | [ 2 | 1, 3 | 2 4 | ] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-compact-object/env: -------------------------------------------------------------------------------- 1 | JSON_INDENT=4 2 | JSON_COMPACT=1 3 | HASHSEED=1 4 | export JSON_INDENT JSON_COMPACT HASHSEED 5 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-compact-object/input: -------------------------------------------------------------------------------- 1 | {"a": 1, "b": 2} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-compact-object/output: -------------------------------------------------------------------------------- 1 | { 2 | "a":1, 3 | "b":2 4 | } -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-object/env: -------------------------------------------------------------------------------- 1 | JSON_INDENT=4 2 | HASHSEED=1 3 | export JSON_INDENT HASHSEED 4 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-object/input: -------------------------------------------------------------------------------- 1 | {"a": 1, "b": 2} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/indent-object/output: -------------------------------------------------------------------------------- 1 | { 2 | "a": 1, 3 | "b": 2 4 | } -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/object/env: -------------------------------------------------------------------------------- 1 | HASHSEED=1 2 | export HASHSEED 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/object/input: -------------------------------------------------------------------------------- 1 | {"a": 1, "b": 2} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/object/output: -------------------------------------------------------------------------------- 1 | {"a": 1, "b": 2} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/preserve-order/env: -------------------------------------------------------------------------------- 1 | JSON_PRESERVE_ORDER=1 2 | export JSON_PRESERVE_ORDER 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/preserve-order/input: -------------------------------------------------------------------------------- 1 | {"foo": 1, "bar": 2, "asdf": 3, "deadbeef": 4, "badc0ffee": 5, "qwerty": 6} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/preserve-order/output: -------------------------------------------------------------------------------- 1 | {"foo": 1, "bar": 2, "asdf": 3, "deadbeef": 4, "badc0ffee": 5, "qwerty": 6} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/real-precision/env: -------------------------------------------------------------------------------- 1 | JSON_REAL_PRECISION=4 2 | export JSON_REAL_PRECISION 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/real-precision/input: -------------------------------------------------------------------------------- 1 | [1.23456789, 1.0, 1.0000000000000002] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/real-precision/output: -------------------------------------------------------------------------------- 1 | [1.235, 1.0, 1.0] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2009-2014 Petri Lehtinen 4 | # 5 | # Jansson is free software; you can redistribute it and/or modify 6 | # it under the terms of the MIT license. See LICENSE for details. 7 | 8 | is_test() { 9 | test -d $test_path 10 | } 11 | 12 | run_test() { 13 | ( 14 | if [ -f $test_path/env ]; then 15 | . $test_path/env 16 | fi 17 | $json_process --env <$test_path/input >$test_log/stdout 2>$test_log/stderr 18 | ) 19 | valgrind_check $test_log/stderr || return 1 20 | cmp -s $test_path/output $test_log/stdout 21 | } 22 | 23 | show_error() { 24 | valgrind_show_error && return 25 | 26 | echo "EXPECTED OUTPUT:" 27 | nl -bn $test_path/output 28 | echo "ACTUAL OUTPUT:" 29 | nl -bn $test_log/stdout 30 | } 31 | 32 | . $top_srcdir/test/scripts/run-tests.sh 33 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/sort-keys/env: -------------------------------------------------------------------------------- 1 | JSON_SORT_KEYS=1 2 | export JSON_SORT_KEYS 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/sort-keys/input: -------------------------------------------------------------------------------- 1 | {"foo": 1, "bar": 2, "baz": 3, "quux": 4} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/encoding-flags/sort-keys/output: -------------------------------------------------------------------------------- 1 | {"bar": 2, "baz": 3, "foo": 1, "quux": 4} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/encoded-surrogate-half/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xed near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/encoded-surrogate-half/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/encoded-surrogate-half/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/error: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | unable to decode byte 0xe5 near '"\' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-after-backslash/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/error: -------------------------------------------------------------------------------- 1 | 1 1 1 2 | unable to decode byte 0xe5 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-array/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/error: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | unable to decode byte 0xe5 near '123' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-bigger-int/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/error: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | unable to decode byte 0xe5 near '"\u' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-escape/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/error: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | unable to decode byte 0xe5 near '1e1' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-exponent/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xe5 near 'a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-identifier/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xe5 near '0' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-int/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/error: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | unable to decode byte 0xe5 near '1e' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-real-after-e/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xe5 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/invalid-utf-8-in-string/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/error: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | unable to decode byte 0xe5 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/lone-invalid-utf-8/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0x81 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/lone-utf-8-continuation-byte/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/not-in-unicode-range/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xf4 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/not-in-unicode-range/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/not-in-unicode-range/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xe0 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/overlong-3-byte-encoding/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xf0 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/overlong-4-byte-encoding/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xc1 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/overlong-ascii-encoding/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/restricted-utf-8/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xfd near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/restricted-utf-8/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/restricted-utf-8/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2009-2014 Petri Lehtinen 4 | # 5 | # Jansson is free software; you can redistribute it and/or modify 6 | # it under the terms of the MIT license. See LICENSE for details. 7 | 8 | is_test() { 9 | test -d $test_path 10 | } 11 | 12 | run_test() { 13 | $json_process --env <$test_path/input >$test_log/stdout 2>$test_log/stderr 14 | valgrind_check $test_log/stderr || return 1 15 | cmp -s $test_path/error $test_log/stderr 16 | } 17 | 18 | show_error() { 19 | valgrind_show_error && return 20 | 21 | echo "EXPECTED ERROR:" 22 | nl -bn $test_path/error 23 | echo "ACTUAL ERROR:" 24 | nl -bn $test_log/stderr 25 | } 26 | 27 | . $top_srcdir/test/scripts/run-tests.sh 28 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/truncated-utf-8/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unable to decode byte 0xe0 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid-unicode/truncated-utf-8/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid-unicode/truncated-utf-8/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/apostrophe/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | invalid token near ''' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/apostrophe/input: -------------------------------------------------------------------------------- 1 | [' 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/ascii-unicode-identifier/error: -------------------------------------------------------------------------------- 1 | 1 1 1 2 | '[' or '{' expected near 'a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/ascii-unicode-identifier/input: -------------------------------------------------------------------------------- 1 | aå 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/brace-comma/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | string or '}' expected near ',' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/brace-comma/input: -------------------------------------------------------------------------------- 1 | {, 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/bracket-comma/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unexpected token near ',' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/bracket-comma/input: -------------------------------------------------------------------------------- 1 | [, 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/bracket-one-comma/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 4 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/bracket-one-comma/error.strip: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/bracket-one-comma/input: -------------------------------------------------------------------------------- 1 | [1, 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/empty/error: -------------------------------------------------------------------------------- 1 | 1 0 0 2 | '[' or '{' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/empty/input: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/submodules/jansson/test/suites/invalid/empty/input -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/extra-comma-in-array/error: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | unexpected token near ']' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/extra-comma-in-array/input: -------------------------------------------------------------------------------- 1 | [1,] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/extra-comma-in-multiline-array/error: -------------------------------------------------------------------------------- 1 | 6 1 17 2 | unexpected token near ']' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/extra-comma-in-multiline-array/input: -------------------------------------------------------------------------------- 1 | [1, 2 | 2, 3 | 3, 4 | 4, 5 | 5, 6 | ] 7 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/garbage-after-newline/error: -------------------------------------------------------------------------------- 1 | 2 3 11 2 | end of file expected near 'foo' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/garbage-after-newline/input: -------------------------------------------------------------------------------- 1 | [1,2,3] 2 | foo 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/garbage-at-the-end/error: -------------------------------------------------------------------------------- 1 | 1 10 10 2 | end of file expected near 'foo' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/garbage-at-the-end/input: -------------------------------------------------------------------------------- 1 | [1,2,3]foo 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/integer-starting-with-zero/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | invalid token near '0' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/integer-starting-with-zero/input: -------------------------------------------------------------------------------- 1 | [012] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-escape/error: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | invalid escape near '"\a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-escape/input: -------------------------------------------------------------------------------- 1 | ["\a <-- invalid escape"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-identifier/error: -------------------------------------------------------------------------------- 1 | 1 5 5 2 | invalid token near 'troo' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-identifier/input: -------------------------------------------------------------------------------- 1 | [troo 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-negative-integer/error: -------------------------------------------------------------------------------- 1 | 1 8 8 2 | ']' expected near 'foo' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-negative-integer/input: -------------------------------------------------------------------------------- 1 | [-123foo] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-negative-real/error: -------------------------------------------------------------------------------- 1 | 1 12 12 2 | ']' expected near 'foo' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-negative-real/input: -------------------------------------------------------------------------------- 1 | [-123.123foo] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-second-surrogate/error: -------------------------------------------------------------------------------- 1 | 1 62 62 2 | invalid Unicode '\uD888\u3210' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/invalid-second-surrogate/input: -------------------------------------------------------------------------------- 1 | ["\uD888\u3210 (first surrogate and invalid second surrogate)"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-open-brace/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 2 2 | string or '}' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-open-brace/error.strip: -------------------------------------------------------------------------------- 1 | 1 1 1 2 | string or '}' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-open-brace/input: -------------------------------------------------------------------------------- 1 | { 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-open-bracket/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 2 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-open-bracket/error.strip: -------------------------------------------------------------------------------- 1 | 1 1 1 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-open-bracket/input: -------------------------------------------------------------------------------- 1 | [ 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-second-surrogate/error: -------------------------------------------------------------------------------- 1 | 1 40 40 2 | invalid Unicode '\uDFAA' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/lone-second-surrogate/input: -------------------------------------------------------------------------------- 1 | ["\uDFAA (second surrogate on it's own)"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/minus-sign-without-number/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | invalid token near '-' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/minus-sign-without-number/input: -------------------------------------------------------------------------------- 1 | [-foo] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/negative-integer-starting-with-zero/error: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | invalid token near '-0' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/negative-integer-starting-with-zero/input: -------------------------------------------------------------------------------- 1 | [-012] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-in-object-key/error: -------------------------------------------------------------------------------- 1 | 1 15 15 2 | NUL byte in object key not supported near '"foo\u0000bar"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-in-object-key/input: -------------------------------------------------------------------------------- 1 | {"foo\u0000bar": 42} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-in-string/error: -------------------------------------------------------------------------------- 1 | 1 12 12 2 | control character 0x0 near '"null byte ' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-in-string/input: -------------------------------------------------------------------------------- 1 | ["null byte not allowed"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-in-string/nostrip: -------------------------------------------------------------------------------- 1 | The embedded NULL byte breaks json_loads(), which is used instead of 2 | json_loadf() in the stripped tests. 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-outside-string/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | invalid token near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-outside-string/input: -------------------------------------------------------------------------------- 1 | [ 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null-byte-outside-string/nostrip: -------------------------------------------------------------------------------- 1 | The embedded NULL byte breaks json_loads(), which is used instead of 2 | json_loadf() in the stripped tests. 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null/error: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | '[' or '{' expected near 'null' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/null/input: -------------------------------------------------------------------------------- 1 | null 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-apostrophes/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | string or '}' expected near ''' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-apostrophes/input: -------------------------------------------------------------------------------- 1 | {'a' 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-garbage-at-end/error: -------------------------------------------------------------------------------- 1 | 1 12 12 2 | '}' expected near '123' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-garbage-at-end/input: -------------------------------------------------------------------------------- 1 | {"a":"a" 123} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-in-unterminated-array/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 4 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-in-unterminated-array/error.strip: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-in-unterminated-array/input: -------------------------------------------------------------------------------- 1 | [{} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-no-colon/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 5 2 | ':' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-no-colon/error.strip: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | ':' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-no-colon/input: -------------------------------------------------------------------------------- 1 | {"a" 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-no-value/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 6 2 | unexpected token near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-no-value/error.strip: -------------------------------------------------------------------------------- 1 | 1 5 5 2 | unexpected token near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-no-value/input: -------------------------------------------------------------------------------- 1 | {"a": 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-unterminated-value/error.normal: -------------------------------------------------------------------------------- 1 | 1 7 7 2 | unexpected newline near '"a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-unterminated-value/error.strip: -------------------------------------------------------------------------------- 1 | 1 7 7 2 | premature end of input near '"a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/object-unterminated-value/input: -------------------------------------------------------------------------------- 1 | {"a":"a 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-garbage-after-e/error: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | invalid token near '1e' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-garbage-after-e/input: -------------------------------------------------------------------------------- 1 | [1ea] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-negative-overflow/error: -------------------------------------------------------------------------------- 1 | 1 15 15 2 | real number overflow near '-123123e100000' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-negative-overflow/input: -------------------------------------------------------------------------------- 1 | [-123123e100000] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-positive-overflow/error: -------------------------------------------------------------------------------- 1 | 1 14 14 2 | real number overflow near '123123e100000' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-positive-overflow/input: -------------------------------------------------------------------------------- 1 | [123123e100000] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-truncated-at-e/error: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | invalid token near '1e' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-truncated-at-e/input: -------------------------------------------------------------------------------- 1 | [1e] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-truncated-at-point/error: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | invalid token near '1.' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/real-truncated-at-point/input: -------------------------------------------------------------------------------- 1 | [1.] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2009-2014 Petri Lehtinen 4 | # 5 | # Jansson is free software; you can redistribute it and/or modify 6 | # it under the terms of the MIT license. See LICENSE for details. 7 | 8 | is_test() { 9 | test -d $test_path 10 | } 11 | 12 | do_run() { 13 | variant=$1 14 | s=".$1" 15 | 16 | strip=0 17 | if [ "$variant" = "strip" ]; then 18 | # This test should not be stripped 19 | [ -f $test_path/nostrip ] && return 20 | strip=1 21 | fi 22 | 23 | STRIP=$strip $json_process --env \ 24 | <$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s 25 | valgrind_check $test_log/stderr$s || return 1 26 | 27 | ref=error 28 | [ -f $test_path/error$s ] && ref=error$s 29 | 30 | if ! cmp -s $test_path/$ref $test_log/stderr$s; then 31 | echo $variant > $test_log/variant 32 | return 1 33 | fi 34 | } 35 | 36 | run_test() { 37 | do_run normal && do_run strip 38 | } 39 | 40 | show_error() { 41 | valgrind_show_error && return 42 | 43 | read variant < $test_log/variant 44 | s=".$variant" 45 | 46 | echo "VARIANT: $variant" 47 | 48 | echo "EXPECTED ERROR:" 49 | ref=error 50 | [ -f $test_path/error$s ] && ref=error$s 51 | nl -bn $test_path/$ref 52 | 53 | echo "ACTUAL ERROR:" 54 | nl -bn $test_log/stderr$s 55 | } 56 | 57 | . $top_srcdir/test/scripts/run-tests.sh 58 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/tab-character-in-string/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | control character 0x9 near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/tab-character-in-string/input: -------------------------------------------------------------------------------- 1 | [" <-- tab character"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/too-big-negative-integer/error: -------------------------------------------------------------------------------- 1 | 1 32 32 2 | too big negative integer 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/too-big-negative-integer/input: -------------------------------------------------------------------------------- 1 | [-123123123123123123123123123123] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/too-big-positive-integer/error: -------------------------------------------------------------------------------- 1 | 1 31 31 2 | too big integer 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/too-big-positive-integer/input: -------------------------------------------------------------------------------- 1 | [123123123123123123123123123123] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/truncated-unicode-surrogate/error: -------------------------------------------------------------------------------- 1 | 1 46 46 2 | invalid Unicode '\uDADA' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/truncated-unicode-surrogate/input: -------------------------------------------------------------------------------- 1 | ["\uDADA (first surrogate without the second)"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unicode-identifier/error: -------------------------------------------------------------------------------- 1 | 1 1 2 2 | '[' or '{' expected near 'å' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unicode-identifier/input: -------------------------------------------------------------------------------- 1 | å 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-array-and-object/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 3 2 | string or '}' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-array-and-object/error.strip: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | string or '}' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-array-and-object/input: -------------------------------------------------------------------------------- 1 | [{ 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-array/error.normal: -------------------------------------------------------------------------------- 1 | 2 0 5 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-array/error.strip: -------------------------------------------------------------------------------- 1 | 1 4 4 2 | ']' expected near end of file 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-array/input: -------------------------------------------------------------------------------- 1 | ["a" 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-empty-key/error.normal: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | unexpected newline near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-empty-key/error.strip: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | premature end of input near '"' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-empty-key/input: -------------------------------------------------------------------------------- 1 | {" 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-key/error.normal: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | unexpected newline near '"a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-key/error.strip: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | premature end of input near '"a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-key/input: -------------------------------------------------------------------------------- 1 | {"a 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-object-and-array/error: -------------------------------------------------------------------------------- 1 | 1 2 2 2 | string or '}' expected near '[' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-object-and-array/input: -------------------------------------------------------------------------------- 1 | {[ 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-string/error.normal: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | unexpected newline near '"a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-string/error.strip: -------------------------------------------------------------------------------- 1 | 1 3 3 2 | premature end of input near '"a' 3 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/invalid/unterminated-string/input: -------------------------------------------------------------------------------- 1 | ["a 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/complex-array/env: -------------------------------------------------------------------------------- 1 | JSON_SORT_KEYS=1 -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/complex-array/input: -------------------------------------------------------------------------------- 1 | [1,2,3,4, 2 | "a", "b", "c", 3 | {"foo": "bar", "core": "dump"}, 4 | true, false, true, true, null, false 5 | ] 6 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/complex-array/output: -------------------------------------------------------------------------------- 1 | [1, 2, 3, 4, "a", "b", "c", {"core": "dump", "foo": "bar"}, true, false, true, true, null, false] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-array/input: -------------------------------------------------------------------------------- 1 | [] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-array/output: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-object-in-array/input: -------------------------------------------------------------------------------- 1 | [{}] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-object-in-array/output: -------------------------------------------------------------------------------- 1 | [{}] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-object/input: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-object/output: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-string/input: -------------------------------------------------------------------------------- 1 | [""] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/empty-string/output: -------------------------------------------------------------------------------- 1 | [""] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/escaped-utf-control-char/input: -------------------------------------------------------------------------------- 1 | ["\u0012 escaped control character"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/escaped-utf-control-char/output: -------------------------------------------------------------------------------- 1 | ["\u0012 escaped control character"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/false/input: -------------------------------------------------------------------------------- 1 | [false] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/false/output: -------------------------------------------------------------------------------- 1 | [false] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/negative-int/input: -------------------------------------------------------------------------------- 1 | [-123] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/negative-int/output: -------------------------------------------------------------------------------- 1 | [-123] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/negative-one/input: -------------------------------------------------------------------------------- 1 | [-1] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/negative-one/output: -------------------------------------------------------------------------------- 1 | [-1] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/negative-zero/input: -------------------------------------------------------------------------------- 1 | [-0] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/negative-zero/output: -------------------------------------------------------------------------------- 1 | [0] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/null/input: -------------------------------------------------------------------------------- 1 | [null] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/null/output: -------------------------------------------------------------------------------- 1 | [null] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/one-byte-utf-8/input: -------------------------------------------------------------------------------- 1 | ["\u002c one-byte UTF-8"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/one-byte-utf-8/output: -------------------------------------------------------------------------------- 1 | [", one-byte UTF-8"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-capital-e-negative-exponent/input: -------------------------------------------------------------------------------- 1 | [1E-2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-capital-e-negative-exponent/output: -------------------------------------------------------------------------------- 1 | [0.01] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-capital-e-positive-exponent/input: -------------------------------------------------------------------------------- 1 | [1E+2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-capital-e-positive-exponent/output: -------------------------------------------------------------------------------- 1 | [100.0] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-capital-e/input: -------------------------------------------------------------------------------- 1 | [1E22] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-capital-e/output: -------------------------------------------------------------------------------- 1 | [1e22] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-exponent/input: -------------------------------------------------------------------------------- 1 | [123e45] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-exponent/output: -------------------------------------------------------------------------------- 1 | [1.2299999999999999e47] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-fraction-exponent/input: -------------------------------------------------------------------------------- 1 | [123.456e78] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-fraction-exponent/output: -------------------------------------------------------------------------------- 1 | [1.23456e80] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-negative-exponent/input: -------------------------------------------------------------------------------- 1 | [1e-2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-negative-exponent/output: -------------------------------------------------------------------------------- 1 | [0.01] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-positive-exponent/input: -------------------------------------------------------------------------------- 1 | [1e+2] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-positive-exponent/output: -------------------------------------------------------------------------------- 1 | [100.0] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-subnormal-number/input: -------------------------------------------------------------------------------- 1 | [1.8011670033376514e-308] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-subnormal-number/output: -------------------------------------------------------------------------------- 1 | [1.8011670033376514e-308] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-underflow/input: -------------------------------------------------------------------------------- 1 | [123e-10000000] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/real-underflow/output: -------------------------------------------------------------------------------- 1 | [0.0] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Copyright (c) 2009-2014 Petri Lehtinen 4 | # 5 | # Jansson is free software; you can redistribute it and/or modify 6 | # it under the terms of the MIT license. See LICENSE for details. 7 | 8 | JSON_SORT_KEYS=1 9 | export JSON_SORT_KEYS 10 | 11 | is_test() { 12 | test -d $test_path 13 | } 14 | 15 | do_run() { 16 | variant=$1 17 | s=".$1" 18 | 19 | strip=0 20 | [ "$variant" = "strip" ] && strip=1 21 | 22 | STRIP=$strip $json_process --env \ 23 | <$test_path/input >$test_log/stdout$s 2>$test_log/stderr$s 24 | valgrind_check $test_log/stderr$s || return 1 25 | 26 | ref=output 27 | [ -f $test_path/output$s ] && ref=output$s 28 | 29 | if ! cmp -s $test_path/$ref $test_log/stdout$s; then 30 | echo $variant > $test_log/variant 31 | return 1 32 | fi 33 | } 34 | 35 | run_test() { 36 | do_run normal && do_run strip 37 | } 38 | 39 | show_error() { 40 | valgrind_show_error && return 41 | 42 | read variant < $test_log/variant 43 | s=".$variant" 44 | 45 | echo "VARIANT: $variant" 46 | 47 | echo "EXPECTED OUTPUT:" 48 | ref=output 49 | [ -f $test_path/output$s ] && ref=output$s 50 | nl -bn $test_path/$ref 51 | 52 | echo "ACTUAL OUTPUT:" 53 | nl -bn $test_log/stdout$s 54 | } 55 | 56 | . $top_srcdir/test/scripts/run-tests.sh 57 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/short-string/input: -------------------------------------------------------------------------------- 1 | ["a"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/short-string/output: -------------------------------------------------------------------------------- 1 | ["a"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-ascii-string/input: -------------------------------------------------------------------------------- 1 | ["abcdefghijklmnopqrstuvwxyz1234567890 "] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-ascii-string/output: -------------------------------------------------------------------------------- 1 | ["abcdefghijklmnopqrstuvwxyz1234567890 "] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-int-0/input: -------------------------------------------------------------------------------- 1 | [0] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-int-0/output: -------------------------------------------------------------------------------- 1 | [0] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-int-1/input: -------------------------------------------------------------------------------- 1 | [1] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-int-1/output: -------------------------------------------------------------------------------- 1 | [1] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-int-123/input: -------------------------------------------------------------------------------- 1 | [123] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-int-123/output: -------------------------------------------------------------------------------- 1 | [123] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-object/input: -------------------------------------------------------------------------------- 1 | {"a":[]} 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-object/output: -------------------------------------------------------------------------------- 1 | {"a": []} -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-real/input: -------------------------------------------------------------------------------- 1 | [123.456789] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/simple-real/output: -------------------------------------------------------------------------------- 1 | [123.456789] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/string-escapes/input: -------------------------------------------------------------------------------- 1 | ["\"\\\/\b\f\n\r\t"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/string-escapes/output: -------------------------------------------------------------------------------- 1 | ["\"\\/\b\f\n\r\t"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/three-byte-utf-8/input: -------------------------------------------------------------------------------- 1 | ["\u0821 three-byte UTF-8"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/three-byte-utf-8/output: -------------------------------------------------------------------------------- 1 | ["ࠡ three-byte UTF-8"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/true/input: -------------------------------------------------------------------------------- 1 | [true] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/true/output: -------------------------------------------------------------------------------- 1 | [true] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/two-byte-utf-8/input: -------------------------------------------------------------------------------- 1 | ["\u0123 two-byte UTF-8"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/two-byte-utf-8/output: -------------------------------------------------------------------------------- 1 | ["ģ two-byte UTF-8"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/utf-8-string/input: -------------------------------------------------------------------------------- 1 | ["€þıœəßð some utf-8 ĸʒ×ŋµåäö𝄞"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/utf-8-string/output: -------------------------------------------------------------------------------- 1 | ["€þıœəßð some utf-8 ĸʒ×ŋµåäö𝄞"] -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/input: -------------------------------------------------------------------------------- 1 | ["\uD834\uDD1E surrogate, four-byte UTF-8"] 2 | -------------------------------------------------------------------------------- /submodules/jansson/test/suites/valid/utf-surrogate-four-byte-encoding/output: -------------------------------------------------------------------------------- 1 | ["𝄞 surrogate, four-byte UTF-8"] -------------------------------------------------------------------------------- /sysfs-gpu-controls.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSFS_GPU_CONTROLS_H 2 | #define __SYSFS_GPU_CONTROLS_H 3 | 4 | #include "miner.h" 5 | 6 | extern bool has_sysfs_hwcontrols; 7 | extern bool opt_reorder; 8 | extern int opt_hysteresis; 9 | extern int opt_targettemp; 10 | extern int opt_overheattemp; 11 | 12 | bool init_sysfs_hwcontrols(int nDevs); 13 | float sysfs_gpu_temp(int gpu); 14 | int sysfs_gpu_engineclock(int gpu); 15 | int sysfs_gpu_memclock(int gpu); 16 | float sysfs_gpu_vddc(int gpu); 17 | int sysfs_gpu_activity(int gpu); 18 | int sysfs_gpu_fanspeed(int gpu); 19 | float sysfs_gpu_fanpercent(int gpu); 20 | int sysfs_set_powertune(int gpu, int iPercentage); 21 | 22 | bool sysfs_gpu_stats(int gpu, float *temp, int *engineclock, int *memclock, float *vddc, 23 | int *activity, int *fanspeed, int *fanpercent, int *powertune); 24 | void sysfs_gpu_autotune(int gpu, enum dev_enable *denable); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /test.bat: -------------------------------------------------------------------------------- 1 | setx GPU_FORCE_64BIT_PTR 0 2 | 3 | 4 | setx GPU_MAX_HEAP_SIZE 100 5 | 6 | 7 | setx GPU_USE_SYNC_OBJECTS 1 8 | 9 | 10 | setx GPU_MAX_ALLOC_PERCENT 100 11 | 12 | 13 | del *.bin 14 | 15 | 16 | 17 | kernel\sgminer.exe --no-submit-stale --kernel Lyra2h -o stratum+tcp://hpp.jkpool.com:3003 -u djm34.1 -p password -w 16 -I 16 18 | 19 | pause -------------------------------------------------------------------------------- /tools/update_changelog.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | FILE="$(dirname "$0")/../ChangeLog" 4 | UPDATECMD="git log --oneline --decorate" 5 | 6 | echo "Updated on `date`." > $FILE 7 | echo "If working with git, use \`$UPDATECMD\` for latest change log." >> $FILE 8 | echo "------------------------------------------------------------------------" >> $FILE 9 | $UPDATECMD >> $FILE 10 | -------------------------------------------------------------------------------- /winbuild/dist/dll/x64/OpenCL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/dll/x64/OpenCL.dll -------------------------------------------------------------------------------- /winbuild/dist/dll/x86/OpenCL.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/dll/x86/OpenCL.dll -------------------------------------------------------------------------------- /winbuild/dist/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef __STDC_HEADERS_H 2 | #define __STDC_HEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at http://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread (void *, size_t, size_t, FILE *); 28 | size_t fwrite (const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* __STDC_HEADERS_H */ 34 | -------------------------------------------------------------------------------- /winbuild/dist/include/gitversion.h: -------------------------------------------------------------------------------- 1 | #define USE_GIT_VERSION 1 2 | -------------------------------------------------------------------------------- /winbuild/dist/include/jansson_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2014 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * jansson.h. 11 | * 12 | * The CMake system will generate the jansson_config.h file and 13 | * copy it to the build and install directories. 14 | */ 15 | 16 | #ifndef JANSSON_CONFIG_H 17 | #define JANSSON_CONFIG_H 18 | 19 | /* Define this so that we can disable scattered automake configuration in source files */ 20 | #ifndef JANSSON_USING_CMAKE 21 | #define JANSSON_USING_CMAKE 22 | #endif 23 | 24 | /* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, 25 | * as we will also check for __int64 etc types. 26 | * (the definition was used in the automake system) */ 27 | 28 | /* Include our standard type header for the integer typedef */ 29 | 30 | #if defined(HAVE_STDINT_H) 31 | # include 32 | #elif defined(HAVE_INTTYPES_H) 33 | # include 34 | #elif defined(HAVE_SYS_TYPES_H) 35 | # include 36 | #endif 37 | 38 | 39 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 40 | defined to `inline', otherwise empty. In C++, the inline is always 41 | supported. */ 42 | #ifdef __cplusplus 43 | #define JSON_INLINE inline 44 | #else 45 | #define JSON_INLINE __inline 46 | #endif 47 | 48 | 49 | #define json_int_t long long 50 | #define json_strtoint _strtoi64 51 | #define JSON_INTEGER_FORMAT "I64d" 52 | 53 | 54 | /* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ 55 | #define JSON_HAVE_LOCALECONV 1 56 | 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /winbuild/dist/include/jansson_private_config.h: -------------------------------------------------------------------------------- 1 | /* #undef HAVE_ENDIAN_H */ 2 | #define HAVE_FCNTL_H 1 3 | /* #undef HAVE_SCHED_H */ 4 | /* #undef HAVE_UNISTD_H */ 5 | /* #undef HAVE_SYS_PARAM_H */ 6 | #define HAVE_SYS_STAT_H 1 7 | /* #undef HAVE_SYS_TIME_H */ 8 | /* #undef HAVE_SYS_TYPES_H */ 9 | #define HAVE_STDINT_H 1 10 | 11 | #define HAVE_CLOSE 1 12 | #define HAVE_GETPID 1 13 | /* #undef HAVE_GETTIMEOFDAY */ 14 | #define HAVE_OPEN 1 15 | #define HAVE_READ 1 16 | /* #undef HAVE_SCHED_YIELD */ 17 | 18 | /* #undef HAVE_SYNC_BUILTINS */ 19 | /* #undef HAVE_ATOMIC_BUILTINS */ 20 | 21 | #define HAVE_LOCALE_H 1 22 | /* #undef HAVE_SETLOCALE */ 23 | 24 | #define HAVE_INT32_T 1 25 | #ifndef HAVE_INT32_T 26 | # define int32_t int32_t 27 | #endif 28 | 29 | #define HAVE_UINT32_T 1 30 | #ifndef HAVE_UINT32_T 31 | # define uint32_t uint32_t 32 | #endif 33 | 34 | #define HAVE_UINT16_T 1 35 | #ifndef HAVE_UINT16_T 36 | # define uint16_t uint16_t 37 | #endif 38 | 39 | #define HAVE_UINT8_T 1 40 | #ifndef HAVE_UINT8_T 41 | # define uint8_t uint8_t 42 | #endif 43 | 44 | /* #undef HAVE_SSIZE_T */ 45 | 46 | #ifndef HAVE_SSIZE_T 47 | # define ssize_t int 48 | #endif 49 | 50 | /* #undef HAVE_SNPRINTF */ 51 | 52 | #ifndef HAVE_SNPRINTF 53 | # define snprintf _snprintf 54 | #endif 55 | 56 | /* #undef HAVE_VSNPRINTF */ 57 | 58 | #define USE_URANDOM 1 59 | #define USE_WINDOWS_CRYPTOAPI 1 60 | -------------------------------------------------------------------------------- /winbuild/dist/include/libgen.h: -------------------------------------------------------------------------------- 1 | #pragma once -------------------------------------------------------------------------------- /winbuild/dist/include/stdbool.h: -------------------------------------------------------------------------------- 1 | /* stdbool.h standard header */ 2 | 3 | #ifndef _STDBOOL 4 | #define _STDBOOL 5 | 6 | #define __bool_true_false_are_defined 1 7 | 8 | #ifndef __cplusplus 9 | 10 | #define bool _Bool 11 | #define false 0 12 | #define true 1 13 | 14 | #endif /* __cplusplus */ 15 | 16 | #endif /* _STDBOOL */ 17 | 18 | /* 19 | * Copyright (c) 1992-2010 by P.J. Plauger. ALL RIGHTS RESERVED. 20 | * Consult your license regarding permissions and restrictions. 21 | V5.30:0009 */ 22 | -------------------------------------------------------------------------------- /winbuild/dist/include/sys/time.h: -------------------------------------------------------------------------------- 1 | #pragma once -------------------------------------------------------------------------------- /winbuild/dist/include/unistd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | /* Values for the second argument to access. 4 | These may be OR'd together. */ 5 | #define R_OK 4 /* Test for read permission. */ 6 | #define W_OK 2 /* Test for write permission. */ 7 | #define F_OK 0 /* Test for existence. */ 8 | 9 | // POSIX open,read,write... deprecated as of VC++ 2005. 10 | // Use ISO conformant _open,_read,_write instead. 11 | #define access _access 12 | #define dup2 _dup2 13 | #define execve _execve 14 | #define ftruncate _chsize 15 | #define unlink _unlink 16 | #define fileno _fileno 17 | #define getcwd _getcwd 18 | #define chdir _chdir 19 | #define isatty _isatty 20 | #define lseek _lseek 21 | #define open _open 22 | #define write _write 23 | #define close _close 24 | #define read _read 25 | #define snprintf _snprintf 26 | 27 | #define STDIN_FILENO 0 28 | #define STDOUT_FILENO 1 29 | #define STDERR_FILENO 2 -------------------------------------------------------------------------------- /winbuild/dist/lib/x64/OpenCL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x64/OpenCL.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x64/libcurl_a.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x64/libcurl_a.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x64/pdcurses.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x64/pdcurses.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x64/pthreadVC2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x64/pthreadVC2.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x64/zlibstat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x64/zlibstat.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/OpenCL.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/OpenCL.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/libcurl_a.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/libcurl_a.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/libeay32MT.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/libeay32MT.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/libeay32MTd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/libeay32MTd.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/panel.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/panel.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/pdcurses.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/pdcurses.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/pthreadVC2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/pthreadVC2.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/ssleay32MT.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/ssleay32MT.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/ssleay32MTd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/ssleay32MTd.lib -------------------------------------------------------------------------------- /winbuild/dist/lib/x86/zlibstat.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/dist/lib/x86/zlibstat.lib -------------------------------------------------------------------------------- /winbuild/jansson/Debug/x64/jansson.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/jansson/Debug/x64/jansson.lib -------------------------------------------------------------------------------- /winbuild/jansson/Debug/x86/jansson.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/jansson/Debug/x86/jansson.lib -------------------------------------------------------------------------------- /winbuild/jansson/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = bosjansson.def 2 | 3 | include_HEADERS = bosjansson.h 4 | nodist_include_HEADERS = jansson_config.h 5 | 6 | noinst_LIBRARIES = libbosjansson.a 7 | 8 | ###lib_LTLIBRARIES = libbosjansson.la 9 | libbosjansson_a_SOURCES = \ 10 | bos_deserializer.c \ 11 | bos_serializer.c \ 12 | dump.c \ 13 | error.c \ 14 | hashtable.c \ 15 | hashtable.h \ 16 | hashtable_seed.c \ 17 | jansson_private.h \ 18 | load.c \ 19 | lookup3.h \ 20 | memory.c \ 21 | pack_unpack.c \ 22 | strbuffer.c \ 23 | strbuffer.h \ 24 | strconv.c \ 25 | utf.c \ 26 | utf.h \ 27 | value.c 28 | #libbosjansson_a_LDFLAGS = \ 29 | # -no-undefined \ 30 | # -export-symbols-regex '^json_' \ 31 | # -version-info 15:0:11 \ 32 | # @JSON_BSYMBOLIC_LDFLAGS@ 33 | 34 | -------------------------------------------------------------------------------- /winbuild/jansson/Release/x64/jansson.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/jansson/Release/x64/jansson.lib -------------------------------------------------------------------------------- /winbuild/jansson/jansson.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | json_delete 3 | json_true 4 | json_false 5 | json_null 6 | json_string 7 | json_stringn 8 | json_string_nocheck 9 | json_stringn_nocheck 10 | json_string_value 11 | json_string_length 12 | json_string_set 13 | json_string_setn 14 | json_string_set_nocheck 15 | json_string_setn_nocheck 16 | json_integer 17 | json_integer_value 18 | json_integer_set 19 | json_real 20 | json_real_value 21 | json_real_set 22 | json_number_value 23 | json_array 24 | json_array_size 25 | json_array_get 26 | json_array_set_new 27 | json_array_append_new 28 | json_array_insert_new 29 | json_array_remove 30 | json_array_clear 31 | json_array_extend 32 | json_object 33 | json_object_size 34 | json_object_get 35 | json_object_set_new 36 | json_object_set_new_nocheck 37 | json_object_del 38 | json_object_clear 39 | json_object_update 40 | json_object_update_existing 41 | json_object_update_missing 42 | json_object_iter 43 | json_object_iter_at 44 | json_object_iter_next 45 | json_object_iter_key 46 | json_object_iter_value 47 | json_object_iter_set_new 48 | json_object_key_to_iter 49 | json_object_seed 50 | json_dumps 51 | json_dumpf 52 | json_dump_file 53 | json_dump_callback 54 | json_loads 55 | json_loadb 56 | json_loadf 57 | json_load_file 58 | json_load_callback 59 | json_equal 60 | json_copy 61 | json_deep_copy 62 | json_pack 63 | json_pack_ex 64 | json_vpack_ex 65 | json_unpack 66 | json_unpack_ex 67 | json_vunpack_ex 68 | json_set_alloc_funcs 69 | json_get_alloc_funcs 70 | 71 | -------------------------------------------------------------------------------- /winbuild/jansson/jansson_config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * bosjansson.h. 11 | * 12 | * The configure script copies this file to jansson_config.h and 13 | * replaces @var@ substitutions by values that fit your system. If you 14 | * cannot run the configure script, you can do the value substitution 15 | * by hand. 16 | */ 17 | 18 | #ifndef JANSSON_CONFIG_H 19 | #define JANSSON_CONFIG_H 20 | 21 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 22 | defined to `inline', otherwise empty. In C++, the inline is always 23 | supported. */ 24 | #ifdef __cplusplus 25 | #define JSON_INLINE inline 26 | #else 27 | #define JSON_INLINE @json_inline@ 28 | #endif 29 | 30 | /* If your compiler supports the `long long` type and the strtoll() 31 | library function, JSON_INTEGER_IS_LONG_LONG is defined to 1, 32 | otherwise to 0. */ 33 | #define JSON_INTEGER_IS_LONG_LONG @json_have_long_long@ 34 | 35 | /* If locale.h and localeconv() are available, define to 1, 36 | otherwise to 0. */ 37 | #define JSON_HAVE_LOCALECONV @json_have_localeconv@ 38 | 39 | /* If __atomic builtins are available they will be used to manage 40 | reference counts of json_t. */ 41 | #define JSON_HAVE_ATOMIC_BUILTINS @json_have_atomic_builtins@ 42 | 43 | /* If __atomic builtins are not available we try using __sync builtins 44 | to manage reference counts of json_t. */ 45 | #define JSON_HAVE_SYNC_BUILTINS @json_have_sync_builtins@ 46 | 47 | /* Maximum recursion depth for parsing JSON input. 48 | This limits the depth of e.g. array-within-array constructions. */ 49 | #define JSON_PARSER_MAX_DEPTH 2048 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /winbuild/jansson/jansson_private_config.h: -------------------------------------------------------------------------------- 1 | /* #undef HAVE_ENDIAN_H */ 2 | #define HAVE_CONFIG_H 1 3 | #define HAVE_FCNTL_H 1 4 | /* #undef HAVE_SCHED_H */ 5 | /* #undef HAVE_UNISTD_H */ 6 | /* #undef HAVE_SYS_PARAM_H */ 7 | #define HAVE_SYS_STAT_H 1 8 | /* #undef HAVE_SYS_TIME_H */ 9 | #define HAVE_SYS_TYPES_H 1 10 | #define HAVE_STDINT_H 1 11 | 12 | #define HAVE_CLOSE 1 13 | #define HAVE_GETPID 1 14 | /* #undef HAVE_GETTIMEOFDAY */ 15 | #define HAVE_OPEN 1 16 | #define HAVE_READ 1 17 | /* #undef HAVE_SCHED_YIELD */ 18 | 19 | /* #undef HAVE_SYNC_BUILTINS */ 20 | /* #undef HAVE_ATOMIC_BUILTINS */ 21 | 22 | #define HAVE_LOCALE_H 1 23 | #define HAVE_SETLOCALE 1 24 | 25 | #define HAVE_INT32_T 1 26 | #ifndef HAVE_INT32_T 27 | # define int32_t int32_t 28 | #endif 29 | 30 | #define HAVE_UINT32_T 1 31 | #ifndef HAVE_UINT32_T 32 | # define uint32_t uint32_t 33 | #endif 34 | 35 | #define HAVE_UINT16_T 1 36 | #ifndef HAVE_UINT16_T 37 | # define uint16_t uint16_t 38 | #endif 39 | 40 | #define HAVE_UINT8_T 1 41 | #ifndef HAVE_UINT8_T 42 | # define uint8_t uint8_t 43 | #endif 44 | 45 | /* #undef HAVE_SSIZE_T */ 46 | #define HAVE_SSIZE_T 0 47 | #ifndef HAVE_SSIZE_T 48 | # define ssize_t int 49 | #endif 50 | 51 | #define USE_URANDOM 1 52 | #define USE_WINDOWS_CRYPTOAPI 1 53 | 54 | #define INITIAL_HASHTABLE_ORDER 3 55 | -------------------------------------------------------------------------------- /winbuild/jansson/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * Copyright (c) 2011-2012 Basile Starynkevitch 4 | * 5 | * Jansson is free software; you can redistribute it and/or modify it 6 | * under the terms of the MIT license. See LICENSE for details. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | #include "bosjansson.h" 13 | #include "jansson_private.h" 14 | 15 | /* C89 allows these to be macros */ 16 | #undef malloc 17 | #undef free 18 | 19 | /* memory function pointers */ 20 | static json_malloc_t do_malloc = malloc; 21 | static json_free_t do_free = free; 22 | 23 | void *jsonp_malloc(size_t size) 24 | { 25 | if(!size) 26 | return NULL; 27 | 28 | return (*do_malloc)(size); 29 | } 30 | 31 | void jsonp_free(void *ptr) 32 | { 33 | if(!ptr) 34 | return; 35 | 36 | (*do_free)(ptr); 37 | } 38 | 39 | char *jsonp_strdup(const char *str) 40 | { 41 | return jsonp_strndup(str, strlen(str)); 42 | } 43 | 44 | char *jsonp_strndup(const char *str, size_t len) 45 | { 46 | char *new_str; 47 | 48 | new_str = jsonp_malloc(len + 1); 49 | if(!new_str) 50 | return NULL; 51 | 52 | memcpy(new_str, str, len); 53 | new_str[len] = '\0'; 54 | return new_str; 55 | } 56 | 57 | void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) 58 | { 59 | do_malloc = malloc_fn; 60 | do_free = free_fn; 61 | } 62 | 63 | void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn) 64 | { 65 | if (malloc_fn) 66 | *malloc_fn = do_malloc; 67 | if (free_fn) 68 | *free_fn = do_free; 69 | } 70 | -------------------------------------------------------------------------------- /winbuild/jansson/src/Makefile.am: -------------------------------------------------------------------------------- 1 | EXTRA_DIST = bosjansson.def 2 | 3 | include_HEADERS = bosjansson.h 4 | nodist_include_HEADERS = jansson_config.h 5 | 6 | noinst_LIBRARIES = libbosjansson.a 7 | 8 | ###lib_LTLIBRARIES = libbosjansson.la 9 | libbosjansson_a_SOURCES = \ 10 | bos_deserializer.c \ 11 | bos_serializer.c \ 12 | dump.c \ 13 | error.c \ 14 | hashtable.c \ 15 | hashtable.h \ 16 | hashtable_seed.c \ 17 | jansson_private.h \ 18 | load.c \ 19 | lookup3.h \ 20 | memory.c \ 21 | pack_unpack.c \ 22 | strbuffer.c \ 23 | strbuffer.h \ 24 | strconv.c \ 25 | utf.c \ 26 | utf.h \ 27 | value.c 28 | #libbosjansson_a_LDFLAGS = \ 29 | # -no-undefined \ 30 | # -export-symbols-regex '^json_' \ 31 | # -version-info 15:0:11 \ 32 | # @JSON_BSYMBOLIC_LDFLAGS@ 33 | 34 | -------------------------------------------------------------------------------- /winbuild/jansson/src/jansson.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | json_delete 3 | json_true 4 | json_false 5 | json_null 6 | json_string 7 | json_stringn 8 | json_string_nocheck 9 | json_stringn_nocheck 10 | json_string_value 11 | json_string_length 12 | json_string_set 13 | json_string_setn 14 | json_string_set_nocheck 15 | json_string_setn_nocheck 16 | json_integer 17 | json_integer_value 18 | json_integer_set 19 | json_real 20 | json_real_value 21 | json_real_set 22 | json_number_value 23 | json_array 24 | json_array_size 25 | json_array_get 26 | json_array_set_new 27 | json_array_append_new 28 | json_array_insert_new 29 | json_array_remove 30 | json_array_clear 31 | json_array_extend 32 | json_object 33 | json_object_size 34 | json_object_get 35 | json_object_set_new 36 | json_object_set_new_nocheck 37 | json_object_del 38 | json_object_clear 39 | json_object_update 40 | json_object_update_existing 41 | json_object_update_missing 42 | json_object_iter 43 | json_object_iter_at 44 | json_object_iter_next 45 | json_object_iter_key 46 | json_object_iter_value 47 | json_object_iter_set_new 48 | json_object_key_to_iter 49 | json_object_seed 50 | json_dumps 51 | json_dumpf 52 | json_dump_file 53 | json_dump_callback 54 | json_loads 55 | json_loadb 56 | json_loadf 57 | json_load_file 58 | json_load_callback 59 | json_equal 60 | json_copy 61 | json_deep_copy 62 | json_pack 63 | json_pack_ex 64 | json_vpack_ex 65 | json_unpack 66 | json_unpack_ex 67 | json_vunpack_ex 68 | json_set_alloc_funcs 69 | json_get_alloc_funcs 70 | 71 | -------------------------------------------------------------------------------- /winbuild/jansson/src/jansson_config.h.in: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | * 7 | * 8 | * This file specifies a part of the site-specific configuration for 9 | * Jansson, namely those things that affect the public API in 10 | * bosjansson.h. 11 | * 12 | * The configure script copies this file to jansson_config.h and 13 | * replaces @var@ substitutions by values that fit your system. If you 14 | * cannot run the configure script, you can do the value substitution 15 | * by hand. 16 | */ 17 | 18 | #ifndef JANSSON_CONFIG_H 19 | #define JANSSON_CONFIG_H 20 | 21 | /* If your compiler supports the inline keyword in C, JSON_INLINE is 22 | defined to `inline', otherwise empty. In C++, the inline is always 23 | supported. */ 24 | #ifdef __cplusplus 25 | #define JSON_INLINE inline 26 | #else 27 | #define JSON_INLINE @json_inline@ 28 | #endif 29 | 30 | /* If your compiler supports the `long long` type and the strtoll() 31 | library function, JSON_INTEGER_IS_LONG_LONG is defined to 1, 32 | otherwise to 0. */ 33 | #define JSON_INTEGER_IS_LONG_LONG @json_have_long_long@ 34 | 35 | /* If locale.h and localeconv() are available, define to 1, 36 | otherwise to 0. */ 37 | #define JSON_HAVE_LOCALECONV @json_have_localeconv@ 38 | 39 | /* If __atomic builtins are available they will be used to manage 40 | reference counts of json_t. */ 41 | #define JSON_HAVE_ATOMIC_BUILTINS @json_have_atomic_builtins@ 42 | 43 | /* If __atomic builtins are not available we try using __sync builtins 44 | to manage reference counts of json_t. */ 45 | #define JSON_HAVE_SYNC_BUILTINS @json_have_sync_builtins@ 46 | 47 | /* Maximum recursion depth for parsing JSON input. 48 | This limits the depth of e.g. array-within-array constructions. */ 49 | #define JSON_PARSER_MAX_DEPTH 2048 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /winbuild/jansson/src/jansson_private_config.h: -------------------------------------------------------------------------------- 1 | /* #undef HAVE_ENDIAN_H */ 2 | #define HAVE_CONFIG_H 1 3 | #define HAVE_FCNTL_H 1 4 | /* #undef HAVE_SCHED_H */ 5 | /* #undef HAVE_UNISTD_H */ 6 | /* #undef HAVE_SYS_PARAM_H */ 7 | #define HAVE_SYS_STAT_H 1 8 | /* #undef HAVE_SYS_TIME_H */ 9 | #define HAVE_SYS_TYPES_H 1 10 | #define HAVE_STDINT_H 1 11 | 12 | #define HAVE_CLOSE 1 13 | #define HAVE_GETPID 1 14 | /* #undef HAVE_GETTIMEOFDAY */ 15 | #define HAVE_OPEN 1 16 | #define HAVE_READ 1 17 | /* #undef HAVE_SCHED_YIELD */ 18 | 19 | /* #undef HAVE_SYNC_BUILTINS */ 20 | /* #undef HAVE_ATOMIC_BUILTINS */ 21 | 22 | #define HAVE_LOCALE_H 1 23 | #define HAVE_SETLOCALE 1 24 | 25 | #define HAVE_INT32_T 1 26 | #ifndef HAVE_INT32_T 27 | # define int32_t int32_t 28 | #endif 29 | 30 | #define HAVE_UINT32_T 1 31 | #ifndef HAVE_UINT32_T 32 | # define uint32_t uint32_t 33 | #endif 34 | 35 | #define HAVE_UINT16_T 1 36 | #ifndef HAVE_UINT16_T 37 | # define uint16_t uint16_t 38 | #endif 39 | 40 | #define HAVE_UINT8_T 1 41 | #ifndef HAVE_UINT8_T 42 | # define uint8_t uint8_t 43 | #endif 44 | 45 | /* #undef HAVE_SSIZE_T */ 46 | #define HAVE_SSIZE_T 0 47 | #ifndef HAVE_SSIZE_T 48 | # define ssize_t int 49 | #endif 50 | 51 | #define USE_URANDOM 1 52 | #define USE_WINDOWS_CRYPTOAPI 1 53 | 54 | #define INITIAL_HASHTABLE_ORDER 3 55 | -------------------------------------------------------------------------------- /winbuild/jansson/src/memory.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * Copyright (c) 2011-2012 Basile Starynkevitch 4 | * 5 | * Jansson is free software; you can redistribute it and/or modify it 6 | * under the terms of the MIT license. See LICENSE for details. 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | #include "bosjansson.h" 13 | #include "jansson_private.h" 14 | 15 | /* C89 allows these to be macros */ 16 | #undef malloc 17 | #undef free 18 | 19 | /* memory function pointers */ 20 | static json_malloc_t do_malloc = malloc; 21 | static json_free_t do_free = free; 22 | 23 | void *jsonp_malloc(size_t size) 24 | { 25 | if(!size) 26 | return NULL; 27 | 28 | return (*do_malloc)(size); 29 | } 30 | 31 | void jsonp_free(void *ptr) 32 | { 33 | if(!ptr) 34 | return; 35 | 36 | (*do_free)(ptr); 37 | } 38 | 39 | char *jsonp_strdup(const char *str) 40 | { 41 | return jsonp_strndup(str, strlen(str)); 42 | } 43 | 44 | char *jsonp_strndup(const char *str, size_t len) 45 | { 46 | char *new_str; 47 | 48 | new_str = jsonp_malloc(len + 1); 49 | if(!new_str) 50 | return NULL; 51 | 52 | memcpy(new_str, str, len); 53 | new_str[len] = '\0'; 54 | return new_str; 55 | } 56 | 57 | void json_set_alloc_funcs(json_malloc_t malloc_fn, json_free_t free_fn) 58 | { 59 | do_malloc = malloc_fn; 60 | do_free = free_fn; 61 | } 62 | 63 | void json_get_alloc_funcs(json_malloc_t *malloc_fn, json_free_t *free_fn) 64 | { 65 | if (malloc_fn) 66 | *malloc_fn = do_malloc; 67 | if (free_fn) 68 | *free_fn = do_free; 69 | } 70 | -------------------------------------------------------------------------------- /winbuild/jansson/src/strbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef STRBUFFER_H 9 | #define STRBUFFER_H 10 | 11 | #include 12 | 13 | typedef struct { 14 | char *value; 15 | size_t length; /* bytes used */ 16 | size_t size; /* bytes allocated */ 17 | } strbuffer_t; 18 | 19 | int strbuffer_init(strbuffer_t *strbuff) JANSSON_ATTRS(warn_unused_result); 20 | void strbuffer_close(strbuffer_t *strbuff); 21 | 22 | void strbuffer_clear(strbuffer_t *strbuff); 23 | 24 | const char *strbuffer_value(const strbuffer_t *strbuff); 25 | 26 | /* Steal the value and close the strbuffer */ 27 | char *strbuffer_steal_value(strbuffer_t *strbuff); 28 | 29 | int strbuffer_append_byte(strbuffer_t *strbuff, char byte); 30 | int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size); 31 | 32 | char strbuffer_pop(strbuffer_t *strbuff); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /winbuild/jansson/src/utf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef UTF_H 9 | #define UTF_H 10 | 11 | #ifdef HAVE_CONFIG_H 12 | #include 13 | #endif 14 | 15 | #ifdef HAVE_STDINT_H 16 | #include 17 | #endif 18 | 19 | int utf8_encode(int32_t codepoint, char *buffer, size_t *size); 20 | 21 | size_t utf8_check_first(char byte); 22 | size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint); 23 | const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint); 24 | 25 | int utf8_check_string(const char *string, size_t length); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /winbuild/jansson/strbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef STRBUFFER_H 9 | #define STRBUFFER_H 10 | 11 | #include 12 | 13 | typedef struct { 14 | char *value; 15 | size_t length; /* bytes used */ 16 | size_t size; /* bytes allocated */ 17 | } strbuffer_t; 18 | 19 | int strbuffer_init(strbuffer_t *strbuff) JANSSON_ATTRS(warn_unused_result); 20 | void strbuffer_close(strbuffer_t *strbuff); 21 | 22 | void strbuffer_clear(strbuffer_t *strbuff); 23 | 24 | const char *strbuffer_value(const strbuffer_t *strbuff); 25 | 26 | /* Steal the value and close the strbuffer */ 27 | char *strbuffer_steal_value(strbuffer_t *strbuff); 28 | 29 | int strbuffer_append_byte(strbuffer_t *strbuff, char byte); 30 | int strbuffer_append_bytes(strbuffer_t *strbuff, const char *data, size_t size); 31 | 32 | char strbuffer_pop(strbuffer_t *strbuff); 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /winbuild/jansson/utf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2009-2016 Petri Lehtinen 3 | * 4 | * Jansson is free software; you can redistribute it and/or modify 5 | * it under the terms of the MIT license. See LICENSE for details. 6 | */ 7 | 8 | #ifndef UTF_H 9 | #define UTF_H 10 | 11 | #ifdef HAVE_CONFIG_H 12 | #include 13 | #endif 14 | 15 | #ifdef HAVE_STDINT_H 16 | #include 17 | #endif 18 | 19 | int utf8_encode(int32_t codepoint, char *buffer, size_t *size); 20 | 21 | size_t utf8_check_first(char byte); 22 | size_t utf8_check_full(const char *buffer, size_t size, int32_t *codepoint); 23 | const char *utf8_iterate(const char *buffer, size_t size, int32_t *codepoint); 24 | 25 | int utf8_check_string(const char *string, size_t length); 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /winbuild/output/x64/Release/kernel/whirlpoolx.cl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/output/x64/Release/kernel/whirlpoolx.cl -------------------------------------------------------------------------------- /winbuild/output/x64/Release/sgminer.conf: -------------------------------------------------------------------------------- 1 | { 2 | "pools": [ 3 | { 4 | "url": "stratum+tcp://zcoin.mintpond.com:3000", 5 | "user": "aChWVb8CpgajadpLmiwDZvZaKizQgHxfh5.amd", 6 | "pass": "0,d=1000", 7 | "no-extranonce": true 8 | } 9 | ], 10 | "profiles": [], 11 | "failover-only": true, 12 | "algorithm": "mtp", 13 | "device": "0,1", 14 | "intensity": "22", 15 | "worksize": "128", 16 | "temp-cutoff": "95,95", 17 | "temp-overheat": "90,90", 18 | "temp-target": "80,80", 19 | "shares": "0" 20 | } -------------------------------------------------------------------------------- /winbuild/output/x64/Release/sgminer.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/output/x64/Release/sgminer.exp -------------------------------------------------------------------------------- /winbuild/output/x64/Release/sgminer.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/output/x64/Release/sgminer.lib -------------------------------------------------------------------------------- /winbuild/output/x64/Release/sgminer.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/firoorg/sgminer/0228460e174a021baab4b2faffbbe98c60d486d3/winbuild/output/x64/Release/sgminer.zip -------------------------------------------------------------------------------- /winbuild/output/x64/Release/test.bat: -------------------------------------------------------------------------------- 1 | setx GPU_FORCE_64BIT_PTR 0 2 | setx GPU_MAX_HEAP_SIZE 100 3 | setx GPU_USE_SYNC_OBJECTS 1 4 | setx GPU_MAX_ALLOC_PERCENT 100 5 | 6 | setx GPU_MAX_SINGLE_ALLOC_PERCENT 100 7 | 8 | 9 | del *.bin 10 | 11 | sgminer.exe --gpu-platform 2 12 | rem --gpu-platform 2 --text-only --more-notices --verbose --debug --protocol-dump 13 | 14 | pause -------------------------------------------------------------------------------- /winbuild/sgminer.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | WindowsLocalDebugger 7 | .\output\x64\Release 8 | C:\Users\djm34\Documents\GitHub\sgminer\winbuild\output\x64\Release\sgminer.exe 9 | 10 | --------------------------------------------------------------------------------