snowflake-connector-python 4.4.0__cp314-cp314-win_amd64.whl
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.
- snowflake/connector/__init__.py +118 -0
- snowflake/connector/_query_context_cache.py +276 -0
- snowflake/connector/_sql_util.py +48 -0
- snowflake/connector/_utils.py +353 -0
- snowflake/connector/aio/README.md +88 -0
- snowflake/connector/aio/__init__.py +163 -0
- snowflake/connector/aio/_azure_storage_client.py +227 -0
- snowflake/connector/aio/_bind_upload_agent.py +69 -0
- snowflake/connector/aio/_connection.py +1216 -0
- snowflake/connector/aio/_cursor.py +1402 -0
- snowflake/connector/aio/_description.py +5 -0
- snowflake/connector/aio/_direct_file_operation_utils.py +88 -0
- snowflake/connector/aio/_file_transfer_agent.py +316 -0
- snowflake/connector/aio/_gcs_storage_client.py +360 -0
- snowflake/connector/aio/_network.py +860 -0
- snowflake/connector/aio/_ocsp_asn1crypto.py +51 -0
- snowflake/connector/aio/_ocsp_snowflake.py +608 -0
- snowflake/connector/aio/_pandas_tools.py +561 -0
- snowflake/connector/aio/_result_batch.py +442 -0
- snowflake/connector/aio/_result_set.py +309 -0
- snowflake/connector/aio/_s3_storage_client.py +460 -0
- snowflake/connector/aio/_session_manager.py +588 -0
- snowflake/connector/aio/_storage_client.py +331 -0
- snowflake/connector/aio/_telemetry.py +97 -0
- snowflake/connector/aio/_time_util.py +57 -0
- snowflake/connector/aio/_wif_util.py +324 -0
- snowflake/connector/aio/auth/__init__.py +52 -0
- snowflake/connector/aio/auth/_auth.py +406 -0
- snowflake/connector/aio/auth/_by_plugin.py +131 -0
- snowflake/connector/aio/auth/_default.py +28 -0
- snowflake/connector/aio/auth/_idtoken.py +54 -0
- snowflake/connector/aio/auth/_keypair.py +60 -0
- snowflake/connector/aio/auth/_no_auth.py +31 -0
- snowflake/connector/aio/auth/_oauth.py +27 -0
- snowflake/connector/aio/auth/_oauth_code.py +117 -0
- snowflake/connector/aio/auth/_oauth_credentials.py +100 -0
- snowflake/connector/aio/auth/_okta.py +247 -0
- snowflake/connector/aio/auth/_pat.py +27 -0
- snowflake/connector/aio/auth/_usrpwdmfa.py +30 -0
- snowflake/connector/aio/auth/_webbrowser.py +405 -0
- snowflake/connector/aio/auth/_workload_identity.py +60 -0
- snowflake/connector/arrow_context.py +211 -0
- snowflake/connector/auth/__init__.py +53 -0
- snowflake/connector/auth/_auth.py +669 -0
- snowflake/connector/auth/_http_server.py +257 -0
- snowflake/connector/auth/_oauth_base.py +472 -0
- snowflake/connector/auth/by_plugin.py +219 -0
- snowflake/connector/auth/default.py +36 -0
- snowflake/connector/auth/idtoken.py +72 -0
- snowflake/connector/auth/keypair.py +225 -0
- snowflake/connector/auth/no_auth.py +39 -0
- snowflake/connector/auth/oauth.py +49 -0
- snowflake/connector/auth/oauth_code.py +490 -0
- snowflake/connector/auth/oauth_credentials.py +71 -0
- snowflake/connector/auth/okta.py +339 -0
- snowflake/connector/auth/pat.py +40 -0
- snowflake/connector/auth/usrpwdmfa.py +69 -0
- snowflake/connector/auth/webbrowser.py +514 -0
- snowflake/connector/auth/workload_identity.py +110 -0
- snowflake/connector/azure_storage_client.py +278 -0
- snowflake/connector/backoff_policies.py +141 -0
- snowflake/connector/bind_upload_agent.py +89 -0
- snowflake/connector/cache.py +696 -0
- snowflake/connector/compat.py +127 -0
- snowflake/connector/config_manager.py +553 -0
- snowflake/connector/connection.py +2671 -0
- snowflake/connector/connection_diagnostic.py +793 -0
- snowflake/connector/constants.py +460 -0
- snowflake/connector/converter.py +809 -0
- snowflake/connector/converter_issue23517.py +87 -0
- snowflake/connector/converter_null.py +14 -0
- snowflake/connector/converter_snowsql.py +205 -0
- snowflake/connector/crl.py +919 -0
- snowflake/connector/crl_cache.py +734 -0
- snowflake/connector/cursor.py +2099 -0
- snowflake/connector/dbapi.py +53 -0
- snowflake/connector/description.py +21 -0
- snowflake/connector/direct_file_operation_utils.py +88 -0
- snowflake/connector/encryption_util.py +220 -0
- snowflake/connector/errorcode.py +94 -0
- snowflake/connector/errors.py +666 -0
- snowflake/connector/externals_utils/__init__.py +0 -0
- snowflake/connector/externals_utils/externals_setup.py +30 -0
- snowflake/connector/feature.py +4 -0
- snowflake/connector/file_compression_type.py +118 -0
- snowflake/connector/file_lock.py +72 -0
- snowflake/connector/file_transfer_agent.py +1244 -0
- snowflake/connector/file_util.py +153 -0
- snowflake/connector/gcs_storage_client.py +476 -0
- snowflake/connector/gzip_decoder.py +85 -0
- snowflake/connector/interval_util.py +26 -0
- snowflake/connector/local_storage_client.py +90 -0
- snowflake/connector/log_configuration.py +62 -0
- snowflake/connector/logging_utils/__init__.py +0 -0
- snowflake/connector/logging_utils/filters.py +72 -0
- snowflake/connector/minicore/__init__.py +0 -0
- snowflake/connector/minicore/aix_ppc64/libsf_mini_core.a +0 -0
- snowflake/connector/minicore/aix_ppc64/libsf_mini_core_static.a +0 -0
- snowflake/connector/minicore/linux_aarch64_glibc/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/linux_aarch64_musl/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/linux_x86_64_glibc/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/linux_x86_64_musl/libsf_mini_core.so +0 -0
- snowflake/connector/minicore/macos_aarch64/libsf_mini_core.dylib +0 -0
- snowflake/connector/minicore/macos_x86_64/libsf_mini_core.dylib +0 -0
- snowflake/connector/minicore/windows_x86_64/sf_mini_core.dll +0 -0
- snowflake/connector/minicore/windows_x86_64/sf_mini_core_static.lib +0 -0
- snowflake/connector/nanoarrow_arrow_iterator.cp314-win_amd64.pyd +0 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp +60 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.hpp +29 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.cpp +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.hpp +26 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.cpp +21 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.hpp +23 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.cpp +570 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.hpp +98 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.cpp +125 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.hpp +115 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.cpp +1140 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.hpp +138 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.cpp +47 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.hpp +46 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.cpp +83 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.hpp +35 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.cpp +97 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.hpp +72 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.cpp +73 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.hpp +28 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.cpp +30 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.hpp +35 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IColumnConverter.hpp +17 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.cpp +23 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.hpp +45 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.cpp +75 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.hpp +57 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/LICENSE.txt +209 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.cpp +75 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.hpp +30 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.cpp +46 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.hpp +29 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.cpp +8 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.hpp +95 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.cpp +57 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.hpp +36 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.cpp +34 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.hpp +48 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.cpp +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.hpp +26 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.cpp +36 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.hpp +31 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.cpp +346 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.hpp +145 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/macros.hpp +14 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.cpp +67 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.hpp +68 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_accessors.h +101 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_alloc.h +127 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_assert.h +45 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_builder.h +1908 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_emitter.h +215 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_endian.h +125 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_epilogue.h +7 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_flatbuffers.h +55 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_identifier.h +148 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_iov.h +31 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_prologue.h +8 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_refmap.h +144 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_rtconfig.h +162 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_types.h +97 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_verifier.h +239 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/flatcc_portable.h +14 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/paligned_alloc.h +210 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pattributes.h +84 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic.h +84 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_pop.h +20 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_push.h +51 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian.h +206 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian_detect.h +118 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinline.h +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinttypes.h +52 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable.h +2 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable_basic.h +25 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstatic_assert.h +67 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdalign.h +162 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdint.h +898 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/punaligned.h +190 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pversion.h +6 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pwarnings.h +52 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc.c +3204 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.c +3217 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.h +3618 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.hpp +379 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_arrow_iterator.pyx +262 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.c +512 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.h +350 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +33273 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.h +397 -0
- snowflake/connector/nanoarrow_cpp/Logging/logging.cpp +100 -0
- snowflake/connector/nanoarrow_cpp/Logging/logging.hpp +49 -0
- snowflake/connector/network.py +1227 -0
- snowflake/connector/ocsp_asn1crypto.py +447 -0
- snowflake/connector/ocsp_snowflake.py +1939 -0
- snowflake/connector/options.py +179 -0
- snowflake/connector/os_details.py +88 -0
- snowflake/connector/pandas_tools.py +734 -0
- snowflake/connector/platform_detection.py +555 -0
- snowflake/connector/proxy.py +28 -0
- snowflake/connector/py.typed +0 -0
- snowflake/connector/result_batch.py +917 -0
- snowflake/connector/result_set.py +340 -0
- snowflake/connector/s3_storage_client.py +614 -0
- snowflake/connector/secret_detector.py +181 -0
- snowflake/connector/session_manager.py +650 -0
- snowflake/connector/sf_dirs.py +64 -0
- snowflake/connector/sfbinaryformat.py +35 -0
- snowflake/connector/sfdatetime.py +345 -0
- snowflake/connector/snow_logging.py +144 -0
- snowflake/connector/sqlstate.py +9 -0
- snowflake/connector/ssd_internal_keys.py +30 -0
- snowflake/connector/ssl_wrap_socket.py +281 -0
- snowflake/connector/storage_client.py +486 -0
- snowflake/connector/telemetry.py +254 -0
- snowflake/connector/telemetry_oob.py +544 -0
- snowflake/connector/test_util.py +30 -0
- snowflake/connector/time_util.py +159 -0
- snowflake/connector/token_cache.py +457 -0
- snowflake/connector/tool/__init__.py +0 -0
- snowflake/connector/tool/dump_certs.py +57 -0
- snowflake/connector/tool/dump_ocsp_response.py +139 -0
- snowflake/connector/tool/dump_ocsp_response_cache.py +194 -0
- snowflake/connector/tool/probe_connection.py +69 -0
- snowflake/connector/url_util.py +55 -0
- snowflake/connector/util_text.py +320 -0
- snowflake/connector/vendored/__init__.py +3 -0
- snowflake/connector/vendored/requests/LICENSE +175 -0
- snowflake/connector/vendored/requests/__init__.py +184 -0
- snowflake/connector/vendored/requests/__version__.py +14 -0
- snowflake/connector/vendored/requests/_internal_utils.py +50 -0
- snowflake/connector/vendored/requests/adapters.py +696 -0
- snowflake/connector/vendored/requests/api.py +157 -0
- snowflake/connector/vendored/requests/auth.py +314 -0
- snowflake/connector/vendored/requests/certs.py +17 -0
- snowflake/connector/vendored/requests/compat.py +106 -0
- snowflake/connector/vendored/requests/cookies.py +561 -0
- snowflake/connector/vendored/requests/exceptions.py +151 -0
- snowflake/connector/vendored/requests/help.py +134 -0
- snowflake/connector/vendored/requests/hooks.py +33 -0
- snowflake/connector/vendored/requests/models.py +1039 -0
- snowflake/connector/vendored/requests/packages.py +23 -0
- snowflake/connector/vendored/requests/sessions.py +831 -0
- snowflake/connector/vendored/requests/status_codes.py +128 -0
- snowflake/connector/vendored/requests/structures.py +99 -0
- snowflake/connector/vendored/requests/utils.py +1086 -0
- snowflake/connector/vendored/urllib3/LICENSE.txt +21 -0
- snowflake/connector/vendored/urllib3/__init__.py +211 -0
- snowflake/connector/vendored/urllib3/_base_connection.py +165 -0
- snowflake/connector/vendored/urllib3/_collections.py +487 -0
- snowflake/connector/vendored/urllib3/_request_methods.py +278 -0
- snowflake/connector/vendored/urllib3/_version.py +34 -0
- snowflake/connector/vendored/urllib3/connection.py +1108 -0
- snowflake/connector/vendored/urllib3/connectionpool.py +1178 -0
- snowflake/connector/vendored/urllib3/contrib/__init__.py +0 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/__init__.py +17 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/connection.py +260 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/emscripten_fetch_worker.js +110 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/fetch.py +726 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/request.py +22 -0
- snowflake/connector/vendored/urllib3/contrib/emscripten/response.py +277 -0
- snowflake/connector/vendored/urllib3/contrib/pyopenssl.py +564 -0
- snowflake/connector/vendored/urllib3/contrib/socks.py +228 -0
- snowflake/connector/vendored/urllib3/exceptions.py +335 -0
- snowflake/connector/vendored/urllib3/fields.py +341 -0
- snowflake/connector/vendored/urllib3/filepost.py +89 -0
- snowflake/connector/vendored/urllib3/http2/__init__.py +53 -0
- snowflake/connector/vendored/urllib3/http2/connection.py +356 -0
- snowflake/connector/vendored/urllib3/http2/probe.py +87 -0
- snowflake/connector/vendored/urllib3/poolmanager.py +651 -0
- snowflake/connector/vendored/urllib3/py.typed +2 -0
- snowflake/connector/vendored/urllib3/response.py +1480 -0
- snowflake/connector/vendored/urllib3/util/__init__.py +42 -0
- snowflake/connector/vendored/urllib3/util/connection.py +137 -0
- snowflake/connector/vendored/urllib3/util/proxy.py +43 -0
- snowflake/connector/vendored/urllib3/util/request.py +263 -0
- snowflake/connector/vendored/urllib3/util/response.py +101 -0
- snowflake/connector/vendored/urllib3/util/retry.py +549 -0
- snowflake/connector/vendored/urllib3/util/ssl_.py +527 -0
- snowflake/connector/vendored/urllib3/util/ssl_match_hostname.py +159 -0
- snowflake/connector/vendored/urllib3/util/ssltransport.py +271 -0
- snowflake/connector/vendored/urllib3/util/timeout.py +275 -0
- snowflake/connector/vendored/urllib3/util/url.py +469 -0
- snowflake/connector/vendored/urllib3/util/util.py +42 -0
- snowflake/connector/vendored/urllib3/util/wait.py +124 -0
- snowflake/connector/version.py +3 -0
- snowflake/connector/wif_util.py +434 -0
- snowflake_connector_python-4.4.0.dist-info/DELVEWHEEL +2 -0
- snowflake_connector_python-4.4.0.dist-info/METADATA +1591 -0
- snowflake_connector_python-4.4.0.dist-info/RECORD +302 -0
- snowflake_connector_python-4.4.0.dist-info/WHEEL +5 -0
- snowflake_connector_python-4.4.0.dist-info/entry_points.txt +4 -0
- snowflake_connector_python-4.4.0.dist-info/licenses/LICENSE.txt +202 -0
- snowflake_connector_python-4.4.0.dist-info/licenses/NOTICE +8 -0
- snowflake_connector_python-4.4.0.dist-info/top_level.txt +1 -0
- snowflake_connector_python.libs/msvcp140-0f885b509a685d2bbfa652fed26b5fb3.dll +0 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
#ifndef FLATCC_ACCESSORS
|
|
2
|
+
#define FLATCC_ACCESSORS
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
#ifndef UINT8_MAX
|
|
9
|
+
#include <stdint.h>
|
|
10
|
+
#endif
|
|
11
|
+
|
|
12
|
+
#define __flatcc_basic_scalar_accessors_impl(N, T, W, E) \
|
|
13
|
+
static inline size_t N ## __size(void) \
|
|
14
|
+
{ return sizeof(T); } \
|
|
15
|
+
static inline T *N ## __ptr_add(T *p, size_t i) \
|
|
16
|
+
{ return p + i; } \
|
|
17
|
+
static inline const T *N ## __const_ptr_add(const T *p, size_t i) \
|
|
18
|
+
{ return p + i; } \
|
|
19
|
+
static inline T N ## _read_from_pe(const void *p) \
|
|
20
|
+
{ return N ## _cast_from_pe(*(T *)p); } \
|
|
21
|
+
static inline T N ## _read_to_pe(const void *p) \
|
|
22
|
+
{ return N ## _cast_to_pe(*(T *)p); } \
|
|
23
|
+
static inline T N ## _read(const void *p) \
|
|
24
|
+
{ return *(T *)p; } \
|
|
25
|
+
static inline void N ## _write_from_pe(void *p, T v) \
|
|
26
|
+
{ *(T *)p = N ## _cast_from_pe(v); } \
|
|
27
|
+
static inline void N ## _write_to_pe(void *p, T v) \
|
|
28
|
+
{ *(T *)p = N ## _cast_to_pe(v); } \
|
|
29
|
+
static inline void N ## _write(void *p, T v) \
|
|
30
|
+
{ *(T *)p = v; } \
|
|
31
|
+
static inline T N ## _read_from_le(const void *p) \
|
|
32
|
+
{ return N ## _cast_from_le(*(T *)p); } \
|
|
33
|
+
typedef struct { int is_null; T value; } N ## _option_t;
|
|
34
|
+
|
|
35
|
+
#define __flatcc_define_integer_accessors_impl(N, T, W, E) \
|
|
36
|
+
static inline T N ## _cast_from_pe(T v) \
|
|
37
|
+
{ return (T) E ## W ## toh((uint ## W ## _t)v); } \
|
|
38
|
+
static inline T N ## _cast_to_pe(T v) \
|
|
39
|
+
{ return (T) hto ## E ## W((uint ## W ## _t)v); } \
|
|
40
|
+
static inline T N ## _cast_from_le(T v) \
|
|
41
|
+
{ return (T) le ## W ## toh((uint ## W ## _t)v); } \
|
|
42
|
+
static inline T N ## _cast_to_le(T v) \
|
|
43
|
+
{ return (T) htole ## W((uint ## W ## _t)v); } \
|
|
44
|
+
static inline T N ## _cast_from_be(T v) \
|
|
45
|
+
{ return (T) be ## W ## toh((uint ## W ## _t)v); } \
|
|
46
|
+
static inline T N ## _cast_to_be(T v) \
|
|
47
|
+
{ return (T) htobe ## W((uint ## W ## _t)v); } \
|
|
48
|
+
__flatcc_basic_scalar_accessors_impl(N, T, W, E)
|
|
49
|
+
|
|
50
|
+
#define __flatcc_define_real_accessors_impl(N, T, W, E) \
|
|
51
|
+
union __ ## N ## _cast { T v; uint ## W ## _t u; }; \
|
|
52
|
+
static inline T N ## _cast_from_pe(T v) \
|
|
53
|
+
{ union __ ## N ## _cast x; \
|
|
54
|
+
x.v = v; x.u = E ## W ## toh(x.u); return x.v; } \
|
|
55
|
+
static inline T N ## _cast_to_pe(T v) \
|
|
56
|
+
{ union __ ## N ## _cast x; \
|
|
57
|
+
x.v = v; x.u = hto ## E ## W(x.u); return x.v; } \
|
|
58
|
+
static inline T N ## _cast_from_le(T v) \
|
|
59
|
+
{ union __ ## N ## _cast x; \
|
|
60
|
+
x.v = v; x.u = le ## W ## toh(x.u); return x.v; } \
|
|
61
|
+
static inline T N ## _cast_to_le(T v) \
|
|
62
|
+
{ union __ ## N ## _cast x; \
|
|
63
|
+
x.v = v; x.u = htole ## W(x.u); return x.v; } \
|
|
64
|
+
static inline T N ## _cast_from_be(T v) \
|
|
65
|
+
{ union __ ## N ## _cast x; \
|
|
66
|
+
x.v = v; x.u = be ## W ## toh(x.u); return x.v; } \
|
|
67
|
+
static inline T N ## _cast_to_be(T v) \
|
|
68
|
+
{ union __ ## N ## _cast x; \
|
|
69
|
+
x.v = v; x.u = htobe ## W(x.u); return x.v; } \
|
|
70
|
+
__flatcc_basic_scalar_accessors_impl(N, T, W, E)
|
|
71
|
+
|
|
72
|
+
#define __flatcc_define_integer_accessors(N, T, W, E) \
|
|
73
|
+
__flatcc_define_integer_accessors_impl(N, T, W, E)
|
|
74
|
+
|
|
75
|
+
#define __flatcc_define_real_accessors(N, T, W, E) \
|
|
76
|
+
__flatcc_define_real_accessors_impl(N, T, W, E)
|
|
77
|
+
|
|
78
|
+
#define __flatcc_define_basic_integer_accessors(NS, TN, T, W, E) \
|
|
79
|
+
__flatcc_define_integer_accessors(NS ## TN, T, W, E)
|
|
80
|
+
|
|
81
|
+
#define __flatcc_define_basic_real_accessors(NS, TN, T, W, E) \
|
|
82
|
+
__flatcc_define_real_accessors(NS ## TN, T, W, E)
|
|
83
|
+
|
|
84
|
+
#define __flatcc_define_basic_scalar_accessors(NS, E) \
|
|
85
|
+
__flatcc_define_basic_integer_accessors(NS, char, char, 8, E) \
|
|
86
|
+
__flatcc_define_basic_integer_accessors(NS, uint8, uint8_t, 8, E) \
|
|
87
|
+
__flatcc_define_basic_integer_accessors(NS, uint16, uint16_t, 16, E) \
|
|
88
|
+
__flatcc_define_basic_integer_accessors(NS, uint32, uint32_t, 32, E) \
|
|
89
|
+
__flatcc_define_basic_integer_accessors(NS, uint64, uint64_t, 64, E) \
|
|
90
|
+
__flatcc_define_basic_integer_accessors(NS, int8, int8_t, 8, E) \
|
|
91
|
+
__flatcc_define_basic_integer_accessors(NS, int16, int16_t, 16, E) \
|
|
92
|
+
__flatcc_define_basic_integer_accessors(NS, int32, int32_t, 32, E) \
|
|
93
|
+
__flatcc_define_basic_integer_accessors(NS, int64, int64_t, 64, E) \
|
|
94
|
+
__flatcc_define_basic_real_accessors(NS, float, float, 32, E) \
|
|
95
|
+
__flatcc_define_basic_real_accessors(NS, double, double, 64, E)
|
|
96
|
+
|
|
97
|
+
#ifdef __cplusplus
|
|
98
|
+
}
|
|
99
|
+
#endif
|
|
100
|
+
|
|
101
|
+
#endif /* FLATCC_ACCESSORS */
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
#ifndef FLATCC_ALLOC_H
|
|
2
|
+
#define FLATCC_ALLOC_H
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* These allocation abstractions are __only__ for runtime libraries.
|
|
10
|
+
*
|
|
11
|
+
* The flatcc compiler uses Posix allocation routines regardless
|
|
12
|
+
* of how this file is configured.
|
|
13
|
+
*
|
|
14
|
+
* This header makes it possible to use systems where malloc is not
|
|
15
|
+
* valid to use. In this case the portable library will not help
|
|
16
|
+
* because it implements Posix / C11 abstractions.
|
|
17
|
+
*
|
|
18
|
+
* Systems like FreeRTOS do not work with Posix memory calls and here it
|
|
19
|
+
* can be helpful to override runtime allocation primitives.
|
|
20
|
+
*
|
|
21
|
+
* In general, it is better to customize the allocator and emitter via
|
|
22
|
+
* flatcc_builder_custom_init and to avoid using the default emitter
|
|
23
|
+
* specific high level calls the copy out a buffer that must later be
|
|
24
|
+
* deallocated. This provides full control of allocation withou the need
|
|
25
|
+
* for this file.
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
* IMPORTANT
|
|
29
|
+
*
|
|
30
|
+
* If you override malloc, free, etc., make sure your applications
|
|
31
|
+
* use the same allocation methods. For example, samples/monster.c
|
|
32
|
+
* and several test cases are no longer guaranteed to work out of the
|
|
33
|
+
* box.
|
|
34
|
+
*
|
|
35
|
+
* The changes must only affect target runtime compilation including the
|
|
36
|
+
* the runtime library libflatccrt.
|
|
37
|
+
*
|
|
38
|
+
* The host system flatcc compiler and the compiler library libflatcc
|
|
39
|
+
* should NOT be compiled with non-Posix allocation since the compiler
|
|
40
|
+
* has a dependency on the runtime library and the wrong free operation
|
|
41
|
+
* might be callled. The safest way to avoid this problem this is to
|
|
42
|
+
* compile flatcc with the CMake script and the runtime files with a
|
|
43
|
+
* dedicated build system for the target system.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
#include <stdlib.h>
|
|
47
|
+
|
|
48
|
+
#ifndef FLATCC_ALLOC
|
|
49
|
+
#define FLATCC_ALLOC(n) malloc(n)
|
|
50
|
+
#endif
|
|
51
|
+
|
|
52
|
+
#ifndef FLATCC_FREE
|
|
53
|
+
#define FLATCC_FREE(p) free(p)
|
|
54
|
+
#endif
|
|
55
|
+
|
|
56
|
+
#ifndef FLATCC_REALLOC
|
|
57
|
+
#define FLATCC_REALLOC(p, n) realloc(p, n)
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
#ifndef FLATCC_CALLOC
|
|
61
|
+
#define FLATCC_CALLOC(nm, n) calloc(nm, n)
|
|
62
|
+
#endif
|
|
63
|
+
|
|
64
|
+
/*
|
|
65
|
+
* Implements `aligned_alloc` and `aligned_free`.
|
|
66
|
+
* Even with C11, this implements non-standard aligned_free needed for portable
|
|
67
|
+
* aligned_alloc implementations.
|
|
68
|
+
*/
|
|
69
|
+
#ifndef FLATCC_USE_GENERIC_ALIGNED_ALLOC
|
|
70
|
+
|
|
71
|
+
#ifndef FLATCC_NO_PALIGNED_ALLOC
|
|
72
|
+
#include "flatcc/portable/paligned_alloc.h"
|
|
73
|
+
#else
|
|
74
|
+
#if !defined(__aligned_free_is_defined) || !__aligned_free_is_defined
|
|
75
|
+
#define aligned_free free
|
|
76
|
+
#endif
|
|
77
|
+
#endif
|
|
78
|
+
|
|
79
|
+
#else /* FLATCC_USE_GENERIC_ALIGNED_ALLOC */
|
|
80
|
+
|
|
81
|
+
#ifndef FLATCC_ALIGNED_ALLOC
|
|
82
|
+
static inline void *__flatcc_aligned_alloc(size_t alignment, size_t size)
|
|
83
|
+
{
|
|
84
|
+
char *raw;
|
|
85
|
+
void *buf;
|
|
86
|
+
size_t total_size = (size + alignment - 1 + sizeof(void *));
|
|
87
|
+
|
|
88
|
+
if (alignment < sizeof(void *)) {
|
|
89
|
+
alignment = sizeof(void *);
|
|
90
|
+
}
|
|
91
|
+
raw = (char *)(size_t)FLATCC_ALLOC(total_size);
|
|
92
|
+
buf = raw + alignment - 1 + sizeof(void *);
|
|
93
|
+
buf = (void *)(((size_t)buf) & ~(alignment - 1));
|
|
94
|
+
((void **)buf)[-1] = raw;
|
|
95
|
+
return buf;
|
|
96
|
+
}
|
|
97
|
+
#define FLATCC_ALIGNED_ALLOC(alignment, size) __flatcc_aligned_alloc(alignment, size)
|
|
98
|
+
#endif /* FLATCC_USE_GENERIC_ALIGNED_ALLOC */
|
|
99
|
+
|
|
100
|
+
#ifndef FLATCC_ALIGNED_FREE
|
|
101
|
+
static inline void __flatcc_aligned_free(void *p)
|
|
102
|
+
{
|
|
103
|
+
char *raw;
|
|
104
|
+
|
|
105
|
+
if (!p) return;
|
|
106
|
+
raw = ((void **)p)[-1];
|
|
107
|
+
|
|
108
|
+
FLATCC_FREE(raw);
|
|
109
|
+
}
|
|
110
|
+
#define FLATCC_ALIGNED_FREE(p) __flatcc_aligned_free(p)
|
|
111
|
+
#endif
|
|
112
|
+
|
|
113
|
+
#endif /* FLATCC_USE_GENERIC_ALIGNED_ALLOC */
|
|
114
|
+
|
|
115
|
+
#ifndef FLATCC_ALIGNED_ALLOC
|
|
116
|
+
#define FLATCC_ALIGNED_ALLOC(a, n) aligned_alloc(a, n)
|
|
117
|
+
#endif
|
|
118
|
+
|
|
119
|
+
#ifndef FLATCC_ALIGNED_FREE
|
|
120
|
+
#define FLATCC_ALIGNED_FREE(p) aligned_free(p)
|
|
121
|
+
#endif
|
|
122
|
+
|
|
123
|
+
#ifdef __cplusplus
|
|
124
|
+
}
|
|
125
|
+
#endif
|
|
126
|
+
|
|
127
|
+
#endif /* FLATCC_ALLOC_H */
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
#ifndef FLATCC_ASSERT_H
|
|
2
|
+
#define FLATCC_ASSERT_H
|
|
3
|
+
|
|
4
|
+
#ifdef __cplusplus
|
|
5
|
+
extern "C" {
|
|
6
|
+
#endif
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* This assert abstraction is only used for the flatcc runtime library.
|
|
10
|
+
* The flatcc compiler uses Posix assert routines regardless of how this
|
|
11
|
+
* file is configured.
|
|
12
|
+
*
|
|
13
|
+
* This header makes it possible to use systems where assert is not
|
|
14
|
+
* valid to use. Note that `<assert.h>` may remain a dependency for static
|
|
15
|
+
* assertions.
|
|
16
|
+
*
|
|
17
|
+
* `FLATCC_ASSERT` is designed to handle errors which cannot be ignored
|
|
18
|
+
* and could lead to crash. The portable library may use assertions that
|
|
19
|
+
* are not affected by this macro.
|
|
20
|
+
*
|
|
21
|
+
* `FLATCC_ASSERT` defaults to POSIX assert but can be overrided by a
|
|
22
|
+
* preprocessor definition.
|
|
23
|
+
*
|
|
24
|
+
* Runtime assertions can be entirely disabled by defining
|
|
25
|
+
* `FLATCC_NO_ASSERT`.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
#ifdef FLATCC_NO_ASSERT
|
|
29
|
+
/* NOTE: This will not affect inclusion of <assert.h> for static assertions. */
|
|
30
|
+
#undef FLATCC_ASSERT
|
|
31
|
+
#define FLATCC_ASSERT(x) ((void)0)
|
|
32
|
+
/* Grisu3 is used for floating point conversion in JSON processing. */
|
|
33
|
+
#define GRISU3_NO_ASSERT
|
|
34
|
+
#endif
|
|
35
|
+
|
|
36
|
+
#ifndef FLATCC_ASSERT
|
|
37
|
+
#include <assert.h>
|
|
38
|
+
#define FLATCC_ASSERT assert
|
|
39
|
+
#endif
|
|
40
|
+
|
|
41
|
+
#ifdef __cplusplus
|
|
42
|
+
}
|
|
43
|
+
#endif
|
|
44
|
+
|
|
45
|
+
#endif /* FLATCC_ASSERT_H */
|