@point3/node-rdkafka 3.6.0-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +20 -0
- package/README.md +636 -0
- package/binding.gyp +154 -0
- package/deps/librdkafka/.clang-format +136 -0
- package/deps/librdkafka/.clang-format-cpp +103 -0
- package/deps/librdkafka/.dir-locals.el +10 -0
- package/deps/librdkafka/.formatignore +33 -0
- package/deps/librdkafka/.gdbmacros +19 -0
- package/deps/librdkafka/.github/CODEOWNERS +1 -0
- package/deps/librdkafka/.github/ISSUE_TEMPLATE +34 -0
- package/deps/librdkafka/.semaphore/run-all-tests.yml +77 -0
- package/deps/librdkafka/.semaphore/semaphore-integration.yml +250 -0
- package/deps/librdkafka/.semaphore/semaphore.yml +378 -0
- package/deps/librdkafka/.semaphore/verify-linux-packages.yml +41 -0
- package/deps/librdkafka/CHANGELOG.md +2208 -0
- package/deps/librdkafka/CMakeLists.txt +291 -0
- package/deps/librdkafka/CODE_OF_CONDUCT.md +46 -0
- package/deps/librdkafka/CONFIGURATION.md +209 -0
- package/deps/librdkafka/CONTRIBUTING.md +431 -0
- package/deps/librdkafka/Doxyfile +2375 -0
- package/deps/librdkafka/INTRODUCTION.md +2481 -0
- package/deps/librdkafka/LICENSE +26 -0
- package/deps/librdkafka/LICENSE.cjson +22 -0
- package/deps/librdkafka/LICENSE.crc32c +28 -0
- package/deps/librdkafka/LICENSE.fnv1a +18 -0
- package/deps/librdkafka/LICENSE.hdrhistogram +27 -0
- package/deps/librdkafka/LICENSE.lz4 +26 -0
- package/deps/librdkafka/LICENSE.murmur2 +25 -0
- package/deps/librdkafka/LICENSE.nanopb +22 -0
- package/deps/librdkafka/LICENSE.opentelemetry +203 -0
- package/deps/librdkafka/LICENSE.pycrc +23 -0
- package/deps/librdkafka/LICENSE.queue +31 -0
- package/deps/librdkafka/LICENSE.regexp +5 -0
- package/deps/librdkafka/LICENSE.snappy +36 -0
- package/deps/librdkafka/LICENSE.tinycthread +26 -0
- package/deps/librdkafka/LICENSE.wingetopt +49 -0
- package/deps/librdkafka/LICENSES.txt +625 -0
- package/deps/librdkafka/Makefile +125 -0
- package/deps/librdkafka/README.md +199 -0
- package/deps/librdkafka/README.win32 +26 -0
- package/deps/librdkafka/STATISTICS.md +624 -0
- package/deps/librdkafka/configure +214 -0
- package/deps/librdkafka/configure.self +331 -0
- package/deps/librdkafka/debian/changelog +111 -0
- package/deps/librdkafka/debian/compat +1 -0
- package/deps/librdkafka/debian/control +71 -0
- package/deps/librdkafka/debian/copyright +99 -0
- package/deps/librdkafka/debian/gbp.conf +9 -0
- package/deps/librdkafka/debian/librdkafka++1.install +1 -0
- package/deps/librdkafka/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/debian/librdkafka-dev.install +9 -0
- package/deps/librdkafka/debian/librdkafka1.docs +5 -0
- package/deps/librdkafka/debian/librdkafka1.install +1 -0
- package/deps/librdkafka/debian/librdkafka1.symbols +135 -0
- package/deps/librdkafka/debian/rules +19 -0
- package/deps/librdkafka/debian/source/format +1 -0
- package/deps/librdkafka/debian/watch +2 -0
- package/deps/librdkafka/dev-conf.sh +123 -0
- package/deps/librdkafka/examples/CMakeLists.txt +79 -0
- package/deps/librdkafka/examples/Makefile +167 -0
- package/deps/librdkafka/examples/README.md +42 -0
- package/deps/librdkafka/examples/alter_consumer_group_offsets.c +338 -0
- package/deps/librdkafka/examples/consumer.c +271 -0
- package/deps/librdkafka/examples/delete_records.c +233 -0
- package/deps/librdkafka/examples/describe_cluster.c +322 -0
- package/deps/librdkafka/examples/describe_consumer_groups.c +455 -0
- package/deps/librdkafka/examples/describe_topics.c +427 -0
- package/deps/librdkafka/examples/elect_leaders.c +317 -0
- package/deps/librdkafka/examples/globals.json +11 -0
- package/deps/librdkafka/examples/idempotent_producer.c +344 -0
- package/deps/librdkafka/examples/incremental_alter_configs.c +347 -0
- package/deps/librdkafka/examples/kafkatest_verifiable_client.cpp +945 -0
- package/deps/librdkafka/examples/list_consumer_group_offsets.c +359 -0
- package/deps/librdkafka/examples/list_consumer_groups.c +365 -0
- package/deps/librdkafka/examples/list_offsets.c +327 -0
- package/deps/librdkafka/examples/misc.c +287 -0
- package/deps/librdkafka/examples/openssl_engine_example.cpp +248 -0
- package/deps/librdkafka/examples/producer.c +251 -0
- package/deps/librdkafka/examples/producer.cpp +228 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.c +617 -0
- package/deps/librdkafka/examples/rdkafka_complex_consumer_example.cpp +467 -0
- package/deps/librdkafka/examples/rdkafka_consume_batch.cpp +264 -0
- package/deps/librdkafka/examples/rdkafka_example.c +853 -0
- package/deps/librdkafka/examples/rdkafka_example.cpp +679 -0
- package/deps/librdkafka/examples/rdkafka_performance.c +1781 -0
- package/deps/librdkafka/examples/transactions-older-broker.c +668 -0
- package/deps/librdkafka/examples/transactions.c +665 -0
- package/deps/librdkafka/examples/user_scram.c +491 -0
- package/deps/librdkafka/examples/win_ssl_cert_store.cpp +396 -0
- package/deps/librdkafka/lds-gen.py +73 -0
- package/deps/librdkafka/mainpage.doxy +40 -0
- package/deps/librdkafka/mklove/Makefile.base +329 -0
- package/deps/librdkafka/mklove/modules/configure.atomics +144 -0
- package/deps/librdkafka/mklove/modules/configure.base +2484 -0
- package/deps/librdkafka/mklove/modules/configure.builtin +70 -0
- package/deps/librdkafka/mklove/modules/configure.cc +186 -0
- package/deps/librdkafka/mklove/modules/configure.cxx +8 -0
- package/deps/librdkafka/mklove/modules/configure.fileversion +65 -0
- package/deps/librdkafka/mklove/modules/configure.gitversion +29 -0
- package/deps/librdkafka/mklove/modules/configure.good_cflags +18 -0
- package/deps/librdkafka/mklove/modules/configure.host +132 -0
- package/deps/librdkafka/mklove/modules/configure.lib +49 -0
- package/deps/librdkafka/mklove/modules/configure.libcurl +99 -0
- package/deps/librdkafka/mklove/modules/configure.libsasl2 +36 -0
- package/deps/librdkafka/mklove/modules/configure.libssl +147 -0
- package/deps/librdkafka/mklove/modules/configure.libzstd +58 -0
- package/deps/librdkafka/mklove/modules/configure.parseversion +95 -0
- package/deps/librdkafka/mklove/modules/configure.pic +16 -0
- package/deps/librdkafka/mklove/modules/configure.socket +20 -0
- package/deps/librdkafka/mklove/modules/configure.zlib +61 -0
- package/deps/librdkafka/mklove/modules/patches/README.md +8 -0
- package/deps/librdkafka/mklove/modules/patches/libcurl.0000-no-runtime-linking-check.patch +11 -0
- package/deps/librdkafka/mklove/modules/patches/libssl.0000-osx-rand-include-fix-OpenSSL-PR16409.patch +56 -0
- package/deps/librdkafka/packaging/RELEASE.md +319 -0
- package/deps/librdkafka/packaging/alpine/build-alpine.sh +38 -0
- package/deps/librdkafka/packaging/archlinux/PKGBUILD +30 -0
- package/deps/librdkafka/packaging/cmake/Config.cmake.in +37 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindLZ4.cmake +38 -0
- package/deps/librdkafka/packaging/cmake/Modules/FindZSTD.cmake +27 -0
- package/deps/librdkafka/packaging/cmake/Modules/LICENSE.FindZstd +178 -0
- package/deps/librdkafka/packaging/cmake/README.md +38 -0
- package/deps/librdkafka/packaging/cmake/config.h.in +52 -0
- package/deps/librdkafka/packaging/cmake/parseversion.cmake +60 -0
- package/deps/librdkafka/packaging/cmake/rdkafka.pc.in +12 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/atomic_64_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/c11threads_test.c +14 -0
- package/deps/librdkafka/packaging/cmake/try_compile/crc32c_hw_test.c +27 -0
- package/deps/librdkafka/packaging/cmake/try_compile/dlopen_test.c +11 -0
- package/deps/librdkafka/packaging/cmake/try_compile/libsasl2_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_darwin_test.c +6 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_freebsd_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/pthread_setname_gnu_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rand_r_test.c +7 -0
- package/deps/librdkafka/packaging/cmake/try_compile/rdkafka_setup.cmake +122 -0
- package/deps/librdkafka/packaging/cmake/try_compile/regex_test.c +10 -0
- package/deps/librdkafka/packaging/cmake/try_compile/strndup_test.c +5 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_32_test.c +8 -0
- package/deps/librdkafka/packaging/cmake/try_compile/sync_64_test.c +8 -0
- package/deps/librdkafka/packaging/cp/README.md +16 -0
- package/deps/librdkafka/packaging/cp/check_features.c +72 -0
- package/deps/librdkafka/packaging/cp/verify-deb.sh +33 -0
- package/deps/librdkafka/packaging/cp/verify-packages.sh +69 -0
- package/deps/librdkafka/packaging/cp/verify-rpm.sh +32 -0
- package/deps/librdkafka/packaging/debian/changelog +66 -0
- package/deps/librdkafka/packaging/debian/compat +1 -0
- package/deps/librdkafka/packaging/debian/control +49 -0
- package/deps/librdkafka/packaging/debian/copyright +84 -0
- package/deps/librdkafka/packaging/debian/docs +5 -0
- package/deps/librdkafka/packaging/debian/gbp.conf +9 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.dirs +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.examples +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.install +6 -0
- package/deps/librdkafka/packaging/debian/librdkafka-dev.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka.dsc +16 -0
- package/deps/librdkafka/packaging/debian/librdkafka1-dbg.substvars +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.dirs +1 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.install +2 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postinst.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.postrm.debhelper +5 -0
- package/deps/librdkafka/packaging/debian/librdkafka1.symbols +64 -0
- package/deps/librdkafka/packaging/debian/rules +19 -0
- package/deps/librdkafka/packaging/debian/source/format +1 -0
- package/deps/librdkafka/packaging/debian/watch +2 -0
- package/deps/librdkafka/packaging/get_version.py +21 -0
- package/deps/librdkafka/packaging/homebrew/README.md +15 -0
- package/deps/librdkafka/packaging/homebrew/brew-update-pr.sh +31 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw-static.sh +52 -0
- package/deps/librdkafka/packaging/mingw-w64/configure-build-msys2-mingw.sh +21 -0
- package/deps/librdkafka/packaging/mingw-w64/export-variables.sh +13 -0
- package/deps/librdkafka/packaging/mingw-w64/run-tests.sh +6 -0
- package/deps/librdkafka/packaging/mingw-w64/semaphoreci-build.sh +38 -0
- package/deps/librdkafka/packaging/nuget/README.md +84 -0
- package/deps/librdkafka/packaging/nuget/artifact.py +177 -0
- package/deps/librdkafka/packaging/nuget/cleanup-s3.py +143 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-win32__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr120.zip +0 -0
- package/deps/librdkafka/packaging/nuget/common/p-common__plat-windows__arch-x64__bldtype-Release/msvcr140.zip +0 -0
- package/deps/librdkafka/packaging/nuget/nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/nugetpackage.py +278 -0
- package/deps/librdkafka/packaging/nuget/packaging.py +448 -0
- package/deps/librdkafka/packaging/nuget/push-to-nuget.sh +21 -0
- package/deps/librdkafka/packaging/nuget/release.py +167 -0
- package/deps/librdkafka/packaging/nuget/requirements.txt +3 -0
- package/deps/librdkafka/packaging/nuget/staticpackage.py +178 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.nuspec +21 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.props +18 -0
- package/deps/librdkafka/packaging/nuget/templates/librdkafka.redist.targets +19 -0
- package/deps/librdkafka/packaging/nuget/zfile/__init__.py +0 -0
- package/deps/librdkafka/packaging/nuget/zfile/zfile.py +98 -0
- package/deps/librdkafka/packaging/rpm/Makefile +92 -0
- package/deps/librdkafka/packaging/rpm/README.md +23 -0
- package/deps/librdkafka/packaging/rpm/el7-x86_64.cfg +40 -0
- package/deps/librdkafka/packaging/rpm/librdkafka.spec +118 -0
- package/deps/librdkafka/packaging/rpm/mock-on-docker.sh +96 -0
- package/deps/librdkafka/packaging/rpm/tests/Makefile +25 -0
- package/deps/librdkafka/packaging/rpm/tests/README.md +8 -0
- package/deps/librdkafka/packaging/rpm/tests/run-test.sh +42 -0
- package/deps/librdkafka/packaging/rpm/tests/test-on-docker.sh +56 -0
- package/deps/librdkafka/packaging/rpm/tests/test.c +77 -0
- package/deps/librdkafka/packaging/rpm/tests/test.cpp +34 -0
- package/deps/librdkafka/packaging/tools/Dockerfile +31 -0
- package/deps/librdkafka/packaging/tools/build-configurations-checks.sh +12 -0
- package/deps/librdkafka/packaging/tools/build-deb-package.sh +64 -0
- package/deps/librdkafka/packaging/tools/build-debian.sh +65 -0
- package/deps/librdkafka/packaging/tools/build-manylinux.sh +68 -0
- package/deps/librdkafka/packaging/tools/build-release-artifacts.sh +139 -0
- package/deps/librdkafka/packaging/tools/distro-build.sh +38 -0
- package/deps/librdkafka/packaging/tools/gh-release-checksums.py +39 -0
- package/deps/librdkafka/packaging/tools/rdutcoverage.sh +25 -0
- package/deps/librdkafka/packaging/tools/requirements.txt +2 -0
- package/deps/librdkafka/packaging/tools/run-in-docker.sh +28 -0
- package/deps/librdkafka/packaging/tools/run-integration-tests.sh +31 -0
- package/deps/librdkafka/packaging/tools/run-style-check.sh +4 -0
- package/deps/librdkafka/packaging/tools/style-format.sh +149 -0
- package/deps/librdkafka/packaging/tools/update_rpcs_max_versions.py +100 -0
- package/deps/librdkafka/service.yml +172 -0
- package/deps/librdkafka/src/CMakeLists.txt +374 -0
- package/deps/librdkafka/src/Makefile +103 -0
- package/deps/librdkafka/src/README.lz4.md +30 -0
- package/deps/librdkafka/src/cJSON.c +2834 -0
- package/deps/librdkafka/src/cJSON.h +398 -0
- package/deps/librdkafka/src/crc32c.c +430 -0
- package/deps/librdkafka/src/crc32c.h +38 -0
- package/deps/librdkafka/src/generate_proto.sh +66 -0
- package/deps/librdkafka/src/librdkafka_cgrp_synch.png +0 -0
- package/deps/librdkafka/src/lz4.c +2727 -0
- package/deps/librdkafka/src/lz4.h +842 -0
- package/deps/librdkafka/src/lz4frame.c +2078 -0
- package/deps/librdkafka/src/lz4frame.h +692 -0
- package/deps/librdkafka/src/lz4frame_static.h +47 -0
- package/deps/librdkafka/src/lz4hc.c +1631 -0
- package/deps/librdkafka/src/lz4hc.h +413 -0
- package/deps/librdkafka/src/nanopb/pb.h +917 -0
- package/deps/librdkafka/src/nanopb/pb_common.c +388 -0
- package/deps/librdkafka/src/nanopb/pb_common.h +49 -0
- package/deps/librdkafka/src/nanopb/pb_decode.c +1727 -0
- package/deps/librdkafka/src/nanopb/pb_decode.h +193 -0
- package/deps/librdkafka/src/nanopb/pb_encode.c +1000 -0
- package/deps/librdkafka/src/nanopb/pb_encode.h +185 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.c +32 -0
- package/deps/librdkafka/src/opentelemetry/common.pb.h +170 -0
- package/deps/librdkafka/src/opentelemetry/metrics.options +2 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.c +67 -0
- package/deps/librdkafka/src/opentelemetry/metrics.pb.h +966 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.c +12 -0
- package/deps/librdkafka/src/opentelemetry/resource.pb.h +58 -0
- package/deps/librdkafka/src/queue.h +850 -0
- package/deps/librdkafka/src/rd.h +584 -0
- package/deps/librdkafka/src/rdaddr.c +255 -0
- package/deps/librdkafka/src/rdaddr.h +202 -0
- package/deps/librdkafka/src/rdatomic.h +230 -0
- package/deps/librdkafka/src/rdavg.h +260 -0
- package/deps/librdkafka/src/rdavl.c +210 -0
- package/deps/librdkafka/src/rdavl.h +250 -0
- package/deps/librdkafka/src/rdbase64.c +200 -0
- package/deps/librdkafka/src/rdbase64.h +43 -0
- package/deps/librdkafka/src/rdbuf.c +1884 -0
- package/deps/librdkafka/src/rdbuf.h +375 -0
- package/deps/librdkafka/src/rdcrc32.c +114 -0
- package/deps/librdkafka/src/rdcrc32.h +170 -0
- package/deps/librdkafka/src/rddl.c +179 -0
- package/deps/librdkafka/src/rddl.h +43 -0
- package/deps/librdkafka/src/rdendian.h +175 -0
- package/deps/librdkafka/src/rdfloat.h +67 -0
- package/deps/librdkafka/src/rdfnv1a.c +113 -0
- package/deps/librdkafka/src/rdfnv1a.h +35 -0
- package/deps/librdkafka/src/rdgz.c +120 -0
- package/deps/librdkafka/src/rdgz.h +46 -0
- package/deps/librdkafka/src/rdhdrhistogram.c +721 -0
- package/deps/librdkafka/src/rdhdrhistogram.h +87 -0
- package/deps/librdkafka/src/rdhttp.c +830 -0
- package/deps/librdkafka/src/rdhttp.h +101 -0
- package/deps/librdkafka/src/rdinterval.h +177 -0
- package/deps/librdkafka/src/rdkafka.c +5505 -0
- package/deps/librdkafka/src/rdkafka.h +10686 -0
- package/deps/librdkafka/src/rdkafka_admin.c +9794 -0
- package/deps/librdkafka/src/rdkafka_admin.h +661 -0
- package/deps/librdkafka/src/rdkafka_assignment.c +1010 -0
- package/deps/librdkafka/src/rdkafka_assignment.h +73 -0
- package/deps/librdkafka/src/rdkafka_assignor.c +1786 -0
- package/deps/librdkafka/src/rdkafka_assignor.h +402 -0
- package/deps/librdkafka/src/rdkafka_aux.c +409 -0
- package/deps/librdkafka/src/rdkafka_aux.h +174 -0
- package/deps/librdkafka/src/rdkafka_background.c +221 -0
- package/deps/librdkafka/src/rdkafka_broker.c +6337 -0
- package/deps/librdkafka/src/rdkafka_broker.h +744 -0
- package/deps/librdkafka/src/rdkafka_buf.c +543 -0
- package/deps/librdkafka/src/rdkafka_buf.h +1525 -0
- package/deps/librdkafka/src/rdkafka_cert.c +576 -0
- package/deps/librdkafka/src/rdkafka_cert.h +62 -0
- package/deps/librdkafka/src/rdkafka_cgrp.c +7587 -0
- package/deps/librdkafka/src/rdkafka_cgrp.h +477 -0
- package/deps/librdkafka/src/rdkafka_conf.c +4880 -0
- package/deps/librdkafka/src/rdkafka_conf.h +732 -0
- package/deps/librdkafka/src/rdkafka_confval.h +97 -0
- package/deps/librdkafka/src/rdkafka_coord.c +623 -0
- package/deps/librdkafka/src/rdkafka_coord.h +132 -0
- package/deps/librdkafka/src/rdkafka_error.c +228 -0
- package/deps/librdkafka/src/rdkafka_error.h +80 -0
- package/deps/librdkafka/src/rdkafka_event.c +502 -0
- package/deps/librdkafka/src/rdkafka_event.h +126 -0
- package/deps/librdkafka/src/rdkafka_feature.c +898 -0
- package/deps/librdkafka/src/rdkafka_feature.h +104 -0
- package/deps/librdkafka/src/rdkafka_fetcher.c +1422 -0
- package/deps/librdkafka/src/rdkafka_fetcher.h +44 -0
- package/deps/librdkafka/src/rdkafka_header.c +220 -0
- package/deps/librdkafka/src/rdkafka_header.h +76 -0
- package/deps/librdkafka/src/rdkafka_idempotence.c +807 -0
- package/deps/librdkafka/src/rdkafka_idempotence.h +144 -0
- package/deps/librdkafka/src/rdkafka_int.h +1260 -0
- package/deps/librdkafka/src/rdkafka_interceptor.c +819 -0
- package/deps/librdkafka/src/rdkafka_interceptor.h +104 -0
- package/deps/librdkafka/src/rdkafka_lz4.c +450 -0
- package/deps/librdkafka/src/rdkafka_lz4.h +49 -0
- package/deps/librdkafka/src/rdkafka_metadata.c +2209 -0
- package/deps/librdkafka/src/rdkafka_metadata.h +345 -0
- package/deps/librdkafka/src/rdkafka_metadata_cache.c +1183 -0
- package/deps/librdkafka/src/rdkafka_mock.c +3661 -0
- package/deps/librdkafka/src/rdkafka_mock.h +610 -0
- package/deps/librdkafka/src/rdkafka_mock_cgrp.c +1876 -0
- package/deps/librdkafka/src/rdkafka_mock_handlers.c +3113 -0
- package/deps/librdkafka/src/rdkafka_mock_int.h +710 -0
- package/deps/librdkafka/src/rdkafka_msg.c +2589 -0
- package/deps/librdkafka/src/rdkafka_msg.h +614 -0
- package/deps/librdkafka/src/rdkafka_msgbatch.h +62 -0
- package/deps/librdkafka/src/rdkafka_msgset.h +98 -0
- package/deps/librdkafka/src/rdkafka_msgset_reader.c +1806 -0
- package/deps/librdkafka/src/rdkafka_msgset_writer.c +1474 -0
- package/deps/librdkafka/src/rdkafka_offset.c +1565 -0
- package/deps/librdkafka/src/rdkafka_offset.h +150 -0
- package/deps/librdkafka/src/rdkafka_op.c +997 -0
- package/deps/librdkafka/src/rdkafka_op.h +858 -0
- package/deps/librdkafka/src/rdkafka_partition.c +4896 -0
- package/deps/librdkafka/src/rdkafka_partition.h +1182 -0
- package/deps/librdkafka/src/rdkafka_pattern.c +228 -0
- package/deps/librdkafka/src/rdkafka_pattern.h +70 -0
- package/deps/librdkafka/src/rdkafka_plugin.c +213 -0
- package/deps/librdkafka/src/rdkafka_plugin.h +41 -0
- package/deps/librdkafka/src/rdkafka_proto.h +736 -0
- package/deps/librdkafka/src/rdkafka_protocol.h +128 -0
- package/deps/librdkafka/src/rdkafka_queue.c +1230 -0
- package/deps/librdkafka/src/rdkafka_queue.h +1220 -0
- package/deps/librdkafka/src/rdkafka_range_assignor.c +1748 -0
- package/deps/librdkafka/src/rdkafka_request.c +7089 -0
- package/deps/librdkafka/src/rdkafka_request.h +732 -0
- package/deps/librdkafka/src/rdkafka_roundrobin_assignor.c +123 -0
- package/deps/librdkafka/src/rdkafka_sasl.c +530 -0
- package/deps/librdkafka/src/rdkafka_sasl.h +63 -0
- package/deps/librdkafka/src/rdkafka_sasl_cyrus.c +722 -0
- package/deps/librdkafka/src/rdkafka_sasl_int.h +89 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.c +1833 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer.h +52 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.c +1666 -0
- package/deps/librdkafka/src/rdkafka_sasl_oauthbearer_oidc.h +47 -0
- package/deps/librdkafka/src/rdkafka_sasl_plain.c +142 -0
- package/deps/librdkafka/src/rdkafka_sasl_scram.c +858 -0
- package/deps/librdkafka/src/rdkafka_sasl_win32.c +550 -0
- package/deps/librdkafka/src/rdkafka_ssl.c +2129 -0
- package/deps/librdkafka/src/rdkafka_ssl.h +86 -0
- package/deps/librdkafka/src/rdkafka_sticky_assignor.c +4785 -0
- package/deps/librdkafka/src/rdkafka_subscription.c +278 -0
- package/deps/librdkafka/src/rdkafka_telemetry.c +760 -0
- package/deps/librdkafka/src/rdkafka_telemetry.h +52 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.c +1053 -0
- package/deps/librdkafka/src/rdkafka_telemetry_decode.h +59 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.c +997 -0
- package/deps/librdkafka/src/rdkafka_telemetry_encode.h +301 -0
- package/deps/librdkafka/src/rdkafka_timer.c +402 -0
- package/deps/librdkafka/src/rdkafka_timer.h +117 -0
- package/deps/librdkafka/src/rdkafka_topic.c +2161 -0
- package/deps/librdkafka/src/rdkafka_topic.h +334 -0
- package/deps/librdkafka/src/rdkafka_transport.c +1309 -0
- package/deps/librdkafka/src/rdkafka_transport.h +99 -0
- package/deps/librdkafka/src/rdkafka_transport_int.h +100 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.c +3256 -0
- package/deps/librdkafka/src/rdkafka_txnmgr.h +171 -0
- package/deps/librdkafka/src/rdkafka_zstd.c +226 -0
- package/deps/librdkafka/src/rdkafka_zstd.h +57 -0
- package/deps/librdkafka/src/rdlist.c +576 -0
- package/deps/librdkafka/src/rdlist.h +434 -0
- package/deps/librdkafka/src/rdlog.c +89 -0
- package/deps/librdkafka/src/rdlog.h +41 -0
- package/deps/librdkafka/src/rdmap.c +508 -0
- package/deps/librdkafka/src/rdmap.h +492 -0
- package/deps/librdkafka/src/rdmurmur2.c +167 -0
- package/deps/librdkafka/src/rdmurmur2.h +35 -0
- package/deps/librdkafka/src/rdports.c +61 -0
- package/deps/librdkafka/src/rdports.h +38 -0
- package/deps/librdkafka/src/rdposix.h +250 -0
- package/deps/librdkafka/src/rdrand.c +80 -0
- package/deps/librdkafka/src/rdrand.h +43 -0
- package/deps/librdkafka/src/rdregex.c +156 -0
- package/deps/librdkafka/src/rdregex.h +43 -0
- package/deps/librdkafka/src/rdsignal.h +57 -0
- package/deps/librdkafka/src/rdstring.c +645 -0
- package/deps/librdkafka/src/rdstring.h +98 -0
- package/deps/librdkafka/src/rdsysqueue.h +404 -0
- package/deps/librdkafka/src/rdtime.h +356 -0
- package/deps/librdkafka/src/rdtypes.h +86 -0
- package/deps/librdkafka/src/rdunittest.c +549 -0
- package/deps/librdkafka/src/rdunittest.h +232 -0
- package/deps/librdkafka/src/rdvarint.c +134 -0
- package/deps/librdkafka/src/rdvarint.h +165 -0
- package/deps/librdkafka/src/rdwin32.h +382 -0
- package/deps/librdkafka/src/rdxxhash.c +1030 -0
- package/deps/librdkafka/src/rdxxhash.h +328 -0
- package/deps/librdkafka/src/regexp.c +1352 -0
- package/deps/librdkafka/src/regexp.h +41 -0
- package/deps/librdkafka/src/snappy.c +1866 -0
- package/deps/librdkafka/src/snappy.h +62 -0
- package/deps/librdkafka/src/snappy_compat.h +138 -0
- package/deps/librdkafka/src/statistics_schema.json +444 -0
- package/deps/librdkafka/src/tinycthread.c +932 -0
- package/deps/librdkafka/src/tinycthread.h +503 -0
- package/deps/librdkafka/src/tinycthread_extra.c +199 -0
- package/deps/librdkafka/src/tinycthread_extra.h +212 -0
- package/deps/librdkafka/src/win32_config.h +58 -0
- package/deps/librdkafka/src-cpp/CMakeLists.txt +90 -0
- package/deps/librdkafka/src-cpp/ConfImpl.cpp +84 -0
- package/deps/librdkafka/src-cpp/ConsumerImpl.cpp +244 -0
- package/deps/librdkafka/src-cpp/HandleImpl.cpp +436 -0
- package/deps/librdkafka/src-cpp/HeadersImpl.cpp +48 -0
- package/deps/librdkafka/src-cpp/KafkaConsumerImpl.cpp +296 -0
- package/deps/librdkafka/src-cpp/Makefile +55 -0
- package/deps/librdkafka/src-cpp/MessageImpl.cpp +38 -0
- package/deps/librdkafka/src-cpp/MetadataImpl.cpp +170 -0
- package/deps/librdkafka/src-cpp/ProducerImpl.cpp +197 -0
- package/deps/librdkafka/src-cpp/QueueImpl.cpp +70 -0
- package/deps/librdkafka/src-cpp/README.md +16 -0
- package/deps/librdkafka/src-cpp/RdKafka.cpp +59 -0
- package/deps/librdkafka/src-cpp/TopicImpl.cpp +124 -0
- package/deps/librdkafka/src-cpp/TopicPartitionImpl.cpp +57 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp.h +3797 -0
- package/deps/librdkafka/src-cpp/rdkafkacpp_int.h +1641 -0
- package/deps/librdkafka/tests/0000-unittests.c +72 -0
- package/deps/librdkafka/tests/0001-multiobj.c +102 -0
- package/deps/librdkafka/tests/0002-unkpart.c +244 -0
- package/deps/librdkafka/tests/0003-msgmaxsize.c +173 -0
- package/deps/librdkafka/tests/0004-conf.c +934 -0
- package/deps/librdkafka/tests/0005-order.c +133 -0
- package/deps/librdkafka/tests/0006-symbols.c +163 -0
- package/deps/librdkafka/tests/0007-autotopic.c +136 -0
- package/deps/librdkafka/tests/0008-reqacks.c +179 -0
- package/deps/librdkafka/tests/0009-mock_cluster.c +97 -0
- package/deps/librdkafka/tests/0011-produce_batch.c +753 -0
- package/deps/librdkafka/tests/0012-produce_consume.c +537 -0
- package/deps/librdkafka/tests/0013-null-msgs.c +473 -0
- package/deps/librdkafka/tests/0014-reconsume-191.c +512 -0
- package/deps/librdkafka/tests/0015-offset_seeks.c +172 -0
- package/deps/librdkafka/tests/0016-client_swname.c +181 -0
- package/deps/librdkafka/tests/0017-compression.c +140 -0
- package/deps/librdkafka/tests/0018-cgrp_term.c +338 -0
- package/deps/librdkafka/tests/0019-list_groups.c +289 -0
- package/deps/librdkafka/tests/0020-destroy_hang.c +162 -0
- package/deps/librdkafka/tests/0021-rkt_destroy.c +72 -0
- package/deps/librdkafka/tests/0022-consume_batch.c +279 -0
- package/deps/librdkafka/tests/0025-timers.c +147 -0
- package/deps/librdkafka/tests/0026-consume_pause.c +547 -0
- package/deps/librdkafka/tests/0028-long_topicnames.c +79 -0
- package/deps/librdkafka/tests/0029-assign_offset.c +202 -0
- package/deps/librdkafka/tests/0030-offset_commit.c +589 -0
- package/deps/librdkafka/tests/0031-get_offsets.c +235 -0
- package/deps/librdkafka/tests/0033-regex_subscribe.c +536 -0
- package/deps/librdkafka/tests/0034-offset_reset.c +398 -0
- package/deps/librdkafka/tests/0035-api_version.c +73 -0
- package/deps/librdkafka/tests/0036-partial_fetch.c +87 -0
- package/deps/librdkafka/tests/0037-destroy_hang_local.c +85 -0
- package/deps/librdkafka/tests/0038-performance.c +121 -0
- package/deps/librdkafka/tests/0039-event.c +284 -0
- package/deps/librdkafka/tests/0040-io_event.c +257 -0
- package/deps/librdkafka/tests/0041-fetch_max_bytes.c +97 -0
- package/deps/librdkafka/tests/0042-many_topics.c +252 -0
- package/deps/librdkafka/tests/0043-no_connection.c +77 -0
- package/deps/librdkafka/tests/0044-partition_cnt.c +94 -0
- package/deps/librdkafka/tests/0045-subscribe_update.c +1010 -0
- package/deps/librdkafka/tests/0046-rkt_cache.c +65 -0
- package/deps/librdkafka/tests/0047-partial_buf_tmout.c +98 -0
- package/deps/librdkafka/tests/0048-partitioner.c +283 -0
- package/deps/librdkafka/tests/0049-consume_conn_close.c +162 -0
- package/deps/librdkafka/tests/0050-subscribe_adds.c +145 -0
- package/deps/librdkafka/tests/0051-assign_adds.c +126 -0
- package/deps/librdkafka/tests/0052-msg_timestamps.c +238 -0
- package/deps/librdkafka/tests/0053-stats_cb.cpp +527 -0
- package/deps/librdkafka/tests/0054-offset_time.cpp +236 -0
- package/deps/librdkafka/tests/0055-producer_latency.c +539 -0
- package/deps/librdkafka/tests/0056-balanced_group_mt.c +315 -0
- package/deps/librdkafka/tests/0057-invalid_topic.cpp +112 -0
- package/deps/librdkafka/tests/0058-log.cpp +123 -0
- package/deps/librdkafka/tests/0059-bsearch.cpp +241 -0
- package/deps/librdkafka/tests/0060-op_prio.cpp +163 -0
- package/deps/librdkafka/tests/0061-consumer_lag.cpp +295 -0
- package/deps/librdkafka/tests/0062-stats_event.c +126 -0
- package/deps/librdkafka/tests/0063-clusterid.cpp +180 -0
- package/deps/librdkafka/tests/0064-interceptors.c +481 -0
- package/deps/librdkafka/tests/0065-yield.cpp +140 -0
- package/deps/librdkafka/tests/0066-plugins.cpp +129 -0
- package/deps/librdkafka/tests/0067-empty_topic.cpp +151 -0
- package/deps/librdkafka/tests/0068-produce_timeout.c +136 -0
- package/deps/librdkafka/tests/0069-consumer_add_parts.c +119 -0
- package/deps/librdkafka/tests/0070-null_empty.cpp +197 -0
- package/deps/librdkafka/tests/0072-headers_ut.c +448 -0
- package/deps/librdkafka/tests/0073-headers.c +381 -0
- package/deps/librdkafka/tests/0074-producev.c +87 -0
- package/deps/librdkafka/tests/0075-retry.c +290 -0
- package/deps/librdkafka/tests/0076-produce_retry.c +452 -0
- package/deps/librdkafka/tests/0077-compaction.c +363 -0
- package/deps/librdkafka/tests/0078-c_from_cpp.cpp +96 -0
- package/deps/librdkafka/tests/0079-fork.c +93 -0
- package/deps/librdkafka/tests/0080-admin_ut.c +3095 -0
- package/deps/librdkafka/tests/0081-admin.c +5633 -0
- package/deps/librdkafka/tests/0082-fetch_max_bytes.cpp +137 -0
- package/deps/librdkafka/tests/0083-cb_event.c +233 -0
- package/deps/librdkafka/tests/0084-destroy_flags.c +208 -0
- package/deps/librdkafka/tests/0085-headers.cpp +392 -0
- package/deps/librdkafka/tests/0086-purge.c +368 -0
- package/deps/librdkafka/tests/0088-produce_metadata_timeout.c +162 -0
- package/deps/librdkafka/tests/0089-max_poll_interval.c +511 -0
- package/deps/librdkafka/tests/0090-idempotence.c +171 -0
- package/deps/librdkafka/tests/0091-max_poll_interval_timeout.c +295 -0
- package/deps/librdkafka/tests/0092-mixed_msgver.c +103 -0
- package/deps/librdkafka/tests/0093-holb.c +200 -0
- package/deps/librdkafka/tests/0094-idempotence_msg_timeout.c +231 -0
- package/deps/librdkafka/tests/0095-all_brokers_down.cpp +122 -0
- package/deps/librdkafka/tests/0097-ssl_verify.cpp +658 -0
- package/deps/librdkafka/tests/0098-consumer-txn.cpp +1218 -0
- package/deps/librdkafka/tests/0099-commit_metadata.c +194 -0
- package/deps/librdkafka/tests/0100-thread_interceptors.cpp +195 -0
- package/deps/librdkafka/tests/0101-fetch-from-follower.cpp +446 -0
- package/deps/librdkafka/tests/0102-static_group_rebalance.c +836 -0
- package/deps/librdkafka/tests/0103-transactions.c +1383 -0
- package/deps/librdkafka/tests/0104-fetch_from_follower_mock.c +625 -0
- package/deps/librdkafka/tests/0105-transactions_mock.c +3930 -0
- package/deps/librdkafka/tests/0106-cgrp_sess_timeout.c +318 -0
- package/deps/librdkafka/tests/0107-topic_recreate.c +259 -0
- package/deps/librdkafka/tests/0109-auto_create_topics.cpp +278 -0
- package/deps/librdkafka/tests/0110-batch_size.cpp +182 -0
- package/deps/librdkafka/tests/0111-delay_create_topics.cpp +127 -0
- package/deps/librdkafka/tests/0112-assign_unknown_part.c +87 -0
- package/deps/librdkafka/tests/0113-cooperative_rebalance.cpp +3473 -0
- package/deps/librdkafka/tests/0114-sticky_partitioning.cpp +176 -0
- package/deps/librdkafka/tests/0115-producer_auth.cpp +182 -0
- package/deps/librdkafka/tests/0116-kafkaconsumer_close.cpp +216 -0
- package/deps/librdkafka/tests/0117-mock_errors.c +331 -0
- package/deps/librdkafka/tests/0118-commit_rebalance.c +154 -0
- package/deps/librdkafka/tests/0119-consumer_auth.cpp +167 -0
- package/deps/librdkafka/tests/0120-asymmetric_subscription.c +185 -0
- package/deps/librdkafka/tests/0121-clusterid.c +115 -0
- package/deps/librdkafka/tests/0122-buffer_cleaning_after_rebalance.c +227 -0
- package/deps/librdkafka/tests/0123-connections_max_idle.c +98 -0
- package/deps/librdkafka/tests/0124-openssl_invalid_engine.c +69 -0
- package/deps/librdkafka/tests/0125-immediate_flush.c +144 -0
- package/deps/librdkafka/tests/0126-oauthbearer_oidc.c +528 -0
- package/deps/librdkafka/tests/0127-fetch_queue_backoff.cpp +165 -0
- package/deps/librdkafka/tests/0128-sasl_callback_queue.cpp +125 -0
- package/deps/librdkafka/tests/0129-fetch_aborted_msgs.c +79 -0
- package/deps/librdkafka/tests/0130-store_offsets.c +178 -0
- package/deps/librdkafka/tests/0131-connect_timeout.c +81 -0
- package/deps/librdkafka/tests/0132-strategy_ordering.c +179 -0
- package/deps/librdkafka/tests/0133-ssl_keys.c +150 -0
- package/deps/librdkafka/tests/0134-ssl_provider.c +92 -0
- package/deps/librdkafka/tests/0135-sasl_credentials.cpp +143 -0
- package/deps/librdkafka/tests/0136-resolve_cb.c +181 -0
- package/deps/librdkafka/tests/0137-barrier_batch_consume.c +619 -0
- package/deps/librdkafka/tests/0138-admin_mock.c +281 -0
- package/deps/librdkafka/tests/0139-offset_validation_mock.c +950 -0
- package/deps/librdkafka/tests/0140-commit_metadata.cpp +108 -0
- package/deps/librdkafka/tests/0142-reauthentication.c +515 -0
- package/deps/librdkafka/tests/0143-exponential_backoff_mock.c +552 -0
- package/deps/librdkafka/tests/0144-idempotence_mock.c +373 -0
- package/deps/librdkafka/tests/0145-pause_resume_mock.c +119 -0
- package/deps/librdkafka/tests/0146-metadata_mock.c +505 -0
- package/deps/librdkafka/tests/0147-consumer_group_consumer_mock.c +952 -0
- package/deps/librdkafka/tests/0148-offset_fetch_commit_error_mock.c +563 -0
- package/deps/librdkafka/tests/0149-broker-same-host-port.c +140 -0
- package/deps/librdkafka/tests/0150-telemetry_mock.c +651 -0
- package/deps/librdkafka/tests/0151-purge-brokers.c +566 -0
- package/deps/librdkafka/tests/0152-rebootstrap.c +59 -0
- package/deps/librdkafka/tests/0153-memberid.c +128 -0
- package/deps/librdkafka/tests/1000-unktopic.c +164 -0
- package/deps/librdkafka/tests/8000-idle.cpp +60 -0
- package/deps/librdkafka/tests/8001-fetch_from_follower_mock_manual.c +113 -0
- package/deps/librdkafka/tests/CMakeLists.txt +170 -0
- package/deps/librdkafka/tests/LibrdkafkaTestApp.py +291 -0
- package/deps/librdkafka/tests/Makefile +182 -0
- package/deps/librdkafka/tests/README.md +509 -0
- package/deps/librdkafka/tests/autotest.sh +33 -0
- package/deps/librdkafka/tests/backtrace.gdb +30 -0
- package/deps/librdkafka/tests/broker_version_tests.py +315 -0
- package/deps/librdkafka/tests/buildbox.sh +17 -0
- package/deps/librdkafka/tests/cleanup-checker-tests.sh +20 -0
- package/deps/librdkafka/tests/cluster_testing.py +191 -0
- package/deps/librdkafka/tests/delete-test-topics.sh +56 -0
- package/deps/librdkafka/tests/fixtures/oauthbearer/jwt_assertion_template.json +10 -0
- package/deps/librdkafka/tests/fixtures/ssl/Makefile +8 -0
- package/deps/librdkafka/tests/fixtures/ssl/README.md +13 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.intermediate.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client.keystore.p12 +0 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.intermediate.pem +72 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.certificate.pem +50 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.intermediate.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/client2.key +46 -0
- package/deps/librdkafka/tests/fixtures/ssl/create_keys.sh +168 -0
- package/deps/librdkafka/tests/fuzzers/Makefile +12 -0
- package/deps/librdkafka/tests/fuzzers/README.md +31 -0
- package/deps/librdkafka/tests/fuzzers/fuzz_regex.c +74 -0
- package/deps/librdkafka/tests/fuzzers/helpers.h +90 -0
- package/deps/librdkafka/tests/gen-ssl-certs.sh +165 -0
- package/deps/librdkafka/tests/interactive_broker_version.py +170 -0
- package/deps/librdkafka/tests/interceptor_test/CMakeLists.txt +16 -0
- package/deps/librdkafka/tests/interceptor_test/Makefile +22 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.c +314 -0
- package/deps/librdkafka/tests/interceptor_test/interceptor_test.h +54 -0
- package/deps/librdkafka/tests/java/IncrementalRebalanceCli.java +97 -0
- package/deps/librdkafka/tests/java/Makefile +13 -0
- package/deps/librdkafka/tests/java/Murmur2Cli.java +46 -0
- package/deps/librdkafka/tests/java/README.md +14 -0
- package/deps/librdkafka/tests/java/TransactionProducerCli.java +162 -0
- package/deps/librdkafka/tests/java/run-class.sh +11 -0
- package/deps/librdkafka/tests/librdkafka.suppressions +483 -0
- package/deps/librdkafka/tests/lz4_manual_test.sh +59 -0
- package/deps/librdkafka/tests/multi-broker-version-test.sh +50 -0
- package/deps/librdkafka/tests/parse-refcnt.sh +43 -0
- package/deps/librdkafka/tests/performance_plot.py +115 -0
- package/deps/librdkafka/tests/plugin_test/Makefile +19 -0
- package/deps/librdkafka/tests/plugin_test/plugin_test.c +58 -0
- package/deps/librdkafka/tests/requirements.txt +2 -0
- package/deps/librdkafka/tests/run-all-tests.sh +79 -0
- package/deps/librdkafka/tests/run-consumer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-producer-tests.sh +16 -0
- package/deps/librdkafka/tests/run-test-batches.py +157 -0
- package/deps/librdkafka/tests/run-test.sh +140 -0
- package/deps/librdkafka/tests/rusage.c +249 -0
- package/deps/librdkafka/tests/sasl_test.py +289 -0
- package/deps/librdkafka/tests/scenarios/README.md +6 -0
- package/deps/librdkafka/tests/scenarios/ak23.json +6 -0
- package/deps/librdkafka/tests/scenarios/default.json +5 -0
- package/deps/librdkafka/tests/scenarios/noautocreate.json +5 -0
- package/deps/librdkafka/tests/sockem.c +801 -0
- package/deps/librdkafka/tests/sockem.h +85 -0
- package/deps/librdkafka/tests/sockem_ctrl.c +145 -0
- package/deps/librdkafka/tests/sockem_ctrl.h +61 -0
- package/deps/librdkafka/tests/test.c +7778 -0
- package/deps/librdkafka/tests/test.conf.example +27 -0
- package/deps/librdkafka/tests/test.h +1028 -0
- package/deps/librdkafka/tests/testcpp.cpp +131 -0
- package/deps/librdkafka/tests/testcpp.h +388 -0
- package/deps/librdkafka/tests/testshared.h +416 -0
- package/deps/librdkafka/tests/tools/README.md +4 -0
- package/deps/librdkafka/tests/tools/stats/README.md +21 -0
- package/deps/librdkafka/tests/tools/stats/filter.jq +42 -0
- package/deps/librdkafka/tests/tools/stats/graph.py +150 -0
- package/deps/librdkafka/tests/tools/stats/requirements.txt +3 -0
- package/deps/librdkafka/tests/tools/stats/to_csv.py +124 -0
- package/deps/librdkafka/tests/trivup/trivup-0.14.0.tar.gz +0 -0
- package/deps/librdkafka/tests/until-fail.sh +87 -0
- package/deps/librdkafka/tests/xxxx-assign_partition.c +122 -0
- package/deps/librdkafka/tests/xxxx-metadata.cpp +159 -0
- package/deps/librdkafka/vcpkg.json +23 -0
- package/deps/librdkafka/win32/README.md +5 -0
- package/deps/librdkafka/win32/build-package.bat +3 -0
- package/deps/librdkafka/win32/build.bat +19 -0
- package/deps/librdkafka/win32/common.vcxproj +84 -0
- package/deps/librdkafka/win32/interceptor_test/interceptor_test.vcxproj +87 -0
- package/deps/librdkafka/win32/librdkafka.autopkg.template +54 -0
- package/deps/librdkafka/win32/librdkafka.master.testing.targets +13 -0
- package/deps/librdkafka/win32/librdkafka.sln +226 -0
- package/deps/librdkafka/win32/librdkafka.vcxproj +276 -0
- package/deps/librdkafka/win32/librdkafkacpp/librdkafkacpp.vcxproj +104 -0
- package/deps/librdkafka/win32/msbuild.ps1 +15 -0
- package/deps/librdkafka/win32/openssl_engine_example/openssl_engine_example.vcxproj +132 -0
- package/deps/librdkafka/win32/package-zip.ps1 +46 -0
- package/deps/librdkafka/win32/packages/repositories.config +4 -0
- package/deps/librdkafka/win32/push-package.bat +4 -0
- package/deps/librdkafka/win32/rdkafka_complex_consumer_example_cpp/rdkafka_complex_consumer_example_cpp.vcxproj +67 -0
- package/deps/librdkafka/win32/rdkafka_example/rdkafka_example.vcxproj +97 -0
- package/deps/librdkafka/win32/rdkafka_performance/rdkafka_performance.vcxproj +97 -0
- package/deps/librdkafka/win32/setup-msys2.ps1 +47 -0
- package/deps/librdkafka/win32/setup-vcpkg.ps1 +34 -0
- package/deps/librdkafka/win32/tests/test.conf.example +25 -0
- package/deps/librdkafka/win32/tests/tests.vcxproj +253 -0
- package/deps/librdkafka/win32/win_ssl_cert_store/win_ssl_cert_store.vcxproj +132 -0
- package/deps/librdkafka/win32/wingetopt.c +564 -0
- package/deps/librdkafka/win32/wingetopt.h +101 -0
- package/deps/librdkafka/win32/wintime.h +33 -0
- package/deps/librdkafka.gyp +62 -0
- package/lib/admin.js +233 -0
- package/lib/client.js +573 -0
- package/lib/error.js +500 -0
- package/lib/index.js +34 -0
- package/lib/kafka-consumer-stream.js +397 -0
- package/lib/kafka-consumer.js +698 -0
- package/lib/producer/high-level-producer.js +323 -0
- package/lib/producer-stream.js +307 -0
- package/lib/producer.js +375 -0
- package/lib/tools/ref-counter.js +52 -0
- package/lib/topic-partition.js +88 -0
- package/lib/topic.js +42 -0
- package/lib/util.js +29 -0
- package/package.json +61 -0
- package/prebuilds/darwin-arm64/@point3+node-rdkafka.node +0 -0
- package/prebuilds/linux-x64/@point3+node-rdkafka.node +0 -0
- package/util/configure.js +30 -0
- package/util/get-env.js +6 -0
- package/util/test-compile.js +11 -0
- package/util/test-producer-delivery.js +100 -0
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
/* $OpenBSD: getopt_long.c,v 1.23 2007/10/31 12:34:57 chl Exp $ */
|
|
2
|
+
/* $NetBSD: getopt_long.c,v 1.15 2002/01/31 22:43:40 tv Exp $ */
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Copyright (c) 2002 Todd C. Miller <Todd.Miller@courtesan.com>
|
|
6
|
+
*
|
|
7
|
+
* Permission to use, copy, modify, and distribute this software for any
|
|
8
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
9
|
+
* copyright notice and this permission notice appear in all copies.
|
|
10
|
+
*
|
|
11
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
+
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
+
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
+
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
*
|
|
19
|
+
* Sponsored in part by the Defense Advanced Research Projects
|
|
20
|
+
* Agency (DARPA) and Air Force Research Laboratory, Air Force
|
|
21
|
+
* Materiel Command, USAF, under agreement number F39502-99-1-0512.
|
|
22
|
+
*/
|
|
23
|
+
/*-
|
|
24
|
+
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
|
25
|
+
* All rights reserved.
|
|
26
|
+
*
|
|
27
|
+
* This code is derived from software contributed to The NetBSD Foundation
|
|
28
|
+
* by Dieter Baron and Thomas Klausner.
|
|
29
|
+
*
|
|
30
|
+
* Redistribution and use in source and binary forms, with or without
|
|
31
|
+
* modification, are permitted provided that the following conditions
|
|
32
|
+
* are met:
|
|
33
|
+
* 1. Redistributions of source code must retain the above copyright
|
|
34
|
+
* notice, this list of conditions and the following disclaimer.
|
|
35
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
|
36
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
37
|
+
* documentation and/or other materials provided with the distribution.
|
|
38
|
+
*
|
|
39
|
+
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
|
40
|
+
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
41
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
42
|
+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
|
|
43
|
+
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
44
|
+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
45
|
+
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
46
|
+
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
47
|
+
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
48
|
+
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
49
|
+
* POSSIBILITY OF SUCH DAMAGE.
|
|
50
|
+
*/
|
|
51
|
+
|
|
52
|
+
#include <errno.h>
|
|
53
|
+
#include <stdlib.h>
|
|
54
|
+
#include <string.h>
|
|
55
|
+
#include "wingetopt.h"
|
|
56
|
+
#include <stdarg.h>
|
|
57
|
+
#include <stdio.h>
|
|
58
|
+
#include <windows.h>
|
|
59
|
+
|
|
60
|
+
#define REPLACE_GETOPT /* use this getopt as the system getopt(3) */
|
|
61
|
+
|
|
62
|
+
#ifdef REPLACE_GETOPT
|
|
63
|
+
int opterr = 1; /* if error message should be printed */
|
|
64
|
+
int optind = 1; /* index into parent argv vector */
|
|
65
|
+
int optopt = '?'; /* character checked for validity */
|
|
66
|
+
#undef optreset /* see getopt.h */
|
|
67
|
+
#define optreset __mingw_optreset
|
|
68
|
+
int optreset; /* reset getopt */
|
|
69
|
+
char *optarg; /* argument associated with option */
|
|
70
|
+
#endif
|
|
71
|
+
|
|
72
|
+
#define PRINT_ERROR ((opterr) && (*options != ':'))
|
|
73
|
+
|
|
74
|
+
#define FLAG_PERMUTE 0x01 /* permute non-options to the end of argv */
|
|
75
|
+
#define FLAG_ALLARGS 0x02 /* treat non-options as args to option "-1" */
|
|
76
|
+
#define FLAG_LONGONLY 0x04 /* operate as getopt_long_only */
|
|
77
|
+
|
|
78
|
+
/* return values */
|
|
79
|
+
#define BADCH (int)'?'
|
|
80
|
+
#define BADARG ((*options == ':') ? (int)':' : (int)'?')
|
|
81
|
+
#define INORDER (int)1
|
|
82
|
+
|
|
83
|
+
#ifndef __CYGWIN__
|
|
84
|
+
#define __progname __argv[0]
|
|
85
|
+
#else
|
|
86
|
+
extern char __declspec(dllimport) * __progname;
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
#ifdef __CYGWIN__
|
|
90
|
+
static char EMSG[] = "";
|
|
91
|
+
#else
|
|
92
|
+
#define EMSG ""
|
|
93
|
+
#endif
|
|
94
|
+
|
|
95
|
+
static int getopt_internal(int,
|
|
96
|
+
char *const *,
|
|
97
|
+
const char *,
|
|
98
|
+
const struct option *,
|
|
99
|
+
int *,
|
|
100
|
+
int);
|
|
101
|
+
static int parse_long_options(char *const *,
|
|
102
|
+
const char *,
|
|
103
|
+
const struct option *,
|
|
104
|
+
int *,
|
|
105
|
+
int);
|
|
106
|
+
static int gcd(int, int);
|
|
107
|
+
static void permute_args(int, int, int, char *const *);
|
|
108
|
+
|
|
109
|
+
static char *place = EMSG; /* option letter processing */
|
|
110
|
+
|
|
111
|
+
/* XXX: set optreset to 1 rather than these two */
|
|
112
|
+
static int nonopt_start = -1; /* first non option argument (for permute) */
|
|
113
|
+
static int nonopt_end = -1; /* first option after non options (for permute) */
|
|
114
|
+
|
|
115
|
+
/* Error messages */
|
|
116
|
+
static const char recargchar[] = "option requires an argument -- %c";
|
|
117
|
+
static const char recargstring[] = "option requires an argument -- %s";
|
|
118
|
+
static const char ambig[] = "ambiguous option -- %.*s";
|
|
119
|
+
static const char noarg[] = "option doesn't take an argument -- %.*s";
|
|
120
|
+
static const char illoptchar[] = "unknown option -- %c";
|
|
121
|
+
static const char illoptstring[] = "unknown option -- %s";
|
|
122
|
+
|
|
123
|
+
static void _vwarnx(const char *fmt, va_list ap) {
|
|
124
|
+
(void)fprintf(stderr, "%s: ", __progname);
|
|
125
|
+
if (fmt != NULL)
|
|
126
|
+
(void)vfprintf(stderr, fmt, ap);
|
|
127
|
+
(void)fprintf(stderr, "\n");
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
static void warnx(const char *fmt, ...) {
|
|
131
|
+
va_list ap;
|
|
132
|
+
va_start(ap, fmt);
|
|
133
|
+
_vwarnx(fmt, ap);
|
|
134
|
+
va_end(ap);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/*
|
|
138
|
+
* Compute the greatest common divisor of a and b.
|
|
139
|
+
*/
|
|
140
|
+
static int gcd(int a, int b) {
|
|
141
|
+
int c;
|
|
142
|
+
|
|
143
|
+
c = a % b;
|
|
144
|
+
while (c != 0) {
|
|
145
|
+
a = b;
|
|
146
|
+
b = c;
|
|
147
|
+
c = a % b;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return (b);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/*
|
|
154
|
+
* Exchange the block from nonopt_start to nonopt_end with the block
|
|
155
|
+
* from nonopt_end to opt_end (keeping the same order of arguments
|
|
156
|
+
* in each block).
|
|
157
|
+
*/
|
|
158
|
+
static void permute_args(int panonopt_start,
|
|
159
|
+
int panonopt_end,
|
|
160
|
+
int opt_end,
|
|
161
|
+
char *const *nargv) {
|
|
162
|
+
int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
|
|
163
|
+
char *swap;
|
|
164
|
+
|
|
165
|
+
/*
|
|
166
|
+
* compute lengths of blocks and number and size of cycles
|
|
167
|
+
*/
|
|
168
|
+
nnonopts = panonopt_end - panonopt_start;
|
|
169
|
+
nopts = opt_end - panonopt_end;
|
|
170
|
+
ncycle = gcd(nnonopts, nopts);
|
|
171
|
+
cyclelen = (opt_end - panonopt_start) / ncycle;
|
|
172
|
+
|
|
173
|
+
for (i = 0; i < ncycle; i++) {
|
|
174
|
+
cstart = panonopt_end + i;
|
|
175
|
+
pos = cstart;
|
|
176
|
+
for (j = 0; j < cyclelen; j++) {
|
|
177
|
+
if (pos >= panonopt_end)
|
|
178
|
+
pos -= nnonopts;
|
|
179
|
+
else
|
|
180
|
+
pos += nopts;
|
|
181
|
+
swap = nargv[pos];
|
|
182
|
+
/* LINTED const cast */
|
|
183
|
+
((char **)nargv)[pos] = nargv[cstart];
|
|
184
|
+
/* LINTED const cast */
|
|
185
|
+
((char **)nargv)[cstart] = swap;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/*
|
|
191
|
+
* parse_long_options --
|
|
192
|
+
* Parse long options in argc/argv argument vector.
|
|
193
|
+
* Returns -1 if short_too is set and the option does not match long_options.
|
|
194
|
+
*/
|
|
195
|
+
static int parse_long_options(char *const *nargv,
|
|
196
|
+
const char *options,
|
|
197
|
+
const struct option *long_options,
|
|
198
|
+
int *idx,
|
|
199
|
+
int short_too) {
|
|
200
|
+
char *current_argv, *has_equal;
|
|
201
|
+
size_t current_argv_len;
|
|
202
|
+
int i, ambiguous, match;
|
|
203
|
+
|
|
204
|
+
#define IDENTICAL_INTERPRETATION(_x, _y) \
|
|
205
|
+
(long_options[(_x)].has_arg == long_options[(_y)].has_arg && \
|
|
206
|
+
long_options[(_x)].flag == long_options[(_y)].flag && \
|
|
207
|
+
long_options[(_x)].val == long_options[(_y)].val)
|
|
208
|
+
|
|
209
|
+
current_argv = place;
|
|
210
|
+
match = -1;
|
|
211
|
+
ambiguous = 0;
|
|
212
|
+
|
|
213
|
+
optind++;
|
|
214
|
+
|
|
215
|
+
if ((has_equal = strchr(current_argv, '=')) != NULL) {
|
|
216
|
+
/* argument found (--option=arg) */
|
|
217
|
+
current_argv_len = has_equal - current_argv;
|
|
218
|
+
has_equal++;
|
|
219
|
+
} else
|
|
220
|
+
current_argv_len = strlen(current_argv);
|
|
221
|
+
|
|
222
|
+
for (i = 0; long_options[i].name; i++) {
|
|
223
|
+
/* find matching long option */
|
|
224
|
+
if (strncmp(current_argv, long_options[i].name,
|
|
225
|
+
current_argv_len))
|
|
226
|
+
continue;
|
|
227
|
+
|
|
228
|
+
if (strlen(long_options[i].name) == current_argv_len) {
|
|
229
|
+
/* exact match */
|
|
230
|
+
match = i;
|
|
231
|
+
ambiguous = 0;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
/*
|
|
235
|
+
* If this is a known short option, don't allow
|
|
236
|
+
* a partial match of a single character.
|
|
237
|
+
*/
|
|
238
|
+
if (short_too && current_argv_len == 1)
|
|
239
|
+
continue;
|
|
240
|
+
|
|
241
|
+
if (match == -1) /* partial match */
|
|
242
|
+
match = i;
|
|
243
|
+
else if (!IDENTICAL_INTERPRETATION(i, match))
|
|
244
|
+
ambiguous = 1;
|
|
245
|
+
}
|
|
246
|
+
if (ambiguous) {
|
|
247
|
+
/* ambiguous abbreviation */
|
|
248
|
+
if (PRINT_ERROR)
|
|
249
|
+
warnx(ambig, (int)current_argv_len, current_argv);
|
|
250
|
+
optopt = 0;
|
|
251
|
+
return (BADCH);
|
|
252
|
+
}
|
|
253
|
+
if (match != -1) { /* option found */
|
|
254
|
+
if (long_options[match].has_arg == no_argument && has_equal) {
|
|
255
|
+
if (PRINT_ERROR)
|
|
256
|
+
warnx(noarg, (int)current_argv_len,
|
|
257
|
+
current_argv);
|
|
258
|
+
/*
|
|
259
|
+
* XXX: GNU sets optopt to val regardless of flag
|
|
260
|
+
*/
|
|
261
|
+
if (long_options[match].flag == NULL)
|
|
262
|
+
optopt = long_options[match].val;
|
|
263
|
+
else
|
|
264
|
+
optopt = 0;
|
|
265
|
+
return (BADARG);
|
|
266
|
+
}
|
|
267
|
+
if (long_options[match].has_arg == required_argument ||
|
|
268
|
+
long_options[match].has_arg == optional_argument) {
|
|
269
|
+
if (has_equal)
|
|
270
|
+
optarg = has_equal;
|
|
271
|
+
else if (long_options[match].has_arg ==
|
|
272
|
+
required_argument) {
|
|
273
|
+
/*
|
|
274
|
+
* optional argument doesn't use next nargv
|
|
275
|
+
*/
|
|
276
|
+
optarg = nargv[optind++];
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if ((long_options[match].has_arg == required_argument) &&
|
|
280
|
+
(optarg == NULL)) {
|
|
281
|
+
/*
|
|
282
|
+
* Missing argument; leading ':' indicates no error
|
|
283
|
+
* should be generated.
|
|
284
|
+
*/
|
|
285
|
+
if (PRINT_ERROR)
|
|
286
|
+
warnx(recargstring, current_argv);
|
|
287
|
+
/*
|
|
288
|
+
* XXX: GNU sets optopt to val regardless of flag
|
|
289
|
+
*/
|
|
290
|
+
if (long_options[match].flag == NULL)
|
|
291
|
+
optopt = long_options[match].val;
|
|
292
|
+
else
|
|
293
|
+
optopt = 0;
|
|
294
|
+
--optind;
|
|
295
|
+
return (BADARG);
|
|
296
|
+
}
|
|
297
|
+
} else { /* unknown option */
|
|
298
|
+
if (short_too) {
|
|
299
|
+
--optind;
|
|
300
|
+
return (-1);
|
|
301
|
+
}
|
|
302
|
+
if (PRINT_ERROR)
|
|
303
|
+
warnx(illoptstring, current_argv);
|
|
304
|
+
optopt = 0;
|
|
305
|
+
return (BADCH);
|
|
306
|
+
}
|
|
307
|
+
if (idx)
|
|
308
|
+
*idx = match;
|
|
309
|
+
if (long_options[match].flag) {
|
|
310
|
+
*long_options[match].flag = long_options[match].val;
|
|
311
|
+
return (0);
|
|
312
|
+
} else
|
|
313
|
+
return (long_options[match].val);
|
|
314
|
+
#undef IDENTICAL_INTERPRETATION
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
/*
|
|
318
|
+
* getopt_internal --
|
|
319
|
+
* Parse argc/argv argument vector. Called by user level routines.
|
|
320
|
+
*/
|
|
321
|
+
static int getopt_internal(int nargc,
|
|
322
|
+
char *const *nargv,
|
|
323
|
+
const char *options,
|
|
324
|
+
const struct option *long_options,
|
|
325
|
+
int *idx,
|
|
326
|
+
int flags) {
|
|
327
|
+
char *oli; /* option letter list index */
|
|
328
|
+
int optchar, short_too;
|
|
329
|
+
static int posixly_correct = -1;
|
|
330
|
+
|
|
331
|
+
if (options == NULL)
|
|
332
|
+
return (-1);
|
|
333
|
+
|
|
334
|
+
/*
|
|
335
|
+
* XXX Some GNU programs (like cvs) set optind to 0 instead of
|
|
336
|
+
* XXX using optreset. Work around this braindamage.
|
|
337
|
+
*/
|
|
338
|
+
if (optind == 0)
|
|
339
|
+
optind = optreset = 1;
|
|
340
|
+
|
|
341
|
+
/*
|
|
342
|
+
* Disable GNU extensions if POSIXLY_CORRECT is set or options
|
|
343
|
+
* string begins with a '+'.
|
|
344
|
+
*
|
|
345
|
+
* CV, 2009-12-14: Check POSIXLY_CORRECT anew if optind == 0 or
|
|
346
|
+
* optreset != 0 for GNU compatibility.
|
|
347
|
+
*/
|
|
348
|
+
#ifndef _WIN32
|
|
349
|
+
if (posixly_correct == -1 || optreset != 0)
|
|
350
|
+
posixly_correct = (getenv("POSIXLY_CORRECT") != NULL);
|
|
351
|
+
#endif
|
|
352
|
+
if (*options == '-')
|
|
353
|
+
flags |= FLAG_ALLARGS;
|
|
354
|
+
else if (posixly_correct || *options == '+')
|
|
355
|
+
flags &= ~FLAG_PERMUTE;
|
|
356
|
+
if (*options == '+' || *options == '-')
|
|
357
|
+
options++;
|
|
358
|
+
|
|
359
|
+
optarg = NULL;
|
|
360
|
+
if (optreset)
|
|
361
|
+
nonopt_start = nonopt_end = -1;
|
|
362
|
+
start:
|
|
363
|
+
if (optreset || !*place) { /* update scanning pointer */
|
|
364
|
+
optreset = 0;
|
|
365
|
+
if (optind >= nargc) { /* end of argument vector */
|
|
366
|
+
place = EMSG;
|
|
367
|
+
if (nonopt_end != -1) {
|
|
368
|
+
/* do permutation, if we have to */
|
|
369
|
+
permute_args(nonopt_start, nonopt_end, optind,
|
|
370
|
+
nargv);
|
|
371
|
+
optind -= nonopt_end - nonopt_start;
|
|
372
|
+
} else if (nonopt_start != -1) {
|
|
373
|
+
/*
|
|
374
|
+
* If we skipped non-options, set optind
|
|
375
|
+
* to the first of them.
|
|
376
|
+
*/
|
|
377
|
+
optind = nonopt_start;
|
|
378
|
+
}
|
|
379
|
+
nonopt_start = nonopt_end = -1;
|
|
380
|
+
return (-1);
|
|
381
|
+
}
|
|
382
|
+
if (*(place = nargv[optind]) != '-' ||
|
|
383
|
+
(place[1] == '\0' && strchr(options, '-') == NULL)) {
|
|
384
|
+
place = EMSG; /* found non-option */
|
|
385
|
+
if (flags & FLAG_ALLARGS) {
|
|
386
|
+
/*
|
|
387
|
+
* GNU extension:
|
|
388
|
+
* return non-option as argument to option 1
|
|
389
|
+
*/
|
|
390
|
+
optarg = nargv[optind++];
|
|
391
|
+
return (INORDER);
|
|
392
|
+
}
|
|
393
|
+
if (!(flags & FLAG_PERMUTE)) {
|
|
394
|
+
/*
|
|
395
|
+
* If no permutation wanted, stop parsing
|
|
396
|
+
* at first non-option.
|
|
397
|
+
*/
|
|
398
|
+
return (-1);
|
|
399
|
+
}
|
|
400
|
+
/* do permutation */
|
|
401
|
+
if (nonopt_start == -1)
|
|
402
|
+
nonopt_start = optind;
|
|
403
|
+
else if (nonopt_end != -1) {
|
|
404
|
+
permute_args(nonopt_start, nonopt_end, optind,
|
|
405
|
+
nargv);
|
|
406
|
+
nonopt_start =
|
|
407
|
+
optind - (nonopt_end - nonopt_start);
|
|
408
|
+
nonopt_end = -1;
|
|
409
|
+
}
|
|
410
|
+
optind++;
|
|
411
|
+
/* process next argument */
|
|
412
|
+
goto start;
|
|
413
|
+
}
|
|
414
|
+
if (nonopt_start != -1 && nonopt_end == -1)
|
|
415
|
+
nonopt_end = optind;
|
|
416
|
+
|
|
417
|
+
/*
|
|
418
|
+
* If we have "-" do nothing, if "--" we are done.
|
|
419
|
+
*/
|
|
420
|
+
if (place[1] != '\0' && *++place == '-' && place[1] == '\0') {
|
|
421
|
+
optind++;
|
|
422
|
+
place = EMSG;
|
|
423
|
+
/*
|
|
424
|
+
* We found an option (--), so if we skipped
|
|
425
|
+
* non-options, we have to permute.
|
|
426
|
+
*/
|
|
427
|
+
if (nonopt_end != -1) {
|
|
428
|
+
permute_args(nonopt_start, nonopt_end, optind,
|
|
429
|
+
nargv);
|
|
430
|
+
optind -= nonopt_end - nonopt_start;
|
|
431
|
+
}
|
|
432
|
+
nonopt_start = nonopt_end = -1;
|
|
433
|
+
return (-1);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/*
|
|
438
|
+
* Check long options if:
|
|
439
|
+
* 1) we were passed some
|
|
440
|
+
* 2) the arg is not just "-"
|
|
441
|
+
* 3) either the arg starts with -- we are getopt_long_only()
|
|
442
|
+
*/
|
|
443
|
+
if (long_options != NULL && place != nargv[optind] &&
|
|
444
|
+
(*place == '-' || (flags & FLAG_LONGONLY))) {
|
|
445
|
+
short_too = 0;
|
|
446
|
+
if (*place == '-')
|
|
447
|
+
place++; /* --foo long option */
|
|
448
|
+
else if (*place != ':' && strchr(options, *place) != NULL)
|
|
449
|
+
short_too = 1; /* could be short option too */
|
|
450
|
+
|
|
451
|
+
optchar = parse_long_options(nargv, options, long_options, idx,
|
|
452
|
+
short_too);
|
|
453
|
+
if (optchar != -1) {
|
|
454
|
+
place = EMSG;
|
|
455
|
+
return (optchar);
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if ((optchar = (int)*place++) == (int)':' ||
|
|
460
|
+
(optchar == (int)'-' && *place != '\0') ||
|
|
461
|
+
(oli = strchr(options, optchar)) == NULL) {
|
|
462
|
+
/*
|
|
463
|
+
* If the user specified "-" and '-' isn't listed in
|
|
464
|
+
* options, return -1 (non-option) as per POSIX.
|
|
465
|
+
* Otherwise, it is an unknown option character (or ':').
|
|
466
|
+
*/
|
|
467
|
+
if (optchar == (int)'-' && *place == '\0')
|
|
468
|
+
return (-1);
|
|
469
|
+
if (!*place)
|
|
470
|
+
++optind;
|
|
471
|
+
if (PRINT_ERROR)
|
|
472
|
+
warnx(illoptchar, optchar);
|
|
473
|
+
optopt = optchar;
|
|
474
|
+
return (BADCH);
|
|
475
|
+
}
|
|
476
|
+
if (long_options != NULL && optchar == 'W' && oli[1] == ';') {
|
|
477
|
+
/* -W long-option */
|
|
478
|
+
if (*place) /* no space */
|
|
479
|
+
/* NOTHING */;
|
|
480
|
+
else if (++optind >= nargc) { /* no arg */
|
|
481
|
+
place = EMSG;
|
|
482
|
+
if (PRINT_ERROR)
|
|
483
|
+
warnx(recargchar, optchar);
|
|
484
|
+
optopt = optchar;
|
|
485
|
+
return (BADARG);
|
|
486
|
+
} else /* white space */
|
|
487
|
+
place = nargv[optind];
|
|
488
|
+
optchar =
|
|
489
|
+
parse_long_options(nargv, options, long_options, idx, 0);
|
|
490
|
+
place = EMSG;
|
|
491
|
+
return (optchar);
|
|
492
|
+
}
|
|
493
|
+
if (*++oli != ':') { /* doesn't take argument */
|
|
494
|
+
if (!*place)
|
|
495
|
+
++optind;
|
|
496
|
+
} else { /* takes (optional) argument */
|
|
497
|
+
optarg = NULL;
|
|
498
|
+
if (*place) /* no white space */
|
|
499
|
+
optarg = place;
|
|
500
|
+
else if (oli[1] != ':') { /* arg not optional */
|
|
501
|
+
if (++optind >= nargc) { /* no arg */
|
|
502
|
+
place = EMSG;
|
|
503
|
+
if (PRINT_ERROR)
|
|
504
|
+
warnx(recargchar, optchar);
|
|
505
|
+
optopt = optchar;
|
|
506
|
+
return (BADARG);
|
|
507
|
+
} else
|
|
508
|
+
optarg = nargv[optind];
|
|
509
|
+
}
|
|
510
|
+
place = EMSG;
|
|
511
|
+
++optind;
|
|
512
|
+
}
|
|
513
|
+
/* dump back option letter */
|
|
514
|
+
return (optchar);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
#ifdef REPLACE_GETOPT
|
|
518
|
+
/*
|
|
519
|
+
* getopt --
|
|
520
|
+
* Parse argc/argv argument vector.
|
|
521
|
+
*
|
|
522
|
+
* [eventually this will replace the BSD getopt]
|
|
523
|
+
*/
|
|
524
|
+
int getopt(int nargc, char *const *nargv, const char *options) {
|
|
525
|
+
|
|
526
|
+
/*
|
|
527
|
+
* We don't pass FLAG_PERMUTE to getopt_internal() since
|
|
528
|
+
* the BSD getopt(3) (unlike GNU) has never done this.
|
|
529
|
+
*
|
|
530
|
+
* Furthermore, since many privileged programs call getopt()
|
|
531
|
+
* before dropping privileges it makes sense to keep things
|
|
532
|
+
* as simple (and bug-free) as possible.
|
|
533
|
+
*/
|
|
534
|
+
return (getopt_internal(nargc, nargv, options, NULL, NULL, 0));
|
|
535
|
+
}
|
|
536
|
+
#endif /* REPLACE_GETOPT */
|
|
537
|
+
|
|
538
|
+
/*
|
|
539
|
+
* getopt_long --
|
|
540
|
+
* Parse argc/argv argument vector.
|
|
541
|
+
*/
|
|
542
|
+
int getopt_long(int nargc,
|
|
543
|
+
char *const *nargv,
|
|
544
|
+
const char *options,
|
|
545
|
+
const struct option *long_options,
|
|
546
|
+
int *idx) {
|
|
547
|
+
|
|
548
|
+
return (getopt_internal(nargc, nargv, options, long_options, idx,
|
|
549
|
+
FLAG_PERMUTE));
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
/*
|
|
553
|
+
* getopt_long_only --
|
|
554
|
+
* Parse argc/argv argument vector.
|
|
555
|
+
*/
|
|
556
|
+
int getopt_long_only(int nargc,
|
|
557
|
+
char *const *nargv,
|
|
558
|
+
const char *options,
|
|
559
|
+
const struct option *long_options,
|
|
560
|
+
int *idx) {
|
|
561
|
+
|
|
562
|
+
return (getopt_internal(nargc, nargv, options, long_options, idx,
|
|
563
|
+
FLAG_PERMUTE | FLAG_LONGONLY));
|
|
564
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#ifndef __GETOPT_H__
|
|
2
|
+
/**
|
|
3
|
+
* DISCLAIMER
|
|
4
|
+
* This file has no copyright assigned and is placed in the Public Domain.
|
|
5
|
+
* This file is a part of the w64 mingw-runtime package.
|
|
6
|
+
*
|
|
7
|
+
* The w64 mingw-runtime package and its code is distributed in the hope that it
|
|
8
|
+
* will be useful but WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESSED OR
|
|
9
|
+
* IMPLIED ARE HEREBY DISCLAIMED. This includes but is not limited to
|
|
10
|
+
* warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
#define __GETOPT_H__
|
|
14
|
+
|
|
15
|
+
/* All the headers include this file. */
|
|
16
|
+
#include <crtdefs.h>
|
|
17
|
+
|
|
18
|
+
#ifdef __cplusplus
|
|
19
|
+
extern "C" {
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
extern int optind; /* index of first non-option in argv */
|
|
23
|
+
extern int optopt; /* single option character, as parsed */
|
|
24
|
+
extern int opterr; /* flag to enable built-in diagnostics... */
|
|
25
|
+
/* (user may set to zero, to suppress) */
|
|
26
|
+
|
|
27
|
+
extern char *optarg; /* pointer to argument of current option */
|
|
28
|
+
|
|
29
|
+
extern int getopt(int nargc, char *const *nargv, const char *options);
|
|
30
|
+
|
|
31
|
+
#ifdef _BSD_SOURCE
|
|
32
|
+
/*
|
|
33
|
+
* BSD adds the non-standard `optreset' feature, for reinitialisation
|
|
34
|
+
* of `getopt' parsing. We support this feature, for applications which
|
|
35
|
+
* proclaim their BSD heritage, before including this header; however,
|
|
36
|
+
* to maintain portability, developers are advised to avoid it.
|
|
37
|
+
*/
|
|
38
|
+
#define optreset __mingw_optreset
|
|
39
|
+
extern int optreset;
|
|
40
|
+
#endif
|
|
41
|
+
#ifdef __cplusplus
|
|
42
|
+
}
|
|
43
|
+
#endif
|
|
44
|
+
/*
|
|
45
|
+
* POSIX requires the `getopt' API to be specified in `unistd.h';
|
|
46
|
+
* thus, `unistd.h' includes this header. However, we do not want
|
|
47
|
+
* to expose the `getopt_long' or `getopt_long_only' APIs, when
|
|
48
|
+
* included in this manner. Thus, close the standard __GETOPT_H__
|
|
49
|
+
* declarations block, and open an additional __GETOPT_LONG_H__
|
|
50
|
+
* specific block, only when *not* __UNISTD_H_SOURCED__, in which
|
|
51
|
+
* to declare the extended API.
|
|
52
|
+
*/
|
|
53
|
+
#endif /* !defined(__GETOPT_H__) */
|
|
54
|
+
|
|
55
|
+
#if !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__)
|
|
56
|
+
#define __GETOPT_LONG_H__
|
|
57
|
+
|
|
58
|
+
#ifdef __cplusplus
|
|
59
|
+
extern "C" {
|
|
60
|
+
#endif
|
|
61
|
+
|
|
62
|
+
struct option /* specification for a long form option... */
|
|
63
|
+
{
|
|
64
|
+
const char *name; /* option name, without leading hyphens */
|
|
65
|
+
int has_arg; /* does it take an argument? */
|
|
66
|
+
int *flag; /* where to save its status, or NULL */
|
|
67
|
+
int val; /* its associated status value */
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
enum /* permitted values for its `has_arg' field... */
|
|
71
|
+
{
|
|
72
|
+
no_argument = 0, /* option never takes an argument */
|
|
73
|
+
required_argument, /* option always requires an argument */
|
|
74
|
+
optional_argument /* option may take an argument */
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
extern int getopt_long(int nargc,
|
|
78
|
+
char *const *nargv,
|
|
79
|
+
const char *options,
|
|
80
|
+
const struct option *long_options,
|
|
81
|
+
int *idx);
|
|
82
|
+
extern int getopt_long_only(int nargc,
|
|
83
|
+
char *const *nargv,
|
|
84
|
+
const char *options,
|
|
85
|
+
const struct option *long_options,
|
|
86
|
+
int *idx);
|
|
87
|
+
/*
|
|
88
|
+
* Previous MinGW implementation had...
|
|
89
|
+
*/
|
|
90
|
+
#ifndef HAVE_DECL_GETOPT
|
|
91
|
+
/*
|
|
92
|
+
* ...for the long form API only; keep this for compatibility.
|
|
93
|
+
*/
|
|
94
|
+
#define HAVE_DECL_GETOPT 1
|
|
95
|
+
#endif
|
|
96
|
+
|
|
97
|
+
#ifdef __cplusplus
|
|
98
|
+
}
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
#endif /* !defined(__UNISTD_H_SOURCED__) && !defined(__GETOPT_LONG_H__) */
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright: public domain
|
|
3
|
+
*/
|
|
4
|
+
#pragma once
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* gettimeofday() for Win32 from
|
|
8
|
+
* http://stackoverflow.com/questions/10905892/equivalent-of-gettimeday-for-windows
|
|
9
|
+
*/
|
|
10
|
+
#define WIN32_LEAN_AND_MEAN
|
|
11
|
+
#include <windows.h>
|
|
12
|
+
#include <stdint.h> // portable: uint64_t MSVC: __int64
|
|
13
|
+
|
|
14
|
+
static int gettimeofday(struct timeval *tp, struct timezone *tzp) {
|
|
15
|
+
// Note: some broken versions only have 8 trailing zero's, the correct
|
|
16
|
+
// epoch has 9 trailing zero's This magic number is the number of 100
|
|
17
|
+
// nanosecond intervals since January 1, 1601 (UTC) until 00:00:00
|
|
18
|
+
// January 1, 1970
|
|
19
|
+
static const uint64_t EPOCH = ((uint64_t)116444736000000000ULL);
|
|
20
|
+
|
|
21
|
+
SYSTEMTIME system_time;
|
|
22
|
+
FILETIME file_time;
|
|
23
|
+
uint64_t time;
|
|
24
|
+
|
|
25
|
+
GetSystemTime(&system_time);
|
|
26
|
+
SystemTimeToFileTime(&system_time, &file_time);
|
|
27
|
+
time = ((uint64_t)file_time.dwLowDateTime);
|
|
28
|
+
time += ((uint64_t)file_time.dwHighDateTime) << 32;
|
|
29
|
+
|
|
30
|
+
tp->tv_sec = (long)((time - EPOCH) / 10000000L);
|
|
31
|
+
tp->tv_usec = (long)(system_time.wMilliseconds * 1000);
|
|
32
|
+
return 0;
|
|
33
|
+
}
|