From 8b0c2c47b45c572a9714ec13f6eba07e1e20992c Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 10:32:04 +0200 Subject: [PATCH 001/397] fix: Rename `bump.bash` to `bump-and-tag.bash` --- CMakeLists.txt | 4 ++-- ci/scripts/{bump.bash => bump-and-tag.bash} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename ci/scripts/{bump.bash => bump-and-tag.bash} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb9000cf5..e264ffb1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.16) -# NOTE(fuzzpixelz): The ci/scripts/bump.bash scripts sets the project version -# using regular expressions on this statement. +# NOTE(fuzzpixelz): The ci/scripts/bump-and-tag.bash script sets the project +# version using regular expressions on this statement. set(ZENOHC_VERSION 0.11.0.0) project( diff --git a/ci/scripts/bump.bash b/ci/scripts/bump-and-tag.bash similarity index 100% rename from ci/scripts/bump.bash rename to ci/scripts/bump-and-tag.bash From 9e3abf3ae6b87b304aa5f0cd5478874c0e756b29 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 11:26:43 +0200 Subject: [PATCH 002/397] feat: Add `version.txt` and infer version in `bump-and-tag.bash` --- .github/workflows/release.yml | 2 +- CMakeLists.txt | 6 ++-- ci/scripts/bump-and-tag.bash | 68 ++++++++++++++++++----------------- docs/conf.py | 3 +- version.txt | 1 + 5 files changed, 41 insertions(+), 39 deletions(-) create mode 100644 version.txt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c6418b0d..0c2972556 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }} BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '^$' }} BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }} - GH_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }} + GITHUB_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }} GIT_USER_NAME: eclipse-zenoh-bot GIT_USER_EMAIL: eclipse-zenoh-bot@users.noreply.github.com diff --git a/CMakeLists.txt b/CMakeLists.txt index e264ffb1d..6dd057a0a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,12 +1,10 @@ cmake_minimum_required(VERSION 3.16) -# NOTE(fuzzpixelz): The ci/scripts/bump-and-tag.bash script sets the project -# version using regular expressions on this statement. -set(ZENOHC_VERSION 0.11.0.0) +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/version.txt version) project( zenohc - VERSION ${ZENOHC_VERSION} + VERSION ${version} DESCRIPTION "The C bindings for Zenoh" HOMEPAGE_URL "https://github.com/eclipse-zenoh/zenoh-c" LANGUAGES C diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index 3c3bae3cf..90d955a34 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -3,23 +3,23 @@ set -eo pipefail # Repository -readonly REPO +readonly repo=${REPO:?input REPO is required} # Release number -readonly VERSION +readonly version=${VERSION:-''} # Release branch -readonly BRANCH +readonly branch=${BRANCH:?input BRANCH is required} # Dependencies' pattern -readonly BUMP_DEPS_PATTERN +readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-input BUMP_DEPS_PATTERN is required} # Dependencies' version -readonly BUMP_DEPS_VERSION +readonly bump_deps_version=${BUMP_DEPS_VERSION:-''} # Dependencies' git branch -readonly BUMP_DEPS_BRANCH +readonly bump_deps_branch=${BUMP_DEPS_BRANCH:-''} # GitHub token -readonly GH_TOKEN +readonly github_token=${GITHUB_TOKEN:?input GITHUB_TOKEN is required} # Git actor name -readonly GIT_USER_NAME +readonly git_user_name=${GIT_USER_NAME:?input GIT_USER_NAME is required} # Git actor email -readonly GIT_USER_EMAIL +readonly git_user_email=${GIT_USER_EMAIL:?input GIT_USER_EMAIL is required} cargo +stable install toml-cli @@ -31,49 +31,51 @@ function toml_set_in_place() { mv "$tmp" "$1" } -export GIT_AUTHOR_NAME=$GIT_USER_NAME -export GIT_AUTHOR_EMAIL=$GIT_USER_EMAIL -export GIT_COMMITTER_NAME=$GIT_USER_NAME -export GIT_COMMITTER_EMAIL=$GIT_USER_EMAIL +export GIT_AUTHOR_NAME=$git_user_name +export GIT_AUTHOR_EMAIL=$git_user_email +export GIT_COMMITTER_NAME=$git_user_name +export GIT_COMMITTER_EMAIL=$git_user_email -git clone --recursive --single-branch --branch "$BRANCH" "https://github.com/$REPO" +git clone --recursive --single-branch --branch "$branch" "https://github.com/$repo" # Bump CMake project version -sed -i "s;^set(ZENOHC_VERSION .*)$;set(ZENOHC_VERSION $VERSION);" CMakeLists.txt +if [[ "$version" == '' ]]; then + # If no version has been specified, infer it using git-describe + printf '%s' "$(git describe)" > version.txt +else + printf '%s' "$version" > version.txt +fi # Propagate version change to Cargo.toml and Cargo.toml.in cmake . -DZENOHC_BUILD_IN_SOURCE_TREE=TRUE -DCMAKE_BUILD_TYPE=Release -# Update Read the Docs version -sed -i "s;^release = .*$;release = '$VERSION';" docs/conf.py # Update Debian dependency of libzenohc-dev -toml_set_in_place Cargo.toml "package.metadata.deb.variants.libzenohc-dev.depends" "libzenohc (=$VERSION)" -toml_set_in_place Cargo.toml.in "package.metadata.deb.variants.libzenohc-dev.depends" "libzenohc (=$VERSION)" +toml_set_in_place Cargo.toml "package.metadata.deb.variants.libzenohc-dev.depends" "libzenohc (=$version)" +toml_set_in_place Cargo.toml.in "package.metadata.deb.variants.libzenohc-dev.depends" "libzenohc (=$version)" -git commit CMakeLists.txt Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump version to $VERSION" +git commit version.txt Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump version to $version" -# Select all package dependencies that match $BUMP_DEPS_PATTERN and bump them to $BUMP_DEPS_VERSION -deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$BUMP_DEPS_PATTERN\"))") +# Select all package dependencies that match $bump_deps_pattern and bump them to $bump_deps_version +deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$bump_deps_pattern\"))") for dep in $deps; do - if [[ -n $BUMP_DEPS_VERSION ]]; then - toml_set_in_place Cargo.toml "dependencies.$dep.version" "$BUMP_DEPS_VERSION" - toml_set_in_place Cargo.toml.in "dependencies.$dep.version" "$BUMP_DEPS_VERSION" + if [[ -n $bump_deps_version ]]; then + toml_set_in_place Cargo.toml "dependencies.$dep.version" "$bump_deps_version" + toml_set_in_place Cargo.toml.in "dependencies.$dep.version" "$bump_deps_version" fi - if [[ -n $BUMP_DEPS_BRANCH ]]; then - toml_set_in_place Cargo.toml "dependencies.$dep.branch" "$BUMP_DEPS_BRANCH" - toml_set_in_place Cargo.toml.in "dependencies.$dep.branch" "$BUMP_DEPS_BRANCH" + if [[ -n $bump_deps_branch ]]; then + toml_set_in_place Cargo.toml "dependencies.$dep.branch" "$bump_deps_branch" + toml_set_in_place Cargo.toml.in "dependencies.$dep.branch" "$bump_deps_branch" fi done # Update lockfile cargo check -if [[ -n $BUMP_DEPS_VERSION || -n $BUMP_DEPS_BRANCH ]]; then - git commit Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump $BUMP_DEPS_PATTERN - version to $BUMP_DEPS_VERSION" +if [[ -n $bump_deps_version || -n $bump_deps_branch ]]; then + git commit Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump $bump_deps_pattern version to $bump_deps_version" else echo "info: no changes have been made to any dependencies" fi -git tag "$VERSION" -m "v$VERSION" +git tag "$version" -m "v$version" git log -10 git show-ref --tags -git push "https://$GH_TOKEN@github.com/$REPO" "$BRANCH" "$VERSION" +git push "https://$github_token@github.com/$repo" "$branch" "$version" diff --git a/docs/conf.py b/docs/conf.py index a9ab9a153..0ce6d7d44 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,7 +19,8 @@ project = 'zenoh-c' copyright = '2017, 2022 ZettaScale Technology' author = 'ZettaScale Zenoh team' -release = '0.11.0.0' +with open("../version.txt", "rt") as f: + release = f.read() # -- General configuration --------------------------------------------------- master_doc = 'index' diff --git a/version.txt b/version.txt new file mode 100644 index 000000000..6e5d683f0 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +0.11.0.0 \ No newline at end of file From 26d37f512d1fabeea52a2961940f0831b2365b59 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 12:26:38 +0200 Subject: [PATCH 003/397] fix: Clone repository using actions/checkout --- .github/workflows/release.yml | 8 +++++--- ci/scripts/bump-and-tag.bash | 11 ++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c2972556..88e6a672f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,16 +47,18 @@ jobs: version: ${{ inputs.version }} github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} + - name: Checkout this repository + uses: actions/checkout@v4 + with: + ref: ${{ steps.create-release-branch.outputs.branch }} + - name: Bump and tag project run: bash ci/scripts/bump-and-tag.bash env: - REPO: ${{ github.repository }} VERSION: ${{ steps.create-release-branch.outputs.version }} - BRANCH: ${{ steps.create-release-branch.outputs.branch }} BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }} BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '^$' }} BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }} - GITHUB_TOKEN: ${{ secrets.BOT_TOKEN_WORKFLOW }} GIT_USER_NAME: eclipse-zenoh-bot GIT_USER_EMAIL: eclipse-zenoh-bot@users.noreply.github.com diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index 90d955a34..dcead5bc2 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -2,20 +2,14 @@ set -eo pipefail -# Repository -readonly repo=${REPO:?input REPO is required} # Release number readonly version=${VERSION:-''} -# Release branch -readonly branch=${BRANCH:?input BRANCH is required} # Dependencies' pattern readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-input BUMP_DEPS_PATTERN is required} # Dependencies' version readonly bump_deps_version=${BUMP_DEPS_VERSION:-''} # Dependencies' git branch readonly bump_deps_branch=${BUMP_DEPS_BRANCH:-''} -# GitHub token -readonly github_token=${GITHUB_TOKEN:?input GITHUB_TOKEN is required} # Git actor name readonly git_user_name=${GIT_USER_NAME:?input GIT_USER_NAME is required} # Git actor email @@ -36,8 +30,6 @@ export GIT_AUTHOR_EMAIL=$git_user_email export GIT_COMMITTER_NAME=$git_user_name export GIT_COMMITTER_EMAIL=$git_user_email -git clone --recursive --single-branch --branch "$branch" "https://github.com/$repo" - # Bump CMake project version if [[ "$version" == '' ]]; then # If no version has been specified, infer it using git-describe @@ -78,4 +70,5 @@ fi git tag "$version" -m "v$version" git log -10 git show-ref --tags -git push "https://$github_token@github.com/$repo" "$branch" "$version" +git push +git push "$version" From c35e9c8f58e77a08c864081b426a3b47b40626e4 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 14:40:41 +0200 Subject: [PATCH 004/397] fix: Add `CMakeFiles` to `.gitignore` --- .gitignore | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d7a6cf967..f5b3fbd49 100644 --- a/.gitignore +++ b/.gitignore @@ -70,4 +70,7 @@ dkms.conf .cache # Platform dependent generated files -include/zenoh_configure.h \ No newline at end of file +include/zenoh_configure.h + +# CMake +CMakeFiles/ \ No newline at end of file From 6acb44f91c7e200d6f4f132126d077c1eb19f236 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 14:42:09 +0200 Subject: [PATCH 005/397] fix: Add `debug` and `release` to `.gitignore` --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f5b3fbd49..68a5929e8 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,6 @@ dkms.conf include/zenoh_configure.h # CMake -CMakeFiles/ \ No newline at end of file +CMakeFiles/ +debug/ +release/ \ No newline at end of file From 2b14ccb327813551d8fcfd96fcd812e161a688ac Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 14:49:23 +0200 Subject: [PATCH 006/397] fix: Provide default release number for testing --- .github/workflows/release.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88e6a672f..f35a5745c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,11 @@ jobs: with: repo: ${{ github.repository }} live-run: ${{ inputs.live-run || false }} - version: ${{ inputs.version }} + # NOTE(fuzzypixelz): When the version is undefined (e.g. on schedule + # events) we cannot use git-describe as CMake doesn't support it. + # However, we still need some placeholder version to test that the + # version can be reliably bumped. + version: ${{ inputs.version || '0.0.0' }} github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} - name: Checkout this repository From db7024fa2521f1cad5079548c915669a93ee11ef Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Thu, 11 Apr 2024 15:19:45 +0200 Subject: [PATCH 007/397] fix: Don't bump deps when pattern is undefined --- .github/workflows/release.yml | 2 +- ci/scripts/bump-and-tag.bash | 40 ++++++++++++++++++----------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f35a5745c..5c9349814 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,7 +61,7 @@ jobs: env: VERSION: ${{ steps.create-release-branch.outputs.version }} BUMP_DEPS_VERSION: ${{ inputs.zenoh-version }} - BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '^$' }} + BUMP_DEPS_PATTERN: ${{ inputs.zenoh-version && 'zenoh.*' || '' }} BUMP_DEPS_BRANCH: ${{ inputs.zenoh-version && format('release/{0}', inputs.zenoh-version) || '' }} GIT_USER_NAME: eclipse-zenoh-bot GIT_USER_EMAIL: eclipse-zenoh-bot@users.noreply.github.com diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index dcead5bc2..a8aafb00c 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -1,11 +1,11 @@ #!/usr/bin/env bash -set -eo pipefail +set -xeo pipefail # Release number readonly version=${VERSION:-''} # Dependencies' pattern -readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-input BUMP_DEPS_PATTERN is required} +readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-''} # Dependencies' version readonly bump_deps_version=${BUMP_DEPS_VERSION:-''} # Dependencies' git branch @@ -46,25 +46,27 @@ toml_set_in_place Cargo.toml.in "package.metadata.deb.variants.libzenohc-dev.dep git commit version.txt Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump version to $version" # Select all package dependencies that match $bump_deps_pattern and bump them to $bump_deps_version -deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$bump_deps_pattern\"))") -for dep in $deps; do - if [[ -n $bump_deps_version ]]; then - toml_set_in_place Cargo.toml "dependencies.$dep.version" "$bump_deps_version" - toml_set_in_place Cargo.toml.in "dependencies.$dep.version" "$bump_deps_version" - fi +if [[ "$bump_deps_pattern" != '' ]]; then + deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$bump_deps_pattern\"))") + for dep in $deps; do + if [[ -n $bump_deps_version ]]; then + toml_set_in_place Cargo.toml "dependencies.$dep.version" "$bump_deps_version" + toml_set_in_place Cargo.toml.in "dependencies.$dep.version" "$bump_deps_version" + fi - if [[ -n $bump_deps_branch ]]; then - toml_set_in_place Cargo.toml "dependencies.$dep.branch" "$bump_deps_branch" - toml_set_in_place Cargo.toml.in "dependencies.$dep.branch" "$bump_deps_branch" - fi -done -# Update lockfile -cargo check + if [[ -n $bump_deps_branch ]]; then + toml_set_in_place Cargo.toml "dependencies.$dep.branch" "$bump_deps_branch" + toml_set_in_place Cargo.toml.in "dependencies.$dep.branch" "$bump_deps_branch" + fi + done + # Update lockfile + cargo check -if [[ -n $bump_deps_version || -n $bump_deps_branch ]]; then - git commit Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump $bump_deps_pattern version to $bump_deps_version" -else - echo "info: no changes have been made to any dependencies" + if [[ -n $bump_deps_version || -n $bump_deps_branch ]]; then + git commit Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump $bump_deps_pattern version to $bump_deps_version" + else + echo "warn: no changes have been made to any dependencies matching $bump_deps_pattern" + fi fi git tag "$version" -m "v$version" From 258fbd11041aa96196e49239ffc821df7c700840 Mon Sep 17 00:00:00 2001 From: Denis Biryukov Date: Thu, 11 Apr 2024 18:19:10 +0200 Subject: [PATCH 008/397] fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t --- include/zenoh_commons.h | 9 ++++++++- src/get.rs | 2 +- src/publisher.rs | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 84b125fbe..d24f08b24 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -352,7 +352,7 @@ typedef struct ALIGN(8) z_owned_reply_t { #endif #if defined(TARGET_ARCH_ARM) typedef struct ALIGN(8) z_owned_reply_t { - uint64_t _0[19]; + uint64_t _0[21]; } z_owned_reply_t; #endif /** @@ -936,9 +936,16 @@ typedef struct zcu_owned_closure_matching_status_t { * * To check if `val` is still valid, you may use `z_X_check(&val)` or `z_check(val)` if your compiler supports `_Generic`, which will return `true` if `val` is valid. */ +#if !defined(TARGET_ARCH_ARM) typedef struct ALIGN(8) zcu_owned_matching_listener_t { uint64_t _0[4]; } zcu_owned_matching_listener_t; +#endif +#if defined(TARGET_ARCH_ARM) +typedef struct ALIGN(4) zcu_owned_matching_listener_t { + uint32_t _0[4]; +} zcu_owned_matching_listener_t; +#endif /** * An owned zenoh publication_cache. * diff --git a/src/get.rs b/src/get.rs index f5b3c6590..8e985d99f 100644 --- a/src/get.rs +++ b/src/get.rs @@ -54,7 +54,7 @@ pub struct z_owned_reply_t([u64; 30]); #[cfg(target_arch = "arm")] #[repr(C, align(8))] -pub struct z_owned_reply_t([u64; 19]); +pub struct z_owned_reply_t([u64; 21]); impl_guarded_transmute!(noderefs ReplyInner, z_owned_reply_t); diff --git a/src/publisher.rs b/src/publisher.rs index f49d8cd31..3b0176546 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -384,8 +384,12 @@ pub extern "C" fn z_publisher_keyexpr(publisher: z_publisher_t) -> z_owned_keyex /// After a move, `val` will still exist, but will no longer be valid. The destructors are double-drop-safe, but other functions will still trust that your `val` is valid. /// /// To check if `val` is still valid, you may use `z_X_check(&val)` or `z_check(val)` if your compiler supports `_Generic`, which will return `true` if `val` is valid. +#[cfg(not(target_arch = "arm"))] #[repr(C, align(8))] pub struct zcu_owned_matching_listener_t([u64; 4]); +#[cfg(target_arch = "arm")] +#[repr(C, align(4))] +pub struct zcu_owned_matching_listener_t([u32; 4]); impl_guarded_transmute!(noderefs Option>, From 58a776a9bb3e73e118aa5b992a70369d277b02ff Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 12 Apr 2024 02:36:02 +0200 Subject: [PATCH 009/397] build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 288 +++++++++++++++++++++++++++++------------------------ 1 file changed, 156 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac02d01d7..1709bb6fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -70,54 +70,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" -dependencies = [ - "anstyle", - "anstyle-parse", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "utf8parse", -] - -[[package]] -name = "anstyle" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" - -[[package]] -name = "anstyle-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" -dependencies = [ - "utf8parse", -] - -[[package]] -name = "anstyle-query" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" -dependencies = [ - "windows-sys 0.48.0", -] - -[[package]] -name = "anstyle-wincon" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" -dependencies = [ - "anstyle", - "windows-sys 0.52.0", -] - [[package]] name = "anyhow" version = "1.0.75" @@ -463,12 +415,6 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "colorchoice" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" - [[package]] name = "concurrent-queue" version = "2.2.0" @@ -604,16 +550,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" -[[package]] -name = "env_filter" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" version = "0.10.2" @@ -627,19 +563,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "env_logger" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c012a26a7f605efc424dd53697843a72be7dc86ad2d01f7814337794a12231d" -dependencies = [ - "anstream", - "anstyle", - "env_filter", - "humantime", - "log", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1217,6 +1140,15 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "memchr" version = "2.6.3" @@ -1291,6 +1223,16 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint-dig" version = "0.8.4" @@ -1391,6 +1333,12 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "parking" version = "2.1.0" @@ -1690,8 +1638,17 @@ checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.3.8", + "regex-syntax 0.7.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -1702,9 +1659,15 @@ checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.7.5", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.7.5" @@ -2098,6 +2061,15 @@ dependencies = [ "keccak", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + [[package]] name = "shared_memory" version = "0.12.4" @@ -2308,6 +2280,16 @@ dependencies = [ "syn 2.0.33", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2448,6 +2430,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", ] [[package]] @@ -2578,12 +2603,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf8parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" - [[package]] name = "uuid" version = "1.4.1" @@ -2617,6 +2636,12 @@ dependencies = [ "unzip-n", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "value-bag" version = "1.4.1" @@ -2959,19 +2984,17 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "base64", "const_format", - "env_logger 0.11.2", "event-listener 4.0.0", "flume", "form_urlencoded", "futures", "git-version", "lazy_static", - "log", "ordered-float", "paste", "petgraph", @@ -2984,6 +3007,7 @@ dependencies = [ "stop-token", "tokio", "tokio-util", + "tracing", "uhlc", "uuid", "vec_map", @@ -3010,7 +3034,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "zenoh-collections", ] @@ -3023,7 +3047,7 @@ dependencies = [ "async-trait", "cbindgen", "chrono", - "env_logger 0.10.2", + "env_logger", "fs2", "fs_extra", "futures", @@ -3043,10 +3067,10 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ - "log", "serde", + "tracing", "uhlc", "zenoh-buffers", "zenoh-protocol", @@ -3056,21 +3080,21 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "flume", "json5", - "log", "num_cpus", "secrecy", "serde", "serde_json", "serde_yaml", + "tracing", "validated_struct", "zenoh-core", "zenoh-protocol", @@ -3081,7 +3105,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-global-executor", "lazy_static", @@ -3093,7 +3117,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "aes", "hmac", @@ -3106,15 +3130,14 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "bincode", - "env_logger 0.11.2", "flume", "futures", - "log", "serde", "tokio", + "tracing", "zenoh", "zenoh-core", "zenoh-macros", @@ -3128,7 +3151,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3142,7 +3165,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "zenoh-config", @@ -3160,17 +3183,17 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "flume", "futures", - "log", "rustls 0.22.2", "rustls-webpki 0.102.2", "serde", "tokio", "tokio-util", + "tracing", "zenoh-buffers", "zenoh-codec", "zenoh-core", @@ -3183,12 +3206,11 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "base64", "futures", - "log", "quinn", "rustls 0.21.7", "rustls-native-certs 0.7.0", @@ -3198,6 +3220,7 @@ dependencies = [ "tokio", "tokio-rustls 0.24.1", "tokio-util", + "tracing", "zenoh-config", "zenoh-core", "zenoh-link-commons", @@ -3211,12 +3234,12 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", - "log", "tokio", "tokio-util", + "tracing", "zenoh-core", "zenoh-link-commons", "zenoh-protocol", @@ -3229,12 +3252,11 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "base64", "futures", - "log", "rustls 0.22.2", "rustls-pemfile 2.0.0", "rustls-pki-types", @@ -3243,6 +3265,7 @@ dependencies = [ "tokio", "tokio-rustls 0.25.0", "tokio-util", + "tracing", "webpki-roots", "zenoh-config", "zenoh-core", @@ -3257,13 +3280,13 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", - "log", "socket2 0.5.6", "tokio", "tokio-util", + "tracing", "zenoh-buffers", "zenoh-collections", "zenoh-core", @@ -3278,14 +3301,14 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "futures", - "log", "nix 0.27.1", "tokio", "tokio-util", + "tracing", "uuid", "zenoh-core", "zenoh-link-commons", @@ -3298,14 +3321,14 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "futures-util", - "log", "tokio", "tokio-tungstenite", "tokio-util", + "tracing", "url", "zenoh-core", "zenoh-link-commons", @@ -3319,7 +3342,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "proc-macro2", "quote", @@ -3330,13 +3353,13 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "const_format", "libloading", - "log", "serde", "serde_json", + "tracing", "zenoh-keyexpr", "zenoh-macros", "zenoh-result", @@ -3346,7 +3369,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "const_format", "rand", @@ -3360,7 +3383,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "anyhow", ] @@ -3368,7 +3391,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "futures", "lazy_static", @@ -3380,11 +3403,11 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ - "log", "serde", "shared_memory", + "tracing", "zenoh-buffers", "zenoh-result", ] @@ -3392,7 +3415,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "event-listener 4.0.0", "futures", @@ -3406,12 +3429,12 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "futures", - "log", "tokio", "tokio-util", + "tracing", "zenoh-core", "zenoh-runtime", ] @@ -3419,11 +3442,10 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-trait", "flume", - "log", "lz4_flex", "paste", "rand", @@ -3433,6 +3455,7 @@ dependencies = [ "sha3", "tokio", "tokio-util", + "tracing", "zenoh-buffers", "zenoh-codec", "zenoh-collections", @@ -3452,7 +3475,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d594afbc358be0e8379a25ed985a1fcc1e36f2d8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" dependencies = [ "async-std", "async-trait", @@ -3462,10 +3485,11 @@ dependencies = [ "lazy_static", "libc", "libloading", - "log", "pnet_datalink", "shellexpand", "tokio", + "tracing", + "tracing-subscriber", "winapi", "zenoh-core", "zenoh-result", From b209194f715156af1d5b96d6a8f37da7d34b85a0 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Fri, 12 Apr 2024 10:14:13 +0200 Subject: [PATCH 010/397] fix: Specify git remote when pushing the tag --- ci/scripts/bump-and-tag.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index a8aafb00c..660400bd3 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -72,5 +72,5 @@ fi git tag "$version" -m "v$version" git log -10 git show-ref --tags -git push -git push "$version" +git push origin +git push origin "$version" From 3c4f8c670c61adda55314576be902c9c1a3a6e36 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Fri, 12 Apr 2024 12:17:03 +0200 Subject: [PATCH 011/397] fix: Require `VERSION`in `bump-and-tag.bash` --- ci/scripts/bump-and-tag.bash | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index 660400bd3..a80dd5563 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -3,7 +3,7 @@ set -xeo pipefail # Release number -readonly version=${VERSION:-''} +readonly version=${VERSION:?input VERSION is required} # Dependencies' pattern readonly bump_deps_pattern=${BUMP_DEPS_PATTERN:-''} # Dependencies' version @@ -31,12 +31,7 @@ export GIT_COMMITTER_NAME=$git_user_name export GIT_COMMITTER_EMAIL=$git_user_email # Bump CMake project version -if [[ "$version" == '' ]]; then - # If no version has been specified, infer it using git-describe - printf '%s' "$(git describe)" > version.txt -else - printf '%s' "$version" > version.txt -fi +printf '%s' "$version" > version.txt # Propagate version change to Cargo.toml and Cargo.toml.in cmake . -DZENOHC_BUILD_IN_SOURCE_TREE=TRUE -DCMAKE_BUILD_TYPE=Release # Update Debian dependency of libzenohc-dev From bceb62c27cb7463c868bd7557ee25bf56135387a Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Fri, 12 Apr 2024 15:44:02 +0200 Subject: [PATCH 012/397] fix: Override release tag if it already exists --- .github/workflows/release.yml | 1 + ci/scripts/bump-and-tag.bash | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5c9349814..f01fdb560 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -55,6 +55,7 @@ jobs: uses: actions/checkout@v4 with: ref: ${{ steps.create-release-branch.outputs.branch }} + token: ${{ secrets.BOT_TOKEN_WORKFLOW }} - name: Bump and tag project run: bash ci/scripts/bump-and-tag.bash diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index a80dd5563..4288a9f50 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -64,8 +64,8 @@ if [[ "$bump_deps_pattern" != '' ]]; then fi fi -git tag "$version" -m "v$version" +git tag --force "$version" -m "v$version" git log -10 git show-ref --tags git push origin -git push origin "$version" +git push --force origin "$version" From 09ed7c08395176d79bd2f223d75164fbc63b3f25 Mon Sep 17 00:00:00 2001 From: Gabriele Baldoni Date: Mon, 15 Apr 2024 06:05:50 +0000 Subject: [PATCH 013/397] feat(tracing): using tracing and zenoh-util init_log (#308) * feat(tracing): using tracing and zenoh-util init_log Signed-off-by: gabrik * chore: adding Cargo.lock Signed-off-by: gabrik * chore: updated Cargo.toml.in Signed-off-by: gabrik * feat(tracing): using zenoh main branch Signed-off-by: gabrik --------- Signed-off-by: gabrik --- Cargo.lock | 27 +----------------- Cargo.toml | 3 +- Cargo.toml.in | 3 +- src/attachment.rs | 2 +- src/closures/hello_closure.rs | 2 +- src/closures/matching_status_closure.rs | 2 +- src/closures/query_channel.rs | 10 +++---- src/closures/query_closure.rs | 4 +-- src/closures/reply_closure.rs | 2 +- src/closures/response_channel.rs | 10 +++---- src/closures/sample_closure.rs | 2 +- src/closures/zenohid_closure.rs | 2 +- src/config.rs | 6 ++-- src/get.rs | 4 +-- src/keyexpr.rs | 38 ++++++++++++------------- src/lib.rs | 2 +- src/liveliness.rs | 14 ++++----- src/publication_cache.rs | 6 ++-- src/publisher.rs | 16 +++++------ src/pull_subscriber.rs | 8 +++--- src/put.rs | 14 ++++----- src/queryable.rs | 10 +++---- src/querying_subscriber.rs | 10 +++---- src/session.rs | 4 +-- src/subscriber.rs | 6 ++-- 25 files changed, 90 insertions(+), 117 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1709bb6fa..8285875ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,19 +550,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" -[[package]] -name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "humantime", - "is-terminal", - "log", - "regex", - "termcolor", -] - [[package]] name = "equivalent" version = "1.0.1" @@ -1005,17 +992,6 @@ dependencies = [ "serde", ] -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi 0.3.2", - "rustix 0.38.32", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" version = "1.0.9" @@ -3047,17 +3023,16 @@ dependencies = [ "async-trait", "cbindgen", "chrono", - "env_logger", "fs2", "fs_extra", "futures", "json5", "lazy_static", "libc", - "log", "rand", "serde_yaml", "spin 0.9.8", + "tracing", "zenoh", "zenoh-ext", "zenoh-protocol", diff --git a/Cargo.toml b/Cargo.toml index a654da5db..9b8c2e457 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,12 +42,10 @@ maintenance = { status = "actively-developed" } async-std = "=1.12.0" async-trait = "0.1.66" chrono = "0.4.34" -env_logger = "0.10.0" futures = "0.3.26" json5 = "0.4.1" lazy_static = "1.4.0" libc = "0.2.139" -log = "0.4.17" rand = "0.8.5" spin = "0.9.5" # shared-memory enabled for zenoh even if zenoh-c "shared-memory" feature is disabled. This is to make "std::mem::transmute" work for `ZSLice` @@ -55,6 +53,7 @@ zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh. zenoh-protocol = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["shared-memory"] } zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["unstable"] } +tracing = "0.1" [build-dependencies] cbindgen = "0.24.3" diff --git a/Cargo.toml.in b/Cargo.toml.in index be9b3f1b7..9d288115f 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -42,12 +42,10 @@ maintenance = { status = "actively-developed" } async-std = "=1.12.0" async-trait = "0.1.66" chrono = "0.4.34" -env_logger = "0.10.0" futures = "0.3.26" json5 = "0.4.1" lazy_static = "1.4.0" libc = "0.2.139" -log = "0.4.17" rand = "0.8.5" spin = "0.9.5" # shared-memory enabled for zenoh even if zenoh-c "shared-memory" feature is disabled. This is to make "std::mem::transmute" work for `ZSLice` @@ -55,6 +53,7 @@ zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh. zenoh-protocol = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["shared-memory"] } zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["unstable"] } +tracing = "0.1" [build-dependencies] cbindgen = "0.24.3" diff --git a/src/attachment.rs b/src/attachment.rs index 5b327fe66..7988493f4 100644 --- a/src/attachment.rs +++ b/src/attachment.rs @@ -69,7 +69,7 @@ pub extern "C" fn z_attachment_iterate( if let Some(driver) = this.iteration_driver { return driver(this.data, body, context); } - log::error!("Invalid iteration_driver"); + tracing::error!("Invalid iteration_driver"); i8::MIN } diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index 4e7f76323..d24c5af81 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -54,7 +54,7 @@ pub extern "C" fn z_closure_hello_call( match closure.call { Some(call) => call(hello, closure.context), None => { - log::error!("Attempted to call an uninitialized closure!"); + tracing::error!("Attempted to call an uninitialized closure!"); } } } diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index 05792b7d8..e343ba1de 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -54,7 +54,7 @@ pub extern "C" fn zcu_closure_matching_status_call( match closure.call { Some(call) => call(sample, closure.context), None => { - log::error!("Attempted to call an uninitialized closure!"); + tracing::error!("Attempted to call an uninitialized closure!"); } } } diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index b7a51c9c0..b3036abee 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -57,7 +57,7 @@ pub extern "C" fn zc_query_fifo_new(bound: usize) -> z_owned_query_channel_t { From::from(move |query: &mut z_owned_query_t| { if let Some(query) = query.take() { if let Err(e) = tx.send(query) { - log::error!("Attempted to push onto a closed query_fifo: {}", e) + tracing::error!("Attempted to push onto a closed query_fifo: {}", e) } } }), @@ -69,7 +69,7 @@ pub extern "C" fn zc_query_fifo_new(bound: usize) -> z_owned_query_channel_t { From::from(move |query: &mut z_owned_query_t| { if let Some(query) = query.take() { if let Err(e) = tx.send(query) { - log::error!("Attempted to push onto a closed query_fifo: {}", e) + tracing::error!("Attempted to push onto a closed query_fifo: {}", e) } } }), @@ -105,7 +105,7 @@ pub extern "C" fn zc_query_non_blocking_fifo_new(bound: usize) -> z_owned_query_ From::from(move |query: &mut z_owned_query_t| { if let Some(query) = query.take() { if let Err(e) = tx.send(query) { - log::error!("Attempted to push onto a closed query_fifo: {}", e) + tracing::error!("Attempted to push onto a closed query_fifo: {}", e) } } }), @@ -117,7 +117,7 @@ pub extern "C" fn zc_query_non_blocking_fifo_new(bound: usize) -> z_owned_query_ From::from(move |query: &mut z_owned_query_t| { if let Some(query) = query.take() { if let Err(e) = tx.send(query) { - log::error!("Attempted to push onto a closed query_fifo: {}", e) + tracing::error!("Attempted to push onto a closed query_fifo: {}", e) } } }), @@ -180,7 +180,7 @@ pub extern "C" fn z_query_channel_closure_call( match closure.call { Some(call) => call(sample, closure.context), None => { - log::error!("Attempted to call an uninitialized closure!"); + tracing::error!("Attempted to call an uninitialized closure!"); true } } diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 22ad4bc28..d6915f8af 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -48,7 +48,7 @@ pub extern "C" fn z_closure_query_null() -> z_owned_closure_query_t { pub extern "C" fn z_closure_query_call(closure: &z_owned_closure_query_t, query: &z_query_t) { match closure.call { Some(call) => call(query, closure.context), - None => log::error!("Attempted to call an uninitialized closure!"), + None => tracing::error!("Attempted to call an uninitialized closure!"), } } /// Drops the closure. Droping an uninitialized closure is a no-op. @@ -126,7 +126,7 @@ pub extern "C" fn z_closure_owned_query_call( ) { match closure.call { Some(call) => call(query, closure.context), - None => log::error!("Attempted to call an uninitialized closure!"), + None => tracing::error!("Attempted to call an uninitialized closure!"), } } /// Drops the closure. Droping an uninitialized closure is a no-op. diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 1aa8a9b44..643822b7a 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -53,7 +53,7 @@ pub extern "C" fn z_closure_reply_call( match closure.call { Some(call) => call(sample, closure.context), None => { - log::error!("Attempted to call an uninitialized closure!"); + tracing::error!("Attempted to call an uninitialized closure!"); } } } diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index 0ea046d5d..5ab3a25e7 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -56,7 +56,7 @@ pub extern "C" fn zc_reply_fifo_new(bound: usize) -> z_owned_reply_channel_t { From::from(move |reply: &mut z_owned_reply_t| { if let Some(reply) = reply.take() { if let Err(e) = tx.send(reply) { - log::error!("Attempted to push onto a closed reply_fifo: {}", e) + tracing::error!("Attempted to push onto a closed reply_fifo: {}", e) } } }), @@ -68,7 +68,7 @@ pub extern "C" fn zc_reply_fifo_new(bound: usize) -> z_owned_reply_channel_t { From::from(move |reply: &mut z_owned_reply_t| { if let Some(reply) = reply.take() { if let Err(e) = tx.send(reply) { - log::error!("Attempted to push onto a closed reply_fifo: {}", e) + tracing::error!("Attempted to push onto a closed reply_fifo: {}", e) } } }), @@ -104,7 +104,7 @@ pub extern "C" fn zc_reply_non_blocking_fifo_new(bound: usize) -> z_owned_reply_ From::from(move |reply: &mut z_owned_reply_t| { if let Some(reply) = reply.take() { if let Err(e) = tx.send(reply) { - log::error!("Attempted to push onto a closed reply_fifo: {}", e) + tracing::error!("Attempted to push onto a closed reply_fifo: {}", e) } } }), @@ -116,7 +116,7 @@ pub extern "C" fn zc_reply_non_blocking_fifo_new(bound: usize) -> z_owned_reply_ From::from(move |reply: &mut z_owned_reply_t| { if let Some(reply) = reply.take() { if let Err(e) = tx.send(reply) { - log::error!("Attempted to push onto a closed reply_fifo: {}", e) + tracing::error!("Attempted to push onto a closed reply_fifo: {}", e) } } }), @@ -180,7 +180,7 @@ pub extern "C" fn z_reply_channel_closure_call( match closure.call { Some(call) => call(sample, closure.context), None => { - log::error!("Attempted to call an uninitialized closure!"); + tracing::error!("Attempted to call an uninitialized closure!"); true } } diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index 6f0e55707..84f32a08b 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -50,7 +50,7 @@ pub extern "C" fn z_closure_sample_null() -> z_owned_closure_sample_t { pub extern "C" fn z_closure_sample_call(closure: &z_owned_closure_sample_t, sample: &z_sample_t) { match closure.call { Some(call) => call(sample, closure.context), - None => log::error!("Attempted to call an uninitialized closure!"), + None => tracing::error!("Attempted to call an uninitialized closure!"), } } diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index 1ad7796fd..e497681c5 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -51,7 +51,7 @@ pub extern "C" fn z_closure_zid_call(closure: &z_owned_closure_zid_t, sample: &z match closure.call { Some(call) => call(sample, closure.context), None => { - log::error!("Attempted to call an uninitialized closure!"); + tracing::error!("Attempted to call an uninitialized closure!"); } } } diff --git a/src/config.rs b/src/config.rs index 80e3a38f1..b208be573 100644 --- a/src/config.rs +++ b/src/config.rs @@ -227,12 +227,12 @@ pub unsafe extern "C" fn zc_config_from_file(path: *const c_char) -> z_owned_con Ok(path) => match zenoh::config::Config::from_file(path) { Ok(c) => Some(Box::new(c)), Err(e) => { - log::error!("Couldn't read config from {}: {}", path, e); + tracing::error!("Couldn't read config from {}: {}", path, e); None } }, Err(e) => { - log::error!("Invalid path '{}': {}", path_str.to_string_lossy(), e); + tracing::error!("Invalid path '{}': {}", path_str.to_string_lossy(), e); None } })) @@ -262,7 +262,7 @@ pub unsafe extern "C" fn z_config_client( Vec::::new(), |mut acc, it| match it { Err(e) => { - log::error!("Error parsing peer address: {}", e); + tracing::error!("Error parsing peer address: {}", e); Err(()) } Ok(loc) => { diff --git a/src/get.rs b/src/get.rs index 8e985d99f..c3009bc81 100644 --- a/src/get.rs +++ b/src/get.rs @@ -216,7 +216,7 @@ pub unsafe extern "C" fn z_get( CStr::from_ptr(parameters).to_str().unwrap() }; let Some(s) = session.upgrade() else { - log::error!("{LOG_INVALID_SESSION}"); + tracing::error!("{LOG_INVALID_SESSION}"); return i8::MIN; }; let mut q = s.get(KeyExpr::try_from(keyexpr).unwrap().with_parameters(p)); @@ -244,7 +244,7 @@ pub unsafe extern "C" fn z_get( { Ok(()) => 0, Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } } diff --git a/src/keyexpr.rs b/src/keyexpr.rs index 7742b3948..2db7b5ad1 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -93,12 +93,12 @@ pub unsafe extern "C" fn z_keyexpr_new(name: *const c_char) -> z_owned_keyexpr_t Ok(name) => match KeyExpr::try_from(name) { Ok(v) => v.into_owned().into(), Err(e) => { - log::error!("Couldn't construct a keyexpr from {:02x?}: {}", name, e); + tracing::error!("Couldn't construct a keyexpr from {:02x?}: {}", name, e); z_owned_keyexpr_t::null() } }, Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); z_owned_keyexpr_t::null() } } @@ -118,13 +118,13 @@ pub unsafe extern "C" fn z_keyexpr_new_autocanonize(name: *const c_char) -> z_ow match KeyExpr::autocanonize(name_owned) { Ok(v) => v.into_owned().into(), Err(e) => { - log::error!("Couldn't construct a keyexpr from {:02x?}: {}", name, e); + tracing::error!("Couldn't construct a keyexpr from {:02x?}: {}", name, e); z_owned_keyexpr_t::null() } } } Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); z_owned_keyexpr_t::null() } } @@ -240,12 +240,12 @@ pub unsafe extern "C" fn z_keyexpr_is_canon(start: *const c_char, len: usize) -> Ok(name) => match keyexpr::new(name) { Ok(_) => 0, Err(e) => { - log::error!("Couldn't construct a keyexpr from `{}`: {}", name, e); + tracing::error!("Couldn't construct a keyexpr from `{}`: {}", name, e); e.errno().get() } }, Err(e) => { - log::error!("{:02x?} is not valid UTF8 {}", name, e); + tracing::error!("{:02x?} is not valid UTF8 {}", name, e); i8::MIN } } @@ -288,12 +288,12 @@ pub unsafe extern "C" fn z_keyexpr_canonize(start: *mut c_char, len: &mut usize) 0 } Err(e) => { - log::error!("Canonization error: {e}"); + tracing::error!("Canonization error: {e}"); e.errno().get() } }, Err(e) => { - log::error!("{:02x?} is not valid UTF8 {}", name, e); + tracing::error!("{:02x?} is not valid UTF8 {}", name, e); i8::MIN } } @@ -309,12 +309,12 @@ pub unsafe extern "C" fn zc_keyexpr_from_slice(name: *const c_char, len: usize) Ok(name) => match KeyExpr::try_from(name) { Ok(v) => v.into(), Err(e) => { - log::error!("Couldn't construct a keyexpr from `{}`: {}", name, e); + tracing::error!("Couldn't construct a keyexpr from `{}`: {}", name, e); z_keyexpr_t::null() } }, Err(e) => { - log::error!("{:02x?} is not valid UTF8 {}", name, e); + tracing::error!("{:02x?} is not valid UTF8 {}", name, e); z_keyexpr_t::null() } } @@ -455,7 +455,7 @@ pub extern "C" fn z_declare_keyexpr( let key_expr = match keyexpr.as_ref() { Some(ke) => ke, None => { - log::warn!("{}", UninitializedKeyExprError); + tracing::warn!("{}", UninitializedKeyExprError); return z_owned_keyexpr_t::null(); } }; @@ -463,12 +463,12 @@ pub extern "C" fn z_declare_keyexpr( Some(s) => match s.declare_keyexpr(key_expr).res_sync() { Ok(id) => id.into_owned().into(), Err(e) => { - log::debug!("{}", e); + tracing::debug!("{}", e); z_owned_keyexpr_t::null() } }, None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); z_owned_keyexpr_t::null() } } @@ -479,7 +479,7 @@ pub extern "C" fn z_declare_keyexpr( #[no_mangle] pub extern "C" fn z_undeclare_keyexpr(session: z_session_t, kexpr: &mut z_owned_keyexpr_t) -> i8 { let Some(kexpr) = kexpr.deref_mut().take() else { - log::debug!("Attempted to undeclare dropped keyexpr"); + tracing::debug!("Attempted to undeclare dropped keyexpr"); return i8::MIN; }; @@ -487,12 +487,12 @@ pub extern "C" fn z_undeclare_keyexpr(session: z_session_t, kexpr: &mut z_owned_ Some(s) => match s.undeclare(kexpr).res() { Ok(()) => 0, Err(e) => { - log::debug!("{}", e); + tracing::debug!("{}", e); e.errno().get() } }, None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); i8::MIN } } @@ -570,7 +570,7 @@ pub unsafe extern "C" fn z_keyexpr_concat( let right = match std::str::from_utf8(right) { Ok(r) => r, Err(e) => { - log::error!( + tracing::error!( "Couldn't concatenate {:02x?} to {} because it is not valid UTF8: {}", right, left, @@ -582,7 +582,7 @@ pub unsafe extern "C" fn z_keyexpr_concat( match left.concat(right) { Ok(result) => result.into(), Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); z_owned_keyexpr_t::null() } } @@ -604,7 +604,7 @@ pub extern "C" fn z_keyexpr_join(left: z_keyexpr_t, right: z_keyexpr_t) -> z_own match left.join(right.as_str()) { Ok(result) => result.into(), Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); z_owned_keyexpr_t::null() } } diff --git a/src/lib.rs b/src/lib.rs index 5019a0713..1d9f01dab 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,7 +149,7 @@ pub(crate) const LOG_INVALID_SESSION: &str = "Invalid session"; /// this will be performed automatically by `z_open` and `z_scout`. #[no_mangle] pub extern "C" fn zc_init_logger() { - let _ = env_logger::try_init(); + zenoh_util::init_log_from_env(); } // Test should be runned with `cargo test --no-default-features` diff --git a/src/liveliness.rs b/src/liveliness.rs index 0a7c689dd..2f4d42b6a 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -96,13 +96,13 @@ pub extern "C" fn zc_liveliness_declare_token( _options: Option<&zc_owned_liveliness_declaration_options_t>, ) -> zc_owned_liveliness_token_t { let Some(session) = session.upgrade() else { - log::error!("Failed to declare liveliness token: provided session was invalid"); + tracing::error!("Failed to declare liveliness token: provided session was invalid"); return zc_liveliness_token_null(); }; match session.liveliness().declare_token(key).res() { Ok(token) => unsafe { core::mem::transmute(token) }, Err(e) => { - log::error!("Failed to declare liveliness token: {e}"); + tracing::error!("Failed to declare liveliness token: {e}"); zc_liveliness_token_null() } } @@ -117,7 +117,7 @@ pub extern "C" fn zc_liveliness_undeclare_token(token: &mut zc_owned_liveliness_ return; }; if let Err(e) = token.undeclare().res() { - log::error!("Failed to undeclare token: {e}"); + tracing::error!("Failed to undeclare token: {e}"); } } @@ -169,7 +169,7 @@ pub extern "C" fn zc_liveliness_declare_subscriber( _options: Option<&zc_owned_liveliness_declare_subscriber_options_t>, ) -> z_owned_subscriber_t { let Some(session) = session.upgrade() else { - log::error!("Failed to declare liveliness token: provided session was invalid"); + tracing::error!("Failed to declare liveliness token: provided session was invalid"); return z_owned_subscriber_t::null(); }; let callback = core::mem::replace(callback, z_owned_closure_sample_t::empty()); @@ -189,7 +189,7 @@ pub extern "C" fn zc_liveliness_declare_subscriber( { Ok(token) => z_owned_subscriber_t::new(token), Err(e) => { - log::error!("Failed to subscribe to liveliness: {e}"); + tracing::error!("Failed to subscribe to liveliness: {e}"); z_owned_subscriber_t::null() } } @@ -234,7 +234,7 @@ pub extern "C" fn zc_liveliness_get( options: Option<&zc_liveliness_get_options_t>, ) -> i8 { let Some(session) = session.upgrade() else { - log::error!("Failed to declare liveliness token: provided session was invalid"); + tracing::error!("Failed to declare liveliness token: provided session was invalid"); return i8::MIN; }; let callback = core::mem::replace(callback, z_owned_closure_reply_t::empty()); @@ -248,7 +248,7 @@ pub extern "C" fn zc_liveliness_get( match builder.res() { Ok(()) => 0, Err(e) => { - log::error!("Failed to subscribe to liveliness: {e}"); + tracing::error!("Failed to subscribe to liveliness: {e}"); e.errno().get() } } diff --git a/src/publication_cache.rs b/src/publication_cache.rs index a97354b3b..69dfc4f87 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -136,12 +136,12 @@ pub extern "C" fn ze_declare_publication_cache( match p.res_sync() { Ok(publication_cache) => ze_owned_publication_cache_t::new(publication_cache), Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); ze_owned_publication_cache_t::null() } } } else { - log::error!("{}", UninitializedKeyExprError); + tracing::error!("{}", UninitializedKeyExprError); ze_owned_publication_cache_t::null() } } @@ -171,7 +171,7 @@ pub extern "C" fn ze_undeclare_publication_cache( ) -> i8 { if let Some(p) = pub_cache.take() { if let Err(e) = p.close().res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); return e.errno().get(); } } diff --git a/src/publisher.rs b/src/publisher.rs index 3b0176546..20ff00657 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -151,18 +151,18 @@ pub extern "C" fn z_declare_publisher( } match p.res_sync() { Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); None } Ok(publisher) => Some(publisher), } } else { - log::error!("{}", UninitializedKeyExprError); + tracing::error!("{}", UninitializedKeyExprError); None } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); None } } @@ -272,7 +272,7 @@ pub unsafe extern "C" fn z_publisher_put( None => p.put(value), }; if let Err(e) = put.res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } else { 0 @@ -306,7 +306,7 @@ pub unsafe extern "C" fn zc_publisher_put_owned( ) -> i8 { if let Some(p) = publisher.as_ref() { let Some(payload) = payload.and_then(|p| p.take()) else { - log::debug!("Attempted to put without a payload"); + tracing::debug!("Attempted to put without a payload"); return i8::MIN; }; let value: Value = payload.into(); @@ -315,7 +315,7 @@ pub unsafe extern "C" fn zc_publisher_put_owned( None => p.put(value), }; if let Err(e) = put.res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } else { 0 @@ -353,7 +353,7 @@ pub extern "C" fn z_publisher_delete( ) -> i8 { if let Some(p) = publisher.as_ref() { if let Err(e) = p.delete().res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } else { 0 @@ -453,7 +453,7 @@ pub extern "C" fn zcu_publisher_matching_listener_callback( pub extern "C" fn z_undeclare_publisher(publisher: &mut z_owned_publisher_t) -> i8 { if let Some(p) = publisher.take() { if let Err(e) = p.undeclare().res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); return e.errno().get(); } } diff --git a/src/pull_subscriber.rs b/src/pull_subscriber.rs index 0eee4bc94..36a87e659 100644 --- a/src/pull_subscriber.rs +++ b/src/pull_subscriber.rs @@ -165,13 +165,13 @@ pub extern "C" fn z_declare_pull_subscriber( match res.res() { Ok(sub) => z_owned_pull_subscriber_t::new(sub), Err(e) => { - log::debug!("{}", e); + tracing::debug!("{}", e); z_owned_pull_subscriber_t::null() } } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); z_owned_pull_subscriber_t::null() } } @@ -183,7 +183,7 @@ pub extern "C" fn z_declare_pull_subscriber( pub extern "C" fn z_undeclare_pull_subscriber(sub: &mut z_owned_pull_subscriber_t) -> i8 { if let Some(s) = sub.as_mut().take() { if let Err(e) = s.undeclare().res_sync() { - log::warn!("{}", e); + tracing::warn!("{}", e); return e.errno().get(); } } @@ -215,7 +215,7 @@ pub extern "C" fn z_subscriber_pull(sub: z_pull_subscriber_t) -> i8 { match sub.0.as_ref() { Some(tx) => { if let Err(e) = tx.pull().res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } else { 0 diff --git a/src/put.rs b/src/put.rs index b5d9f2f94..31eaae142 100644 --- a/src/put.rs +++ b/src/put.rs @@ -178,14 +178,14 @@ pub unsafe extern "C" fn z_put( } match res.res_sync() { Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } Ok(()) => 0, } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); i8::MIN } } @@ -226,18 +226,18 @@ pub extern "C" fn zc_put_owned( } match res.res_sync() { Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } Ok(()) => 0, } } else { - log::debug!("zc_payload_null was provided as payload for put"); + tracing::debug!("zc_payload_null was provided as payload for put"); i8::MIN } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); i8::MIN } } @@ -286,14 +286,14 @@ pub extern "C" fn z_delete( } match res.res_sync() { Err(e) => { - log::error!("{}", e); + tracing::error!("{}", e); e.errno().get() } Ok(()) => 0, } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); i8::MIN } } diff --git a/src/queryable.rs b/src/queryable.rs index 1906dc735..a82fe02e8 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -223,7 +223,7 @@ pub extern "C" fn z_declare_queryable( let session = match session.upgrade() { Some(s) => s, None => { - log::error!("{}", LOG_INVALID_SESSION); + tracing::error!("{}", LOG_INVALID_SESSION); return None.into(); } }; @@ -234,7 +234,7 @@ pub extern "C" fn z_declare_queryable( builder .callback(move |query| z_closure_query_call(&closure, &z_query_t::from(&query))) .res_sync() - .map_err(|e| log::error!("{}", e)) + .map_err(|e| tracing::error!("{}", e)) .ok() .into() } @@ -248,7 +248,7 @@ pub extern "C" fn z_declare_queryable( pub extern "C" fn z_undeclare_queryable(qable: &mut z_owned_queryable_t) -> i8 { if let Some(qable) = qable.take() { if let Err(e) = qable.undeclare().res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); return e.errno().get(); } } @@ -285,7 +285,7 @@ pub unsafe extern "C" fn z_query_reply( options: Option<&z_query_reply_options_t>, ) -> i8 { let Some(query) = query.as_ref() else { - log::error!("Called `z_query_reply` with invalidated `query`"); + tracing::error!("Called `z_query_reply` with invalidated `query`"); return i8::MIN; }; if let Some(key) = &*key { @@ -306,7 +306,7 @@ pub unsafe extern "C" fn z_query_reply( }; } if let Err(e) = query.reply(Ok(s)).res_sync() { - log::error!("{}", e); + tracing::error!("{}", e); return e.errno().get(); } 0 diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index cdec44f0f..118f9a4e6 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -198,13 +198,13 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber( { Ok(sub) => ze_owned_querying_subscriber_t::new(sub, session), Err(e) => { - log::debug!("{}", e); + tracing::debug!("{}", e); ze_owned_querying_subscriber_t::null() } } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); ze_owned_querying_subscriber_t::null() } } @@ -241,12 +241,12 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( }) .res() { - log::debug!("{}", e); + tracing::debug!("{}", e); return -1; } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); return -1; } } @@ -260,7 +260,7 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( pub extern "C" fn ze_undeclare_querying_subscriber(sub: &mut ze_owned_querying_subscriber_t) -> i8 { if let Some(s) = sub.take() { if let Err(e) = s.fetching_subscriber.close().res_sync() { - log::warn!("{}", e); + tracing::warn!("{}", e); return e.errno().get(); } } diff --git a/src/session.rs b/src/session.rs index 2caab85ea..52b9e5ccf 100644 --- a/src/session.rs +++ b/src/session.rs @@ -105,14 +105,14 @@ pub extern "C" fn z_open(config: &mut z_owned_config_t) -> z_owned_session_t { let config = match config.as_mut().take() { Some(c) => c, None => { - log::error!("Config not provided"); + tracing::error!("Config not provided"); return z_owned_session_t::null(); } }; match zenoh::open(*config).res() { Ok(s) => z_owned_session_t::new(Arc::new(s)), Err(e) => { - log::error!("Error opening session: {}", e); + tracing::error!("Error opening session: {}", e); z_owned_session_t::null() } } diff --git a/src/subscriber.rs b/src/subscriber.rs index b9488960a..7a5f5a3e1 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -194,13 +194,13 @@ pub extern "C" fn z_declare_subscriber( match res.res() { Ok(sub) => z_owned_subscriber_t::new(sub), Err(e) => { - log::debug!("{}", e); + tracing::debug!("{}", e); z_owned_subscriber_t::null() } } } None => { - log::debug!("{}", LOG_INVALID_SESSION); + tracing::debug!("{}", LOG_INVALID_SESSION); z_owned_subscriber_t::null() } } @@ -223,7 +223,7 @@ pub extern "C" fn z_subscriber_keyexpr(subscriber: z_subscriber_t) -> z_owned_ke pub extern "C" fn z_undeclare_subscriber(sub: &mut z_owned_subscriber_t) -> i8 { if let Some(s) = sub.take() { if let Err(e) = s.undeclare().res_sync() { - log::warn!("{}", e); + tracing::warn!("{}", e); return e.errno().get(); } } From 46e905c93804894003afeabf0628b8d3594f229e Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 16 Apr 2024 02:36:28 +0200 Subject: [PATCH 014/397] build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8285875ca..3008e1322 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -369,9 +369,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", From 05712873033ad4c701170dc3a73e6282a233ff50 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 17 Apr 2024 02:38:10 +0200 Subject: [PATCH 015/397] build: Sync with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 64 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3008e1322..84325ae1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,6 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", + "getrandom", "once_cell", "version_check", "zerocopy", @@ -281,9 +282,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -1188,7 +1189,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -1752,7 +1753,7 @@ version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys 0.4.13", @@ -2960,8 +2961,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ + "ahash", "async-trait", "base64", "const_format", @@ -3010,7 +3012,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "zenoh-collections", ] @@ -3042,7 +3044,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "serde", "tracing", @@ -3055,12 +3057,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "flume", "json5", @@ -3080,7 +3082,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-global-executor", "lazy_static", @@ -3092,7 +3094,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "aes", "hmac", @@ -3105,7 +3107,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "bincode", "flume", @@ -3126,7 +3128,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3140,7 +3142,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "zenoh-config", @@ -3158,7 +3160,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "flume", @@ -3181,7 +3183,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "base64", @@ -3209,7 +3211,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "tokio", @@ -3227,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "base64", @@ -3255,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3276,7 +3278,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "futures", @@ -3296,7 +3298,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "futures-util", @@ -3317,7 +3319,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "proc-macro2", "quote", @@ -3328,7 +3330,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "const_format", "libloading", @@ -3344,7 +3346,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "const_format", "rand", @@ -3358,7 +3360,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "anyhow", ] @@ -3366,7 +3368,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "futures", "lazy_static", @@ -3378,7 +3380,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "serde", "shared_memory", @@ -3390,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "event-listener 4.0.0", "futures", @@ -3404,7 +3406,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "futures", "tokio", @@ -3417,7 +3419,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-trait", "flume", @@ -3450,7 +3452,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#580f0b6142338c73d17da28b17986b0094272c6e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" dependencies = [ "async-std", "async-trait", From 6c84a50d3d86c6fecc619f081171d38c0c9af16b Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Wed, 17 Apr 2024 15:22:20 +0200 Subject: [PATCH 016/397] fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. --- ci/scripts/bump-and-tag.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/bump-and-tag.bash b/ci/scripts/bump-and-tag.bash index 4288a9f50..d762ef63b 100644 --- a/ci/scripts/bump-and-tag.bash +++ b/ci/scripts/bump-and-tag.bash @@ -42,7 +42,7 @@ git commit version.txt Cargo.toml Cargo.toml.in Cargo.lock -m "chore: Bump versi # Select all package dependencies that match $bump_deps_pattern and bump them to $bump_deps_version if [[ "$bump_deps_pattern" != '' ]]; then - deps=$(toml get Cargo.toml dependencies | jq -r "keys.[] | select(test(\"$bump_deps_pattern\"))") + deps=$(toml get Cargo.toml dependencies | jq -r "keys[] | select(test(\"$bump_deps_pattern\"))") for dep in $deps; do if [[ -n $bump_deps_version ]]; then toml_set_in_place Cargo.toml "dependencies.$dep.version" "$bump_deps_version" From f63f07ef284ccb7f31989c591057b044ddebf8e7 Mon Sep 17 00:00:00 2001 From: gabrik Date: Thu, 18 Apr 2024 08:50:12 +0200 Subject: [PATCH 017/397] chore: using new try_init_log_from_env Signed-off-by: gabrik --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- src/lib.rs | 2 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84325ae1d..75b73e3c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2961,7 +2961,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "ahash", "async-trait", @@ -3012,7 +3012,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "zenoh-collections", ] @@ -3044,7 +3044,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "serde", "tracing", @@ -3057,12 +3057,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "flume", "json5", @@ -3082,7 +3082,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-global-executor", "lazy_static", @@ -3094,7 +3094,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "aes", "hmac", @@ -3107,7 +3107,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "bincode", "flume", @@ -3128,7 +3128,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3142,7 +3142,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "zenoh-config", @@ -3160,7 +3160,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "flume", @@ -3183,7 +3183,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "base64", @@ -3211,7 +3211,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "tokio", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "base64", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3278,7 +3278,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "futures", @@ -3298,7 +3298,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "futures-util", @@ -3319,7 +3319,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "proc-macro2", "quote", @@ -3330,7 +3330,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "const_format", "libloading", @@ -3346,7 +3346,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "const_format", "rand", @@ -3360,7 +3360,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "anyhow", ] @@ -3368,7 +3368,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "futures", "lazy_static", @@ -3380,7 +3380,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "serde", "shared_memory", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "event-listener 4.0.0", "futures", @@ -3406,7 +3406,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "futures", "tokio", @@ -3419,7 +3419,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-trait", "flume", @@ -3452,7 +3452,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#23c593297d5b4183d2eaa9596b2f3da8f5517b70" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" dependencies = [ "async-std", "async-trait", diff --git a/src/lib.rs b/src/lib.rs index 1d9f01dab..5a006954d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,7 +149,7 @@ pub(crate) const LOG_INVALID_SESSION: &str = "Invalid session"; /// this will be performed automatically by `z_open` and `z_scout`. #[no_mangle] pub extern "C" fn zc_init_logger() { - zenoh_util::init_log_from_env(); + zenoh_util::try_init_log_from_env(); } // Test should be runned with `cargo test --no-default-features` From 09df4b3fed3b645b0e3f7598ea50112b7a94c742 Mon Sep 17 00:00:00 2001 From: oteffahi <70609372+oteffahi@users.noreply.github.com> Date: Thu, 18 Apr 2024 09:49:54 +0200 Subject: [PATCH 018/397] Align examples and remove reading from stdin (#255) * Remove reading from stdin, align example implementations * Add argument parsing implementation for examples * Add argument parsing to examples, format files * Replace getchar with sleep in z_pong example * Fix typo in include * Use null-pointers instead of empty strings, remove unnecessary mallocs * Free returned pointer after parse_pos_args usage * Add common and positional args parsing to z_ping example * Add formatting for parsed config options * Add const to function parameters * Update mode option help * Fix pos_args memory leak * Refactor parse_args, remove possible strcpy buffer overflow * Change parse_args function returns to const where applicable * Fix const initialization warning * Remove redundant const for value parameters * Fix buf variable memory leak * Update insert json-list config error message * Add usage example for -e and -l arguments in help * Update example notation in help message Co-authored-by: Alexander * Update example notation in help message (2/2) * Fix parameter in error message Co-authored-by: Alexander --------- Co-authored-by: Alexander --- examples/parse_args.h | 213 +++++++++++++++++++++++++++ examples/z_delete.c | 62 ++++++-- examples/z_get.c | 93 ++++++++---- examples/z_get_liveliness.c | 71 ++++++--- examples/z_info.c | 48 ++++-- examples/z_liveliness.c | 87 +++++++---- examples/z_non_blocking_get.c | 73 ++++++--- examples/z_ping.c | 88 +++++------ examples/z_pong.c | 66 +++++---- examples/z_pub.c | 97 ++++++++---- examples/z_pub_attachment.c | 78 +++++++--- examples/z_pub_cache.c | 88 ++++++++--- examples/z_pub_shm.c | 80 +++++++--- examples/z_pub_thr.c | 70 ++++++--- examples/z_pull.c | 91 ++++++++---- examples/z_put.c | 75 +++++++--- examples/z_query_sub.c | 84 +++++++---- examples/z_queryable.c | 96 ++++++++---- examples/z_queryable_with_channels.c | 85 ++++++++--- examples/z_sub.c | 79 +++++++--- examples/z_sub_attachment.c | 86 +++++++---- examples/z_sub_liveliness.c | 84 +++++++---- examples/z_sub_thr.c | 50 +++++-- 23 files changed, 1427 insertions(+), 517 deletions(-) create mode 100644 examples/parse_args.h diff --git a/examples/parse_args.h b/examples/parse_args.h new file mode 100644 index 000000000..dac3b98db --- /dev/null +++ b/examples/parse_args.h @@ -0,0 +1,213 @@ +// +// Copyright (c) 2024 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +// + +#pragma once + +#include +#include +#include + +#include "zenoh.h" + +#define COMMON_HELP \ + "\ + -c (optional, string): The path to a configuration file for the session. If this option isn't passed, the default configuration will be used.\n\ + -m (optional, string, default='peer'): The zenoh session mode. [possible values: peer, client, router]\n\ + -e (optional, string): endpoint to connect to. Repeat option to pass multiple endpoints. If none are given, endpoints will be discovered through multicast-scouting if it is enabled.\n\ + e.g.: '-e tcp/192.168.1.1:7447'\n\ + -l (optional, string): locator to listen on. Repeat option to pass multiple locators. If none are given, the default configuration will be used.\n\ + e.g.: '-l tcp/192.168.1.1:7447'\n\ + --no-multicast-scouting (optional): By default zenohd replies to multicast scouting messages for being discovered by peers and clients. This option disables this feature.\n\ +" + +/** + * Parse an option of format `-f`, `--flag`, `-f ` or `--flag ` from `argv`. If found, the option and its + * eventual value are each replaced by NULL in `argv` + * @param argc: argc passed from `main` function + * @param argv: argv passed from `main` function + * @param opt: option to parse (without `-` or `--` prefix) + * @param opt_has_value: if true, the option is of format `-f ` or `--flag ` and `value` will be returned + * if found, else an error message is printed and program will exit. If false, option has no value and a non-null + * pointer will be returned if option is found. + * @returns NULL if option was not found, else a non-null value depending on if `opt_has_value`. + */ +const char* parse_opt(int argc, char** argv, const char* opt, bool opt_has_value) { + size_t optlen = strlen(opt); + for (int i = 1; i < argc; i++) { + if (argv[i] == NULL) { + continue; + } + size_t len = strlen(argv[i]); + if (len < 2) { + continue; + } + if (optlen == 1) { + if (argv[i][0] == '-' && argv[i][1] == opt[0]) { + argv[i] = NULL; + if (!opt_has_value) { + return (char*)opt; + } else if (i + 1 < argc && argv[i + 1]) { + char* value = argv[i + 1]; + argv[i + 1] = NULL; + return value; + } else { + printf("Option -%s given without a value\n", opt); + exit(-1); + } + } + } else if (optlen > 1 && len > 3 && argv[i][0] == '-' && argv[i][1] == '-') { + // Note: support for '--arg=' syntax can be added here + if (strcmp(argv[i] + 2, opt) == 0) { + argv[i] = NULL; + if (!opt_has_value) { + return (char*)opt; + } else if (i + 1 < argc && argv[i + 1]) { + char* value = argv[i + 1]; + argv[i + 1] = NULL; + return value; + } else { + printf("Option --%s given without a value\n", opt); + exit(-1); + } + } + } + } + return NULL; +} + +/** + * Check if any options remains in `argv`. Must be called after all expected options are parsed + * @param argc + * @param argv + * @returns NULL if no option was found, else the first option string that was found + */ +const char* check_unknown_opts(int argc, char** const argv) { + for (int i = 1; i < argc; i++) { + if (argv[i] && argv[i][0] == '-') { + return argv[i]; + } + } + return NULL; +} + +/** + * Parse positional arguments from `argv`. Must be called after all expected options are parsed, and after checking that + * no unknown options remain in `argv` + * @param argc + * @param argv + * @param nb_args: number of expected positional arguments + * @returns NULL if found more positional arguments than `nb_args`. Else an array of found arguments in order, followed + * by NULL values if found less positional arguments than `nb_args` + * @note Returned pointer is dynamically allocated and must be freed + */ +char** parse_pos_args(const int argc, char** argv, const size_t nb_args) { + char** pos_argv = (char**)calloc(nb_args, sizeof(char*)); + size_t pos_argc = 0; + for (int i = 1; i < argc; i++) { + if (argv[i]) { + pos_argc++; + if (pos_argc > nb_args) { + free(pos_argv); + return NULL; + } + pos_argv[pos_argc - 1] = argv[i]; + } + } + return pos_argv; +} + +/** + * Parse zenoh options that require a JSON-serialized list (-e, -l from common args) and add them to + * `config`. Prints error message and exits if fails to insert parsed values + * @param argc + * @param argv + * @param opt: option to parse (without `-` or `--` prefix) + * @param config: address of an owned zenoh configuration + * @param config_key: zenoh configuration key under which the parsed values will be inserted + */ +void parse_zenoh_json_list_config(int argc, char** argv, const char* opt, const char* config_key, + const z_owned_config_t* config) { + char* buf = (char*)calloc(1, sizeof(char)); + const char* value = parse_opt(argc, argv, opt, true); + while (value) { + size_t len_newbuf = strlen(buf) + strlen(value) + 4; // value + quotes + comma + nullbyte + char* newbuf = (char*)malloc(len_newbuf); + snprintf(newbuf, len_newbuf, "%s'%s',", buf, value); + free(buf); + buf = newbuf; + value = parse_opt(argc, argv, opt, true); + } + size_t buflen = strlen(buf); + if (buflen > 0) { + // remove trailing comma + buf[buflen - 1] = '\0'; + buflen--; + // add list delimiters + size_t json_list_len = buflen + 3; // buf + brackets + nullbyte + char* json_list = (char*)malloc(json_list_len); + snprintf(json_list, json_list_len, "[%s]", buf); + // insert in config + if (zc_config_insert_json(z_loan(*config), config_key, json_list) < 0) { + printf( + "Couldn't insert value `%s` in configuration at `%s`\n`%s` is either not a JSON-serialized list of " + "strings, or values within the list do not respect expected format for `%s`\n", + json_list, config_key, json_list, config_key); + free(json_list); + exit(-1); + } + free(json_list); + } + free(buf); +} + +/** + * Parse zenoh options that are common to all examples (-c, -m, -e, -l, --no-multicast-scouting) and add them to + * `config` + * @param argc + * @param argv + * @param config: address of an owned zenoh configuration + */ +void parse_zenoh_common_args(const int argc, char** argv, z_owned_config_t* config) { + // -c: A configuration file. + const char* config_file = parse_opt(argc, argv, "c", true); + if (config_file) { + *config = zc_config_from_file(config_file); + } + // -m: The Zenoh session mode [default: peer]. + const char* mode = parse_opt(argc, argv, "m", true); + if (mode) { + size_t buflen = strlen(mode) + 3; // mode + quotes + nullbyte + char* buf = (char*)malloc(buflen); + snprintf(buf, buflen, "'%s'", mode); + if (zc_config_insert_json(z_loan(*config), Z_CONFIG_MODE_KEY, buf) < 0) { + printf( + "Couldn't insert value `%s` in configuration at `%s`. Value must be one of: 'client', 'peer' or " + "'router'\n", + mode, Z_CONFIG_MODE_KEY); + free(buf); + exit(-1); + } + free(buf); + } + // -e: Endpoint to connect to. Can be repeated + parse_zenoh_json_list_config(argc, argv, "e", Z_CONFIG_CONNECT_KEY, config); + // -l: Endpoint to listen on. Can be repeated + parse_zenoh_json_list_config(argc, argv, "l", Z_CONFIG_LISTEN_KEY, config); + // --no-multicast-scrouting: Disable the multicast-based scouting mechanism. + const char* no_multicast_scouting = parse_opt(argc, argv, "no-multicast-scouting", false); + if (no_multicast_scouting && zc_config_insert_json(z_loan(*config), Z_CONFIG_MULTICAST_SCOUTING_KEY, "false") < 0) { + printf("Couldn't disable multicast-scouting.\n"); + exit(-1); + } +} diff --git a/examples/z_delete.c b/examples/z_delete.c index 5000444bc..9d076033b 100644 --- a/examples/z_delete.c +++ b/examples/z_delete.c @@ -14,23 +14,19 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-put"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-put" - if (argc > 1) keyexpr = argv[1]; +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 3) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -39,9 +35,9 @@ int main(int argc, char **argv) { exit(-1); } - printf("Deleting resources matching '%s'...\n", keyexpr); + printf("Deleting resources matching '%s'...\n", args.keyexpr); z_delete_options_t options = z_delete_options_default(); - int res = z_delete(z_loan(s), z_keyexpr(keyexpr), &options); + int res = z_delete(z_loan(s), z_keyexpr(args.keyexpr), &options); if (res < 0) { printf("Delete failed...\n"); } @@ -49,3 +45,41 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_delete [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_get.c b/examples/z_get.c index 272bef89a..9234f1c2e 100644 --- a/examples/z_get.c +++ b/examples/z_get.c @@ -14,37 +14,27 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - char *value = NULL; - switch (argc) { - default: - case 3: - value = argv[2]; - case 2: - expr = argv[1]; - break; - case 1: - // Do nothing - break; - } - z_keyexpr_t keyexpr = z_keyexpr(expr); +#define DEFAULT_SELECTOR "demo/example/**" +#define DEFAULT_VALUE NULL + +struct args_t { + char* selector; // -s + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +int main(int argc, char** argv) { + z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); + + z_keyexpr_t keyexpr = z_keyexpr(args.selector); if (!z_check(keyexpr)) { - printf("%s is not a valid key expression", expr); + printf("%s is not a valid key expression", args.selector); exit(-1); } - z_owned_config_t config = z_config_default(); - if (argc > 3) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -53,11 +43,11 @@ int main(int argc, char **argv) { exit(-1); } - printf("Sending Query '%s'...\n", expr); + printf("Sending Query '%s'...\n", args.selector); z_owned_reply_channel_t channel = zc_reply_fifo_new(16); z_get_options_t opts = z_get_options_default(); - if (value != NULL) { - opts.value.payload = z_bytes_from_str(value); + if (args.value != NULL) { + opts.value.payload = z_bytes_from_str(args.value); } z_get(z_loan(s), keyexpr, "", z_move(channel.send), &opts); // here, the send is moved and will be dropped by zenoh when adequate @@ -76,4 +66,47 @@ int main(int argc, char **argv) { z_drop(z_move(channel)); z_close(z_move(s)); return 0; -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_get [OPTIONS]\n\n\ + Options:\n\ + -s (optional, string, default='%s'): The selection of resources to query\n\ + -v (optional, string): An optional value to put in the query\n", + DEFAULT_SELECTOR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* selector = parse_opt(argc, argv, "s", true); + if (!selector) { + selector = DEFAULT_SELECTOR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.selector = (char*)selector, .value = (char*)value}; +} diff --git a/examples/z_get_liveliness.c b/examples/z_get_liveliness.c index c667cb03a..e6704cdd0 100644 --- a/examples/z_get_liveliness.c +++ b/examples/z_get_liveliness.c @@ -14,29 +14,24 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "group1/**"; - if (argc > 1) { - expr = argv[1]; - } +#define DEFAULT_KEYEXPR "group1/**" - z_keyexpr_t keyexpr = z_keyexpr(expr); - if (!z_check(keyexpr)) { - printf("%s is not a valid key expression\n", expr); - exit(-1); - } +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } + struct args_t args = parse_args(argc, argv, &config); + + z_keyexpr_t keyexpr = z_keyexpr(args.keyexpr); + if (!z_check(keyexpr)) { + printf("%s is not a valid key expression\n", args.keyexpr); + exit(-1); } printf("Opening session...\n"); @@ -46,7 +41,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Sending liveliness query '%s'...\n", expr); + printf("Sending liveliness query '%s'...\n", args.keyexpr); z_owned_reply_channel_t channel = zc_reply_fifo_new(16); zc_liveliness_get(z_loan(s), keyexpr, z_move(channel.send), NULL); z_owned_reply_t reply = z_reply_null(); @@ -65,3 +60,41 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_get_liveliness [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to query\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_info.c b/examples/z_info.c index d9db2e6d9..728261e90 100644 --- a/examples/z_info.c +++ b/examples/z_info.c @@ -13,26 +13,21 @@ #include +#include "parse_args.h" #include "zenoh.h" -void print_zid(const z_id_t *id, void *ctx) { +void parse_args(int argc, char** argv, z_owned_config_t* config); + +void print_zid(const z_id_t* id, void* ctx) { for (int i = 0; i < 16; i++) { printf("%02x", id->id[i]); } printf("\n"); } -int main(int argc, char **argv) { +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 1) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[1]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[1], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -57,3 +52,34 @@ int main(int argc, char **argv) { z_close(z_move(s)); } + +void print_help() { + printf( + "\ + Usage: z_info [OPTIONS]\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +void parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); +} diff --git a/examples/z_liveliness.c b/examples/z_liveliness.c index 4191b0496..3b1d27b9a 100644 --- a/examples/z_liveliness.c +++ b/examples/z_liveliness.c @@ -13,31 +13,27 @@ #include #include + +#include "parse_args.h" #include "zenoh.h" +#define DEFAULT_KEYEXPR "group1/zenoh-rs" + +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + int main(int argc, char **argv) { - char *expr = "group1/zenoh-rs"; - if (argc > 1) { - expr = argv[1]; - } + z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); - z_keyexpr_t keyexpr = z_keyexpr(expr); + z_keyexpr_t keyexpr = z_keyexpr(args.keyexpr); if (!z_check(keyexpr)) { - printf("%s is not a valid key expression\n", expr); + printf("%s is not a valid key expression\n", args.keyexpr); exit(-1); } - z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } - printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); if (!z_check(s)) { @@ -45,26 +41,61 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring liveliness token '%s'...\n", expr); + printf("Declaring liveliness token '%s'...\n", args.keyexpr); zc_owned_liveliness_token_t token = zc_liveliness_declare_token(z_loan(s), keyexpr, NULL); if (!z_check(token)) { printf("Unable to create liveliness token!\n"); exit(-1); } - printf("Enter 'd' to undeclare liveliness token, 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } else if (c == 'd') { - printf("Undeclaring liveliness token...\n"); - z_drop(z_move(token)); - } + printf("Press CTRL-C to undeclare liveliness token and quit...\n"); + while (1) { + z_sleep_s(1); } + // LivelinessTokens are automatically closed when dropped + // Use the code below to manually undeclare it if needed + printf("Undeclaring liveliness token...\n"); z_drop(z_move(token)); + z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_liveliness [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression the liveliness token\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_non_blocking_get.c b/examples/z_non_blocking_get.c index c0b02a274..87d7f2f5f 100644 --- a/examples/z_non_blocking_get.c +++ b/examples/z_non_blocking_get.c @@ -14,28 +14,25 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } - z_keyexpr_t keyexpr = z_keyexpr(expr); +#define DEFAULT_SELECTOR "demo/example/**" + +struct args_t { + char* selector; // -s +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +int main(int argc, char** argv) { + z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); + + z_keyexpr_t keyexpr = z_keyexpr(args.selector); if (!z_check(keyexpr)) { - printf("%s is not a valid key expression", expr); + printf("%s is not a valid key expression", args.selector); exit(-1); } - z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -44,7 +41,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Sending Query '%s'...\n", expr); + printf("Sending Query '%s'...\n", args.selector); z_get_options_t opts = z_get_options_default(); opts.target = Z_QUERY_TARGET_ALL; z_owned_reply_channel_t channel = zc_reply_non_blocking_fifo_new(16); @@ -69,4 +66,42 @@ int main(int argc, char **argv) { z_drop(z_move(channel)); z_close(z_move(s)); return 0; -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_non_blocking_get [OPTIONS]\n\n\ + Options:\n\ + -s (optional, string, default='%s'): The selection of resources to query\n", + DEFAULT_SELECTOR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* selector = parse_opt(argc, argv, "s", true); + if (!selector) { + selector = DEFAULT_SELECTOR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.selector = (char*)selector}; +} diff --git a/examples/z_ping.c b/examples/z_ping.c index fdc08f71d..c4df86a82 100644 --- a/examples/z_ping.c +++ b/examples/z_ping.c @@ -3,6 +3,7 @@ #include #include +#include "parse_args.h" #include "zenoh.h" #define DEFAULT_PKT_SIZE 8 @@ -11,7 +12,11 @@ #define PING_TIMEOUT_SEC 1 #define handle_error_en(en, msg) \ - do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + do { \ + errno = en; \ + perror(msg); \ + exit(EXIT_FAILURE); \ + } while (0) z_condvar_t cond; z_mutex_t mutex; @@ -23,27 +28,15 @@ struct args_t { unsigned int size; // -s unsigned int number_of_pings; // -n unsigned int warmup_ms; // -w - char* config_path; // -c - uint8_t help_requested; // -h }; -struct args_t parse_args(int argc, char** argv); +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); int main(int argc, char** argv) { - struct args_t args = parse_args(argc, argv); - if (args.help_requested) { - printf( - "\ - -n (optional, int, default=%d): the number of pings to be attempted\n\ - -s (optional, int, default=%d): the size of the payload embedded in the ping and repeated by the pong\n\ - -w (optional, int, default=%d): the warmup time in ms during which pings will be emitted but not measured\n\ - -c (optional, string): the path to a configuration file for the session. If this option isn't passed, the default configuration will be used.\n\ - ", - DEFAULT_PKT_SIZE, DEFAULT_PING_NB, DEFAULT_WARMUP_MS); - return 1; - } + z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); + z_mutex_init(&mutex); z_condvar_init(&cond); - z_owned_config_t config = args.config_path ? zc_config_from_file(args.config_path) : z_config_default(); z_owned_session_t session = z_open(z_move(config)); z_keyexpr_t ping = z_keyexpr_unchecked("test/ping"); z_keyexpr_t pong = z_keyexpr_unchecked("test/pong"); @@ -90,44 +83,53 @@ int main(int argc, char** argv) { z_close(z_move(session)); } -char* getopt(int argc, char** argv, char option) { - for (int i = 0; i < argc; i++) { - size_t len = strlen(argv[i]); - if (len >= 2 && argv[i][0] == '-' && argv[i][1] == option) { - if (len > 2 && argv[i][2] == '=') { - return argv[i] + 3; - } else if (i + 1 < argc) { - return argv[i + 1]; - } - } - } - return NULL; +void print_help() { + printf( + "\ + Usage: z_ping [OPTIONS]\n\n\ + Options:\n\ + -n (optional, int, default=%d): The number of pings to be attempted\n\ + -s (optional, int, default=%d): The size of the payload embedded in the ping and repeated by the pong\n\ + -w (optional, int, default=%d): The warmup time in ms during which pings will be emitted but not measured\n", + DEFAULT_PKT_SIZE, DEFAULT_PING_NB, DEFAULT_WARMUP_MS); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); } -struct args_t parse_args(int argc, char** argv) { - for (int i = 0; i < argc; i++) { - if (strcmp(argv[i], "-h") == 0) { - return (struct args_t){.help_requested = 1}; - } +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); } - char* arg = getopt(argc, argv, 's'); + const char* arg = parse_opt(argc, argv, "s", true); unsigned int size = DEFAULT_PKT_SIZE; if (arg) { size = atoi(arg); } - arg = getopt(argc, argv, 'n'); + arg = parse_opt(argc, argv, "n", true); unsigned int number_of_pings = DEFAULT_PING_NB; if (arg) { number_of_pings = atoi(arg); } - arg = getopt(argc, argv, 'w'); + arg = parse_opt(argc, argv, "w", true); unsigned int warmup_ms = DEFAULT_WARMUP_MS; if (arg) { warmup_ms = atoi(arg); } - return (struct args_t){.help_requested = 0, - .size = size, - .number_of_pings = number_of_pings, - .warmup_ms = warmup_ms, - .config_path = getopt(argc, argv, 'c')}; -} \ No newline at end of file + parse_zenoh_common_args(argc, argv, config); + arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.size = size, .number_of_pings = number_of_pings, .warmup_ms = warmup_ms}; +} diff --git a/examples/z_pong.c b/examples/z_pong.c index 8dbb2631e..b9bc73f7a 100644 --- a/examples/z_pong.c +++ b/examples/z_pong.c @@ -1,8 +1,11 @@ #include #include +#include "parse_args.h" #include "zenoh.h" +void parse_args(int argc, char** argv, z_owned_config_t* config); + void callback(const z_sample_t* sample, void* context) { z_publisher_t pub = z_loan(*(z_owned_publisher_t*)context); #ifdef ZENOH_C // The zc_owned_payload_t API is exclusive to zenoh-c, but allows avoiding some copies. @@ -20,50 +23,51 @@ void drop(void* context) { // which makes passing a pointer to the stack safe as long as `sub` is dropped in a scope where `pub` is still // valid. } -struct args_t { - char* config_path; // -c - uint8_t help_requested; // -h -}; -struct args_t parse_args(int argc, char** argv); int main(int argc, char** argv) { - struct args_t args = parse_args(argc, argv); - if (args.help_requested) { - printf("-c (optional, string): the path to a configuration file for the session. If this option isn't passed, the default configuration will be used.\n"); - return 1; - } - z_owned_config_t config = args.config_path ? zc_config_from_file(args.config_path) : z_config_default(); + z_owned_config_t config = z_config_default(); + parse_args(argc, argv, &config); + z_owned_session_t session = z_open(z_move(config)); z_keyexpr_t ping = z_keyexpr_unchecked("test/ping"); z_keyexpr_t pong = z_keyexpr_unchecked("test/pong"); z_owned_publisher_t pub = z_declare_publisher(z_loan(session), pong, NULL); z_owned_closure_sample_t respond = z_closure(callback, drop, (void*)z_move(pub)); z_owned_subscriber_t sub = z_declare_subscriber(z_loan(session), ping, z_move(respond), NULL); - while (getchar() != 'q') { + while (1) { + z_sleep_s(1); } z_drop(z_move(sub)); z_close(z_move(session)); } -char* getopt(int argc, char** argv, char option) { - for (int i = 0; i < argc; i++) { - size_t len = strlen(argv[i]); - if (len >= 2 && argv[i][0] == '-' && argv[i][1] == option) { - if (len > 2 && argv[i][2] == '=') { - return argv[i] + 3; - } else if (i + 1 < argc) { - return argv[i + 1]; - } - } - } - return NULL; +void print_help() { + printf( + "\ + Usage: z_pong [OPTIONS]\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); } -struct args_t parse_args(int argc, char** argv) { - for (int i = 0; i < argc; i++) { - if (strcmp(argv[i], "-h") == 0) { - return (struct args_t){.help_requested = 1}; - } +void parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); } - return (struct args_t){.help_requested = 0, .config_path = getopt(argc, argv, 'c')}; -} \ No newline at end of file + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); +} diff --git a/examples/z_pub.c b/examples/z_pub.c index ecc95e42d..f372abe8f 100644 --- a/examples/z_pub.c +++ b/examples/z_pub.c @@ -14,9 +14,20 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -void matching_status_handler(const zcu_matching_status_t *matching_status, void *arg) { +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub" +#define DEFAULT_VALUE "Pub from C!" + +struct args_t { + char* keyexpr; // -k + char* value; // -v + bool add_matching_listener; // --add-matching-listener +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +void matching_status_handler(const zcu_matching_status_t* matching_status, void* arg) { if (matching_status->matching) { printf("Subscriber matched\n"); } else { @@ -24,25 +35,9 @@ void matching_status_handler(const zcu_matching_status_t *matching_status, void } } -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub"; - char *value = "Pub from C!"; - bool add_matching_listener = false; - - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; - if (argc > 3) add_matching_listener = atoi(argv[3]); - +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 4) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[4]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[4], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -51,27 +46,28 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring Publisher on '%s'...\n", keyexpr); - z_owned_publisher_t pub = z_declare_publisher(z_loan(s), z_keyexpr(keyexpr), NULL); + printf("Declaring Publisher on '%s'...\n", args.keyexpr); + z_owned_publisher_t pub = z_declare_publisher(z_loan(s), z_keyexpr(args.keyexpr), NULL); if (!z_check(pub)) { printf("Unable to declare Publisher for key expression!\n"); exit(-1); } zcu_owned_matching_listener_t listener; - if (add_matching_listener) { + if (args.add_matching_listener) { zcu_owned_closure_matching_status_t callback = z_closure(matching_status_handler); - listener = zcu_publisher_matching_listener_callback(z_loan(pub), z_move(callback)); + listener = zcu_publisher_matching_listener_callback(z_loan(pub), z_move(callback)); } + printf("Press CTRL-C to quit...\n"); char buf[256]; for (int idx = 0; 1; ++idx) { z_sleep_s(1); - sprintf(buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); + sprintf(buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); z_publisher_put_options_t options = z_publisher_put_options_default(); options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL); - z_publisher_put(z_loan(pub), (const uint8_t *)buf, strlen(buf), &options); + z_publisher_put(z_loan(pub), (const uint8_t*)buf, strlen(buf), &options); } z_undeclare_publisher(z_move(pub)); @@ -79,3 +75,52 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n\ + --add-matching-listener (optional): Add matching listener\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + const char* arg = parse_opt(argc, argv, "add-matching-listener", false); + bool add_matching_listener = false; + if (arg) { + add_matching_listener = true; + } + parse_zenoh_common_args(argc, argv, config); + arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value, .add_matching_listener = add_matching_listener}; +} diff --git a/examples/z_pub_attachment.c b/examples/z_pub_attachment.c index a24133e91..d09fd3d6a 100644 --- a/examples/z_pub_attachment.c +++ b/examples/z_pub_attachment.c @@ -14,25 +14,21 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub"; - char *value = "Pub from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub" +#define DEFAULT_VALUE "Pub from C!" - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 3) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -41,8 +37,8 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring Publisher on '%s'...\n", keyexpr); - z_owned_publisher_t pub = z_declare_publisher(z_loan(s), z_keyexpr(keyexpr), NULL); + printf("Declaring Publisher on '%s'...\n", args.keyexpr); + z_owned_publisher_t pub = z_declare_publisher(z_loan(s), z_keyexpr(args.keyexpr), NULL); if (!z_check(pub)) { printf("Unable to declare Publisher for key expression!\n"); exit(-1); @@ -60,6 +56,7 @@ int main(int argc, char **argv) { // add some value z_bytes_map_insert_by_alias(&map, z_bytes_from_str("source"), z_bytes_from_str("C")); + printf("Press CTRL-C to quit...\n"); char buf[256]; char buf_ind[16]; for (int idx = 0; 1; ++idx) { @@ -69,9 +66,9 @@ int main(int argc, char **argv) { sprintf(buf_ind, "%d", idx); z_bytes_map_insert_by_alias(&map, z_bytes_from_str("index"), z_bytes_from_str(buf_ind)); - sprintf(buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); - z_publisher_put(z_loan(pub), (const uint8_t *)buf, strlen(buf), &options); + sprintf(buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); + z_publisher_put(z_loan(pub), (const uint8_t*)buf, strlen(buf), &options); } z_undeclare_publisher(z_move(pub)); @@ -81,3 +78,46 @@ int main(int argc, char **argv) { return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub_attachement [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_pub_cache.c b/examples/z_pub_cache.c index 770bf9d93..0fe50a262 100644 --- a/examples/z_pub_cache.c +++ b/examples/z_pub_cache.c @@ -14,25 +14,23 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub"; - char *value = "Pub from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub" +#define DEFAULT_VALUE "Pub from C!" +#define DEFAULT_HISTORY 1 - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v + unsigned int history; // -i +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 3) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); if (zc_config_insert_json(z_loan(config), Z_CONFIG_ADD_TIMESTAMP_KEY, "true") < 0) { printf("Unable to configure timestamps!\n"); @@ -47,23 +45,24 @@ int main(int argc, char **argv) { } ze_publication_cache_options_t pub_cache_opts = ze_publication_cache_options_default(); - pub_cache_opts.history = 42; + pub_cache_opts.history = args.history; pub_cache_opts.queryable_complete = false; - printf("Declaring publication cache on '%s'...\n", keyexpr); + printf("Declaring publication cache on '%s'...\n", args.keyexpr); ze_owned_publication_cache_t pub_cache = - ze_declare_publication_cache(z_loan(s), z_keyexpr(keyexpr), &pub_cache_opts); + ze_declare_publication_cache(z_loan(s), z_keyexpr(args.keyexpr), &pub_cache_opts); if (!z_check(pub_cache)) { printf("Unable to declare publication cache for key expression!\n"); exit(-1); } + printf("Press CTRL-C to quit...\n"); char buf[256]; for (int idx = 0; 1; ++idx) { z_sleep_s(1); - sprintf(buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); - z_put(z_loan(s), z_keyexpr(keyexpr), (const uint8_t *)buf, strlen(buf), NULL); + sprintf(buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); + z_put(z_loan(s), z_keyexpr(args.keyexpr), (const uint8_t*)buf, strlen(buf), NULL); } z_drop(z_move(pub_cache)); @@ -71,3 +70,52 @@ int main(int argc, char **argv) { return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub_cache [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n\ + -i (optional, int, default='%d'): The number of publications to keep in cache\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE, DEFAULT_HISTORY); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + const char* arg = parse_opt(argc, argv, "i", true); + unsigned int history = DEFAULT_HISTORY; + if (arg) { + history = atoi(arg); + } + parse_zenoh_common_args(argc, argv, config); + arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value, .history = history}; +} diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 10970bf62..feddc6fdf 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -16,32 +16,28 @@ #include #include +#include "parse_args.h" #include "zenoh.h" #define N 10 +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub-shm" +#define DEFAULT_VALUE "Pub from C!" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub-shm"; - char *value = "Pub from C!"; - - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); + // Enable shared memory if (zc_config_insert_json(z_loan(config), "transport/shared_memory/enabled", "true") < 0) { printf("Error enabling Shared Memory"); exit(-1); } - if (argc > 3) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -57,13 +53,14 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring Publisher on '%s'...\n", keyexpr); - z_owned_publisher_t pub = z_declare_publisher(z_loan(s), z_keyexpr(keyexpr), NULL); + printf("Declaring Publisher on '%s'...\n", args.keyexpr); + z_owned_publisher_t pub = z_declare_publisher(z_loan(s), z_keyexpr(args.keyexpr), NULL); if (!z_check(pub)) { printf("Unable to declare Publisher for key expression!\n"); exit(-1); } + printf("Press CTRL-C to quit...\n"); for (int idx = 0; true; ++idx) { zc_owned_shmbuf_t shmbuf = zc_shm_alloc(&manager, 256); if (!z_check(shmbuf)) { @@ -74,13 +71,13 @@ int main(int argc, char **argv) { exit(-1); } } - char *buf = (char *)zc_shmbuf_ptr(&shmbuf); + char* buf = (char*)zc_shmbuf_ptr(&shmbuf); buf[256] = 0; - snprintf(buf, 255, "[%4d] %s", idx, value); + snprintf(buf, 255, "[%4d] %s", idx, args.value); size_t len = strlen(buf); zc_shmbuf_set_length(&shmbuf, len); z_sleep_s(1); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); z_publisher_put_options_t options = z_publisher_put_options_default(); options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL); zc_owned_payload_t payload = zc_shmbuf_into_payload(z_move(shmbuf)); @@ -92,3 +89,46 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub_shm [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_pub_thr.c b/examples/z_pub_thr.c index 8686c33eb..0a6562317 100644 --- a/examples/z_pub_thr.c +++ b/examples/z_pub_thr.c @@ -14,29 +14,21 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - if (argc < 2) { - printf("USAGE:\n\tz_pub_thr []\n\n"); - exit(-1); - } +struct args_t { + unsigned int size; // positional_1 +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); - char *keyexpr = "test/thr"; - size_t len = atoi(argv[1]); - uint8_t *value = (uint8_t *)z_malloc(len); - memset(value, 1, len); +int main(int argc, char** argv) { + char* keyexpr = "test/thr"; z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); + uint8_t* value = (uint8_t*)z_malloc(args.size); + memset(value, 1, args.size); z_owned_session_t s = z_open(z_move(config)); if (!z_check(s)) { @@ -53,10 +45,50 @@ int main(int argc, char **argv) { exit(-1); } + printf("Press CTRL-C to quit...\n"); while (1) { - z_publisher_put(z_loan(pub), (const uint8_t *)value, len, NULL); + z_publisher_put(z_loan(pub), (const uint8_t*)value, args.size, NULL); } z_undeclare_publisher(z_move(pub)); z_close(z_move(s)); } + +void print_help() { + printf( + "\ + Usage: z_pub_thr [OPTIONS] \n\n\ + Arguments:\n\ + (required, int): Size of the payload to publish\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args) { + printf("Unexpected additional positional arguments\n"); + exit(-1); + } + if (!pos_args[0]) { + printf(" argument is required\n"); + free(pos_args); + exit(-1); + } + unsigned int size = atoi(pos_args[0]); + free(pos_args); + return (struct args_t){.size = size}; +} diff --git a/examples/z_pull.c b/examples/z_pull.c index 0af23f7e2..c405d602f 100644 --- a/examples/z_pull.c +++ b/examples/z_pull.c @@ -12,33 +12,29 @@ // ZettaScale Zenoh Team, // #include + +#include "parse_args.h" #include "zenoh.h" -const char *kind_to_str(z_sample_kind_t kind); +#define DEFAULT_KEYEXPR "demo/example/**" + +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +const char* kind_to_str(z_sample_kind_t kind); -void data_handler(const z_sample_t *sample, void *arg) { +void data_handler(const z_sample_t* sample, void* arg) { z_owned_str_t keystr = z_keyexpr_to_string(sample->keyexpr); printf(">> [Subscriber] Received %s ('%s': '%.*s')\n", kind_to_str(sample->kind), z_loan(keystr), (int)sample->payload.len, sample->payload.start); z_drop(z_move(keystr)); } -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } - +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -48,22 +44,19 @@ int main(int argc, char **argv) { } z_owned_closure_sample_t callback = z_closure(data_handler); - printf("Declaring Subscriber on '%s'...\n", expr); - z_owned_pull_subscriber_t sub = z_declare_pull_subscriber(z_loan(s), z_keyexpr(expr), z_move(callback), NULL); + printf("Declaring Subscriber on '%s'...\n", args.keyexpr); + z_owned_pull_subscriber_t sub = + z_declare_pull_subscriber(z_loan(s), z_keyexpr(args.keyexpr), z_move(callback), NULL); if (!z_check(sub)) { printf("Unable to declare subscriber.\n"); exit(-1); } - printf("Press to pull data...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } else { - z_subscriber_pull(z_loan(sub)); - } + printf("Press CTRL-C to quit...\n"); + for (int idx = 0; 1; ++idx) { + z_sleep_s(1); + printf("[%4d] Pulling...\n", idx); + z_subscriber_pull(z_loan(sub)); } z_undeclare_pull_subscriber(z_move(sub)); @@ -71,7 +64,7 @@ int main(int argc, char **argv) { return 0; } -const char *kind_to_str(z_sample_kind_t kind) { +const char* kind_to_str(z_sample_kind_t kind) { switch (kind) { case Z_SAMPLE_KIND_PUT: return "PUT"; @@ -80,4 +73,42 @@ const char *kind_to_str(z_sample_kind_t kind) { default: return "UNKNOWN"; } -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_pull [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_put.c b/examples/z_put.c index 498d1e958..dd24a9bd5 100644 --- a/examples/z_put.c +++ b/examples/z_put.c @@ -14,29 +14,25 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-put"; - char *value = "Put from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-put" +#define DEFAULT_VALUE "Put from C!" - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +int main(int argc, char** argv) { + z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); z_owned_bytes_map_t attachment = z_bytes_map_new(); z_bytes_map_insert_by_alias(&attachment, z_bytes_from_str("hello"), z_bytes_from_str("there")); - z_owned_config_t config = z_config_default(); - if (argc > 3) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } - printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); if (!z_check(s)) { @@ -44,11 +40,11 @@ int main(int argc, char **argv) { exit(-1); } - printf("Putting Data ('%s': '%s')...\n", keyexpr, value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, args.value); z_put_options_t options = z_put_options_default(); options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL); options.attachment = z_bytes_map_as_attachment(&attachment); - int res = z_put(z_loan(s), z_keyexpr(keyexpr), (const uint8_t *)value, strlen(value), &options); + int res = z_put(z_loan(s), z_keyexpr(args.keyexpr), (const uint8_t*)args.value, strlen(args.value), &options); if (res < 0) { printf("Put failed...\n"); } @@ -57,3 +53,46 @@ int main(int argc, char **argv) { z_drop(z_move(attachment)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_put [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_query_sub.c b/examples/z_query_sub.c index 15564be7c..c7e1c1cd8 100644 --- a/examples/z_query_sub.c +++ b/examples/z_query_sub.c @@ -12,33 +12,29 @@ // ZettaScale Zenoh Team, // #include + +#include "parse_args.h" #include "zenoh.h" -const char *kind_to_str(z_sample_kind_t kind); +#define DEFAULT_KEYEXPR "demo/example/**" + +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); -void data_handler(const z_sample_t *sample, void *arg) { +const char* kind_to_str(z_sample_kind_t kind); + +void data_handler(const z_sample_t* sample, void* arg) { z_owned_str_t keystr = z_keyexpr_to_string(sample->keyexpr); printf(">> [Subscriber] Received %s ('%s': '%.*s')\n", kind_to_str(sample->kind), z_loan(keystr), (int)sample->payload.len, sample->payload.start); z_drop(z_move(keystr)); } -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } - +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -49,21 +45,17 @@ int main(int argc, char **argv) { ze_querying_subscriber_options_t sub_opts = ze_querying_subscriber_options_default(); z_owned_closure_sample_t callback = z_closure(data_handler); - printf("Declaring querying subscriber on '%s'...\n", expr); + printf("Declaring querying subscriber on '%s'...\n", args.keyexpr); ze_owned_querying_subscriber_t sub = - ze_declare_querying_subscriber(z_loan(s), z_keyexpr(expr), z_move(callback), &sub_opts); + ze_declare_querying_subscriber(z_loan(s), z_keyexpr(args.keyexpr), z_move(callback), &sub_opts); if (!z_check(sub)) { printf("Unable to declare querying subscriber.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_drop(z_move(sub)); @@ -72,7 +64,7 @@ int main(int argc, char **argv) { return 0; } -const char *kind_to_str(z_sample_kind_t kind) { +const char* kind_to_str(z_sample_kind_t kind) { switch (kind) { case Z_SAMPLE_KIND_PUT: return "PUT"; @@ -82,3 +74,41 @@ const char *kind_to_str(z_sample_kind_t kind) { return "UNKNOWN"; } } + +void print_help() { + printf( + "\ + Usage: z_query_sub [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_queryable.c b/examples/z_queryable.c index 9d6ec7702..81a19bbd7 100644 --- a/examples/z_queryable.c +++ b/examples/z_queryable.c @@ -13,13 +13,22 @@ #include #include + +#include "parse_args.h" #include "zenoh.h" -const char *expr = "demo/example/zenoh-c-queryable"; -const char *value = "Queryable from C!"; -z_keyexpr_t keyexpr; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-queryable" +#define DEFAULT_VALUE "Queryable from C!" + +char* value = NULL; -void query_handler(const z_query_t *query, void *context) { +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +void query_handler(const z_query_t* query, void* context) { z_owned_str_t keystr = z_keyexpr_to_string(z_query_keyexpr(query)); z_bytes_t pred = z_query_parameters(query); z_value_t payload_value = z_query_value(query); @@ -31,24 +40,14 @@ void query_handler(const z_query_t *query, void *context) { } z_query_reply_options_t options = z_query_reply_options_default(); options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL); - z_query_reply(query, z_keyexpr((const char *)context), (const unsigned char *)value, strlen(value), &options); + z_query_reply(query, z_keyexpr((const char*)context), (const unsigned char*)value, strlen(value), &options); z_drop(z_move(keystr)); } -int main(int argc, char **argv) { - if (argc > 1) { - expr = argv[1]; - } +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); + value = args.value; printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -56,30 +55,69 @@ int main(int argc, char **argv) { printf("Unable to open session!\n"); exit(-1); } - keyexpr = z_keyexpr(expr); + z_keyexpr_t keyexpr = z_keyexpr(args.keyexpr); if (!z_check(keyexpr)) { - printf("%s is not a valid key expression", expr); + printf("%s is not a valid key expression", args.keyexpr); exit(-1); } - printf("Declaring Queryable on '%s'...\n", expr); - z_owned_closure_query_t callback = z_closure(query_handler, NULL, expr); + printf("Declaring Queryable on '%s'...\n", args.keyexpr); + z_owned_closure_query_t callback = z_closure(query_handler, NULL, args.keyexpr); z_owned_queryable_t qable = z_declare_queryable(z_loan(s), keyexpr, z_move(callback), NULL); if (!z_check(qable)) { printf("Unable to create queryable.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_queryable(z_move(qable)); z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_queryable [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression matching queries to reply to\n\ + -v (optional, string, default='%s'): The value to reply to queries with\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_queryable_with_channels.c b/examples/z_queryable_with_channels.c index 672ddd607..d71c0ccbf 100644 --- a/examples/z_queryable_with_channels.c +++ b/examples/z_queryable_with_channels.c @@ -14,32 +14,28 @@ #include #include #include + +#include "parse_args.h" #include "zenoh.h" -const char *expr = "demo/example/zenoh-c-queryable"; -const char *value = "Queryable from C!"; -z_keyexpr_t keyexpr; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-queryable" +#define DEFAULT_VALUE "Queryable from C!" + +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); -void query_handler(const z_query_t *query, void *context) { - z_owned_closure_owned_query_t *channel = (z_owned_closure_owned_query_t *)context; +void query_handler(const z_query_t* query, void* context) { + z_owned_closure_owned_query_t* channel = (z_owned_closure_owned_query_t*)context; z_owned_query_t oquery = z_query_clone(query); z_call(*channel, &oquery); } -int main(int argc, char **argv) { - if (argc > 1) { - expr = argv[1]; - } +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -47,13 +43,13 @@ int main(int argc, char **argv) { printf("Unable to open session!\n"); exit(-1); } - keyexpr = z_keyexpr(expr); + z_keyexpr_t keyexpr = z_keyexpr(args.keyexpr); if (!z_check(keyexpr)) { - printf("%s is not a valid key expression", expr); + printf("%s is not a valid key expression", args.keyexpr); exit(-1); } - printf("Declaring Queryable on '%s'...\n", expr); + printf("Declaring Queryable on '%s'...\n", args.keyexpr); z_owned_query_channel_t channel = zc_query_fifo_new(16); z_owned_closure_query_t callback = z_closure(query_handler, NULL, &channel.send); z_owned_queryable_t qable = z_declare_queryable(z_loan(s), keyexpr, z_move(callback), NULL); @@ -62,7 +58,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("^C to quit...\n"); + printf("Press CTRL-C to quit...\n"); z_owned_query_t oquery = z_query_null(); for (z_call(channel.recv, &oquery); z_check(oquery); z_call(channel.recv, &oquery)) { z_query_t query = z_loan(oquery); @@ -77,7 +73,7 @@ int main(int argc, char **argv) { } z_query_reply_options_t options = z_query_reply_options_default(); options.encoding = z_encoding(Z_ENCODING_PREFIX_TEXT_PLAIN, NULL); - z_query_reply(&query, keyexpr, (const unsigned char *)value, strlen(value), &options); + z_query_reply(&query, keyexpr, (const unsigned char*)args.value, strlen(args.value), &options); z_drop(z_move(keystr)); z_drop(z_move(oquery)); } @@ -87,3 +83,46 @@ int main(int argc, char **argv) { z_drop(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_queryable_with_channels [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression matching queries to reply to\n\ + -v (optional, string, default='%s'): The value to reply to queries with\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_sub.c b/examples/z_sub.c index 867c1277e..e5f5b30fa 100644 --- a/examples/z_sub.c +++ b/examples/z_sub.c @@ -12,8 +12,17 @@ // ZettaScale Zenoh Team, // #include + +#include "parse_args.h" #include "zenoh.h" +#define DEFAULT_KEYEXPR "demo/example/**" + +struct args_t { + char *keyexpr; // -k +}; +struct args_t parse_args(int argc, char **argv, z_owned_config_t *config); + const char *kind_to_str(z_sample_kind_t kind); void data_handler(const z_sample_t *sample, void *arg) { @@ -24,21 +33,9 @@ void data_handler(const z_sample_t *sample, void *arg) { } int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } - z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); + // A probing procedure for shared memory is performed upon session opening. To enable `z_pub_shm` to operate // over shared memory (and to not fallback on network mode), shared memory needs to be enabled also on the // subscriber side. By doing so, the probing procedure will succeed and shared memory will operate as expected. @@ -55,20 +52,16 @@ int main(int argc, char **argv) { } z_owned_closure_sample_t callback = z_closure(data_handler); - printf("Declaring Subscriber on '%s'...\n", expr); - z_owned_subscriber_t sub = z_declare_subscriber(z_loan(s), z_keyexpr(expr), z_move(callback), NULL); + printf("Declaring Subscriber on '%s'...\n", args.keyexpr); + z_owned_subscriber_t sub = z_declare_subscriber(z_loan(s), z_keyexpr(args.keyexpr), z_move(callback), NULL); if (!z_check(sub)) { printf("Unable to declare subscriber.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); @@ -85,4 +78,42 @@ const char *kind_to_str(z_sample_kind_t kind) { default: return "UNKNOWN"; } -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_sub [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char **argv, z_owned_config_t *config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char *keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char *arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char **pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_sub_attachment.c b/examples/z_sub_attachment.c index 58b0afd81..4b38b9c7b 100644 --- a/examples/z_sub_attachment.c +++ b/examples/z_sub_attachment.c @@ -13,16 +13,25 @@ // #include #include + +#include "parse_args.h" #include "zenoh.h" -const char *kind_to_str(z_sample_kind_t kind); +#define DEFAULT_KEYEXPR "demo/example/**" + +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +const char* kind_to_str(z_sample_kind_t kind); -int8_t attachment_reader(z_bytes_t key, z_bytes_t val, void *ctx) { +int8_t attachment_reader(z_bytes_t key, z_bytes_t val, void* ctx) { printf(" attachment: %.*s: '%.*s'\n", (int)key.len, key.start, (int)val.len, val.start); return 0; } -void data_handler(const z_sample_t *sample, void *arg) { +void data_handler(const z_sample_t* sample, void* arg) { z_owned_str_t keystr = z_keyexpr_to_string(sample->keyexpr); printf(">> [Subscriber] Received %s ('%s': '%.*s')\n", kind_to_str(sample->kind), z_loan(keystr), (int)sample->payload.len, sample->payload.start); @@ -41,22 +50,9 @@ void data_handler(const z_sample_t *sample, void *arg) { z_drop(z_move(keystr)); } -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } - +int main(int argc, char** argv) { z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); @@ -66,20 +62,16 @@ int main(int argc, char **argv) { } z_owned_closure_sample_t callback = z_closure(data_handler); - printf("Declaring Subscriber on '%s'...\n", expr); - z_owned_subscriber_t sub = z_declare_subscriber(z_loan(s), z_keyexpr(expr), z_move(callback), NULL); + printf("Declaring Subscriber on '%s'...\n", args.keyexpr); + z_owned_subscriber_t sub = z_declare_subscriber(z_loan(s), z_keyexpr(args.keyexpr), z_move(callback), NULL); if (!z_check(sub)) { printf("Unable to declare subscriber.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); @@ -87,7 +79,7 @@ int main(int argc, char **argv) { return 0; } -const char *kind_to_str(z_sample_kind_t kind) { +const char* kind_to_str(z_sample_kind_t kind) { switch (kind) { case Z_SAMPLE_KIND_PUT: return "PUT"; @@ -97,3 +89,41 @@ const char *kind_to_str(z_sample_kind_t kind) { return "UNKNOWN"; } } + +void print_help() { + printf( + "\ + Usage: z_sub_attachement [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_sub_liveliness.c b/examples/z_sub_liveliness.c index 36bf64515..9b74fa8e2 100644 --- a/examples/z_sub_liveliness.c +++ b/examples/z_sub_liveliness.c @@ -12,9 +12,18 @@ // ZettaScale Zenoh Team, // #include + +#include "parse_args.h" #include "zenoh.h" -void data_handler(const z_sample_t *sample, void *arg) { +#define DEFAULT_KEYEXPR "group1/**" + +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +void data_handler(const z_sample_t* sample, void* arg) { z_owned_str_t keystr = z_keyexpr_to_string(sample->keyexpr); switch (sample->kind) { case Z_SAMPLE_KIND_PUT: @@ -27,29 +36,16 @@ void data_handler(const z_sample_t *sample, void *arg) { z_drop(z_move(keystr)); } -int main(int argc, char **argv) { - char *expr = "group1/**"; - if (argc > 1) { - expr = argv[1]; - } +int main(int argc, char** argv) { + z_owned_config_t config = z_config_default(); + struct args_t args = parse_args(argc, argv, &config); - z_keyexpr_t keyexpr = z_keyexpr(expr); + z_keyexpr_t keyexpr = z_keyexpr(args.keyexpr); if (!z_check(keyexpr)) { - printf("%s is not a valid key expression\n", expr); + printf("%s is not a valid key expression\n", args.keyexpr); exit(-1); } - z_owned_config_t config = z_config_default(); - if (argc > 2) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } - printf("Opening session...\n"); z_owned_session_t s = z_open(z_move(config)); if (!z_check(s)) { @@ -57,7 +53,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring liveliness subscriber on '%s'...\n", expr); + printf("Declaring liveliness subscriber on '%s'...\n", args.keyexpr); z_owned_closure_sample_t callback = z_closure(data_handler); z_owned_subscriber_t sub = zc_liveliness_declare_subscriber(z_loan(s), keyexpr, z_move(callback), NULL); if (!z_check(sub)) { @@ -65,16 +61,50 @@ int main(int argc, char **argv) { exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_sub_liveliness [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression matching liveliness tokens to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 05ee709d3..efec57128 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -13,10 +13,13 @@ // #include +#include "parse_args.h" #include "zenoh.h" #define N 1000000 +void parse_args(int argc, char **argv, z_owned_config_t *config); + typedef struct { volatile unsigned long count; volatile unsigned long finished_rounds; @@ -61,15 +64,7 @@ void drop_stats(void *context) { int main(int argc, char **argv) { z_owned_config_t config = z_config_default(); - if (argc > 1) { - if (zc_config_insert_json(z_loan(config), Z_CONFIG_CONNECT_KEY, argv[1]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[1], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + parse_args(argc, argv, &config); z_owned_session_t s = z_open(z_move(config)); if (!z_check(s)) { @@ -87,9 +82,9 @@ int main(int argc, char **argv) { exit(-1); } - char c = 0; - while (c != 'q') { - c = fgetc(stdin); + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); @@ -97,3 +92,34 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_sub_thr [OPTIONS]\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +void parse_args(int argc, char **argv, z_owned_config_t *config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char *arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char **pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); +} From 68ab0c1faa2c3521680352778e618d95f15e2e95 Mon Sep 17 00:00:00 2001 From: "ChenYing Kuo (CY)" Date: Thu, 18 Apr 2024 18:21:52 +0800 Subject: [PATCH 019/397] Bugfix: Unable to build z_queryable_with_channels.c (#340) Signed-off-by: ChenYing Kuo --- include/zenoh_macros.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index fa6668d48..b34ffd85d 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -181,7 +181,9 @@ template<> struct zenoh_drop_type { typedef void type; template<> struct zenoh_drop_type { typedef void type; }; template<> struct zenoh_drop_type { typedef void type; }; template<> struct zenoh_drop_type { typedef void type; }; +template<> struct zenoh_drop_type { typedef void type; }; template<> struct zenoh_drop_type { typedef void type; }; +template<> struct zenoh_drop_type { typedef void type; }; template<> struct zenoh_drop_type { typedef void type; }; template<> struct zenoh_drop_type { typedef void type; }; template<> struct zenoh_drop_type { typedef int8_t type; }; @@ -210,7 +212,9 @@ template<> inline void z_drop(z_owned_closure_hello_t* v) { z_closure_hello_drop template<> inline void z_drop(z_owned_closure_zid_t* v) { z_closure_zid_drop(v); } template<> inline void z_drop(zcu_owned_closure_matching_status_t* v) { zcu_closure_matching_status_drop(v); } template<> inline void z_drop(z_owned_reply_channel_closure_t* v) { z_reply_channel_closure_drop(v); } +template<> inline void z_drop(z_owned_query_channel_closure_t* v) { z_query_channel_closure_drop(v); } template<> inline void z_drop(z_owned_reply_channel_t* v) { z_reply_channel_drop(v); } +template<> inline void z_drop(z_owned_query_channel_t* v) { z_query_channel_drop(v); } template<> inline void z_drop(z_owned_bytes_map_t* v) { z_bytes_map_drop(v); } template<> inline void z_drop(zc_owned_liveliness_token_t* v) { zc_liveliness_undeclare_token(v); } template<> inline int8_t z_drop(ze_owned_publication_cache_t* v) { return ze_undeclare_publication_cache(v); } @@ -273,6 +277,8 @@ inline void z_call(const struct z_owned_closure_sample_t &closure, const struct { z_closure_sample_call(&closure, sample); } inline void z_call(const struct z_owned_closure_query_t &closure, const struct z_query_t *query) { z_closure_query_call(&closure, query); } +inline void z_call(const struct z_owned_closure_owned_query_t &closure, struct z_owned_query_t *query) + { z_closure_owned_query_call(&closure, query); } inline void z_call(const struct z_owned_closure_reply_t &closure, struct z_owned_reply_t *sample) { z_closure_reply_call(&closure, sample); } inline void z_call(const struct z_owned_closure_hello_t &closure, struct z_owned_hello_t *hello) @@ -283,6 +289,8 @@ inline void z_call(const struct zcu_owned_closure_matching_status_t &closure, co { zcu_closure_matching_status_call(&closure, matching_status); } inline bool z_call(const struct z_owned_reply_channel_closure_t &closure, struct z_owned_reply_t *sample) { return z_reply_channel_closure_call(&closure, sample); } +inline bool z_call(const struct z_owned_query_channel_closure_t &closure, struct z_owned_query_t *query) + { return z_query_channel_closure_call(&closure, query); } // clang-format on #define _z_closure_overloader(callback, droper, ctx, ...) \ From 414236375cb1b80f9c2ea68fc164d33aac3a9f28 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:38:57 +0200 Subject: [PATCH 020/397] build: Sync with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 92 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 75b73e3c8..b4cdc65e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -285,6 +285,9 @@ name = "bitflags" version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +dependencies = [ + "serde", +] [[package]] name = "block-buffer" @@ -1690,6 +1693,18 @@ dependencies = [ "cache-padded", ] +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64", + "bitflags 2.4.2", + "serde", + "serde_derive", +] + [[package]] name = "rsa" version = "0.9.2" @@ -1774,9 +1789,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.2" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring 0.17.6", @@ -2335,7 +2350,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.2", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] @@ -2961,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "ahash", "async-trait", @@ -3012,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "zenoh-collections", ] @@ -3044,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "serde", "tracing", @@ -3057,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "flume", "json5", @@ -3082,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-global-executor", "lazy_static", @@ -3094,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "aes", "hmac", @@ -3107,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "bincode", "flume", @@ -3128,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3142,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "zenoh-config", @@ -3160,12 +3175,12 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "flume", "futures", - "rustls 0.22.2", + "rustls 0.22.4", "rustls-webpki 0.102.2", "serde", "tokio", @@ -3173,6 +3188,7 @@ dependencies = [ "tracing", "zenoh-buffers", "zenoh-codec", + "zenoh-config", "zenoh-core", "zenoh-protocol", "zenoh-result", @@ -3183,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "base64", @@ -3191,13 +3207,15 @@ dependencies = [ "quinn", "rustls 0.21.7", "rustls-native-certs 0.7.0", - "rustls-pemfile 2.0.0", + "rustls-pemfile 1.0.3", + "rustls-pki-types", "rustls-webpki 0.102.2", "secrecy", "tokio", "tokio-rustls 0.24.1", "tokio-util", "tracing", + "webpki-roots", "zenoh-config", "zenoh-core", "zenoh-link-commons", @@ -3211,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "tokio", @@ -3229,12 +3247,12 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "base64", "futures", - "rustls 0.22.2", + "rustls 0.22.4", "rustls-pemfile 2.0.0", "rustls-pki-types", "rustls-webpki 0.102.2", @@ -3257,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3278,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "futures", @@ -3298,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "futures-util", @@ -3319,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "proc-macro2", "quote", @@ -3330,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "const_format", "libloading", @@ -3346,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "const_format", "rand", @@ -3360,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "anyhow", ] @@ -3368,19 +3386,23 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "futures", "lazy_static", + "libc", + "ron", + "serde", "tokio", "zenoh-collections", + "zenoh-macros", "zenoh-result", ] [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "serde", "shared_memory", @@ -3392,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "event-listener 4.0.0", "futures", @@ -3406,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "futures", "tokio", @@ -3419,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-trait", "flume", @@ -3452,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#4f42ce780da20bd2a08c06bf5cbb5d6ad7db031d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" dependencies = [ "async-std", "async-trait", @@ -3494,6 +3516,6 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" From ea99d6b9d8e5f9ed65099f8537f07078f122b82e Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 26 Apr 2024 15:52:44 +0200 Subject: [PATCH 021/397] build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4cdc65e7..47aee08cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ad58af6c93babe0e4310b37e04dae7bc9523e246" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" dependencies = [ "async-std", "async-trait", From df1e1bcf98e88d8866a91058b9998d7c5dd96510 Mon Sep 17 00:00:00 2001 From: "ChenYing Kuo (CY)" Date: Mon, 29 Apr 2024 15:48:00 +0800 Subject: [PATCH 022/397] Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo --- README.md | 227 +++++++++++++++++++++++++++++------------------------- 1 file changed, 124 insertions(+), 103 deletions(-) diff --git a/README.md b/README.md index 502f21853..a2551c5d7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ [![License](https://img.shields.io/badge/License-EPL%202.0-blue)](https://choosealicense.com/licenses/epl-2.0/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) - # Eclipse Zenoh The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute. @@ -17,171 +16,178 @@ Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and computations Check the website [zenoh.io](http://zenoh.io) and the [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed information. ------------------------------- + # C API This repository provides a C binding based on the main [Zenoh implementation written in Rust](https://github.com/eclipse-zenoh/zenoh). ------------------------------- + ## How to build it > :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active development. When you build from git, make sure you also build from git any other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.). It may happen that some changes in git are not compatible with the most recent packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in maintaining compatibility between the various git repositories in the Zenoh project. 1. Make sure that [Rust](https://www.rust-lang.org) is available on your platform. - Please check [here](https://www.rust-lang.org/tools/install) to learn how to install it. - If you already have the Rust toolchain installed, make sure it is up-to-date with: - ```bash - $ rustup update - ``` + Please check [here](https://www.rust-lang.org/tools/install) to learn how to install it. + If you already have the Rust toolchain installed, make sure it is up-to-date with: + + ```bash + rustup update + ``` -3. Clone the [source] with `git`: +2. Clone the [source] with `git`: ```bash git clone https://github.com/eclipse-zenoh/zenoh-c.git ``` -[source]: https://github.com/eclipse-zenoh/zenoh-c + [source]: https://github.com/eclipse-zenoh/zenoh-c 3. Build: - Good CMake practice is to perform build outside of source directory, leaving source tree untouched. The examples below demonstrates this mode of building. On the other hand VScode by default creates build directory named 'build' inside source tree. In this case build script slightly changes its behavior. See more about it in section 'VScode'. + Good CMake practice is to perform build outside of source directory, leaving source tree untouched. The examples below demonstrates this mode of building. On the other hand VScode by default creates build directory named 'build' inside source tree. In this case build script slightly changes its behavior. See more about it in section 'VScode'. - By default build configuration is set to `Release`, it's not necessary to add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your platform uses multi-config generator by default (this is the case on Windows), you may need to add option `--config Release` on build step. See more in CMake [build-configurations] documentation. Option`--config Release` is skipped in further examples for brewity. It's actually necessary for [Visual Studio generators] only. For [Ninja Multi-Config] the build script is able to select `Release` as the default configuration. + By default build configuration is set to `Release`, it's not necessary to add `-DCMAKE_BUILD_TYPE=Release` option on configuration step. But if your platform uses multi-config generator by default (this is the case on Windows), you may need to add option `--config Release` on build step. See more in CMake [build-configurations] documentation. Option`--config Release` is skipped in further examples for brewity. It's actually necessary for [Visual Studio generators] only. For [Ninja Multi-Config] the build script is able to select `Release` as the default configuration. - ```bash - $ mkdir -p build && cd build - $ cmake ../zenoh-c - $ cmake --build . --config Release - ``` + ```bash + mkdir -p build && cd build + cmake ../zenoh-c + cmake --build . --config Release + ``` - The generator to use is selected with option `-G`. If Ninja is installed on your system, adding `-GNinja` to `cmake` command can greatly speed up the build time: + The generator to use is selected with option `-G`. If Ninja is installed on your system, adding `-GNinja` to `cmake` command can greatly speed up the build time: - ```bash - $ cmake ../zenoh-c -GNinja - $ cmake --build . + ```bash + cmake ../zenoh-c -GNinja + cmake --build . ``` -[build-configurations]: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations -[Visual Studio generators]: https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14 -[Ninja]: https://cmake.org/cmake/help/latest/generator/Ninja.html -[Ninja Multi-Config]: https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html + [build-configurations]: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations + [Visual Studio generators]: https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14 + [Ninja Multi-Config]: https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html -3. Install: +4. Install: - To install zenoh-c library into system just build target `install`. You need root privileges to do it, as the default install location is `/usr/local`. + To install zenoh-c library into system just build target `install`. You need root privileges to do it, as the default install location is `/usr/local`. - ```bash - $ cmake --build . --target install - ``` + ```bash + cmake --build . --target install + ``` - If you want to install zenoh-c libraries locally, you can set the installation directory with `CMAKE_INSTALL_PREFIX` + If you want to install zenoh-c libraries locally, you can set the installation directory with `CMAKE_INSTALL_PREFIX` - ```bash - $ cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local - $ cmake --build . --target install - ``` + ```bash + cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local + cmake --build . --target install + ``` - By default only dynamic library is installed. Set `ZENOHC_INSTALL_STATIC_LIBRARY` variable to true to install static library also: + By default only dynamic library is installed. Set `ZENOHC_INSTALL_STATIC_LIBRARY` variable to true to install static library also: - ```bash - $ cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DZENOHC_INSTALL_STATIC_LIBRARY=TRUE - $ cmake --build . --target install - ``` + ```bash + cmake ../zenoh-c -DCMAKE_INSTALL_PREFIX=~/.local -DZENOHC_INSTALL_STATIC_LIBRARY=TRUE + cmake --build . --target install + ``` + + The result of installation is the header files in `include` directory, the library files in `lib` directory and cmake package configuration files for package `zenohc` in `lib/cmake` directory. The library later can be loaded with CMake command `find_package(zenohc)`. + Add dependency in CMakeLists.txt on target - The result of installation is the header files in `include` directory, the library files in `lib` directory and cmake package configuration files for package `zenohc` in `lib/cmake` directory. The library later can be loaded with CMake command `find_package(zenohc)`. - Add dependency in CMakeLists.txt on target - - `zenohc::shared` for linking dynamic library - - `zenohc::static` for linking static library - - `zenohc::lib` for linking static or dynamic library depending on boolean variable `ZENOHC_LIB_STATIC` + - `zenohc::shared` for linking dynamic library + - `zenohc::static` for linking static library + - `zenohc::lib` for linking static or dynamic library depending on boolean variable `ZENOHC_LIB_STATIC` - For `Debug` configuration the library package `zenohc_debug` is installed side-by-side with release `zenohc` library. Suffix `d` is added to names of library files (libzenohc**d**.so). + For `Debug` configuration the library package `zenohc_debug` is installed side-by-side with release `zenohc` library. Suffix `d` is added to names of library files (libzenohc**d**.so). -4. VScode +5. VScode - When zenoh-c project is opened in VSCode the build directory is set to `build` inside source tree (this is default behavior of Microsoft [CMake Tools]). The project build script detects this situation. In this case it places build files in `target` directory and `Cargo.toml` file (which is generated from `Cargo.toml.in`) into the root of source tree, as the rust developers used to and as the rust build tools expects by default. This behavior also can be explicitly enabled by setting `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`. + When zenoh-c project is opened in VSCode the build directory is set to `build` inside source tree (this is default behavior of Microsoft [CMake Tools]). The project build script detects this situation. In this case it places build files in `target` directory and `Cargo.toml` file (which is generated from `Cargo.toml.in`) into the root of source tree, as the rust developers used to and as the rust build tools expects by default. This behavior also can be explicitly enabled by setting `ZENOHC_BUILD_IN_SOURCE_TREE` variable to `TRUE`. -[CMake Tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools + [CMake Tools]: https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools ## Building the Examples - The examples can be built in two ways. One is to select `examples` as a build target of zenoh-c project (assuming here that the current directory is side-by-side with zenoh-c directory): +The examples can be built in two ways. One is to select `examples` as a build target of zenoh-c project (assuming here that the current directory is side-by-side with zenoh-c directory): - ```bash - $ cmake ../zenoh-c - $ cmake --build . --target examples - ``` +```bash +cmake ../zenoh-c +cmake --build . --target examples +``` - You may also use `--target ` if you wish to only build a specific example. +You may also use `--target ` if you wish to only build a specific example. - All build artifacts will be in the `target/release/examples` directory in this case. +All build artifacts will be in the `target/release/examples` directory in this case. - Second way is to directly build `examples` as a root project: +The second way is to directly build `examples` as a root project: - ```bash - $ cmake ../zenoh-c/examples - $ cmake --build . - ``` +```bash +cmake ../zenoh-c/examples +cmake --build . +``` - In this case the examples executables will be built in the current directory. +In this case, the examples executables will be built in the current directory. - As a root project the `examples` project links `zenoh-c` with CMake's [add_subdirectory] command by default. There are also other ways to link `zenoh-c` - with [find_package] or [FetchContent]: +As a root project the `examples` project links `zenoh-c` with CMake's [add_subdirectory] command by default. There are also other ways to link `zenoh-c` - with [find_package] or [FetchContent]: [add_subdirectory]: https://cmake.org/cmake/help/latest/command/add_subdirectory.html [find_package]: https://cmake.org/cmake/help/latest/command/find_package.html [FetchContent]: https://cmake.org/cmake/help/latest/module/FetchContent.html - Link with `zenoh-c` installed into default location in the system (with [find_package]): +Link with `zenoh-c` installed into default location in the system (with [find_package]): - ```bash - $ cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE - ``` +```bash +cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE +``` - Link with `zenoh-c` installed in `~/.local` directory: +Link with `zenoh-c` installed in `~/.local` directory: - ```bash - $ cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE -DCMAKE_INSTALL_PREFIX=~/.local - ``` +```bash +cmake ../zenoh-c/examples -DZENOHC_SOURCE=PACKAGE -DCMAKE_INSTALL_PREFIX=~/.local +``` - Download specific `zenoh-c` version from git with [FetchContent]: +Download specific `zenoh-c` version from git with [FetchContent]: - ```bash - $ cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.8.0-rc - ``` +```bash +cmake ../zenoh-c/examples -DZENOHC_SOURCE=GIT_URL -DZENOHC_GIT_TAG=0.11.0-rc +``` - See also `configure_include_project` function in [helpers.cmake] for more information +See also `configure_include_project` function in [helpers.cmake] for more information [helpers.cmake]: cmake/helpers.cmake ## Running the Examples ### Basic Pub/Sub Example + ```bash -$ ./target/release/examples/z_sub +./target/release/examples/z_sub ``` ```bash -$ ./target/release/examples/z_pub +./target/release/examples/z_pub ``` ### Queryable and Query Example + ```bash -$ ./target/release/examples/z_queryable +./target/release/examples/z_queryable ``` ```bash -$ ./target/release/examples/z_get +./target/release/examples/z_get ``` -## Running the Throughput Examples +### Running the Throughput Examples + ```bash -$ ./target/release/examples/z_sub_thr +./target/release/examples/z_sub_thr ``` ```bash -$ ./target/release/examples/z_pub_thr +./target/release/examples/z_pub_thr ``` ## API conventions -Many of the types exposed by the `zenoh-c` API are types for which destruction is necessary. To help you spot these types, we named them with the convention that any destructible type must start by `z_owned`. + +Most of the types exposed by the `zenoh-c` API are types for which destruction is necessary. To help you spot these types, we name them with the convention that any destructible type must start by `z_owned`. For maximum performance, we try to make as few copies as possible. Sometimes, this implies moving data that you `z_owned`. Any function that takes a non-const pointer to a `z_owned` type will perform its destruction. To make this pattern more obvious, we encourage you to use the `z_move` macro instead of a simple `&` to create these pointers. Rest assured that all `z_owned` types are double-free safe, and that you may check whether any `z_owned_X_t` typed value is still valid by using `z_X_check(&val)`, or the `z_check(val)` macro if you're using C11. @@ -194,34 +200,39 @@ Note that some `z_X_t` typed values can be constructed without needing to `z_bor The examples have been written with C11 in mind, using the conventions we encourage you to follow. Finally, we strongly advise that you refrain from using structure field that starts with `_`: -* We try to maintain a common API between `zenoh-c` and [`zenoh-pico`](https://github.com/eclipse-zenoh/zenoh-pico), such that porting code from one to the other is, ideally, trivial. However, some types must have distinct representations in either library, meaning that using these representations explicitly will get you in trouble when porting. -* We reserve the right to change the memory layout of any type which has `_`-prefixed fields, so trying to use them might cause your code to break on updates. + +- We try to maintain a common API between `zenoh-c` and [`zenoh-pico`](https://github.com/eclipse-zenoh/zenoh-pico), such that porting code from one to the other is, ideally, trivial. However, some types must have distinct representations in either library, meaning that using these representations explicitly will get you in trouble when porting. +- We reserve the right to change the memory layout of any type which has `_`-prefixed fields, so trying to use them might cause your code to break on updates. ## Logging + By default, zenoh-c enables Zenoh's logging library upon using the `z_open` or `z_scout` functions. This behavior can be disabled by adding `-DDISABLE_LOGGER_AUTOINIT:bool=true` to the `cmake` configuration command. The logger may then be manually re-enabled with the `zc_init_logger` function. ## Cross-Compilation -* The following alternative options have been introduced to facilitate cross-compilation. + +The following alternative options have been introduced to facilitate cross-compilation. > :warning: **WARNING** :warning: : Perhaps additional efforts are necessary, that will depend of your environment. -- `-DZENOHC_CARGO_CHANNEL=nightly|beta|stable`: refers to a specific rust toolchain release [`rust-channels`] https://rust-lang.github.io/rustup/concepts/channels.html -- `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation. [`cargo flags`] https://doc.rust-lang.org/cargo/commands/cargo-build.html -- `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust support several Tire-1, Tire-2 and Tire-3 targets [`targets`] https://doc.rust-lang.org/nightly/rustc/platform-support.html. But keep in mind that zenoh-c only have support for following targets: `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`, `arm-unknown-linux-gnueabi` +- `-DZENOHC_CARGO_CHANNEL="+nightly"|"+beta"|"+stable"`: refers to a specific rust toolchain release [[rust-channels](https://rust-lang.github.io/rustup/concepts/channels.html)] +- `-DZENOHC_CARGO_FLAGS`: several optional flags can be used for compilation. [[cargo flags](https://doc.rust-lang.org/cargo/commands/cargo-build.html)] +- `-DZENOHC_CUSTOM_TARGET`: specifies a crosscompilation target. Currently rust support several Tire-1, Tire-2 and Tire-3 targets [[targets](https://doc.rust-lang.org/nightly/rustc/platform-support.html)]. But keep in mind that zenoh-c only have support for following targets: `aarch64-unknown-linux-gnu`, `x86_64-unknown-linux-gnu`, `arm-unknown-linux-gnueabi` -Lets put all together in an example: +Let's put all together in an example: Assuming you want to crosscompile for aarch64-unknown-linux-gnu. -1. install required packages - - `sudo apt install gcc-aarch64-linux-gnu` -2. *(Only if you use `nightly` ) - - `rustup component add rust-src --toolchain nightly` -3. Compile Zenoh-C. Assume that it's in 'zenoh-c' directory. Notice that build in this sample is performed outside of source directory - ```bash - $ export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar" - $ mkdir -p build && cd build - $ cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL=nightly -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort" -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu" -DCMAKE_INSTALL_PREFIX=../aarch64/stage - $ cmake --build . --target install - ``` +1. Install required packages + - `sudo apt install gcc-aarch64-linux-gnu` +2. *(Only if you're using `nightly`) + - `rustup component add rust-src --toolchain nightly` +3. Compile Zenoh-C. Assume that it's in `zenoh-c` directory. Notice that build in this sample is performed outside of source directory + + ```bash + export RUSTFLAGS="-Clinker=aarch64-linux-gnu-gcc -Car=aarch64-linux-gnu-ar" + mkdir -p build && cd build + cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+nightly" -DZENOHC_CARGO_FLAGS="-Zbuild-std=std,panic_abort" -DZENOHC_CUSTOM_TARGET="aarch64-unknown-linux-gnu" -DCMAKE_INSTALL_PREFIX=../aarch64/stage + cmake --build . --target install + ``` + Additionally you can use `RUSTFLAGS` environment variable for lead the compilation. If all goes right the building files will be located at: @@ -229,13 +240,23 @@ If all goes right the building files will be located at: and release files will be located at `/path/to/zenoh-c/target/aarch64-unknown-linux-gnu/release` +## Rust Version + +The Rust version we use is defined in [rust-toolchain.toml](rust-toolchain.toml), which is `1.72.0`. +There might be some memory mapping issue if you use the later version. + +You can also specify the Rust version. + +```bash +cmake ../zenoh-c -DZENOHC_CARGO_CHANNEL="+1.72.0" +``` + ## Zenoh features support (enabling/disabling protocols, etc) It's necessary sometimes to build zenoh-c library with set of features different from default. For example: enable TCP and UDP only. This can be done by changing `ZENOHC_CARGO_FLAGS` parameter for cmake (notice ";" instead of space due to cmake peculiarities) -Available features can be found in zenoh sources: https://github.com/eclipse-zenoh/zenoh/blob/main/zenoh/Cargo.toml +Available features can be found in Zenoh [Cargo.toml](https://github.com/eclipse-zenoh/zenoh/blob/main/zenoh/Cargo.toml) -``` +```bash cmake ../zenoh-c -DZENOHC_CARGO_FLAGS="--no-default-features;--features=zenoh/transport_tcp,zenoh/transport_udp" ``` - From be60ca4eb89870c3c839b6f54b369d5f847af134 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:55:49 +0200 Subject: [PATCH 023/397] build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 47aee08cd..089fb906a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e8916bf3ce3e3418b953eccd58f2aa1482839257" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" dependencies = [ "async-std", "async-trait", From bb66369c1b56d9a9a257f93a3d576ed7602d6ef9 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 30 Apr 2024 13:14:45 +0200 Subject: [PATCH 024/397] build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 089fb906a..b918c43f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ea604b6a7298eca0dc0731ddc5d2311665a10e6b" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" dependencies = [ "async-std", "async-trait", From 8ff01c81c15e3d849a2e047ac34ccc092feb47c5 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 3 May 2024 02:36:39 +0200 Subject: [PATCH 025/397] build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b918c43f8..743222cc4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#371ca6b65a5434f6deb2761f0aa24944bfb37636" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" dependencies = [ "async-std", "async-trait", From 4681f57a5458e0207cf1bfa8da0c0645d1e24fe1 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Sat, 4 May 2024 02:37:42 +0200 Subject: [PATCH 026/397] build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 743222cc4..cd2cf4159 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7a4744576e21c85d31b1527b2c4bf2230e5152e8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" dependencies = [ "async-std", "async-trait", From 4be7f24c8cc6b850bec6cae830bdca046a88c80a Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Sun, 5 May 2024 02:37:52 +0200 Subject: [PATCH 027/397] build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd2cf4159..63b4a790d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f5195c04c403058c8aa1537b6a539037d476e649" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" dependencies = [ "async-std", "async-trait", From 71e15dc5d5b7a701408b5e0d395edc328b06bd94 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 7 May 2024 02:37:24 +0200 Subject: [PATCH 028/397] build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63b4a790d..2af52b0e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e53364f30717912fbef99cb16e26e59733097b58" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" dependencies = [ "async-std", "async-trait", From 6e161ac9226fb14e64477dcccff77ae919f23b14 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 8 May 2024 02:37:51 +0200 Subject: [PATCH 029/397] build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2af52b0e9..0bc94c10e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7e5d5e8f1822eb655f3a3a852286ead9cdaec5ab" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" dependencies = [ "async-std", "async-trait", From dae17688056d85c83a994635ebc44cf494e74fd8 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 14 May 2024 02:39:04 +0200 Subject: [PATCH 030/397] build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0bc94c10e..c834d441a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b8dd01d6ce05f851f33497e8d899df308d315afb" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" dependencies = [ "async-std", "async-trait", From e031818d8c4b4901d7c1d2d9fbcbac9c18c59e70 Mon Sep 17 00:00:00 2001 From: Jochen Sprickerhof Date: Mon, 13 May 2024 14:14:21 +0200 Subject: [PATCH 031/397] Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). --- install/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 4e935729c..414373edc 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -74,5 +74,5 @@ endforeach() # # Install lib files # -install_zenohc_lib("Release;RelWithDebInfo;MinSizeRel" "RELEASE" zenohc) -install_zenohc_lib("Debug" "DEBUG" zenohc_debug) \ No newline at end of file +install_zenohc_lib("Release;RelWithDebInfo;MinSizeRel;None" "RELEASE" zenohc) +install_zenohc_lib("Debug" "DEBUG" zenohc_debug) From a3fcc45b8e45978d74cbd4ccc1cb94d4778705ce Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 14 May 2024 16:14:09 +0200 Subject: [PATCH 032/397] build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c834d441a..33dcbc2d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#45e05f0e9375b03b7765bcdd5df399ac9136ac04" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" dependencies = [ "async-std", "async-trait", From 87c839548688f17782c2b55cb1455a3c5a1a1be6 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Thu, 16 May 2024 02:38:38 +0200 Subject: [PATCH 033/397] build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33dcbc2d9..490f979ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#763a05f0d61a894cf3cbeb07223e2ea726777325" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" dependencies = [ "async-std", "async-trait", From f3be503b8f68fe3538ceacdd6cde7390a5bbc411 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 22 May 2024 02:37:51 +0200 Subject: [PATCH 034/397] build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 490f979ab..ccf54ce6c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#75aa2739c36533f57b0eef3580256014e445f241" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" dependencies = [ "async-std", "async-trait", From a2f82294195bdb5c2ce5cf100db5b9d40c56861d Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 29 May 2024 02:38:17 +0200 Subject: [PATCH 035/397] build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ccf54ce6c..613df0624 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#25f06bd9e71b4dbed5ba8d75eaa1708693e7b9ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" dependencies = [ "async-std", "async-trait", From 01490ac005e9645cd155b0df0ea6ea601e8adf9a Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 31 May 2024 02:38:39 +0200 Subject: [PATCH 036/397] build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 613df0624..ec79a8969 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#3118d31b8c83343ac4dc990ae1bbdc59aa62f103" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" dependencies = [ "async-std", "async-trait", From 68ba0ad95ceed39b94a331b636cbe8676deae704 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 4 Jun 2024 02:38:20 +0200 Subject: [PATCH 037/397] build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec79a8969..998112597 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#009f66612fe01953d8f75e9d92f1e8c79ffd2a74" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" dependencies = [ "async-std", "async-trait", From 8f37fe5d6a097401985fb7ca517687e1058cd6e8 Mon Sep 17 00:00:00 2001 From: Diogo Matsubara Date: Tue, 4 Jun 2024 11:25:23 +0200 Subject: [PATCH 038/397] chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d60a3b63f..8d0d841e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: run: cargo test --verbose --release --features=logger-autoinit --features=shared-memory - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: # Artifact name name: zenoh-c-${{ matrix.os }} From 889cee1590a57ee31e2fd41386d0159cfb63cd80 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Thu, 6 Jun 2024 02:39:16 +0200 Subject: [PATCH 039/397] build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 998112597..1715f9191 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d574654c618bf62f7baf9754f7c258d1b46f6465" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" dependencies = [ "async-std", "async-trait", From 3504aa5bd127121106fb77cfc161033c66347ed3 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 11 Jun 2024 02:39:52 +0200 Subject: [PATCH 040/397] build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1715f9191..474b4eb05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2976,7 +2976,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3027,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3059,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "serde", "tracing", @@ -3072,12 +3072,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "flume", "json5", @@ -3097,7 +3097,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3109,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "aes", "hmac", @@ -3122,7 +3122,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "bincode", "flume", @@ -3143,7 +3143,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3157,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "zenoh-config", @@ -3175,7 +3175,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "flume", @@ -3199,7 +3199,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "base64", @@ -3229,7 +3229,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "tokio", @@ -3247,7 +3247,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "base64", @@ -3275,7 +3275,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3296,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "futures", @@ -3316,7 +3316,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3337,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3348,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "const_format", "libloading", @@ -3364,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "const_format", "rand", @@ -3378,7 +3378,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "anyhow", ] @@ -3386,7 +3386,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3414,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3428,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "futures", "tokio", @@ -3441,7 +3441,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-trait", "flume", @@ -3474,7 +3474,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#c279982c131c556ebd474f4ffa9fd6c096d13830" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" dependencies = [ "async-std", "async-trait", From e7650f882661852bd43b117ed97787bc5165aee4 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 12 Jun 2024 02:37:25 +0200 Subject: [PATCH 041/397] build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 330 +++++++++++++++++++++++++++-------------------------- 1 file changed, 170 insertions(+), 160 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 474b4eb05..df3553b3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -282,9 +282,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -365,6 +365,12 @@ dependencies = [ "libc", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "1.0.0" @@ -419,6 +425,16 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "concurrent-queue" version = "2.2.0" @@ -456,9 +472,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -466,9 +482,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -1002,6 +1018,26 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "js-sys" version = "0.3.64" @@ -1192,7 +1228,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "libc", ] @@ -1213,6 +1249,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint-dig" version = "0.8.4" @@ -1282,9 +1329,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl-probe" @@ -1505,16 +1552,16 @@ dependencies = [ [[package]] name = "quinn" -version = "0.10.2" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" dependencies = [ "bytes", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.7", + "rustls", "thiserror", "tokio", "tracing", @@ -1522,16 +1569,16 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13f81c9a9d574310b8351f8666f5a93ac3b0069c45c28ad52c10291389a7cf9" +checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" dependencies = [ "bytes", "rand", - "ring 0.16.20", + "ring", "rustc-hash", - "rustls 0.21.7", - "rustls-native-certs 0.6.3", + "rustls", + "rustls-platform-verifier", "slab", "thiserror", "tinyvec", @@ -1540,15 +1587,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" +checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" dependencies = [ - "bytes", "libc", + "once_cell", "socket2 0.5.6", "tracing", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1654,21 +1701,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.6" @@ -1679,7 +1711,7 @@ dependencies = [ "getrandom", "libc", "spin 0.9.8", - "untrusted 0.9.0", + "untrusted", "windows-sys 0.48.0", ] @@ -1700,7 +1732,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64", - "bitflags 2.4.2", + "bitflags 2.5.0", "serde", "serde_derive", ] @@ -1768,7 +1800,7 @@ version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys 0.4.13", @@ -1777,42 +1809,19 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.23.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "a218f0f6d05669de4eabfb24f31ce802035c952429d037507b4a4a39f0e60c5b" dependencies = [ "log", - "ring 0.16.20", - "rustls-webpki 0.101.5", - "sct", -] - -[[package]] -name = "rustls" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" -dependencies = [ - "log", - "ring 0.17.6", + "once_cell", + "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki", "subtle", "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.3", - "schannel", - "security-framework", -] - [[package]] name = "rustls-native-certs" version = "0.7.0" @@ -1820,21 +1829,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.0.0", + "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" -dependencies = [ - "base64", -] - [[package]] name = "rustls-pemfile" version = "2.0.0" @@ -1847,29 +1847,46 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.3.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ede67b28608b4c60685c7d54122d4400d90f62b40caee7700e700380a390fa8" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] -name = "rustls-webpki" -version = "0.101.5" +name = "rustls-platform-verifier" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "b5f0d26fa1ce3c790f9590868f0109289a044acb954525f933e2aa3b871c157d" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-roots", + "winapi", ] +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" + [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ - "ring 0.17.6", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -1878,6 +1895,15 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.22" @@ -1917,16 +1943,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "secrecy" version = "0.8.0" @@ -1939,22 +1955,23 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -2336,21 +2353,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.7", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls", "rustls-pki-types", "tokio", ] @@ -2555,12 +2562,6 @@ version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -2658,6 +2659,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2976,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "ahash", "async-trait", @@ -3027,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "zenoh-collections", ] @@ -3059,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "serde", "tracing", @@ -3072,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "flume", "json5", @@ -3097,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-global-executor", "lazy_static", @@ -3109,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "aes", "hmac", @@ -3122,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "bincode", "flume", @@ -3143,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3157,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "zenoh-config", @@ -3175,13 +3186,13 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "flume", "futures", - "rustls 0.22.4", - "rustls-webpki 0.102.2", + "rustls", + "rustls-webpki", "serde", "tokio", "tokio-util", @@ -3199,20 +3210,19 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "base64", "futures", "quinn", - "rustls 0.21.7", - "rustls-native-certs 0.7.0", - "rustls-pemfile 1.0.3", + "rustls", + "rustls-pemfile", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki", "secrecy", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util", "tracing", "webpki-roots", @@ -3229,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "tokio", @@ -3247,18 +3257,18 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "base64", "futures", - "rustls 0.22.4", - "rustls-pemfile 2.0.0", + "rustls", + "rustls-pemfile", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki", "secrecy", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls", "tokio-util", "tracing", "webpki-roots", @@ -3275,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3296,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "futures", @@ -3316,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "futures-util", @@ -3337,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "proc-macro2", "quote", @@ -3348,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "const_format", "libloading", @@ -3364,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "const_format", "rand", @@ -3378,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "anyhow", ] @@ -3386,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "futures", "lazy_static", @@ -3402,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "serde", "shared_memory", @@ -3414,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "event-listener 4.0.0", "futures", @@ -3428,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "futures", "tokio", @@ -3441,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-trait", "flume", @@ -3474,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#d8e66decbe8bd7a1981579fd49ea333c0acd41ff" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" dependencies = [ "async-std", "async-trait", From 5a1728e09d60a093b2abee8b876925184e636067 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Thu, 13 Jun 2024 02:37:15 +0200 Subject: [PATCH 042/397] build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df3553b3c..66080b766 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9d0974289ade917ffe56079479e1ddd598eda494" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" dependencies = [ "async-std", "async-trait", From fd311d76ab61868e05b50c3827d3b6678fc53ea3 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 14 Jun 2024 02:36:30 +0200 Subject: [PATCH 043/397] build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66080b766..1c2ee7539 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#ed6c636a84c00552ca7f7c07d075d5783a40de44" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" dependencies = [ "async-std", "async-trait", From a9521bc0faac8967d57c48520f2c4052ba52187b Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Fri, 14 Jun 2024 08:54:32 +0200 Subject: [PATCH 044/397] Enable releasing from any branch (#456) --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f01fdb560..86b21b5ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,10 @@ on: type: string description: Release number of Zenoh required: false + branch: + type: string + description: Release branch + required: false jobs: tag: @@ -49,6 +53,7 @@ jobs: # However, we still need some placeholder version to test that the # version can be reliably bumped. version: ${{ inputs.version || '0.0.0' }} + branch: ${{ inputs.branch }} github-token: ${{ secrets.BOT_TOKEN_WORKFLOW }} - name: Checkout this repository From 36677888e05a0b98d69eaca91fb4bb06d75a799a Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Sat, 15 Jun 2024 02:36:55 +0200 Subject: [PATCH 045/397] build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c2ee7539..5fad99c31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#8160b019a06bcd4a6cabcd114dbb901f65e2dc93" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" dependencies = [ "async-std", "async-trait", From 548ee8dde0f53a58c06e68a2949949b31140c36c Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Mon, 17 Jun 2024 15:32:58 +0200 Subject: [PATCH 046/397] Update to latest zenoh --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5fad99c31..22eca2d00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#7adad9482f8d27fab56ca54aa053de4cc2f63557" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" dependencies = [ "async-std", "async-trait", From f9b4664abaa8e941a629e33882f79c38a281a338 Mon Sep 17 00:00:00 2001 From: Mahmoud Mazouz Date: Wed, 19 Jun 2024 16:49:42 +0200 Subject: [PATCH 047/397] Replace `-rc` with `-pre` and document versioning (#466) --- CMakeLists.txt | 2 +- README.md | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6dd057a0a..c8e4e542a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ if(NOT DEFINED PROJECT_VERSION_TWEAK) elseif(PROJECT_VERSION_TWEAK EQUAL 0) set(project_version "${project_version}-dev") elseif(PROJECT_VERSION_TWEAK GREATER 1) - set(project_version "${project_version}-rc.${PROJECT_VERSION_TWEAK}") + set(project_version "${project_version}-pre.${PROJECT_VERSION_TWEAK}") endif() status_print(project_version) diff --git a/README.md b/README.md index a2551c5d7..3da32ebbc 100644 --- a/README.md +++ b/README.md @@ -260,3 +260,16 @@ Available features can be found in Zenoh [Cargo.toml](https://github.com/eclipse ```bash cmake ../zenoh-c -DZENOHC_CARGO_FLAGS="--no-default-features;--features=zenoh/transport_tcp,zenoh/transport_udp" ``` + +## Versioning + +Being a CMake project, zenoh-c is limited to the `MAJOR.MINOR.PATCH.TWEAK` version scheme [inherent +to CMake](https://gitlab.kitware.com/cmake/cmake/-/issues/16716). However, zenoh-c also incorporates +a Cargo package which cannot be versionned with the `MAJOR.MINOR.PATCH.TWEAK` version scheme (not +SemVer compatible). Hence zenoh-c uses a one-to-one mapping between CMake versions and SemVer versions: + +| CMake version | SemVer equivalent | Meaning | +|-------------------------|-------------------|----------------------| +| `1.2.3` | `1.2.3` | Release version | +| `1.2.3.0` | `1.2.3-dev` | Developement version | +| `1.2.3.x if x >= 1` | `1.2.3-pre.x` | Pre-release version | From a98d700e994598fe3d26f47c417d397b66902ead Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 21 Jun 2024 02:37:34 +0200 Subject: [PATCH 048/397] build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22eca2d00..0c703f282 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#93f93d2d67f25886a25e83922a534694c2135669" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" dependencies = [ "async-std", "async-trait", From 9043dc6df30641fe804ddbb01539041034e3a627 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 3 Jul 2024 02:36:42 +0200 Subject: [PATCH 049/397] build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c703f282..2eaae4972 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2500e5a62d8940cbfbc36f27c07360f91ba28c2d" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" dependencies = [ "async-std", "async-trait", From 8552972a72784560cd7762bd82cfe8852fdb27d6 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Thu, 4 Jul 2024 02:36:46 +0200 Subject: [PATCH 050/397] build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2eaae4972..51094e873 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#869ace655e7b324b9a76e004f21b3b6f69a6b338" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" dependencies = [ "async-std", "async-trait", From 775e66586d105cbb42882ace58286f0cb2d967b2 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:37:50 +0200 Subject: [PATCH 051/397] build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51094e873..f54ad6f6a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b93ca8494aa7fabfab22583cb0e23b5e5d9e905e" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" dependencies = [ "async-std", "async-trait", From 4ea609d4a4761d48fdcf5a6e3d63f60943c83509 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 17 Jul 2024 11:10:47 +0200 Subject: [PATCH 052/397] Ensure that find_package(zenohc) can be called two times (#470) --- install/PackageConfig.cmake.in | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/install/PackageConfig.cmake.in b/install/PackageConfig.cmake.in index 13fd98f5d..fe88a38ff 100644 --- a/install/PackageConfig.cmake.in +++ b/install/PackageConfig.cmake.in @@ -23,29 +23,35 @@ if(_IMPORT_PREFIX STREQUAL "/") set(_IMPORT_PREFIX "") endif() -add_library(__zenohc_static STATIC IMPORTED GLOBAL) -add_library(zenohc::static ALIAS __zenohc_static) -target_link_libraries(__zenohc_static INTERFACE @NATIVE_STATIC_LIBS@) -set_target_properties(__zenohc_static PROPERTIES - IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@STATICLIB@" - INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@" -) +if(NOT TARGET __zenohc_static) + add_library(__zenohc_static STATIC IMPORTED GLOBAL) + add_library(zenohc::static ALIAS __zenohc_static) + target_link_libraries(__zenohc_static INTERFACE @NATIVE_STATIC_LIBS@) + set_target_properties(__zenohc_static PROPERTIES + IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@STATICLIB@" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@" + ) +endif() -add_library(__zenohc_shared SHARED IMPORTED GLOBAL) -add_library(zenohc::shared ALIAS __zenohc_shared) -set_target_properties(__zenohc_shared PROPERTIES - IMPORTED_NO_SONAME TRUE - INTERFACE_COMPILE_DEFINITION ZENOHC_DYN_LIB - IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@DYLIB@" - INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@" -) +if(NOT TARGET __zenohc_shared) + add_library(__zenohc_shared SHARED IMPORTED GLOBAL) + add_library(zenohc::shared ALIAS __zenohc_shared) + set_target_properties(__zenohc_shared PROPERTIES + IMPORTED_NO_SONAME TRUE + INTERFACE_COMPILE_DEFINITION ZENOHC_DYN_LIB + IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@DYLIB@" + INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@" + ) +endif() if(NOT ("@IMPLIB@" STREQUAL "")) set_property(TARGET __zenohc_shared PROPERTY IMPORTED_IMPLIB "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@IMPLIB@") endif() -if(ZENOHC_LIB_STATIC) +if(NOT TARGET zenohc::lib) + if(ZENOHC_LIB_STATIC) add_library(zenohc::lib ALIAS __zenohc_static) -else() + else() add_library(zenohc::lib ALIAS __zenohc_shared) + endif() endif() From 9c25f8d5794cad0fb848bb2233e2355947169f52 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Wed, 17 Jul 2024 11:11:42 +0200 Subject: [PATCH 053/397] Update CMakeLists.txt (#473) --- tests/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 21695a439..12b55c326 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,6 +2,8 @@ message(STATUS "zenoh-c tests") add_custom_target(tests) +find_package(Threads REQUIRED) + file(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/*.c") foreach(file ${files}) get_filename_component(target ${file} NAME_WE) @@ -20,7 +22,7 @@ foreach(file ${files}) add_executable(${target} EXCLUDE_FROM_ALL ${file}) add_dependencies(tests ${target}) add_dependencies(${target} zenohc::lib) - target_link_libraries(${target} PRIVATE zenohc::lib) + target_link_libraries(${target} PRIVATE zenohc::lib Threads::Threads) copy_dlls(${target}) set_property(TARGET ${target} PROPERTY C_STANDARD 11) add_test(NAME "${test_type}_${target}" COMMAND ${target}) From c75ce16e855e8b1f0562523cdf6be6c37f4ebb56 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 18 Jul 2024 12:52:30 +0200 Subject: [PATCH 054/397] Install zenohc.dll in /bin on Windows (#471) --- install/CMakeLists.txt | 10 +++++++++- install/PackageConfig.cmake.in | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/install/CMakeLists.txt b/install/CMakeLists.txt index 414373edc..f297b5cdc 100644 --- a/install/CMakeLists.txt +++ b/install/CMakeLists.txt @@ -23,7 +23,15 @@ function(install_zenohc_lib configurations property_postfix package_name) get_filename_component(STATICLIB ${staticlib_path} NAME) # Install dynamic, import and static library - install(FILES ${dylib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${configurations}) + + # On Windows .dll need to be installed in ${CMAKE_INSTALL_BINDIR}, + # while on Linux and macOS .so and .dylib need to be installed in ${CMAKE_INSTALL_LIBDIR} + if(WIN32) + set(ZENOHC_INSTALL_DYLIBDIR ${CMAKE_INSTALL_BINDIR}) + else() + set(ZENOHC_INSTALL_DYLIBDIR ${CMAKE_INSTALL_LIBDIR}) + endif() + install(FILES ${dylib_path} DESTINATION ${ZENOHC_INSTALL_DYLIBDIR} CONFIGURATIONS ${configurations}) if(DEFINED implib_path) install(FILES ${implib_path} DESTINATION ${CMAKE_INSTALL_LIBDIR} CONFIGURATIONS ${configurations}) endif() diff --git a/install/PackageConfig.cmake.in b/install/PackageConfig.cmake.in index fe88a38ff..f0257214b 100644 --- a/install/PackageConfig.cmake.in +++ b/install/PackageConfig.cmake.in @@ -39,7 +39,7 @@ if(NOT TARGET __zenohc_shared) set_target_properties(__zenohc_shared PROPERTIES IMPORTED_NO_SONAME TRUE INTERFACE_COMPILE_DEFINITION ZENOHC_DYN_LIB - IMPORTED_LOCATION "${_IMPORT_PREFIX}/@CMAKE_INSTALL_LIBDIR@/@DYLIB@" + IMPORTED_LOCATION "${_IMPORT_PREFIX}/@ZENOHC_INSTALL_DYLIBDIR@/@DYLIB@" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/@CMAKE_INSTALL_INCLUDEDIR@" ) endif() From 0530a2d2e6163b2211707dfc22334a1658b650e1 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Fri, 26 Jul 2024 02:38:37 +0200 Subject: [PATCH 055/397] build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f54ad6f6a..b697cfb31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#b3e42cef38f6227a87a26725d0479bcf9ace69a9" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" dependencies = [ "async-std", "async-trait", From f3c364053278deb5949b5b34811e822d240dabb9 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Sat, 27 Jul 2024 02:38:14 +0200 Subject: [PATCH 056/397] build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b697cfb31..a97c1e2b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#0a969cb8bbb670a02b16c0373b133b00d58f1aaf" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" dependencies = [ "async-std", "async-trait", From 6bcc17d17aa5fc28e5a8c45bfe3f3bb1f18a8f27 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 30 Jul 2024 02:37:36 +0200 Subject: [PATCH 057/397] build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a97c1e2b5..34d604241 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e587aa9ce43af6cb78bbe418f478804218f7b19f" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" dependencies = [ "async-std", "async-trait", From 30e3f1f09dee6c25c1f409960c119db64b7a7c5c Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 6 Aug 2024 02:36:48 +0200 Subject: [PATCH 058/397] build: Sync with eclipse-zenoh/zenoh@f47354c from 2024-08-05 (#572) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34d604241..007e01fcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#2d88c7bdcc46c58a7fbdb67397841452ac8f60ec" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" dependencies = [ "async-std", "async-trait", From 63e78ec10ba5f9a23deabcfd9813a0f1d8abf856 Mon Sep 17 00:00:00 2001 From: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Date: Thu, 8 Aug 2024 11:43:09 +0200 Subject: [PATCH 059/397] Logging (#580) * renamed zc_init_logger -> zc_init_logging; added support for providing custom callbacks for logging messages; * format * clippy * add missing dependency --- Cargo.lock | 1 + Cargo.toml | 1 + Cargo.toml.in | 1 + README.md | 2 +- build-resources/opaque-types/src/lib.rs | 1 - docs/api.rst | 16 +++ include/zenoh_commons.h | 97 +++++++++++++- include/zenoh_macros.h | 11 ++ splitguide.yaml | 1 + src/closures/log_closure.rs | 167 ++++++++++++++++++++++++ src/closures/mod.rs | 3 + src/lib.rs | 32 ++++- src/scouting.rs | 4 +- src/session.rs | 6 +- tests/z_api_alignment_test.c | 2 +- tests/z_api_config_test.c | 2 +- tests/z_api_double_drop_test.c | 2 +- tests/z_api_drop_options.c | 2 +- 18 files changed, 336 insertions(+), 15 deletions(-) create mode 100644 src/closures/log_closure.rs diff --git a/Cargo.lock b/Cargo.lock index c6557bf0e..019cb2a50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3683,6 +3683,7 @@ dependencies = [ "unwrap-infallible", "zenoh", "zenoh-ext", + "zenoh-util", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index ce05412b4..e794d8262 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,7 @@ unwrap-infallible = "0.1.5" const_format = "0.2.32" zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" [build-dependencies] diff --git a/Cargo.toml.in b/Cargo.toml.in index 34d98ecfd..42a2b0eb3 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -54,6 +54,7 @@ unwrap-infallible = "0.1.5" const_format = "0.2.32" zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" [build-dependencies] diff --git a/README.md b/README.md index 7093c9436..5ff72b19a 100644 --- a/README.md +++ b/README.md @@ -213,7 +213,7 @@ Finally, we strongly advise that you refrain from using structure field that sta ## Logging -By default, zenoh-c enables Zenoh's logging library upon using the `z_open` or `z_scout` functions. This behavior can be disabled by adding `-DDISABLE_LOGGER_AUTOINIT:bool=true` to the `cmake` configuration command. The logger may then be manually re-enabled with the `zc_init_logger` function. +By default, zenoh-c enables Zenoh's logging library upon using the `z_open` or `z_scout` functions. This behavior can be disabled by adding `-DDISABLE_LOGGER_AUTOINIT:bool=true` to the `cmake` configuration command. The logger may then be manually re-enabled with the `zc_init_logging` function. ## Cross-Compilation diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index b0370ceef..1c1a8b7c6 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -63,7 +63,6 @@ pub struct CSlice { _context: *mut c_void, } - get_opaque_type_data!(CSlice, z_owned_slice_t); /// A contiguous sequence of bytes owned by some other entity. get_opaque_type_data!(CSlice, z_view_slice_t); diff --git a/docs/api.rst b/docs/api.rst index ddfe3e550..f39dc622b 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -877,3 +877,19 @@ Functions .. doxygenfunction:: ze_querying_subscriber_options_default .. doxygenfunction:: zc_reply_keyexpr_default + +Logging +======= + +Types +----- + +.. doxygenstruct:: zc_owned_closure_log_t +.. doxygenstruct:: zc_loaned_closure_log_t +.. doxygenenum:: zc_log_severity_t + +Functions +--------- + +.. doxygenfunction:: zc_init_logging +.. doxygenfunction:: zc_init_logging_with_callback diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index ae89b03b6..31a47cf2a 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -218,6 +218,41 @@ typedef enum zc_locality_t { ZC_LOCALITY_REMOTE = 2, } zc_locality_t; #endif +/** + * Severity level of Zenoh log message. + */ +typedef enum zc_log_severity_t { + /** + * The `trace` level. + * + * Designates very low priority, often extremely verbose, information. + */ + ZC_LOG_SEVERITY_TRACE = 0, + /** + * The "debug" level. + * + * Designates lower priority information. + */ + ZC_LOG_SEVERITY_DEBUG = 1, + /** + * The "info" level. + * + * Designates useful information. + */ + ZC_LOG_SEVERITY_INFO = 2, + /** + * The "warn" level. + * + * Designates hazardous situations. + */ + ZC_LOG_SEVERITY_WARN = 3, + /** + * The "error" level. + * + * Designates very serious errors. + */ + ZC_LOG_SEVERITY_ERROR = 4, +} zc_log_severity_t; /** * Key expressions types to which Queryable should reply to. */ @@ -337,6 +372,30 @@ typedef struct z_owned_closure_hello_t { */ void (*drop)(void *context); } z_owned_closure_hello_t; +/** + * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: + * + * Closures are not guaranteed not to be called concurrently. + * + * It is guaranteed that: + * - `call` will never be called once `drop` has started. + * - `drop` will only be called **once**, and **after every** `call` has ended. + * - The two previous guarantees imply that `call` and `drop` are never called concurrently. + */ +typedef struct zc_owned_closure_log_t { + /** + * An optional pointer to a closure state. + */ + void *context; + /** + * A closure body. + */ + void (*call)(enum zc_log_severity_t severity, const struct z_loaned_string_t *msg, void *context); + /** + * An optional drop function that will be called when the closure is dropped. + */ + void (*drop)(void *context); +} zc_owned_closure_log_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -1549,6 +1608,30 @@ ZENOHC_API void z_closure_hello_null(struct z_owned_closure_hello_t *this_); * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API +void z_closure_log_call(const struct zc_loaned_closure_log_t *closure, + enum zc_log_severity_t severity, + const struct z_loaned_string_t *msg); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_closure_log_check(const struct zc_owned_closure_log_t *this_); +/** + * Drops the closure. Droping an uninitialized closure is a no-op. + */ +ZENOHC_API void z_closure_log_drop(struct zc_owned_closure_log_t *closure); +/** + * Borrows closure. + */ +ZENOHC_API +const struct zc_loaned_closure_log_t *z_closure_log_loan(const struct zc_owned_closure_log_t *closure); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void z_closure_log_null(struct zc_owned_closure_log_t *this_); +/** + * Calls the closure. Calling an uninitialized closure is a no-op. + */ +ZENOHC_API void z_closure_query_call(const struct z_loaned_closure_query_t *closure, const struct z_loaned_query_t *query); /** @@ -4304,12 +4387,22 @@ ZENOHC_API z_result_t zc_config_to_string(const struct z_loaned_config_t *config, struct z_owned_string_t *out_config_string); /** - * Initialises the zenoh runtime logger. + * Initializes the zenoh runtime logger, using rust environment settings. * * Note that unless you built zenoh-c with the `logger-autoinit` feature disabled, * this will be performed automatically by `z_open` and `z_scout`. */ -ZENOHC_API void zc_init_logger(void); +ZENOHC_API void zc_init_logging(void); +/** + * Initializes the zenoh runtime logger with custom callback. + * + * @param min_severity: Minimum severity level of log message to be be passed to the `callback`. + * Messages with lower severity levels will be ignored. + * @param callback: A closure that will be called with each log message severity level and content. + */ +ZENOHC_API +void zc_init_logging_with_callback(enum zc_log_severity_t min_severity, + struct zc_owned_closure_log_t *callback); /** * Constructs default value for `zc_liveliness_declaration_options_t`. */ diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index ce8463d69..01bb9c7be 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -9,6 +9,7 @@ z_owned_bytes_t : z_bytes_loan, \ z_owned_bytes_writer_t : z_bytes_writer_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ + zc_owned_closure_log_t : z_closure_log_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ @@ -56,6 +57,7 @@ z_owned_bytes_t* : z_bytes_drop, \ z_owned_bytes_writer_t* : z_bytes_writer_drop, \ z_owned_closure_hello_t* : z_closure_hello_drop, \ + zc_owned_closure_log_t* : z_closure_log_drop, \ z_owned_closure_query_t* : z_closure_query_drop, \ z_owned_closure_reply_t* : z_closure_reply_drop, \ z_owned_closure_sample_t* : z_closure_sample_drop, \ @@ -91,6 +93,7 @@ z_owned_bytes_t* : z_bytes_null, \ z_owned_bytes_writer_t* : z_bytes_writer_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ + zc_owned_closure_log_t* : z_closure_log_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ @@ -128,6 +131,7 @@ z_owned_bytes_t : z_bytes_check, \ z_owned_bytes_writer_t : z_bytes_writer_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ + zc_owned_closure_log_t : z_closure_log_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ @@ -197,6 +201,7 @@ inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; inline const z_loaned_bytes_writer_t* z_loan(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; +inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return z_closure_log_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; @@ -240,6 +245,7 @@ inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { retu inline void z_drop(z_owned_bytes_t* this_) { return z_bytes_drop(this_); }; inline void z_drop(z_owned_bytes_writer_t* this_) { return z_bytes_writer_drop(this_); }; inline void z_drop(z_owned_closure_hello_t* closure) { return z_closure_hello_drop(closure); }; +inline void z_drop(zc_owned_closure_log_t* closure) { return z_closure_log_drop(closure); }; inline void z_drop(z_owned_closure_query_t* closure) { return z_closure_query_drop(closure); }; inline void z_drop(z_owned_closure_reply_t* closure) { return z_closure_reply_drop(closure); }; inline void z_drop(z_owned_closure_sample_t* closure) { return z_closure_sample_drop(closure); }; @@ -271,6 +277,7 @@ inline void z_drop(z_owned_subscriber_t* this_) { return z_subscriber_drop(this_ inline z_owned_bytes_t* z_move(z_owned_bytes_t& this_) { return (&this_); }; inline z_owned_bytes_writer_t* z_move(z_owned_bytes_writer_t& this_) { return (&this_); }; inline z_owned_closure_hello_t* z_move(z_owned_closure_hello_t& closure) { return (&closure); }; +inline zc_owned_closure_log_t* z_move(zc_owned_closure_log_t& closure) { return (&closure); }; inline z_owned_closure_query_t* z_move(z_owned_closure_query_t& closure) { return (&closure); }; inline z_owned_closure_reply_t* z_move(z_owned_closure_reply_t& closure) { return (&closure); }; inline z_owned_closure_sample_t* z_move(z_owned_closure_sample_t& closure) { return (&closure); }; @@ -302,6 +309,7 @@ inline z_owned_subscriber_t* z_move(z_owned_subscriber_t& this_) { return (&this inline void z_null(z_owned_bytes_t* this_) { return z_bytes_null(this_); }; inline void z_null(z_owned_bytes_writer_t* this_) { return z_bytes_writer_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { return z_closure_hello_null(this_); }; +inline void z_null(zc_owned_closure_log_t* this_) { return z_closure_log_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { return z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { return z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { return z_closure_sample_null(this_); }; @@ -337,6 +345,7 @@ inline void z_null(z_view_string_t* this_) { return z_view_string_null(this_); } inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; inline bool z_check(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; +inline bool z_check(const zc_owned_closure_log_t& this_) { return z_closure_log_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; @@ -468,6 +477,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_writer_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_query_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_reply_t type; }; diff --git a/splitguide.yaml b/splitguide.yaml index a0edc71f2..913b422a8 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -67,6 +67,7 @@ zenoh_opaque.h: - z_loaned_closure_reply_t! - z_loaned_closure_sample_t! - z_loaned_closure_zid_t! + - zc_loaned_closure_log_t! - zc_loaned_closure_matching_status_t!#unstable - z_owned_shm_client_t!#shared-memory#unstable - zc_owned_shm_client_list_t!#shared-memory#unstable diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs new file mode 100644 index 000000000..ff8dd0d13 --- /dev/null +++ b/src/closures/log_closure.rs @@ -0,0 +1,167 @@ +// +// Copyright (c) 2017, 2024 ZettaScale Technology. +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh team, +// + +use std::mem::MaybeUninit; + +use crate::{ + transmute::{LoanedCTypeRef, OwnedCTypeRef}, + z_loaned_string_t, +}; + +#[repr(C)] +#[derive(PartialOrd, PartialEq)] +/// Severity level of Zenoh log message. +pub enum zc_log_severity_t { + /// The `trace` level. + /// + /// Designates very low priority, often extremely verbose, information. + TRACE = 0, + /// The "debug" level. + /// + /// Designates lower priority information. + DEBUG = 1, + /// The "info" level. + /// + /// Designates useful information. + INFO = 2, + /// The "warn" level. + /// + /// Designates hazardous situations. + WARN = 3, + /// The "error" level. + /// + /// Designates very serious errors. + ERROR = 4, +} + +impl From for tracing::Level { + fn from(value: zc_log_severity_t) -> Self { + match value { + zc_log_severity_t::TRACE => tracing::Level::TRACE, + zc_log_severity_t::DEBUG => tracing::Level::DEBUG, + zc_log_severity_t::INFO => tracing::Level::INFO, + zc_log_severity_t::WARN => tracing::Level::WARN, + zc_log_severity_t::ERROR => tracing::Level::ERROR, + } + } +} + +impl From for zc_log_severity_t { + fn from(value: tracing::Level) -> Self { + match value { + tracing::Level::TRACE => zc_log_severity_t::TRACE, + tracing::Level::DEBUG => zc_log_severity_t::DEBUG, + tracing::Level::INFO => zc_log_severity_t::INFO, + tracing::Level::WARN => zc_log_severity_t::WARN, + tracing::Level::ERROR => zc_log_severity_t::ERROR, + } + } +} + +/// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: +/// +/// Closures are not guaranteed not to be called concurrently. +/// +/// It is guaranteed that: +/// - `call` will never be called once `drop` has started. +/// - `drop` will only be called **once**, and **after every** `call` has ended. +/// - The two previous guarantees imply that `call` and `drop` are never called concurrently. +#[repr(C)] +pub struct zc_owned_closure_log_t { + /// An optional pointer to a closure state. + context: *mut libc::c_void, + /// A closure body. + call: Option< + extern "C" fn( + severity: zc_log_severity_t, + msg: &z_loaned_string_t, + context: *mut libc::c_void, + ), + >, + /// An optional drop function that will be called when the closure is dropped. + drop: Option, +} + +/// Loaned closure. +#[repr(C)] +pub struct zc_loaned_closure_log_t { + _0: [usize; 3], +} + +decl_c_type!( + owned(zc_owned_closure_log_t), + loaned(zc_loaned_closure_log_t) +); + +impl zc_owned_closure_log_t { + pub fn empty() -> Self { + zc_owned_closure_log_t { + context: std::ptr::null_mut(), + call: None, + drop: None, + } + } + + pub fn is_empty(&self) -> bool { + self.call.is_none() && self.drop.is_none() && self.context.is_null() + } +} +unsafe impl Send for zc_owned_closure_log_t {} +unsafe impl Sync for zc_owned_closure_log_t {} +impl Drop for zc_owned_closure_log_t { + fn drop(&mut self) { + if let Some(drop) = self.drop { + drop(self.context) + } + } +} +/// Constructs a closure in a gravestone state. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn z_closure_log_null(this: *mut MaybeUninit) { + (*this).write(zc_owned_closure_log_t::empty()); +} +/// Calls the closure. Calling an uninitialized closure is a no-op. +#[no_mangle] +pub extern "C" fn z_closure_log_call( + closure: &zc_loaned_closure_log_t, + severity: zc_log_severity_t, + msg: &z_loaned_string_t, +) { + let closure = closure.as_owned_c_type_ref(); + match closure.call { + Some(call) => call(severity, msg, closure.context), + None => { + tracing::error!("Attempted to call an uninitialized closure!"); + } + } +} +/// Drops the closure. Droping an uninitialized closure is a no-op. +#[no_mangle] +pub extern "C" fn z_closure_log_drop(closure: &mut zc_owned_closure_log_t) { + let mut empty_closure = zc_owned_closure_log_t::empty(); + std::mem::swap(&mut empty_closure, closure); +} + +/// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. +#[no_mangle] +pub extern "C" fn z_closure_log_check(this: &zc_owned_closure_log_t) -> bool { + !this.is_empty() +} + +/// Borrows closure. +#[no_mangle] +pub extern "C" fn z_closure_log_loan(closure: &zc_owned_closure_log_t) -> &zc_loaned_closure_log_t { + closure.as_loaned_c_type_ref() +} diff --git a/src/closures/mod.rs b/src/closures/mod.rs index 7f3600dc4..56fcaad4d 100644 --- a/src/closures/mod.rs +++ b/src/closures/mod.rs @@ -37,6 +37,9 @@ mod sample_channel; pub use hello_closure::*; mod hello_closure; +pub use log_closure::*; +mod log_closure; + #[cfg(feature = "unstable")] pub use matching_status_closure::*; #[cfg(feature = "unstable")] diff --git a/src/lib.rs b/src/lib.rs index ab777dfa4..2a7633e19 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -18,6 +18,7 @@ use std::{cmp::min, slice}; use libc::c_void; +use crate::transmute::LoanedCTypeRef; #[macro_use] mod transmute; pub mod opaque_types; @@ -76,15 +77,42 @@ pub mod context; #[cfg(all(feature = "shared-memory", feature = "unstable"))] pub mod shm; -/// Initialises the zenoh runtime logger. +/// Initializes the zenoh runtime logger, using rust environment settings. /// /// Note that unless you built zenoh-c with the `logger-autoinit` feature disabled, /// this will be performed automatically by `z_open` and `z_scout`. #[no_mangle] -pub extern "C" fn zc_init_logger() { +pub extern "C" fn zc_init_logging() { zenoh::try_init_log_from_env(); } +/// Initializes the zenoh runtime logger with custom callback. +/// +/// @param min_severity: Minimum severity level of log message to be be passed to the `callback`. +/// Messages with lower severity levels will be ignored. +/// @param callback: A closure that will be called with each log message severity level and content. +#[no_mangle] +pub extern "C" fn zc_init_logging_with_callback( + min_severity: zc_log_severity_t, + callback: &mut zc_owned_closure_log_t, +) { + let mut closure = zc_owned_closure_log_t::empty(); + std::mem::swap(callback, &mut closure); + zenoh_util::log::init_log_with_callback( + move |meta| min_severity <= (*meta.level()).into(), + move |record| { + if let Some(s) = record.message.as_ref() { + let c = CStringView(CString(CSlice::new_borrowed_from_slice(s.as_bytes()))); + z_closure_log_call( + z_closure_log_loan(&closure), + record.level.into(), + c.as_loaned_c_type_ref(), + ); + } + }, + ); +} + // Test should be runned with `cargo test --no-default-features` #[test] #[cfg(not(feature = "default"))] diff --git a/src/scouting.rs b/src/scouting.rs index 7b7faec67..625f09ffb 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -24,7 +24,7 @@ use crate::{ result::{self, Z_OK}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_closure_hello_call, z_closure_hello_loan, z_owned_closure_hello_t, z_owned_config_t, - z_owned_string_array_t, z_view_string_t, zc_init_logger, CString, CStringView, ZVector, + z_owned_string_array_t, z_view_string_t, zc_init_logging, CString, CStringView, ZVector, }; #[cfg(feature = "unstable")] use crate::{transmute::IntoCType, z_id_t}; @@ -160,7 +160,7 @@ pub extern "C" fn z_scout( options: Option<&z_scout_options_t>, ) -> result::z_result_t { if cfg!(feature = "logger-autoinit") { - zc_init_logger(); + zc_init_logging(); } let options = options.cloned().unwrap_or_default(); let what = diff --git a/src/session.rs b/src/session.rs index 6fd268333..b891eed3d 100644 --- a/src/session.rs +++ b/src/session.rs @@ -22,7 +22,7 @@ use crate::{ opaque_types::{z_loaned_session_t, z_owned_session_t}, result, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_owned_config_t, zc_init_logger, + z_owned_config_t, zc_init_logging, }; decl_c_type!( owned(z_owned_session_t, Option>), @@ -57,7 +57,7 @@ pub extern "C" fn z_open( ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { - zc_init_logger(); + zc_init_logging(); } let Some(config) = config.as_rust_type_mut().take() else { tracing::error!("Config not provided"); @@ -90,7 +90,7 @@ pub extern "C" fn z_open_with_custom_shm_clients( ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { - zc_init_logger(); + zc_init_logging(); } let Some(config) = config.as_rust_type_mut().take() else { tracing::error!("Config not provided"); diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index 52a46c9b2..98276d794 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -107,7 +107,7 @@ int main(int argc, char **argv) { setbuf(stdout, NULL); #ifdef ZENOH_C - zc_init_logger(); + zc_init_logging(); #endif z_view_keyexpr_t key_demo_example, key_demo_example_a, key_demo_example_starstar; diff --git a/tests/z_api_config_test.c b/tests/z_api_config_test.c index 51f73c5ea..633a65de9 100644 --- a/tests/z_api_config_test.c +++ b/tests/z_api_config_test.c @@ -40,7 +40,7 @@ void config_peer() { } int main(int argc, char **argv) { - zc_init_logger(); + zc_init_logging(); config_client(); config_peer(); } diff --git a/tests/z_api_double_drop_test.c b/tests/z_api_double_drop_test.c index 5a6cc4ccb..089aff593 100644 --- a/tests/z_api_double_drop_test.c +++ b/tests/z_api_double_drop_test.c @@ -120,7 +120,7 @@ void test_queryable() { } int main(int argc, char **argv) { - zc_init_logger(); + zc_init_logging(); test_session(); test_publisher(); test_keyexpr(); diff --git a/tests/z_api_drop_options.c b/tests/z_api_drop_options.c index 099603f84..613dcfe6b 100644 --- a/tests/z_api_drop_options.c +++ b/tests/z_api_drop_options.c @@ -74,7 +74,7 @@ void get() { } int main(int argc, char **argv) { - zc_init_logger(); + zc_init_logging(); put(); get(); } From 04cad65d2f2a23de2d325db472bc03945282c011 Mon Sep 17 00:00:00 2001 From: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:06:51 +0200 Subject: [PATCH 060/397] z_bytes_reader and z_bytes_writer update (#583) * made z_bytes_writer non-owned; added z_bytes_writer_append(...) and z_bytes_writer append_bounded(...) (aka writer.serialize()); added z_bytes_reader_read_bounded(...); * fix initializer * fix initializer --- Cargo.lock | 1296 +++++++++++------------ build-resources/opaque-types/src/lib.rs | 5 +- docs/api.rst | 9 +- include/zenoh_commons.h | 50 +- include/zenoh_macros.h | 13 - splitguide.yaml | 3 +- src/payload.rs | 118 ++- tests/z_api_payload_test.c | 88 +- 8 files changed, 764 insertions(+), 818 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 019cb2a50..5b820a761 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -43,18 +43,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-tzdata" @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "array-init" @@ -85,9 +85,9 @@ checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" [[package]] name = "asn1-rs" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -101,13 +101,13 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", "synstructure", ] @@ -119,7 +119,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] @@ -133,32 +133,43 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-channel" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +dependencies = [ + "concurrent-queue", + "event-listener-strategy", + "futures-core", + "pin-project-lite", +] + [[package]] name = "async-executor" -version = "1.5.1" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ - "async-lock", "async-task", "concurrent-queue", - "fastrand 1.9.0", - "futures-lite", + "fastrand 2.1.0", + "futures-lite 2.3.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.3.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.3", + "async-lock 3.4.0", "blocking", - "futures-lite", + "futures-lite 2.3.0", "once_cell", "tokio", ] @@ -169,20 +180,39 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite", + "futures-lite 1.13.0", "log", "parking", - "polling", - "rustix 0.37.25", + "polling 2.8.0", + "rustix 0.37.27", "slab", - "socket2 0.4.9", + "socket2 0.4.10", "waker-fn", ] +[[package]] +name = "async-io" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +dependencies = [ + "async-lock 3.4.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.3.0", + "parking", + "polling 3.7.2", + "rustix 0.38.34", + "slab", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "async-lock" version = "2.8.0" @@ -192,21 +222,32 @@ dependencies = [ "event-listener 2.5.3", ] +[[package]] +name = "async-lock" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +dependencies = [ + "event-listener 5.3.1", + "event-listener-strategy", + "pin-project-lite", +] + [[package]] name = "async-std" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -220,26 +261,26 @@ dependencies = [ [[package]] name = "async-task" -version = "4.4.0" +version = "4.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" +checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "atomic-waker" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "atty" @@ -254,15 +295,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -275,9 +316,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" @@ -308,9 +349,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -326,36 +367,34 @@ dependencies = [ [[package]] name = "blocking" -version = "1.3.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.3.1", "async-task", - "atomic-waker", - "fastrand 1.9.0", - "futures-lite", - "log", + "futures-io", + "futures-lite 2.3.0", + "piper", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cache-padded" @@ -384,12 +423,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" [[package]] name = "cesu8" @@ -420,7 +456,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -478,9 +514,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" @@ -520,36 +556,33 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -563,15 +596,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "pem-rfc7468", @@ -636,20 +669,20 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "dyn-clone" -version = "1.0.13" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" @@ -665,9 +698,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -696,6 +729,16 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "event-listener-strategy" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +dependencies = [ + "event-listener 5.3.1", + "pin-project-lite", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -707,9 +750,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fixedbitset" @@ -726,7 +769,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin 0.9.8", + "spin", ] [[package]] @@ -762,9 +805,9 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -777,9 +820,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -787,15 +830,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -804,9 +847,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -823,34 +866,47 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +dependencies = [ + "fastrand 2.1.0", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -876,9 +932,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -889,30 +945,28 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "git-version" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" +checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19" dependencies = [ "git-version-macro", - "proc-macro-hack", ] [[package]] name = "git-version-macro" -version = "0.3.5" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" +checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" dependencies = [ - "proc-macro-hack", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -929,9 +983,9 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hashbrown" @@ -966,9 +1020,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hermit-abi" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" [[package]] name = "hmac" @@ -981,18 +1041,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "http" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1001,9 +1061,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "humantime" @@ -1013,16 +1073,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows 0.48.0", + "windows-core", ] [[package]] @@ -1034,134 +1094,14 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] - [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -1176,9 +1116,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1195,9 +1135,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -1208,7 +1148,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -1239,9 +1179,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jni" @@ -1265,9 +1205,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1285,9 +1225,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -1312,11 +1252,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" dependencies = [ - "spin 0.5.2", + "spin", ] [[package]] @@ -1327,43 +1267,47 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] name = "libm" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" [[package]] -name = "linux-raw-sys" -version = "0.3.8" +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", +] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] -name = "litemap" -version = "0.7.3" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1380,18 +1324,18 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" dependencies = [ "value-bag", ] [[package]] name = "lz4_flex" -version = "0.11.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" +checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" dependencies = [ "twox-hash", ] @@ -1428,22 +1372,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1474,7 +1419,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "libc", ] @@ -1507,11 +1452,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -1561,9 +1505,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", "libm", @@ -1575,15 +1519,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.2", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -1617,9 +1561,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.1.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" +checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" dependencies = [ "num-traits", ] @@ -1644,9 +1588,9 @@ checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" [[package]] name = "parking" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1675,9 +1619,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem-rfc7468" @@ -1696,9 +1640,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.3" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -1707,9 +1651,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.3" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -1717,22 +1661,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.3" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "pest_meta" -version = "2.7.3" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -1741,12 +1685,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.0.0", + "indexmap 2.3.0", ] [[package]] @@ -1779,7 +1723,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] @@ -1793,9 +1737,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1803,6 +1747,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "piper" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +dependencies = [ + "atomic-waker", + "fastrand 2.1.0", + "futures-io", +] + [[package]] name = "pkcs1" version = "0.7.5" @@ -1872,6 +1827,21 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +dependencies = [ + "cfg-if", + "concurrent-queue", + "hermit-abi 0.4.0", + "pin-project-lite", + "rustix 0.38.34", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -1880,9 +1850,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "proc-macro-crate" @@ -1893,26 +1866,20 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ "bytes", "pin-project-lite", @@ -1920,6 +1887,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", + "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -1927,9 +1895,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ "bytes", "rand", @@ -1945,22 +1913,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", - "socket2 0.5.6", + "socket2 0.5.7", "tracing", "windows-sys 0.52.0", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2006,20 +1974,20 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -2061,16 +2029,17 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ring" -version = "0.17.6" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", - "spin 0.9.8", + "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2089,24 +2058,22 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ - "base64 0.21.4", - "bitflags 2.5.0", + "base64 0.21.7", + "bitflags 2.6.0", "serde", "serde_derive", ] [[package]] name = "rsa" -version = "0.9.2" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" dependencies = [ - "byteorder", "const-oid", "digest", "num-bigint-dig", "num-integer", - "num-iter", "num-traits", "pkcs1", "pkcs8", @@ -2119,15 +2086,15 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" @@ -2149,9 +2116,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.25" +version = "0.37.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" dependencies = [ "bitflags 1.3.2", "errno", @@ -2163,22 +2130,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "log", "once_cell", @@ -2191,9 +2158,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -2204,25 +2171,25 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.0.0" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ - "base64 0.21.4", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-platform-verifier" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5f0d26fa1ce3c790f9590868f0109289a044acb954525f933e2aa3b871c157d" +checksum = "93bda3f493b9abe5b93b3e7e3ecde0df292f2bd28c0296b90586ee0055ff5123" dependencies = [ "core-foundation", "core-foundation-sys", @@ -2241,15 +2208,15 @@ dependencies = [ [[package]] name = "rustls-platform-verifier-android" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring", "rustls-pki-types", @@ -2258,15 +2225,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2279,18 +2246,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "schemars" -version = "0.8.13" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" dependencies = [ "dyn-clone", "either", @@ -2301,14 +2268,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.13" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -2329,11 +2296,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -2343,9 +2310,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -2353,15 +2320,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] @@ -2391,44 +2358,45 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "serde_derive_internals" -version = "0.26.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.3.0", "itoa", "ryu", "serde", @@ -2437,9 +2405,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -2448,9 +2416,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2506,9 +2474,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", "rand_core", @@ -2537,9 +2505,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -2547,20 +2515,14 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -2572,9 +2534,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -2582,9 +2544,9 @@ dependencies = [ [[package]] name = "stabby" -version = "5.0.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7708f5b0e8bddba162d20fa10c8d17c31a2ec6bba369f7904bb18a8bde49ba2" +checksum = "71dafe1facecf85bb802989436421475290d4351bcb2f7e3453598d0ad23182c" dependencies = [ "lazy_static", "rustversion", @@ -2593,9 +2555,9 @@ dependencies = [ [[package]] name = "stabby-abi" -version = "5.0.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6e7a8b2ff2c116bfab6afcce0adec14509eb38fd3f231bb97826d01de4021e" +checksum = "edf9151d4c625c05bebeb90a61b48861df35a43b7083bdae1ad41fe754236f88" dependencies = [ "libc", "rustversion", @@ -2605,9 +2567,9 @@ dependencies = [ [[package]] name = "stabby-macros" -version = "5.0.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97bd3101fab9929a08fa0138d30d46c7a80b9d32bc8a3a00706ba00358a275" +checksum = "fb7520c91a07eb1568a79c69d3ddc7c0e8f475cf2940602e162736ce4b16bc31" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2616,12 +2578,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -2662,7 +2618,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af91f480ee899ab2d9f8435bfdfc14d08a5754bd9d3fef1f1a1c23336aad6c8b" dependencies = [ - "async-channel", + "async-channel 1.9.0", "cfg-if", "futures-core", "pin-project-lite", @@ -2676,9 +2632,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -2693,9 +2649,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -2710,19 +2666,20 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", - "fastrand 2.0.2", - "rustix 0.38.32", - "windows-sys 0.52.0", + "fastrand 2.1.0", + "once_cell", + "rustix 0.38.34", + "windows-sys 0.59.0", ] [[package]] @@ -2742,22 +2699,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] @@ -2766,7 +2723,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d3b04d33c9633b8662b167b847c7ab521f83d1ae20f2321b65b5b925e532e36" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "libc", "log", @@ -2815,21 +2772,11 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -2851,30 +2798,29 @@ dependencies = [ [[package]] name = "tokio" -version = "1.36.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] @@ -2902,9 +2848,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -2926,9 +2872,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" [[package]] name = "toml_edit" @@ -2936,18 +2882,17 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.3.0", "toml_datetime", "winnow", ] [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2956,20 +2901,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -3047,9 +2992,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ucd-trie" @@ -3068,15 +3013,30 @@ dependencies = [ "log", "rand", "serde", - "spin 0.9.8", + "spin", ] +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-xid" version = "0.2.4" @@ -3085,9 +3045,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" @@ -3114,9 +3074,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3129,23 +3089,11 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[package]] -name = "utf8_iter" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" - [[package]] name = "uuid" -version = "1.4.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] @@ -3182,9 +3130,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.4.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" [[package]] name = "vec_map" @@ -3194,21 +3142,21 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "waker-fn" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -3222,9 +3170,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3232,24 +3180,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -3259,9 +3207,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3269,28 +3217,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -3298,9 +3246,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -3311,7 +3259,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b7b128a98c1cfa201b09eb49ba285887deb3cbe7466a98850eb1adabb452be5" dependencies = [ - "windows 0.34.0", + "windows", ] [[package]] @@ -3332,11 +3280,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -3359,12 +3307,12 @@ dependencies = [ ] [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] [[package]] @@ -3382,7 +3330,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -3402,17 +3359,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3423,9 +3381,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3441,9 +3399,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3459,9 +3417,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3477,9 +3441,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3495,9 +3459,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3507,9 +3471,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3525,9 +3489,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -3538,18 +3502,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "x509-parser" version = "0.16.0" @@ -3567,34 +3519,10 @@ dependencies = [ "time", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", - "synstructure", -] - [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "ahash", "async-trait", @@ -3620,7 +3548,7 @@ dependencies = [ "serde_cbor", "serde_json", "serde_yaml", - "socket2 0.5.6", + "socket2 0.5.7", "stop-token", "tokio", "tokio-util", @@ -3652,7 +3580,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "zenoh-collections", ] @@ -3678,7 +3606,7 @@ dependencies = [ "rand", "regex", "serde_yaml", - "spin 0.9.8", + "spin", "tracing", "unwrap-infallible", "zenoh", @@ -3689,7 +3617,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "serde", "tracing", @@ -3702,12 +3630,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "flume", "json5", @@ -3729,7 +3657,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-global-executor", "lazy_static", @@ -3741,7 +3669,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "aes", "hmac", @@ -3754,7 +3682,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "bincode", "flume", @@ -3773,7 +3701,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3787,7 +3715,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "zenoh-config", @@ -3805,7 +3733,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "flume", @@ -3830,7 +3758,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "base64 0.22.1", @@ -3861,10 +3789,10 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tokio-util", "tracing", @@ -3880,7 +3808,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "base64 0.22.1", @@ -3890,7 +3818,7 @@ dependencies = [ "rustls-pki-types", "rustls-webpki", "secrecy", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tokio-rustls", "tokio-util", @@ -3911,10 +3839,10 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tokio-util", "tracing", @@ -3932,7 +3860,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "futures", @@ -3952,7 +3880,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "futures-util", @@ -3973,18 +3901,18 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.72", "zenoh-keyexpr", ] [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "libloading", "serde", @@ -3999,7 +3927,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "const_format", "rand", @@ -4014,7 +3942,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "anyhow", ] @@ -4022,7 +3950,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "futures", "lazy_static", @@ -4037,7 +3965,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "bincode", @@ -4061,7 +3989,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "event-listener 5.3.1", "futures", @@ -4075,7 +4003,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "futures", "tokio", @@ -4088,7 +4016,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "flume", @@ -4121,7 +4049,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" dependencies = [ "async-trait", "const_format", @@ -4145,69 +4073,27 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ + "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", -] - -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", - "synstructure", + "syn 2.0.72", ] [[package]] name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" - -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.52", -] +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index 1c1a8b7c6..c837ce488 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -94,10 +94,7 @@ get_opaque_type_data!(Sample, z_loaned_sample_t); get_opaque_type_data!(ZBytesReader<'static>, z_bytes_reader_t); /// A writer for serialized data. -get_opaque_type_data!(Option>, z_owned_bytes_writer_t); - -/// A loaned writer for serialized data. -get_opaque_type_data!(ZBytesWriter<'static>, z_loaned_bytes_writer_t); +get_opaque_type_data!(ZBytesWriter<'static>, z_bytes_writer_t); /// An iterator over multi-element serialized data get_opaque_type_data!(ZBytesIterator<'static, ZBytes>, z_bytes_iterator_t); diff --git a/docs/api.rst b/docs/api.rst index f39dc622b..1c2f9f41d 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -106,6 +106,7 @@ Types .. doxygenstruct:: z_loaned_bytes_t .. doxygenstruct:: z_bytes_iterator_t .. doxygenstruct:: z_bytes_reader_t +.. doxygenstruct:: z_bytes_writer_t Functions ^^^^^^^^^ @@ -159,6 +160,7 @@ Functions .. doxygenfunction:: z_bytes_get_reader .. doxygenfunction:: z_bytes_reader_read +.. doxygenfunction:: z_bytes_reader_read_bounded .. doxygenfunction:: z_bytes_reader_seek .. doxygenfunction:: z_bytes_reader_tell @@ -167,12 +169,9 @@ Functions .. doxygenfunction:: z_bytes_get_writer -.. doxygenfunction:: z_bytes_writer_loan -.. doxygenfunction:: z_bytes_writer_loan_mut -.. doxygenfunction:: z_bytes_writer_null -.. doxygenfunction:: z_bytes_writer_check -.. doxygenfunction:: z_bytes_writer_drop .. doxygenfunction:: z_bytes_writer_write_all +.. doxygenfunction:: z_bytes_writer_append +.. doxygenfunction:: z_bytes_writer_append_bounded diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 31a47cf2a..81cbb19b2 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -1344,9 +1344,7 @@ ZENOHC_API struct z_bytes_reader_t z_bytes_get_reader(const struct z_loaned_byte /** * Gets writer for `this_`. */ -ZENOHC_API -void z_bytes_get_writer(struct z_loaned_bytes_t *this_, - struct z_owned_bytes_writer_t *out); +ZENOHC_API struct z_bytes_writer_t z_bytes_get_writer(struct z_loaned_bytes_t *this_); /** * Returns ``true`` if `this_` is empty, ``false`` otherwise. */ @@ -1386,11 +1384,21 @@ ZENOHC_API size_t z_bytes_reader_read(struct z_bytes_reader_t *this_, uint8_t *dst, size_t len); +/** + * Reads data into specified destination. + * + * @param this_: Data reader to read from. + * @param dst: An uninitialized memory location where a new piece of data will be read. Note that it does not involve a copy, but only increases reference count. + * @return ​0​ upon success, negative error code otherwise. + */ +ZENOHC_API +z_result_t z_bytes_reader_read_bounded(struct z_bytes_reader_t *this_, + struct z_owned_bytes_t *dst); /** * Sets the `reader` position indicator for the payload to the value pointed to by offset. * The new position is exactly `offset` bytes measured from the beginning of the payload if origin is `SEEK_SET`, * from the current reader position if origin is `SEEK_CUR`, and from the end of the payload if origin is `SEEK_END`. - * Return ​0​ upon success, negative error code otherwise. + * @return ​0​ upon success, negative error code otherwise. */ ZENOHC_API z_result_t z_bytes_reader_seek(struct z_bytes_reader_t *this_, @@ -1486,34 +1494,30 @@ ZENOHC_API void z_bytes_serialize_from_uint64(struct z_owned_bytes_t *this_, uin */ ZENOHC_API void z_bytes_serialize_from_uint8(struct z_owned_bytes_t *this_, uint8_t val); /** - * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_bytes_writer_check(const struct z_owned_bytes_writer_t *this_); -/** - * Drops `this_`, resetting it to gravestone value. - */ -ZENOHC_API void z_bytes_writer_drop(struct z_owned_bytes_writer_t *this_); -/** - * Borrows writer. + * Appends bytes. + * This allows to compose a serialized data out of multiple `z_owned_bytes_t` that may point to different memory regions. + * Said in other terms, it allows to create a linear view on different memory regions without copy. + * + * @return 0 in case of success, negative error code otherwise */ ZENOHC_API -const struct z_loaned_bytes_writer_t *z_bytes_writer_loan(const struct z_owned_bytes_writer_t *this_); +z_result_t z_bytes_writer_append(struct z_bytes_writer_t *this_, + struct z_owned_bytes_t *bytes); /** - * Muatably borrows writer. + * Appends bytes, with boundaries information. It would allow to read the same piece of data using `z_bytes_reader_read_bounded()`. + * + * @return 0 in case of success, negative error code otherwise */ ZENOHC_API -struct z_loaned_bytes_writer_t *z_bytes_writer_loan_mut(struct z_owned_bytes_writer_t *this_); -/** - * The gravestone value for `z_owned_bytes_reader_t`. - */ -ZENOHC_API void z_bytes_writer_null(struct z_owned_bytes_writer_t *this_); +z_result_t z_bytes_writer_append_bounded(struct z_bytes_writer_t *this_, + struct z_owned_bytes_t *bytes); /** - * Writes `len` bytes from `src` into underlying data + * Writes `len` bytes from `src` into underlying data. * - * @return 0 in case of success, negative error code otherwise + * @return 0 in case of success, negative error code otherwise. */ ZENOHC_API -z_result_t z_bytes_writer_write_all(struct z_loaned_bytes_writer_t *this_, +z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, const uint8_t *src, size_t len); /** diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 01bb9c7be..fbd517319 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -7,7 +7,6 @@ #define z_loan(x) \ _Generic((x), \ z_owned_bytes_t : z_bytes_loan, \ - z_owned_bytes_writer_t : z_bytes_writer_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ zc_owned_closure_log_t : z_closure_log_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ @@ -43,7 +42,6 @@ #define z_loan_mut(x) \ _Generic((x), \ z_owned_bytes_t : z_bytes_loan_mut, \ - z_owned_bytes_writer_t : z_bytes_writer_loan_mut, \ z_owned_condvar_t : z_condvar_loan_mut, \ z_owned_config_t : z_config_loan_mut, \ z_owned_encoding_t : z_encoding_loan_mut, \ @@ -55,7 +53,6 @@ #define z_drop(x) \ _Generic((x), \ z_owned_bytes_t* : z_bytes_drop, \ - z_owned_bytes_writer_t* : z_bytes_writer_drop, \ z_owned_closure_hello_t* : z_closure_hello_drop, \ zc_owned_closure_log_t* : z_closure_log_drop, \ z_owned_closure_query_t* : z_closure_query_drop, \ @@ -91,7 +88,6 @@ #define z_null(x) \ _Generic((x), \ z_owned_bytes_t* : z_bytes_null, \ - z_owned_bytes_writer_t* : z_bytes_writer_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ zc_owned_closure_log_t* : z_closure_log_null, \ z_owned_closure_query_t* : z_closure_query_null, \ @@ -129,7 +125,6 @@ #define z_check(x) \ _Generic((x), \ z_owned_bytes_t : z_bytes_check, \ - z_owned_bytes_writer_t : z_bytes_writer_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ zc_owned_closure_log_t : z_closure_log_check, \ z_owned_closure_query_t : z_closure_query_check, \ @@ -199,7 +194,6 @@ inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; -inline const z_loaned_bytes_writer_t* z_loan(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return z_closure_log_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; @@ -233,7 +227,6 @@ inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_ inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; -inline z_loaned_bytes_writer_t* z_loan_mut(z_owned_bytes_writer_t& this_) { return z_bytes_writer_loan_mut(&this_); }; inline z_loaned_condvar_t* z_loan_mut(z_owned_condvar_t& this_) { return z_condvar_loan_mut(&this_); }; inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_loan_mut(&this_); }; inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; @@ -243,7 +236,6 @@ inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { retu inline void z_drop(z_owned_bytes_t* this_) { return z_bytes_drop(this_); }; -inline void z_drop(z_owned_bytes_writer_t* this_) { return z_bytes_writer_drop(this_); }; inline void z_drop(z_owned_closure_hello_t* closure) { return z_closure_hello_drop(closure); }; inline void z_drop(zc_owned_closure_log_t* closure) { return z_closure_log_drop(closure); }; inline void z_drop(z_owned_closure_query_t* closure) { return z_closure_query_drop(closure); }; @@ -275,7 +267,6 @@ inline void z_drop(z_owned_subscriber_t* this_) { return z_subscriber_drop(this_ inline z_owned_bytes_t* z_move(z_owned_bytes_t& this_) { return (&this_); }; -inline z_owned_bytes_writer_t* z_move(z_owned_bytes_writer_t& this_) { return (&this_); }; inline z_owned_closure_hello_t* z_move(z_owned_closure_hello_t& closure) { return (&closure); }; inline zc_owned_closure_log_t* z_move(zc_owned_closure_log_t& closure) { return (&closure); }; inline z_owned_closure_query_t* z_move(z_owned_closure_query_t& closure) { return (&closure); }; @@ -307,7 +298,6 @@ inline z_owned_subscriber_t* z_move(z_owned_subscriber_t& this_) { return (&this inline void z_null(z_owned_bytes_t* this_) { return z_bytes_null(this_); }; -inline void z_null(z_owned_bytes_writer_t* this_) { return z_bytes_writer_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { return z_closure_hello_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { return z_closure_log_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { return z_closure_query_null(this_); }; @@ -343,7 +333,6 @@ inline void z_null(z_view_string_t* this_) { return z_view_string_null(this_); } inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_bytes_writer_t& this_) { return z_bytes_writer_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return z_closure_log_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; @@ -473,8 +462,6 @@ template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_writer_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_writer_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; diff --git a/splitguide.yaml b/splitguide.yaml index 913b422a8..c8cbae9f8 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -20,8 +20,7 @@ zenoh_opaque.h: - z_owned_sample_t! - z_loaned_sample_t! - z_bytes_reader_t! - - z_owned_bytes_writer_t! - - z_loaned_bytes_writer_t! + - z_bytes_writer_t! - z_bytes_iterator_t! - z_owned_encoding_t! - z_loaned_encoding_t! diff --git a/src/payload.rs b/src/payload.rs index bed077167..1752ca94c 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -798,10 +798,35 @@ pub unsafe extern "C" fn z_bytes_reader_read( reader.read(buf).unwrap_or(0) } +/// Reads data into specified destination. +/// +/// @param this_: Data reader to read from. +/// @param dst: An uninitialized memory location where a new piece of data will be read. Note that it does not involve a copy, but only increases reference count. +/// @return ​0​ upon success, negative error code otherwise. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn z_bytes_reader_read_bounded( + this: &mut z_bytes_reader_t, + dst: &mut MaybeUninit, +) -> z_result_t { + let reader = this.as_rust_type_mut(); + match reader.deserialize::() { + Ok(b) => { + dst.as_rust_type_mut_uninit().write(b); + result::Z_OK + } + Err(e) => { + dst.as_rust_type_mut_uninit().write(ZBytes::empty()); + tracing::error!("{}", e); + result::Z_EPARSE + } + } +} + /// Sets the `reader` position indicator for the payload to the value pointed to by offset. /// The new position is exactly `offset` bytes measured from the beginning of the payload if origin is `SEEK_SET`, /// from the current reader position if origin is `SEEK_CUR`, and from the end of the payload if origin is `SEEK_END`. -/// Return ​0​ upon success, negative error code otherwise. +/// @return ​0​ upon success, negative error code otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_reader_seek( @@ -839,77 +864,58 @@ pub unsafe extern "C" fn z_bytes_reader_tell(this: &mut z_bytes_reader_t) -> i64 reader.stream_position().map(|p| p as i64).unwrap_or(-1) } -pub use crate::opaque_types::{z_loaned_bytes_writer_t, z_owned_bytes_writer_t}; +pub use crate::opaque_types::z_bytes_writer_t; -decl_c_type! { - owned(z_owned_bytes_writer_t, Option>), - loaned(z_loaned_bytes_writer_t, ZBytesWriter<'static>), -} - -/// The gravestone value for `z_owned_bytes_reader_t`. -#[no_mangle] -extern "C" fn z_bytes_writer_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); -} +decl_c_type! {loaned(z_bytes_writer_t, ZBytesWriter<'static>)} -/// Drops `this_`, resetting it to gravestone value. +/// Gets writer for `this_`. #[no_mangle] -extern "C" fn z_bytes_writer_drop(this: &mut z_owned_bytes_writer_t) { - *this.as_rust_type_mut() = None; +extern "C" fn z_bytes_get_writer(this: &'static mut z_loaned_bytes_t) -> z_bytes_writer_t { + *this.as_rust_type_mut().writer().as_loaned_c_type_ref() } -/// Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. +/// Writes `len` bytes from `src` into underlying data. +/// +/// @return 0 in case of success, negative error code otherwise. +#[allow(clippy::missing_safety_doc)] #[no_mangle] -extern "C" fn z_bytes_writer_check(this: &z_owned_bytes_writer_t) -> bool { - this.as_rust_type_ref().is_some() +unsafe extern "C" fn z_bytes_writer_write_all( + this: &mut z_bytes_writer_t, + src: *const u8, + len: usize, +) -> z_result_t { + match this.as_rust_type_mut().write_all(from_raw_parts(src, len)) { + Ok(_) => Z_OK, + Err(_) => Z_EIO, + } } -/// Borrows writer. -#[no_mangle] +/// Appends bytes. +/// This allows to compose a serialized data out of multiple `z_owned_bytes_t` that may point to different memory regions. +/// Said in other terms, it allows to create a linear view on different memory regions without copy. +/// +/// @return 0 in case of success, negative error code otherwise #[allow(clippy::missing_safety_doc)] -unsafe extern "C" fn z_bytes_writer_loan( - this: &z_owned_bytes_writer_t, -) -> &z_loaned_bytes_writer_t { - this.as_rust_type_ref() - .as_ref() - .unwrap_unchecked() - .as_loaned_c_type_ref() -} - -/// Muatably borrows writer. #[no_mangle] -#[allow(clippy::missing_safety_doc)] -unsafe extern "C" fn z_bytes_writer_loan_mut( - this: &mut z_owned_bytes_writer_t, -) -> &mut z_loaned_bytes_writer_t { +unsafe extern "C" fn z_bytes_writer_append( + this: &mut z_bytes_writer_t, + bytes: &mut z_owned_bytes_t, +) -> z_result_t { this.as_rust_type_mut() - .as_mut() - .unwrap_unchecked() - .as_loaned_c_type_mut() + .append(std::mem::take(bytes.as_rust_type_mut())); + result::Z_OK } -/// Gets writer for `this_`. -#[no_mangle] -extern "C" fn z_bytes_get_writer( - this: &'static mut z_loaned_bytes_t, - out: &mut MaybeUninit, -) { - out.as_rust_type_mut_uninit() - .write(Some(this.as_rust_type_mut().writer())); -} - -/// Writes `len` bytes from `src` into underlying data +/// Appends bytes, with boundaries information. It would allow to read the same piece of data using `z_bytes_reader_read_bounded()`. /// /// @return 0 in case of success, negative error code otherwise #[allow(clippy::missing_safety_doc)] #[no_mangle] -unsafe extern "C" fn z_bytes_writer_write_all( - this: &mut z_loaned_bytes_writer_t, - src: *const u8, - len: usize, +unsafe extern "C" fn z_bytes_writer_append_bounded( + this: &mut z_bytes_writer_t, + bytes: &mut z_owned_bytes_t, ) -> z_result_t { - match this.as_rust_type_mut().write_all(from_raw_parts(src, len)) { - Ok(_) => Z_OK, - Err(_) => Z_EIO, - } + this.as_rust_type_mut() + .serialize(std::mem::take(bytes.as_rust_type_mut())); + result::Z_OK } diff --git a/tests/z_api_payload_test.c b/tests/z_api_payload_test.c index 765d81829..37f2d6aaa 100644 --- a/tests/z_api_payload_test.c +++ b/tests/z_api_payload_test.c @@ -85,14 +85,11 @@ void test_writer() { z_owned_bytes_t payload; z_bytes_empty(&payload); - z_owned_bytes_writer_t writer; - z_bytes_get_writer(z_loan_mut(payload), &writer); + z_bytes_writer_t writer = z_bytes_get_writer(z_loan_mut(payload)); - assert(z_bytes_writer_write_all(z_loan_mut(writer), data, 3) == 0); - assert(z_bytes_writer_write_all(z_loan_mut(writer), data + 3, 5) == 0); - assert(z_bytes_writer_write_all(z_loan_mut(writer), data + 8, 2) == 0); - - z_drop(z_move(writer)); + assert(z_bytes_writer_write_all(&writer, data, 3) == 0); + assert(z_bytes_writer_write_all(&writer, data + 3, 5) == 0); + assert(z_bytes_writer_write_all(&writer, data + 8, 2) == 0); z_bytes_reader_t reader = z_bytes_get_reader(z_loan(payload)); @@ -102,6 +99,75 @@ void test_writer() { z_drop(z_move(payload)); } +void test_bounded(void) { + uint32_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + uint32_t data_out[10] = {0}; + + z_owned_bytes_t payload; + z_bytes_empty(&payload); + + z_bytes_writer_t writer = z_bytes_get_writer(z_loan_mut(payload)); + for (size_t i = 0; i < 10; ++i) { + z_owned_bytes_t b; + z_bytes_serialize_from_uint32(&b, data[i]); + assert(z_bytes_writer_append_bounded(&writer, z_move(b)) == 0); + } + { + z_owned_bytes_t b; + z_bytes_serialize_from_str(&b, "test"); + assert(z_bytes_writer_append_bounded(&writer, z_move(b)) == 0); + } + + z_bytes_reader_t reader = z_bytes_get_reader(z_loan(payload)); + + for (size_t i = 0; i < 10; ++i) { + z_owned_bytes_t b; + assert(z_bytes_reader_read_bounded(&reader, &b) == 0); + assert(z_bytes_deserialize_into_uint32(z_loan(b), &data_out[i]) == 0); + z_drop(z_move(b)); + } + assert(!memcmp(data, data_out, 10)); + { + z_owned_string_t s; + z_owned_bytes_t b; + assert(z_bytes_reader_read_bounded(&reader, &b) == 0); + z_bytes_deserialize_into_string(z_loan(b), &s); + assert(strncmp("test", z_string_data(z_loan(s)), z_string_len(z_loan(s))) == 0); + z_drop(z_move(b)); + z_drop(z_move(s)); + } + uint8_t d; + assert(0 == z_bytes_reader_read(&reader, &d, 1)); // we reached the end of the payload + + z_drop(z_move(payload)); +} + +void test_append(void) { + uint8_t data[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + uint8_t data_out[10] = {0}; + + z_owned_bytes_t payload; + z_bytes_empty(&payload); + + z_bytes_writer_t writer = z_bytes_get_writer(z_loan_mut(payload)); + z_bytes_writer_write_all(&writer, data, 5); + { + z_owned_bytes_t b; + z_bytes_serialize_from_buf(&b, data + 5, 5); + assert(z_bytes_writer_append(&writer, z_move(b)) == 0); + } + + z_bytes_reader_t reader = z_bytes_get_reader(z_loan(payload)); + z_bytes_reader_read(&reader, data_out, 10); + + assert(!memcmp(data, data_out, 10)); + + uint8_t d; + assert(0 == z_bytes_reader_read(&reader, &d, 1)); // we reached the end of the payload + + z_drop(z_move(payload)); +} + void custom_deleter(void *data, void *context) { (void)data; size_t *cnt = (size_t *)context; @@ -168,7 +234,7 @@ void test_slice(void) { z_drop(z_move(payload)); \ } -void test_arithmetic() { +void test_arithmetic(void) { TEST_ARITHMETIC(uint8_t, uint8, 5); TEST_ARITHMETIC(uint16_t, uint16, 1000); TEST_ARITHMETIC(uint32_t, uint32, 51000000); @@ -194,7 +260,7 @@ bool iter_body(z_owned_bytes_t *b, void *context) { return true; } -void test_iter() { +void test_iter(void) { uint8_t data_out[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; z_owned_bytes_t payload; @@ -216,7 +282,7 @@ void test_iter() { z_drop(z_move(payload)); } -void test_pair() { +void test_pair(void) { z_owned_bytes_t payload, payload1, payload2, payload1_out, payload2_out; z_bytes_serialize_from_int16(&payload1, -500); z_bytes_serialize_from_double(&payload2, 123.45); @@ -239,6 +305,8 @@ int main(int argc, char **argv) { test_writer(); test_slice(); test_arithmetic(); + test_bounded(); + test_append(); test_iter(); test_pair(); } From ad54bcb614d0c18f7c253b7fe854dd606591a8af Mon Sep 17 00:00:00 2001 From: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Date: Thu, 8 Aug 2024 15:09:05 +0200 Subject: [PATCH 061/397] rename zc_publisher_matching_listener_callback -> zc_publisher_matching_listener_declare; (#581) added zc_publisher_get_matching_status; --- docs/api.rst | 4 ++++ examples/z_pub.c | 2 +- examples/z_pub_shm.c | 2 +- include/zenoh_commons.h | 20 +++++++++++++++----- src/publisher.rs | 32 ++++++++++++++++++++++++++++---- 5 files changed, 49 insertions(+), 11 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 1c2f9f41d..9364c81a6 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -572,6 +572,10 @@ Functions .. doxygenfunction:: zc_closure_matching_status_drop .. doxygenfunction:: zc_closure_matching_status_call +.. doxygenfunction:: zc_publisher_get_matching_status +.. doxygenfunction:: zc_publisher_matching_listener_declare +.. doxygenfunction:: zc_publisher_matching_listener_undeclare + Subscription ============ diff --git a/examples/z_pub.c b/examples/z_pub.c index 08e9a98f2..05d5ae2ab 100644 --- a/examples/z_pub.c +++ b/examples/z_pub.c @@ -68,7 +68,7 @@ int main(int argc, char **argv) { if (add_matching_listener) { zc_owned_closure_matching_status_t callback; z_closure(&callback, matching_status_handler, NULL, NULL); - zc_publisher_matching_listener_callback(&listener, z_loan(pub), z_move(callback)); + zc_publisher_matching_listener_declare(&listener, z_loan(pub), z_move(callback)); } #else if (add_matching_listener) { diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 728b086cf..bf43406c1 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -79,7 +79,7 @@ int main(int argc, char **argv) { if (add_matching_listener) { zc_owned_closure_matching_status_t callback; z_closure(&callback, matching_status_handler, NULL, NULL); - zc_publisher_matching_listener_callback(&listener, z_loan(pub), z_move(callback)); + zc_publisher_matching_listener_declare(&listener, z_loan(pub), z_move(callback)); } #else if (add_matching_listener) { diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 81cbb19b2..8f0ce542f 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -4516,20 +4516,30 @@ ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_owned_liveliness_token_t #if defined(UNSTABLE) ZENOHC_API enum zc_locality_t zc_locality_default(void); #endif +/** + * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. + * + * @return 0 in case of success, negative error code otherwise (in this case matching_status is not updated). + */ +#if defined(UNSTABLE) +ZENOHC_API +z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *this_, + struct zc_matching_status_t *matching_status); +#endif /** * Constructs matching listener, registering a callback for notifying subscribers matching with a given publisher. * * @param this_: An unitilized memory location where matching listener will be constructed. The matching listener will be automatically dropped when publisher is dropped. - * @publisher: A publisher to associate with matching listener. - * @callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). + * @param publisher: A publisher to associate with matching listener. + * @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). * * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_callback(zc_owned_matching_listener_t *this_, - const struct z_loaned_publisher_t *publisher, - struct zc_owned_closure_matching_status_t *callback); +z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, + const struct z_loaned_publisher_t *publisher, + struct zc_owned_closure_matching_status_t *callback); #endif /** * Undeclares the given matching listener, droping and invalidating it. diff --git a/src/publisher.rs b/src/publisher.rs index 094d75ad0..3877c47a3 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -315,13 +315,13 @@ pub struct zc_matching_status_t { /// Constructs matching listener, registering a callback for notifying subscribers matching with a given publisher. /// /// @param this_: An unitilized memory location where matching listener will be constructed. The matching listener will be automatically dropped when publisher is dropped. -/// @publisher: A publisher to associate with matching listener. -/// @callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). +/// @param publisher: A publisher to associate with matching listener. +/// @param callback: A closure that will be called every time the matching status of the publisher changes (If last subscriber, disconnects or when the first subscriber connects). /// /// @return 0 in case of success, negative error code otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn zc_publisher_matching_listener_callback( +pub extern "C" fn zc_publisher_matching_listener_declare( this: &mut MaybeUninit, publisher: &'static z_loaned_publisher_t, callback: &mut zc_owned_closure_matching_status_t, @@ -369,6 +369,30 @@ pub extern "C" fn zc_publisher_matching_listener_undeclare( result::Z_OK } +#[cfg(feature = "unstable")] +/// Gets publisher matching status - i.e. if there are any subscribers matching its key expression. +/// +/// @return 0 in case of success, negative error code otherwise (in this case matching_status is not updated). +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn zc_publisher_get_matching_status( + this: &'static z_loaned_publisher_t, + matching_status: &mut MaybeUninit, +) -> result::z_result_t { + match this.as_rust_type_ref().matching_status().wait() { + Ok(s) => { + matching_status.write(zc_matching_status_t { + matching: s.matching_subscribers(), + }); + result::Z_OK + } + Err(e) => { + tracing::error!("{}", e); + result::Z_ENETWORK + } + } +} + /// Undeclares the given publisher, droping and invalidating it. /// /// @return 0 in case of success, negative error code otherwise. @@ -378,7 +402,7 @@ pub extern "C" fn z_undeclare_publisher(this: &mut z_owned_publisher_t) -> resul if let Some(p) = this.as_rust_type_mut().take() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); - return result::Z_EGENERIC; + return result::Z_ENETWORK; } } result::Z_OK From 320faf6a286bb6bd8fc3a97dee59b85d1a1470d2 Mon Sep 17 00:00:00 2001 From: Yuyuan Yuan Date: Fri, 9 Aug 2024 20:19:43 +0800 Subject: [PATCH 062/397] docs: fix doxygen (#578) * chore: ignore docs/doxyxml * docs: update the README of doxygen * docs: fix the warnings * docs: remove the unnecessary step in macOS * chore: address the review comment --- docs/.gitignore | 1 + docs/README.md | 22 ++++++---------------- docs/api.rst | 17 +++++++---------- 3 files changed, 14 insertions(+), 26 deletions(-) diff --git a/docs/.gitignore b/docs/.gitignore index e35d8850c..772f2ec8f 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1 +1,2 @@ _build +doxyxml diff --git a/docs/README.md b/docs/README.md index 0ed3948ea..41f1052cb 100644 --- a/docs/README.md +++ b/docs/README.md @@ -3,20 +3,10 @@ zenoh-c API documentation is available on [Read the Docs](https://zenoh-c.readthedocs.io/en/latest/index.html). ------------------------------- -## How to build it +## How to build it - -- Ubuntu -- - - ```bash - $ cd docs - $ sphinx-build -b html . _build/html - ``` - - -- MacOS -- - - Update conf.py *Config.set_library_file* with the path to your *libclang.dylib* file. - - ```bash - $ cd docs - $ sphinx-build -b html . _build/html - ``` \ No newline at end of file +```bash +cd docs +doxygen +sphinx-build -b html . _build/html +``` diff --git a/docs/api.rst b/docs/api.rst index 9364c81a6..297ae3151 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -77,7 +77,7 @@ Functions .. doxygenfunction:: z_string_is_empty String Array ------------ +------------ Types ^^^^^ .. doxygenstruct:: z_owned_string_array_t @@ -233,9 +233,6 @@ Functions .. doxygenfunction:: z_encoding_loan_mut .. doxygenfunction:: z_encoding_check .. doxygenfunction:: z_encoding_drop - -.. doxygenfunction:: z_encoding_drop - .. doxygenfunction:: z_encoding_loan_default .. doxygenfunction:: z_encoding_from_str .. doxygenfunction:: z_encoding_from_substr @@ -313,7 +310,7 @@ Predefined Encodings .. doxygenfunction:: z_encoding_video_vp9 Reply Error ------ +----------- Types ^^^^^ .. doxygenstruct:: z_loaned_reply_err_t @@ -629,7 +626,7 @@ Functions .. doxygenfunction:: z_ring_handler_sample_drop .. doxygenfunction:: z_ring_handler_sample_loan .. doxygenfunction:: z_ring_handler_sample_recv -.. doxygenfunction:: z_ring_handler_sample_try_recv +.. doxygenfunction:: z_ring_handler_sample_try_recv Queryable ========= @@ -705,7 +702,7 @@ Functions .. doxygenfunction:: z_ring_handler_query_drop .. doxygenfunction:: z_ring_handler_query_loan .. doxygenfunction:: z_ring_handler_query_recv -.. doxygenfunction:: z_ring_handler_query_try_recv +.. doxygenfunction:: z_ring_handler_query_try_recv Query ===== @@ -770,7 +767,7 @@ Functions .. doxygenfunction:: z_ring_handler_reply_drop .. doxygenfunction:: z_ring_handler_reply_loan .. doxygenfunction:: z_ring_handler_reply_recv -.. doxygenfunction:: z_ring_handler_reply_try_recv +.. doxygenfunction:: z_ring_handler_reply_try_recv Scouting ======== @@ -792,8 +789,8 @@ Functions .. doxygenfunction:: z_hello_locators .. doxygenfunction:: z_hello_zid .. doxygenfunction:: z_hello_loan -.. doxygenfunction:: z_hello_drop -.. doxygenfunction:: z_hello_null +.. doxygenfunction:: z_hello_drop +.. doxygenfunction:: z_hello_null .. doxygenfunction:: z_hello_check .. doxygenfunction:: z_whatami_to_view_string From 5a82ecfd6154adf30ff96efe9b7838018134a528 Mon Sep 17 00:00:00 2001 From: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Date: Fri, 9 Aug 2024 16:20:31 +0200 Subject: [PATCH 063/397] add valgrind memory leaks check (#584) * added pub sub test for memory leaks * added valgrind test * format * ci fix * ci fix * add queryable-get memory leaks test * do not copy memory leaks script * fixed memory leak in handlers * docs update * format * format --- .github/workflows/ci.yml | 4 + Cargo.lock | 1 + Cargo.toml | 1 + Cargo.toml.in | 1 + docs/api.rst | 8 ++ include/zenoh_commons.h | 8 ++ src/closures/query_channel.rs | 2 +- src/closures/response_channel.rs | 2 +- src/closures/sample_channel.rs | 2 +- src/lib.rs | 9 ++ tests/CMakeLists.txt | 9 +- tests/run_leak_check.sh | 19 +++++ tests/z_leak_pub_sub_test.c | 98 ++++++++++++++++++++++ tests/z_leak_queryable_get_test.c | 131 ++++++++++++++++++++++++++++++ 14 files changed, 291 insertions(+), 4 deletions(-) create mode 100755 tests/run_leak_check.sh create mode 100644 tests/z_leak_pub_sub_test.c create mode 100644 tests/z_leak_queryable_get_test.c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3566327b..c7032a88a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,6 +49,10 @@ jobs: cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local cmake --build . --target install --config Release + - name: Install valgrind + uses: taiki-e/install-action@valgrind + if: matrix.os == 'ubuntu-latest' + - name: Run cmake tests with zenoh-c as dynamic library shell: bash run: | diff --git a/Cargo.lock b/Cargo.lock index 5b820a761..bdd61aca9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3611,6 +3611,7 @@ dependencies = [ "unwrap-infallible", "zenoh", "zenoh-ext", + "zenoh-runtime", "zenoh-util", ] diff --git a/Cargo.toml b/Cargo.toml index e794d8262..367ff9ed2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,7 @@ unwrap-infallible = "0.1.5" const_format = "0.2.32" zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-runtime = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" diff --git a/Cargo.toml.in b/Cargo.toml.in index 42a2b0eb3..7f60c486b 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -54,6 +54,7 @@ unwrap-infallible = "0.1.5" const_format = "0.2.32" zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-runtime = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" diff --git a/docs/api.rst b/docs/api.rst index 297ae3151..6bd722e18 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -893,3 +893,11 @@ Functions .. doxygenfunction:: zc_init_logging .. doxygenfunction:: zc_init_logging_with_callback + + +Other +===== + +Functions +--------- +.. doxygenfunction:: zc_stop_z_runtime \ No newline at end of file diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 8f0ce542f..24bfc5817 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -4599,6 +4599,14 @@ ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif +/** + * Stops all Zenoh tasks and drops all related static variables. + * All Zenoh-related structures should be properly dropped/undeclared PRIOR to this call. + * None of Zenoh functionality can be used after this call. + * Useful to suppress memory leaks messages due to Zenoh static variables (since they are never destroyed due to Rust language design). + */ +ZENOHC_API +void zc_stop_z_runtime(void); /** * Constructs and declares a publication cache. * diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index f24f7033b..1b3c9cccb 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -61,7 +61,7 @@ extern "C" fn __z_handler_query_send(query: &z_loaned_query_t, context: *mut c_v extern "C" fn __z_handler_query_drop(context: *mut c_void) { unsafe { - let f = (context as *mut Arc).read(); + let f = Box::from_raw(context as *mut Arc); std::mem::drop(f); } } diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index f106a56a2..518d3eb7b 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -61,7 +61,7 @@ extern "C" fn __z_handler_reply_send(reply: &z_loaned_reply_t, context: *mut c_v extern "C" fn __z_handler_reply_drop(context: *mut c_void) { unsafe { - let f = (context as *mut Arc).read(); + let f = Box::from_raw(context as *mut Arc); std::mem::drop(f); } } diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index b74fc9b28..6f84f3b3d 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -63,7 +63,7 @@ extern "C" fn __z_handler_sample_send(sample: &z_loaned_sample_t, context: *mut extern "C" fn __z_handler_sample_drop(context: *mut c_void) { unsafe { - let f = (context as *mut Arc).read(); + let f = Box::from_raw(context as *mut Arc); std::mem::drop(f); } } diff --git a/src/lib.rs b/src/lib.rs index 2a7633e19..3ff20ae0f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -162,3 +162,12 @@ impl CopyableToCArray for &str { self.as_bytes().copy_to_c_array(buf, len) } } + +/// Stops all Zenoh tasks and drops all related static variables. +/// All Zenoh-related structures should be properly dropped/undeclared PRIOR to this call. +/// None of Zenoh functionality can be used after this call. +/// Useful to suppress memory leaks messages due to Zenoh static variables (since they are never destroyed due to Rust language design). +#[no_mangle] +pub extern "C" fn zc_stop_z_runtime() { + let _z = zenoh_runtime::ZRuntimePoolGuard; +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 69e7e1530..64f2bbc5c 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -29,6 +29,8 @@ foreach(file ${files}) set(test_type "integration") elseif (${file} MATCHES "^.*z_build_.*$") set(test_type "build") + elseif (${file} MATCHES "^.*z_leak_.*$") + set(test_type "leak") else() message(FATAL_ERROR "Test file ${file} does not match any known type (z_api_ or z_int_ or z_build)") endif() @@ -39,6 +41,11 @@ foreach(file ${files}) target_link_libraries(${target} PRIVATE zenohc::lib Threads::Threads) copy_dlls(${target}) set_property(TARGET ${target} PROPERTY C_STANDARD 11) - add_test(NAME "${test_type}_${target}" COMMAND ${target}) + find_program(VALGRIND valgrind) + if (NOT(test_type STREQUAL leak)) + add_test(NAME "${test_type}_${target}" COMMAND ${target}) + elseif(VALGRIND) + add_test(NAME "${test_type}_${target}" COMMAND bash ${PROJECT_SOURCE_DIR}/tests/run_leak_check.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}) + endif() endforeach() diff --git a/tests/run_leak_check.sh b/tests/run_leak_check.sh new file mode 100755 index 000000000..7ce533bd8 --- /dev/null +++ b/tests/run_leak_check.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash +set -e +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +function check_leaks { + echo "Checking $1 for memory leaks" + valgrind --leak-check=full --num-callers=50 --log-file="$1.leaks.log" $1 + num_leaks=$(grep 'ERROR SUMMARY: [0-9]+' -Eo "$1.leaks.log" | grep '[0-9]+' -Eo) + echo "Detected $num_leaks memory leaks" + if (( num_leaks == 0 )) + then + return 0 + else + cat $1.leaks.log + return -1 + fi +} + +check_leaks $1 diff --git a/tests/z_leak_pub_sub_test.c b/tests/z_leak_pub_sub_test.c new file mode 100644 index 000000000..231d8b39e --- /dev/null +++ b/tests/z_leak_pub_sub_test.c @@ -0,0 +1,98 @@ +// +// Copyright (c) 2024 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, + +#include +#include +#include +#include + +#include "zenoh.h" + +#undef NDEBUG +#include + +const char *PUB_KEY_EXPR = "test/valgrind/data"; +const char *SUB_KEY_EXPR = "test/valgrind/**"; + +void data_handler(const z_loaned_sample_t *sample, void *context) { + (void)context; + z_view_string_t key_string; + z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_string); + + z_owned_string_t payload_string; + z_bytes_deserialize_into_string(z_sample_payload(sample), &payload_string); + + printf(">> [Subscriber] Received ('%.*s': '%.*s')\n", (int)z_string_len(z_loan(key_string)), + z_string_data(z_loan(key_string)), (int)z_string_len(z_loan(payload_string)), + z_string_data(z_loan(payload_string))); + z_drop(z_move(payload_string)); +} + +int main(int argc, char **argv) { + printf("Declaring Publisher on %s\n", PUB_KEY_EXPR); + + z_owned_keyexpr_t pub_keyexpr; + z_keyexpr_from_str(&pub_keyexpr, PUB_KEY_EXPR); + + z_owned_config_t pub_config; + z_config_default(&pub_config); + + z_owned_session_t pub_session; + z_open(&pub_session, z_move(pub_config)); + + z_owned_publisher_t publisher; + z_declare_publisher(&publisher, z_loan(pub_session), z_loan(pub_keyexpr), NULL); + + printf("Declaring Subscriber on %s\n", SUB_KEY_EXPR); + + z_view_keyexpr_t sub_keyexpr; + z_view_keyexpr_from_str(&sub_keyexpr, SUB_KEY_EXPR); + + z_owned_config_t sub_config; + z_config_default(&sub_config); + + z_owned_session_t sub_session; + z_open(&sub_session, z_move(sub_config)); + + z_owned_closure_sample_t callback; + z_closure(&callback, data_handler, NULL, NULL); + + z_owned_subscriber_t subscriber; + z_declare_subscriber(&subscriber, z_loan(sub_session), z_loan(sub_keyexpr), z_move(callback), NULL); + + z_sleep_s(1); + + char buf[32] = {0}; + for (int i = 0; i < 5; ++i) { + sprintf(buf, "data [%4d]", i); + printf("Putting Data ('%s': '%s')...\n", PUB_KEY_EXPR, buf); + z_publisher_put_options_t options; + z_publisher_put_options_default(&options); + + z_owned_bytes_t payload; + z_bytes_serialize_from_str(&payload, buf); + + z_publisher_put(z_loan(publisher), z_move(payload), &options); + z_sleep_s(1); + } + + z_undeclare_publisher(z_move(publisher)); + z_undeclare_subscriber(z_move(subscriber)); + z_close(z_move(pub_session)); + z_close(z_move(sub_session)); + z_drop(z_move(pub_keyexpr)); + + zc_stop_z_runtime(); + + return 0; +} diff --git a/tests/z_leak_queryable_get_test.c b/tests/z_leak_queryable_get_test.c new file mode 100644 index 000000000..58f755950 --- /dev/null +++ b/tests/z_leak_queryable_get_test.c @@ -0,0 +1,131 @@ +// +// Copyright (c) 2024 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, + +#include +#include +#include +#include + +#include "zenoh.h" + +#undef NDEBUG +#include + +const char *GET_KEY_EXPR = "test/valgrind/data"; +const char *QUERYABLE_KEY_EXPR = "test/valgrind/**"; + +void query_handler(const z_loaned_query_t *query, void *context) { + (void)context; + z_view_string_t key_string; + z_keyexpr_as_view_string(z_query_keyexpr(query), &key_string); + + z_view_string_t params; + z_query_parameters(query, ¶ms); + + const z_loaned_bytes_t *payload = z_query_payload(query); + + z_owned_string_t payload_string; + z_bytes_deserialize_into_string(payload, &payload_string); + + printf(">> [Queryable ] Received Query '%.*s' with value '%.*s'\n", (int)z_string_len(z_loan(key_string)), + z_string_data(z_loan(key_string)), (int)z_string_len(z_loan(payload_string)), + z_string_data(z_loan(payload_string))); + z_drop(z_move(payload_string)); + z_query_reply_options_t options; + z_query_reply_options_default(&options); + + z_owned_bytes_t reply_payload; + z_bytes_clone(&reply_payload, payload); + + z_query_reply(query, z_query_keyexpr(query), z_move(reply_payload), &options); +} + +int main(int argc, char **argv) { + printf("Declaring Queryable on %s\n", QUERYABLE_KEY_EXPR); + + z_owned_keyexpr_t queryable_keyexpr; + z_keyexpr_from_str(&queryable_keyexpr, QUERYABLE_KEY_EXPR); + + z_owned_config_t queryable_config; + z_config_default(&queryable_config); + + z_owned_session_t queryable_session; + z_open(&queryable_session, z_move(queryable_config)); + + z_owned_closure_query_t callback; + z_closure(&callback, query_handler, NULL, NULL); + z_owned_queryable_t queryable; + z_declare_queryable(&queryable, z_loan(queryable_session), z_loan(queryable_keyexpr), z_move(callback), NULL); + + z_view_keyexpr_t get_keyexpr; + z_view_keyexpr_from_str(&get_keyexpr, GET_KEY_EXPR); + + z_owned_config_t get_config; + z_config_default(&get_config); + + z_owned_session_t get_session; + z_open(&get_session, z_move(get_config)); + + z_sleep_s(1); + + size_t received_replies = 0; + char buf[32] = {0}; + for (int i = 0; i < 5; ++i) { + sprintf(buf, "data [%4d]", i); + printf("Get with Data ('%s': '%s')...\n", GET_KEY_EXPR, buf); + z_get_options_t options; + z_get_options_default(&options); + + z_owned_bytes_t payload; + z_bytes_serialize_from_str(&payload, buf); + + options.payload = z_move(payload); + + z_owned_fifo_handler_reply_t handler; + z_owned_closure_reply_t closure; + z_fifo_channel_reply_new(&closure, &handler, 16); + + z_get(z_loan(get_session), z_loan(get_keyexpr), "", z_move(closure), &options); + + z_owned_reply_t reply; + while (z_recv(z_loan(handler), &reply) == Z_OK) { + received_replies++; + const z_loaned_sample_t *sample = z_reply_ok(z_loan(reply)); + assert(sample != NULL); + + z_view_string_t key_str; + z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_str); + + z_owned_string_t reply_str; + z_bytes_deserialize_into_string(z_sample_payload(sample), &reply_str); + + printf(">> Received ('%.*s': '%.*s')\n", (int)z_string_len(z_loan(key_str)), z_string_data(z_loan(key_str)), + (int)z_string_len(z_loan(reply_str)), z_string_data(z_loan(reply_str))); + z_drop(z_move(reply_str)); + z_drop(z_move(reply)); + } + + z_drop(z_move(handler)); + z_sleep_s(1); + } + assert(received_replies == 5); + + z_undeclare_queryable(z_move(queryable)); + z_close(z_move(get_session)); + z_close(z_move(queryable_session)); + z_drop(z_move(queryable_keyexpr)); + + zc_stop_z_runtime(); + + return 0; +} From 7e41056a4fa069c0aa2739b805174d5c8ac1670f Mon Sep 17 00:00:00 2001 From: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:28:07 +0200 Subject: [PATCH 064/397] attempt to address ci no more space issue (#585) * attempt to address ci no more space issue * remove env settings * add CARGO_PROFILE_DEV_DEBUG=false --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c7032a88a..093142d88 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,10 @@ on: schedule: - cron: "0 6 * * 1-5" +env: + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + CARGO_PROFILE_DEV_DEBUG: false + jobs: check_format: name: Check codebase format with clang-format From 2d20612f1bc4768912d75c3edc654c3f96625e01 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Sat, 10 Aug 2024 02:37:57 +0200 Subject: [PATCH 065/397] build: Sync with eclipse-zenoh/zenoh@fef38dc from 2024-08-09 (#586) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 007e01fcc..8da0a9f00 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#f47354cf0ab8f76e8a7079553873e716e7d880b8" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" dependencies = [ "async-std", "async-trait", From bb086c8aff2036b3b8bfe79a1b2d59c56216ddc4 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Mon, 12 Aug 2024 11:03:54 +0200 Subject: [PATCH 066/397] Move protection (#488) * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * build fixes * zc_ prefix for log function * zc_ prefix in example * regenerated files * cargo fmt * undeclare as drop * removed _undeclare parsing * missing drop/check funcs added. verification added to build.rs * cargo fmt * tests fix * test fix * cmake fix * null drop test same as in pico, take corrected --------- Co-authored-by: Mahmoud Mazouz Co-authored-by: Luca Cominardi --- .github/workflows/ci.yml | 7 + CMakeLists.txt | 3 +- build.rs | 488 +++++++++--- examples/z_get.c | 4 +- examples/z_get_shm.c | 2 +- examples/z_non_blocking_get.c | 2 +- examples/z_pong.c | 2 +- examples/z_pub_attachment.c | 2 +- examples/z_put.c | 3 +- examples/z_queryable_with_channels.c | 1 - examples/z_sub_thr.c | 1 - include/zenoh_commons.h | 932 ++++++++++++----------- include/zenoh_macros.h | 972 +++++++++++++++++++----- include/zenoh_memory.h | 2 +- src/closures/hello_closure.rs | 25 +- src/closures/log_closure.rs | 37 +- src/closures/matching_status_closure.rs | 26 +- src/closures/query_channel.rs | 34 +- src/closures/query_closure.rs | 24 +- src/closures/reply_closure.rs | 24 +- src/closures/response_channel.rs | 31 +- src/closures/sample_channel.rs | 34 +- src/closures/sample_closure.rs | 24 +- src/closures/zenohid_closure.rs | 27 +- src/collections.rs | 76 +- src/commons.rs | 23 +- src/config.rs | 13 +- src/encoding.rs | 10 +- src/get.rs | 81 +- src/info.rs | 22 +- src/keyexpr.rs | 32 +- src/lib.rs | 6 +- src/liveliness.rs | 49 +- src/payload.rs | 165 ++-- src/platform/synchronization.rs | 62 +- src/publication_cache.rs | 30 +- src/publisher.rs | 162 ++-- src/put.rs | 83 +- src/queryable.rs | 162 ++-- src/querying_subscriber.rs | 66 +- src/scouting.rs | 33 +- src/session.rs | 29 +- src/shm/buffer/zshm.rs | 19 +- src/shm/buffer/zshmmut.rs | 18 +- src/shm/client/shm_client.rs | 12 +- src/shm/client_storage/mod.rs | 41 +- src/shm/provider/alloc_layout.rs | 13 +- src/shm/provider/shm_provider.rs | 12 +- src/shm/provider/types.rs | 28 +- src/subscriber.rs | 39 +- src/transmute.rs | 385 +++++++++- tests/CMakeLists.txt | 23 +- tests/z_api_alignment_test.c | 12 +- tests/z_api_drop_options.c | 6 +- tests/z_api_keyexpr_test.c | 10 +- tests/z_api_null_drop_test.c | 202 ++--- tests/z_api_shm_test.c | 36 +- tests/z_api_unitinialized_check.c | 6 +- tests/z_int_pub_sub_attachment_test.c | 2 +- tests/z_int_pub_sub_test.c | 2 +- tests/z_int_queryable_attachment_test.c | 6 +- tests/z_int_queryable_test.c | 4 +- 62 files changed, 3003 insertions(+), 1684 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 093142d88..1fdf3d305 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,6 +65,13 @@ jobs: cmake --build . --target tests --config Release ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_static)" + - name: Build cmake tests with C++ compiler to make sure that C API is C++ compatible + shell: bash + run: | + cd build + cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Debug -DZENOHC_BUILD_TESTS_WITH_CXX=TRUE + cmake --build . --target tests --config Debug + - name: Run cmake tests with zenoh-c as static library shell: bash run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index bdf872595..e0e13dbed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ project( VERSION ${version} DESCRIPTION "The C bindings for Zenoh" HOMEPAGE_URL "https://github.com/eclipse-zenoh/zenoh-c" - LANGUAGES C + LANGUAGES C CXX ) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) @@ -30,6 +30,7 @@ declare_cache_var_true_if_vscode(ZENOHC_BUILD_IN_SOURCE_TREE "Do build inside so declare_cache_var(ZENOHC_BUILD_WITH_LOGGER_AUTOINIT TRUE BOOL "Enable logger-autoinit zenoh-c feature") declare_cache_var(ZENOHC_BUILD_WITH_SHARED_MEMORY FALSE BOOL "Enable shared-memory zenoh-c feature") declare_cache_var(ZENOHC_BUILD_WITH_UNSTABLE_API TRUE BOOL "Enable unstable API feature") +declare_cache_var(ZENOHC_BUILD_TESTS_WITH_CXX FALSE BOOL "Use C++ compiler for building tests to check API's C++ compatibility") declare_cache_var(ZENOHC_CUSTOM_TARGET "" STRING "Rust target for cross compilation, 'aarch64-unknown-linux-gnu' for example") declare_cache_var(ZENOHC_CARGO_CHANNEL "" STRING "Cargo channel parameter. Should be '+stable', '+nightly' or empty value") declare_cache_var(ZENOHC_CARGO_FLAGS "" STRING "Additional cargo flags") diff --git a/build.rs b/build.rs index 008d964f6..ca09135ee 100644 --- a/build.rs +++ b/build.rs @@ -1,3 +1,4 @@ +use core::panic; use std::{ borrow::Cow, collections::{HashMap, HashSet}, @@ -126,6 +127,25 @@ fn produce_opaque_types_data() -> PathBuf { output_file_path } +fn split_type_name(type_name: &str) -> (&str, Option<&str>, &str, &str) { + let mut split = type_name.split('_'); + let prefix = split + .next() + .unwrap_or_else(|| panic!("Fist '_' not found in type name: {type_name}")); + let cat = split + .next() + .unwrap_or_else(|| panic!("Second '_' not found in type name: {type_name}")); + let category = if cat != "owned" && cat != "loaned" && cat != "moved" { + None + } else { + Some(cat) + }; + let postfix = split.next_back().expect("Type should end with '_t'"); + let prefix_cat_len = prefix.len() + 1 + category.map(|c| c.len() + 1).unwrap_or(0); + let semantic = &type_name[prefix_cat_len..type_name.len() - postfix.len() - 1]; + (prefix, category, semantic, postfix) +} + fn generate_opaque_types() { let type_to_inner_field_name = HashMap::from([("z_id_t", "pub id")]); let current_folder = get_build_rs_path(); @@ -139,14 +159,44 @@ fn generate_opaque_types() { let re = Regex::new(r"type: (\w+), align: (\d+), size: (\d+)").unwrap(); for (_, [type_name, align, size]) in re.captures_iter(&data_in).map(|c| c.extract()) { let inner_field_name = type_to_inner_field_name.get(type_name).unwrap_or(&"_0"); - let s = format!( - "#[derive(Copy, Clone)] -#[repr(C, align({align}))] + let (prefix, category, semantic, postfix) = split_type_name(type_name); + let mut s = String::new(); + if category != Some("owned") { + s += "#[derive(Copy, Clone)]\n"; + }; + s += format!( + "#[repr(C, align({align}))] pub struct {type_name} {{ {inner_field_name}: [u8; {size}], }} " - ); + ) + .as_str(); + if category == Some("owned") { + let moved_type_name = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); + s += format!( + "#[repr(C)] +#[derive(Default)] +pub struct {moved_type_name} {{ + pub _ptr: Option<&'static mut {type_name}>, +}} + +impl {moved_type_name} {{ + pub fn take(&mut self) -> Option<{type_name}> {{ + self._ptr.take().map(std::mem::take) + }} +}} + +impl From> for {moved_type_name} {{ + fn from(ptr: Option<&'static mut {type_name}>) -> Self {{ + Self {{ _ptr: ptr }} + }} +}} +" + ) + .as_str(); + } + let doc = docs .remove(type_name) .unwrap_or_else(|| panic!("Failed to extract docs for opaque type: {type_name}")); @@ -846,11 +896,28 @@ impl FuncArg { } #[derive(Clone, Debug)] pub struct FunctionSignature { + entity_name: String, // the signifcant part of name, e.g. `session` for `z_session_t` return_type: Ctype, func_name: String, args: Vec, } +impl FunctionSignature { + pub fn new( + entity_name: &str, + return_type: &str, + func_name: String, + args: Vec, + ) -> Self { + FunctionSignature { + entity_name: entity_name.to_owned(), + return_type: Ctype::new(return_type), + func_name, + args, + } + } +} + pub fn create_generics_header(path_in: &str, path_out: &str) { let mut file_out = std::fs::File::options() .read(false) @@ -861,91 +928,196 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { .open(path_out) .unwrap(); - let header = "#pragma once - + file_out + .write_all( + "#pragma once // clang-format off + +" + .as_bytes(), + ) + .unwrap(); + + // + // C part + // + file_out + .write_all( + " #ifndef __cplusplus +" + .as_bytes(), + ) + .unwrap(); -"; - file_out.write_all(header.as_bytes()).unwrap(); + // Collect all function signatures to be wrappeb by macros and verify that all necessary functions are present for each entity + let (move_funcs, take_funcs) = make_move_take_signatures(path_in); + let loan_funcs = find_loan_functions(path_in); + let loan_mut_funcs = find_loan_mut_functions(path_in); + let drop_funcs = find_drop_functions(path_in); + let null_funcs = find_null_functions(path_in); + let check_funcs = find_check_functions(path_in); + let call_funcs = find_call_functions(path_in); + let recv_funcs = find_recv_functions(path_in); + + let drops = drop_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let moves = move_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let takes = take_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let nulls = null_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let checks = check_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + + let mut msgs = Vec::new(); + + // More checks can be added here - let type_name_to_loan_func = find_loan_functions(path_in); - let out = generate_generic_loan_c(&type_name_to_loan_func); + if drops != nulls { + msgs.push(format!( + "the list of z_xxx_drop and z_xxx_null functions are different:\n missing z_xxx_null for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&nulls), + nulls.difference(&drops) + )); + } + + if drops != checks { + msgs.push(format!( + "the list of z_xxx_drop and z_xxx_check functions are different:\n missing z_xxx_check for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&checks), + checks.difference(&drops) + )); + } + + if drops != moves { + msgs.push(format!( + "the list of z_xxx_drop and z_xxx_move functions are different:\n missing z_xxx_move for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&moves), + moves.difference(&drops) + )); + } + + if drops != takes { + msgs.push(format!( + "the list of z_xxx_drop and z_xxx_take functions are different:\n missing z_xxx_take for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&takes), + takes.difference(&drops) + )); + } + + if !msgs.is_empty() { + panic!("Some functions are missing:\n{}", msgs.join("\n")); + } + + let out = generate_move_functions_c(&move_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let type_name_to_loan_mut_func = find_loan_mut_functions(path_in); - let out = generate_generic_loan_mut_c(&type_name_to_loan_mut_func); + let out = generate_generic_loan_c(&loan_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let type_name_to_drop_func = find_drop_functions(path_in); - let out = generate_generic_drop_c(&type_name_to_drop_func); + let out = generate_generic_loan_mut_c(&loan_mut_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_move_c(&type_name_to_drop_func); + let out = generate_generic_drop_c(&drop_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let type_name_to_null_func = find_null_functions(path_in); - let out = generate_generic_null_c(&type_name_to_null_func); + let out = generate_generic_move_c(&move_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let type_name_to_check_func = find_check_functions(path_in); - let out = generate_generic_check_c(&type_name_to_check_func); + let out = generate_generic_null_c(&null_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let type_name_to_call_func = find_call_functions(path_in); - let out = generate_generic_call_c(&type_name_to_call_func); + let out = generate_take_functions(&take_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_closure_c(&type_name_to_call_func); + let out = generate_generic_take_c(&take_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_check_c(&check_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_call_c(&call_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_closure_c(&call_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let recv_funcs = find_recv_functions(path_in); let out = generate_generic_recv_c(&recv_funcs); file_out.write_all(out.as_bytes()).unwrap(); + // + // C++ part + // file_out .write_all("\n#else // #ifndef __cplusplus\n".as_bytes()) .unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_loan_cpp(&type_name_to_loan_func); + let out = generate_move_functions_cpp(&move_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_cpp(&loan_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_mut_cpp(&loan_mut_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_drop_cpp(&drop_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_loan_mut_cpp(&type_name_to_loan_mut_func); + let out = generate_generic_move_cpp(&move_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_drop_cpp(&type_name_to_drop_func); + let out = generate_generic_null_cpp(&null_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_move_cpp(&type_name_to_drop_func); + let out = generate_take_functions(&take_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_null_cpp(&type_name_to_null_func); + let out = generate_generic_take_cpp(&take_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_check_cpp(&type_name_to_check_func); + let out = generate_generic_check_cpp(&check_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_call_cpp(&type_name_to_call_func); + let out = generate_generic_call_cpp(&call_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_closure_cpp(&type_name_to_call_func); + let out = generate_generic_closure_cpp(&call_funcs); file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); @@ -953,16 +1125,49 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { file_out.write_all(out.as_bytes()).unwrap(); file_out.write_all("\n\n".as_bytes()).unwrap(); - let out = generate_generic_loan_to_owned_type_cpp( - &[type_name_to_loan_func, type_name_to_loan_mut_func].concat(), - ); + let out = generate_generic_loan_to_owned_type_cpp(&[loan_funcs, loan_mut_funcs].concat()); file_out.write_all(out.as_bytes()).unwrap(); file_out - .write_all("\n#endif // #ifndef __cplusplus".as_bytes()) + .write_all("\n#endif // #ifndef __cplusplus\n\n".as_bytes()) .unwrap(); } +pub fn make_move_take_signatures( + path_in: &str, +) -> (Vec, Vec) { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"(\w+)_drop\(struct (\w+) (\w+)\);").unwrap(); + let mut move_funcs = Vec::::new(); + let mut take_funcs = Vec::::new(); + + for (_, [func_name_prefix, arg_type, arg_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + let (prefix, _, semantic, postfix) = split_type_name(arg_type); + let z_owned_type = format!("{}_{}_{}_{}*", prefix, "owned", semantic, postfix); + let z_moved_type = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); + let move_f = FunctionSignature::new( + semantic, + arg_type, + func_name_prefix.to_string() + "_move", + vec![FuncArg::new(&z_owned_type, arg_name)], + ); + let take_f = FunctionSignature::new( + semantic, + "void", + func_name_prefix.to_string() + "_take", + vec![ + FuncArg::new(&z_owned_type, arg_name), + FuncArg::new(&z_moved_type, "x"), + ], + ); + move_funcs.push(move_f); + take_funcs.push(take_f); + } + (move_funcs, take_funcs) +} + pub fn find_loan_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); let re = Regex::new(r"const struct (\w+) \*(\w+)_loan\(const struct (\w+) \*(\w+)\);").unwrap(); @@ -971,14 +1176,16 @@ pub fn find_loan_functions(path_in: &str) -> Vec { for (_, [return_type, func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { - let f = FunctionSignature { - return_type: Ctype::new(&("const ".to_string() + return_type + "*")), - func_name: func_name.to_string() + "_loan", - args: vec![FuncArg::new( + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + &("const ".to_string() + return_type + "*"), + func_name.to_string() + "_loan", + vec![FuncArg::new( &("const ".to_string() + arg_type + "*"), arg_name, )], - }; + ); res.push(f); } res @@ -992,11 +1199,13 @@ pub fn find_loan_mut_functions(path_in: &str) -> Vec { for (_, [return_type, func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { - let f = FunctionSignature { - return_type: Ctype::new(&(return_type.to_string() + "*")), - func_name: func_name.to_string() + "_loan_mut", - args: vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], - }; + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + &(return_type.to_string() + "*"), + func_name.to_string() + "_loan_mut", + vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], + ); res.push(f); } res @@ -1004,15 +1213,25 @@ pub fn find_loan_mut_functions(path_in: &str) -> Vec { pub fn find_drop_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"(\w+)_drop\(struct (\w+) \*(\w+)\);").unwrap(); + let re = Regex::new(r"(.+?) +(\w+_drop)\(struct (\w+) (\w+)\);").unwrap(); let mut res = Vec::::new(); - for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { - let f = FunctionSignature { - return_type: Ctype::new("void"), - func_name: func_name.to_string() + "_drop", - args: vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], - }; + for (_, [return_type, func_name, arg_type, arg_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + // if necessary, other prefixes like "extern", "static", etc. can be removed here + let return_type = return_type + .split(' ') + .filter(|x| *x != "ZENOHC_API") + .collect::>() + .join(" "); + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + return_type.as_str(), + func_name.to_string(), + vec![FuncArg::new(arg_type, arg_name)], + ); res.push(f); } res @@ -1024,11 +1243,13 @@ pub fn find_null_functions(path_in: &str) -> Vec { let mut res = Vec::::new(); for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { - let f = FunctionSignature { - return_type: Ctype::new("void"), - func_name: func_name.to_string() + "_null", - args: vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], - }; + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + "void", + func_name.to_string() + "_null", + vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], + ); res.push(f); } res @@ -1040,14 +1261,16 @@ pub fn find_check_functions(path_in: &str) -> Vec { let mut res = Vec::::new(); for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { - let f = FunctionSignature { - return_type: Ctype::new("bool"), - func_name: func_name.to_string() + "_check", - args: vec![FuncArg::new( + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + "bool", + func_name.to_string() + "_check", + vec![FuncArg::new( &("const ".to_string() + arg_type + "*"), arg_name, )], - }; + ); res.push(f); } res @@ -1056,27 +1279,31 @@ pub fn find_check_functions(path_in: &str) -> Vec { pub fn find_call_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); let re = Regex::new( - r"(\w+) (\w+)_call\(const struct (\w+) \*(\w+),\s+(\w*)\s*struct (\w+) \*(\w+)\);", + r"(\w+) (\w+)_call\(const struct (\w+) \*(\w+),\s+(\w*)\s*struct (\w+) (\*?)(\w+)\);", ) .unwrap(); let mut res = Vec::::new(); - for (_, [return_type, func_name, closure_type, closure_name, arg_cv, arg_type, arg_name]) in - re.captures_iter(&bindings).map(|c| c.extract()) + for ( + _, + [return_type, func_name, closure_type, closure_name, arg_cv, arg_type, arg_deref, arg_name], + ) in re.captures_iter(&bindings).map(|c| c.extract()) { let arg_cv: String = if arg_cv.is_empty() { "".to_string() } else { "const ".to_string() }; - let f = FunctionSignature { - return_type: Ctype::new(return_type), - func_name: func_name.to_string() + "_call", - args: vec![ + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + return_type, + func_name.to_string() + "_call", + vec![ FuncArg::new(&("const ".to_string() + closure_type + "*"), closure_name), - FuncArg::new(&(arg_cv + arg_type + "*"), arg_name), + FuncArg::new(&(arg_cv + arg_type + arg_deref), arg_name), ], - }; + ); res.push(f); } res @@ -1090,14 +1317,16 @@ pub fn find_recv_functions(path_in: &str) -> Vec { for (_, [return_type, handler_type, value_type, arg1_type, arg1_name, arg2_type, arg2_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { - let f = FunctionSignature { - return_type: Ctype::new(return_type), - func_name: "z_".to_string() + handler_type + "_handler_" + value_type + "_recv", - args: vec![ + let (_, _, semantic, _) = split_type_name(arg1_type); + let f = FunctionSignature::new( + semantic, + return_type, + "z_".to_string() + handler_type + "_handler_" + value_type + "_recv", + vec![ FuncArg::new(&("const ".to_string() + arg1_type + "*"), arg1_name), FuncArg::new(&(arg2_type.to_string() + "*"), arg2_name), ], - }; + ); res.push(f); } res @@ -1108,20 +1337,32 @@ pub fn generate_generic_c( generic_name: &str, decay: bool, ) -> String { - let va_args = macro_func.iter().any(|f| f.args.len() > 1); + let va_args = macro_func + .iter() + .any(|f| f.args.len() != macro_func[0].args.len()); + let mut args = macro_func[0] + .args + .iter() + .map(|a| a.name.to_string()) + .collect::>(); let mut out = if va_args { format!( - "#define {generic_name}(x, ...) \\ - _Generic((x)" + "#define {generic_name}({}, ...) \\ + _Generic(({})", + args.join(", "), + args[0], ) } else { format!( - "#define {generic_name}(x) \\ - _Generic((x)" + "#define {generic_name}({}) \\ + _Generic(({})", + args.join(", "), + args[0], ) }; - - let x = if decay { "&x" } else { "x" }; + if decay { + args[0] = format!("&{}", args[0]); + } for func in macro_func { let owned_type = if decay { @@ -1135,9 +1376,9 @@ pub fn generate_generic_c( } out += " \\\n"; if va_args { - out += &format!(" )({x}, __VA_ARGS__)"); + out += &format!(" )({}, __VA_ARGS__)", args.join(", ")); } else { - out += &format!(" )({x})"); + out += &format!(" )({})", args.join(", ")); } out } @@ -1150,12 +1391,65 @@ pub fn generate_generic_loan_mut_c(macro_func: &[FunctionSignature]) -> String { generate_generic_c(macro_func, "z_loan_mut", true) } +pub fn generate_generic_move_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_move", true) +} + +pub fn generate_generic_take_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_take", false) +} + pub fn generate_generic_drop_c(macro_func: &[FunctionSignature]) -> String { generate_generic_c(macro_func, "z_drop", false) } -pub fn generate_generic_move_c(_macro_func: &[FunctionSignature]) -> String { - "#define z_move(x) (&x)".to_string() +pub fn generate_take_functions(macro_func: &[FunctionSignature]) -> String { + let mut out = String::new(); + for sig in macro_func { + let (prefix, _, semantic, _) = split_type_name(&sig.args[0].typename.typename); + out += &format!( + "static inline void {}({} {}, {} {}) {{ *{} = *{}._ptr; {}_{}_null({}._ptr); }}\n", + sig.func_name, + sig.args[0].typename.typename, + sig.args[0].name, + sig.args[1].typename.typename, + sig.args[1].name, + sig.args[0].name, + sig.args[1].name, + prefix, + semantic, + sig.args[1].name, + ); + } + out +} + +pub fn generate_move_functions_c(macro_func: &[FunctionSignature]) -> String { + let mut out = String::new(); + for sig in macro_func { + out += &format!( + "static inline {} {}({} x) {{ return ({}){{x}}; }}\n", + sig.return_type.typename, + sig.func_name, + sig.args[0].typename.typename, + sig.return_type.typename + ); + } + out +} + +pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String { + let mut out = String::new(); + for sig in macro_func { + out += &format!( + "static inline {} {}({} x) {{ return {}{{x}}; }}\n", + sig.return_type.typename, + sig.func_name, + sig.args[0].typename.typename, + sig.return_type.typename + ); + } + out } pub fn generate_generic_null_c(macro_func: &[FunctionSignature]) -> String { @@ -1224,7 +1518,11 @@ pub fn generate_generic_cpp( for i in 1..func.args.len() { out += &format!(", {} {}", func.args[i].typename.typename, func.args[i].name); } - out += &format!(") {{{body_start}return {func_name}({x}"); + out += &format!(") {{{body_start}"); + if return_type != "void" { + out += "return "; + } + out += &format!("{func_name}({x}"); for i in 1..func.args.len() { out += &format!(", {}", func.args[i].name); } @@ -1276,15 +1574,11 @@ pub fn generate_generic_drop_cpp(macro_func: &[FunctionSignature]) -> String { } pub fn generate_generic_move_cpp(macro_func: &[FunctionSignature]) -> String { - let mut move_funcs = Vec::::new(); - for f in macro_func { - move_funcs.push(FunctionSignature { - return_type: f.args[0].typename.clone(), - func_name: "".to_string(), - args: [f.args[0].clone()].to_vec(), - }); - } - generate_generic_cpp(&move_funcs, "z_move", true) + generate_generic_cpp(macro_func, "z_move", true) +} + +pub fn generate_generic_take_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_take", false) } pub fn generate_generic_null_cpp(macro_func: &[FunctionSignature]) -> String { diff --git a/examples/z_get.c b/examples/z_get.c index a97dd5c1f..f53c49935 100644 --- a/examples/z_get.c +++ b/examples/z_get.c @@ -65,10 +65,10 @@ int main(int argc, char **argv) { z_owned_bytes_t payload; if (value != NULL) { z_bytes_from_static_str(&payload, value); - opts.payload = &payload; + opts.payload = z_move(payload); } z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure), - z_move(opts)); // here, the send is moved and will be dropped by zenoh when adequate + &opts); // here, the send is moved and will be dropped by zenoh when adequate z_owned_reply_t reply; for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) { diff --git a/examples/z_get_shm.c b/examples/z_get_shm.c index 34d43a5d1..99e3f61e3 100644 --- a/examples/z_get_shm.c +++ b/examples/z_get_shm.c @@ -106,7 +106,7 @@ int main(int argc, char** argv) { opts.payload = &payload; } z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure), - z_move(opts)); // here, the send is moved and will be dropped by zenoh when adequate + &opts); // here, the send is moved and will be dropped by zenoh when adequate z_owned_reply_t reply; for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) { diff --git a/examples/z_non_blocking_get.c b/examples/z_non_blocking_get.c index cda250aa8..7a76bc692 100644 --- a/examples/z_non_blocking_get.c +++ b/examples/z_non_blocking_get.c @@ -53,7 +53,7 @@ int main(int argc, char **argv) { z_owned_closure_reply_t closure; z_fifo_channel_reply_new(&closure, &handler, 16); z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure), - z_move(opts)); // here, the closure is moved and will be dropped by zenoh when adequate + &opts); // here, the closure is moved and will be dropped by zenoh when adequate z_owned_reply_t reply; for (z_result_t res = z_try_recv(z_loan(handler), &reply); res != Z_CHANNEL_DISCONNECTED; res = z_try_recv(z_loan(handler), &reply)) { diff --git a/examples/z_pong.c b/examples/z_pong.c index d63916733..ccf3d1d62 100644 --- a/examples/z_pong.c +++ b/examples/z_pong.c @@ -59,7 +59,7 @@ int main(int argc, char** argv) { z_owned_publisher_t pub; z_declare_publisher(&pub, z_loan(session), z_loan(pong), NULL); z_owned_closure_sample_t respond; - z_closure(&respond, callback, drop, (void*)z_move(pub)); + z_closure(&respond, callback, drop, (void*)&pub); z_owned_subscriber_t sub; z_declare_subscriber(&sub, z_loan(session), z_loan(ping), z_move(respond), NULL); while (getchar() != 'q') { diff --git a/examples/z_pub_attachment.c b/examples/z_pub_attachment.c index 86fa49732..ca13d1c2a 100644 --- a/examples/z_pub_attachment.c +++ b/examples/z_pub_attachment.c @@ -94,7 +94,7 @@ int main(int argc, char** argv) { kvs[1] = (kv_pair_t){.key = "index", .value = buf_ind}; kv_it it = {.current = kvs, .end = kvs + 2}; z_bytes_from_iter(&attachment, create_attachment_iter, (void*)&it); - options.attachment = &attachment; + options.attachment = z_move(attachment); sprintf(buf, "[%4d] %s", idx, value); printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); diff --git a/examples/z_put.c b/examples/z_put.c index f58225d05..26f1910d8 100644 --- a/examples/z_put.c +++ b/examples/z_put.c @@ -58,7 +58,8 @@ int main(int argc, char **argv) { z_put_options_t options; z_put_options_default(&options); - options.attachment = &attachment; // attachment is going to be consumed by z_put, so no need to drop it manually + options.attachment = + z_move(attachment); // attachement is going to be consumed by z_put, so no need to drop it manually int res = z_put(z_loan(s), z_loan(ke), z_move(payload), &options); if (res < 0) { diff --git a/examples/z_queryable_with_channels.c b/examples/z_queryable_with_channels.c index a7c1f849e..6ead46766 100644 --- a/examples/z_queryable_with_channels.c +++ b/examples/z_queryable_with_channels.c @@ -13,7 +13,6 @@ #include #include -#include #include "zenoh.h" diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 13486ff66..80c455ef6 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -12,7 +12,6 @@ // ZettaScale Zenoh Team, // #include -#include #include "zenoh.h" diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 24bfc5817..24bb9d9bd 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,26 +16,6 @@ #define ALIGN(n) #define ZENOHC_API #endif -/** - * Allocation errors - * - * - **NEED_DEFRAGMENT**: defragmentation needed - * - **OUT_OF_MEMORY**: the provider is out of memory - * - **OTHER**: other error - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef enum z_alloc_error_t { -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_NEED_DEFRAGMENT, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_OUT_OF_MEMORY, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_OTHER, -#endif -} z_alloc_error_t; -#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -96,22 +76,6 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif -/** - * Layouting errors - * - * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect - * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef enum z_layout_error_t { -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, -#endif -} z_layout_error_t; -#endif /** * The priority of zenoh messages. */ @@ -202,7 +166,6 @@ typedef enum z_whatami_t { /** * The locality of samples to be received by subscribers or targeted by publishers. */ -#if defined(UNSTABLE) typedef enum zc_locality_t { /** * Any @@ -217,7 +180,6 @@ typedef enum zc_locality_t { */ ZC_LOCALITY_REMOTE = 2, } zc_locality_t; -#endif /** * Severity level of Zenoh log message. */ @@ -268,78 +230,28 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_alloc_result_t { - z_owned_shm_mut_t buf; - enum z_alloc_error_t error; -} z_buf_alloc_result_t; -#endif +typedef struct z_moved_alloc_layout_t { + struct z_owned_alloc_layout_t *_ptr; +} z_moved_alloc_layout_t; typedef int8_t z_result_t; -/** - * An AllocAlignment. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_alloc_alignment_t { - uint8_t pow; -} z_alloc_alignment_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_data_t { - void *ptr; -} zc_threadsafe_context_data_t; -#endif -/** - * A tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a thread-safe context - the associated callbacks may be executed concurrently with the same - * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be - * thread-safe. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_t { - struct zc_threadsafe_context_data_t context; - void (*delete_fn)(void*); -} zc_threadsafe_context_t; -#endif -/** - * Unique segment identifier - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_segment_id_t; -#endif -/** - * Chunk id within it's segment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_chunk_id_t; -#endif -/** - * A ChunkDescriptor - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_chunk_descriptor_t { - z_segment_id_t segment; - z_chunk_id_t chunk; - size_t len; -} z_chunk_descriptor_t; -#endif -/** - * An AllocatedChunk - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_allocated_chunk_t { - struct z_chunk_descriptor_t descriptpr; - void *data; -} z_allocated_chunk_t; -#endif +typedef struct z_moved_bytes_t { + struct z_owned_bytes_t *_ptr; +} z_moved_bytes_t; +typedef struct z_moved_slice_t { + struct z_owned_slice_t *_ptr; +} z_moved_slice_t; +typedef struct z_moved_string_t { + struct z_owned_string_t *_ptr; +} z_moved_string_t; +typedef struct z_moved_shm_t { + struct z_owned_shm_t *_ptr; +} z_moved_shm_t; +typedef struct z_moved_shm_mut_t { + struct z_owned_shm_mut_t *_ptr; +} z_moved_shm_mut_t; +typedef struct z_moved_chunk_alloc_result_t { + struct z_owned_chunk_alloc_result_t *_ptr; +} z_moved_chunk_alloc_result_t; /** * Monotonic clock */ @@ -347,6 +259,9 @@ typedef struct z_clock_t { uint64_t t; const void *t_base; } z_clock_t; +typedef struct z_moved_session_t { + struct z_owned_session_t *_ptr; +} z_moved_session_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -373,29 +288,11 @@ typedef struct z_owned_closure_hello_t { void (*drop)(void *context); } z_owned_closure_hello_t; /** - * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: - * - * Closures are not guaranteed not to be called concurrently. - * - * It is guaranteed that: - * - `call` will never be called once `drop` has started. - * - `drop` will only be called **once**, and **after every** `call` has ended. - * - The two previous guarantees imply that `call` and `drop` are never called concurrently. + * Moved closure. */ -typedef struct zc_owned_closure_log_t { - /** - * An optional pointer to a closure state. - */ - void *context; - /** - * A closure body. - */ - void (*call)(enum zc_log_severity_t severity, const struct z_loaned_string_t *msg, void *context); - /** - * An optional drop function that will be called when the closure is dropped. - */ - void (*drop)(void *context); -} zc_owned_closure_log_t; +typedef struct z_moved_closure_hello_t { + struct z_owned_closure_hello_t *_ptr; +} z_moved_closure_hello_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -420,6 +317,12 @@ typedef struct z_owned_closure_query_t { */ void (*drop)(void *context); } z_owned_closure_query_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_query_t { + struct z_owned_closure_query_t *_ptr; +} z_moved_closure_query_t; /** * A structure that contains all the elements for stateful, memory-leak-free callbacks. * @@ -444,6 +347,12 @@ typedef struct z_owned_closure_reply_t { */ void (*drop)(void *context); } z_owned_closure_reply_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_reply_t { + struct z_owned_closure_reply_t *_ptr; +} z_moved_closure_reply_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks. * @@ -468,6 +377,12 @@ typedef struct z_owned_closure_sample_t { */ void (*drop)(void *context); } z_owned_closure_sample_t; +/** + * Moved closure. + */ +typedef struct z_moved_closure_sample_t { + struct z_owned_closure_sample_t *_ptr; +} z_moved_closure_sample_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: * @@ -487,13 +402,30 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const z_id_t *z_id, void *context); + void (*call)(const struct z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ void (*drop)(void *context); } z_owned_closure_zid_t; #endif +/** + * Moved closure. + */ +#if defined(UNSTABLE) +typedef struct z_moved_closure_zid_t { + struct z_owned_closure_zid_t *_ptr; +} z_moved_closure_zid_t; +#endif +typedef struct z_moved_condvar_t { + struct z_owned_condvar_t *_ptr; +} z_moved_condvar_t; +typedef struct z_moved_config_t { + struct z_owned_config_t *_ptr; +} z_moved_config_t; +typedef struct z_moved_encoding_t { + struct z_owned_encoding_t *_ptr; +} z_moved_encoding_t; /** * Options passed to the `z_declare_publisher()` function. */ @@ -501,7 +433,7 @@ typedef struct z_publisher_options_t { /** * Default encoding for messages put by this publisher. */ - struct z_owned_encoding_t *encoding; + struct z_moved_encoding_t encoding; /** * The congestion control to apply when routing messages from this publisher. */ @@ -566,12 +498,24 @@ typedef struct z_delete_options_t { enum zc_locality_t allowed_destination; #endif } z_delete_options_t; +typedef struct z_moved_fifo_handler_query_t { + struct z_owned_fifo_handler_query_t *_ptr; +} z_moved_fifo_handler_query_t; +typedef struct z_moved_fifo_handler_reply_t { + struct z_owned_fifo_handler_reply_t *_ptr; +} z_moved_fifo_handler_reply_t; +typedef struct z_moved_fifo_handler_sample_t { + struct z_owned_fifo_handler_sample_t *_ptr; +} z_moved_fifo_handler_sample_t; /** * The replies consolidation strategy to apply on replies to a `z_get()`. */ typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; +typedef struct z_moved_source_info_t { + struct z_owned_source_info_t *_ptr; +} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -587,11 +531,11 @@ typedef struct z_get_options_t { /** * An optional payload to attach to the query. */ - struct z_owned_bytes_t *payload; + struct z_moved_bytes_t payload; /** * An optional encoding of the query payload and or attachment. */ - struct z_owned_encoding_t *encoding; + struct z_moved_encoding_t encoding; /** * The congestion control to apply when routing the query. */ @@ -620,17 +564,29 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - z_owned_source_info_t *source_info; + struct z_moved_source_info_t source_info; #endif /** * An optional attachment to attach to the query. */ - struct z_owned_bytes_t *attachment; + struct z_moved_bytes_t attachment; /** * The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration. */ uint64_t timeout_ms; } z_get_options_t; +typedef struct z_moved_hello_t { + struct z_owned_hello_t *_ptr; +} z_moved_hello_t; +typedef struct z_moved_keyexpr_t { + struct z_owned_keyexpr_t *_ptr; +} z_moved_keyexpr_t; +typedef struct z_moved_memory_layout_t { + struct z_owned_memory_layout_t *_ptr; +} z_moved_memory_layout_t; +typedef struct z_moved_mutex_t { + struct z_owned_mutex_t *_ptr; +} z_moved_mutex_t; /** * Represents the set of options that can be applied to the delete operation by a previously declared publisher, * whenever issued via `z_publisher_delete()`. @@ -639,8 +595,11 @@ typedef struct z_publisher_delete_options_t { /** * The timestamp of this message. */ - struct z_timestamp_t *timestamp; + const struct z_timestamp_t *timestamp; } z_publisher_delete_options_t; +typedef struct z_moved_publisher_t { + struct z_owned_publisher_t *_ptr; +} z_moved_publisher_t; /** * Options passed to the `z_publisher_put()` function. */ @@ -648,21 +607,21 @@ typedef struct z_publisher_put_options_t { /** * The encoding of the data to publish. */ - struct z_owned_encoding_t *encoding; + struct z_moved_encoding_t encoding; /** * The timestamp of the publication. */ - struct z_timestamp_t *timestamp; + const struct z_timestamp_t *timestamp; #if defined(UNSTABLE) /** * The source info for the publication. */ - z_owned_source_info_t *source_info; + struct z_moved_source_info_t source_info; #endif /** * The attachment to attach to the publication. */ - struct z_owned_bytes_t *attachment; + struct z_moved_bytes_t attachment; } z_publisher_put_options_t; /** * Options passed to the `z_put()` function. @@ -671,7 +630,7 @@ typedef struct z_put_options_t { /** * The encoding of the message. */ - struct z_owned_encoding_t *encoding; + struct z_moved_encoding_t encoding; /** * The congestion control to apply when routing this message. */ @@ -698,13 +657,16 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - z_owned_source_info_t *source_info; + struct z_moved_source_info_t source_info; #endif /** * The attachment to this message. */ - struct z_owned_bytes_t *attachment; + struct z_moved_bytes_t attachment; } z_put_options_t; +typedef struct z_moved_query_t { + struct z_owned_query_t *_ptr; +} z_moved_query_t; /** * Represents the set of options that can be applied to a query reply, * sent via `z_query_reply()`. @@ -713,7 +675,7 @@ typedef struct z_query_reply_options_t { /** * The encoding of the reply payload. */ - struct z_owned_encoding_t *encoding; + struct z_moved_encoding_t encoding; /** * The congestion control to apply when routing the reply. */ @@ -734,12 +696,12 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - z_owned_source_info_t *source_info; + struct z_moved_source_info_t source_info; #endif /** * The attachment to this reply. */ - struct z_owned_bytes_t *attachment; + struct z_moved_bytes_t attachment; } z_query_reply_options_t; /** * Represents the set of options that can be applied to a query delete reply, @@ -766,12 +728,12 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - z_owned_source_info_t *source_info; + struct z_moved_source_info_t source_info; #endif /** * The attachment to this reply. */ - struct z_owned_bytes_t *attachment; + struct z_moved_bytes_t attachment; } z_query_reply_del_options_t; /** * Represents the set of options that can be applied to a query reply error, @@ -781,8 +743,29 @@ typedef struct z_query_reply_err_options_t { /** * The encoding of the error payload. */ - struct z_owned_encoding_t *encoding; + struct z_moved_encoding_t encoding; } z_query_reply_err_options_t; +typedef struct z_moved_queryable_t { + struct z_owned_queryable_t *_ptr; +} z_moved_queryable_t; +typedef struct z_moved_reply_t { + struct z_owned_reply_t *_ptr; +} z_moved_reply_t; +typedef struct z_moved_reply_err_t { + struct z_owned_reply_err_t *_ptr; +} z_moved_reply_err_t; +typedef struct z_moved_ring_handler_query_t { + struct z_owned_ring_handler_query_t *_ptr; +} z_moved_ring_handler_query_t; +typedef struct z_moved_ring_handler_reply_t { + struct z_owned_ring_handler_reply_t *_ptr; +} z_moved_ring_handler_reply_t; +typedef struct z_moved_ring_handler_sample_t { + struct z_owned_ring_handler_sample_t *_ptr; +} z_moved_ring_handler_sample_t; +typedef struct z_moved_sample_t { + struct z_owned_sample_t *_ptr; +} z_moved_sample_t; /** * Options to pass to `z_scout()`. */ @@ -796,39 +779,15 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -/** - * A callbacks for ShmSegment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_segment_callbacks_t { - uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); -} zc_shm_segment_callbacks_t; -#endif -/** - * A ShmSegment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_shm_segment_t { - struct zc_threadsafe_context_t context; - struct zc_shm_segment_callbacks_t callbacks; -} z_shm_segment_t; -#endif -/** - * A callbacks for ShmClient - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_client_callbacks_t { - bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); -} zc_shm_client_callbacks_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_layout_alloc_result_t { - z_owned_shm_mut_t buf; - bool error_is_alloc; - enum z_alloc_error_t alloc_error; - enum z_layout_error_t layout_error; -} z_buf_layout_alloc_result_t; -#endif +typedef struct z_moved_shm_client_t { + struct z_owned_shm_client_t *_ptr; +} z_moved_shm_client_t; +typedef struct z_moved_shm_client_storage_t { + struct z_owned_shm_client_storage_t *_ptr; +} z_moved_shm_client_storage_t; +typedef struct z_moved_shm_provider_t { + struct z_owned_shm_provider_t *_ptr; +} z_moved_shm_provider_t; /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -837,46 +796,15 @@ typedef struct z_buf_layout_alloc_result_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif -/** - * A non-tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same - * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated - * with this context data are not required to be thread-safe. - * - * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can - * still be executed concurrently. The exact behavior depends on user's application, but we strongly - * discourage our users from pinning to some specific behavior unless they _really_ understand what they - * are doing. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_context_t { - void *context; - void (*delete_fn)(void*); -} zc_context_t; -#endif -/** - * A callbacks for ShmProviderBackend - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_provider_backend_callbacks_t { - void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, - const z_loaned_memory_layout_t *layout, - void *context); - void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); - size_t (*defragment_fn)(void *context); - size_t (*available_fn)(void *context); - void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); -} zc_shm_provider_backend_callbacks_t; -#endif +typedef struct z_moved_string_array_t { + struct z_owned_string_array_t *_ptr; +} z_moved_string_array_t; +typedef struct z_moved_subscriber_t { + struct z_owned_subscriber_t *_ptr; +} z_moved_subscriber_t; +typedef struct z_moved_task_t { + struct z_owned_task_t *_ptr; +} z_moved_task_t; typedef struct z_task_attr_t { size_t _0; } z_task_attr_t; @@ -887,13 +815,35 @@ typedef struct z_time_t { uint64_t t; } z_time_t; /** - * Loaned closure. + * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: + * + * Closures are not guaranteed not to be called concurrently. + * + * It is guaranteed that: + * - `call` will never be called once `drop` has started. + * - `drop` will only be called **once**, and **after every** `call` has ended. + * - The two previous guarantees imply that `call` and `drop` are never called concurrently. */ -#if defined(UNSTABLE) -typedef struct zc_loaned_closure_matching_status_t { - size_t _0[3]; -} zc_loaned_closure_matching_status_t; -#endif +typedef struct zc_owned_closure_log_t { + /** + * An optional pointer to a closure state. + */ + void *context; + /** + * A closure body. + */ + void (*call)(enum zc_log_severity_t severity, const struct z_loaned_string_t *msg, void *context); + /** + * An optional drop function that will be called when the closure is dropped. + */ + void (*drop)(void *context); +} zc_owned_closure_log_t; +/** + * Moved closure. + */ +typedef struct zc_moved_closure_log_t { + struct zc_owned_closure_log_t *_ptr; +} zc_moved_closure_log_t; /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -931,6 +881,14 @@ typedef struct zc_owned_closure_matching_status_t { void (*drop)(void *context); } zc_owned_closure_matching_status_t; #endif +/** + * Moved closure. + */ +#if defined(UNSTABLE) +typedef struct zc_moved_closure_matching_status_t { + struct zc_owned_closure_matching_status_t *_ptr; +} zc_moved_closure_matching_status_t; +#endif /** * The options for `zc_liveliness_declare_token()`. */ @@ -955,6 +913,15 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif +typedef struct zc_moved_liveliness_token_t { + struct zc_owned_liveliness_token_t *_ptr; +} zc_moved_liveliness_token_t; +typedef struct zc_moved_matching_listener_t { + struct zc_owned_matching_listener_t *_ptr; +} zc_moved_matching_listener_t; +typedef struct zc_moved_shm_client_list_t { + struct zc_owned_shm_client_list_t *_ptr; +} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -1025,6 +992,12 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif +typedef struct ze_moved_publication_cache_t { + struct ze_owned_publication_cache_t *_ptr; +} ze_moved_publication_cache_t; +typedef struct ze_moved_querying_subscriber_t { + struct ze_owned_querying_subscriber_t *_ptr; +} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1044,53 +1017,54 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); +ZENOHC_API +const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, - const z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1098,12 +1072,12 @@ z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout, + const struct z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1167,7 +1141,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const z_loaned_shm_t **dst); + const struct z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1178,7 +1152,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - z_loaned_shm_t **dst); + struct z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1189,7 +1163,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - z_owned_shm_t *dst); + struct z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1249,7 +1223,7 @@ z_result_t z_bytes_deserialize_into_uint8(const struct z_loaned_bytes_t *this_, * Drops `this_`, resetting it to gravestone value. If there are any shallow copies * created by `z_bytes_clone()`, they would still stay valid. */ -ZENOHC_API void z_bytes_drop(struct z_owned_bytes_t *this_); +ZENOHC_API void z_bytes_drop(struct z_moved_bytes_t this_); /** * Constructs an empty instance of `z_owned_bytes_t`. */ @@ -1286,13 +1260,13 @@ z_result_t z_bytes_from_iter(struct z_owned_bytes_t *this_, */ ZENOHC_API z_result_t z_bytes_from_pair(struct z_owned_bytes_t *this_, - struct z_owned_bytes_t *first, - struct z_owned_bytes_t *second); + struct z_moved_bytes_t first, + struct z_moved_bytes_t second); /** * Serializes a slice. * The slice is consumed upon function return. */ -ZENOHC_API void z_bytes_from_slice(struct z_owned_bytes_t *this_, struct z_owned_slice_t *slice); +ZENOHC_API void z_bytes_from_slice(struct z_owned_bytes_t *this_, struct z_moved_slice_t slice); /** * Serializes a statically allocated constant data. * @param this_: An uninitialized location in memory where `z_owned_bytes_t` is to be constructed. @@ -1328,7 +1302,7 @@ z_result_t z_bytes_from_str(struct z_owned_bytes_t *this_, * Serializes a string. * The string is consumed upon function return. */ -ZENOHC_API void z_bytes_from_string(struct z_owned_bytes_t *this_, struct z_owned_string_t *s); +ZENOHC_API void z_bytes_from_string(struct z_owned_bytes_t *this_, struct z_moved_string_t s); /** * Returns an iterator for multi-element serialized data. * @@ -1448,7 +1422,9 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_owned_shm_t *shm); +ZENOHC_API +z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, + struct z_moved_shm_t shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1456,7 +1432,7 @@ ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - z_owned_shm_mut_t *shm); + struct z_moved_shm_mut_t shm); #endif /** * Serializes a slice by copying. @@ -1502,7 +1478,7 @@ ZENOHC_API void z_bytes_serialize_from_uint8(struct z_owned_bytes_t *this_, uint */ ZENOHC_API z_result_t z_bytes_writer_append(struct z_bytes_writer_t *this_, - struct z_owned_bytes_t *bytes); + struct z_moved_bytes_t bytes); /** * Appends bytes, with boundaries information. It would allow to read the same piece of data using `z_bytes_reader_read_bounded()`. * @@ -1510,7 +1486,7 @@ z_result_t z_bytes_writer_append(struct z_bytes_writer_t *this_, */ ZENOHC_API z_result_t z_bytes_writer_append_bounded(struct z_bytes_writer_t *this_, - struct z_owned_bytes_t *bytes); + struct z_moved_bytes_t bytes); /** * Writes `len` bytes from `src` into underlying data. * @@ -1524,27 +1500,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); +const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1552,14 +1528,14 @@ void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1584,7 +1560,7 @@ ZENOHC_API struct z_clock_t z_clock_now(void); * the remaining reference count (number of shallow copies) of the session otherwise, saturating at i8::MAX. */ ZENOHC_API -z_result_t z_close(struct z_owned_session_t *this_); +z_result_t z_close(struct z_moved_session_t session); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -1598,7 +1574,7 @@ ZENOHC_API bool z_closure_hello_check(const struct z_owned_closure_hello_t *this /** * Drops the closure. Droping an uninitialized closure is a no-op. */ -ZENOHC_API void z_closure_hello_drop(struct z_owned_closure_hello_t *closure); +ZENOHC_API void z_closure_hello_drop(struct z_moved_closure_hello_t _closure); /** * Borrows closure. */ @@ -1612,30 +1588,6 @@ ZENOHC_API void z_closure_hello_null(struct z_owned_closure_hello_t *this_); * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API -void z_closure_log_call(const struct zc_loaned_closure_log_t *closure, - enum zc_log_severity_t severity, - const struct z_loaned_string_t *msg); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_log_check(const struct zc_owned_closure_log_t *this_); -/** - * Drops the closure. Droping an uninitialized closure is a no-op. - */ -ZENOHC_API void z_closure_log_drop(struct zc_owned_closure_log_t *closure); -/** - * Borrows closure. - */ -ZENOHC_API -const struct zc_loaned_closure_log_t *z_closure_log_loan(const struct zc_owned_closure_log_t *closure); -/** - * Constructs a closure in a gravestone state. - */ -ZENOHC_API void z_closure_log_null(struct zc_owned_closure_log_t *this_); -/** - * Calls the closure. Calling an uninitialized closure is a no-op. - */ -ZENOHC_API void z_closure_query_call(const struct z_loaned_closure_query_t *closure, const struct z_loaned_query_t *query); /** @@ -1645,7 +1597,7 @@ ZENOHC_API bool z_closure_query_check(const struct z_owned_closure_query_t *this /** * Drops the closure, resetting it to its gravestone state. */ -ZENOHC_API void z_closure_query_drop(struct z_owned_closure_query_t *closure); +ZENOHC_API void z_closure_query_drop(struct z_moved_closure_query_t closure); /** * Borrows closure. */ @@ -1669,7 +1621,7 @@ ZENOHC_API bool z_closure_reply_check(const struct z_owned_closure_reply_t *this * Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. */ ZENOHC_API -void z_closure_reply_drop(struct z_owned_closure_reply_t *closure); +void z_closure_reply_drop(struct z_moved_closure_reply_t closure); /** * Borrows closure. */ @@ -1692,7 +1644,7 @@ ZENOHC_API bool z_closure_sample_check(const struct z_owned_closure_sample_t *th /** * Drops the closure. Droping an uninitialized closure is a no-op. */ -ZENOHC_API void z_closure_sample_drop(struct z_owned_closure_sample_t *closure); +ZENOHC_API void z_closure_sample_drop(struct z_moved_closure_sample_t closure); /** * Borrows closure. */ @@ -1708,7 +1660,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const z_id_t *z_id); + const struct z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -1721,7 +1673,7 @@ ZENOHC_API bool z_closure_zid_check(const struct z_owned_closure_zid_t *this_); */ #if defined(UNSTABLE) ZENOHC_API -void z_closure_zid_drop(struct z_owned_closure_zid_t *closure); +void z_closure_zid_drop(struct z_moved_closure_zid_t closure); #endif /** * Vorrows closure. @@ -1743,7 +1695,7 @@ ZENOHC_API bool z_condvar_check(const struct z_owned_condvar_t *this_); /** * Drops conditional variable. */ -ZENOHC_API void z_condvar_drop(struct z_owned_condvar_t *this_); +ZENOHC_API void z_condvar_drop(struct z_moved_condvar_t this_); /** * Constructs conditional variable. */ @@ -1802,7 +1754,7 @@ ZENOHC_API z_result_t z_config_default(struct z_owned_config_t *this_); /** * Frees `config`, and resets it to its gravestone state. */ -ZENOHC_API void z_config_drop(struct z_owned_config_t *this_); +ZENOHC_API void z_config_drop(struct z_moved_config_t this_); /** * Borrows config. */ @@ -1849,7 +1801,7 @@ ZENOHC_API z_result_t z_declare_publisher(struct z_owned_publisher_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - const struct z_publisher_options_t *options); + struct z_publisher_options_t *options); /** * Constructs a Queryable for the given key expression. * @@ -1865,7 +1817,7 @@ ZENOHC_API z_result_t z_declare_queryable(struct z_owned_queryable_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_closure_query_t *callback, + struct z_moved_closure_query_t callback, struct z_queryable_options_t *options); /** * Constructs and declares a subscriber for a given key expression. Dropping subscriber @@ -1882,7 +1834,7 @@ ZENOHC_API z_result_t z_declare_subscriber(struct z_owned_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_closure_sample_t *callback, + struct z_moved_closure_sample_t callback, struct z_subscriber_options_t *options); /** * Sends request to delete data on specified key expression (used when working with Zenoh storages ). @@ -2068,7 +2020,7 @@ void z_encoding_clone(struct z_owned_encoding_t *dst, /** * Frees the memory and resets the encoding it to its default value. */ -ZENOHC_API void z_encoding_drop(struct z_owned_encoding_t *this_); +ZENOHC_API void z_encoding_drop(struct z_moved_encoding_t this_); /** * Constructs a `z_owned_encoding_t` from a specified string. */ @@ -2403,13 +2355,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); +ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2439,7 +2391,7 @@ ZENOHC_API bool z_fifo_handler_query_check(const struct z_owned_fifo_handler_que /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_fifo_handler_query_drop(struct z_owned_fifo_handler_query_t *this_); +ZENOHC_API void z_fifo_handler_query_drop(struct z_moved_fifo_handler_query_t this_); /** * Borrows handler. */ @@ -2473,7 +2425,7 @@ ZENOHC_API bool z_fifo_handler_reply_check(const struct z_owned_fifo_handler_rep /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_fifo_handler_reply_drop(struct z_owned_fifo_handler_reply_t *this_); +ZENOHC_API void z_fifo_handler_reply_drop(struct z_moved_fifo_handler_reply_t this_); /** * Borrows handler. */ @@ -2506,7 +2458,7 @@ ZENOHC_API bool z_fifo_handler_sample_check(const struct z_owned_fifo_handler_sa /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_fifo_handler_sample_drop(struct z_owned_fifo_handler_sample_t *this_); +ZENOHC_API void z_fifo_handler_sample_drop(struct z_moved_fifo_handler_sample_t this_); /** * Borrows handler. */ @@ -2549,7 +2501,7 @@ ZENOHC_API z_result_t z_get(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const char *parameters, - struct z_owned_closure_reply_t *callback, + struct z_moved_closure_reply_t callback, struct z_get_options_t *options); /** * Constructs default `z_get_options_t` @@ -2562,7 +2514,7 @@ ZENOHC_API bool z_hello_check(const struct z_owned_hello_t *this_); /** * Frees memory and resets hello message to its gravestone state. */ -ZENOHC_API void z_hello_drop(struct z_owned_hello_t *this_); +ZENOHC_API void z_hello_drop(struct z_moved_hello_t this_); /** * Borrows hello message. */ @@ -2587,7 +2539,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2600,7 +2552,7 @@ ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #if defined(UNSTABLE) ZENOHC_API z_result_t z_info_peers_zid(const struct z_loaned_session_t *session, - struct z_owned_closure_zid_t *callback); + struct z_moved_closure_zid_t callback); #endif /** * Fetches the Zenoh IDs of all connected routers. @@ -2613,7 +2565,7 @@ z_result_t z_info_peers_zid(const struct z_loaned_session_t *session, #if defined(UNSTABLE) ZENOHC_API z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, - struct z_owned_closure_zid_t *callback); + struct z_moved_closure_zid_t callback); #endif /** * Returns the session's Zenoh ID. @@ -2623,7 +2575,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2671,7 +2623,7 @@ z_result_t z_keyexpr_concat(struct z_owned_keyexpr_t *this_, /** * Frees key expression and resets it to its gravestone state. */ -ZENOHC_API void z_keyexpr_drop(struct z_owned_keyexpr_t *this_); +ZENOHC_API void z_keyexpr_drop(struct z_moved_keyexpr_t this_); /** * Returns ``true`` if both ``left`` and ``right`` are equal, ``false`` otherwise. */ @@ -2767,13 +2719,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); #endif /** * Extract data from Memory Layout @@ -2782,21 +2734,21 @@ ZENOHC_API void z_memory_layout_drop(z_owned_memory_layout_t *this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const z_loaned_memory_layout_t *this_); + const struct z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); +const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2804,7 +2756,7 @@ z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2813,7 +2765,7 @@ ZENOHC_API bool z_mutex_check(const struct z_owned_mutex_t *this_); /** * Drops mutex and resets it to its gravestone state. */ -ZENOHC_API void z_mutex_drop(struct z_owned_mutex_t *this_); +ZENOHC_API void z_mutex_drop(struct z_moved_mutex_t this_); /** * Constructs a mutex. * @return 0 in case of success, negative error code otherwise. @@ -2850,7 +2802,7 @@ z_result_t z_mutex_unlock(struct z_loaned_mutex_t *this_); */ ZENOHC_API z_result_t z_open(struct z_owned_session_t *this_, - struct z_owned_config_t *config); + struct z_moved_config_t config); /** * Constructs and opens a new Zenoh session with specified client storage. * @@ -2859,22 +2811,22 @@ z_result_t z_open(struct z_owned_session_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, - struct z_owned_config_t *config, - const z_loaned_shm_client_storage_t *shm_clients); + struct z_moved_config_t config, + const struct z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, - const z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, + const struct z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2899,12 +2851,12 @@ ZENOHC_API void z_publisher_delete_options_default(struct z_publisher_delete_opt /** * Frees memory and resets publisher to its gravestone state. Also attempts undeclare publisher. */ -ZENOHC_API void z_publisher_drop(struct z_owned_publisher_t *this_); +ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t this_); /** * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -2943,7 +2895,7 @@ ZENOHC_API void z_publisher_options_default(struct z_publisher_options_t *this_) */ ZENOHC_API z_result_t z_publisher_put(const struct z_loaned_publisher_t *this_, - struct z_owned_bytes_t *payload, + struct z_moved_bytes_t payload, struct z_publisher_put_options_t *options); /** * Constructs the default value for `z_publisher_put_options_t`. @@ -2962,7 +2914,7 @@ ZENOHC_API void z_publisher_put_options_default(struct z_publisher_put_options_t ZENOHC_API z_result_t z_put(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_bytes_t *payload, + struct z_moved_bytes_t payload, struct z_put_options_t *options); /** * Constructs the default value for `z_put_options_t`. @@ -3022,7 +2974,7 @@ ZENOHC_API struct z_query_consolidation_t z_query_consolidation_none(void); /** * Destroys the query resetting it to its gravestone value. */ -ZENOHC_API void z_query_drop(struct z_owned_query_t *this_); +ZENOHC_API void z_query_drop(struct z_moved_query_t this_); /** * Gets query payload encoding. * @@ -3073,7 +3025,7 @@ const struct z_loaned_bytes_t *z_query_payload(const struct z_loaned_query_t *th ZENOHC_API z_result_t z_query_reply(const struct z_loaned_query_t *this_, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_bytes_t *payload, + struct z_moved_bytes_t payload, struct z_query_reply_options_t *options); /** * Sends a delete reply to a query. @@ -3113,7 +3065,7 @@ ZENOHC_API void z_query_reply_del_options_default(struct z_query_reply_del_optio */ ZENOHC_API z_result_t z_query_reply_err(const struct z_loaned_query_t *this_, - struct z_owned_bytes_t *payload, + struct z_moved_bytes_t payload, struct z_query_reply_err_options_t *options); /** * Constructs the default value for `z_query_reply_err_options_t`. @@ -3134,7 +3086,7 @@ ZENOHC_API bool z_queryable_check(const struct z_owned_queryable_t *this_); /** * Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. */ -ZENOHC_API void z_queryable_drop(struct z_owned_queryable_t *this_); +ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t this_); ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); /** @@ -3166,7 +3118,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3179,7 +3131,7 @@ ZENOHC_API void z_reply_clone(struct z_owned_reply_t *dst, const struct z_loaned /** * Frees reply, resetting it to its gravestone state. */ -ZENOHC_API void z_reply_drop(struct z_owned_reply_t *this_); +ZENOHC_API void z_reply_drop(struct z_moved_reply_t this_); /** * Yields the contents of the reply by asserting it indicates a failure. * @@ -3193,7 +3145,7 @@ ZENOHC_API bool z_reply_err_check(const struct z_owned_reply_err_t *this_); /** * Frees the memory and resets the reply error it to its default value. */ -ZENOHC_API void z_reply_err_drop(struct z_owned_reply_err_t *this_); +ZENOHC_API void z_reply_err_drop(struct z_moved_reply_err_t this_); /** * Returns reply error encoding. */ @@ -3237,7 +3189,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3267,7 +3219,7 @@ ZENOHC_API bool z_ring_handler_query_check(const struct z_owned_ring_handler_que /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_ring_handler_query_drop(struct z_owned_ring_handler_query_t *this_); +ZENOHC_API void z_ring_handler_query_drop(struct z_moved_ring_handler_query_t this_); /** * Borrows handler. */ @@ -3300,7 +3252,7 @@ ZENOHC_API bool z_ring_handler_reply_check(const struct z_owned_ring_handler_rep /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_ring_handler_reply_drop(struct z_owned_ring_handler_reply_t *this_); +ZENOHC_API void z_ring_handler_reply_drop(struct z_moved_ring_handler_reply_t this_); /** * Borrows handler. */ @@ -3333,7 +3285,7 @@ ZENOHC_API bool z_ring_handler_sample_check(const struct z_owned_ring_handler_sa /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_ring_handler_sample_drop(struct z_owned_ring_handler_sample_t *this_); +ZENOHC_API void z_ring_handler_sample_drop(struct z_moved_ring_handler_sample_t this_); /** * Borrows handler. */ @@ -3384,7 +3336,7 @@ enum z_congestion_control_t z_sample_congestion_control(const struct z_loaned_sa /** * Frees the memory and invalidates the sample, resetting it to a gravestone state. */ -ZENOHC_API void z_sample_drop(struct z_owned_sample_t *this_); +ZENOHC_API void z_sample_drop(struct z_moved_sample_t this_); /** * Returns the encoding associated with the sample data. */ @@ -3423,7 +3375,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3441,8 +3393,8 @@ ZENOHC_API const struct z_timestamp_t *z_sample_timestamp(const struct z_loaned_ * @return 0 if successful, negative error values upon failure. */ ZENOHC_API -z_result_t z_scout(struct z_owned_config_t *config, - struct z_owned_closure_hello_t *callback, +z_result_t z_scout(struct z_moved_config_t config, + struct z_moved_closure_hello_t callback, const struct z_scout_options_t *options); /** * Constructs the default values for the scouting operation. @@ -3463,7 +3415,7 @@ void z_session_clone(struct z_owned_session_t *dst, * * This will also close the session if it does not have any clones left. */ -ZENOHC_API void z_session_drop(struct z_owned_session_t *this_); +ZENOHC_API void z_session_drop(struct z_moved_session_t this_); /** * Borrows session. */ @@ -3476,26 +3428,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(z_owned_shm_client_t *this_, +void z_shm_client_new(struct z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3503,177 +3455,179 @@ void z_shm_client_new(z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, - const z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, + const struct z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); +const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, - const zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, + const struct zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(z_owned_shm_t *this_); +ZENOHC_API void z_shm_drop(struct z_moved_shm_t this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_owned_shm_mut_t *that); +ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); +ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); +ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_owned_shm_t *that); +ZENOHC_API +void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, + struct z_moved_shm_t that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3683,48 +3637,49 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); +ZENOHC_API +const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, - const z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, + const struct z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3733,7 +3688,7 @@ z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(z_owned_shm_provider_t *this_, +void z_shm_provider_new(struct z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3742,14 +3697,14 @@ void z_shm_provider_new(z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3758,13 +3713,13 @@ void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3802,7 +3757,7 @@ ZENOHC_API const uint8_t *z_slice_data(const struct z_loaned_slice_t *this_); /** * Frees the memory and invalidates the slice. */ -ZENOHC_API void z_slice_drop(struct z_owned_slice_t *this_); +ZENOHC_API void z_slice_drop(struct z_moved_slice_t this_); /** * Constructs an empty `z_owned_slice_t`. */ @@ -3843,46 +3798,47 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); +ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); +ZENOHC_API +const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(z_owned_source_info_t *this_, - const z_entity_global_id_t *source_id, +z_result_t z_source_info_new(struct z_owned_source_info_t *this_, + const struct z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -3891,7 +3847,7 @@ ZENOHC_API bool z_string_array_check(const struct z_owned_string_array_t *this_) /** * Destroys the string array, resetting it to its gravestone value. */ -ZENOHC_API void z_string_array_drop(struct z_owned_string_array_t *this_); +ZENOHC_API void z_string_array_drop(struct z_moved_string_array_t this_); /** * @return the value at the position of index in the string array. * @@ -3975,7 +3931,7 @@ ZENOHC_API const char *z_string_data(const struct z_loaned_string_t *this_); /** * Frees memory and invalidates `z_owned_string_t`, putting it in gravestone state. */ -ZENOHC_API void z_string_drop(struct z_owned_string_t *this_); +ZENOHC_API void z_string_drop(struct z_moved_string_t this_); /** * Constructs an empty owned string. */ @@ -4016,7 +3972,7 @@ ZENOHC_API bool z_subscriber_check(const struct z_owned_subscriber_t *this_); /** * Drops subscriber and resets it to its gravestone state. Also attempts to undeclare it. */ -ZENOHC_API void z_subscriber_drop(struct z_owned_subscriber_t *this_); +ZENOHC_API void z_subscriber_drop(struct z_moved_subscriber_t this_); /** * Returns the key expression of the subscriber. */ @@ -4042,7 +3998,11 @@ ZENOHC_API bool z_task_check(const struct z_owned_task_t *this_); /** * Detaches the task and releases all allocated resources. */ -ZENOHC_API void z_task_detach(struct z_owned_task_t *this_); +ZENOHC_API void z_task_detach(struct z_moved_task_t this_); +/** + * Drop the task. Same as `z_task_detach`. Use `z_task_join` to wait for the task completion. + */ +ZENOHC_API void z_task_drop(struct z_moved_task_t this_); /** * Constructs a new task. * @@ -4059,7 +4019,7 @@ z_result_t z_task_init(struct z_owned_task_t *this_, /** * Joins the task and releases all allocated resources */ -ZENOHC_API z_result_t z_task_join(struct z_owned_task_t *this_); +ZENOHC_API z_result_t z_task_join(struct z_moved_task_t this_); /** * Constructs task in a gravestone state. */ @@ -4094,7 +4054,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4112,30 +4072,30 @@ ZENOHC_API uint64_t z_timestamp_ntp64_time(const struct z_timestamp_t *this_); * @return 0 in case of success, negative error code otherwise. */ ZENOHC_API -z_result_t z_undeclare_keyexpr(struct z_owned_keyexpr_t *this_, +z_result_t z_undeclare_keyexpr(struct z_moved_keyexpr_t this_, const struct z_loaned_session_t *session); /** * Undeclares the given publisher, droping and invalidating it. * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_publisher(struct z_owned_publisher_t *this_); +ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t this_); /** * Undeclares a `z_owned_queryable_t` and drops it. * * Returns 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_queryable(struct z_owned_queryable_t *this_); +ZENOHC_API z_result_t z_undeclare_queryable(struct z_moved_queryable_t this_); /** * Undeclares subscriber and drops subscriber. * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_subscriber(struct z_owned_subscriber_t *this_); +ZENOHC_API z_result_t z_undeclare_subscriber(struct z_moved_subscriber_t this_); /** - * Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. + * Constructs a view key expression in empty state */ -ZENOHC_API bool z_view_keyexpr_check(const struct z_view_keyexpr_t *this_); +ZENOHC_API void z_view_keyexpr_empty(struct z_view_keyexpr_t *this_); /** * Constructs a `z_view_keyexpr_t` by aliasing a string. * @return 0 in case of success, negative error code in case of failure (for example if expr is not a valid key expression or if it is @@ -4210,19 +4170,15 @@ ZENOHC_API void z_view_keyexpr_from_substr_unchecked(struct z_view_keyexpr_t *this_, const char *start, size_t len); +/** + * Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_view_keyexpr_is_empty(const struct z_view_keyexpr_t *this_); /** * Borrows `z_view_keyexpr_t`. */ ZENOHC_API const struct z_loaned_keyexpr_t *z_view_keyexpr_loan(const struct z_view_keyexpr_t *this_); -/** - * Constructs a view key expression in a gravestone state. - */ -ZENOHC_API void z_view_keyexpr_null(struct z_view_keyexpr_t *this_); -/** - * @return ``true`` if the slice is not empty, ``false`` otherwise. - */ -ZENOHC_API bool z_view_slice_check(const struct z_view_slice_t *this_); /** * Constructs an empty view slice. */ @@ -4237,17 +4193,13 @@ z_result_t z_view_slice_from_buf(struct z_view_slice_t *this_, const uint8_t *start, size_t len); /** - * Borrows view slice. - */ -ZENOHC_API const struct z_loaned_slice_t *z_view_slice_loan(const struct z_view_slice_t *this_); -/** - * Constructs an empty view slice. + * @return ``true`` if the slice is not empty, ``false`` otherwise. */ -ZENOHC_API void z_view_slice_null(struct z_view_slice_t *this_); +ZENOHC_API bool z_view_slice_is_empty(const struct z_view_slice_t *this_); /** - * @return ``true`` if view string is valid, ``false`` if it is in a gravestone state. + * Borrows view slice. */ -ZENOHC_API bool z_view_string_check(const struct z_view_string_t *this_); +ZENOHC_API const struct z_loaned_slice_t *z_view_slice_loan(const struct z_view_slice_t *this_); /** * Constructs an empty view string. */ @@ -4270,13 +4222,13 @@ z_result_t z_view_string_from_substr(struct z_view_string_t *this_, const char *str, size_t len); /** - * Borrows view string. + * @return ``true`` if view string is valid, ``false`` if it is in a gravestone state. */ -ZENOHC_API const struct z_loaned_string_t *z_view_string_loan(const struct z_view_string_t *this_); +ZENOHC_API bool z_view_string_is_empty(const struct z_view_string_t *this_); /** - * Constructs view string in a gravestone state. + * Borrows view string. */ -ZENOHC_API void z_view_string_null(struct z_view_string_t *this_); +ZENOHC_API const struct z_loaned_string_t *z_view_string_loan(const struct z_view_string_t *this_); /** * Constructs a non-owned non-null-terminated string from the kind of zenoh entity. * @@ -4290,6 +4242,30 @@ ZENOHC_API void z_view_string_null(struct z_view_string_t *this_); ZENOHC_API z_result_t z_whatami_to_view_string(enum z_whatami_t whatami, struct z_view_string_t *str_out); +/** + * Calls the closure. Calling an uninitialized closure is a no-op. + */ +ZENOHC_API +void zc_closure_log_call(const struct zc_loaned_closure_log_t *closure, + enum zc_log_severity_t severity, + const struct z_loaned_string_t *msg); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool zc_closure_log_check(const struct zc_owned_closure_log_t *this_); +/** + * Drops the closure. Droping an uninitialized closure is a no-op. + */ +ZENOHC_API void zc_closure_log_drop(struct zc_moved_closure_log_t closure); +/** + * Borrows closure. + */ +ZENOHC_API +const struct zc_loaned_closure_log_t *zc_closure_log_loan(const struct zc_owned_closure_log_t *closure); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void zc_closure_log_null(struct zc_owned_closure_log_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -4310,7 +4286,7 @@ bool zc_closure_matching_status_check(const struct zc_owned_closure_matching_sta */ #if defined(UNSTABLE) ZENOHC_API -void zc_closure_matching_status_drop(struct zc_owned_closure_matching_status_t *closure); +void zc_closure_matching_status_drop(struct zc_moved_closure_matching_status_t closure); #endif /** * Borrows closure. @@ -4430,7 +4406,7 @@ ZENOHC_API z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_closure_sample_t *callback, + struct z_moved_closure_sample_t callback, struct zc_liveliness_subscriber_options_t *_options); #endif /** @@ -4446,7 +4422,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4463,7 +4439,7 @@ z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, ZENOHC_API z_result_t zc_liveliness_get(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_closure_reply_t *callback, + struct z_moved_closure_reply_t callback, struct zc_liveliness_get_options_t *options); #endif /** @@ -4483,32 +4459,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); +const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_owned_liveliness_token_t *this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t this_); #endif /** * Returns default value of `zc_locality_t` @@ -4516,6 +4492,18 @@ ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_owned_liveliness_token_t #if defined(UNSTABLE) ZENOHC_API enum zc_locality_t zc_locality_default(void); #endif +/** + * Checks the matching listener is for the gravestone state + */ +#if defined(UNSTABLE) +ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +#endif +/** + * Constructs an empty matching listener + */ +#if defined(UNSTABLE) +ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); +#endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. * @@ -4537,9 +4525,9 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, - struct zc_owned_closure_matching_status_t *callback); + struct zc_moved_closure_matching_status_t callback); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4547,7 +4535,17 @@ z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t * * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_publisher_matching_listener_undeclare(zc_owned_matching_listener_t *this_); +ZENOHC_API +z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t this_); +#endif +/** + * Undeclares the given matching listener, droping and invalidating it. + * + * @return 0 in case of success, negative error code otherwise. + */ +#if defined(UNSTABLE) +ZENOHC_API +z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4558,46 +4556,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - z_owned_shm_client_t *client, - zc_loaned_shm_client_list_t *list); + struct z_moved_shm_client_t client, + struct zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); +const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); +struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4619,7 +4617,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4637,29 +4635,29 @@ z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_owned_closure_sample_t *callback, + struct z_moved_closure_sample_t callback, struct ze_querying_subscriber_options_t *options); #endif /** * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4671,13 +4669,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4686,22 +4684,22 @@ ZENOHC_API void ze_querying_subscriber_drop(ze_owned_querying_subscriber_t *this */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, - const struct z_get_options_t *options); + struct z_get_options_t *options); #endif /** * Borrows querying subscriber. */ #if defined(UNSTABLE) ZENOHC_API -const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); +const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4715,7 +4713,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_owned_publication_cache_t *this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4723,5 +4721,5 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_owned_publication_cache_ * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_owned_querying_subscriber_t *this_); +ZENOHC_API z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t this_); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index fbd517319..124704465 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -1,17 +1,67 @@ #pragma once - // clang-format off + + #ifndef __cplusplus +static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t){x}; } +static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t){x}; } +static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t){x}; } +static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t){x}; } +static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t){x}; } +static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t){x}; } +static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t){x}; } +static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t){x}; } +static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t){x}; } +static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return (z_moved_config_t){x}; } +static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t){x}; } +static inline z_moved_fifo_handler_query_t z_fifo_handler_query_move(z_owned_fifo_handler_query_t* x) { return (z_moved_fifo_handler_query_t){x}; } +static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fifo_handler_reply_t* x) { return (z_moved_fifo_handler_reply_t){x}; } +static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t){x}; } +static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t){x}; } +static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } +static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t){x}; } +static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } +static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } +static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } +static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t){x}; } +static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t){x}; } +static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return (z_moved_reply_err_t){x}; } +static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return (z_moved_ring_handler_query_t){x}; } +static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_ring_handler_reply_t* x) { return (z_moved_ring_handler_reply_t){x}; } +static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t){x}; } +static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t){x}; } +static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return (z_moved_session_t){x}; } +static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t){x}; } +static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t){x}; } +static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t){x}; } +static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t){x}; } +static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t){x}; } +static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t){x}; } +static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t){x}; } +static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t){x}; } +static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return (z_moved_string_t){x}; } +static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t){x}; } +static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_task_t){x}; } +static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } +static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } +static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } +static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t){x}; } +static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } +static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } +static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } -#define z_loan(x) \ - _Generic((x), \ + +#define z_loan(this_) \ + _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ - zc_owned_closure_log_t : z_closure_log_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ + z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -20,6 +70,7 @@ z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ + z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -30,69 +81,149 @@ z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ + z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ + z_owned_shm_t : z_shm_loan, \ + z_owned_shm_mut_t : z_shm_mut_loan, \ + z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ + z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ - z_view_string_t : z_view_string_loan \ - )(&x) + z_view_string_t : z_view_string_loan, \ + zc_owned_closure_log_t : zc_closure_log_loan, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ + zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ + zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ + )(&this_) -#define z_loan_mut(x) \ - _Generic((x), \ +#define z_loan_mut(this_) \ + _Generic((this_), \ z_owned_bytes_t : z_bytes_loan_mut, \ z_owned_condvar_t : z_condvar_loan_mut, \ z_owned_config_t : z_config_loan_mut, \ z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut \ - )(&x) - -#define z_drop(x) \ - _Generic((x), \ - z_owned_bytes_t* : z_bytes_drop, \ - z_owned_closure_hello_t* : z_closure_hello_drop, \ - zc_owned_closure_log_t* : z_closure_log_drop, \ - z_owned_closure_query_t* : z_closure_query_drop, \ - z_owned_closure_reply_t* : z_closure_reply_drop, \ - z_owned_closure_sample_t* : z_closure_sample_drop, \ - z_owned_condvar_t* : z_condvar_drop, \ - z_owned_config_t* : z_config_drop, \ - z_owned_encoding_t* : z_encoding_drop, \ - z_owned_fifo_handler_query_t* : z_fifo_handler_query_drop, \ - z_owned_fifo_handler_reply_t* : z_fifo_handler_reply_drop, \ - z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_drop, \ - z_owned_hello_t* : z_hello_drop, \ - z_owned_keyexpr_t* : z_keyexpr_drop, \ - z_owned_mutex_t* : z_mutex_drop, \ - z_owned_publisher_t* : z_publisher_drop, \ - z_owned_query_t* : z_query_drop, \ - z_owned_queryable_t* : z_queryable_drop, \ - z_owned_reply_t* : z_reply_drop, \ - z_owned_reply_err_t* : z_reply_err_drop, \ - z_owned_ring_handler_query_t* : z_ring_handler_query_drop, \ - z_owned_ring_handler_reply_t* : z_ring_handler_reply_drop, \ - z_owned_ring_handler_sample_t* : z_ring_handler_sample_drop, \ - z_owned_sample_t* : z_sample_drop, \ - z_owned_session_t* : z_session_drop, \ - z_owned_slice_t* : z_slice_drop, \ - z_owned_string_array_t* : z_string_array_drop, \ - z_owned_string_t* : z_string_drop, \ - z_owned_subscriber_t* : z_subscriber_drop \ - )(x) - -#define z_move(x) (&x) - -#define z_null(x) \ - _Generic((x), \ + z_owned_shm_t : z_shm_loan_mut, \ + z_owned_shm_mut_t : z_shm_mut_loan_mut, \ + z_owned_string_array_t : z_string_array_loan_mut, \ + zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ + )(&this_) + +#define z_drop(this_) \ + _Generic((this_), \ + z_moved_alloc_layout_t : z_alloc_layout_drop, \ + z_moved_bytes_t : z_bytes_drop, \ + z_moved_chunk_alloc_result_t : z_chunk_alloc_result_drop, \ + z_moved_closure_hello_t : z_closure_hello_drop, \ + z_moved_closure_query_t : z_closure_query_drop, \ + z_moved_closure_reply_t : z_closure_reply_drop, \ + z_moved_closure_sample_t : z_closure_sample_drop, \ + z_moved_closure_zid_t : z_closure_zid_drop, \ + z_moved_condvar_t : z_condvar_drop, \ + z_moved_config_t : z_config_drop, \ + z_moved_encoding_t : z_encoding_drop, \ + z_moved_fifo_handler_query_t : z_fifo_handler_query_drop, \ + z_moved_fifo_handler_reply_t : z_fifo_handler_reply_drop, \ + z_moved_fifo_handler_sample_t : z_fifo_handler_sample_drop, \ + z_moved_hello_t : z_hello_drop, \ + z_moved_keyexpr_t : z_keyexpr_drop, \ + z_moved_memory_layout_t : z_memory_layout_drop, \ + z_moved_mutex_t : z_mutex_drop, \ + z_moved_publisher_t : z_publisher_drop, \ + z_moved_query_t : z_query_drop, \ + z_moved_queryable_t : z_queryable_drop, \ + z_moved_reply_t : z_reply_drop, \ + z_moved_reply_err_t : z_reply_err_drop, \ + z_moved_ring_handler_query_t : z_ring_handler_query_drop, \ + z_moved_ring_handler_reply_t : z_ring_handler_reply_drop, \ + z_moved_ring_handler_sample_t : z_ring_handler_sample_drop, \ + z_moved_sample_t : z_sample_drop, \ + z_moved_session_t : z_session_drop, \ + z_moved_shm_client_t : z_shm_client_drop, \ + z_moved_shm_client_storage_t : z_shm_client_storage_drop, \ + z_moved_shm_t : z_shm_drop, \ + z_moved_shm_mut_t : z_shm_mut_drop, \ + z_moved_shm_provider_t : z_shm_provider_drop, \ + z_moved_slice_t : z_slice_drop, \ + z_moved_source_info_t : z_source_info_drop, \ + z_moved_string_array_t : z_string_array_drop, \ + z_moved_string_t : z_string_drop, \ + z_moved_subscriber_t : z_subscriber_drop, \ + z_moved_task_t : z_task_drop, \ + zc_moved_closure_log_t : zc_closure_log_drop, \ + zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ + zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ + zc_moved_matching_listener_t : zc_publisher_matching_listener_drop, \ + zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ + ze_moved_publication_cache_t : ze_publication_cache_drop, \ + ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ + )(this_) + +#define z_move(this_) \ + _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_move, \ + z_owned_bytes_t : z_bytes_move, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ + z_owned_closure_hello_t : z_closure_hello_move, \ + z_owned_closure_query_t : z_closure_query_move, \ + z_owned_closure_reply_t : z_closure_reply_move, \ + z_owned_closure_sample_t : z_closure_sample_move, \ + z_owned_closure_zid_t : z_closure_zid_move, \ + z_owned_condvar_t : z_condvar_move, \ + z_owned_config_t : z_config_move, \ + z_owned_encoding_t : z_encoding_move, \ + z_owned_fifo_handler_query_t : z_fifo_handler_query_move, \ + z_owned_fifo_handler_reply_t : z_fifo_handler_reply_move, \ + z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ + z_owned_hello_t : z_hello_move, \ + z_owned_keyexpr_t : z_keyexpr_move, \ + z_owned_memory_layout_t : z_memory_layout_move, \ + z_owned_mutex_t : z_mutex_move, \ + z_owned_publisher_t : z_publisher_move, \ + z_owned_query_t : z_query_move, \ + z_owned_queryable_t : z_queryable_move, \ + z_owned_reply_t : z_reply_move, \ + z_owned_reply_err_t : z_reply_err_move, \ + z_owned_ring_handler_query_t : z_ring_handler_query_move, \ + z_owned_ring_handler_reply_t : z_ring_handler_reply_move, \ + z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ + z_owned_sample_t : z_sample_move, \ + z_owned_session_t : z_session_move, \ + z_owned_shm_client_t : z_shm_client_move, \ + z_owned_shm_client_storage_t : z_shm_client_storage_move, \ + z_owned_shm_t : z_shm_move, \ + z_owned_shm_mut_t : z_shm_mut_move, \ + z_owned_shm_provider_t : z_shm_provider_move, \ + z_owned_slice_t : z_slice_move, \ + z_owned_source_info_t : z_source_info_move, \ + z_owned_string_array_t : z_string_array_move, \ + z_owned_string_t : z_string_move, \ + z_owned_subscriber_t : z_subscriber_move, \ + z_owned_task_t : z_task_move, \ + zc_owned_closure_log_t : zc_closure_log_move, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ + zc_owned_liveliness_token_t : zc_liveliness_token_move, \ + zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ + zc_owned_shm_client_list_t : zc_shm_client_list_move, \ + ze_owned_publication_cache_t : ze_publication_cache_move, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ + )(&this_) + +#define z_null(this_) \ + _Generic((this_), \ + z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ - zc_owned_closure_log_t* : z_closure_log_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ + z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -101,6 +232,7 @@ z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ + z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -112,24 +244,134 @@ z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ + z_owned_shm_client_t* : z_shm_client_null, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ + z_owned_shm_mut_t* : z_shm_mut_null, \ + z_owned_shm_t* : z_shm_null, \ + z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ + z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - z_view_keyexpr_t* : z_view_keyexpr_null, \ - z_view_slice_t* : z_view_slice_null, \ - z_view_string_t* : z_view_string_null \ - )(x) + zc_owned_closure_log_t* : zc_closure_log_null, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ + zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ + zc_owned_matching_listener_t* : zc_matching_listener_null, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ + ze_owned_publication_cache_t* : ze_publication_cache_null, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ + )(this_) + +static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } +static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t x) { *this_ = *x._ptr; z_fifo_handler_query_null(x._ptr); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t x) { *this_ = *x._ptr; z_fifo_handler_reply_null(x._ptr); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } +static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t x) { *this_ = *x._ptr; z_ring_handler_reply_null(x._ptr); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } +static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } +static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } +static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } +static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } +static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } +static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } +static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } +static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } +static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } + -#define z_check(x) \ - _Generic((x), \ +#define z_take(this_, x) \ + _Generic((this_), \ + z_owned_alloc_layout_t* : z_alloc_layout_take, \ + z_owned_bytes_t* : z_bytes_take, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ + z_owned_closure_hello_t* : z_closure_hello_take, \ + z_owned_closure_query_t* : z_closure_query_take, \ + z_owned_closure_reply_t* : z_closure_reply_take, \ + z_owned_closure_sample_t* : z_closure_sample_take, \ + z_owned_closure_zid_t* : z_closure_zid_take, \ + z_owned_condvar_t* : z_condvar_take, \ + z_owned_config_t* : z_config_take, \ + z_owned_encoding_t* : z_encoding_take, \ + z_owned_fifo_handler_query_t* : z_fifo_handler_query_take, \ + z_owned_fifo_handler_reply_t* : z_fifo_handler_reply_take, \ + z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ + z_owned_hello_t* : z_hello_take, \ + z_owned_keyexpr_t* : z_keyexpr_take, \ + z_owned_memory_layout_t* : z_memory_layout_take, \ + z_owned_mutex_t* : z_mutex_take, \ + z_owned_publisher_t* : z_publisher_take, \ + z_owned_query_t* : z_query_take, \ + z_owned_queryable_t* : z_queryable_take, \ + z_owned_reply_t* : z_reply_take, \ + z_owned_reply_err_t* : z_reply_err_take, \ + z_owned_ring_handler_query_t* : z_ring_handler_query_take, \ + z_owned_ring_handler_reply_t* : z_ring_handler_reply_take, \ + z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ + z_owned_sample_t* : z_sample_take, \ + z_owned_session_t* : z_session_take, \ + z_owned_shm_client_t* : z_shm_client_take, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ + z_owned_shm_t* : z_shm_take, \ + z_owned_shm_mut_t* : z_shm_mut_take, \ + z_owned_shm_provider_t* : z_shm_provider_take, \ + z_owned_slice_t* : z_slice_take, \ + z_owned_source_info_t* : z_source_info_take, \ + z_owned_string_array_t* : z_string_array_take, \ + z_owned_string_t* : z_string_take, \ + z_owned_subscriber_t* : z_subscriber_take, \ + z_owned_task_t* : z_task_take, \ + zc_owned_closure_log_t* : zc_closure_log_take, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ + zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ + zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ + ze_owned_publication_cache_t* : ze_publication_cache_take, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ + )(this_, x) + +#define z_check(this_) \ + _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ - zc_owned_closure_log_t : z_closure_log_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ + z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -138,6 +380,7 @@ z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ + z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -149,56 +392,118 @@ z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ + z_owned_shm_t : z_shm_check, \ + z_owned_shm_client_t : z_shm_client_check, \ + z_owned_shm_client_storage_t : z_shm_client_storage_check, \ + z_owned_shm_mut_t : z_shm_mut_check, \ + z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ + z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - z_view_keyexpr_t : z_view_keyexpr_check, \ - z_view_slice_t : z_view_slice_check, \ - z_view_string_t : z_view_string_check \ - )(&x) + zc_owned_closure_log_t : zc_closure_log_check, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ + zc_owned_liveliness_token_t : zc_liveliness_token_check, \ + zc_owned_matching_listener_t : zc_matching_listener_check, \ + zc_owned_shm_client_list_t : zc_shm_client_list_check, \ + ze_owned_publication_cache_t : ze_publication_cache_check, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ + )(&this_) -#define z_call(x, ...) \ - _Generic((x), \ +#define z_call(closure, hello) \ + _Generic((closure), \ const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call \ - )(x, __VA_ARGS__) + const z_loaned_closure_sample_t* : z_closure_sample_call, \ + const z_loaned_closure_zid_t* : z_closure_zid_call, \ + const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ {{(x)->context = (void*)(ctx); (x)->call = (callback); (x)->drop = (dropper);}} -#define z_try_recv(x, ...) \ - _Generic((x), \ +#define z_try_recv(this_, query) \ + _Generic((this_), \ const z_loaned_fifo_handler_query_t* : z_fifo_handler_query_try_recv, \ const z_loaned_fifo_handler_reply_t* : z_fifo_handler_reply_try_recv, \ const z_loaned_fifo_handler_sample_t* : z_fifo_handler_sample_try_recv, \ const z_loaned_ring_handler_query_t* : z_ring_handler_query_try_recv, \ const z_loaned_ring_handler_reply_t* : z_ring_handler_reply_try_recv, \ const z_loaned_ring_handler_sample_t* : z_ring_handler_sample_try_recv \ - )(x, __VA_ARGS__) + )(this_, query) -#define z_recv(x, ...) \ - _Generic((x), \ +#define z_recv(this_, query) \ + _Generic((this_), \ const z_loaned_fifo_handler_query_t* : z_fifo_handler_query_recv, \ const z_loaned_fifo_handler_reply_t* : z_fifo_handler_reply_recv, \ const z_loaned_fifo_handler_sample_t* : z_fifo_handler_sample_recv, \ const z_loaned_ring_handler_query_t* : z_ring_handler_query_recv, \ const z_loaned_ring_handler_reply_t* : z_ring_handler_reply_recv, \ const z_loaned_ring_handler_sample_t* : z_ring_handler_sample_recv \ - )(x, __VA_ARGS__) + )(this_, query) #else // #ifndef __cplusplus +static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return z_moved_alloc_layout_t{x}; } +static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return z_moved_bytes_t{x}; } +static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return z_moved_chunk_alloc_result_t{x}; } +static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return z_moved_closure_hello_t{x}; } +static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return z_moved_closure_query_t{x}; } +static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return z_moved_closure_reply_t{x}; } +static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return z_moved_closure_sample_t{x}; } +static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return z_moved_closure_zid_t{x}; } +static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return z_moved_condvar_t{x}; } +static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return z_moved_config_t{x}; } +static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return z_moved_encoding_t{x}; } +static inline z_moved_fifo_handler_query_t z_fifo_handler_query_move(z_owned_fifo_handler_query_t* x) { return z_moved_fifo_handler_query_t{x}; } +static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fifo_handler_reply_t* x) { return z_moved_fifo_handler_reply_t{x}; } +static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return z_moved_fifo_handler_sample_t{x}; } +static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_hello_t{x}; } +static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } +static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return z_moved_memory_layout_t{x}; } +static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } +static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } +static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } +static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return z_moved_queryable_t{x}; } +static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return z_moved_reply_t{x}; } +static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return z_moved_reply_err_t{x}; } +static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return z_moved_ring_handler_query_t{x}; } +static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_ring_handler_reply_t* x) { return z_moved_ring_handler_reply_t{x}; } +static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return z_moved_ring_handler_sample_t{x}; } +static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return z_moved_sample_t{x}; } +static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return z_moved_session_t{x}; } +static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return z_moved_shm_client_t{x}; } +static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return z_moved_shm_client_storage_t{x}; } +static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return z_moved_shm_t{x}; } +static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return z_moved_shm_mut_t{x}; } +static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return z_moved_shm_provider_t{x}; } +static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return z_moved_slice_t{x}; } +static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return z_moved_source_info_t{x}; } +static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return z_moved_string_array_t{x}; } +static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return z_moved_string_t{x}; } +static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return z_moved_subscriber_t{x}; } +static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_task_t{x}; } +static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } +static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } +static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } +static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return zc_moved_matching_listener_t{x}; } +static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } +static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } +static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } + + +inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; +inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; -inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return z_closure_log_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; +inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -207,6 +512,7 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; +inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -217,13 +523,23 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; +inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; +inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; +inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; +inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; +inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return z_view_keyexpr_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; +inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; +inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; +inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; +inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; +inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -232,112 +548,352 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; +inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; +inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; +inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; + + +inline void z_drop(z_moved_alloc_layout_t this_) { z_alloc_layout_drop(this_); }; +inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; +inline void z_drop(z_moved_chunk_alloc_result_t this_) { z_chunk_alloc_result_drop(this_); }; +inline void z_drop(z_moved_closure_hello_t _closure) { z_closure_hello_drop(_closure); }; +inline void z_drop(z_moved_closure_query_t closure) { z_closure_query_drop(closure); }; +inline void z_drop(z_moved_closure_reply_t closure) { z_closure_reply_drop(closure); }; +inline void z_drop(z_moved_closure_sample_t closure) { z_closure_sample_drop(closure); }; +inline void z_drop(z_moved_closure_zid_t closure) { z_closure_zid_drop(closure); }; +inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; +inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; +inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; +inline void z_drop(z_moved_fifo_handler_query_t this_) { z_fifo_handler_query_drop(this_); }; +inline void z_drop(z_moved_fifo_handler_reply_t this_) { z_fifo_handler_reply_drop(this_); }; +inline void z_drop(z_moved_fifo_handler_sample_t this_) { z_fifo_handler_sample_drop(this_); }; +inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; +inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; +inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; +inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; +inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; +inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; +inline void z_drop(z_moved_queryable_t this_) { z_queryable_drop(this_); }; +inline void z_drop(z_moved_reply_t this_) { z_reply_drop(this_); }; +inline void z_drop(z_moved_reply_err_t this_) { z_reply_err_drop(this_); }; +inline void z_drop(z_moved_ring_handler_query_t this_) { z_ring_handler_query_drop(this_); }; +inline void z_drop(z_moved_ring_handler_reply_t this_) { z_ring_handler_reply_drop(this_); }; +inline void z_drop(z_moved_ring_handler_sample_t this_) { z_ring_handler_sample_drop(this_); }; +inline void z_drop(z_moved_sample_t this_) { z_sample_drop(this_); }; +inline void z_drop(z_moved_session_t this_) { z_session_drop(this_); }; +inline void z_drop(z_moved_shm_client_t this_) { z_shm_client_drop(this_); }; +inline void z_drop(z_moved_shm_client_storage_t this_) { z_shm_client_storage_drop(this_); }; +inline void z_drop(z_moved_shm_t this_) { z_shm_drop(this_); }; +inline void z_drop(z_moved_shm_mut_t this_) { z_shm_mut_drop(this_); }; +inline void z_drop(z_moved_shm_provider_t this_) { z_shm_provider_drop(this_); }; +inline void z_drop(z_moved_slice_t this_) { z_slice_drop(this_); }; +inline void z_drop(z_moved_source_info_t this_) { z_source_info_drop(this_); }; +inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); }; +inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; +inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; +inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; +inline void z_drop(zc_moved_closure_log_t closure) { zc_closure_log_drop(closure); }; +inline void z_drop(zc_moved_closure_matching_status_t closure) { zc_closure_matching_status_drop(closure); }; +inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; +inline z_result_t z_drop(zc_moved_matching_listener_t this_) { return zc_publisher_matching_listener_drop(this_); }; +inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; +inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; +inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; + + +inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; +inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; +inline z_moved_chunk_alloc_result_t z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; +inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& _closure) { return z_closure_hello_move(&_closure); }; +inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure) { return z_closure_query_move(&closure); }; +inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure) { return z_closure_reply_move(&closure); }; +inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure) { return z_closure_sample_move(&closure); }; +inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure) { return z_closure_zid_move(&closure); }; +inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; +inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; +inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; +inline z_moved_fifo_handler_query_t z_move(z_owned_fifo_handler_query_t& this_) { return z_fifo_handler_query_move(&this_); }; +inline z_moved_fifo_handler_reply_t z_move(z_owned_fifo_handler_reply_t& this_) { return z_fifo_handler_reply_move(&this_); }; +inline z_moved_fifo_handler_sample_t z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; +inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; +inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; +inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; +inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; +inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; +inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; +inline z_moved_queryable_t z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; +inline z_moved_reply_t z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; +inline z_moved_reply_err_t z_move(z_owned_reply_err_t& this_) { return z_reply_err_move(&this_); }; +inline z_moved_ring_handler_query_t z_move(z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_move(&this_); }; +inline z_moved_ring_handler_reply_t z_move(z_owned_ring_handler_reply_t& this_) { return z_ring_handler_reply_move(&this_); }; +inline z_moved_ring_handler_sample_t z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; +inline z_moved_sample_t z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; +inline z_moved_session_t z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; +inline z_moved_shm_client_t z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; +inline z_moved_shm_client_storage_t z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; +inline z_moved_shm_t z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; +inline z_moved_shm_mut_t z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; +inline z_moved_shm_provider_t z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; +inline z_moved_slice_t z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; +inline z_moved_source_info_t z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; +inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; +inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; +inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; +inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; +inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure) { return zc_closure_log_move(&closure); }; +inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_move(&closure); }; +inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; +inline zc_moved_matching_listener_t z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; +inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; +inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; +inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; + +inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; +inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; +inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; +inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; +inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; +inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; +inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; +inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; +inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; +inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; +inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; +inline void z_null(z_owned_fifo_handler_query_t* this_) { z_fifo_handler_query_null(this_); }; +inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_null(this_); }; +inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; +inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; +inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; +inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; +inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; +inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; +inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; +inline void z_null(z_owned_queryable_t* this_) { z_queryable_null(this_); }; +inline void z_null(z_owned_reply_err_t* this_) { z_reply_err_null(this_); }; +inline void z_null(z_owned_reply_t* this_) { z_reply_null(this_); }; +inline void z_null(z_owned_ring_handler_query_t* this_) { z_ring_handler_query_null(this_); }; +inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_null(this_); }; +inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; +inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; +inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; +inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; +inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; +inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; +inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; +inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; +inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; +inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; +inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; +inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; +inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; +inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; +inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; +inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; +inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; +inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; +inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; +inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; +inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; -inline void z_drop(z_owned_bytes_t* this_) { return z_bytes_drop(this_); }; -inline void z_drop(z_owned_closure_hello_t* closure) { return z_closure_hello_drop(closure); }; -inline void z_drop(zc_owned_closure_log_t* closure) { return z_closure_log_drop(closure); }; -inline void z_drop(z_owned_closure_query_t* closure) { return z_closure_query_drop(closure); }; -inline void z_drop(z_owned_closure_reply_t* closure) { return z_closure_reply_drop(closure); }; -inline void z_drop(z_owned_closure_sample_t* closure) { return z_closure_sample_drop(closure); }; -inline void z_drop(z_owned_condvar_t* this_) { return z_condvar_drop(this_); }; -inline void z_drop(z_owned_config_t* this_) { return z_config_drop(this_); }; -inline void z_drop(z_owned_encoding_t* this_) { return z_encoding_drop(this_); }; -inline void z_drop(z_owned_fifo_handler_query_t* this_) { return z_fifo_handler_query_drop(this_); }; -inline void z_drop(z_owned_fifo_handler_reply_t* this_) { return z_fifo_handler_reply_drop(this_); }; -inline void z_drop(z_owned_fifo_handler_sample_t* this_) { return z_fifo_handler_sample_drop(this_); }; -inline void z_drop(z_owned_hello_t* this_) { return z_hello_drop(this_); }; -inline void z_drop(z_owned_keyexpr_t* this_) { return z_keyexpr_drop(this_); }; -inline void z_drop(z_owned_mutex_t* this_) { return z_mutex_drop(this_); }; -inline void z_drop(z_owned_publisher_t* this_) { return z_publisher_drop(this_); }; -inline void z_drop(z_owned_query_t* this_) { return z_query_drop(this_); }; -inline void z_drop(z_owned_queryable_t* this_) { return z_queryable_drop(this_); }; -inline void z_drop(z_owned_reply_t* this_) { return z_reply_drop(this_); }; -inline void z_drop(z_owned_reply_err_t* this_) { return z_reply_err_drop(this_); }; -inline void z_drop(z_owned_ring_handler_query_t* this_) { return z_ring_handler_query_drop(this_); }; -inline void z_drop(z_owned_ring_handler_reply_t* this_) { return z_ring_handler_reply_drop(this_); }; -inline void z_drop(z_owned_ring_handler_sample_t* this_) { return z_ring_handler_sample_drop(this_); }; -inline void z_drop(z_owned_sample_t* this_) { return z_sample_drop(this_); }; -inline void z_drop(z_owned_session_t* this_) { return z_session_drop(this_); }; -inline void z_drop(z_owned_slice_t* this_) { return z_slice_drop(this_); }; -inline void z_drop(z_owned_string_array_t* this_) { return z_string_array_drop(this_); }; -inline void z_drop(z_owned_string_t* this_) { return z_string_drop(this_); }; -inline void z_drop(z_owned_subscriber_t* this_) { return z_subscriber_drop(this_); }; - - -inline z_owned_bytes_t* z_move(z_owned_bytes_t& this_) { return (&this_); }; -inline z_owned_closure_hello_t* z_move(z_owned_closure_hello_t& closure) { return (&closure); }; -inline zc_owned_closure_log_t* z_move(zc_owned_closure_log_t& closure) { return (&closure); }; -inline z_owned_closure_query_t* z_move(z_owned_closure_query_t& closure) { return (&closure); }; -inline z_owned_closure_reply_t* z_move(z_owned_closure_reply_t& closure) { return (&closure); }; -inline z_owned_closure_sample_t* z_move(z_owned_closure_sample_t& closure) { return (&closure); }; -inline z_owned_condvar_t* z_move(z_owned_condvar_t& this_) { return (&this_); }; -inline z_owned_config_t* z_move(z_owned_config_t& this_) { return (&this_); }; -inline z_owned_encoding_t* z_move(z_owned_encoding_t& this_) { return (&this_); }; -inline z_owned_fifo_handler_query_t* z_move(z_owned_fifo_handler_query_t& this_) { return (&this_); }; -inline z_owned_fifo_handler_reply_t* z_move(z_owned_fifo_handler_reply_t& this_) { return (&this_); }; -inline z_owned_fifo_handler_sample_t* z_move(z_owned_fifo_handler_sample_t& this_) { return (&this_); }; -inline z_owned_hello_t* z_move(z_owned_hello_t& this_) { return (&this_); }; -inline z_owned_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return (&this_); }; -inline z_owned_mutex_t* z_move(z_owned_mutex_t& this_) { return (&this_); }; -inline z_owned_publisher_t* z_move(z_owned_publisher_t& this_) { return (&this_); }; -inline z_owned_query_t* z_move(z_owned_query_t& this_) { return (&this_); }; -inline z_owned_queryable_t* z_move(z_owned_queryable_t& this_) { return (&this_); }; -inline z_owned_reply_t* z_move(z_owned_reply_t& this_) { return (&this_); }; -inline z_owned_reply_err_t* z_move(z_owned_reply_err_t& this_) { return (&this_); }; -inline z_owned_ring_handler_query_t* z_move(z_owned_ring_handler_query_t& this_) { return (&this_); }; -inline z_owned_ring_handler_reply_t* z_move(z_owned_ring_handler_reply_t& this_) { return (&this_); }; -inline z_owned_ring_handler_sample_t* z_move(z_owned_ring_handler_sample_t& this_) { return (&this_); }; -inline z_owned_sample_t* z_move(z_owned_sample_t& this_) { return (&this_); }; -inline z_owned_session_t* z_move(z_owned_session_t& this_) { return (&this_); }; -inline z_owned_slice_t* z_move(z_owned_slice_t& this_) { return (&this_); }; -inline z_owned_string_array_t* z_move(z_owned_string_array_t& this_) { return (&this_); }; -inline z_owned_string_t* z_move(z_owned_string_t& this_) { return (&this_); }; -inline z_owned_subscriber_t* z_move(z_owned_subscriber_t& this_) { return (&this_); }; - - -inline void z_null(z_owned_bytes_t* this_) { return z_bytes_null(this_); }; -inline void z_null(z_owned_closure_hello_t* this_) { return z_closure_hello_null(this_); }; -inline void z_null(zc_owned_closure_log_t* this_) { return z_closure_log_null(this_); }; -inline void z_null(z_owned_closure_query_t* this_) { return z_closure_query_null(this_); }; -inline void z_null(z_owned_closure_reply_t* this_) { return z_closure_reply_null(this_); }; -inline void z_null(z_owned_closure_sample_t* this_) { return z_closure_sample_null(this_); }; -inline void z_null(z_owned_condvar_t* this_) { return z_condvar_null(this_); }; -inline void z_null(z_owned_config_t* this_) { return z_config_null(this_); }; -inline void z_null(z_owned_encoding_t* this_) { return z_encoding_null(this_); }; -inline void z_null(z_owned_fifo_handler_query_t* this_) { return z_fifo_handler_query_null(this_); }; -inline void z_null(z_owned_fifo_handler_reply_t* this_) { return z_fifo_handler_reply_null(this_); }; -inline void z_null(z_owned_fifo_handler_sample_t* this_) { return z_fifo_handler_sample_null(this_); }; -inline void z_null(z_owned_hello_t* this_) { return z_hello_null(this_); }; -inline void z_null(z_owned_keyexpr_t* this_) { return z_keyexpr_null(this_); }; -inline void z_null(z_owned_mutex_t* this_) { return z_mutex_null(this_); }; -inline void z_null(z_owned_publisher_t* this_) { return z_publisher_null(this_); }; -inline void z_null(z_owned_query_t* this_) { return z_query_null(this_); }; -inline void z_null(z_owned_queryable_t* this_) { return z_queryable_null(this_); }; -inline void z_null(z_owned_reply_err_t* this_) { return z_reply_err_null(this_); }; -inline void z_null(z_owned_reply_t* this_) { return z_reply_null(this_); }; -inline void z_null(z_owned_ring_handler_query_t* this_) { return z_ring_handler_query_null(this_); }; -inline void z_null(z_owned_ring_handler_reply_t* this_) { return z_ring_handler_reply_null(this_); }; -inline void z_null(z_owned_ring_handler_sample_t* this_) { return z_ring_handler_sample_null(this_); }; -inline void z_null(z_owned_sample_t* this_) { return z_sample_null(this_); }; -inline void z_null(z_owned_session_t* this_) { return z_session_null(this_); }; -inline void z_null(z_owned_slice_t* this_) { return z_slice_null(this_); }; -inline void z_null(z_owned_string_array_t* this_) { return z_string_array_null(this_); }; -inline void z_null(z_owned_string_t* this_) { return z_string_null(this_); }; -inline void z_null(z_owned_subscriber_t* this_) { return z_subscriber_null(this_); }; -inline void z_null(z_owned_task_t* this_) { return z_task_null(this_); }; -inline void z_null(z_view_keyexpr_t* this_) { return z_view_keyexpr_null(this_); }; -inline void z_null(z_view_slice_t* this_) { return z_view_slice_null(this_); }; -inline void z_null(z_view_string_t* this_) { return z_view_string_null(this_); }; +static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } +static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t x) { *this_ = *x._ptr; z_fifo_handler_query_null(x._ptr); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t x) { *this_ = *x._ptr; z_fifo_handler_reply_null(x._ptr); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } +static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t x) { *this_ = *x._ptr; z_ring_handler_reply_null(x._ptr); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } +static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } +static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } +static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } +static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } +static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } +static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } +static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } +static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } +static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } + +inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { + z_alloc_layout_take(this_, x); +}; +inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { + z_bytes_take(this_, x); +}; +inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { + z_chunk_alloc_result_take(this_, x); +}; +inline void z_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { + z_closure_hello_take(_closure, x); +}; +inline void z_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { + z_closure_query_take(closure, x); +}; +inline void z_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { + z_closure_reply_take(closure, x); +}; +inline void z_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { + z_closure_sample_take(closure, x); +}; +inline void z_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { + z_closure_zid_take(closure, x); +}; +inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { + z_condvar_take(this_, x); +}; +inline void z_take(z_owned_config_t* this_, z_moved_config_t x) { + z_config_take(this_, x); +}; +inline void z_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { + z_encoding_take(this_, x); +}; +inline void z_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t x) { + z_fifo_handler_query_take(this_, x); +}; +inline void z_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t x) { + z_fifo_handler_reply_take(this_, x); +}; +inline void z_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { + z_fifo_handler_sample_take(this_, x); +}; +inline void z_take(z_owned_hello_t* this_, z_moved_hello_t x) { + z_hello_take(this_, x); +}; +inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { + z_keyexpr_take(this_, x); +}; +inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { + z_memory_layout_take(this_, x); +}; +inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { + z_mutex_take(this_, x); +}; +inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { + z_publisher_take(this_, x); +}; +inline void z_take(z_owned_query_t* this_, z_moved_query_t x) { + z_query_take(this_, x); +}; +inline void z_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { + z_queryable_take(this_, x); +}; +inline void z_take(z_owned_reply_t* this_, z_moved_reply_t x) { + z_reply_take(this_, x); +}; +inline void z_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { + z_reply_err_take(this_, x); +}; +inline void z_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { + z_ring_handler_query_take(this_, x); +}; +inline void z_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t x) { + z_ring_handler_reply_take(this_, x); +}; +inline void z_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { + z_ring_handler_sample_take(this_, x); +}; +inline void z_take(z_owned_sample_t* this_, z_moved_sample_t x) { + z_sample_take(this_, x); +}; +inline void z_take(z_owned_session_t* this_, z_moved_session_t x) { + z_session_take(this_, x); +}; +inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { + z_shm_client_take(this_, x); +}; +inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { + z_shm_client_storage_take(this_, x); +}; +inline void z_take(z_owned_shm_t* this_, z_moved_shm_t x) { + z_shm_take(this_, x); +}; +inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { + z_shm_mut_take(this_, x); +}; +inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { + z_shm_provider_take(this_, x); +}; +inline void z_take(z_owned_slice_t* this_, z_moved_slice_t x) { + z_slice_take(this_, x); +}; +inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { + z_source_info_take(this_, x); +}; +inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { + z_string_array_take(this_, x); +}; +inline void z_take(z_owned_string_t* this_, z_moved_string_t x) { + z_string_take(this_, x); +}; +inline void z_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { + z_subscriber_take(this_, x); +}; +inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { + z_task_take(this_, x); +}; +inline void z_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { + zc_closure_log_take(closure, x); +}; +inline void z_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { + zc_closure_matching_status_take(closure, x); +}; +inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { + zc_liveliness_token_take(this_, x); +}; +inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { + zc_publisher_matching_listener_take(this_, x); +}; +inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { + zc_shm_client_list_take(this_, x); +}; +inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { + ze_publication_cache_take(this_, x); +}; +inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { + ze_querying_subscriber_take(this_, x); +}; + + +inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; +inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; -inline bool z_check(const zc_owned_closure_log_t& this_) { return z_closure_log_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; +inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -346,6 +902,7 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; +inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -357,27 +914,43 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; +inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; +inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; +inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; +inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; +inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; +inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; -inline bool z_check(const z_view_keyexpr_t& this_) { return z_view_keyexpr_check(&this_); }; -inline bool z_check(const z_view_slice_t& this_) { return z_view_slice_check(&this_); }; -inline bool z_check(const z_view_string_t& this_) { return z_view_string_check(&this_); }; +inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; +inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; +inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; +inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; +inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; +inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; +inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { - return z_closure_hello_call(closure, hello); + z_closure_hello_call(closure, hello); }; inline void z_call(const z_loaned_closure_query_t* closure, const z_loaned_query_t* query) { - return z_closure_query_call(closure, query); + z_closure_query_call(closure, query); }; inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply_t* reply) { - return z_closure_reply_call(closure, reply); + z_closure_reply_call(closure, reply); }; inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { - return z_closure_sample_call(closure, sample); + z_closure_sample_call(closure, sample); +}; +inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { + z_closure_zid_call(closure, z_id); +}; +inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { + zc_closure_matching_status_call(closure, mathing_status); }; @@ -417,6 +990,24 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; +inline void z_closure( + z_owned_closure_zid_t* closure, + void (*call)(const z_id_t*, void*), + void (*drop)(void*), + void *context) { + closure->context = context; + closure->drop = drop; + closure->call = call; +}; +inline void z_closure( + zc_owned_closure_matching_status_t* closure, + void (*call)(const zc_matching_status_t*, void*), + void (*drop)(void*), + void *context) { + closure->context = context; + closure->drop = drop; + closure->call = call; +}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -460,18 +1051,22 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_query_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_reply_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -488,6 +1083,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -508,14 +1105,35 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_subscriber_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; -#endif // #ifndef __cplusplus \ No newline at end of file +#endif // #ifndef __cplusplus + diff --git a/include/zenoh_memory.h b/include/zenoh_memory.h index 088f4437b..010b28ef7 100644 --- a/include/zenoh_memory.h +++ b/include/zenoh_memory.h @@ -4,4 +4,4 @@ /*------------------ Memory ------------------*/ static inline void *z_malloc(size_t size) { return malloc(size); } static inline void *z_realloc(void *ptr, size_t size) { return realloc(ptr, size); } -static inline void z_free(void *ptr) { return free(ptr); } \ No newline at end of file +static inline void z_free(void *ptr) { free(ptr); } \ No newline at end of file diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index 93483cb00..afbd88aae 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -45,20 +45,28 @@ pub struct z_loaned_closure_hello_t { _0: [usize; 3], } +/// Moved closure. +#[repr(C)] +pub struct z_moved_closure_hello_t { + pub _ptr: Option<&'static mut z_owned_closure_hello_t>, +} + decl_c_type!( owned(z_owned_closure_hello_t), - loaned(z_loaned_closure_hello_t) + loaned(z_loaned_closure_hello_t), + moved(z_moved_closure_hello_t) ); -impl z_owned_closure_hello_t { - pub fn empty() -> Self { +impl Default for z_owned_closure_hello_t { + fn default() -> Self { z_owned_closure_hello_t { context: std::ptr::null_mut(), call: None, drop: None, } } - +} +impl z_owned_closure_hello_t { pub fn is_empty(&self) -> bool { self.call.is_none() && self.drop.is_none() && self.context.is_null() } @@ -76,7 +84,7 @@ impl Drop for z_owned_closure_hello_t { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_closure_hello_null(this: *mut MaybeUninit) { - (*this).write(z_owned_closure_hello_t::empty()); + (*this).write(z_owned_closure_hello_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. #[no_mangle] @@ -94,10 +102,9 @@ pub extern "C" fn z_closure_hello_call( } /// Drops the closure. Droping an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn z_closure_hello_drop(closure: &mut z_owned_closure_hello_t) { - let mut empty_closure = z_owned_closure_hello_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn z_closure_hello_drop(_closure: z_moved_closure_hello_t) {} + impl From for z_owned_closure_hello_t { fn from(f: F) -> Self { let this = Box::into_raw(Box::new(f)) as _; diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs index ff8dd0d13..70190ee5e 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -99,11 +99,28 @@ pub struct zc_loaned_closure_log_t { _0: [usize; 3], } +/// Moved closure. +#[repr(C)] +pub struct zc_moved_closure_log_t { + _ptr: Option<&'static mut zc_owned_closure_log_t>, +} + decl_c_type!( owned(zc_owned_closure_log_t), - loaned(zc_loaned_closure_log_t) + loaned(zc_loaned_closure_log_t), + moved(zc_moved_closure_log_t) ); +impl Default for zc_owned_closure_log_t { + fn default() -> Self { + zc_owned_closure_log_t { + context: std::ptr::null_mut(), + call: None, + drop: None, + } + } +} + impl zc_owned_closure_log_t { pub fn empty() -> Self { zc_owned_closure_log_t { @@ -129,12 +146,12 @@ impl Drop for zc_owned_closure_log_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_log_null(this: *mut MaybeUninit) { - (*this).write(zc_owned_closure_log_t::empty()); +pub unsafe extern "C" fn zc_closure_log_null(this: *mut MaybeUninit) { + (*this).write(zc_owned_closure_log_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn z_closure_log_call( +pub extern "C" fn zc_closure_log_call( closure: &zc_loaned_closure_log_t, severity: zc_log_severity_t, msg: &z_loaned_string_t, @@ -149,19 +166,19 @@ pub extern "C" fn z_closure_log_call( } /// Drops the closure. Droping an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn z_closure_log_drop(closure: &mut zc_owned_closure_log_t) { - let mut empty_closure = zc_owned_closure_log_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn zc_closure_log_drop(closure: zc_moved_closure_log_t) {} /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_log_check(this: &zc_owned_closure_log_t) -> bool { +pub extern "C" fn zc_closure_log_check(this: &zc_owned_closure_log_t) -> bool { !this.is_empty() } /// Borrows closure. #[no_mangle] -pub extern "C" fn z_closure_log_loan(closure: &zc_owned_closure_log_t) -> &zc_loaned_closure_log_t { +pub extern "C" fn zc_closure_log_loan( + closure: &zc_owned_closure_log_t, +) -> &zc_loaned_closure_log_t { closure.as_loaned_c_type_ref() } diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index cdf5d16a2..5c36960c3 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -43,20 +43,29 @@ pub struct zc_loaned_closure_matching_status_t { _0: [usize; 3], } +/// Moved closure. +#[repr(C)] +pub struct zc_moved_closure_matching_status_t { + pub _ptr: Option<&'static mut zc_owned_closure_matching_status_t>, +} + decl_c_type!( owned(zc_owned_closure_matching_status_t), - loaned(zc_loaned_closure_matching_status_t) + loaned(zc_loaned_closure_matching_status_t), + moved(zc_moved_closure_matching_status_t) ); -impl zc_owned_closure_matching_status_t { - pub fn empty() -> Self { +impl Default for zc_owned_closure_matching_status_t { + fn default() -> Self { zc_owned_closure_matching_status_t { context: std::ptr::null_mut(), call: None, drop: None, } } +} +impl zc_owned_closure_matching_status_t { pub fn is_empty(&self) -> bool { self.call.is_none() && self.drop.is_none() && self.context.is_null() } @@ -76,7 +85,7 @@ impl Drop for zc_owned_closure_matching_status_t { pub unsafe extern "C" fn zc_closure_matching_status_null( this: *mut MaybeUninit, ) { - (*this).write(zc_owned_closure_matching_status_t::empty()); + (*this).write(zc_owned_closure_matching_status_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -103,12 +112,9 @@ pub extern "C" fn zc_closure_matching_status_call( } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn zc_closure_matching_status_drop( - closure: &mut zc_owned_closure_matching_status_t, -) { - let mut empty_closure = zc_owned_closure_matching_status_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn zc_closure_matching_status_drop(closure: zc_moved_closure_matching_status_t) {} + impl From for zc_owned_closure_matching_status_t { fn from(f: F) -> Self { let this = Box::into_raw(Box::new(f)) as _; diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index 1b3c9cccb..dcc5ed676 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -16,27 +16,28 @@ use std::{mem::MaybeUninit, sync::Arc}; use libc::c_void; use zenoh::{ - handlers, - handlers::{IntoHandler, RingChannelHandler}, + handlers::{self, IntoHandler, RingChannelHandler}, query::Query, }; -pub use crate::opaque_types::{z_loaned_fifo_handler_query_t, z_owned_fifo_handler_query_t}; +pub use crate::opaque_types::{ + z_loaned_fifo_handler_query_t, z_moved_fifo_handler_query_t, z_owned_fifo_handler_query_t, +}; use crate::{ result::{self, z_result_t}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_loaned_query_t, z_owned_closure_query_t, z_owned_query_t, }; decl_c_type!( - owned(z_owned_fifo_handler_query_t, Option>), - loaned(z_loaned_fifo_handler_query_t, flume::Receiver) + owned(z_owned_fifo_handler_query_t, option flume::Receiver ), + loaned(z_loaned_fifo_handler_query_t), + moved(z_moved_fifo_handler_query_t) ); /// Drops the handler and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_drop(this: &mut z_owned_fifo_handler_query_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_fifo_handler_query_drop(this: z_moved_fifo_handler_query_t) {} /// Constructs a handler in gravestone state. #[no_mangle] @@ -141,17 +142,22 @@ pub extern "C" fn z_fifo_handler_query_try_recv( } } -pub use crate::opaque_types::{z_loaned_ring_handler_query_t, z_owned_ring_handler_query_t}; +pub use crate::opaque_types::{ + z_loaned_ring_handler_query_t, z_moved_ring_handler_query_t, z_owned_ring_handler_query_t, +}; decl_c_type!( - owned(z_owned_ring_handler_query_t, Option>), - loaned(z_loaned_ring_handler_query_t, RingChannelHandler) + owned( + z_owned_ring_handler_query_t, + option RingChannelHandler, + ), + loaned(z_loaned_ring_handler_query_t), +moved(z_moved_ring_handler_query_t) ); /// Drops the handler and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_drop(this: &mut z_owned_ring_handler_query_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_ring_handler_query_drop(this: z_moved_ring_handler_query_t) {} /// Constructs a handler in gravestone state. #[no_mangle] diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 7003acab1..0a468356c 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -44,20 +44,29 @@ pub struct z_loaned_closure_query_t { _0: [usize; 3], } +/// Moved closure. +#[repr(C)] +pub struct z_moved_closure_query_t { + pub _ptr: Option<&'static mut z_owned_closure_query_t>, +} + decl_c_type!( owned(z_owned_closure_query_t), - loaned(z_loaned_closure_query_t) + loaned(z_loaned_closure_query_t), + moved(z_moved_closure_query_t) ); -impl z_owned_closure_query_t { - pub const fn empty() -> Self { +impl Default for z_owned_closure_query_t { + fn default() -> Self { z_owned_closure_query_t { context: std::ptr::null_mut(), call: None, drop: None, } } +} +impl z_owned_closure_query_t { pub fn is_empty(&self) -> bool { self.call.is_none() && self.drop.is_none() && self.context.is_null() } @@ -75,7 +84,7 @@ impl Drop for z_owned_closure_query_t { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_closure_query_null(this: *mut MaybeUninit) { - (*this).write(z_owned_closure_query_t::empty()); + (*this).write(z_owned_closure_query_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -98,10 +107,9 @@ pub extern "C" fn z_closure_query_call( } /// Drops the closure, resetting it to its gravestone state. #[no_mangle] -pub extern "C" fn z_closure_query_drop(closure: &mut z_owned_closure_query_t) { - let mut empty_closure = z_owned_closure_query_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn z_closure_query_drop(closure: z_moved_closure_query_t) {} + impl From for z_owned_closure_query_t { fn from(f: F) -> Self { let this = Box::into_raw(Box::new(f)) as _; diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 8a4f00d5a..38937b3b8 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -44,20 +44,29 @@ pub struct z_loaned_closure_reply_t { _0: [usize; 3], } +/// Moved closure. +#[repr(C)] +pub struct z_moved_closure_reply_t { + pub _ptr: Option<&'static mut z_owned_closure_reply_t>, +} + decl_c_type!( owned(z_owned_closure_reply_t), - loaned(z_loaned_closure_reply_t) + loaned(z_loaned_closure_reply_t), + moved(z_moved_closure_reply_t) ); -impl z_owned_closure_reply_t { - pub(crate) fn empty() -> Self { +impl Default for z_owned_closure_reply_t { + fn default() -> Self { z_owned_closure_reply_t { context: std::ptr::null_mut(), call: None, drop: None, } } +} +impl z_owned_closure_reply_t { pub(crate) fn is_empty(&self) -> bool { self.call.is_none() && self.drop.is_none() && self.context.is_null() } @@ -75,7 +84,7 @@ impl Drop for z_owned_closure_reply_t { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_closure_reply_null(this: *mut MaybeUninit) { - (*this).write(z_owned_closure_reply_t::empty()); + (*this).write(z_owned_closure_reply_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -100,10 +109,9 @@ pub extern "C" fn z_closure_reply_call( } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn z_closure_reply_drop(closure: &mut z_owned_closure_reply_t) { - let mut empty_closure = z_owned_closure_reply_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn z_closure_reply_drop(closure: z_moved_closure_reply_t) {} + impl From for z_owned_closure_reply_t { fn from(f: F) -> Self { let this = Box::into_raw(Box::new(f)) as _; diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index 518d3eb7b..d2bebde69 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -16,27 +16,28 @@ use std::{mem::MaybeUninit, sync::Arc}; use libc::c_void; use zenoh::{ - handlers, - handlers::{IntoHandler, RingChannelHandler}, + handlers::{self, IntoHandler, RingChannelHandler}, query::Reply, }; -pub use crate::opaque_types::{z_loaned_fifo_handler_reply_t, z_owned_fifo_handler_reply_t}; +pub use crate::opaque_types::{ + z_loaned_fifo_handler_reply_t, z_moved_fifo_handler_reply_t, z_owned_fifo_handler_reply_t, +}; use crate::{ result::{self, z_result_t}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_loaned_reply_t, z_owned_closure_reply_t, z_owned_reply_t, }; decl_c_type!( - owned(z_owned_fifo_handler_reply_t, Option>), - loaned(z_loaned_fifo_handler_reply_t, flume::Receiver) + owned(z_owned_fifo_handler_reply_t, option flume::Receiver), + loaned(z_loaned_fifo_handler_reply_t), + moved(z_moved_fifo_handler_reply_t) ); /// Drops the handler and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_drop(this: &mut z_owned_fifo_handler_reply_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_fifo_handler_reply_drop(this: z_moved_fifo_handler_reply_t) {} /// Constructs a handler in gravestone state. #[no_mangle] @@ -140,17 +141,19 @@ pub extern "C" fn z_fifo_handler_reply_try_recv( } } -pub use crate::opaque_types::{z_loaned_ring_handler_reply_t, z_owned_ring_handler_reply_t}; +pub use crate::opaque_types::{ + z_loaned_ring_handler_reply_t, z_moved_ring_handler_reply_t, z_owned_ring_handler_reply_t, +}; decl_c_type!( - owned(z_owned_ring_handler_reply_t, Option>), - loaned(z_loaned_ring_handler_reply_t, RingChannelHandler) + owned(z_owned_ring_handler_reply_t, option RingChannelHandler), + loaned(z_loaned_ring_handler_reply_t), + moved(z_moved_ring_handler_reply_t) ); /// Drops the handler and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_drop(this: &mut z_owned_ring_handler_reply_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_ring_handler_reply_drop(this: z_moved_ring_handler_reply_t) {} /// Constructs a handler in gravestone state. #[no_mangle] diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index 6f84f3b3d..d80d9f484 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -16,27 +16,28 @@ use std::{mem::MaybeUninit, sync::Arc}; use libc::c_void; use zenoh::{ - handlers, - handlers::{IntoHandler, RingChannelHandler}, + handlers::{self, IntoHandler, RingChannelHandler}, sample::Sample, }; -pub use crate::opaque_types::{z_loaned_fifo_handler_sample_t, z_owned_fifo_handler_sample_t}; +pub use crate::opaque_types::{ + z_loaned_fifo_handler_sample_t, z_moved_fifo_handler_sample_t, z_owned_fifo_handler_sample_t, +}; use crate::{ result::{self, z_result_t}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_loaned_sample_t, z_owned_closure_sample_t, z_owned_sample_t, }; decl_c_type!( - owned(z_owned_fifo_handler_sample_t, Option>), - loaned(z_loaned_fifo_handler_sample_t, flume::Receiver) + owned(z_owned_fifo_handler_sample_t, option flume::Receiver), + loaned(z_loaned_fifo_handler_sample_t), + moved(z_moved_fifo_handler_sample_t) ); /// Drops the handler and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_sample_drop(this: &mut z_owned_fifo_handler_sample_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_fifo_handler_sample_drop(this: z_moved_fifo_handler_sample_t) {} /// Constructs a handler in gravestone state. #[no_mangle] @@ -143,17 +144,22 @@ pub extern "C" fn z_fifo_handler_sample_try_recv( } } -pub use crate::opaque_types::{z_loaned_ring_handler_sample_t, z_owned_ring_handler_sample_t}; +pub use crate::opaque_types::{ + z_loaned_ring_handler_sample_t, z_moved_ring_handler_sample_t, z_owned_ring_handler_sample_t, +}; decl_c_type!( - owned(z_owned_ring_handler_sample_t, Option>), - loaned(z_loaned_ring_handler_sample_t, RingChannelHandler) + owned( + z_owned_ring_handler_sample_t, + option RingChannelHandler, + ), + loaned(z_loaned_ring_handler_sample_t), + moved(z_moved_ring_handler_sample_t) ); /// Drops the handler and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_sample_drop(this: &mut z_owned_ring_handler_sample_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_ring_handler_sample_drop(this: z_moved_ring_handler_sample_t) {} /// Constructs a handler in gravestone state. #[no_mangle] diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index b35041a4b..7d7ca2545 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -44,20 +44,29 @@ pub struct z_loaned_closure_sample_t { _0: [usize; 3], } +/// Moved closure. +#[repr(C)] +pub struct z_moved_closure_sample_t { + pub _ptr: Option<&'static mut z_owned_closure_sample_t>, +} + decl_c_type!( owned(z_owned_closure_sample_t), - loaned(z_loaned_closure_sample_t) + loaned(z_loaned_closure_sample_t), + moved(z_moved_closure_sample_t) ); -impl z_owned_closure_sample_t { - pub const fn empty() -> Self { +impl Default for z_owned_closure_sample_t { + fn default() -> Self { z_owned_closure_sample_t { context: std::ptr::null_mut(), call: None, drop: None, } } +} +impl z_owned_closure_sample_t { pub fn is_empty(&self) -> bool { self.call.is_none() && self.drop.is_none() && self.context.is_null() } @@ -76,7 +85,7 @@ impl Drop for z_owned_closure_sample_t { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_closure_sample_null(this: &mut MaybeUninit) { - this.write(z_owned_closure_sample_t::empty()); + this.write(z_owned_closure_sample_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -100,10 +109,9 @@ pub extern "C" fn z_closure_sample_call( /// Drops the closure. Droping an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn z_closure_sample_drop(closure: &mut z_owned_closure_sample_t) { - let mut empty_closure = z_owned_closure_sample_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn z_closure_sample_drop(closure: z_moved_closure_sample_t) {} + impl From for z_owned_closure_sample_t { fn from(f: F) -> Self { let this = Box::into_raw(Box::new(f)) as _; diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index 7be0186b0..59e9d72ac 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -44,17 +44,29 @@ pub struct z_loaned_closure_zid_t { _0: [usize; 3], } -decl_c_type!(owned(z_owned_closure_zid_t), loaned(z_loaned_closure_zid_t)); +/// Moved closure. +#[repr(C)] +pub struct z_moved_closure_zid_t { + pub _ptr: Option<&'static mut z_owned_closure_zid_t>, +} -impl z_owned_closure_zid_t { - pub fn empty() -> Self { +decl_c_type!( + owned(z_owned_closure_zid_t), + loaned(z_loaned_closure_zid_t), + moved(z_moved_closure_zid_t) +); + +impl Default for z_owned_closure_zid_t { + fn default() -> Self { z_owned_closure_zid_t { context: std::ptr::null_mut(), call: None, drop: None, } } +} +impl z_owned_closure_zid_t { pub fn is_empty(&self) -> bool { self.call.is_none() && self.drop.is_none() && self.context.is_null() } @@ -80,7 +92,7 @@ pub unsafe extern "C" fn z_closure_zid_check(this: &z_owned_closure_zid_t) -> bo #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_closure_zid_null(this: &mut MaybeUninit) { - this.write(z_owned_closure_zid_t::empty()); + this.write(z_owned_closure_zid_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. #[no_mangle] @@ -95,10 +107,9 @@ pub extern "C" fn z_closure_zid_call(closure: &z_loaned_closure_zid_t, z_id: &z_ } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized (null) closure is a no-op. #[no_mangle] -pub extern "C" fn z_closure_zid_drop(closure: &mut z_owned_closure_zid_t) { - let mut empty_closure = z_owned_closure_zid_t::empty(); - std::mem::swap(&mut empty_closure, closure); -} +#[allow(unused_variables)] +pub extern "C" fn z_closure_zid_drop(closure: z_moved_closure_zid_t) {} + impl From for z_owned_closure_zid_t { fn from(f: F) -> Self { let this = Box::into_raw(Box::new(f)) as _; diff --git a/src/collections.rs b/src/collections.rs index 37262f382..2e32f971b 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -43,7 +43,7 @@ pub extern "C" fn _z_drop_c_slice_default(data: *mut c_void, context: *mut c_voi } #[derive(Default, Clone)] -pub struct CSliceOwned(pub CSlice); +pub struct CSliceOwned(CSlice); #[derive(Default)] pub struct CSliceView(CSlice); @@ -259,12 +259,13 @@ impl From> for CSlice { impl std::cmp::Eq for CSlice {} -pub use crate::opaque_types::{z_loaned_slice_t, z_owned_slice_t, z_view_slice_t}; +pub use crate::opaque_types::{z_loaned_slice_t, z_moved_slice_t, z_owned_slice_t, z_view_slice_t}; decl_c_type!( owned(z_owned_slice_t, CSliceOwned), - view(z_view_slice_t, CSliceView), loaned(z_loaned_slice_t, CSlice), + view(z_view_slice_t, CSliceView), + moved(z_moved_slice_t) ); /// Constructs an empty view slice. @@ -273,12 +274,6 @@ pub extern "C" fn z_view_slice_empty(this: &mut MaybeUninit) { this.as_rust_type_mut_uninit().write(CSliceView::default()); } -/// Constructs an empty view slice. -#[no_mangle] -pub extern "C" fn z_view_slice_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(CSliceView::default()); -} - /// Constructs a `len` bytes long view starting at `start`. /// /// @return -1 if `start == NULL` and `len > 0` (and creates an empty view slice), 0 otherwise. @@ -310,8 +305,8 @@ pub extern "C" fn z_view_slice_loan(this: &z_view_slice_t) -> &z_loaned_slice_t /// @return ``true`` if the slice is not empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_view_slice_check(this: &z_view_slice_t) -> bool { - !this.as_rust_type_ref().is_empty() +pub extern "C" fn z_view_slice_is_empty(this: &z_view_slice_t) -> bool { + this.as_rust_type_ref().is_empty() } /// Constructs an empty `z_owned_slice_t`. @@ -329,9 +324,8 @@ pub extern "C" fn z_slice_null(this: &mut MaybeUninit) { /// Frees the memory and invalidates the slice. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_slice_drop(this: &mut z_owned_slice_t) { - *this.as_rust_type_mut() = CSliceOwned::default(); -} +#[allow(unused_variables)] +pub unsafe extern "C" fn z_slice_drop(this: z_moved_slice_t) {} /// Borrows slice. #[no_mangle] @@ -423,14 +417,16 @@ pub unsafe extern "C" fn z_slice_from_buf( } } -pub use crate::opaque_types::{z_loaned_string_t, z_owned_string_t, z_view_string_t}; +pub use crate::opaque_types::{ + z_loaned_string_t, z_moved_string_t, z_owned_string_t, z_view_string_t, +}; #[derive(Default)] -pub struct CString(pub CSlice); +pub struct CString(CSlice); #[derive(Default)] -pub struct CStringOwned(pub CString); +pub struct CStringOwned(CString); #[derive(Default)] -pub struct CStringView(pub CString); +pub struct CStringView(CString); impl CString { pub fn new_borrowed_from_slice(slice: &[u8]) -> Self { @@ -513,18 +509,30 @@ impl From for CStringOwned { } } +impl From for CSlice { + fn from(value: CString) -> Self { + value.0 + } +} + +impl From for CSlice { + fn from(value: CStringOwned) -> Self { + value.0 .0 + } +} + decl_c_type!( owned(z_owned_string_t, CStringOwned), - view(z_view_string_t, CStringView), loaned(z_loaned_string_t, CString), + view(z_view_string_t, CStringView), + moved(z_moved_string_t) ); /// Frees memory and invalidates `z_owned_string_t`, putting it in gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_string_drop(this: &mut z_owned_string_t) { - *this.as_rust_type_mut() = CStringOwned::default(); -} +#[allow(unused_variables)] +pub unsafe extern "C" fn z_string_drop(this: z_moved_string_t) {} /// @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. #[no_mangle] @@ -541,14 +549,8 @@ pub extern "C" fn z_string_null(this: &mut MaybeUninit) { /// @return ``true`` if view string is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_view_string_check(this: &z_view_string_t) -> bool { - !this.as_rust_type_ref().is_empty() -} - -/// Constructs view string in a gravestone state. -#[no_mangle] -pub extern "C" fn z_view_string_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(CStringView::default()); +pub extern "C" fn z_view_string_is_empty(this: &z_view_string_t) -> bool { + this.as_rust_type_ref().is_empty() } /// Constructs an empty owned string. @@ -720,11 +722,14 @@ pub extern "C" fn z_string_is_empty(this: &z_loaned_string_t) -> bool { this.as_rust_type_ref().is_empty() } -pub use crate::opaque_types::{z_loaned_string_array_t, z_owned_string_array_t}; +pub use crate::opaque_types::{ + z_loaned_string_array_t, z_moved_string_array_t, z_owned_string_array_t, +}; pub type ZVector = Vec; decl_c_type!( - owned(z_owned_string_array_t, Option), - loaned(z_loaned_string_array_t, ZVector), + owned(z_owned_string_array_t, option ZVector), + loaned(z_loaned_string_array_t), + moved(z_moved_string_array_t) ); /// Constructs a new empty string array. @@ -747,9 +752,8 @@ pub extern "C" fn z_string_array_check(this: &z_owned_string_array_t) -> bool { /// Destroys the string array, resetting it to its gravestone value. #[no_mangle] -pub extern "C" fn z_string_array_drop(this: &mut z_owned_string_array_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_string_array_drop(this: z_moved_string_array_t) {} /// Borrows string array. #[no_mangle] diff --git a/src/commons.rs b/src/commons.rs index 69e9076c4..4f4a1e7ce 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -32,6 +32,8 @@ use zenoh::{ use crate::transmute::IntoCType; #[cfg(feature = "unstable")] use crate::z_id_t; +#[cfg(feature = "unstable")] +use crate::z_moved_source_info_t; use crate::{ result, transmute::{CTypeRef, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, @@ -97,10 +99,11 @@ pub extern "C" fn z_timestamp_id(this: &z_timestamp_t) -> z_id_t { } use crate::opaque_types::z_loaned_sample_t; -pub use crate::opaque_types::z_owned_sample_t; +pub use crate::opaque_types::{z_moved_sample_t, z_owned_sample_t}; decl_c_type!( - owned(z_owned_sample_t, Option), - loaned(z_loaned_sample_t, Sample), + owned(z_owned_sample_t, option Sample), + loaned(z_loaned_sample_t), + moved(z_moved_sample_t) ); /// Returns the key expression of the sample. @@ -199,9 +202,8 @@ pub unsafe extern "C" fn z_sample_loan(this: &z_owned_sample_t) -> &z_loaned_sam /// Frees the memory and invalidates the sample, resetting it to a gravestone state. #[no_mangle] -pub extern "C" fn z_sample_drop(this: &mut z_owned_sample_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_sample_drop(this: z_moved_sample_t) {} /// Constructs sample in its gravestone state. #[no_mangle] @@ -209,7 +211,6 @@ pub extern "C" fn z_sample_null(this: &mut MaybeUninit) { this.as_rust_type_mut_uninit().write(None); } -#[cfg(feature = "unstable")] /// The locality of samples to be received by subscribers or targeted by publishers. #[repr(C)] #[derive(Clone, Copy, Debug)] @@ -480,7 +481,8 @@ pub use crate::opaque_types::{z_loaned_source_info_t, z_owned_source_info_t}; #[cfg(feature = "unstable")] decl_c_type!( owned(z_owned_source_info_t, SourceInfo), - loaned(z_loaned_source_info_t, SourceInfo) + loaned(z_loaned_source_info_t, SourceInfo), + moved(z_moved_source_info_t) ); #[cfg(feature = "unstable")] @@ -535,9 +537,8 @@ pub extern "C" fn z_source_info_loan(this: &z_owned_source_info_t) -> &z_loaned_ #[cfg(feature = "unstable")] /// Frees the memory and invalidates the source info, resetting it to a gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_drop(this: &mut z_owned_source_info_t) { - *this.as_rust_type_mut() = SourceInfo::default(); -} +#[allow(unused_variables)] +pub extern "C" fn z_source_info_drop(this: z_moved_source_info_t) {} #[cfg(feature = "unstable")] /// Constructs source info in its gravestone state. diff --git a/src/config.rs b/src/config.rs index 42b48d2c0..671098e55 100644 --- a/src/config.rs +++ b/src/config.rs @@ -65,10 +65,11 @@ pub static Z_CONFIG_ADD_TIMESTAMP_KEY: &c_char = pub static Z_CONFIG_SHARED_MEMORY_KEY: &c_char = unsafe { &*(b"transport/shared_memory/enabled\0".as_ptr() as *const c_char) }; -pub use crate::opaque_types::{z_loaned_config_t, z_owned_config_t}; +pub use crate::opaque_types::{z_loaned_config_t, z_moved_config_t, z_owned_config_t}; decl_c_type!( - owned(z_owned_config_t, Option), - loaned(z_loaned_config_t, Config) + owned(z_owned_config_t, option Config), + loaned(z_loaned_config_t), + moved(z_moved_config_t) ); /// Borrows config. @@ -220,10 +221,8 @@ pub unsafe extern "C" fn zc_config_insert_json_from_substr( /// Frees `config`, and resets it to its gravestone state. #[no_mangle] -#[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_config_drop(this: &mut z_owned_config_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_config_drop(this: z_moved_config_t) {} /// Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] diff --git a/src/encoding.rs b/src/encoding.rs index 2f25e37c7..71c701140 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -27,12 +27,13 @@ pub use crate::opaque_types::{z_loaned_encoding_t, z_owned_encoding_t}; use crate::{ result::{self, z_result_t}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_owned_string_t, z_string_copy_from_substr, + z_moved_encoding_t, z_owned_string_t, z_string_copy_from_substr, }; decl_c_type!( owned(z_owned_encoding_t, Encoding), loaned(z_loaned_encoding_t, Encoding), + moved(z_moved_encoding_t) ); /// Constructs a `z_owned_encoding_t` from a specified substring. @@ -48,6 +49,7 @@ pub unsafe extern "C" fn z_encoding_from_substr( encoding.write(Encoding::default()); result::Z_OK } else { + #[allow(clippy::unnecessary_cast)] let s = from_raw_parts(s as *const u8, len); match from_utf8(s) { Ok(s) => { @@ -79,6 +81,7 @@ pub unsafe extern "C" fn z_encoding_set_schema_from_substr( } else if s.is_null() { return result::Z_EINVAL; } + #[allow(clippy::unnecessary_cast)] let schema_bytes = from_raw_parts(s as *const u8, len); match from_utf8(schema_bytes) { Ok(schema_str) => { @@ -142,9 +145,8 @@ pub extern "C" fn z_encoding_null(this: &mut MaybeUninit) { /// Frees the memory and resets the encoding it to its default value. #[no_mangle] -pub extern "C" fn z_encoding_drop(this: &mut z_owned_encoding_t) { - *this.as_rust_type_mut() = Encoding::default(); -} +#[allow(unused_variables)] +pub extern "C" fn z_encoding_drop(this: z_moved_encoding_t) {} /// Returns ``true`` if encoding is in non-default state, ``false`` otherwise. #[no_mangle] diff --git a/src/get.rs b/src/get.rs index be938aa0d..f861a40c8 100644 --- a/src/get.rs +++ b/src/get.rs @@ -16,28 +16,29 @@ use std::{ ffi::CStr, mem::MaybeUninit, ops::{Deref, DerefMut}, - ptr::{null, null_mut}, + ptr::null, }; use libc::c_char; use zenoh::{ - bytes::{Encoding, ZBytes}, - prelude::*, - qos::{CongestionControl, Priority}, + bytes::{Encoding, EncodingBuilderTrait, ZBytes}, + qos::{CongestionControl, Priority, QoSBuilderTrait}, query::{ConsolidationMode, QueryConsolidation, QueryTarget, Reply, ReplyError, Selector}, + sample::SampleBuilderTrait, + Wait, }; use crate::{ result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, - z_loaned_session_t, z_owned_bytes_t, z_owned_closure_reply_t, z_owned_encoding_t, z_priority_t, + z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, z_query_target_t, }; #[cfg(feature = "unstable")] use crate::{ - transmute::IntoCType, z_id_t, z_owned_source_info_t, zc_locality_default, zc_locality_t, + transmute::IntoCType, z_id_t, z_moved_source_info_t, zc_locality_default, zc_locality_t, zc_reply_keyexpr_default, zc_reply_keyexpr_t, }; @@ -67,10 +68,11 @@ impl From<&ReplyError> for &ReplyErrorNewtype { } } -pub use crate::opaque_types::{z_loaned_reply_err_t, z_owned_reply_err_t}; +pub use crate::opaque_types::{z_loaned_reply_err_t, z_moved_reply_err_t, z_owned_reply_err_t}; decl_c_type!( owned(z_owned_reply_err_t, ReplyErrorNewtype), - loaned(z_loaned_reply_err_t, ReplyErrorNewtype) + loaned(z_loaned_reply_err_t, ReplyErrorNewtype), + moved(z_moved_reply_err_t) ); /// Constructs an empty `z_owned_reply_err_t`. @@ -107,15 +109,14 @@ pub extern "C" fn z_reply_err_loan(this: &z_owned_reply_err_t) -> &z_loaned_repl /// Frees the memory and resets the reply error it to its default value. #[no_mangle] -pub extern "C" fn z_reply_err_drop(this: &mut z_owned_reply_err_t) { - std::mem::take(this.as_rust_type_mut()); -} - -pub use crate::opaque_types::{z_loaned_reply_t, z_owned_reply_t}; +#[allow(unused_variables)] +pub extern "C" fn z_reply_err_drop(this: z_moved_reply_err_t) {} +pub use crate::opaque_types::{z_loaned_reply_t, z_moved_reply_t, z_owned_reply_t}; decl_c_type!( - owned(z_owned_reply_t, Option), - loaned(z_loaned_reply_t, Reply) + owned(z_owned_reply_t, option Reply), + loaned(z_loaned_reply_t), + moved(z_moved_reply_t) ); /// Returns ``true`` if reply contains a valid response, ``false`` otherwise (in this case it contains a errror value). @@ -187,9 +188,9 @@ pub struct z_get_options_t { /// The replies consolidation strategy to apply on replies to the query. pub consolidation: z_query_consolidation_t, /// An optional payload to attach to the query. - pub payload: *mut z_owned_bytes_t, + pub payload: z_moved_bytes_t, /// An optional encoding of the query payload and or attachment. - pub encoding: *mut z_owned_encoding_t, + pub encoding: z_moved_encoding_t, /// The congestion control to apply when routing the query. pub congestion_control: z_congestion_control_t, /// If true, Zenoh will not wait to batch this message with others to reduce the bandwith. @@ -204,17 +205,17 @@ pub struct z_get_options_t { pub priority: z_priority_t, #[cfg(feature = "unstable")] /// The source info for the query. - pub source_info: *mut z_owned_source_info_t, + pub source_info: z_moved_source_info_t, /// An optional attachment to attach to the query. - pub attachment: *mut z_owned_bytes_t, + pub attachment: z_moved_bytes_t, /// The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration. pub timeout_ms: u64, } /// Constructs default `z_get_options_t` #[no_mangle] -pub extern "C" fn z_get_options_default(this: &mut z_get_options_t) { - *this = z_get_options_t { +pub extern "C" fn z_get_options_default(this: &mut MaybeUninit) { + this.write(z_get_options_t { target: QueryTarget::default().into(), consolidation: QueryConsolidation::default().into(), congestion_control: CongestionControl::default().into(), @@ -225,12 +226,12 @@ pub extern "C" fn z_get_options_default(this: &mut z_get_options_t) { priority: Priority::default().into(), is_express: false, timeout_ms: 0, - payload: null_mut(), - encoding: null_mut(), + payload: None.into(), + encoding: None.into(), #[cfg(feature = "unstable")] - source_info: null_mut(), - attachment: null_mut(), - }; + source_info: None.into(), + attachment: None.into(), + }); } /// Query data from the matching queryables in the system. @@ -249,11 +250,12 @@ pub unsafe extern "C" fn z_get( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, parameters: *const c_char, - callback: &mut z_owned_closure_reply_t, + callback: z_moved_closure_reply_t, options: Option<&mut z_get_options_t>, ) -> result::z_result_t { - let mut closure = z_owned_closure_reply_t::empty(); - std::mem::swap(callback, &mut closure); + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; let p = if parameters.is_null() { "" } else { @@ -263,21 +265,17 @@ pub unsafe extern "C" fn z_get( let key_expr = key_expr.as_rust_type_ref(); let mut get = session.get(Selector::from((key_expr, p))); if let Some(options) = options { - if let Some(payload) = unsafe { options.payload.as_mut() } { - let payload = std::mem::take(payload.as_rust_type_mut()); + if let Some(payload) = options.payload.take_rust_type() { get = get.payload(payload); } - if let Some(encoding) = unsafe { options.encoding.as_mut() } { - let encoding = std::mem::take(encoding.as_rust_type_mut()); + if let Some(encoding) = options.encoding.take_rust_type() { get = get.encoding(encoding); } #[cfg(feature = "unstable")] - if let Some(source_info) = unsafe { options.source_info.as_mut() } { - let source_info = std::mem::take(source_info.as_rust_type_mut()); + if let Some(source_info) = options.source_info.take_rust_type() { get = get.source_info(source_info); } - if let Some(attachment) = unsafe { options.attachment.as_mut() } { - let attachment = std::mem::take(attachment.as_rust_type_mut()); + if let Some(attachment) = options.attachment.take_rust_type() { get = get.attachment(attachment); } @@ -301,7 +299,7 @@ pub unsafe extern "C" fn z_get( match get .callback(move |response| { z_closure_reply_call( - z_closure_reply_loan(&closure), + z_closure_reply_loan(&callback), response.as_loaned_c_type_ref(), ) }) @@ -317,9 +315,8 @@ pub unsafe extern "C" fn z_get( /// Frees reply, resetting it to its gravestone state. #[no_mangle] -pub extern "C" fn z_reply_drop(this: &mut z_owned_reply_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_reply_drop(this: z_moved_reply_t) {} /// Returns ``true`` if `reply` is valid, ``false`` otherwise. #[no_mangle] diff --git a/src/info.rs b/src/info.rs index 7b3b45963..dde3b670d 100644 --- a/src/info.rs +++ b/src/info.rs @@ -16,8 +16,8 @@ use zenoh::{prelude::*, session::ZenohId}; pub use crate::opaque_types::z_id_t; use crate::{ result, - transmute::{CTypeRef, IntoCType, RustTypeRef}, - z_closure_zid_call, z_closure_zid_loan, z_loaned_session_t, z_owned_closure_zid_t, + transmute::{CTypeRef, IntoCType, IntoRustType, RustTypeRef}, + z_closure_zid_call, z_closure_zid_loan, z_loaned_session_t, z_moved_closure_zid_t, }; decl_c_type!(copy(z_id_t, ZenohId)); @@ -49,13 +49,14 @@ pub unsafe extern "C" fn z_info_zid(session: &z_loaned_session_t) -> z_id_t { #[no_mangle] pub unsafe extern "C" fn z_info_peers_zid( session: &z_loaned_session_t, - callback: &mut z_owned_closure_zid_t, + callback: z_moved_closure_zid_t, ) -> result::z_result_t { - let mut closure = z_owned_closure_zid_t::empty(); - std::mem::swap(&mut closure, callback); let session = session.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; for id in session.info().peers_zid().wait() { - z_closure_zid_call(z_closure_zid_loan(&closure), id.as_ctype_ref()); + z_closure_zid_call(z_closure_zid_loan(&callback), id.as_ctype_ref()); } result::Z_OK } @@ -70,13 +71,14 @@ pub unsafe extern "C" fn z_info_peers_zid( #[no_mangle] pub unsafe extern "C" fn z_info_routers_zid( session: &z_loaned_session_t, - callback: &mut z_owned_closure_zid_t, + callback: z_moved_closure_zid_t, ) -> result::z_result_t { - let mut closure = z_owned_closure_zid_t::empty(); - std::mem::swap(&mut closure, callback); let session = session.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; for id in session.info().routers_zid().wait() { - z_closure_zid_call(z_closure_zid_loan(&closure), id.as_ctype_ref()); + z_closure_zid_call(z_closure_zid_loan(&callback), id.as_ctype_ref()); } result::Z_OK } diff --git a/src/keyexpr.rs b/src/keyexpr.rs index f1af6f7b2..acd953c0d 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -21,17 +21,20 @@ use zenoh::{ prelude::*, }; -pub use crate::opaque_types::{z_loaned_keyexpr_t, z_owned_keyexpr_t, z_view_keyexpr_t}; +pub use crate::opaque_types::{ + z_loaned_keyexpr_t, z_moved_keyexpr_t, z_owned_keyexpr_t, z_view_keyexpr_t, +}; use crate::{ - result, - result::{z_result_t, Z_OK}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + result::{self, z_result_t, Z_OK}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_loaned_session_t, z_view_string_from_substr, z_view_string_t, }; + decl_c_type! { - owned(z_owned_keyexpr_t, Option>), + owned(z_owned_keyexpr_t, option KeyExpr<'static>), + loaned(z_loaned_keyexpr_t), view(z_view_keyexpr_t, Option>), - loaned(z_loaned_keyexpr_t, KeyExpr<'static>), + moved(z_moved_keyexpr_t) } /// Constructs an owned key expression in a gravestone state. @@ -40,9 +43,9 @@ pub extern "C" fn z_keyexpr_null(this: &mut MaybeUninit) { this.as_rust_type_mut_uninit().write(None); } -/// Constructs a view key expression in a gravestone state. +/// Constructs a view key expression in empty state #[no_mangle] -pub extern "C" fn z_view_keyexpr_null(this: &mut MaybeUninit) { +pub extern "C" fn z_view_keyexpr_empty(this: &mut MaybeUninit) { this.as_rust_type_mut_uninit().write(None); } @@ -143,9 +146,8 @@ pub unsafe extern "C" fn z_view_keyexpr_loan(this: &z_view_keyexpr_t) -> &z_loan /// Frees key expression and resets it to its gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_drop(this: &mut z_owned_keyexpr_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_keyexpr_drop(this: z_moved_keyexpr_t) {} /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] @@ -155,8 +157,8 @@ pub extern "C" fn z_keyexpr_check(this: &z_owned_keyexpr_t) -> bool { /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_view_keyexpr_check(this: &z_view_keyexpr_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_view_keyexpr_is_empty(this: &z_view_keyexpr_t) -> bool { + this.as_rust_type_ref().is_none() } /// Returns 0 if the passed string is a valid (and canon) key expression. @@ -487,10 +489,10 @@ pub extern "C" fn z_declare_keyexpr( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] pub extern "C" fn z_undeclare_keyexpr( - this: &mut z_owned_keyexpr_t, + this: z_moved_keyexpr_t, session: &z_loaned_session_t, ) -> result::z_result_t { - let Some(kexpr) = this.as_rust_type_mut().take() else { + let Some(kexpr) = this.into_rust_type() else { tracing::debug!("Attempted to undeclare dropped keyexpr"); return result::Z_EINVAL; }; diff --git a/src/lib.rs b/src/lib.rs index 3ff20ae0f..a5742be1d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -102,9 +102,9 @@ pub extern "C" fn zc_init_logging_with_callback( move |meta| min_severity <= (*meta.level()).into(), move |record| { if let Some(s) = record.message.as_ref() { - let c = CStringView(CString(CSlice::new_borrowed_from_slice(s.as_bytes()))); - z_closure_log_call( - z_closure_log_loan(&closure), + let c = CStringView::new_borrowed_from_slice(s.as_bytes()); + zc_closure_log_call( + zc_closure_log_loan(&closure), record.level.into(), c.as_loaned_c_type_ref(), ); diff --git a/src/liveliness.rs b/src/liveliness.rs index 4afc4142e..f7826accf 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -22,14 +22,15 @@ use zenoh::{ use crate::{ opaque_types::{zc_loaned_liveliness_token_t, zc_owned_liveliness_token_t}, result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_closure_reply_call, z_closure_reply_loan, z_closure_sample_call, z_closure_sample_loan, - z_loaned_keyexpr_t, z_loaned_session_t, z_owned_closure_reply_t, z_owned_closure_sample_t, - z_owned_subscriber_t, + z_loaned_keyexpr_t, z_loaned_session_t, z_moved_closure_reply_t, z_moved_closure_sample_t, + z_owned_subscriber_t, zc_moved_liveliness_token_t, }; decl_c_type!( - owned(zc_owned_liveliness_token_t, Option>), - loaned(zc_loaned_liveliness_token_t, LivelinessToken<'static>) + owned(zc_owned_liveliness_token_t, option LivelinessToken<'static>), + loaned(zc_loaned_liveliness_token_t), + moved(zc_moved_liveliness_token_t) ); /// Constructs liveliness token in its gravestone state. @@ -46,9 +47,9 @@ pub extern "C" fn zc_liveliness_token_check(this: &zc_owned_liveliness_token_t) /// Undeclares liveliness token, frees memory and resets it to a gravestone state. #[no_mangle] -pub extern "C" fn zc_liveliness_token_drop(this: &mut zc_owned_liveliness_token_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn zc_liveliness_token_drop(this: zc_moved_liveliness_token_t) {} + /// The options for `zc_liveliness_declare_token()`. #[repr(C)] pub struct zc_liveliness_declaration_options_t { @@ -58,9 +59,9 @@ pub struct zc_liveliness_declaration_options_t { /// Constructs default value for `zc_liveliness_declaration_options_t`. #[no_mangle] pub extern "C" fn zc_liveliness_declaration_options_default( - this: &mut zc_liveliness_declaration_options_t, + this: &mut MaybeUninit, ) { - *this = zc_liveliness_declaration_options_t { _dummy: 0 }; + this.write(zc_liveliness_declaration_options_t { _dummy: 0 }); } /// Borrows token. @@ -110,10 +111,9 @@ pub extern "C" fn zc_liveliness_declare_token( /// Destroys a liveliness token, notifying subscribers of its destruction. #[no_mangle] pub extern "C" fn zc_liveliness_undeclare_token( - this: &mut zc_owned_liveliness_token_t, + this: zc_moved_liveliness_token_t, ) -> result::z_result_t { - let this = this.as_rust_type_mut(); - if let Some(token) = this.take() { + if let Some(token) = this.into_rust_type() { if let Err(e) = token.undeclare().wait() { tracing::error!("Failed to undeclare token: {e}"); return result::Z_EGENERIC; @@ -131,9 +131,9 @@ pub struct zc_liveliness_subscriber_options_t { /// Constucts default value for `zc_liveliness_declare_subscriber_options_t`. #[no_mangle] pub extern "C" fn zc_liveliness_subscriber_options_default( - this: &mut zc_liveliness_subscriber_options_t, + this: &mut MaybeUninit, ) { - *this = zc_liveliness_subscriber_options_t { _dummy: 0 }; + this.write(zc_liveliness_subscriber_options_t { _dummy: 0 }); } /// Declares a subscriber on liveliness tokens that intersect `key_expr`. @@ -150,13 +150,16 @@ pub extern "C" fn zc_liveliness_declare_subscriber( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: &mut z_owned_closure_sample_t, + callback: z_moved_closure_sample_t, _options: Option<&mut zc_liveliness_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); - let callback = core::mem::replace(callback, z_owned_closure_sample_t::empty()); let key_expr = key_expr.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + this.write(None); + return result::Z_EINVAL; + }; match session .liveliness() .declare_subscriber(key_expr) @@ -186,8 +189,10 @@ pub struct zc_liveliness_get_options_t { /// Constructs default value `zc_liveliness_get_options_t`. #[no_mangle] -pub extern "C" fn zc_liveliness_get_options_default(this: &mut zc_liveliness_get_options_t) { - *this = zc_liveliness_get_options_t { timeout_ms: 10000 }; +pub extern "C" fn zc_liveliness_get_options_default( + this: &mut MaybeUninit, +) { + this.write(zc_liveliness_get_options_t { timeout_ms: 10000 }); } /// Queries liveliness tokens currently on the network with a key expression intersecting with `key_expr`. @@ -200,12 +205,14 @@ pub extern "C" fn zc_liveliness_get_options_default(this: &mut zc_liveliness_get pub extern "C" fn zc_liveliness_get( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: &mut z_owned_closure_reply_t, + callback: z_moved_closure_reply_t, options: Option<&mut zc_liveliness_get_options_t>, ) -> result::z_result_t { let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let callback = core::mem::replace(callback, z_owned_closure_reply_t::empty()); + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; let liveliness: Liveliness<'static> = session.liveliness(); let mut builder = liveliness.get(key_expr).callback(move |response| { z_closure_reply_call( diff --git a/src/payload.rs b/src/payload.rs index 1752ca94c..214588fef 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -24,7 +24,7 @@ use std::{ use zenoh::{ bytes::{Deserialize, Serialize, ZBytes, ZBytesIterator, ZBytesReader, ZBytesWriter, ZSerde}, - internal::buffers::{ZBuf, ZSlice, ZSliceBuffer}, + internal::buffers::{ZBuf, ZSliceBuffer}, }; pub use crate::opaque_types::{z_loaned_bytes_t, z_owned_bytes_t}; @@ -32,15 +32,16 @@ pub use crate::opaque_types::{z_loaned_bytes_t, z_owned_bytes_t}; use crate::result::Z_ENULL; use crate::{ result::{self, z_result_t, Z_EINVAL, Z_EIO, Z_EPARSE, Z_OK}, - transmute::{LoanedCTypeRef, OwnedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_slice_t, z_loaned_string_t, z_owned_slice_t, z_owned_string_t, z_slice_clone, - z_string_clone, CSlice, CSliceOwned, CStringOwned, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_loaned_slice_t, z_loaned_string_t, z_moved_bytes_t, z_moved_slice_t, z_moved_string_t, + z_owned_slice_t, z_owned_string_t, CSlice, CSliceOwned, CString, CStringOwned, }; #[cfg(all(feature = "shared-memory", feature = "unstable"))] -use crate::{z_loaned_shm_t, z_owned_shm_mut_t, z_owned_shm_t}; +use crate::{z_loaned_shm_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_t}; decl_c_type! { owned(z_owned_bytes_t, ZBytes), - loaned(z_loaned_bytes_t, ZBytes), + loaned(z_loaned_bytes_t), + moved(z_moved_bytes_t) } /// The gravestone value for `z_owned_bytes_t`. @@ -58,9 +59,8 @@ extern "C" fn z_bytes_empty(this: &mut MaybeUninit) { /// Drops `this_`, resetting it to gravestone value. If there are any shallow copies /// created by `z_bytes_clone()`, they would still stay valid. #[no_mangle] -extern "C" fn z_bytes_drop(this: &mut z_owned_bytes_t) { - *this.as_rust_type_mut() = ZBytes::default(); -} +#[allow(unused_variables)] +extern "C" fn z_bytes_drop(this: z_moved_bytes_t) {} /// Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. #[no_mangle] @@ -254,6 +254,26 @@ impl From for ZBytes { } } +impl From for ZBytes { + fn from(value: CSliceOwned) -> Self { + let value: CSlice = value.into(); + ZBytes::new(value) + } +} +impl From for ZBytes { + fn from(value: CString) -> Self { + let value: CSlice = value.into(); + ZBytes::new(value) + } +} + +impl From for ZBytes { + fn from(value: CStringOwned) -> Self { + let value: CSlice = value.into(); + ZBytes::new(value) + } +} + fn z_bytes_serialize_from_arithmetic(this: &mut MaybeUninit, val: T) where ZSerde: Serialize, @@ -440,20 +460,17 @@ pub extern "C" fn z_bytes_deserialize_into_double( z_bytes_deserialize_into_arithmetic::(this, dst) } -fn _z_bytes_serialize_from_cslice(this: &mut MaybeUninit, s: CSlice) { - let payload = ZBytes::from(ZSlice::from(s)); - this.as_rust_type_mut_uninit().write(payload); -} - /// Serializes a slice. /// The slice is consumed upon function return. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_from_slice( this: &mut MaybeUninit, - slice: &mut z_owned_slice_t, + slice: z_moved_slice_t, ) { - _z_bytes_serialize_from_cslice(this, std::mem::take(slice.as_rust_type_mut())) + let slice = slice.into_rust_type(); + let payload = slice.map(ZBytes::from).unwrap_or_default(); + this.as_rust_type_mut_uninit().write(payload); } /// Serializes a slice by copying. @@ -463,10 +480,9 @@ pub unsafe extern "C" fn z_bytes_serialize_from_slice( this: &mut MaybeUninit, slice: &z_loaned_slice_t, ) { - let mut s = MaybeUninit::::uninit(); - z_slice_clone(&mut s, slice); - let mut s_clone = s.assume_init(); - z_bytes_from_slice(this, &mut s_clone) + let slice = slice.as_rust_type_ref(); + let payload = ZBytes::from(slice.clone_to_owned()); + this.as_rust_type_mut_uninit().write(payload); } /// Serializes a data from buffer. @@ -485,10 +501,11 @@ pub unsafe extern "C" fn z_bytes_from_buf( deleter: Option, context: *mut c_void, ) -> z_result_t { - if let Ok(mut s) = CSliceOwned::wrap(data, len, deleter, context) { - z_bytes_from_slice(this, s.as_owned_c_type_mut()); + if let Ok(s) = CSliceOwned::wrap(data, len, deleter, context) { + this.as_rust_type_mut_uninit().write(ZBytes::from(s)); Z_OK } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); Z_EINVAL } } @@ -505,10 +522,11 @@ pub unsafe extern "C" fn z_bytes_from_static_buf( data: *mut u8, len: usize, ) -> z_result_t { - if let Ok(mut s) = CSliceOwned::wrap(data as _, len, None, null_mut()) { - z_bytes_from_slice(this, s.as_owned_c_type_mut()); + if let Ok(s) = CSliceOwned::wrap(data as _, len, None, null_mut()) { + this.as_rust_type_mut_uninit().write(ZBytes::from(s)); Z_OK } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); Z_EINVAL } } @@ -525,10 +543,11 @@ pub unsafe extern "C" fn z_bytes_serialize_from_buf( data: *const u8, len: usize, ) -> z_result_t { - if let Ok(mut s) = CSliceOwned::new(data, len) { - z_bytes_from_slice(this, s.as_owned_c_type_mut()); + if let Ok(s) = CSliceOwned::new(data, len) { + this.as_rust_type_mut_uninit().write(ZBytes::from(s)); Z_OK } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); Z_EINVAL } } @@ -539,11 +558,12 @@ pub unsafe extern "C" fn z_bytes_serialize_from_buf( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_from_string( this: &mut MaybeUninit, - s: &mut z_owned_string_t, + s: z_moved_string_t, ) { // TODO: verify that string is a valid utf-8 string ? - let cs = std::mem::take(&mut s.as_rust_type_mut().0 .0); - _z_bytes_serialize_from_cslice(this, cs) + let cs = s.into_rust_type(); + let payload = cs.map(ZBytes::from).unwrap_or_default(); + this.as_rust_type_mut_uninit().write(payload); } /// Serializes a string by copying. @@ -553,10 +573,9 @@ pub unsafe extern "C" fn z_bytes_serialize_from_string( this: &mut MaybeUninit, str: &z_loaned_string_t, ) { - let mut s = MaybeUninit::::uninit(); - z_string_clone(&mut s, str); - let mut s_clone = s.assume_init(); - z_bytes_from_string(this, &mut s_clone) + let s = str.as_rust_type_ref(); + let payload = ZBytes::from(s.clone_to_owned()); + this.as_rust_type_mut_uninit().write(payload); } /// Serializes a null-terminated string. @@ -573,10 +592,11 @@ pub unsafe extern "C" fn z_bytes_from_str( deleter: Option, context: *mut c_void, ) -> z_result_t { - if let Ok(mut s) = CStringOwned::wrap(str, libc::strlen(str), deleter, context) { - z_bytes_from_string(this, s.as_owned_c_type_mut()); + if let Ok(s) = CStringOwned::wrap(str, libc::strlen(str), deleter, context) { + this.as_rust_type_mut_uninit().write(ZBytes::from(s)); Z_OK } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); Z_EINVAL } } @@ -591,10 +611,11 @@ pub unsafe extern "C" fn z_bytes_from_static_str( this: &mut MaybeUninit, str: *const libc::c_char, ) -> z_result_t { - if let Ok(mut s) = CStringOwned::wrap(str as _, libc::strlen(str), None, null_mut()) { - z_bytes_from_string(this, s.as_owned_c_type_mut()); + if let Ok(s) = CStringOwned::wrap(str as _, libc::strlen(str), None, null_mut()) { + this.as_rust_type_mut_uninit().write(ZBytes::from(s)); Z_OK } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); Z_EINVAL } } @@ -609,10 +630,11 @@ pub unsafe extern "C" fn z_bytes_serialize_from_str( this: &mut MaybeUninit, str: *const libc::c_char, ) -> z_result_t { - if let Ok(mut s) = CStringOwned::new(str, libc::strlen(str)) { - z_bytes_from_string(this, s.as_owned_c_type_mut()); + if let Ok(s) = CStringOwned::new(str, libc::strlen(str)) { + this.as_rust_type_mut_uninit().write(ZBytes::from(s)); Z_OK } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); Z_EINVAL } } @@ -622,14 +644,17 @@ pub unsafe extern "C" fn z_bytes_serialize_from_str( #[no_mangle] pub extern "C" fn z_bytes_from_pair( this: &mut MaybeUninit, - first: &mut z_owned_bytes_t, - second: &mut z_owned_bytes_t, + first: z_moved_bytes_t, + second: z_moved_bytes_t, ) -> z_result_t { - let first = std::mem::take(first.as_rust_type_mut()); - let second = std::mem::take(second.as_rust_type_mut()); - let b = ZBytes::serialize((first, second)); - this.as_rust_type_mut_uninit().write(b); - Z_OK + if let (Some(first), Some(second)) = (first.into_rust_type(), second.into_rust_type()) { + let payload = ZBytes::serialize((first, second)); + this.as_rust_type_mut_uninit().write(payload); + Z_OK + } else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); + Z_EINVAL + } } /// Deserializes into a pair of `z_owned_bytes_t` objects. @@ -647,6 +672,8 @@ pub extern "C" fn z_bytes_deserialize_into_pair( Z_OK } Err(e) => { + first.as_rust_type_mut_uninit().write(ZBytes::default()); + second.as_rust_type_mut_uninit().write(ZBytes::default()); tracing::error!("Failed to deserialize the payload: {:?}", e); Z_EPARSE } @@ -741,15 +768,14 @@ pub extern "C" fn z_bytes_iterator_next( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_serialize_from_shm( this: &mut MaybeUninit, - shm: &mut z_owned_shm_t, + shm: z_moved_shm_t, ) -> z_result_t { - match shm.as_rust_type_mut().take() { - Some(shm) => { - this.as_rust_type_mut_uninit().write(shm.into()); - Z_OK - } - None => Z_ENULL, - } + let Some(shm) = shm.into_rust_type() else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); + return Z_ENULL; + }; + this.as_rust_type_mut_uninit().write(shm.into()); + Z_OK } #[cfg(all(feature = "shared-memory", feature = "unstable"))] @@ -758,15 +784,14 @@ pub unsafe extern "C" fn z_bytes_serialize_from_shm( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_serialize_from_shm_mut( this: &mut MaybeUninit, - shm: &mut z_owned_shm_mut_t, + shm: z_moved_shm_mut_t, ) -> z_result_t { - match shm.as_rust_type_mut().take() { - Some(shm) => { - this.as_rust_type_mut_uninit().write(shm.into()); - Z_OK - } - None => Z_ENULL, - } + let Some(shm) = shm.into_rust_type() else { + this.as_rust_type_mut_uninit().write(ZBytes::default()); + return Z_ENULL; + }; + this.as_rust_type_mut_uninit().write(shm.into()); + Z_OK } pub use crate::z_bytes_reader_t; @@ -899,10 +924,12 @@ unsafe extern "C" fn z_bytes_writer_write_all( #[no_mangle] unsafe extern "C" fn z_bytes_writer_append( this: &mut z_bytes_writer_t, - bytes: &mut z_owned_bytes_t, + bytes: z_moved_bytes_t, ) -> z_result_t { - this.as_rust_type_mut() - .append(std::mem::take(bytes.as_rust_type_mut())); + let Some(bytes) = bytes.into_rust_type() else { + return result::Z_ENULL; + }; + this.as_rust_type_mut().append(bytes); result::Z_OK } @@ -913,9 +940,11 @@ unsafe extern "C" fn z_bytes_writer_append( #[no_mangle] unsafe extern "C" fn z_bytes_writer_append_bounded( this: &mut z_bytes_writer_t, - bytes: &mut z_owned_bytes_t, + bytes: z_moved_bytes_t, ) -> z_result_t { - this.as_rust_type_mut() - .serialize(std::mem::take(bytes.as_rust_type_mut())); + let Some(bytes) = bytes.into_rust_type() else { + return result::Z_ENULL; + }; + this.as_rust_type_mut().serialize(bytes); result::Z_OK } diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index fcb83d9de..9f142a83f 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -6,15 +6,16 @@ use std::{ use libc::c_void; -pub use crate::opaque_types::{z_loaned_mutex_t, z_owned_mutex_t}; +pub use crate::opaque_types::{z_loaned_mutex_t, z_moved_mutex_t, z_owned_mutex_t}; use crate::{ result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, }; decl_c_type!( - owned(z_owned_mutex_t, Option<(Mutex<()>, Option>)>), - loaned(z_loaned_mutex_t, (Mutex<()>, Option>)) + owned(z_owned_mutex_t, option(Mutex<()>, Option>)), + loaned(z_loaned_mutex_t), + moved(z_moved_mutex_t) ); /// Constructs a mutex. @@ -30,9 +31,8 @@ pub extern "C" fn z_mutex_init(this: &mut MaybeUninit) -> resul /// Drops mutex and resets it to its gravestone state. #[no_mangle] -pub extern "C" fn z_mutex_drop(this: &mut z_owned_mutex_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_mutex_drop(this: z_moved_mutex_t) {} /// Returns ``true`` if mutex is valid, ``false`` otherwise. #[no_mangle] @@ -107,11 +107,11 @@ pub unsafe extern "C" fn z_mutex_try_lock( result::Z_OK } -pub use crate::opaque_types::{z_loaned_condvar_t, z_owned_condvar_t}; -decl_c_type!( - inequal - owned(z_owned_condvar_t, Option), - loaned(z_loaned_condvar_t, Condvar) +pub use crate::opaque_types::{z_loaned_condvar_t, z_moved_condvar_t, z_owned_condvar_t}; +decl_c_type_inequal!( + owned(z_owned_condvar_t, option Condvar), + loaned(z_loaned_condvar_t), + moved(z_moved_condvar_t) ); /// Constructs conditional variable. @@ -128,9 +128,8 @@ pub extern "C" fn z_condvar_null(this: &mut MaybeUninit) { /// Drops conditional variable. #[no_mangle] -pub extern "C" fn z_condvar_drop(this: &mut z_owned_condvar_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_condvar_drop(this: z_moved_condvar_t) {} /// Returns ``true`` if conditional variable is valid, ``false`` otherwise. #[no_mangle] @@ -195,8 +194,11 @@ pub unsafe extern "C" fn z_condvar_wait( result::Z_OK } -pub use crate::opaque_types::z_owned_task_t; -decl_c_type!(owned(z_owned_task_t, Option>)); +pub use crate::opaque_types::{z_moved_task_t, z_owned_task_t}; +decl_c_type!( + owned(z_owned_task_t, option JoinHandle<()>), + moved(z_moved_task_t) +); #[repr(C)] #[derive(Clone, Copy)] @@ -210,24 +212,26 @@ pub extern "C" fn z_task_null(this: &mut MaybeUninit) { /// Detaches the task and releases all allocated resources. #[no_mangle] -pub extern "C" fn z_task_detach(this: &mut z_owned_task_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_task_detach(this: z_moved_task_t) {} /// Joins the task and releases all allocated resources #[no_mangle] -pub extern "C" fn z_task_join(this: &mut z_owned_task_t) -> result::z_result_t { - let this = this.as_rust_type_mut().take(); - if let Some(task) = this { - match task.join() { - Ok(_) => result::Z_OK, - Err(_) => result::Z_EINVAL_MUTEX, - } - } else { - result::Z_OK +pub extern "C" fn z_task_join(this: z_moved_task_t) -> result::z_result_t { + let Some(task) = this.into_rust_type() else { + return result::Z_OK; + }; + match task.join() { + Ok(_) => result::Z_OK, + Err(_) => result::Z_EINVAL_MUTEX, } } +/// Drop the task. Same as `z_task_detach`. Use `z_task_join` to wait for the task completion. +#[no_mangle] +#[allow(unused_variables)] +pub extern "C" fn z_task_drop(this: z_moved_task_t) {} + /// Returns ``true`` if task is valid, ``false`` otherwise. #[no_mangle] pub extern "C" fn z_task_check(this: &z_owned_task_t) -> bool { diff --git a/src/publication_cache.rs b/src/publication_cache.rs index d6335b72b..611683748 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -14,12 +14,12 @@ use std::{mem::MaybeUninit, ptr::null}; -use zenoh::prelude::*; +use zenoh::Wait; use zenoh_ext::SessionExt; use crate::{ result, - transmute::{RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, RustTypeRef, RustTypeRefUninit}, z_loaned_keyexpr_t, z_loaned_session_t, }; #[cfg(feature = "unstable")] @@ -43,21 +43,29 @@ pub struct ze_publication_cache_options_t { /// Constructs the default value for `ze_publication_cache_options_t`. #[no_mangle] -pub extern "C" fn ze_publication_cache_options_default(this: &mut ze_publication_cache_options_t) { - *this = ze_publication_cache_options_t { +pub extern "C" fn ze_publication_cache_options_default( + this: &mut MaybeUninit, +) { + this.write(ze_publication_cache_options_t { queryable_prefix: null(), #[cfg(feature = "unstable")] queryable_origin: zc_locality_default(), queryable_complete: false, history: 1, resources_limit: 0, - }; + }); } -pub use crate::opaque_types::{ze_loaned_publication_cache_t, ze_owned_publication_cache_t}; +pub use crate::opaque_types::{ + ze_loaned_publication_cache_t, ze_moved_publication_cache_t, ze_owned_publication_cache_t, +}; decl_c_type!( - owned(ze_owned_publication_cache_t, Option>), - loaned(ze_loaned_publication_cache_t, zenoh_ext::PublicationCache<'static>) + owned( + ze_owned_publication_cache_t, + option zenoh_ext::PublicationCache<'static>, + ), + loaned(ze_loaned_publication_cache_t), + moved(ze_moved_publication_cache_t) ); /// Constructs and declares a publication cache. @@ -127,9 +135,9 @@ pub extern "C" fn ze_publication_cache_check(this: &ze_owned_publication_cache_t #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn ze_undeclare_publication_cache( - this: &mut ze_owned_publication_cache_t, + this: ze_moved_publication_cache_t, ) -> result::z_result_t { - if let Some(p) = this.as_rust_type_mut().take() { + if let Some(p) = this.into_rust_type() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -141,6 +149,6 @@ pub extern "C" fn ze_undeclare_publication_cache( /// Drops publication cache. Also attempts to undeclare it. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_drop(this: &mut ze_owned_publication_cache_t) { +pub extern "C" fn ze_publication_cache_drop(this: ze_moved_publication_cache_t) { ze_undeclare_publication_cache(this); } diff --git a/src/publisher.rs b/src/publisher.rs index 3877c47a3..e34df423a 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -12,10 +12,7 @@ // ZettaScale Zenoh team, // -use std::{ - mem::MaybeUninit, - ptr::{self, null_mut}, -}; +use std::mem::MaybeUninit; #[cfg(feature = "unstable")] use zenoh::pubsub::MatchingListener; @@ -25,24 +22,27 @@ use zenoh::{ qos::{CongestionControl, Priority}, }; +#[cfg(feature = "unstable")] +use crate::z_moved_source_info_t; +#[cfg(feature = "unstable")] +use crate::zc_moved_closure_matching_status_t; use crate::{ - result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_congestion_control_t, z_loaned_keyexpr_t, z_loaned_session_t, z_owned_bytes_t, - z_owned_encoding_t, z_priority_t, z_timestamp_t, + result::{self}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + z_congestion_control_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, + z_moved_encoding_t, z_priority_t, z_timestamp_t, }; #[cfg(feature = "unstable")] use crate::{ - transmute::IntoCType, z_entity_global_id_t, z_owned_source_info_t, - zc_closure_matching_status_call, zc_closure_matching_status_loan, zc_locality_default, - zc_locality_t, zc_owned_closure_matching_status_t, + transmute::IntoCType, z_entity_global_id_t, zc_closure_matching_status_call, + zc_closure_matching_status_loan, zc_locality_default, zc_locality_t, }; /// Options passed to the `z_declare_publisher()` function. #[repr(C)] pub struct z_publisher_options_t { /// Default encoding for messages put by this publisher. - pub encoding: *mut z_owned_encoding_t, + pub encoding: z_moved_encoding_t, /// The congestion control to apply when routing messages from this publisher. pub congestion_control: z_congestion_control_t, /// The priority of messages from this publisher. @@ -56,22 +56,22 @@ pub struct z_publisher_options_t { /// Constructs the default value for `z_publisher_options_t`. #[no_mangle] -pub extern "C" fn z_publisher_options_default(this: &mut z_publisher_options_t) { - *this = z_publisher_options_t { - encoding: null_mut(), +pub extern "C" fn z_publisher_options_default(this: &mut MaybeUninit) { + this.write(z_publisher_options_t { + encoding: None.into(), congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), is_express: false, #[cfg(feature = "unstable")] allowed_destination: zc_locality_default(), - }; + }); } -pub use crate::opaque_types::{z_loaned_publisher_t, z_owned_publisher_t}; - +pub use crate::opaque_types::{z_loaned_publisher_t, z_moved_publisher_t, z_owned_publisher_t}; decl_c_type!( - owned(z_owned_publisher_t, Option>), - loaned(z_loaned_publisher_t, Publisher<'static>) + owned(z_owned_publisher_t, option Publisher<'static>), + loaned(z_loaned_publisher_t), + moved(z_moved_publisher_t) ); /// Constructs and declares a publisher for the given key expression. @@ -91,7 +91,7 @@ pub extern "C" fn z_declare_publisher( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - options: Option<&z_publisher_options_t>, + options: Option<&mut z_publisher_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); @@ -106,8 +106,7 @@ pub extern "C" fn z_declare_publisher( { p = p.allowed_destination(options.allowed_destination.into()); } - if let Some(encoding) = unsafe { options.encoding.as_mut() } { - let encoding = std::mem::take(encoding.as_rust_type_mut()); + if let Some(encoding) = options.encoding.take_rust_type() { p = p.encoding(encoding); } } @@ -164,27 +163,29 @@ pub unsafe extern "C" fn z_publisher_loan_mut( #[repr(C)] pub struct z_publisher_put_options_t { /// The encoding of the data to publish. - pub encoding: *mut z_owned_encoding_t, + pub encoding: z_moved_encoding_t, /// The timestamp of the publication. - pub timestamp: *mut z_timestamp_t, - #[cfg(feature = "unstable")] + pub timestamp: Option<&'static z_timestamp_t>, /// The source info for the publication. - pub source_info: *mut z_owned_source_info_t, + #[cfg(feature = "unstable")] + pub source_info: z_moved_source_info_t, /// The attachment to attach to the publication. - pub attachment: *mut z_owned_bytes_t, + pub attachment: z_moved_bytes_t, } /// Constructs the default value for `z_publisher_put_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_put_options_default(this: &mut z_publisher_put_options_t) { - *this = z_publisher_put_options_t { - encoding: ptr::null_mut(), - timestamp: ptr::null_mut(), +pub extern "C" fn z_publisher_put_options_default( + this: &mut MaybeUninit, +) { + this.write(z_publisher_put_options_t { + encoding: None.into(), + timestamp: None, #[cfg(feature = "unstable")] - source_info: ptr::null_mut(), - attachment: ptr::null_mut(), - } + source_info: None.into(), + attachment: None.into(), + }); } /// Sends a `PUT` message onto the publisher's key expression, transfering the payload ownership. @@ -202,32 +203,28 @@ pub extern "C" fn z_publisher_put_options_default(this: &mut z_publisher_put_opt #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_publisher_put( this: &z_loaned_publisher_t, - payload: &mut z_owned_bytes_t, + payload: z_moved_bytes_t, options: Option<&mut z_publisher_put_options_t>, ) -> result::z_result_t { let publisher = this.as_rust_type_ref(); - let payload = std::mem::take(payload.as_rust_type_mut()); + let Some(payload) = payload.into_rust_type() else { + return result::Z_EINVAL; + }; let mut put = publisher.put(payload); if let Some(options) = options { - if let Some(encoding) = unsafe { options.encoding.as_mut() } { - let encoding = std::mem::take(encoding.as_rust_type_mut()); + if let Some(encoding) = options.encoding.take_rust_type() { put = put.encoding(encoding); }; #[cfg(feature = "unstable")] - if let Some(source_info) = unsafe { options.source_info.as_mut() } { - let source_info = std::mem::take(source_info.as_rust_type_mut()); + if let Some(source_info) = options.source_info.take_rust_type() { put = put.source_info(source_info); }; - if let Some(attachment) = unsafe { options.attachment.as_mut() } { - let attachment = std::mem::take(attachment.as_rust_type_mut()); + if let Some(attachment) = options.attachment.take_rust_type() { put = put.attachment(attachment); } - if !options.timestamp.is_null() { - let timestamp = *unsafe { options.timestamp.as_mut() } - .unwrap() - .as_rust_type_ref(); - put = put.timestamp(Some(timestamp)); + if let Some(timestamp) = options.timestamp { + put = put.timestamp(Some(*timestamp.as_rust_type_ref())); } } @@ -244,16 +241,16 @@ pub unsafe extern "C" fn z_publisher_put( #[repr(C)] pub struct z_publisher_delete_options_t { /// The timestamp of this message. - pub timestamp: *mut z_timestamp_t, + pub timestamp: Option<&'static z_timestamp_t>, } /// Constructs the default values for the delete operation via a publisher entity. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_delete_options_default(this: &mut z_publisher_delete_options_t) { - *this = z_publisher_delete_options_t { - timestamp: ptr::null_mut(), - } +pub extern "C" fn z_publisher_delete_options_default( + this: &mut MaybeUninit, +) { + this.write(z_publisher_delete_options_t { timestamp: None }); } /// Sends a `DELETE` message onto the publisher's key expression. /// @@ -267,11 +264,8 @@ pub extern "C" fn z_publisher_delete( let publisher = publisher.as_rust_type_ref(); let mut del = publisher.delete(); if let Some(options) = options { - if !options.timestamp.is_null() { - let timestamp = *unsafe { options.timestamp.as_mut() } - .unwrap() - .as_rust_type_ref(); - del = del.timestamp(Some(timestamp)); + if let Some(timestamp) = options.timestamp { + del = del.timestamp(Some(*timestamp.as_rust_type_ref())); } } if let Err(e) = del.wait() { @@ -298,9 +292,26 @@ pub extern "C" fn z_publisher_keyexpr(publisher: &z_loaned_publisher_t) -> &z_lo } #[cfg(feature = "unstable")] -pub use crate::opaque_types::zc_owned_matching_listener_t; +pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; +#[cfg(feature = "unstable")] +decl_c_type!( + owned(zc_owned_matching_listener_t, option MatchingListener<'static, ()>), + moved(zc_moved_matching_listener_t) +); + +/// Constructs an empty matching listener +#[no_mangle] +#[cfg(feature = "unstable")] +pub extern "C" fn zc_matching_listener_null(this: &mut MaybeUninit) { + this.as_rust_type_mut_uninit().write(None); +} + +/// Checks the matching listener is for the gravestone state +#[no_mangle] #[cfg(feature = "unstable")] -decl_c_type!(owned(zc_owned_matching_listener_t, Option>)); +pub extern "C" fn zc_matching_listener_check(this: &zc_owned_matching_listener_t) -> bool { + this.as_rust_type_ref().is_some() +} #[cfg(feature = "unstable")] /// A struct that indicates if there exist Subscribers matching the Publisher's key expression. @@ -324,19 +335,20 @@ pub struct zc_matching_status_t { pub extern "C" fn zc_publisher_matching_listener_declare( this: &mut MaybeUninit, publisher: &'static z_loaned_publisher_t, - callback: &mut zc_owned_closure_matching_status_t, + callback: zc_moved_closure_matching_status_t, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); - let mut closure = zc_owned_closure_matching_status_t::empty(); - std::mem::swap(callback, &mut closure); let publisher = publisher.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; let listener = publisher .matching_listener() .callback_mut(move |matching_status| { let status = zc_matching_status_t { matching: matching_status.matching_subscribers(), }; - zc_closure_matching_status_call(zc_closure_matching_status_loan(&closure), &status); + zc_closure_matching_status_call(zc_closure_matching_status_loan(&callback), &status); }) .wait(); match listener { @@ -358,9 +370,9 @@ pub extern "C" fn zc_publisher_matching_listener_declare( #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn zc_publisher_matching_listener_undeclare( - this: &mut zc_owned_matching_listener_t, + this: zc_moved_matching_listener_t, ) -> result::z_result_t { - if let Some(p) = this.as_rust_type_mut().take() { + if let Some(p) = this.into_rust_type().take() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -369,6 +381,18 @@ pub extern "C" fn zc_publisher_matching_listener_undeclare( result::Z_OK } +#[cfg(feature = "unstable")] +/// Undeclares the given matching listener, droping and invalidating it. +/// +/// @return 0 in case of success, negative error code otherwise. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub extern "C" fn zc_publisher_matching_listener_drop( + this: zc_moved_matching_listener_t, +) -> result::z_result_t { + zc_publisher_matching_listener_undeclare(this) +} + #[cfg(feature = "unstable")] /// Gets publisher matching status - i.e. if there are any subscribers matching its key expression. /// @@ -398,8 +422,8 @@ pub extern "C" fn zc_publisher_get_matching_status( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_undeclare_publisher(this: &mut z_owned_publisher_t) -> result::z_result_t { - if let Some(p) = this.as_rust_type_mut().take() { +pub extern "C" fn z_undeclare_publisher(this: z_moved_publisher_t) -> result::z_result_t { + if let Some(p) = this.into_rust_type() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_ENETWORK; @@ -411,6 +435,6 @@ pub extern "C" fn z_undeclare_publisher(this: &mut z_owned_publisher_t) -> resul /// Frees memory and resets publisher to its gravestone state. Also attempts undeclare publisher. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_drop(this: &mut z_owned_publisher_t) { +pub extern "C" fn z_publisher_drop(this: z_moved_publisher_t) { z_undeclare_publisher(this); } diff --git a/src/put.rs b/src/put.rs index c8455639e..a440fe0fb 100644 --- a/src/put.rs +++ b/src/put.rs @@ -11,16 +11,22 @@ // Contributors: // ZettaScale Zenoh team, // -use std::ptr::null_mut; +use std::mem::MaybeUninit; use zenoh::{ - prelude::*, - qos::{CongestionControl, Priority}, + bytes::EncodingBuilderTrait, + qos::{CongestionControl, Priority, QoSBuilderTrait}, + sample::{SampleBuilderTrait, TimestampBuilderTrait}, + Wait, }; +#[cfg(feature = "unstable")] +use crate::z_moved_source_info_t; use crate::{ - commons::*, encoding::*, keyexpr::*, result, transmute::RustTypeRef, z_loaned_session_t, - z_owned_bytes_t, z_timestamp_t, + commons::*, + result, + transmute::{IntoRustType, RustTypeRef, TakeRustType}, + z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_encoding_t, z_timestamp_t, }; /// Options passed to the `z_put()` function. @@ -28,7 +34,7 @@ use crate::{ #[allow(non_camel_case_types)] pub struct z_put_options_t { /// The encoding of the message. - pub encoding: *mut z_owned_encoding_t, + pub encoding: z_moved_encoding_t, /// The congestion control to apply when routing this message. pub congestion_control: z_congestion_control_t, /// The priority of this message. @@ -36,33 +42,33 @@ pub struct z_put_options_t { /// If true, Zenoh will not wait to batch this operation with others to reduce the bandwith. pub is_express: bool, /// The timestamp of this message. - pub timestamp: *mut z_timestamp_t, - #[cfg(feature = "unstable")] + pub timestamp: Option<&'static mut z_timestamp_t>, /// The allowed destination of this message. - pub allowed_destination: zc_locality_t, #[cfg(feature = "unstable")] + pub allowed_destination: zc_locality_t, /// The source info for the message. - pub source_info: *mut z_owned_source_info_t, + #[cfg(feature = "unstable")] + pub source_info: z_moved_source_info_t, /// The attachment to this message. - pub attachment: *mut z_owned_bytes_t, + pub attachment: z_moved_bytes_t, } /// Constructs the default value for `z_put_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_put_options_default(this: &mut z_put_options_t) { - *this = z_put_options_t { - encoding: null_mut(), +pub extern "C" fn z_put_options_default(this: &mut MaybeUninit) { + this.write(z_put_options_t { + encoding: None.into(), congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), is_express: false, - timestamp: null_mut(), + timestamp: None, #[cfg(feature = "unstable")] allowed_destination: zc_locality_default(), #[cfg(feature = "unstable")] - source_info: null_mut(), - attachment: null_mut(), - }; + source_info: None.into(), + attachment: None.into(), + }); } /// Publishes data on specified key expression. @@ -78,33 +84,29 @@ pub extern "C" fn z_put_options_default(this: &mut z_put_options_t) { pub extern "C" fn z_put( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - payload: &mut z_owned_bytes_t, + payload: z_moved_bytes_t, options: Option<&mut z_put_options_t>, ) -> result::z_result_t { let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let payload = std::mem::take(payload.as_rust_type_mut()); + let Some(payload) = payload.into_rust_type() else { + return result::Z_EINVAL; + }; let mut put = session.put(key_expr, payload); if let Some(options) = options { - if let Some(encoding) = unsafe { options.encoding.as_mut() } { - let encoding = std::mem::take(encoding.as_rust_type_mut()); + if let Some(encoding) = options.encoding.take_rust_type() { put = put.encoding(encoding); }; #[cfg(feature = "unstable")] - if let Some(source_info) = unsafe { options.source_info.as_mut() } { - let source_info = std::mem::take(source_info.as_rust_type_mut()); + if let Some(source_info) = options.source_info.take_rust_type() { put = put.source_info(source_info); }; - if let Some(attachment) = unsafe { options.attachment.as_mut() } { - let attachment = std::mem::take(attachment.as_rust_type_mut()); + if let Some(attachment) = options.attachment.take_rust_type() { put = put.attachment(attachment); } - if !options.timestamp.is_null() { - let timestamp = *unsafe { options.timestamp.as_ref() } - .unwrap() - .as_rust_type_ref(); - put = put.timestamp(Some(timestamp)); + if let Some(timestamp) = options.timestamp.as_ref() { + put = put.timestamp(Some(timestamp.into_rust_type())); } put = put.priority(options.priority.into()); put = put.congestion_control(options.congestion_control.into()); @@ -134,24 +136,24 @@ pub struct z_delete_options_t { /// If true, Zenoh will not wait to batch this operation with others to reduce the bandwith. pub is_express: bool, /// The timestamp of this message. - pub timestamp: *mut z_timestamp_t, - #[cfg(feature = "unstable")] + pub timestamp: Option<&'static mut z_timestamp_t>, /// The allowed destination of this message. + #[cfg(feature = "unstable")] pub allowed_destination: zc_locality_t, } /// Constructs the default value for `z_delete_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_delete_options_default(this: *mut z_delete_options_t) { - *this = z_delete_options_t { +pub unsafe extern "C" fn z_delete_options_default(this: &mut MaybeUninit) { + this.write(z_delete_options_t { congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), is_express: false, - timestamp: null_mut(), + timestamp: None, #[cfg(feature = "unstable")] allowed_destination: zc_locality_default(), - }; + }); } /// Sends request to delete data on specified key expression (used when working with Zenoh storages ). @@ -172,11 +174,8 @@ pub extern "C" fn z_delete( let key_expr = key_expr.as_rust_type_ref(); let mut del = session.delete(key_expr); if let Some(options) = options { - if !options.timestamp.is_null() { - let timestamp = *unsafe { options.timestamp.as_ref() } - .unwrap() - .as_rust_type_ref(); - del = del.timestamp(Some(timestamp)); + if let Some(timestamp) = options.timestamp.as_ref() { + del = del.timestamp(Some(timestamp.into_rust_type())); } del = del .congestion_control(options.congestion_control.into()) diff --git a/src/queryable.rs b/src/queryable.rs index f2a7b7253..7fa2fefb6 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -11,29 +11,32 @@ // Contributors: // ZettaScale Zenoh team, // -use std::{mem::MaybeUninit, ptr::null_mut}; +use std::mem::MaybeUninit; use zenoh::{ - bytes::Encoding, - prelude::*, - qos::{CongestionControl, Priority}, + bytes::{Encoding, EncodingBuilderTrait}, + prelude::SessionDeclarations, + qos::{CongestionControl, Priority, QoSBuilderTrait}, query::{Query, Queryable}, + sample::{SampleBuilderTrait, TimestampBuilderTrait}, + Wait, }; pub use crate::opaque_types::{z_loaned_queryable_t, z_owned_queryable_t}; #[cfg(feature = "unstable")] -use crate::z_owned_source_info_t; +use crate::z_moved_source_info_t; use crate::{ result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_query_call, z_closure_query_loan, z_congestion_control_t, z_loaned_bytes_t, - z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, z_owned_bytes_t, - z_owned_closure_query_t, z_owned_encoding_t, z_priority_t, z_timestamp_t, + z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, + z_moved_closure_query_t, z_moved_encoding_t, z_moved_queryable_t, z_priority_t, z_timestamp_t, z_view_string_from_substr, z_view_string_t, }; decl_c_type!( - owned(z_owned_queryable_t, Option>), - loaned(z_loaned_queryable_t, Queryable<'static, ()>) + owned(z_owned_queryable_t, option Queryable<'static, ()>), + loaned(z_loaned_queryable_t), + moved(z_moved_queryable_t) ); /// Constructs a queryable in its gravestone value. @@ -52,10 +55,11 @@ pub unsafe extern "C" fn z_queryable_loan(this: &z_owned_queryable_t) -> &z_loan .as_loaned_c_type_ref() } -pub use crate::opaque_types::{z_loaned_query_t, z_owned_query_t}; +pub use crate::opaque_types::{z_loaned_query_t, z_moved_query_t, z_owned_query_t}; decl_c_type!( - owned(z_owned_query_t, Option), - loaned(z_loaned_query_t, Query) + owned(z_owned_query_t, option Query), + loaned(z_loaned_query_t), + moved(z_moved_query_t) ); /// Constructs query in its gravestone value. @@ -79,9 +83,8 @@ pub unsafe extern "C" fn z_query_loan(this: &'static z_owned_query_t) -> &z_loan } /// Destroys the query resetting it to its gravestone value. #[no_mangle] -pub extern "C" fn z_query_drop(this: &mut z_owned_query_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_query_drop(this: z_moved_query_t) {} /// Constructs a shallow copy of the query, allowing to keep it in an "open" state past the callback's return. /// /// This operation is infallible, but may return a gravestone value if `query` itself was a gravestone value (which cannot be the case in a callback). @@ -101,8 +104,8 @@ pub struct z_queryable_options_t { /// Constructs the default value for `z_query_reply_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_queryable_options_default(this: &mut z_queryable_options_t) { - *this = z_queryable_options_t { complete: false }; +pub extern "C" fn z_queryable_options_default(this: &mut MaybeUninit) { + this.write(z_queryable_options_t { complete: false }); } /// Represents the set of options that can be applied to a query reply, @@ -111,7 +114,7 @@ pub extern "C" fn z_queryable_options_default(this: &mut z_queryable_options_t) #[repr(C)] pub struct z_query_reply_options_t { /// The encoding of the reply payload. - pub encoding: *mut z_owned_encoding_t, + pub encoding: z_moved_encoding_t, /// The congestion control to apply when routing the reply. pub congestion_control: z_congestion_control_t, /// The priority of the reply. @@ -119,28 +122,28 @@ pub struct z_query_reply_options_t { /// If true, Zenoh will not wait to batch this operation with others to reduce the bandwith. pub is_express: bool, /// The timestamp of the reply. - pub timestamp: *mut z_timestamp_t, - #[cfg(feature = "unstable")] + pub timestamp: Option<&'static mut z_timestamp_t>, /// The source info for the reply. - pub source_info: *mut z_owned_source_info_t, + #[cfg(feature = "unstable")] + pub source_info: z_moved_source_info_t, /// The attachment to this reply. - pub attachment: *mut z_owned_bytes_t, + pub attachment: z_moved_bytes_t, } /// Constructs the default value for `z_query_reply_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_query_reply_options_default(this: &mut z_query_reply_options_t) { - *this = z_query_reply_options_t { - encoding: null_mut(), +pub extern "C" fn z_query_reply_options_default(this: &mut MaybeUninit) { + this.write(z_query_reply_options_t { + encoding: None.into(), congestion_control: CongestionControl::Block.into(), priority: Priority::default().into(), is_express: false, - timestamp: null_mut(), + timestamp: None, #[cfg(feature = "unstable")] - source_info: null_mut(), - attachment: null_mut(), - }; + source_info: None.into(), + attachment: None.into(), + }); } /// Represents the set of options that can be applied to a query reply error, @@ -149,16 +152,18 @@ pub extern "C" fn z_query_reply_options_default(this: &mut z_query_reply_options #[repr(C)] pub struct z_query_reply_err_options_t { /// The encoding of the error payload. - pub encoding: *mut z_owned_encoding_t, + pub encoding: z_moved_encoding_t, } /// Constructs the default value for `z_query_reply_err_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_query_reply_err_options_default(this: &mut z_query_reply_err_options_t) { - *this = z_query_reply_err_options_t { - encoding: null_mut(), - }; +pub extern "C" fn z_query_reply_err_options_default( + this: &mut MaybeUninit, +) { + this.write(z_query_reply_err_options_t { + encoding: None.into(), + }); } /// Represents the set of options that can be applied to a query delete reply, @@ -173,27 +178,29 @@ pub struct z_query_reply_del_options_t { /// If true, Zenoh will not wait to batch this operation with others to reduce the bandwith. pub is_express: bool, /// The timestamp of the reply. - pub timestamp: *mut z_timestamp_t, - #[cfg(feature = "unstable")] + pub timestamp: Option<&'static mut z_timestamp_t>, /// The source info for the reply. - pub source_info: *mut z_owned_source_info_t, + #[cfg(feature = "unstable")] + pub source_info: z_moved_source_info_t, /// The attachment to this reply. - pub attachment: *mut z_owned_bytes_t, + pub attachment: z_moved_bytes_t, } /// Constructs the default value for `z_query_reply_del_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_query_reply_del_options_default(this: &mut z_query_reply_del_options_t) { - *this = z_query_reply_del_options_t { +pub extern "C" fn z_query_reply_del_options_default( + this: &mut MaybeUninit, +) { + this.write(z_query_reply_del_options_t { congestion_control: CongestionControl::Block.into(), priority: Priority::default().into(), is_express: false, - timestamp: null_mut(), + timestamp: None, #[cfg(feature = "unstable")] - source_info: null_mut(), - attachment: null_mut(), - }; + source_info: None.into(), + attachment: None.into(), + }); } /// Constructs a Queryable for the given key expression. @@ -211,21 +218,25 @@ pub extern "C" fn z_declare_queryable( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: &mut z_owned_closure_query_t, + callback: z_moved_closure_query_t, options: Option<&mut z_queryable_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); - let mut closure = z_owned_closure_query_t::empty(); - std::mem::swap(&mut closure, callback); let session = session.as_rust_type_ref(); let keyexpr = key_expr.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; let mut builder = session.declare_queryable(keyexpr); if let Some(options) = options { builder = builder.complete(options.complete); } let queryable = builder .callback(move |query| { - z_closure_query_call(z_closure_query_loan(&closure), query.as_loaned_c_type_ref()) + z_closure_query_call( + z_closure_query_loan(&callback), + query.as_loaned_c_type_ref(), + ) }) .wait(); match queryable { @@ -246,8 +257,8 @@ pub extern "C" fn z_declare_queryable( /// Returns 0 in case of success, negative error code otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_undeclare_queryable(this: &mut z_owned_queryable_t) -> result::z_result_t { - if let Some(qable) = this.as_rust_type_mut().take() { +pub extern "C" fn z_undeclare_queryable(this: z_moved_queryable_t) -> result::z_result_t { + if let Some(qable) = this.into_rust_type() { if let Err(e) = qable.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -259,7 +270,7 @@ pub extern "C" fn z_undeclare_queryable(this: &mut z_owned_queryable_t) -> resul /// Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_queryable_drop(this: &mut z_owned_queryable_t) { +pub extern "C" fn z_queryable_drop(this: z_moved_queryable_t) { z_undeclare_queryable(this); } @@ -287,33 +298,29 @@ pub extern "C" fn z_queryable_check(this: &z_owned_queryable_t) -> bool { pub extern "C" fn z_query_reply( this: &z_loaned_query_t, key_expr: &z_loaned_keyexpr_t, - payload: &mut z_owned_bytes_t, + payload: z_moved_bytes_t, options: Option<&mut z_query_reply_options_t>, ) -> result::z_result_t { let query = this.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let payload = std::mem::take(payload.as_rust_type_mut()); + let Some(payload) = payload.into_rust_type() else { + return result::Z_EINVAL; + }; let mut reply = query.reply(key_expr, payload); if let Some(options) = options { - if let Some(encoding) = unsafe { options.encoding.as_mut() } { - let encoding = std::mem::take(encoding.as_rust_type_mut()); + if let Some(encoding) = options.encoding.take_rust_type() { reply = reply.encoding(encoding); }; #[cfg(feature = "unstable")] - if let Some(source_info) = unsafe { options.source_info.as_mut() } { - let source_info = std::mem::take(source_info.as_rust_type_mut()); + if let Some(source_info) = options.source_info.take_rust_type() { reply = reply.source_info(source_info); }; - if let Some(attachment) = unsafe { options.attachment.as_mut() } { - let attachment = std::mem::take(attachment.as_rust_type_mut()); + if let Some(attachment) = options.attachment.take_rust_type() { reply = reply.attachment(attachment); } - if !options.timestamp.is_null() { - let timestamp = *unsafe { options.timestamp.as_mut() } - .unwrap() - .as_rust_type_ref(); - reply = reply.timestamp(Some(timestamp)); + if let Some(timestamp) = options.timestamp.as_ref() { + reply = reply.timestamp(Some(timestamp.into_rust_type())); } reply = reply.priority(options.priority.into()); reply = reply.congestion_control(options.congestion_control.into()); @@ -343,19 +350,17 @@ pub extern "C" fn z_query_reply( #[no_mangle] pub unsafe extern "C" fn z_query_reply_err( this: &z_loaned_query_t, - payload: &mut z_owned_bytes_t, + payload: z_moved_bytes_t, options: Option<&mut z_query_reply_err_options_t>, ) -> result::z_result_t { let query = this.as_rust_type_ref(); - let payload = std::mem::take(payload.as_rust_type_mut()); + let Some(payload) = payload.into_rust_type() else { + return result::Z_EINVAL; + }; let reply = query.reply_err(payload).encoding( options - .and_then(|o| { - o.encoding - .as_mut() - .map(|e| std::mem::take(e.as_rust_type_mut())) - }) + .and_then(|o| o.encoding.take_rust_type()) .unwrap_or(Encoding::default()), ); @@ -391,19 +396,14 @@ pub unsafe extern "C" fn z_query_reply_del( let mut reply = query.reply_del(key_expr); if let Some(options) = options { #[cfg(feature = "unstable")] - if let Some(source_info) = unsafe { options.source_info.as_mut() } { - let source_info = std::mem::take(source_info.as_rust_type_mut()); + if let Some(source_info) = options.source_info.take_rust_type() { reply = reply.source_info(source_info); }; - if let Some(attachment) = unsafe { options.attachment.as_mut() } { - let attachment = std::mem::take(attachment.as_rust_type_mut()); + if let Some(attachment) = options.attachment.take_rust_type() { reply = reply.attachment(attachment); } - if !options.timestamp.is_null() { - let timestamp = *unsafe { options.timestamp.as_mut() } - .unwrap() - .as_rust_type_ref(); - reply = reply.timestamp(Some(timestamp)); + if let Some(timestamp) = options.timestamp.as_ref() { + reply = reply.timestamp(Some(timestamp.into_rust_type())); } reply = reply.priority(options.priority.into()); reply = reply.congestion_control(options.congestion_control.into()); diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 2a758efd5..fda55ec3b 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -12,30 +12,34 @@ // ZettaScale Zenoh team, // -use std::{mem::MaybeUninit, ptr::null}; +use std::mem::MaybeUninit; -use zenoh::{prelude::*, pubsub::Reliability, session::Session}; +use zenoh::{ + bytes::EncodingBuilderTrait, prelude::SessionDeclarations, pubsub::Reliability, + sample::SampleBuilderTrait, session::Session, Wait, +}; use zenoh_ext::*; use crate::{ opaque_types::{ze_loaned_querying_subscriber_t, ze_owned_querying_subscriber_t}, result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_sample_call, z_closure_sample_loan, z_get_options_t, z_loaned_keyexpr_t, - z_loaned_session_t, z_owned_closure_sample_t, z_query_consolidation_none, + z_loaned_session_t, z_moved_closure_sample_t, z_query_consolidation_none, z_query_consolidation_t, z_query_target_default, z_query_target_t, z_reliability_t, }; #[cfg(feature = "unstable")] -use crate::{zc_locality_default, zc_locality_t, zc_reply_keyexpr_default, zc_reply_keyexpr_t}; +use crate::{ + zc_locality_default, zc_locality_t, zc_reply_keyexpr_default, zc_reply_keyexpr_t, + ze_moved_querying_subscriber_t, +}; decl_c_type!( owned( ze_owned_querying_subscriber_t, - Option<(zenoh_ext::FetchingSubscriber<'static, ()>, &'static Session)>, + option(zenoh_ext::FetchingSubscriber<'static, ()>, &'static Session), ), - loaned( - ze_loaned_querying_subscriber_t, - (zenoh_ext::FetchingSubscriber<'static, ()>, &'static Session), - ) + loaned(ze_loaned_querying_subscriber_t), + moved(ze_moved_querying_subscriber_t) ); /// Constructs a querying subscriber in a gravestone state. @@ -59,7 +63,7 @@ pub struct ze_querying_subscriber_options_t { #[cfg(feature = "unstable")] allowed_origin: zc_locality_t, /// The selector to be used for queries. - query_selector: *const z_loaned_keyexpr_t, + query_selector: Option<&'static z_loaned_keyexpr_t>, /// The target to be used for queries. query_target: z_query_target_t, /// The consolidation mode to be used for queries. @@ -74,19 +78,19 @@ pub struct ze_querying_subscriber_options_t { /// Constructs the default value for `ze_querying_subscriber_options_t`. #[no_mangle] pub extern "C" fn ze_querying_subscriber_options_default( - this: &mut ze_querying_subscriber_options_t, + this: &mut MaybeUninit, ) { - *this = ze_querying_subscriber_options_t { + this.write(ze_querying_subscriber_options_t { reliability: Reliability::DEFAULT.into(), #[cfg(feature = "unstable")] allowed_origin: zc_locality_default(), - query_selector: null(), + query_selector: None, query_target: z_query_target_default(), query_consolidation: z_query_consolidation_none(), #[cfg(feature = "unstable")] query_accept_replies: zc_reply_keyexpr_default(), query_timeout_ms: 0, - }; + }); } /// Constructs and declares a querying subscriber for a given key expression. @@ -104,13 +108,15 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber( this: &mut MaybeUninit, session: &'static z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: &mut z_owned_closure_sample_t, + callback: z_moved_closure_sample_t, options: Option<&mut ze_querying_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); - let mut closure = z_owned_closure_sample_t::empty(); - std::mem::swap(callback, &mut closure); let session = session.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + this.write(None); + return result::Z_EINVAL; + }; let mut sub = session .declare_subscriber(key_expr.as_rust_type_ref()) .querying(); @@ -125,7 +131,7 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber( .query_accept_replies(options.query_accept_replies.into()) .allowed_origin(options.allowed_origin.into()); } - if let Some(query_selector) = unsafe { options.query_selector.as_ref() } { + if let Some(query_selector) = options.query_selector { let query_selector = query_selector.as_rust_type_ref().clone(); sub = sub.query_selector(query_selector); } @@ -135,7 +141,7 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber( } let sub = sub.callback(move |sample| { let sample = sample.as_loaned_c_type_ref(); - z_closure_sample_call(z_closure_sample_loan(&closure), sample); + z_closure_sample_call(z_closure_sample_loan(&callback), sample); }); match sub.wait() { Ok(sub) => { @@ -158,7 +164,7 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber( pub unsafe extern "C" fn ze_querying_subscriber_get( this: &ze_loaned_querying_subscriber_t, selector: &z_loaned_keyexpr_t, - options: Option<&z_get_options_t>, + options: Option<&mut z_get_options_t>, ) -> result::z_result_t { unsafe impl Sync for z_get_options_t {} let sub = this.as_rust_type_ref(); @@ -171,21 +177,17 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( let mut get = session.get(selector).callback(cb); if let Some(options) = options { - if let Some(payload) = unsafe { options.payload.as_mut() } { - let payload = std::mem::take(payload.as_rust_type_mut()); + if let Some(payload) = options.payload.take_rust_type() { get = get.payload(payload); } - if let Some(encoding) = unsafe { options.encoding.as_mut() } { - let encoding = std::mem::take(encoding.as_rust_type_mut()); + if let Some(encoding) = options.encoding.take_rust_type() { get = get.encoding(encoding); } #[cfg(feature = "unstable")] - if let Some(source_info) = unsafe { options.source_info.as_mut() } { - let source_info = std::mem::take(source_info.as_rust_type_mut()); + if let Some(source_info) = options.source_info.take_rust_type() { get = get.source_info(source_info); } - if let Some(attachment) = unsafe { options.attachment.as_mut() } { - let attachment = std::mem::take(attachment.as_rust_type_mut()); + if let Some(attachment) = options.attachment.take_rust_type() { get = get.attachment(attachment); } @@ -214,9 +216,9 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] pub extern "C" fn ze_undeclare_querying_subscriber( - this: &mut ze_owned_querying_subscriber_t, + this: ze_moved_querying_subscriber_t, ) -> result::z_result_t { - if let Some(s) = this.as_rust_type_mut().take() { + if let Some(s) = this.into_rust_type() { if let Err(e) = s.0.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -227,7 +229,7 @@ pub extern "C" fn ze_undeclare_querying_subscriber( /// Drops querying subscriber. Also attempts to undeclare it. #[no_mangle] -pub extern "C" fn ze_querying_subscriber_drop(this: &mut ze_owned_querying_subscriber_t) { +pub extern "C" fn ze_querying_subscriber_drop(this: ze_moved_querying_subscriber_t) { ze_undeclare_querying_subscriber(this); } diff --git a/src/scouting.rs b/src/scouting.rs index 625f09ffb..8118376fa 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -19,26 +19,26 @@ use zenoh::{ scouting::Hello, }; -pub use crate::opaque_types::{z_loaned_hello_t, z_owned_hello_t}; +pub use crate::opaque_types::{z_loaned_hello_t, z_moved_hello_t, z_owned_hello_t}; use crate::{ result::{self, Z_OK}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_closure_hello_call, z_closure_hello_loan, z_owned_closure_hello_t, z_owned_config_t, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_closure_hello_call, z_closure_hello_loan, z_moved_closure_hello_t, z_moved_config_t, z_owned_string_array_t, z_view_string_t, zc_init_logging, CString, CStringView, ZVector, }; #[cfg(feature = "unstable")] use crate::{transmute::IntoCType, z_id_t}; decl_c_type!( - owned(z_owned_hello_t, Option), - loaned(z_loaned_hello_t, Hello) + owned(z_owned_hello_t, option Hello ), + loaned(z_loaned_hello_t), + moved(z_moved_hello_t) ); /// Frees memory and resets hello message to its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_hello_drop(this: &mut z_owned_hello_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub unsafe extern "C" fn z_hello_drop(this: z_moved_hello_t) {} /// Borrows hello message. #[no_mangle] @@ -141,8 +141,8 @@ pub const DEFAULT_SCOUTING_TIMEOUT: u64 = 1000; /// Constructs the default values for the scouting operation. #[no_mangle] -pub extern "C" fn z_scout_options_default(this: &mut z_scout_options_t) { - *this = z_scout_options_t::default(); +pub extern "C" fn z_scout_options_default(this: &mut MaybeUninit) { + this.write(z_scout_options_t::default()); } /// Scout for routers and/or peers. @@ -155,29 +155,30 @@ pub extern "C" fn z_scout_options_default(this: &mut z_scout_options_t) { #[allow(clippy::missing_safety_doc)] #[no_mangle] pub extern "C" fn z_scout( - config: &mut z_owned_config_t, - callback: &mut z_owned_closure_hello_t, + config: z_moved_config_t, + callback: z_moved_closure_hello_t, options: Option<&z_scout_options_t>, ) -> result::z_result_t { if cfg!(feature = "logger-autoinit") { zc_init_logging(); } + let Some(callback) = callback.into_rust_type() else { + return result::Z_EINVAL; + }; let options = options.cloned().unwrap_or_default(); let what = WhatAmIMatcher::try_from(options.what as u8).unwrap_or(WhatAmI::Router | WhatAmI::Peer); #[allow(clippy::unnecessary_cast)] // Required for multi-target let timeout = options.timeout_ms; - let Some(config) = config.as_rust_type_mut().take() else { + let Some(config) = config.into_rust_type() else { tracing::error!("Config not provided"); return result::Z_EINVAL; }; - let mut closure = z_owned_closure_hello_t::empty(); - std::mem::swap(&mut closure, callback); task::block_on(async move { let scout = zenoh::scout(what, config) .callback(move |h| { - z_closure_hello_call(z_closure_hello_loan(&closure), h.as_loaned_c_type_ref()) + z_closure_hello_call(z_closure_hello_loan(&callback), h.as_loaned_c_type_ref()) }) .await .unwrap(); diff --git a/src/session.rs b/src/session.rs index b891eed3d..ddc434886 100644 --- a/src/session.rs +++ b/src/session.rs @@ -14,19 +14,20 @@ use std::{mem::MaybeUninit, sync::Arc}; -use zenoh::{prelude::*, session::Session}; +use zenoh::{Session, Wait}; #[cfg(all(feature = "shared-memory", feature = "unstable"))] use crate::z_loaned_shm_client_storage_t; use crate::{ opaque_types::{z_loaned_session_t, z_owned_session_t}, result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_owned_config_t, zc_init_logging, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_moved_config_t, z_moved_session_t, zc_init_logging, }; decl_c_type!( - owned(z_owned_session_t, Option>), - loaned(z_loaned_session_t, Arc) + owned(z_owned_session_t, option Arc), + loaned(z_loaned_session_t), + moved(z_moved_session_t) ); /// Borrows session. @@ -53,13 +54,13 @@ pub extern "C" fn z_session_null(this: &mut MaybeUninit) { #[no_mangle] pub extern "C" fn z_open( this: &mut MaybeUninit, - config: &mut z_owned_config_t, + config: z_moved_config_t, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { zc_init_logging(); } - let Some(config) = config.as_rust_type_mut().take() else { + let Some(config) = config.into_rust_type().take() else { tracing::error!("Config not provided"); this.write(None); return result::Z_EINVAL; @@ -85,14 +86,14 @@ pub extern "C" fn z_open( #[no_mangle] pub extern "C" fn z_open_with_custom_shm_clients( this: &mut MaybeUninit, - config: &mut z_owned_config_t, + config: z_moved_config_t, shm_clients: &z_loaned_shm_client_storage_t, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { zc_init_logging(); } - let Some(config) = config.as_rust_type_mut().take() else { + let Some(config) = config.into_rust_type().take() else { tracing::error!("Config not provided"); this.write(None); return result::Z_EINVAL; @@ -125,9 +126,8 @@ pub extern "C" fn z_session_check(this: &z_owned_session_t) -> bool { /// @return 0 in case of success, a negative value if an error occured while closing the session, /// the remaining reference count (number of shallow copies) of the session otherwise, saturating at i8::MAX. #[no_mangle] -pub extern "C" fn z_close(this: &mut z_owned_session_t) -> result::z_result_t { - let session = this.as_rust_type_mut(); - let Some(s) = session.take() else { +pub extern "C" fn z_close(session: z_moved_session_t) -> result::z_result_t { + let Some(s) = session.into_rust_type() else { return result::Z_EINVAL; }; let s = match Arc::try_unwrap(s) { @@ -149,9 +149,8 @@ pub extern "C" fn z_close(this: &mut z_owned_session_t) -> result::z_result_t { /// /// This will also close the session if it does not have any clones left. #[no_mangle] -pub extern "C" fn z_session_drop(this: &mut z_owned_session_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_session_drop(this: z_moved_session_t) {} /// Constructs an owned shallow copy of the session in provided uninitialized memory location. #[allow(clippy::missing_safety_doc)] diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 492728394..20836d725 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -20,22 +20,20 @@ use std::{ use zenoh::shm::{zshm, zshmmut, ZShm}; use crate::{ - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_shm_mut_t, z_loaned_shm_t, z_owned_shm_mut_t, z_owned_shm_t, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_loaned_shm_mut_t, z_loaned_shm_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_t, }; decl_c_type!( - owned(z_owned_shm_t, Option), + owned(z_owned_shm_t, option ZShm), loaned(z_loaned_shm_t, zshm), + moved(z_moved_shm_t) ); /// Constructs ZShm slice from ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_from_mut( - this: &mut MaybeUninit, - that: &mut z_owned_shm_mut_t, -) { - let shm: Option = that.as_rust_type_mut().take().map(|val| val.into()); +pub extern "C" fn z_shm_from_mut(this: &mut MaybeUninit, that: z_moved_shm_mut_t) { + let shm: Option = that.into_rust_type().take().map(|val| val.into()); this.as_rust_type_mut_uninit().write(shm); } @@ -97,9 +95,8 @@ pub unsafe extern "C" fn z_shm_try_mut(this: &mut z_owned_shm_t) -> *mut z_loane /// Deletes ZShm slice #[no_mangle] -pub extern "C" fn z_shm_drop(this: &mut z_owned_shm_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_shm_drop(this: z_moved_shm_t) {} /// Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice #[no_mangle] diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index f77d1c0b9..75c3502ac 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -20,23 +20,24 @@ use std::{ use zenoh::shm::{zshmmut, ZShmMut}; use crate::{ - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_shm_mut_t, z_owned_shm_mut_t, z_owned_shm_t, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_loaned_shm_mut_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_mut_t, }; decl_c_type!( - owned(z_owned_shm_mut_t, Option), - loaned(z_loaned_shm_mut_t, zshmmut) + owned(z_owned_shm_mut_t, option ZShmMut), + loaned(z_loaned_shm_mut_t, zshmmut), + moved(z_moved_shm_mut_t) ); /// Tries to construct ZShmMut slice from ZShm slice #[no_mangle] pub extern "C" fn z_shm_mut_try_from_immut( this: &mut MaybeUninit, - that: &mut z_owned_shm_t, + that: z_moved_shm_t, ) { let shm: Option = that - .as_rust_type_mut() + .into_rust_type() .take() .and_then(|val| val.try_into().ok()); this.as_rust_type_mut_uninit().write(shm); @@ -78,9 +79,8 @@ pub unsafe extern "C" fn z_shm_mut_loan_mut( /// Deletes ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_mut_drop(this: &mut z_owned_shm_mut_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_shm_mut_drop(this: z_moved_shm_mut_t) {} /// @return the length of the ZShmMut slice #[no_mangle] diff --git a/src/shm/client/shm_client.rs b/src/shm/client/shm_client.rs index 8b94617f9..e1061976d 100644 --- a/src/shm/client/shm_client.rs +++ b/src/shm/client/shm_client.rs @@ -21,7 +21,7 @@ use zenoh::{ }; use super::shm_segment::{z_shm_segment_t, DynamicShmSegment}; -pub use crate::opaque_types::z_owned_shm_client_t; +pub use crate::opaque_types::{z_moved_shm_client_t, z_owned_shm_client_t}; use crate::{ context::{zc_threadsafe_context_t, DroppableContext, ThreadsafeContext}, shm::common::types::z_segment_id_t, @@ -39,7 +39,10 @@ pub struct zc_shm_client_callbacks_t { ) -> bool, } -decl_c_type!(owned(z_owned_shm_client_t, Option>)); +decl_c_type!( + owned(z_owned_shm_client_t, option Arc), + moved(z_moved_shm_client_t) +); #[derive(Debug)] pub struct DynamicShmClient { @@ -90,6 +93,5 @@ pub extern "C" fn z_shm_client_check(this: &z_owned_shm_client_t) -> bool { /// Deletes SHM Client #[no_mangle] -pub extern "C" fn z_shm_client_drop(this: &mut z_owned_shm_client_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_shm_client_drop(this: z_moved_shm_client_t) {} diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index c5948afbc..528c7f6d4 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -19,14 +19,16 @@ use zenoh::shm::{ProtocolID, ShmClient, ShmClientStorage, GLOBAL_CLIENT_STORAGE} use super::common::types::z_protocol_id_t; use crate::{ result::{z_result_t, Z_EINVAL, Z_OK}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_shm_client_storage_t, z_owned_shm_client_storage_t, z_owned_shm_client_t, - zc_loaned_shm_client_list_t, zc_owned_shm_client_list_t, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_loaned_shm_client_storage_t, z_moved_shm_client_storage_t, z_moved_shm_client_t, + z_owned_shm_client_storage_t, zc_loaned_shm_client_list_t, zc_moved_shm_client_list_t, + zc_owned_shm_client_list_t, }; decl_c_type!( - owned(zc_owned_shm_client_list_t, Option)>>), - loaned(zc_loaned_shm_client_list_t, Vec<(ProtocolID, Arc)>) + owned(zc_owned_shm_client_list_t, option Vec<(ProtocolID, Arc)>), + loaned(zc_loaned_shm_client_list_t), + moved(zc_moved_shm_client_list_t) ); /// Creates a new empty list of SHM Clients @@ -50,9 +52,8 @@ pub extern "C" fn zc_shm_client_list_check(this: &zc_owned_shm_client_list_t) -> /// Deletes list of SHM Clients #[no_mangle] -pub extern "C" fn zc_shm_client_list_drop(this: &mut zc_owned_shm_client_list_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn zc_shm_client_list_drop(this: zc_moved_shm_client_list_t) {} /// Borrows list of SHM Clients #[no_mangle] @@ -81,21 +82,20 @@ pub unsafe extern "C" fn zc_shm_client_list_loan_mut( #[no_mangle] pub extern "C" fn zc_shm_client_list_add_client( id: z_protocol_id_t, - client: &mut z_owned_shm_client_t, + client: z_moved_shm_client_t, list: &mut zc_loaned_shm_client_list_t, ) -> z_result_t { - match client.as_rust_type_mut().take() { - Some(client) => { - list.as_rust_type_mut().push((id, client)); - Z_OK - } - None => Z_EINVAL, - } + let Some(client) = client.into_rust_type() else { + return Z_EINVAL; + }; + list.as_rust_type_mut().push((id, client)); + Z_OK } decl_c_type!( - owned(z_owned_shm_client_storage_t, Option>), - loaned(z_loaned_shm_client_storage_t, Arc), + owned(z_owned_shm_client_storage_t, option Arc ), + loaned(z_loaned_shm_client_storage_t), + moved(z_moved_shm_client_storage_t) ); #[no_mangle] @@ -163,9 +163,8 @@ pub extern "C" fn z_shm_client_storage_check(this: &z_owned_shm_client_storage_t /// Derefs SHM Client Storage #[no_mangle] -pub extern "C" fn z_shm_client_storage_drop(this: &mut z_owned_shm_client_storage_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_shm_client_storage_drop(this: z_moved_shm_client_storage_t) {} /// Borrows SHM Client Storage #[no_mangle] diff --git a/src/shm/provider/alloc_layout.rs b/src/shm/provider/alloc_layout.rs index b78f927bd..add466290 100644 --- a/src/shm/provider/alloc_layout.rs +++ b/src/shm/provider/alloc_layout.rs @@ -29,7 +29,8 @@ use crate::{ result::z_result_t, shm::protocol_implementations::posix::posix_shm_provider::PosixAllocLayout, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_alloc_layout_t, z_loaned_shm_provider_t, z_owned_alloc_layout_t, + z_loaned_alloc_layout_t, z_loaned_shm_provider_t, z_moved_alloc_layout_t, + z_owned_alloc_layout_t, }; pub type DynamicAllocLayout = @@ -45,8 +46,9 @@ pub enum CSHMLayout { } decl_c_type!( - owned(z_owned_alloc_layout_t, Option), - loaned(z_loaned_alloc_layout_t, CSHMLayout), + owned(z_owned_alloc_layout_t, option CSHMLayout), + loaned(z_loaned_alloc_layout_t), + moved(z_moved_alloc_layout_t) ); /// Creates a new Alloc Layout for SHM Provider @@ -86,9 +88,8 @@ pub unsafe extern "C" fn z_alloc_layout_loan( /// Deletes Alloc Layout #[no_mangle] -pub extern "C" fn z_alloc_layout_drop(this: &mut z_owned_alloc_layout_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_alloc_layout_drop(this: z_moved_alloc_layout_t) {} #[no_mangle] pub extern "C" fn z_alloc_layout_alloc( diff --git a/src/shm/provider/shm_provider.rs b/src/shm/provider/shm_provider.rs index e5c35391b..4c2dc479f 100644 --- a/src/shm/provider/shm_provider.rs +++ b/src/shm/provider/shm_provider.rs @@ -35,7 +35,7 @@ use crate::{ provider::types::z_buf_layout_alloc_result_t, }, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_shm_provider_t, z_owned_shm_mut_t, z_owned_shm_provider_t, + z_loaned_shm_provider_t, z_moved_shm_provider_t, z_owned_shm_mut_t, z_owned_shm_provider_t, }; pub type DynamicShmProvider = ShmProvider>; @@ -50,8 +50,9 @@ pub enum CSHMProvider { } decl_c_type!( - owned(z_owned_shm_provider_t, Option), - loaned(z_loaned_shm_provider_t, CSHMProvider), + owned(z_owned_shm_provider_t, option CSHMProvider), + loaned(z_loaned_shm_provider_t), + moved(z_moved_shm_provider_t) ); /// Creates a new SHM Provider @@ -116,9 +117,8 @@ pub unsafe extern "C" fn z_shm_provider_loan( /// Deletes SHM Provider #[no_mangle] -pub extern "C" fn z_shm_provider_drop(this: &mut z_owned_shm_provider_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_shm_provider_drop(this: z_moved_shm_provider_t) {} #[no_mangle] pub extern "C" fn z_shm_provider_alloc( diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index 0806f9003..e56caf375 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -27,8 +27,9 @@ use crate::{ result::{z_result_t, Z_EINVAL, Z_OK}, shm::buffer::zshmmut::z_shm_mut_null, transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_loaned_chunk_alloc_result_t, z_loaned_memory_layout_t, z_owned_chunk_alloc_result_t, - z_owned_memory_layout_t, z_owned_shm_mut_t, + z_loaned_chunk_alloc_result_t, z_loaned_memory_layout_t, z_moved_chunk_alloc_result_t, + z_moved_memory_layout_t, z_owned_chunk_alloc_result_t, z_owned_memory_layout_t, + z_owned_shm_mut_t, }; /// Allocation errors @@ -110,10 +111,10 @@ pub struct z_alloc_alignment_t { decl_c_type!(copy(z_alloc_alignment_t, AllocAlignment),); -decl_c_type!( - inequal - owned(z_owned_memory_layout_t, Option), - loaned(z_loaned_memory_layout_t, MemoryLayout) +decl_c_type_inequal!( + owned(z_owned_memory_layout_t, option MemoryLayout), + loaned(z_loaned_memory_layout_t), + moved(z_moved_memory_layout_t) ); /// Creates a new Memory Layout @@ -169,9 +170,8 @@ pub unsafe extern "C" fn z_memory_layout_loan( /// Deletes Memory Layout #[no_mangle] -pub extern "C" fn z_memory_layout_drop(this: &mut z_owned_memory_layout_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_memory_layout_drop(this: z_moved_memory_layout_t) {} /// Extract data from Memory Layout #[no_mangle] @@ -186,8 +186,9 @@ pub extern "C" fn z_memory_layout_get_data( } decl_c_type!( - owned(z_owned_chunk_alloc_result_t, Option), - loaned(z_loaned_chunk_alloc_result_t, ChunkAllocResult) + owned(z_owned_chunk_alloc_result_t, option ChunkAllocResult), + loaned(z_loaned_chunk_alloc_result_t), + moved(z_moved_chunk_alloc_result_t) ); /// Creates a new Chunk Alloc Result with Ok value @@ -241,9 +242,8 @@ pub unsafe extern "C" fn z_chunk_alloc_result_loan( /// Deletes Chunk Alloc Result #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_drop(this: &mut z_owned_chunk_alloc_result_t) { - *this.as_rust_type_mut() = None; -} +#[allow(unused_variables)] +pub extern "C" fn z_chunk_alloc_result_drop(this: z_moved_chunk_alloc_result_t) {} #[repr(C)] pub struct z_buf_alloc_result_t { diff --git a/src/subscriber.rs b/src/subscriber.rs index 296da5fee..9929b2e0a 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -15,15 +15,16 @@ use std::mem::MaybeUninit; use zenoh::{ - prelude::*, + prelude::SessionDeclarations, pubsub::{Reliability, Subscriber}, + Wait, }; use crate::{ keyexpr::*, result, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, - z_closure_sample_call, z_closure_sample_loan, z_loaned_session_t, z_owned_closure_sample_t, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + z_closure_sample_call, z_closure_sample_loan, z_loaned_session_t, z_moved_closure_sample_t, }; /// The subscription reliability. @@ -57,10 +58,11 @@ impl From for Reliability { } } -pub use crate::opaque_types::{z_loaned_subscriber_t, z_owned_subscriber_t}; +pub use crate::opaque_types::{z_loaned_subscriber_t, z_moved_subscriber_t, z_owned_subscriber_t}; decl_c_type!( - owned(z_owned_subscriber_t, Option>), - loaned(z_loaned_subscriber_t, Subscriber<'static, ()>) + owned(z_owned_subscriber_t, option Subscriber<'static, ()>), + loaned(z_loaned_subscriber_t), + moved(z_moved_subscriber_t) ); /// Constructs a subscriber in a gravestone state. @@ -89,10 +91,10 @@ pub struct z_subscriber_options_t { /// Constructs the default value for `z_subscriber_options_t`. #[no_mangle] -pub extern "C" fn z_subscriber_options_default(this: &mut z_subscriber_options_t) { - *this = z_subscriber_options_t { +pub extern "C" fn z_subscriber_options_default(this: &mut MaybeUninit) { + this.write(z_subscriber_options_t { reliability: Reliability::DEFAULT.into(), - } + }); } /// Constructs and declares a subscriber for a given key expression. Dropping subscriber @@ -110,19 +112,21 @@ pub extern "C" fn z_declare_subscriber( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: &mut z_owned_closure_sample_t, + callback: z_moved_closure_sample_t, options: Option<&mut z_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); - let mut closure = z_owned_closure_sample_t::empty(); - std::mem::swap(callback, &mut closure); let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); + let Some(callback) = callback.into_rust_type() else { + this.write(None); + return result::Z_EINVAL; + }; let mut subscriber = session .declare_subscriber(key_expr) .callback(move |sample| { let sample = sample.as_loaned_c_type_ref(); - z_closure_sample_call(z_closure_sample_loan(&closure), sample) + z_closure_sample_call(z_closure_sample_loan(&callback), sample) }); if let Some(options) = options { subscriber = subscriber.reliability(options.reliability.into()); @@ -155,8 +159,8 @@ pub extern "C" fn z_subscriber_keyexpr(subscriber: &z_loaned_subscriber_t) -> &z /// @return 0 in case of success, negative error code otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_undeclare_subscriber(this: &mut z_owned_subscriber_t) -> result::z_result_t { - if let Some(s) = this.as_rust_type_mut().take() { +pub extern "C" fn z_undeclare_subscriber(this: z_moved_subscriber_t) -> result::z_result_t { + if let Some(s) = this.into_rust_type() { if let Err(e) = s.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -167,9 +171,8 @@ pub extern "C" fn z_undeclare_subscriber(this: &mut z_owned_subscriber_t) -> res /// Drops subscriber and resets it to its gravestone state. Also attempts to undeclare it. #[no_mangle] -pub extern "C" fn z_subscriber_drop(this: &mut z_owned_subscriber_t) { - z_undeclare_subscriber(this); -} +#[allow(unused_variables)] +pub extern "C" fn z_subscriber_drop(this: z_moved_subscriber_t) {} /// Returns ``true`` if subscriber is valid, ``false`` otherwise. #[no_mangle] diff --git a/src/transmute.rs b/src/transmute.rs index 97b5a57a0..dd71717e9 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -45,17 +45,23 @@ pub(crate) trait RustTypeRefUninit: Sized { fn as_rust_type_mut_uninit(&mut self) -> &mut MaybeUninit; } -pub(crate) trait IntoRustType: Sized + Copy { +pub(crate) trait IntoRustType: Sized { type RustType; fn into_rust_type(self) -> Self::RustType; } -pub(crate) trait IntoCType: Sized + Copy { +pub(crate) trait TakeRustType: IntoRustType + Default { + fn take_rust_type(&mut self) -> Self::RustType { + std::mem::take(self).into_rust_type() + } +} + +pub(crate) trait IntoCType: Sized { type CType; fn into_c_type(self) -> Self::CType; } -macro_rules! validate_equivalence2 { +macro_rules! validate_equivalence { ($type_a:ty, $type_b:ty) => { const _: () = { use const_format::concatcp; @@ -170,6 +176,14 @@ macro_rules! impl_transmute { } } }; + (take_rust ($c_type:ty, $rust_type:ty)) => { + impl Default for $c_type { + fn default() -> Self { + unsafe { std::mem::transmute::<$rust_type, $c_type>(<$rust_type>::default()) } + } + } + impl $crate::transmute::TakeRustType for $c_type {} + }; (into_c ($rust_type:ty, $c_type:ty)) => { impl $crate::transmute::IntoCType for $rust_type { type CType = $c_type; @@ -180,60 +194,363 @@ macro_rules! impl_transmute { }; } -// This macro declares conversions between Rust and C types. +macro_rules! impl_owned { + (owned $c_owned_type:ty, moved $c_moved_type:ty, inner rust option $rust_inner_type:ty) => { + impl_transmute!(as_c_owned(Option<$rust_inner_type>, $c_owned_type)); + impl_transmute!(as_rust($c_owned_type, Option<$rust_inner_type>)); + impl_transmute!(into_rust($c_owned_type, Option<$rust_inner_type>)); + impl_transmute!(take_rust($c_owned_type, Option<$rust_inner_type>)); + + impl Drop for $c_owned_type { + fn drop(&mut self) { + use $crate::transmute::RustTypeRef; + self.as_rust_type_mut().take(); + } + } + + impl $crate::transmute::IntoRustType for $c_moved_type { + type RustType = Option<$rust_inner_type>; + fn into_rust_type(self) -> Self::RustType { + use $crate::transmute::RustTypeRef; + let mut this = self; + // expicit types for better understanding + let ptr: &mut Option<&mut Option<$rust_inner_type>> = + &mut this._ptr.as_mut().map(|r| r.as_rust_type_mut()); + let res: Option<$rust_inner_type> = + ptr.as_mut().map(|r| std::mem::take(*r)).flatten(); + res + } + } + impl $crate::transmute::TakeRustType for $c_moved_type {} + impl Drop for $c_moved_type { + fn drop(&mut self) { + self.take(); + } + } + }; + (owned $c_owned_type:ty, moved $c_moved_type:ty, inner rust $rust_owned_type:ty) => { + impl_transmute!(as_c_owned($rust_owned_type, $c_owned_type)); + impl_transmute!(as_rust($c_owned_type, $rust_owned_type)); + impl_transmute!(into_rust($c_owned_type, $rust_owned_type)); + impl_transmute!(take_rust($c_owned_type, $rust_owned_type)); + + impl Drop for $c_owned_type { + fn drop(&mut self) { + use $crate::transmute::RustTypeRef; + std::mem::take(self.as_rust_type_mut()); + } + } + + impl $crate::transmute::IntoRustType for $c_moved_type { + type RustType = Option<$rust_owned_type>; + fn into_rust_type(self) -> Self::RustType { + use $crate::transmute::RustTypeRef; + let mut this = self; + this._ptr + .as_mut() + .map(|r| std::mem::take(r.as_rust_type_mut())) + } + } + impl $crate::transmute::TakeRustType for $c_moved_type {} + impl Drop for $c_moved_type { + fn drop(&mut self) { + self.take(); + } + } + }; + (owned rust $c_owned_type:ty, moved $c_moved_type:ty, loaned $c_loaned_type:ty) => { + impl_transmute!(as_c_owned($c_loaned_type, $c_owned_type)); + impl_transmute!(as_c_loaned($c_owned_type, $c_loaned_type)); + + // $c_owned_type is a real rust type here, not a blind C structure with same size/alingment + // So it's expected that drop is implemented for it (e.g. closures calls `drop` functions themselves) + + impl $crate::transmute::IntoRustType for $c_moved_type { + type RustType = Option<$c_owned_type>; + fn into_rust_type(self) -> Self::RustType { + let mut this = self; + this._ptr.as_mut().map(|r| std::mem::take(*r)) + } + } + impl Drop for $c_moved_type { + fn drop(&mut self) { + std::mem::take(&mut self._ptr); + } + } + }; +} + +// There are several possible variants how owned/loaned/moved types are implememnted +// Here is the relation between them: +// +// - "Owned" type is a type with "empty" state. +// - It's guaranteed that in the "empty" state object doesn't hold any external resources (memory, socket, file, etc) and can be safely forgotten without explicit destruction. +// - The "empty" state itself may be valid or not valid state of an object. E.g. it can be "None" value of an Option type or just default value of a struct. +// - The "empty" statis a always a "default()" value of an owned type. +// +// - "Inner" type is a type which is contained in the "Owned" type and whcih is necessarily valid. E.g. if the owned type is Option then inner type is T. +// If the owned type is just T with default value then inner type is T itself. It's ususally the same as "Loaned" type but not always +// +// - "Loaned: type is a type which is used to access the owned type. Usually it's the same as wrapped type, but sometimes (e.g. for type `ZShm`) it's an wrapper type over +// the inside type of loaned type. E.g. owned type is `Option`, inner type is then `Zshm``, but loaned type is `zshm` +// (which is just wrapper over `ZShm`` restricting write access) +// +// - "Moved" type - repr "C" structure which contains optional pointer to the owned type. It's used to explictly transfer ownership in C code. +// In the rust code it's possible only to take "Inner" type from "Moved" type, taking ownership on it. +// +// - "View" type - the type which holds references to external data but doesn't own it. Therefore it's always safe to copy/forget it without explicit destructor. +// The view type correspods to owned type. E.g. there may be "onwned string" and "view string". View type can be converted to loaned type, same as loaned type of +// corresponding owned type. This allows to accept either owned data or external data in the same function. +// +// Typically all these types are the same size and alignment and can be converted to each other just with `reinterpret_cast` in C++. +// But this is necessary for C++ only, if type is not used by C++ binding, this restriction can be relaxed. +// + +// These macros declares conversions between Rust and C types. // Typically the "owned" and "loaned" types have the same size and alignment. // This is necessary for C++ wrapper library to work correctly. // But for some types which are not covered by C++ this restriction can be relaxed. -// In this case the "inequal" keyword should be used. +// In this case the "inequal" variant should be used. + #[macro_export] -macro_rules! decl_c_type { +macro_rules! decl_c_type_inequal { + // + // Owned with with explicit rust loaned type - rarely used + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type!( + owned($c_owned_type, option $rust_inner_type), + moved($c_moved_type) + ); + validate_equivalence!($c_loaned_type, $rust_loaned_type); + impl_transmute!(as_c_loaned($rust_loaned_type, $c_loaned_type)); + impl_transmute!(as_rust($c_loaned_type, $rust_loaned_type)); + }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { decl_c_type!( owned($c_owned_type, $rust_owned_type), - loaned($c_loaned_type, $rust_loaned_type) + moved($c_moved_type) + ); + validate_equivalence!($c_loaned_type, $rust_loaned_type); + impl_transmute!(as_c_loaned($rust_loaned_type, $c_loaned_type)); + impl_transmute!(as_rust($c_loaned_type, $rust_loaned_type)); + }; + + // + // Owned with loaned type same as inner type - typical case + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, option $rust_inner_type), + loaned($c_loaned_type, $rust_inner_type), + moved($c_moved_type) + ); + }; + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, $rust_owned_type), + loaned($c_loaned_type, $rust_owned_type), + moved($c_moved_type) + ); + }; + // + // With view type + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + view ($c_view_type:ty, $rust_view_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, option $rust_inner_type), + loaned($c_loaned_type), + moved($c_moved_type) ); - validate_equivalence2!($c_view_type, $rust_view_type); - validate_equivalence2!($c_view_type, $c_loaned_type); + validate_equivalence!($c_view_type, $rust_view_type); impl_transmute!(as_c_view($rust_view_type, $c_view_type)); impl_transmute!(as_rust($c_view_type, $rust_view_type)); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { - decl_c_type!( inequal + loaned ($c_loaned_type:ty $(,)?), + view ($c_view_type:ty, $rust_view_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), - loaned($c_loaned_type, $rust_loaned_type) + loaned($c_loaned_type), + moved($c_moved_type) ); - validate_equivalence2!($c_owned_type, $c_loaned_type); + validate_equivalence!($c_view_type, $rust_view_type); + impl_transmute!(as_c_view($rust_view_type, $c_view_type)); + impl_transmute!(as_rust($c_view_type, $rust_view_type)); }; - (inequal - owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { - decl_c_type!(loaned($c_loaned_type, $rust_loaned_type)); - decl_c_type!(owned($c_owned_type, $rust_owned_type)); + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), + view ($c_view_type:ty, $rust_view_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, $rust_owned_type), + loaned($c_loaned_type, $rust_loaned_type), + moved($c_moved_type) + ); + validate_equivalence!($c_view_type, $rust_view_type); + impl_transmute!(as_c_view($rust_view_type, $c_view_type)); + impl_transmute!(as_rust($c_view_type, $rust_view_type)); }; - (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?) $(,)?) => { - validate_equivalence2!($c_owned_type, $rust_owned_type); - impl_transmute!(as_c_owned($rust_owned_type, $c_owned_type)); - impl_transmute!(as_rust($c_owned_type, $rust_owned_type)); +} + +#[macro_export] +macro_rules! decl_c_type { + // + // Owned type only + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + validate_equivalence!($c_owned_type, Option<$rust_inner_type>); + impl_owned!(owned $c_owned_type, moved $c_moved_type, inner rust option $rust_inner_type); }; - (loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { - validate_equivalence2!($c_loaned_type, $rust_loaned_type); - impl_transmute!(as_c_loaned($rust_loaned_type, $c_loaned_type)); - impl_transmute!(as_rust($c_loaned_type, $rust_loaned_type)); + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + validate_equivalence!($c_owned_type, $rust_owned_type); + impl_owned!(owned $c_owned_type, moved $c_moved_type, inner rust $rust_owned_type); + }; + // + // Owned with with explicit rust loaned type - rarely used + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, option $rust_inner_type), + loaned($c_loaned_type, $rust_loaned_type), + moved($c_moved_type) + ); + validate_equivalence!($c_loaned_type, $c_owned_type); + }; + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, $rust_owned_type), + loaned($c_loaned_type, $rust_loaned_type), + moved($c_moved_type) + ); + validate_equivalence!($c_loaned_type, $c_owned_type); }; + // + // Owned with loaned type same as inner type - typical case + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type!( + owned($c_owned_type, option $rust_inner_type), + loaned($c_loaned_type, $rust_inner_type), + moved($c_moved_type) + ); + }; + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type!( + owned($c_owned_type, $rust_owned_type), + loaned($c_loaned_type, $rust_owned_type), + moved($c_moved_type) + ); + }; + // + // With view type + // + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + view ($c_view_type:ty, $rust_view_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, option $rust_inner_type), + loaned($c_loaned_type), + view($c_view_type, $rust_view_type), + moved($c_moved_type) + ); + validate_equivalence!($c_owned_type, $c_loaned_type); + validate_equivalence!($c_view_type, $c_loaned_type); + }; + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + view ($c_view_type:ty, $rust_view_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, $rust_owned_type), + loaned($c_loaned_type, $rust_owned_type), + view($c_view_type, $rust_view_type), + moved($c_moved_type) + ); + validate_equivalence!($c_owned_type, $c_loaned_type); + validate_equivalence!($c_view_type, $c_loaned_type); + }; + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), + view ($c_view_type:ty, $rust_view_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + decl_c_type_inequal!( + owned($c_owned_type, $rust_owned_type), + loaned($c_loaned_type, $rust_loaned_type), + view($c_view_type, $rust_view_type), + moved($c_moved_type) + ); + validate_equivalence!($c_owned_type, $c_loaned_type); + validate_equivalence!($c_view_type, $c_loaned_type); + }; + + // + // Specific case for closures: c owned type and rust owned type is the same thing: c-repr structure + // + (owned ($c_owned_type:ty $(,)?), + loaned ($c_loaned_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?) + $(,)?) => { + validate_equivalence!($c_owned_type, $c_loaned_type); + impl_owned!(owned rust $c_owned_type, moved $c_moved_type, loaned $c_loaned_type); + }; + + // + // Rust type is copyable plain data type, just allow to convert references or copy whole structure + // (copy ($c_type:ty, $rust_type:ty $(,)?) $(,)?) => { - validate_equivalence2!($c_type, $rust_type); + validate_equivalence!($c_type, $rust_type); impl_transmute!(as_c($rust_type, $c_type)); impl_transmute!(as_rust($c_type, $rust_type)); impl_transmute!(into_c($rust_type, $c_type)); impl_transmute!(into_rust($c_type, $rust_type)); }; - (owned ($c_owned_type:ty$ (,)?), - loaned ($c_loaned_type:ty $(,)?) $(,)?) => { - validate_equivalence2!($c_owned_type, $c_loaned_type); - impl_transmute!(as_c_owned($c_loaned_type, $c_owned_type)); - impl_transmute!(as_c_loaned($c_owned_type, $c_loaned_type)); + + // + // Specific case: no owned type exists + // + (loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { + validate_equivalence!($c_loaned_type, $rust_loaned_type); + impl_transmute!(as_c_loaned($rust_loaned_type, $c_loaned_type)); + impl_transmute!(as_rust($c_loaned_type, $rust_loaned_type)); }; } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 64f2bbc5c..89d980847 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,12 +40,25 @@ foreach(file ${files}) add_dependencies(${target} zenohc::lib) target_link_libraries(${target} PRIVATE zenohc::lib Threads::Threads) copy_dlls(${target}) - set_property(TARGET ${target} PROPERTY C_STANDARD 11) - find_program(VALGRIND valgrind) - if (NOT(test_type STREQUAL leak)) + if(ZENOHC_BUILD_TESTS_WITH_CXX) + set_source_files_properties(${file} PROPERTIES LANGUAGE CXX) + set_property(TARGET ${target} PROPERTY LANGUAGE CXX) + set_property(TARGET ${target} PROPERTY CXX_STANDARD 17) + # add compiler flag "+x c++" to suppress the Clang warning "treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated " + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_options(${target} PRIVATE -x c++) + endif() add_test(NAME "${test_type}_${target}" COMMAND ${target}) - elseif(VALGRIND) - add_test(NAME "${test_type}_${target}" COMMAND bash ${PROJECT_SOURCE_DIR}/tests/run_leak_check.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}) + else() + set_source_files_properties(${file} PROPERTIES LANGUAGE C) + set_property(TARGET ${target} PROPERTY LANGUAGE C) + set_property(TARGET ${target} PROPERTY C_STANDARD 11) + find_program(VALGRIND valgrind) + if (NOT(test_type STREQUAL leak)) + add_test(NAME "${test_type}_${target}" COMMAND ${target}) + elseif(VALGRIND) + add_test(NAME "${test_type}_${target}" COMMAND bash ${PROJECT_SOURCE_DIR}/tests/run_leak_check.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target}) + endif() endif() endforeach() diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index 98276d794..c235a13ef 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -24,7 +24,7 @@ #define URI "demo/example/**/*" #define SCOUTING_TIMEOUT "1000" -char *value = "Test value"; +const char *value = "Test value"; #ifdef UNSTABLE volatile unsigned int zids = 0; @@ -114,8 +114,8 @@ int main(int argc, char **argv) { z_view_keyexpr_from_str(&key_demo_example, "demo/example"); z_view_keyexpr_from_str(&key_demo_example_a, "demo/example/a"); z_view_keyexpr_from_str(&key_demo_example_starstar, "demo/example/**"); - _Bool _ret_bool = z_view_keyexpr_check(&key_demo_example); - assert(_ret_bool == true); + bool _ret_bool = z_view_keyexpr_is_empty(&key_demo_example); + assert(_ret_bool == false); _ret_bool = z_keyexpr_includes(z_loan(key_demo_example_starstar), z_loan(key_demo_example_a)); assert(_ret_bool); @@ -264,7 +264,7 @@ int main(int argc, char **argv) { const z_loaned_session_t *ls1 = z_loan(s1); z_owned_closure_sample_t _ret_closure_sample; - z_closure(&_ret_closure_sample, data_handler, NULL, ls1); + z_closure(&_ret_closure_sample, data_handler, NULL, (void *)ls1); z_subscriber_options_t _ret_sub_opt; z_subscriber_options_default(&_ret_sub_opt); @@ -277,7 +277,7 @@ int main(int argc, char **argv) { z_sleep_s(SLEEP); char s1_res[64]; - sprintf(s1_res, "%s/chunk/%d", keyexpr_str, 1); + snprintf(s1_res, 64, "%s/chunk/%d", keyexpr_str, 1); z_view_keyexpr_t s1_key; z_view_keyexpr_from_str(&s1_key, s1_res); z_owned_keyexpr_t _ret_expr; @@ -314,7 +314,7 @@ int main(int argc, char **argv) { // TODO: test for pull subscriber z_owned_closure_query_t _ret_closure_query; - z_closure(&_ret_closure_query, query_handler, NULL, ls1); + z_closure(&_ret_closure_query, query_handler, NULL, (void *)ls1); z_queryable_options_t _ret_qle_opt; z_queryable_options_default(&_ret_qle_opt); z_owned_queryable_t qle; diff --git a/tests/z_api_drop_options.c b/tests/z_api_drop_options.c index 613dcfe6b..845c79d45 100644 --- a/tests/z_api_drop_options.c +++ b/tests/z_api_drop_options.c @@ -37,7 +37,7 @@ void put() { z_put_options_default(&opts); z_owned_bytes_t payload, attachment; z_bytes_serialize_from_int32(&attachment, 16); - opts.attachment = &attachment; + opts.attachment = z_move(attachment); z_bytes_serialize_from_int32(&payload, 16); z_put(z_loan(s), z_loan(ke), z_move(payload), &opts); assert(!z_check(payload)); @@ -61,9 +61,9 @@ void get() { z_get_options_default(&opts); z_owned_bytes_t payload, attachment; z_bytes_serialize_from_int32(&attachment, 16); - opts.payload = &payload; + opts.payload = z_move(payload); z_bytes_serialize_from_int32(&payload, 16); - opts.attachment = &attachment; + opts.attachment = z_move(attachment); z_owned_closure_reply_t closure; z_closure(&closure, cb, drop, NULL); diff --git a/tests/z_api_keyexpr_test.c b/tests/z_api_keyexpr_test.c index e955f036b..bc47f0390 100644 --- a/tests/z_api_keyexpr_test.c +++ b/tests/z_api_keyexpr_test.c @@ -24,13 +24,13 @@ void canonize() { char keyexpr[256]; int8_t err; - uintptr_t len_old, len_new; + size_t len_old, len_new; strcpy(keyexpr, "a/**/**/c"); len_old = len_new = strlen(keyexpr); - printf("'%s', len = %lu -> ", keyexpr, len_old); + printf("'%s', len = %zu -> ", keyexpr, len_old); err = z_keyexpr_canonize(keyexpr, &len_new); - printf("'%s', len = %lu, err = %d\n", keyexpr, len_new, err); + printf("'%s', len = %zu, err = %d\n", keyexpr, len_new, err); assert(err == 0); assert(len_new == len_old - 3); assert(strcmp(keyexpr, "a/**/c") == 0); @@ -45,7 +45,7 @@ void canonize() { strcpy(keyexpr, "a/**/**/c"); z_view_keyexpr_t key_expr_canonized; z_view_keyexpr_from_str_autocanonize(&key_expr_canonized, keyexpr); - assert(z_view_keyexpr_check(&key_expr_canonized) == true); + assert(z_view_keyexpr_is_empty(&key_expr_canonized) == false); assert(strcmp(keyexpr, "a/**/c") == 0); z_view_string_t key_exp_canonized_bytes; z_keyexpr_as_view_string(z_loan(key_expr_canonized), &key_exp_canonized_bytes); @@ -93,7 +93,7 @@ void undeclare() { z_owned_keyexpr_t ke; z_declare_keyexpr(&ke, z_loan(s), z_loan(view_ke)); assert(z_keyexpr_check(&ke)); - z_undeclare_keyexpr(&ke, z_loan(s)); + z_undeclare_keyexpr(z_move(ke), z_loan(s)); assert(!z_keyexpr_check(&ke)); } diff --git a/tests/z_api_null_drop_test.c b/tests/z_api_null_drop_test.c index 5cd05adec..0090c7a22 100644 --- a/tests/z_api_null_drop_test.c +++ b/tests/z_api_null_drop_test.c @@ -20,158 +20,64 @@ #include "zenoh.h" -int main(int argc, char **argv) { - // - // Check that all null functions exists - // - z_owned_session_t session_null_1; - z_session_null(&session_null_1); - z_owned_publisher_t publisher_null_1; - z_publisher_null(&publisher_null_1); - z_owned_keyexpr_t keyexpr_null_1; - z_keyexpr_null(&keyexpr_null_1); - z_owned_config_t config_null_1; - z_config_null(&config_null_1); - z_owned_subscriber_t subscriber_null_1; - z_subscriber_null(&subscriber_null_1); - z_owned_queryable_t queryable_null_1; - z_queryable_null(&queryable_null_1); - z_owned_encoding_t encoding_null_1; - z_encoding_null(&encoding_null_1); - z_owned_reply_t reply_null_1; - z_reply_null(&reply_null_1); - z_owned_hello_t hello_null_1; - z_hello_null(&hello_null_1); - z_owned_closure_sample_t closure_sample_null_1; - z_closure_sample_null(&closure_sample_null_1); - z_owned_closure_query_t closure_query_null_1; - z_closure_query_null(&closure_query_null_1); - z_owned_closure_reply_t closure_reply_null_1; - z_closure_reply_null(&closure_reply_null_1); - z_owned_closure_hello_t closure_hello_null_1; - z_closure_hello_null(&closure_hello_null_1); -#ifdef UNSTABLE - z_owned_closure_zid_t closure_zid_null_1; - z_closure_zid_null(&closure_zid_null_1); -#endif - z_owned_string_t str_null_1; - z_string_null(&str_null_1); - z_owned_bytes_t bytes_null_1; - z_bytes_null(&bytes_null_1); - - // - // Test that they actually make invalid value (where applicable) - // - assert(!z_check(session_null_1)); - assert(!z_check(publisher_null_1)); - assert(!z_check(keyexpr_null_1)); - assert(!z_check(config_null_1)); - assert(!z_check(subscriber_null_1)); - assert(!z_check(queryable_null_1)); - assert(!z_check(encoding_null_1)); - assert(!z_check(reply_null_1)); - assert(!z_check(hello_null_1)); - assert(!z_check(str_null_1)); - assert(!z_check(bytes_null_1)); +// fill v with invalid values +// set v to null +// check if v it is null +// make sure that drop on null does not crash +// make sure that double drop on null does not crash +// fill v with invalid values again +// +// set v1 to null +// move v to v1 +// make sure that v is null now +#define TEST(name) \ + { \ + z_owned_##name##_t v; \ + memset(&v, -1, sizeof(v)); \ + z_null(&v); \ + assert(!z_check(v)); \ + z_drop(z_move(v)); \ + z_drop(z_move(v)); \ + z_owned_##name##_t v1; \ + z_null(&v1); \ + memset(&v, -1, sizeof(v)); \ + z_take(&v1, z_move(v)); \ + assert(!z_check(v)); \ + } - // - // Test that z_null macro defined for all types - // - z_owned_session_t session_null_2; - z_owned_publisher_t publisher_null_2; - z_owned_keyexpr_t keyexpr_null_2; - z_owned_config_t config_null_2; - z_owned_subscriber_t subscriber_null_2; - z_owned_queryable_t queryable_null_2; - z_owned_encoding_t encoding_null_2; - z_owned_reply_t reply_null_2; - z_owned_hello_t hello_null_2; - z_owned_closure_sample_t closure_sample_null_2; - z_owned_closure_query_t closure_query_null_2; - z_owned_closure_reply_t closure_reply_null_2; - z_owned_closure_hello_t closure_hello_null_2; -#ifdef UNSTABLE - z_owned_closure_zid_t closure_zid_null_2; +int main(void) { + TEST(session) + TEST(keyexpr) + TEST(config) + TEST(hello) + TEST(closure_sample) + TEST(closure_query) + TEST(closure_reply) + TEST(closure_hello) + TEST(closure_zid) + TEST(string) + TEST(string_array) + TEST(sample) + TEST(query) + TEST(slice) + TEST(bytes) + TEST(encoding) +#if Z_FEATURE_PUBLICATION == 1 + TEST(publisher) #endif - z_owned_string_t str_null_2; - z_owned_bytes_t bytes_null_2; - - z_null(&session_null_2); - z_null(&publisher_null_2); - z_null(&keyexpr_null_2); - z_null(&config_null_2); - z_null(&subscriber_null_2); - z_null(&queryable_null_2); - z_null(&encoding_null_2); - z_null(&reply_null_2); - z_null(&hello_null_2); - z_null(&closure_sample_null_2); - z_null(&closure_query_null_2); - z_null(&closure_reply_null_2); - z_null(&closure_hello_null_2); -#ifdef UNSTABLE - z_null(&closure_zid_null_2); +#if Z_FEATURE_SUBSCRIPTION == 1 + TEST(subscriber) #endif - z_null(&str_null_2); - z_null(&bytes_null_2); - - // - // Test that null macro works the same as direct call - // - assert(!z_check(session_null_2)); - assert(!z_check(publisher_null_2)); - assert(!z_check(keyexpr_null_2)); - assert(!z_check(config_null_2)); - assert(!z_check(subscriber_null_2)); - assert(!z_check(queryable_null_2)); - assert(!z_check(encoding_null_2)); - assert(!z_check(reply_null_2)); - assert(!z_check(hello_null_2)); - assert(!z_check(str_null_2)); - assert(!z_check(bytes_null_2)); - - // - // Test drop null and double drop it - // - for (int i = 0; i < 2; ++i) { - z_drop(z_move(session_null_1)); - z_undeclare_publisher(z_move(publisher_null_1)); - z_drop(z_move(keyexpr_null_1)); - z_drop(z_move(config_null_1)); - z_undeclare_subscriber(z_move(subscriber_null_1)); - z_undeclare_queryable(z_move(queryable_null_1)); - z_drop(z_move(encoding_null_1)); - z_drop(z_move(reply_null_1)); - z_drop(z_move(hello_null_1)); - z_drop(z_move(closure_sample_null_1)); - z_drop(z_move(closure_query_null_1)); - z_drop(z_move(closure_reply_null_1)); - z_drop(z_move(closure_hello_null_1)); -#ifdef UNSTABLE - z_drop(z_move(closure_zid_null_1)); +#if Z_FEATURE_QUERYABLE == 1 + TEST(queryable) #endif - z_drop(z_move(str_null_1)); - z_drop(z_move(bytes_null_1)); - - z_drop(z_move(session_null_2)); - z_undeclare_publisher(z_move(publisher_null_2)); - z_drop(z_move(keyexpr_null_2)); - z_drop(z_move(config_null_2)); - z_undeclare_subscriber(z_move(subscriber_null_2)); - z_undeclare_queryable(z_move(queryable_null_2)); - z_drop(z_move(encoding_null_2)); - z_drop(z_move(reply_null_2)); - z_drop(z_move(hello_null_2)); - z_drop(z_move(closure_sample_null_2)); - z_drop(z_move(closure_query_null_2)); - z_drop(z_move(closure_reply_null_2)); - z_drop(z_move(closure_hello_null_2)); -#ifdef UNSTABLE - z_drop(z_move(closure_zid_null_2)); +#if Z_FEATURE_QUERY == 1 + TEST(reply) #endif - z_drop(z_move(str_null_2)); - z_drop(z_move(bytes_null_2)); - } + // Double drop not supported for these types + // TEST(task) + // TEST(mutex) + // TEST(condvar) return 0; -} +} \ No newline at end of file diff --git a/tests/z_api_shm_test.c b/tests/z_api_shm_test.c index a16697c9e..2b27eb8b0 100644 --- a/tests/z_api_shm_test.c +++ b/tests/z_api_shm_test.c @@ -39,15 +39,19 @@ return -200; \ } -int test_shm_buffer(z_owned_shm_mut_t* buf) { - ASSERT_CHECK(*buf); +int test_shm_buffer(z_moved_shm_mut_t mbuf) { + assert(mbuf._ptr != NULL); + z_owned_shm_mut_t buf; + z_take(&buf, mbuf); + assert(mbuf._ptr == NULL); + ASSERT_CHECK(buf); - { z_loaned_shm_mut_t* loaned = z_loan_mut(*buf); } + { z_loaned_shm_mut_t* loaned = z_loan_mut(buf); } z_owned_shm_t immut; - z_shm_from_mut(&immut, z_move(*buf)); + z_shm_from_mut(&immut, z_move(buf)); ASSERT_CHECK(immut); - ASSERT_CHECK_ERR(*buf); + assert(buf->_ptr == NULL); { const z_loaned_shm_t* loaned = z_loan(immut); } @@ -79,7 +83,7 @@ int test_shm_buffer(z_owned_shm_mut_t* buf) { return 0; } -bool test_layouted_allocation(const z_loaned_alloc_layout_t* alloc_layout) { +int test_layouted_allocation(const z_loaned_alloc_layout_t* alloc_layout) { z_buf_alloc_result_t alloc; z_owned_shm_mut_t shm_buf; @@ -88,12 +92,12 @@ bool test_layouted_allocation(const z_loaned_alloc_layout_t* alloc_layout) { if (z_alloc_layout_alloc_gc(&alloc, alloc_layout) == Z_OK) { ASSERT_OK(test_shm_buffer(z_move(alloc.buf))); ASSERT_CHECK_ERR(alloc.buf); - return true; + return Z_OK; } else - return false; + return Z_ENULL; } -bool test_allocation(const z_loaned_shm_provider_t* provider, size_t size, z_alloc_alignment_t alignment) { +int test_allocation(const z_loaned_shm_provider_t* provider, size_t size, z_alloc_alignment_t alignment) { z_buf_layout_alloc_result_t alloc; z_owned_shm_mut_t shm_buf; @@ -102,16 +106,16 @@ bool test_allocation(const z_loaned_shm_provider_t* provider, size_t size, z_all if (z_shm_provider_alloc_gc(&alloc, provider, size, alignment) == Z_OK) { ASSERT_OK(test_shm_buffer(z_move(alloc.buf))); ASSERT_CHECK_ERR(alloc.buf); - return true; + return Z_OK; } else - return false; + return Z_ENULL; } int test_provider(z_owned_shm_provider_t* provider, z_alloc_alignment_t alignment, size_t buf_ok_size, size_t buf_err_size) { // test allocation OK for (int i = 0; i < 100; ++i) { - ASSERT_TRUE(test_allocation(z_loan(*provider), buf_ok_size, alignment)); + ASSERT_OK(test_allocation(z_loan(*provider), buf_ok_size, alignment)); } // test allocation ERROR @@ -127,7 +131,7 @@ int test_provider(z_owned_shm_provider_t* provider, z_alloc_alignment_t alignmen ASSERT_CHECK(alloc_layout); // test layouted allocation OK for (int i = 0; i < 100; ++i) { - ASSERT_TRUE(test_layouted_allocation(z_loan(alloc_layout))); + ASSERT_OK(test_layouted_allocation(z_loan(alloc_layout))); } z_drop(z_move(alloc_layout)); ASSERT_CHECK_ERR(alloc_layout); @@ -240,7 +244,7 @@ void layout_for_fn(struct z_owned_memory_layout_t* layout, void* context) { z_memory_layout_get_data(&size, &alignment, z_loan(*layout)); if (size != 1 || alignment.pow != 0) { - z_memory_layout_drop(layout); + z_memory_layout_drop(z_move(*layout)); } } @@ -252,8 +256,8 @@ int run_c_provider() { test_provider_context test_context; test_context.available = size; test_context.count = size; - test_context.busy_flags = malloc(sizeof(bool) * size); - test_context.bytes = malloc(sizeof(uint8_t) * size); + test_context.busy_flags = (bool*)malloc(sizeof(bool) * size); + test_context.bytes = (uint8_t*)malloc(sizeof(uint8_t) * size); zc_context_t context = {&test_context, &delete_fn}; // init callbacks diff --git a/tests/z_api_unitinialized_check.c b/tests/z_api_unitinialized_check.c index 0908e7856..c27b14078 100644 --- a/tests/z_api_unitinialized_check.c +++ b/tests/z_api_unitinialized_check.c @@ -32,9 +32,9 @@ int main(int argc, char **argv) { z_view_keyexpr_t keyexpr; assert(z_view_keyexpr_from_str(&keyexpr, NULL) == Z_EINVAL); - assert(!z_check(keyexpr)); + assert(z_view_keyexpr_is_empty(&keyexpr)); z_view_keyexpr_from_str_unchecked(&keyexpr, NULL); - assert(!z_check(keyexpr)); + assert(z_view_keyexpr_is_empty(&keyexpr)); z_view_keyexpr_from_substr_unchecked(&keyexpr, NULL, 0); - assert(!z_check(keyexpr)); + assert(z_view_keyexpr_is_empty(&keyexpr)); } diff --git a/tests/z_int_pub_sub_attachment_test.c b/tests/z_int_pub_sub_attachment_test.c index 5cd81f758..6d49f34cf 100644 --- a/tests/z_int_pub_sub_attachment_test.c +++ b/tests/z_int_pub_sub_attachment_test.c @@ -119,7 +119,7 @@ int run_publisher() { kv_it it = {kvs, kvs + 2}; z_bytes_from_iter(&attachment, create_attachment_iter, (void *)&it); - options.attachment = &attachment; + options.attachment = z_move(attachment); z_owned_bytes_t payload; z_bytes_from_static_str(&payload, values[i]); diff --git a/tests/z_int_pub_sub_test.c b/tests/z_int_pub_sub_test.c index 9e883e994..3195b53b3 100644 --- a/tests/z_int_pub_sub_test.c +++ b/tests/z_int_pub_sub_test.c @@ -67,7 +67,7 @@ int run_publisher() { z_publisher_put_options_t options; z_publisher_put_options_default(&options); - // options.source_info = &source_info; + // options.source_info = z_move(source_info); options.timestamp = &ts; z_owned_bytes_t payload; diff --git a/tests/z_int_queryable_attachment_test.c b/tests/z_int_queryable_attachment_test.c index 55f2681b5..461179216 100644 --- a/tests/z_int_queryable_attachment_test.c +++ b/tests/z_int_queryable_attachment_test.c @@ -113,7 +113,7 @@ void query_handler(const z_loaned_query_t *query, void *context) { kv_it it_out = {.current = kvs_out, .end = kvs_out + 1}; z_bytes_from_iter(&reply_attachment, create_attachment_iter, (void *)&it_out); - options.attachment = &reply_attachment; + options.attachment = z_move(reply_attachment); z_owned_bytes_t payload; z_bytes_from_static_str(&payload, values[value_num]); @@ -137,7 +137,7 @@ int run_queryable() { } z_owned_closure_query_t callback; - z_closure(&callback, query_handler, NULL, keyexpr); + z_closure(&callback, query_handler, NULL, (void *)keyexpr); z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); @@ -187,7 +187,7 @@ int run_get() { kv_it it = {.current = kvs, .end = kvs + 2}; z_bytes_from_iter(&attachment, create_attachment_iter, (void *)&it); - opts.attachment = &attachment; + opts.attachment = z_move(attachment); z_get(z_loan(s), z_loan(ke), "", z_move(closure), &opts); z_owned_reply_t reply; for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) { diff --git a/tests/z_int_queryable_test.c b/tests/z_int_queryable_test.c index 7446272c8..a62875b1c 100644 --- a/tests/z_int_queryable_test.c +++ b/tests/z_int_queryable_test.c @@ -45,7 +45,7 @@ void query_handler(const z_loaned_query_t *query, void *context) { // z_owned_source_info_t source_info; // z_source_info_new(&source_info, &entity_global_id, TEST_SN); - // options.source_info = &source_info; + // options.source_info = z_move(source_info); z_owned_bytes_t payload; z_bytes_from_static_str(&payload, values[value_num]); @@ -71,7 +71,7 @@ int run_queryable() { z_view_keyexpr_t ke; z_view_keyexpr_from_str(&ke, keyexpr); z_owned_closure_query_t callback; - z_closure(&callback, query_handler, NULL, keyexpr); + z_closure(&callback, query_handler, NULL, (void *)keyexpr); z_owned_queryable_t qable; ; if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) != Z_OK) { From 3f0f9d8e873081595416e5803f640e42fa322759 Mon Sep 17 00:00:00 2001 From: Yuyuan Yuan Date: Tue, 13 Aug 2024 02:36:17 +0800 Subject: [PATCH 067/397] fix: use `z_move` in shm examples (#589) --- examples/z_get_shm.c | 4 ++-- examples/z_pub_shm.c | 4 ++-- examples/z_queryable_shm.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/z_get_shm.c b/examples/z_get_shm.c index 99e3f61e3..cbb183c1a 100644 --- a/examples/z_get_shm.c +++ b/examples/z_get_shm.c @@ -103,7 +103,7 @@ int main(int argc, char** argv) { printf("Unexpected failure during SHM buffer serialization...\n"); return -1; } - opts.payload = &payload; + opts.payload = z_move(payload); } z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure), &opts); // here, the send is moved and will be dropped by zenoh when adequate @@ -135,4 +135,4 @@ int main(int argc, char** argv) { z_drop(z_move(provider)); z_drop(z_move(layout)); return 0; -} \ No newline at end of file +} diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index bf43406c1..4c814e882 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -115,7 +115,7 @@ int main(int argc, char **argv) { z_publisher_put_options_default(&options); z_owned_bytes_t payload; - z_bytes_serialize_from_shm_mut(&payload, &alloc.buf); + z_bytes_serialize_from_shm_mut(&payload, z_move(alloc.buf)); z_publisher_put(z_loan(pub), z_move(payload), &options); } else { @@ -137,4 +137,4 @@ int main(int argc, char **argv) { z_drop(z_move(layout)); return 0; -} \ No newline at end of file +} diff --git a/examples/z_queryable_shm.c b/examples/z_queryable_shm.c index fbf68c80a..28a0c4195 100644 --- a/examples/z_queryable_shm.c +++ b/examples/z_queryable_shm.c @@ -62,7 +62,7 @@ void query_handler(const z_loaned_query_t *query, void *context) { z_query_reply_options_default(&options); z_owned_bytes_t reply_payload; - z_bytes_serialize_from_shm_mut(&reply_payload, &alloc.buf); + z_bytes_serialize_from_shm_mut(&reply_payload, z_move(alloc.buf)); z_view_keyexpr_t reply_keyexpr; z_view_keyexpr_from_str(&reply_keyexpr, (const char *)context); From 14133431b7a82743c0fd05ae51f5ff87c858cd02 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Tue, 13 Aug 2024 02:37:56 +0200 Subject: [PATCH 068/397] build: Sync with eclipse-zenoh/zenoh@e66745e from 2024-08-12 (#591) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8da0a9f00..091f281ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2987,7 +2987,7 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "ahash", "async-trait", @@ -3038,7 +3038,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "zenoh-collections", ] @@ -3070,7 +3070,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "serde", "tracing", @@ -3083,12 +3083,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "flume", "json5", @@ -3108,7 +3108,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-global-executor", "lazy_static", @@ -3120,7 +3120,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "aes", "hmac", @@ -3133,7 +3133,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "bincode", "flume", @@ -3154,7 +3154,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "hashbrown 0.14.0", "keyed-set", @@ -3168,7 +3168,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "zenoh-config", @@ -3186,7 +3186,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "flume", @@ -3210,7 +3210,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "base64", @@ -3239,7 +3239,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "tokio", @@ -3257,7 +3257,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "base64", @@ -3285,7 +3285,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "futures", @@ -3326,7 +3326,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "futures-util", @@ -3347,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "proc-macro2", "quote", @@ -3358,7 +3358,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "const_format", "libloading", @@ -3374,7 +3374,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "const_format", "rand", @@ -3388,7 +3388,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "anyhow", ] @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "futures", "lazy_static", @@ -3412,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "serde", "shared_memory", @@ -3424,7 +3424,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "event-listener 4.0.0", "futures", @@ -3438,7 +3438,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "futures", "tokio", @@ -3451,7 +3451,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-trait", "flume", @@ -3484,7 +3484,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#fef38dce9c33336dcd9d1d0ae8baec57aa3c1aee" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" dependencies = [ "async-std", "async-trait", From 4859ca8f8114e4b022a188a7e21e2eaa62deb591 Mon Sep 17 00:00:00 2001 From: yellowhatter <104833606+yellowhatter@users.noreply.github.com> Date: Tue, 13 Aug 2024 15:13:37 +0300 Subject: [PATCH 069/397] fix tests and examples for SHM (#592) --- examples/z_ping_shm.c | 1 - tests/z_api_shm_test.c | 19 +++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/examples/z_ping_shm.c b/examples/z_ping_shm.c index f5bd203bf..4d9ec30fc 100644 --- a/examples/z_ping_shm.c +++ b/examples/z_ping_shm.c @@ -140,7 +140,6 @@ int main(int argc, char** argv) { } z_mutex_unlock(z_loan_mut(mutex)); z_free(results); - z_free(data); z_undeclare_subscriber(z_move(sub)); z_undeclare_publisher(z_move(pub)); z_drop(z_move(mutex)); diff --git a/tests/z_api_shm_test.c b/tests/z_api_shm_test.c index 2b27eb8b0..1a06e29d4 100644 --- a/tests/z_api_shm_test.c +++ b/tests/z_api_shm_test.c @@ -21,6 +21,12 @@ return result; \ } +#define ASSERT_ERR(result) \ + if (result == Z_OK) { \ + assert(false); \ + return result; \ + } + #define ASSERT_TRUE(expr) \ if (!(expr)) { \ assert(false); \ @@ -43,7 +49,7 @@ int test_shm_buffer(z_moved_shm_mut_t mbuf) { assert(mbuf._ptr != NULL); z_owned_shm_mut_t buf; z_take(&buf, mbuf); - assert(mbuf._ptr == NULL); + ASSERT_CHECK_ERR(*mbuf._ptr); ASSERT_CHECK(buf); { z_loaned_shm_mut_t* loaned = z_loan_mut(buf); } @@ -51,7 +57,6 @@ int test_shm_buffer(z_moved_shm_mut_t mbuf) { z_owned_shm_t immut; z_shm_from_mut(&immut, z_move(buf)); ASSERT_CHECK(immut); - assert(buf->_ptr == NULL); { const z_loaned_shm_t* loaned = z_loan(immut); } @@ -89,7 +94,8 @@ int test_layouted_allocation(const z_loaned_alloc_layout_t* alloc_layout) { z_owned_shm_mut_t shm_buf; z_alloc_error_t shm_error; - if (z_alloc_layout_alloc_gc(&alloc, alloc_layout) == Z_OK) { + z_alloc_layout_alloc_gc(&alloc, alloc_layout); + if (z_check(alloc.buf)) { ASSERT_OK(test_shm_buffer(z_move(alloc.buf))); ASSERT_CHECK_ERR(alloc.buf); return Z_OK; @@ -103,7 +109,8 @@ int test_allocation(const z_loaned_shm_provider_t* provider, size_t size, z_allo z_owned_shm_mut_t shm_buf; z_alloc_error_t shm_error; - if (z_shm_provider_alloc_gc(&alloc, provider, size, alignment) == Z_OK) { + z_shm_provider_alloc_gc(&alloc, provider, size, alignment); + if (z_check(alloc.buf)) { ASSERT_OK(test_shm_buffer(z_move(alloc.buf))); ASSERT_CHECK_ERR(alloc.buf); return Z_OK; @@ -120,7 +127,7 @@ int test_provider(z_owned_shm_provider_t* provider, z_alloc_alignment_t alignmen // test allocation ERROR if (buf_err_size) { - ASSERT_TRUE(!test_allocation(z_loan(*provider), buf_err_size, alignment)); + ASSERT_ERR(test_allocation(z_loan(*provider), buf_err_size, alignment)); } // OK layouted allocations @@ -144,7 +151,7 @@ int test_provider(z_owned_shm_provider_t* provider, z_alloc_alignment_t alignmen ASSERT_OK(z_alloc_layout_new(&alloc_layout, z_loan(*provider), buf_err_size, alignment)); ASSERT_CHECK(alloc_layout); // test layouted allocation ERROR - ASSERT_TRUE(!test_layouted_allocation(z_loan(alloc_layout))); + ASSERT_ERR(test_layouted_allocation(z_loan(alloc_layout))); z_drop(z_move(alloc_layout)); ASSERT_CHECK_ERR(alloc_layout); } From d24b99883b6ef8dd13542857e1efdfec2ba0d99e Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 14 Aug 2024 16:02:22 +0300 Subject: [PATCH 070/397] SHM is now enabled by default in the Config, so no need to set it explicitly in examples --- examples/z_get_shm.c | 10 ---------- examples/z_ping_shm.c | 10 ---------- examples/z_pong.c | 12 ------------ examples/z_pub_shm.c | 11 ----------- examples/z_pub_shm_thr.c | 11 ----------- examples/z_queryable_shm.c | 10 ---------- examples/z_sub.c | 13 ------------- examples/z_sub_shm.c | 13 ------------- examples/z_sub_thr.c | 14 +------------- 9 files changed, 1 insertion(+), 103 deletions(-) diff --git a/examples/z_get_shm.c b/examples/z_get_shm.c index cbb183c1a..48ee8587b 100644 --- a/examples/z_get_shm.c +++ b/examples/z_get_shm.c @@ -40,16 +40,6 @@ int main(int argc, char** argv) { z_owned_config_t config; z_config_default(&config); - // A probing procedure for shared memory is performed upon session opening. To operate over shared memory - // (and to not fallback on network mode), shared memory needs to be enabled in the configuration. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } - if (argc > 3) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { printf( diff --git a/examples/z_ping_shm.c b/examples/z_ping_shm.c index 4d9ec30fc..085a617b0 100644 --- a/examples/z_ping_shm.c +++ b/examples/z_ping_shm.c @@ -54,16 +54,6 @@ int main(int argc, char** argv) { z_config_default(&config); } - // A probing procedure for shared memory is performed upon session opening. To operate over shared memory - // (and to not fallback on network mode), shared memory needs to be enabled in the configuration. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } - z_owned_session_t session; z_open(&session, z_move(config)); z_view_keyexpr_t ping; diff --git a/examples/z_pong.c b/examples/z_pong.c index ccf3d1d62..e3a312035 100644 --- a/examples/z_pong.c +++ b/examples/z_pong.c @@ -38,18 +38,6 @@ int main(int argc, char** argv) { z_config_default(&config); } -#ifdef SHARED_MEMORY - // A probing procedure for shared memory is performed upon session opening. To operate over shared memory - // (and to not fallback on network mode), shared memory needs to be enabled in the configuration. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } -#endif - z_owned_session_t session; z_open(&session, z_move(config)); z_view_keyexpr_t ping; diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 4c814e882..7c0098912 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -38,17 +38,6 @@ int main(int argc, char **argv) { z_owned_config_t config; z_config_default(&config); - // A probing procedure for shared memory is performed upon session opening. To enable `z_pub_shm` to operate - // over shared memory (and to not fallback on network mode), shared memory needs to be enabled also on the - // subscriber side. By doing so, the probing procedure will succeed and shared memory will operate as expected. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } - if (argc > 4) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[4]) < 0) { printf( diff --git a/examples/z_pub_shm_thr.c b/examples/z_pub_shm_thr.c index af0b4a564..cc6d413a8 100644 --- a/examples/z_pub_shm_thr.c +++ b/examples/z_pub_shm_thr.c @@ -28,17 +28,6 @@ int main(int argc, char **argv) { z_owned_config_t config; z_config_default(&config); - // A probing procedure for shared memory is performed upon session opening. To enable `z_pub_shm` to operate - // over shared memory (and to not fallback on network mode), shared memory needs to be enabled also on the - // subscriber side. By doing so, the probing procedure will succeed and shared memory will operate as expected. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } - if (argc > 2) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { printf( diff --git a/examples/z_queryable_shm.c b/examples/z_queryable_shm.c index 28a0c4195..e59eca281 100644 --- a/examples/z_queryable_shm.c +++ b/examples/z_queryable_shm.c @@ -91,16 +91,6 @@ int main(int argc, char **argv) { } } - // A probing procedure for shared memory is performed upon session opening. To operate over shared memory - // (and to not fallback on network mode), shared memory needs to be enabled in the configuration. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } - printf("Opening session...\n"); z_owned_session_t s; if (z_open(&s, z_move(config))) { diff --git a/examples/z_sub.c b/examples/z_sub.c index d584fd321..07ae9111b 100644 --- a/examples/z_sub.c +++ b/examples/z_sub.c @@ -42,19 +42,6 @@ int main(int argc, char **argv) { z_owned_config_t config; z_config_default(&config); -#ifdef SHARED_MEMORY - // A probing procedure for shared memory is performed upon session opening. To enable `z_pub_shm` to operate - // over shared memory (and to not fallback on network mode), shared memory needs to be enabled also on the - // subscriber side. By doing so, the probing procedure will succeed and shared memory will operate as expected. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } -#endif - if (argc > 2) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { printf( diff --git a/examples/z_sub_shm.c b/examples/z_sub_shm.c index b48298d51..8d9006846 100644 --- a/examples/z_sub_shm.c +++ b/examples/z_sub_shm.c @@ -64,19 +64,6 @@ int main(int argc, char **argv) { z_owned_config_t config; z_config_default(&config); -#ifdef SHARED_MEMORY - // A probing procedure for shared memory is performed upon session opening. To enable `z_pub_shm` to operate - // over shared memory (and to not fallback on network mode), shared memory needs to be enabled also on the - // subscriber side. By doing so, the probing procedure will succeed and shared memory will operate as expected. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } -#endif - if (argc > 2) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { printf( diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 80c455ef6..52d23fb22 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -62,19 +62,7 @@ void drop_stats(void *context) { int main(int argc, char **argv) { z_owned_config_t config; z_config_default(&config); - -#ifdef SHARED_MEMORY - // A probing procedure for shared memory is performed upon session opening. To operate over shared memory - // (and to not fallback on network mode), shared memory needs to be enabled in the configuration. - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { - printf( - "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized value\n", - Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); - exit(-1); - } -#endif - + if (argc > 1) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[1]) < 0) { printf( From 9938aaee0223da2785468dfebc9a8300e5f20fc8 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:32:31 +0200 Subject: [PATCH 071/397] build: Sync with eclipse-zenoh/zenoh@0e2f78a from 2024-08-14 (#596) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 1296 ++++++++++++----------- build-resources/opaque-types/Cargo.lock | 54 +- include/zenoh_commons.h | 515 +++++---- include/zenoh_macros.h | 356 +------ 4 files changed, 1066 insertions(+), 1155 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdd61aca9..246aca820 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.8.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if", "cipher", @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom", @@ -43,18 +43,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-tzdata" @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "array-init" @@ -85,9 +85,9 @@ checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" [[package]] name = "asn1-rs" -version = "0.6.2" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5493c3bedbacf7fd7382c6346bbd66687d12bbaad3a89a2d2c303ee6cf20b048" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" dependencies = [ "asn1-rs-derive", "asn1-rs-impl", @@ -101,13 +101,13 @@ dependencies = [ [[package]] name = "asn1-rs-derive" -version = "0.5.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", "synstructure", ] @@ -119,7 +119,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] @@ -133,43 +133,32 @@ dependencies = [ "futures-core", ] -[[package]] -name = "async-channel" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-executor" -version = "1.13.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" dependencies = [ + "async-lock", "async-task", "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", + "fastrand 1.9.0", + "futures-lite", "slab", ] [[package]] name = "async-global-executor" -version = "2.4.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" dependencies = [ - "async-channel 2.3.1", + "async-channel", "async-executor", - "async-io 2.3.3", - "async-lock 3.4.0", + "async-io", + "async-lock", "blocking", - "futures-lite 2.3.0", + "futures-lite", "once_cell", "tokio", ] @@ -180,39 +169,20 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock 2.8.0", + "async-lock", "autocfg", "cfg-if", "concurrent-queue", - "futures-lite 1.13.0", + "futures-lite", "log", "parking", - "polling 2.8.0", - "rustix 0.37.27", + "polling", + "rustix 0.37.25", "slab", - "socket2 0.4.10", + "socket2 0.4.9", "waker-fn", ] -[[package]] -name = "async-io" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" -dependencies = [ - "async-lock 3.4.0", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite 2.3.0", - "parking", - "polling 3.7.2", - "rustix 0.38.34", - "slab", - "tracing", - "windows-sys 0.52.0", -] - [[package]] name = "async-lock" version = "2.8.0" @@ -222,32 +192,21 @@ dependencies = [ "event-listener 2.5.3", ] -[[package]] -name = "async-lock" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" -dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", - "pin-project-lite", -] - [[package]] name = "async-std" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ - "async-channel 1.9.0", + "async-channel", "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", + "async-io", + "async-lock", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite 1.13.0", + "futures-lite", "gloo-timers", "kv-log-macro", "log", @@ -261,26 +220,26 @@ dependencies = [ [[package]] name = "async-task" -version = "4.7.1" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "atomic-waker" -version = "1.1.2" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" [[package]] name = "atty" @@ -295,15 +254,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -316,9 +275,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64" @@ -349,9 +308,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" dependencies = [ "serde", ] @@ -367,34 +326,36 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" dependencies = [ - "async-channel 2.3.1", + "async-channel", + "async-lock", "async-task", - "futures-io", - "futures-lite 2.3.0", - "piper", + "atomic-waker", + "fastrand 1.9.0", + "futures-lite", + "log", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.5.0" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.7.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cache-padded" @@ -423,9 +384,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.8" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cesu8" @@ -456,7 +420,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-targets 0.52.0", ] [[package]] @@ -514,9 +478,9 @@ dependencies = [ [[package]] name = "const-oid" -version = "0.9.6" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const_format" @@ -556,33 +520,36 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.2.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.4.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] [[package]] name = "crypto-common" @@ -596,15 +563,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "der" -version = "0.7.9" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "pem-rfc7468", @@ -669,20 +636,20 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "dyn-clone" -version = "1.0.17" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "either" @@ -698,9 +665,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", @@ -729,16 +696,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" -dependencies = [ - "event-listener 5.3.1", - "pin-project-lite", -] - [[package]] name = "fastrand" version = "1.9.0" @@ -750,9 +707,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "fixedbitset" @@ -769,7 +726,7 @@ dependencies = [ "futures-core", "futures-sink", "nanorand", - "spin", + "spin 0.9.8", ] [[package]] @@ -805,9 +762,9 @@ checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -820,9 +777,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -830,15 +787,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -847,9 +804,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -866,47 +823,34 @@ dependencies = [ "waker-fn", ] -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand 2.1.0", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -932,9 +876,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "js-sys", @@ -945,28 +889,30 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "git-version" -version = "0.3.9" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad568aa3db0fcbc81f2f116137f263d7304f512a1209b35b85150d3ef88ad19" +checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" dependencies = [ "git-version-macro", + "proc-macro-hack", ] [[package]] name = "git-version-macro" -version = "0.3.9" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53010ccb100b96a67bc32c0175f0ed1426b31b655d562898e57325f81c023ac0" +checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" dependencies = [ + "proc-macro-hack", "proc-macro2", "quote", - "syn 2.0.72", + "syn 1.0.109", ] [[package]] @@ -983,9 +929,9 @@ dependencies = [ [[package]] name = "half" -version = "1.8.3" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" @@ -1020,15 +966,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - -[[package]] -name = "hermit-abi" -version = "0.4.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hmac" @@ -1041,18 +981,18 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "http" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ "bytes", "fnv", @@ -1061,9 +1001,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "humantime" @@ -1073,16 +1013,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows 0.48.0", ] [[package]] @@ -1094,14 +1034,134 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -1116,9 +1176,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1135,9 +1195,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] @@ -1148,7 +1208,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.3.2", "libc", "windows-sys 0.48.0", ] @@ -1179,9 +1239,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jni" @@ -1205,9 +1265,9 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1225,9 +1285,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.5" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ "cpufeatures", ] @@ -1252,11 +1312,11 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.5.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "spin", + "spin 0.5.2", ] [[package]] @@ -1267,29 +1327,19 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-sys 0.48.0", ] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.6.0", - "libc", -] +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" [[package]] name = "linux-raw-sys" @@ -1299,15 +1349,21 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "litemap" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -1324,18 +1380,18 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" dependencies = [ "value-bag", ] [[package]] name = "lz4_flex" -version = "0.11.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" +checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" dependencies = [ "twox-hash", ] @@ -1372,23 +1428,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "1.0.1" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -1419,7 +1474,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if", "libc", ] @@ -1452,10 +1507,11 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ + "autocfg", "num-integer", "num-traits", ] @@ -1505,9 +1561,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -1519,15 +1575,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.9", + "hermit-abi 0.3.2", "libc", ] [[package]] name = "object" -version = "0.36.3" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -1561,9 +1617,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.2.2" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" +checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" dependencies = [ "num-traits", ] @@ -1588,9 +1644,9 @@ checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" [[package]] name = "parking" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" [[package]] name = "parking_lot" @@ -1619,9 +1675,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "pem-rfc7468" @@ -1640,9 +1696,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.11" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" dependencies = [ "memchr", "thiserror", @@ -1651,9 +1707,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.11" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" dependencies = [ "pest", "pest_generator", @@ -1661,22 +1717,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.11" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "pest_meta" -version = "2.7.11" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" dependencies = [ "once_cell", "pest", @@ -1685,12 +1741,12 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.3.0", + "indexmap 2.0.0", ] [[package]] @@ -1723,7 +1779,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] @@ -1737,9 +1793,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -1747,17 +1803,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" -dependencies = [ - "atomic-waker", - "fastrand 2.1.0", - "futures-io", -] - [[package]] name = "pkcs1" version = "0.7.5" @@ -1827,21 +1872,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "polling" -version = "3.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi 0.4.0", - "pin-project-lite", - "rustix 0.38.34", - "tracing", - "windows-sys 0.52.0", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -1850,12 +1880,9 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" -dependencies = [ - "zerocopy", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro-crate" @@ -1866,20 +1893,26 @@ dependencies = [ "toml_edit", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quinn" -version = "0.11.3" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", "pin-project-lite", @@ -1887,7 +1920,6 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", - "socket2 0.5.7", "thiserror", "tokio", "tracing", @@ -1895,9 +1927,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand", @@ -1913,22 +1945,22 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", - "socket2 0.5.7", + "socket2 0.5.6", "tracing", "windows-sys 0.52.0", ] [[package]] name = "quote" -version = "1.0.36" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1974,20 +2006,20 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "libredox", + "redox_syscall", "thiserror", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -2029,17 +2061,16 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ring" -version = "0.17.8" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" dependencies = [ "cc", - "cfg-if", "getrandom", "libc", - "spin", + "spin 0.9.8", "untrusted", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -2058,22 +2089,24 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ - "base64 0.21.7", - "bitflags 2.6.0", + "base64 0.21.4", + "bitflags 2.5.0", "serde", "serde_derive", ] [[package]] name = "rsa" -version = "0.9.6" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" dependencies = [ + "byteorder", "const-oid", "digest", "num-bigint-dig", "num-integer", + "num-iter", "num-traits", "pkcs1", "pkcs8", @@ -2086,15 +2119,15 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" @@ -2116,9 +2149,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.27" +version = "0.37.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" dependencies = [ "bitflags 1.3.2", "errno", @@ -2130,22 +2163,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ "log", "once_cell", @@ -2158,9 +2191,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -2171,25 +2204,25 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" dependencies = [ - "base64 0.22.1", + "base64 0.21.4", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-platform-verifier" -version = "0.3.3" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bda3f493b9abe5b93b3e7e3ecde0df292f2bd28c0296b90586ee0055ff5123" +checksum = "b5f0d26fa1ce3c790f9590868f0109289a044acb954525f933e2aa3b871c157d" dependencies = [ "core-foundation", "core-foundation-sys", @@ -2208,15 +2241,15 @@ dependencies = [ [[package]] name = "rustls-platform-verifier-android" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" +checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", "rustls-pki-types", @@ -2225,15 +2258,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -2246,18 +2279,18 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "schemars" -version = "0.8.21" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" dependencies = [ "dyn-clone", "either", @@ -2268,14 +2301,14 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "0.8.21" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.72", + "syn 1.0.109", ] [[package]] @@ -2296,11 +2329,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -2310,9 +2343,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -2320,15 +2353,15 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.205" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -2358,45 +2391,44 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.205" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "serde_derive_internals" -version = "0.29.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 1.0.109", ] [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", - "memchr", "ryu", "serde", ] [[package]] name = "serde_yaml" -version = "0.9.34+deprecated" +version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.0.0", "itoa", "ryu", "serde", @@ -2405,9 +2437,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.6" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", @@ -2416,9 +2448,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", @@ -2474,9 +2506,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.2.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" dependencies = [ "digest", "rand_core", @@ -2505,9 +2537,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.10" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2515,14 +2547,20 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", "windows-sys 0.52.0", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.8" @@ -2534,9 +2572,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", "der", @@ -2544,9 +2582,9 @@ dependencies = [ [[package]] name = "stabby" -version = "5.1.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71dafe1facecf85bb802989436421475290d4351bcb2f7e3453598d0ad23182c" +checksum = "c7708f5b0e8bddba162d20fa10c8d17c31a2ec6bba369f7904bb18a8bde49ba2" dependencies = [ "lazy_static", "rustversion", @@ -2555,9 +2593,9 @@ dependencies = [ [[package]] name = "stabby-abi" -version = "5.1.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edf9151d4c625c05bebeb90a61b48861df35a43b7083bdae1ad41fe754236f88" +checksum = "1a6e7a8b2ff2c116bfab6afcce0adec14509eb38fd3f231bb97826d01de4021e" dependencies = [ "libc", "rustversion", @@ -2567,9 +2605,9 @@ dependencies = [ [[package]] name = "stabby-macros" -version = "5.1.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7520c91a07eb1568a79c69d3ddc7c0e8f475cf2940602e162736ce4b16bc31" +checksum = "db97bd3101fab9929a08fa0138d30d46c7a80b9d32bc8a3a00706ba00358a275" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2578,6 +2616,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -2618,7 +2662,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af91f480ee899ab2d9f8435bfdfc14d08a5754bd9d3fef1f1a1c23336aad6c8b" dependencies = [ - "async-channel 1.9.0", + "async-channel", "cfg-if", "futures-core", "pin-project-lite", @@ -2632,9 +2676,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.6.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -2649,9 +2693,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -2666,20 +2710,19 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "tempfile" -version = "3.12.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "once_cell", - "rustix 0.38.34", - "windows-sys 0.59.0", + "fastrand 2.0.2", + "rustix 0.38.32", + "windows-sys 0.52.0", ] [[package]] @@ -2699,22 +2742,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] @@ -2723,7 +2766,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d3b04d33c9633b8662b167b847c7ab521f83d1ae20f2321b65b5b925e532e36" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.5.0", "cfg-if", "libc", "log", @@ -2772,11 +2815,21 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -2798,29 +2851,30 @@ dependencies = [ [[package]] name = "tokio" -version = "1.39.2" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", "libc", "mio", + "num_cpus", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.5.6", "tokio-macros", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] @@ -2848,9 +2902,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2872,9 +2926,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" @@ -2882,17 +2936,18 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.3.0", + "indexmap 2.0.0", "toml_datetime", "winnow", ] [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2901,20 +2956,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -2992,9 +3047,9 @@ dependencies = [ [[package]] name = "typenum" -version = "1.17.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "ucd-trie" @@ -3013,30 +3068,15 @@ dependencies = [ "log", "rand", "serde", - "spin", + "spin 0.9.8", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-xid" version = "0.2.4" @@ -3045,9 +3085,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" -version = "0.2.11" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "untrusted" @@ -3074,9 +3114,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -3089,11 +3129,23 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" -version = "1.10.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom", ] @@ -3130,9 +3182,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.9.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" [[package]] name = "vec_map" @@ -3142,21 +3194,21 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.5" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.2.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" [[package]] name = "walkdir" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -3170,9 +3222,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3180,24 +3232,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -3207,9 +3259,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3217,28 +3269,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -3246,9 +3298,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" dependencies = [ "rustls-pki-types", ] @@ -3259,7 +3311,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b7b128a98c1cfa201b09eb49ba285887deb3cbe7466a98850eb1adabb452be5" dependencies = [ - "windows", + "windows 0.34.0", ] [[package]] @@ -3280,11 +3332,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.9" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "windows-sys 0.59.0", + "winapi", ] [[package]] @@ -3307,12 +3359,12 @@ dependencies = [ ] [[package]] -name = "windows-core" -version = "0.52.0" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -3330,16 +3382,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets 0.52.6", + "windows-targets 0.52.0", ] [[package]] @@ -3359,18 +3402,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -3381,9 +3423,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -3399,9 +3441,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -3417,15 +3459,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -3441,9 +3477,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -3459,9 +3495,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -3471,9 +3507,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -3489,9 +3525,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.6" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" @@ -3502,6 +3538,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "x509-parser" version = "0.16.0" @@ -3519,10 +3567,34 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", +] + [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "ahash", "async-trait", @@ -3548,7 +3620,7 @@ dependencies = [ "serde_cbor", "serde_json", "serde_yaml", - "socket2 0.5.7", + "socket2 0.5.6", "stop-token", "tokio", "tokio-util", @@ -3580,7 +3652,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "zenoh-collections", ] @@ -3606,7 +3678,7 @@ dependencies = [ "rand", "regex", "serde_yaml", - "spin", + "spin 0.9.8", "tracing", "unwrap-infallible", "zenoh", @@ -3618,7 +3690,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "serde", "tracing", @@ -3631,12 +3703,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "flume", "json5", @@ -3658,7 +3730,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-global-executor", "lazy_static", @@ -3670,7 +3742,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "aes", "hmac", @@ -3683,7 +3755,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "bincode", "flume", @@ -3702,7 +3774,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3716,7 +3788,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "zenoh-config", @@ -3734,7 +3806,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -3759,7 +3831,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3790,10 +3862,10 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", - "socket2 0.5.7", + "socket2 0.5.6", "tokio", "tokio-util", "tracing", @@ -3809,7 +3881,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3819,7 +3891,7 @@ dependencies = [ "rustls-pki-types", "rustls-webpki", "secrecy", - "socket2 0.5.7", + "socket2 0.5.6", "tokio", "tokio-rustls", "tokio-util", @@ -3840,10 +3912,10 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", - "socket2 0.5.7", + "socket2 0.5.6", "tokio", "tokio-util", "tracing", @@ -3861,7 +3933,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures", @@ -3881,7 +3953,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures-util", @@ -3902,18 +3974,18 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", "zenoh-keyexpr", ] [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "libloading", "serde", @@ -3928,7 +4000,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "const_format", "rand", @@ -3943,7 +4015,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "anyhow", ] @@ -3951,7 +4023,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "lazy_static", @@ -3966,7 +4038,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "bincode", @@ -3990,7 +4062,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "event-listener 5.3.1", "futures", @@ -4004,7 +4076,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "tokio", @@ -4017,7 +4089,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -4050,7 +4122,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "const_format", @@ -4074,27 +4146,69 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.52", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index c51674665..bf01256ac 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3286,7 +3286,7 @@ dependencies = [ [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "ahash", "async-trait", @@ -3344,7 +3344,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "zenoh-collections", ] @@ -3352,7 +3352,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "serde", "tracing", @@ -3365,12 +3365,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "flume", "json5", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-global-executor", "lazy_static", @@ -3404,7 +3404,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "aes", "hmac", @@ -3417,7 +3417,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "bincode", "flume", @@ -3436,7 +3436,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "hashbrown", "keyed-set", @@ -3450,7 +3450,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "zenoh-config", @@ -3468,7 +3468,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -3493,7 +3493,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3524,7 +3524,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3543,7 +3543,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3595,7 +3595,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures", @@ -3615,7 +3615,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures-util", @@ -3636,7 +3636,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "proc-macro2", "quote", @@ -3647,7 +3647,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "libloading", "serde", @@ -3662,7 +3662,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "const_format", "rand", @@ -3677,7 +3677,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "anyhow", ] @@ -3685,7 +3685,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "lazy_static", @@ -3700,7 +3700,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "bincode", @@ -3724,7 +3724,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "event-listener 5.3.1", "futures", @@ -3738,7 +3738,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "tokio", @@ -3751,7 +3751,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -3784,7 +3784,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "const_format", diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 24bb9d9bd..57c83bb97 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,6 +16,26 @@ #define ALIGN(n) #define ZENOHC_API #endif +/** + * Allocation errors + * + * - **NEED_DEFRAGMENT**: defragmentation needed + * - **OUT_OF_MEMORY**: the provider is out of memory + * - **OTHER**: other error + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_alloc_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_NEED_DEFRAGMENT, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OUT_OF_MEMORY, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OTHER, +#endif +} z_alloc_error_t; +#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -76,6 +96,22 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif +/** + * Layouting errors + * + * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect + * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_layout_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, +#endif +} z_layout_error_t; +#endif /** * The priority of zenoh messages. */ @@ -230,10 +266,47 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -typedef struct z_moved_alloc_layout_t { - struct z_owned_alloc_layout_t *_ptr; -} z_moved_alloc_layout_t; +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_alloc_result_t { + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif typedef int8_t z_result_t; +/** + * An AllocAlignment. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t *_ptr; } z_moved_bytes_t; @@ -243,15 +316,37 @@ typedef struct z_moved_slice_t { typedef struct z_moved_string_t { struct z_owned_string_t *_ptr; } z_moved_string_t; -typedef struct z_moved_shm_t { - struct z_owned_shm_t *_ptr; -} z_moved_shm_t; -typedef struct z_moved_shm_mut_t { - struct z_owned_shm_mut_t *_ptr; -} z_moved_shm_mut_t; -typedef struct z_moved_chunk_alloc_result_t { - struct z_owned_chunk_alloc_result_t *_ptr; -} z_moved_chunk_alloc_result_t; +/** + * Unique segment identifier + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_segment_id_t; +#endif +/** + * Chunk id within it's segment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * A ChunkDescriptor + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * An AllocatedChunk + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif /** * Monotonic clock */ @@ -402,7 +497,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const struct z_id_t *z_id, void *context); + void (*call)(const z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -513,9 +608,6 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; -typedef struct z_moved_source_info_t { - struct z_owned_source_info_t *_ptr; -} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -564,7 +656,7 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t source_info; #endif /** * An optional attachment to attach to the query. @@ -581,9 +673,6 @@ typedef struct z_moved_hello_t { typedef struct z_moved_keyexpr_t { struct z_owned_keyexpr_t *_ptr; } z_moved_keyexpr_t; -typedef struct z_moved_memory_layout_t { - struct z_owned_memory_layout_t *_ptr; -} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t *_ptr; } z_moved_mutex_t; @@ -616,7 +705,7 @@ typedef struct z_publisher_put_options_t { /** * The source info for the publication. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t source_info; #endif /** * The attachment to attach to the publication. @@ -657,7 +746,7 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t source_info; #endif /** * The attachment to this message. @@ -696,7 +785,7 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t source_info; #endif /** * The attachment to this reply. @@ -728,7 +817,7 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t source_info; #endif /** * The attachment to this reply. @@ -779,15 +868,39 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -typedef struct z_moved_shm_client_t { - struct z_owned_shm_client_t *_ptr; -} z_moved_shm_client_t; -typedef struct z_moved_shm_client_storage_t { - struct z_owned_shm_client_storage_t *_ptr; -} z_moved_shm_client_storage_t; -typedef struct z_moved_shm_provider_t { - struct z_owned_shm_provider_t *_ptr; -} z_moved_shm_provider_t; +/** + * A callbacks for ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_segment_callbacks_t { + uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); +} zc_shm_segment_callbacks_t; +#endif +/** + * A ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_shm_segment_t { + struct zc_threadsafe_context_t context; + struct zc_shm_segment_callbacks_t callbacks; +} z_shm_segment_t; +#endif +/** + * A callbacks for ShmClient + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_client_callbacks_t { + bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); +} zc_shm_client_callbacks_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_layout_alloc_result_t { + z_owned_shm_mut_t buf; + bool error_is_alloc; + enum z_alloc_error_t alloc_error; + enum z_layout_error_t layout_error; +} z_buf_layout_alloc_result_t; +#endif /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -796,6 +909,46 @@ typedef struct z_moved_shm_provider_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif +/** + * A non-tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same + * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated + * with this context data are not required to be thread-safe. + * + * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can + * still be executed concurrently. The exact behavior depends on user's application, but we strongly + * discourage our users from pinning to some specific behavior unless they _really_ understand what they + * are doing. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_context_t { + void *context; + void (*delete_fn)(void*); +} zc_context_t; +#endif +/** + * A callbacks for ShmProviderBackend + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_provider_backend_callbacks_t { + void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, + const z_loaned_memory_layout_t *layout, + void *context); + void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); + size_t (*defragment_fn)(void *context); + size_t (*available_fn)(void *context); + void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); +} zc_shm_provider_backend_callbacks_t; +#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t *_ptr; } z_moved_string_array_t; @@ -844,6 +997,14 @@ typedef struct zc_owned_closure_log_t { typedef struct zc_moved_closure_log_t { struct zc_owned_closure_log_t *_ptr; } zc_moved_closure_log_t; +/** + * Loaned closure. + */ +#if defined(UNSTABLE) +typedef struct zc_loaned_closure_matching_status_t { + size_t _0[3]; +} zc_loaned_closure_matching_status_t; +#endif /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -913,15 +1074,6 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif -typedef struct zc_moved_liveliness_token_t { - struct zc_owned_liveliness_token_t *_ptr; -} zc_moved_liveliness_token_t; -typedef struct zc_moved_matching_listener_t { - struct zc_owned_matching_listener_t *_ptr; -} zc_moved_matching_listener_t; -typedef struct zc_moved_shm_client_list_t { - struct zc_owned_shm_client_list_t *_ptr; -} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -992,12 +1144,6 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif -typedef struct ze_moved_publication_cache_t { - struct ze_owned_publication_cache_t *_ptr; -} ze_moved_publication_cache_t; -typedef struct ze_moved_querying_subscriber_t { - struct ze_owned_querying_subscriber_t *_ptr; -} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1017,54 +1163,53 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t this_); +ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1072,12 +1217,12 @@ z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout, + const z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1141,7 +1286,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const struct z_loaned_shm_t **dst); + const z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1152,7 +1297,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - struct z_loaned_shm_t **dst); + z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1163,7 +1308,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - struct z_owned_shm_t *dst); + z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1422,9 +1567,7 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t shm); +ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_moved_shm_t shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1432,7 +1575,7 @@ z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t shm); + z_moved_shm_mut_t shm); #endif /** * Serializes a slice by copying. @@ -1500,27 +1643,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t this_); +ZENOHC_API void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); +const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1528,14 +1671,14 @@ void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1660,7 +1803,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const struct z_id_t *z_id); + const z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2355,13 +2498,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); +ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2539,7 +2682,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2575,7 +2718,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2719,13 +2862,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); +ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t this_); #endif /** * Extract data from Memory Layout @@ -2734,21 +2877,21 @@ ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const struct z_loaned_memory_layout_t *this_); + const z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); +const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2756,7 +2899,7 @@ z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2812,21 +2955,21 @@ z_result_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t config, - const struct z_loaned_shm_client_storage_t *shm_clients); + const z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, - const struct z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, + const z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2856,7 +2999,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t this_); * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3118,7 +3261,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3189,7 +3332,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3375,7 +3518,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3428,26 +3571,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t this_); +ZENOHC_API void z_shm_client_drop(z_moved_shm_client_t this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(struct z_owned_shm_client_t *this_, +void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3455,179 +3598,177 @@ void z_shm_client_new(struct z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, - const struct z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, + const z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t this_); +ZENOHC_API void z_shm_client_storage_drop(z_moved_shm_client_storage_t this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); +const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, - const struct zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, + const zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(struct z_moved_shm_t this_); +ZENOHC_API void z_shm_drop(z_moved_shm_t this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t that); +ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_moved_shm_mut_t that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); +ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t this_); +ZENOHC_API void z_shm_mut_drop(z_moved_shm_mut_t this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); +ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t that); +ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3637,49 +3778,48 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t this_); +ZENOHC_API void z_shm_provider_drop(z_moved_shm_provider_t this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); +ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, + const z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3688,7 +3828,7 @@ z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3697,14 +3837,14 @@ void z_shm_provider_new(struct z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3713,13 +3853,13 @@ void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3798,47 +3938,46 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t this_); +ZENOHC_API void z_source_info_drop(z_moved_source_info_t this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); +ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API -const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); +ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(struct z_owned_source_info_t *this_, - const struct z_entity_global_id_t *source_id, +z_result_t z_source_info_new(z_owned_source_info_t *this_, + const z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -4054,7 +4193,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4422,7 +4561,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4459,32 +4598,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t this_); +ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); +const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t this_); #endif /** * Returns default value of `zc_locality_t` @@ -4496,13 +4635,13 @@ ZENOHC_API enum zc_locality_t zc_locality_default(void); * Checks the matching listener is for the gravestone state */ #if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); #endif /** * Constructs an empty matching listener */ #if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); +ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); #endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -4525,7 +4664,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t callback); #endif @@ -4535,8 +4674,7 @@ z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_liste * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_listener_t this_); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4544,8 +4682,7 @@ z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4556,46 +4693,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - struct z_moved_shm_client_t client, - struct zc_loaned_shm_client_list_t *list); + z_moved_shm_client_t client, + zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t this_); +ZENOHC_API void zc_shm_client_list_drop(zc_moved_shm_client_list_t this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); +const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); +zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4617,7 +4754,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4635,7 +4772,7 @@ z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *thi */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t callback, @@ -4645,19 +4782,19 @@ z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t this_); +ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4669,13 +4806,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t this_); +ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4684,7 +4821,7 @@ ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_ */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -4693,13 +4830,13 @@ z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber */ #if defined(UNSTABLE) ZENOHC_API -const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); +const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4713,7 +4850,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4721,5 +4858,5 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t this_); +ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t this_); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 124704465..6872f6381 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,14 +4,11 @@ #ifndef __cplusplus -static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t){x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t){x}; } -static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t){x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t){x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t){x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t){x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t){x}; } -static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t){x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t){x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return (z_moved_config_t){x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t){x}; } @@ -20,7 +17,6 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t){x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t){x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } -static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t){x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } @@ -32,36 +28,21 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t){x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t){x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return (z_moved_session_t){x}; } -static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t){x}; } -static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t){x}; } -static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t){x}; } -static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t){x}; } -static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t){x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t){x}; } -static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t){x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t){x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return (z_moved_string_t){x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t){x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_task_t){x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } -static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } -static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } -static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t){x}; } -static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } #define z_loan(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ - z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -70,7 +51,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ - z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -81,23 +61,14 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ - z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ - z_owned_shm_t : z_shm_loan, \ - z_owned_shm_mut_t : z_shm_mut_loan, \ - z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ - z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ - zc_owned_closure_log_t : zc_closure_log_loan, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ - zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ + zc_owned_closure_log_t : zc_closure_log_loan \ )(&this_) #define z_loan_mut(this_) \ @@ -108,22 +79,16 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_shm_t : z_shm_loan_mut, \ - z_owned_shm_mut_t : z_shm_mut_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ + z_owned_string_array_t : z_string_array_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_alloc_layout_t : z_alloc_layout_drop, \ z_moved_bytes_t : z_bytes_drop, \ - z_moved_chunk_alloc_result_t : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t : z_closure_hello_drop, \ z_moved_closure_query_t : z_closure_query_drop, \ z_moved_closure_reply_t : z_closure_reply_drop, \ z_moved_closure_sample_t : z_closure_sample_drop, \ - z_moved_closure_zid_t : z_closure_zid_drop, \ z_moved_condvar_t : z_condvar_drop, \ z_moved_config_t : z_config_drop, \ z_moved_encoding_t : z_encoding_drop, \ @@ -132,7 +97,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_moved_fifo_handler_sample_t : z_fifo_handler_sample_drop, \ z_moved_hello_t : z_hello_drop, \ z_moved_keyexpr_t : z_keyexpr_drop, \ - z_moved_memory_layout_t : z_memory_layout_drop, \ z_moved_mutex_t : z_mutex_drop, \ z_moved_publisher_t : z_publisher_drop, \ z_moved_query_t : z_query_drop, \ @@ -144,36 +108,21 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_moved_ring_handler_sample_t : z_ring_handler_sample_drop, \ z_moved_sample_t : z_sample_drop, \ z_moved_session_t : z_session_drop, \ - z_moved_shm_client_t : z_shm_client_drop, \ - z_moved_shm_client_storage_t : z_shm_client_storage_drop, \ - z_moved_shm_t : z_shm_drop, \ - z_moved_shm_mut_t : z_shm_mut_drop, \ - z_moved_shm_provider_t : z_shm_provider_drop, \ z_moved_slice_t : z_slice_drop, \ - z_moved_source_info_t : z_source_info_drop, \ z_moved_string_array_t : z_string_array_drop, \ z_moved_string_t : z_string_drop, \ z_moved_subscriber_t : z_subscriber_drop, \ z_moved_task_t : z_task_drop, \ - zc_moved_closure_log_t : zc_closure_log_drop, \ - zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ - zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ - zc_moved_matching_listener_t : zc_publisher_matching_listener_drop, \ - zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ + zc_moved_closure_log_t : zc_closure_log_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ - z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -182,7 +131,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ - z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ z_owned_query_t : z_query_move, \ @@ -194,36 +142,21 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ - z_owned_shm_client_t : z_shm_client_move, \ - z_owned_shm_client_storage_t : z_shm_client_storage_move, \ - z_owned_shm_t : z_shm_move, \ - z_owned_shm_mut_t : z_shm_mut_move, \ - z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ - z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ - zc_owned_closure_log_t : zc_closure_log_move, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ - zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ + zc_owned_closure_log_t : zc_closure_log_move \ )(&this_) #define z_null(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ - z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -232,7 +165,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ - z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -244,34 +176,19 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ - z_owned_shm_client_t* : z_shm_client_null, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ - z_owned_shm_mut_t* : z_shm_mut_null, \ - z_owned_shm_t* : z_shm_null, \ - z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ - z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ - zc_owned_matching_listener_t* : zc_matching_listener_null, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ - ze_owned_publication_cache_t* : ze_publication_cache_null, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ + zc_owned_closure_log_t* : zc_closure_log_null \ )(this_) -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -280,7 +197,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } @@ -292,36 +208,21 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ - z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -330,7 +231,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ - z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ z_owned_query_t* : z_query_take, \ @@ -342,36 +242,21 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ - z_owned_shm_client_t* : z_shm_client_take, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ - z_owned_shm_t* : z_shm_take, \ - z_owned_shm_mut_t* : z_shm_mut_take, \ - z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ - z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ - zc_owned_closure_log_t* : zc_closure_log_take, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ + zc_owned_closure_log_t* : zc_closure_log_take \ )(this_, x) #define z_check(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ - z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -380,7 +265,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ - z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -392,24 +276,12 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ - z_owned_shm_t : z_shm_check, \ - z_owned_shm_client_t : z_shm_client_check, \ - z_owned_shm_client_storage_t : z_shm_client_storage_check, \ - z_owned_shm_mut_t : z_shm_mut_check, \ - z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ - z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ - zc_owned_liveliness_token_t : zc_liveliness_token_check, \ - zc_owned_matching_listener_t : zc_matching_listener_check, \ - zc_owned_shm_client_list_t : zc_shm_client_list_check, \ - ze_owned_publication_cache_t : ze_publication_cache_check, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ + zc_owned_closure_log_t : zc_closure_log_check \ )(&this_) #define z_call(closure, hello) \ @@ -417,9 +289,7 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call, \ - const z_loaned_closure_zid_t* : z_closure_zid_call, \ - const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call \ )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ @@ -447,14 +317,11 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t #else // #ifndef __cplusplus -static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return z_moved_alloc_layout_t{x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return z_moved_bytes_t{x}; } -static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return z_moved_chunk_alloc_result_t{x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return z_moved_closure_hello_t{x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return z_moved_closure_query_t{x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return z_moved_closure_reply_t{x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return z_moved_closure_sample_t{x}; } -static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return z_moved_closure_zid_t{x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return z_moved_condvar_t{x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return z_moved_config_t{x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return z_moved_encoding_t{x}; } @@ -463,7 +330,6 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return z_moved_fifo_handler_sample_t{x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_hello_t{x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } -static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return z_moved_memory_layout_t{x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } @@ -475,35 +341,20 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return z_moved_ring_handler_sample_t{x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return z_moved_sample_t{x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return z_moved_session_t{x}; } -static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return z_moved_shm_client_t{x}; } -static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return z_moved_shm_client_storage_t{x}; } -static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return z_moved_shm_t{x}; } -static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return z_moved_shm_mut_t{x}; } -static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return z_moved_shm_provider_t{x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return z_moved_slice_t{x}; } -static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return z_moved_source_info_t{x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return z_moved_string_array_t{x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return z_moved_string_t{x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return z_moved_subscriber_t{x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_task_t{x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } -static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } -static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } -static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return zc_moved_matching_listener_t{x}; } -static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } -inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; -inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; -inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -512,7 +363,6 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; -inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -523,12 +373,7 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; -inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; -inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; -inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; -inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; -inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -536,10 +381,6 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; -inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; -inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; -inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; -inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -548,20 +389,14 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; -inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; -inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; -inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; -inline void z_drop(z_moved_alloc_layout_t this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; -inline void z_drop(z_moved_chunk_alloc_result_t this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t _closure) { z_closure_hello_drop(_closure); }; inline void z_drop(z_moved_closure_query_t closure) { z_closure_query_drop(closure); }; inline void z_drop(z_moved_closure_reply_t closure) { z_closure_reply_drop(closure); }; inline void z_drop(z_moved_closure_sample_t closure) { z_closure_sample_drop(closure); }; -inline void z_drop(z_moved_closure_zid_t closure) { z_closure_zid_drop(closure); }; inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; @@ -570,7 +405,6 @@ inline void z_drop(z_moved_fifo_handler_reply_t this_) { z_fifo_handler_reply_dr inline void z_drop(z_moved_fifo_handler_sample_t this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; @@ -582,34 +416,19 @@ inline void z_drop(z_moved_ring_handler_reply_t this_) { z_ring_handler_reply_dr inline void z_drop(z_moved_ring_handler_sample_t this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_shm_client_t this_) { z_shm_client_drop(this_); }; -inline void z_drop(z_moved_shm_client_storage_t this_) { z_shm_client_storage_drop(this_); }; -inline void z_drop(z_moved_shm_t this_) { z_shm_drop(this_); }; -inline void z_drop(z_moved_shm_mut_t this_) { z_shm_mut_drop(this_); }; -inline void z_drop(z_moved_shm_provider_t this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_source_info_t this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t closure) { zc_closure_log_drop(closure); }; -inline void z_drop(zc_moved_closure_matching_status_t closure) { zc_closure_matching_status_drop(closure); }; -inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; -inline z_result_t z_drop(zc_moved_matching_listener_t this_) { return zc_publisher_matching_listener_drop(this_); }; -inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; -inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; -inline z_moved_chunk_alloc_result_t z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& _closure) { return z_closure_hello_move(&_closure); }; inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure) { return z_closure_query_move(&closure); }; inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure) { return z_closure_reply_move(&closure); }; inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure) { return z_closure_sample_move(&closure); }; -inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure) { return z_closure_zid_move(&closure); }; inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -618,7 +437,6 @@ inline z_moved_fifo_handler_reply_t z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; @@ -630,34 +448,19 @@ inline z_moved_ring_handler_reply_t z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_shm_client_t z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; -inline z_moved_shm_client_storage_t z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; -inline z_moved_shm_t z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; -inline z_moved_shm_mut_t z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; -inline z_moved_shm_provider_t z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_source_info_t z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure) { return zc_closure_log_move(&closure); }; -inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_move(&closure); }; -inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; -inline zc_moved_matching_listener_t z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; -inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; -inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; -inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; -inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; @@ -666,7 +469,6 @@ inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_n inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; -inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; @@ -678,33 +480,18 @@ inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_n inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; -inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; -inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; -inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; -inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; -inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; -inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; -inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; -inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; -inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; -inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; -inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; -inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -713,7 +500,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } @@ -725,36 +511,18 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } -inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { - z_alloc_layout_take(this_, x); -}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { z_bytes_take(this_, x); }; -inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { - z_chunk_alloc_result_take(this_, x); -}; inline void z_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { z_closure_hello_take(_closure, x); }; @@ -767,9 +535,6 @@ inline void z_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) inline void z_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { z_closure_sample_take(closure, x); }; -inline void z_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { - z_closure_zid_take(closure, x); -}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { z_condvar_take(this_, x); }; @@ -794,9 +559,6 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { - z_memory_layout_take(this_, x); -}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { z_mutex_take(this_, x); }; @@ -830,27 +592,9 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t x) { z_session_take(this_, x); }; -inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { - z_shm_client_take(this_, x); -}; -inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { - z_shm_client_storage_take(this_, x); -}; -inline void z_take(z_owned_shm_t* this_, z_moved_shm_t x) { - z_shm_take(this_, x); -}; -inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { - z_shm_mut_take(this_, x); -}; -inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { - z_shm_provider_take(this_, x); -}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { - z_source_info_take(this_, x); -}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { z_string_array_take(this_, x); }; @@ -866,34 +610,13 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { inline void z_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { zc_closure_log_take(closure, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { - zc_closure_matching_status_take(closure, x); -}; -inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { - zc_liveliness_token_take(this_, x); -}; -inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { - zc_publisher_matching_listener_take(this_, x); -}; -inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { - zc_shm_client_list_take(this_, x); -}; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { - ze_querying_subscriber_take(this_, x); -}; -inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; -inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -902,7 +625,6 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; -inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -914,24 +636,12 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; -inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; -inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; -inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; -inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; -inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; -inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; -inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; -inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; -inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; -inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; -inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; -inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { @@ -946,12 +656,6 @@ inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; -inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { - z_closure_zid_call(closure, z_id); -}; -inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { - zc_closure_matching_status_call(closure, mathing_status); -}; inline void z_closure( @@ -990,24 +694,6 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; -inline void z_closure( - z_owned_closure_zid_t* closure, - void (*call)(const z_id_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; -inline void z_closure( - zc_owned_closure_matching_status_t* closure, - void (*call)(const zc_matching_status_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -1051,12 +737,8 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -1065,8 +747,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -1083,8 +763,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -1105,18 +783,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -1125,14 +793,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; #endif // #ifndef __cplusplus From db9d5113dff90cea4b331a4b1bf95aefc15f7610 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 14 Aug 2024 17:42:15 +0300 Subject: [PATCH 072/397] update zenoh --- Cargo.lock | 54 ++++++++++++------------- build-resources/opaque-types/Cargo.lock | 54 ++++++++++++------------- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdd61aca9..4b4da74b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3522,7 +3522,7 @@ dependencies = [ [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "ahash", "async-trait", @@ -3580,7 +3580,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "zenoh-collections", ] @@ -3618,7 +3618,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "serde", "tracing", @@ -3631,12 +3631,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "flume", "json5", @@ -3658,7 +3658,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-global-executor", "lazy_static", @@ -3670,7 +3670,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "aes", "hmac", @@ -3683,7 +3683,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "bincode", "flume", @@ -3702,7 +3702,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3716,7 +3716,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "zenoh-config", @@ -3734,7 +3734,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -3759,7 +3759,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3790,7 +3790,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3809,7 +3809,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3840,7 +3840,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3861,7 +3861,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures", @@ -3881,7 +3881,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures-util", @@ -3902,7 +3902,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "proc-macro2", "quote", @@ -3913,7 +3913,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "libloading", "serde", @@ -3928,7 +3928,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "const_format", "rand", @@ -3943,7 +3943,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "anyhow", ] @@ -3951,7 +3951,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "lazy_static", @@ -3966,7 +3966,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "bincode", @@ -3990,7 +3990,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "event-listener 5.3.1", "futures", @@ -4004,7 +4004,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "tokio", @@ -4017,7 +4017,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -4050,7 +4050,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0bc608836e20c3ab5ad2e479e8b1aa53ba3addd4" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index c51674665..bf01256ac 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3286,7 +3286,7 @@ dependencies = [ [[package]] name = "zenoh" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "ahash", "async-trait", @@ -3344,7 +3344,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "zenoh-collections", ] @@ -3352,7 +3352,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "serde", "tracing", @@ -3365,12 +3365,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" [[package]] name = "zenoh-config" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "flume", "json5", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-global-executor", "lazy_static", @@ -3404,7 +3404,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "aes", "hmac", @@ -3417,7 +3417,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "bincode", "flume", @@ -3436,7 +3436,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "hashbrown", "keyed-set", @@ -3450,7 +3450,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "zenoh-config", @@ -3468,7 +3468,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -3493,7 +3493,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3524,7 +3524,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3543,7 +3543,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3595,7 +3595,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures", @@ -3615,7 +3615,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "futures-util", @@ -3636,7 +3636,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "proc-macro2", "quote", @@ -3647,7 +3647,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "libloading", "serde", @@ -3662,7 +3662,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "const_format", "rand", @@ -3677,7 +3677,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "anyhow", ] @@ -3685,7 +3685,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "lazy_static", @@ -3700,7 +3700,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "bincode", @@ -3724,7 +3724,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "event-listener 5.3.1", "futures", @@ -3738,7 +3738,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "futures", "tokio", @@ -3751,7 +3751,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "flume", @@ -3784,7 +3784,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#2d5ab7c48c47c4d957d653b14fc9140549721619" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" dependencies = [ "async-trait", "const_format", From 608f3618d136d09c3f758d0244aeb08084238343 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 14 Aug 2024 17:45:19 +0300 Subject: [PATCH 073/397] fix clang --- examples/z_sub_thr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 52d23fb22..15838b6ec 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -62,7 +62,7 @@ void drop_stats(void *context) { int main(int argc, char **argv) { z_owned_config_t config; z_config_default(&config); - + if (argc > 1) { if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[1]) < 0) { printf( From 169ea9f0c910be5250d7d7645d00dd890060a886 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Thu, 15 Aug 2024 10:24:01 +0200 Subject: [PATCH 074/397] dropper autogeneration --- build.rs | 42 ++++++++++++++++++++++++++++++++++++++++++ src/transmute.rs | 34 +++++++++++++++------------------- 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/build.rs b/build.rs index ca09135ee..cbd490962 100644 --- a/build.rs +++ b/build.rs @@ -174,6 +174,8 @@ pub struct {type_name} {{ .as_str(); if category == Some("owned") { let moved_type_name = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); + let semantic_upcase = semantic.chars().next().unwrap().to_uppercase().to_string() + &semantic[1..]; + let moved_dropper_type_name = format!("Moved{}", semantic_upcase); s += format!( "#[repr(C)] #[derive(Default)] @@ -192,6 +194,46 @@ impl From> for {moved_type_name} {{ Self {{ _ptr: ptr }} }} }} + +#[repr(C)] +#[derive(Default)] +pub struct {moved_type_name}2 {{ + _this: {type_name} +}} + +impl {moved_type_name}2 {{ + pub fn dropper(&mut self) -> {moved_dropper_type_name} {{ + {moved_dropper_type_name}(&mut self._this) + }} +}} + +pub struct {moved_dropper_type_name}<'a>(&'a mut {type_name}); + +impl AsRef<{type_name}> for {moved_dropper_type_name}<'_> {{ + fn as_ref(&self) -> &{type_name} {{ + self.0 + }} +}} + +impl AsMut<{type_name}> for {moved_dropper_type_name}<'_> {{ + fn as_mut(&mut self) -> &mut {type_name} {{ + self.0 + }} +}} + +impl Drop for {type_name} {{ + fn drop(&mut self) {{ + use crate::transmute::RustTypeRef; + std::mem::take(self.as_rust_type_mut()); + }} +}} + +impl Drop for {moved_dropper_type_name}<'_> {{ + fn drop(&mut self) {{ + use crate::transmute::RustTypeRef; + std::mem::take(self.0.as_rust_type_mut()); + }} +}} " ) .as_str(); diff --git a/src/transmute.rs b/src/transmute.rs index dd71717e9..a53071cee 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -39,23 +39,19 @@ pub(crate) trait RustTypeRef: Sized { fn as_rust_type_ref(&self) -> &Self::RustType; fn as_rust_type_mut(&mut self) -> &mut Self::RustType; } - pub(crate) trait RustTypeRefUninit: Sized { type RustType; fn as_rust_type_mut_uninit(&mut self) -> &mut MaybeUninit; } - pub(crate) trait IntoRustType: Sized { type RustType; fn into_rust_type(self) -> Self::RustType; } - pub(crate) trait TakeRustType: IntoRustType + Default { fn take_rust_type(&mut self) -> Self::RustType { std::mem::take(self).into_rust_type() } } - pub(crate) trait IntoCType: Sized { type CType; fn into_c_type(self) -> Self::CType; @@ -84,7 +80,7 @@ macro_rules! validate_equivalence { } const SIZE_A: usize = std::mem::size_of::<$type_a>(); const SIZE_B: usize = std::mem::size_of::<$type_b>(); - if SIZE_A != SIZE_B { + if SIZE_A != SIZE_B { const ERR_MESSAGE: &str = concatcp!( "Size mismatch: type ", TYPE_NAME_A, @@ -103,6 +99,9 @@ macro_rules! validate_equivalence { #[macro_export] macro_rules! impl_transmute { + (as_moved ($rust_type:ty, $c_type:ty)) => { + }; + (as_c ($rust_type:ty, $c_type:ty)) => { impl $crate::transmute::CTypeRef for $rust_type { type CType = $c_type; @@ -195,18 +194,25 @@ macro_rules! impl_transmute { } macro_rules! impl_owned { - (owned $c_owned_type:ty, moved $c_moved_type:ty, inner rust option $rust_inner_type:ty) => { + (owned $c_owned_type:ty, moved2 $c_moved_type:ty, inner rust option $rust_inner_type:ty) => { impl_transmute!(as_c_owned(Option<$rust_inner_type>, $c_owned_type)); impl_transmute!(as_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(into_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(take_rust($c_owned_type, Option<$rust_inner_type>)); - impl Drop for $c_owned_type { + impl $crate::transmute::TakeRustType for $c_moved_type {} + impl Drop for $c_moved_type { fn drop(&mut self) { - use $crate::transmute::RustTypeRef; - self.as_rust_type_mut().take(); + self.take(); } } + }; + + (owned $c_owned_type:ty, moved $c_moved_type:ty, inner rust option $rust_inner_type:ty) => { + impl_transmute!(as_c_owned(Option<$rust_inner_type>, $c_owned_type)); + impl_transmute!(as_rust($c_owned_type, Option<$rust_inner_type>)); + impl_transmute!(into_rust($c_owned_type, Option<$rust_inner_type>)); + impl_transmute!(take_rust($c_owned_type, Option<$rust_inner_type>)); impl $crate::transmute::IntoRustType for $c_moved_type { type RustType = Option<$rust_inner_type>; @@ -234,13 +240,6 @@ macro_rules! impl_owned { impl_transmute!(into_rust($c_owned_type, $rust_owned_type)); impl_transmute!(take_rust($c_owned_type, $rust_owned_type)); - impl Drop for $c_owned_type { - fn drop(&mut self) { - use $crate::transmute::RustTypeRef; - std::mem::take(self.as_rust_type_mut()); - } - } - impl $crate::transmute::IntoRustType for $c_moved_type { type RustType = Option<$rust_owned_type>; fn into_rust_type(self) -> Self::RustType { @@ -262,9 +261,6 @@ macro_rules! impl_owned { impl_transmute!(as_c_owned($c_loaned_type, $c_owned_type)); impl_transmute!(as_c_loaned($c_owned_type, $c_loaned_type)); - // $c_owned_type is a real rust type here, not a blind C structure with same size/alingment - // So it's expected that drop is implemented for it (e.g. closures calls `drop` functions themselves) - impl $crate::transmute::IntoRustType for $c_moved_type { type RustType = Option<$c_owned_type>; fn into_rust_type(self) -> Self::RustType { From 942768faf059dc3afbd1db5fc58efe8ec343433f Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Thu, 15 Aug 2024 11:37:05 +0200 Subject: [PATCH 075/397] dropper type --- build.rs | 31 ++++++++++++++++++++++++------- src/payload.rs | 2 +- src/transmute.rs | 24 +++++++++++++++++++++++- 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/build.rs b/build.rs index cbd490962..12d82cd6e 100644 --- a/build.rs +++ b/build.rs @@ -146,6 +146,22 @@ fn split_type_name(type_name: &str) -> (&str, Option<&str>, &str, &str) { (prefix, category, semantic, postfix) } +fn to_camel_case(s: &str) -> String { + let mut res = String::new(); + let mut capitalize = true; + for c in s.chars() { + if c == '_' { + capitalize = true; + } else if capitalize { + res.push(c.to_ascii_uppercase()); + capitalize = false; + } else { + res.push(c); + } + } + res +} + fn generate_opaque_types() { let type_to_inner_field_name = HashMap::from([("z_id_t", "pub id")]); let current_folder = get_build_rs_path(); @@ -174,8 +190,7 @@ pub struct {type_name} {{ .as_str(); if category == Some("owned") { let moved_type_name = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); - let semantic_upcase = semantic.chars().next().unwrap().to_uppercase().to_string() + &semantic[1..]; - let moved_dropper_type_name = format!("Moved{}", semantic_upcase); + let moved_dropper_type_name = format!("Moved{}", to_camel_case(semantic)); s += format!( "#[repr(C)] #[derive(Default)] @@ -196,7 +211,6 @@ impl From> for {moved_type_name} {{ }} #[repr(C)] -#[derive(Default)] pub struct {moved_type_name}2 {{ _this: {type_name} }} @@ -209,18 +223,21 @@ impl {moved_type_name}2 {{ pub struct {moved_dropper_type_name}<'a>(&'a mut {type_name}); -impl AsRef<{type_name}> for {moved_dropper_type_name}<'_> {{ - fn as_ref(&self) -> &{type_name} {{ +impl std::ops::Deref for {moved_dropper_type_name}<'_> {{ + type Target = {type_name}; + + fn deref(&self) -> &Self::Target {{ self.0 }} }} -impl AsMut<{type_name}> for {moved_dropper_type_name}<'_> {{ - fn as_mut(&mut self) -> &mut {type_name} {{ +impl std::ops::DerefMut for {moved_dropper_type_name}<'_> {{ + fn deref_mut(&mut self) -> &mut Self::Target {{ self.0 }} }} + impl Drop for {type_name} {{ fn drop(&mut self) {{ use crate::transmute::RustTypeRef; diff --git a/src/payload.rs b/src/payload.rs index 214588fef..09c641e81 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -41,7 +41,7 @@ use crate::{z_loaned_shm_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_t}; decl_c_type! { owned(z_owned_bytes_t, ZBytes), loaned(z_loaned_bytes_t), - moved(z_moved_bytes_t) + moved(z_moved_bytes_t), } /// The gravestone value for `z_owned_bytes_t`. diff --git a/src/transmute.rs b/src/transmute.rs index a53071cee..6213249c5 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -194,12 +194,26 @@ macro_rules! impl_transmute { } macro_rules! impl_owned { - (owned $c_owned_type:ty, moved2 $c_moved_type:ty, inner rust option $rust_inner_type:ty) => { + (owned $c_owned_type:ty, moved $c_moved_type:ty, moved2 $c_moved_type2:ty, inner rust option $rust_inner_type:ty) => { impl_transmute!(as_c_owned(Option<$rust_inner_type>, $c_owned_type)); impl_transmute!(as_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(into_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(take_rust($c_owned_type, Option<$rust_inner_type>)); + impl $crate::transmute::IntoRustType for $c_moved_type { + type RustType = Option<$rust_inner_type>; + fn into_rust_type(self) -> Self::RustType { + use $crate::transmute::RustTypeRef; + let mut this = self; + // expicit types for better understanding + let ptr: &mut Option<&mut Option<$rust_inner_type>> = + &mut this._ptr.as_mut().map(|r| r.as_rust_type_mut()); + let res: Option<$rust_inner_type> = + ptr.as_mut().map(|r| std::mem::take(*r)).flatten(); + res + } + } + impl $crate::transmute::TakeRustType for $c_moved_type {} impl Drop for $c_moved_type { fn drop(&mut self) { @@ -419,6 +433,14 @@ macro_rules! decl_c_type { validate_equivalence!($c_owned_type, Option<$rust_inner_type>); impl_owned!(owned $c_owned_type, moved $c_moved_type, inner rust option $rust_inner_type); }; + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), + moved ($c_moved_type:ty $(,)?), + moved2 ($c_moved_type2:ty $(,)?) + $(,)?) => { + validate_equivalence!($c_owned_type, Option<$rust_inner_type>); + impl_owned!(owned $c_owned_type, moved $c_moved_type, moved2 $c_moved_type2, inner rust option $rust_inner_type); + }; + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), moved ($c_moved_type:ty $(,)?) $(,)?) => { From 9e7cf38c83b62e2f37fedc1981c6132b33877475 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Thu, 15 Aug 2024 16:51:09 +0200 Subject: [PATCH 076/397] unfinished - into_rust_type approach failed --- build.rs | 65 +-- include/zenoh_commons.h | 626 +++++++++++++++--------- include/zenoh_macros.h | 356 +------------- src/closures/hello_closure.rs | 4 +- src/closures/log_closure.rs | 4 +- src/closures/matching_status_closure.rs | 1 - src/closures/query_channel.rs | 2 - src/closures/query_closure.rs | 4 +- src/closures/reply_closure.rs | 5 +- src/closures/response_channel.rs | 2 - src/closures/sample_channel.rs | 2 - src/closures/sample_closure.rs | 4 +- src/closures/zenohid_closure.rs | 1 - src/collections.rs | 3 - src/commons.rs | 2 - src/config.rs | 1 - src/encoding.rs | 1 - src/get.rs | 39 +- src/keyexpr.rs | 1 - src/liveliness.rs | 1 - src/payload.rs | 38 +- src/platform/synchronization.rs | 3 - src/publication_cache.rs | 1 - src/publisher.rs | 43 +- src/put.rs | 27 +- src/queryable.rs | 59 +-- src/querying_subscriber.rs | 1 - src/scouting.rs | 7 +- src/session.rs | 1 - src/shm/buffer/zshm.rs | 1 - src/shm/buffer/zshmmut.rs | 1 - src/shm/client/shm_client.rs | 1 - src/shm/client_storage/mod.rs | 2 - src/shm/provider/alloc_layout.rs | 1 - src/shm/provider/shm_provider.rs | 1 - src/shm/provider/types.rs | 2 - src/subscriber.rs | 8 +- src/transmute.rs | 203 +++----- 38 files changed, 560 insertions(+), 964 deletions(-) diff --git a/build.rs b/build.rs index 12d82cd6e..75262eba1 100644 --- a/build.rs +++ b/build.rs @@ -146,22 +146,6 @@ fn split_type_name(type_name: &str) -> (&str, Option<&str>, &str, &str) { (prefix, category, semantic, postfix) } -fn to_camel_case(s: &str) -> String { - let mut res = String::new(); - let mut capitalize = true; - for c in s.chars() { - if c == '_' { - capitalize = true; - } else if capitalize { - res.push(c.to_ascii_uppercase()); - capitalize = false; - } else { - res.push(c); - } - } - res -} - fn generate_opaque_types() { let type_to_inner_field_name = HashMap::from([("z_id_t", "pub id")]); let current_folder = get_build_rs_path(); @@ -190,67 +174,34 @@ pub struct {type_name} {{ .as_str(); if category == Some("owned") { let moved_type_name = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); - let moved_dropper_type_name = format!("Moved{}", to_camel_case(semantic)); + // Note: owned type {type_name} should implement "Default" and "IntoRustType" traits, this is + // done by "decl_c_type!" macro in transmute module. s += format!( "#[repr(C)] #[derive(Default)] pub struct {moved_type_name} {{ - pub _ptr: Option<&'static mut {type_name}>, -}} - -impl {moved_type_name} {{ - pub fn take(&mut self) -> Option<{type_name}> {{ - self._ptr.take().map(std::mem::take) - }} -}} - -impl From> for {moved_type_name} {{ - fn from(ptr: Option<&'static mut {type_name}>) -> Self {{ - Self {{ _ptr: ptr }} - }} -}} - -#[repr(C)] -pub struct {moved_type_name}2 {{ _this: {type_name} }} -impl {moved_type_name}2 {{ - pub fn dropper(&mut self) -> {moved_dropper_type_name} {{ - {moved_dropper_type_name}(&mut self._this) - }} -}} - -pub struct {moved_dropper_type_name}<'a>(&'a mut {type_name}); - -impl std::ops::Deref for {moved_dropper_type_name}<'_> {{ +impl std::ops::Deref for {moved_type_name} {{ type Target = {type_name}; - fn deref(&self) -> &Self::Target {{ - self.0 + &self._this }} }} -impl std::ops::DerefMut for {moved_dropper_type_name}<'_> {{ +impl std::ops::DerefMut for {moved_type_name} {{ fn deref_mut(&mut self) -> &mut Self::Target {{ - self.0 + &mut self._this }} }} - impl Drop for {type_name} {{ fn drop(&mut self) {{ - use crate::transmute::RustTypeRef; - std::mem::take(self.as_rust_type_mut()); + use crate::transmute::IntoRustType; + let _ = self.into_rust_type(); }} }} - -impl Drop for {moved_dropper_type_name}<'_> {{ - fn drop(&mut self) {{ - use crate::transmute::RustTypeRef; - std::mem::take(self.0.as_rust_type_mut()); - }} -}} " ) .as_str(); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 24bb9d9bd..13428eaaa 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,6 +16,26 @@ #define ALIGN(n) #define ZENOHC_API #endif +/** + * Allocation errors + * + * - **NEED_DEFRAGMENT**: defragmentation needed + * - **OUT_OF_MEMORY**: the provider is out of memory + * - **OTHER**: other error + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_alloc_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_NEED_DEFRAGMENT, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OUT_OF_MEMORY, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OTHER, +#endif +} z_alloc_error_t; +#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -76,6 +96,22 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif +/** + * Layouting errors + * + * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect + * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_layout_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, +#endif +} z_layout_error_t; +#endif /** * The priority of zenoh messages. */ @@ -230,28 +266,87 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -typedef struct z_moved_alloc_layout_t { - struct z_owned_alloc_layout_t *_ptr; -} z_moved_alloc_layout_t; +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_alloc_result_t { + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif typedef int8_t z_result_t; +/** + * An AllocAlignment. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif typedef struct z_moved_bytes_t { - struct z_owned_bytes_t *_ptr; + struct z_owned_bytes_t _this; } z_moved_bytes_t; typedef struct z_moved_slice_t { - struct z_owned_slice_t *_ptr; + struct z_owned_slice_t _this; } z_moved_slice_t; typedef struct z_moved_string_t { - struct z_owned_string_t *_ptr; + struct z_owned_string_t _this; } z_moved_string_t; -typedef struct z_moved_shm_t { - struct z_owned_shm_t *_ptr; -} z_moved_shm_t; -typedef struct z_moved_shm_mut_t { - struct z_owned_shm_mut_t *_ptr; -} z_moved_shm_mut_t; -typedef struct z_moved_chunk_alloc_result_t { - struct z_owned_chunk_alloc_result_t *_ptr; -} z_moved_chunk_alloc_result_t; +/** + * Unique segment identifier + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_segment_id_t; +#endif +/** + * Chunk id within it's segment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * A ChunkDescriptor + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * An AllocatedChunk + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif /** * Monotonic clock */ @@ -260,7 +355,7 @@ typedef struct z_clock_t { const void *t_base; } z_clock_t; typedef struct z_moved_session_t { - struct z_owned_session_t *_ptr; + struct z_owned_session_t _this; } z_moved_session_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -291,7 +386,7 @@ typedef struct z_owned_closure_hello_t { * Moved closure. */ typedef struct z_moved_closure_hello_t { - struct z_owned_closure_hello_t *_ptr; + struct z_owned_closure_hello_t _this; } z_moved_closure_hello_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -321,7 +416,7 @@ typedef struct z_owned_closure_query_t { * Moved closure. */ typedef struct z_moved_closure_query_t { - struct z_owned_closure_query_t *_ptr; + struct z_owned_closure_query_t _this; } z_moved_closure_query_t; /** * A structure that contains all the elements for stateful, memory-leak-free callbacks. @@ -351,7 +446,7 @@ typedef struct z_owned_closure_reply_t { * Moved closure. */ typedef struct z_moved_closure_reply_t { - struct z_owned_closure_reply_t *_ptr; + struct z_owned_closure_reply_t _this; } z_moved_closure_reply_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks. @@ -381,7 +476,7 @@ typedef struct z_owned_closure_sample_t { * Moved closure. */ typedef struct z_moved_closure_sample_t { - struct z_owned_closure_sample_t *_ptr; + struct z_owned_closure_sample_t _this; } z_moved_closure_sample_t; /** * A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -402,7 +497,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const struct z_id_t *z_id, void *context); + void (*call)(const z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -418,13 +513,13 @@ typedef struct z_moved_closure_zid_t { } z_moved_closure_zid_t; #endif typedef struct z_moved_condvar_t { - struct z_owned_condvar_t *_ptr; + struct z_owned_condvar_t _this; } z_moved_condvar_t; typedef struct z_moved_config_t { - struct z_owned_config_t *_ptr; + struct z_owned_config_t _this; } z_moved_config_t; typedef struct z_moved_encoding_t { - struct z_owned_encoding_t *_ptr; + struct z_owned_encoding_t _this; } z_moved_encoding_t; /** * Options passed to the `z_declare_publisher()` function. @@ -433,7 +528,7 @@ typedef struct z_publisher_options_t { /** * Default encoding for messages put by this publisher. */ - struct z_moved_encoding_t encoding; + struct z_moved_encoding_t *encoding; /** * The congestion control to apply when routing messages from this publisher. */ @@ -499,13 +594,13 @@ typedef struct z_delete_options_t { #endif } z_delete_options_t; typedef struct z_moved_fifo_handler_query_t { - struct z_owned_fifo_handler_query_t *_ptr; + struct z_owned_fifo_handler_query_t _this; } z_moved_fifo_handler_query_t; typedef struct z_moved_fifo_handler_reply_t { - struct z_owned_fifo_handler_reply_t *_ptr; + struct z_owned_fifo_handler_reply_t _this; } z_moved_fifo_handler_reply_t; typedef struct z_moved_fifo_handler_sample_t { - struct z_owned_fifo_handler_sample_t *_ptr; + struct z_owned_fifo_handler_sample_t _this; } z_moved_fifo_handler_sample_t; /** * The replies consolidation strategy to apply on replies to a `z_get()`. @@ -513,9 +608,6 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; -typedef struct z_moved_source_info_t { - struct z_owned_source_info_t *_ptr; -} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -531,11 +623,11 @@ typedef struct z_get_options_t { /** * An optional payload to attach to the query. */ - struct z_moved_bytes_t payload; + struct z_moved_bytes_t *payload; /** * An optional encoding of the query payload and or attachment. */ - struct z_moved_encoding_t encoding; + struct z_moved_encoding_t *encoding; /** * The congestion control to apply when routing the query. */ @@ -564,28 +656,25 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. */ - struct z_moved_bytes_t attachment; + struct z_moved_bytes_t *attachment; /** * The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration. */ uint64_t timeout_ms; } z_get_options_t; typedef struct z_moved_hello_t { - struct z_owned_hello_t *_ptr; + struct z_owned_hello_t _this; } z_moved_hello_t; typedef struct z_moved_keyexpr_t { - struct z_owned_keyexpr_t *_ptr; + struct z_owned_keyexpr_t _this; } z_moved_keyexpr_t; -typedef struct z_moved_memory_layout_t { - struct z_owned_memory_layout_t *_ptr; -} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { - struct z_owned_mutex_t *_ptr; + struct z_owned_mutex_t _this; } z_moved_mutex_t; /** * Represents the set of options that can be applied to the delete operation by a previously declared publisher, @@ -598,7 +687,7 @@ typedef struct z_publisher_delete_options_t { const struct z_timestamp_t *timestamp; } z_publisher_delete_options_t; typedef struct z_moved_publisher_t { - struct z_owned_publisher_t *_ptr; + struct z_owned_publisher_t _this; } z_moved_publisher_t; /** * Options passed to the `z_publisher_put()` function. @@ -607,7 +696,7 @@ typedef struct z_publisher_put_options_t { /** * The encoding of the data to publish. */ - struct z_moved_encoding_t encoding; + struct z_moved_encoding_t *encoding; /** * The timestamp of the publication. */ @@ -616,12 +705,12 @@ typedef struct z_publisher_put_options_t { /** * The source info for the publication. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. */ - struct z_moved_bytes_t attachment; + struct z_moved_bytes_t *attachment; } z_publisher_put_options_t; /** * Options passed to the `z_put()` function. @@ -630,7 +719,7 @@ typedef struct z_put_options_t { /** * The encoding of the message. */ - struct z_moved_encoding_t encoding; + struct z_moved_encoding_t *encoding; /** * The congestion control to apply when routing this message. */ @@ -657,15 +746,15 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this message. */ - struct z_moved_bytes_t attachment; + struct z_moved_bytes_t *attachment; } z_put_options_t; typedef struct z_moved_query_t { - struct z_owned_query_t *_ptr; + struct z_owned_query_t _this; } z_moved_query_t; /** * Represents the set of options that can be applied to a query reply, @@ -675,7 +764,7 @@ typedef struct z_query_reply_options_t { /** * The encoding of the reply payload. */ - struct z_moved_encoding_t encoding; + struct z_moved_encoding_t *encoding; /** * The congestion control to apply when routing the reply. */ @@ -696,12 +785,12 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. */ - struct z_moved_bytes_t attachment; + struct z_moved_bytes_t *attachment; } z_query_reply_options_t; /** * Represents the set of options that can be applied to a query delete reply, @@ -728,12 +817,12 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. */ - struct z_moved_bytes_t attachment; + struct z_moved_bytes_t *attachment; } z_query_reply_del_options_t; /** * Represents the set of options that can be applied to a query reply error, @@ -743,28 +832,28 @@ typedef struct z_query_reply_err_options_t { /** * The encoding of the error payload. */ - struct z_moved_encoding_t encoding; + struct z_moved_encoding_t *encoding; } z_query_reply_err_options_t; typedef struct z_moved_queryable_t { - struct z_owned_queryable_t *_ptr; + struct z_owned_queryable_t _this; } z_moved_queryable_t; typedef struct z_moved_reply_t { - struct z_owned_reply_t *_ptr; + struct z_owned_reply_t _this; } z_moved_reply_t; typedef struct z_moved_reply_err_t { - struct z_owned_reply_err_t *_ptr; + struct z_owned_reply_err_t _this; } z_moved_reply_err_t; typedef struct z_moved_ring_handler_query_t { - struct z_owned_ring_handler_query_t *_ptr; + struct z_owned_ring_handler_query_t _this; } z_moved_ring_handler_query_t; typedef struct z_moved_ring_handler_reply_t { - struct z_owned_ring_handler_reply_t *_ptr; + struct z_owned_ring_handler_reply_t _this; } z_moved_ring_handler_reply_t; typedef struct z_moved_ring_handler_sample_t { - struct z_owned_ring_handler_sample_t *_ptr; + struct z_owned_ring_handler_sample_t _this; } z_moved_ring_handler_sample_t; typedef struct z_moved_sample_t { - struct z_owned_sample_t *_ptr; + struct z_owned_sample_t _this; } z_moved_sample_t; /** * Options to pass to `z_scout()`. @@ -779,15 +868,39 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -typedef struct z_moved_shm_client_t { - struct z_owned_shm_client_t *_ptr; -} z_moved_shm_client_t; -typedef struct z_moved_shm_client_storage_t { - struct z_owned_shm_client_storage_t *_ptr; -} z_moved_shm_client_storage_t; -typedef struct z_moved_shm_provider_t { - struct z_owned_shm_provider_t *_ptr; -} z_moved_shm_provider_t; +/** + * A callbacks for ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_segment_callbacks_t { + uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); +} zc_shm_segment_callbacks_t; +#endif +/** + * A ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_shm_segment_t { + struct zc_threadsafe_context_t context; + struct zc_shm_segment_callbacks_t callbacks; +} z_shm_segment_t; +#endif +/** + * A callbacks for ShmClient + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_client_callbacks_t { + bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); +} zc_shm_client_callbacks_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_layout_alloc_result_t { + z_owned_shm_mut_t buf; + bool error_is_alloc; + enum z_alloc_error_t alloc_error; + enum z_layout_error_t layout_error; +} z_buf_layout_alloc_result_t; +#endif /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -796,14 +909,54 @@ typedef struct z_moved_shm_provider_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif +/** + * A non-tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same + * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated + * with this context data are not required to be thread-safe. + * + * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can + * still be executed concurrently. The exact behavior depends on user's application, but we strongly + * discourage our users from pinning to some specific behavior unless they _really_ understand what they + * are doing. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_context_t { + void *context; + void (*delete_fn)(void*); +} zc_context_t; +#endif +/** + * A callbacks for ShmProviderBackend + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_provider_backend_callbacks_t { + void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, + const z_loaned_memory_layout_t *layout, + void *context); + void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); + size_t (*defragment_fn)(void *context); + size_t (*available_fn)(void *context); + void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); +} zc_shm_provider_backend_callbacks_t; +#endif typedef struct z_moved_string_array_t { - struct z_owned_string_array_t *_ptr; + struct z_owned_string_array_t _this; } z_moved_string_array_t; typedef struct z_moved_subscriber_t { - struct z_owned_subscriber_t *_ptr; + struct z_owned_subscriber_t _this; } z_moved_subscriber_t; typedef struct z_moved_task_t { - struct z_owned_task_t *_ptr; + struct z_owned_task_t _this; } z_moved_task_t; typedef struct z_task_attr_t { size_t _0; @@ -842,8 +995,16 @@ typedef struct zc_owned_closure_log_t { * Moved closure. */ typedef struct zc_moved_closure_log_t { - struct zc_owned_closure_log_t *_ptr; + struct zc_owned_closure_log_t _this; } zc_moved_closure_log_t; +/** + * Loaned closure. + */ +#if defined(UNSTABLE) +typedef struct zc_loaned_closure_matching_status_t { + size_t _0[3]; +} zc_loaned_closure_matching_status_t; +#endif /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -913,15 +1074,6 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif -typedef struct zc_moved_liveliness_token_t { - struct zc_owned_liveliness_token_t *_ptr; -} zc_moved_liveliness_token_t; -typedef struct zc_moved_matching_listener_t { - struct zc_owned_matching_listener_t *_ptr; -} zc_moved_matching_listener_t; -typedef struct zc_moved_shm_client_list_t { - struct zc_owned_shm_client_list_t *_ptr; -} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -992,12 +1144,6 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif -typedef struct ze_moved_publication_cache_t { - struct ze_owned_publication_cache_t *_ptr; -} ze_moved_publication_cache_t; -typedef struct ze_moved_querying_subscriber_t { - struct ze_owned_querying_subscriber_t *_ptr; -} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1017,54 +1163,53 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t this_); +ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1072,12 +1217,12 @@ z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout, + const z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1141,7 +1286,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const struct z_loaned_shm_t **dst); + const z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1152,7 +1297,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - struct z_loaned_shm_t **dst); + z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1163,7 +1308,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - struct z_owned_shm_t *dst); + z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1260,13 +1405,13 @@ z_result_t z_bytes_from_iter(struct z_owned_bytes_t *this_, */ ZENOHC_API z_result_t z_bytes_from_pair(struct z_owned_bytes_t *this_, - struct z_moved_bytes_t first, - struct z_moved_bytes_t second); + struct z_moved_bytes_t *first, + struct z_moved_bytes_t *second); /** * Serializes a slice. * The slice is consumed upon function return. */ -ZENOHC_API void z_bytes_from_slice(struct z_owned_bytes_t *this_, struct z_moved_slice_t slice); +ZENOHC_API void z_bytes_from_slice(struct z_owned_bytes_t *this_, struct z_moved_slice_t *slice); /** * Serializes a statically allocated constant data. * @param this_: An uninitialized location in memory where `z_owned_bytes_t` is to be constructed. @@ -1302,7 +1447,7 @@ z_result_t z_bytes_from_str(struct z_owned_bytes_t *this_, * Serializes a string. * The string is consumed upon function return. */ -ZENOHC_API void z_bytes_from_string(struct z_owned_bytes_t *this_, struct z_moved_string_t s); +ZENOHC_API void z_bytes_from_string(struct z_owned_bytes_t *this_, struct z_moved_string_t *s); /** * Returns an iterator for multi-element serialized data. * @@ -1422,9 +1567,7 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t shm); +ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_moved_shm_t shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1432,7 +1575,7 @@ z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t shm); + z_moved_shm_mut_t shm); #endif /** * Serializes a slice by copying. @@ -1478,7 +1621,7 @@ ZENOHC_API void z_bytes_serialize_from_uint8(struct z_owned_bytes_t *this_, uint */ ZENOHC_API z_result_t z_bytes_writer_append(struct z_bytes_writer_t *this_, - struct z_moved_bytes_t bytes); + struct z_moved_bytes_t *bytes); /** * Appends bytes, with boundaries information. It would allow to read the same piece of data using `z_bytes_reader_read_bounded()`. * @@ -1486,7 +1629,7 @@ z_result_t z_bytes_writer_append(struct z_bytes_writer_t *this_, */ ZENOHC_API z_result_t z_bytes_writer_append_bounded(struct z_bytes_writer_t *this_, - struct z_moved_bytes_t bytes); + struct z_moved_bytes_t *bytes); /** * Writes `len` bytes from `src` into underlying data. * @@ -1500,27 +1643,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t this_); +ZENOHC_API void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); +const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1528,14 +1671,14 @@ void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1660,7 +1803,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const struct z_id_t *z_id); + const z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -1817,7 +1960,7 @@ ZENOHC_API z_result_t z_declare_queryable(struct z_owned_queryable_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_closure_query_t callback, + struct z_moved_closure_query_t *callback, struct z_queryable_options_t *options); /** * Constructs and declares a subscriber for a given key expression. Dropping subscriber @@ -1834,7 +1977,7 @@ ZENOHC_API z_result_t z_declare_subscriber(struct z_owned_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_closure_sample_t callback, + struct z_moved_closure_sample_t *callback, struct z_subscriber_options_t *options); /** * Sends request to delete data on specified key expression (used when working with Zenoh storages ). @@ -2355,13 +2498,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); +ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2501,7 +2644,7 @@ ZENOHC_API z_result_t z_get(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const char *parameters, - struct z_moved_closure_reply_t callback, + struct z_moved_closure_reply_t *callback, struct z_get_options_t *options); /** * Constructs default `z_get_options_t` @@ -2539,7 +2682,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2575,7 +2718,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2719,13 +2862,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); +ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t this_); #endif /** * Extract data from Memory Layout @@ -2734,21 +2877,21 @@ ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const struct z_loaned_memory_layout_t *this_); + const z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); +const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2756,7 +2899,7 @@ z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2812,21 +2955,21 @@ z_result_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t config, - const struct z_loaned_shm_client_storage_t *shm_clients); + const z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, - const struct z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, + const z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2856,7 +2999,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t this_); * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -2895,7 +3038,7 @@ ZENOHC_API void z_publisher_options_default(struct z_publisher_options_t *this_) */ ZENOHC_API z_result_t z_publisher_put(const struct z_loaned_publisher_t *this_, - struct z_moved_bytes_t payload, + struct z_moved_bytes_t *payload, struct z_publisher_put_options_t *options); /** * Constructs the default value for `z_publisher_put_options_t`. @@ -2914,7 +3057,7 @@ ZENOHC_API void z_publisher_put_options_default(struct z_publisher_put_options_t ZENOHC_API z_result_t z_put(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_bytes_t payload, + struct z_moved_bytes_t *payload, struct z_put_options_t *options); /** * Constructs the default value for `z_put_options_t`. @@ -3025,7 +3168,7 @@ const struct z_loaned_bytes_t *z_query_payload(const struct z_loaned_query_t *th ZENOHC_API z_result_t z_query_reply(const struct z_loaned_query_t *this_, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_bytes_t payload, + struct z_moved_bytes_t *payload, struct z_query_reply_options_t *options); /** * Sends a delete reply to a query. @@ -3065,7 +3208,7 @@ ZENOHC_API void z_query_reply_del_options_default(struct z_query_reply_del_optio */ ZENOHC_API z_result_t z_query_reply_err(const struct z_loaned_query_t *this_, - struct z_moved_bytes_t payload, + struct z_moved_bytes_t *payload, struct z_query_reply_err_options_t *options); /** * Constructs the default value for `z_query_reply_err_options_t`. @@ -3118,7 +3261,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3189,7 +3332,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3375,7 +3518,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3394,7 +3537,7 @@ ZENOHC_API const struct z_timestamp_t *z_sample_timestamp(const struct z_loaned_ */ ZENOHC_API z_result_t z_scout(struct z_moved_config_t config, - struct z_moved_closure_hello_t callback, + struct z_moved_closure_hello_t *callback, const struct z_scout_options_t *options); /** * Constructs the default values for the scouting operation. @@ -3428,26 +3571,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t this_); +ZENOHC_API void z_shm_client_drop(z_moved_shm_client_t this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(struct z_owned_shm_client_t *this_, +void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3455,179 +3598,177 @@ void z_shm_client_new(struct z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, - const struct z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, + const z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t this_); +ZENOHC_API void z_shm_client_storage_drop(z_moved_shm_client_storage_t this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); +const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, - const struct zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, + const zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(struct z_moved_shm_t this_); +ZENOHC_API void z_shm_drop(z_moved_shm_t this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t that); +ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_moved_shm_mut_t that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); +ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t this_); +ZENOHC_API void z_shm_mut_drop(z_moved_shm_mut_t this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); +ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t that); +ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3637,49 +3778,48 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t this_); +ZENOHC_API void z_shm_provider_drop(z_moved_shm_provider_t this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); +ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, + const z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3688,7 +3828,7 @@ z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3697,14 +3837,14 @@ void z_shm_provider_new(struct z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3713,13 +3853,13 @@ void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3798,47 +3938,46 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t this_); +ZENOHC_API void z_source_info_drop(z_moved_source_info_t this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); +ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API -const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); +ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(struct z_owned_source_info_t *this_, - const struct z_entity_global_id_t *source_id, +z_result_t z_source_info_new(z_owned_source_info_t *this_, + const z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -4054,7 +4193,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4422,7 +4561,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4459,32 +4598,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t this_); +ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); +const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t this_); #endif /** * Returns default value of `zc_locality_t` @@ -4496,13 +4635,13 @@ ZENOHC_API enum zc_locality_t zc_locality_default(void); * Checks the matching listener is for the gravestone state */ #if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); #endif /** * Constructs an empty matching listener */ #if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); +ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); #endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -4525,7 +4664,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t callback); #endif @@ -4535,8 +4674,7 @@ z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_liste * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_listener_t *this_); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4545,7 +4683,7 @@ z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t this_); +z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t2 *this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4556,46 +4694,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - struct z_moved_shm_client_t client, - struct zc_loaned_shm_client_list_t *list); + z_moved_shm_client_t client, + zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t this_); +ZENOHC_API void zc_shm_client_list_drop(zc_moved_shm_client_list_t this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); +const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); +zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4617,7 +4755,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4635,7 +4773,7 @@ z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *thi */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t callback, @@ -4645,19 +4783,19 @@ z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t this_); +ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4669,13 +4807,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t this_); +ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4684,7 +4822,7 @@ ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_ */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -4693,13 +4831,13 @@ z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber */ #if defined(UNSTABLE) ZENOHC_API -const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); +const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4713,7 +4851,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4721,5 +4859,5 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t this_); +ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t this_); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 124704465..6872f6381 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,14 +4,11 @@ #ifndef __cplusplus -static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t){x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t){x}; } -static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t){x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t){x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t){x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t){x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t){x}; } -static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t){x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t){x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return (z_moved_config_t){x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t){x}; } @@ -20,7 +17,6 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t){x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t){x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } -static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t){x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } @@ -32,36 +28,21 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t){x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t){x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return (z_moved_session_t){x}; } -static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t){x}; } -static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t){x}; } -static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t){x}; } -static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t){x}; } -static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t){x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t){x}; } -static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t){x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t){x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return (z_moved_string_t){x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t){x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_task_t){x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } -static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } -static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } -static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t){x}; } -static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } #define z_loan(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ - z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -70,7 +51,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ - z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -81,23 +61,14 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ - z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ - z_owned_shm_t : z_shm_loan, \ - z_owned_shm_mut_t : z_shm_mut_loan, \ - z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ - z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ - zc_owned_closure_log_t : zc_closure_log_loan, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ - zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ + zc_owned_closure_log_t : zc_closure_log_loan \ )(&this_) #define z_loan_mut(this_) \ @@ -108,22 +79,16 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_shm_t : z_shm_loan_mut, \ - z_owned_shm_mut_t : z_shm_mut_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ + z_owned_string_array_t : z_string_array_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_alloc_layout_t : z_alloc_layout_drop, \ z_moved_bytes_t : z_bytes_drop, \ - z_moved_chunk_alloc_result_t : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t : z_closure_hello_drop, \ z_moved_closure_query_t : z_closure_query_drop, \ z_moved_closure_reply_t : z_closure_reply_drop, \ z_moved_closure_sample_t : z_closure_sample_drop, \ - z_moved_closure_zid_t : z_closure_zid_drop, \ z_moved_condvar_t : z_condvar_drop, \ z_moved_config_t : z_config_drop, \ z_moved_encoding_t : z_encoding_drop, \ @@ -132,7 +97,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_moved_fifo_handler_sample_t : z_fifo_handler_sample_drop, \ z_moved_hello_t : z_hello_drop, \ z_moved_keyexpr_t : z_keyexpr_drop, \ - z_moved_memory_layout_t : z_memory_layout_drop, \ z_moved_mutex_t : z_mutex_drop, \ z_moved_publisher_t : z_publisher_drop, \ z_moved_query_t : z_query_drop, \ @@ -144,36 +108,21 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_moved_ring_handler_sample_t : z_ring_handler_sample_drop, \ z_moved_sample_t : z_sample_drop, \ z_moved_session_t : z_session_drop, \ - z_moved_shm_client_t : z_shm_client_drop, \ - z_moved_shm_client_storage_t : z_shm_client_storage_drop, \ - z_moved_shm_t : z_shm_drop, \ - z_moved_shm_mut_t : z_shm_mut_drop, \ - z_moved_shm_provider_t : z_shm_provider_drop, \ z_moved_slice_t : z_slice_drop, \ - z_moved_source_info_t : z_source_info_drop, \ z_moved_string_array_t : z_string_array_drop, \ z_moved_string_t : z_string_drop, \ z_moved_subscriber_t : z_subscriber_drop, \ z_moved_task_t : z_task_drop, \ - zc_moved_closure_log_t : zc_closure_log_drop, \ - zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ - zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ - zc_moved_matching_listener_t : zc_publisher_matching_listener_drop, \ - zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ + zc_moved_closure_log_t : zc_closure_log_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ - z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -182,7 +131,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ - z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ z_owned_query_t : z_query_move, \ @@ -194,36 +142,21 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ - z_owned_shm_client_t : z_shm_client_move, \ - z_owned_shm_client_storage_t : z_shm_client_storage_move, \ - z_owned_shm_t : z_shm_move, \ - z_owned_shm_mut_t : z_shm_mut_move, \ - z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ - z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ - zc_owned_closure_log_t : zc_closure_log_move, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ - zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ + zc_owned_closure_log_t : zc_closure_log_move \ )(&this_) #define z_null(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ - z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -232,7 +165,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ - z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -244,34 +176,19 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ - z_owned_shm_client_t* : z_shm_client_null, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ - z_owned_shm_mut_t* : z_shm_mut_null, \ - z_owned_shm_t* : z_shm_null, \ - z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ - z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ - zc_owned_matching_listener_t* : zc_matching_listener_null, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ - ze_owned_publication_cache_t* : ze_publication_cache_null, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ + zc_owned_closure_log_t* : zc_closure_log_null \ )(this_) -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -280,7 +197,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } @@ -292,36 +208,21 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ - z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -330,7 +231,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ - z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ z_owned_query_t* : z_query_take, \ @@ -342,36 +242,21 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ - z_owned_shm_client_t* : z_shm_client_take, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ - z_owned_shm_t* : z_shm_take, \ - z_owned_shm_mut_t* : z_shm_mut_take, \ - z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ - z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ - zc_owned_closure_log_t* : zc_closure_log_take, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ + zc_owned_closure_log_t* : zc_closure_log_take \ )(this_, x) #define z_check(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ - z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -380,7 +265,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ - z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -392,24 +276,12 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ - z_owned_shm_t : z_shm_check, \ - z_owned_shm_client_t : z_shm_client_check, \ - z_owned_shm_client_storage_t : z_shm_client_storage_check, \ - z_owned_shm_mut_t : z_shm_mut_check, \ - z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ - z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ - zc_owned_liveliness_token_t : zc_liveliness_token_check, \ - zc_owned_matching_listener_t : zc_matching_listener_check, \ - zc_owned_shm_client_list_t : zc_shm_client_list_check, \ - ze_owned_publication_cache_t : ze_publication_cache_check, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ + zc_owned_closure_log_t : zc_closure_log_check \ )(&this_) #define z_call(closure, hello) \ @@ -417,9 +289,7 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call, \ - const z_loaned_closure_zid_t* : z_closure_zid_call, \ - const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call \ )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ @@ -447,14 +317,11 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t #else // #ifndef __cplusplus -static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return z_moved_alloc_layout_t{x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return z_moved_bytes_t{x}; } -static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return z_moved_chunk_alloc_result_t{x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return z_moved_closure_hello_t{x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return z_moved_closure_query_t{x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return z_moved_closure_reply_t{x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return z_moved_closure_sample_t{x}; } -static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return z_moved_closure_zid_t{x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return z_moved_condvar_t{x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return z_moved_config_t{x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return z_moved_encoding_t{x}; } @@ -463,7 +330,6 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return z_moved_fifo_handler_sample_t{x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_hello_t{x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } -static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return z_moved_memory_layout_t{x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } @@ -475,35 +341,20 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return z_moved_ring_handler_sample_t{x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return z_moved_sample_t{x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return z_moved_session_t{x}; } -static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return z_moved_shm_client_t{x}; } -static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return z_moved_shm_client_storage_t{x}; } -static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return z_moved_shm_t{x}; } -static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return z_moved_shm_mut_t{x}; } -static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return z_moved_shm_provider_t{x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return z_moved_slice_t{x}; } -static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return z_moved_source_info_t{x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return z_moved_string_array_t{x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return z_moved_string_t{x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return z_moved_subscriber_t{x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_task_t{x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } -static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } -static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } -static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return zc_moved_matching_listener_t{x}; } -static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } -inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; -inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; -inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -512,7 +363,6 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; -inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -523,12 +373,7 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; -inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; -inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; -inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; -inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; -inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -536,10 +381,6 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; -inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; -inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; -inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; -inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -548,20 +389,14 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; -inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; -inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; -inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; -inline void z_drop(z_moved_alloc_layout_t this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; -inline void z_drop(z_moved_chunk_alloc_result_t this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t _closure) { z_closure_hello_drop(_closure); }; inline void z_drop(z_moved_closure_query_t closure) { z_closure_query_drop(closure); }; inline void z_drop(z_moved_closure_reply_t closure) { z_closure_reply_drop(closure); }; inline void z_drop(z_moved_closure_sample_t closure) { z_closure_sample_drop(closure); }; -inline void z_drop(z_moved_closure_zid_t closure) { z_closure_zid_drop(closure); }; inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; @@ -570,7 +405,6 @@ inline void z_drop(z_moved_fifo_handler_reply_t this_) { z_fifo_handler_reply_dr inline void z_drop(z_moved_fifo_handler_sample_t this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; @@ -582,34 +416,19 @@ inline void z_drop(z_moved_ring_handler_reply_t this_) { z_ring_handler_reply_dr inline void z_drop(z_moved_ring_handler_sample_t this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_shm_client_t this_) { z_shm_client_drop(this_); }; -inline void z_drop(z_moved_shm_client_storage_t this_) { z_shm_client_storage_drop(this_); }; -inline void z_drop(z_moved_shm_t this_) { z_shm_drop(this_); }; -inline void z_drop(z_moved_shm_mut_t this_) { z_shm_mut_drop(this_); }; -inline void z_drop(z_moved_shm_provider_t this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_source_info_t this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t closure) { zc_closure_log_drop(closure); }; -inline void z_drop(zc_moved_closure_matching_status_t closure) { zc_closure_matching_status_drop(closure); }; -inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; -inline z_result_t z_drop(zc_moved_matching_listener_t this_) { return zc_publisher_matching_listener_drop(this_); }; -inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; -inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; -inline z_moved_chunk_alloc_result_t z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& _closure) { return z_closure_hello_move(&_closure); }; inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure) { return z_closure_query_move(&closure); }; inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure) { return z_closure_reply_move(&closure); }; inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure) { return z_closure_sample_move(&closure); }; -inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure) { return z_closure_zid_move(&closure); }; inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -618,7 +437,6 @@ inline z_moved_fifo_handler_reply_t z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; @@ -630,34 +448,19 @@ inline z_moved_ring_handler_reply_t z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_shm_client_t z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; -inline z_moved_shm_client_storage_t z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; -inline z_moved_shm_t z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; -inline z_moved_shm_mut_t z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; -inline z_moved_shm_provider_t z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_source_info_t z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure) { return zc_closure_log_move(&closure); }; -inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_move(&closure); }; -inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; -inline zc_moved_matching_listener_t z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; -inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; -inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; -inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; -inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; @@ -666,7 +469,6 @@ inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_n inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; -inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; @@ -678,33 +480,18 @@ inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_n inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; -inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; -inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; -inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; -inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; -inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; -inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; -inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; -inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; -inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; -inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; -inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; -inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -713,7 +500,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } @@ -725,36 +511,18 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } -inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { - z_alloc_layout_take(this_, x); -}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { z_bytes_take(this_, x); }; -inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { - z_chunk_alloc_result_take(this_, x); -}; inline void z_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { z_closure_hello_take(_closure, x); }; @@ -767,9 +535,6 @@ inline void z_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) inline void z_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { z_closure_sample_take(closure, x); }; -inline void z_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { - z_closure_zid_take(closure, x); -}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { z_condvar_take(this_, x); }; @@ -794,9 +559,6 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { - z_memory_layout_take(this_, x); -}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { z_mutex_take(this_, x); }; @@ -830,27 +592,9 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t x) { z_session_take(this_, x); }; -inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { - z_shm_client_take(this_, x); -}; -inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { - z_shm_client_storage_take(this_, x); -}; -inline void z_take(z_owned_shm_t* this_, z_moved_shm_t x) { - z_shm_take(this_, x); -}; -inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { - z_shm_mut_take(this_, x); -}; -inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { - z_shm_provider_take(this_, x); -}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { - z_source_info_take(this_, x); -}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { z_string_array_take(this_, x); }; @@ -866,34 +610,13 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { inline void z_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { zc_closure_log_take(closure, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { - zc_closure_matching_status_take(closure, x); -}; -inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { - zc_liveliness_token_take(this_, x); -}; -inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { - zc_publisher_matching_listener_take(this_, x); -}; -inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { - zc_shm_client_list_take(this_, x); -}; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { - ze_querying_subscriber_take(this_, x); -}; -inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; -inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -902,7 +625,6 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; -inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -914,24 +636,12 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; -inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; -inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; -inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; -inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; -inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; -inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; -inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; -inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; -inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; -inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; -inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; -inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { @@ -946,12 +656,6 @@ inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; -inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { - z_closure_zid_call(closure, z_id); -}; -inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { - zc_closure_matching_status_call(closure, mathing_status); -}; inline void z_closure( @@ -990,24 +694,6 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; -inline void z_closure( - z_owned_closure_zid_t* closure, - void (*call)(const z_id_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; -inline void z_closure( - zc_owned_closure_matching_status_t* closure, - void (*call)(const zc_matching_status_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -1051,12 +737,8 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -1065,8 +747,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -1083,8 +763,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -1105,18 +783,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -1125,14 +793,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; #endif // #ifndef __cplusplus diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index afbd88aae..275371389 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -48,13 +48,13 @@ pub struct z_loaned_closure_hello_t { /// Moved closure. #[repr(C)] pub struct z_moved_closure_hello_t { - pub _ptr: Option<&'static mut z_owned_closure_hello_t>, + _this: z_owned_closure_hello_t, } decl_c_type!( owned(z_owned_closure_hello_t), loaned(z_loaned_closure_hello_t), - moved(z_moved_closure_hello_t) + moved(z_moved_closure_hello_t), ); impl Default for z_owned_closure_hello_t { diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs index 70190ee5e..754d63118 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -102,13 +102,13 @@ pub struct zc_loaned_closure_log_t { /// Moved closure. #[repr(C)] pub struct zc_moved_closure_log_t { - _ptr: Option<&'static mut zc_owned_closure_log_t>, + _this: zc_owned_closure_log_t, } decl_c_type!( owned(zc_owned_closure_log_t), loaned(zc_loaned_closure_log_t), - moved(zc_moved_closure_log_t) + moved(zc_moved_closure_log_t), ); impl Default for zc_owned_closure_log_t { diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index 5c36960c3..f3fc3767d 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -52,7 +52,6 @@ pub struct zc_moved_closure_matching_status_t { decl_c_type!( owned(zc_owned_closure_matching_status_t), loaned(zc_loaned_closure_matching_status_t), - moved(zc_moved_closure_matching_status_t) ); impl Default for zc_owned_closure_matching_status_t { diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index dcc5ed676..43b280850 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -31,7 +31,6 @@ use crate::{ decl_c_type!( owned(z_owned_fifo_handler_query_t, option flume::Receiver ), loaned(z_loaned_fifo_handler_query_t), - moved(z_moved_fifo_handler_query_t) ); /// Drops the handler and resets it to a gravestone state. @@ -151,7 +150,6 @@ decl_c_type!( option RingChannelHandler, ), loaned(z_loaned_ring_handler_query_t), -moved(z_moved_ring_handler_query_t) ); /// Drops the handler and resets it to a gravestone state. diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 0a468356c..85104a50f 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -47,13 +47,13 @@ pub struct z_loaned_closure_query_t { /// Moved closure. #[repr(C)] pub struct z_moved_closure_query_t { - pub _ptr: Option<&'static mut z_owned_closure_query_t>, + _this: z_owned_closure_query_t, } decl_c_type!( owned(z_owned_closure_query_t), loaned(z_loaned_closure_query_t), - moved(z_moved_closure_query_t) + moved(z_moved_closure_query_t), ); impl Default for z_owned_closure_query_t { diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 38937b3b8..112c68c2f 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -46,14 +46,15 @@ pub struct z_loaned_closure_reply_t { /// Moved closure. #[repr(C)] +#[derive(Default)] pub struct z_moved_closure_reply_t { - pub _ptr: Option<&'static mut z_owned_closure_reply_t>, + pub _this: z_owned_closure_reply_t, } decl_c_type!( owned(z_owned_closure_reply_t), loaned(z_loaned_closure_reply_t), - moved(z_moved_closure_reply_t) + moved(z_moved_closure_reply_t), ); impl Default for z_owned_closure_reply_t { diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index d2bebde69..741b754e6 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -31,7 +31,6 @@ use crate::{ decl_c_type!( owned(z_owned_fifo_handler_reply_t, option flume::Receiver), loaned(z_loaned_fifo_handler_reply_t), - moved(z_moved_fifo_handler_reply_t) ); /// Drops the handler and resets it to a gravestone state. @@ -147,7 +146,6 @@ pub use crate::opaque_types::{ decl_c_type!( owned(z_owned_ring_handler_reply_t, option RingChannelHandler), loaned(z_loaned_ring_handler_reply_t), - moved(z_moved_ring_handler_reply_t) ); /// Drops the handler and resets it to a gravestone state. diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index d80d9f484..c418b9d3e 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -31,7 +31,6 @@ use crate::{ decl_c_type!( owned(z_owned_fifo_handler_sample_t, option flume::Receiver), loaned(z_loaned_fifo_handler_sample_t), - moved(z_moved_fifo_handler_sample_t) ); /// Drops the handler and resets it to a gravestone state. @@ -153,7 +152,6 @@ decl_c_type!( option RingChannelHandler, ), loaned(z_loaned_ring_handler_sample_t), - moved(z_moved_ring_handler_sample_t) ); /// Drops the handler and resets it to a gravestone state. diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index 7d7ca2545..54ff18b03 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -47,13 +47,13 @@ pub struct z_loaned_closure_sample_t { /// Moved closure. #[repr(C)] pub struct z_moved_closure_sample_t { - pub _ptr: Option<&'static mut z_owned_closure_sample_t>, + _this: z_owned_closure_sample_t, } decl_c_type!( owned(z_owned_closure_sample_t), loaned(z_loaned_closure_sample_t), - moved(z_moved_closure_sample_t) + moved(z_moved_closure_sample_t), ); impl Default for z_owned_closure_sample_t { diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index 59e9d72ac..f63ffc503 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -53,7 +53,6 @@ pub struct z_moved_closure_zid_t { decl_c_type!( owned(z_owned_closure_zid_t), loaned(z_loaned_closure_zid_t), - moved(z_moved_closure_zid_t) ); impl Default for z_owned_closure_zid_t { diff --git a/src/collections.rs b/src/collections.rs index 2e32f971b..8563368a7 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -265,7 +265,6 @@ decl_c_type!( owned(z_owned_slice_t, CSliceOwned), loaned(z_loaned_slice_t, CSlice), view(z_view_slice_t, CSliceView), - moved(z_moved_slice_t) ); /// Constructs an empty view slice. @@ -525,7 +524,6 @@ decl_c_type!( owned(z_owned_string_t, CStringOwned), loaned(z_loaned_string_t, CString), view(z_view_string_t, CStringView), - moved(z_moved_string_t) ); /// Frees memory and invalidates `z_owned_string_t`, putting it in gravestone state. @@ -729,7 +727,6 @@ pub type ZVector = Vec; decl_c_type!( owned(z_owned_string_array_t, option ZVector), loaned(z_loaned_string_array_t), - moved(z_moved_string_array_t) ); /// Constructs a new empty string array. diff --git a/src/commons.rs b/src/commons.rs index 4f4a1e7ce..2b5499fe2 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -103,7 +103,6 @@ pub use crate::opaque_types::{z_moved_sample_t, z_owned_sample_t}; decl_c_type!( owned(z_owned_sample_t, option Sample), loaned(z_loaned_sample_t), - moved(z_moved_sample_t) ); /// Returns the key expression of the sample. @@ -482,7 +481,6 @@ pub use crate::opaque_types::{z_loaned_source_info_t, z_owned_source_info_t}; decl_c_type!( owned(z_owned_source_info_t, SourceInfo), loaned(z_loaned_source_info_t, SourceInfo), - moved(z_moved_source_info_t) ); #[cfg(feature = "unstable")] diff --git a/src/config.rs b/src/config.rs index 671098e55..735a63730 100644 --- a/src/config.rs +++ b/src/config.rs @@ -69,7 +69,6 @@ pub use crate::opaque_types::{z_loaned_config_t, z_moved_config_t, z_owned_confi decl_c_type!( owned(z_owned_config_t, option Config), loaned(z_loaned_config_t), - moved(z_moved_config_t) ); /// Borrows config. diff --git a/src/encoding.rs b/src/encoding.rs index 71c701140..239ac5eff 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -33,7 +33,6 @@ use crate::{ decl_c_type!( owned(z_owned_encoding_t, Encoding), loaned(z_loaned_encoding_t, Encoding), - moved(z_moved_encoding_t) ); /// Constructs a `z_owned_encoding_t` from a specified substring. diff --git a/src/get.rs b/src/get.rs index f861a40c8..3edb1cc42 100644 --- a/src/get.rs +++ b/src/get.rs @@ -29,12 +29,7 @@ use zenoh::{ }; use crate::{ - result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, - z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, - z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, - z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, - z_query_target_t, + result, transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, z_query_target_t }; #[cfg(feature = "unstable")] use crate::{ @@ -72,7 +67,6 @@ pub use crate::opaque_types::{z_loaned_reply_err_t, z_moved_reply_err_t, z_owned decl_c_type!( owned(z_owned_reply_err_t, ReplyErrorNewtype), loaned(z_loaned_reply_err_t, ReplyErrorNewtype), - moved(z_moved_reply_err_t) ); /// Constructs an empty `z_owned_reply_err_t`. @@ -116,7 +110,6 @@ pub use crate::opaque_types::{z_loaned_reply_t, z_moved_reply_t, z_owned_reply_t decl_c_type!( owned(z_owned_reply_t, option Reply), loaned(z_loaned_reply_t), - moved(z_moved_reply_t) ); /// Returns ``true`` if reply contains a valid response, ``false`` otherwise (in this case it contains a errror value). @@ -188,9 +181,9 @@ pub struct z_get_options_t { /// The replies consolidation strategy to apply on replies to the query. pub consolidation: z_query_consolidation_t, /// An optional payload to attach to the query. - pub payload: z_moved_bytes_t, + pub payload: Option<&'static mut z_moved_bytes_t>, /// An optional encoding of the query payload and or attachment. - pub encoding: z_moved_encoding_t, + pub encoding: Option<&'static mut z_moved_encoding_t>, /// The congestion control to apply when routing the query. pub congestion_control: z_congestion_control_t, /// If true, Zenoh will not wait to batch this message with others to reduce the bandwith. @@ -205,9 +198,9 @@ pub struct z_get_options_t { pub priority: z_priority_t, #[cfg(feature = "unstable")] /// The source info for the query. - pub source_info: z_moved_source_info_t, + pub source_info: Option<&'static mut z_moved_source_info_t>, /// An optional attachment to attach to the query. - pub attachment: z_moved_bytes_t, + pub attachment: Option<&'static mut z_moved_bytes_t>, /// The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration. pub timeout_ms: u64, } @@ -250,12 +243,10 @@ pub unsafe extern "C" fn z_get( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, parameters: *const c_char, - callback: z_moved_closure_reply_t, + callback: &mut z_moved_closure_reply_t, options: Option<&mut z_get_options_t>, ) -> result::z_result_t { - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.into_rust_type(); let p = if parameters.is_null() { "" } else { @@ -265,18 +256,18 @@ pub unsafe extern "C" fn z_get( let key_expr = key_expr.as_rust_type_ref(); let mut get = session.get(Selector::from((key_expr, p))); if let Some(options) = options { - if let Some(payload) = options.payload.take_rust_type() { - get = get.payload(payload); + if let Some(payload) = options.payload.take() { + get = get.payload(payload.into_rust_type()); } - if let Some(encoding) = options.encoding.take_rust_type() { - get = get.encoding(encoding); + if let Some(encoding) = options.encoding.take() { + get = get.encoding(encoding.into_rust_type()); } #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take_rust_type() { - get = get.source_info(source_info); + if let Some(source_info) = options.source_info.take() { + get = get.source_info(source_info.into_rust_type()); } - if let Some(attachment) = options.attachment.take_rust_type() { - get = get.attachment(attachment); + if let Some(attachment) = options.attachment.take() { + get = get.attachment(attachment.into_rust_type()); } get = get diff --git a/src/keyexpr.rs b/src/keyexpr.rs index acd953c0d..64dcd80b5 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -34,7 +34,6 @@ decl_c_type! { owned(z_owned_keyexpr_t, option KeyExpr<'static>), loaned(z_loaned_keyexpr_t), view(z_view_keyexpr_t, Option>), - moved(z_moved_keyexpr_t) } /// Constructs an owned key expression in a gravestone state. diff --git a/src/liveliness.rs b/src/liveliness.rs index f7826accf..348e4810c 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -30,7 +30,6 @@ use crate::{ decl_c_type!( owned(zc_owned_liveliness_token_t, option LivelinessToken<'static>), loaned(zc_loaned_liveliness_token_t), - moved(zc_moved_liveliness_token_t) ); /// Constructs liveliness token in its gravestone state. diff --git a/src/payload.rs b/src/payload.rs index 09c641e81..aee6f8804 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -41,7 +41,6 @@ use crate::{z_loaned_shm_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_t}; decl_c_type! { owned(z_owned_bytes_t, ZBytes), loaned(z_loaned_bytes_t), - moved(z_moved_bytes_t), } /// The gravestone value for `z_owned_bytes_t`. @@ -466,10 +465,10 @@ pub extern "C" fn z_bytes_deserialize_into_double( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_from_slice( this: &mut MaybeUninit, - slice: z_moved_slice_t, + slice: &mut z_moved_slice_t, ) { let slice = slice.into_rust_type(); - let payload = slice.map(ZBytes::from).unwrap_or_default(); + let payload = ZBytes::from(slice); this.as_rust_type_mut_uninit().write(payload); } @@ -558,11 +557,11 @@ pub unsafe extern "C" fn z_bytes_serialize_from_buf( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_from_string( this: &mut MaybeUninit, - s: z_moved_string_t, + s: &mut z_moved_string_t, ) { // TODO: verify that string is a valid utf-8 string ? let cs = s.into_rust_type(); - let payload = cs.map(ZBytes::from).unwrap_or_default(); + let payload = ZBytes::from(cs); this.as_rust_type_mut_uninit().write(payload); } @@ -644,17 +643,12 @@ pub unsafe extern "C" fn z_bytes_serialize_from_str( #[no_mangle] pub extern "C" fn z_bytes_from_pair( this: &mut MaybeUninit, - first: z_moved_bytes_t, - second: z_moved_bytes_t, + first: &mut z_moved_bytes_t, + second: &mut z_moved_bytes_t, ) -> z_result_t { - if let (Some(first), Some(second)) = (first.into_rust_type(), second.into_rust_type()) { - let payload = ZBytes::serialize((first, second)); - this.as_rust_type_mut_uninit().write(payload); - Z_OK - } else { - this.as_rust_type_mut_uninit().write(ZBytes::default()); - Z_EINVAL - } + let payload = ZBytes::serialize((first.into_rust_type(), second.into_rust_type())); + this.as_rust_type_mut_uninit().write(payload); + Z_OK } /// Deserializes into a pair of `z_owned_bytes_t` objects. @@ -924,12 +918,9 @@ unsafe extern "C" fn z_bytes_writer_write_all( #[no_mangle] unsafe extern "C" fn z_bytes_writer_append( this: &mut z_bytes_writer_t, - bytes: z_moved_bytes_t, + bytes: &mut z_moved_bytes_t, ) -> z_result_t { - let Some(bytes) = bytes.into_rust_type() else { - return result::Z_ENULL; - }; - this.as_rust_type_mut().append(bytes); + this.as_rust_type_mut().append(bytes.into_rust_type()); result::Z_OK } @@ -940,11 +931,8 @@ unsafe extern "C" fn z_bytes_writer_append( #[no_mangle] unsafe extern "C" fn z_bytes_writer_append_bounded( this: &mut z_bytes_writer_t, - bytes: z_moved_bytes_t, + bytes: &mut z_moved_bytes_t, ) -> z_result_t { - let Some(bytes) = bytes.into_rust_type() else { - return result::Z_ENULL; - }; - this.as_rust_type_mut().serialize(bytes); + this.as_rust_type_mut().serialize(bytes.into_rust_type()); result::Z_OK } diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index 9f142a83f..6150bc73b 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -15,7 +15,6 @@ use crate::{ decl_c_type!( owned(z_owned_mutex_t, option(Mutex<()>, Option>)), loaned(z_loaned_mutex_t), - moved(z_moved_mutex_t) ); /// Constructs a mutex. @@ -111,7 +110,6 @@ pub use crate::opaque_types::{z_loaned_condvar_t, z_moved_condvar_t, z_owned_con decl_c_type_inequal!( owned(z_owned_condvar_t, option Condvar), loaned(z_loaned_condvar_t), - moved(z_moved_condvar_t) ); /// Constructs conditional variable. @@ -197,7 +195,6 @@ pub unsafe extern "C" fn z_condvar_wait( pub use crate::opaque_types::{z_moved_task_t, z_owned_task_t}; decl_c_type!( owned(z_owned_task_t, option JoinHandle<()>), - moved(z_moved_task_t) ); #[repr(C)] diff --git a/src/publication_cache.rs b/src/publication_cache.rs index 611683748..0ae925fdc 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -65,7 +65,6 @@ decl_c_type!( option zenoh_ext::PublicationCache<'static>, ), loaned(ze_loaned_publication_cache_t), - moved(ze_moved_publication_cache_t) ); /// Constructs and declares a publication cache. diff --git a/src/publisher.rs b/src/publisher.rs index e34df423a..4c1a14190 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -28,7 +28,7 @@ use crate::z_moved_source_info_t; use crate::zc_moved_closure_matching_status_t; use crate::{ result::{self}, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_congestion_control_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_encoding_t, z_priority_t, z_timestamp_t, }; @@ -42,7 +42,7 @@ use crate::{ #[repr(C)] pub struct z_publisher_options_t { /// Default encoding for messages put by this publisher. - pub encoding: z_moved_encoding_t, + pub encoding: Option<&'static mut z_moved_encoding_t>, /// The congestion control to apply when routing messages from this publisher. pub congestion_control: z_congestion_control_t, /// The priority of messages from this publisher. @@ -71,7 +71,6 @@ pub use crate::opaque_types::{z_loaned_publisher_t, z_moved_publisher_t, z_owned decl_c_type!( owned(z_owned_publisher_t, option Publisher<'static>), loaned(z_loaned_publisher_t), - moved(z_moved_publisher_t) ); /// Constructs and declares a publisher for the given key expression. @@ -106,8 +105,8 @@ pub extern "C" fn z_declare_publisher( { p = p.allowed_destination(options.allowed_destination.into()); } - if let Some(encoding) = options.encoding.take_rust_type() { - p = p.encoding(encoding); + if let Some(encoding) = options.encoding.take() { + p = p.encoding(encoding.into_rust_type()); } } match p.wait() { @@ -163,14 +162,14 @@ pub unsafe extern "C" fn z_publisher_loan_mut( #[repr(C)] pub struct z_publisher_put_options_t { /// The encoding of the data to publish. - pub encoding: z_moved_encoding_t, + pub encoding: Option<&'static mut z_moved_encoding_t>, /// The timestamp of the publication. pub timestamp: Option<&'static z_timestamp_t>, /// The source info for the publication. #[cfg(feature = "unstable")] - pub source_info: z_moved_source_info_t, + pub source_info: Option<&'static mut z_moved_source_info_t>, /// The attachment to attach to the publication. - pub attachment: z_moved_bytes_t, + pub attachment: Option<&'static mut z_moved_bytes_t>, } /// Constructs the default value for `z_publisher_put_options_t`. @@ -203,25 +202,22 @@ pub extern "C" fn z_publisher_put_options_default( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_publisher_put( this: &z_loaned_publisher_t, - payload: z_moved_bytes_t, + payload: &mut z_moved_bytes_t, options: Option<&mut z_publisher_put_options_t>, ) -> result::z_result_t { let publisher = this.as_rust_type_ref(); - let Some(payload) = payload.into_rust_type() else { - return result::Z_EINVAL; - }; - + let payload = payload.into_rust_type(); let mut put = publisher.put(payload); if let Some(options) = options { - if let Some(encoding) = options.encoding.take_rust_type() { - put = put.encoding(encoding); + if let Some(encoding) = options.encoding.take() { + put = put.encoding(encoding.into_rust_type()); }; #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take_rust_type() { - put = put.source_info(source_info); + if let Some(source_info) = options.source_info.take() { + put = put.source_info(source_info.into_rust_type()); }; - if let Some(attachment) = options.attachment.take_rust_type() { - put = put.attachment(attachment); + if let Some(attachment) = options.attachment.take() { + put = put.attachment(attachment.into_rust_type()); } if let Some(timestamp) = options.timestamp { put = put.timestamp(Some(*timestamp.as_rust_type_ref())); @@ -292,11 +288,10 @@ pub extern "C" fn z_publisher_keyexpr(publisher: &z_loaned_publisher_t) -> &z_lo } #[cfg(feature = "unstable")] -pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; +pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_moved_matching_listener_t2, zc_owned_matching_listener_t}; #[cfg(feature = "unstable")] decl_c_type!( owned(zc_owned_matching_listener_t, option MatchingListener<'static, ()>), - moved(zc_moved_matching_listener_t) ); /// Constructs an empty matching listener @@ -370,9 +365,9 @@ pub extern "C" fn zc_publisher_matching_listener_declare( #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn zc_publisher_matching_listener_undeclare( - this: zc_moved_matching_listener_t, + this: &mut zc_moved_matching_listener_t2, ) -> result::z_result_t { - if let Some(p) = this.into_rust_type().take() { + if let Some(p) = this.dropper().as_rust_type_mut() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -388,7 +383,7 @@ pub extern "C" fn zc_publisher_matching_listener_undeclare( #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn zc_publisher_matching_listener_drop( - this: zc_moved_matching_listener_t, + this: &mut zc_moved_matching_listener_t, ) -> result::z_result_t { zc_publisher_matching_listener_undeclare(this) } diff --git a/src/put.rs b/src/put.rs index a440fe0fb..f8640b0e5 100644 --- a/src/put.rs +++ b/src/put.rs @@ -25,7 +25,7 @@ use crate::z_moved_source_info_t; use crate::{ commons::*, result, - transmute::{IntoRustType, RustTypeRef, TakeRustType}, + transmute::{IntoRustType, RustTypeRef}, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_encoding_t, z_timestamp_t, }; @@ -34,7 +34,7 @@ use crate::{ #[allow(non_camel_case_types)] pub struct z_put_options_t { /// The encoding of the message. - pub encoding: z_moved_encoding_t, + pub encoding: Option<&'static mut z_moved_encoding_t>, /// The congestion control to apply when routing this message. pub congestion_control: z_congestion_control_t, /// The priority of this message. @@ -48,9 +48,9 @@ pub struct z_put_options_t { pub allowed_destination: zc_locality_t, /// The source info for the message. #[cfg(feature = "unstable")] - pub source_info: z_moved_source_info_t, + pub source_info: Option<&'static mut z_moved_source_info_t>, /// The attachment to this message. - pub attachment: z_moved_bytes_t, + pub attachment: Option<&'static mut z_moved_bytes_t>, } /// Constructs the default value for `z_put_options_t`. @@ -84,26 +84,23 @@ pub extern "C" fn z_put_options_default(this: &mut MaybeUninit) pub extern "C" fn z_put( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - payload: z_moved_bytes_t, + payload: &mut z_moved_bytes_t, options: Option<&mut z_put_options_t>, ) -> result::z_result_t { let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let Some(payload) = payload.into_rust_type() else { - return result::Z_EINVAL; - }; - + let payload = payload.into_rust_type(); let mut put = session.put(key_expr, payload); if let Some(options) = options { - if let Some(encoding) = options.encoding.take_rust_type() { - put = put.encoding(encoding); + if let Some(encoding) = options.encoding.take() { + put = put.encoding(encoding.into_rust_type()); }; #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take_rust_type() { - put = put.source_info(source_info); + if let Some(source_info) = options.source_info.take() { + put = put.source_info(source_info.into_rust_type()); }; - if let Some(attachment) = options.attachment.take_rust_type() { - put = put.attachment(attachment); + if let Some(attachment) = options.attachment.take() { + put = put.attachment(attachment.into_rust_type()); } if let Some(timestamp) = options.timestamp.as_ref() { put = put.timestamp(Some(timestamp.into_rust_type())); diff --git a/src/queryable.rs b/src/queryable.rs index 7fa2fefb6..71821f0e4 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -27,7 +27,7 @@ pub use crate::opaque_types::{z_loaned_queryable_t, z_owned_queryable_t}; use crate::z_moved_source_info_t; use crate::{ result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_closure_query_call, z_closure_query_loan, z_congestion_control_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_query_t, z_moved_encoding_t, z_moved_queryable_t, z_priority_t, z_timestamp_t, @@ -36,7 +36,6 @@ use crate::{ decl_c_type!( owned(z_owned_queryable_t, option Queryable<'static, ()>), loaned(z_loaned_queryable_t), - moved(z_moved_queryable_t) ); /// Constructs a queryable in its gravestone value. @@ -59,7 +58,6 @@ pub use crate::opaque_types::{z_loaned_query_t, z_moved_query_t, z_owned_query_t decl_c_type!( owned(z_owned_query_t, option Query), loaned(z_loaned_query_t), - moved(z_moved_query_t) ); /// Constructs query in its gravestone value. @@ -114,7 +112,7 @@ pub extern "C" fn z_queryable_options_default(this: &mut MaybeUninit, /// The congestion control to apply when routing the reply. pub congestion_control: z_congestion_control_t, /// The priority of the reply. @@ -125,9 +123,9 @@ pub struct z_query_reply_options_t { pub timestamp: Option<&'static mut z_timestamp_t>, /// The source info for the reply. #[cfg(feature = "unstable")] - pub source_info: z_moved_source_info_t, + pub source_info: Option<&'static mut z_moved_source_info_t>, /// The attachment to this reply. - pub attachment: z_moved_bytes_t, + pub attachment: Option<&'static mut z_moved_bytes_t>, } /// Constructs the default value for `z_query_reply_options_t`. @@ -152,7 +150,7 @@ pub extern "C" fn z_query_reply_options_default(this: &mut MaybeUninit, } /// Constructs the default value for `z_query_reply_err_options_t`. @@ -181,9 +179,9 @@ pub struct z_query_reply_del_options_t { pub timestamp: Option<&'static mut z_timestamp_t>, /// The source info for the reply. #[cfg(feature = "unstable")] - pub source_info: z_moved_source_info_t, + pub source_info: Option<&'static mut z_moved_source_info_t>, /// The attachment to this reply. - pub attachment: z_moved_bytes_t, + pub attachment: Option<&'static mut z_moved_bytes_t>, } /// Constructs the default value for `z_query_reply_del_options_t`. @@ -218,15 +216,13 @@ pub extern "C" fn z_declare_queryable( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: z_moved_closure_query_t, + callback: &mut z_moved_closure_query_t, options: Option<&mut z_queryable_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); let keyexpr = key_expr.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.into_rust_type(); let mut builder = session.declare_queryable(keyexpr); if let Some(options) = options { builder = builder.complete(options.complete); @@ -298,26 +294,23 @@ pub extern "C" fn z_queryable_check(this: &z_owned_queryable_t) -> bool { pub extern "C" fn z_query_reply( this: &z_loaned_query_t, key_expr: &z_loaned_keyexpr_t, - payload: z_moved_bytes_t, + payload: &mut z_moved_bytes_t, options: Option<&mut z_query_reply_options_t>, ) -> result::z_result_t { let query = this.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let Some(payload) = payload.into_rust_type() else { - return result::Z_EINVAL; - }; - + let payload = payload.into_rust_type(); let mut reply = query.reply(key_expr, payload); if let Some(options) = options { - if let Some(encoding) = options.encoding.take_rust_type() { - reply = reply.encoding(encoding); + if let Some(encoding) = options.encoding.take() { + reply = reply.encoding(encoding.into_rust_type()); }; #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take_rust_type() { - reply = reply.source_info(source_info); + if let Some(source_info) = options.source_info.take() { + reply = reply.source_info(source_info.into_rust_type()); }; - if let Some(attachment) = options.attachment.take_rust_type() { - reply = reply.attachment(attachment); + if let Some(attachment) = options.attachment.take() { + reply = reply.attachment(attachment.into_rust_type()); } if let Some(timestamp) = options.timestamp.as_ref() { reply = reply.timestamp(Some(timestamp.into_rust_type())); @@ -350,17 +343,15 @@ pub extern "C" fn z_query_reply( #[no_mangle] pub unsafe extern "C" fn z_query_reply_err( this: &z_loaned_query_t, - payload: z_moved_bytes_t, + payload: &mut z_moved_bytes_t, options: Option<&mut z_query_reply_err_options_t>, ) -> result::z_result_t { let query = this.as_rust_type_ref(); - let Some(payload) = payload.into_rust_type() else { - return result::Z_EINVAL; - }; - + let payload = payload.into_rust_type(); let reply = query.reply_err(payload).encoding( options - .and_then(|o| o.encoding.take_rust_type()) + .and_then(|o| o.encoding.take()) + .map(|e| e.into_rust_type()) .unwrap_or(Encoding::default()), ); @@ -396,11 +387,11 @@ pub unsafe extern "C" fn z_query_reply_del( let mut reply = query.reply_del(key_expr); if let Some(options) = options { #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take_rust_type() { - reply = reply.source_info(source_info); + if let Some(source_info) = options.source_info.take() { + reply = reply.source_info(source_info.into_rust_type()); }; - if let Some(attachment) = options.attachment.take_rust_type() { - reply = reply.attachment(attachment); + if let Some(attachment) = options.attachment.take() { + reply = reply.attachment(attachment.into_rust_type()); } if let Some(timestamp) = options.timestamp.as_ref() { reply = reply.timestamp(Some(timestamp.into_rust_type())); diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index fda55ec3b..80536be82 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -39,7 +39,6 @@ decl_c_type!( option(zenoh_ext::FetchingSubscriber<'static, ()>, &'static Session), ), loaned(ze_loaned_querying_subscriber_t), - moved(ze_moved_querying_subscriber_t) ); /// Constructs a querying subscriber in a gravestone state. diff --git a/src/scouting.rs b/src/scouting.rs index 8118376fa..06e1a67a3 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -31,7 +31,6 @@ use crate::{transmute::IntoCType, z_id_t}; decl_c_type!( owned(z_owned_hello_t, option Hello ), loaned(z_loaned_hello_t), - moved(z_moved_hello_t) ); /// Frees memory and resets hello message to its gravestone state. @@ -156,15 +155,13 @@ pub extern "C" fn z_scout_options_default(this: &mut MaybeUninit, ) -> result::z_result_t { if cfg!(feature = "logger-autoinit") { zc_init_logging(); } - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.into_rust_type(); let options = options.cloned().unwrap_or_default(); let what = WhatAmIMatcher::try_from(options.what as u8).unwrap_or(WhatAmI::Router | WhatAmI::Peer); diff --git a/src/session.rs b/src/session.rs index ddc434886..4b620cb68 100644 --- a/src/session.rs +++ b/src/session.rs @@ -27,7 +27,6 @@ use crate::{ decl_c_type!( owned(z_owned_session_t, option Arc), loaned(z_loaned_session_t), - moved(z_moved_session_t) ); /// Borrows session. diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 20836d725..8b5261e74 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -27,7 +27,6 @@ use crate::{ decl_c_type!( owned(z_owned_shm_t, option ZShm), loaned(z_loaned_shm_t, zshm), - moved(z_moved_shm_t) ); /// Constructs ZShm slice from ZShmMut slice diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index 75c3502ac..ecb40a7d4 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -27,7 +27,6 @@ use crate::{ decl_c_type!( owned(z_owned_shm_mut_t, option ZShmMut), loaned(z_loaned_shm_mut_t, zshmmut), - moved(z_moved_shm_mut_t) ); /// Tries to construct ZShmMut slice from ZShm slice diff --git a/src/shm/client/shm_client.rs b/src/shm/client/shm_client.rs index e1061976d..9dfe702e3 100644 --- a/src/shm/client/shm_client.rs +++ b/src/shm/client/shm_client.rs @@ -41,7 +41,6 @@ pub struct zc_shm_client_callbacks_t { decl_c_type!( owned(z_owned_shm_client_t, option Arc), - moved(z_moved_shm_client_t) ); #[derive(Debug)] diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index 528c7f6d4..c86028733 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -28,7 +28,6 @@ use crate::{ decl_c_type!( owned(zc_owned_shm_client_list_t, option Vec<(ProtocolID, Arc)>), loaned(zc_loaned_shm_client_list_t), - moved(zc_moved_shm_client_list_t) ); /// Creates a new empty list of SHM Clients @@ -95,7 +94,6 @@ pub extern "C" fn zc_shm_client_list_add_client( decl_c_type!( owned(z_owned_shm_client_storage_t, option Arc ), loaned(z_loaned_shm_client_storage_t), - moved(z_moved_shm_client_storage_t) ); #[no_mangle] diff --git a/src/shm/provider/alloc_layout.rs b/src/shm/provider/alloc_layout.rs index add466290..760e7780e 100644 --- a/src/shm/provider/alloc_layout.rs +++ b/src/shm/provider/alloc_layout.rs @@ -48,7 +48,6 @@ pub enum CSHMLayout { decl_c_type!( owned(z_owned_alloc_layout_t, option CSHMLayout), loaned(z_loaned_alloc_layout_t), - moved(z_moved_alloc_layout_t) ); /// Creates a new Alloc Layout for SHM Provider diff --git a/src/shm/provider/shm_provider.rs b/src/shm/provider/shm_provider.rs index 4c2dc479f..104a0f3cd 100644 --- a/src/shm/provider/shm_provider.rs +++ b/src/shm/provider/shm_provider.rs @@ -52,7 +52,6 @@ pub enum CSHMProvider { decl_c_type!( owned(z_owned_shm_provider_t, option CSHMProvider), loaned(z_loaned_shm_provider_t), - moved(z_moved_shm_provider_t) ); /// Creates a new SHM Provider diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index e56caf375..c528bc96e 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -114,7 +114,6 @@ decl_c_type!(copy(z_alloc_alignment_t, AllocAlignment),); decl_c_type_inequal!( owned(z_owned_memory_layout_t, option MemoryLayout), loaned(z_loaned_memory_layout_t), - moved(z_moved_memory_layout_t) ); /// Creates a new Memory Layout @@ -188,7 +187,6 @@ pub extern "C" fn z_memory_layout_get_data( decl_c_type!( owned(z_owned_chunk_alloc_result_t, option ChunkAllocResult), loaned(z_loaned_chunk_alloc_result_t), - moved(z_moved_chunk_alloc_result_t) ); /// Creates a new Chunk Alloc Result with Ok value diff --git a/src/subscriber.rs b/src/subscriber.rs index 9929b2e0a..4cdce1a25 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -62,7 +62,6 @@ pub use crate::opaque_types::{z_loaned_subscriber_t, z_moved_subscriber_t, z_own decl_c_type!( owned(z_owned_subscriber_t, option Subscriber<'static, ()>), loaned(z_loaned_subscriber_t), - moved(z_moved_subscriber_t) ); /// Constructs a subscriber in a gravestone state. @@ -112,16 +111,13 @@ pub extern "C" fn z_declare_subscriber( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: z_moved_closure_sample_t, + callback: &mut z_moved_closure_sample_t, options: Option<&mut z_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - this.write(None); - return result::Z_EINVAL; - }; + let callback = callback.into_rust_type(); let mut subscriber = session .declare_subscriber(key_expr) .callback(move |sample| { diff --git a/src/transmute.rs b/src/transmute.rs index 6213249c5..e08cf9758 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -47,16 +47,25 @@ pub(crate) trait IntoRustType: Sized { type RustType; fn into_rust_type(self) -> Self::RustType; } -pub(crate) trait TakeRustType: IntoRustType + Default { - fn take_rust_type(&mut self) -> Self::RustType { - std::mem::take(self).into_rust_type() - } -} pub(crate) trait IntoCType: Sized { type CType; fn into_c_type(self) -> Self::CType; } +impl IntoRustType for &mut T where T: Default + IntoRustType { + type RustType = T::RustType; + fn into_rust_type(self) -> Self::RustType { + std::mem::take(self).into_rust_type() + } +} + +impl IntoCType for &mut T where T: Default + IntoCType { + type CType = T::CType; + fn into_c_type(self) -> Self::CType { + std::mem::take(self).into_c_type() + } +} + macro_rules! validate_equivalence { ($type_a:ty, $type_b:ty) => { const _: () = { @@ -99,8 +108,6 @@ macro_rules! validate_equivalence { #[macro_export] macro_rules! impl_transmute { - (as_moved ($rust_type:ty, $c_type:ty)) => { - }; (as_c ($rust_type:ty, $c_type:ty)) => { impl $crate::transmute::CTypeRef for $rust_type { @@ -181,7 +188,6 @@ macro_rules! impl_transmute { unsafe { std::mem::transmute::<$rust_type, $c_type>(<$rust_type>::default()) } } } - impl $crate::transmute::TakeRustType for $c_type {} }; (into_c ($rust_type:ty, $c_type:ty)) => { impl $crate::transmute::IntoCType for $rust_type { @@ -194,103 +200,33 @@ macro_rules! impl_transmute { } macro_rules! impl_owned { - (owned $c_owned_type:ty, moved $c_moved_type:ty, moved2 $c_moved_type2:ty, inner rust option $rust_inner_type:ty) => { + (owned $c_owned_type:ty, inner rust option $rust_inner_type:ty) => { impl_transmute!(as_c_owned(Option<$rust_inner_type>, $c_owned_type)); impl_transmute!(as_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(into_rust($c_owned_type, Option<$rust_inner_type>)); + impl_transmute!(into_c(Option<$rust_inner_type>, $c_owned_type)); impl_transmute!(take_rust($c_owned_type, Option<$rust_inner_type>)); - - impl $crate::transmute::IntoRustType for $c_moved_type { - type RustType = Option<$rust_inner_type>; - fn into_rust_type(self) -> Self::RustType { - use $crate::transmute::RustTypeRef; - let mut this = self; - // expicit types for better understanding - let ptr: &mut Option<&mut Option<$rust_inner_type>> = - &mut this._ptr.as_mut().map(|r| r.as_rust_type_mut()); - let res: Option<$rust_inner_type> = - ptr.as_mut().map(|r| std::mem::take(*r)).flatten(); - res - } - } - - impl $crate::transmute::TakeRustType for $c_moved_type {} - impl Drop for $c_moved_type { - fn drop(&mut self) { - self.take(); - } - } }; - - (owned $c_owned_type:ty, moved $c_moved_type:ty, inner rust option $rust_inner_type:ty) => { + (owned $c_owned_type:ty, inner rust option $rust_inner_type:ty) => { impl_transmute!(as_c_owned(Option<$rust_inner_type>, $c_owned_type)); impl_transmute!(as_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(into_rust($c_owned_type, Option<$rust_inner_type>)); impl_transmute!(take_rust($c_owned_type, Option<$rust_inner_type>)); - - impl $crate::transmute::IntoRustType for $c_moved_type { - type RustType = Option<$rust_inner_type>; - fn into_rust_type(self) -> Self::RustType { - use $crate::transmute::RustTypeRef; - let mut this = self; - // expicit types for better understanding - let ptr: &mut Option<&mut Option<$rust_inner_type>> = - &mut this._ptr.as_mut().map(|r| r.as_rust_type_mut()); - let res: Option<$rust_inner_type> = - ptr.as_mut().map(|r| std::mem::take(*r)).flatten(); - res - } - } - impl $crate::transmute::TakeRustType for $c_moved_type {} - impl Drop for $c_moved_type { - fn drop(&mut self) { - self.take(); - } - } }; - (owned $c_owned_type:ty, moved $c_moved_type:ty, inner rust $rust_owned_type:ty) => { + (owned $c_owned_type:ty, inner rust $rust_owned_type:ty) => { impl_transmute!(as_c_owned($rust_owned_type, $c_owned_type)); impl_transmute!(as_rust($c_owned_type, $rust_owned_type)); impl_transmute!(into_rust($c_owned_type, $rust_owned_type)); impl_transmute!(take_rust($c_owned_type, $rust_owned_type)); - - impl $crate::transmute::IntoRustType for $c_moved_type { - type RustType = Option<$rust_owned_type>; - fn into_rust_type(self) -> Self::RustType { - use $crate::transmute::RustTypeRef; - let mut this = self; - this._ptr - .as_mut() - .map(|r| std::mem::take(r.as_rust_type_mut())) - } - } - impl $crate::transmute::TakeRustType for $c_moved_type {} - impl Drop for $c_moved_type { - fn drop(&mut self) { - self.take(); - } - } }; - (owned rust $c_owned_type:ty, moved $c_moved_type:ty, loaned $c_loaned_type:ty) => { + (owned rust $c_owned_type:ty, loaned $c_loaned_type:ty) => { impl_transmute!(as_c_owned($c_loaned_type, $c_owned_type)); impl_transmute!(as_c_loaned($c_owned_type, $c_loaned_type)); - - impl $crate::transmute::IntoRustType for $c_moved_type { - type RustType = Option<$c_owned_type>; - fn into_rust_type(self) -> Self::RustType { - let mut this = self; - this._ptr.as_mut().map(|r| std::mem::take(*r)) - } - } - impl Drop for $c_moved_type { - fn drop(&mut self) { - std::mem::take(&mut self._ptr); - } - } + impl_transmute!(into_rust($c_owned_type, $c_owned_type)); }; } -// There are several possible variants how owned/loaned/moved types are implememnted +// There are several possible variants how owned/loaned types are implememnted // Here is the relation between them: // // - "Owned" type is a type with "empty" state. @@ -305,8 +241,14 @@ macro_rules! impl_owned { // the inside type of loaned type. E.g. owned type is `Option`, inner type is then `Zshm``, but loaned type is `zshm` // (which is just wrapper over `ZShm`` restricting write access) // -// - "Moved" type - repr "C" structure which contains optional pointer to the owned type. It's used to explictly transfer ownership in C code. -// In the rust code it's possible only to take "Inner" type from "Moved" type, taking ownership on it. +// - "Moved" type - repr "C" structure which wraps the owned type. It's used to explictly transfer ownership in C code. +// When pointer to moved type is passed to C code, the only way to access the wrapped owned type +// is by calling ".dropper()" method which returns pointer to the owned type wrapped into the "XxxDropper" structure. +// The "XxxDropper" structure drops and nullifies the wrapped owned type when it's dropped. +// I.e. C function which accepts pointer to "z_xxx_moved_t" have to take it's dropper +// to guarantee ownership transfer. +// Note: C functions purposedly accepts **pointer** to moved type, not the moved type itself. +// Solution with passing moved type by value could be better from Rust point of view, but provokes error on C side. // // - "View" type - the type which holds references to external data but doesn't own it. Therefore it's always safe to copy/forget it without explicit destructor. // The view type correspods to owned type. E.g. there may be "onwned string" and "view string". View type can be converted to loaned type, same as loaned type of @@ -328,24 +270,20 @@ macro_rules! decl_c_type_inequal { // Owned with with explicit rust loaned type - rarely used // (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { decl_c_type!( owned($c_owned_type, option $rust_inner_type), - moved($c_moved_type) ); validate_equivalence!($c_loaned_type, $rust_loaned_type); impl_transmute!(as_c_loaned($rust_loaned_type, $c_loaned_type)); impl_transmute!(as_rust($c_loaned_type, $rust_loaned_type)); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { decl_c_type!( owned($c_owned_type, $rust_owned_type), - moved($c_moved_type) ); validate_equivalence!($c_loaned_type, $rust_loaned_type); impl_transmute!(as_c_loaned($rust_loaned_type, $c_loaned_type)); @@ -356,23 +294,19 @@ macro_rules! decl_c_type_inequal { // Owned with loaned type same as inner type - typical case // (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), - loaned ($c_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, option $rust_inner_type), loaned($c_loaned_type, $rust_inner_type), - moved($c_moved_type) ); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - loaned ($c_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type, $rust_owned_type), - moved($c_moved_type) ); }; // @@ -380,13 +314,11 @@ macro_rules! decl_c_type_inequal { // (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), loaned ($c_loaned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + view ($c_view_type:ty, $rust_view_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, option $rust_inner_type), loaned($c_loaned_type), - moved($c_moved_type) ); validate_equivalence!($c_view_type, $rust_view_type); impl_transmute!(as_c_view($rust_view_type, $c_view_type)); @@ -394,13 +326,11 @@ macro_rules! decl_c_type_inequal { }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), loaned ($c_loaned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + view ($c_view_type:ty, $rust_view_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type), - moved($c_moved_type) ); validate_equivalence!($c_view_type, $rust_view_type); impl_transmute!(as_c_view($rust_view_type, $c_view_type)); @@ -408,13 +338,11 @@ macro_rules! decl_c_type_inequal { }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + view ($c_view_type:ty, $rust_view_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type, $rust_loaned_type), - moved($c_moved_type) ); validate_equivalence!($c_view_type, $rust_view_type); impl_transmute!(as_c_view($rust_view_type, $c_view_type)); @@ -427,48 +355,40 @@ macro_rules! decl_c_type { // // Owned type only // - (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?) $(,)?) => { validate_equivalence!($c_owned_type, Option<$rust_inner_type>); - impl_owned!(owned $c_owned_type, moved $c_moved_type, inner rust option $rust_inner_type); + impl_owned!(owned $c_owned_type, inner rust option $rust_inner_type); }; - (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?), - moved2 ($c_moved_type2:ty $(,)?) + (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?) $(,)?) => { validate_equivalence!($c_owned_type, Option<$rust_inner_type>); - impl_owned!(owned $c_owned_type, moved $c_moved_type, moved2 $c_moved_type2, inner rust option $rust_inner_type); + impl_owned!(owned $c_owned_type, inner rust option $rust_inner_type); }; - (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?) $(,)?) => { validate_equivalence!($c_owned_type, $rust_owned_type); - impl_owned!(owned $c_owned_type, moved $c_moved_type, inner rust $rust_owned_type); + impl_owned!(owned $c_owned_type, inner rust $rust_owned_type); }; // // Owned with with explicit rust loaned type - rarely used // (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, option $rust_inner_type), loaned($c_loaned_type, $rust_loaned_type), - moved($c_moved_type) ); validate_equivalence!($c_loaned_type, $c_owned_type); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type, $rust_loaned_type), - moved($c_moved_type) ); validate_equivalence!($c_loaned_type, $c_owned_type); }; @@ -476,23 +396,19 @@ macro_rules! decl_c_type { // Owned with loaned type same as inner type - typical case // (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), - loaned ($c_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty $(,)?) $(,)?) => { decl_c_type!( owned($c_owned_type, option $rust_inner_type), loaned($c_loaned_type, $rust_inner_type), - moved($c_moved_type) ); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), - loaned ($c_loaned_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + loaned ($c_loaned_type:ty $(,)?) $(,)?) => { decl_c_type!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type, $rust_owned_type), - moved($c_moved_type) ); }; // @@ -500,42 +416,36 @@ macro_rules! decl_c_type { // (owned ($c_owned_type:ty, option $rust_inner_type:ty $(,)?), loaned ($c_loaned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + view ($c_view_type:ty, $rust_view_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, option $rust_inner_type), loaned($c_loaned_type), view($c_view_type, $rust_view_type), - moved($c_moved_type) ); validate_equivalence!($c_owned_type, $c_loaned_type); validate_equivalence!($c_view_type, $c_loaned_type); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), loaned ($c_loaned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + view ($c_view_type:ty, $rust_view_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type, $rust_owned_type), view($c_view_type, $rust_view_type), - moved($c_moved_type) ); validate_equivalence!($c_owned_type, $c_loaned_type); validate_equivalence!($c_view_type, $c_loaned_type); }; (owned ($c_owned_type:ty, $rust_owned_type:ty $(,)?), loaned ($c_loaned_type:ty, $rust_loaned_type:ty $(,)?), - view ($c_view_type:ty, $rust_view_type:ty $(,)?), - moved ($c_moved_type:ty $(,)?) + view ($c_view_type:ty, $rust_view_type:ty $(,)?) $(,)?) => { decl_c_type_inequal!( owned($c_owned_type, $rust_owned_type), loaned($c_loaned_type, $rust_loaned_type), view($c_view_type, $rust_view_type), - moved($c_moved_type) ); validate_equivalence!($c_owned_type, $c_loaned_type); validate_equivalence!($c_view_type, $c_loaned_type); @@ -543,13 +453,26 @@ macro_rules! decl_c_type { // // Specific case for closures: c owned type and rust owned type is the same thing: c-repr structure + // Moved type for closures is not autogenerated, so defining Derefs for + // it here to make "into_rust_type" on "&mut z_moved_xxx_t" // (owned ($c_owned_type:ty $(,)?), loaned ($c_loaned_type:ty $(,)?), moved ($c_moved_type:ty $(,)?) $(,)?) => { validate_equivalence!($c_owned_type, $c_loaned_type); - impl_owned!(owned rust $c_owned_type, moved $c_moved_type, loaned $c_loaned_type); + impl_owned!(owned rust $c_owned_type, loaned $c_loaned_type); + impl std::ops::Deref for $c_moved_type { + type Target = $c_owned_type; + fn deref(&self) -> &Self::Target { + &self._this + } + } + impl std::ops::DerefMut for $c_moved_type { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self._this + } + } }; // From db29e632753084669f39206c7ebd9c535d146d78 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Thu, 15 Aug 2024 19:00:08 +0200 Subject: [PATCH 077/397] compiles --- build.rs | 22 +- include/zenoh_commons.h | 534 ++++++++++++-------------------- include/zenoh_macros.h | 380 ++++++++++++++++++++--- src/get.rs | 12 +- src/keyexpr.rs | 6 +- src/payload.rs | 12 +- src/platform/synchronization.rs | 6 +- src/publisher.rs | 20 +- src/put.rs | 10 +- src/queryable.rs | 30 +- src/scouting.rs | 8 +- src/session.rs | 10 +- src/subscriber.rs | 8 +- src/transmute.rs | 43 ++- 14 files changed, 623 insertions(+), 478 deletions(-) diff --git a/build.rs b/build.rs index 75262eba1..8a89f65f0 100644 --- a/build.rs +++ b/build.rs @@ -174,7 +174,7 @@ pub struct {type_name} {{ .as_str(); if category == Some("owned") { let moved_type_name = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); - // Note: owned type {type_name} should implement "Default" and "IntoRustType" traits, this is + // Note: owned type {type_name} should implement "Default" trait, this is // done by "decl_c_type!" macro in transmute module. s += format!( "#[repr(C)] @@ -183,23 +183,17 @@ pub struct {moved_type_name} {{ _this: {type_name} }} -impl std::ops::Deref for {moved_type_name} {{ - type Target = {type_name}; - fn deref(&self) -> &Self::Target {{ - &self._this - }} -}} - -impl std::ops::DerefMut for {moved_type_name} {{ - fn deref_mut(&mut self) -> &mut Self::Target {{ - &mut self._this +impl crate::transmute::TakeCType for {moved_type_name} {{ + type CType = {type_name}; + fn take_c_type(&mut self) -> Self::CType {{ + std::mem::take(&mut self._this) }} }} impl Drop for {type_name} {{ fn drop(&mut self) {{ - use crate::transmute::IntoRustType; - let _ = self.into_rust_type(); + use crate::transmute::RustTypeRef; + std::mem::take(self.as_rust_type_mut()); }} }} " @@ -1029,7 +1023,7 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { } if !msgs.is_empty() { - panic!("Some functions are missing:\n{}", msgs.join("\n")); + // panic!("Some functions are missing:\n{}", msgs.join("\n")); } let out = generate_move_functions_c(&move_funcs); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 13428eaaa..9211e3dac 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,26 +16,6 @@ #define ALIGN(n) #define ZENOHC_API #endif -/** - * Allocation errors - * - * - **NEED_DEFRAGMENT**: defragmentation needed - * - **OUT_OF_MEMORY**: the provider is out of memory - * - **OTHER**: other error - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef enum z_alloc_error_t { -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_NEED_DEFRAGMENT, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_OUT_OF_MEMORY, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_OTHER, -#endif -} z_alloc_error_t; -#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -96,22 +76,6 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif -/** - * Layouting errors - * - * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect - * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef enum z_layout_error_t { -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, -#endif -} z_layout_error_t; -#endif /** * The priority of zenoh messages. */ @@ -266,47 +230,10 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_alloc_result_t { - z_owned_shm_mut_t buf; - enum z_alloc_error_t error; -} z_buf_alloc_result_t; -#endif +typedef struct z_moved_alloc_layout_t { + struct z_owned_alloc_layout_t _this; +} z_moved_alloc_layout_t; typedef int8_t z_result_t; -/** - * An AllocAlignment. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_alloc_alignment_t { - uint8_t pow; -} z_alloc_alignment_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_data_t { - void *ptr; -} zc_threadsafe_context_data_t; -#endif -/** - * A tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a thread-safe context - the associated callbacks may be executed concurrently with the same - * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be - * thread-safe. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_t { - struct zc_threadsafe_context_data_t context; - void (*delete_fn)(void*); -} zc_threadsafe_context_t; -#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t _this; } z_moved_bytes_t; @@ -316,37 +243,15 @@ typedef struct z_moved_slice_t { typedef struct z_moved_string_t { struct z_owned_string_t _this; } z_moved_string_t; -/** - * Unique segment identifier - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_segment_id_t; -#endif -/** - * Chunk id within it's segment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_chunk_id_t; -#endif -/** - * A ChunkDescriptor - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_chunk_descriptor_t { - z_segment_id_t segment; - z_chunk_id_t chunk; - size_t len; -} z_chunk_descriptor_t; -#endif -/** - * An AllocatedChunk - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_allocated_chunk_t { - struct z_chunk_descriptor_t descriptpr; - void *data; -} z_allocated_chunk_t; -#endif +typedef struct z_moved_shm_t { + struct z_owned_shm_t _this; +} z_moved_shm_t; +typedef struct z_moved_shm_mut_t { + struct z_owned_shm_mut_t _this; +} z_moved_shm_mut_t; +typedef struct z_moved_chunk_alloc_result_t { + struct z_owned_chunk_alloc_result_t _this; +} z_moved_chunk_alloc_result_t; /** * Monotonic clock */ @@ -497,7 +402,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const z_id_t *z_id, void *context); + void (*call)(const struct z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -608,6 +513,9 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; +typedef struct z_moved_source_info_t { + struct z_owned_source_info_t _this; +} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -656,7 +564,7 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. @@ -673,6 +581,9 @@ typedef struct z_moved_hello_t { typedef struct z_moved_keyexpr_t { struct z_owned_keyexpr_t _this; } z_moved_keyexpr_t; +typedef struct z_moved_memory_layout_t { + struct z_owned_memory_layout_t _this; +} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t _this; } z_moved_mutex_t; @@ -705,7 +616,7 @@ typedef struct z_publisher_put_options_t { /** * The source info for the publication. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. @@ -746,7 +657,7 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to this message. @@ -785,7 +696,7 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -817,7 +728,7 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -868,39 +779,15 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -/** - * A callbacks for ShmSegment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_segment_callbacks_t { - uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); -} zc_shm_segment_callbacks_t; -#endif -/** - * A ShmSegment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_shm_segment_t { - struct zc_threadsafe_context_t context; - struct zc_shm_segment_callbacks_t callbacks; -} z_shm_segment_t; -#endif -/** - * A callbacks for ShmClient - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_client_callbacks_t { - bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); -} zc_shm_client_callbacks_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_layout_alloc_result_t { - z_owned_shm_mut_t buf; - bool error_is_alloc; - enum z_alloc_error_t alloc_error; - enum z_layout_error_t layout_error; -} z_buf_layout_alloc_result_t; -#endif +typedef struct z_moved_shm_client_t { + struct z_owned_shm_client_t _this; +} z_moved_shm_client_t; +typedef struct z_moved_shm_client_storage_t { + struct z_owned_shm_client_storage_t _this; +} z_moved_shm_client_storage_t; +typedef struct z_moved_shm_provider_t { + struct z_owned_shm_provider_t _this; +} z_moved_shm_provider_t; /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -909,46 +796,6 @@ typedef struct z_buf_layout_alloc_result_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif -/** - * A non-tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same - * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated - * with this context data are not required to be thread-safe. - * - * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can - * still be executed concurrently. The exact behavior depends on user's application, but we strongly - * discourage our users from pinning to some specific behavior unless they _really_ understand what they - * are doing. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_context_t { - void *context; - void (*delete_fn)(void*); -} zc_context_t; -#endif -/** - * A callbacks for ShmProviderBackend - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_provider_backend_callbacks_t { - void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, - const z_loaned_memory_layout_t *layout, - void *context); - void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); - size_t (*defragment_fn)(void *context); - size_t (*available_fn)(void *context); - void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); -} zc_shm_provider_backend_callbacks_t; -#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t _this; } z_moved_string_array_t; @@ -997,14 +844,6 @@ typedef struct zc_owned_closure_log_t { typedef struct zc_moved_closure_log_t { struct zc_owned_closure_log_t _this; } zc_moved_closure_log_t; -/** - * Loaned closure. - */ -#if defined(UNSTABLE) -typedef struct zc_loaned_closure_matching_status_t { - size_t _0[3]; -} zc_loaned_closure_matching_status_t; -#endif /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -1074,6 +913,15 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif +typedef struct zc_moved_liveliness_token_t { + struct zc_owned_liveliness_token_t _this; +} zc_moved_liveliness_token_t; +typedef struct zc_moved_matching_listener_t { + struct zc_owned_matching_listener_t _this; +} zc_moved_matching_listener_t; +typedef struct zc_moved_shm_client_list_t { + struct zc_owned_shm_client_list_t _this; +} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -1144,6 +992,12 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif +typedef struct ze_moved_publication_cache_t { + struct ze_owned_publication_cache_t _this; +} ze_moved_publication_cache_t; +typedef struct ze_moved_querying_subscriber_t { + struct ze_owned_querying_subscriber_t _this; +} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1163,53 +1017,54 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t this_); +ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); +ZENOHC_API +const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, - const z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1217,12 +1072,12 @@ z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout, + const struct z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1286,7 +1141,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const z_loaned_shm_t **dst); + const struct z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1297,7 +1152,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - z_loaned_shm_t **dst); + struct z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1308,7 +1163,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - z_owned_shm_t *dst); + struct z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1567,7 +1422,9 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_moved_shm_t shm); +ZENOHC_API +z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, + struct z_moved_shm_t shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1575,7 +1432,7 @@ ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - z_moved_shm_mut_t shm); + struct z_moved_shm_mut_t shm); #endif /** * Serializes a slice by copying. @@ -1643,27 +1500,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t this_); +ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); +const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1671,14 +1528,14 @@ void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1703,7 +1560,7 @@ ZENOHC_API struct z_clock_t z_clock_now(void); * the remaining reference count (number of shallow copies) of the session otherwise, saturating at i8::MAX. */ ZENOHC_API -z_result_t z_close(struct z_moved_session_t session); +z_result_t z_close(struct z_moved_session_t *session); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -1803,7 +1660,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const z_id_t *z_id); + const struct z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2498,13 +2355,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); +ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2682,7 +2539,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2718,7 +2575,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2862,13 +2719,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t this_); +ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); #endif /** * Extract data from Memory Layout @@ -2877,21 +2734,21 @@ ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const z_loaned_memory_layout_t *this_); + const struct z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); +const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2899,7 +2756,7 @@ z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2945,7 +2802,7 @@ z_result_t z_mutex_unlock(struct z_loaned_mutex_t *this_); */ ZENOHC_API z_result_t z_open(struct z_owned_session_t *this_, - struct z_moved_config_t config); + struct z_moved_config_t *config); /** * Constructs and opens a new Zenoh session with specified client storage. * @@ -2955,21 +2812,21 @@ z_result_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t config, - const z_loaned_shm_client_storage_t *shm_clients); + const struct z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, - const z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, + const struct z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2994,12 +2851,12 @@ ZENOHC_API void z_publisher_delete_options_default(struct z_publisher_delete_opt /** * Frees memory and resets publisher to its gravestone state. Also attempts undeclare publisher. */ -ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t this_); +ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *_this); /** * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3117,7 +2974,7 @@ ZENOHC_API struct z_query_consolidation_t z_query_consolidation_none(void); /** * Destroys the query resetting it to its gravestone value. */ -ZENOHC_API void z_query_drop(struct z_moved_query_t this_); +ZENOHC_API void z_query_drop(struct z_moved_query_t *this_); /** * Gets query payload encoding. * @@ -3229,7 +3086,7 @@ ZENOHC_API bool z_queryable_check(const struct z_owned_queryable_t *this_); /** * Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. */ -ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t this_); +ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t *this_); ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); /** @@ -3261,7 +3118,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3332,7 +3189,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3518,7 +3375,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3536,7 +3393,7 @@ ZENOHC_API const struct z_timestamp_t *z_sample_timestamp(const struct z_loaned_ * @return 0 if successful, negative error values upon failure. */ ZENOHC_API -z_result_t z_scout(struct z_moved_config_t config, +z_result_t z_scout(struct z_moved_config_t *config, struct z_moved_closure_hello_t *callback, const struct z_scout_options_t *options); /** @@ -3571,26 +3428,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(z_moved_shm_client_t this_); +ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(z_owned_shm_client_t *this_, +void z_shm_client_new(struct z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3598,177 +3455,179 @@ void z_shm_client_new(z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, - const z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, + const struct z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(z_moved_shm_client_storage_t this_); +ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); +const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, - const zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, + const struct zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(z_moved_shm_t this_); +ZENOHC_API void z_shm_drop(struct z_moved_shm_t this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_moved_shm_mut_t that); +ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); +ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(z_moved_shm_mut_t this_); +ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); +ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t that); +ZENOHC_API +void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, + struct z_moved_shm_t that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3778,48 +3637,49 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(z_moved_shm_provider_t this_); +ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); +ZENOHC_API +const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, - const z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, + const struct z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3828,7 +3688,7 @@ z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(z_owned_shm_provider_t *this_, +void z_shm_provider_new(struct z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3837,14 +3697,14 @@ void z_shm_provider_new(z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3853,13 +3713,13 @@ void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3938,46 +3798,47 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(z_moved_source_info_t this_); +ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); +ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); +ZENOHC_API +const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(z_owned_source_info_t *this_, - const z_entity_global_id_t *source_id, +z_result_t z_source_info_new(struct z_owned_source_info_t *this_, + const struct z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -4158,7 +4019,7 @@ z_result_t z_task_init(struct z_owned_task_t *this_, /** * Joins the task and releases all allocated resources */ -ZENOHC_API z_result_t z_task_join(struct z_moved_task_t this_); +ZENOHC_API z_result_t z_task_join(struct z_moved_task_t *this_); /** * Constructs task in a gravestone state. */ @@ -4193,7 +4054,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4211,26 +4072,26 @@ ZENOHC_API uint64_t z_timestamp_ntp64_time(const struct z_timestamp_t *this_); * @return 0 in case of success, negative error code otherwise. */ ZENOHC_API -z_result_t z_undeclare_keyexpr(struct z_moved_keyexpr_t this_, +z_result_t z_undeclare_keyexpr(struct z_moved_keyexpr_t *this_, const struct z_loaned_session_t *session); /** * Undeclares the given publisher, droping and invalidating it. * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t this_); +ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t *_this); /** * Undeclares a `z_owned_queryable_t` and drops it. * * Returns 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_queryable(struct z_moved_queryable_t this_); +ZENOHC_API z_result_t z_undeclare_queryable(struct z_moved_queryable_t *this_); /** * Undeclares subscriber and drops subscriber. * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_subscriber(struct z_moved_subscriber_t this_); +ZENOHC_API z_result_t z_undeclare_subscriber(struct z_moved_subscriber_t *_this); /** * Constructs a view key expression in empty state */ @@ -4561,7 +4422,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4598,32 +4459,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t this_); +ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); +const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t this_); #endif /** * Returns default value of `zc_locality_t` @@ -4635,13 +4496,13 @@ ZENOHC_API enum zc_locality_t zc_locality_default(void); * Checks the matching listener is for the gravestone state */ #if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); +ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); #endif /** * Constructs an empty matching listener */ #if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); +ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); #endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -4664,7 +4525,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t callback); #endif @@ -4674,7 +4535,8 @@ z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t * * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_listener_t *this_); +ZENOHC_API +z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *this_); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4694,46 +4556,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - z_moved_shm_client_t client, - zc_loaned_shm_client_list_t *list); + struct z_moved_shm_client_t client, + struct zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(zc_moved_shm_client_list_t this_); +ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); +const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); +struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4755,7 +4617,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4773,7 +4635,7 @@ z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t callback, @@ -4783,19 +4645,19 @@ z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t this_); +ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4807,13 +4669,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t this_); +ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4822,7 +4684,7 @@ ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t this_ */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -4831,13 +4693,13 @@ z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *thi */ #if defined(UNSTABLE) ZENOHC_API -const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); +const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4851,7 +4713,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4859,5 +4721,5 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_ * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t this_); +ZENOHC_API z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t this_); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 6872f6381..0deb86736 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,11 +4,14 @@ #ifndef __cplusplus +static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t){x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t){x}; } +static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t){x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t){x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t){x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t){x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t){x}; } +static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t){x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t){x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return (z_moved_config_t){x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t){x}; } @@ -17,10 +20,8 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t){x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t){x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } +static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t){x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } -static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } -static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } -static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t){x}; } static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t){x}; } static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return (z_moved_reply_err_t){x}; } static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return (z_moved_ring_handler_query_t){x}; } @@ -28,21 +29,35 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t){x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t){x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return (z_moved_session_t){x}; } +static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t){x}; } +static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t){x}; } +static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t){x}; } +static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t){x}; } +static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t){x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t){x}; } +static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t){x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t){x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return (z_moved_string_t){x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t){x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_task_t){x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } +static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } +static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } +static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } +static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } +static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } #define z_loan(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ + z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -51,6 +66,7 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ + z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -61,14 +77,23 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ + z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ + z_owned_shm_t : z_shm_loan, \ + z_owned_shm_mut_t : z_shm_mut_loan, \ + z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ + z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ - zc_owned_closure_log_t : zc_closure_log_loan \ + zc_owned_closure_log_t : zc_closure_log_loan, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ + zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ + zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ )(&this_) #define z_loan_mut(this_) \ @@ -79,16 +104,22 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut \ + z_owned_shm_t : z_shm_loan_mut, \ + z_owned_shm_mut_t : z_shm_mut_loan_mut, \ + z_owned_string_array_t : z_string_array_loan_mut, \ + zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ + z_moved_alloc_layout_t : z_alloc_layout_drop, \ z_moved_bytes_t : z_bytes_drop, \ + z_moved_chunk_alloc_result_t : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t : z_closure_hello_drop, \ z_moved_closure_query_t : z_closure_query_drop, \ z_moved_closure_reply_t : z_closure_reply_drop, \ z_moved_closure_sample_t : z_closure_sample_drop, \ + z_moved_closure_zid_t : z_closure_zid_drop, \ z_moved_condvar_t : z_condvar_drop, \ z_moved_config_t : z_config_drop, \ z_moved_encoding_t : z_encoding_drop, \ @@ -97,10 +128,8 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_moved_fifo_handler_sample_t : z_fifo_handler_sample_drop, \ z_moved_hello_t : z_hello_drop, \ z_moved_keyexpr_t : z_keyexpr_drop, \ + z_moved_memory_layout_t : z_memory_layout_drop, \ z_moved_mutex_t : z_mutex_drop, \ - z_moved_publisher_t : z_publisher_drop, \ - z_moved_query_t : z_query_drop, \ - z_moved_queryable_t : z_queryable_drop, \ z_moved_reply_t : z_reply_drop, \ z_moved_reply_err_t : z_reply_err_drop, \ z_moved_ring_handler_query_t : z_ring_handler_query_drop, \ @@ -108,21 +137,35 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_moved_ring_handler_sample_t : z_ring_handler_sample_drop, \ z_moved_sample_t : z_sample_drop, \ z_moved_session_t : z_session_drop, \ + z_moved_shm_client_t : z_shm_client_drop, \ + z_moved_shm_client_storage_t : z_shm_client_storage_drop, \ + z_moved_shm_t : z_shm_drop, \ + z_moved_shm_mut_t : z_shm_mut_drop, \ + z_moved_shm_provider_t : z_shm_provider_drop, \ z_moved_slice_t : z_slice_drop, \ + z_moved_source_info_t : z_source_info_drop, \ z_moved_string_array_t : z_string_array_drop, \ z_moved_string_t : z_string_drop, \ z_moved_subscriber_t : z_subscriber_drop, \ z_moved_task_t : z_task_drop, \ - zc_moved_closure_log_t : zc_closure_log_drop \ + zc_moved_closure_log_t : zc_closure_log_drop, \ + zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ + zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ + zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ + ze_moved_publication_cache_t : ze_publication_cache_drop, \ + ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ + z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -131,10 +174,8 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ + z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ - z_owned_publisher_t : z_publisher_move, \ - z_owned_query_t : z_query_move, \ - z_owned_queryable_t : z_queryable_move, \ z_owned_reply_t : z_reply_move, \ z_owned_reply_err_t : z_reply_err_move, \ z_owned_ring_handler_query_t : z_ring_handler_query_move, \ @@ -142,21 +183,35 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ + z_owned_shm_client_t : z_shm_client_move, \ + z_owned_shm_client_storage_t : z_shm_client_storage_move, \ + z_owned_shm_t : z_shm_move, \ + z_owned_shm_mut_t : z_shm_mut_move, \ + z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ + z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ - zc_owned_closure_log_t : zc_closure_log_move \ + zc_owned_closure_log_t : zc_closure_log_move, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ + zc_owned_liveliness_token_t : zc_liveliness_token_move, \ + zc_owned_shm_client_list_t : zc_shm_client_list_move, \ + ze_owned_publication_cache_t : ze_publication_cache_move, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ )(&this_) #define z_null(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ + z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -165,6 +220,7 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ + z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -176,19 +232,34 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ + z_owned_shm_client_t* : z_shm_client_null, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ + z_owned_shm_mut_t* : z_shm_mut_null, \ + z_owned_shm_t* : z_shm_null, \ + z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ + z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null \ + zc_owned_closure_log_t* : zc_closure_log_null, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ + zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ + zc_owned_matching_listener_t* : zc_matching_listener_null, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ + ze_owned_publication_cache_t* : ze_publication_cache_null, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ )(this_) +static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } +static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -197,10 +268,8 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } +static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } @@ -208,21 +277,35 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } +static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } +static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } +static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } +static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } +static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } +static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } +static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } +static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ _Generic((this_), \ + z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ + z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -231,10 +314,8 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ + z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ - z_owned_publisher_t* : z_publisher_take, \ - z_owned_query_t* : z_query_take, \ - z_owned_queryable_t* : z_queryable_take, \ z_owned_reply_t* : z_reply_take, \ z_owned_reply_err_t* : z_reply_err_take, \ z_owned_ring_handler_query_t* : z_ring_handler_query_take, \ @@ -242,21 +323,35 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ + z_owned_shm_client_t* : z_shm_client_take, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ + z_owned_shm_t* : z_shm_take, \ + z_owned_shm_mut_t* : z_shm_mut_take, \ + z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ + z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ - zc_owned_closure_log_t* : zc_closure_log_take \ + zc_owned_closure_log_t* : zc_closure_log_take, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ + zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ + ze_owned_publication_cache_t* : ze_publication_cache_take, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ )(this_, x) #define z_check(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ + z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -265,6 +360,7 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ + z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -276,12 +372,24 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ + z_owned_shm_t : z_shm_check, \ + z_owned_shm_client_t : z_shm_client_check, \ + z_owned_shm_client_storage_t : z_shm_client_storage_check, \ + z_owned_shm_mut_t : z_shm_mut_check, \ + z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ + z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check \ + zc_owned_closure_log_t : zc_closure_log_check, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ + zc_owned_liveliness_token_t : zc_liveliness_token_check, \ + zc_owned_matching_listener_t : zc_matching_listener_check, \ + zc_owned_shm_client_list_t : zc_shm_client_list_check, \ + ze_owned_publication_cache_t : ze_publication_cache_check, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ )(&this_) #define z_call(closure, hello) \ @@ -289,7 +397,9 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call, \ + const z_loaned_closure_zid_t* : z_closure_zid_call, \ + const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ @@ -317,11 +427,14 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved #else // #ifndef __cplusplus +static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return z_moved_alloc_layout_t{x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return z_moved_bytes_t{x}; } +static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return z_moved_chunk_alloc_result_t{x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return z_moved_closure_hello_t{x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return z_moved_closure_query_t{x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return z_moved_closure_reply_t{x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return z_moved_closure_sample_t{x}; } +static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return z_moved_closure_zid_t{x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return z_moved_condvar_t{x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return z_moved_config_t{x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return z_moved_encoding_t{x}; } @@ -330,10 +443,8 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return z_moved_fifo_handler_sample_t{x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_hello_t{x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } +static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return z_moved_memory_layout_t{x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } -static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } -static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } -static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return z_moved_queryable_t{x}; } static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return z_moved_reply_t{x}; } static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return z_moved_reply_err_t{x}; } static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return z_moved_ring_handler_query_t{x}; } @@ -341,20 +452,34 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return z_moved_ring_handler_sample_t{x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return z_moved_sample_t{x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return z_moved_session_t{x}; } +static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return z_moved_shm_client_t{x}; } +static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return z_moved_shm_client_storage_t{x}; } +static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return z_moved_shm_t{x}; } +static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return z_moved_shm_mut_t{x}; } +static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return z_moved_shm_provider_t{x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return z_moved_slice_t{x}; } +static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return z_moved_source_info_t{x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return z_moved_string_array_t{x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return z_moved_string_t{x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return z_moved_subscriber_t{x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_task_t{x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } +static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } +static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } +static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } +static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } +static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } +inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; +inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; +inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -363,6 +488,7 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; +inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -373,7 +499,12 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; +inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; +inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; +inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; +inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; +inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -381,6 +512,10 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; +inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; +inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; +inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; +inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -389,14 +524,20 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; +inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; +inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; +inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; +inline void z_drop(z_moved_alloc_layout_t this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; +inline void z_drop(z_moved_chunk_alloc_result_t this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t _closure) { z_closure_hello_drop(_closure); }; inline void z_drop(z_moved_closure_query_t closure) { z_closure_query_drop(closure); }; inline void z_drop(z_moved_closure_reply_t closure) { z_closure_reply_drop(closure); }; inline void z_drop(z_moved_closure_sample_t closure) { z_closure_sample_drop(closure); }; +inline void z_drop(z_moved_closure_zid_t closure) { z_closure_zid_drop(closure); }; inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; @@ -405,10 +546,8 @@ inline void z_drop(z_moved_fifo_handler_reply_t this_) { z_fifo_handler_reply_dr inline void z_drop(z_moved_fifo_handler_sample_t this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; +inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; -inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; -inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; -inline void z_drop(z_moved_queryable_t this_) { z_queryable_drop(this_); }; inline void z_drop(z_moved_reply_t this_) { z_reply_drop(this_); }; inline void z_drop(z_moved_reply_err_t this_) { z_reply_err_drop(this_); }; inline void z_drop(z_moved_ring_handler_query_t this_) { z_ring_handler_query_drop(this_); }; @@ -416,19 +555,33 @@ inline void z_drop(z_moved_ring_handler_reply_t this_) { z_ring_handler_reply_dr inline void z_drop(z_moved_ring_handler_sample_t this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t this_) { z_session_drop(this_); }; +inline void z_drop(z_moved_shm_client_t this_) { z_shm_client_drop(this_); }; +inline void z_drop(z_moved_shm_client_storage_t this_) { z_shm_client_storage_drop(this_); }; +inline void z_drop(z_moved_shm_t this_) { z_shm_drop(this_); }; +inline void z_drop(z_moved_shm_mut_t this_) { z_shm_mut_drop(this_); }; +inline void z_drop(z_moved_shm_provider_t this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t this_) { z_slice_drop(this_); }; +inline void z_drop(z_moved_source_info_t this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t closure) { zc_closure_log_drop(closure); }; +inline void z_drop(zc_moved_closure_matching_status_t closure) { zc_closure_matching_status_drop(closure); }; +inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; +inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; +inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; +inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; +inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; +inline z_moved_chunk_alloc_result_t z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& _closure) { return z_closure_hello_move(&_closure); }; inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure) { return z_closure_query_move(&closure); }; inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure) { return z_closure_reply_move(&closure); }; inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure) { return z_closure_sample_move(&closure); }; +inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure) { return z_closure_zid_move(&closure); }; inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -437,10 +590,8 @@ inline z_moved_fifo_handler_reply_t z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; +inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; -inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; -inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; -inline z_moved_queryable_t z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; inline z_moved_reply_t z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; inline z_moved_reply_err_t z_move(z_owned_reply_err_t& this_) { return z_reply_err_move(&this_); }; inline z_moved_ring_handler_query_t z_move(z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_move(&this_); }; @@ -448,19 +599,33 @@ inline z_moved_ring_handler_reply_t z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; +inline z_moved_shm_client_t z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; +inline z_moved_shm_client_storage_t z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; +inline z_moved_shm_t z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; +inline z_moved_shm_mut_t z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; +inline z_moved_shm_provider_t z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; +inline z_moved_source_info_t z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure) { return zc_closure_log_move(&closure); }; +inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_move(&closure); }; +inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; +inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; +inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; +inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; +inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; +inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; +inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; @@ -469,6 +634,7 @@ inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_n inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; +inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; @@ -480,18 +646,33 @@ inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_n inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; +inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; +inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; +inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; +inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; +inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; +inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; +inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; +inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; +inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; +inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; +inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; +inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; +static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } +static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -500,10 +681,8 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } +static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } @@ -511,18 +690,35 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } +static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } +static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } +static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } +static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } +static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } +static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } +static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } +static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } +inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { + z_alloc_layout_take(this_, x); +}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { z_bytes_take(this_, x); }; +inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { + z_chunk_alloc_result_take(this_, x); +}; inline void z_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { z_closure_hello_take(_closure, x); }; @@ -535,6 +731,9 @@ inline void z_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) inline void z_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { z_closure_sample_take(closure, x); }; +inline void z_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { + z_closure_zid_take(closure, x); +}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { z_condvar_take(this_, x); }; @@ -559,18 +758,12 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { z_keyexpr_take(this_, x); }; +inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { + z_memory_layout_take(this_, x); +}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { z_mutex_take(this_, x); }; -inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { - z_publisher_take(this_, x); -}; -inline void z_take(z_owned_query_t* this_, z_moved_query_t x) { - z_query_take(this_, x); -}; -inline void z_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { - z_queryable_take(this_, x); -}; inline void z_take(z_owned_reply_t* this_, z_moved_reply_t x) { z_reply_take(this_, x); }; @@ -592,9 +785,27 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t x) { z_session_take(this_, x); }; +inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { + z_shm_client_take(this_, x); +}; +inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { + z_shm_client_storage_take(this_, x); +}; +inline void z_take(z_owned_shm_t* this_, z_moved_shm_t x) { + z_shm_take(this_, x); +}; +inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { + z_shm_mut_take(this_, x); +}; +inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { + z_shm_provider_take(this_, x); +}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t x) { z_slice_take(this_, x); }; +inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { + z_source_info_take(this_, x); +}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { z_string_array_take(this_, x); }; @@ -610,13 +821,31 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { inline void z_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { zc_closure_log_take(closure, x); }; +inline void z_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { + zc_closure_matching_status_take(closure, x); +}; +inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { + zc_liveliness_token_take(this_, x); +}; +inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { + zc_shm_client_list_take(this_, x); +}; +inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { + ze_publication_cache_take(this_, x); +}; +inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { + ze_querying_subscriber_take(this_, x); +}; +inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; +inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; +inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -625,6 +854,7 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; +inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -636,12 +866,24 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; +inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; +inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; +inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; +inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; +inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; +inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; +inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; +inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; +inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; +inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; +inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; +inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { @@ -656,6 +898,12 @@ inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; +inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { + z_closure_zid_call(closure, z_id); +}; +inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { + zc_closure_matching_status_call(closure, mathing_status); +}; inline void z_closure( @@ -694,6 +942,24 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; +inline void z_closure( + z_owned_closure_zid_t* closure, + void (*call)(const z_id_t*, void*), + void (*drop)(void*), + void *context) { + closure->context = context; + closure->drop = drop; + closure->call = call; +}; +inline void z_closure( + zc_owned_closure_matching_status_t* closure, + void (*call)(const zc_matching_status_t*, void*), + void (*drop)(void*), + void *context) { + closure->context = context; + closure->drop = drop; + closure->call = call; +}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -737,8 +1003,12 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -747,6 +1017,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -763,6 +1035,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -783,8 +1057,18 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -793,6 +1077,14 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; #endif // #ifndef __cplusplus diff --git a/src/get.rs b/src/get.rs index 3edb1cc42..2203ebccb 100644 --- a/src/get.rs +++ b/src/get.rs @@ -29,7 +29,7 @@ use zenoh::{ }; use crate::{ - result, transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, z_query_target_t + result, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, z_query_target_t }; #[cfg(feature = "unstable")] use crate::{ @@ -246,7 +246,7 @@ pub unsafe extern "C" fn z_get( callback: &mut z_moved_closure_reply_t, options: Option<&mut z_get_options_t>, ) -> result::z_result_t { - let callback = callback.into_rust_type(); + let callback = callback.take_rust_type(); let p = if parameters.is_null() { "" } else { @@ -257,17 +257,17 @@ pub unsafe extern "C" fn z_get( let mut get = session.get(Selector::from((key_expr, p))); if let Some(options) = options { if let Some(payload) = options.payload.take() { - get = get.payload(payload.into_rust_type()); + get = get.payload(payload.take_rust_type()); } if let Some(encoding) = options.encoding.take() { - get = get.encoding(encoding.into_rust_type()); + get = get.encoding(encoding.take_rust_type()); } #[cfg(feature = "unstable")] if let Some(source_info) = options.source_info.take() { - get = get.source_info(source_info.into_rust_type()); + get = get.source_info(source_info.take_rust_type()); } if let Some(attachment) = options.attachment.take() { - get = get.attachment(attachment.into_rust_type()); + get = get.attachment(attachment.take_rust_type()); } get = get diff --git a/src/keyexpr.rs b/src/keyexpr.rs index 64dcd80b5..2dc58f886 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -26,7 +26,7 @@ pub use crate::opaque_types::{ }; use crate::{ result::{self, z_result_t, Z_OK}, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_session_t, z_view_string_from_substr, z_view_string_t, }; @@ -488,10 +488,10 @@ pub extern "C" fn z_declare_keyexpr( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] pub extern "C" fn z_undeclare_keyexpr( - this: z_moved_keyexpr_t, + this: &mut z_moved_keyexpr_t, session: &z_loaned_session_t, ) -> result::z_result_t { - let Some(kexpr) = this.into_rust_type() else { + let Some(kexpr) = this.take_rust_type() else { tracing::debug!("Attempted to undeclare dropped keyexpr"); return result::Z_EINVAL; }; diff --git a/src/payload.rs b/src/payload.rs index aee6f8804..25f61fb8b 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -32,7 +32,7 @@ pub use crate::opaque_types::{z_loaned_bytes_t, z_owned_bytes_t}; use crate::result::Z_ENULL; use crate::{ result::{self, z_result_t, Z_EINVAL, Z_EIO, Z_EPARSE, Z_OK}, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_slice_t, z_loaned_string_t, z_moved_bytes_t, z_moved_slice_t, z_moved_string_t, z_owned_slice_t, z_owned_string_t, CSlice, CSliceOwned, CString, CStringOwned, }; @@ -467,7 +467,7 @@ pub unsafe extern "C" fn z_bytes_from_slice( this: &mut MaybeUninit, slice: &mut z_moved_slice_t, ) { - let slice = slice.into_rust_type(); + let slice = slice.take_rust_type(); let payload = ZBytes::from(slice); this.as_rust_type_mut_uninit().write(payload); } @@ -560,7 +560,7 @@ pub unsafe extern "C" fn z_bytes_from_string( s: &mut z_moved_string_t, ) { // TODO: verify that string is a valid utf-8 string ? - let cs = s.into_rust_type(); + let cs = s.take_rust_type(); let payload = ZBytes::from(cs); this.as_rust_type_mut_uninit().write(payload); } @@ -646,7 +646,7 @@ pub extern "C" fn z_bytes_from_pair( first: &mut z_moved_bytes_t, second: &mut z_moved_bytes_t, ) -> z_result_t { - let payload = ZBytes::serialize((first.into_rust_type(), second.into_rust_type())); + let payload = ZBytes::serialize((first.take_rust_type(), second.take_rust_type())); this.as_rust_type_mut_uninit().write(payload); Z_OK } @@ -920,7 +920,7 @@ unsafe extern "C" fn z_bytes_writer_append( this: &mut z_bytes_writer_t, bytes: &mut z_moved_bytes_t, ) -> z_result_t { - this.as_rust_type_mut().append(bytes.into_rust_type()); + this.as_rust_type_mut().append(bytes.take_rust_type()); result::Z_OK } @@ -933,6 +933,6 @@ unsafe extern "C" fn z_bytes_writer_append_bounded( this: &mut z_bytes_writer_t, bytes: &mut z_moved_bytes_t, ) -> z_result_t { - this.as_rust_type_mut().serialize(bytes.into_rust_type()); + this.as_rust_type_mut().serialize(bytes.take_rust_type()); result::Z_OK } diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index 6150bc73b..875d7f204 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -9,7 +9,7 @@ use libc::c_void; pub use crate::opaque_types::{z_loaned_mutex_t, z_moved_mutex_t, z_owned_mutex_t}; use crate::{ result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, }; decl_c_type!( @@ -214,8 +214,8 @@ pub extern "C" fn z_task_detach(this: z_moved_task_t) {} /// Joins the task and releases all allocated resources #[no_mangle] -pub extern "C" fn z_task_join(this: z_moved_task_t) -> result::z_result_t { - let Some(task) = this.into_rust_type() else { +pub extern "C" fn z_task_join(this: &mut z_moved_task_t) -> result::z_result_t { + let Some(task) = this.take_rust_type() else { return result::Z_OK; }; match task.join() { diff --git a/src/publisher.rs b/src/publisher.rs index 4c1a14190..bba45c399 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -28,7 +28,7 @@ use crate::z_moved_source_info_t; use crate::zc_moved_closure_matching_status_t; use crate::{ result::{self}, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_congestion_control_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_encoding_t, z_priority_t, z_timestamp_t, }; @@ -106,7 +106,7 @@ pub extern "C" fn z_declare_publisher( p = p.allowed_destination(options.allowed_destination.into()); } if let Some(encoding) = options.encoding.take() { - p = p.encoding(encoding.into_rust_type()); + p = p.encoding(encoding.take_rust_type()); } } match p.wait() { @@ -206,18 +206,18 @@ pub unsafe extern "C" fn z_publisher_put( options: Option<&mut z_publisher_put_options_t>, ) -> result::z_result_t { let publisher = this.as_rust_type_ref(); - let payload = payload.into_rust_type(); + let payload = payload.take_rust_type(); let mut put = publisher.put(payload); if let Some(options) = options { if let Some(encoding) = options.encoding.take() { - put = put.encoding(encoding.into_rust_type()); + put = put.encoding(encoding.take_rust_type()); }; #[cfg(feature = "unstable")] if let Some(source_info) = options.source_info.take() { - put = put.source_info(source_info.into_rust_type()); + put = put.source_info(source_info.take_rust_type()); }; if let Some(attachment) = options.attachment.take() { - put = put.attachment(attachment.into_rust_type()); + put = put.attachment(attachment.take_rust_type()); } if let Some(timestamp) = options.timestamp { put = put.timestamp(Some(*timestamp.as_rust_type_ref())); @@ -417,8 +417,8 @@ pub extern "C" fn zc_publisher_get_matching_status( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_undeclare_publisher(this: z_moved_publisher_t) -> result::z_result_t { - if let Some(p) = this.into_rust_type() { +pub extern "C" fn z_undeclare_publisher(_this: &mut z_moved_publisher_t) -> result::z_result_t { + if let Some(p) = _this.take_rust_type() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_ENETWORK; @@ -430,6 +430,6 @@ pub extern "C" fn z_undeclare_publisher(this: z_moved_publisher_t) -> result::z_ /// Frees memory and resets publisher to its gravestone state. Also attempts undeclare publisher. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_drop(this: z_moved_publisher_t) { - z_undeclare_publisher(this); +pub extern "C" fn z_publisher_drop(_this: &mut z_moved_publisher_t) { + z_undeclare_publisher(_this); } diff --git a/src/put.rs b/src/put.rs index f8640b0e5..f8b9ede1f 100644 --- a/src/put.rs +++ b/src/put.rs @@ -25,7 +25,7 @@ use crate::z_moved_source_info_t; use crate::{ commons::*, result, - transmute::{IntoRustType, RustTypeRef}, + transmute::{IntoRustType, RustTypeRef, TakeRustType}, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_encoding_t, z_timestamp_t, }; @@ -89,18 +89,18 @@ pub extern "C" fn z_put( ) -> result::z_result_t { let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let payload = payload.into_rust_type(); + let payload = payload.take_rust_type(); let mut put = session.put(key_expr, payload); if let Some(options) = options { if let Some(encoding) = options.encoding.take() { - put = put.encoding(encoding.into_rust_type()); + put = put.encoding(encoding.take_rust_type()); }; #[cfg(feature = "unstable")] if let Some(source_info) = options.source_info.take() { - put = put.source_info(source_info.into_rust_type()); + put = put.source_info(source_info.take_rust_type()); }; if let Some(attachment) = options.attachment.take() { - put = put.attachment(attachment.into_rust_type()); + put = put.attachment(attachment.take_rust_type()); } if let Some(timestamp) = options.timestamp.as_ref() { put = put.timestamp(Some(timestamp.into_rust_type())); diff --git a/src/queryable.rs b/src/queryable.rs index 71821f0e4..fd949978a 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -27,7 +27,7 @@ pub use crate::opaque_types::{z_loaned_queryable_t, z_owned_queryable_t}; use crate::z_moved_source_info_t; use crate::{ result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_query_call, z_closure_query_loan, z_congestion_control_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_query_t, z_moved_encoding_t, z_moved_queryable_t, z_priority_t, z_timestamp_t, @@ -82,7 +82,9 @@ pub unsafe extern "C" fn z_query_loan(this: &'static z_owned_query_t) -> &z_loan /// Destroys the query resetting it to its gravestone value. #[no_mangle] #[allow(unused_variables)] -pub extern "C" fn z_query_drop(this: z_moved_query_t) {} +pub extern "C" fn z_query_drop(this: &mut z_moved_query_t) { + this.take_rust_type(); +} /// Constructs a shallow copy of the query, allowing to keep it in an "open" state past the callback's return. /// /// This operation is infallible, but may return a gravestone value if `query` itself was a gravestone value (which cannot be the case in a callback). @@ -222,7 +224,7 @@ pub extern "C" fn z_declare_queryable( let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); let keyexpr = key_expr.as_rust_type_ref(); - let callback = callback.into_rust_type(); + let callback = callback.take_rust_type(); let mut builder = session.declare_queryable(keyexpr); if let Some(options) = options { builder = builder.complete(options.complete); @@ -253,8 +255,8 @@ pub extern "C" fn z_declare_queryable( /// Returns 0 in case of success, negative error code otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_undeclare_queryable(this: z_moved_queryable_t) -> result::z_result_t { - if let Some(qable) = this.into_rust_type() { +pub extern "C" fn z_undeclare_queryable(this: &mut z_moved_queryable_t) -> result::z_result_t { + if let Some(qable) = this.take_rust_type() { if let Err(e) = qable.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -266,7 +268,7 @@ pub extern "C" fn z_undeclare_queryable(this: z_moved_queryable_t) -> result::z_ /// Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_queryable_drop(this: z_moved_queryable_t) { +pub extern "C" fn z_queryable_drop(this: &mut z_moved_queryable_t) { z_undeclare_queryable(this); } @@ -299,18 +301,18 @@ pub extern "C" fn z_query_reply( ) -> result::z_result_t { let query = this.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let payload = payload.into_rust_type(); + let payload = payload.take_rust_type(); let mut reply = query.reply(key_expr, payload); if let Some(options) = options { if let Some(encoding) = options.encoding.take() { - reply = reply.encoding(encoding.into_rust_type()); + reply = reply.encoding(encoding.take_rust_type()); }; #[cfg(feature = "unstable")] if let Some(source_info) = options.source_info.take() { - reply = reply.source_info(source_info.into_rust_type()); + reply = reply.source_info(source_info.take_rust_type()); }; if let Some(attachment) = options.attachment.take() { - reply = reply.attachment(attachment.into_rust_type()); + reply = reply.attachment(attachment.take_rust_type()); } if let Some(timestamp) = options.timestamp.as_ref() { reply = reply.timestamp(Some(timestamp.into_rust_type())); @@ -347,11 +349,11 @@ pub unsafe extern "C" fn z_query_reply_err( options: Option<&mut z_query_reply_err_options_t>, ) -> result::z_result_t { let query = this.as_rust_type_ref(); - let payload = payload.into_rust_type(); + let payload = payload.take_rust_type(); let reply = query.reply_err(payload).encoding( options .and_then(|o| o.encoding.take()) - .map(|e| e.into_rust_type()) + .map(|e| e.take_rust_type()) .unwrap_or(Encoding::default()), ); @@ -388,10 +390,10 @@ pub unsafe extern "C" fn z_query_reply_del( if let Some(options) = options { #[cfg(feature = "unstable")] if let Some(source_info) = options.source_info.take() { - reply = reply.source_info(source_info.into_rust_type()); + reply = reply.source_info(source_info.take_rust_type()); }; if let Some(attachment) = options.attachment.take() { - reply = reply.attachment(attachment.into_rust_type()); + reply = reply.attachment(attachment.take_rust_type()); } if let Some(timestamp) = options.timestamp.as_ref() { reply = reply.timestamp(Some(timestamp.into_rust_type())); diff --git a/src/scouting.rs b/src/scouting.rs index 06e1a67a3..2c0997dde 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -22,7 +22,7 @@ use zenoh::{ pub use crate::opaque_types::{z_loaned_hello_t, z_moved_hello_t, z_owned_hello_t}; use crate::{ result::{self, Z_OK}, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_hello_call, z_closure_hello_loan, z_moved_closure_hello_t, z_moved_config_t, z_owned_string_array_t, z_view_string_t, zc_init_logging, CString, CStringView, ZVector, }; @@ -154,20 +154,20 @@ pub extern "C" fn z_scout_options_default(this: &mut MaybeUninit, ) -> result::z_result_t { if cfg!(feature = "logger-autoinit") { zc_init_logging(); } - let callback = callback.into_rust_type(); + let callback = callback.take_rust_type(); let options = options.cloned().unwrap_or_default(); let what = WhatAmIMatcher::try_from(options.what as u8).unwrap_or(WhatAmI::Router | WhatAmI::Peer); #[allow(clippy::unnecessary_cast)] // Required for multi-target let timeout = options.timeout_ms; - let Some(config) = config.into_rust_type() else { + let Some(config) = config.take_rust_type() else { tracing::error!("Config not provided"); return result::Z_EINVAL; }; diff --git a/src/session.rs b/src/session.rs index 4b620cb68..21ad4279d 100644 --- a/src/session.rs +++ b/src/session.rs @@ -21,7 +21,7 @@ use crate::z_loaned_shm_client_storage_t; use crate::{ opaque_types::{z_loaned_session_t, z_owned_session_t}, result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_moved_config_t, z_moved_session_t, zc_init_logging, }; decl_c_type!( @@ -53,13 +53,13 @@ pub extern "C" fn z_session_null(this: &mut MaybeUninit) { #[no_mangle] pub extern "C" fn z_open( this: &mut MaybeUninit, - config: z_moved_config_t, + config: &mut z_moved_config_t, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { zc_init_logging(); } - let Some(config) = config.into_rust_type().take() else { + let Some(config) = config.take_rust_type().take() else { tracing::error!("Config not provided"); this.write(None); return result::Z_EINVAL; @@ -125,8 +125,8 @@ pub extern "C" fn z_session_check(this: &z_owned_session_t) -> bool { /// @return 0 in case of success, a negative value if an error occured while closing the session, /// the remaining reference count (number of shallow copies) of the session otherwise, saturating at i8::MAX. #[no_mangle] -pub extern "C" fn z_close(session: z_moved_session_t) -> result::z_result_t { - let Some(s) = session.into_rust_type() else { +pub extern "C" fn z_close(session: &mut z_moved_session_t) -> result::z_result_t { + let Some(s) = session.take_rust_type() else { return result::Z_EINVAL; }; let s = match Arc::try_unwrap(s) { diff --git a/src/subscriber.rs b/src/subscriber.rs index 4cdce1a25..2e521a860 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -23,7 +23,7 @@ use zenoh::{ use crate::{ keyexpr::*, result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_sample_call, z_closure_sample_loan, z_loaned_session_t, z_moved_closure_sample_t, }; @@ -117,7 +117,7 @@ pub extern "C" fn z_declare_subscriber( let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let callback = callback.into_rust_type(); + let callback = callback.take_rust_type(); let mut subscriber = session .declare_subscriber(key_expr) .callback(move |sample| { @@ -155,8 +155,8 @@ pub extern "C" fn z_subscriber_keyexpr(subscriber: &z_loaned_subscriber_t) -> &z /// @return 0 in case of success, negative error code otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_undeclare_subscriber(this: z_moved_subscriber_t) -> result::z_result_t { - if let Some(s) = this.into_rust_type() { +pub extern "C" fn z_undeclare_subscriber(_this: &mut z_moved_subscriber_t) -> result::z_result_t { + if let Some(s) = _this.take_rust_type() { if let Err(e) = s.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; diff --git a/src/transmute.rs b/src/transmute.rs index e08cf9758..0bb393267 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -52,17 +52,19 @@ pub(crate) trait IntoCType: Sized { fn into_c_type(self) -> Self::CType; } -impl IntoRustType for &mut T where T: Default + IntoRustType { - type RustType = T::RustType; - fn into_rust_type(self) -> Self::RustType { - std::mem::take(self).into_rust_type() - } -} +pub(crate) trait TakeRustType: Sized { + type RustType; + fn take_rust_type(&mut self) -> Self::RustType; +} +pub(crate) trait TakeCType: Sized { + type CType; + fn take_c_type(&mut self) -> Self::CType; +} -impl IntoCType for &mut T where T: Default + IntoCType { - type CType = T::CType; - fn into_c_type(self) -> Self::CType { - std::mem::take(self).into_c_type() +impl TakeRustType for P where P: TakeCType, Q: IntoRustType { + type RustType = Q::RustType; + fn take_rust_type(&mut self) -> Self::RustType { + self.take_c_type().into_rust_type() } } @@ -243,12 +245,10 @@ macro_rules! impl_owned { // // - "Moved" type - repr "C" structure which wraps the owned type. It's used to explictly transfer ownership in C code. // When pointer to moved type is passed to C code, the only way to access the wrapped owned type -// is by calling ".dropper()" method which returns pointer to the owned type wrapped into the "XxxDropper" structure. -// The "XxxDropper" structure drops and nullifies the wrapped owned type when it's dropped. -// I.e. C function which accepts pointer to "z_xxx_moved_t" have to take it's dropper -// to guarantee ownership transfer. +// is to call "take_rust_type()" or "take_c_type()" methods which empties the passed owned type, +// leaving rust code responsible to drop it. // Note: C functions purposedly accepts **pointer** to moved type, not the moved type itself. -// Solution with passing moved type by value could be better from Rust point of view, but provokes error on C side. +// Passing moved type by value could be better from Rust point of view, but provokes error on C side. // // - "View" type - the type which holds references to external data but doesn't own it. Therefore it's always safe to copy/forget it without explicit destructor. // The view type correspods to owned type. E.g. there may be "onwned string" and "view string". View type can be converted to loaned type, same as loaned type of @@ -462,15 +462,10 @@ macro_rules! decl_c_type { $(,)?) => { validate_equivalence!($c_owned_type, $c_loaned_type); impl_owned!(owned rust $c_owned_type, loaned $c_loaned_type); - impl std::ops::Deref for $c_moved_type { - type Target = $c_owned_type; - fn deref(&self) -> &Self::Target { - &self._this - } - } - impl std::ops::DerefMut for $c_moved_type { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self._this + impl $crate::transmute::TakeCType for $c_moved_type { + type CType = $c_owned_type; + fn take_c_type(&mut self) -> Self::CType { + std::mem::take(&mut self._this) } } }; From 094dbbf3cfdd55e00532ce40faf14c1f9493725c Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Thu, 15 Aug 2024 19:23:35 +0200 Subject: [PATCH 078/397] compile with all features --- include/zenoh_commons.h | 41 +++++++++++++------------ include/zenoh_macros.h | 30 ++---------------- src/closures/matching_status_closure.rs | 3 +- src/closures/zenohid_closure.rs | 3 +- src/info.rs | 14 +++------ src/liveliness.rs | 19 +++++------- src/payload.rs | 8 ++--- src/publication_cache.rs | 10 +++--- src/publisher.rs | 12 +++----- src/querying_subscriber.rs | 33 +++++++++----------- src/session.rs | 4 +-- src/shm/buffer/zshm.rs | 6 ++-- src/shm/buffer/zshmmut.rs | 6 ++-- src/shm/client_storage/mod.rs | 6 ++-- 14 files changed, 80 insertions(+), 115 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 9211e3dac..5f778ddfe 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -414,7 +414,7 @@ typedef struct z_owned_closure_zid_t { */ #if defined(UNSTABLE) typedef struct z_moved_closure_zid_t { - struct z_owned_closure_zid_t *_ptr; + struct z_owned_closure_zid_t _this; } z_moved_closure_zid_t; #endif typedef struct z_moved_condvar_t { @@ -886,7 +886,7 @@ typedef struct zc_owned_closure_matching_status_t { */ #if defined(UNSTABLE) typedef struct zc_moved_closure_matching_status_t { - struct zc_owned_closure_matching_status_t *_ptr; + struct zc_owned_closure_matching_status_t _this; } zc_moved_closure_matching_status_t; #endif /** @@ -1424,7 +1424,7 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t shm); + struct z_moved_shm_t *shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1432,7 +1432,7 @@ z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t shm); + struct z_moved_shm_mut_t *shm); #endif /** * Serializes a slice by copying. @@ -2552,7 +2552,7 @@ ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #if defined(UNSTABLE) ZENOHC_API z_result_t z_info_peers_zid(const struct z_loaned_session_t *session, - struct z_moved_closure_zid_t callback); + struct z_moved_closure_zid_t *callback); #endif /** * Fetches the Zenoh IDs of all connected routers. @@ -2565,7 +2565,7 @@ z_result_t z_info_peers_zid(const struct z_loaned_session_t *session, #if defined(UNSTABLE) ZENOHC_API z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, - struct z_moved_closure_zid_t callback); + struct z_moved_closure_zid_t *callback); #endif /** * Returns the session's Zenoh ID. @@ -2811,7 +2811,7 @@ z_result_t z_open(struct z_owned_session_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, - struct z_moved_config_t config, + struct z_moved_config_t *config, const struct z_loaned_shm_client_storage_t *shm_clients); #endif /** @@ -3521,7 +3521,7 @@ ZENOHC_API void z_shm_drop(struct z_moved_shm_t this_); * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t that); +ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t *that); #endif /** * @return the length of the ZShm slice @@ -3595,7 +3595,7 @@ ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t that); + struct z_moved_shm_t *that); #endif /** * Constructs ZShm slice in its gravestone value. @@ -4406,7 +4406,7 @@ ZENOHC_API z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_closure_sample_t callback, + struct z_moved_closure_sample_t *callback, struct zc_liveliness_subscriber_options_t *_options); #endif /** @@ -4439,7 +4439,7 @@ z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_ ZENOHC_API z_result_t zc_liveliness_get(const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_closure_reply_t callback, + struct z_moved_closure_reply_t *callback, struct zc_liveliness_get_options_t *options); #endif /** @@ -4484,7 +4484,7 @@ ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *thi * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t *this_); #endif /** * Returns default value of `zc_locality_t` @@ -4527,7 +4527,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t ZENOHC_API z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, - struct zc_moved_closure_matching_status_t callback); + struct zc_moved_closure_matching_status_t *callback); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4545,7 +4545,7 @@ z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t2 *this_); +z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t *this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4556,7 +4556,7 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - struct z_moved_shm_client_t client, + struct z_moved_shm_client_t *client, struct zc_loaned_shm_client_list_t *list); #endif /** @@ -4638,7 +4638,7 @@ ZENOHC_API z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, - struct z_moved_closure_sample_t callback, + struct z_moved_closure_sample_t *callback, struct ze_querying_subscriber_options_t *options); #endif /** @@ -4651,7 +4651,7 @@ ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cac * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t this_); +ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t *_this); #endif /** * Constructs a publication cache in a gravestone state. @@ -4675,7 +4675,7 @@ ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subs * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t this_); +ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *_this); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4713,7 +4713,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4721,5 +4721,6 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t this_); +ZENOHC_API +z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t *_this); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 0deb86736..fccf7defd 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -44,8 +44,6 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } #define z_loan(this_) \ @@ -151,9 +149,7 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne zc_moved_closure_log_t : zc_closure_log_drop, \ zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ - zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ + zc_moved_shm_client_list_t : zc_shm_client_list_drop \ )(this_) #define z_move(this_) \ @@ -197,9 +193,7 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne zc_owned_closure_log_t : zc_closure_log_move, \ zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ + zc_owned_shm_client_list_t : zc_shm_client_list_move \ )(&this_) #define z_null(this_) \ @@ -292,8 +286,6 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ @@ -337,9 +329,7 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t zc_owned_closure_log_t* : zc_closure_log_take, \ zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ + zc_owned_shm_client_list_t* : zc_shm_client_list_take \ )(this_, x) #define z_check(this_) \ @@ -467,8 +457,6 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } @@ -570,8 +558,6 @@ inline void z_drop(zc_moved_closure_log_t closure) { zc_closure_log_drop(closure inline void z_drop(zc_moved_closure_matching_status_t closure) { zc_closure_matching_status_drop(closure); }; inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; @@ -614,8 +600,6 @@ inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure) { return z inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_move(&closure); }; inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; @@ -705,8 +689,6 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } @@ -830,12 +812,6 @@ inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { zc_shm_client_list_take(this_, x); }; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { - ze_querying_subscriber_take(this_, x); -}; inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index f3fc3767d..bae2312f2 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -46,12 +46,13 @@ pub struct zc_loaned_closure_matching_status_t { /// Moved closure. #[repr(C)] pub struct zc_moved_closure_matching_status_t { - pub _ptr: Option<&'static mut zc_owned_closure_matching_status_t>, + _this: zc_owned_closure_matching_status_t, } decl_c_type!( owned(zc_owned_closure_matching_status_t), loaned(zc_loaned_closure_matching_status_t), + moved(zc_moved_closure_matching_status_t), ); impl Default for zc_owned_closure_matching_status_t { diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index f63ffc503..eedc0a648 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -47,12 +47,13 @@ pub struct z_loaned_closure_zid_t { /// Moved closure. #[repr(C)] pub struct z_moved_closure_zid_t { - pub _ptr: Option<&'static mut z_owned_closure_zid_t>, + pub _this: z_owned_closure_zid_t, } decl_c_type!( owned(z_owned_closure_zid_t), loaned(z_loaned_closure_zid_t), + moved(z_moved_closure_zid_t), ); impl Default for z_owned_closure_zid_t { diff --git a/src/info.rs b/src/info.rs index dde3b670d..ec9187531 100644 --- a/src/info.rs +++ b/src/info.rs @@ -16,7 +16,7 @@ use zenoh::{prelude::*, session::ZenohId}; pub use crate::opaque_types::z_id_t; use crate::{ result, - transmute::{CTypeRef, IntoCType, IntoRustType, RustTypeRef}, + transmute::{CTypeRef, IntoCType, RustTypeRef, TakeRustType}, z_closure_zid_call, z_closure_zid_loan, z_loaned_session_t, z_moved_closure_zid_t, }; decl_c_type!(copy(z_id_t, ZenohId)); @@ -49,12 +49,10 @@ pub unsafe extern "C" fn z_info_zid(session: &z_loaned_session_t) -> z_id_t { #[no_mangle] pub unsafe extern "C" fn z_info_peers_zid( session: &z_loaned_session_t, - callback: z_moved_closure_zid_t, + callback: &mut z_moved_closure_zid_t, ) -> result::z_result_t { let session = session.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.take_rust_type(); for id in session.info().peers_zid().wait() { z_closure_zid_call(z_closure_zid_loan(&callback), id.as_ctype_ref()); } @@ -71,12 +69,10 @@ pub unsafe extern "C" fn z_info_peers_zid( #[no_mangle] pub unsafe extern "C" fn z_info_routers_zid( session: &z_loaned_session_t, - callback: z_moved_closure_zid_t, + callback: &mut z_moved_closure_zid_t, ) -> result::z_result_t { let session = session.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.take_rust_type(); for id in session.info().routers_zid().wait() { z_closure_zid_call(z_closure_zid_loan(&callback), id.as_ctype_ref()); } diff --git a/src/liveliness.rs b/src/liveliness.rs index 348e4810c..49ffc3a26 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -22,7 +22,7 @@ use zenoh::{ use crate::{ opaque_types::{zc_loaned_liveliness_token_t, zc_owned_liveliness_token_t}, result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_reply_call, z_closure_reply_loan, z_closure_sample_call, z_closure_sample_loan, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_closure_reply_t, z_moved_closure_sample_t, z_owned_subscriber_t, zc_moved_liveliness_token_t, @@ -110,9 +110,9 @@ pub extern "C" fn zc_liveliness_declare_token( /// Destroys a liveliness token, notifying subscribers of its destruction. #[no_mangle] pub extern "C" fn zc_liveliness_undeclare_token( - this: zc_moved_liveliness_token_t, + this: &mut zc_moved_liveliness_token_t, ) -> result::z_result_t { - if let Some(token) = this.into_rust_type() { + if let Some(token) = this.take_rust_type() { if let Err(e) = token.undeclare().wait() { tracing::error!("Failed to undeclare token: {e}"); return result::Z_EGENERIC; @@ -149,16 +149,13 @@ pub extern "C" fn zc_liveliness_declare_subscriber( this: &mut MaybeUninit, session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: z_moved_closure_sample_t, + callback: &mut z_moved_closure_sample_t, _options: Option<&mut zc_liveliness_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - this.write(None); - return result::Z_EINVAL; - }; + let callback = callback.take_rust_type(); match session .liveliness() .declare_subscriber(key_expr) @@ -204,14 +201,12 @@ pub extern "C" fn zc_liveliness_get_options_default( pub extern "C" fn zc_liveliness_get( session: &z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: z_moved_closure_reply_t, + callback: &mut z_moved_closure_reply_t, options: Option<&mut zc_liveliness_get_options_t>, ) -> result::z_result_t { let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.take_rust_type(); let liveliness: Liveliness<'static> = session.liveliness(); let mut builder = liveliness.get(key_expr).callback(move |response| { z_closure_reply_call( diff --git a/src/payload.rs b/src/payload.rs index 25f61fb8b..f0ee9426d 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -762,9 +762,9 @@ pub extern "C" fn z_bytes_iterator_next( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_serialize_from_shm( this: &mut MaybeUninit, - shm: z_moved_shm_t, + shm: &mut z_moved_shm_t, ) -> z_result_t { - let Some(shm) = shm.into_rust_type() else { + let Some(shm) = shm.take_rust_type() else { this.as_rust_type_mut_uninit().write(ZBytes::default()); return Z_ENULL; }; @@ -778,9 +778,9 @@ pub unsafe extern "C" fn z_bytes_serialize_from_shm( #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_bytes_serialize_from_shm_mut( this: &mut MaybeUninit, - shm: z_moved_shm_mut_t, + shm: &mut z_moved_shm_mut_t, ) -> z_result_t { - let Some(shm) = shm.into_rust_type() else { + let Some(shm) = shm.take_rust_type() else { this.as_rust_type_mut_uninit().write(ZBytes::default()); return Z_ENULL; }; diff --git a/src/publication_cache.rs b/src/publication_cache.rs index 0ae925fdc..8ad2cd12e 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -19,7 +19,7 @@ use zenoh_ext::SessionExt; use crate::{ result, - transmute::{IntoRustType, RustTypeRef, RustTypeRefUninit}, + transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_keyexpr_t, z_loaned_session_t, }; #[cfg(feature = "unstable")] @@ -134,9 +134,9 @@ pub extern "C" fn ze_publication_cache_check(this: &ze_owned_publication_cache_t #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn ze_undeclare_publication_cache( - this: ze_moved_publication_cache_t, + this: &mut ze_moved_publication_cache_t, ) -> result::z_result_t { - if let Some(p) = this.into_rust_type() { + if let Some(p) = this.take_rust_type() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -148,6 +148,6 @@ pub extern "C" fn ze_undeclare_publication_cache( /// Drops publication cache. Also attempts to undeclare it. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_drop(this: ze_moved_publication_cache_t) { - ze_undeclare_publication_cache(this); +pub extern "C" fn ze_publication_cache_drop(_this: &mut ze_moved_publication_cache_t) { + ze_undeclare_publication_cache(_this); } diff --git a/src/publisher.rs b/src/publisher.rs index bba45c399..30903e0f7 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -288,7 +288,7 @@ pub extern "C" fn z_publisher_keyexpr(publisher: &z_loaned_publisher_t) -> &z_lo } #[cfg(feature = "unstable")] -pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_moved_matching_listener_t2, zc_owned_matching_listener_t}; +pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; #[cfg(feature = "unstable")] decl_c_type!( owned(zc_owned_matching_listener_t, option MatchingListener<'static, ()>), @@ -330,13 +330,11 @@ pub struct zc_matching_status_t { pub extern "C" fn zc_publisher_matching_listener_declare( this: &mut MaybeUninit, publisher: &'static z_loaned_publisher_t, - callback: zc_moved_closure_matching_status_t, + callback: &mut zc_moved_closure_matching_status_t, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let publisher = publisher.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - return result::Z_EINVAL; - }; + let callback = callback.take_rust_type(); let listener = publisher .matching_listener() .callback_mut(move |matching_status| { @@ -365,9 +363,9 @@ pub extern "C" fn zc_publisher_matching_listener_declare( #[no_mangle] #[allow(clippy::missing_safety_doc)] pub extern "C" fn zc_publisher_matching_listener_undeclare( - this: &mut zc_moved_matching_listener_t2, + this: &mut zc_moved_matching_listener_t, ) -> result::z_result_t { - if let Some(p) = this.dropper().as_rust_type_mut() { + if let Some(p) = this.take_rust_type() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 80536be82..1912b6fc5 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -23,7 +23,7 @@ use zenoh_ext::*; use crate::{ opaque_types::{ze_loaned_querying_subscriber_t, ze_owned_querying_subscriber_t}, result, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_sample_call, z_closure_sample_loan, z_get_options_t, z_loaned_keyexpr_t, z_loaned_session_t, z_moved_closure_sample_t, z_query_consolidation_none, z_query_consolidation_t, z_query_target_default, z_query_target_t, z_reliability_t, @@ -107,15 +107,12 @@ pub unsafe extern "C" fn ze_declare_querying_subscriber( this: &mut MaybeUninit, session: &'static z_loaned_session_t, key_expr: &z_loaned_keyexpr_t, - callback: z_moved_closure_sample_t, + callback: &mut z_moved_closure_sample_t, options: Option<&mut ze_querying_subscriber_options_t>, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); let session = session.as_rust_type_ref(); - let Some(callback) = callback.into_rust_type() else { - this.write(None); - return result::Z_EINVAL; - }; + let callback = callback.take_rust_type(); let mut sub = session .declare_subscriber(key_expr.as_rust_type_ref()) .querying(); @@ -176,18 +173,18 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( let mut get = session.get(selector).callback(cb); if let Some(options) = options { - if let Some(payload) = options.payload.take_rust_type() { - get = get.payload(payload); + if let Some(payload) = options.payload.take() { + get = get.payload(payload.take_rust_type()); } - if let Some(encoding) = options.encoding.take_rust_type() { - get = get.encoding(encoding); + if let Some(encoding) = options.encoding.take() { + get = get.encoding(encoding.take_rust_type()); } #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take_rust_type() { - get = get.source_info(source_info); + if let Some(source_info) = options.source_info.take() { + get = get.source_info(source_info.take_rust_type()); } - if let Some(attachment) = options.attachment.take_rust_type() { - get = get.attachment(attachment); + if let Some(attachment) = options.attachment.take() { + get = get.attachment(attachment.take_rust_type()); } get = get @@ -215,9 +212,9 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] pub extern "C" fn ze_undeclare_querying_subscriber( - this: ze_moved_querying_subscriber_t, + _this: &mut ze_moved_querying_subscriber_t, ) -> result::z_result_t { - if let Some(s) = this.into_rust_type() { + if let Some(s) = _this.take_rust_type() { if let Err(e) = s.0.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -228,8 +225,8 @@ pub extern "C" fn ze_undeclare_querying_subscriber( /// Drops querying subscriber. Also attempts to undeclare it. #[no_mangle] -pub extern "C" fn ze_querying_subscriber_drop(this: ze_moved_querying_subscriber_t) { - ze_undeclare_querying_subscriber(this); +pub extern "C" fn ze_querying_subscriber_drop(_this: &mut ze_moved_querying_subscriber_t) { + ze_undeclare_querying_subscriber(_this); } /// Returns ``true`` if querying subscriber is valid, ``false`` otherwise. diff --git a/src/session.rs b/src/session.rs index 21ad4279d..897fe92df 100644 --- a/src/session.rs +++ b/src/session.rs @@ -85,14 +85,14 @@ pub extern "C" fn z_open( #[no_mangle] pub extern "C" fn z_open_with_custom_shm_clients( this: &mut MaybeUninit, - config: z_moved_config_t, + config: &mut z_moved_config_t, shm_clients: &z_loaned_shm_client_storage_t, ) -> result::z_result_t { let this = this.as_rust_type_mut_uninit(); if cfg!(feature = "logger-autoinit") { zc_init_logging(); } - let Some(config) = config.into_rust_type().take() else { + let Some(config) = config.take_rust_type() else { tracing::error!("Config not provided"); this.write(None); return result::Z_EINVAL; diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 8b5261e74..0ea044852 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -20,7 +20,7 @@ use std::{ use zenoh::shm::{zshm, zshmmut, ZShm}; use crate::{ - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_shm_mut_t, z_loaned_shm_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_t, }; @@ -31,8 +31,8 @@ decl_c_type!( /// Constructs ZShm slice from ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_from_mut(this: &mut MaybeUninit, that: z_moved_shm_mut_t) { - let shm: Option = that.into_rust_type().take().map(|val| val.into()); +pub extern "C" fn z_shm_from_mut(this: &mut MaybeUninit, that: &mut z_moved_shm_mut_t) { + let shm: Option = that.take_rust_type().take().map(|val| val.into()); this.as_rust_type_mut_uninit().write(shm); } diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index ecb40a7d4..1e398ad0e 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -20,7 +20,7 @@ use std::{ use zenoh::shm::{zshmmut, ZShmMut}; use crate::{ - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_shm_mut_t, z_moved_shm_mut_t, z_moved_shm_t, z_owned_shm_mut_t, }; @@ -33,10 +33,10 @@ decl_c_type!( #[no_mangle] pub extern "C" fn z_shm_mut_try_from_immut( this: &mut MaybeUninit, - that: z_moved_shm_t, + that: &mut z_moved_shm_t, ) { let shm: Option = that - .into_rust_type() + .take_rust_type() .take() .and_then(|val| val.try_into().ok()); this.as_rust_type_mut_uninit().write(shm); diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index c86028733..197fdbf99 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -19,7 +19,7 @@ use zenoh::shm::{ProtocolID, ShmClient, ShmClientStorage, GLOBAL_CLIENT_STORAGE} use super::common::types::z_protocol_id_t; use crate::{ result::{z_result_t, Z_EINVAL, Z_OK}, - transmute::{IntoRustType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_shm_client_storage_t, z_moved_shm_client_storage_t, z_moved_shm_client_t, z_owned_shm_client_storage_t, zc_loaned_shm_client_list_t, zc_moved_shm_client_list_t, zc_owned_shm_client_list_t, @@ -81,10 +81,10 @@ pub unsafe extern "C" fn zc_shm_client_list_loan_mut( #[no_mangle] pub extern "C" fn zc_shm_client_list_add_client( id: z_protocol_id_t, - client: z_moved_shm_client_t, + client: &mut z_moved_shm_client_t, list: &mut zc_loaned_shm_client_list_t, ) -> z_result_t { - let Some(client) = client.into_rust_type() else { + let Some(client) = client.take_rust_type() else { return Z_EINVAL; }; list.as_rust_type_mut().push((id, client)); From 6a5b3b5697804ebe65ad4f431a15cd0789da9433 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 10:53:20 +0200 Subject: [PATCH 079/397] drop functions updated --- build.rs | 8 +- include/zenoh_commons.h | 82 ++++++------ include/zenoh_macros.h | 162 +++++++++++++++++------- src/closures/hello_closure.rs | 7 +- src/closures/log_closure.rs | 7 +- src/closures/matching_status_closure.rs | 7 +- src/closures/query_channel.rs | 12 +- src/closures/query_closure.rs | 7 +- src/closures/reply_closure.rs | 7 +- src/closures/response_channel.rs | 12 +- src/closures/sample_channel.rs | 12 +- src/closures/sample_closure.rs | 7 +- src/closures/zenohid_closure.rs | 7 +- src/collections.rs | 17 ++- src/commons.rs | 13 +- src/config.rs | 8 +- src/encoding.rs | 7 +- src/get.rs | 10 +- src/keyexpr.rs | 5 +- src/liveliness.rs | 5 +- src/payload.rs | 5 +- src/platform/synchronization.rs | 20 +-- src/queryable.rs | 5 +- src/scouting.rs | 5 +- src/session.rs | 5 +- src/shm/buffer/zshm.rs | 5 +- src/shm/buffer/zshmmut.rs | 5 +- src/shm/client/shm_client.rs | 7 +- src/shm/client_storage/mod.rs | 10 +- src/shm/provider/alloc_layout.rs | 7 +- src/shm/provider/shm_provider.rs | 7 +- src/shm/provider/types.rs | 12 +- src/subscriber.rs | 5 +- 33 files changed, 309 insertions(+), 191 deletions(-) diff --git a/build.rs b/build.rs index 8a89f65f0..d2193e070 100644 --- a/build.rs +++ b/build.rs @@ -1141,7 +1141,7 @@ pub fn make_move_take_signatures( path_in: &str, ) -> (Vec, Vec) { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"(\w+)_drop\(struct (\w+) (\w+)\);").unwrap(); + let re = Regex::new(r"(\w+)_drop\(struct (\w+) \*(\w+)\);").unwrap(); let mut move_funcs = Vec::::new(); let mut take_funcs = Vec::::new(); @@ -1217,7 +1217,7 @@ pub fn find_loan_mut_functions(path_in: &str) -> Vec { pub fn find_drop_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"(.+?) +(\w+_drop)\(struct (\w+) (\w+)\);").unwrap(); + let re = Regex::new(r"(.+?) +(\w+_drop)\(struct (\w+) \*(\w+)\);").unwrap(); let mut res = Vec::::new(); for (_, [return_type, func_name, arg_type, arg_name]) in @@ -1344,7 +1344,9 @@ pub fn generate_generic_c( let va_args = macro_func .iter() .any(|f| f.args.len() != macro_func[0].args.len()); - let mut args = macro_func[0] + let mut args = macro_func + .first() + .unwrap_or_else(|| panic!("no sigatures found for building generic {generic_name}")) .args .iter() .map(|a| a.name.to_string()) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 5f778ddfe..c83877cd4 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -1049,7 +1049,7 @@ ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_) * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t this_); +ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); #endif /** * Borrows Alloc Layout @@ -1223,7 +1223,7 @@ z_result_t z_bytes_deserialize_into_uint8(const struct z_loaned_bytes_t *this_, * Drops `this_`, resetting it to gravestone value. If there are any shallow copies * created by `z_bytes_clone()`, they would still stay valid. */ -ZENOHC_API void z_bytes_drop(struct z_moved_bytes_t this_); +ZENOHC_API void z_bytes_drop(struct z_moved_bytes_t *this_); /** * Constructs an empty instance of `z_owned_bytes_t`. */ @@ -1506,7 +1506,7 @@ ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_resu * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t this_); +ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); #endif /** * Borrows Chunk Alloc Result @@ -1574,7 +1574,7 @@ ZENOHC_API bool z_closure_hello_check(const struct z_owned_closure_hello_t *this /** * Drops the closure. Droping an uninitialized closure is a no-op. */ -ZENOHC_API void z_closure_hello_drop(struct z_moved_closure_hello_t _closure); +ZENOHC_API void z_closure_hello_drop(struct z_moved_closure_hello_t *this_); /** * Borrows closure. */ @@ -1597,7 +1597,7 @@ ZENOHC_API bool z_closure_query_check(const struct z_owned_closure_query_t *this /** * Drops the closure, resetting it to its gravestone state. */ -ZENOHC_API void z_closure_query_drop(struct z_moved_closure_query_t closure); +ZENOHC_API void z_closure_query_drop(struct z_moved_closure_query_t *closure_); /** * Borrows closure. */ @@ -1621,7 +1621,7 @@ ZENOHC_API bool z_closure_reply_check(const struct z_owned_closure_reply_t *this * Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. */ ZENOHC_API -void z_closure_reply_drop(struct z_moved_closure_reply_t closure); +void z_closure_reply_drop(struct z_moved_closure_reply_t *closure_); /** * Borrows closure. */ @@ -1644,7 +1644,7 @@ ZENOHC_API bool z_closure_sample_check(const struct z_owned_closure_sample_t *th /** * Drops the closure. Droping an uninitialized closure is a no-op. */ -ZENOHC_API void z_closure_sample_drop(struct z_moved_closure_sample_t closure); +ZENOHC_API void z_closure_sample_drop(struct z_moved_closure_sample_t *closure_); /** * Borrows closure. */ @@ -1673,7 +1673,7 @@ ZENOHC_API bool z_closure_zid_check(const struct z_owned_closure_zid_t *this_); */ #if defined(UNSTABLE) ZENOHC_API -void z_closure_zid_drop(struct z_moved_closure_zid_t closure); +void z_closure_zid_drop(struct z_moved_closure_zid_t *closure_); #endif /** * Vorrows closure. @@ -1695,7 +1695,7 @@ ZENOHC_API bool z_condvar_check(const struct z_owned_condvar_t *this_); /** * Drops conditional variable. */ -ZENOHC_API void z_condvar_drop(struct z_moved_condvar_t this_); +ZENOHC_API void z_condvar_drop(struct z_moved_condvar_t *this_); /** * Constructs conditional variable. */ @@ -1754,7 +1754,7 @@ ZENOHC_API z_result_t z_config_default(struct z_owned_config_t *this_); /** * Frees `config`, and resets it to its gravestone state. */ -ZENOHC_API void z_config_drop(struct z_moved_config_t this_); +ZENOHC_API void z_config_drop(struct z_moved_config_t *this_); /** * Borrows config. */ @@ -2020,7 +2020,7 @@ void z_encoding_clone(struct z_owned_encoding_t *dst, /** * Frees the memory and resets the encoding it to its default value. */ -ZENOHC_API void z_encoding_drop(struct z_moved_encoding_t this_); +ZENOHC_API void z_encoding_drop(struct z_moved_encoding_t *this_); /** * Constructs a `z_owned_encoding_t` from a specified string. */ @@ -2391,7 +2391,7 @@ ZENOHC_API bool z_fifo_handler_query_check(const struct z_owned_fifo_handler_que /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_fifo_handler_query_drop(struct z_moved_fifo_handler_query_t this_); +ZENOHC_API void z_fifo_handler_query_drop(struct z_moved_fifo_handler_query_t *this_); /** * Borrows handler. */ @@ -2425,7 +2425,7 @@ ZENOHC_API bool z_fifo_handler_reply_check(const struct z_owned_fifo_handler_rep /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_fifo_handler_reply_drop(struct z_moved_fifo_handler_reply_t this_); +ZENOHC_API void z_fifo_handler_reply_drop(struct z_moved_fifo_handler_reply_t *this_); /** * Borrows handler. */ @@ -2458,7 +2458,7 @@ ZENOHC_API bool z_fifo_handler_sample_check(const struct z_owned_fifo_handler_sa /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_fifo_handler_sample_drop(struct z_moved_fifo_handler_sample_t this_); +ZENOHC_API void z_fifo_handler_sample_drop(struct z_moved_fifo_handler_sample_t *this_); /** * Borrows handler. */ @@ -2514,7 +2514,7 @@ ZENOHC_API bool z_hello_check(const struct z_owned_hello_t *this_); /** * Frees memory and resets hello message to its gravestone state. */ -ZENOHC_API void z_hello_drop(struct z_moved_hello_t this_); +ZENOHC_API void z_hello_drop(struct z_moved_hello_t *this_); /** * Borrows hello message. */ @@ -2623,7 +2623,7 @@ z_result_t z_keyexpr_concat(struct z_owned_keyexpr_t *this_, /** * Frees key expression and resets it to its gravestone state. */ -ZENOHC_API void z_keyexpr_drop(struct z_moved_keyexpr_t this_); +ZENOHC_API void z_keyexpr_drop(struct z_moved_keyexpr_t *this_); /** * Returns ``true`` if both ``left`` and ``right`` are equal, ``false`` otherwise. */ @@ -2725,7 +2725,7 @@ ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t this_); +ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); #endif /** * Extract data from Memory Layout @@ -2765,7 +2765,7 @@ ZENOHC_API bool z_mutex_check(const struct z_owned_mutex_t *this_); /** * Drops mutex and resets it to its gravestone state. */ -ZENOHC_API void z_mutex_drop(struct z_moved_mutex_t this_); +ZENOHC_API void z_mutex_drop(struct z_moved_mutex_t *this_); /** * Constructs a mutex. * @return 0 in case of success, negative error code otherwise. @@ -3131,7 +3131,7 @@ ZENOHC_API void z_reply_clone(struct z_owned_reply_t *dst, const struct z_loaned /** * Frees reply, resetting it to its gravestone state. */ -ZENOHC_API void z_reply_drop(struct z_moved_reply_t this_); +ZENOHC_API void z_reply_drop(struct z_moved_reply_t *this_); /** * Yields the contents of the reply by asserting it indicates a failure. * @@ -3145,7 +3145,7 @@ ZENOHC_API bool z_reply_err_check(const struct z_owned_reply_err_t *this_); /** * Frees the memory and resets the reply error it to its default value. */ -ZENOHC_API void z_reply_err_drop(struct z_moved_reply_err_t this_); +ZENOHC_API void z_reply_err_drop(struct z_moved_reply_err_t *this_); /** * Returns reply error encoding. */ @@ -3219,7 +3219,7 @@ ZENOHC_API bool z_ring_handler_query_check(const struct z_owned_ring_handler_que /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_ring_handler_query_drop(struct z_moved_ring_handler_query_t this_); +ZENOHC_API void z_ring_handler_query_drop(struct z_moved_ring_handler_query_t *this_); /** * Borrows handler. */ @@ -3252,7 +3252,7 @@ ZENOHC_API bool z_ring_handler_reply_check(const struct z_owned_ring_handler_rep /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_ring_handler_reply_drop(struct z_moved_ring_handler_reply_t this_); +ZENOHC_API void z_ring_handler_reply_drop(struct z_moved_ring_handler_reply_t *this_); /** * Borrows handler. */ @@ -3285,7 +3285,7 @@ ZENOHC_API bool z_ring_handler_sample_check(const struct z_owned_ring_handler_sa /** * Drops the handler and resets it to a gravestone state. */ -ZENOHC_API void z_ring_handler_sample_drop(struct z_moved_ring_handler_sample_t this_); +ZENOHC_API void z_ring_handler_sample_drop(struct z_moved_ring_handler_sample_t *this_); /** * Borrows handler. */ @@ -3336,7 +3336,7 @@ enum z_congestion_control_t z_sample_congestion_control(const struct z_loaned_sa /** * Frees the memory and invalidates the sample, resetting it to a gravestone state. */ -ZENOHC_API void z_sample_drop(struct z_moved_sample_t this_); +ZENOHC_API void z_sample_drop(struct z_moved_sample_t *this_); /** * Returns the encoding associated with the sample data. */ @@ -3415,7 +3415,7 @@ void z_session_clone(struct z_owned_session_t *dst, * * This will also close the session if it does not have any clones left. */ -ZENOHC_API void z_session_drop(struct z_moved_session_t this_); +ZENOHC_API void z_session_drop(struct z_moved_session_t *this_); /** * Borrows session. */ @@ -3440,7 +3440,7 @@ ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t this_); +ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t *this_); #endif /** * Creates a new SHM Client @@ -3475,7 +3475,7 @@ void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t this_); +ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); #endif /** * Borrows SHM Client Storage @@ -3515,7 +3515,7 @@ ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(struct z_moved_shm_t this_); +ZENOHC_API void z_shm_drop(struct z_moved_shm_t *this_); #endif /** * Constructs ZShm slice from ZShmMut slice @@ -3563,7 +3563,7 @@ ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t this_); +ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); #endif /** * @return the length of the ZShmMut slice @@ -3664,7 +3664,7 @@ ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t this_); +ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); @@ -3757,7 +3757,7 @@ ZENOHC_API const uint8_t *z_slice_data(const struct z_loaned_slice_t *this_); /** * Frees the memory and invalidates the slice. */ -ZENOHC_API void z_slice_drop(struct z_moved_slice_t this_); +ZENOHC_API void z_slice_drop(struct z_moved_slice_t *this_); /** * Constructs an empty `z_owned_slice_t`. */ @@ -3804,7 +3804,7 @@ ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t this_); +ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t *this_); #endif /** * Returns the source_id of the source info. @@ -3847,7 +3847,7 @@ ZENOHC_API bool z_string_array_check(const struct z_owned_string_array_t *this_) /** * Destroys the string array, resetting it to its gravestone value. */ -ZENOHC_API void z_string_array_drop(struct z_moved_string_array_t this_); +ZENOHC_API void z_string_array_drop(struct z_moved_string_array_t *this_); /** * @return the value at the position of index in the string array. * @@ -3931,7 +3931,7 @@ ZENOHC_API const char *z_string_data(const struct z_loaned_string_t *this_); /** * Frees memory and invalidates `z_owned_string_t`, putting it in gravestone state. */ -ZENOHC_API void z_string_drop(struct z_moved_string_t this_); +ZENOHC_API void z_string_drop(struct z_moved_string_t *this_); /** * Constructs an empty owned string. */ @@ -3972,7 +3972,7 @@ ZENOHC_API bool z_subscriber_check(const struct z_owned_subscriber_t *this_); /** * Drops subscriber and resets it to its gravestone state. Also attempts to undeclare it. */ -ZENOHC_API void z_subscriber_drop(struct z_moved_subscriber_t this_); +ZENOHC_API void z_subscriber_drop(struct z_moved_subscriber_t *this_); /** * Returns the key expression of the subscriber. */ @@ -3998,11 +3998,11 @@ ZENOHC_API bool z_task_check(const struct z_owned_task_t *this_); /** * Detaches the task and releases all allocated resources. */ -ZENOHC_API void z_task_detach(struct z_moved_task_t this_); +ZENOHC_API void z_task_detach(struct z_moved_task_t *this_); /** * Drop the task. Same as `z_task_detach`. Use `z_task_join` to wait for the task completion. */ -ZENOHC_API void z_task_drop(struct z_moved_task_t this_); +ZENOHC_API void z_task_drop(struct z_moved_task_t *this_); /** * Constructs a new task. * @@ -4256,7 +4256,7 @@ ZENOHC_API bool zc_closure_log_check(const struct zc_owned_closure_log_t *this_) /** * Drops the closure. Droping an uninitialized closure is a no-op. */ -ZENOHC_API void zc_closure_log_drop(struct zc_moved_closure_log_t closure); +ZENOHC_API void zc_closure_log_drop(struct zc_moved_closure_log_t *closure_); /** * Borrows closure. */ @@ -4286,7 +4286,7 @@ bool zc_closure_matching_status_check(const struct zc_owned_closure_matching_sta */ #if defined(UNSTABLE) ZENOHC_API -void zc_closure_matching_status_drop(struct zc_moved_closure_matching_status_t closure); +void zc_closure_matching_status_drop(struct zc_moved_closure_matching_status_t *closure_); #endif /** * Borrows closure. @@ -4465,7 +4465,7 @@ ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t this_); +ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t *this_); #endif /** * Borrows token. @@ -4569,7 +4569,7 @@ ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t this_); +ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); #endif /** * Borrows list of SHM Clients diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index fccf7defd..b05f0b896 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -22,6 +22,9 @@ static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t){x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } +static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } +static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } +static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t){x}; } static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t){x}; } static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return (z_moved_reply_err_t){x}; } static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return (z_moved_ring_handler_query_t){x}; } @@ -43,7 +46,10 @@ static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_ta static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } +static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t){x}; } static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } +static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } +static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } #define z_loan(this_) \ @@ -128,6 +134,9 @@ static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_cl z_moved_keyexpr_t : z_keyexpr_drop, \ z_moved_memory_layout_t : z_memory_layout_drop, \ z_moved_mutex_t : z_mutex_drop, \ + z_moved_publisher_t : z_publisher_drop, \ + z_moved_query_t : z_query_drop, \ + z_moved_queryable_t : z_queryable_drop, \ z_moved_reply_t : z_reply_drop, \ z_moved_reply_err_t : z_reply_err_drop, \ z_moved_ring_handler_query_t : z_ring_handler_query_drop, \ @@ -149,7 +158,10 @@ static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_cl zc_moved_closure_log_t : zc_closure_log_drop, \ zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ - zc_moved_shm_client_list_t : zc_shm_client_list_drop \ + zc_moved_matching_listener_t : zc_publisher_matching_listener_drop, \ + zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ + ze_moved_publication_cache_t : ze_publication_cache_drop, \ + ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ )(this_) #define z_move(this_) \ @@ -172,6 +184,9 @@ static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_cl z_owned_keyexpr_t : z_keyexpr_move, \ z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ + z_owned_publisher_t : z_publisher_move, \ + z_owned_query_t : z_query_move, \ + z_owned_queryable_t : z_queryable_move, \ z_owned_reply_t : z_reply_move, \ z_owned_reply_err_t : z_reply_err_move, \ z_owned_ring_handler_query_t : z_ring_handler_query_move, \ @@ -193,7 +208,10 @@ static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_cl zc_owned_closure_log_t : zc_closure_log_move, \ zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move \ + zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ + zc_owned_shm_client_list_t : zc_shm_client_list_move, \ + ze_owned_publication_cache_t : ze_publication_cache_move, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ )(&this_) #define z_null(this_) \ @@ -249,11 +267,11 @@ static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_cl static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { *this_ = *x._ptr; z_closure_hello_null(x._ptr); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { *closure_ = *x._ptr; z_closure_query_null(x._ptr); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { *closure_ = *x._ptr; z_closure_reply_null(x._ptr); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { *closure_ = *x._ptr; z_closure_sample_null(x._ptr); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t x) { *closure_ = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -264,6 +282,9 @@ static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *th static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } +static inline void z_publisher_take(z_owned_publisher_t* _this, z_moved_publisher_t x) { *_this = *x._ptr; z_publisher_null(x._ptr); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } @@ -282,10 +303,13 @@ static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_st static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { *closure_ = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t x) { *closure_ = *x._ptr; zc_closure_matching_status_null(x._ptr); } static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } +static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* _this, ze_moved_publication_cache_t x) { *_this = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* _this, ze_moved_querying_subscriber_t x) { *_this = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ @@ -308,6 +332,9 @@ static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc z_owned_keyexpr_t* : z_keyexpr_take, \ z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ + z_owned_publisher_t* : z_publisher_take, \ + z_owned_query_t* : z_query_take, \ + z_owned_queryable_t* : z_queryable_take, \ z_owned_reply_t* : z_reply_take, \ z_owned_reply_err_t* : z_reply_err_take, \ z_owned_ring_handler_query_t* : z_ring_handler_query_take, \ @@ -329,7 +356,10 @@ static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc zc_owned_closure_log_t* : zc_closure_log_take, \ zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take \ + zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ + ze_owned_publication_cache_t* : ze_publication_cache_take, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ )(this_, x) #define z_check(this_) \ @@ -435,6 +465,9 @@ static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_ static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return z_moved_memory_layout_t{x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } +static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } +static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } +static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return z_moved_queryable_t{x}; } static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return z_moved_reply_t{x}; } static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return z_moved_reply_err_t{x}; } static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return z_moved_ring_handler_query_t{x}; } @@ -456,7 +489,10 @@ static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_tas static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } +static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return zc_moved_matching_listener_t{x}; } static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } +static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } +static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } @@ -521,11 +557,11 @@ inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_ inline void z_drop(z_moved_alloc_layout_t this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; inline void z_drop(z_moved_chunk_alloc_result_t this_) { z_chunk_alloc_result_drop(this_); }; -inline void z_drop(z_moved_closure_hello_t _closure) { z_closure_hello_drop(_closure); }; -inline void z_drop(z_moved_closure_query_t closure) { z_closure_query_drop(closure); }; -inline void z_drop(z_moved_closure_reply_t closure) { z_closure_reply_drop(closure); }; -inline void z_drop(z_moved_closure_sample_t closure) { z_closure_sample_drop(closure); }; -inline void z_drop(z_moved_closure_zid_t closure) { z_closure_zid_drop(closure); }; +inline void z_drop(z_moved_closure_hello_t this_) { z_closure_hello_drop(this_); }; +inline void z_drop(z_moved_closure_query_t closure_) { z_closure_query_drop(closure_); }; +inline void z_drop(z_moved_closure_reply_t closure_) { z_closure_reply_drop(closure_); }; +inline void z_drop(z_moved_closure_sample_t closure_) { z_closure_sample_drop(closure_); }; +inline void z_drop(z_moved_closure_zid_t closure_) { z_closure_zid_drop(closure_); }; inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; @@ -536,6 +572,9 @@ inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; +inline void z_drop(z_moved_publisher_t _this) { z_publisher_drop(_this); }; +inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; +inline void z_drop(z_moved_queryable_t this_) { z_queryable_drop(this_); }; inline void z_drop(z_moved_reply_t this_) { z_reply_drop(this_); }; inline void z_drop(z_moved_reply_err_t this_) { z_reply_err_drop(this_); }; inline void z_drop(z_moved_ring_handler_query_t this_) { z_ring_handler_query_drop(this_); }; @@ -554,20 +593,23 @@ inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); } inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; -inline void z_drop(zc_moved_closure_log_t closure) { zc_closure_log_drop(closure); }; -inline void z_drop(zc_moved_closure_matching_status_t closure) { zc_closure_matching_status_drop(closure); }; +inline void z_drop(zc_moved_closure_log_t closure_) { zc_closure_log_drop(closure_); }; +inline void z_drop(zc_moved_closure_matching_status_t closure_) { zc_closure_matching_status_drop(closure_); }; inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; +inline z_result_t z_drop(zc_moved_matching_listener_t this_) { return zc_publisher_matching_listener_drop(this_); }; inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; +inline void z_drop(ze_moved_publication_cache_t _this) { ze_publication_cache_drop(_this); }; +inline void z_drop(ze_moved_querying_subscriber_t _this) { ze_querying_subscriber_drop(_this); }; inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; inline z_moved_chunk_alloc_result_t z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; -inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& _closure) { return z_closure_hello_move(&_closure); }; -inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure) { return z_closure_query_move(&closure); }; -inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure) { return z_closure_reply_move(&closure); }; -inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure) { return z_closure_sample_move(&closure); }; -inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure) { return z_closure_zid_move(&closure); }; +inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; +inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; +inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; +inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; +inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure_) { return z_closure_zid_move(&closure_); }; inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -578,6 +620,9 @@ inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&thi inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; +inline z_moved_publisher_t z_move(z_owned_publisher_t& _this) { return z_publisher_move(&_this); }; +inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; +inline z_moved_queryable_t z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; inline z_moved_reply_t z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; inline z_moved_reply_err_t z_move(z_owned_reply_err_t& this_) { return z_reply_err_move(&this_); }; inline z_moved_ring_handler_query_t z_move(z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_move(&this_); }; @@ -596,10 +641,13 @@ inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_s inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; -inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure) { return zc_closure_log_move(&closure); }; -inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_move(&closure); }; +inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; +inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure_) { return zc_closure_matching_status_move(&closure_); }; inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; +inline zc_moved_matching_listener_t z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; +inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& _this) { return ze_publication_cache_move(&_this); }; +inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& _this) { return ze_querying_subscriber_move(&_this); }; inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; @@ -652,11 +700,11 @@ inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscrib static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { *_closure = *x._ptr; z_closure_hello_null(x._ptr); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { *closure = *x._ptr; z_closure_query_null(x._ptr); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { *closure = *x._ptr; z_closure_reply_null(x._ptr); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { *closure = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { *closure = *x._ptr; z_closure_zid_null(x._ptr); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { *this_ = *x._ptr; z_closure_hello_null(x._ptr); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { *closure_ = *x._ptr; z_closure_query_null(x._ptr); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { *closure_ = *x._ptr; z_closure_reply_null(x._ptr); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { *closure_ = *x._ptr; z_closure_sample_null(x._ptr); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t x) { *closure_ = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -667,6 +715,9 @@ static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *th static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } +static inline void z_publisher_take(z_owned_publisher_t* _this, z_moved_publisher_t x) { *_this = *x._ptr; z_publisher_null(x._ptr); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } @@ -685,10 +736,13 @@ static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_st static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { *closure = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { *closure = *x._ptr; zc_closure_matching_status_null(x._ptr); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { *closure_ = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t x) { *closure_ = *x._ptr; zc_closure_matching_status_null(x._ptr); } static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } +static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* _this, ze_moved_publication_cache_t x) { *_this = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* _this, ze_moved_querying_subscriber_t x) { *_this = *x._ptr; ze_querying_subscriber_null(x._ptr); } @@ -701,20 +755,20 @@ inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { z_chunk_alloc_result_take(this_, x); }; -inline void z_take(z_owned_closure_hello_t* _closure, z_moved_closure_hello_t x) { - z_closure_hello_take(_closure, x); +inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { + z_closure_hello_take(this_, x); }; -inline void z_take(z_owned_closure_query_t* closure, z_moved_closure_query_t x) { - z_closure_query_take(closure, x); +inline void z_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { + z_closure_query_take(closure_, x); }; -inline void z_take(z_owned_closure_reply_t* closure, z_moved_closure_reply_t x) { - z_closure_reply_take(closure, x); +inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { + z_closure_reply_take(closure_, x); }; -inline void z_take(z_owned_closure_sample_t* closure, z_moved_closure_sample_t x) { - z_closure_sample_take(closure, x); +inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { + z_closure_sample_take(closure_, x); }; -inline void z_take(z_owned_closure_zid_t* closure, z_moved_closure_zid_t x) { - z_closure_zid_take(closure, x); +inline void z_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t x) { + z_closure_zid_take(closure_, x); }; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { z_condvar_take(this_, x); @@ -746,6 +800,15 @@ inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { z_mutex_take(this_, x); }; +inline void z_take(z_owned_publisher_t* _this, z_moved_publisher_t x) { + z_publisher_take(_this, x); +}; +inline void z_take(z_owned_query_t* this_, z_moved_query_t x) { + z_query_take(this_, x); +}; +inline void z_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { + z_queryable_take(this_, x); +}; inline void z_take(z_owned_reply_t* this_, z_moved_reply_t x) { z_reply_take(this_, x); }; @@ -800,18 +863,27 @@ inline void z_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { z_task_take(this_, x); }; -inline void z_take(zc_owned_closure_log_t* closure, zc_moved_closure_log_t x) { - zc_closure_log_take(closure, x); +inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { + zc_closure_log_take(closure_, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure, zc_moved_closure_matching_status_t x) { - zc_closure_matching_status_take(closure, x); +inline void z_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t x) { + zc_closure_matching_status_take(closure_, x); }; inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { zc_liveliness_token_take(this_, x); }; +inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { + zc_publisher_matching_listener_take(this_, x); +}; inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { zc_shm_client_list_take(this_, x); }; +inline void z_take(ze_owned_publication_cache_t* _this, ze_moved_publication_cache_t x) { + ze_publication_cache_take(_this, x); +}; +inline void z_take(ze_owned_querying_subscriber_t* _this, ze_moved_querying_subscriber_t x) { + ze_querying_subscriber_take(_this, x); +}; inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index 275371389..6f6531ee9 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -17,7 +17,7 @@ use std::mem::MaybeUninit; use libc::c_void; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, z_loaned_hello_t, }; /// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -102,8 +102,9 @@ pub extern "C" fn z_closure_hello_call( } /// Drops the closure. Droping an uninitialized closure is a no-op. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_closure_hello_drop(_closure: z_moved_closure_hello_t) {} +pub extern "C" fn z_closure_hello_drop(this_: &mut z_moved_closure_hello_t) { + let _ = this_.take_rust_type(); +} impl From for z_owned_closure_hello_t { fn from(f: F) -> Self { diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs index 754d63118..930a4abbb 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -15,7 +15,7 @@ use std::mem::MaybeUninit; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, z_loaned_string_t, }; @@ -166,8 +166,9 @@ pub extern "C" fn zc_closure_log_call( } /// Drops the closure. Droping an uninitialized closure is a no-op. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn zc_closure_log_drop(closure: zc_moved_closure_log_t) {} +pub extern "C" fn zc_closure_log_drop(closure_: &mut zc_moved_closure_log_t) { + let _ = closure_.take_rust_type(); +} /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index bae2312f2..8a77fcc17 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -16,7 +16,7 @@ use std::mem::MaybeUninit; use libc::c_void; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, zc_matching_status_t, }; /// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -112,8 +112,9 @@ pub extern "C" fn zc_closure_matching_status_call( } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn zc_closure_matching_status_drop(closure: zc_moved_closure_matching_status_t) {} +pub extern "C" fn zc_closure_matching_status_drop(closure_: &mut zc_moved_closure_matching_status_t) { + let _ = closure_.take_rust_type(); +} impl From for zc_owned_closure_matching_status_t { fn from(f: F) -> Self { diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index 43b280850..492339040 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -25,7 +25,7 @@ pub use crate::opaque_types::{ }; use crate::{ result::{self, z_result_t}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_query_t, z_owned_closure_query_t, z_owned_query_t, }; decl_c_type!( @@ -35,8 +35,9 @@ decl_c_type!( /// Drops the handler and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_fifo_handler_query_drop(this: z_moved_fifo_handler_query_t) {} +pub extern "C" fn z_fifo_handler_query_drop(this_: &mut z_moved_fifo_handler_query_t) { + let _ = this_.take_rust_type(); +} /// Constructs a handler in gravestone state. #[no_mangle] @@ -154,8 +155,9 @@ decl_c_type!( /// Drops the handler and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_ring_handler_query_drop(this: z_moved_ring_handler_query_t) {} +pub extern "C" fn z_ring_handler_query_drop(this_: &mut z_moved_ring_handler_query_t) { + let _ = this_.take_rust_type(); +} /// Constructs a handler in gravestone state. #[no_mangle] diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 85104a50f..331e3df25 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -17,7 +17,7 @@ use std::mem::MaybeUninit; use libc::c_void; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, z_loaned_query_t, }; /// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -107,8 +107,9 @@ pub extern "C" fn z_closure_query_call( } /// Drops the closure, resetting it to its gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_closure_query_drop(closure: z_moved_closure_query_t) {} +pub extern "C" fn z_closure_query_drop(closure_: &mut z_moved_closure_query_t) { + let _ = closure_.take_rust_type(); +} impl From for z_owned_closure_query_t { fn from(f: F) -> Self { diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 112c68c2f..80b72fbc7 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -17,7 +17,7 @@ use std::mem::MaybeUninit; use libc::c_void; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, z_loaned_reply_t, }; /// A structure that contains all the elements for stateful, memory-leak-free callbacks. @@ -110,8 +110,9 @@ pub extern "C" fn z_closure_reply_call( } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_closure_reply_drop(closure: z_moved_closure_reply_t) {} +pub extern "C" fn z_closure_reply_drop(closure_: &mut z_moved_closure_reply_t) { + let _ = closure_.take_rust_type(); +} impl From for z_owned_closure_reply_t { fn from(f: F) -> Self { diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index 741b754e6..28baad2a8 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -25,7 +25,7 @@ pub use crate::opaque_types::{ }; use crate::{ result::{self, z_result_t}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_reply_t, z_owned_closure_reply_t, z_owned_reply_t, }; decl_c_type!( @@ -35,8 +35,9 @@ decl_c_type!( /// Drops the handler and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_fifo_handler_reply_drop(this: z_moved_fifo_handler_reply_t) {} +pub extern "C" fn z_fifo_handler_reply_drop(this_: &mut z_moved_fifo_handler_reply_t) { + let _ = this_.take_rust_type(); +} /// Constructs a handler in gravestone state. #[no_mangle] @@ -150,8 +151,9 @@ decl_c_type!( /// Drops the handler and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_ring_handler_reply_drop(this: z_moved_ring_handler_reply_t) {} +pub extern "C" fn z_ring_handler_reply_drop(this_: &mut z_moved_ring_handler_reply_t) { + let _ = this_.take_rust_type(); +} /// Constructs a handler in gravestone state. #[no_mangle] diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index c418b9d3e..cd586c9dd 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -25,7 +25,7 @@ pub use crate::opaque_types::{ }; use crate::{ result::{self, z_result_t}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_sample_t, z_owned_closure_sample_t, z_owned_sample_t, }; decl_c_type!( @@ -35,8 +35,9 @@ decl_c_type!( /// Drops the handler and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_fifo_handler_sample_drop(this: z_moved_fifo_handler_sample_t) {} +pub extern "C" fn z_fifo_handler_sample_drop(this_: &mut z_moved_fifo_handler_sample_t) { + let _ = this_.take_rust_type(); +} /// Constructs a handler in gravestone state. #[no_mangle] @@ -156,8 +157,9 @@ decl_c_type!( /// Drops the handler and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_ring_handler_sample_drop(this: z_moved_ring_handler_sample_t) {} +pub extern "C" fn z_ring_handler_sample_drop(this_: &mut z_moved_ring_handler_sample_t) { + let _ = this_.take_rust_type(); +} /// Constructs a handler in gravestone state. #[no_mangle] diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index 54ff18b03..b60c5ba03 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -17,7 +17,7 @@ use std::mem::MaybeUninit; use libc::c_void; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, z_loaned_sample_t, }; /// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks. @@ -109,8 +109,9 @@ pub extern "C" fn z_closure_sample_call( /// Drops the closure. Droping an uninitialized closure is a no-op. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_closure_sample_drop(closure: z_moved_closure_sample_t) {} +pub extern "C" fn z_closure_sample_drop(closure_: &mut z_moved_closure_sample_t) { + let _ = closure_.take_rust_type(); +} impl From for z_owned_closure_sample_t { fn from(f: F) -> Self { diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index eedc0a648..d6f6d01fa 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -17,7 +17,7 @@ use std::mem::MaybeUninit; use libc::c_void; use crate::{ - transmute::{LoanedCTypeRef, OwnedCTypeRef}, + transmute::{LoanedCTypeRef, OwnedCTypeRef, TakeRustType}, z_id_t, }; /// A closure is a structure that contains all the elements for stateful, memory-leak-free callbacks: @@ -107,8 +107,9 @@ pub extern "C" fn z_closure_zid_call(closure: &z_loaned_closure_zid_t, z_id: &z_ } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized (null) closure is a no-op. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_closure_zid_drop(closure: z_moved_closure_zid_t) {} +pub extern "C" fn z_closure_zid_drop(closure_: &mut z_moved_closure_zid_t) { + let _ = closure_.take_rust_type(); +} impl From for z_owned_closure_zid_t { fn from(f: F) -> Self { diff --git a/src/collections.rs b/src/collections.rs index 8563368a7..c40bca0bc 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -25,7 +25,7 @@ use libc::strlen; use crate::{ result::{self, z_result_t}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, }; pub struct CSlice { @@ -323,8 +323,9 @@ pub extern "C" fn z_slice_null(this: &mut MaybeUninit) { /// Frees the memory and invalidates the slice. #[no_mangle] #[allow(clippy::missing_safety_doc)] -#[allow(unused_variables)] -pub unsafe extern "C" fn z_slice_drop(this: z_moved_slice_t) {} +pub unsafe extern "C" fn z_slice_drop(this_:&mut z_moved_slice_t) { + let _ = this_.take_rust_type(); +} /// Borrows slice. #[no_mangle] @@ -529,8 +530,9 @@ decl_c_type!( /// Frees memory and invalidates `z_owned_string_t`, putting it in gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -#[allow(unused_variables)] -pub unsafe extern "C" fn z_string_drop(this: z_moved_string_t) {} +pub unsafe extern "C" fn z_string_drop(this_: &mut z_moved_string_t) { + let _ = this_.take_rust_type(); +} /// @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. #[no_mangle] @@ -749,8 +751,9 @@ pub extern "C" fn z_string_array_check(this: &z_owned_string_array_t) -> bool { /// Destroys the string array, resetting it to its gravestone value. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_string_array_drop(this: z_moved_string_array_t) {} +pub extern "C" fn z_string_array_drop(this_: &mut z_moved_string_array_t) { + let _ = this_.take_rust_type(); +} /// Borrows string array. #[no_mangle] diff --git a/src/commons.rs b/src/commons.rs index 2b5499fe2..706948a96 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -12,6 +12,9 @@ // ZettaScale Zenoh team, // +#[cfg(feature = "unstable")] +use crate::transmute::TakeRustType; + use std::{mem::MaybeUninit, ptr::null}; use libc::c_ulong; @@ -201,8 +204,9 @@ pub unsafe extern "C" fn z_sample_loan(this: &z_owned_sample_t) -> &z_loaned_sam /// Frees the memory and invalidates the sample, resetting it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_sample_drop(this: z_moved_sample_t) {} +pub extern "C" fn z_sample_drop(this_: &mut z_moved_sample_t) { + let _ = this_.take_rust_type(); +} /// Constructs sample in its gravestone state. #[no_mangle] @@ -535,8 +539,9 @@ pub extern "C" fn z_source_info_loan(this: &z_owned_source_info_t) -> &z_loaned_ #[cfg(feature = "unstable")] /// Frees the memory and invalidates the source info, resetting it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_source_info_drop(this: z_moved_source_info_t) {} +pub extern "C" fn z_source_info_drop(this_: &mut z_moved_source_info_t) { + let _ = this_.take_rust_type(); +} #[cfg(feature = "unstable")] /// Constructs source info in its gravestone state. diff --git a/src/config.rs b/src/config.rs index 735a63730..084ede15d 100644 --- a/src/config.rs +++ b/src/config.rs @@ -18,7 +18,7 @@ use zenoh::config::{Config, Locator, ValidatedMap, WhatAmI}; use crate::{ result::{self, z_result_t, Z_OK}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_owned_string_t, z_string_copy_from_substr, z_string_null, }; @@ -220,8 +220,10 @@ pub unsafe extern "C" fn zc_config_insert_json_from_substr( /// Frees `config`, and resets it to its gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_config_drop(this: z_moved_config_t) {} +pub extern "C" fn z_config_drop(this_: &mut z_moved_config_t) { + let _ = this_.take_rust_type(); +} + /// Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] diff --git a/src/encoding.rs b/src/encoding.rs index 239ac5eff..09626fe08 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -26,7 +26,7 @@ use zenoh::bytes::Encoding; pub use crate::opaque_types::{z_loaned_encoding_t, z_owned_encoding_t}; use crate::{ result::{self, z_result_t}, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_moved_encoding_t, z_owned_string_t, z_string_copy_from_substr, }; @@ -144,8 +144,9 @@ pub extern "C" fn z_encoding_null(this: &mut MaybeUninit) { /// Frees the memory and resets the encoding it to its default value. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_encoding_drop(this: z_moved_encoding_t) {} +pub extern "C" fn z_encoding_drop(this_: &mut z_moved_encoding_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if encoding is in non-default state, ``false`` otherwise. #[no_mangle] diff --git a/src/get.rs b/src/get.rs index 2203ebccb..4bc3f90e9 100644 --- a/src/get.rs +++ b/src/get.rs @@ -103,8 +103,9 @@ pub extern "C" fn z_reply_err_loan(this: &z_owned_reply_err_t) -> &z_loaned_repl /// Frees the memory and resets the reply error it to its default value. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_reply_err_drop(this: z_moved_reply_err_t) {} +pub extern "C" fn z_reply_err_drop(this_: &mut z_moved_reply_err_t) { + let _ = this_.take_rust_type(); +} pub use crate::opaque_types::{z_loaned_reply_t, z_moved_reply_t, z_owned_reply_t}; decl_c_type!( @@ -306,8 +307,9 @@ pub unsafe extern "C" fn z_get( /// Frees reply, resetting it to its gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_reply_drop(this: z_moved_reply_t) {} +pub extern "C" fn z_reply_drop(this_: &mut z_moved_reply_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if `reply` is valid, ``false`` otherwise. #[no_mangle] diff --git a/src/keyexpr.rs b/src/keyexpr.rs index 2dc58f886..eae7b85c8 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -145,8 +145,9 @@ pub unsafe extern "C" fn z_view_keyexpr_loan(this: &z_view_keyexpr_t) -> &z_loan /// Frees key expression and resets it to its gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_keyexpr_drop(this: z_moved_keyexpr_t) {} +pub extern "C" fn z_keyexpr_drop(this_: &mut z_moved_keyexpr_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] diff --git a/src/liveliness.rs b/src/liveliness.rs index 49ffc3a26..ef64f1b25 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -46,8 +46,9 @@ pub extern "C" fn zc_liveliness_token_check(this: &zc_owned_liveliness_token_t) /// Undeclares liveliness token, frees memory and resets it to a gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn zc_liveliness_token_drop(this: zc_moved_liveliness_token_t) {} +pub extern "C" fn zc_liveliness_token_drop(this_: &mut zc_moved_liveliness_token_t) { + let _ = this_.take_rust_type(); +} /// The options for `zc_liveliness_declare_token()`. #[repr(C)] diff --git a/src/payload.rs b/src/payload.rs index f0ee9426d..0a88c8c5e 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -58,8 +58,9 @@ extern "C" fn z_bytes_empty(this: &mut MaybeUninit) { /// Drops `this_`, resetting it to gravestone value. If there are any shallow copies /// created by `z_bytes_clone()`, they would still stay valid. #[no_mangle] -#[allow(unused_variables)] -extern "C" fn z_bytes_drop(this: z_moved_bytes_t) {} +extern "C" fn z_bytes_drop(this_: &mut z_moved_bytes_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. #[no_mangle] diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index 875d7f204..fd30138b0 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -30,8 +30,9 @@ pub extern "C" fn z_mutex_init(this: &mut MaybeUninit) -> resul /// Drops mutex and resets it to its gravestone state. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_mutex_drop(this: z_moved_mutex_t) {} +pub extern "C" fn z_mutex_drop(this_: &mut z_moved_mutex_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if mutex is valid, ``false`` otherwise. #[no_mangle] @@ -126,8 +127,9 @@ pub extern "C" fn z_condvar_null(this: &mut MaybeUninit) { /// Drops conditional variable. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_condvar_drop(this: z_moved_condvar_t) {} +pub extern "C" fn z_condvar_drop(this_: &mut z_moved_condvar_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if conditional variable is valid, ``false`` otherwise. #[no_mangle] @@ -209,8 +211,9 @@ pub extern "C" fn z_task_null(this: &mut MaybeUninit) { /// Detaches the task and releases all allocated resources. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_task_detach(this: z_moved_task_t) {} +pub extern "C" fn z_task_detach(this_: &mut z_moved_task_t) { + let _ = this_.take_rust_type(); +} /// Joins the task and releases all allocated resources #[no_mangle] @@ -226,8 +229,9 @@ pub extern "C" fn z_task_join(this: &mut z_moved_task_t) -> result::z_result_t { /// Drop the task. Same as `z_task_detach`. Use `z_task_join` to wait for the task completion. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_task_drop(this: z_moved_task_t) {} +pub extern "C" fn z_task_drop(this_: &mut z_moved_task_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if task is valid, ``false`` otherwise. #[no_mangle] diff --git a/src/queryable.rs b/src/queryable.rs index fd949978a..8b905839b 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -81,9 +81,8 @@ pub unsafe extern "C" fn z_query_loan(this: &'static z_owned_query_t) -> &z_loan } /// Destroys the query resetting it to its gravestone value. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_query_drop(this: &mut z_moved_query_t) { - this.take_rust_type(); +pub extern "C" fn z_query_drop(this_: &mut z_moved_query_t) { + let _ = this_.take_rust_type(); } /// Constructs a shallow copy of the query, allowing to keep it in an "open" state past the callback's return. /// diff --git a/src/scouting.rs b/src/scouting.rs index 2c0997dde..49665b42f 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -36,8 +36,9 @@ decl_c_type!( /// Frees memory and resets hello message to its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -#[allow(unused_variables)] -pub unsafe extern "C" fn z_hello_drop(this: z_moved_hello_t) {} +pub unsafe extern "C" fn z_hello_drop(this_: &mut z_moved_hello_t) { + let _ = this_.take_rust_type(); +} /// Borrows hello message. #[no_mangle] diff --git a/src/session.rs b/src/session.rs index 897fe92df..9d8488227 100644 --- a/src/session.rs +++ b/src/session.rs @@ -148,8 +148,9 @@ pub extern "C" fn z_close(session: &mut z_moved_session_t) -> result::z_result_t /// /// This will also close the session if it does not have any clones left. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_session_drop(this: z_moved_session_t) {} +pub extern "C" fn z_session_drop(this_: &mut z_moved_session_t) { + let _ = this_.take_rust_type(); +} /// Constructs an owned shallow copy of the session in provided uninitialized memory location. #[allow(clippy::missing_safety_doc)] diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 0ea044852..5ef8635d1 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -94,8 +94,9 @@ pub unsafe extern "C" fn z_shm_try_mut(this: &mut z_owned_shm_t) -> *mut z_loane /// Deletes ZShm slice #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_shm_drop(this: z_moved_shm_t) {} +pub extern "C" fn z_shm_drop(this_: &mut z_moved_shm_t) { + let _ = this_.take_rust_type(); +} /// Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice #[no_mangle] diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index 1e398ad0e..08dd12993 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -78,8 +78,9 @@ pub unsafe extern "C" fn z_shm_mut_loan_mut( /// Deletes ZShmMut slice #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_shm_mut_drop(this: z_moved_shm_mut_t) {} +pub extern "C" fn z_shm_mut_drop(this_: &mut z_moved_shm_mut_t) { + let _ = this_.take_rust_type(); +} /// @return the length of the ZShmMut slice #[no_mangle] diff --git a/src/shm/client/shm_client.rs b/src/shm/client/shm_client.rs index 9dfe702e3..0a73b0697 100644 --- a/src/shm/client/shm_client.rs +++ b/src/shm/client/shm_client.rs @@ -25,7 +25,7 @@ pub use crate::opaque_types::{z_moved_shm_client_t, z_owned_shm_client_t}; use crate::{ context::{zc_threadsafe_context_t, DroppableContext, ThreadsafeContext}, shm::common::types::z_segment_id_t, - transmute::{RustTypeRef, RustTypeRefUninit}, + transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, }; /// A callbacks for ShmClient @@ -92,5 +92,6 @@ pub extern "C" fn z_shm_client_check(this: &z_owned_shm_client_t) -> bool { /// Deletes SHM Client #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_shm_client_drop(this: z_moved_shm_client_t) {} +pub extern "C" fn z_shm_client_drop(this_: &mut z_moved_shm_client_t) { + let _ = this_.take_rust_type(); +} diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index 197fdbf99..b790c1984 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -51,8 +51,9 @@ pub extern "C" fn zc_shm_client_list_check(this: &zc_owned_shm_client_list_t) -> /// Deletes list of SHM Clients #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn zc_shm_client_list_drop(this: zc_moved_shm_client_list_t) {} +pub extern "C" fn zc_shm_client_list_drop(this_: &mut zc_moved_shm_client_list_t) { + let _ = this_.take_rust_type(); +} /// Borrows list of SHM Clients #[no_mangle] @@ -161,8 +162,9 @@ pub extern "C" fn z_shm_client_storage_check(this: &z_owned_shm_client_storage_t /// Derefs SHM Client Storage #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_shm_client_storage_drop(this: z_moved_shm_client_storage_t) {} +pub extern "C" fn z_shm_client_storage_drop(this_: &mut z_moved_shm_client_storage_t) { + let _ = this_.take_rust_type(); +} /// Borrows SHM Client Storage #[no_mangle] diff --git a/src/shm/provider/alloc_layout.rs b/src/shm/provider/alloc_layout.rs index 760e7780e..29df26fae 100644 --- a/src/shm/provider/alloc_layout.rs +++ b/src/shm/provider/alloc_layout.rs @@ -28,7 +28,7 @@ use crate::{ context::{zc_threadsafe_context_t, Context, ThreadsafeContext}, result::z_result_t, shm::protocol_implementations::posix::posix_shm_provider::PosixAllocLayout, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_alloc_layout_t, z_loaned_shm_provider_t, z_moved_alloc_layout_t, z_owned_alloc_layout_t, }; @@ -87,8 +87,9 @@ pub unsafe extern "C" fn z_alloc_layout_loan( /// Deletes Alloc Layout #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_alloc_layout_drop(this: z_moved_alloc_layout_t) {} +pub extern "C" fn z_alloc_layout_drop(this_: &mut z_moved_alloc_layout_t) { + let _ = this_.take_rust_type(); +} #[no_mangle] pub extern "C" fn z_alloc_layout_alloc( diff --git a/src/shm/provider/shm_provider.rs b/src/shm/provider/shm_provider.rs index 104a0f3cd..cff4f3296 100644 --- a/src/shm/provider/shm_provider.rs +++ b/src/shm/provider/shm_provider.rs @@ -34,7 +34,7 @@ use crate::{ protocol_implementations::posix::posix_shm_provider::PosixShmProvider, provider::types::z_buf_layout_alloc_result_t, }, - transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_shm_provider_t, z_moved_shm_provider_t, z_owned_shm_mut_t, z_owned_shm_provider_t, }; @@ -116,8 +116,9 @@ pub unsafe extern "C" fn z_shm_provider_loan( /// Deletes SHM Provider #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_shm_provider_drop(this: z_moved_shm_provider_t) {} +pub extern "C" fn z_shm_provider_drop(this_: &mut z_moved_shm_provider_t) { + let _ = this_.take_rust_type(); +} #[no_mangle] pub extern "C" fn z_shm_provider_alloc( diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index c528bc96e..7c1d47023 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -26,7 +26,7 @@ use super::chunk::z_allocated_chunk_t; use crate::{ result::{z_result_t, Z_EINVAL, Z_OK}, shm::buffer::zshmmut::z_shm_mut_null, - transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_chunk_alloc_result_t, z_loaned_memory_layout_t, z_moved_chunk_alloc_result_t, z_moved_memory_layout_t, z_owned_chunk_alloc_result_t, z_owned_memory_layout_t, z_owned_shm_mut_t, @@ -169,8 +169,9 @@ pub unsafe extern "C" fn z_memory_layout_loan( /// Deletes Memory Layout #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_memory_layout_drop(this: z_moved_memory_layout_t) {} +pub extern "C" fn z_memory_layout_drop(this_: &mut z_moved_memory_layout_t) { + let _ = this_.take_rust_type(); +} /// Extract data from Memory Layout #[no_mangle] @@ -240,8 +241,9 @@ pub unsafe extern "C" fn z_chunk_alloc_result_loan( /// Deletes Chunk Alloc Result #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_chunk_alloc_result_drop(this: z_moved_chunk_alloc_result_t) {} +pub extern "C" fn z_chunk_alloc_result_drop(this_: &mut z_moved_chunk_alloc_result_t) { + let _ = this_.take_rust_type(); +} #[repr(C)] pub struct z_buf_alloc_result_t { diff --git a/src/subscriber.rs b/src/subscriber.rs index 2e521a860..ff3301aac 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -167,8 +167,9 @@ pub extern "C" fn z_undeclare_subscriber(_this: &mut z_moved_subscriber_t) -> re /// Drops subscriber and resets it to its gravestone state. Also attempts to undeclare it. #[no_mangle] -#[allow(unused_variables)] -pub extern "C" fn z_subscriber_drop(this: z_moved_subscriber_t) {} +pub extern "C" fn z_subscriber_drop(this_: &mut z_moved_subscriber_t) { + let _ = this_.take_rust_type(); +} /// Returns ``true`` if subscriber is valid, ``false`` otherwise. #[no_mangle] From 47c25f4ed1bcf90c5701ef2daa7be61f5cfca401 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 11:46:30 +0200 Subject: [PATCH 080/397] "this" parameter name globally renamed to this_ to avoid using C++ keyword --- include/zenoh_commons.h | 10 +- include/zenoh_macros.h | 36 +++--- src/closures/hello_closure.rs | 8 +- src/closures/log_closure.rs | 8 +- src/closures/query_channel.rs | 16 +-- src/closures/query_closure.rs | 8 +- src/closures/reply_closure.rs | 8 +- src/closures/response_channel.rs | 16 +-- src/closures/sample_channel.rs | 8 +- src/closures/sample_closure.rs | 8 +- src/closures/zenohid_closure.rs | 8 +- src/collections.rs | 112 +++++++++--------- src/commons.rs | 88 +++++++------- src/config.rs | 24 ++-- src/encoding.rs | 16 +-- src/get.rs | 52 ++++---- src/keyexpr.rs | 24 ++-- src/liveliness.rs | 8 +- src/payload.rs | 44 +++---- src/platform/synchronization.rs | 56 ++++----- src/publication_cache.rs | 12 +- src/publisher.rs | 32 ++--- src/put.rs | 8 +- src/queryable.rs | 56 ++++----- src/querying_subscriber.rs | 8 +- src/scouting.rs | 24 ++-- src/session.rs | 12 +- src/shm/buffer/zshm.rs | 40 +++---- src/shm/buffer/zshmmut.rs | 24 ++-- src/shm/client/shm_client.rs | 8 +- src/shm/client_storage/mod.rs | 20 ++-- .../posix/posix_shm_client.rs | 4 +- src/shm/provider/alloc_layout.rs | 8 +- src/shm/provider/shm_provider.rs | 8 +- src/shm/provider/types.rs | 16 +-- src/subscriber.rs | 20 ++-- 36 files changed, 429 insertions(+), 429 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index c83877cd4..25e2b3f94 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -2851,7 +2851,7 @@ ZENOHC_API void z_publisher_delete_options_default(struct z_publisher_delete_opt /** * Frees memory and resets publisher to its gravestone state. Also attempts undeclare publisher. */ -ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *_this); +ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); /** * Returns the ID of the publisher. */ @@ -4079,7 +4079,7 @@ z_result_t z_undeclare_keyexpr(struct z_moved_keyexpr_t *this_, * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t *_this); +ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t *this_); /** * Undeclares a `z_owned_queryable_t` and drops it. * @@ -4091,7 +4091,7 @@ ZENOHC_API z_result_t z_undeclare_queryable(struct z_moved_queryable_t *this_); * * @return 0 in case of success, negative error code otherwise. */ -ZENOHC_API z_result_t z_undeclare_subscriber(struct z_moved_subscriber_t *_this); +ZENOHC_API z_result_t z_undeclare_subscriber(struct z_moved_subscriber_t *this_); /** * Constructs a view key expression in empty state */ @@ -4651,7 +4651,7 @@ ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cac * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t *_this); +ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); #endif /** * Constructs a publication cache in a gravestone state. @@ -4675,7 +4675,7 @@ ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subs * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *_this); +ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index b05f0b896..2a91855a8 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -282,7 +282,7 @@ static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *th static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } -static inline void z_publisher_take(z_owned_publisher_t* _this, z_moved_publisher_t x) { *_this = *x._ptr; z_publisher_null(x._ptr); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } @@ -308,8 +308,8 @@ static inline void zc_closure_matching_status_take(zc_owned_closure_matching_sta static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* _this, ze_moved_publication_cache_t x) { *_this = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* _this, ze_moved_querying_subscriber_t x) { *_this = *x._ptr; ze_querying_subscriber_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ @@ -572,7 +572,7 @@ inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; -inline void z_drop(z_moved_publisher_t _this) { z_publisher_drop(_this); }; +inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; inline void z_drop(z_moved_queryable_t this_) { z_queryable_drop(this_); }; inline void z_drop(z_moved_reply_t this_) { z_reply_drop(this_); }; @@ -598,8 +598,8 @@ inline void z_drop(zc_moved_closure_matching_status_t closure_) { zc_closure_mat inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; inline z_result_t z_drop(zc_moved_matching_listener_t this_) { return zc_publisher_matching_listener_drop(this_); }; inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t _this) { ze_publication_cache_drop(_this); }; -inline void z_drop(ze_moved_querying_subscriber_t _this) { ze_querying_subscriber_drop(_this); }; +inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; +inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; @@ -620,7 +620,7 @@ inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&thi inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; -inline z_moved_publisher_t z_move(z_owned_publisher_t& _this) { return z_publisher_move(&_this); }; +inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; inline z_moved_queryable_t z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; inline z_moved_reply_t z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; @@ -646,8 +646,8 @@ inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_statu inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; inline zc_moved_matching_listener_t z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& _this) { return ze_publication_cache_move(&_this); }; -inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& _this) { return ze_querying_subscriber_move(&_this); }; +inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; +inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; @@ -715,7 +715,7 @@ static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *th static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } -static inline void z_publisher_take(z_owned_publisher_t* _this, z_moved_publisher_t x) { *_this = *x._ptr; z_publisher_null(x._ptr); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } @@ -741,8 +741,8 @@ static inline void zc_closure_matching_status_take(zc_owned_closure_matching_sta static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* _this, ze_moved_publication_cache_t x) { *_this = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* _this, ze_moved_querying_subscriber_t x) { *_this = *x._ptr; ze_querying_subscriber_null(x._ptr); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } @@ -800,8 +800,8 @@ inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { z_mutex_take(this_, x); }; -inline void z_take(z_owned_publisher_t* _this, z_moved_publisher_t x) { - z_publisher_take(_this, x); +inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { + z_publisher_take(this_, x); }; inline void z_take(z_owned_query_t* this_, z_moved_query_t x) { z_query_take(this_, x); @@ -878,11 +878,11 @@ inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listen inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { zc_shm_client_list_take(this_, x); }; -inline void z_take(ze_owned_publication_cache_t* _this, ze_moved_publication_cache_t x) { - ze_publication_cache_take(_this, x); +inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { + ze_publication_cache_take(this_, x); }; -inline void z_take(ze_owned_querying_subscriber_t* _this, ze_moved_querying_subscriber_t x) { - ze_querying_subscriber_take(_this, x); +inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { + ze_querying_subscriber_take(this_, x); }; diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index 6f6531ee9..4183ded46 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -83,8 +83,8 @@ impl Drop for z_owned_closure_hello_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_hello_null(this: *mut MaybeUninit) { - (*this).write(z_owned_closure_hello_t::default()); +pub unsafe extern "C" fn z_closure_hello_null(this_: *mut MaybeUninit) { + (*this_).write(z_owned_closure_hello_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. #[no_mangle] @@ -129,8 +129,8 @@ impl From for z_owned_closure_hello_t { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_hello_check(this: &z_owned_closure_hello_t) -> bool { - !this.is_empty() +pub extern "C" fn z_closure_hello_check(this_: &z_owned_closure_hello_t) -> bool { + !this_.is_empty() } /// Borrows closure. diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs index 930a4abbb..e8e8fe2cb 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -146,8 +146,8 @@ impl Drop for zc_owned_closure_log_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zc_closure_log_null(this: *mut MaybeUninit) { - (*this).write(zc_owned_closure_log_t::default()); +pub unsafe extern "C" fn zc_closure_log_null(this_: *mut MaybeUninit) { + (*this_).write(zc_owned_closure_log_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. #[no_mangle] @@ -172,8 +172,8 @@ pub extern "C" fn zc_closure_log_drop(closure_: &mut zc_moved_closure_log_t) { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn zc_closure_log_check(this: &zc_owned_closure_log_t) -> bool { - !this.is_empty() +pub extern "C" fn zc_closure_log_check(this_: &zc_owned_closure_log_t) -> bool { + !this_.is_empty() } /// Borrows closure. diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index 492339040..b9aadf9d3 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -41,14 +41,14 @@ pub extern "C" fn z_fifo_handler_query_drop(this_: &mut z_moved_fifo_handler_que /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_fifo_handler_query_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_check(this: &z_owned_fifo_handler_query_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_fifo_handler_query_check(this_: &z_owned_fifo_handler_query_t) -> bool { + this_.as_rust_type_ref().is_some() } extern "C" fn __z_handler_query_send(query: &z_loaned_query_t, context: *mut c_void) { @@ -161,14 +161,14 @@ pub extern "C" fn z_ring_handler_query_drop(this_: &mut z_moved_ring_handler_que /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_ring_handler_query_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_check(this: &z_owned_ring_handler_query_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_ring_handler_query_check(this_: &z_owned_ring_handler_query_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Constructs send and recieve ends of the ring channel diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 331e3df25..74969df78 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -83,14 +83,14 @@ impl Drop for z_owned_closure_query_t { /// Constructs a closure in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_query_null(this: *mut MaybeUninit) { - (*this).write(z_owned_closure_query_t::default()); +pub unsafe extern "C" fn z_closure_query_null(this_: *mut MaybeUninit) { + (*this_).write(z_owned_closure_query_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_query_check(this: &z_owned_closure_query_t) -> bool { - !this.is_empty() +pub extern "C" fn z_closure_query_check(this_: &z_owned_closure_query_t) -> bool { + !this_.is_empty() } /// Calls the closure. Calling an uninitialized closure is a no-op. diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 80b72fbc7..051851bd9 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -84,14 +84,14 @@ impl Drop for z_owned_closure_reply_t { /// Constructs a closure int its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_reply_null(this: *mut MaybeUninit) { - (*this).write(z_owned_closure_reply_t::default()); +pub unsafe extern "C" fn z_closure_reply_null(this_: *mut MaybeUninit) { + (*this_).write(z_owned_closure_reply_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_reply_check(this: &z_owned_closure_reply_t) -> bool { - !this.is_empty() +pub extern "C" fn z_closure_reply_check(this_: &z_owned_closure_reply_t) -> bool { + !this_.is_empty() } /// Calls the closure. Calling an uninitialized closure is a no-op. diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index 28baad2a8..027146474 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -41,14 +41,14 @@ pub extern "C" fn z_fifo_handler_reply_drop(this_: &mut z_moved_fifo_handler_rep /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_fifo_handler_reply_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_check(this: &z_owned_fifo_handler_reply_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_fifo_handler_reply_check(this_: &z_owned_fifo_handler_reply_t) -> bool { + this_.as_rust_type_ref().is_some() } extern "C" fn __z_handler_reply_send(reply: &z_loaned_reply_t, context: *mut c_void) { @@ -157,14 +157,14 @@ pub extern "C" fn z_ring_handler_reply_drop(this_: &mut z_moved_ring_handler_rep /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_ring_handler_reply_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_check(this: &z_owned_ring_handler_reply_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_ring_handler_reply_check(this_: &z_owned_ring_handler_reply_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Constructs send and recieve ends of the ring channel diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index cd586c9dd..57f11f4a2 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -49,8 +49,8 @@ pub extern "C" fn z_fifo_handler_sample_null( /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_sample_check(this: &z_owned_fifo_handler_sample_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_fifo_handler_sample_check(this_: &z_owned_fifo_handler_sample_t) -> bool { + this_.as_rust_type_ref().is_some() } extern "C" fn __z_handler_sample_send(sample: &z_loaned_sample_t, context: *mut c_void) { @@ -171,8 +171,8 @@ pub extern "C" fn z_ring_handler_sample_null( /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_sample_check(this: &z_owned_ring_handler_sample_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_ring_handler_sample_check(this_: &z_owned_ring_handler_sample_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Constructs send and recieve ends of the ring channel diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index b60c5ba03..5c208427a 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -84,14 +84,14 @@ impl Drop for z_owned_closure_sample_t { /// Constructs a closure in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_sample_null(this: &mut MaybeUninit) { - this.write(z_owned_closure_sample_t::default()); +pub unsafe extern "C" fn z_closure_sample_null(this_: &mut MaybeUninit) { + this_.write(z_owned_closure_sample_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_sample_check(this: &z_owned_closure_sample_t) -> bool { - !this.is_empty() +pub extern "C" fn z_closure_sample_check(this_: &z_owned_closure_sample_t) -> bool { + !this_.is_empty() } /// Calls the closure. Calling an uninitialized closure is a no-op. diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index d6f6d01fa..84add94e1 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -84,15 +84,15 @@ impl Drop for z_owned_closure_zid_t { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_zid_check(this: &z_owned_closure_zid_t) -> bool { - !this.is_empty() +pub unsafe extern "C" fn z_closure_zid_check(this_: &z_owned_closure_zid_t) -> bool { + !this_.is_empty() } /// Constructs a null closure. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_zid_null(this: &mut MaybeUninit) { - this.write(z_owned_closure_zid_t::default()); +pub unsafe extern "C" fn z_closure_zid_null(this_: &mut MaybeUninit) { + this_.write(z_owned_closure_zid_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. #[no_mangle] diff --git a/src/collections.rs b/src/collections.rs index c40bca0bc..84dfa07ea 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -269,8 +269,8 @@ decl_c_type!( /// Constructs an empty view slice. #[no_mangle] -pub extern "C" fn z_view_slice_empty(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(CSliceView::default()); +pub extern "C" fn z_view_slice_empty(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(CSliceView::default()); } /// Constructs a `len` bytes long view starting at `start`. @@ -298,26 +298,26 @@ pub unsafe extern "C" fn z_view_slice_from_buf( /// Borrows view slice. #[no_mangle] -pub extern "C" fn z_view_slice_loan(this: &z_view_slice_t) -> &z_loaned_slice_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_view_slice_loan(this_: &z_view_slice_t) -> &z_loaned_slice_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } /// @return ``true`` if the slice is not empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_view_slice_is_empty(this: &z_view_slice_t) -> bool { - this.as_rust_type_ref().is_empty() +pub extern "C" fn z_view_slice_is_empty(this_: &z_view_slice_t) -> bool { + this_.as_rust_type_ref().is_empty() } /// Constructs an empty `z_owned_slice_t`. #[no_mangle] -pub extern "C" fn z_slice_empty(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(CSliceOwned::default()); +pub extern "C" fn z_slice_empty(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(CSliceOwned::default()); } /// Constructs an empty `z_owned_slice_t`. #[no_mangle] -pub extern "C" fn z_slice_null(this: &mut MaybeUninit) { - z_slice_empty(this); +pub extern "C" fn z_slice_null(this_: &mut MaybeUninit) { + z_slice_empty(this_); } /// Frees the memory and invalidates the slice. @@ -329,39 +329,39 @@ pub unsafe extern "C" fn z_slice_drop(this_:&mut z_moved_slice_t) { /// Borrows slice. #[no_mangle] -pub extern "C" fn z_slice_loan(this: &z_owned_slice_t) -> &z_loaned_slice_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_slice_loan(this_: &z_owned_slice_t) -> &z_loaned_slice_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } /// Constructs an owned copy of a slice. #[no_mangle] -pub extern "C" fn z_slice_clone(dst: &mut MaybeUninit, this: &z_loaned_slice_t) { +pub extern "C" fn z_slice_clone(dst: &mut MaybeUninit, this_: &z_loaned_slice_t) { dst.as_rust_type_mut_uninit() - .write(this.as_rust_type_ref().clone_to_owned()); + .write(this_.as_rust_type_ref().clone_to_owned()); } /// @return ``true`` if slice is not empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_slice_check(this: &z_owned_slice_t) -> bool { - !this.as_rust_type_ref().is_empty() +pub extern "C" fn z_slice_check(this_: &z_owned_slice_t) -> bool { + !this_.as_rust_type_ref().is_empty() } /// @return the length of the slice. #[no_mangle] -pub extern "C" fn z_slice_len(this: &z_loaned_slice_t) -> usize { - this.as_rust_type_ref().len() +pub extern "C" fn z_slice_len(this_: &z_loaned_slice_t) -> usize { + this_.as_rust_type_ref().len() } /// @return the pointer to the slice data. #[no_mangle] -pub extern "C" fn z_slice_data(this: &z_loaned_slice_t) -> *const u8 { - this.as_rust_type_ref().data() +pub extern "C" fn z_slice_data(this_: &z_loaned_slice_t) -> *const u8 { + this_.as_rust_type_ref().data() } /// @return ``true`` if slice is empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_slice_is_empty(this: &z_loaned_slice_t) -> bool { - this.as_rust_type_ref().is_empty() +pub extern "C" fn z_slice_is_empty(this_: &z_loaned_slice_t) -> bool { + this_.as_rust_type_ref().is_empty() } /// Constructs a slice by copying a `len` bytes long sequence starting at `start`. @@ -536,48 +536,48 @@ pub unsafe extern "C" fn z_string_drop(this_: &mut z_moved_string_t) { /// @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_string_check(this: &z_owned_string_t) -> bool { - !this.as_rust_type_ref().is_empty() +pub extern "C" fn z_string_check(this_: &z_owned_string_t) -> bool { + !this_.as_rust_type_ref().is_empty() } /// Constructs owned string in a gravestone state. #[no_mangle] -pub extern "C" fn z_string_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit() +pub extern "C" fn z_string_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit() .write(CStringOwned::default()); } /// @return ``true`` if view string is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_view_string_is_empty(this: &z_view_string_t) -> bool { - this.as_rust_type_ref().is_empty() +pub extern "C" fn z_view_string_is_empty(this_: &z_view_string_t) -> bool { + this_.as_rust_type_ref().is_empty() } /// Constructs an empty owned string. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_string_empty(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit() +pub unsafe extern "C" fn z_string_empty(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit() .write(CStringOwned::default()); } /// Constructs an empty view string. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_view_string_empty(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(CStringView::default()); +pub unsafe extern "C" fn z_view_string_empty(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(CStringView::default()); } /// Borrows string. #[no_mangle] -pub extern "C" fn z_string_loan(this: &z_owned_string_t) -> &z_loaned_string_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_string_loan(this_: &z_owned_string_t) -> &z_loaned_string_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } /// Borrows view string. #[no_mangle] -pub extern "C" fn z_view_string_loan(this: &z_view_string_t) -> &z_loaned_string_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_view_string_loan(this_: &z_view_string_t) -> &z_loaned_string_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } /// Constructs an owned string by copying `str` into it (including terminating 0), using `strlen` (this should therefore not be used with untrusted inputs). @@ -586,10 +586,10 @@ pub extern "C" fn z_view_string_loan(this: &z_view_string_t) -> &z_loaned_string #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_string_copy_from_str( - this: &mut MaybeUninit, + this_: &mut MaybeUninit, str: *const libc::c_char, ) -> z_result_t { - z_string_copy_from_substr(this, str, strlen(str)) + z_string_copy_from_substr(this_, str, strlen(str)) } /// Constructs an owned string by copying a `str` substring of length `len`. @@ -689,14 +689,14 @@ pub unsafe extern "C" fn z_view_string_from_substr( /// @return the length of the string (without terminating 0 character). #[no_mangle] -pub extern "C" fn z_string_len(this: &z_loaned_string_t) -> usize { - this.as_rust_type_ref().len() +pub extern "C" fn z_string_len(this_: &z_loaned_string_t) -> usize { + this_.as_rust_type_ref().len() } /// @return the pointer of the string data. #[no_mangle] -pub extern "C" fn z_string_data(this: &z_loaned_string_t) -> *const libc::c_char { - this.as_rust_type_ref().data() as _ +pub extern "C" fn z_string_data(this_: &z_loaned_string_t) -> *const libc::c_char { + this_.as_rust_type_ref().data() as _ } /// Constructs an owned copy of a string. @@ -712,14 +712,14 @@ pub extern "C" fn z_string_clone( // Converts loaned string into loaned slice (with terminating 0 character). #[no_mangle] -pub extern "C" fn z_string_as_slice(this: &z_loaned_string_t) -> &z_loaned_slice_t { - this.as_rust_type_ref().as_ref().as_loaned_c_type_ref() +pub extern "C" fn z_string_as_slice(this_: &z_loaned_string_t) -> &z_loaned_slice_t { + this_.as_rust_type_ref().as_ref().as_loaned_c_type_ref() } /// @return ``true`` if string is empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_string_is_empty(this: &z_loaned_string_t) -> bool { - this.as_rust_type_ref().is_empty() +pub extern "C" fn z_string_is_empty(this_: &z_loaned_string_t) -> bool { + this_.as_rust_type_ref().is_empty() } pub use crate::opaque_types::{ @@ -733,20 +733,20 @@ decl_c_type!( /// Constructs a new empty string array. #[no_mangle] -pub extern "C" fn z_string_array_new(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(Some(ZVector::new())); +pub extern "C" fn z_string_array_new(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(Some(ZVector::new())); } /// Constructs string array in its gravestone state. #[no_mangle] -pub extern "C" fn z_string_array_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_string_array_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_string_array_check(this: &z_owned_string_array_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_string_array_check(this_: &z_owned_string_array_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Destroys the string array, resetting it to its gravestone value. @@ -781,14 +781,14 @@ pub unsafe extern "C" fn z_string_array_loan_mut( /// @return number of elements in the array. #[no_mangle] -pub extern "C" fn z_string_array_len(this: &z_loaned_string_array_t) -> usize { - this.as_rust_type_ref().len() +pub extern "C" fn z_string_array_len(this_: &z_loaned_string_array_t) -> usize { + this_.as_rust_type_ref().len() } /// @return ``true`` if the array is empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_string_array_is_empty(this: &z_loaned_string_array_t) -> bool { - this.as_rust_type_ref().is_empty() +pub extern "C" fn z_string_array_is_empty(this_: &z_loaned_string_array_t) -> bool { + this_.as_rust_type_ref().is_empty() } /// @return the value at the position of index in the string array. diff --git a/src/commons.rs b/src/commons.rs index 706948a96..66467377b 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -90,15 +90,15 @@ pub extern "C" fn z_timestamp_new( /// Returns NPT64 time associated with this timestamp. #[no_mangle] -pub extern "C" fn z_timestamp_ntp64_time(this: &z_timestamp_t) -> u64 { - this.as_rust_type_ref().get_time().0 +pub extern "C" fn z_timestamp_ntp64_time(this_: &z_timestamp_t) -> u64 { + this_.as_rust_type_ref().get_time().0 } #[cfg(feature = "unstable")] /// Returns id associated with this timestamp. #[no_mangle] -pub extern "C" fn z_timestamp_id(this: &z_timestamp_t) -> z_id_t { - this.as_rust_type_ref().get_id().to_le_bytes().into() +pub extern "C" fn z_timestamp_id(this_: &z_timestamp_t) -> z_id_t { + this_.as_rust_type_ref().get_id().to_le_bytes().into() } use crate::opaque_types::z_loaned_sample_t; @@ -110,31 +110,31 @@ decl_c_type!( /// Returns the key expression of the sample. #[no_mangle] -pub extern "C" fn z_sample_keyexpr(this: &z_loaned_sample_t) -> &z_loaned_keyexpr_t { - this.as_rust_type_ref().key_expr().as_loaned_c_type_ref() +pub extern "C" fn z_sample_keyexpr(this_: &z_loaned_sample_t) -> &z_loaned_keyexpr_t { + this_.as_rust_type_ref().key_expr().as_loaned_c_type_ref() } /// Returns the encoding associated with the sample data. #[no_mangle] -pub extern "C" fn z_sample_encoding(this: &z_loaned_sample_t) -> &z_loaned_encoding_t { - this.as_rust_type_ref().encoding().as_loaned_c_type_ref() +pub extern "C" fn z_sample_encoding(this_: &z_loaned_sample_t) -> &z_loaned_encoding_t { + this_.as_rust_type_ref().encoding().as_loaned_c_type_ref() } /// Returns the sample payload data. #[no_mangle] -pub extern "C" fn z_sample_payload(this: &z_loaned_sample_t) -> &z_loaned_bytes_t { - this.as_rust_type_ref().payload().as_loaned_c_type_ref() +pub extern "C" fn z_sample_payload(this_: &z_loaned_sample_t) -> &z_loaned_bytes_t { + this_.as_rust_type_ref().payload().as_loaned_c_type_ref() } /// Returns the sample kind. #[no_mangle] -pub extern "C" fn z_sample_kind(this: &z_loaned_sample_t) -> z_sample_kind_t { - this.as_rust_type_ref().kind().into() +pub extern "C" fn z_sample_kind(this_: &z_loaned_sample_t) -> z_sample_kind_t { + this_.as_rust_type_ref().kind().into() } /// Returns the sample timestamp. /// /// Will return `NULL`, if sample is not associated with a timestamp. #[no_mangle] -pub extern "C" fn z_sample_timestamp(this: &z_loaned_sample_t) -> Option<&z_timestamp_t> { - if let Some(t) = this.as_rust_type_ref().timestamp() { +pub extern "C" fn z_sample_timestamp(this_: &z_loaned_sample_t) -> Option<&z_timestamp_t> { + if let Some(t) = this_.as_rust_type_ref().timestamp() { Some(t.as_ctype_ref()) } else { None @@ -145,8 +145,8 @@ pub extern "C" fn z_sample_timestamp(this: &z_loaned_sample_t) -> Option<&z_time /// /// Returns `NULL`, if sample does not contain any attachment. #[no_mangle] -pub extern "C" fn z_sample_attachment(this: &z_loaned_sample_t) -> *const z_loaned_bytes_t { - match this.as_rust_type_ref().attachment() { +pub extern "C" fn z_sample_attachment(this_: &z_loaned_sample_t) -> *const z_loaned_bytes_t { + match this_.as_rust_type_ref().attachment() { Some(attachment) => attachment.as_loaned_c_type_ref() as *const _, None => null(), } @@ -154,8 +154,8 @@ pub extern "C" fn z_sample_attachment(this: &z_loaned_sample_t) -> *const z_loan #[cfg(feature = "unstable")] /// Returns the sample source_info. #[no_mangle] -pub extern "C" fn z_sample_source_info(this: &z_loaned_sample_t) -> &z_loaned_source_info_t { - this.as_rust_type_ref().source_info().as_loaned_c_type_ref() +pub extern "C" fn z_sample_source_info(this_: &z_loaned_sample_t) -> &z_loaned_source_info_t { + this_.as_rust_type_ref().source_info().as_loaned_c_type_ref() } /// Constructs an owned shallow copy of the sample (i.e. all modficiations applied to the copy, might be visible in the original) in provided uninitilized memory location. @@ -170,33 +170,33 @@ pub extern "C" fn z_sample_clone( /// Returns sample qos priority value. #[no_mangle] -pub extern "C" fn z_sample_priority(this: &z_loaned_sample_t) -> z_priority_t { - this.as_rust_type_ref().priority().into() +pub extern "C" fn z_sample_priority(this_: &z_loaned_sample_t) -> z_priority_t { + this_.as_rust_type_ref().priority().into() } /// Returns whether sample qos express flag was set or not. #[no_mangle] -pub extern "C" fn z_sample_express(this: &z_loaned_sample_t) -> bool { - this.as_rust_type_ref().express() +pub extern "C" fn z_sample_express(this_: &z_loaned_sample_t) -> bool { + this_.as_rust_type_ref().express() } /// Returns sample qos congestion control value. #[no_mangle] -pub extern "C" fn z_sample_congestion_control(this: &z_loaned_sample_t) -> z_congestion_control_t { - this.as_rust_type_ref().congestion_control().into() +pub extern "C" fn z_sample_congestion_control(this_: &z_loaned_sample_t) -> z_congestion_control_t { + this_.as_rust_type_ref().congestion_control().into() } /// Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_sample_check(this: &z_owned_sample_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_sample_check(this_: &z_owned_sample_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows sample. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_sample_loan(this: &z_owned_sample_t) -> &z_loaned_sample_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_sample_loan(this_: &z_owned_sample_t) -> &z_loaned_sample_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -210,8 +210,8 @@ pub extern "C" fn z_sample_drop(this_: &mut z_moved_sample_t) { /// Constructs sample in its gravestone state. #[no_mangle] -pub extern "C" fn z_sample_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_sample_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// The locality of samples to be received by subscribers or targeted by publishers. @@ -470,14 +470,14 @@ decl_c_type!(copy(z_entity_global_id_t, EntityGlobalId)); #[cfg(feature = "unstable")] /// Returns the zenoh id of entity global id. #[no_mangle] -pub extern "C" fn z_entity_global_id_zid(this: &z_entity_global_id_t) -> z_id_t { - this.as_rust_type_ref().zid().into_c_type() +pub extern "C" fn z_entity_global_id_zid(this_: &z_entity_global_id_t) -> z_id_t { + this_.as_rust_type_ref().zid().into_c_type() } #[cfg(feature = "unstable")] /// Returns the entity id of the entity global id. #[no_mangle] -pub extern "C" fn z_entity_global_id_eid(this: &z_entity_global_id_t) -> u32 { - this.as_rust_type_ref().eid() +pub extern "C" fn z_entity_global_id_eid(this_: &z_entity_global_id_t) -> u32 { + this_.as_rust_type_ref().eid() } #[cfg(feature = "unstable")] pub use crate::opaque_types::{z_loaned_source_info_t, z_owned_source_info_t}; @@ -507,8 +507,8 @@ pub extern "C" fn z_source_info_new( #[cfg(feature = "unstable")] /// Returns the source_id of the source info. #[no_mangle] -pub extern "C" fn z_source_info_id(this: &z_loaned_source_info_t) -> z_entity_global_id_t { - match this.as_rust_type_ref().source_id { +pub extern "C" fn z_source_info_id(this_: &z_loaned_source_info_t) -> z_entity_global_id_t { + match this_.as_rust_type_ref().source_id { Some(source_id) => source_id, None => EntityGlobalId::default(), } @@ -518,22 +518,22 @@ pub extern "C" fn z_source_info_id(this: &z_loaned_source_info_t) -> z_entity_gl #[cfg(feature = "unstable")] /// Returns the source_sn of the source info. #[no_mangle] -pub extern "C" fn z_source_info_sn(this: &z_loaned_source_info_t) -> u64 { - this.as_rust_type_ref().source_sn.unwrap_or(0) +pub extern "C" fn z_source_info_sn(this_: &z_loaned_source_info_t) -> u64 { + this_.as_rust_type_ref().source_sn.unwrap_or(0) } #[cfg(feature = "unstable")] /// Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_check(this: &z_owned_source_info_t) -> bool { - this.as_rust_type_ref().source_id.is_some() || this.as_rust_type_ref().source_sn.is_some() +pub extern "C" fn z_source_info_check(this_: &z_owned_source_info_t) -> bool { + this_.as_rust_type_ref().source_id.is_some() || this_.as_rust_type_ref().source_sn.is_some() } #[cfg(feature = "unstable")] /// Borrows source info. #[no_mangle] -pub extern "C" fn z_source_info_loan(this: &z_owned_source_info_t) -> &z_loaned_source_info_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_source_info_loan(this_: &z_owned_source_info_t) -> &z_loaned_source_info_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } #[cfg(feature = "unstable")] @@ -546,6 +546,6 @@ pub extern "C" fn z_source_info_drop(this_: &mut z_moved_source_info_t) { #[cfg(feature = "unstable")] /// Constructs source info in its gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(SourceInfo::default()); +pub extern "C" fn z_source_info_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(SourceInfo::default()); } diff --git a/src/config.rs b/src/config.rs index 084ede15d..0932227b1 100644 --- a/src/config.rs +++ b/src/config.rs @@ -73,32 +73,32 @@ decl_c_type!( /// Borrows config. #[no_mangle] -pub extern "C" fn z_config_loan(this: &'static z_owned_config_t) -> &z_loaned_config_t { - let this = this.as_rust_type_ref(); +pub extern "C" fn z_config_loan(this_: &'static z_owned_config_t) -> &z_loaned_config_t { + let this = this_.as_rust_type_ref(); let this = unsafe { this.as_ref().unwrap_unchecked() }; this.as_loaned_c_type_ref() } /// Mutably borrows config. #[no_mangle] -pub extern "C" fn z_config_loan_mut(this: &mut z_owned_config_t) -> &mut z_loaned_config_t { - let this = this.as_rust_type_mut(); +pub extern "C" fn z_config_loan_mut(this_: &mut z_owned_config_t) -> &mut z_loaned_config_t { + let this = this_.as_rust_type_mut(); let this = unsafe { this.as_mut().unwrap_unchecked() }; this.as_loaned_c_type_mut() } /// Constructs a new empty configuration. #[no_mangle] -pub extern "C" fn z_config_default(this: &mut MaybeUninit) -> result::z_result_t { - this.as_rust_type_mut_uninit() +pub extern "C" fn z_config_default(this_: &mut MaybeUninit) -> result::z_result_t { + this_.as_rust_type_mut_uninit() .write(Some(Config::default())); Z_OK } /// Constructs config in its gravestone state. #[no_mangle] -pub extern "C" fn z_config_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_config_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Clones the config into provided uninitialized memory location. @@ -227,8 +227,8 @@ pub extern "C" fn z_config_drop(this_: &mut z_moved_config_t) { /// Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_config_check(this: &z_owned_config_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_config_check(this_: &z_owned_config_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Reads a configuration from a JSON-serialized string, such as '{mode:"client",connect:{endpoints:["tcp/127.0.0.1:7447"]}}'. @@ -337,8 +337,8 @@ pub unsafe extern "C" fn zc_config_from_env( /// Constructs a default peer mode configuration. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_config_peer(this: &mut MaybeUninit) -> result::z_result_t { - this.as_rust_type_mut_uninit() +pub extern "C" fn z_config_peer(this_: &mut MaybeUninit) -> result::z_result_t { + this_.as_rust_type_mut_uninit() .write(Some(zenoh::config::peer())); Z_OK } diff --git a/src/encoding.rs b/src/encoding.rs index 09626fe08..0481ed55e 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -138,8 +138,8 @@ pub extern "C" fn z_encoding_loan_default() -> &'static z_loaned_encoding_t { /// Constructs a default `z_owned_encoding_t`. #[no_mangle] -pub extern "C" fn z_encoding_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(Encoding::default()); +pub extern "C" fn z_encoding_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(Encoding::default()); } /// Frees the memory and resets the encoding it to its default value. @@ -150,20 +150,20 @@ pub extern "C" fn z_encoding_drop(this_: &mut z_moved_encoding_t) { /// Returns ``true`` if encoding is in non-default state, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_encoding_check(this: &'static z_owned_encoding_t) -> bool { - *this.as_rust_type_ref() != Encoding::default() +pub extern "C" fn z_encoding_check(this_: &'static z_owned_encoding_t) -> bool { + *this_.as_rust_type_ref() != Encoding::default() } /// Borrows encoding. #[no_mangle] -pub extern "C" fn z_encoding_loan(this: &z_owned_encoding_t) -> &z_loaned_encoding_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_encoding_loan(this_: &z_owned_encoding_t) -> &z_loaned_encoding_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } /// Mutably borrows encoding. #[no_mangle] -pub extern "C" fn z_encoding_loan_mut(this: &mut z_owned_encoding_t) -> &mut z_loaned_encoding_t { - this.as_rust_type_mut().as_loaned_c_type_mut() +pub extern "C" fn z_encoding_loan_mut(this_: &mut z_owned_encoding_t) -> &mut z_loaned_encoding_t { + this_.as_rust_type_mut().as_loaned_c_type_mut() } /// Constructs an owned copy of the encoding in provided uninitilized memory location. diff --git a/src/get.rs b/src/get.rs index 4bc3f90e9..7aff366c8 100644 --- a/src/get.rs +++ b/src/get.rs @@ -71,34 +71,34 @@ decl_c_type!( /// Constructs an empty `z_owned_reply_err_t`. #[no_mangle] -pub extern "C" fn z_reply_err_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit() +pub extern "C" fn z_reply_err_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit() .write(ReplyErrorNewtype::default()); } /// Returns ``true`` if reply error is in non-default state, ``false`` otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_reply_err_check(this: &'static z_owned_reply_err_t) -> bool { - !this.as_rust_type_ref().payload().is_empty() +pub extern "C" fn z_reply_err_check(this_: &'static z_owned_reply_err_t) -> bool { + !this_.as_rust_type_ref().payload().is_empty() } /// Returns reply error payload. #[no_mangle] -pub extern "C" fn z_reply_err_payload(this: &z_loaned_reply_err_t) -> &z_loaned_bytes_t { - this.as_rust_type_ref().payload().as_loaned_c_type_ref() +pub extern "C" fn z_reply_err_payload(this_: &z_loaned_reply_err_t) -> &z_loaned_bytes_t { + this_.as_rust_type_ref().payload().as_loaned_c_type_ref() } /// Returns reply error encoding. #[no_mangle] -pub extern "C" fn z_reply_err_encoding(this: &z_loaned_reply_err_t) -> &z_loaned_encoding_t { - this.as_rust_type_ref().encoding().as_loaned_c_type_ref() +pub extern "C" fn z_reply_err_encoding(this_: &z_loaned_reply_err_t) -> &z_loaned_encoding_t { + this_.as_rust_type_ref().encoding().as_loaned_c_type_ref() } /// Borrows reply error. #[no_mangle] -pub extern "C" fn z_reply_err_loan(this: &z_owned_reply_err_t) -> &z_loaned_reply_err_t { - this.as_rust_type_ref().as_loaned_c_type_ref() +pub extern "C" fn z_reply_err_loan(this_: &z_owned_reply_err_t) -> &z_loaned_reply_err_t { + this_.as_rust_type_ref().as_loaned_c_type_ref() } /// Frees the memory and resets the reply error it to its default value. @@ -116,8 +116,8 @@ decl_c_type!( /// Returns ``true`` if reply contains a valid response, ``false`` otherwise (in this case it contains a errror value). #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_reply_is_ok(this: &z_loaned_reply_t) -> bool { - this.as_rust_type_ref().result().is_ok() +pub unsafe extern "C" fn z_reply_is_ok(this_: &z_loaned_reply_t) -> bool { + this_.as_rust_type_ref().result().is_ok() } /// Yields the contents of the reply by asserting it indicates a success. @@ -125,8 +125,8 @@ pub unsafe extern "C" fn z_reply_is_ok(this: &z_loaned_reply_t) -> bool { /// Returns `NULL` if reply does not contain a sample (i. e. if `z_reply_is_ok` returns ``false``). #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_reply_ok(this: &z_loaned_reply_t) -> *const z_loaned_sample_t { - match this.as_rust_type_ref().result() { +pub unsafe extern "C" fn z_reply_ok(this_: &z_loaned_reply_t) -> *const z_loaned_sample_t { + match this_.as_rust_type_ref().result() { Ok(sample) => sample.as_loaned_c_type_ref() as _, Err(_) => null(), } @@ -137,8 +137,8 @@ pub unsafe extern "C" fn z_reply_ok(this: &z_loaned_reply_t) -> *const z_loaned_ /// Returns `NULL` if reply does not contain a error (i. e. if `z_reply_is_ok` returns ``true``). #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_reply_err(this: &z_loaned_reply_t) -> *const z_loaned_reply_err_t { - match this.as_rust_type_ref().result() { +pub unsafe extern "C" fn z_reply_err(this_: &z_loaned_reply_t) -> *const z_loaned_reply_err_t { + match this_.as_rust_type_ref().result() { Ok(_) => null(), Err(v) => std::convert::Into::<&ReplyErrorNewtype>::into(v).as_loaned_c_type_ref(), } @@ -164,14 +164,14 @@ pub unsafe extern "C" fn z_reply_replier_id( /// Constructs the reply in its gravestone state. #[no_mangle] -pub extern "C" fn z_reply_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_reply_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Constructs an owned shallow copy of reply in provided uninitialized memory location. #[no_mangle] -pub extern "C" fn z_reply_clone(dst: &mut MaybeUninit, this: &z_loaned_reply_t) { +pub extern "C" fn z_reply_clone(dst: &mut MaybeUninit, this_: &z_loaned_reply_t) { dst.as_rust_type_mut_uninit() - .write(Some(this.as_rust_type_ref().clone())); + .write(Some(this_.as_rust_type_ref().clone())); } /// Options passed to the `z_get()` function. @@ -208,8 +208,8 @@ pub struct z_get_options_t { /// Constructs default `z_get_options_t` #[no_mangle] -pub extern "C" fn z_get_options_default(this: &mut MaybeUninit) { - this.write(z_get_options_t { +pub extern "C" fn z_get_options_default(this_: &mut MaybeUninit) { + this_.write(z_get_options_t { target: QueryTarget::default().into(), consolidation: QueryConsolidation::default().into(), congestion_control: CongestionControl::default().into(), @@ -313,15 +313,15 @@ pub extern "C" fn z_reply_drop(this_: &mut z_moved_reply_t) { /// Returns ``true`` if `reply` is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_reply_check(this: &z_owned_reply_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_reply_check(this_: &z_owned_reply_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows reply. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_reply_loan(this: &z_owned_reply_t) -> &z_loaned_reply_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_reply_loan(this_: &z_owned_reply_t) -> &z_loaned_reply_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() diff --git a/src/keyexpr.rs b/src/keyexpr.rs index eae7b85c8..018966609 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -38,14 +38,14 @@ decl_c_type! { /// Constructs an owned key expression in a gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_keyexpr_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Constructs a view key expression in empty state #[no_mangle] -pub extern "C" fn z_view_keyexpr_empty(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_view_keyexpr_empty(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } fn keyexpr_create_inner( @@ -126,8 +126,8 @@ pub unsafe extern "C" fn z_keyexpr_from_str_autocanonize( /// Borrows `z_owned_keyexpr_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_keyexpr_loan(this: &z_owned_keyexpr_t) -> &z_loaned_keyexpr_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_keyexpr_loan(this_: &z_owned_keyexpr_t) -> &z_loaned_keyexpr_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -136,8 +136,8 @@ pub unsafe extern "C" fn z_keyexpr_loan(this: &z_owned_keyexpr_t) -> &z_loaned_k /// Borrows `z_view_keyexpr_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_view_keyexpr_loan(this: &z_view_keyexpr_t) -> &z_loaned_keyexpr_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_view_keyexpr_loan(this_: &z_view_keyexpr_t) -> &z_loaned_keyexpr_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -151,14 +151,14 @@ pub extern "C" fn z_keyexpr_drop(this_: &mut z_moved_keyexpr_t) { /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_check(this: &z_owned_keyexpr_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_keyexpr_check(this_: &z_owned_keyexpr_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_view_keyexpr_is_empty(this: &z_view_keyexpr_t) -> bool { - this.as_rust_type_ref().is_none() +pub extern "C" fn z_view_keyexpr_is_empty(this_: &z_view_keyexpr_t) -> bool { + this_.as_rust_type_ref().is_none() } /// Returns 0 if the passed string is a valid (and canon) key expression. diff --git a/src/liveliness.rs b/src/liveliness.rs index ef64f1b25..9ee54d581 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -34,14 +34,14 @@ decl_c_type!( /// Constructs liveliness token in its gravestone state. #[no_mangle] -pub extern "C" fn zc_liveliness_token_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn zc_liveliness_token_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if liveliness token is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn zc_liveliness_token_check(this: &zc_owned_liveliness_token_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn zc_liveliness_token_check(this_: &zc_owned_liveliness_token_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Undeclares liveliness token, frees memory and resets it to a gravestone state. diff --git a/src/payload.rs b/src/payload.rs index 0a88c8c5e..e3e8f04fa 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -303,62 +303,62 @@ where /// Serializes an unsigned integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_uint8(this: &mut MaybeUninit, val: u8) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_uint8(this_: &mut MaybeUninit, val: u8) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes an unsigned integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_uint16(this: &mut MaybeUninit, val: u16) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_uint16(this_: &mut MaybeUninit, val: u16) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes an unsigned integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_uint32(this: &mut MaybeUninit, val: u32) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_uint32(this_: &mut MaybeUninit, val: u32) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes an unsigned integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_uint64(this: &mut MaybeUninit, val: u64) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_uint64(this_: &mut MaybeUninit, val: u64) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes a signed integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_int8(this: &mut MaybeUninit, val: i8) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_int8(this_: &mut MaybeUninit, val: i8) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes a signed integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_int16(this: &mut MaybeUninit, val: i16) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_int16(this_: &mut MaybeUninit, val: i16) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes a signed integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_int32(this: &mut MaybeUninit, val: i32) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_int32(this_: &mut MaybeUninit, val: i32) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes a signed integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_int64(this: &mut MaybeUninit, val: i64) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_int64(this_: &mut MaybeUninit, val: i64) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes a float. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_float(this: &mut MaybeUninit, val: f32) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_float(this_: &mut MaybeUninit, val: f32) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes a double. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_double(this: &mut MaybeUninit, val: f64) { - z_bytes_serialize_from_arithmetic::(this, val); +pub extern "C" fn z_bytes_serialize_from_double(this_: &mut MaybeUninit, val: f64) { + z_bytes_serialize_from_arithmetic::(this_, val); } /// Deserializes into an unsigned integer. /// @return 0 in case of success, negative error code otherwise. @@ -879,8 +879,8 @@ pub unsafe extern "C" fn z_bytes_reader_seek( /// @return read position indicator on success or -1L if failure occurs. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_bytes_reader_tell(this: &mut z_bytes_reader_t) -> i64 { - let reader = this.as_rust_type_mut(); +pub unsafe extern "C" fn z_bytes_reader_tell(this_: &mut z_bytes_reader_t) -> i64 { + let reader = this_.as_rust_type_mut(); reader.stream_position().map(|p| p as i64).unwrap_or(-1) } diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index fd30138b0..f9590c5de 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -20,8 +20,8 @@ decl_c_type!( /// Constructs a mutex. /// @return 0 in case of success, negative error code otherwise. #[no_mangle] -pub extern "C" fn z_mutex_init(this: &mut MaybeUninit) -> result::z_result_t { - this.as_rust_type_mut_uninit().write(Some(( +pub extern "C" fn z_mutex_init(this_: &mut MaybeUninit) -> result::z_result_t { + this_.as_rust_type_mut_uninit().write(Some(( Mutex::<()>::new(()), None::>, ))); @@ -36,21 +36,21 @@ pub extern "C" fn z_mutex_drop(this_: &mut z_moved_mutex_t) { /// Returns ``true`` if mutex is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_mutex_check(this: &z_owned_mutex_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_mutex_check(this_: &z_owned_mutex_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Constructs mutex in a gravestone state. #[no_mangle] -pub extern "C" fn z_mutex_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_mutex_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Mutably borrows mutex. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_mutex_loan_mut(this: &mut z_owned_mutex_t) -> &mut z_loaned_mutex_t { - this.as_rust_type_mut() +pub unsafe extern "C" fn z_mutex_loan_mut(this_: &mut z_owned_mutex_t) -> &mut z_loaned_mutex_t { + this_.as_rust_type_mut() .as_mut() .unwrap_unchecked() .as_loaned_c_type_mut() @@ -59,8 +59,8 @@ pub unsafe extern "C" fn z_mutex_loan_mut(this: &mut z_owned_mutex_t) -> &mut z_ /// Locks mutex. If mutex is already locked, blocks the thread until it aquires the lock. /// @return 0 in case of success, negative error code in case of failure. #[no_mangle] -pub extern "C" fn z_mutex_lock(this: &'static mut z_loaned_mutex_t) -> result::z_result_t { - let this = this.as_rust_type_mut(); +pub extern "C" fn z_mutex_lock(this_: &'static mut z_loaned_mutex_t) -> result::z_result_t { + let this = this_.as_rust_type_mut(); match this.0.lock() { Ok(new_lock) => { @@ -77,8 +77,8 @@ pub extern "C" fn z_mutex_lock(this: &'static mut z_loaned_mutex_t) -> result::z /// Unlocks previously locked mutex. If mutex was not locked by the current thread, the behaviour is undefined. /// @return 0 in case of success, negative error code otherwise. #[no_mangle] -pub extern "C" fn z_mutex_unlock(this: &mut z_loaned_mutex_t) -> result::z_result_t { - let this = this.as_rust_type_mut(); +pub extern "C" fn z_mutex_unlock(this_: &mut z_loaned_mutex_t) -> result::z_result_t { + let this = this_.as_rust_type_mut(); if this.1.is_none() { return result::Z_EINVAL_MUTEX; } else { @@ -115,14 +115,14 @@ decl_c_type_inequal!( /// Constructs conditional variable. #[no_mangle] -pub extern "C" fn z_condvar_init(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(Some(Condvar::new())); +pub extern "C" fn z_condvar_init(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(Some(Condvar::new())); } /// Constructs conditional variable in a gravestone state. #[no_mangle] -pub extern "C" fn z_condvar_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_condvar_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Drops conditional variable. @@ -133,15 +133,15 @@ pub extern "C" fn z_condvar_drop(this_: &mut z_moved_condvar_t) { /// Returns ``true`` if conditional variable is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_condvar_check(this: &z_owned_condvar_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_condvar_check(this_: &z_owned_condvar_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows conditional variable. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_condvar_loan(this: &z_owned_condvar_t) -> &z_loaned_condvar_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_condvar_loan(this_: &z_owned_condvar_t) -> &z_loaned_condvar_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -162,8 +162,8 @@ pub unsafe extern "C" fn z_condvar_loan_mut( /// Wakes up one blocked thread waiting on this condiitonal variable. /// @return 0 in case of success, negative error code in case of failure. #[no_mangle] -pub extern "C" fn z_condvar_signal(this: &z_loaned_condvar_t) -> result::z_result_t { - let this = this.as_rust_type_ref(); +pub extern "C" fn z_condvar_signal(this_: &z_loaned_condvar_t) -> result::z_result_t { + let this = this_.as_rust_type_ref(); this.notify_one(); result::Z_OK } @@ -205,8 +205,8 @@ pub struct z_task_attr_t(usize); /// Constructs task in a gravestone state. #[no_mangle] -pub extern "C" fn z_task_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_task_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Detaches the task and releases all allocated resources. @@ -217,8 +217,8 @@ pub extern "C" fn z_task_detach(this_: &mut z_moved_task_t) { /// Joins the task and releases all allocated resources #[no_mangle] -pub extern "C" fn z_task_join(this: &mut z_moved_task_t) -> result::z_result_t { - let Some(task) = this.take_rust_type() else { +pub extern "C" fn z_task_join(this_: &mut z_moved_task_t) -> result::z_result_t { + let Some(task) = this_.take_rust_type() else { return result::Z_OK; }; match task.join() { @@ -235,8 +235,8 @@ pub extern "C" fn z_task_drop(this_: &mut z_moved_task_t) { /// Returns ``true`` if task is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_task_check(this: &z_owned_task_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_task_check(this_: &z_owned_task_t) -> bool { + this_.as_rust_type_ref().is_some() } struct FunArgPair { diff --git a/src/publication_cache.rs b/src/publication_cache.rs index 8ad2cd12e..5bd71991b 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -118,15 +118,15 @@ pub extern "C" fn ze_declare_publication_cache( /// Constructs a publication cache in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn ze_publication_cache_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if publication cache is valid, ``false`` otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_check(this: &ze_owned_publication_cache_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn ze_publication_cache_check(this_: &ze_owned_publication_cache_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Undeclares and drops publication cache. @@ -148,6 +148,6 @@ pub extern "C" fn ze_undeclare_publication_cache( /// Drops publication cache. Also attempts to undeclare it. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_drop(_this: &mut ze_moved_publication_cache_t) { - ze_undeclare_publication_cache(_this); +pub extern "C" fn ze_publication_cache_drop(this_: &mut ze_moved_publication_cache_t) { + ze_undeclare_publication_cache(this_); } diff --git a/src/publisher.rs b/src/publisher.rs index 30903e0f7..40172708e 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -56,8 +56,8 @@ pub struct z_publisher_options_t { /// Constructs the default value for `z_publisher_options_t`. #[no_mangle] -pub extern "C" fn z_publisher_options_default(this: &mut MaybeUninit) { - this.write(z_publisher_options_t { +pub extern "C" fn z_publisher_options_default(this_: &mut MaybeUninit) { + this_.write(z_publisher_options_t { encoding: None.into(), congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), @@ -125,22 +125,22 @@ pub extern "C" fn z_declare_publisher( /// Constructs a publisher in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_publisher_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if publisher is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_publisher_check(this: &z_owned_publisher_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_publisher_check(this_: &z_owned_publisher_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows publisher. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_publisher_loan(this: &z_owned_publisher_t) -> &z_loaned_publisher_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_publisher_loan(this_: &z_owned_publisher_t) -> &z_loaned_publisher_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -297,15 +297,15 @@ decl_c_type!( /// Constructs an empty matching listener #[no_mangle] #[cfg(feature = "unstable")] -pub extern "C" fn zc_matching_listener_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn zc_matching_listener_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Checks the matching listener is for the gravestone state #[no_mangle] #[cfg(feature = "unstable")] -pub extern "C" fn zc_matching_listener_check(this: &zc_owned_matching_listener_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn zc_matching_listener_check(this_: &zc_owned_matching_listener_t) -> bool { + this_.as_rust_type_ref().is_some() } #[cfg(feature = "unstable")] @@ -415,8 +415,8 @@ pub extern "C" fn zc_publisher_get_matching_status( /// @return 0 in case of success, negative error code otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_undeclare_publisher(_this: &mut z_moved_publisher_t) -> result::z_result_t { - if let Some(p) = _this.take_rust_type() { +pub extern "C" fn z_undeclare_publisher(this_: &mut z_moved_publisher_t) -> result::z_result_t { + if let Some(p) = this_.take_rust_type() { if let Err(e) = p.undeclare().wait() { tracing::error!("{}", e); return result::Z_ENETWORK; @@ -428,6 +428,6 @@ pub extern "C" fn z_undeclare_publisher(_this: &mut z_moved_publisher_t) -> resu /// Frees memory and resets publisher to its gravestone state. Also attempts undeclare publisher. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_drop(_this: &mut z_moved_publisher_t) { - z_undeclare_publisher(_this); +pub extern "C" fn z_publisher_drop(this_: &mut z_moved_publisher_t) { + z_undeclare_publisher(this_); } diff --git a/src/put.rs b/src/put.rs index f8b9ede1f..e25f2d40d 100644 --- a/src/put.rs +++ b/src/put.rs @@ -56,8 +56,8 @@ pub struct z_put_options_t { /// Constructs the default value for `z_put_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_put_options_default(this: &mut MaybeUninit) { - this.write(z_put_options_t { +pub extern "C" fn z_put_options_default(this_: &mut MaybeUninit) { + this_.write(z_put_options_t { encoding: None.into(), congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), @@ -142,8 +142,8 @@ pub struct z_delete_options_t { /// Constructs the default value for `z_delete_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_delete_options_default(this: &mut MaybeUninit) { - this.write(z_delete_options_t { +pub unsafe extern "C" fn z_delete_options_default(this_: &mut MaybeUninit) { + this_.write(z_delete_options_t { congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), is_express: false, diff --git a/src/queryable.rs b/src/queryable.rs index 8b905839b..1d63362d7 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -40,15 +40,15 @@ decl_c_type!( /// Constructs a queryable in its gravestone value. #[no_mangle] -pub extern "C" fn z_queryable_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_queryable_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } // Borrows Queryable #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_queryable_loan(this: &z_owned_queryable_t) -> &z_loaned_queryable_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_queryable_loan(this_: &z_owned_queryable_t) -> &z_loaned_queryable_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -62,8 +62,8 @@ decl_c_type!( /// Constructs query in its gravestone value. #[no_mangle] -pub extern "C" fn z_query_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_query_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns `false` if `this` is in a gravestone state, `true` otherwise. #[no_mangle] @@ -73,8 +73,8 @@ pub extern "C" fn z_query_check(query: &z_owned_query_t) -> bool { /// Borrows the query. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_query_loan(this: &'static z_owned_query_t) -> &z_loaned_query_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_query_loan(this_: &'static z_owned_query_t) -> &z_loaned_query_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -88,9 +88,9 @@ pub extern "C" fn z_query_drop(this_: &mut z_moved_query_t) { /// /// This operation is infallible, but may return a gravestone value if `query` itself was a gravestone value (which cannot be the case in a callback). #[no_mangle] -pub extern "C" fn z_query_clone(dst: &mut MaybeUninit, this: &z_loaned_query_t) { +pub extern "C" fn z_query_clone(dst: &mut MaybeUninit, this_: &z_loaned_query_t) { dst.as_rust_type_mut_uninit() - .write(Some(this.as_rust_type_ref().clone())); + .write(Some(this_.as_rust_type_ref().clone())); } /// Options passed to the `z_declare_queryable()` function. @@ -103,8 +103,8 @@ pub struct z_queryable_options_t { /// Constructs the default value for `z_query_reply_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_queryable_options_default(this: &mut MaybeUninit) { - this.write(z_queryable_options_t { complete: false }); +pub extern "C" fn z_queryable_options_default(this_: &mut MaybeUninit) { + this_.write(z_queryable_options_t { complete: false }); } /// Represents the set of options that can be applied to a query reply, @@ -132,8 +132,8 @@ pub struct z_query_reply_options_t { /// Constructs the default value for `z_query_reply_options_t`. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_query_reply_options_default(this: &mut MaybeUninit) { - this.write(z_query_reply_options_t { +pub extern "C" fn z_query_reply_options_default(this_: &mut MaybeUninit) { + this_.write(z_query_reply_options_t { encoding: None.into(), congestion_control: CongestionControl::Block.into(), priority: Priority::default().into(), @@ -254,8 +254,8 @@ pub extern "C" fn z_declare_queryable( /// Returns 0 in case of success, negative error code otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_undeclare_queryable(this: &mut z_moved_queryable_t) -> result::z_result_t { - if let Some(qable) = this.take_rust_type() { +pub extern "C" fn z_undeclare_queryable(this_: &mut z_moved_queryable_t) -> result::z_result_t { + if let Some(qable) = this_.take_rust_type() { if let Err(e) = qable.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -267,14 +267,14 @@ pub extern "C" fn z_undeclare_queryable(this: &mut z_moved_queryable_t) -> resul /// Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_queryable_drop(this: &mut z_moved_queryable_t) { - z_undeclare_queryable(this); +pub extern "C" fn z_queryable_drop(this_: &mut z_moved_queryable_t) { + z_undeclare_queryable(this_); } /// Returns ``true`` if queryable is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_queryable_check(this: &z_owned_queryable_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_queryable_check(this_: &z_owned_queryable_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Sends a reply to a query. @@ -412,8 +412,8 @@ pub unsafe extern "C" fn z_query_reply_del( /// Gets query key expression. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_query_keyexpr(this: &z_loaned_query_t) -> &z_loaned_keyexpr_t { - this.as_rust_type_ref().key_expr().as_loaned_c_type_ref() +pub extern "C" fn z_query_keyexpr(this_: &z_loaned_query_t) -> &z_loaned_keyexpr_t { + this_.as_rust_type_ref().key_expr().as_loaned_c_type_ref() } /// Gets query value selector. @@ -432,8 +432,8 @@ pub unsafe extern "C" fn z_query_parameters( /// /// Returns NULL if query does not contain a payload. #[no_mangle] -pub extern "C" fn z_query_payload(this: &z_loaned_query_t) -> Option<&z_loaned_bytes_t> { - this.as_rust_type_ref() +pub extern "C" fn z_query_payload(this_: &z_loaned_query_t) -> Option<&z_loaned_bytes_t> { + this_.as_rust_type_ref() .payload() .map(|v| v.as_loaned_c_type_ref()) } @@ -442,8 +442,8 @@ pub extern "C" fn z_query_payload(this: &z_loaned_query_t) -> Option<&z_loaned_b /// /// Returns NULL if query does not contain an encoding. #[no_mangle] -pub extern "C" fn z_query_encoding(this: &z_loaned_query_t) -> Option<&z_loaned_encoding_t> { - this.as_rust_type_ref() +pub extern "C" fn z_query_encoding(this_: &z_loaned_query_t) -> Option<&z_loaned_encoding_t> { + this_.as_rust_type_ref() .encoding() .map(|v| v.as_loaned_c_type_ref()) } @@ -452,8 +452,8 @@ pub extern "C" fn z_query_encoding(this: &z_loaned_query_t) -> Option<&z_loaned_ /// /// Returns NULL if query does not contain an attachment. #[no_mangle] -pub extern "C" fn z_query_attachment(this: &z_loaned_query_t) -> Option<&z_loaned_bytes_t> { - this.as_rust_type_ref() +pub extern "C" fn z_query_attachment(this_: &z_loaned_query_t) -> Option<&z_loaned_bytes_t> { + this_.as_rust_type_ref() .attachment() .map(|a| a.as_loaned_c_type_ref()) } diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 1912b6fc5..2c64da470 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -225,14 +225,14 @@ pub extern "C" fn ze_undeclare_querying_subscriber( /// Drops querying subscriber. Also attempts to undeclare it. #[no_mangle] -pub extern "C" fn ze_querying_subscriber_drop(_this: &mut ze_moved_querying_subscriber_t) { - ze_undeclare_querying_subscriber(_this); +pub extern "C" fn ze_querying_subscriber_drop(this_: &mut ze_moved_querying_subscriber_t) { + ze_undeclare_querying_subscriber(this_); } /// Returns ``true`` if querying subscriber is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn ze_querying_subscriber_check(this: &ze_owned_querying_subscriber_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn ze_querying_subscriber_check(this_: &ze_owned_querying_subscriber_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows querying subscriber. diff --git a/src/scouting.rs b/src/scouting.rs index 49665b42f..eca44f4bc 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -43,8 +43,8 @@ pub unsafe extern "C" fn z_hello_drop(this_: &mut z_moved_hello_t) { /// Borrows hello message. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_hello_loan(this: &z_owned_hello_t) -> &z_loaned_hello_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_hello_loan(this_: &z_owned_hello_t) -> &z_loaned_hello_t { + this_.as_rust_type_ref() .as_ref() .unwrap() .as_loaned_c_type_ref() @@ -52,27 +52,27 @@ pub unsafe extern "C" fn z_hello_loan(this: &z_owned_hello_t) -> &z_loaned_hello /// Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_hello_check(this: &z_owned_hello_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_hello_check(this_: &z_owned_hello_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Constructs hello message in a gravestone state. #[no_mangle] -pub extern "C" fn z_hello_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_hello_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } #[cfg(feature = "unstable")] /// Returns id of Zenoh entity that transmitted hello message. #[no_mangle] -pub extern "C" fn z_hello_zid(this: &z_loaned_hello_t) -> z_id_t { - this.as_rust_type_ref().zid().into_c_type() +pub extern "C" fn z_hello_zid(this_: &z_loaned_hello_t) -> z_id_t { + this_.as_rust_type_ref().zid().into_c_type() } /// Returns type of Zenoh entity that transmitted hello message. #[no_mangle] -pub extern "C" fn z_hello_whatami(this: &z_loaned_hello_t) -> z_whatami_t { - match this.as_rust_type_ref().whatami() { +pub extern "C" fn z_hello_whatami(this_: &z_loaned_hello_t) -> z_whatami_t { + match this_.as_rust_type_ref().whatami() { WhatAmI::Router => z_whatami_t::ROUTER, WhatAmI::Peer => z_whatami_t::PEER, WhatAmI::Client => z_whatami_t::CLIENT, @@ -141,8 +141,8 @@ pub const DEFAULT_SCOUTING_TIMEOUT: u64 = 1000; /// Constructs the default values for the scouting operation. #[no_mangle] -pub extern "C" fn z_scout_options_default(this: &mut MaybeUninit) { - this.write(z_scout_options_t::default()); +pub extern "C" fn z_scout_options_default(this_: &mut MaybeUninit) { + this_.write(z_scout_options_t::default()); } /// Scout for routers and/or peers. diff --git a/src/session.rs b/src/session.rs index 9d8488227..db0ead932 100644 --- a/src/session.rs +++ b/src/session.rs @@ -32,8 +32,8 @@ decl_c_type!( /// Borrows session. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_session_loan(this: &z_owned_session_t) -> &z_loaned_session_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_session_loan(this_: &z_owned_session_t) -> &z_loaned_session_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -42,8 +42,8 @@ pub unsafe extern "C" fn z_session_loan(this: &z_owned_session_t) -> &z_loaned_s /// Constructs a Zenoh session in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_session_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_session_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Constructs and opens a new Zenoh session. @@ -116,8 +116,8 @@ pub extern "C" fn z_open_with_custom_shm_clients( /// Returns ``true`` if `session` is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_session_check(this: &z_owned_session_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_session_check(this_: &z_owned_session_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Closes a zenoh session. This alos drops and invalidates `session`. diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 5ef8635d1..7190c944f 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -31,27 +31,27 @@ decl_c_type!( /// Constructs ZShm slice from ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_from_mut(this: &mut MaybeUninit, that: &mut z_moved_shm_mut_t) { +pub extern "C" fn z_shm_from_mut(this_: &mut MaybeUninit, that: &mut z_moved_shm_mut_t) { let shm: Option = that.take_rust_type().take().map(|val| val.into()); - this.as_rust_type_mut_uninit().write(shm); + this_.as_rust_type_mut_uninit().write(shm); } /// Constructs ZShm slice in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_shm_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_check(this: &z_owned_shm_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_shm_check(this_: &z_owned_shm_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy #[no_mangle] -pub extern "C" fn z_shm_clone(out: &mut MaybeUninit, this: &z_loaned_shm_t) { - let this = this.as_rust_type_ref(); +pub extern "C" fn z_shm_clone(out: &mut MaybeUninit, this_: &z_loaned_shm_t) { + let this = this_.as_rust_type_ref(); let copy = this.to_owned(); out.as_rust_type_mut_uninit().write(Some(copy)); } @@ -59,16 +59,16 @@ pub extern "C" fn z_shm_clone(out: &mut MaybeUninit, this: &z_loa /// Borrows ZShm slice #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_shm_loan(this: &z_owned_shm_t) -> &z_loaned_shm_t { - let this: &zshm = this.as_rust_type_ref().as_ref().unwrap_unchecked().borrow(); +pub unsafe extern "C" fn z_shm_loan(this_: &z_owned_shm_t) -> &z_loaned_shm_t { + let this: &zshm = this_.as_rust_type_ref().as_ref().unwrap_unchecked().borrow(); this.as_loaned_c_type_ref() } /// Mutably borrows ZShm slice #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_shm_loan_mut(this: &mut z_owned_shm_t) -> &mut z_loaned_shm_t { - let this: &mut zshm = this +pub unsafe extern "C" fn z_shm_loan_mut(this_: &mut z_owned_shm_t) -> &mut z_loaned_shm_t { + let this: &mut zshm = this_ .as_rust_type_mut() .as_mut() .unwrap_unchecked() @@ -79,8 +79,8 @@ pub unsafe extern "C" fn z_shm_loan_mut(this: &mut z_owned_shm_t) -> &mut z_loan /// Mutably borrows ZShm slice as borrowed ZShmMut slice #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_shm_try_mut(this: &mut z_owned_shm_t) -> *mut z_loaned_shm_mut_t { - let this = this.as_rust_type_mut(); +pub unsafe extern "C" fn z_shm_try_mut(this_: &mut z_owned_shm_t) -> *mut z_loaned_shm_mut_t { + let this = this_.as_rust_type_mut(); let this: &mut ZShm = this.as_mut().unwrap_unchecked(); let shm: &mut zshm = this.borrow_mut(); match shm.try_into() { @@ -100,8 +100,8 @@ pub extern "C" fn z_shm_drop(this_: &mut z_moved_shm_t) { /// Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_try_reloan_mut(this: &mut z_loaned_shm_t) -> *mut z_loaned_shm_mut_t { - let this = this.as_rust_type_mut(); +pub extern "C" fn z_shm_try_reloan_mut(this_: &mut z_loaned_shm_t) -> *mut z_loaned_shm_mut_t { + let this = this_.as_rust_type_mut(); match this.try_into() { Ok(val) => { let v: &mut zshmmut = val; @@ -113,13 +113,13 @@ pub extern "C" fn z_shm_try_reloan_mut(this: &mut z_loaned_shm_t) -> *mut z_loan /// @return the length of the ZShm slice #[no_mangle] -pub extern "C" fn z_shm_len(this: &z_loaned_shm_t) -> usize { - this.as_rust_type_ref().len() +pub extern "C" fn z_shm_len(this_: &z_loaned_shm_t) -> usize { + this_.as_rust_type_ref().len() } /// @return the pointer of the ZShm slice #[no_mangle] -pub extern "C" fn z_shm_data(this: &z_loaned_shm_t) -> *const libc::c_uchar { - let s = this.as_rust_type_ref(); +pub extern "C" fn z_shm_data(this_: &z_loaned_shm_t) -> *const libc::c_uchar { + let s = this_.as_rust_type_ref(); s.as_ref().as_ptr() } diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index 08dd12993..948d385c9 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -44,21 +44,21 @@ pub extern "C" fn z_shm_mut_try_from_immut( /// Constructs ZShmMut slice in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_mut_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_shm_mut_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_mut_check(this: &z_owned_shm_mut_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_shm_mut_check(this_: &z_owned_shm_mut_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows ZShmMut slice #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_shm_mut_loan(this: &z_owned_shm_mut_t) -> &z_loaned_shm_mut_t { - let shmmut: &zshmmut = this.as_rust_type_ref().as_ref().unwrap_unchecked().borrow(); +pub unsafe extern "C" fn z_shm_mut_loan(this_: &z_owned_shm_mut_t) -> &z_loaned_shm_mut_t { + let shmmut: &zshmmut = this_.as_rust_type_ref().as_ref().unwrap_unchecked().borrow(); shmmut.as_loaned_c_type_ref() } @@ -84,19 +84,19 @@ pub extern "C" fn z_shm_mut_drop(this_: &mut z_moved_shm_mut_t) { /// @return the length of the ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_mut_len(this: &z_loaned_shm_mut_t) -> usize { - this.as_rust_type_ref().len() +pub extern "C" fn z_shm_mut_len(this_: &z_loaned_shm_mut_t) -> usize { + this_.as_rust_type_ref().len() } /// @return the immutable pointer to the underlying data #[no_mangle] -pub extern "C" fn z_shm_mut_data(this: &z_loaned_shm_mut_t) -> *const libc::c_uchar { - let s = this.as_rust_type_ref(); +pub extern "C" fn z_shm_mut_data(this_: &z_loaned_shm_mut_t) -> *const libc::c_uchar { + let s = this_.as_rust_type_ref(); s.as_ref().as_ptr() } /// @return the mutable pointer to the underlying data #[no_mangle] -pub extern "C" fn z_shm_mut_data_mut(this: &mut z_loaned_shm_mut_t) -> *mut libc::c_uchar { - this.as_rust_type_mut().as_mut().as_mut_ptr() +pub extern "C" fn z_shm_mut_data_mut(this_: &mut z_loaned_shm_mut_t) -> *mut libc::c_uchar { + this_.as_rust_type_mut().as_mut().as_mut_ptr() } diff --git a/src/shm/client/shm_client.rs b/src/shm/client/shm_client.rs index 0a73b0697..fa41152e8 100644 --- a/src/shm/client/shm_client.rs +++ b/src/shm/client/shm_client.rs @@ -80,14 +80,14 @@ pub extern "C" fn z_shm_client_new( /// Constructs SHM client in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_client_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_shm_client_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_client_check(this: &z_owned_shm_client_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_shm_client_check(this_: &z_owned_shm_client_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Deletes SHM Client diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index b790c1984..173a5fcce 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -32,21 +32,21 @@ decl_c_type!( /// Creates a new empty list of SHM Clients #[no_mangle] -pub extern "C" fn zc_shm_client_list_new(this: &mut MaybeUninit) { +pub extern "C" fn zc_shm_client_list_new(this_: &mut MaybeUninit) { let client_list: Vec<(ProtocolID, Arc)> = Vec::default(); - this.as_rust_type_mut_uninit().write(Some(client_list)); + this_.as_rust_type_mut_uninit().write(Some(client_list)); } /// Constructs SHM client list in its gravestone value. #[no_mangle] -pub extern "C" fn zc_shm_client_list_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn zc_shm_client_list_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn zc_shm_client_list_check(this: &zc_owned_shm_client_list_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn zc_shm_client_list_check(this_: &zc_owned_shm_client_list_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Deletes list of SHM Clients @@ -150,14 +150,14 @@ pub extern "C" fn z_shm_client_storage_clone( /// Constructs SHM Client Storage in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_client_storage_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_shm_client_storage_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_client_storage_check(this: &z_owned_shm_client_storage_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_shm_client_storage_check(this_: &z_owned_shm_client_storage_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Derefs SHM Client Storage diff --git a/src/shm/protocol_implementations/posix/posix_shm_client.rs b/src/shm/protocol_implementations/posix/posix_shm_client.rs index 17534dc2d..fd131395f 100644 --- a/src/shm/protocol_implementations/posix/posix_shm_client.rs +++ b/src/shm/protocol_implementations/posix/posix_shm_client.rs @@ -20,7 +20,7 @@ use crate::{transmute::RustTypeRefUninit, z_owned_shm_client_t}; /// Creates a new POSIX SHM Client #[no_mangle] -pub extern "C" fn z_posix_shm_client_new(this: &mut MaybeUninit) { +pub extern "C" fn z_posix_shm_client_new(this_: &mut MaybeUninit) { let client = Arc::new(PosixShmClient) as Arc; - this.as_rust_type_mut_uninit().write(Some(client)); + this_.as_rust_type_mut_uninit().write(Some(client)); } diff --git a/src/shm/provider/alloc_layout.rs b/src/shm/provider/alloc_layout.rs index 29df26fae..8af9b32d1 100644 --- a/src/shm/provider/alloc_layout.rs +++ b/src/shm/provider/alloc_layout.rs @@ -63,14 +63,14 @@ pub extern "C" fn z_alloc_layout_new( /// Constructs Alloc Layout in its gravestone value. #[no_mangle] -pub extern "C" fn z_alloc_layout_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_alloc_layout_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_alloc_layout_check(this: &z_owned_alloc_layout_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_alloc_layout_check(this_: &z_owned_alloc_layout_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows Alloc Layout diff --git a/src/shm/provider/shm_provider.rs b/src/shm/provider/shm_provider.rs index cff4f3296..2ef046c49 100644 --- a/src/shm/provider/shm_provider.rs +++ b/src/shm/provider/shm_provider.rs @@ -92,14 +92,14 @@ pub extern "C" fn z_shm_provider_threadsafe_new( /// Constructs SHM Provider in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_provider_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_shm_provider_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_provider_check(this: &z_owned_shm_provider_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_shm_provider_check(this_: &z_owned_shm_provider_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows SHM Provider diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index 7c1d47023..8eedd5c23 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -145,14 +145,14 @@ fn create_memory_layout( /// Constructs Memory Layout in its gravestone value. #[no_mangle] -pub extern "C" fn z_memory_layout_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_memory_layout_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_memory_layout_check(this: &z_owned_memory_layout_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_memory_layout_check(this_: &z_owned_memory_layout_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows Memory Layout @@ -217,14 +217,14 @@ pub extern "C" fn z_chunk_alloc_result_new_error( /// Constructs Chunk Alloc Result in its gravestone value. #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_chunk_alloc_result_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_check(this: &z_owned_chunk_alloc_result_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_chunk_alloc_result_check(this_: &z_owned_chunk_alloc_result_t) -> bool { + this_.as_rust_type_ref().is_some() } /// Borrows Chunk Alloc Result diff --git a/src/subscriber.rs b/src/subscriber.rs index ff3301aac..efbc6888e 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -66,15 +66,15 @@ decl_c_type!( /// Constructs a subscriber in a gravestone state. #[no_mangle] -pub extern "C" fn z_subscriber_null(this: &mut MaybeUninit) { - this.as_rust_type_mut_uninit().write(None); +pub extern "C" fn z_subscriber_null(this_: &mut MaybeUninit) { + this_.as_rust_type_mut_uninit().write(None); } /// Borrows subscriber. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_subscriber_loan(this: &z_owned_subscriber_t) -> &z_loaned_subscriber_t { - this.as_rust_type_ref() +pub unsafe extern "C" fn z_subscriber_loan(this_: &z_owned_subscriber_t) -> &z_loaned_subscriber_t { + this_.as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -90,8 +90,8 @@ pub struct z_subscriber_options_t { /// Constructs the default value for `z_subscriber_options_t`. #[no_mangle] -pub extern "C" fn z_subscriber_options_default(this: &mut MaybeUninit) { - this.write(z_subscriber_options_t { +pub extern "C" fn z_subscriber_options_default(this_: &mut MaybeUninit) { + this_.write(z_subscriber_options_t { reliability: Reliability::DEFAULT.into(), }); } @@ -155,8 +155,8 @@ pub extern "C" fn z_subscriber_keyexpr(subscriber: &z_loaned_subscriber_t) -> &z /// @return 0 in case of success, negative error code otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_undeclare_subscriber(_this: &mut z_moved_subscriber_t) -> result::z_result_t { - if let Some(s) = _this.take_rust_type() { +pub extern "C" fn z_undeclare_subscriber(this_: &mut z_moved_subscriber_t) -> result::z_result_t { + if let Some(s) = this_.take_rust_type() { if let Err(e) = s.undeclare().wait() { tracing::error!("{}", e); return result::Z_EGENERIC; @@ -173,6 +173,6 @@ pub extern "C" fn z_subscriber_drop(this_: &mut z_moved_subscriber_t) { /// Returns ``true`` if subscriber is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_subscriber_check(this: &z_owned_subscriber_t) -> bool { - this.as_rust_type_ref().is_some() +pub extern "C" fn z_subscriber_check(this_: &z_owned_subscriber_t) -> bool { + this_.as_rust_type_ref().is_some() } From 655e59806997d1bfbbd8be32fbe083d45401ae58 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 11:52:24 +0200 Subject: [PATCH 081/397] compile fix --- include/zenoh_commons.h | 516 +++++++++++++++++++++++++--------------- include/zenoh_macros.h | 356 +-------------------------- src/commons.rs | 13 +- 3 files changed, 341 insertions(+), 544 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 25e2b3f94..4497f0c5e 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,6 +16,26 @@ #define ALIGN(n) #define ZENOHC_API #endif +/** + * Allocation errors + * + * - **NEED_DEFRAGMENT**: defragmentation needed + * - **OUT_OF_MEMORY**: the provider is out of memory + * - **OTHER**: other error + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_alloc_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_NEED_DEFRAGMENT, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OUT_OF_MEMORY, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OTHER, +#endif +} z_alloc_error_t; +#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -76,6 +96,22 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif +/** + * Layouting errors + * + * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect + * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_layout_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, +#endif +} z_layout_error_t; +#endif /** * The priority of zenoh messages. */ @@ -230,10 +266,47 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -typedef struct z_moved_alloc_layout_t { - struct z_owned_alloc_layout_t _this; -} z_moved_alloc_layout_t; +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_alloc_result_t { + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif typedef int8_t z_result_t; +/** + * An AllocAlignment. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t _this; } z_moved_bytes_t; @@ -243,15 +316,37 @@ typedef struct z_moved_slice_t { typedef struct z_moved_string_t { struct z_owned_string_t _this; } z_moved_string_t; -typedef struct z_moved_shm_t { - struct z_owned_shm_t _this; -} z_moved_shm_t; -typedef struct z_moved_shm_mut_t { - struct z_owned_shm_mut_t _this; -} z_moved_shm_mut_t; -typedef struct z_moved_chunk_alloc_result_t { - struct z_owned_chunk_alloc_result_t _this; -} z_moved_chunk_alloc_result_t; +/** + * Unique segment identifier + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_segment_id_t; +#endif +/** + * Chunk id within it's segment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * A ChunkDescriptor + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * An AllocatedChunk + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif /** * Monotonic clock */ @@ -402,7 +497,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const struct z_id_t *z_id, void *context); + void (*call)(const z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -513,9 +608,6 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; -typedef struct z_moved_source_info_t { - struct z_owned_source_info_t _this; -} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -564,7 +656,7 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. @@ -581,9 +673,6 @@ typedef struct z_moved_hello_t { typedef struct z_moved_keyexpr_t { struct z_owned_keyexpr_t _this; } z_moved_keyexpr_t; -typedef struct z_moved_memory_layout_t { - struct z_owned_memory_layout_t _this; -} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t _this; } z_moved_mutex_t; @@ -616,7 +705,7 @@ typedef struct z_publisher_put_options_t { /** * The source info for the publication. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. @@ -657,7 +746,7 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this message. @@ -696,7 +785,7 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -728,7 +817,7 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -779,15 +868,39 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -typedef struct z_moved_shm_client_t { - struct z_owned_shm_client_t _this; -} z_moved_shm_client_t; -typedef struct z_moved_shm_client_storage_t { - struct z_owned_shm_client_storage_t _this; -} z_moved_shm_client_storage_t; -typedef struct z_moved_shm_provider_t { - struct z_owned_shm_provider_t _this; -} z_moved_shm_provider_t; +/** + * A callbacks for ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_segment_callbacks_t { + uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); +} zc_shm_segment_callbacks_t; +#endif +/** + * A ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_shm_segment_t { + struct zc_threadsafe_context_t context; + struct zc_shm_segment_callbacks_t callbacks; +} z_shm_segment_t; +#endif +/** + * A callbacks for ShmClient + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_client_callbacks_t { + bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); +} zc_shm_client_callbacks_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_layout_alloc_result_t { + z_owned_shm_mut_t buf; + bool error_is_alloc; + enum z_alloc_error_t alloc_error; + enum z_layout_error_t layout_error; +} z_buf_layout_alloc_result_t; +#endif /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -796,6 +909,46 @@ typedef struct z_moved_shm_provider_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif +/** + * A non-tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same + * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated + * with this context data are not required to be thread-safe. + * + * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can + * still be executed concurrently. The exact behavior depends on user's application, but we strongly + * discourage our users from pinning to some specific behavior unless they _really_ understand what they + * are doing. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_context_t { + void *context; + void (*delete_fn)(void*); +} zc_context_t; +#endif +/** + * A callbacks for ShmProviderBackend + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_provider_backend_callbacks_t { + void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, + const z_loaned_memory_layout_t *layout, + void *context); + void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); + size_t (*defragment_fn)(void *context); + size_t (*available_fn)(void *context); + void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); +} zc_shm_provider_backend_callbacks_t; +#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t _this; } z_moved_string_array_t; @@ -844,6 +997,14 @@ typedef struct zc_owned_closure_log_t { typedef struct zc_moved_closure_log_t { struct zc_owned_closure_log_t _this; } zc_moved_closure_log_t; +/** + * Loaned closure. + */ +#if defined(UNSTABLE) +typedef struct zc_loaned_closure_matching_status_t { + size_t _0[3]; +} zc_loaned_closure_matching_status_t; +#endif /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -913,15 +1074,6 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif -typedef struct zc_moved_liveliness_token_t { - struct zc_owned_liveliness_token_t _this; -} zc_moved_liveliness_token_t; -typedef struct zc_moved_matching_listener_t { - struct zc_owned_matching_listener_t _this; -} zc_moved_matching_listener_t; -typedef struct zc_moved_shm_client_list_t { - struct zc_owned_shm_client_list_t _this; -} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -992,12 +1144,6 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif -typedef struct ze_moved_publication_cache_t { - struct ze_owned_publication_cache_t _this; -} ze_moved_publication_cache_t; -typedef struct ze_moved_querying_subscriber_t { - struct ze_owned_querying_subscriber_t _this; -} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1017,54 +1163,53 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1072,12 +1217,12 @@ z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout, + const z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1141,7 +1286,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const struct z_loaned_shm_t **dst); + const z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1152,7 +1297,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - struct z_loaned_shm_t **dst); + z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1163,7 +1308,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - struct z_owned_shm_t *dst); + z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1422,9 +1567,7 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t *shm); +ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_moved_shm_t *shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1432,7 +1575,7 @@ z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t *shm); + z_moved_shm_mut_t *shm); #endif /** * Serializes a slice by copying. @@ -1500,27 +1643,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); +const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1528,14 +1671,14 @@ void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1660,7 +1803,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const struct z_id_t *z_id); + const z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2355,13 +2498,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); +ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2539,7 +2682,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2575,7 +2718,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2719,13 +2862,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t *this_); #endif /** * Extract data from Memory Layout @@ -2734,21 +2877,21 @@ ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const struct z_loaned_memory_layout_t *this_); + const z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); +const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2756,7 +2899,7 @@ z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2812,21 +2955,21 @@ z_result_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t *config, - const struct z_loaned_shm_client_storage_t *shm_clients); + const z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, - const struct z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, + const z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2856,7 +2999,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3118,7 +3261,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3189,7 +3332,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3375,7 +3518,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3428,26 +3571,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t *this_); +ZENOHC_API void z_shm_client_drop(z_moved_shm_client_t *this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(struct z_owned_shm_client_t *this_, +void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3455,179 +3598,177 @@ void z_shm_client_new(struct z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, - const struct z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, + const z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); +const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, - const struct zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, + const zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(struct z_moved_shm_t *this_); +ZENOHC_API void z_shm_drop(z_moved_shm_t *this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t *that); +ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_moved_shm_mut_t *that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); +ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_drop(z_moved_shm_mut_t *this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); +ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t *that); +ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t *that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3637,49 +3778,48 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_drop(z_moved_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); +ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, + const z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3688,7 +3828,7 @@ z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3697,14 +3837,14 @@ void z_shm_provider_new(struct z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3713,13 +3853,13 @@ void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3798,47 +3938,46 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t *this_); +ZENOHC_API void z_source_info_drop(z_moved_source_info_t *this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); +ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API -const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); +ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(struct z_owned_source_info_t *this_, - const struct z_entity_global_id_t *source_id, +z_result_t z_source_info_new(z_owned_source_info_t *this_, + const z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -4054,7 +4193,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4422,7 +4561,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4459,32 +4598,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t *this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); +const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t *this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t *this_); #endif /** * Returns default value of `zc_locality_t` @@ -4496,13 +4635,13 @@ ZENOHC_API enum zc_locality_t zc_locality_default(void); * Checks the matching listener is for the gravestone state */ #if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); #endif /** * Constructs an empty matching listener */ #if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); +ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); #endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -4525,7 +4664,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t *callback); #endif @@ -4535,8 +4674,7 @@ z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_liste * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_listener_t *this_); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4544,8 +4682,7 @@ z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t *this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t *this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4556,46 +4693,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - struct z_moved_shm_client_t *client, - struct zc_loaned_shm_client_list_t *list); + z_moved_shm_client_t *client, + zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); +const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); +zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4617,7 +4754,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4635,7 +4772,7 @@ z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *thi */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t *callback, @@ -4645,19 +4782,19 @@ z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4669,13 +4806,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4684,7 +4821,7 @@ ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_ */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -4693,13 +4830,13 @@ z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber */ #if defined(UNSTABLE) ZENOHC_API -const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); +const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4713,7 +4850,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4721,6 +4858,5 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t *_this); +ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t *_this); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 2a91855a8..587b96126 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,14 +4,11 @@ #ifndef __cplusplus -static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t){x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t){x}; } -static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t){x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t){x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t){x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t){x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t){x}; } -static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t){x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t){x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return (z_moved_config_t){x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t){x}; } @@ -20,7 +17,6 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t){x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t){x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } -static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t){x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } @@ -32,36 +28,21 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t){x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t){x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return (z_moved_session_t){x}; } -static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t){x}; } -static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t){x}; } -static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t){x}; } -static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t){x}; } -static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t){x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t){x}; } -static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t){x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t){x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return (z_moved_string_t){x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t){x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_task_t){x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } -static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t){x}; } -static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t){x}; } -static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t){x}; } -static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t){x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t){x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t){x}; } #define z_loan(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ - z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -70,7 +51,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ - z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -81,23 +61,14 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ - z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ - z_owned_shm_t : z_shm_loan, \ - z_owned_shm_mut_t : z_shm_mut_loan, \ - z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ - z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ - zc_owned_closure_log_t : zc_closure_log_loan, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ - zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ + zc_owned_closure_log_t : zc_closure_log_loan \ )(&this_) #define z_loan_mut(this_) \ @@ -108,22 +79,16 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_shm_t : z_shm_loan_mut, \ - z_owned_shm_mut_t : z_shm_mut_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ + z_owned_string_array_t : z_string_array_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_alloc_layout_t : z_alloc_layout_drop, \ z_moved_bytes_t : z_bytes_drop, \ - z_moved_chunk_alloc_result_t : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t : z_closure_hello_drop, \ z_moved_closure_query_t : z_closure_query_drop, \ z_moved_closure_reply_t : z_closure_reply_drop, \ z_moved_closure_sample_t : z_closure_sample_drop, \ - z_moved_closure_zid_t : z_closure_zid_drop, \ z_moved_condvar_t : z_condvar_drop, \ z_moved_config_t : z_config_drop, \ z_moved_encoding_t : z_encoding_drop, \ @@ -132,7 +97,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_moved_fifo_handler_sample_t : z_fifo_handler_sample_drop, \ z_moved_hello_t : z_hello_drop, \ z_moved_keyexpr_t : z_keyexpr_drop, \ - z_moved_memory_layout_t : z_memory_layout_drop, \ z_moved_mutex_t : z_mutex_drop, \ z_moved_publisher_t : z_publisher_drop, \ z_moved_query_t : z_query_drop, \ @@ -144,36 +108,21 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_moved_ring_handler_sample_t : z_ring_handler_sample_drop, \ z_moved_sample_t : z_sample_drop, \ z_moved_session_t : z_session_drop, \ - z_moved_shm_client_t : z_shm_client_drop, \ - z_moved_shm_client_storage_t : z_shm_client_storage_drop, \ - z_moved_shm_t : z_shm_drop, \ - z_moved_shm_mut_t : z_shm_mut_drop, \ - z_moved_shm_provider_t : z_shm_provider_drop, \ z_moved_slice_t : z_slice_drop, \ - z_moved_source_info_t : z_source_info_drop, \ z_moved_string_array_t : z_string_array_drop, \ z_moved_string_t : z_string_drop, \ z_moved_subscriber_t : z_subscriber_drop, \ z_moved_task_t : z_task_drop, \ - zc_moved_closure_log_t : zc_closure_log_drop, \ - zc_moved_closure_matching_status_t : zc_closure_matching_status_drop, \ - zc_moved_liveliness_token_t : zc_liveliness_token_drop, \ - zc_moved_matching_listener_t : zc_publisher_matching_listener_drop, \ - zc_moved_shm_client_list_t : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t : ze_querying_subscriber_drop \ + zc_moved_closure_log_t : zc_closure_log_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ - z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -182,7 +131,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ - z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ z_owned_query_t : z_query_move, \ @@ -194,36 +142,21 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ - z_owned_shm_client_t : z_shm_client_move, \ - z_owned_shm_client_storage_t : z_shm_client_storage_move, \ - z_owned_shm_t : z_shm_move, \ - z_owned_shm_mut_t : z_shm_mut_move, \ - z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ - z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ - zc_owned_closure_log_t : zc_closure_log_move, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ - zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ + zc_owned_closure_log_t : zc_closure_log_move \ )(&this_) #define z_null(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ - z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -232,7 +165,6 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ - z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -244,34 +176,19 @@ static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owne z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ - z_owned_shm_client_t* : z_shm_client_null, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ - z_owned_shm_mut_t* : z_shm_mut_null, \ - z_owned_shm_t* : z_shm_null, \ - z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ - z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ - zc_owned_matching_listener_t* : zc_matching_listener_null, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ - ze_owned_publication_cache_t* : ze_publication_cache_null, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ + zc_owned_closure_log_t* : zc_closure_log_null \ )(this_) -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { *this_ = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { *closure_ = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { *closure_ = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { *closure_ = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t x) { *closure_ = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -280,7 +197,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } @@ -292,36 +208,21 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { *closure_ = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t x) { *closure_ = *x._ptr; zc_closure_matching_status_null(x._ptr); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } #define z_take(this_, x) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ - z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -330,7 +231,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ - z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ z_owned_query_t* : z_query_take, \ @@ -342,36 +242,21 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ - z_owned_shm_client_t* : z_shm_client_take, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ - z_owned_shm_t* : z_shm_take, \ - z_owned_shm_mut_t* : z_shm_mut_take, \ - z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ - z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ - zc_owned_closure_log_t* : zc_closure_log_take, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ + zc_owned_closure_log_t* : zc_closure_log_take \ )(this_, x) #define z_check(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ - z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -380,7 +265,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ - z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -392,24 +276,12 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ - z_owned_shm_t : z_shm_check, \ - z_owned_shm_client_t : z_shm_client_check, \ - z_owned_shm_client_storage_t : z_shm_client_storage_check, \ - z_owned_shm_mut_t : z_shm_mut_check, \ - z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ - z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ - zc_owned_liveliness_token_t : zc_liveliness_token_check, \ - zc_owned_matching_listener_t : zc_matching_listener_check, \ - zc_owned_shm_client_list_t : zc_shm_client_list_check, \ - ze_owned_publication_cache_t : ze_publication_cache_check, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ + zc_owned_closure_log_t : zc_closure_log_check \ )(&this_) #define z_call(closure, hello) \ @@ -417,9 +289,7 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call, \ - const z_loaned_closure_zid_t* : z_closure_zid_call, \ - const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call \ )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ @@ -447,14 +317,11 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t #else // #ifndef __cplusplus -static inline z_moved_alloc_layout_t z_alloc_layout_move(z_owned_alloc_layout_t* x) { return z_moved_alloc_layout_t{x}; } static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return z_moved_bytes_t{x}; } -static inline z_moved_chunk_alloc_result_t z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return z_moved_chunk_alloc_result_t{x}; } static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return z_moved_closure_hello_t{x}; } static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return z_moved_closure_query_t{x}; } static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return z_moved_closure_reply_t{x}; } static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return z_moved_closure_sample_t{x}; } -static inline z_moved_closure_zid_t z_closure_zid_move(z_owned_closure_zid_t* x) { return z_moved_closure_zid_t{x}; } static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return z_moved_condvar_t{x}; } static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return z_moved_config_t{x}; } static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return z_moved_encoding_t{x}; } @@ -463,7 +330,6 @@ static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fif static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return z_moved_fifo_handler_sample_t{x}; } static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_hello_t{x}; } static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } -static inline z_moved_memory_layout_t z_memory_layout_move(z_owned_memory_layout_t* x) { return z_moved_memory_layout_t{x}; } static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } @@ -475,35 +341,20 @@ static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_rin static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return z_moved_ring_handler_sample_t{x}; } static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return z_moved_sample_t{x}; } static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return z_moved_session_t{x}; } -static inline z_moved_shm_client_t z_shm_client_move(z_owned_shm_client_t* x) { return z_moved_shm_client_t{x}; } -static inline z_moved_shm_client_storage_t z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return z_moved_shm_client_storage_t{x}; } -static inline z_moved_shm_t z_shm_move(z_owned_shm_t* x) { return z_moved_shm_t{x}; } -static inline z_moved_shm_mut_t z_shm_mut_move(z_owned_shm_mut_t* x) { return z_moved_shm_mut_t{x}; } -static inline z_moved_shm_provider_t z_shm_provider_move(z_owned_shm_provider_t* x) { return z_moved_shm_provider_t{x}; } static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return z_moved_slice_t{x}; } -static inline z_moved_source_info_t z_source_info_move(z_owned_source_info_t* x) { return z_moved_source_info_t{x}; } static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return z_moved_string_array_t{x}; } static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return z_moved_string_t{x}; } static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return z_moved_subscriber_t{x}; } static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_task_t{x}; } static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } -static inline zc_moved_closure_matching_status_t zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return zc_moved_closure_matching_status_t{x}; } -static inline zc_moved_liveliness_token_t zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return zc_moved_liveliness_token_t{x}; } -static inline zc_moved_matching_listener_t zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return zc_moved_matching_listener_t{x}; } -static inline zc_moved_shm_client_list_t zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return zc_moved_shm_client_list_t{x}; } -static inline ze_moved_publication_cache_t ze_publication_cache_move(ze_owned_publication_cache_t* x) { return ze_moved_publication_cache_t{x}; } -static inline ze_moved_querying_subscriber_t ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return ze_moved_querying_subscriber_t{x}; } -inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; -inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; -inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -512,7 +363,6 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; -inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -523,12 +373,7 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; -inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; -inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; -inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; -inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; -inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -536,10 +381,6 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; -inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; -inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; -inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; -inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -548,20 +389,14 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; -inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; -inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; -inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; -inline void z_drop(z_moved_alloc_layout_t this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; -inline void z_drop(z_moved_chunk_alloc_result_t this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t this_) { z_closure_hello_drop(this_); }; inline void z_drop(z_moved_closure_query_t closure_) { z_closure_query_drop(closure_); }; inline void z_drop(z_moved_closure_reply_t closure_) { z_closure_reply_drop(closure_); }; inline void z_drop(z_moved_closure_sample_t closure_) { z_closure_sample_drop(closure_); }; -inline void z_drop(z_moved_closure_zid_t closure_) { z_closure_zid_drop(closure_); }; inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; @@ -570,7 +405,6 @@ inline void z_drop(z_moved_fifo_handler_reply_t this_) { z_fifo_handler_reply_dr inline void z_drop(z_moved_fifo_handler_sample_t this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_memory_layout_t this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; @@ -582,34 +416,19 @@ inline void z_drop(z_moved_ring_handler_reply_t this_) { z_ring_handler_reply_dr inline void z_drop(z_moved_ring_handler_sample_t this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_shm_client_t this_) { z_shm_client_drop(this_); }; -inline void z_drop(z_moved_shm_client_storage_t this_) { z_shm_client_storage_drop(this_); }; -inline void z_drop(z_moved_shm_t this_) { z_shm_drop(this_); }; -inline void z_drop(z_moved_shm_mut_t this_) { z_shm_mut_drop(this_); }; -inline void z_drop(z_moved_shm_provider_t this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_source_info_t this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t closure_) { zc_closure_log_drop(closure_); }; -inline void z_drop(zc_moved_closure_matching_status_t closure_) { zc_closure_matching_status_drop(closure_); }; -inline void z_drop(zc_moved_liveliness_token_t this_) { zc_liveliness_token_drop(this_); }; -inline z_result_t z_drop(zc_moved_matching_listener_t this_) { return zc_publisher_matching_listener_drop(this_); }; -inline void z_drop(zc_moved_shm_client_list_t this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t this_) { ze_querying_subscriber_drop(this_); }; -inline z_moved_alloc_layout_t z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; -inline z_moved_chunk_alloc_result_t z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; -inline z_moved_closure_zid_t z_move(z_owned_closure_zid_t& closure_) { return z_closure_zid_move(&closure_); }; inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -618,7 +437,6 @@ inline z_moved_fifo_handler_reply_t z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_memory_layout_t z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; @@ -630,34 +448,19 @@ inline z_moved_ring_handler_reply_t z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_shm_client_t z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; -inline z_moved_shm_client_storage_t z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; -inline z_moved_shm_t z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; -inline z_moved_shm_mut_t z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; -inline z_moved_shm_provider_t z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_source_info_t z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; -inline zc_moved_closure_matching_status_t z_move(zc_owned_closure_matching_status_t& closure_) { return zc_closure_matching_status_move(&closure_); }; -inline zc_moved_liveliness_token_t z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; -inline zc_moved_matching_listener_t z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; -inline zc_moved_shm_client_list_t z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; -inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; -inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; -inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; @@ -666,7 +469,6 @@ inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_n inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; -inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; @@ -678,33 +480,18 @@ inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_n inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; -inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; -inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; -inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; -inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; -inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; -inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; -inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; -inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; -inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; -inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; -inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; -inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { *this_ = *x._ptr; z_alloc_layout_null(x._ptr); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { *this_ = *x._ptr; z_chunk_alloc_result_null(x._ptr); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { *this_ = *x._ptr; z_closure_hello_null(x._ptr); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { *closure_ = *x._ptr; z_closure_query_null(x._ptr); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { *closure_ = *x._ptr; z_closure_reply_null(x._ptr); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { *closure_ = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t x) { *closure_ = *x._ptr; z_closure_zid_null(x._ptr); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } @@ -713,7 +500,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { *this_ = *x._ptr; z_memory_layout_null(x._ptr); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } @@ -725,36 +511,18 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { *this_ = *x._ptr; z_shm_client_null(x._ptr); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { *this_ = *x._ptr; z_shm_client_storage_null(x._ptr); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t x) { *this_ = *x._ptr; z_shm_null(x._ptr); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { *this_ = *x._ptr; z_shm_mut_null(x._ptr); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { *this_ = *x._ptr; z_shm_provider_null(x._ptr); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { *this_ = *x._ptr; z_source_info_null(x._ptr); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { *closure_ = *x._ptr; zc_closure_log_null(x._ptr); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t x) { *closure_ = *x._ptr; zc_closure_matching_status_null(x._ptr); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { *this_ = *x._ptr; zc_liveliness_token_null(x._ptr); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { *this_ = *x._ptr; zc_matching_listener_null(x._ptr); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { *this_ = *x._ptr; zc_shm_client_list_null(x._ptr); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { *this_ = *x._ptr; ze_publication_cache_null(x._ptr); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { *this_ = *x._ptr; ze_querying_subscriber_null(x._ptr); } -inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t x) { - z_alloc_layout_take(this_, x); -}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { z_bytes_take(this_, x); }; -inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t x) { - z_chunk_alloc_result_take(this_, x); -}; inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { z_closure_hello_take(this_, x); }; @@ -767,9 +535,6 @@ inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { z_closure_sample_take(closure_, x); }; -inline void z_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t x) { - z_closure_zid_take(closure_, x); -}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { z_condvar_take(this_, x); }; @@ -794,9 +559,6 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t x) { - z_memory_layout_take(this_, x); -}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { z_mutex_take(this_, x); }; @@ -830,27 +592,9 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t x) { z_session_take(this_, x); }; -inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t x) { - z_shm_client_take(this_, x); -}; -inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t x) { - z_shm_client_storage_take(this_, x); -}; -inline void z_take(z_owned_shm_t* this_, z_moved_shm_t x) { - z_shm_take(this_, x); -}; -inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t x) { - z_shm_mut_take(this_, x); -}; -inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t x) { - z_shm_provider_take(this_, x); -}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t x) { - z_source_info_take(this_, x); -}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { z_string_array_take(this_, x); }; @@ -866,34 +610,13 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { zc_closure_log_take(closure_, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t x) { - zc_closure_matching_status_take(closure_, x); -}; -inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t x) { - zc_liveliness_token_take(this_, x); -}; -inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t x) { - zc_publisher_matching_listener_take(this_, x); -}; -inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t x) { - zc_shm_client_list_take(this_, x); -}; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t x) { - ze_querying_subscriber_take(this_, x); -}; -inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; -inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -902,7 +625,6 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; -inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -914,24 +636,12 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; -inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; -inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; -inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; -inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; -inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; -inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; -inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; -inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; -inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; -inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; -inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; -inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { @@ -946,12 +656,6 @@ inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; -inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { - z_closure_zid_call(closure, z_id); -}; -inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { - zc_closure_matching_status_call(closure, mathing_status); -}; inline void z_closure( @@ -990,24 +694,6 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; -inline void z_closure( - z_owned_closure_zid_t* closure, - void (*call)(const z_id_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; -inline void z_closure( - zc_owned_closure_matching_status_t* closure, - void (*call)(const zc_matching_status_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -1051,12 +737,8 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -1065,8 +747,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -1083,8 +763,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -1105,18 +783,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -1125,14 +793,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; #endif // #ifndef __cplusplus diff --git a/src/commons.rs b/src/commons.rs index 66467377b..fcc88639a 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -12,12 +12,9 @@ // ZettaScale Zenoh team, // -#[cfg(feature = "unstable")] use crate::transmute::TakeRustType; - -use std::{mem::MaybeUninit, ptr::null}; - use libc::c_ulong; +use std::{mem::MaybeUninit, ptr::null}; use zenoh::{ qos::{CongestionControl, Priority}, query::{ConsolidationMode, QueryTarget}, @@ -155,7 +152,10 @@ pub extern "C" fn z_sample_attachment(this_: &z_loaned_sample_t) -> *const z_loa /// Returns the sample source_info. #[no_mangle] pub extern "C" fn z_sample_source_info(this_: &z_loaned_sample_t) -> &z_loaned_source_info_t { - this_.as_rust_type_ref().source_info().as_loaned_c_type_ref() + this_ + .as_rust_type_ref() + .source_info() + .as_loaned_c_type_ref() } /// Constructs an owned shallow copy of the sample (i.e. all modficiations applied to the copy, might be visible in the original) in provided uninitilized memory location. @@ -196,7 +196,8 @@ pub extern "C" fn z_sample_check(this_: &z_owned_sample_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_sample_loan(this_: &z_owned_sample_t) -> &z_loaned_sample_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() From d5f48a3c02fb5d19a55c9ab10f42a321f6ead26f Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 13:42:53 +0200 Subject: [PATCH 082/397] generic functions update --- build.rs | 10 +- include/zenoh_macros.h | 366 ++++++++++++++++++++--------------------- 2 files changed, 188 insertions(+), 188 deletions(-) diff --git a/build.rs b/build.rs index d2193e070..d61c09c5a 100644 --- a/build.rs +++ b/build.rs @@ -1150,10 +1150,10 @@ pub fn make_move_take_signatures( { let (prefix, _, semantic, postfix) = split_type_name(arg_type); let z_owned_type = format!("{}_{}_{}_{}*", prefix, "owned", semantic, postfix); - let z_moved_type = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); + let z_moved_type = format!("{}_{}_{}_{}*", prefix, "moved", semantic, postfix); let move_f = FunctionSignature::new( semantic, - arg_type, + &z_moved_type, func_name_prefix.to_string() + "_move", vec![FuncArg::new(&z_owned_type, arg_name)], ); @@ -1414,7 +1414,7 @@ pub fn generate_take_functions(macro_func: &[FunctionSignature]) -> String { for sig in macro_func { let (prefix, _, semantic, _) = split_type_name(&sig.args[0].typename.typename); out += &format!( - "static inline void {}({} {}, {} {}) {{ *{} = *{}._ptr; {}_{}_null({}._ptr); }}\n", + "static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_{}_null(&{}->_this); }}\n", sig.func_name, sig.args[0].typename.typename, sig.args[0].name, @@ -1434,7 +1434,7 @@ pub fn generate_move_functions_c(macro_func: &[FunctionSignature]) -> String { let mut out = String::new(); for sig in macro_func { out += &format!( - "static inline {} {}({} x) {{ return ({}){{x}}; }}\n", + "static inline {} {}({} x) {{ return ({})(x); }}\n", sig.return_type.typename, sig.func_name, sig.args[0].typename.typename, @@ -1448,7 +1448,7 @@ pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String { let mut out = String::new(); for sig in macro_func { out += &format!( - "static inline {} {}({} x) {{ return {}{{x}}; }}\n", + "static inline {} {}({} x) {{ return reinterpret_cast<{}>(x); }}\n", sig.return_type.typename, sig.func_name, sig.args[0].typename.typename, diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 587b96126..78426c553 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,36 +4,36 @@ #ifndef __cplusplus -static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t){x}; } -static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t){x}; } -static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t){x}; } -static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t){x}; } -static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t){x}; } -static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t){x}; } -static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return (z_moved_config_t){x}; } -static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t){x}; } -static inline z_moved_fifo_handler_query_t z_fifo_handler_query_move(z_owned_fifo_handler_query_t* x) { return (z_moved_fifo_handler_query_t){x}; } -static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fifo_handler_reply_t* x) { return (z_moved_fifo_handler_reply_t){x}; } -static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t){x}; } -static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t){x}; } -static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t){x}; } -static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t){x}; } -static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t){x}; } -static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return (z_moved_query_t){x}; } -static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t){x}; } -static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t){x}; } -static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return (z_moved_reply_err_t){x}; } -static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return (z_moved_ring_handler_query_t){x}; } -static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_ring_handler_reply_t* x) { return (z_moved_ring_handler_reply_t){x}; } -static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t){x}; } -static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t){x}; } -static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return (z_moved_session_t){x}; } -static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t){x}; } -static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t){x}; } -static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return (z_moved_string_t){x}; } -static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t){x}; } -static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return (z_moved_task_t){x}; } -static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t){x}; } +static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t*)(x); } +static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t*)(x); } +static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t*)(x); } +static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t*)(x); } +static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t*)(x); } +static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t*)(x); } +static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return (z_moved_config_t*)(x); } +static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t*)(x); } +static inline z_moved_fifo_handler_query_t* z_fifo_handler_query_move(z_owned_fifo_handler_query_t* x) { return (z_moved_fifo_handler_query_t*)(x); } +static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fifo_handler_reply_t* x) { return (z_moved_fifo_handler_reply_t*)(x); } +static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t*)(x); } +static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t*)(x); } +static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t*)(x); } +static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t*)(x); } +static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t*)(x); } +static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return (z_moved_query_t*)(x); } +static inline z_moved_queryable_t* z_queryable_move(z_owned_queryable_t* x) { return (z_moved_queryable_t*)(x); } +static inline z_moved_reply_t* z_reply_move(z_owned_reply_t* x) { return (z_moved_reply_t*)(x); } +static inline z_moved_reply_err_t* z_reply_err_move(z_owned_reply_err_t* x) { return (z_moved_reply_err_t*)(x); } +static inline z_moved_ring_handler_query_t* z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return (z_moved_ring_handler_query_t*)(x); } +static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ring_handler_reply_t* x) { return (z_moved_ring_handler_reply_t*)(x); } +static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t*)(x); } +static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t*)(x); } +static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return (z_moved_session_t*)(x); } +static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t*)(x); } +static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t*)(x); } +static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return (z_moved_string_t*)(x); } +static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t*)(x); } +static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return (z_moved_task_t*)(x); } +static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t*)(x); } #define z_loan(this_) \ @@ -184,36 +184,36 @@ static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* zc_owned_closure_log_t* : zc_closure_log_null \ )(this_) -static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { *this_ = *x._ptr; z_closure_hello_null(x._ptr); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { *closure_ = *x._ptr; z_closure_query_null(x._ptr); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { *closure_ = *x._ptr; z_closure_reply_null(x._ptr); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { *closure_ = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } -static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } -static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } -static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t x) { *this_ = *x._ptr; z_fifo_handler_query_null(x._ptr); } -static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t x) { *this_ = *x._ptr; z_fifo_handler_reply_null(x._ptr); } -static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } -static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } -static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } -static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } -static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } -static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } -static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t x) { *this_ = *x._ptr; z_ring_handler_reply_null(x._ptr); } -static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } -static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } -static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } -static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } -static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } -static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { *closure_ = *x._ptr; zc_closure_log_null(x._ptr); } +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_fifo_handler_query_null(&x->_this); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_fifo_handler_reply_null(&x->_this); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_queryable_null(&x->_this); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_reply_null(&x->_this); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_reply_err_null(&x->_this); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_ring_handler_query_null(&x->_this); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_ring_handler_reply_null(&x->_this); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } #define z_take(this_, x) \ @@ -317,36 +317,36 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move #else // #ifndef __cplusplus -static inline z_moved_bytes_t z_bytes_move(z_owned_bytes_t* x) { return z_moved_bytes_t{x}; } -static inline z_moved_closure_hello_t z_closure_hello_move(z_owned_closure_hello_t* x) { return z_moved_closure_hello_t{x}; } -static inline z_moved_closure_query_t z_closure_query_move(z_owned_closure_query_t* x) { return z_moved_closure_query_t{x}; } -static inline z_moved_closure_reply_t z_closure_reply_move(z_owned_closure_reply_t* x) { return z_moved_closure_reply_t{x}; } -static inline z_moved_closure_sample_t z_closure_sample_move(z_owned_closure_sample_t* x) { return z_moved_closure_sample_t{x}; } -static inline z_moved_condvar_t z_condvar_move(z_owned_condvar_t* x) { return z_moved_condvar_t{x}; } -static inline z_moved_config_t z_config_move(z_owned_config_t* x) { return z_moved_config_t{x}; } -static inline z_moved_encoding_t z_encoding_move(z_owned_encoding_t* x) { return z_moved_encoding_t{x}; } -static inline z_moved_fifo_handler_query_t z_fifo_handler_query_move(z_owned_fifo_handler_query_t* x) { return z_moved_fifo_handler_query_t{x}; } -static inline z_moved_fifo_handler_reply_t z_fifo_handler_reply_move(z_owned_fifo_handler_reply_t* x) { return z_moved_fifo_handler_reply_t{x}; } -static inline z_moved_fifo_handler_sample_t z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return z_moved_fifo_handler_sample_t{x}; } -static inline z_moved_hello_t z_hello_move(z_owned_hello_t* x) { return z_moved_hello_t{x}; } -static inline z_moved_keyexpr_t z_keyexpr_move(z_owned_keyexpr_t* x) { return z_moved_keyexpr_t{x}; } -static inline z_moved_mutex_t z_mutex_move(z_owned_mutex_t* x) { return z_moved_mutex_t{x}; } -static inline z_moved_publisher_t z_publisher_move(z_owned_publisher_t* x) { return z_moved_publisher_t{x}; } -static inline z_moved_query_t z_query_move(z_owned_query_t* x) { return z_moved_query_t{x}; } -static inline z_moved_queryable_t z_queryable_move(z_owned_queryable_t* x) { return z_moved_queryable_t{x}; } -static inline z_moved_reply_t z_reply_move(z_owned_reply_t* x) { return z_moved_reply_t{x}; } -static inline z_moved_reply_err_t z_reply_err_move(z_owned_reply_err_t* x) { return z_moved_reply_err_t{x}; } -static inline z_moved_ring_handler_query_t z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return z_moved_ring_handler_query_t{x}; } -static inline z_moved_ring_handler_reply_t z_ring_handler_reply_move(z_owned_ring_handler_reply_t* x) { return z_moved_ring_handler_reply_t{x}; } -static inline z_moved_ring_handler_sample_t z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return z_moved_ring_handler_sample_t{x}; } -static inline z_moved_sample_t z_sample_move(z_owned_sample_t* x) { return z_moved_sample_t{x}; } -static inline z_moved_session_t z_session_move(z_owned_session_t* x) { return z_moved_session_t{x}; } -static inline z_moved_slice_t z_slice_move(z_owned_slice_t* x) { return z_moved_slice_t{x}; } -static inline z_moved_string_array_t z_string_array_move(z_owned_string_array_t* x) { return z_moved_string_array_t{x}; } -static inline z_moved_string_t z_string_move(z_owned_string_t* x) { return z_moved_string_t{x}; } -static inline z_moved_subscriber_t z_subscriber_move(z_owned_subscriber_t* x) { return z_moved_subscriber_t{x}; } -static inline z_moved_task_t z_task_move(z_owned_task_t* x) { return z_moved_task_t{x}; } -static inline zc_moved_closure_log_t zc_closure_log_move(zc_owned_closure_log_t* x) { return zc_moved_closure_log_t{x}; } +static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return reinterpret_cast(x); } +static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return reinterpret_cast(x); } +static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return reinterpret_cast(x); } +static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return reinterpret_cast(x); } +static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return reinterpret_cast(x); } +static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return reinterpret_cast(x); } +static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return reinterpret_cast(x); } +static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return reinterpret_cast(x); } +static inline z_moved_fifo_handler_query_t* z_fifo_handler_query_move(z_owned_fifo_handler_query_t* x) { return reinterpret_cast(x); } +static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fifo_handler_reply_t* x) { return reinterpret_cast(x); } +static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return reinterpret_cast(x); } +static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return reinterpret_cast(x); } +static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return reinterpret_cast(x); } +static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return reinterpret_cast(x); } +static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return reinterpret_cast(x); } +static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return reinterpret_cast(x); } +static inline z_moved_queryable_t* z_queryable_move(z_owned_queryable_t* x) { return reinterpret_cast(x); } +static inline z_moved_reply_t* z_reply_move(z_owned_reply_t* x) { return reinterpret_cast(x); } +static inline z_moved_reply_err_t* z_reply_err_move(z_owned_reply_err_t* x) { return reinterpret_cast(x); } +static inline z_moved_ring_handler_query_t* z_ring_handler_query_move(z_owned_ring_handler_query_t* x) { return reinterpret_cast(x); } +static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ring_handler_reply_t* x) { return reinterpret_cast(x); } +static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return reinterpret_cast(x); } +static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return reinterpret_cast(x); } +static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return reinterpret_cast(x); } +static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return reinterpret_cast(x); } +static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return reinterpret_cast(x); } +static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return reinterpret_cast(x); } +static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return reinterpret_cast(x); } +static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return reinterpret_cast(x); } +static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return reinterpret_cast(x); } @@ -424,36 +424,36 @@ inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t closure_) { zc_closure_log_drop(closure_); }; -inline z_moved_bytes_t z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; -inline z_moved_closure_hello_t z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; -inline z_moved_closure_query_t z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; -inline z_moved_closure_reply_t z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; -inline z_moved_closure_sample_t z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; -inline z_moved_condvar_t z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; -inline z_moved_config_t z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; -inline z_moved_encoding_t z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; -inline z_moved_fifo_handler_query_t z_move(z_owned_fifo_handler_query_t& this_) { return z_fifo_handler_query_move(&this_); }; -inline z_moved_fifo_handler_reply_t z_move(z_owned_fifo_handler_reply_t& this_) { return z_fifo_handler_reply_move(&this_); }; -inline z_moved_fifo_handler_sample_t z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; -inline z_moved_hello_t z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; -inline z_moved_keyexpr_t z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_mutex_t z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; -inline z_moved_publisher_t z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; -inline z_moved_query_t z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; -inline z_moved_queryable_t z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; -inline z_moved_reply_t z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; -inline z_moved_reply_err_t z_move(z_owned_reply_err_t& this_) { return z_reply_err_move(&this_); }; -inline z_moved_ring_handler_query_t z_move(z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_move(&this_); }; -inline z_moved_ring_handler_reply_t z_move(z_owned_ring_handler_reply_t& this_) { return z_ring_handler_reply_move(&this_); }; -inline z_moved_ring_handler_sample_t z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; -inline z_moved_sample_t z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; -inline z_moved_session_t z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_slice_t z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_string_array_t z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; -inline z_moved_string_t z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; -inline z_moved_subscriber_t z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; -inline z_moved_task_t z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; -inline zc_moved_closure_log_t z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; +inline z_moved_bytes_t* z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; +inline z_moved_closure_hello_t* z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; +inline z_moved_closure_query_t* z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; +inline z_moved_closure_reply_t* z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; +inline z_moved_closure_sample_t* z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; +inline z_moved_condvar_t* z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; +inline z_moved_config_t* z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; +inline z_moved_encoding_t* z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; +inline z_moved_fifo_handler_query_t* z_move(z_owned_fifo_handler_query_t& this_) { return z_fifo_handler_query_move(&this_); }; +inline z_moved_fifo_handler_reply_t* z_move(z_owned_fifo_handler_reply_t& this_) { return z_fifo_handler_reply_move(&this_); }; +inline z_moved_fifo_handler_sample_t* z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; +inline z_moved_hello_t* z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; +inline z_moved_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; +inline z_moved_mutex_t* z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; +inline z_moved_publisher_t* z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; +inline z_moved_query_t* z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; +inline z_moved_queryable_t* z_move(z_owned_queryable_t& this_) { return z_queryable_move(&this_); }; +inline z_moved_reply_t* z_move(z_owned_reply_t& this_) { return z_reply_move(&this_); }; +inline z_moved_reply_err_t* z_move(z_owned_reply_err_t& this_) { return z_reply_err_move(&this_); }; +inline z_moved_ring_handler_query_t* z_move(z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_move(&this_); }; +inline z_moved_ring_handler_reply_t* z_move(z_owned_ring_handler_reply_t& this_) { return z_ring_handler_reply_move(&this_); }; +inline z_moved_ring_handler_sample_t* z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; +inline z_moved_sample_t* z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; +inline z_moved_session_t* z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; +inline z_moved_slice_t* z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; +inline z_moved_string_array_t* z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; +inline z_moved_string_t* z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; +inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; +inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; +inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; @@ -487,127 +487,127 @@ inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; -static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { *this_ = *x._ptr; z_bytes_null(x._ptr); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { *this_ = *x._ptr; z_closure_hello_null(x._ptr); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { *closure_ = *x._ptr; z_closure_query_null(x._ptr); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { *closure_ = *x._ptr; z_closure_reply_null(x._ptr); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { *closure_ = *x._ptr; z_closure_sample_null(x._ptr); } -static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { *this_ = *x._ptr; z_condvar_null(x._ptr); } -static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t x) { *this_ = *x._ptr; z_config_null(x._ptr); } -static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { *this_ = *x._ptr; z_encoding_null(x._ptr); } -static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t x) { *this_ = *x._ptr; z_fifo_handler_query_null(x._ptr); } -static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t x) { *this_ = *x._ptr; z_fifo_handler_reply_null(x._ptr); } -static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { *this_ = *x._ptr; z_fifo_handler_sample_null(x._ptr); } -static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t x) { *this_ = *x._ptr; z_hello_null(x._ptr); } -static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { *this_ = *x._ptr; z_keyexpr_null(x._ptr); } -static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { *this_ = *x._ptr; z_mutex_null(x._ptr); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { *this_ = *x._ptr; z_publisher_null(x._ptr); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t x) { *this_ = *x._ptr; z_query_null(x._ptr); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { *this_ = *x._ptr; z_queryable_null(x._ptr); } -static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t x) { *this_ = *x._ptr; z_reply_null(x._ptr); } -static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { *this_ = *x._ptr; z_reply_err_null(x._ptr); } -static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { *this_ = *x._ptr; z_ring_handler_query_null(x._ptr); } -static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t x) { *this_ = *x._ptr; z_ring_handler_reply_null(x._ptr); } -static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { *this_ = *x._ptr; z_ring_handler_sample_null(x._ptr); } -static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t x) { *this_ = *x._ptr; z_sample_null(x._ptr); } -static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t x) { *this_ = *x._ptr; z_session_null(x._ptr); } -static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t x) { *this_ = *x._ptr; z_slice_null(x._ptr); } -static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { *this_ = *x._ptr; z_string_array_null(x._ptr); } -static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t x) { *this_ = *x._ptr; z_string_null(x._ptr); } -static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { *this_ = *x._ptr; z_subscriber_null(x._ptr); } -static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t x) { *this_ = *x._ptr; z_task_null(x._ptr); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { *closure_ = *x._ptr; zc_closure_log_null(x._ptr); } - - - -inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t x) { +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_fifo_handler_query_null(&x->_this); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_fifo_handler_reply_null(&x->_this); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_queryable_null(&x->_this); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_reply_null(&x->_this); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_reply_err_null(&x->_this); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_ring_handler_query_null(&x->_this); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_ring_handler_reply_null(&x->_this); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } + + + +inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { z_bytes_take(this_, x); }; -inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t x) { +inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { z_closure_hello_take(this_, x); }; -inline void z_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t x) { +inline void z_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { z_closure_query_take(closure_, x); }; -inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t x) { +inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { z_closure_reply_take(closure_, x); }; -inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t x) { +inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { z_closure_sample_take(closure_, x); }; -inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t x) { +inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { z_condvar_take(this_, x); }; -inline void z_take(z_owned_config_t* this_, z_moved_config_t x) { +inline void z_take(z_owned_config_t* this_, z_moved_config_t* x) { z_config_take(this_, x); }; -inline void z_take(z_owned_encoding_t* this_, z_moved_encoding_t x) { +inline void z_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { z_encoding_take(this_, x); }; -inline void z_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t x) { +inline void z_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { z_fifo_handler_query_take(this_, x); }; -inline void z_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t x) { +inline void z_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { z_fifo_handler_reply_take(this_, x); }; -inline void z_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t x) { +inline void z_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { z_fifo_handler_sample_take(this_, x); }; -inline void z_take(z_owned_hello_t* this_, z_moved_hello_t x) { +inline void z_take(z_owned_hello_t* this_, z_moved_hello_t* x) { z_hello_take(this_, x); }; -inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t x) { +inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t x) { +inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { z_mutex_take(this_, x); }; -inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t x) { +inline void z_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { z_publisher_take(this_, x); }; -inline void z_take(z_owned_query_t* this_, z_moved_query_t x) { +inline void z_take(z_owned_query_t* this_, z_moved_query_t* x) { z_query_take(this_, x); }; -inline void z_take(z_owned_queryable_t* this_, z_moved_queryable_t x) { +inline void z_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { z_queryable_take(this_, x); }; -inline void z_take(z_owned_reply_t* this_, z_moved_reply_t x) { +inline void z_take(z_owned_reply_t* this_, z_moved_reply_t* x) { z_reply_take(this_, x); }; -inline void z_take(z_owned_reply_err_t* this_, z_moved_reply_err_t x) { +inline void z_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { z_reply_err_take(this_, x); }; -inline void z_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t x) { +inline void z_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { z_ring_handler_query_take(this_, x); }; -inline void z_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t x) { +inline void z_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { z_ring_handler_reply_take(this_, x); }; -inline void z_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t x) { +inline void z_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { z_ring_handler_sample_take(this_, x); }; -inline void z_take(z_owned_sample_t* this_, z_moved_sample_t x) { +inline void z_take(z_owned_sample_t* this_, z_moved_sample_t* x) { z_sample_take(this_, x); }; -inline void z_take(z_owned_session_t* this_, z_moved_session_t x) { +inline void z_take(z_owned_session_t* this_, z_moved_session_t* x) { z_session_take(this_, x); }; -inline void z_take(z_owned_slice_t* this_, z_moved_slice_t x) { +inline void z_take(z_owned_slice_t* this_, z_moved_slice_t* x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t x) { +inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { z_string_array_take(this_, x); }; -inline void z_take(z_owned_string_t* this_, z_moved_string_t x) { +inline void z_take(z_owned_string_t* this_, z_moved_string_t* x) { z_string_take(this_, x); }; -inline void z_take(z_owned_subscriber_t* this_, z_moved_subscriber_t x) { +inline void z_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { z_subscriber_take(this_, x); }; -inline void z_take(z_owned_task_t* this_, z_moved_task_t x) { +inline void z_take(z_owned_task_t* this_, z_moved_task_t* x) { z_task_take(this_, x); }; -inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t x) { +inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { zc_closure_log_take(closure_, x); }; From f64b0b81d8925dc1ada68df755f6384956f2e230 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 14:32:15 +0200 Subject: [PATCH 083/397] drop generic fix --- build.rs | 3 +- include/zenoh_commons.h | 516 +++++++++++++++------------------------- include/zenoh_macros.h | 474 ++++++++++++++++++++++++++++++------ tests/z_api_shm_test.c | 8 +- 4 files changed, 603 insertions(+), 398 deletions(-) diff --git a/build.rs b/build.rs index d61c09c5a..711a5f700 100644 --- a/build.rs +++ b/build.rs @@ -1230,11 +1230,12 @@ pub fn find_drop_functions(path_in: &str) -> Vec { .collect::>() .join(" "); let (_, _, semantic, _) = split_type_name(arg_type); + let arg_type = arg_type.to_string() + "*"; let f = FunctionSignature::new( semantic, return_type.as_str(), func_name.to_string(), - vec![FuncArg::new(arg_type, arg_name)], + vec![FuncArg::new(&arg_type, arg_name)], ); res.push(f); } diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 4497f0c5e..25e2b3f94 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,26 +16,6 @@ #define ALIGN(n) #define ZENOHC_API #endif -/** - * Allocation errors - * - * - **NEED_DEFRAGMENT**: defragmentation needed - * - **OUT_OF_MEMORY**: the provider is out of memory - * - **OTHER**: other error - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef enum z_alloc_error_t { -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_NEED_DEFRAGMENT, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_OUT_OF_MEMORY, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_ALLOC_ERROR_OTHER, -#endif -} z_alloc_error_t; -#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -96,22 +76,6 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif -/** - * Layouting errors - * - * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect - * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef enum z_layout_error_t { -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) - Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, -#endif -} z_layout_error_t; -#endif /** * The priority of zenoh messages. */ @@ -266,47 +230,10 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_alloc_result_t { - z_owned_shm_mut_t buf; - enum z_alloc_error_t error; -} z_buf_alloc_result_t; -#endif +typedef struct z_moved_alloc_layout_t { + struct z_owned_alloc_layout_t _this; +} z_moved_alloc_layout_t; typedef int8_t z_result_t; -/** - * An AllocAlignment. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_alloc_alignment_t { - uint8_t pow; -} z_alloc_alignment_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_data_t { - void *ptr; -} zc_threadsafe_context_data_t; -#endif -/** - * A tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a thread-safe context - the associated callbacks may be executed concurrently with the same - * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be - * thread-safe. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_threadsafe_context_t { - struct zc_threadsafe_context_data_t context; - void (*delete_fn)(void*); -} zc_threadsafe_context_t; -#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t _this; } z_moved_bytes_t; @@ -316,37 +243,15 @@ typedef struct z_moved_slice_t { typedef struct z_moved_string_t { struct z_owned_string_t _this; } z_moved_string_t; -/** - * Unique segment identifier - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_segment_id_t; -#endif -/** - * Chunk id within it's segment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef uint32_t z_chunk_id_t; -#endif -/** - * A ChunkDescriptor - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_chunk_descriptor_t { - z_segment_id_t segment; - z_chunk_id_t chunk; - size_t len; -} z_chunk_descriptor_t; -#endif -/** - * An AllocatedChunk - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_allocated_chunk_t { - struct z_chunk_descriptor_t descriptpr; - void *data; -} z_allocated_chunk_t; -#endif +typedef struct z_moved_shm_t { + struct z_owned_shm_t _this; +} z_moved_shm_t; +typedef struct z_moved_shm_mut_t { + struct z_owned_shm_mut_t _this; +} z_moved_shm_mut_t; +typedef struct z_moved_chunk_alloc_result_t { + struct z_owned_chunk_alloc_result_t _this; +} z_moved_chunk_alloc_result_t; /** * Monotonic clock */ @@ -497,7 +402,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const z_id_t *z_id, void *context); + void (*call)(const struct z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -608,6 +513,9 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; +typedef struct z_moved_source_info_t { + struct z_owned_source_info_t _this; +} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -656,7 +564,7 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. @@ -673,6 +581,9 @@ typedef struct z_moved_hello_t { typedef struct z_moved_keyexpr_t { struct z_owned_keyexpr_t _this; } z_moved_keyexpr_t; +typedef struct z_moved_memory_layout_t { + struct z_owned_memory_layout_t _this; +} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t _this; } z_moved_mutex_t; @@ -705,7 +616,7 @@ typedef struct z_publisher_put_options_t { /** * The source info for the publication. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. @@ -746,7 +657,7 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to this message. @@ -785,7 +696,7 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -817,7 +728,7 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - z_moved_source_info_t *source_info; + struct z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -868,39 +779,15 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -/** - * A callbacks for ShmSegment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_segment_callbacks_t { - uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); -} zc_shm_segment_callbacks_t; -#endif -/** - * A ShmSegment - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_shm_segment_t { - struct zc_threadsafe_context_t context; - struct zc_shm_segment_callbacks_t callbacks; -} z_shm_segment_t; -#endif -/** - * A callbacks for ShmClient - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_client_callbacks_t { - bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); -} zc_shm_client_callbacks_t; -#endif -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct z_buf_layout_alloc_result_t { - z_owned_shm_mut_t buf; - bool error_is_alloc; - enum z_alloc_error_t alloc_error; - enum z_layout_error_t layout_error; -} z_buf_layout_alloc_result_t; -#endif +typedef struct z_moved_shm_client_t { + struct z_owned_shm_client_t _this; +} z_moved_shm_client_t; +typedef struct z_moved_shm_client_storage_t { + struct z_owned_shm_client_storage_t _this; +} z_moved_shm_client_storage_t; +typedef struct z_moved_shm_provider_t { + struct z_owned_shm_provider_t _this; +} z_moved_shm_provider_t; /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -909,46 +796,6 @@ typedef struct z_buf_layout_alloc_result_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif -/** - * A non-tread-safe droppable context. - * Contexts are idiomatically used in C together with callback interfaces to deliver associated state - * information to each callback. - * - * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same - * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated - * with this context data are not required to be thread-safe. - * - * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can - * still be executed concurrently. The exact behavior depends on user's application, but we strongly - * discourage our users from pinning to some specific behavior unless they _really_ understand what they - * are doing. - * - * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The - * delete_fn is guaranteed to be executed only once at some point of time after the last associated - * callback call returns. - * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't - * be executed. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_context_t { - void *context; - void (*delete_fn)(void*); -} zc_context_t; -#endif -/** - * A callbacks for ShmProviderBackend - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -typedef struct zc_shm_provider_backend_callbacks_t { - void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, - const z_loaned_memory_layout_t *layout, - void *context); - void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); - size_t (*defragment_fn)(void *context); - size_t (*available_fn)(void *context); - void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); -} zc_shm_provider_backend_callbacks_t; -#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t _this; } z_moved_string_array_t; @@ -997,14 +844,6 @@ typedef struct zc_owned_closure_log_t { typedef struct zc_moved_closure_log_t { struct zc_owned_closure_log_t _this; } zc_moved_closure_log_t; -/** - * Loaned closure. - */ -#if defined(UNSTABLE) -typedef struct zc_loaned_closure_matching_status_t { - size_t _0[3]; -} zc_loaned_closure_matching_status_t; -#endif /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -1074,6 +913,15 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif +typedef struct zc_moved_liveliness_token_t { + struct zc_owned_liveliness_token_t _this; +} zc_moved_liveliness_token_t; +typedef struct zc_moved_matching_listener_t { + struct zc_owned_matching_listener_t _this; +} zc_moved_matching_listener_t; +typedef struct zc_moved_shm_client_list_t { + struct zc_owned_shm_client_list_t _this; +} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -1144,6 +992,12 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif +typedef struct ze_moved_publication_cache_t { + struct ze_owned_publication_cache_t _this; +} ze_moved_publication_cache_t; +typedef struct ze_moved_querying_subscriber_t { + struct ze_owned_querying_subscriber_t _this; +} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1163,53 +1017,54 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout); + const struct z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); +ZENOHC_API +const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, - const z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1217,12 +1072,12 @@ z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const z_loaned_alloc_layout_t *layout, + const struct z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1286,7 +1141,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const z_loaned_shm_t **dst); + const struct z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1297,7 +1152,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - z_loaned_shm_t **dst); + struct z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1308,7 +1163,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - z_owned_shm_t *dst); + struct z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1567,7 +1422,9 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_moved_shm_t *shm); +ZENOHC_API +z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, + struct z_moved_shm_t *shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1575,7 +1432,7 @@ ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - z_moved_shm_mut_t *shm); + struct z_moved_shm_mut_t *shm); #endif /** * Serializes a slice by copying. @@ -1643,27 +1500,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); +const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1671,14 +1528,14 @@ void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1803,7 +1660,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const z_id_t *z_id); + const struct z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2498,13 +2355,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); +ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2682,7 +2539,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2718,7 +2575,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2862,13 +2719,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); #endif /** * Extract data from Memory Layout @@ -2877,21 +2734,21 @@ ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t *this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const z_loaned_memory_layout_t *this_); + const struct z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); +const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2899,7 +2756,7 @@ z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2955,21 +2812,21 @@ z_result_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t *config, - const z_loaned_shm_client_storage_t *shm_clients); + const struct z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, - const z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, + const struct z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2999,7 +2856,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3261,7 +3118,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3332,7 +3189,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3518,7 +3375,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3571,26 +3428,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(z_moved_shm_client_t *this_); +ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t *this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(z_owned_shm_client_t *this_, +void z_shm_client_new(struct z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3598,177 +3455,179 @@ void z_shm_client_new(z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, - const z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, + const struct z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); +const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, - const zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, + const struct zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(z_moved_shm_t *this_); +ZENOHC_API void z_shm_drop(struct z_moved_shm_t *this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_moved_shm_mut_t *that); +ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t *that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); +ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(z_moved_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); +ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t *that); +ZENOHC_API +void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, + struct z_moved_shm_t *that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3778,48 +3637,49 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const z_loaned_shm_provider_t *provider, + const struct z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(z_moved_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); +ZENOHC_API +const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, - const z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, + const struct z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3828,7 +3688,7 @@ z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(z_owned_shm_provider_t *this_, +void z_shm_provider_new(struct z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3837,14 +3697,14 @@ void z_shm_provider_new(z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3853,13 +3713,13 @@ void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); +ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3938,46 +3798,47 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(z_moved_source_info_t *this_); +ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t *this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); +ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); +ZENOHC_API +const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(z_owned_source_info_t *this_, - const z_entity_global_id_t *source_id, +z_result_t z_source_info_new(struct z_owned_source_info_t *this_, + const struct z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -4193,7 +4054,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4561,7 +4422,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4598,32 +4459,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t *this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); +const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t *this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t *this_); #endif /** * Returns default value of `zc_locality_t` @@ -4635,13 +4496,13 @@ ZENOHC_API enum zc_locality_t zc_locality_default(void); * Checks the matching listener is for the gravestone state */ #if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); +ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); #endif /** * Constructs an empty matching listener */ #if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); +ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); #endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -4664,7 +4525,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t *callback); #endif @@ -4674,7 +4535,8 @@ z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t * * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_listener_t *this_); +ZENOHC_API +z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *this_); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4682,7 +4544,8 @@ ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_list * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t *this_); +ZENOHC_API +z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t *this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4693,46 +4556,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - z_moved_shm_client_t *client, - zc_loaned_shm_client_list_t *list); + struct z_moved_shm_client_t *client, + struct zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); +const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); +struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4754,7 +4617,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4772,7 +4635,7 @@ z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t *callback, @@ -4782,19 +4645,19 @@ z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4806,13 +4669,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4821,7 +4684,7 @@ ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -4830,13 +4693,13 @@ z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *thi */ #if defined(UNSTABLE) ZENOHC_API -const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); +const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4850,7 +4713,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4858,5 +4721,6 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_ * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t *_this); +ZENOHC_API +z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t *_this); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 78426c553..94577f8ff 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,11 +4,14 @@ #ifndef __cplusplus +static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t*)(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t*)(x); } +static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t*)(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t*)(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t*)(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t*)(x); } static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t*)(x); } +static inline z_moved_closure_zid_t* z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t*)(x); } static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t*)(x); } static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return (z_moved_config_t*)(x); } static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t*)(x); } @@ -17,6 +20,7 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t*)(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t*)(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t*)(x); } +static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t*)(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t*)(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t*)(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return (z_moved_query_t*)(x); } @@ -28,21 +32,36 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t*)(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t*)(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return (z_moved_session_t*)(x); } +static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t*)(x); } +static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t*)(x); } +static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t*)(x); } +static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t*)(x); } +static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t*)(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t*)(x); } +static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t*)(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t*)(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return (z_moved_string_t*)(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t*)(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return (z_moved_task_t*)(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t*)(x); } +static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t*)(x); } +static inline zc_moved_liveliness_token_t* zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t*)(x); } +static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t*)(x); } +static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t*)(x); } +static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t*)(x); } +static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t*)(x); } #define z_loan(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ + z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -51,6 +70,7 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ + z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -61,14 +81,23 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ + z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ + z_owned_shm_t : z_shm_loan, \ + z_owned_shm_mut_t : z_shm_mut_loan, \ + z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ + z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ - zc_owned_closure_log_t : zc_closure_log_loan \ + zc_owned_closure_log_t : zc_closure_log_loan, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ + zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ + zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ )(&this_) #define z_loan_mut(this_) \ @@ -79,50 +108,72 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut \ + z_owned_shm_t : z_shm_loan_mut, \ + z_owned_shm_mut_t : z_shm_mut_loan_mut, \ + z_owned_string_array_t : z_string_array_loan_mut, \ + zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_bytes_t : z_bytes_drop, \ - z_moved_closure_hello_t : z_closure_hello_drop, \ - z_moved_closure_query_t : z_closure_query_drop, \ - z_moved_closure_reply_t : z_closure_reply_drop, \ - z_moved_closure_sample_t : z_closure_sample_drop, \ - z_moved_condvar_t : z_condvar_drop, \ - z_moved_config_t : z_config_drop, \ - z_moved_encoding_t : z_encoding_drop, \ - z_moved_fifo_handler_query_t : z_fifo_handler_query_drop, \ - z_moved_fifo_handler_reply_t : z_fifo_handler_reply_drop, \ - z_moved_fifo_handler_sample_t : z_fifo_handler_sample_drop, \ - z_moved_hello_t : z_hello_drop, \ - z_moved_keyexpr_t : z_keyexpr_drop, \ - z_moved_mutex_t : z_mutex_drop, \ - z_moved_publisher_t : z_publisher_drop, \ - z_moved_query_t : z_query_drop, \ - z_moved_queryable_t : z_queryable_drop, \ - z_moved_reply_t : z_reply_drop, \ - z_moved_reply_err_t : z_reply_err_drop, \ - z_moved_ring_handler_query_t : z_ring_handler_query_drop, \ - z_moved_ring_handler_reply_t : z_ring_handler_reply_drop, \ - z_moved_ring_handler_sample_t : z_ring_handler_sample_drop, \ - z_moved_sample_t : z_sample_drop, \ - z_moved_session_t : z_session_drop, \ - z_moved_slice_t : z_slice_drop, \ - z_moved_string_array_t : z_string_array_drop, \ - z_moved_string_t : z_string_drop, \ - z_moved_subscriber_t : z_subscriber_drop, \ - z_moved_task_t : z_task_drop, \ - zc_moved_closure_log_t : zc_closure_log_drop \ + z_moved_alloc_layout_t* : z_alloc_layout_drop, \ + z_moved_bytes_t* : z_bytes_drop, \ + z_moved_chunk_alloc_result_t* : z_chunk_alloc_result_drop, \ + z_moved_closure_hello_t* : z_closure_hello_drop, \ + z_moved_closure_query_t* : z_closure_query_drop, \ + z_moved_closure_reply_t* : z_closure_reply_drop, \ + z_moved_closure_sample_t* : z_closure_sample_drop, \ + z_moved_closure_zid_t* : z_closure_zid_drop, \ + z_moved_condvar_t* : z_condvar_drop, \ + z_moved_config_t* : z_config_drop, \ + z_moved_encoding_t* : z_encoding_drop, \ + z_moved_fifo_handler_query_t* : z_fifo_handler_query_drop, \ + z_moved_fifo_handler_reply_t* : z_fifo_handler_reply_drop, \ + z_moved_fifo_handler_sample_t* : z_fifo_handler_sample_drop, \ + z_moved_hello_t* : z_hello_drop, \ + z_moved_keyexpr_t* : z_keyexpr_drop, \ + z_moved_memory_layout_t* : z_memory_layout_drop, \ + z_moved_mutex_t* : z_mutex_drop, \ + z_moved_publisher_t* : z_publisher_drop, \ + z_moved_query_t* : z_query_drop, \ + z_moved_queryable_t* : z_queryable_drop, \ + z_moved_reply_t* : z_reply_drop, \ + z_moved_reply_err_t* : z_reply_err_drop, \ + z_moved_ring_handler_query_t* : z_ring_handler_query_drop, \ + z_moved_ring_handler_reply_t* : z_ring_handler_reply_drop, \ + z_moved_ring_handler_sample_t* : z_ring_handler_sample_drop, \ + z_moved_sample_t* : z_sample_drop, \ + z_moved_session_t* : z_session_drop, \ + z_moved_shm_client_t* : z_shm_client_drop, \ + z_moved_shm_client_storage_t* : z_shm_client_storage_drop, \ + z_moved_shm_t* : z_shm_drop, \ + z_moved_shm_mut_t* : z_shm_mut_drop, \ + z_moved_shm_provider_t* : z_shm_provider_drop, \ + z_moved_slice_t* : z_slice_drop, \ + z_moved_source_info_t* : z_source_info_drop, \ + z_moved_string_array_t* : z_string_array_drop, \ + z_moved_string_t* : z_string_drop, \ + z_moved_subscriber_t* : z_subscriber_drop, \ + z_moved_task_t* : z_task_drop, \ + zc_moved_closure_log_t* : zc_closure_log_drop, \ + zc_moved_closure_matching_status_t* : zc_closure_matching_status_drop, \ + zc_moved_liveliness_token_t* : zc_liveliness_token_drop, \ + zc_moved_matching_listener_t* : zc_publisher_matching_listener_drop, \ + zc_moved_shm_client_list_t* : zc_shm_client_list_drop, \ + ze_moved_publication_cache_t* : ze_publication_cache_drop, \ + ze_moved_querying_subscriber_t* : ze_querying_subscriber_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ + z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -131,6 +182,7 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ + z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ z_owned_query_t : z_query_move, \ @@ -142,21 +194,36 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ + z_owned_shm_client_t : z_shm_client_move, \ + z_owned_shm_client_storage_t : z_shm_client_storage_move, \ + z_owned_shm_t : z_shm_move, \ + z_owned_shm_mut_t : z_shm_mut_move, \ + z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ + z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ - zc_owned_closure_log_t : zc_closure_log_move \ + zc_owned_closure_log_t : zc_closure_log_move, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ + zc_owned_liveliness_token_t : zc_liveliness_token_move, \ + zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ + zc_owned_shm_client_list_t : zc_shm_client_list_move, \ + ze_owned_publication_cache_t : ze_publication_cache_move, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ )(&this_) #define z_null(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ + z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -165,6 +232,7 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ + z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -176,19 +244,34 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ + z_owned_shm_client_t* : z_shm_client_null, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ + z_owned_shm_mut_t* : z_shm_mut_null, \ + z_owned_shm_t* : z_shm_null, \ + z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ + z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null \ + zc_owned_closure_log_t* : zc_closure_log_null, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ + zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ + zc_owned_matching_listener_t* : zc_matching_listener_null, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ + ze_owned_publication_cache_t* : ze_publication_cache_null, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ )(this_) +static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } +static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { *closure_ = x->_this; z_closure_zid_null(&x->_this); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } @@ -197,6 +280,7 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } +static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } @@ -208,21 +292,36 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } +static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_shm_client_null(&x->_this); } +static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_shm_client_storage_null(&x->_this); } +static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_shm_null(&x->_this); } +static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_shm_mut_null(&x->_this); } +static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } +static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_closure_matching_status_null(&x->_this); } +static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { *this_ = x->_this; zc_liveliness_token_null(&x->_this); } +static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_matching_listener_null(&x->_this); } +static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_shm_client_list_null(&x->_this); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_publication_cache_null(&x->_this); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_querying_subscriber_null(&x->_this); } #define z_take(this_, x) \ _Generic((this_), \ + z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ + z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ + z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -231,6 +330,7 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ + z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ z_owned_query_t* : z_query_take, \ @@ -242,21 +342,36 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ + z_owned_shm_client_t* : z_shm_client_take, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ + z_owned_shm_t* : z_shm_take, \ + z_owned_shm_mut_t* : z_shm_mut_take, \ + z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ + z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ - zc_owned_closure_log_t* : zc_closure_log_take \ + zc_owned_closure_log_t* : zc_closure_log_take, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ + zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ + zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ + zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ + ze_owned_publication_cache_t* : ze_publication_cache_take, \ + ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ )(this_, x) #define z_check(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ + z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ + z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -265,6 +380,7 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ + z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -276,12 +392,24 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ + z_owned_shm_t : z_shm_check, \ + z_owned_shm_client_t : z_shm_client_check, \ + z_owned_shm_client_storage_t : z_shm_client_storage_check, \ + z_owned_shm_mut_t : z_shm_mut_check, \ + z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ + z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check \ + zc_owned_closure_log_t : zc_closure_log_check, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ + zc_owned_liveliness_token_t : zc_liveliness_token_check, \ + zc_owned_matching_listener_t : zc_matching_listener_check, \ + zc_owned_shm_client_list_t : zc_shm_client_list_check, \ + ze_owned_publication_cache_t : ze_publication_cache_check, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ )(&this_) #define z_call(closure, hello) \ @@ -289,7 +417,9 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call, \ + const z_loaned_closure_zid_t* : z_closure_zid_call, \ + const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ @@ -317,11 +447,14 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move #else // #ifndef __cplusplus +static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return reinterpret_cast(x); } +static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return reinterpret_cast(x); } +static inline z_moved_closure_zid_t* z_closure_zid_move(z_owned_closure_zid_t* x) { return reinterpret_cast(x); } static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return reinterpret_cast(x); } static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return reinterpret_cast(x); } static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return reinterpret_cast(x); } @@ -330,6 +463,7 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return reinterpret_cast(x); } +static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return reinterpret_cast(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return reinterpret_cast(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return reinterpret_cast(x); } @@ -341,20 +475,35 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return reinterpret_cast(x); } +static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return reinterpret_cast(x); } +static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return reinterpret_cast(x); } +static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return reinterpret_cast(x); } +static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return reinterpret_cast(x); } +static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return reinterpret_cast(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return reinterpret_cast(x); } +static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return reinterpret_cast(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return reinterpret_cast(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return reinterpret_cast(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return reinterpret_cast(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return reinterpret_cast(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return reinterpret_cast(x); } +static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return reinterpret_cast(x); } +static inline zc_moved_liveliness_token_t* zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return reinterpret_cast(x); } +static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return reinterpret_cast(x); } +static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return reinterpret_cast(x); } +static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return reinterpret_cast(x); } +static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return reinterpret_cast(x); } +inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; +inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; +inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -363,6 +512,7 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; +inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -373,7 +523,12 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; +inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; +inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; +inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; +inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; +inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -381,6 +536,10 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; +inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; +inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; +inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; +inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -389,46 +548,68 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; +inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; +inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; +inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; -inline void z_drop(z_moved_bytes_t this_) { z_bytes_drop(this_); }; -inline void z_drop(z_moved_closure_hello_t this_) { z_closure_hello_drop(this_); }; -inline void z_drop(z_moved_closure_query_t closure_) { z_closure_query_drop(closure_); }; -inline void z_drop(z_moved_closure_reply_t closure_) { z_closure_reply_drop(closure_); }; -inline void z_drop(z_moved_closure_sample_t closure_) { z_closure_sample_drop(closure_); }; -inline void z_drop(z_moved_condvar_t this_) { z_condvar_drop(this_); }; -inline void z_drop(z_moved_config_t this_) { z_config_drop(this_); }; -inline void z_drop(z_moved_encoding_t this_) { z_encoding_drop(this_); }; -inline void z_drop(z_moved_fifo_handler_query_t this_) { z_fifo_handler_query_drop(this_); }; -inline void z_drop(z_moved_fifo_handler_reply_t this_) { z_fifo_handler_reply_drop(this_); }; -inline void z_drop(z_moved_fifo_handler_sample_t this_) { z_fifo_handler_sample_drop(this_); }; -inline void z_drop(z_moved_hello_t this_) { z_hello_drop(this_); }; -inline void z_drop(z_moved_keyexpr_t this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_mutex_t this_) { z_mutex_drop(this_); }; -inline void z_drop(z_moved_publisher_t this_) { z_publisher_drop(this_); }; -inline void z_drop(z_moved_query_t this_) { z_query_drop(this_); }; -inline void z_drop(z_moved_queryable_t this_) { z_queryable_drop(this_); }; -inline void z_drop(z_moved_reply_t this_) { z_reply_drop(this_); }; -inline void z_drop(z_moved_reply_err_t this_) { z_reply_err_drop(this_); }; -inline void z_drop(z_moved_ring_handler_query_t this_) { z_ring_handler_query_drop(this_); }; -inline void z_drop(z_moved_ring_handler_reply_t this_) { z_ring_handler_reply_drop(this_); }; -inline void z_drop(z_moved_ring_handler_sample_t this_) { z_ring_handler_sample_drop(this_); }; -inline void z_drop(z_moved_sample_t this_) { z_sample_drop(this_); }; -inline void z_drop(z_moved_session_t this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_slice_t this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_string_array_t this_) { z_string_array_drop(this_); }; -inline void z_drop(z_moved_string_t this_) { z_string_drop(this_); }; -inline void z_drop(z_moved_subscriber_t this_) { z_subscriber_drop(this_); }; -inline void z_drop(z_moved_task_t this_) { z_task_drop(this_); }; -inline void z_drop(zc_moved_closure_log_t closure_) { zc_closure_log_drop(closure_); }; +inline void z_drop(z_moved_alloc_layout_t* this_) { z_alloc_layout_drop(this_); }; +inline void z_drop(z_moved_bytes_t* this_) { z_bytes_drop(this_); }; +inline void z_drop(z_moved_chunk_alloc_result_t* this_) { z_chunk_alloc_result_drop(this_); }; +inline void z_drop(z_moved_closure_hello_t* this_) { z_closure_hello_drop(this_); }; +inline void z_drop(z_moved_closure_query_t* closure_) { z_closure_query_drop(closure_); }; +inline void z_drop(z_moved_closure_reply_t* closure_) { z_closure_reply_drop(closure_); }; +inline void z_drop(z_moved_closure_sample_t* closure_) { z_closure_sample_drop(closure_); }; +inline void z_drop(z_moved_closure_zid_t* closure_) { z_closure_zid_drop(closure_); }; +inline void z_drop(z_moved_condvar_t* this_) { z_condvar_drop(this_); }; +inline void z_drop(z_moved_config_t* this_) { z_config_drop(this_); }; +inline void z_drop(z_moved_encoding_t* this_) { z_encoding_drop(this_); }; +inline void z_drop(z_moved_fifo_handler_query_t* this_) { z_fifo_handler_query_drop(this_); }; +inline void z_drop(z_moved_fifo_handler_reply_t* this_) { z_fifo_handler_reply_drop(this_); }; +inline void z_drop(z_moved_fifo_handler_sample_t* this_) { z_fifo_handler_sample_drop(this_); }; +inline void z_drop(z_moved_hello_t* this_) { z_hello_drop(this_); }; +inline void z_drop(z_moved_keyexpr_t* this_) { z_keyexpr_drop(this_); }; +inline void z_drop(z_moved_memory_layout_t* this_) { z_memory_layout_drop(this_); }; +inline void z_drop(z_moved_mutex_t* this_) { z_mutex_drop(this_); }; +inline void z_drop(z_moved_publisher_t* this_) { z_publisher_drop(this_); }; +inline void z_drop(z_moved_query_t* this_) { z_query_drop(this_); }; +inline void z_drop(z_moved_queryable_t* this_) { z_queryable_drop(this_); }; +inline void z_drop(z_moved_reply_t* this_) { z_reply_drop(this_); }; +inline void z_drop(z_moved_reply_err_t* this_) { z_reply_err_drop(this_); }; +inline void z_drop(z_moved_ring_handler_query_t* this_) { z_ring_handler_query_drop(this_); }; +inline void z_drop(z_moved_ring_handler_reply_t* this_) { z_ring_handler_reply_drop(this_); }; +inline void z_drop(z_moved_ring_handler_sample_t* this_) { z_ring_handler_sample_drop(this_); }; +inline void z_drop(z_moved_sample_t* this_) { z_sample_drop(this_); }; +inline void z_drop(z_moved_session_t* this_) { z_session_drop(this_); }; +inline void z_drop(z_moved_shm_client_t* this_) { z_shm_client_drop(this_); }; +inline void z_drop(z_moved_shm_client_storage_t* this_) { z_shm_client_storage_drop(this_); }; +inline void z_drop(z_moved_shm_t* this_) { z_shm_drop(this_); }; +inline void z_drop(z_moved_shm_mut_t* this_) { z_shm_mut_drop(this_); }; +inline void z_drop(z_moved_shm_provider_t* this_) { z_shm_provider_drop(this_); }; +inline void z_drop(z_moved_slice_t* this_) { z_slice_drop(this_); }; +inline void z_drop(z_moved_source_info_t* this_) { z_source_info_drop(this_); }; +inline void z_drop(z_moved_string_array_t* this_) { z_string_array_drop(this_); }; +inline void z_drop(z_moved_string_t* this_) { z_string_drop(this_); }; +inline void z_drop(z_moved_subscriber_t* this_) { z_subscriber_drop(this_); }; +inline void z_drop(z_moved_task_t* this_) { z_task_drop(this_); }; +inline void z_drop(zc_moved_closure_log_t* closure_) { zc_closure_log_drop(closure_); }; +inline void z_drop(zc_moved_closure_matching_status_t* closure_) { zc_closure_matching_status_drop(closure_); }; +inline void z_drop(zc_moved_liveliness_token_t* this_) { zc_liveliness_token_drop(this_); }; +inline z_result_t z_drop(zc_moved_matching_listener_t* this_) { return zc_publisher_matching_listener_drop(this_); }; +inline void z_drop(zc_moved_shm_client_list_t* this_) { zc_shm_client_list_drop(this_); }; +inline void z_drop(ze_moved_publication_cache_t* this_) { ze_publication_cache_drop(this_); }; +inline void z_drop(ze_moved_querying_subscriber_t* this_) { ze_querying_subscriber_drop(this_); }; +inline z_moved_alloc_layout_t* z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t* z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; +inline z_moved_chunk_alloc_result_t* z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t* z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; inline z_moved_closure_query_t* z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; inline z_moved_closure_reply_t* z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; inline z_moved_closure_sample_t* z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; +inline z_moved_closure_zid_t* z_move(z_owned_closure_zid_t& closure_) { return z_closure_zid_move(&closure_); }; inline z_moved_condvar_t* z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t* z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t* z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -437,6 +618,7 @@ inline z_moved_fifo_handler_reply_t* z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t* z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t* z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; +inline z_moved_memory_layout_t* z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t* z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t* z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t* z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; @@ -448,19 +630,34 @@ inline z_moved_ring_handler_reply_t* z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t* z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t* z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t* z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; +inline z_moved_shm_client_t* z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; +inline z_moved_shm_client_storage_t* z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; +inline z_moved_shm_t* z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; +inline z_moved_shm_mut_t* z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; +inline z_moved_shm_provider_t* z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t* z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; +inline z_moved_source_info_t* z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t* z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t* z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; +inline zc_moved_closure_matching_status_t* z_move(zc_owned_closure_matching_status_t& closure_) { return zc_closure_matching_status_move(&closure_); }; +inline zc_moved_liveliness_token_t* z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; +inline zc_moved_matching_listener_t* z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; +inline zc_moved_shm_client_list_t* z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; +inline ze_moved_publication_cache_t* z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; +inline ze_moved_querying_subscriber_t* z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; +inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; +inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; +inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; @@ -469,6 +666,7 @@ inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_n inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; +inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; @@ -480,18 +678,33 @@ inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_n inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; +inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; +inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; +inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; +inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; +inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; +inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; +inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; +inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; +inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; +inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; +inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; +inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; +static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } +static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } +static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { *closure_ = x->_this; z_closure_zid_null(&x->_this); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } @@ -500,6 +713,7 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } +static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } @@ -511,18 +725,36 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } +static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_shm_client_null(&x->_this); } +static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_shm_client_storage_null(&x->_this); } +static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_shm_null(&x->_this); } +static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_shm_mut_null(&x->_this); } +static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } +static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } +static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_closure_matching_status_null(&x->_this); } +static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { *this_ = x->_this; zc_liveliness_token_null(&x->_this); } +static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_matching_listener_null(&x->_this); } +static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_shm_client_list_null(&x->_this); } +static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_publication_cache_null(&x->_this); } +static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_querying_subscriber_null(&x->_this); } +inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { + z_alloc_layout_take(this_, x); +}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { z_bytes_take(this_, x); }; +inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { + z_chunk_alloc_result_take(this_, x); +}; inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { z_closure_hello_take(this_, x); }; @@ -535,6 +767,9 @@ inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { z_closure_sample_take(closure_, x); }; +inline void z_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { + z_closure_zid_take(closure_, x); +}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { z_condvar_take(this_, x); }; @@ -559,6 +794,9 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t* x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { z_keyexpr_take(this_, x); }; +inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { + z_memory_layout_take(this_, x); +}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { z_mutex_take(this_, x); }; @@ -592,9 +830,27 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t* x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t* x) { z_session_take(this_, x); }; +inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { + z_shm_client_take(this_, x); +}; +inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { + z_shm_client_storage_take(this_, x); +}; +inline void z_take(z_owned_shm_t* this_, z_moved_shm_t* x) { + z_shm_take(this_, x); +}; +inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { + z_shm_mut_take(this_, x); +}; +inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { + z_shm_provider_take(this_, x); +}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t* x) { z_slice_take(this_, x); }; +inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { + z_source_info_take(this_, x); +}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { z_string_array_take(this_, x); }; @@ -610,13 +866,34 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t* x) { inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { zc_closure_log_take(closure_, x); }; +inline void z_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { + zc_closure_matching_status_take(closure_, x); +}; +inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { + zc_liveliness_token_take(this_, x); +}; +inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { + zc_publisher_matching_listener_take(this_, x); +}; +inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { + zc_shm_client_list_take(this_, x); +}; +inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { + ze_publication_cache_take(this_, x); +}; +inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { + ze_querying_subscriber_take(this_, x); +}; +inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; +inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; +inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -625,6 +902,7 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; +inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -636,12 +914,24 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; +inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; +inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; +inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; +inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; +inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; +inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; +inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; +inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; +inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; +inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; +inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; +inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { @@ -656,6 +946,12 @@ inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; +inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { + z_closure_zid_call(closure, z_id); +}; +inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { + zc_closure_matching_status_call(closure, mathing_status); +}; inline void z_closure( @@ -694,6 +990,24 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; +inline void z_closure( + z_owned_closure_zid_t* closure, + void (*call)(const z_id_t*, void*), + void (*drop)(void*), + void *context) { + closure->context = context; + closure->drop = drop; + closure->call = call; +}; +inline void z_closure( + zc_owned_closure_matching_status_t* closure, + void (*call)(const zc_matching_status_t*, void*), + void (*drop)(void*), + void *context) { + closure->context = context; + closure->drop = drop; + closure->call = call; +}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -737,8 +1051,12 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -747,6 +1065,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -763,6 +1083,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -783,8 +1105,18 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -793,6 +1125,14 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; +template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; #endif // #ifndef __cplusplus diff --git a/tests/z_api_shm_test.c b/tests/z_api_shm_test.c index 2b27eb8b0..04a2d2d59 100644 --- a/tests/z_api_shm_test.c +++ b/tests/z_api_shm_test.c @@ -39,11 +39,11 @@ return -200; \ } -int test_shm_buffer(z_moved_shm_mut_t mbuf) { - assert(mbuf._ptr != NULL); +int test_shm_buffer(z_moved_shm_mut_t* mbuf) { + ASSERT_CHECK(mbuf->_this); z_owned_shm_mut_t buf; z_take(&buf, mbuf); - assert(mbuf._ptr == NULL); + ASSERT_CHECK_ERR(mbuf->_this); ASSERT_CHECK(buf); { z_loaned_shm_mut_t* loaned = z_loan_mut(buf); } @@ -51,7 +51,7 @@ int test_shm_buffer(z_moved_shm_mut_t mbuf) { z_owned_shm_t immut; z_shm_from_mut(&immut, z_move(buf)); ASSERT_CHECK(immut); - assert(buf->_ptr == NULL); + ASSERT_CHECK_ERR(buf); { const z_loaned_shm_t* loaned = z_loan(immut); } From 75699f85b4bee2e022e87905ffc7d1ef4d41b4d0 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 15:06:36 +0200 Subject: [PATCH 084/397] clippy fix --- src/get.rs | 8 ++++---- src/publisher.rs | 8 ++++---- src/put.rs | 6 +++--- src/queryable.rs | 12 ++++++------ src/transmute.rs | 10 +++++++++- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/src/get.rs b/src/get.rs index 7aff366c8..a90c63221 100644 --- a/src/get.rs +++ b/src/get.rs @@ -220,11 +220,11 @@ pub extern "C" fn z_get_options_default(this_: &mut MaybeUninit priority: Priority::default().into(), is_express: false, timeout_ms: 0, - payload: None.into(), - encoding: None.into(), + payload: None, + encoding: None, #[cfg(feature = "unstable")] - source_info: None.into(), - attachment: None.into(), + source_info: None, + attachment: None, }); } diff --git a/src/publisher.rs b/src/publisher.rs index 40172708e..d30f9b11b 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -58,7 +58,7 @@ pub struct z_publisher_options_t { #[no_mangle] pub extern "C" fn z_publisher_options_default(this_: &mut MaybeUninit) { this_.write(z_publisher_options_t { - encoding: None.into(), + encoding: None, congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), is_express: false, @@ -179,11 +179,11 @@ pub extern "C" fn z_publisher_put_options_default( this: &mut MaybeUninit, ) { this.write(z_publisher_put_options_t { - encoding: None.into(), + encoding: None, timestamp: None, #[cfg(feature = "unstable")] - source_info: None.into(), - attachment: None.into(), + source_info: None, + attachment: None, }); } diff --git a/src/put.rs b/src/put.rs index e25f2d40d..a06fd485b 100644 --- a/src/put.rs +++ b/src/put.rs @@ -58,7 +58,7 @@ pub struct z_put_options_t { #[allow(clippy::missing_safety_doc)] pub extern "C" fn z_put_options_default(this_: &mut MaybeUninit) { this_.write(z_put_options_t { - encoding: None.into(), + encoding: None, congestion_control: CongestionControl::default().into(), priority: Priority::default().into(), is_express: false, @@ -66,8 +66,8 @@ pub extern "C" fn z_put_options_default(this_: &mut MaybeUninit #[cfg(feature = "unstable")] allowed_destination: zc_locality_default(), #[cfg(feature = "unstable")] - source_info: None.into(), - attachment: None.into(), + source_info: None, + attachment: None, }); } diff --git a/src/queryable.rs b/src/queryable.rs index 1d63362d7..9b44e3f71 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -134,14 +134,14 @@ pub struct z_query_reply_options_t { #[allow(clippy::missing_safety_doc)] pub extern "C" fn z_query_reply_options_default(this_: &mut MaybeUninit) { this_.write(z_query_reply_options_t { - encoding: None.into(), + encoding: None, congestion_control: CongestionControl::Block.into(), priority: Priority::default().into(), is_express: false, timestamp: None, #[cfg(feature = "unstable")] - source_info: None.into(), - attachment: None.into(), + source_info: None, + attachment: None, }); } @@ -161,7 +161,7 @@ pub extern "C" fn z_query_reply_err_options_default( this: &mut MaybeUninit, ) { this.write(z_query_reply_err_options_t { - encoding: None.into(), + encoding: None, }); } @@ -197,8 +197,8 @@ pub extern "C" fn z_query_reply_del_options_default( is_express: false, timestamp: None, #[cfg(feature = "unstable")] - source_info: None.into(), - attachment: None.into(), + source_info: None, + attachment: None, }); } diff --git a/src/transmute.rs b/src/transmute.rs index 0bb393267..a44fd2a07 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -184,6 +184,14 @@ macro_rules! impl_transmute { } } }; + (into_rust (itself $rust_type:ty)) => { + impl $crate::transmute::IntoRustType for $rust_type { + type RustType = $rust_type; + fn into_rust_type(self) -> Self::RustType { + self + } + } + }; (take_rust ($c_type:ty, $rust_type:ty)) => { impl Default for $c_type { fn default() -> Self { @@ -224,7 +232,7 @@ macro_rules! impl_owned { (owned rust $c_owned_type:ty, loaned $c_loaned_type:ty) => { impl_transmute!(as_c_owned($c_loaned_type, $c_owned_type)); impl_transmute!(as_c_loaned($c_owned_type, $c_loaned_type)); - impl_transmute!(into_rust($c_owned_type, $c_owned_type)); + impl_transmute!(into_rust(itself $c_owned_type)); }; } From c6a59a3ee5f5c48183c05197c8d169c7260148dc Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 15:11:46 +0200 Subject: [PATCH 085/397] cargo fmt --- src/closures/matching_status_closure.rs | 4 +++- src/collections.rs | 16 +++++++++++----- src/commons.rs | 6 +++--- src/config.rs | 10 +++++++--- src/get.rs | 13 ++++++++++--- src/keyexpr.rs | 6 ++++-- src/payload.rs | 20 ++++++++++++++++---- src/platform/synchronization.rs | 6 ++++-- src/publisher.rs | 5 +++-- src/queryable.rs | 19 +++++++++++-------- src/scouting.rs | 3 ++- src/session.rs | 3 ++- src/shm/buffer/zshm.rs | 11 +++++++++-- src/shm/buffer/zshmmut.rs | 6 +++++- src/subscriber.rs | 3 ++- src/transmute.rs | 13 ++++++++----- 16 files changed, 100 insertions(+), 44 deletions(-) diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index 8a77fcc17..53dc6e722 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -112,7 +112,9 @@ pub extern "C" fn zc_closure_matching_status_call( } /// Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. #[no_mangle] -pub extern "C" fn zc_closure_matching_status_drop(closure_: &mut zc_moved_closure_matching_status_t) { +pub extern "C" fn zc_closure_matching_status_drop( + closure_: &mut zc_moved_closure_matching_status_t, +) { let _ = closure_.take_rust_type(); } diff --git a/src/collections.rs b/src/collections.rs index 84dfa07ea..ffc43d529 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -311,7 +311,9 @@ pub extern "C" fn z_view_slice_is_empty(this_: &z_view_slice_t) -> bool { /// Constructs an empty `z_owned_slice_t`. #[no_mangle] pub extern "C" fn z_slice_empty(this_: &mut MaybeUninit) { - this_.as_rust_type_mut_uninit().write(CSliceOwned::default()); + this_ + .as_rust_type_mut_uninit() + .write(CSliceOwned::default()); } /// Constructs an empty `z_owned_slice_t`. @@ -323,7 +325,7 @@ pub extern "C" fn z_slice_null(this_: &mut MaybeUninit) { /// Frees the memory and invalidates the slice. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_slice_drop(this_:&mut z_moved_slice_t) { +pub unsafe extern "C" fn z_slice_drop(this_: &mut z_moved_slice_t) { let _ = this_.take_rust_type(); } @@ -543,7 +545,8 @@ pub extern "C" fn z_string_check(this_: &z_owned_string_t) -> bool { /// Constructs owned string in a gravestone state. #[no_mangle] pub extern "C" fn z_string_null(this_: &mut MaybeUninit) { - this_.as_rust_type_mut_uninit() + this_ + .as_rust_type_mut_uninit() .write(CStringOwned::default()); } @@ -557,7 +560,8 @@ pub extern "C" fn z_view_string_is_empty(this_: &z_view_string_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_string_empty(this_: &mut MaybeUninit) { - this_.as_rust_type_mut_uninit() + this_ + .as_rust_type_mut_uninit() .write(CStringOwned::default()); } @@ -565,7 +569,9 @@ pub unsafe extern "C" fn z_string_empty(this_: &mut MaybeUninit) { - this_.as_rust_type_mut_uninit().write(CStringView::default()); + this_ + .as_rust_type_mut_uninit() + .write(CStringView::default()); } /// Borrows string. diff --git a/src/commons.rs b/src/commons.rs index fcc88639a..be52e2a88 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -12,9 +12,9 @@ // ZettaScale Zenoh team, // -use crate::transmute::TakeRustType; -use libc::c_ulong; use std::{mem::MaybeUninit, ptr::null}; + +use libc::c_ulong; use zenoh::{ qos::{CongestionControl, Priority}, query::{ConsolidationMode, QueryTarget}, @@ -36,7 +36,7 @@ use crate::z_id_t; use crate::z_moved_source_info_t; use crate::{ result, - transmute::{CTypeRef, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit}, + transmute::{CTypeRef, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_session_t, }; diff --git a/src/config.rs b/src/config.rs index 0932227b1..93e740b1a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -89,8 +89,11 @@ pub extern "C" fn z_config_loan_mut(this_: &mut z_owned_config_t) -> &mut z_loan /// Constructs a new empty configuration. #[no_mangle] -pub extern "C" fn z_config_default(this_: &mut MaybeUninit) -> result::z_result_t { - this_.as_rust_type_mut_uninit() +pub extern "C" fn z_config_default( + this_: &mut MaybeUninit, +) -> result::z_result_t { + this_ + .as_rust_type_mut_uninit() .write(Some(Config::default())); Z_OK } @@ -338,7 +341,8 @@ pub unsafe extern "C" fn zc_config_from_env( #[allow(clippy::missing_safety_doc)] #[no_mangle] pub extern "C" fn z_config_peer(this_: &mut MaybeUninit) -> result::z_result_t { - this_.as_rust_type_mut_uninit() + this_ + .as_rust_type_mut_uninit() .write(Some(zenoh::config::peer())); Z_OK } diff --git a/src/get.rs b/src/get.rs index a90c63221..f5a976b14 100644 --- a/src/get.rs +++ b/src/get.rs @@ -29,7 +29,12 @@ use zenoh::{ }; use crate::{ - result, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, z_query_target_t + result, + transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, + z_closure_reply_call, z_closure_reply_loan, z_congestion_control_t, z_consolidation_mode_t, + z_loaned_bytes_t, z_loaned_encoding_t, z_loaned_keyexpr_t, z_loaned_sample_t, + z_loaned_session_t, z_moved_bytes_t, z_moved_closure_reply_t, z_moved_encoding_t, z_priority_t, + z_query_target_t, }; #[cfg(feature = "unstable")] use crate::{ @@ -72,7 +77,8 @@ decl_c_type!( /// Constructs an empty `z_owned_reply_err_t`. #[no_mangle] pub extern "C" fn z_reply_err_null(this_: &mut MaybeUninit) { - this_.as_rust_type_mut_uninit() + this_ + .as_rust_type_mut_uninit() .write(ReplyErrorNewtype::default()); } @@ -321,7 +327,8 @@ pub extern "C" fn z_reply_check(this_: &z_owned_reply_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_reply_loan(this_: &z_owned_reply_t) -> &z_loaned_reply_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() diff --git a/src/keyexpr.rs b/src/keyexpr.rs index 018966609..b94f0ba6a 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -127,7 +127,8 @@ pub unsafe extern "C" fn z_keyexpr_from_str_autocanonize( #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_keyexpr_loan(this_: &z_owned_keyexpr_t) -> &z_loaned_keyexpr_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -137,7 +138,8 @@ pub unsafe extern "C" fn z_keyexpr_loan(this_: &z_owned_keyexpr_t) -> &z_loaned_ #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_view_keyexpr_loan(this_: &z_view_keyexpr_t) -> &z_loaned_keyexpr_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() diff --git a/src/payload.rs b/src/payload.rs index e3e8f04fa..f1581b8a6 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -309,19 +309,28 @@ pub extern "C" fn z_bytes_serialize_from_uint8(this_: &mut MaybeUninit, val: u16) { +pub extern "C" fn z_bytes_serialize_from_uint16( + this_: &mut MaybeUninit, + val: u16, +) { z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes an unsigned integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_uint32(this_: &mut MaybeUninit, val: u32) { +pub extern "C" fn z_bytes_serialize_from_uint32( + this_: &mut MaybeUninit, + val: u32, +) { z_bytes_serialize_from_arithmetic::(this_, val); } /// Serializes an unsigned integer. #[no_mangle] -pub extern "C" fn z_bytes_serialize_from_uint64(this_: &mut MaybeUninit, val: u64) { +pub extern "C" fn z_bytes_serialize_from_uint64( + this_: &mut MaybeUninit, + val: u64, +) { z_bytes_serialize_from_arithmetic::(this_, val); } @@ -357,7 +366,10 @@ pub extern "C" fn z_bytes_serialize_from_float(this_: &mut MaybeUninit, val: f64) { +pub extern "C" fn z_bytes_serialize_from_double( + this_: &mut MaybeUninit, + val: f64, +) { z_bytes_serialize_from_arithmetic::(this_, val); } /// Deserializes into an unsigned integer. diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index f9590c5de..871e94509 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -50,7 +50,8 @@ pub extern "C" fn z_mutex_null(this_: &mut MaybeUninit) { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_mutex_loan_mut(this_: &mut z_owned_mutex_t) -> &mut z_loaned_mutex_t { - this_.as_rust_type_mut() + this_ + .as_rust_type_mut() .as_mut() .unwrap_unchecked() .as_loaned_c_type_mut() @@ -141,7 +142,8 @@ pub extern "C" fn z_condvar_check(this_: &z_owned_condvar_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_condvar_loan(this_: &z_owned_condvar_t) -> &z_loaned_condvar_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() diff --git a/src/publisher.rs b/src/publisher.rs index d30f9b11b..22240e773 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -140,7 +140,8 @@ pub extern "C" fn z_publisher_check(this_: &z_owned_publisher_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_publisher_loan(this_: &z_owned_publisher_t) -> &z_loaned_publisher_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -288,7 +289,7 @@ pub extern "C" fn z_publisher_keyexpr(publisher: &z_loaned_publisher_t) -> &z_lo } #[cfg(feature = "unstable")] -pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; +pub use crate::opaque_types::{zc_moved_matching_listener_t, zc_owned_matching_listener_t}; #[cfg(feature = "unstable")] decl_c_type!( owned(zc_owned_matching_listener_t, option MatchingListener<'static, ()>), diff --git a/src/queryable.rs b/src/queryable.rs index 9b44e3f71..707f735a2 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -48,7 +48,8 @@ pub extern "C" fn z_queryable_null(this_: &mut MaybeUninit) #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_queryable_loan(this_: &z_owned_queryable_t) -> &z_loaned_queryable_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -74,7 +75,8 @@ pub extern "C" fn z_query_check(query: &z_owned_query_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_query_loan(this_: &'static z_owned_query_t) -> &z_loaned_query_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() @@ -160,9 +162,7 @@ pub struct z_query_reply_err_options_t { pub extern "C" fn z_query_reply_err_options_default( this: &mut MaybeUninit, ) { - this.write(z_query_reply_err_options_t { - encoding: None, - }); + this.write(z_query_reply_err_options_t { encoding: None }); } /// Represents the set of options that can be applied to a query delete reply, @@ -433,7 +433,8 @@ pub unsafe extern "C" fn z_query_parameters( /// Returns NULL if query does not contain a payload. #[no_mangle] pub extern "C" fn z_query_payload(this_: &z_loaned_query_t) -> Option<&z_loaned_bytes_t> { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .payload() .map(|v| v.as_loaned_c_type_ref()) } @@ -443,7 +444,8 @@ pub extern "C" fn z_query_payload(this_: &z_loaned_query_t) -> Option<&z_loaned_ /// Returns NULL if query does not contain an encoding. #[no_mangle] pub extern "C" fn z_query_encoding(this_: &z_loaned_query_t) -> Option<&z_loaned_encoding_t> { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .encoding() .map(|v| v.as_loaned_c_type_ref()) } @@ -453,7 +455,8 @@ pub extern "C" fn z_query_encoding(this_: &z_loaned_query_t) -> Option<&z_loaned /// Returns NULL if query does not contain an attachment. #[no_mangle] pub extern "C" fn z_query_attachment(this_: &z_loaned_query_t) -> Option<&z_loaned_bytes_t> { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .attachment() .map(|a| a.as_loaned_c_type_ref()) } diff --git a/src/scouting.rs b/src/scouting.rs index eca44f4bc..d8cc48069 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -44,7 +44,8 @@ pub unsafe extern "C" fn z_hello_drop(this_: &mut z_moved_hello_t) { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_hello_loan(this_: &z_owned_hello_t) -> &z_loaned_hello_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap() .as_loaned_c_type_ref() diff --git a/src/session.rs b/src/session.rs index db0ead932..01c1547c9 100644 --- a/src/session.rs +++ b/src/session.rs @@ -33,7 +33,8 @@ decl_c_type!( #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_session_loan(this_: &z_owned_session_t) -> &z_loaned_session_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 7190c944f..1b29e0be7 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -31,7 +31,10 @@ decl_c_type!( /// Constructs ZShm slice from ZShmMut slice #[no_mangle] -pub extern "C" fn z_shm_from_mut(this_: &mut MaybeUninit, that: &mut z_moved_shm_mut_t) { +pub extern "C" fn z_shm_from_mut( + this_: &mut MaybeUninit, + that: &mut z_moved_shm_mut_t, +) { let shm: Option = that.take_rust_type().take().map(|val| val.into()); this_.as_rust_type_mut_uninit().write(shm); } @@ -60,7 +63,11 @@ pub extern "C" fn z_shm_clone(out: &mut MaybeUninit, this_: &z_lo #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_shm_loan(this_: &z_owned_shm_t) -> &z_loaned_shm_t { - let this: &zshm = this_.as_rust_type_ref().as_ref().unwrap_unchecked().borrow(); + let this: &zshm = this_ + .as_rust_type_ref() + .as_ref() + .unwrap_unchecked() + .borrow(); this.as_loaned_c_type_ref() } diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index 948d385c9..67e46e1cc 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -58,7 +58,11 @@ pub extern "C" fn z_shm_mut_check(this_: &z_owned_shm_mut_t) -> bool { #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn z_shm_mut_loan(this_: &z_owned_shm_mut_t) -> &z_loaned_shm_mut_t { - let shmmut: &zshmmut = this_.as_rust_type_ref().as_ref().unwrap_unchecked().borrow(); + let shmmut: &zshmmut = this_ + .as_rust_type_ref() + .as_ref() + .unwrap_unchecked() + .borrow(); shmmut.as_loaned_c_type_ref() } diff --git a/src/subscriber.rs b/src/subscriber.rs index efbc6888e..6bd43eb44 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -74,7 +74,8 @@ pub extern "C" fn z_subscriber_null(this_: &mut MaybeUninit &z_loaned_subscriber_t { - this_.as_rust_type_ref() + this_ + .as_rust_type_ref() .as_ref() .unwrap_unchecked() .as_loaned_c_type_ref() diff --git a/src/transmute.rs b/src/transmute.rs index a44fd2a07..6be940ab0 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -55,13 +55,17 @@ pub(crate) trait IntoCType: Sized { pub(crate) trait TakeRustType: Sized { type RustType; fn take_rust_type(&mut self) -> Self::RustType; -} +} pub(crate) trait TakeCType: Sized { type CType; fn take_c_type(&mut self) -> Self::CType; -} +} -impl TakeRustType for P where P: TakeCType, Q: IntoRustType { +impl TakeRustType for P +where + P: TakeCType, + Q: IntoRustType, +{ type RustType = Q::RustType; fn take_rust_type(&mut self) -> Self::RustType { self.take_c_type().into_rust_type() @@ -91,7 +95,7 @@ macro_rules! validate_equivalence { } const SIZE_A: usize = std::mem::size_of::<$type_a>(); const SIZE_B: usize = std::mem::size_of::<$type_b>(); - if SIZE_A != SIZE_B { + if SIZE_A != SIZE_B { const ERR_MESSAGE: &str = concatcp!( "Size mismatch: type ", TYPE_NAME_A, @@ -110,7 +114,6 @@ macro_rules! validate_equivalence { #[macro_export] macro_rules! impl_transmute { - (as_c ($rust_type:ty, $c_type:ty)) => { impl $crate::transmute::CTypeRef for $rust_type { type CType = $c_type; From 5dd3f84561f659940e75d27da8660347dd549dbd Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 15:21:17 +0200 Subject: [PATCH 086/397] headers updated --- include/zenoh_commons.h | 516 +++++++++++++++++++++++++--------------- include/zenoh_macros.h | 356 +-------------------------- 2 files changed, 334 insertions(+), 538 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 25e2b3f94..4497f0c5e 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,6 +16,26 @@ #define ALIGN(n) #define ZENOHC_API #endif +/** + * Allocation errors + * + * - **NEED_DEFRAGMENT**: defragmentation needed + * - **OUT_OF_MEMORY**: the provider is out of memory + * - **OTHER**: other error + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_alloc_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_NEED_DEFRAGMENT, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OUT_OF_MEMORY, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_ALLOC_ERROR_OTHER, +#endif +} z_alloc_error_t; +#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -76,6 +96,22 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif +/** + * Layouting errors + * + * INCORRECT_LAYOUT_ARGS: layout arguments are incorrect + * PROVIDER_INCOMPATIBLE_LAYOUT: layout incompatible with provider + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum z_layout_error_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, +#endif +} z_layout_error_t; +#endif /** * The priority of zenoh messages. */ @@ -230,10 +266,47 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -typedef struct z_moved_alloc_layout_t { - struct z_owned_alloc_layout_t _this; -} z_moved_alloc_layout_t; +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_alloc_result_t { + z_owned_shm_mut_t buf; + enum z_alloc_error_t error; +} z_buf_alloc_result_t; +#endif typedef int8_t z_result_t; +/** + * An AllocAlignment. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_alloc_alignment_t { + uint8_t pow; +} z_alloc_alignment_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_data_t { + void *ptr; +} zc_threadsafe_context_data_t; +#endif +/** + * A tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a thread-safe context - the associated callbacks may be executed concurrently with the same + * zc_context_t instance. In other words, all the callbacks associated with this context data MUST be + * thread-safe. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted.The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_threadsafe_context_t { + struct zc_threadsafe_context_data_t context; + void (*delete_fn)(void*); +} zc_threadsafe_context_t; +#endif typedef struct z_moved_bytes_t { struct z_owned_bytes_t _this; } z_moved_bytes_t; @@ -243,15 +316,37 @@ typedef struct z_moved_slice_t { typedef struct z_moved_string_t { struct z_owned_string_t _this; } z_moved_string_t; -typedef struct z_moved_shm_t { - struct z_owned_shm_t _this; -} z_moved_shm_t; -typedef struct z_moved_shm_mut_t { - struct z_owned_shm_mut_t _this; -} z_moved_shm_mut_t; -typedef struct z_moved_chunk_alloc_result_t { - struct z_owned_chunk_alloc_result_t _this; -} z_moved_chunk_alloc_result_t; +/** + * Unique segment identifier + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_segment_id_t; +#endif +/** + * Chunk id within it's segment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef uint32_t z_chunk_id_t; +#endif +/** + * A ChunkDescriptor + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_chunk_descriptor_t { + z_segment_id_t segment; + z_chunk_id_t chunk; + size_t len; +} z_chunk_descriptor_t; +#endif +/** + * An AllocatedChunk + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_allocated_chunk_t { + struct z_chunk_descriptor_t descriptpr; + void *data; +} z_allocated_chunk_t; +#endif /** * Monotonic clock */ @@ -402,7 +497,7 @@ typedef struct z_owned_closure_zid_t { /** * A callback function. */ - void (*call)(const struct z_id_t *z_id, void *context); + void (*call)(const z_id_t *z_id, void *context); /** * An optional function that will be called upon closure drop. */ @@ -513,9 +608,6 @@ typedef struct z_moved_fifo_handler_sample_t { typedef struct z_query_consolidation_t { enum z_consolidation_mode_t mode; } z_query_consolidation_t; -typedef struct z_moved_source_info_t { - struct z_owned_source_info_t _this; -} z_moved_source_info_t; /** * Options passed to the `z_get()` function. */ @@ -564,7 +656,7 @@ typedef struct z_get_options_t { /** * The source info for the query. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * An optional attachment to attach to the query. @@ -581,9 +673,6 @@ typedef struct z_moved_hello_t { typedef struct z_moved_keyexpr_t { struct z_owned_keyexpr_t _this; } z_moved_keyexpr_t; -typedef struct z_moved_memory_layout_t { - struct z_owned_memory_layout_t _this; -} z_moved_memory_layout_t; typedef struct z_moved_mutex_t { struct z_owned_mutex_t _this; } z_moved_mutex_t; @@ -616,7 +705,7 @@ typedef struct z_publisher_put_options_t { /** * The source info for the publication. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to attach to the publication. @@ -657,7 +746,7 @@ typedef struct z_put_options_t { /** * The source info for the message. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this message. @@ -696,7 +785,7 @@ typedef struct z_query_reply_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -728,7 +817,7 @@ typedef struct z_query_reply_del_options_t { /** * The source info for the reply. */ - struct z_moved_source_info_t *source_info; + z_moved_source_info_t *source_info; #endif /** * The attachment to this reply. @@ -779,15 +868,39 @@ typedef struct z_scout_options_t { */ enum z_what_t what; } z_scout_options_t; -typedef struct z_moved_shm_client_t { - struct z_owned_shm_client_t _this; -} z_moved_shm_client_t; -typedef struct z_moved_shm_client_storage_t { - struct z_owned_shm_client_storage_t _this; -} z_moved_shm_client_storage_t; -typedef struct z_moved_shm_provider_t { - struct z_owned_shm_provider_t _this; -} z_moved_shm_provider_t; +/** + * A callbacks for ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_segment_callbacks_t { + uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); +} zc_shm_segment_callbacks_t; +#endif +/** + * A ShmSegment + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_shm_segment_t { + struct zc_threadsafe_context_t context; + struct zc_shm_segment_callbacks_t callbacks; +} z_shm_segment_t; +#endif +/** + * A callbacks for ShmClient + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_client_callbacks_t { + bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); +} zc_shm_client_callbacks_t; +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct z_buf_layout_alloc_result_t { + z_owned_shm_mut_t buf; + bool error_is_alloc; + enum z_alloc_error_t alloc_error; + enum z_layout_error_t layout_error; +} z_buf_layout_alloc_result_t; +#endif /** * Unique protocol identifier. * Here is a contract: it is up to user to make sure that incompatible ShmClient @@ -796,6 +909,46 @@ typedef struct z_moved_shm_provider_t { #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef uint32_t z_protocol_id_t; #endif +/** + * A non-tread-safe droppable context. + * Contexts are idiomatically used in C together with callback interfaces to deliver associated state + * information to each callback. + * + * This is a non-thread-safe context - zenoh-c guarantees that associated callbacks that share the same + * zc_context_t instance will never be executed concurrently. In other words, all the callbacks associated + * with this context data are not required to be thread-safe. + * + * NOTE: Remember that the same callback interfaces associated with different zc_context_t instances can + * still be executed concurrently. The exact behavior depends on user's application, but we strongly + * discourage our users from pinning to some specific behavior unless they _really_ understand what they + * are doing. + * + * Once moved to zenoh-c ownership, this context is guaranteed to execute delete_fn when deleted. The + * delete_fn is guaranteed to be executed only once at some point of time after the last associated + * callback call returns. + * NOTE: if user doesn't pass the instance of this context to zenoh-c, the delete_fn callback won't + * be executed. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_context_t { + void *context; + void (*delete_fn)(void*); +} zc_context_t; +#endif +/** + * A callbacks for ShmProviderBackend + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef struct zc_shm_provider_backend_callbacks_t { + void (*alloc_fn)(z_owned_chunk_alloc_result_t *out_result, + const z_loaned_memory_layout_t *layout, + void *context); + void (*free_fn)(const struct z_chunk_descriptor_t *chunk, void *context); + size_t (*defragment_fn)(void *context); + size_t (*available_fn)(void *context); + void (*layout_for_fn)(z_owned_memory_layout_t *layout, void *context); +} zc_shm_provider_backend_callbacks_t; +#endif typedef struct z_moved_string_array_t { struct z_owned_string_array_t _this; } z_moved_string_array_t; @@ -844,6 +997,14 @@ typedef struct zc_owned_closure_log_t { typedef struct zc_moved_closure_log_t { struct zc_owned_closure_log_t _this; } zc_moved_closure_log_t; +/** + * Loaned closure. + */ +#if defined(UNSTABLE) +typedef struct zc_loaned_closure_matching_status_t { + size_t _0[3]; +} zc_loaned_closure_matching_status_t; +#endif /** * A struct that indicates if there exist Subscribers matching the Publisher's key expression. */ @@ -913,15 +1074,6 @@ typedef struct zc_liveliness_get_options_t { uint32_t timeout_ms; } zc_liveliness_get_options_t; #endif -typedef struct zc_moved_liveliness_token_t { - struct zc_owned_liveliness_token_t _this; -} zc_moved_liveliness_token_t; -typedef struct zc_moved_matching_listener_t { - struct zc_owned_matching_listener_t _this; -} zc_moved_matching_listener_t; -typedef struct zc_moved_shm_client_list_t { - struct zc_owned_shm_client_list_t _this; -} zc_moved_shm_client_list_t; /** * Options passed to the `ze_declare_publication_cache()` function. */ @@ -992,12 +1144,6 @@ typedef struct ze_querying_subscriber_options_t { uint64_t query_timeout_ms; } ze_querying_subscriber_options_t; #endif -typedef struct ze_moved_publication_cache_t { - struct ze_owned_publication_cache_t _this; -} ze_moved_publication_cache_t; -typedef struct ze_moved_querying_subscriber_t { - struct ze_owned_querying_subscriber_t _this; -} ze_moved_querying_subscriber_t; ZENOHC_API extern const unsigned int Z_ROUTER; ZENOHC_API extern const unsigned int Z_PEER; ZENOHC_API extern const unsigned int Z_CLIENT; @@ -1017,54 +1163,53 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout); + const z_loaned_alloc_layout_t *layout); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); #endif /** * Deletes Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); #endif /** * Borrows Alloc Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); +ZENOHC_API const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); #endif /** * Creates a new Alloc Layout for SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -1072,12 +1217,12 @@ z_result_t z_alloc_layout_new(struct z_owned_alloc_layout_t *this_, * Constructs Alloc Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(struct z_owned_alloc_layout_t *this_); +ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, - const struct z_loaned_alloc_layout_t *layout, + const z_loaned_alloc_layout_t *layout, struct zc_threadsafe_context_t result_context, void (*result_callback)(void*, struct z_buf_alloc_result_t*)); @@ -1141,7 +1286,7 @@ z_result_t z_bytes_deserialize_into_int8(const struct z_loaned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *this_, - const struct z_loaned_shm_t **dst); + const z_loaned_shm_t **dst); #endif /** * Deserializes data into a mutably loaned SHM buffer @@ -1152,7 +1297,7 @@ z_result_t z_bytes_deserialize_into_loaned_shm(const struct z_loaned_bytes_t *th #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this_, - struct z_loaned_shm_t **dst); + z_loaned_shm_t **dst); #endif /** * Deserializes data into an owned SHM buffer by copying it's shared reference @@ -1163,7 +1308,7 @@ z_result_t z_bytes_deserialize_into_mut_loaned_shm(struct z_loaned_bytes_t *this #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_deserialize_into_owned_shm(const struct z_loaned_bytes_t *this_, - struct z_owned_shm_t *dst); + z_owned_shm_t *dst); #endif /** * Deserializes into a pair of `z_owned_bytes_t` objects. @@ -1422,9 +1567,7 @@ ZENOHC_API void z_bytes_serialize_from_int8(struct z_owned_bytes_t *this_, int8_ * Serializes from an immutable SHM buffer consuming it */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, - struct z_moved_shm_t *shm); +ZENOHC_API z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, z_moved_shm_t *shm); #endif /** * Serializes from a mutable SHM buffer consuming it @@ -1432,7 +1575,7 @@ z_result_t z_bytes_serialize_from_shm(struct z_owned_bytes_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_bytes_serialize_from_shm_mut(struct z_owned_bytes_t *this_, - struct z_moved_shm_mut_t *shm); + z_moved_shm_mut_t *shm); #endif /** * Serializes a slice by copying. @@ -1500,27 +1643,27 @@ z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); #endif /** * Deletes Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); #endif /** * Borrows Chunk Alloc Result */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const struct z_owned_chunk_alloc_result_t *this_); +const z_loaned_chunk_alloc_result_t *z_chunk_alloc_result_loan(const z_owned_chunk_alloc_result_t *this_); #endif /** * Creates a new Chunk Alloc Result with Error value */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, +void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, enum z_alloc_error_t alloc_error); #endif /** @@ -1528,14 +1671,14 @@ void z_chunk_alloc_result_new_error(struct z_owned_chunk_alloc_result_t *this_, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_chunk_alloc_result_new_ok(struct z_owned_chunk_alloc_result_t *this_, +z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif /** * Constructs Chunk Alloc Result in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); +ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); #endif /** * Get number of milliseconds passed since creation of `time`. @@ -1660,7 +1803,7 @@ ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); #if defined(UNSTABLE) ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, - const struct z_id_t *z_id); + const z_id_t *z_id); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2355,13 +2498,13 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_zenoh_uint8(void); * Returns the entity id of the entity global id. */ #if defined(UNSTABLE) -ZENOHC_API uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); +ZENOHC_API uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); #endif /** * Returns the zenoh id of entity global id. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_entity_global_id_zid(const struct z_entity_global_id_t *this_); +ZENOHC_API z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); #endif /** * Constructs send and recieve ends of the fifo channel @@ -2539,7 +2682,7 @@ ZENOHC_API enum z_whatami_t z_hello_whatami(const struct z_loaned_hello_t *this_ * Returns id of Zenoh entity that transmitted hello message. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); +ZENOHC_API z_id_t z_hello_zid(const struct z_loaned_hello_t *this_); #endif /** * Fetches the Zenoh IDs of all connected peers. @@ -2575,7 +2718,7 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, * to pass it a valid session. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); +ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif /** * Constructs a non-owned non-null-terminated string from key expression. @@ -2719,13 +2862,13 @@ enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_ * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const struct z_owned_memory_layout_t *this_); +ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); #endif /** * Deletes Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_drop(z_moved_memory_layout_t *this_); #endif /** * Extract data from Memory Layout @@ -2734,21 +2877,21 @@ ZENOHC_API void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); ZENOHC_API void z_memory_layout_get_data(size_t *out_size, struct z_alloc_alignment_t *out_alignment, - const struct z_loaned_memory_layout_t *this_); + const z_loaned_memory_layout_t *this_); #endif /** * Borrows Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_memory_layout_t *z_memory_layout_loan(const struct z_owned_memory_layout_t *this_); +const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout_t *this_); #endif /** * Creates a new Memory Layout */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, +z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif @@ -2756,7 +2899,7 @@ z_result_t z_memory_layout_new(struct z_owned_memory_layout_t *this_, * Constructs Memory Layout in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(struct z_owned_memory_layout_t *this_); +ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2812,21 +2955,21 @@ z_result_t z_open(struct z_owned_session_t *this_, ZENOHC_API z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, struct z_moved_config_t *config, - const struct z_loaned_shm_client_storage_t *shm_clients); + const z_loaned_shm_client_storage_t *shm_clients); #endif /** * Creates a new POSIX SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_posix_shm_client_new(z_owned_shm_client_t *this_); #endif /** * Creates a new POSIX SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_posix_shm_provider_new(struct z_owned_shm_provider_t *this_, - const struct z_loaned_memory_layout_t *layout); +z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, + const z_loaned_memory_layout_t *layout); #endif /** * Returns the default value of #z_priority_t. @@ -2856,7 +2999,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); * Returns the ID of the publisher. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +ZENOHC_API z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3118,7 +3261,7 @@ ZENOHC_API uint64_t z_random_u64(void); */ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif /** * Returns ``true`` if `reply` is valid, ``false`` otherwise. @@ -3189,7 +3332,7 @@ ZENOHC_API const struct z_loaned_sample_t *z_reply_ok(const struct z_loaned_repl * Returns `true` if id is present. */ #if defined(UNSTABLE) -ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, struct z_id_t *out_id); +ZENOHC_API bool z_reply_replier_id(const struct z_loaned_reply_t *this_, z_id_t *out_id); #endif /** * Constructs send and recieve ends of the ring channel @@ -3375,7 +3518,7 @@ ZENOHC_API enum z_priority_t z_sample_priority(const struct z_loaned_sample_t *t */ #if defined(UNSTABLE) ZENOHC_API -const struct z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); +const z_loaned_source_info_t *z_sample_source_info(const struct z_loaned_sample_t *this_); #endif /** * Returns the sample timestamp. @@ -3428,26 +3571,26 @@ ZENOHC_API void z_session_null(struct z_owned_session_t *this_); * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const struct z_owned_shm_t *this_); +ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const struct z_owned_shm_client_t *this_); +ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); #endif /** * Deletes SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_drop(struct z_moved_shm_client_t *this_); +ZENOHC_API void z_shm_client_drop(z_moved_shm_client_t *this_); #endif /** * Creates a new SHM Client */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_new(struct z_owned_shm_client_t *this_, +void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif @@ -3455,179 +3598,177 @@ void z_shm_client_new(struct z_owned_shm_client_t *this_, * Constructs SHM client in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(struct z_owned_shm_client_t *this_); +ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); +ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); #endif /** * Performs a shallow copy of SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_client_storage_clone(struct z_owned_shm_client_storage_t *this_, - const struct z_loaned_shm_client_storage_t *from); +void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, + const z_loaned_shm_client_storage_t *from); #endif /** * Derefs SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); #endif /** * Borrows SHM Client Storage */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const struct z_owned_shm_client_storage_t *this_); +const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm_client_storage_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_client_storage_new(struct z_owned_shm_client_storage_t *this_, - const struct zc_loaned_shm_client_list_t *clients, +z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, + const zc_loaned_shm_client_list_t *clients, bool add_default_client_set); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif /** * Constructs SHM Client Storage in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); +ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); #endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_clone(struct z_owned_shm_t *out, const struct z_loaned_shm_t *this_); +ZENOHC_API void z_shm_clone(z_owned_shm_t *out, const z_loaned_shm_t *this_); #endif /** * @return the pointer of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); +ZENOHC_API const unsigned char *z_shm_data(const z_loaned_shm_t *this_); #endif /** * Deletes ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_drop(struct z_moved_shm_t *this_); +ZENOHC_API void z_shm_drop(z_moved_shm_t *this_); #endif /** * Constructs ZShm slice from ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_from_mut(struct z_owned_shm_t *this_, struct z_moved_shm_mut_t *that); +ZENOHC_API void z_shm_from_mut(z_owned_shm_t *this_, z_moved_shm_mut_t *that); #endif /** * @return the length of the ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_len(const struct z_loaned_shm_t *this_); +ZENOHC_API size_t z_shm_len(const z_loaned_shm_t *this_); #endif /** * Borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); +ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #endif /** * Mutably borrows ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const struct z_owned_shm_mut_t *this_); +ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); #endif /** * @return the immutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); #endif /** * @return the mutable pointer to the underlying data */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); +ZENOHC_API unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); #endif /** * Deletes ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_drop(z_moved_shm_mut_t *this_); #endif /** * @return the length of the ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); +ZENOHC_API size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); #endif /** * Borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); +ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); #endif /** * Mutably borrows ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif /** * Constructs ZShmMut slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(struct z_owned_shm_mut_t *this_); +ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); #endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -void z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, - struct z_moved_shm_t *that); +ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t *that); #endif /** * Constructs ZShm slice in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(struct z_owned_shm_t *this_); +ZENOHC_API void z_shm_null(z_owned_shm_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment, struct zc_threadsafe_context_t result_context, @@ -3637,49 +3778,48 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t *out_result, - const struct z_loaned_shm_provider_t *provider, + const z_loaned_shm_provider_t *provider, size_t size, struct z_alloc_alignment_t alignment); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const struct z_owned_shm_provider_t *this_); +ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif /** * Deletes SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_drop(z_moved_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); +ZENOHC_API size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); #endif /** * Borrows SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API -const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); +ZENOHC_API const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); #endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, - const struct z_loaned_shm_provider_t *provider, +z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, + const z_loaned_shm_provider_t *provider, struct z_allocated_chunk_t allocated_chunk, size_t len); #endif @@ -3688,7 +3828,7 @@ z_result_t z_shm_provider_map(struct z_owned_shm_mut_t *out_result, */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3697,14 +3837,14 @@ void z_shm_provider_new(struct z_owned_shm_provider_t *this_, * Constructs SHM Provider in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(struct z_owned_shm_provider_t *this_); +ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); #endif /** * Creates a new threadsafe SHM Provider */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, +void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, z_protocol_id_t id, struct zc_threadsafe_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); @@ -3713,13 +3853,13 @@ void z_shm_provider_threadsafe_new(struct z_owned_shm_provider_t *this_, * Mutably borrows ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); #endif /** * Tries to reborrow mutably-borrowed ZShm slice as borrowed ZShmMut slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API struct z_loaned_shm_mut_t *z_shm_try_reloan_mut(struct z_loaned_shm_t *this_); +ZENOHC_API z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); #endif /** * Puts current thread to sleep for specified amount of milliseconds. @@ -3798,47 +3938,46 @@ ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const struct z_owned_source_info_t *this_); +ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); #endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_drop(struct z_moved_source_info_t *this_); +ZENOHC_API void z_source_info_drop(z_moved_source_info_t *this_); #endif /** * Returns the source_id of the source info. */ #if defined(UNSTABLE) -ZENOHC_API struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); +ZENOHC_API z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); #endif /** * Borrows source info. */ #if defined(UNSTABLE) -ZENOHC_API -const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); +ZENOHC_API const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); #endif /** * Create source info */ #if defined(UNSTABLE) ZENOHC_API -z_result_t z_source_info_new(struct z_owned_source_info_t *this_, - const struct z_entity_global_id_t *source_id, +z_result_t z_source_info_new(z_owned_source_info_t *this_, + const z_entity_global_id_t *source_id, uint64_t source_sn); #endif /** * Constructs source info in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(struct z_owned_source_info_t *this_); +ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); #endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) -ZENOHC_API uint64_t z_source_info_sn(const struct z_loaned_source_info_t *this_); +ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -4054,7 +4193,7 @@ const char *z_time_now_as_str(const char *buf, * Returns id associated with this timestamp. */ #if defined(UNSTABLE) -ZENOHC_API struct z_id_t z_timestamp_id(const struct z_timestamp_t *this_); +ZENOHC_API z_id_t z_timestamp_id(const struct z_timestamp_t *this_); #endif /** * Create uhlc timestamp from session id. @@ -4422,7 +4561,7 @@ z_result_t zc_liveliness_declare_subscriber(struct z_owned_subscriber_t *this_, */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_liveliness_declare_token(struct zc_owned_liveliness_token_t *this_, +z_result_t zc_liveliness_declare_token(zc_owned_liveliness_token_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, const struct zc_liveliness_declaration_options_t *_options); @@ -4459,32 +4598,32 @@ void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_op * Returns ``true`` if liveliness token is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const struct zc_owned_liveliness_token_t *this_); +ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); #endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_drop(struct zc_moved_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t *this_); #endif /** * Borrows token. */ #if defined(UNSTABLE) ZENOHC_API -const struct zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const struct zc_owned_liveliness_token_t *this_); +const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif /** * Constructs liveliness token in its gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(struct zc_owned_liveliness_token_t *this_); +ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); #endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t zc_liveliness_undeclare_token(struct zc_moved_liveliness_token_t *this_); +ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t *this_); #endif /** * Returns default value of `zc_locality_t` @@ -4496,13 +4635,13 @@ ZENOHC_API enum zc_locality_t zc_locality_default(void); * Checks the matching listener is for the gravestone state */ #if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const struct zc_owned_matching_listener_t *this_); +ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); #endif /** * Constructs an empty matching listener */ #if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(struct zc_owned_matching_listener_t *this_); +ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); #endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. @@ -4525,7 +4664,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if defined(UNSTABLE) ZENOHC_API -z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_listener_t *this_, +z_result_t zc_publisher_matching_listener_declare(zc_owned_matching_listener_t *this_, const struct z_loaned_publisher_t *publisher, struct zc_moved_closure_matching_status_t *callback); #endif @@ -4535,8 +4674,7 @@ z_result_t zc_publisher_matching_listener_declare(struct zc_owned_matching_liste * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener_t *this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_drop(zc_moved_matching_listener_t *this_); #endif /** * Undeclares the given matching listener, droping and invalidating it. @@ -4544,8 +4682,7 @@ z_result_t zc_publisher_matching_listener_drop(struct zc_moved_matching_listener * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t zc_publisher_matching_listener_undeclare(struct zc_moved_matching_listener_t *this_); +ZENOHC_API z_result_t zc_publisher_matching_listener_undeclare(zc_moved_matching_listener_t *this_); #endif /** * Returns the default value of #zc_reply_keyexpr_t. @@ -4556,46 +4693,46 @@ ZENOHC_API enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, - struct z_moved_shm_client_t *client, - struct zc_loaned_shm_client_list_t *list); + z_moved_shm_client_t *client, + zc_loaned_shm_client_list_t *list); #endif /** * Returns ``true`` if `this` is valid. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); +ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); #endif /** * Deletes list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); #endif /** * Borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -const struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const struct zc_owned_shm_client_list_t *this_); +const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_client_list_t *this_); #endif /** * Mutably borrows list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API -struct zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(struct zc_owned_shm_client_list_t *this_); +zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_list_t *this_); #endif /** * Creates a new empty list of SHM Clients */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif /** * Constructs SHM client list in its gravestone value. */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); +ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -4617,7 +4754,7 @@ void zc_stop_z_runtime(void); */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *this_, +z_result_t ze_declare_publication_cache(ze_owned_publication_cache_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); @@ -4635,7 +4772,7 @@ z_result_t ze_declare_publication_cache(struct ze_owned_publication_cache_t *thi */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t *this_, +z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, const struct z_loaned_session_t *session, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t *callback, @@ -4645,19 +4782,19 @@ z_result_t ze_declare_querying_subscriber(struct ze_owned_querying_subscriber_t * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const struct ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** * Drops publication cache. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); #endif /** * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(struct ze_owned_publication_cache_t *this_); +ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** * Constructs the default value for `ze_publication_cache_options_t`. @@ -4669,13 +4806,13 @@ ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); #endif /** * Make querying subscriber perform an additional query on a specified selector. @@ -4684,7 +4821,7 @@ ZENOHC_API void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_ */ #if defined(UNSTABLE) ZENOHC_API -z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber_t *this_, +z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *this_, const struct z_loaned_keyexpr_t *selector, struct z_get_options_t *options); #endif @@ -4693,13 +4830,13 @@ z_result_t ze_querying_subscriber_get(const struct ze_loaned_querying_subscriber */ #if defined(UNSTABLE) ZENOHC_API -const struct ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const struct ze_owned_querying_subscriber_t *this_); +const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. @@ -4713,7 +4850,7 @@ void ze_querying_subscriber_options_default(struct ze_querying_subscriber_option * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); +ZENOHC_API z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); #endif /** * Undeclares the given querying subscriber, drops it and resets to a gravestone state. @@ -4721,6 +4858,5 @@ ZENOHC_API z_result_t ze_undeclare_publication_cache(struct ze_moved_publication * @return 0 in case of success, negative error code otherwise. */ #if defined(UNSTABLE) -ZENOHC_API -z_result_t ze_undeclare_querying_subscriber(struct ze_moved_querying_subscriber_t *_this); +ZENOHC_API z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t *_this); #endif diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 94577f8ff..6e92ea128 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,14 +4,11 @@ #ifndef __cplusplus -static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return (z_moved_alloc_layout_t*)(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return (z_moved_bytes_t*)(x); } -static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return (z_moved_chunk_alloc_result_t*)(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return (z_moved_closure_hello_t*)(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return (z_moved_closure_query_t*)(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return (z_moved_closure_reply_t*)(x); } static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return (z_moved_closure_sample_t*)(x); } -static inline z_moved_closure_zid_t* z_closure_zid_move(z_owned_closure_zid_t* x) { return (z_moved_closure_zid_t*)(x); } static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return (z_moved_condvar_t*)(x); } static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return (z_moved_config_t*)(x); } static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return (z_moved_encoding_t*)(x); } @@ -20,7 +17,6 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return (z_moved_fifo_handler_sample_t*)(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return (z_moved_hello_t*)(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return (z_moved_keyexpr_t*)(x); } -static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return (z_moved_memory_layout_t*)(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return (z_moved_mutex_t*)(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return (z_moved_publisher_t*)(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return (z_moved_query_t*)(x); } @@ -32,36 +28,21 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return (z_moved_ring_handler_sample_t*)(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return (z_moved_sample_t*)(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return (z_moved_session_t*)(x); } -static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return (z_moved_shm_client_t*)(x); } -static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return (z_moved_shm_client_storage_t*)(x); } -static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return (z_moved_shm_t*)(x); } -static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return (z_moved_shm_mut_t*)(x); } -static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return (z_moved_shm_provider_t*)(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return (z_moved_slice_t*)(x); } -static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return (z_moved_source_info_t*)(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return (z_moved_string_array_t*)(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return (z_moved_string_t*)(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return (z_moved_subscriber_t*)(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return (z_moved_task_t*)(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return (zc_moved_closure_log_t*)(x); } -static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return (zc_moved_closure_matching_status_t*)(x); } -static inline zc_moved_liveliness_token_t* zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return (zc_moved_liveliness_token_t*)(x); } -static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return (zc_moved_matching_listener_t*)(x); } -static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return (zc_moved_shm_client_list_t*)(x); } -static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return (ze_moved_publication_cache_t*)(x); } -static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return (ze_moved_querying_subscriber_t*)(x); } #define z_loan(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_loan, \ z_owned_bytes_t : z_bytes_loan, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ z_owned_closure_query_t : z_closure_query_loan, \ z_owned_closure_reply_t : z_closure_reply_loan, \ z_owned_closure_sample_t : z_closure_sample_loan, \ - z_owned_closure_zid_t : z_closure_zid_loan, \ z_owned_condvar_t : z_condvar_loan, \ z_owned_config_t : z_config_loan, \ z_owned_encoding_t : z_encoding_loan, \ @@ -70,7 +51,6 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_fifo_handler_sample_t : z_fifo_handler_sample_loan, \ z_owned_hello_t : z_hello_loan, \ z_owned_keyexpr_t : z_keyexpr_loan, \ - z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ @@ -81,23 +61,14 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_ring_handler_sample_t : z_ring_handler_sample_loan, \ z_owned_sample_t : z_sample_loan, \ z_owned_session_t : z_session_loan, \ - z_owned_shm_client_storage_t : z_shm_client_storage_loan, \ - z_owned_shm_t : z_shm_loan, \ - z_owned_shm_mut_t : z_shm_mut_loan, \ - z_owned_shm_provider_t : z_shm_provider_loan, \ z_owned_slice_t : z_slice_loan, \ - z_owned_source_info_t : z_source_info_loan, \ z_owned_string_array_t : z_string_array_loan, \ z_owned_string_t : z_string_loan, \ z_owned_subscriber_t : z_subscriber_loan, \ z_view_keyexpr_t : z_view_keyexpr_loan, \ z_view_slice_t : z_view_slice_loan, \ z_view_string_t : z_view_string_loan, \ - zc_owned_closure_log_t : zc_closure_log_loan, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_loan, \ - zc_owned_liveliness_token_t : zc_liveliness_token_loan, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_loan \ + zc_owned_closure_log_t : zc_closure_log_loan \ )(&this_) #define z_loan_mut(this_) \ @@ -108,22 +79,16 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_encoding_t : z_encoding_loan_mut, \ z_owned_mutex_t : z_mutex_loan_mut, \ z_owned_publisher_t : z_publisher_loan_mut, \ - z_owned_shm_t : z_shm_loan_mut, \ - z_owned_shm_mut_t : z_shm_mut_loan_mut, \ - z_owned_string_array_t : z_string_array_loan_mut, \ - zc_owned_shm_client_list_t : zc_shm_client_list_loan_mut \ + z_owned_string_array_t : z_string_array_loan_mut \ )(&this_) #define z_drop(this_) \ _Generic((this_), \ - z_moved_alloc_layout_t* : z_alloc_layout_drop, \ z_moved_bytes_t* : z_bytes_drop, \ - z_moved_chunk_alloc_result_t* : z_chunk_alloc_result_drop, \ z_moved_closure_hello_t* : z_closure_hello_drop, \ z_moved_closure_query_t* : z_closure_query_drop, \ z_moved_closure_reply_t* : z_closure_reply_drop, \ z_moved_closure_sample_t* : z_closure_sample_drop, \ - z_moved_closure_zid_t* : z_closure_zid_drop, \ z_moved_condvar_t* : z_condvar_drop, \ z_moved_config_t* : z_config_drop, \ z_moved_encoding_t* : z_encoding_drop, \ @@ -132,7 +97,6 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_moved_fifo_handler_sample_t* : z_fifo_handler_sample_drop, \ z_moved_hello_t* : z_hello_drop, \ z_moved_keyexpr_t* : z_keyexpr_drop, \ - z_moved_memory_layout_t* : z_memory_layout_drop, \ z_moved_mutex_t* : z_mutex_drop, \ z_moved_publisher_t* : z_publisher_drop, \ z_moved_query_t* : z_query_drop, \ @@ -144,36 +108,21 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_moved_ring_handler_sample_t* : z_ring_handler_sample_drop, \ z_moved_sample_t* : z_sample_drop, \ z_moved_session_t* : z_session_drop, \ - z_moved_shm_client_t* : z_shm_client_drop, \ - z_moved_shm_client_storage_t* : z_shm_client_storage_drop, \ - z_moved_shm_t* : z_shm_drop, \ - z_moved_shm_mut_t* : z_shm_mut_drop, \ - z_moved_shm_provider_t* : z_shm_provider_drop, \ z_moved_slice_t* : z_slice_drop, \ - z_moved_source_info_t* : z_source_info_drop, \ z_moved_string_array_t* : z_string_array_drop, \ z_moved_string_t* : z_string_drop, \ z_moved_subscriber_t* : z_subscriber_drop, \ z_moved_task_t* : z_task_drop, \ - zc_moved_closure_log_t* : zc_closure_log_drop, \ - zc_moved_closure_matching_status_t* : zc_closure_matching_status_drop, \ - zc_moved_liveliness_token_t* : zc_liveliness_token_drop, \ - zc_moved_matching_listener_t* : zc_publisher_matching_listener_drop, \ - zc_moved_shm_client_list_t* : zc_shm_client_list_drop, \ - ze_moved_publication_cache_t* : ze_publication_cache_drop, \ - ze_moved_querying_subscriber_t* : ze_querying_subscriber_drop \ + zc_moved_closure_log_t* : zc_closure_log_drop \ )(this_) #define z_move(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_move, \ z_owned_bytes_t : z_bytes_move, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_move, \ z_owned_closure_hello_t : z_closure_hello_move, \ z_owned_closure_query_t : z_closure_query_move, \ z_owned_closure_reply_t : z_closure_reply_move, \ z_owned_closure_sample_t : z_closure_sample_move, \ - z_owned_closure_zid_t : z_closure_zid_move, \ z_owned_condvar_t : z_condvar_move, \ z_owned_config_t : z_config_move, \ z_owned_encoding_t : z_encoding_move, \ @@ -182,7 +131,6 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_fifo_handler_sample_t : z_fifo_handler_sample_move, \ z_owned_hello_t : z_hello_move, \ z_owned_keyexpr_t : z_keyexpr_move, \ - z_owned_memory_layout_t : z_memory_layout_move, \ z_owned_mutex_t : z_mutex_move, \ z_owned_publisher_t : z_publisher_move, \ z_owned_query_t : z_query_move, \ @@ -194,36 +142,21 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_ring_handler_sample_t : z_ring_handler_sample_move, \ z_owned_sample_t : z_sample_move, \ z_owned_session_t : z_session_move, \ - z_owned_shm_client_t : z_shm_client_move, \ - z_owned_shm_client_storage_t : z_shm_client_storage_move, \ - z_owned_shm_t : z_shm_move, \ - z_owned_shm_mut_t : z_shm_mut_move, \ - z_owned_shm_provider_t : z_shm_provider_move, \ z_owned_slice_t : z_slice_move, \ - z_owned_source_info_t : z_source_info_move, \ z_owned_string_array_t : z_string_array_move, \ z_owned_string_t : z_string_move, \ z_owned_subscriber_t : z_subscriber_move, \ z_owned_task_t : z_task_move, \ - zc_owned_closure_log_t : zc_closure_log_move, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ - zc_owned_liveliness_token_t : zc_liveliness_token_move, \ - zc_owned_matching_listener_t : zc_publisher_matching_listener_move, \ - zc_owned_shm_client_list_t : zc_shm_client_list_move, \ - ze_owned_publication_cache_t : ze_publication_cache_move, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_move \ + zc_owned_closure_log_t : zc_closure_log_move \ )(&this_) #define z_null(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_null, \ z_owned_bytes_t* : z_bytes_null, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_null, \ z_owned_closure_hello_t* : z_closure_hello_null, \ z_owned_closure_query_t* : z_closure_query_null, \ z_owned_closure_reply_t* : z_closure_reply_null, \ z_owned_closure_sample_t* : z_closure_sample_null, \ - z_owned_closure_zid_t* : z_closure_zid_null, \ z_owned_condvar_t* : z_condvar_null, \ z_owned_config_t* : z_config_null, \ z_owned_encoding_t* : z_encoding_null, \ @@ -232,7 +165,6 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ z_owned_hello_t* : z_hello_null, \ z_owned_keyexpr_t* : z_keyexpr_null, \ - z_owned_memory_layout_t* : z_memory_layout_null, \ z_owned_mutex_t* : z_mutex_null, \ z_owned_publisher_t* : z_publisher_null, \ z_owned_query_t* : z_query_null, \ @@ -244,34 +176,19 @@ static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_own z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ z_owned_sample_t* : z_sample_null, \ z_owned_session_t* : z_session_null, \ - z_owned_shm_client_t* : z_shm_client_null, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_null, \ - z_owned_shm_mut_t* : z_shm_mut_null, \ - z_owned_shm_t* : z_shm_null, \ - z_owned_shm_provider_t* : z_shm_provider_null, \ z_owned_slice_t* : z_slice_null, \ - z_owned_source_info_t* : z_source_info_null, \ z_owned_string_array_t* : z_string_array_null, \ z_owned_string_t* : z_string_null, \ z_owned_subscriber_t* : z_subscriber_null, \ z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_null, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_null, \ - zc_owned_matching_listener_t* : zc_matching_listener_null, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_null, \ - ze_owned_publication_cache_t* : ze_publication_cache_null, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_null \ + zc_owned_closure_log_t* : zc_closure_log_null \ )(this_) -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { *closure_ = x->_this; z_closure_zid_null(&x->_this); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } @@ -280,7 +197,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } @@ -292,36 +208,21 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_shm_client_null(&x->_this); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_shm_client_storage_null(&x->_this); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_shm_null(&x->_this); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_shm_mut_null(&x->_this); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_closure_matching_status_null(&x->_this); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { *this_ = x->_this; zc_liveliness_token_null(&x->_this); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_matching_listener_null(&x->_this); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_shm_client_list_null(&x->_this); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_publication_cache_null(&x->_this); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_querying_subscriber_null(&x->_this); } #define z_take(this_, x) \ _Generic((this_), \ - z_owned_alloc_layout_t* : z_alloc_layout_take, \ z_owned_bytes_t* : z_bytes_take, \ - z_owned_chunk_alloc_result_t* : z_chunk_alloc_result_take, \ z_owned_closure_hello_t* : z_closure_hello_take, \ z_owned_closure_query_t* : z_closure_query_take, \ z_owned_closure_reply_t* : z_closure_reply_take, \ z_owned_closure_sample_t* : z_closure_sample_take, \ - z_owned_closure_zid_t* : z_closure_zid_take, \ z_owned_condvar_t* : z_condvar_take, \ z_owned_config_t* : z_config_take, \ z_owned_encoding_t* : z_encoding_take, \ @@ -330,7 +231,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_take, \ z_owned_hello_t* : z_hello_take, \ z_owned_keyexpr_t* : z_keyexpr_take, \ - z_owned_memory_layout_t* : z_memory_layout_take, \ z_owned_mutex_t* : z_mutex_take, \ z_owned_publisher_t* : z_publisher_take, \ z_owned_query_t* : z_query_take, \ @@ -342,36 +242,21 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t* : z_ring_handler_sample_take, \ z_owned_sample_t* : z_sample_take, \ z_owned_session_t* : z_session_take, \ - z_owned_shm_client_t* : z_shm_client_take, \ - z_owned_shm_client_storage_t* : z_shm_client_storage_take, \ - z_owned_shm_t* : z_shm_take, \ - z_owned_shm_mut_t* : z_shm_mut_take, \ - z_owned_shm_provider_t* : z_shm_provider_take, \ z_owned_slice_t* : z_slice_take, \ - z_owned_source_info_t* : z_source_info_take, \ z_owned_string_array_t* : z_string_array_take, \ z_owned_string_t* : z_string_take, \ z_owned_subscriber_t* : z_subscriber_take, \ z_owned_task_t* : z_task_take, \ - zc_owned_closure_log_t* : zc_closure_log_take, \ - zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ - zc_owned_liveliness_token_t* : zc_liveliness_token_take, \ - zc_owned_matching_listener_t* : zc_publisher_matching_listener_take, \ - zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ - ze_owned_publication_cache_t* : ze_publication_cache_take, \ - ze_owned_querying_subscriber_t* : ze_querying_subscriber_take \ + zc_owned_closure_log_t* : zc_closure_log_take \ )(this_, x) #define z_check(this_) \ _Generic((this_), \ - z_owned_alloc_layout_t : z_alloc_layout_check, \ z_owned_bytes_t : z_bytes_check, \ - z_owned_chunk_alloc_result_t : z_chunk_alloc_result_check, \ z_owned_closure_hello_t : z_closure_hello_check, \ z_owned_closure_query_t : z_closure_query_check, \ z_owned_closure_reply_t : z_closure_reply_check, \ z_owned_closure_sample_t : z_closure_sample_check, \ - z_owned_closure_zid_t : z_closure_zid_check, \ z_owned_condvar_t : z_condvar_check, \ z_owned_config_t : z_config_check, \ z_owned_encoding_t : z_encoding_check, \ @@ -380,7 +265,6 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ z_owned_hello_t : z_hello_check, \ z_owned_keyexpr_t : z_keyexpr_check, \ - z_owned_memory_layout_t : z_memory_layout_check, \ z_owned_mutex_t : z_mutex_check, \ z_owned_publisher_t : z_publisher_check, \ z_owned_query_t : z_query_check, \ @@ -392,24 +276,12 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ z_owned_sample_t : z_sample_check, \ z_owned_session_t : z_session_check, \ - z_owned_shm_t : z_shm_check, \ - z_owned_shm_client_t : z_shm_client_check, \ - z_owned_shm_client_storage_t : z_shm_client_storage_check, \ - z_owned_shm_mut_t : z_shm_mut_check, \ - z_owned_shm_provider_t : z_shm_provider_check, \ z_owned_slice_t : z_slice_check, \ - z_owned_source_info_t : z_source_info_check, \ z_owned_string_array_t : z_string_array_check, \ z_owned_string_t : z_string_check, \ z_owned_subscriber_t : z_subscriber_check, \ z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check, \ - zc_owned_closure_matching_status_t : zc_closure_matching_status_check, \ - zc_owned_liveliness_token_t : zc_liveliness_token_check, \ - zc_owned_matching_listener_t : zc_matching_listener_check, \ - zc_owned_shm_client_list_t : zc_shm_client_list_check, \ - ze_owned_publication_cache_t : ze_publication_cache_check, \ - ze_owned_querying_subscriber_t : ze_querying_subscriber_check \ + zc_owned_closure_log_t : zc_closure_log_check \ )(&this_) #define z_call(closure, hello) \ @@ -417,9 +289,7 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t const z_loaned_closure_hello_t* : z_closure_hello_call, \ const z_loaned_closure_query_t* : z_closure_query_call, \ const z_loaned_closure_reply_t* : z_closure_reply_call, \ - const z_loaned_closure_sample_t* : z_closure_sample_call, \ - const z_loaned_closure_zid_t* : z_closure_zid_call, \ - const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ + const z_loaned_closure_sample_t* : z_closure_sample_call \ )(closure, hello) #define z_closure(x, callback, dropper, ctx) \ @@ -447,14 +317,11 @@ static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* t #else // #ifndef __cplusplus -static inline z_moved_alloc_layout_t* z_alloc_layout_move(z_owned_alloc_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_bytes_t* z_bytes_move(z_owned_bytes_t* x) { return reinterpret_cast(x); } -static inline z_moved_chunk_alloc_result_t* z_chunk_alloc_result_move(z_owned_chunk_alloc_result_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_hello_t* z_closure_hello_move(z_owned_closure_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_query_t* z_closure_query_move(z_owned_closure_query_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_reply_t* z_closure_reply_move(z_owned_closure_reply_t* x) { return reinterpret_cast(x); } static inline z_moved_closure_sample_t* z_closure_sample_move(z_owned_closure_sample_t* x) { return reinterpret_cast(x); } -static inline z_moved_closure_zid_t* z_closure_zid_move(z_owned_closure_zid_t* x) { return reinterpret_cast(x); } static inline z_moved_condvar_t* z_condvar_move(z_owned_condvar_t* x) { return reinterpret_cast(x); } static inline z_moved_config_t* z_config_move(z_owned_config_t* x) { return reinterpret_cast(x); } static inline z_moved_encoding_t* z_encoding_move(z_owned_encoding_t* x) { return reinterpret_cast(x); } @@ -463,7 +330,6 @@ static inline z_moved_fifo_handler_reply_t* z_fifo_handler_reply_move(z_owned_fi static inline z_moved_fifo_handler_sample_t* z_fifo_handler_sample_move(z_owned_fifo_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_hello_t* z_hello_move(z_owned_hello_t* x) { return reinterpret_cast(x); } static inline z_moved_keyexpr_t* z_keyexpr_move(z_owned_keyexpr_t* x) { return reinterpret_cast(x); } -static inline z_moved_memory_layout_t* z_memory_layout_move(z_owned_memory_layout_t* x) { return reinterpret_cast(x); } static inline z_moved_mutex_t* z_mutex_move(z_owned_mutex_t* x) { return reinterpret_cast(x); } static inline z_moved_publisher_t* z_publisher_move(z_owned_publisher_t* x) { return reinterpret_cast(x); } static inline z_moved_query_t* z_query_move(z_owned_query_t* x) { return reinterpret_cast(x); } @@ -475,35 +341,20 @@ static inline z_moved_ring_handler_reply_t* z_ring_handler_reply_move(z_owned_ri static inline z_moved_ring_handler_sample_t* z_ring_handler_sample_move(z_owned_ring_handler_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_sample_t* z_sample_move(z_owned_sample_t* x) { return reinterpret_cast(x); } static inline z_moved_session_t* z_session_move(z_owned_session_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_client_t* z_shm_client_move(z_owned_shm_client_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_client_storage_t* z_shm_client_storage_move(z_owned_shm_client_storage_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_t* z_shm_move(z_owned_shm_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_mut_t* z_shm_mut_move(z_owned_shm_mut_t* x) { return reinterpret_cast(x); } -static inline z_moved_shm_provider_t* z_shm_provider_move(z_owned_shm_provider_t* x) { return reinterpret_cast(x); } static inline z_moved_slice_t* z_slice_move(z_owned_slice_t* x) { return reinterpret_cast(x); } -static inline z_moved_source_info_t* z_source_info_move(z_owned_source_info_t* x) { return reinterpret_cast(x); } static inline z_moved_string_array_t* z_string_array_move(z_owned_string_array_t* x) { return reinterpret_cast(x); } static inline z_moved_string_t* z_string_move(z_owned_string_t* x) { return reinterpret_cast(x); } static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* x) { return reinterpret_cast(x); } static inline z_moved_task_t* z_task_move(z_owned_task_t* x) { return reinterpret_cast(x); } static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t* x) { return reinterpret_cast(x); } -static inline zc_moved_closure_matching_status_t* zc_closure_matching_status_move(zc_owned_closure_matching_status_t* x) { return reinterpret_cast(x); } -static inline zc_moved_liveliness_token_t* zc_liveliness_token_move(zc_owned_liveliness_token_t* x) { return reinterpret_cast(x); } -static inline zc_moved_matching_listener_t* zc_publisher_matching_listener_move(zc_owned_matching_listener_t* x) { return reinterpret_cast(x); } -static inline zc_moved_shm_client_list_t* zc_shm_client_list_move(zc_owned_shm_client_list_t* x) { return reinterpret_cast(x); } -static inline ze_moved_publication_cache_t* ze_publication_cache_move(ze_owned_publication_cache_t* x) { return reinterpret_cast(x); } -static inline ze_moved_querying_subscriber_t* ze_querying_subscriber_move(ze_owned_querying_subscriber_t* x) { return reinterpret_cast(x); } -inline const z_loaned_alloc_layout_t* z_loan(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_loan(&this_); }; inline const z_loaned_bytes_t* z_loan(const z_owned_bytes_t& this_) { return z_bytes_loan(&this_); }; -inline const z_loaned_chunk_alloc_result_t* z_loan(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_loan(&this_); }; inline const z_loaned_closure_hello_t* z_loan(const z_owned_closure_hello_t& closure) { return z_closure_hello_loan(&closure); }; inline const z_loaned_closure_query_t* z_loan(const z_owned_closure_query_t& closure) { return z_closure_query_loan(&closure); }; inline const z_loaned_closure_reply_t* z_loan(const z_owned_closure_reply_t& closure) { return z_closure_reply_loan(&closure); }; inline const z_loaned_closure_sample_t* z_loan(const z_owned_closure_sample_t& closure) { return z_closure_sample_loan(&closure); }; -inline const z_loaned_closure_zid_t* z_loan(const z_owned_closure_zid_t& closure) { return z_closure_zid_loan(&closure); }; inline const z_loaned_condvar_t* z_loan(const z_owned_condvar_t& this_) { return z_condvar_loan(&this_); }; inline const z_loaned_config_t* z_loan(const z_owned_config_t& this_) { return z_config_loan(&this_); }; inline const z_loaned_encoding_t* z_loan(const z_owned_encoding_t& this_) { return z_encoding_loan(&this_); }; @@ -512,7 +363,6 @@ inline const z_loaned_fifo_handler_reply_t* z_loan(const z_owned_fifo_handler_re inline const z_loaned_fifo_handler_sample_t* z_loan(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_loan(&this_); }; inline const z_loaned_hello_t* z_loan(const z_owned_hello_t& this_) { return z_hello_loan(&this_); }; inline const z_loaned_keyexpr_t* z_loan(const z_owned_keyexpr_t& this_) { return z_keyexpr_loan(&this_); }; -inline const z_loaned_memory_layout_t* z_loan(const z_owned_memory_layout_t& this_) { return z_memory_layout_loan(&this_); }; inline const z_loaned_publisher_t* z_loan(const z_owned_publisher_t& this_) { return z_publisher_loan(&this_); }; inline const z_loaned_query_t* z_loan(const z_owned_query_t& this_) { return z_query_loan(&this_); }; inline const z_loaned_queryable_t* z_loan(const z_owned_queryable_t& this_) { return z_queryable_loan(&this_); }; @@ -523,12 +373,7 @@ inline const z_loaned_ring_handler_reply_t* z_loan(const z_owned_ring_handler_re inline const z_loaned_ring_handler_sample_t* z_loan(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_loan(&this_); }; inline const z_loaned_sample_t* z_loan(const z_owned_sample_t& this_) { return z_sample_loan(&this_); }; inline const z_loaned_session_t* z_loan(const z_owned_session_t& this_) { return z_session_loan(&this_); }; -inline const z_loaned_shm_client_storage_t* z_loan(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_loan(&this_); }; -inline const z_loaned_shm_t* z_loan(const z_owned_shm_t& this_) { return z_shm_loan(&this_); }; -inline const z_loaned_shm_mut_t* z_loan(const z_owned_shm_mut_t& this_) { return z_shm_mut_loan(&this_); }; -inline const z_loaned_shm_provider_t* z_loan(const z_owned_shm_provider_t& this_) { return z_shm_provider_loan(&this_); }; inline const z_loaned_slice_t* z_loan(const z_owned_slice_t& this_) { return z_slice_loan(&this_); }; -inline const z_loaned_source_info_t* z_loan(const z_owned_source_info_t& this_) { return z_source_info_loan(&this_); }; inline const z_loaned_string_array_t* z_loan(const z_owned_string_array_t& this_) { return z_string_array_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_owned_string_t& this_) { return z_string_loan(&this_); }; inline const z_loaned_subscriber_t* z_loan(const z_owned_subscriber_t& this_) { return z_subscriber_loan(&this_); }; @@ -536,10 +381,6 @@ inline const z_loaned_keyexpr_t* z_loan(const z_view_keyexpr_t& this_) { return inline const z_loaned_slice_t* z_loan(const z_view_slice_t& this_) { return z_view_slice_loan(&this_); }; inline const z_loaned_string_t* z_loan(const z_view_string_t& this_) { return z_view_string_loan(&this_); }; inline const zc_loaned_closure_log_t* z_loan(const zc_owned_closure_log_t& closure) { return zc_closure_log_loan(&closure); }; -inline const zc_loaned_closure_matching_status_t* z_loan(const zc_owned_closure_matching_status_t& closure) { return zc_closure_matching_status_loan(&closure); }; -inline const zc_loaned_liveliness_token_t* z_loan(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_loan(&this_); }; -inline const zc_loaned_shm_client_list_t* z_loan(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan(&this_); }; -inline const ze_loaned_querying_subscriber_t* z_loan(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_loan(&this_); }; inline z_loaned_bytes_t* z_loan_mut(z_owned_bytes_t& this_) { return z_bytes_loan_mut(&this_); }; @@ -548,20 +389,14 @@ inline z_loaned_config_t* z_loan_mut(z_owned_config_t& this_) { return z_config_ inline z_loaned_encoding_t* z_loan_mut(z_owned_encoding_t& this_) { return z_encoding_loan_mut(&this_); }; inline z_loaned_mutex_t* z_loan_mut(z_owned_mutex_t& this_) { return z_mutex_loan_mut(&this_); }; inline z_loaned_publisher_t* z_loan_mut(z_owned_publisher_t& this_) { return z_publisher_loan_mut(&this_); }; -inline z_loaned_shm_t* z_loan_mut(z_owned_shm_t& this_) { return z_shm_loan_mut(&this_); }; -inline z_loaned_shm_mut_t* z_loan_mut(z_owned_shm_mut_t& this_) { return z_shm_mut_loan_mut(&this_); }; inline z_loaned_string_array_t* z_loan_mut(z_owned_string_array_t& this_) { return z_string_array_loan_mut(&this_); }; -inline zc_loaned_shm_client_list_t* z_loan_mut(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_loan_mut(&this_); }; -inline void z_drop(z_moved_alloc_layout_t* this_) { z_alloc_layout_drop(this_); }; inline void z_drop(z_moved_bytes_t* this_) { z_bytes_drop(this_); }; -inline void z_drop(z_moved_chunk_alloc_result_t* this_) { z_chunk_alloc_result_drop(this_); }; inline void z_drop(z_moved_closure_hello_t* this_) { z_closure_hello_drop(this_); }; inline void z_drop(z_moved_closure_query_t* closure_) { z_closure_query_drop(closure_); }; inline void z_drop(z_moved_closure_reply_t* closure_) { z_closure_reply_drop(closure_); }; inline void z_drop(z_moved_closure_sample_t* closure_) { z_closure_sample_drop(closure_); }; -inline void z_drop(z_moved_closure_zid_t* closure_) { z_closure_zid_drop(closure_); }; inline void z_drop(z_moved_condvar_t* this_) { z_condvar_drop(this_); }; inline void z_drop(z_moved_config_t* this_) { z_config_drop(this_); }; inline void z_drop(z_moved_encoding_t* this_) { z_encoding_drop(this_); }; @@ -570,7 +405,6 @@ inline void z_drop(z_moved_fifo_handler_reply_t* this_) { z_fifo_handler_reply_d inline void z_drop(z_moved_fifo_handler_sample_t* this_) { z_fifo_handler_sample_drop(this_); }; inline void z_drop(z_moved_hello_t* this_) { z_hello_drop(this_); }; inline void z_drop(z_moved_keyexpr_t* this_) { z_keyexpr_drop(this_); }; -inline void z_drop(z_moved_memory_layout_t* this_) { z_memory_layout_drop(this_); }; inline void z_drop(z_moved_mutex_t* this_) { z_mutex_drop(this_); }; inline void z_drop(z_moved_publisher_t* this_) { z_publisher_drop(this_); }; inline void z_drop(z_moved_query_t* this_) { z_query_drop(this_); }; @@ -582,34 +416,19 @@ inline void z_drop(z_moved_ring_handler_reply_t* this_) { z_ring_handler_reply_d inline void z_drop(z_moved_ring_handler_sample_t* this_) { z_ring_handler_sample_drop(this_); }; inline void z_drop(z_moved_sample_t* this_) { z_sample_drop(this_); }; inline void z_drop(z_moved_session_t* this_) { z_session_drop(this_); }; -inline void z_drop(z_moved_shm_client_t* this_) { z_shm_client_drop(this_); }; -inline void z_drop(z_moved_shm_client_storage_t* this_) { z_shm_client_storage_drop(this_); }; -inline void z_drop(z_moved_shm_t* this_) { z_shm_drop(this_); }; -inline void z_drop(z_moved_shm_mut_t* this_) { z_shm_mut_drop(this_); }; -inline void z_drop(z_moved_shm_provider_t* this_) { z_shm_provider_drop(this_); }; inline void z_drop(z_moved_slice_t* this_) { z_slice_drop(this_); }; -inline void z_drop(z_moved_source_info_t* this_) { z_source_info_drop(this_); }; inline void z_drop(z_moved_string_array_t* this_) { z_string_array_drop(this_); }; inline void z_drop(z_moved_string_t* this_) { z_string_drop(this_); }; inline void z_drop(z_moved_subscriber_t* this_) { z_subscriber_drop(this_); }; inline void z_drop(z_moved_task_t* this_) { z_task_drop(this_); }; inline void z_drop(zc_moved_closure_log_t* closure_) { zc_closure_log_drop(closure_); }; -inline void z_drop(zc_moved_closure_matching_status_t* closure_) { zc_closure_matching_status_drop(closure_); }; -inline void z_drop(zc_moved_liveliness_token_t* this_) { zc_liveliness_token_drop(this_); }; -inline z_result_t z_drop(zc_moved_matching_listener_t* this_) { return zc_publisher_matching_listener_drop(this_); }; -inline void z_drop(zc_moved_shm_client_list_t* this_) { zc_shm_client_list_drop(this_); }; -inline void z_drop(ze_moved_publication_cache_t* this_) { ze_publication_cache_drop(this_); }; -inline void z_drop(ze_moved_querying_subscriber_t* this_) { ze_querying_subscriber_drop(this_); }; -inline z_moved_alloc_layout_t* z_move(z_owned_alloc_layout_t& this_) { return z_alloc_layout_move(&this_); }; inline z_moved_bytes_t* z_move(z_owned_bytes_t& this_) { return z_bytes_move(&this_); }; -inline z_moved_chunk_alloc_result_t* z_move(z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_move(&this_); }; inline z_moved_closure_hello_t* z_move(z_owned_closure_hello_t& this_) { return z_closure_hello_move(&this_); }; inline z_moved_closure_query_t* z_move(z_owned_closure_query_t& closure_) { return z_closure_query_move(&closure_); }; inline z_moved_closure_reply_t* z_move(z_owned_closure_reply_t& closure_) { return z_closure_reply_move(&closure_); }; inline z_moved_closure_sample_t* z_move(z_owned_closure_sample_t& closure_) { return z_closure_sample_move(&closure_); }; -inline z_moved_closure_zid_t* z_move(z_owned_closure_zid_t& closure_) { return z_closure_zid_move(&closure_); }; inline z_moved_condvar_t* z_move(z_owned_condvar_t& this_) { return z_condvar_move(&this_); }; inline z_moved_config_t* z_move(z_owned_config_t& this_) { return z_config_move(&this_); }; inline z_moved_encoding_t* z_move(z_owned_encoding_t& this_) { return z_encoding_move(&this_); }; @@ -618,7 +437,6 @@ inline z_moved_fifo_handler_reply_t* z_move(z_owned_fifo_handler_reply_t& this_) inline z_moved_fifo_handler_sample_t* z_move(z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_move(&this_); }; inline z_moved_hello_t* z_move(z_owned_hello_t& this_) { return z_hello_move(&this_); }; inline z_moved_keyexpr_t* z_move(z_owned_keyexpr_t& this_) { return z_keyexpr_move(&this_); }; -inline z_moved_memory_layout_t* z_move(z_owned_memory_layout_t& this_) { return z_memory_layout_move(&this_); }; inline z_moved_mutex_t* z_move(z_owned_mutex_t& this_) { return z_mutex_move(&this_); }; inline z_moved_publisher_t* z_move(z_owned_publisher_t& this_) { return z_publisher_move(&this_); }; inline z_moved_query_t* z_move(z_owned_query_t& this_) { return z_query_move(&this_); }; @@ -630,34 +448,19 @@ inline z_moved_ring_handler_reply_t* z_move(z_owned_ring_handler_reply_t& this_) inline z_moved_ring_handler_sample_t* z_move(z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_move(&this_); }; inline z_moved_sample_t* z_move(z_owned_sample_t& this_) { return z_sample_move(&this_); }; inline z_moved_session_t* z_move(z_owned_session_t& this_) { return z_session_move(&this_); }; -inline z_moved_shm_client_t* z_move(z_owned_shm_client_t& this_) { return z_shm_client_move(&this_); }; -inline z_moved_shm_client_storage_t* z_move(z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_move(&this_); }; -inline z_moved_shm_t* z_move(z_owned_shm_t& this_) { return z_shm_move(&this_); }; -inline z_moved_shm_mut_t* z_move(z_owned_shm_mut_t& this_) { return z_shm_mut_move(&this_); }; -inline z_moved_shm_provider_t* z_move(z_owned_shm_provider_t& this_) { return z_shm_provider_move(&this_); }; inline z_moved_slice_t* z_move(z_owned_slice_t& this_) { return z_slice_move(&this_); }; -inline z_moved_source_info_t* z_move(z_owned_source_info_t& this_) { return z_source_info_move(&this_); }; inline z_moved_string_array_t* z_move(z_owned_string_array_t& this_) { return z_string_array_move(&this_); }; inline z_moved_string_t* z_move(z_owned_string_t& this_) { return z_string_move(&this_); }; inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subscriber_move(&this_); }; inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_); }; inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; -inline zc_moved_closure_matching_status_t* z_move(zc_owned_closure_matching_status_t& closure_) { return zc_closure_matching_status_move(&closure_); }; -inline zc_moved_liveliness_token_t* z_move(zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_move(&this_); }; -inline zc_moved_matching_listener_t* z_move(zc_owned_matching_listener_t& this_) { return zc_publisher_matching_listener_move(&this_); }; -inline zc_moved_shm_client_list_t* z_move(zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_move(&this_); }; -inline ze_moved_publication_cache_t* z_move(ze_owned_publication_cache_t& this_) { return ze_publication_cache_move(&this_); }; -inline ze_moved_querying_subscriber_t* z_move(ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_move(&this_); }; -inline void z_null(z_owned_alloc_layout_t* this_) { z_alloc_layout_null(this_); }; inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; -inline void z_null(z_owned_chunk_alloc_result_t* this_) { z_chunk_alloc_result_null(this_); }; inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; -inline void z_null(z_owned_closure_zid_t* this_) { z_closure_zid_null(this_); }; inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; @@ -666,7 +469,6 @@ inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_n inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; -inline void z_null(z_owned_memory_layout_t* this_) { z_memory_layout_null(this_); }; inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; @@ -678,33 +480,18 @@ inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_n inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; -inline void z_null(z_owned_shm_client_t* this_) { z_shm_client_null(this_); }; -inline void z_null(z_owned_shm_client_storage_t* this_) { z_shm_client_storage_null(this_); }; -inline void z_null(z_owned_shm_mut_t* this_) { z_shm_mut_null(this_); }; -inline void z_null(z_owned_shm_t* this_) { z_shm_null(this_); }; -inline void z_null(z_owned_shm_provider_t* this_) { z_shm_provider_null(this_); }; inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; -inline void z_null(z_owned_source_info_t* this_) { z_source_info_null(this_); }; inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; -inline void z_null(zc_owned_closure_matching_status_t* this_) { zc_closure_matching_status_null(this_); }; -inline void z_null(zc_owned_liveliness_token_t* this_) { zc_liveliness_token_null(this_); }; -inline void z_null(zc_owned_matching_listener_t* this_) { zc_matching_listener_null(this_); }; -inline void z_null(zc_owned_shm_client_list_t* this_) { zc_shm_client_list_null(this_); }; -inline void z_null(ze_owned_publication_cache_t* this_) { ze_publication_cache_null(this_); }; -inline void z_null(ze_owned_querying_subscriber_t* this_) { ze_querying_subscriber_null(this_); }; -static inline void z_alloc_layout_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { *this_ = x->_this; z_alloc_layout_null(&x->_this); } static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } -static inline void z_chunk_alloc_result_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { *this_ = x->_this; z_chunk_alloc_result_null(&x->_this); } static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } -static inline void z_closure_zid_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { *closure_ = x->_this; z_closure_zid_null(&x->_this); } static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } @@ -713,7 +500,6 @@ static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_ static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } -static inline void z_memory_layout_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { *this_ = x->_this; z_memory_layout_null(&x->_this); } static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } @@ -725,36 +511,18 @@ static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_ static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } -static inline void z_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_shm_client_null(&x->_this); } -static inline void z_shm_client_storage_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { *this_ = x->_this; z_shm_client_storage_null(&x->_this); } -static inline void z_shm_take(z_owned_shm_t* this_, z_moved_shm_t* x) { *this_ = x->_this; z_shm_null(&x->_this); } -static inline void z_shm_mut_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { *this_ = x->_this; z_shm_mut_null(&x->_this); } -static inline void z_shm_provider_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { *this_ = x->_this; z_shm_provider_null(&x->_this); } static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } -static inline void z_source_info_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { *this_ = x->_this; z_source_info_null(&x->_this); } static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } -static inline void zc_closure_matching_status_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { *closure_ = x->_this; zc_closure_matching_status_null(&x->_this); } -static inline void zc_liveliness_token_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { *this_ = x->_this; zc_liveliness_token_null(&x->_this); } -static inline void zc_publisher_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_matching_listener_null(&x->_this); } -static inline void zc_shm_client_list_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { *this_ = x->_this; zc_shm_client_list_null(&x->_this); } -static inline void ze_publication_cache_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { *this_ = x->_this; ze_publication_cache_null(&x->_this); } -static inline void ze_querying_subscriber_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { *this_ = x->_this; ze_querying_subscriber_null(&x->_this); } -inline void z_take(z_owned_alloc_layout_t* this_, z_moved_alloc_layout_t* x) { - z_alloc_layout_take(this_, x); -}; inline void z_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { z_bytes_take(this_, x); }; -inline void z_take(z_owned_chunk_alloc_result_t* this_, z_moved_chunk_alloc_result_t* x) { - z_chunk_alloc_result_take(this_, x); -}; inline void z_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { z_closure_hello_take(this_, x); }; @@ -767,9 +535,6 @@ inline void z_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x inline void z_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { z_closure_sample_take(closure_, x); }; -inline void z_take(z_owned_closure_zid_t* closure_, z_moved_closure_zid_t* x) { - z_closure_zid_take(closure_, x); -}; inline void z_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { z_condvar_take(this_, x); }; @@ -794,9 +559,6 @@ inline void z_take(z_owned_hello_t* this_, z_moved_hello_t* x) { inline void z_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { z_keyexpr_take(this_, x); }; -inline void z_take(z_owned_memory_layout_t* this_, z_moved_memory_layout_t* x) { - z_memory_layout_take(this_, x); -}; inline void z_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { z_mutex_take(this_, x); }; @@ -830,27 +592,9 @@ inline void z_take(z_owned_sample_t* this_, z_moved_sample_t* x) { inline void z_take(z_owned_session_t* this_, z_moved_session_t* x) { z_session_take(this_, x); }; -inline void z_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { - z_shm_client_take(this_, x); -}; -inline void z_take(z_owned_shm_client_storage_t* this_, z_moved_shm_client_storage_t* x) { - z_shm_client_storage_take(this_, x); -}; -inline void z_take(z_owned_shm_t* this_, z_moved_shm_t* x) { - z_shm_take(this_, x); -}; -inline void z_take(z_owned_shm_mut_t* this_, z_moved_shm_mut_t* x) { - z_shm_mut_take(this_, x); -}; -inline void z_take(z_owned_shm_provider_t* this_, z_moved_shm_provider_t* x) { - z_shm_provider_take(this_, x); -}; inline void z_take(z_owned_slice_t* this_, z_moved_slice_t* x) { z_slice_take(this_, x); }; -inline void z_take(z_owned_source_info_t* this_, z_moved_source_info_t* x) { - z_source_info_take(this_, x); -}; inline void z_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { z_string_array_take(this_, x); }; @@ -866,34 +610,13 @@ inline void z_take(z_owned_task_t* this_, z_moved_task_t* x) { inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { zc_closure_log_take(closure_, x); }; -inline void z_take(zc_owned_closure_matching_status_t* closure_, zc_moved_closure_matching_status_t* x) { - zc_closure_matching_status_take(closure_, x); -}; -inline void z_take(zc_owned_liveliness_token_t* this_, zc_moved_liveliness_token_t* x) { - zc_liveliness_token_take(this_, x); -}; -inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { - zc_publisher_matching_listener_take(this_, x); -}; -inline void z_take(zc_owned_shm_client_list_t* this_, zc_moved_shm_client_list_t* x) { - zc_shm_client_list_take(this_, x); -}; -inline void z_take(ze_owned_publication_cache_t* this_, ze_moved_publication_cache_t* x) { - ze_publication_cache_take(this_, x); -}; -inline void z_take(ze_owned_querying_subscriber_t* this_, ze_moved_querying_subscriber_t* x) { - ze_querying_subscriber_take(this_, x); -}; -inline bool z_check(const z_owned_alloc_layout_t& this_) { return z_alloc_layout_check(&this_); }; inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_chunk_alloc_result_t& this_) { return z_chunk_alloc_result_check(&this_); }; inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; -inline bool z_check(const z_owned_closure_zid_t& this_) { return z_closure_zid_check(&this_); }; inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; @@ -902,7 +625,6 @@ inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_h inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; -inline bool z_check(const z_owned_memory_layout_t& this_) { return z_memory_layout_check(&this_); }; inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; @@ -914,24 +636,12 @@ inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_h inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; -inline bool z_check(const z_owned_shm_t& this_) { return z_shm_check(&this_); }; -inline bool z_check(const z_owned_shm_client_t& this_) { return z_shm_client_check(&this_); }; -inline bool z_check(const z_owned_shm_client_storage_t& this_) { return z_shm_client_storage_check(&this_); }; -inline bool z_check(const z_owned_shm_mut_t& this_) { return z_shm_mut_check(&this_); }; -inline bool z_check(const z_owned_shm_provider_t& this_) { return z_shm_provider_check(&this_); }; inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; -inline bool z_check(const z_owned_source_info_t& this_) { return z_source_info_check(&this_); }; inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; -inline bool z_check(const zc_owned_closure_matching_status_t& this_) { return zc_closure_matching_status_check(&this_); }; -inline bool z_check(const zc_owned_liveliness_token_t& this_) { return zc_liveliness_token_check(&this_); }; -inline bool z_check(const zc_owned_matching_listener_t& this_) { return zc_matching_listener_check(&this_); }; -inline bool z_check(const zc_owned_shm_client_list_t& this_) { return zc_shm_client_list_check(&this_); }; -inline bool z_check(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_check(&this_); }; -inline bool z_check(const ze_owned_querying_subscriber_t& this_) { return ze_querying_subscriber_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { @@ -946,12 +656,6 @@ inline void z_call(const z_loaned_closure_reply_t* closure, const z_loaned_reply inline void z_call(const z_loaned_closure_sample_t* closure, const z_loaned_sample_t* sample) { z_closure_sample_call(closure, sample); }; -inline void z_call(const z_loaned_closure_zid_t* closure, const z_id_t* z_id) { - z_closure_zid_call(closure, z_id); -}; -inline void z_call(const zc_loaned_closure_matching_status_t* closure, const zc_matching_status_t* mathing_status) { - zc_closure_matching_status_call(closure, mathing_status); -}; inline void z_closure( @@ -990,24 +694,6 @@ inline void z_closure( closure->drop = drop; closure->call = call; }; -inline void z_closure( - z_owned_closure_zid_t* closure, - void (*call)(const z_id_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; -inline void z_closure( - zc_owned_closure_matching_status_t* closure, - void (*call)(const zc_matching_status_t*, void*), - void (*drop)(void*), - void *context) { - closure->context = context; - closure->drop = drop; - closure->call = call; -}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -1051,12 +737,8 @@ inline z_result_t z_recv(const z_loaned_ring_handler_sample_t* this_, z_owned_sa template struct z_loaned_to_owned_type_t {}; template struct z_owned_to_loaned_type_t {}; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_alloc_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_alloc_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_bytes_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_bytes_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_chunk_alloc_result_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_chunk_alloc_result_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_hello_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_query_t type; }; @@ -1065,8 +747,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_reply_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_sample_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_sample_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_closure_zid_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_closure_zid_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_condvar_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_condvar_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_config_t type; }; @@ -1083,8 +763,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_h template<> struct z_owned_to_loaned_type_t { typedef z_loaned_hello_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_keyexpr_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_keyexpr_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_memory_layout_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_memory_layout_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_publisher_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_publisher_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; @@ -1105,18 +783,8 @@ template<> struct z_loaned_to_owned_type_t { typedef z_owned_ template<> struct z_owned_to_loaned_type_t { typedef z_loaned_sample_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_session_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_session_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_client_storage_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_client_storage_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_mut_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_mut_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_shm_provider_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_shm_provider_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_slice_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_slice_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef z_owned_source_info_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef z_loaned_source_info_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_array_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_string_array_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_string_t type; }; @@ -1125,14 +793,6 @@ template<> struct z_loaned_to_owned_type_t { typedef z_ow template<> struct z_owned_to_loaned_type_t { typedef z_loaned_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_log_t type; }; template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_log_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_closure_matching_status_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_closure_matching_status_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_liveliness_token_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_liveliness_token_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef zc_owned_shm_client_list_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef zc_loaned_shm_client_list_t type; }; -template<> struct z_loaned_to_owned_type_t { typedef ze_owned_querying_subscriber_t type; }; -template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_querying_subscriber_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_mutex_t type; }; #endif // #ifndef __cplusplus From 12237a18a975281d2495310cd435394226c08cb1 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 15:31:48 +0200 Subject: [PATCH 087/397] cargo fmt fix --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 711a5f700..e36016ab4 100644 --- a/build.rs +++ b/build.rs @@ -180,7 +180,7 @@ pub struct {type_name} {{ "#[repr(C)] #[derive(Default)] pub struct {moved_type_name} {{ - _this: {type_name} + _this: {type_name}, }} impl crate::transmute::TakeCType for {moved_type_name} {{ From d841847cbc9047a53575b3696cbf4be232c21f3b Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Fri, 16 Aug 2024 16:16:56 +0200 Subject: [PATCH 088/397] check in build.rs restored --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index e36016ab4..98f558a70 100644 --- a/build.rs +++ b/build.rs @@ -1023,7 +1023,7 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { } if !msgs.is_empty() { - // panic!("Some functions are missing:\n{}", msgs.join("\n")); + panic!("Some functions are missing:\n{}", msgs.join("\n")); } let out = generate_move_functions_c(&move_funcs); From e66140ce346663374d103e0f708274eaf3abe5c9 Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Mon, 19 Aug 2024 23:02:42 +0800 Subject: [PATCH 089/397] fix: misuse the callback in z_info --- examples/z_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/z_info.c b/examples/z_info.c index 49b900ce8..584bf5d05 100644 --- a/examples/z_info.c +++ b/examples/z_info.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) { // we'll just have to make sure we `z_move` it again to avoid mem-leaks. printf("peers ids:\n"); z_owned_closure_zid_t callback2; - z_closure(&callback, print_zid, NULL, NULL); + z_closure(&callback2, print_zid, NULL, NULL); z_info_peers_zid(z_loan(s), z_move(callback2)); z_close(z_move(s)); From b4824e6ee73004225f387824f0deda50649f5b1b Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Tue, 20 Aug 2024 15:20:23 +0800 Subject: [PATCH 090/397] refactor: use `z_id_to_string` for displaying `z_id_t` --- docs/api.rst | 3 ++- examples/z_info.c | 8 ++++---- src/info.rs | 11 ++++++++++- tests/z_api_alignment_test.c | 17 +++++++---------- 4 files changed, 23 insertions(+), 16 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 6bd722e18..98d48fe96 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -510,6 +510,7 @@ Functions .. doxygenfunction:: z_info_zid .. doxygenfunction:: z_info_routers_zid .. doxygenfunction:: z_info_peers_zid +.. doxygenfunction:: z_id_to_string .. doxygenfunction:: z_closure_zid_check .. doxygenfunction:: z_closure_zid_null @@ -900,4 +901,4 @@ Other Functions --------- -.. doxygenfunction:: zc_stop_z_runtime \ No newline at end of file +.. doxygenfunction:: zc_stop_z_runtime diff --git a/examples/z_info.c b/examples/z_info.c index 584bf5d05..d88e08560 100644 --- a/examples/z_info.c +++ b/examples/z_info.c @@ -16,10 +16,10 @@ #include "zenoh.h" void print_zid(const z_id_t *id, void *ctx) { - for (int i = 0; i < 16; i++) { - printf("%02x", id->id[i]); - } - printf("\n"); + z_owned_string_t str; + z_id_to_string(id, &str); + printf("%.*s\n", (int)z_string_len(z_loan(str)), z_string_data(z_loan(str))); + z_drop(z_move(str)); } int main(int argc, char **argv) { diff --git a/src/info.rs b/src/info.rs index ec9187531..d1e431d68 100644 --- a/src/info.rs +++ b/src/info.rs @@ -11,13 +11,15 @@ // Contributors: // ZettaScale Zenoh team, // +use std::mem::MaybeUninit; use zenoh::{prelude::*, session::ZenohId}; pub use crate::opaque_types::z_id_t; use crate::{ result, - transmute::{CTypeRef, IntoCType, RustTypeRef, TakeRustType}, + transmute::{CTypeRef, IntoCType, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_closure_zid_call, z_closure_zid_loan, z_loaned_session_t, z_moved_closure_zid_t, + z_owned_string_t, }; decl_c_type!(copy(z_id_t, ZenohId)); @@ -27,6 +29,13 @@ impl From<[u8; 16]> for z_id_t { } } +/// Formats the `z_id_t` into 16-digit hex string (LSB-first order) +#[no_mangle] +pub extern "C" fn z_id_to_string(zid: &z_id_t, dst: &mut MaybeUninit) { + let zid = zid.as_rust_type_ref(); + dst.as_rust_type_mut_uninit().write(zid.to_string().into()); +} + /// Returns the session's Zenoh ID. /// /// Unless the `session` is invalid, that ID is guaranteed to be non-zero. diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index c235a13ef..6d92e3cf2 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -203,11 +203,10 @@ int main(int argc, char **argv) { #ifdef UNSTABLE z_id_t _ret_zid = z_info_zid(z_loan(s1)); - printf("Session 1 with PID: 0x"); - for (unsigned long i = 0; i < sizeof(_ret_zid); i++) { - printf("%.2X", _ret_zid.id[i]); - } - printf("\n"); + z_owned_string_t str; + z_id_to_string(&_ret_zid, &str); + printf("Session 1 with PID: 0x%.*s\n", (int)z_string_len(z_loan(str)), z_string_data(z_loan(str))); + z_drop(z_move(str)); z_owned_closure_zid_t _ret_closure_zid; z_closure(&_ret_closure_zid, zid_handler, NULL, NULL); @@ -248,11 +247,9 @@ int main(int argc, char **argv) { #ifdef UNSTABLE _ret_zid = z_info_zid(z_loan(s2)); - printf("Session 2 with PID: 0x"); - for (unsigned long i = 0; i < sizeof(_ret_zid); i++) { - printf("%.2X", _ret_zid.id[i]); - } - printf("\n"); + z_id_to_string(&_ret_zid, &str); + printf("Session 2 with PID: 0x%.*s\n", (int)z_string_len(z_loan(str)), z_string_data(z_loan(str))); + z_drop(z_move(str)); #endif #ifdef ZENOH_PICO From 5c67b8016e7875ef569a69e38bfe84b1b7207155 Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Tue, 20 Aug 2024 15:25:25 +0800 Subject: [PATCH 091/397] recheck ECA From c6ee2f465f2c347285a8689123d171b5537b2874 Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Tue, 20 Aug 2024 15:32:26 +0800 Subject: [PATCH 092/397] cargo fmt --- src/info.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/info.rs b/src/info.rs index d1e431d68..ffe8a158f 100644 --- a/src/info.rs +++ b/src/info.rs @@ -12,6 +12,7 @@ // ZettaScale Zenoh team, // use std::mem::MaybeUninit; + use zenoh::{prelude::*, session::ZenohId}; pub use crate::opaque_types::z_id_t; From b57e9ef454441f8474a615a1ebb633f8437481ee Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot Date: Tue, 20 Aug 2024 14:59:30 +0000 Subject: [PATCH 093/397] chore: Bump version to `1.0.0.0` --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index 6e5d683f0..bd2666abb 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.11.0.0 \ No newline at end of file +1.0.0.0 \ No newline at end of file From e2258f2a8c1c62d45fc872d9b99066a593e59a64 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot Date: Tue, 20 Aug 2024 14:59:30 +0000 Subject: [PATCH 094/397] chore: Bump libzenohc-dev version to `1.0.0~dev-1` --- Cargo.toml | 4 ++-- Cargo.toml.in | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 367ff9ed2..1620e91b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ # [package] name = "zenoh-c" -version = "0.11.0-dev" +version = "1.0.0-dev" repository = "https://github.com/eclipse-zenoh/zenoh-c" homepage = "http://zenoh.io" authors = [ @@ -86,7 +86,7 @@ maintainer = "zenoh-dev@eclipse.org" copyright = "2017, 2022 ZettaScale Technology" section = "net" license-file = ["LICENSE", "0"] -depends = "libzenohc (=0.11.0-dev-1)" +depends = "libzenohc (=1.0.0~dev-1)" assets = [["include/*", "usr/include/", "755"]] [profile.dev] diff --git a/Cargo.toml.in b/Cargo.toml.in index 7f60c486b..7a8512fec 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -86,7 +86,7 @@ maintainer = "zenoh-dev@eclipse.org" copyright = "2017, 2022 ZettaScale Technology" section = "net" license-file = ["LICENSE", "0"] -depends = "libzenohc (=0.11.0-dev-1)" +depends = "libzenohc (=1.0.0~dev-1)" assets = [["include/*", "usr/include/", "755"]] [profile.dev] From 8941ccb4f2064b2380b42a2755b2fc6a8d8b8783 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot Date: Tue, 20 Aug 2024 14:59:31 +0000 Subject: [PATCH 095/397] chore: Bump `/zenoh.*/` dependencies to `1.0.0-dev` --- Cargo.toml | 8 ++++---- Cargo.toml.in | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1620e91b7..3c651a157 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -52,10 +52,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } -zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } -zenoh-runtime = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } -zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" [build-dependencies] diff --git a/Cargo.toml.in b/Cargo.toml.in index 7a8512fec..7ecac40d5 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -52,10 +52,10 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } -zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } -zenoh-runtime = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } -zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" [build-dependencies] From 6797264f19ff98b8dfae512af030641a0dbd40c1 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot Date: Tue, 20 Aug 2024 15:01:42 +0000 Subject: [PATCH 096/397] chore: Update Cargo.lock to `1.0.0-dev` --- Cargo.lock | 110 ++++++++++++++++++++++++++--------------------------- 1 file changed, 55 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 246aca820..377680df1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3593,8 +3593,8 @@ dependencies = [ [[package]] name = "zenoh" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "ahash", "async-trait", @@ -3651,15 +3651,15 @@ dependencies = [ [[package]] name = "zenoh-buffers" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "zenoh-collections", ] [[package]] name = "zenoh-c" -version = "0.11.0-dev" +version = "1.0.0-dev" dependencies = [ "async-std", "async-trait", @@ -3689,8 +3689,8 @@ dependencies = [ [[package]] name = "zenoh-codec" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "serde", "tracing", @@ -3702,13 +3702,13 @@ dependencies = [ [[package]] name = "zenoh-collections" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" [[package]] name = "zenoh-config" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "flume", "json5", @@ -3729,8 +3729,8 @@ dependencies = [ [[package]] name = "zenoh-core" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-global-executor", "lazy_static", @@ -3741,8 +3741,8 @@ dependencies = [ [[package]] name = "zenoh-crypto" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "aes", "hmac", @@ -3754,8 +3754,8 @@ dependencies = [ [[package]] name = "zenoh-ext" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "bincode", "flume", @@ -3773,8 +3773,8 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3787,8 +3787,8 @@ dependencies = [ [[package]] name = "zenoh-link" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "zenoh-config", @@ -3805,8 +3805,8 @@ dependencies = [ [[package]] name = "zenoh-link-commons" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "flume", @@ -3830,8 +3830,8 @@ dependencies = [ [[package]] name = "zenoh-link-quic" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "base64 0.22.1", @@ -3861,8 +3861,8 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3880,8 +3880,8 @@ dependencies = [ [[package]] name = "zenoh-link-tls" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "base64 0.22.1", @@ -3911,8 +3911,8 @@ dependencies = [ [[package]] name = "zenoh-link-udp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3932,8 +3932,8 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "futures", @@ -3952,8 +3952,8 @@ dependencies = [ [[package]] name = "zenoh-link-ws" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "futures-util", @@ -3973,8 +3973,8 @@ dependencies = [ [[package]] name = "zenoh-macros" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "proc-macro2", "quote", @@ -3984,8 +3984,8 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "libloading", "serde", @@ -3999,8 +3999,8 @@ dependencies = [ [[package]] name = "zenoh-protocol" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "const_format", "rand", @@ -4014,16 +4014,16 @@ dependencies = [ [[package]] name = "zenoh-result" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "anyhow", ] [[package]] name = "zenoh-runtime" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "futures", "lazy_static", @@ -4037,8 +4037,8 @@ dependencies = [ [[package]] name = "zenoh-shm" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "bincode", @@ -4061,8 +4061,8 @@ dependencies = [ [[package]] name = "zenoh-sync" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "event-listener 5.3.1", "futures", @@ -4075,8 +4075,8 @@ dependencies = [ [[package]] name = "zenoh-task" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "futures", "tokio", @@ -4088,8 +4088,8 @@ dependencies = [ [[package]] name = "zenoh-transport" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "flume", @@ -4121,8 +4121,8 @@ dependencies = [ [[package]] name = "zenoh-util" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "const_format", From 33ab5ea88750733ae3e01334d84df1def8d59f6e Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot Date: Tue, 20 Aug 2024 15:02:30 +0000 Subject: [PATCH 097/397] chore: Bump build-resources/opaque-types version to `1.0.0-dev` --- build-resources/opaque-types/Cargo.lock | 108 ++++++++++++------------ build-resources/opaque-types/Cargo.toml | 8 +- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index bf01256ac..96ca8eb87 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3285,8 +3285,8 @@ dependencies = [ [[package]] name = "zenoh" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "ahash", "async-trait", @@ -3343,16 +3343,16 @@ dependencies = [ [[package]] name = "zenoh-buffers" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "zenoh-collections", ] [[package]] name = "zenoh-codec" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "serde", "tracing", @@ -3364,13 +3364,13 @@ dependencies = [ [[package]] name = "zenoh-collections" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" [[package]] name = "zenoh-config" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "flume", "json5", @@ -3391,8 +3391,8 @@ dependencies = [ [[package]] name = "zenoh-core" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-global-executor", "lazy_static", @@ -3403,8 +3403,8 @@ dependencies = [ [[package]] name = "zenoh-crypto" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "aes", "hmac", @@ -3416,8 +3416,8 @@ dependencies = [ [[package]] name = "zenoh-ext" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "bincode", "flume", @@ -3435,8 +3435,8 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "hashbrown", "keyed-set", @@ -3449,8 +3449,8 @@ dependencies = [ [[package]] name = "zenoh-link" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "zenoh-config", @@ -3467,8 +3467,8 @@ dependencies = [ [[package]] name = "zenoh-link-commons" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "flume", @@ -3492,8 +3492,8 @@ dependencies = [ [[package]] name = "zenoh-link-quic" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "base64 0.22.1", @@ -3523,8 +3523,8 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3542,8 +3542,8 @@ dependencies = [ [[package]] name = "zenoh-link-tls" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "base64 0.22.1", @@ -3573,8 +3573,8 @@ dependencies = [ [[package]] name = "zenoh-link-udp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3594,8 +3594,8 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "futures", @@ -3614,8 +3614,8 @@ dependencies = [ [[package]] name = "zenoh-link-ws" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "futures-util", @@ -3635,8 +3635,8 @@ dependencies = [ [[package]] name = "zenoh-macros" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "proc-macro2", "quote", @@ -3646,8 +3646,8 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "libloading", "serde", @@ -3661,8 +3661,8 @@ dependencies = [ [[package]] name = "zenoh-protocol" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "const_format", "rand", @@ -3676,16 +3676,16 @@ dependencies = [ [[package]] name = "zenoh-result" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "anyhow", ] [[package]] name = "zenoh-runtime" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "futures", "lazy_static", @@ -3699,8 +3699,8 @@ dependencies = [ [[package]] name = "zenoh-shm" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "bincode", @@ -3723,8 +3723,8 @@ dependencies = [ [[package]] name = "zenoh-sync" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "event-listener 5.3.1", "futures", @@ -3737,8 +3737,8 @@ dependencies = [ [[package]] name = "zenoh-task" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "futures", "tokio", @@ -3750,8 +3750,8 @@ dependencies = [ [[package]] name = "zenoh-transport" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "flume", @@ -3783,8 +3783,8 @@ dependencies = [ [[package]] name = "zenoh-util" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#0e2f78a7cfe4e6f9aa7056cfdd58607e1ddcbd9f" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.toml b/build-resources/opaque-types/Cargo.toml index 2554a58bf..bedb5107f 100644 --- a/build-resources/opaque-types/Cargo.toml +++ b/build-resources/opaque-types/Cargo.toml @@ -12,8 +12,8 @@ panic = [] # The whole purpose of this project is to generate set of compilation default = ["zenoh/default"] [dependencies] -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } -zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true} -zenoh-protocol = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true} +zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } const_format = "0.2.32" -flume = "*" \ No newline at end of file +flume = "*" From e626980de573de7cc50b5a9653ee9f403410a507 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 21 Aug 2024 10:20:04 +0200 Subject: [PATCH 098/397] merge main branch into dev/1.0.0 (after "moved_as_ptr" update) (#600) * fix: Rename `bump.bash` to `bump-and-tag.bash` * feat: Add `version.txt` and infer version in `bump-and-tag.bash` * fix: Clone repository using actions/checkout * fix: Add `CMakeFiles` to `.gitignore` * fix: Add `debug` and `release` to `.gitignore` * fix: Provide default release number for testing * fix: Don't bump deps when pattern is undefined * fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330) Co-authored-by: eclipse-zenoh-bot * fix: Specify git remote when pushing the tag * fix: Require `VERSION`in `bump-and-tag.bash` * fix: Override release tag if it already exists * feat(tracing): using tracing and zenoh-util init_log (#308) * feat(tracing): using tracing and zenoh-util init_log Signed-off-by: gabrik * chore: adding Cargo.lock Signed-off-by: gabrik * chore: updated Cargo.toml.in Signed-off-by: gabrik * feat(tracing): using zenoh main branch Signed-off-by: gabrik --------- Signed-off-by: gabrik * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337) Co-authored-by: eclipse-zenoh-bot * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * chore: using new try_init_log_from_env Signed-off-by: gabrik * Align examples and remove reading from stdin (#255) * Remove reading from stdin, align example implementations * Add argument parsing implementation for examples * Add argument parsing to examples, format files * Replace getchar with sleep in z_pong example * Fix typo in include * Use null-pointers instead of empty strings, remove unnecessary mallocs * Free returned pointer after parse_pos_args usage * Add common and positional args parsing to z_ping example * Add formatting for parsed config options * Add const to function parameters * Update mode option help * Fix pos_args memory leak * Refactor parse_args, remove possible strcpy buffer overflow * Change parse_args function returns to const where applicable * Fix const initialization warning * Remove redundant const for value parameters * Fix buf variable memory leak * Update insert json-list config error message * Add usage example for -e and -l arguments in help * Update example notation in help message Co-authored-by: Alexander * Update example notation in help message (2/2) * Fix parameter in error message Co-authored-by: Alexander --------- Co-authored-by: Alexander * Bugfix: Unable to build z_queryable_with_channels.c (#340) Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343) Co-authored-by: eclipse-zenoh-bot * Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360) Co-authored-by: eclipse-zenoh-bot * Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). * build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420) Co-authored-by: eclipse-zenoh-bot * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457) Co-authored-by: eclipse-zenoh-bot * Enable releasing from any branch (#456) * build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460) Co-authored-by: eclipse-zenoh-bot * Update to latest zenoh * Replace `-rc` with `-pre` and document versioning (#466) * build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467) Co-authored-by: eclipse-zenoh-bot * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494) Co-authored-by: eclipse-zenoh-bot * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500) Co-authored-by: eclipse-zenoh-bot * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508) Co-authored-by: eclipse-zenoh-bot * Ensure that find_package(zenohc) can be called two times (#470) * Update CMakeLists.txt (#473) * Install zenohc.dll in /bin on Windows (#471) * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552) Co-authored-by: eclipse-zenoh-bot * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556) Co-authored-by: eclipse-zenoh-bot * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * decl_c_type corrected * cargo check run * borrow error fix * compilation fix * parse arg fix * example compilation fix * examples compile fix * examples build fixes * removed duplicated z_config_default (it's called in parsing args later) * clang format * clang format * cargo.toml restore --------- Signed-off-by: gabrik Signed-off-by: ChenYing Kuo Co-authored-by: Mahmoud Mazouz Co-authored-by: Denis Biryukov Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: eclipse-zenoh-bot Co-authored-by: Mahmoud Mazouz Co-authored-by: Gabriele Baldoni Co-authored-by: gabrik Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: ChenYing Kuo (CY) Co-authored-by: Jochen Sprickerhof Co-authored-by: Diogo Matsubara Co-authored-by: OlivierHecart Co-authored-by: Silvio Traversaro Co-authored-by: Luca Cominardi --- .gitignore | 7 +- examples/parse_args.h | 216 +++++++++++++++++++++++++++ examples/z_delete.c | 63 ++++++-- examples/z_get.c | 96 ++++++++---- examples/z_get_liveliness.c | 74 ++++++--- examples/z_info.c | 49 ++++-- examples/z_liveliness.c | 89 +++++++---- examples/z_non_blocking_get.c | 76 +++++++--- examples/z_ping.c | 87 +++++------ examples/z_pong.c | 71 +++++---- examples/z_pub.c | 99 ++++++++---- examples/z_pub_attachment.c | 79 +++++++--- examples/z_pub_cache.c | 85 ++++++++--- examples/z_pub_shm.c | 92 ++++++++---- examples/z_pub_thr.c | 71 ++++++--- examples/z_pull.c | 92 ++++++++---- examples/z_put.c | 79 +++++++--- examples/z_query_sub.c | 87 +++++++---- examples/z_queryable.c | 90 +++++++---- examples/z_queryable_with_channels.c | 85 ++++++++--- examples/z_sub.c | 91 +++++++---- examples/z_sub_attachment.c | 88 +++++++---- examples/z_sub_liveliness.c | 85 +++++++---- examples/z_sub_thr.c | 62 ++++++-- src/keyexpr.rs | 2 +- src/liveliness.rs | 2 +- 26 files changed, 1451 insertions(+), 566 deletions(-) create mode 100644 examples/parse_args.h diff --git a/.gitignore b/.gitignore index 8fbb4b478..f7b04b718 100644 --- a/.gitignore +++ b/.gitignore @@ -75,4 +75,9 @@ include/zenoh_opaque.h # Build resources .build_resources* -src/opaque_types/mod.rs \ No newline at end of file +src/opaque_types/mod.rs + +# CMake +CMakeFiles/ +debug/ +release/ diff --git a/examples/parse_args.h b/examples/parse_args.h new file mode 100644 index 000000000..7708ba6b5 --- /dev/null +++ b/examples/parse_args.h @@ -0,0 +1,216 @@ +// +// Copyright (c) 2024 ZettaScale Technology +// +// This program and the accompanying materials are made available under the +// terms of the Eclipse Public License 2.0 which is available at +// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +// which is available at https://www.apache.org/licenses/LICENSE-2.0. +// +// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +// +// Contributors: +// ZettaScale Zenoh Team, +// + +#pragma once + +#include +#include +#include + +#include "zenoh.h" + +#define COMMON_HELP \ + "\ + -c (optional, string): The path to a configuration file for the session. If this option isn't passed, the default configuration will be used.\n\ + -m (optional, string, default='peer'): The zenoh session mode. [possible values: peer, client, router]\n\ + -e (optional, string): endpoint to connect to. Repeat option to pass multiple endpoints. If none are given, endpoints will be discovered through multicast-scouting if it is enabled.\n\ + e.g.: '-e tcp/192.168.1.1:7447'\n\ + -l (optional, string): locator to listen on. Repeat option to pass multiple locators. If none are given, the default configuration will be used.\n\ + e.g.: '-l tcp/192.168.1.1:7447'\n\ + --no-multicast-scouting (optional): By default zenohd replies to multicast scouting messages for being discovered by peers and clients. This option disables this feature.\n\ +" + +/** + * Parse an option of format `-f`, `--flag`, `-f ` or `--flag ` from `argv`. If found, the option and its + * eventual value are each replaced by NULL in `argv` + * @param argc: argc passed from `main` function + * @param argv: argv passed from `main` function + * @param opt: option to parse (without `-` or `--` prefix) + * @param opt_has_value: if true, the option is of format `-f ` or `--flag ` and `value` will be returned + * if found, else an error message is printed and program will exit. If false, option has no value and a non-null + * pointer will be returned if option is found. + * @returns NULL if option was not found, else a non-null value depending on if `opt_has_value`. + */ +const char* parse_opt(int argc, char** argv, const char* opt, bool opt_has_value) { + size_t optlen = strlen(opt); + for (int i = 1; i < argc; i++) { + if (argv[i] == NULL) { + continue; + } + size_t len = strlen(argv[i]); + if (len < 2) { + continue; + } + if (optlen == 1) { + if (argv[i][0] == '-' && argv[i][1] == opt[0]) { + argv[i] = NULL; + if (!opt_has_value) { + return (char*)opt; + } else if (i + 1 < argc && argv[i + 1]) { + char* value = argv[i + 1]; + argv[i + 1] = NULL; + return value; + } else { + printf("Option -%s given without a value\n", opt); + exit(-1); + } + } + } else if (optlen > 1 && len > 3 && argv[i][0] == '-' && argv[i][1] == '-') { + // Note: support for '--arg=' syntax can be added here + if (strcmp(argv[i] + 2, opt) == 0) { + argv[i] = NULL; + if (!opt_has_value) { + return (char*)opt; + } else if (i + 1 < argc && argv[i + 1]) { + char* value = argv[i + 1]; + argv[i + 1] = NULL; + return value; + } else { + printf("Option --%s given without a value\n", opt); + exit(-1); + } + } + } + } + return NULL; +} + +/** + * Check if any options remains in `argv`. Must be called after all expected options are parsed + * @param argc + * @param argv + * @returns NULL if no option was found, else the first option string that was found + */ +const char* check_unknown_opts(int argc, char** const argv) { + for (int i = 1; i < argc; i++) { + if (argv[i] && argv[i][0] == '-') { + return argv[i]; + } + } + return NULL; +} + +/** + * Parse positional arguments from `argv`. Must be called after all expected options are parsed, and after checking that + * no unknown options remain in `argv` + * @param argc + * @param argv + * @param nb_args: number of expected positional arguments + * @returns NULL if found more positional arguments than `nb_args`. Else an array of found arguments in order, followed + * by NULL values if found less positional arguments than `nb_args` + * @note Returned pointer is dynamically allocated and must be freed + */ +char** parse_pos_args(const int argc, char** argv, const size_t nb_args) { + char** pos_argv = (char**)calloc(nb_args, sizeof(char*)); + size_t pos_argc = 0; + for (int i = 1; i < argc; i++) { + if (argv[i]) { + pos_argc++; + if (pos_argc > nb_args) { + free(pos_argv); + return NULL; + } + pos_argv[pos_argc - 1] = argv[i]; + } + } + return pos_argv; +} + +/** + * Parse zenoh options that require a JSON-serialized list (-e, -l from common args) and add them to + * `config`. Prints error message and exits if fails to insert parsed values + * @param argc + * @param argv + * @param opt: option to parse (without `-` or `--` prefix) + * @param config: address of an owned zenoh configuration + * @param config_key: zenoh configuration key under which the parsed values will be inserted + */ +void parse_zenoh_json_list_config(int argc, char** argv, const char* opt, const char* config_key, + z_owned_config_t* config) { + char* buf = (char*)calloc(1, sizeof(char)); + const char* value = parse_opt(argc, argv, opt, true); + while (value) { + size_t len_newbuf = strlen(buf) + strlen(value) + 4; // value + quotes + comma + nullbyte + char* newbuf = (char*)malloc(len_newbuf); + snprintf(newbuf, len_newbuf, "%s'%s',", buf, value); + free(buf); + buf = newbuf; + value = parse_opt(argc, argv, opt, true); + } + size_t buflen = strlen(buf); + if (buflen > 0) { + // remove trailing comma + buf[buflen - 1] = '\0'; + buflen--; + // add list delimiters + size_t json_list_len = buflen + 3; // buf + brackets + nullbyte + char* json_list = (char*)malloc(json_list_len); + snprintf(json_list, json_list_len, "[%s]", buf); + // insert in config + if (zc_config_insert_json(z_loan_mut(*config), config_key, json_list) < 0) { + printf( + "Couldn't insert value `%s` in configuration at `%s`\n`%s` is either not a JSON-serialized list of " + "strings, or values within the list do not respect expected format for `%s`\n", + json_list, config_key, json_list, config_key); + free(json_list); + exit(-1); + } + free(json_list); + } + free(buf); +} + +/** + * Parse zenoh options that are common to all examples (-c, -m, -e, -l, --no-multicast-scouting) and add them to + * `config` + * @param argc + * @param argv + * @param config: address of an owned zenoh configuration + */ +void parse_zenoh_common_args(const int argc, char** argv, z_owned_config_t* config) { + // -c: A configuration file. + const char* config_file = parse_opt(argc, argv, "c", true); + if (config_file) { + zc_config_from_file(config, config_file); + } else { + z_config_default(config); + } + // -m: The Zenoh session mode [default: peer]. + const char* mode = parse_opt(argc, argv, "m", true); + if (mode) { + size_t buflen = strlen(mode) + 3; // mode + quotes + nullbyte + char* buf = (char*)malloc(buflen); + snprintf(buf, buflen, "'%s'", mode); + if (zc_config_insert_json(z_loan_mut(*config), Z_CONFIG_MODE_KEY, buf) < 0) { + printf( + "Couldn't insert value `%s` in configuration at `%s`. Value must be one of: 'client', 'peer' or " + "'router'\n", + mode, Z_CONFIG_MODE_KEY); + free(buf); + exit(-1); + } + free(buf); + } + // -e: Endpoint to connect to. Can be repeated + parse_zenoh_json_list_config(argc, argv, "e", Z_CONFIG_CONNECT_KEY, config); + // -l: Endpoint to listen on. Can be repeated + parse_zenoh_json_list_config(argc, argv, "l", Z_CONFIG_LISTEN_KEY, config); + // --no-multicast-scrouting: Disable the multicast-based scouting mechanism. + const char* no_multicast_scouting = parse_opt(argc, argv, "no-multicast-scouting", false); + if (no_multicast_scouting && + zc_config_insert_json(z_loan_mut(*config), Z_CONFIG_MULTICAST_SCOUTING_KEY, "false") < 0) { + printf("Couldn't disable multicast-scouting.\n"); + exit(-1); + } +} diff --git a/examples/z_delete.c b/examples/z_delete.c index d0478408c..67c0f083a 100644 --- a/examples/z_delete.c +++ b/examples/z_delete.c @@ -14,24 +14,19 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-put"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-put" - if (argc > 1) keyexpr = argv[1]; +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 3) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -40,9 +35,9 @@ int main(int argc, char **argv) { exit(-1); } - printf("Deleting resources matching '%s'...\n", keyexpr); + printf("Deleting resources matching '%s'...\n", args.keyexpr); z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); int res = z_delete(z_loan(s), z_loan(ke), NULL); if (res < 0) { printf("Delete failed...\n"); @@ -51,3 +46,41 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_delete [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_get.c b/examples/z_get.c index f53c49935..c26b9cbb9 100644 --- a/examples/z_get.c +++ b/examples/z_get.c @@ -14,38 +14,27 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - char *value = NULL; - switch (argc) { - default: - case 3: - value = argv[2]; - case 2: - expr = argv[1]; - break; - case 1: - value = "Test Value"; - break; - } +#define DEFAULT_SELECTOR "demo/example/**" +#define DEFAULT_VALUE NULL + +struct args_t { + char* selector; // -s + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +int main(int argc, char** argv) { + z_owned_config_t config; + struct args_t args = parse_args(argc, argv, &config); + z_view_keyexpr_t keyexpr; - if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) { - printf("%s is not a valid key expression", expr); + if (z_view_keyexpr_from_str(&keyexpr, args.selector) < 0) { + printf("%s is not a valid key expression", args.selector); exit(-1); } - z_owned_config_t config; - z_config_default(&config); - if (argc > 3) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } printf("Opening session...\n"); z_owned_session_t s; @@ -54,7 +43,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Sending Query '%s'...\n", expr); + printf("Sending Query '%s'...\n", args.selector); z_owned_fifo_handler_reply_t handler; z_owned_closure_reply_t closure; z_fifo_channel_reply_new(&closure, &handler, 16); @@ -63,8 +52,8 @@ int main(int argc, char **argv) { z_get_options_default(&opts); z_owned_bytes_t payload; - if (value != NULL) { - z_bytes_from_static_str(&payload, value); + if (args.value != NULL) { + z_bytes_from_static_str(&payload, args.value); opts.payload = z_move(payload); } z_get(z_loan(s), z_loan(keyexpr), "", z_move(closure), @@ -73,7 +62,7 @@ int main(int argc, char **argv) { for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) { if (z_reply_is_ok(z_loan(reply))) { - const z_loaned_sample_t *sample = z_reply_ok(z_loan(reply)); + const z_loaned_sample_t* sample = z_reply_ok(z_loan(reply)); z_view_string_t key_str; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_str); @@ -93,4 +82,47 @@ int main(int argc, char **argv) { z_drop(z_move(handler)); z_close(z_move(s)); return 0; -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_get [OPTIONS]\n\n\ + Options:\n\ + -s (optional, string, default='%s'): The selection of resources to query\n\ + -v (optional, string): An optional value to put in the query\n", + DEFAULT_SELECTOR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* selector = parse_opt(argc, argv, "s", true); + if (!selector) { + selector = DEFAULT_SELECTOR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.selector = (char*)selector, .value = (char*)value}; +} diff --git a/examples/z_get_liveliness.c b/examples/z_get_liveliness.c index d7b0b6737..60e101416 100644 --- a/examples/z_get_liveliness.c +++ b/examples/z_get_liveliness.c @@ -14,30 +14,24 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "group1/**"; - if (argc > 1) { - expr = argv[1]; - } +#define DEFAULT_KEYEXPR "group1/**" - z_view_keyexpr_t keyexpr; - if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) { - printf("%s is not a valid key expression\n", expr); - exit(-1); - } +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } + struct args_t args = parse_args(argc, argv, &config); + + z_view_keyexpr_t keyexpr; + if (z_view_keyexpr_from_str(&keyexpr, args.keyexpr) < 0) { + printf("%s is not a valid key expression\n", args.keyexpr); + exit(-1); } z_owned_session_t s; @@ -47,7 +41,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Sending liveliness query '%s'...\n", expr); + printf("Sending liveliness query '%s'...\n", args.keyexpr); z_owned_fifo_handler_reply_t handler; z_owned_closure_reply_t closure; z_fifo_channel_reply_new(&closure, &handler, 16); @@ -55,7 +49,7 @@ int main(int argc, char **argv) { z_owned_reply_t reply; for (z_result_t res = z_recv(z_loan(handler), &reply); res == Z_OK; res = z_recv(z_loan(handler), &reply)) { if (z_reply_is_ok(z_loan(reply))) { - const z_loaned_sample_t *sample = z_reply_ok(z_loan(reply)); + const z_loaned_sample_t* sample = z_reply_ok(z_loan(reply)); z_view_string_t key_str; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_str); printf(">> Alive token ('%.*s')\n", (int)z_string_len(z_loan(key_str)), z_string_data(z_loan(key_str))); @@ -69,3 +63,41 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_get_liveliness [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to query\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_info.c b/examples/z_info.c index 584bf5d05..c3eb28d43 100644 --- a/examples/z_info.c +++ b/examples/z_info.c @@ -13,27 +13,21 @@ #include +#include "parse_args.h" #include "zenoh.h" -void print_zid(const z_id_t *id, void *ctx) { +void parse_args(int argc, char** argv, z_owned_config_t* config); + +void print_zid(const z_id_t* id, void* ctx) { for (int i = 0; i < 16; i++) { printf("%02x", id->id[i]); } printf("\n"); } -int main(int argc, char **argv) { +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 1) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[1]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[1], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -60,3 +54,34 @@ int main(int argc, char **argv) { z_close(z_move(s)); } + +void print_help() { + printf( + "\ + Usage: z_info [OPTIONS]\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +void parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); +} diff --git a/examples/z_liveliness.c b/examples/z_liveliness.c index ab82bc4ff..de0dd95db 100644 --- a/examples/z_liveliness.c +++ b/examples/z_liveliness.c @@ -14,30 +14,24 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "group1/zenoh-c"; - if (argc > 1) { - expr = argv[1]; - } +#define DEFAULT_KEYEXPR "group1/zenoh-rs" - z_view_keyexpr_t keyexpr; - if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) { - printf("%s is not a valid key expression\n", expr); - exit(-1); - } +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } + struct args_t args = parse_args(argc, argv, &config); + + z_view_keyexpr_t keyexpr; + if (z_view_keyexpr_from_str(&keyexpr, args.keyexpr) < 0) { + printf("%s is not a valid key expression\n", args.keyexpr); + exit(-1); } printf("Opening session...\n"); @@ -47,26 +41,61 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring liveliness token '%s'...\n", expr); + printf("Declaring liveliness token '%s'...\n", args.keyexpr); zc_owned_liveliness_token_t token; if (zc_liveliness_declare_token(&token, z_loan(s), z_loan(keyexpr), NULL) < 0) { printf("Unable to create liveliness token!\n"); exit(-1); } - printf("Enter 'd' to undeclare liveliness token, 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } else if (c == 'd') { - printf("Undeclaring liveliness token...\n"); - z_drop(z_move(token)); - } + printf("Press CTRL-C to undeclare liveliness token and quit...\n"); + while (1) { + z_sleep_s(1); } + // LivelinessTokens are automatically closed when dropped + // Use the code below to manually undeclare it if needed + printf("Undeclaring liveliness token...\n"); z_drop(z_move(token)); + z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_liveliness [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression the liveliness token\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_non_blocking_get.c b/examples/z_non_blocking_get.c index 7a76bc692..1f834d769 100644 --- a/examples/z_non_blocking_get.c +++ b/examples/z_non_blocking_get.c @@ -14,29 +14,25 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } +#define DEFAULT_SELECTOR "demo/example/**" + +struct args_t { + char* selector; // -s +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +int main(int argc, char** argv) { + z_owned_config_t config; + struct args_t args = parse_args(argc, argv, &config); + z_view_keyexpr_t keyexpr; - if (z_view_keyexpr_from_str(&keyexpr, expr) < 0) { - printf("%s is not a valid key expression", expr); + if (z_view_keyexpr_from_str(&keyexpr, args.selector) < 0) { + printf("%s is not a valid key expression", args.selector); exit(-1); } - z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } printf("Opening session...\n"); z_owned_session_t s; @@ -45,7 +41,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Sending Query '%s'...\n", expr); + printf("Sending Query '%s'...\n", args.selector); z_get_options_t opts; z_get_options_default(&opts); opts.target = Z_QUERY_TARGET_ALL; @@ -62,7 +58,7 @@ int main(int argc, char **argv) { continue; } if (z_reply_is_ok(z_loan(reply))) { - const z_loaned_sample_t *sample = z_reply_ok(z_loan(reply)); + const z_loaned_sample_t* sample = z_reply_ok(z_loan(reply)); z_view_string_t key_str; z_owned_string_t payload_string; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_str); @@ -78,4 +74,42 @@ int main(int argc, char **argv) { z_drop(z_move(handler)); z_close(z_move(s)); return 0; -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_non_blocking_get [OPTIONS]\n\n\ + Options:\n\ + -s (optional, string, default='%s'): The selection of resources to query\n", + DEFAULT_SELECTOR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* selector = parse_opt(argc, argv, "s", true); + if (!selector) { + selector = DEFAULT_SELECTOR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.selector = (char*)selector}; +} diff --git a/examples/z_ping.c b/examples/z_ping.c index c5ab59364..436feeb6d 100644 --- a/examples/z_ping.c +++ b/examples/z_ping.c @@ -3,6 +3,7 @@ #include #include +#include "parse_args.h" #include "zenoh.h" #define DEFAULT_PKT_SIZE 8 @@ -27,32 +28,15 @@ struct args_t { unsigned int size; // -s unsigned int number_of_pings; // -n unsigned int warmup_ms; // -w - char* config_path; // -c - uint8_t help_requested; // -h }; -struct args_t parse_args(int argc, char** argv); +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); int main(int argc, char** argv) { - struct args_t args = parse_args(argc, argv); - if (args.help_requested) { - printf( - "\ - -n (optional, int, default=%d): the number of pings to be attempted\n\ - -s (optional, int, default=%d): the size of the payload embedded in the ping and repeated by the pong\n\ - -w (optional, int, default=%d): the warmup time in ms during which pings will be emitted but not measured\n\ - -c (optional, string): the path to a configuration file for the session. If this option isn't passed, the default configuration will be used.\n\ - ", - DEFAULT_PING_NB, DEFAULT_PKT_SIZE, DEFAULT_WARMUP_MS); - return 1; - } + z_owned_config_t config; + struct args_t args = parse_args(argc, argv, &config); + z_mutex_init(&mutex); z_condvar_init(&cond); - z_owned_config_t config; - if (args.config_path) { - zc_config_from_file(&config, args.config_path); - } else { - z_config_default(&config); - } z_owned_session_t session; z_open(&session, z_move(config)); z_view_keyexpr_t ping; @@ -110,44 +94,53 @@ int main(int argc, char** argv) { z_close(z_move(session)); } -char* getopt(int argc, char** argv, char option) { - for (int i = 0; i < argc; i++) { - size_t len = strlen(argv[i]); - if (len >= 2 && argv[i][0] == '-' && argv[i][1] == option) { - if (len > 2 && argv[i][2] == '=') { - return argv[i] + 3; - } else if (i + 1 < argc) { - return argv[i + 1]; - } - } - } - return NULL; +void print_help() { + printf( + "\ + Usage: z_ping [OPTIONS]\n\n\ + Options:\n\ + -n (optional, int, default=%d): The number of pings to be attempted\n\ + -s (optional, int, default=%d): The size of the payload embedded in the ping and repeated by the pong\n\ + -w (optional, int, default=%d): The warmup time in ms during which pings will be emitted but not measured\n", + DEFAULT_PKT_SIZE, DEFAULT_PING_NB, DEFAULT_WARMUP_MS); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); } -struct args_t parse_args(int argc, char** argv) { - for (int i = 0; i < argc; i++) { - if (strcmp(argv[i], "-h") == 0) { - return (struct args_t){.help_requested = 1}; - } +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); } - char* arg = getopt(argc, argv, 's'); + const char* arg = parse_opt(argc, argv, "s", true); unsigned int size = DEFAULT_PKT_SIZE; if (arg) { size = atoi(arg); } - arg = getopt(argc, argv, 'n'); + arg = parse_opt(argc, argv, "n", true); unsigned int number_of_pings = DEFAULT_PING_NB; if (arg) { number_of_pings = atoi(arg); } - arg = getopt(argc, argv, 'w'); + arg = parse_opt(argc, argv, "w", true); unsigned int warmup_ms = DEFAULT_WARMUP_MS; if (arg) { warmup_ms = atoi(arg); } - return (struct args_t){.help_requested = 0, - .size = size, - .number_of_pings = number_of_pings, - .warmup_ms = warmup_ms, - .config_path = getopt(argc, argv, 'c')}; -} \ No newline at end of file + parse_zenoh_common_args(argc, argv, config); + arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.size = size, .number_of_pings = number_of_pings, .warmup_ms = warmup_ms}; +} diff --git a/examples/z_pong.c b/examples/z_pong.c index e3a312035..f58a3fe96 100644 --- a/examples/z_pong.c +++ b/examples/z_pong.c @@ -1,8 +1,11 @@ #include #include +#include "parse_args.h" #include "zenoh.h" +void parse_args(int argc, char** argv, z_owned_config_t* config); + void callback(const z_loaned_sample_t* sample, void* context) { const z_loaned_publisher_t* pub = z_loan(*(z_owned_publisher_t*)context); z_owned_bytes_t payload; @@ -17,26 +20,10 @@ void drop(void* context) { // which makes passing a pointer to the stack safe as long as `sub` is dropped in a scope where `pub` is still // valid. } -struct args_t { - char* config_path; // -c - uint8_t help_requested; // -h -}; -struct args_t parse_args(int argc, char** argv); int main(int argc, char** argv) { - struct args_t args = parse_args(argc, argv); - if (args.help_requested) { - printf( - "-c (optional, string): the path to a configuration file for the session. If this option isn't passed, the " - "default configuration will be used.\n"); - return 1; - } z_owned_config_t config; - if (args.config_path) { - zc_config_from_file(&config, args.config_path); - } else { - z_config_default(&config); - } + parse_args(argc, argv, &config); z_owned_session_t session; z_open(&session, z_move(config)); @@ -50,31 +37,41 @@ int main(int argc, char** argv) { z_closure(&respond, callback, drop, (void*)&pub); z_owned_subscriber_t sub; z_declare_subscriber(&sub, z_loan(session), z_loan(ping), z_move(respond), NULL); - while (getchar() != 'q') { + + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); z_close(z_move(session)); } -char* getopt(int argc, char** argv, char option) { - for (int i = 0; i < argc; i++) { - size_t len = strlen(argv[i]); - if (len >= 2 && argv[i][0] == '-' && argv[i][1] == option) { - if (len > 2 && argv[i][2] == '=') { - return argv[i] + 3; - } else if (i + 1 < argc) { - return argv[i + 1]; - } - } - } - return NULL; +void print_help() { + printf( + "\ + Usage: z_pong [OPTIONS]\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); } -struct args_t parse_args(int argc, char** argv) { - for (int i = 0; i < argc; i++) { - if (strcmp(argv[i], "-h") == 0) { - return (struct args_t){.help_requested = 1}; - } +void parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); } - return (struct args_t){.help_requested = 0, .config_path = getopt(argc, argv, 'c')}; -} \ No newline at end of file + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); +} diff --git a/examples/z_pub.c b/examples/z_pub.c index 05d5ae2ab..6aa478a30 100644 --- a/examples/z_pub.c +++ b/examples/z_pub.c @@ -14,10 +14,21 @@ #include #include +#include "parse_args.h" #include "zenoh.h" +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub" +#define DEFAULT_VALUE "Pub from C!" + +struct args_t { + char* keyexpr; // -k + char* value; // -v + bool add_matching_listener; // --add-matching-listener +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + #ifdef UNSTABLE -void matching_status_handler(const zc_matching_status_t *matching_status, void *arg) { +void matching_status_handler(const zc_matching_status_t* matching_status, void* arg) { if (matching_status->matching) { printf("Subscriber matched\n"); } else { @@ -26,26 +37,9 @@ void matching_status_handler(const zc_matching_status_t *matching_status, void * } #endif -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub"; - char *value = "Pub from C!"; - bool add_matching_listener = false; - - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; - if (argc > 3) add_matching_listener = atoi(argv[3]); - +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 4) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[4]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[4], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -54,10 +48,10 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring Publisher on '%s'...\n", keyexpr); + printf("Declaring Publisher on '%s'...\n", args.keyexpr); z_owned_publisher_t pub; z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare Publisher for key expression!\n"); exit(-1); @@ -65,23 +59,24 @@ int main(int argc, char **argv) { #ifdef UNSTABLE zc_owned_matching_listener_t listener; - if (add_matching_listener) { + if (args.add_matching_listener) { zc_owned_closure_matching_status_t callback; z_closure(&callback, matching_status_handler, NULL, NULL); zc_publisher_matching_listener_declare(&listener, z_loan(pub), z_move(callback)); } #else - if (add_matching_listener) { + if (args.add_matching_listener) { printf("To enable matching listener you must compile Zenoh-c with unstable feature support!\n"); exit(-1); } #endif + printf("Press CTRL-C to quit...\n"); char buf[256] = {}; for (int idx = 0; 1; ++idx) { z_sleep_s(1); - sprintf(buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); + sprintf(buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); z_publisher_put_options_t options; z_publisher_put_options_default(&options); @@ -91,7 +86,7 @@ int main(int argc, char **argv) { z_publisher_put(z_loan(pub), z_move(payload), &options); } #ifdef UNSTABLE - if (add_matching_listener) { + if (args.add_matching_listener) { zc_publisher_matching_listener_undeclare(z_move(listener)); } #endif @@ -100,3 +95,53 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n\ + --add-matching-listener (optional): Add matching listener\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + const char* arg = parse_opt(argc, argv, "add-matching-listener", false); + bool add_matching_listener = false; + if (arg) { + add_matching_listener = true; + } + parse_zenoh_common_args(argc, argv, config); + arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){ + .keyexpr = (char*)keyexpr, .value = (char*)value, .add_matching_listener = add_matching_listener}; +} diff --git a/examples/z_pub_attachment.c b/examples/z_pub_attachment.c index ca13d1c2a..ed947262b 100644 --- a/examples/z_pub_attachment.c +++ b/examples/z_pub_attachment.c @@ -14,8 +14,12 @@ #include #include +#include "parse_args.h" #include "zenoh.h" +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub" +#define DEFAULT_VALUE "Pub from C!" + typedef struct kv_pair_t { const char* key; const char* value; @@ -39,24 +43,15 @@ bool create_attachment_iter(z_owned_bytes_t* kv_pair, void* context) { return true; }; -int main(int argc, char** argv) { - char* keyexpr = "demo/example/zenoh-c-pub"; - char* value = "Pub from C!"; - - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 3) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -65,9 +60,9 @@ int main(int argc, char** argv) { exit(-1); } - printf("Declaring Publisher on '%s'...\n", keyexpr); + printf("Declaring Publisher on '%s'...\n", args.keyexpr); z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); z_owned_publisher_t pub; if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL)) { printf("Unable to declare Publisher for key expression!\n"); @@ -84,6 +79,7 @@ int main(int argc, char** argv) { z_owned_bytes_t attachment; z_owned_bytes_t payload; + printf("Press CTRL-C to quit...\n"); char buf[256]; char buf_ind[16]; for (int idx = 0; 1; ++idx) { @@ -96,8 +92,8 @@ int main(int argc, char** argv) { z_bytes_from_iter(&attachment, create_attachment_iter, (void*)&it); options.attachment = z_move(attachment); - sprintf(buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); + sprintf(buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); z_bytes_serialize_from_str(&payload, buf); z_publisher_put(z_loan(pub), z_move(payload), &options); @@ -109,3 +105,46 @@ int main(int argc, char** argv) { return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub_attachement [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_pub_cache.c b/examples/z_pub_cache.c index db931ae4e..e2de9caf9 100644 --- a/examples/z_pub_cache.c +++ b/examples/z_pub_cache.c @@ -14,26 +14,23 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub"; - char *value = "Pub from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub" +#define DEFAULT_VALUE "Pub from C!" +#define DEFAULT_HISTORY 1 - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v + unsigned int history; // -i +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 3) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_ADD_TIMESTAMP_KEY, "true") < 0) { printf("Unable to configure timestamps!\n"); @@ -52,21 +49,22 @@ int main(int argc, char **argv) { pub_cache_opts.history = 42; pub_cache_opts.queryable_complete = false; - printf("Declaring publication cache on '%s'...\n", keyexpr); + printf("Declaring publication cache on '%s'...\n", args.keyexpr); ze_owned_publication_cache_t pub_cache; z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); if (ze_declare_publication_cache(&pub_cache, z_loan(s), z_loan(ke), &pub_cache_opts) != Z_OK) { printf("Unable to declare publication cache for key expression!\n"); exit(-1); } + printf("Press CTRL-C to quit...\n"); char buf[256]; for (int idx = 0; 1; ++idx) { z_sleep_s(1); - sprintf(buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); + sprintf(buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); z_owned_bytes_t payload; z_bytes_serialize_from_str(&payload, buf); @@ -78,3 +76,52 @@ int main(int argc, char **argv) { return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub_cache [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n\ + -i (optional, int, default='%d'): The number of publications to keep in cache\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE, DEFAULT_HISTORY); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + const char* arg = parse_opt(argc, argv, "i", true); + unsigned int history = DEFAULT_HISTORY; + if (arg) { + history = atoi(arg); + } + parse_zenoh_common_args(argc, argv, config); + arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value, .history = history}; +} diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 7c0098912..461816aca 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -14,39 +14,22 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -#ifdef UNSTABLE -void matching_status_handler(const zc_matching_status_t *matching_status, void *arg) { - if (matching_status->matching) { - printf("Subscriber matched\n"); - } else { - printf("No Subscribers matched\n"); - } -} -#endif - -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-pub"; - char *value = "Pub from C SHM!"; - bool add_matching_listener = false; +#define N 10 +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-pub-shm" +#define DEFAULT_VALUE "Pub from C!" - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; - if (argc > 3) add_matching_listener = atoi(argv[3]); +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - - if (argc > 4) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[4]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[4], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -55,10 +38,10 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring Publisher on '%s'...\n", keyexpr); + printf("Declaring Publisher on '%s'...\n", args.keyexpr); z_owned_publisher_t pub; z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); if (z_declare_publisher(&pub, z_loan(s), z_loan(ke), NULL) < 0) { printf("Unable to declare Publisher for key expression!\n"); exit(-1); @@ -95,9 +78,9 @@ int main(int argc, char **argv) { z_shm_provider_alloc_gc_defrag_blocking(&alloc, z_loan(provider), buf_ok_size, alignment); if (z_check(alloc.buf)) { { - uint8_t *buf = z_shm_mut_data_mut(z_loan_mut(alloc.buf)); - sprintf((char *)buf, "[%4d] %s", idx, value); - printf("Putting Data ('%s': '%s')...\n", keyexpr, buf); + uint8_t* buf = z_shm_mut_data_mut(z_loan_mut(alloc.buf)); + sprintf((char*)buf, "[%4d] %s", idx, args.value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, buf); } z_publisher_put_options_t options; @@ -127,3 +110,46 @@ int main(int argc, char **argv) { return 0; } + +void print_help() { + printf( + "\ + Usage: z_pub_shm [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_pub_thr.c b/examples/z_pub_thr.c index 83601ef5d..ebd1d7f0f 100644 --- a/examples/z_pub_thr.c +++ b/examples/z_pub_thr.c @@ -14,30 +14,21 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - if (argc < 2) { - printf("USAGE:\n\tz_pub_thr []\n\n"); - exit(-1); - } +struct args_t { + unsigned int size; // positional_1 +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); - char *keyexpr = "test/thr"; - size_t len = atoi(argv[1]); - uint8_t *value = (uint8_t *)z_malloc(len); - memset(value, 1, len); +int main(int argc, char** argv) { + char* keyexpr = "test/thr"; z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); + uint8_t* value = (uint8_t*)z_malloc(args.size); + memset(value, 1, args.size); z_owned_session_t s; if (z_open(&s, z_move(config)) < 0) { @@ -57,12 +48,52 @@ int main(int argc, char **argv) { exit(-1); } + printf("Press CTRL-C to quit...\n"); z_owned_bytes_t payload; while (1) { - z_bytes_from_buf(&payload, value, len, NULL, NULL); + z_bytes_from_buf(&payload, value, args.size, NULL, NULL); z_publisher_put(z_loan(pub), z_move(payload), NULL); } z_undeclare_publisher(z_move(pub)); z_close(z_move(s)); } + +void print_help() { + printf( + "\ + Usage: z_pub_thr [OPTIONS] \n\n\ + Arguments:\n\ + (required, int): Size of the payload to publish\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args) { + printf("Unexpected additional positional arguments\n"); + exit(-1); + } + if (!pos_args[0]) { + printf(" argument is required\n"); + free(pos_args); + exit(-1); + } + unsigned int size = atoi(pos_args[0]); + free(pos_args); + return (struct args_t){.size = size}; +} diff --git a/examples/z_pull.c b/examples/z_pull.c index b24ca82fa..722b67f12 100644 --- a/examples/z_pull.c +++ b/examples/z_pull.c @@ -13,20 +13,19 @@ // #include +#include "parse_args.h" #include "zenoh.h" -const char *kind_to_str(z_sample_kind_t kind) { - switch (kind) { - case Z_SAMPLE_KIND_PUT: - return "PUT"; - case Z_SAMPLE_KIND_DELETE: - return "DELETE"; - default: - return "UNKNOWN"; - } -} +#define DEFAULT_KEYEXPR "demo/example/**" -void handle_sample(const z_loaned_sample_t *sample) { +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +const char* kind_to_str(z_sample_kind_t kind); + +void handle_sample(const z_loaned_sample_t* sample) { z_view_string_t keystr; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &keystr); z_owned_string_t payload_value; @@ -37,23 +36,9 @@ void handle_sample(const z_loaned_sample_t *sample) { z_drop(z_move(payload_value)); } -int main(int argc, char **argv) { - char *expr = "demo/example/**"; - if (argc > 1) { - expr = argv[1]; - } - +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -66,9 +51,9 @@ int main(int argc, char **argv) { z_owned_ring_handler_sample_t handler; z_owned_closure_sample_t closure; - printf("Declaring Subscriber on '%s'...\n", expr); + printf("Declaring Subscriber on '%s'...\n", args.keyexpr); z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, expr); + z_view_keyexpr_from_str(&ke, args.keyexpr); z_owned_subscriber_t sub; if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(closure), NULL) < 0) { @@ -96,3 +81,52 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +const char* kind_to_str(z_sample_kind_t kind) { + switch (kind) { + case Z_SAMPLE_KIND_PUT: + return "PUT"; + case Z_SAMPLE_KIND_DELETE: + return "DELETE"; + default: + return "UNKNOWN"; + } +} + +void print_help() { + printf( + "\ + Usage: z_pull [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_put.c b/examples/z_put.c index 26f1910d8..9117be365 100644 --- a/examples/z_put.c +++ b/examples/z_put.c @@ -14,27 +14,21 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -int main(int argc, char **argv) { - char *keyexpr = "demo/example/zenoh-c-put"; - char *value = "Put from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-put" +#define DEFAULT_VALUE "Put from C!" - if (argc > 1) keyexpr = argv[1]; - if (argc > 2) value = argv[2]; +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - - if (argc > 3) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[3]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[3], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -43,17 +37,17 @@ int main(int argc, char **argv) { exit(-1); } - printf("Putting Data ('%s': '%s')...\n", keyexpr, value); + printf("Putting Data ('%s': '%s')...\n", args.keyexpr, args.value); z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); z_owned_bytes_t payload; - z_bytes_from_static_str(&payload, value); + z_bytes_from_static_str(&payload, args.value); z_owned_bytes_t attachment, key, val; - z_bytes_from_static_str(&key, (char *)"hello"); - z_bytes_from_static_str(&val, (char *)"there"); + z_bytes_from_static_str(&key, (char*)"hello"); + z_bytes_from_static_str(&val, (char*)"there"); z_bytes_from_pair(&attachment, z_move(key), z_move(val)); z_put_options_t options; @@ -69,3 +63,46 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_put [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to write to\n\ + -v (optional, string, default='%s'): The value to write\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_query_sub.c b/examples/z_query_sub.c index 957860512..e17a48b43 100644 --- a/examples/z_query_sub.c +++ b/examples/z_query_sub.c @@ -13,14 +13,21 @@ // #include +#include "parse_args.h" #include "zenoh.h" -const char *kind_to_str(z_sample_kind_t kind); +#define DEFAULT_KEYEXPR "demo/example/**" -void data_handler(const z_loaned_sample_t *sample, void *arg) { +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +const char* kind_to_str(z_sample_kind_t kind); + +void data_handler(const z_loaned_sample_t* sample, void* arg) { z_view_string_t key_string; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_string); - z_owned_string_t payload_string; z_bytes_deserialize_into_string(z_sample_payload(sample), &payload_string); @@ -30,23 +37,9 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { z_drop(z_move(payload_string)); } -int main(int argc, char **argv) { - char *keyexpr = "demo/example/**"; - if (argc > 1) { - keyexpr = argv[1]; - } - +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -56,28 +49,22 @@ int main(int argc, char **argv) { } z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); ze_querying_subscriber_options_t sub_opts; ze_querying_subscriber_options_default(&sub_opts); - z_owned_closure_sample_t callback; z_closure(&callback, data_handler, NULL, NULL); - printf("Declaring querying subscriber on '%s'...\n", keyexpr); - + printf("Declaring querying subscriber on '%s'...\n", args.keyexpr); ze_owned_querying_subscriber_t sub; if (ze_declare_querying_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), &sub_opts) < 0) { printf("Unable to declare querying subscriber.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } ze_undeclare_querying_subscriber(z_move(sub)); @@ -86,7 +73,7 @@ int main(int argc, char **argv) { return 0; } -const char *kind_to_str(z_sample_kind_t kind) { +const char* kind_to_str(z_sample_kind_t kind) { switch (kind) { case Z_SAMPLE_KIND_PUT: return "PUT"; @@ -96,3 +83,41 @@ const char *kind_to_str(z_sample_kind_t kind) { return "UNKNOWN"; } } + +void print_help() { + printf( + "\ + Usage: z_query_sub [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_queryable.c b/examples/z_queryable.c index 7b86fcab2..5f5f48b71 100644 --- a/examples/z_queryable.c +++ b/examples/z_queryable.c @@ -14,12 +14,22 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -const char *keyexpr = "demo/example/zenoh-c-queryable"; -const char *value = "Queryable from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-queryable" +#define DEFAULT_VALUE "Queryable from C!" z_view_keyexpr_t ke; +struct args_t { + char *keyexpr; // -k + char *value; // -v +}; + +char *value; + +struct args_t parse_args(int argc, char **argv, z_owned_config_t *config); + void query_handler(const z_loaned_query_t *query, void *context) { z_view_string_t key_string; z_keyexpr_as_view_string(z_query_keyexpr(query), &key_string); @@ -53,20 +63,9 @@ void query_handler(const z_loaned_query_t *query, void *context) { } int main(int argc, char **argv) { - if (argc > 1) { - keyexpr = argv[1]; - } z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); + value = args.value; printf("Opening session...\n"); z_owned_session_t s; @@ -75,14 +74,14 @@ int main(int argc, char **argv) { exit(-1); } - if (z_view_keyexpr_from_str(&ke, keyexpr)) { - printf("%s is not a valid key expression", keyexpr); + if (z_view_keyexpr_from_str(&ke, args.keyexpr)) { + printf("%s is not a valid key expression", args.keyexpr); exit(-1); } - printf("Declaring Queryable on '%s'...\n", keyexpr); + printf("Declaring Queryable on '%s'...\n", args.keyexpr); z_owned_closure_query_t callback; - z_closure(&callback, query_handler, NULL, (void *)keyexpr); + z_closure(&callback, query_handler, NULL, (void *)args.keyexpr); z_owned_queryable_t qable; if (z_declare_queryable(&qable, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { @@ -90,16 +89,55 @@ int main(int argc, char **argv) { exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_queryable(z_move(qable)); z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_queryable [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression matching queries to reply to\n\ + -v (optional, string, default='%s'): The value to reply to queries with\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char **argv, z_owned_config_t *config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char *keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char *value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char *arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char **pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char *)keyexpr, .value = (char *)value}; +} diff --git a/examples/z_queryable_with_channels.c b/examples/z_queryable_with_channels.c index 6ead46766..4e8b6b856 100644 --- a/examples/z_queryable_with_channels.c +++ b/examples/z_queryable_with_channels.c @@ -14,27 +14,23 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -const char *keyexpr = "demo/example/zenoh-c-queryable"; -const char *value = "Queryable from C!"; +#define DEFAULT_KEYEXPR "demo/example/zenoh-c-queryable" +#define DEFAULT_VALUE "Queryable from C!" + +struct args_t { + char* keyexpr; // -k + char* value; // -v +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + z_view_keyexpr_t ke; -int main(int argc, char **argv) { - if (argc > 1) { - keyexpr = argv[1]; - } +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); printf("Opening session...\n"); z_owned_session_t s; @@ -43,12 +39,12 @@ int main(int argc, char **argv) { exit(-1); } - if (z_view_keyexpr_from_str(&ke, keyexpr) < 0) { - printf("%s is not a valid key expression", keyexpr); + if (z_view_keyexpr_from_str(&ke, args.keyexpr) < 0) { + printf("%s is not a valid key expression", args.keyexpr); exit(-1); } - printf("Declaring Queryable on '%s'...\n", keyexpr); + printf("Declaring Queryable on '%s'...\n", args.keyexpr); z_owned_fifo_handler_query_t handler; z_owned_closure_query_t closure; z_fifo_channel_query_new(&closure, &handler, 16); @@ -59,17 +55,17 @@ int main(int argc, char **argv) { exit(-1); } - printf("^C to quit...\n"); + printf("Press CTRL-C to quit...\n"); z_owned_query_t oquery; for (z_result_t res = z_recv(z_loan(handler), &oquery); res == Z_OK; res = z_recv(z_loan(handler), &oquery)) { - const z_loaned_query_t *query = z_loan(oquery); + const z_loaned_query_t* query = z_loan(oquery); z_view_string_t key_string; z_keyexpr_as_view_string(z_query_keyexpr(query), &key_string); z_view_string_t params; z_query_parameters(query, ¶ms); - const z_loaned_bytes_t *payload = z_query_payload(query); + const z_loaned_bytes_t* payload = z_query_payload(query); if (payload != NULL && z_bytes_len(payload) > 0) { z_owned_string_t payload_string; z_bytes_deserialize_into_string(payload, &payload_string); @@ -87,7 +83,7 @@ int main(int argc, char **argv) { z_query_reply_options_default(&options); z_owned_bytes_t reply_payload; - z_bytes_from_static_str(&reply_payload, value); + z_bytes_from_static_str(&reply_payload, args.value); z_query_reply(query, z_loan(ke), z_move(reply_payload), &options); z_drop(z_move(oquery)); } @@ -97,3 +93,46 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_queryable_with_channels [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression matching queries to reply to\n\ + -v (optional, string, default='%s'): The value to reply to queries with\n", + DEFAULT_KEYEXPR, DEFAULT_VALUE); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + const char* value = parse_opt(argc, argv, "v", true); + if (!value) { + value = DEFAULT_VALUE; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; +} diff --git a/examples/z_sub.c b/examples/z_sub.c index 07ae9111b..41dfdeff5 100644 --- a/examples/z_sub.c +++ b/examples/z_sub.c @@ -13,8 +13,16 @@ // #include +#include "parse_args.h" #include "zenoh.h" +#define DEFAULT_KEYEXPR "demo/example/**" + +struct args_t { + char *keyexpr; // -k +}; +struct args_t parse_args(int argc, char **argv, z_owned_config_t *config); + const char *kind_to_str(z_sample_kind_t kind); void data_handler(const z_loaned_sample_t *sample, void *arg) { @@ -31,26 +39,23 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { } int main(int argc, char **argv) { - char *keyexpr = "demo/example/**"; - if (argc > 1) { - keyexpr = argv[1]; - } - + z_owned_config_t config; + struct args_t args = parse_args(argc, argv, &config); z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); + z_view_keyexpr_from_str(&ke, args.keyexpr); - z_owned_config_t config; - z_config_default(&config); - - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } +#ifdef SHARED_MEMORY + // A probing procedure for shared memory is performed upon session opening. To enable `z_pub_shm` to operate + // over shared memory (and to not fallback on network mode), shared memory needs to be enabled also on the + // subscriber side. By doing so, the probing procedure will succeed and shared memory will operate as expected. + if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { + printf( + "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " + "JSON-serialized value\n", + Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); + exit(-1); } +#endif printf("Opening session...\n"); z_owned_session_t s; @@ -61,20 +66,16 @@ int main(int argc, char **argv) { z_owned_closure_sample_t callback; z_closure(&callback, data_handler, NULL, NULL); - printf("Declaring Subscriber on '%s'...\n", keyexpr); + printf("Declaring Subscriber on '%s'...\n", args.keyexpr); z_owned_subscriber_t sub; if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL) < 0) { printf("Unable to declare subscriber.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); @@ -91,4 +92,42 @@ const char *kind_to_str(z_sample_kind_t kind) { default: return "UNKNOWN"; } -} \ No newline at end of file +} + +void print_help() { + printf( + "\ + Usage: z_sub [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char **argv, z_owned_config_t *config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char *keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char *arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char **pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char *)keyexpr}; +} diff --git a/examples/z_sub_attachment.c b/examples/z_sub_attachment.c index 7736ce442..20cef431e 100644 --- a/examples/z_sub_attachment.c +++ b/examples/z_sub_attachment.c @@ -14,11 +14,18 @@ #include #include +#include "parse_args.h" #include "zenoh.h" -const char *kind_to_str(z_sample_kind_t kind); +#define DEFAULT_KEYEXPR "demo/example/**" -void data_handler(const z_loaned_sample_t *sample, void *arg) { +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +const char* kind_to_str(z_sample_kind_t kind); + +void data_handler(const z_loaned_sample_t* sample, void* arg) { z_view_string_t key_string; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_string); @@ -29,7 +36,7 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { (int)z_string_len(z_loan(key_string)), z_string_data(z_loan(key_string)), (int)z_string_len(z_loan(payload_string)), z_string_data(z_loan(payload_string))); - const z_loaned_bytes_t *attachment = z_sample_attachment(sample); + const z_loaned_bytes_t* attachment = z_sample_attachment(sample); // checks if attachment exists if (attachment != NULL) { // reads full attachment @@ -55,26 +62,11 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { z_drop(z_move(payload_string)); } -int main(int argc, char **argv) { - char *keyexpr = "demo/example/**"; - if (argc > 1) { - keyexpr = argv[1]; - } - - z_view_keyexpr_t ke; - z_view_keyexpr_from_str(&ke, keyexpr); - +int main(int argc, char** argv) { z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } + struct args_t args = parse_args(argc, argv, &config); + z_view_keyexpr_t ke; + z_view_keyexpr_from_str(&ke, args.keyexpr); printf("Opening session...\n"); z_owned_session_t s; @@ -85,20 +77,16 @@ int main(int argc, char **argv) { z_owned_closure_sample_t callback; z_closure(&callback, data_handler, NULL, NULL); - printf("Declaring Subscriber on '%s'...\n", keyexpr); + printf("Declaring Subscriber on '%s'...\n", args.keyexpr); z_owned_subscriber_t sub; if (z_declare_subscriber(&sub, z_loan(s), z_loan(ke), z_move(callback), NULL)) { printf("Unable to declare subscriber.\n"); exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); @@ -106,7 +94,7 @@ int main(int argc, char **argv) { return 0; } -const char *kind_to_str(z_sample_kind_t kind) { +const char* kind_to_str(z_sample_kind_t kind) { switch (kind) { case Z_SAMPLE_KIND_PUT: return "PUT"; @@ -116,3 +104,41 @@ const char *kind_to_str(z_sample_kind_t kind) { return "UNKNOWN"; } } + +void print_help() { + printf( + "\ + Usage: z_sub_attachement [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_sub_liveliness.c b/examples/z_sub_liveliness.c index 1a94a6b11..bb2d4fc0f 100644 --- a/examples/z_sub_liveliness.c +++ b/examples/z_sub_liveliness.c @@ -13,9 +13,17 @@ // #include +#include "parse_args.h" #include "zenoh.h" -void data_handler(const z_loaned_sample_t *sample, void *arg) { +#define DEFAULT_KEYEXPR "group1/**" + +struct args_t { + char* keyexpr; // -k +}; +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); + +void data_handler(const z_loaned_sample_t* sample, void* arg) { z_view_string_t key_string; z_keyexpr_as_view_string(z_sample_keyexpr(sample), &key_string); switch (z_sample_kind(sample)) { @@ -30,30 +38,15 @@ void data_handler(const z_loaned_sample_t *sample, void *arg) { } } -int main(int argc, char **argv) { - char *keyexpr = "group1/**"; - if (argc > 1) { - keyexpr = argv[1]; - } - +int main(int argc, char** argv) { + z_owned_config_t config; + struct args_t args = parse_args(argc, argv, &config); z_view_keyexpr_t ke; - if (z_view_keyexpr_from_str(&ke, keyexpr) < 0) { - printf("%s is not a valid key expression\n", keyexpr); + if (z_view_keyexpr_from_str(&ke, args.keyexpr) < 0) { + printf("%s is not a valid key expression\n", args.keyexpr); exit(-1); } - z_owned_config_t config; - z_config_default(&config); - if (argc > 2) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_LISTEN_KEY, argv[2]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[2], Z_CONFIG_LISTEN_KEY, Z_CONFIG_LISTEN_KEY); - exit(-1); - } - } - printf("Opening session...\n"); z_owned_session_t s; if (z_open(&s, z_move(config)) < 0) { @@ -61,7 +54,7 @@ int main(int argc, char **argv) { exit(-1); } - printf("Declaring liveliness subscriber on '%s'...\n", keyexpr); + printf("Declaring liveliness subscriber on '%s'...\n", args.keyexpr); z_owned_closure_sample_t callback; z_closure(&callback, data_handler, NULL, NULL); z_owned_subscriber_t sub; @@ -70,16 +63,50 @@ int main(int argc, char **argv) { exit(-1); } - printf("Enter 'q' to quit...\n"); - char c = 0; - while (c != 'q') { - c = getchar(); - if (c == -1) { - z_sleep_s(1); - } + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_sub_liveliness [OPTIONS]\n\n\ + Options:\n\ + -k (optional, string, default='%s'): The key expression matching liveliness tokens to subscribe to\n", + DEFAULT_KEYEXPR); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + const char* keyexpr = parse_opt(argc, argv, "k", true); + if (!keyexpr) { + keyexpr = DEFAULT_KEYEXPR; + } + parse_zenoh_common_args(argc, argv, config); + const char* arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char** pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); + return (struct args_t){.keyexpr = (char*)keyexpr}; +} diff --git a/examples/z_sub_thr.c b/examples/z_sub_thr.c index 15838b6ec..75367f065 100644 --- a/examples/z_sub_thr.c +++ b/examples/z_sub_thr.c @@ -13,10 +13,13 @@ // #include +#include "parse_args.h" #include "zenoh.h" #define N 1000000 +void parse_args(int argc, char **argv, z_owned_config_t *config); + typedef struct { volatile unsigned long count; volatile unsigned long finished_rounds; @@ -61,17 +64,19 @@ void drop_stats(void *context) { int main(int argc, char **argv) { z_owned_config_t config; - z_config_default(&config); - - if (argc > 1) { - if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_CONNECT_KEY, argv[1]) < 0) { - printf( - "Couldn't insert value `%s` in configuration at `%s`. This is likely because `%s` expects a " - "JSON-serialized list of strings\n", - argv[1], Z_CONFIG_CONNECT_KEY, Z_CONFIG_CONNECT_KEY); - exit(-1); - } + parse_args(argc, argv, &config); + +#ifdef SHARED_MEMORY + // A probing procedure for shared memory is performed upon session opening. To operate over shared memory + // (and to not fallback on network mode), shared memory needs to be enabled in the configuration. + if (zc_config_insert_json(z_loan_mut(config), Z_CONFIG_SHARED_MEMORY_KEY, "true") < 0) { + printf( + "Couldn't insert value `true` in configuration at `%s`. This is likely because `%s` expects a " + "JSON-serialized value\n", + Z_CONFIG_SHARED_MEMORY_KEY, Z_CONFIG_SHARED_MEMORY_KEY); + exit(-1); } +#endif z_owned_session_t s; @@ -94,9 +99,9 @@ int main(int argc, char **argv) { exit(-1); } - char c = 0; - while (c != 'q') { - c = fgetc(stdin); + printf("Press CTRL-C to quit...\n"); + while (1) { + z_sleep_s(1); } z_undeclare_subscriber(z_move(sub)); @@ -104,3 +109,34 @@ int main(int argc, char **argv) { z_close(z_move(s)); return 0; } + +void print_help() { + printf( + "\ + Usage: z_sub_thr [OPTIONS]\n\n\ + Options:\n"); + printf(COMMON_HELP); + printf( + "\ + -h: print help\n"); +} + +void parse_args(int argc, char **argv, z_owned_config_t *config) { + if (parse_opt(argc, argv, "h", false)) { + print_help(); + exit(1); + } + parse_zenoh_common_args(argc, argv, config); + const char *arg = check_unknown_opts(argc, argv); + if (arg) { + printf("Unknown option %s\n", arg); + exit(-1); + } + char **pos_args = parse_pos_args(argc, argv, 1); + if (!pos_args || pos_args[0]) { + printf("Unexpected positional arguments\n"); + free(pos_args); + exit(-1); + } + free(pos_args); +} diff --git a/src/keyexpr.rs b/src/keyexpr.rs index b94f0ba6a..e9aa62ee1 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -78,7 +78,7 @@ unsafe fn keyexpr_create( Ok(name) => match keyexpr_create_inner(name, should_auto_canonize, should_copy) { Ok(v) => Ok(v), Err(e) => { - tracing::error!("Couldn't construct a keyexpr: {}", e); + tracing::error!("Couldn't construct keyexpr: {}", e); Err(result::Z_EINVAL) } }, diff --git a/src/liveliness.rs b/src/liveliness.rs index 9ee54d581..9bf168ab6 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -101,7 +101,7 @@ pub extern "C" fn zc_liveliness_declare_token( result::Z_OK } Err(e) => { - tracing::error!("Failed to undeclare token: {e}"); + tracing::error!("Failed to undeclare liveliness token: {e}"); this.write(None); result::Z_EGENERIC } From 9e30b3430b6801286d630de269a69ff76c390d7d Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 21 Aug 2024 11:03:54 +0200 Subject: [PATCH 099/397] `z_check` and `z_null` made internal (#605) * fix: Rename `bump.bash` to `bump-and-tag.bash` * feat: Add `version.txt` and infer version in `bump-and-tag.bash` * fix: Clone repository using actions/checkout * fix: Add `CMakeFiles` to `.gitignore` * fix: Add `debug` and `release` to `.gitignore` * fix: Provide default release number for testing * fix: Don't bump deps when pattern is undefined * fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330) Co-authored-by: eclipse-zenoh-bot * fix: Specify git remote when pushing the tag * fix: Require `VERSION`in `bump-and-tag.bash` * fix: Override release tag if it already exists * feat(tracing): using tracing and zenoh-util init_log (#308) * feat(tracing): using tracing and zenoh-util init_log Signed-off-by: gabrik * chore: adding Cargo.lock Signed-off-by: gabrik * chore: updated Cargo.toml.in Signed-off-by: gabrik * feat(tracing): using zenoh main branch Signed-off-by: gabrik --------- Signed-off-by: gabrik * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337) Co-authored-by: eclipse-zenoh-bot * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * chore: using new try_init_log_from_env Signed-off-by: gabrik * Align examples and remove reading from stdin (#255) * Remove reading from stdin, align example implementations * Add argument parsing implementation for examples * Add argument parsing to examples, format files * Replace getchar with sleep in z_pong example * Fix typo in include * Use null-pointers instead of empty strings, remove unnecessary mallocs * Free returned pointer after parse_pos_args usage * Add common and positional args parsing to z_ping example * Add formatting for parsed config options * Add const to function parameters * Update mode option help * Fix pos_args memory leak * Refactor parse_args, remove possible strcpy buffer overflow * Change parse_args function returns to const where applicable * Fix const initialization warning * Remove redundant const for value parameters * Fix buf variable memory leak * Update insert json-list config error message * Add usage example for -e and -l arguments in help * Update example notation in help message Co-authored-by: Alexander * Update example notation in help message (2/2) * Fix parameter in error message Co-authored-by: Alexander --------- Co-authored-by: Alexander * Bugfix: Unable to build z_queryable_with_channels.c (#340) Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343) Co-authored-by: eclipse-zenoh-bot * Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360) Co-authored-by: eclipse-zenoh-bot * Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). * build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420) Co-authored-by: eclipse-zenoh-bot * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457) Co-authored-by: eclipse-zenoh-bot * Enable releasing from any branch (#456) * build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460) Co-authored-by: eclipse-zenoh-bot * Update to latest zenoh * Replace `-rc` with `-pre` and document versioning (#466) * build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467) Co-authored-by: eclipse-zenoh-bot * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494) Co-authored-by: eclipse-zenoh-bot * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500) Co-authored-by: eclipse-zenoh-bot * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508) Co-authored-by: eclipse-zenoh-bot * Ensure that find_package(zenohc) can be called two times (#470) * Update CMakeLists.txt (#473) * Install zenohc.dll in /bin on Windows (#471) * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552) Co-authored-by: eclipse-zenoh-bot * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556) Co-authored-by: eclipse-zenoh-bot * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * decl_c_type corrected * cargo check run * borrow error fix * compilation fix * parse arg fix * example compilation fix * examples compile fix * examples build fixes * removed duplicated z_config_default (it's called in parsing args later) * clang format * clang format * cargo.toml restore * added underscore to _z_null and _z_check * missing functions updated * rename to z_internal_null/check * clang format fix * restored headers, corrected cargo.toml --------- Signed-off-by: gabrik Signed-off-by: ChenYing Kuo Co-authored-by: Mahmoud Mazouz Co-authored-by: Denis Biryukov Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: eclipse-zenoh-bot Co-authored-by: Mahmoud Mazouz Co-authored-by: Gabriele Baldoni Co-authored-by: gabrik Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: ChenYing Kuo (CY) Co-authored-by: Jochen Sprickerhof Co-authored-by: Diogo Matsubara Co-authored-by: OlivierHecart Co-authored-by: Silvio Traversaro Co-authored-by: Luca Cominardi --- Cargo.toml | 14 +- build.rs | 22 +- include/zenoh_commons.h | 857 ++++++++++++------------ include/zenoh_macros.h | 366 +++++----- src/closures/hello_closure.rs | 6 +- src/closures/log_closure.rs | 6 +- src/closures/matching_status_closure.rs | 4 +- src/closures/query_channel.rs | 16 +- src/closures/query_closure.rs | 6 +- src/closures/reply_closure.rs | 6 +- src/closures/response_channel.rs | 16 +- src/closures/sample_channel.rs | 12 +- src/closures/sample_closure.rs | 6 +- src/closures/zenohid_closure.rs | 6 +- src/collections.rs | 12 +- src/commons.rs | 8 +- src/config.rs | 18 +- src/encoding.rs | 4 +- src/get.rs | 8 +- src/keyexpr.rs | 4 +- src/liveliness.rs | 6 +- src/payload.rs | 4 +- src/platform/synchronization.rs | 12 +- src/publication_cache.rs | 8 +- src/publisher.rs | 12 +- src/queryable.rs | 8 +- src/querying_subscriber.rs | 6 +- src/scouting.rs | 4 +- src/session.rs | 4 +- src/shm/buffer/zshm.rs | 4 +- src/shm/buffer/zshmmut.rs | 4 +- src/shm/client/shm_client.rs | 4 +- src/shm/client_storage/mod.rs | 14 +- src/shm/provider/alloc_layout.rs | 4 +- src/shm/provider/shm_provider.rs | 4 +- src/shm/provider/types.rs | 18 +- src/subscriber.rs | 4 +- tests/z_api_alignment_test.c | 16 +- tests/z_api_double_drop_test.c | 38 +- tests/z_api_drop_options.c | 8 +- tests/z_api_encoding_test.c | 18 +- tests/z_api_keyexpr_drop_test.c | 2 +- tests/z_api_keyexpr_test.c | 4 +- tests/z_api_null_drop_test.c | 26 +- tests/z_api_unitinialized_check.c | 4 +- 45 files changed, 850 insertions(+), 783 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3c651a157..865011179 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,11 @@ build = "build.rs" [features] logger-autoinit = [] -shared-memory = ["zenoh/shared-memory", "dep:zenoh-ext", "zenoh-ext/shared-memory"] +shared-memory = [ + "zenoh/shared-memory", + "dep:zenoh-ext", + "zenoh-ext/shared-memory", +] unstable = ["zenoh/unstable", "zenoh-ext/unstable", "dep:zenoh-ext"] default = ["zenoh/default"] @@ -52,10 +56,12 @@ rand = "0.8.5" spin = "0.9.5" unwrap-infallible = "0.1.5" const_format = "0.2.32" -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = [ + "internal", +] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true } zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } flume = "*" [build-dependencies] diff --git a/build.rs b/build.rs index 98f558a70..5aa58e2e7 100644 --- a/build.rs +++ b/build.rs @@ -992,7 +992,7 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { if drops != nulls { msgs.push(format!( - "the list of z_xxx_drop and z_xxx_null functions are different:\n missing z_xxx_null for {:?}\n missing z_xxx_drop for {:?}", + "the list of z_xxx_drop and z_internal_xxx_null functions are different:\n missing z_internal_xxx_null for {:?}\n missing z_xxx_drop for {:?}", drops.difference(&nulls), nulls.difference(&drops) )); @@ -1000,7 +1000,7 @@ pub fn create_generics_header(path_in: &str, path_out: &str) { if drops != checks { msgs.push(format!( - "the list of z_xxx_drop and z_xxx_check functions are different:\n missing z_xxx_check for {:?}\n missing z_xxx_drop for {:?}", + "the list of z_xxx_drop and z_internal_xxx_check functions are different:\n missing z_internal_xxx_check for {:?}\n missing z_xxx_drop for {:?}", drops.difference(&checks), checks.difference(&drops) )); @@ -1244,7 +1244,7 @@ pub fn find_drop_functions(path_in: &str) -> Vec { pub fn find_null_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"(\w+)_null\(struct (\w+) \*(\w+)\);").unwrap(); + let re = Regex::new(r" (z.?_internal_\w+_null)\(struct (\w+) \*(\w+)\);").unwrap(); let mut res = Vec::::new(); for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { @@ -1252,7 +1252,7 @@ pub fn find_null_functions(path_in: &str) -> Vec { let f = FunctionSignature::new( semantic, "void", - func_name.to_string() + "_null", + func_name.to_string(), vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], ); res.push(f); @@ -1262,7 +1262,7 @@ pub fn find_null_functions(path_in: &str) -> Vec { pub fn find_check_functions(path_in: &str) -> Vec { let bindings = std::fs::read_to_string(path_in).unwrap(); - let re = Regex::new(r"bool (\w+)_check\(const struct (\w+) \*(\w+)\);").unwrap(); + let re = Regex::new(r"bool (z.?_internal_\w+_check)\(const struct (\w+) \*(\w+)\);").unwrap(); let mut res = Vec::::new(); for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { @@ -1270,7 +1270,7 @@ pub fn find_check_functions(path_in: &str) -> Vec { let f = FunctionSignature::new( semantic, "bool", - func_name.to_string() + "_check", + func_name.to_string(), vec![FuncArg::new( &("const ".to_string() + arg_type + "*"), arg_name, @@ -1415,7 +1415,7 @@ pub fn generate_take_functions(macro_func: &[FunctionSignature]) -> String { for sig in macro_func { let (prefix, _, semantic, _) = split_type_name(&sig.args[0].typename.typename); out += &format!( - "static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_{}_null(&{}->_this); }}\n", + "static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_internal_{}_null(&{}->_this); }}\n", sig.func_name, sig.args[0].typename.typename, sig.args[0].name, @@ -1460,11 +1460,11 @@ pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String { } pub fn generate_generic_null_c(macro_func: &[FunctionSignature]) -> String { - generate_generic_c(macro_func, "z_null", false) + generate_generic_c(macro_func, "z_internal_null", false) } pub fn generate_generic_check_c(macro_func: &[FunctionSignature]) -> String { - generate_generic_c(macro_func, "z_check", true) + generate_generic_c(macro_func, "z_internal_check", true) } pub fn generate_generic_call_c(macro_func: &[FunctionSignature]) -> String { @@ -1589,11 +1589,11 @@ pub fn generate_generic_take_cpp(macro_func: &[FunctionSignature]) -> String { } pub fn generate_generic_null_cpp(macro_func: &[FunctionSignature]) -> String { - generate_generic_cpp(macro_func, "z_null", false) + generate_generic_cpp(macro_func, "z_internal_null", false) } pub fn generate_generic_check_cpp(macro_func: &[FunctionSignature]) -> String { - generate_generic_cpp(macro_func, "z_check", true) + generate_generic_cpp(macro_func, "z_internal_check", true) } pub fn generate_generic_call_cpp(macro_func: &[FunctionSignature]) -> String { diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 4497f0c5e..97283212a 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -1185,12 +1185,6 @@ ZENOHC_API void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_result, const z_loaned_alloc_layout_t *layout); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_alloc_layout_check(const z_owned_alloc_layout_t *this_); -#endif /** * Deletes Alloc Layout */ @@ -1213,12 +1207,6 @@ z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif -/** - * Constructs Alloc Layout in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_alloc_layout_null(z_owned_alloc_layout_t *this_); -#endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_result_t *out_result, @@ -1227,10 +1215,6 @@ z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_re void (*result_callback)(void*, struct z_buf_alloc_result_t*)); #endif -/** - * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_bytes_check(const struct z_owned_bytes_t *this_); /** * Constructs an owned shallow copy of data in provided uninitialized memory location. */ @@ -1487,10 +1471,6 @@ ZENOHC_API const struct z_loaned_bytes_t *z_bytes_loan(const struct z_owned_byte * Muatably borrows data. */ ZENOHC_API struct z_loaned_bytes_t *z_bytes_loan_mut(struct z_owned_bytes_t *this_); -/** - * The gravestone value for `z_owned_bytes_t`. - */ -ZENOHC_API void z_bytes_null(struct z_owned_bytes_t *this_); /** * Reads data into specified destination. * @@ -1639,12 +1619,6 @@ ZENOHC_API z_result_t z_bytes_writer_write_all(struct z_bytes_writer_t *this_, const uint8_t *src, size_t len); -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); -#endif /** * Deletes Chunk Alloc Result */ @@ -1674,12 +1648,6 @@ ZENOHC_API z_result_t z_chunk_alloc_result_new_ok(z_owned_chunk_alloc_result_t *this_, struct z_allocated_chunk_t allocated_chunk); #endif -/** - * Constructs Chunk Alloc Result in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); -#endif /** * Get number of milliseconds passed since creation of `time`. */ @@ -1710,10 +1678,6 @@ z_result_t z_close(struct z_moved_session_t *session); ZENOHC_API void z_closure_hello_call(const struct z_loaned_closure_hello_t *closure, const struct z_loaned_hello_t *hello); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_hello_check(const struct z_owned_closure_hello_t *this_); /** * Drops the closure. Droping an uninitialized closure is a no-op. */ @@ -1723,20 +1687,12 @@ ZENOHC_API void z_closure_hello_drop(struct z_moved_closure_hello_t *this_); */ ZENOHC_API const struct z_loaned_closure_hello_t *z_closure_hello_loan(const struct z_owned_closure_hello_t *closure); -/** - * Constructs a closure in a gravestone state. - */ -ZENOHC_API void z_closure_hello_null(struct z_owned_closure_hello_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API void z_closure_query_call(const struct z_loaned_closure_query_t *closure, const struct z_loaned_query_t *query); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_query_check(const struct z_owned_closure_query_t *this_); /** * Drops the closure, resetting it to its gravestone state. */ @@ -1746,20 +1702,12 @@ ZENOHC_API void z_closure_query_drop(struct z_moved_closure_query_t *closure_); */ ZENOHC_API const struct z_loaned_closure_query_t *z_closure_query_loan(const struct z_owned_closure_query_t *closure); -/** - * Constructs a closure in its gravestone state. - */ -ZENOHC_API void z_closure_query_null(struct z_owned_closure_query_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API void z_closure_reply_call(const struct z_loaned_closure_reply_t *closure, const struct z_loaned_reply_t *reply); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_reply_check(const struct z_owned_closure_reply_t *this_); /** * Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. */ @@ -1770,20 +1718,12 @@ void z_closure_reply_drop(struct z_moved_closure_reply_t *closure_); */ ZENOHC_API const struct z_loaned_closure_reply_t *z_closure_reply_loan(const struct z_owned_closure_reply_t *closure); -/** - * Constructs a closure int its gravestone state. - */ -ZENOHC_API void z_closure_reply_null(struct z_owned_closure_reply_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ ZENOHC_API void z_closure_sample_call(const struct z_loaned_closure_sample_t *closure, const struct z_loaned_sample_t *sample); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_closure_sample_check(const struct z_owned_closure_sample_t *this_); /** * Drops the closure. Droping an uninitialized closure is a no-op. */ @@ -1793,10 +1733,6 @@ ZENOHC_API void z_closure_sample_drop(struct z_moved_closure_sample_t *closure_) */ ZENOHC_API const struct z_loaned_closure_sample_t *z_closure_sample_loan(const struct z_owned_closure_sample_t *closure); -/** - * Constructs a closure in its gravestone state. - */ -ZENOHC_API void z_closure_sample_null(struct z_owned_closure_sample_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -1805,12 +1741,6 @@ ZENOHC_API void z_closure_zid_call(const struct z_loaned_closure_zid_t *closure, const z_id_t *z_id); #endif -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API bool z_closure_zid_check(const struct z_owned_closure_zid_t *this_); -#endif /** * Drops the closure, resetting it to its gravestone state. Droping an uninitialized (null) closure is a no-op. */ @@ -1825,16 +1755,6 @@ void z_closure_zid_drop(struct z_moved_closure_zid_t *closure_); ZENOHC_API const struct z_loaned_closure_zid_t *z_closure_zid_loan(const struct z_owned_closure_zid_t *closure); #endif -/** - * Constructs a null closure. - */ -#if defined(UNSTABLE) -ZENOHC_API void z_closure_zid_null(struct z_owned_closure_zid_t *this_); -#endif -/** - * Returns ``true`` if conditional variable is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_condvar_check(const struct z_owned_condvar_t *this_); /** * Drops conditional variable. */ @@ -1851,10 +1771,6 @@ ZENOHC_API const struct z_loaned_condvar_t *z_condvar_loan(const struct z_owned_ * Mutably borrows conditional variable. */ ZENOHC_API struct z_loaned_condvar_t *z_condvar_loan_mut(struct z_owned_condvar_t *this_); -/** - * Constructs conditional variable in a gravestone state. - */ -ZENOHC_API void z_condvar_null(struct z_owned_condvar_t *this_); /** * Wakes up one blocked thread waiting on this condiitonal variable. * @return 0 in case of success, negative error code in case of failure. @@ -1870,10 +1786,6 @@ ZENOHC_API z_result_t z_condvar_signal(const struct z_loaned_condvar_t *this_); ZENOHC_API z_result_t z_condvar_wait(const struct z_loaned_condvar_t *this_, struct z_loaned_mutex_t *m); -/** - * Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_config_check(const struct z_owned_config_t *this_); /** * Constructs a default, zenoh-allocated, client mode configuration. * @@ -1906,10 +1818,6 @@ ZENOHC_API const struct z_loaned_config_t *z_config_loan(const struct z_owned_co * Mutably borrows config. */ ZENOHC_API struct z_loaned_config_t *z_config_loan_mut(struct z_owned_config_t *this_); -/** - * Constructs config in its gravestone state. - */ -ZENOHC_API void z_config_null(struct z_owned_config_t *this_); /** * Constructs a default peer mode configuration. */ @@ -2150,10 +2058,6 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_audio_ogg(void); * Constant alias for string: `"audio/vorbis"`. */ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_audio_vorbis(void); -/** - * Returns ``true`` if encoding is in non-default state, ``false`` otherwise. - */ -ZENOHC_API bool z_encoding_check(const struct z_owned_encoding_t *this_); /** * Constructs an owned copy of the encoding in provided uninitilized memory location. */ @@ -2218,10 +2122,6 @@ ZENOHC_API const struct z_loaned_encoding_t *z_encoding_loan_default(void); * Mutably borrows encoding. */ ZENOHC_API struct z_loaned_encoding_t *z_encoding_loan_mut(struct z_owned_encoding_t *this_); -/** - * Constructs a default `z_owned_encoding_t`. - */ -ZENOHC_API void z_encoding_null(struct z_owned_encoding_t *this_); /** * Set a schema to this encoding from a c string. Zenoh does not define what a schema is and its semantichs is left to the implementer. * E.g. a common schema for `text/plain` encoding is `utf-8`. @@ -2527,10 +2427,6 @@ ZENOHC_API void z_fifo_channel_sample_new(struct z_owned_closure_sample_t *callback, struct z_owned_fifo_handler_sample_t *handler, size_t capacity); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_fifo_handler_query_check(const struct z_owned_fifo_handler_query_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -2540,10 +2436,6 @@ ZENOHC_API void z_fifo_handler_query_drop(struct z_moved_fifo_handler_query_t *t */ ZENOHC_API const struct z_loaned_fifo_handler_query_t *z_fifo_handler_query_loan(const struct z_owned_fifo_handler_query_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_fifo_handler_query_null(struct z_owned_fifo_handler_query_t *this_); /** * Returns query from the fifo buffer. If there are no more pending queries will block until next query is received, or until * the channel is dropped (normally when Queryable is dropped). @@ -2561,10 +2453,6 @@ z_result_t z_fifo_handler_query_recv(const struct z_loaned_fifo_handler_query_t ZENOHC_API z_result_t z_fifo_handler_query_try_recv(const struct z_loaned_fifo_handler_query_t *this_, struct z_owned_query_t *query); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_fifo_handler_reply_check(const struct z_owned_fifo_handler_reply_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -2574,10 +2462,6 @@ ZENOHC_API void z_fifo_handler_reply_drop(struct z_moved_fifo_handler_reply_t *t */ ZENOHC_API const struct z_loaned_fifo_handler_reply_t *z_fifo_handler_reply_loan(const struct z_owned_fifo_handler_reply_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_fifo_handler_reply_null(struct z_owned_fifo_handler_reply_t *this_); /** * Returns reply from the fifo buffer. If there are no more pending replies will block until next reply is received, or until * the channel is dropped (normally when all replies are received). @@ -2594,10 +2478,6 @@ z_result_t z_fifo_handler_reply_recv(const struct z_loaned_fifo_handler_reply_t ZENOHC_API z_result_t z_fifo_handler_reply_try_recv(const struct z_loaned_fifo_handler_reply_t *this_, struct z_owned_reply_t *reply); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_fifo_handler_sample_check(const struct z_owned_fifo_handler_sample_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -2607,10 +2487,6 @@ ZENOHC_API void z_fifo_handler_sample_drop(struct z_moved_fifo_handler_sample_t */ ZENOHC_API const struct z_loaned_fifo_handler_sample_t *z_fifo_handler_sample_loan(const struct z_owned_fifo_handler_sample_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_fifo_handler_sample_null(struct z_owned_fifo_handler_sample_t *this_); /** * Returns sample from the fifo buffer. If there are no more pending replies will block until next sample is received, or until * the channel is dropped (normally when there are no more samples to receive). @@ -2650,10 +2526,6 @@ z_result_t z_get(const struct z_loaned_session_t *session, * Constructs default `z_get_options_t` */ ZENOHC_API void z_get_options_default(struct z_get_options_t *this_); -/** - * Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_hello_check(const struct z_owned_hello_t *this_); /** * Frees memory and resets hello message to its gravestone state. */ @@ -2670,10 +2542,6 @@ ZENOHC_API const struct z_loaned_hello_t *z_hello_loan(const struct z_owned_hell ZENOHC_API void z_hello_locators(const struct z_loaned_hello_t *this_, struct z_owned_string_array_t *locators_out); -/** - * Constructs hello message in a gravestone state. - */ -ZENOHC_API void z_hello_null(struct z_owned_hello_t *this_); /** * Returns type of Zenoh entity that transmitted hello message. */ @@ -2720,6 +2588,364 @@ z_result_t z_info_routers_zid(const struct z_loaned_session_t *session, #if defined(UNSTABLE) ZENOHC_API z_id_t z_info_zid(const struct z_loaned_session_t *session); #endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_alloc_layout_check(const z_owned_alloc_layout_t *this_); +#endif +/** + * Constructs Alloc Layout in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_alloc_layout_null(z_owned_alloc_layout_t *this_); +#endif +/** + * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_bytes_check(const struct z_owned_bytes_t *this_); +/** + * The gravestone value for `z_owned_bytes_t`. + */ +ZENOHC_API void z_internal_bytes_null(struct z_owned_bytes_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +#endif +/** + * Constructs Chunk Alloc Result in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +#endif +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_hello_check(const struct z_owned_closure_hello_t *this_); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void z_internal_closure_hello_null(struct z_owned_closure_hello_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_query_check(const struct z_owned_closure_query_t *this_); +/** + * Constructs a closure in its gravestone state. + */ +ZENOHC_API void z_internal_closure_query_null(struct z_owned_closure_query_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_reply_check(const struct z_owned_closure_reply_t *this_); +/** + * Constructs a closure int its gravestone state. + */ +ZENOHC_API void z_internal_closure_reply_null(struct z_owned_closure_reply_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_closure_sample_check(const struct z_owned_closure_sample_t *this_); +/** + * Constructs a closure in its gravestone state. + */ +ZENOHC_API void z_internal_closure_sample_null(struct z_owned_closure_sample_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API bool z_internal_closure_zid_check(const struct z_owned_closure_zid_t *this_); +#endif +/** + * Constructs a null closure. + */ +#if defined(UNSTABLE) +ZENOHC_API void z_internal_closure_zid_null(struct z_owned_closure_zid_t *this_); +#endif +/** + * Returns ``true`` if conditional variable is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_condvar_check(const struct z_owned_condvar_t *this_); +/** + * Constructs conditional variable in a gravestone state. + */ +ZENOHC_API void z_internal_condvar_null(struct z_owned_condvar_t *this_); +/** + * Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_config_check(const struct z_owned_config_t *this_); +/** + * Constructs config in its gravestone state. + */ +ZENOHC_API void z_internal_config_null(struct z_owned_config_t *this_); +/** + * Returns ``true`` if encoding is in non-default state, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_encoding_check(const struct z_owned_encoding_t *this_); +/** + * Constructs a default `z_owned_encoding_t`. + */ +ZENOHC_API void z_internal_encoding_null(struct z_owned_encoding_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_fifo_handler_query_check(const struct z_owned_fifo_handler_query_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_fifo_handler_query_null(struct z_owned_fifo_handler_query_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_fifo_handler_reply_check(const struct z_owned_fifo_handler_reply_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_fifo_handler_reply_null(struct z_owned_fifo_handler_reply_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_fifo_handler_sample_check(const struct z_owned_fifo_handler_sample_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_fifo_handler_sample_null(struct z_owned_fifo_handler_sample_t *this_); +/** + * Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_hello_check(const struct z_owned_hello_t *this_); +/** + * Constructs hello message in a gravestone state. + */ +ZENOHC_API void z_internal_hello_null(struct z_owned_hello_t *this_); +/** + * Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_keyexpr_check(const struct z_owned_keyexpr_t *this_); +/** + * Constructs an owned key expression in a gravestone state. + */ +ZENOHC_API void z_internal_keyexpr_null(struct z_owned_keyexpr_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_memory_layout_check(const z_owned_memory_layout_t *this_); +#endif +/** + * Constructs Memory Layout in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_memory_layout_null(z_owned_memory_layout_t *this_); +#endif +/** + * Returns ``true`` if mutex is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_mutex_check(const struct z_owned_mutex_t *this_); +/** + * Constructs mutex in a gravestone state. + */ +ZENOHC_API void z_internal_mutex_null(struct z_owned_mutex_t *this_); +/** + * Returns ``true`` if publisher is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_publisher_check(const struct z_owned_publisher_t *this_); +/** + * Constructs a publisher in a gravestone state. + */ +ZENOHC_API void z_internal_publisher_null(struct z_owned_publisher_t *this_); +/** + * Returns `false` if `this` is in a gravestone state, `true` otherwise. + */ +ZENOHC_API bool z_internal_query_check(const struct z_owned_query_t *query); +/** + * Constructs query in its gravestone value. + */ +ZENOHC_API void z_internal_query_null(struct z_owned_query_t *this_); +/** + * Returns ``true`` if queryable is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_queryable_check(const struct z_owned_queryable_t *this_); +/** + * Constructs a queryable in its gravestone value. + */ +ZENOHC_API void z_internal_queryable_null(struct z_owned_queryable_t *this_); +/** + * Returns ``true`` if `reply` is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_reply_check(const struct z_owned_reply_t *this_); +/** + * Returns ``true`` if reply error is in non-default state, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_reply_err_check(const struct z_owned_reply_err_t *this_); +/** + * Constructs an empty `z_owned_reply_err_t`. + */ +ZENOHC_API void z_internal_reply_err_null(struct z_owned_reply_err_t *this_); +/** + * Constructs the reply in its gravestone state. + */ +ZENOHC_API void z_internal_reply_null(struct z_owned_reply_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_ring_handler_query_check(const struct z_owned_ring_handler_query_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_ring_handler_query_null(struct z_owned_ring_handler_query_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_ring_handler_reply_check(const struct z_owned_ring_handler_reply_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_ring_handler_reply_null(struct z_owned_ring_handler_reply_t *this_); +/** + * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool z_internal_ring_handler_sample_check(const struct z_owned_ring_handler_sample_t *this_); +/** + * Constructs a handler in gravestone state. + */ +ZENOHC_API void z_internal_ring_handler_sample_null(struct z_owned_ring_handler_sample_t *this_); +/** + * Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_sample_check(const struct z_owned_sample_t *this_); +/** + * Constructs sample in its gravestone state. + */ +ZENOHC_API void z_internal_sample_null(struct z_owned_sample_t *this_); +/** + * Returns ``true`` if `session` is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_session_check(const struct z_owned_session_t *this_); +/** + * Constructs a Zenoh session in its gravestone state. + */ +ZENOHC_API void z_internal_session_null(struct z_owned_session_t *this_); +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_check(const z_owned_shm_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_client_check(const z_owned_shm_client_t *this_); +#endif +/** + * Constructs SHM client in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_client_null(z_owned_shm_client_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); +#endif +/** + * Constructs SHM Client Storage in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_client_storage_null(z_owned_shm_client_storage_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_mut_check(const z_owned_shm_mut_t *this_); +#endif +/** + * Constructs ZShmMut slice in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_mut_null(z_owned_shm_mut_t *this_); +#endif +/** + * Constructs ZShm slice in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_null(z_owned_shm_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool z_internal_shm_provider_check(const z_owned_shm_provider_t *this_); +#endif +/** + * Constructs SHM Provider in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void z_internal_shm_provider_null(z_owned_shm_provider_t *this_); +#endif +/** + * @return ``true`` if slice is not empty, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_slice_check(const struct z_owned_slice_t *this_); +/** + * Constructs an empty `z_owned_slice_t`. + */ +ZENOHC_API void z_internal_slice_null(struct z_owned_slice_t *this_); +/** + * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API bool z_internal_source_info_check(const z_owned_source_info_t *this_); +#endif +/** + * Constructs source info in its gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API void z_internal_source_info_null(z_owned_source_info_t *this_); +#endif +/** + * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. + */ +ZENOHC_API bool z_internal_string_array_check(const struct z_owned_string_array_t *this_); +/** + * Constructs string array in its gravestone state. + */ +ZENOHC_API void z_internal_string_array_null(struct z_owned_string_array_t *this_); +/** + * @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool z_internal_string_check(const struct z_owned_string_t *this_); +/** + * Constructs owned string in a gravestone state. + */ +ZENOHC_API void z_internal_string_null(struct z_owned_string_t *this_); +/** + * Returns ``true`` if subscriber is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_subscriber_check(const struct z_owned_subscriber_t *this_); +/** + * Constructs a subscriber in a gravestone state. + */ +ZENOHC_API void z_internal_subscriber_null(struct z_owned_subscriber_t *this_); +/** + * Returns ``true`` if task is valid, ``false`` otherwise. + */ +ZENOHC_API bool z_internal_task_check(const struct z_owned_task_t *this_); +/** + * Constructs task in a gravestone state. + */ +ZENOHC_API void z_internal_task_null(struct z_owned_task_t *this_); /** * Constructs a non-owned non-null-terminated string from key expression. */ @@ -2746,10 +2972,6 @@ z_result_t z_keyexpr_canonize(char *start, */ ZENOHC_API z_result_t z_keyexpr_canonize_null_terminated(char *start); -/** - * Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_keyexpr_check(const struct z_owned_keyexpr_t *this_); /** * Constructs key expression by concatenation of key expression in `left` with a string in `right`. * Returns 0 in case of success, negative error code otherwise. @@ -2844,10 +3066,6 @@ z_result_t z_keyexpr_join(struct z_owned_keyexpr_t *this_, * Borrows `z_owned_keyexpr_t`. */ ZENOHC_API const struct z_loaned_keyexpr_t *z_keyexpr_loan(const struct z_owned_keyexpr_t *this_); -/** - * Constructs an owned key expression in a gravestone state. - */ -ZENOHC_API void z_keyexpr_null(struct z_owned_keyexpr_t *this_); /** * Returns the relation between `left` and `right` from `left`'s point of view. * @@ -2858,12 +3076,6 @@ ZENOHC_API enum z_keyexpr_intersection_level_t z_keyexpr_relation_to(const struct z_loaned_keyexpr_t *left, const struct z_loaned_keyexpr_t *right); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_memory_layout_check(const z_owned_memory_layout_t *this_); -#endif /** * Deletes Memory Layout */ @@ -2895,16 +3107,6 @@ z_result_t z_memory_layout_new(z_owned_memory_layout_t *this_, size_t size, struct z_alloc_alignment_t alignment); #endif -/** - * Constructs Memory Layout in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_memory_layout_null(z_owned_memory_layout_t *this_); -#endif -/** - * Returns ``true`` if mutex is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_mutex_check(const struct z_owned_mutex_t *this_); /** * Drops mutex and resets it to its gravestone state. */ @@ -2923,10 +3125,6 @@ ZENOHC_API struct z_loaned_mutex_t *z_mutex_loan_mut(struct z_owned_mutex_t *thi * @return 0 in case of success, negative error code in case of failure. */ ZENOHC_API z_result_t z_mutex_lock(struct z_loaned_mutex_t *this_); -/** - * Constructs mutex in a gravestone state. - */ -ZENOHC_API void z_mutex_null(struct z_owned_mutex_t *this_); /** * Tries to lock mutex. If mutex is already locked, return immediately. * @return 0 in case of success, negative value if failed to aquire the lock. @@ -2975,10 +3173,6 @@ z_result_t z_posix_shm_provider_new(z_owned_shm_provider_t *this_, * Returns the default value of #z_priority_t. */ ZENOHC_API enum z_priority_t z_priority_default(void); -/** - * Returns ``true`` if publisher is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_publisher_check(const struct z_owned_publisher_t *this_); /** * Sends a `DELETE` message onto the publisher's key expression. * @@ -3015,10 +3209,6 @@ const struct z_loaned_publisher_t *z_publisher_loan(const struct z_owned_publish * Mutably borrows publisher. */ ZENOHC_API struct z_loaned_publisher_t *z_publisher_loan_mut(struct z_owned_publisher_t *this_); -/** - * Constructs a publisher in a gravestone state. - */ -ZENOHC_API void z_publisher_null(struct z_owned_publisher_t *this_); /** * Constructs the default value for `z_publisher_options_t`. */ @@ -3069,10 +3259,6 @@ ZENOHC_API void z_put_options_default(struct z_put_options_t *this_); * Returns NULL if query does not contain an attachment. */ ZENOHC_API const struct z_loaned_bytes_t *z_query_attachment(const struct z_loaned_query_t *this_); -/** - * Returns `false` if `this` is in a gravestone state, `true` otherwise. - */ -ZENOHC_API bool z_query_check(const struct z_owned_query_t *query); /** * Constructs a shallow copy of the query, allowing to keep it in an "open" state past the callback's return. * @@ -3132,11 +3318,7 @@ ZENOHC_API const struct z_loaned_keyexpr_t *z_query_keyexpr(const struct z_loane /** * Borrows the query. */ -ZENOHC_API const struct z_loaned_query_t *z_query_loan(const struct z_owned_query_t *this_); -/** - * Constructs query in its gravestone value. - */ -ZENOHC_API void z_query_null(struct z_owned_query_t *this_); +ZENOHC_API const struct z_loaned_query_t *z_query_loan(const struct z_owned_query_t *this_); /** * Gets query value selector. */ @@ -3222,20 +3404,12 @@ ZENOHC_API void z_query_reply_options_default(struct z_query_reply_options_t *th * Create a default `z_query_target_t`. */ ZENOHC_API enum z_query_target_t z_query_target_default(void); -/** - * Returns ``true`` if queryable is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_queryable_check(const struct z_owned_queryable_t *this_); /** * Frees memory and resets it to its gravesztone state. Will also attempt to undeclare queryable. */ ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t *this_); ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); -/** - * Constructs a queryable in its gravestone value. - */ -ZENOHC_API void z_queryable_null(struct z_owned_queryable_t *this_); /** * Constructs the default value for `z_query_reply_options_t`. */ @@ -3263,10 +3437,6 @@ ZENOHC_API uint8_t z_random_u8(void); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); #endif -/** - * Returns ``true`` if `reply` is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_reply_check(const struct z_owned_reply_t *this_); /** * Constructs an owned shallow copy of reply in provided uninitialized memory location. */ @@ -3281,10 +3451,6 @@ ZENOHC_API void z_reply_drop(struct z_moved_reply_t *this_); * Returns `NULL` if reply does not contain a error (i. e. if `z_reply_is_ok` returns ``true``). */ ZENOHC_API const struct z_loaned_reply_err_t *z_reply_err(const struct z_loaned_reply_t *this_); -/** - * Returns ``true`` if reply error is in non-default state, ``false`` otherwise. - */ -ZENOHC_API bool z_reply_err_check(const struct z_owned_reply_err_t *this_); /** * Frees the memory and resets the reply error it to its default value. */ @@ -3299,10 +3465,6 @@ const struct z_loaned_encoding_t *z_reply_err_encoding(const struct z_loaned_rep */ ZENOHC_API const struct z_loaned_reply_err_t *z_reply_err_loan(const struct z_owned_reply_err_t *this_); -/** - * Constructs an empty `z_owned_reply_err_t`. - */ -ZENOHC_API void z_reply_err_null(struct z_owned_reply_err_t *this_); /** * Returns reply error payload. */ @@ -3317,10 +3479,6 @@ bool z_reply_is_ok(const struct z_loaned_reply_t *this_); * Borrows reply. */ ZENOHC_API const struct z_loaned_reply_t *z_reply_loan(const struct z_owned_reply_t *this_); -/** - * Constructs the reply in its gravestone state. - */ -ZENOHC_API void z_reply_null(struct z_owned_reply_t *this_); /** * Yields the contents of the reply by asserting it indicates a success. * @@ -3355,10 +3513,6 @@ ZENOHC_API void z_ring_channel_sample_new(struct z_owned_closure_sample_t *callback, struct z_owned_ring_handler_sample_t *handler, size_t capacity); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_ring_handler_query_check(const struct z_owned_ring_handler_query_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -3368,10 +3522,6 @@ ZENOHC_API void z_ring_handler_query_drop(struct z_moved_ring_handler_query_t *t */ ZENOHC_API const struct z_loaned_ring_handler_query_t *z_ring_handler_query_loan(const struct z_owned_ring_handler_query_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_ring_handler_query_null(struct z_owned_ring_handler_query_t *this_); /** * Returns query from the ring buffer. If there are no more pending queries will block until next query is received, or until * the channel is dropped (normally when Queryable is dropped). @@ -3388,10 +3538,6 @@ z_result_t z_ring_handler_query_recv(const struct z_loaned_ring_handler_query_t ZENOHC_API z_result_t z_ring_handler_query_try_recv(const struct z_loaned_ring_handler_query_t *this_, struct z_owned_query_t *query); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_ring_handler_reply_check(const struct z_owned_ring_handler_reply_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -3401,10 +3547,6 @@ ZENOHC_API void z_ring_handler_reply_drop(struct z_moved_ring_handler_reply_t *t */ ZENOHC_API const struct z_loaned_ring_handler_reply_t *z_ring_handler_reply_loan(const struct z_owned_ring_handler_reply_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_ring_handler_reply_null(struct z_owned_ring_handler_reply_t *this_); /** * Returns reply from the ring buffer. If there are no more pending replies will block until next reply is received, or until * the channel is dropped (normally when all replies are received). @@ -3421,10 +3563,6 @@ z_result_t z_ring_handler_reply_recv(const struct z_loaned_ring_handler_reply_t ZENOHC_API z_result_t z_ring_handler_reply_try_recv(const struct z_loaned_ring_handler_reply_t *this_, struct z_owned_reply_t *reply); -/** - * Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_ring_handler_sample_check(const struct z_owned_ring_handler_sample_t *this_); /** * Drops the handler and resets it to a gravestone state. */ @@ -3434,10 +3572,6 @@ ZENOHC_API void z_ring_handler_sample_drop(struct z_moved_ring_handler_sample_t */ ZENOHC_API const struct z_loaned_ring_handler_sample_t *z_ring_handler_sample_loan(const struct z_owned_ring_handler_sample_t *this_); -/** - * Constructs a handler in gravestone state. - */ -ZENOHC_API void z_ring_handler_sample_null(struct z_owned_ring_handler_sample_t *this_); /** * Returns sample from the ring buffer. If there are no more pending replies will block until next sample is received, or until * the channel is dropped (normally when there are no more replies to receive). @@ -3461,10 +3595,6 @@ z_result_t z_ring_handler_sample_try_recv(const struct z_loaned_ring_handler_sam */ ZENOHC_API const struct z_loaned_bytes_t *z_sample_attachment(const struct z_loaned_sample_t *this_); -/** - * Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_sample_check(const struct z_owned_sample_t *this_); /** * Constructs an owned shallow copy of the sample (i.e. all modficiations applied to the copy, might be visible in the original) in provided uninitilized memory location. */ @@ -3501,10 +3631,6 @@ ZENOHC_API enum z_sample_kind_t z_sample_kind(const struct z_loaned_sample_t *th * Borrows sample. */ ZENOHC_API const struct z_loaned_sample_t *z_sample_loan(const struct z_owned_sample_t *this_); -/** - * Constructs sample in its gravestone state. - */ -ZENOHC_API void z_sample_null(struct z_owned_sample_t *this_); /** * Returns the sample payload data. */ @@ -3543,10 +3669,6 @@ z_result_t z_scout(struct z_moved_config_t *config, * Constructs the default values for the scouting operation. */ ZENOHC_API void z_scout_options_default(struct z_scout_options_t *this_); -/** - * Returns ``true`` if `session` is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_session_check(const struct z_owned_session_t *this_); /** * Constructs an owned shallow copy of the session in provided uninitialized memory location. */ @@ -3563,22 +3685,6 @@ ZENOHC_API void z_session_drop(struct z_moved_session_t *this_); * Borrows session. */ ZENOHC_API const struct z_loaned_session_t *z_session_loan(const struct z_owned_session_t *this_); -/** - * Constructs a Zenoh session in its gravestone state. - */ -ZENOHC_API void z_session_null(struct z_owned_session_t *this_); -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_check(const z_owned_shm_t *this_); -#endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_check(const z_owned_shm_client_t *this_); -#endif /** * Deletes SHM Client */ @@ -3594,18 +3700,6 @@ void z_shm_client_new(z_owned_shm_client_t *this_, struct zc_threadsafe_context_t context, struct zc_shm_client_callbacks_t callbacks); #endif -/** - * Constructs SHM client in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_null(z_owned_shm_client_t *this_); -#endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); -#endif /** * Performs a shallow copy of SHM Client Storage */ @@ -3636,12 +3730,6 @@ z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); #endif -/** - * Constructs SHM Client Storage in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_client_storage_null(z_owned_shm_client_storage_t *this_); -#endif /** * Converts borrowed ZShm slice to owned ZShm slice by performing a shallow SHM reference copy */ @@ -3684,12 +3772,6 @@ ZENOHC_API const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_mut_check(const z_owned_shm_mut_t *this_); -#endif /** * @return the immutable pointer to the underlying data */ @@ -3726,24 +3808,12 @@ ZENOHC_API const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *thi #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); #endif -/** - * Constructs ZShmMut slice in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_mut_null(z_owned_shm_mut_t *this_); -#endif /** * Tries to construct ZShmMut slice from ZShm slice */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, z_moved_shm_t *that); #endif -/** - * Constructs ZShm slice in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_null(z_owned_shm_t *this_); -#endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, @@ -3792,12 +3862,6 @@ void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t * #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool z_shm_provider_check(const z_owned_shm_provider_t *this_); -#endif #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); #endif @@ -3833,12 +3897,6 @@ void z_shm_provider_new(z_owned_shm_provider_t *this_, struct zc_context_t context, struct zc_shm_provider_backend_callbacks_t callbacks); #endif -/** - * Constructs SHM Provider in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void z_shm_provider_null(z_owned_shm_provider_t *this_); -#endif /** * Creates a new threadsafe SHM Provider */ @@ -3873,10 +3931,6 @@ ZENOHC_API int8_t z_sleep_s(size_t time); * Puts current thread to sleep for specified amount of microseconds. */ ZENOHC_API int8_t z_sleep_us(size_t time); -/** - * @return ``true`` if slice is not empty, ``false`` otherwise. - */ -ZENOHC_API bool z_slice_check(const struct z_owned_slice_t *this_); /** * Constructs an owned copy of a slice. */ @@ -3930,16 +3984,6 @@ ZENOHC_API size_t z_slice_len(const struct z_loaned_slice_t *this_); * Borrows slice. */ ZENOHC_API const struct z_loaned_slice_t *z_slice_loan(const struct z_owned_slice_t *this_); -/** - * Constructs an empty `z_owned_slice_t`. - */ -ZENOHC_API void z_slice_null(struct z_owned_slice_t *this_); -/** - * Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API bool z_source_info_check(const z_owned_source_info_t *this_); -#endif /** * Frees the memory and invalidates the source info, resetting it to a gravestone state. */ @@ -3967,22 +4011,12 @@ z_result_t z_source_info_new(z_owned_source_info_t *this_, const z_entity_global_id_t *source_id, uint64_t source_sn); #endif -/** - * Constructs source info in its gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API void z_source_info_null(z_owned_source_info_t *this_); -#endif /** * Returns the source_sn of the source info. */ #if defined(UNSTABLE) ZENOHC_API uint64_t z_source_info_sn(const z_loaned_source_info_t *this_); #endif -/** - * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. - */ -ZENOHC_API bool z_string_array_check(const struct z_owned_string_array_t *this_); /** * Destroys the string array, resetting it to its gravestone value. */ @@ -4017,10 +4051,6 @@ struct z_loaned_string_array_t *z_string_array_loan_mut(struct z_owned_string_ar * Constructs a new empty string array. */ ZENOHC_API void z_string_array_new(struct z_owned_string_array_t *this_); -/** - * Constructs string array in its gravestone state. - */ -ZENOHC_API void z_string_array_null(struct z_owned_string_array_t *this_); /** * Appends specified value to the end of the string array by alias. * @@ -4038,10 +4068,6 @@ ZENOHC_API size_t z_string_array_push_by_copy(struct z_loaned_string_array_t *this_, const struct z_loaned_string_t *value); ZENOHC_API const struct z_loaned_slice_t *z_string_as_slice(const struct z_loaned_string_t *this_); -/** - * @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool z_string_check(const struct z_owned_string_t *this_); /** * Constructs an owned copy of a string. */ @@ -4100,14 +4126,6 @@ ZENOHC_API size_t z_string_len(const struct z_loaned_string_t *this_); * Borrows string. */ ZENOHC_API const struct z_loaned_string_t *z_string_loan(const struct z_owned_string_t *this_); -/** - * Constructs owned string in a gravestone state. - */ -ZENOHC_API void z_string_null(struct z_owned_string_t *this_); -/** - * Returns ``true`` if subscriber is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_subscriber_check(const struct z_owned_subscriber_t *this_); /** * Drops subscriber and resets it to its gravestone state. Also attempts to undeclare it. */ @@ -4122,18 +4140,10 @@ const struct z_loaned_keyexpr_t *z_subscriber_keyexpr(const struct z_loaned_subs */ ZENOHC_API const struct z_loaned_subscriber_t *z_subscriber_loan(const struct z_owned_subscriber_t *this_); -/** - * Constructs a subscriber in a gravestone state. - */ -ZENOHC_API void z_subscriber_null(struct z_owned_subscriber_t *this_); /** * Constructs the default value for `z_subscriber_options_t`. */ ZENOHC_API void z_subscriber_options_default(struct z_subscriber_options_t *this_); -/** - * Returns ``true`` if task is valid, ``false`` otherwise. - */ -ZENOHC_API bool z_task_check(const struct z_owned_task_t *this_); /** * Detaches the task and releases all allocated resources. */ @@ -4159,10 +4169,6 @@ z_result_t z_task_init(struct z_owned_task_t *this_, * Joins the task and releases all allocated resources */ ZENOHC_API z_result_t z_task_join(struct z_moved_task_t *this_); -/** - * Constructs task in a gravestone state. - */ -ZENOHC_API void z_task_null(struct z_owned_task_t *this_); /** * Get number of milliseconds passed since creation of `time`. */ @@ -4388,10 +4394,6 @@ ZENOHC_API void zc_closure_log_call(const struct zc_loaned_closure_log_t *closure, enum zc_log_severity_t severity, const struct z_loaned_string_t *msg); -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -ZENOHC_API bool zc_closure_log_check(const struct zc_owned_closure_log_t *this_); /** * Drops the closure. Droping an uninitialized closure is a no-op. */ @@ -4401,10 +4403,6 @@ ZENOHC_API void zc_closure_log_drop(struct zc_moved_closure_log_t *closure_); */ ZENOHC_API const struct zc_loaned_closure_log_t *zc_closure_log_loan(const struct zc_owned_closure_log_t *closure); -/** - * Constructs a closure in a gravestone state. - */ -ZENOHC_API void zc_closure_log_null(struct zc_owned_closure_log_t *this_); /** * Calls the closure. Calling an uninitialized closure is a no-op. */ @@ -4413,13 +4411,6 @@ ZENOHC_API void zc_closure_matching_status_call(const struct zc_loaned_closure_matching_status_t *closure, const struct zc_matching_status_t *mathing_status); #endif -/** - * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API -bool zc_closure_matching_status_check(const struct zc_owned_closure_matching_status_t *this_); -#endif /** * Drops the closure, resetting it to its gravestone state. Droping an uninitialized closure is a no-op. */ @@ -4434,12 +4425,6 @@ void zc_closure_matching_status_drop(struct zc_moved_closure_matching_status_t * ZENOHC_API const struct zc_loaned_closure_matching_status_t *zc_closure_matching_status_loan(const struct zc_owned_closure_matching_status_t *closure); #endif -/** - * Constructs a null value of 'zc_owned_closure_matching_status_t' type - */ -#if defined(UNSTABLE) -ZENOHC_API void zc_closure_matching_status_null(struct zc_owned_closure_matching_status_t *this_); -#endif /** * Constructs a configuration by parsing a file path stored in ZENOH_CONFIG environmental variable. * @@ -4522,6 +4507,64 @@ ZENOHC_API void zc_init_logging(void); ZENOHC_API void zc_init_logging_with_callback(enum zc_log_severity_t min_severity, struct zc_owned_closure_log_t *callback); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API bool zc_internal_closure_log_check(const struct zc_owned_closure_log_t *this_); +/** + * Constructs a closure in a gravestone state. + */ +ZENOHC_API void zc_internal_closure_log_null(struct zc_owned_closure_log_t *this_); +/** + * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API +bool zc_internal_closure_matching_status_check(const struct zc_owned_closure_matching_status_t *this_); +#endif +/** + * Constructs a null value of 'zc_owned_closure_matching_status_t' type + */ +#if defined(UNSTABLE) +ZENOHC_API +void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_status_t *this_); +#endif +/** + * Returns ``true`` if liveliness token is valid, ``false`` otherwise. + */ +#if defined(UNSTABLE) +ZENOHC_API bool zc_internal_liveliness_token_check(const zc_owned_liveliness_token_t *this_); +#endif +/** + * Constructs liveliness token in its gravestone state. + */ +#if defined(UNSTABLE) +ZENOHC_API void zc_internal_liveliness_token_null(zc_owned_liveliness_token_t *this_); +#endif +/** + * Checks the matching listener is for the gravestone state + */ +#if defined(UNSTABLE) +ZENOHC_API bool zc_internal_matching_listener_check(const zc_owned_matching_listener_t *this_); +#endif +/** + * Constructs an empty matching listener + */ +#if defined(UNSTABLE) +ZENOHC_API void zc_internal_matching_listener_null(zc_owned_matching_listener_t *this_); +#endif +/** + * Returns ``true`` if `this` is valid. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API bool zc_internal_shm_client_list_check(const zc_owned_shm_client_list_t *this_); +#endif +/** + * Constructs SHM client list in its gravestone value. + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +ZENOHC_API void zc_internal_shm_client_list_null(zc_owned_shm_client_list_t *this_); +#endif /** * Constructs default value for `zc_liveliness_declaration_options_t`. */ @@ -4594,12 +4637,6 @@ ZENOHC_API void zc_liveliness_get_options_default(struct zc_liveliness_get_optio ZENOHC_API void zc_liveliness_subscriber_options_default(struct zc_liveliness_subscriber_options_t *this_); #endif -/** - * Returns ``true`` if liveliness token is valid, ``false`` otherwise. - */ -#if defined(UNSTABLE) -ZENOHC_API bool zc_liveliness_token_check(const zc_owned_liveliness_token_t *this_); -#endif /** * Undeclares liveliness token, frees memory and resets it to a gravestone state. */ @@ -4613,12 +4650,6 @@ ZENOHC_API void zc_liveliness_token_drop(zc_moved_liveliness_token_t *this_); ZENOHC_API const zc_loaned_liveliness_token_t *zc_liveliness_token_loan(const zc_owned_liveliness_token_t *this_); #endif -/** - * Constructs liveliness token in its gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API void zc_liveliness_token_null(zc_owned_liveliness_token_t *this_); -#endif /** * Destroys a liveliness token, notifying subscribers of its destruction. */ @@ -4631,18 +4662,6 @@ ZENOHC_API z_result_t zc_liveliness_undeclare_token(zc_moved_liveliness_token_t #if defined(UNSTABLE) ZENOHC_API enum zc_locality_t zc_locality_default(void); #endif -/** - * Checks the matching listener is for the gravestone state - */ -#if defined(UNSTABLE) -ZENOHC_API bool zc_matching_listener_check(const zc_owned_matching_listener_t *this_); -#endif -/** - * Constructs an empty matching listener - */ -#if defined(UNSTABLE) -ZENOHC_API void zc_matching_listener_null(zc_owned_matching_listener_t *this_); -#endif /** * Gets publisher matching status - i.e. if there are any subscribers matching its key expression. * @@ -4696,12 +4715,6 @@ z_result_t zc_shm_client_list_add_client(z_protocol_id_t id, z_moved_shm_client_t *client, zc_loaned_shm_client_list_t *list); #endif -/** - * Returns ``true`` if `this` is valid. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API bool zc_shm_client_list_check(const zc_owned_shm_client_list_t *this_); -#endif /** * Deletes list of SHM Clients */ @@ -4728,12 +4741,6 @@ zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_lis #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) ZENOHC_API void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); #endif -/** - * Constructs SHM client list in its gravestone value. - */ -#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) -ZENOHC_API void zc_shm_client_list_null(zc_owned_shm_client_list_t *this_); -#endif /** * Stops all Zenoh tasks and drops all related static variables. * All Zenoh-related structures should be properly dropped/undeclared PRIOR to this call. @@ -4782,31 +4789,37 @@ z_result_t ze_declare_querying_subscriber(ze_owned_querying_subscriber_t *this_, * Returns ``true`` if publication cache is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_publication_cache_check(const ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_internal_publication_cache_check(const ze_owned_publication_cache_t *this_); #endif /** - * Drops publication cache. Also attempts to undeclare it. + * Constructs a publication cache in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); +ZENOHC_API void ze_internal_publication_cache_null(ze_owned_publication_cache_t *this_); #endif /** - * Constructs a publication cache in a gravestone state. + * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_null(ze_owned_publication_cache_t *this_); +ZENOHC_API bool ze_internal_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); #endif /** - * Constructs the default value for `ze_publication_cache_options_t`. + * Constructs a querying subscriber in a gravestone state. */ #if defined(UNSTABLE) -ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache_options_t *this_); +ZENOHC_API void ze_internal_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); #endif /** - * Returns ``true`` if querying subscriber is valid, ``false`` otherwise. + * Drops publication cache. Also attempts to undeclare it. + */ +#if defined(UNSTABLE) +ZENOHC_API void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); +#endif +/** + * Constructs the default value for `ze_publication_cache_options_t`. */ #if defined(UNSTABLE) -ZENOHC_API bool ze_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_publication_cache_options_default(struct ze_publication_cache_options_t *this_); #endif /** * Drops querying subscriber. Also attempts to undeclare it. @@ -4832,12 +4845,6 @@ z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *thi ZENOHC_API const ze_loaned_querying_subscriber_t *ze_querying_subscriber_loan(const ze_owned_querying_subscriber_t *this_); #endif -/** - * Constructs a querying subscriber in a gravestone state. - */ -#if defined(UNSTABLE) -ZENOHC_API void ze_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); -#endif /** * Constructs the default value for `ze_querying_subscriber_options_t`. */ diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 6e92ea128..03d4f9ccb 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -150,70 +150,70 @@ static inline zc_moved_closure_log_t* zc_closure_log_move(zc_owned_closure_log_t zc_owned_closure_log_t : zc_closure_log_move \ )(&this_) -#define z_null(this_) \ +#define z_internal_null(this_) \ _Generic((this_), \ - z_owned_bytes_t* : z_bytes_null, \ - z_owned_closure_hello_t* : z_closure_hello_null, \ - z_owned_closure_query_t* : z_closure_query_null, \ - z_owned_closure_reply_t* : z_closure_reply_null, \ - z_owned_closure_sample_t* : z_closure_sample_null, \ - z_owned_condvar_t* : z_condvar_null, \ - z_owned_config_t* : z_config_null, \ - z_owned_encoding_t* : z_encoding_null, \ - z_owned_fifo_handler_query_t* : z_fifo_handler_query_null, \ - z_owned_fifo_handler_reply_t* : z_fifo_handler_reply_null, \ - z_owned_fifo_handler_sample_t* : z_fifo_handler_sample_null, \ - z_owned_hello_t* : z_hello_null, \ - z_owned_keyexpr_t* : z_keyexpr_null, \ - z_owned_mutex_t* : z_mutex_null, \ - z_owned_publisher_t* : z_publisher_null, \ - z_owned_query_t* : z_query_null, \ - z_owned_queryable_t* : z_queryable_null, \ - z_owned_reply_err_t* : z_reply_err_null, \ - z_owned_reply_t* : z_reply_null, \ - z_owned_ring_handler_query_t* : z_ring_handler_query_null, \ - z_owned_ring_handler_reply_t* : z_ring_handler_reply_null, \ - z_owned_ring_handler_sample_t* : z_ring_handler_sample_null, \ - z_owned_sample_t* : z_sample_null, \ - z_owned_session_t* : z_session_null, \ - z_owned_slice_t* : z_slice_null, \ - z_owned_string_array_t* : z_string_array_null, \ - z_owned_string_t* : z_string_null, \ - z_owned_subscriber_t* : z_subscriber_null, \ - z_owned_task_t* : z_task_null, \ - zc_owned_closure_log_t* : zc_closure_log_null \ + z_owned_bytes_t* : z_internal_bytes_null, \ + z_owned_closure_hello_t* : z_internal_closure_hello_null, \ + z_owned_closure_query_t* : z_internal_closure_query_null, \ + z_owned_closure_reply_t* : z_internal_closure_reply_null, \ + z_owned_closure_sample_t* : z_internal_closure_sample_null, \ + z_owned_condvar_t* : z_internal_condvar_null, \ + z_owned_config_t* : z_internal_config_null, \ + z_owned_encoding_t* : z_internal_encoding_null, \ + z_owned_fifo_handler_query_t* : z_internal_fifo_handler_query_null, \ + z_owned_fifo_handler_reply_t* : z_internal_fifo_handler_reply_null, \ + z_owned_fifo_handler_sample_t* : z_internal_fifo_handler_sample_null, \ + z_owned_hello_t* : z_internal_hello_null, \ + z_owned_keyexpr_t* : z_internal_keyexpr_null, \ + z_owned_mutex_t* : z_internal_mutex_null, \ + z_owned_publisher_t* : z_internal_publisher_null, \ + z_owned_query_t* : z_internal_query_null, \ + z_owned_queryable_t* : z_internal_queryable_null, \ + z_owned_reply_err_t* : z_internal_reply_err_null, \ + z_owned_reply_t* : z_internal_reply_null, \ + z_owned_ring_handler_query_t* : z_internal_ring_handler_query_null, \ + z_owned_ring_handler_reply_t* : z_internal_ring_handler_reply_null, \ + z_owned_ring_handler_sample_t* : z_internal_ring_handler_sample_null, \ + z_owned_sample_t* : z_internal_sample_null, \ + z_owned_session_t* : z_internal_session_null, \ + z_owned_slice_t* : z_internal_slice_null, \ + z_owned_string_array_t* : z_internal_string_array_null, \ + z_owned_string_t* : z_internal_string_null, \ + z_owned_subscriber_t* : z_internal_subscriber_null, \ + z_owned_task_t* : z_internal_task_null, \ + zc_owned_closure_log_t* : zc_internal_closure_log_null \ )(this_) -static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } -static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } -static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } -static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } -static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_fifo_handler_query_null(&x->_this); } -static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_fifo_handler_reply_null(&x->_this); } -static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } -static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } -static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } -static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_queryable_null(&x->_this); } -static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_reply_null(&x->_this); } -static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_reply_err_null(&x->_this); } -static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_ring_handler_query_null(&x->_this); } -static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_ring_handler_reply_null(&x->_this); } -static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } -static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } -static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } -static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } -static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } -static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } -static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } -static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_internal_closure_sample_null(&x->_this); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_internal_condvar_null(&x->_this); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_internal_config_null(&x->_this); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_internal_encoding_null(&x->_this); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_internal_fifo_handler_query_null(&x->_this); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_internal_fifo_handler_reply_null(&x->_this); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_internal_reply_err_null(&x->_this); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_internal_ring_handler_query_null(&x->_this); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_internal_ring_handler_reply_null(&x->_this); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } #define z_take(this_, x) \ @@ -250,38 +250,38 @@ static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_move zc_owned_closure_log_t* : zc_closure_log_take \ )(this_, x) -#define z_check(this_) \ +#define z_internal_check(this_) \ _Generic((this_), \ - z_owned_bytes_t : z_bytes_check, \ - z_owned_closure_hello_t : z_closure_hello_check, \ - z_owned_closure_query_t : z_closure_query_check, \ - z_owned_closure_reply_t : z_closure_reply_check, \ - z_owned_closure_sample_t : z_closure_sample_check, \ - z_owned_condvar_t : z_condvar_check, \ - z_owned_config_t : z_config_check, \ - z_owned_encoding_t : z_encoding_check, \ - z_owned_fifo_handler_query_t : z_fifo_handler_query_check, \ - z_owned_fifo_handler_reply_t : z_fifo_handler_reply_check, \ - z_owned_fifo_handler_sample_t : z_fifo_handler_sample_check, \ - z_owned_hello_t : z_hello_check, \ - z_owned_keyexpr_t : z_keyexpr_check, \ - z_owned_mutex_t : z_mutex_check, \ - z_owned_publisher_t : z_publisher_check, \ - z_owned_query_t : z_query_check, \ - z_owned_queryable_t : z_queryable_check, \ - z_owned_reply_t : z_reply_check, \ - z_owned_reply_err_t : z_reply_err_check, \ - z_owned_ring_handler_query_t : z_ring_handler_query_check, \ - z_owned_ring_handler_reply_t : z_ring_handler_reply_check, \ - z_owned_ring_handler_sample_t : z_ring_handler_sample_check, \ - z_owned_sample_t : z_sample_check, \ - z_owned_session_t : z_session_check, \ - z_owned_slice_t : z_slice_check, \ - z_owned_string_array_t : z_string_array_check, \ - z_owned_string_t : z_string_check, \ - z_owned_subscriber_t : z_subscriber_check, \ - z_owned_task_t : z_task_check, \ - zc_owned_closure_log_t : zc_closure_log_check \ + z_owned_bytes_t : z_internal_bytes_check, \ + z_owned_closure_hello_t : z_internal_closure_hello_check, \ + z_owned_closure_query_t : z_internal_closure_query_check, \ + z_owned_closure_reply_t : z_internal_closure_reply_check, \ + z_owned_closure_sample_t : z_internal_closure_sample_check, \ + z_owned_condvar_t : z_internal_condvar_check, \ + z_owned_config_t : z_internal_config_check, \ + z_owned_encoding_t : z_internal_encoding_check, \ + z_owned_fifo_handler_query_t : z_internal_fifo_handler_query_check, \ + z_owned_fifo_handler_reply_t : z_internal_fifo_handler_reply_check, \ + z_owned_fifo_handler_sample_t : z_internal_fifo_handler_sample_check, \ + z_owned_hello_t : z_internal_hello_check, \ + z_owned_keyexpr_t : z_internal_keyexpr_check, \ + z_owned_mutex_t : z_internal_mutex_check, \ + z_owned_publisher_t : z_internal_publisher_check, \ + z_owned_query_t : z_internal_query_check, \ + z_owned_queryable_t : z_internal_queryable_check, \ + z_owned_reply_t : z_internal_reply_check, \ + z_owned_reply_err_t : z_internal_reply_err_check, \ + z_owned_ring_handler_query_t : z_internal_ring_handler_query_check, \ + z_owned_ring_handler_reply_t : z_internal_ring_handler_reply_check, \ + z_owned_ring_handler_sample_t : z_internal_ring_handler_sample_check, \ + z_owned_sample_t : z_internal_sample_check, \ + z_owned_session_t : z_internal_session_check, \ + z_owned_slice_t : z_internal_slice_check, \ + z_owned_string_array_t : z_internal_string_array_check, \ + z_owned_string_t : z_internal_string_check, \ + z_owned_subscriber_t : z_internal_subscriber_check, \ + z_owned_task_t : z_internal_task_check, \ + zc_owned_closure_log_t : zc_internal_closure_log_check \ )(&this_) #define z_call(closure, hello) \ @@ -456,67 +456,67 @@ inline z_moved_task_t* z_move(z_owned_task_t& this_) { return z_task_move(&this_ inline zc_moved_closure_log_t* z_move(zc_owned_closure_log_t& closure_) { return zc_closure_log_move(&closure_); }; -inline void z_null(z_owned_bytes_t* this_) { z_bytes_null(this_); }; -inline void z_null(z_owned_closure_hello_t* this_) { z_closure_hello_null(this_); }; -inline void z_null(z_owned_closure_query_t* this_) { z_closure_query_null(this_); }; -inline void z_null(z_owned_closure_reply_t* this_) { z_closure_reply_null(this_); }; -inline void z_null(z_owned_closure_sample_t* this_) { z_closure_sample_null(this_); }; -inline void z_null(z_owned_condvar_t* this_) { z_condvar_null(this_); }; -inline void z_null(z_owned_config_t* this_) { z_config_null(this_); }; -inline void z_null(z_owned_encoding_t* this_) { z_encoding_null(this_); }; -inline void z_null(z_owned_fifo_handler_query_t* this_) { z_fifo_handler_query_null(this_); }; -inline void z_null(z_owned_fifo_handler_reply_t* this_) { z_fifo_handler_reply_null(this_); }; -inline void z_null(z_owned_fifo_handler_sample_t* this_) { z_fifo_handler_sample_null(this_); }; -inline void z_null(z_owned_hello_t* this_) { z_hello_null(this_); }; -inline void z_null(z_owned_keyexpr_t* this_) { z_keyexpr_null(this_); }; -inline void z_null(z_owned_mutex_t* this_) { z_mutex_null(this_); }; -inline void z_null(z_owned_publisher_t* this_) { z_publisher_null(this_); }; -inline void z_null(z_owned_query_t* this_) { z_query_null(this_); }; -inline void z_null(z_owned_queryable_t* this_) { z_queryable_null(this_); }; -inline void z_null(z_owned_reply_err_t* this_) { z_reply_err_null(this_); }; -inline void z_null(z_owned_reply_t* this_) { z_reply_null(this_); }; -inline void z_null(z_owned_ring_handler_query_t* this_) { z_ring_handler_query_null(this_); }; -inline void z_null(z_owned_ring_handler_reply_t* this_) { z_ring_handler_reply_null(this_); }; -inline void z_null(z_owned_ring_handler_sample_t* this_) { z_ring_handler_sample_null(this_); }; -inline void z_null(z_owned_sample_t* this_) { z_sample_null(this_); }; -inline void z_null(z_owned_session_t* this_) { z_session_null(this_); }; -inline void z_null(z_owned_slice_t* this_) { z_slice_null(this_); }; -inline void z_null(z_owned_string_array_t* this_) { z_string_array_null(this_); }; -inline void z_null(z_owned_string_t* this_) { z_string_null(this_); }; -inline void z_null(z_owned_subscriber_t* this_) { z_subscriber_null(this_); }; -inline void z_null(z_owned_task_t* this_) { z_task_null(this_); }; -inline void z_null(zc_owned_closure_log_t* this_) { zc_closure_log_null(this_); }; - -static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_bytes_null(&x->_this); } -static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_closure_hello_null(&x->_this); } -static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_closure_query_null(&x->_this); } -static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_closure_reply_null(&x->_this); } -static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_closure_sample_null(&x->_this); } -static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_condvar_null(&x->_this); } -static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_config_null(&x->_this); } -static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_encoding_null(&x->_this); } -static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_fifo_handler_query_null(&x->_this); } -static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_fifo_handler_reply_null(&x->_this); } -static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_fifo_handler_sample_null(&x->_this); } -static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_hello_null(&x->_this); } -static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_keyexpr_null(&x->_this); } -static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_mutex_null(&x->_this); } -static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_publisher_null(&x->_this); } -static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_query_null(&x->_this); } -static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_queryable_null(&x->_this); } -static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_reply_null(&x->_this); } -static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_reply_err_null(&x->_this); } -static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_ring_handler_query_null(&x->_this); } -static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_ring_handler_reply_null(&x->_this); } -static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_ring_handler_sample_null(&x->_this); } -static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_sample_null(&x->_this); } -static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_session_null(&x->_this); } -static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_slice_null(&x->_this); } -static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_string_array_null(&x->_this); } -static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_string_null(&x->_this); } -static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_subscriber_null(&x->_this); } -static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_task_null(&x->_this); } -static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_closure_log_null(&x->_this); } +inline void z_internal_null(z_owned_bytes_t* this_) { z_internal_bytes_null(this_); }; +inline void z_internal_null(z_owned_closure_hello_t* this_) { z_internal_closure_hello_null(this_); }; +inline void z_internal_null(z_owned_closure_query_t* this_) { z_internal_closure_query_null(this_); }; +inline void z_internal_null(z_owned_closure_reply_t* this_) { z_internal_closure_reply_null(this_); }; +inline void z_internal_null(z_owned_closure_sample_t* this_) { z_internal_closure_sample_null(this_); }; +inline void z_internal_null(z_owned_condvar_t* this_) { z_internal_condvar_null(this_); }; +inline void z_internal_null(z_owned_config_t* this_) { z_internal_config_null(this_); }; +inline void z_internal_null(z_owned_encoding_t* this_) { z_internal_encoding_null(this_); }; +inline void z_internal_null(z_owned_fifo_handler_query_t* this_) { z_internal_fifo_handler_query_null(this_); }; +inline void z_internal_null(z_owned_fifo_handler_reply_t* this_) { z_internal_fifo_handler_reply_null(this_); }; +inline void z_internal_null(z_owned_fifo_handler_sample_t* this_) { z_internal_fifo_handler_sample_null(this_); }; +inline void z_internal_null(z_owned_hello_t* this_) { z_internal_hello_null(this_); }; +inline void z_internal_null(z_owned_keyexpr_t* this_) { z_internal_keyexpr_null(this_); }; +inline void z_internal_null(z_owned_mutex_t* this_) { z_internal_mutex_null(this_); }; +inline void z_internal_null(z_owned_publisher_t* this_) { z_internal_publisher_null(this_); }; +inline void z_internal_null(z_owned_query_t* this_) { z_internal_query_null(this_); }; +inline void z_internal_null(z_owned_queryable_t* this_) { z_internal_queryable_null(this_); }; +inline void z_internal_null(z_owned_reply_err_t* this_) { z_internal_reply_err_null(this_); }; +inline void z_internal_null(z_owned_reply_t* this_) { z_internal_reply_null(this_); }; +inline void z_internal_null(z_owned_ring_handler_query_t* this_) { z_internal_ring_handler_query_null(this_); }; +inline void z_internal_null(z_owned_ring_handler_reply_t* this_) { z_internal_ring_handler_reply_null(this_); }; +inline void z_internal_null(z_owned_ring_handler_sample_t* this_) { z_internal_ring_handler_sample_null(this_); }; +inline void z_internal_null(z_owned_sample_t* this_) { z_internal_sample_null(this_); }; +inline void z_internal_null(z_owned_session_t* this_) { z_internal_session_null(this_); }; +inline void z_internal_null(z_owned_slice_t* this_) { z_internal_slice_null(this_); }; +inline void z_internal_null(z_owned_string_array_t* this_) { z_internal_string_array_null(this_); }; +inline void z_internal_null(z_owned_string_t* this_) { z_internal_string_null(this_); }; +inline void z_internal_null(z_owned_subscriber_t* this_) { z_internal_subscriber_null(this_); }; +inline void z_internal_null(z_owned_task_t* this_) { z_internal_task_null(this_); }; +inline void z_internal_null(zc_owned_closure_log_t* this_) { zc_internal_closure_log_null(this_); }; + +static inline void z_bytes_take(z_owned_bytes_t* this_, z_moved_bytes_t* x) { *this_ = x->_this; z_internal_bytes_null(&x->_this); } +static inline void z_closure_hello_take(z_owned_closure_hello_t* this_, z_moved_closure_hello_t* x) { *this_ = x->_this; z_internal_closure_hello_null(&x->_this); } +static inline void z_closure_query_take(z_owned_closure_query_t* closure_, z_moved_closure_query_t* x) { *closure_ = x->_this; z_internal_closure_query_null(&x->_this); } +static inline void z_closure_reply_take(z_owned_closure_reply_t* closure_, z_moved_closure_reply_t* x) { *closure_ = x->_this; z_internal_closure_reply_null(&x->_this); } +static inline void z_closure_sample_take(z_owned_closure_sample_t* closure_, z_moved_closure_sample_t* x) { *closure_ = x->_this; z_internal_closure_sample_null(&x->_this); } +static inline void z_condvar_take(z_owned_condvar_t* this_, z_moved_condvar_t* x) { *this_ = x->_this; z_internal_condvar_null(&x->_this); } +static inline void z_config_take(z_owned_config_t* this_, z_moved_config_t* x) { *this_ = x->_this; z_internal_config_null(&x->_this); } +static inline void z_encoding_take(z_owned_encoding_t* this_, z_moved_encoding_t* x) { *this_ = x->_this; z_internal_encoding_null(&x->_this); } +static inline void z_fifo_handler_query_take(z_owned_fifo_handler_query_t* this_, z_moved_fifo_handler_query_t* x) { *this_ = x->_this; z_internal_fifo_handler_query_null(&x->_this); } +static inline void z_fifo_handler_reply_take(z_owned_fifo_handler_reply_t* this_, z_moved_fifo_handler_reply_t* x) { *this_ = x->_this; z_internal_fifo_handler_reply_null(&x->_this); } +static inline void z_fifo_handler_sample_take(z_owned_fifo_handler_sample_t* this_, z_moved_fifo_handler_sample_t* x) { *this_ = x->_this; z_internal_fifo_handler_sample_null(&x->_this); } +static inline void z_hello_take(z_owned_hello_t* this_, z_moved_hello_t* x) { *this_ = x->_this; z_internal_hello_null(&x->_this); } +static inline void z_keyexpr_take(z_owned_keyexpr_t* this_, z_moved_keyexpr_t* x) { *this_ = x->_this; z_internal_keyexpr_null(&x->_this); } +static inline void z_mutex_take(z_owned_mutex_t* this_, z_moved_mutex_t* x) { *this_ = x->_this; z_internal_mutex_null(&x->_this); } +static inline void z_publisher_take(z_owned_publisher_t* this_, z_moved_publisher_t* x) { *this_ = x->_this; z_internal_publisher_null(&x->_this); } +static inline void z_query_take(z_owned_query_t* this_, z_moved_query_t* x) { *this_ = x->_this; z_internal_query_null(&x->_this); } +static inline void z_queryable_take(z_owned_queryable_t* this_, z_moved_queryable_t* x) { *this_ = x->_this; z_internal_queryable_null(&x->_this); } +static inline void z_reply_take(z_owned_reply_t* this_, z_moved_reply_t* x) { *this_ = x->_this; z_internal_reply_null(&x->_this); } +static inline void z_reply_err_take(z_owned_reply_err_t* this_, z_moved_reply_err_t* x) { *this_ = x->_this; z_internal_reply_err_null(&x->_this); } +static inline void z_ring_handler_query_take(z_owned_ring_handler_query_t* this_, z_moved_ring_handler_query_t* x) { *this_ = x->_this; z_internal_ring_handler_query_null(&x->_this); } +static inline void z_ring_handler_reply_take(z_owned_ring_handler_reply_t* this_, z_moved_ring_handler_reply_t* x) { *this_ = x->_this; z_internal_ring_handler_reply_null(&x->_this); } +static inline void z_ring_handler_sample_take(z_owned_ring_handler_sample_t* this_, z_moved_ring_handler_sample_t* x) { *this_ = x->_this; z_internal_ring_handler_sample_null(&x->_this); } +static inline void z_sample_take(z_owned_sample_t* this_, z_moved_sample_t* x) { *this_ = x->_this; z_internal_sample_null(&x->_this); } +static inline void z_session_take(z_owned_session_t* this_, z_moved_session_t* x) { *this_ = x->_this; z_internal_session_null(&x->_this); } +static inline void z_slice_take(z_owned_slice_t* this_, z_moved_slice_t* x) { *this_ = x->_this; z_internal_slice_null(&x->_this); } +static inline void z_string_array_take(z_owned_string_array_t* this_, z_moved_string_array_t* x) { *this_ = x->_this; z_internal_string_array_null(&x->_this); } +static inline void z_string_take(z_owned_string_t* this_, z_moved_string_t* x) { *this_ = x->_this; z_internal_string_null(&x->_this); } +static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscriber_t* x) { *this_ = x->_this; z_internal_subscriber_null(&x->_this); } +static inline void z_task_take(z_owned_task_t* this_, z_moved_task_t* x) { *this_ = x->_this; z_internal_task_null(&x->_this); } +static inline void zc_closure_log_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) { *closure_ = x->_this; zc_internal_closure_log_null(&x->_this); } @@ -612,36 +612,36 @@ inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* x) }; -inline bool z_check(const z_owned_bytes_t& this_) { return z_bytes_check(&this_); }; -inline bool z_check(const z_owned_closure_hello_t& this_) { return z_closure_hello_check(&this_); }; -inline bool z_check(const z_owned_closure_query_t& this_) { return z_closure_query_check(&this_); }; -inline bool z_check(const z_owned_closure_reply_t& this_) { return z_closure_reply_check(&this_); }; -inline bool z_check(const z_owned_closure_sample_t& this_) { return z_closure_sample_check(&this_); }; -inline bool z_check(const z_owned_condvar_t& this_) { return z_condvar_check(&this_); }; -inline bool z_check(const z_owned_config_t& this_) { return z_config_check(&this_); }; -inline bool z_check(const z_owned_encoding_t& this_) { return z_encoding_check(&this_); }; -inline bool z_check(const z_owned_fifo_handler_query_t& this_) { return z_fifo_handler_query_check(&this_); }; -inline bool z_check(const z_owned_fifo_handler_reply_t& this_) { return z_fifo_handler_reply_check(&this_); }; -inline bool z_check(const z_owned_fifo_handler_sample_t& this_) { return z_fifo_handler_sample_check(&this_); }; -inline bool z_check(const z_owned_hello_t& this_) { return z_hello_check(&this_); }; -inline bool z_check(const z_owned_keyexpr_t& this_) { return z_keyexpr_check(&this_); }; -inline bool z_check(const z_owned_mutex_t& this_) { return z_mutex_check(&this_); }; -inline bool z_check(const z_owned_publisher_t& this_) { return z_publisher_check(&this_); }; -inline bool z_check(const z_owned_query_t& query) { return z_query_check(&query); }; -inline bool z_check(const z_owned_queryable_t& this_) { return z_queryable_check(&this_); }; -inline bool z_check(const z_owned_reply_t& this_) { return z_reply_check(&this_); }; -inline bool z_check(const z_owned_reply_err_t& this_) { return z_reply_err_check(&this_); }; -inline bool z_check(const z_owned_ring_handler_query_t& this_) { return z_ring_handler_query_check(&this_); }; -inline bool z_check(const z_owned_ring_handler_reply_t& this_) { return z_ring_handler_reply_check(&this_); }; -inline bool z_check(const z_owned_ring_handler_sample_t& this_) { return z_ring_handler_sample_check(&this_); }; -inline bool z_check(const z_owned_sample_t& this_) { return z_sample_check(&this_); }; -inline bool z_check(const z_owned_session_t& this_) { return z_session_check(&this_); }; -inline bool z_check(const z_owned_slice_t& this_) { return z_slice_check(&this_); }; -inline bool z_check(const z_owned_string_array_t& this_) { return z_string_array_check(&this_); }; -inline bool z_check(const z_owned_string_t& this_) { return z_string_check(&this_); }; -inline bool z_check(const z_owned_subscriber_t& this_) { return z_subscriber_check(&this_); }; -inline bool z_check(const z_owned_task_t& this_) { return z_task_check(&this_); }; -inline bool z_check(const zc_owned_closure_log_t& this_) { return zc_closure_log_check(&this_); }; +inline bool z_internal_check(const z_owned_bytes_t& this_) { return z_internal_bytes_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_hello_t& this_) { return z_internal_closure_hello_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_query_t& this_) { return z_internal_closure_query_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_reply_t& this_) { return z_internal_closure_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_closure_sample_t& this_) { return z_internal_closure_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_condvar_t& this_) { return z_internal_condvar_check(&this_); }; +inline bool z_internal_check(const z_owned_config_t& this_) { return z_internal_config_check(&this_); }; +inline bool z_internal_check(const z_owned_encoding_t& this_) { return z_internal_encoding_check(&this_); }; +inline bool z_internal_check(const z_owned_fifo_handler_query_t& this_) { return z_internal_fifo_handler_query_check(&this_); }; +inline bool z_internal_check(const z_owned_fifo_handler_reply_t& this_) { return z_internal_fifo_handler_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_fifo_handler_sample_t& this_) { return z_internal_fifo_handler_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_hello_t& this_) { return z_internal_hello_check(&this_); }; +inline bool z_internal_check(const z_owned_keyexpr_t& this_) { return z_internal_keyexpr_check(&this_); }; +inline bool z_internal_check(const z_owned_mutex_t& this_) { return z_internal_mutex_check(&this_); }; +inline bool z_internal_check(const z_owned_publisher_t& this_) { return z_internal_publisher_check(&this_); }; +inline bool z_internal_check(const z_owned_query_t& query) { return z_internal_query_check(&query); }; +inline bool z_internal_check(const z_owned_queryable_t& this_) { return z_internal_queryable_check(&this_); }; +inline bool z_internal_check(const z_owned_reply_t& this_) { return z_internal_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_reply_err_t& this_) { return z_internal_reply_err_check(&this_); }; +inline bool z_internal_check(const z_owned_ring_handler_query_t& this_) { return z_internal_ring_handler_query_check(&this_); }; +inline bool z_internal_check(const z_owned_ring_handler_reply_t& this_) { return z_internal_ring_handler_reply_check(&this_); }; +inline bool z_internal_check(const z_owned_ring_handler_sample_t& this_) { return z_internal_ring_handler_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_sample_t& this_) { return z_internal_sample_check(&this_); }; +inline bool z_internal_check(const z_owned_session_t& this_) { return z_internal_session_check(&this_); }; +inline bool z_internal_check(const z_owned_slice_t& this_) { return z_internal_slice_check(&this_); }; +inline bool z_internal_check(const z_owned_string_array_t& this_) { return z_internal_string_array_check(&this_); }; +inline bool z_internal_check(const z_owned_string_t& this_) { return z_internal_string_check(&this_); }; +inline bool z_internal_check(const z_owned_subscriber_t& this_) { return z_internal_subscriber_check(&this_); }; +inline bool z_internal_check(const z_owned_task_t& this_) { return z_internal_task_check(&this_); }; +inline bool z_internal_check(const zc_owned_closure_log_t& this_) { return zc_internal_closure_log_check(&this_); }; inline void z_call(const z_loaned_closure_hello_t* closure, const z_loaned_hello_t* hello) { diff --git a/src/closures/hello_closure.rs b/src/closures/hello_closure.rs index 4183ded46..dcd4c19c8 100644 --- a/src/closures/hello_closure.rs +++ b/src/closures/hello_closure.rs @@ -83,7 +83,9 @@ impl Drop for z_owned_closure_hello_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_hello_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_hello_null( + this_: *mut MaybeUninit, +) { (*this_).write(z_owned_closure_hello_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. @@ -129,7 +131,7 @@ impl From for z_owned_closure_hello_t { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_hello_check(this_: &z_owned_closure_hello_t) -> bool { +pub extern "C" fn z_internal_closure_hello_check(this_: &z_owned_closure_hello_t) -> bool { !this_.is_empty() } diff --git a/src/closures/log_closure.rs b/src/closures/log_closure.rs index e8e8fe2cb..894b0f6da 100644 --- a/src/closures/log_closure.rs +++ b/src/closures/log_closure.rs @@ -146,7 +146,9 @@ impl Drop for zc_owned_closure_log_t { /// Constructs a closure in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zc_closure_log_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn zc_internal_closure_log_null( + this_: *mut MaybeUninit, +) { (*this_).write(zc_owned_closure_log_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. @@ -172,7 +174,7 @@ pub extern "C" fn zc_closure_log_drop(closure_: &mut zc_moved_closure_log_t) { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn zc_closure_log_check(this_: &zc_owned_closure_log_t) -> bool { +pub extern "C" fn zc_internal_closure_log_check(this_: &zc_owned_closure_log_t) -> bool { !this_.is_empty() } diff --git a/src/closures/matching_status_closure.rs b/src/closures/matching_status_closure.rs index 53dc6e722..0597651f1 100644 --- a/src/closures/matching_status_closure.rs +++ b/src/closures/matching_status_closure.rs @@ -82,7 +82,7 @@ impl Drop for zc_owned_closure_matching_status_t { /// Constructs a null value of 'zc_owned_closure_matching_status_t' type #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn zc_closure_matching_status_null( +pub unsafe extern "C" fn zc_internal_closure_matching_status_null( this: *mut MaybeUninit, ) { (*this).write(zc_owned_closure_matching_status_t::default()); @@ -90,7 +90,7 @@ pub unsafe extern "C" fn zc_closure_matching_status_null( /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn zc_closure_matching_status_check( +pub extern "C" fn zc_internal_closure_matching_status_check( this: &zc_owned_closure_matching_status_t, ) -> bool { !this.is_empty() diff --git a/src/closures/query_channel.rs b/src/closures/query_channel.rs index b9aadf9d3..cc1ff2547 100644 --- a/src/closures/query_channel.rs +++ b/src/closures/query_channel.rs @@ -41,13 +41,17 @@ pub extern "C" fn z_fifo_handler_query_drop(this_: &mut z_moved_fifo_handler_que /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_fifo_handler_query_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_query_check(this_: &z_owned_fifo_handler_query_t) -> bool { +pub extern "C" fn z_internal_fifo_handler_query_check( + this_: &z_owned_fifo_handler_query_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -161,13 +165,17 @@ pub extern "C" fn z_ring_handler_query_drop(this_: &mut z_moved_ring_handler_que /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_ring_handler_query_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_query_check(this_: &z_owned_ring_handler_query_t) -> bool { +pub extern "C" fn z_internal_ring_handler_query_check( + this_: &z_owned_ring_handler_query_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/closures/query_closure.rs b/src/closures/query_closure.rs index 74969df78..8197774f3 100644 --- a/src/closures/query_closure.rs +++ b/src/closures/query_closure.rs @@ -83,13 +83,15 @@ impl Drop for z_owned_closure_query_t { /// Constructs a closure in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_query_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_query_null( + this_: *mut MaybeUninit, +) { (*this_).write(z_owned_closure_query_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_query_check(this_: &z_owned_closure_query_t) -> bool { +pub extern "C" fn z_internal_closure_query_check(this_: &z_owned_closure_query_t) -> bool { !this_.is_empty() } diff --git a/src/closures/reply_closure.rs b/src/closures/reply_closure.rs index 051851bd9..a33692dd0 100644 --- a/src/closures/reply_closure.rs +++ b/src/closures/reply_closure.rs @@ -84,13 +84,15 @@ impl Drop for z_owned_closure_reply_t { /// Constructs a closure int its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_reply_null(this_: *mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_reply_null( + this_: *mut MaybeUninit, +) { (*this_).write(z_owned_closure_reply_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_reply_check(this_: &z_owned_closure_reply_t) -> bool { +pub extern "C" fn z_internal_closure_reply_check(this_: &z_owned_closure_reply_t) -> bool { !this_.is_empty() } diff --git a/src/closures/response_channel.rs b/src/closures/response_channel.rs index 027146474..fc7092b17 100644 --- a/src/closures/response_channel.rs +++ b/src/closures/response_channel.rs @@ -41,13 +41,17 @@ pub extern "C" fn z_fifo_handler_reply_drop(this_: &mut z_moved_fifo_handler_rep /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_fifo_handler_reply_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_reply_check(this_: &z_owned_fifo_handler_reply_t) -> bool { +pub extern "C" fn z_internal_fifo_handler_reply_check( + this_: &z_owned_fifo_handler_reply_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -157,13 +161,17 @@ pub extern "C" fn z_ring_handler_reply_drop(this_: &mut z_moved_ring_handler_rep /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_ring_handler_reply_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_reply_check(this_: &z_owned_ring_handler_reply_t) -> bool { +pub extern "C" fn z_internal_ring_handler_reply_check( + this_: &z_owned_ring_handler_reply_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/closures/sample_channel.rs b/src/closures/sample_channel.rs index 57f11f4a2..7daf956d6 100644 --- a/src/closures/sample_channel.rs +++ b/src/closures/sample_channel.rs @@ -41,7 +41,7 @@ pub extern "C" fn z_fifo_handler_sample_drop(this_: &mut z_moved_fifo_handler_sa /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_sample_null( +pub extern "C" fn z_internal_fifo_handler_sample_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -49,7 +49,9 @@ pub extern "C" fn z_fifo_handler_sample_null( /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_fifo_handler_sample_check(this_: &z_owned_fifo_handler_sample_t) -> bool { +pub extern "C" fn z_internal_fifo_handler_sample_check( + this_: &z_owned_fifo_handler_sample_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -163,7 +165,7 @@ pub extern "C" fn z_ring_handler_sample_drop(this_: &mut z_moved_ring_handler_sa /// Constructs a handler in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_sample_null( +pub extern "C" fn z_internal_ring_handler_sample_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -171,7 +173,9 @@ pub extern "C" fn z_ring_handler_sample_null( /// Returns ``true`` if handler is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_ring_handler_sample_check(this_: &z_owned_ring_handler_sample_t) -> bool { +pub extern "C" fn z_internal_ring_handler_sample_check( + this_: &z_owned_ring_handler_sample_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/closures/sample_closure.rs b/src/closures/sample_closure.rs index 5c208427a..d2574b764 100644 --- a/src/closures/sample_closure.rs +++ b/src/closures/sample_closure.rs @@ -84,13 +84,15 @@ impl Drop for z_owned_closure_sample_t { /// Constructs a closure in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_sample_null(this_: &mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_sample_null( + this_: &mut MaybeUninit, +) { this_.write(z_owned_closure_sample_t::default()); } /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_closure_sample_check(this_: &z_owned_closure_sample_t) -> bool { +pub extern "C" fn z_internal_closure_sample_check(this_: &z_owned_closure_sample_t) -> bool { !this_.is_empty() } diff --git a/src/closures/zenohid_closure.rs b/src/closures/zenohid_closure.rs index 84add94e1..6447515aa 100644 --- a/src/closures/zenohid_closure.rs +++ b/src/closures/zenohid_closure.rs @@ -84,14 +84,16 @@ impl Drop for z_owned_closure_zid_t { /// Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_zid_check(this_: &z_owned_closure_zid_t) -> bool { +pub unsafe extern "C" fn z_internal_closure_zid_check(this_: &z_owned_closure_zid_t) -> bool { !this_.is_empty() } /// Constructs a null closure. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub unsafe extern "C" fn z_closure_zid_null(this_: &mut MaybeUninit) { +pub unsafe extern "C" fn z_internal_closure_zid_null( + this_: &mut MaybeUninit, +) { this_.write(z_owned_closure_zid_t::default()); } /// Calls the closure. Calling an uninitialized closure is a no-op. diff --git a/src/collections.rs b/src/collections.rs index ffc43d529..5be462f6b 100644 --- a/src/collections.rs +++ b/src/collections.rs @@ -318,7 +318,7 @@ pub extern "C" fn z_slice_empty(this_: &mut MaybeUninit) { /// Constructs an empty `z_owned_slice_t`. #[no_mangle] -pub extern "C" fn z_slice_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_slice_null(this_: &mut MaybeUninit) { z_slice_empty(this_); } @@ -344,7 +344,7 @@ pub extern "C" fn z_slice_clone(dst: &mut MaybeUninit, this_: & /// @return ``true`` if slice is not empty, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_slice_check(this_: &z_owned_slice_t) -> bool { +pub extern "C" fn z_internal_slice_check(this_: &z_owned_slice_t) -> bool { !this_.as_rust_type_ref().is_empty() } @@ -538,13 +538,13 @@ pub unsafe extern "C" fn z_string_drop(this_: &mut z_moved_string_t) { /// @return ``true`` if `this_` is a valid string, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_string_check(this_: &z_owned_string_t) -> bool { +pub extern "C" fn z_internal_string_check(this_: &z_owned_string_t) -> bool { !this_.as_rust_type_ref().is_empty() } /// Constructs owned string in a gravestone state. #[no_mangle] -pub extern "C" fn z_string_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_string_null(this_: &mut MaybeUninit) { this_ .as_rust_type_mut_uninit() .write(CStringOwned::default()); @@ -745,13 +745,13 @@ pub extern "C" fn z_string_array_new(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_string_array_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_string_array_check(this_: &z_owned_string_array_t) -> bool { +pub extern "C" fn z_internal_string_array_check(this_: &z_owned_string_array_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/commons.rs b/src/commons.rs index be52e2a88..db3aebbb7 100644 --- a/src/commons.rs +++ b/src/commons.rs @@ -188,7 +188,7 @@ pub extern "C" fn z_sample_congestion_control(this_: &z_loaned_sample_t) -> z_co /// Returns ``true`` if sample is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_sample_check(this_: &z_owned_sample_t) -> bool { +pub extern "C" fn z_internal_sample_check(this_: &z_owned_sample_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -211,7 +211,7 @@ pub extern "C" fn z_sample_drop(this_: &mut z_moved_sample_t) { /// Constructs sample in its gravestone state. #[no_mangle] -pub extern "C" fn z_sample_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_sample_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -526,7 +526,7 @@ pub extern "C" fn z_source_info_sn(this_: &z_loaned_source_info_t) -> u64 { #[cfg(feature = "unstable")] /// Returns ``true`` if source info is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_check(this_: &z_owned_source_info_t) -> bool { +pub extern "C" fn z_internal_source_info_check(this_: &z_owned_source_info_t) -> bool { this_.as_rust_type_ref().source_id.is_some() || this_.as_rust_type_ref().source_sn.is_some() } @@ -547,6 +547,6 @@ pub extern "C" fn z_source_info_drop(this_: &mut z_moved_source_info_t) { #[cfg(feature = "unstable")] /// Constructs source info in its gravestone state. #[no_mangle] -pub extern "C" fn z_source_info_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_source_info_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(SourceInfo::default()); } diff --git a/src/config.rs b/src/config.rs index 93e740b1a..a4d5d4a60 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,7 +19,7 @@ use zenoh::config::{Config, Locator, ValidatedMap, WhatAmI}; use crate::{ result::{self, z_result_t, Z_OK}, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, - z_owned_string_t, z_string_copy_from_substr, z_string_null, + z_internal_string_null, z_owned_string_t, z_string_copy_from_substr, }; #[no_mangle] @@ -100,7 +100,7 @@ pub extern "C" fn z_config_default( /// Constructs config in its gravestone state. #[no_mangle] -pub extern "C" fn z_config_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_config_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -137,7 +137,7 @@ pub unsafe extern "C" fn zc_config_get_from_substr( ) -> result::z_result_t { let config = this.as_rust_type_ref(); if key.is_null() { - z_string_null(out_value_string); + z_internal_string_null(out_value_string); return result::Z_EINVAL; } @@ -145,7 +145,7 @@ pub unsafe extern "C" fn zc_config_get_from_substr( Ok(s) => s, Err(e) => { tracing::error!("Config key is not a valid utf-8 string: {}", e); - z_string_null(out_value_string); + z_internal_string_null(out_value_string); return result::Z_EINVAL; } }; @@ -161,7 +161,7 @@ pub unsafe extern "C" fn zc_config_get_from_substr( } None => { tracing::error!("No value was found in the config for key: '{}'", key); - z_string_null(out_value_string); + z_internal_string_null(out_value_string); result::Z_EUNAVAILABLE } } @@ -230,7 +230,7 @@ pub extern "C" fn z_config_drop(this_: &mut z_moved_config_t) { /// Returns ``true`` if config is valid, ``false`` if it is in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_config_check(this_: &z_owned_config_t) -> bool { +pub extern "C" fn z_internal_config_check(this_: &z_owned_config_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -245,7 +245,7 @@ pub unsafe extern "C" fn zc_config_from_str( ) -> result::z_result_t { let mut res = result::Z_OK; if s.is_null() { - z_config_null(this); + z_internal_config_null(this); res = result::Z_EINVAL; } else { let conf_str = CStr::from_ptr(s); @@ -281,7 +281,7 @@ pub unsafe extern "C" fn zc_config_to_string( } Err(e) => { tracing::error!("Config is not a valid json5: {}", e); - z_string_null(out_config_string); + z_internal_string_null(out_config_string); result::Z_EPARSE } } @@ -380,7 +380,7 @@ pub unsafe extern "C" fn z_config_client( { locators } else { - z_config_null(this); + z_internal_config_null(this); return res; }; this.as_rust_type_mut_uninit() diff --git a/src/encoding.rs b/src/encoding.rs index 0481ed55e..7b8102af7 100644 --- a/src/encoding.rs +++ b/src/encoding.rs @@ -138,7 +138,7 @@ pub extern "C" fn z_encoding_loan_default() -> &'static z_loaned_encoding_t { /// Constructs a default `z_owned_encoding_t`. #[no_mangle] -pub extern "C" fn z_encoding_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_encoding_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(Encoding::default()); } @@ -150,7 +150,7 @@ pub extern "C" fn z_encoding_drop(this_: &mut z_moved_encoding_t) { /// Returns ``true`` if encoding is in non-default state, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_encoding_check(this_: &'static z_owned_encoding_t) -> bool { +pub extern "C" fn z_internal_encoding_check(this_: &'static z_owned_encoding_t) -> bool { *this_.as_rust_type_ref() != Encoding::default() } diff --git a/src/get.rs b/src/get.rs index f5a976b14..140301b6c 100644 --- a/src/get.rs +++ b/src/get.rs @@ -76,7 +76,7 @@ decl_c_type!( /// Constructs an empty `z_owned_reply_err_t`. #[no_mangle] -pub extern "C" fn z_reply_err_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_reply_err_null(this_: &mut MaybeUninit) { this_ .as_rust_type_mut_uninit() .write(ReplyErrorNewtype::default()); @@ -85,7 +85,7 @@ pub extern "C" fn z_reply_err_null(this_: &mut MaybeUninit) /// Returns ``true`` if reply error is in non-default state, ``false`` otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_reply_err_check(this_: &'static z_owned_reply_err_t) -> bool { +pub extern "C" fn z_internal_reply_err_check(this_: &'static z_owned_reply_err_t) -> bool { !this_.as_rust_type_ref().payload().is_empty() } @@ -170,7 +170,7 @@ pub unsafe extern "C" fn z_reply_replier_id( /// Constructs the reply in its gravestone state. #[no_mangle] -pub extern "C" fn z_reply_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_reply_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Constructs an owned shallow copy of reply in provided uninitialized memory location. @@ -319,7 +319,7 @@ pub extern "C" fn z_reply_drop(this_: &mut z_moved_reply_t) { /// Returns ``true`` if `reply` is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_reply_check(this_: &z_owned_reply_t) -> bool { +pub extern "C" fn z_internal_reply_check(this_: &z_owned_reply_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/keyexpr.rs b/src/keyexpr.rs index e9aa62ee1..81906d6f1 100644 --- a/src/keyexpr.rs +++ b/src/keyexpr.rs @@ -38,7 +38,7 @@ decl_c_type! { /// Constructs an owned key expression in a gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_keyexpr_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -153,7 +153,7 @@ pub extern "C" fn z_keyexpr_drop(this_: &mut z_moved_keyexpr_t) { /// Returns ``true`` if `keyexpr` is valid, ``false`` if it is in gravestone state. #[no_mangle] -pub extern "C" fn z_keyexpr_check(this_: &z_owned_keyexpr_t) -> bool { +pub extern "C" fn z_internal_keyexpr_check(this_: &z_owned_keyexpr_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/liveliness.rs b/src/liveliness.rs index 9bf168ab6..c13f19f66 100644 --- a/src/liveliness.rs +++ b/src/liveliness.rs @@ -34,13 +34,15 @@ decl_c_type!( /// Constructs liveliness token in its gravestone state. #[no_mangle] -pub extern "C" fn zc_liveliness_token_null(this_: &mut MaybeUninit) { +pub extern "C" fn zc_internal_liveliness_token_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if liveliness token is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn zc_liveliness_token_check(this_: &zc_owned_liveliness_token_t) -> bool { +pub extern "C" fn zc_internal_liveliness_token_check(this_: &zc_owned_liveliness_token_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/payload.rs b/src/payload.rs index f1581b8a6..3a0e092f5 100644 --- a/src/payload.rs +++ b/src/payload.rs @@ -45,7 +45,7 @@ decl_c_type! { /// The gravestone value for `z_owned_bytes_t`. #[no_mangle] -extern "C" fn z_bytes_null(this: &mut MaybeUninit) { +extern "C" fn z_internal_bytes_null(this: &mut MaybeUninit) { this.as_rust_type_mut_uninit().write(ZBytes::default()); } @@ -64,7 +64,7 @@ extern "C" fn z_bytes_drop(this_: &mut z_moved_bytes_t) { /// Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. #[no_mangle] -extern "C" fn z_bytes_check(this: &z_owned_bytes_t) -> bool { +extern "C" fn z_internal_bytes_check(this: &z_owned_bytes_t) -> bool { !this.as_rust_type_ref().is_empty() } diff --git a/src/platform/synchronization.rs b/src/platform/synchronization.rs index 871e94509..d01904133 100644 --- a/src/platform/synchronization.rs +++ b/src/platform/synchronization.rs @@ -36,13 +36,13 @@ pub extern "C" fn z_mutex_drop(this_: &mut z_moved_mutex_t) { /// Returns ``true`` if mutex is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_mutex_check(this_: &z_owned_mutex_t) -> bool { +pub extern "C" fn z_internal_mutex_check(this_: &z_owned_mutex_t) -> bool { this_.as_rust_type_ref().is_some() } /// Constructs mutex in a gravestone state. #[no_mangle] -pub extern "C" fn z_mutex_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_mutex_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -122,7 +122,7 @@ pub extern "C" fn z_condvar_init(this_: &mut MaybeUninit) { /// Constructs conditional variable in a gravestone state. #[no_mangle] -pub extern "C" fn z_condvar_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_condvar_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -134,7 +134,7 @@ pub extern "C" fn z_condvar_drop(this_: &mut z_moved_condvar_t) { /// Returns ``true`` if conditional variable is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_condvar_check(this_: &z_owned_condvar_t) -> bool { +pub extern "C" fn z_internal_condvar_check(this_: &z_owned_condvar_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -207,7 +207,7 @@ pub struct z_task_attr_t(usize); /// Constructs task in a gravestone state. #[no_mangle] -pub extern "C" fn z_task_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_task_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -237,7 +237,7 @@ pub extern "C" fn z_task_drop(this_: &mut z_moved_task_t) { /// Returns ``true`` if task is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_task_check(this_: &z_owned_task_t) -> bool { +pub extern "C" fn z_internal_task_check(this_: &z_owned_task_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/publication_cache.rs b/src/publication_cache.rs index 5bd71991b..b76864187 100644 --- a/src/publication_cache.rs +++ b/src/publication_cache.rs @@ -118,14 +118,18 @@ pub extern "C" fn ze_declare_publication_cache( /// Constructs a publication cache in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_null(this_: &mut MaybeUninit) { +pub extern "C" fn ze_internal_publication_cache_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if publication cache is valid, ``false`` otherwise. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_publication_cache_check(this_: &ze_owned_publication_cache_t) -> bool { +pub extern "C" fn ze_internal_publication_cache_check( + this_: &ze_owned_publication_cache_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/publisher.rs b/src/publisher.rs index 22240e773..47970642f 100644 --- a/src/publisher.rs +++ b/src/publisher.rs @@ -125,14 +125,14 @@ pub extern "C" fn z_declare_publisher( /// Constructs a publisher in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_publisher_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_publisher_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if publisher is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_publisher_check(this_: &z_owned_publisher_t) -> bool { +pub extern "C" fn z_internal_publisher_check(this_: &z_owned_publisher_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -298,14 +298,18 @@ decl_c_type!( /// Constructs an empty matching listener #[no_mangle] #[cfg(feature = "unstable")] -pub extern "C" fn zc_matching_listener_null(this_: &mut MaybeUninit) { +pub extern "C" fn zc_internal_matching_listener_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Checks the matching listener is for the gravestone state #[no_mangle] #[cfg(feature = "unstable")] -pub extern "C" fn zc_matching_listener_check(this_: &zc_owned_matching_listener_t) -> bool { +pub extern "C" fn zc_internal_matching_listener_check( + this_: &zc_owned_matching_listener_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/queryable.rs b/src/queryable.rs index 707f735a2..9ad70825c 100644 --- a/src/queryable.rs +++ b/src/queryable.rs @@ -40,7 +40,7 @@ decl_c_type!( /// Constructs a queryable in its gravestone value. #[no_mangle] -pub extern "C" fn z_queryable_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_queryable_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -63,12 +63,12 @@ decl_c_type!( /// Constructs query in its gravestone value. #[no_mangle] -pub extern "C" fn z_query_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_query_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns `false` if `this` is in a gravestone state, `true` otherwise. #[no_mangle] -pub extern "C" fn z_query_check(query: &z_owned_query_t) -> bool { +pub extern "C" fn z_internal_query_check(query: &z_owned_query_t) -> bool { query.as_rust_type_ref().is_some() } /// Borrows the query. @@ -273,7 +273,7 @@ pub extern "C" fn z_queryable_drop(this_: &mut z_moved_queryable_t) { /// Returns ``true`` if queryable is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_queryable_check(this_: &z_owned_queryable_t) -> bool { +pub extern "C" fn z_internal_queryable_check(this_: &z_owned_queryable_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 2c64da470..2b76bd359 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -44,7 +44,7 @@ decl_c_type!( /// Constructs a querying subscriber in a gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn ze_querying_subscriber_null( +pub extern "C" fn ze_internal_querying_subscriber_null( this: &mut MaybeUninit, ) { this.as_rust_type_mut_uninit().write(None); @@ -231,7 +231,9 @@ pub extern "C" fn ze_querying_subscriber_drop(this_: &mut ze_moved_querying_subs /// Returns ``true`` if querying subscriber is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn ze_querying_subscriber_check(this_: &ze_owned_querying_subscriber_t) -> bool { +pub extern "C" fn ze_internal_querying_subscriber_check( + this_: &ze_owned_querying_subscriber_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/scouting.rs b/src/scouting.rs index d8cc48069..a5f524437 100644 --- a/src/scouting.rs +++ b/src/scouting.rs @@ -53,13 +53,13 @@ pub unsafe extern "C" fn z_hello_loan(this_: &z_owned_hello_t) -> &z_loaned_hell /// Returns ``true`` if `hello message` is valid, ``false`` if it is in a gravestone state. #[no_mangle] -pub extern "C" fn z_hello_check(this_: &z_owned_hello_t) -> bool { +pub extern "C" fn z_internal_hello_check(this_: &z_owned_hello_t) -> bool { this_.as_rust_type_ref().is_some() } /// Constructs hello message in a gravestone state. #[no_mangle] -pub extern "C" fn z_hello_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_hello_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } diff --git a/src/session.rs b/src/session.rs index 01c1547c9..e70af592a 100644 --- a/src/session.rs +++ b/src/session.rs @@ -43,7 +43,7 @@ pub unsafe extern "C" fn z_session_loan(this_: &z_owned_session_t) -> &z_loaned_ /// Constructs a Zenoh session in its gravestone state. #[no_mangle] #[allow(clippy::missing_safety_doc)] -pub extern "C" fn z_session_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_session_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -117,7 +117,7 @@ pub extern "C" fn z_open_with_custom_shm_clients( /// Returns ``true`` if `session` is valid, ``false`` otherwise. #[allow(clippy::missing_safety_doc)] #[no_mangle] -pub extern "C" fn z_session_check(this_: &z_owned_session_t) -> bool { +pub extern "C" fn z_internal_session_check(this_: &z_owned_session_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/buffer/zshm.rs b/src/shm/buffer/zshm.rs index 1b29e0be7..1b401854c 100644 --- a/src/shm/buffer/zshm.rs +++ b/src/shm/buffer/zshm.rs @@ -41,13 +41,13 @@ pub extern "C" fn z_shm_from_mut( /// Constructs ZShm slice in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_check(this_: &z_owned_shm_t) -> bool { +pub extern "C" fn z_internal_shm_check(this_: &z_owned_shm_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/buffer/zshmmut.rs b/src/shm/buffer/zshmmut.rs index 67e46e1cc..f901ad607 100644 --- a/src/shm/buffer/zshmmut.rs +++ b/src/shm/buffer/zshmmut.rs @@ -44,13 +44,13 @@ pub extern "C" fn z_shm_mut_try_from_immut( /// Constructs ZShmMut slice in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_mut_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_mut_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_mut_check(this_: &z_owned_shm_mut_t) -> bool { +pub extern "C" fn z_internal_shm_mut_check(this_: &z_owned_shm_mut_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/client/shm_client.rs b/src/shm/client/shm_client.rs index fa41152e8..2446ddab2 100644 --- a/src/shm/client/shm_client.rs +++ b/src/shm/client/shm_client.rs @@ -80,13 +80,13 @@ pub extern "C" fn z_shm_client_new( /// Constructs SHM client in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_client_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_client_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_client_check(this_: &z_owned_shm_client_t) -> bool { +pub extern "C" fn z_internal_shm_client_check(this_: &z_owned_shm_client_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/client_storage/mod.rs b/src/shm/client_storage/mod.rs index 173a5fcce..b4efd99bd 100644 --- a/src/shm/client_storage/mod.rs +++ b/src/shm/client_storage/mod.rs @@ -39,13 +39,15 @@ pub extern "C" fn zc_shm_client_list_new(this_: &mut MaybeUninit) { +pub extern "C" fn zc_internal_shm_client_list_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn zc_shm_client_list_check(this_: &zc_owned_shm_client_list_t) -> bool { +pub extern "C" fn zc_internal_shm_client_list_check(this_: &zc_owned_shm_client_list_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -150,13 +152,17 @@ pub extern "C" fn z_shm_client_storage_clone( /// Constructs SHM Client Storage in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_client_storage_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_client_storage_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_client_storage_check(this_: &z_owned_shm_client_storage_t) -> bool { +pub extern "C" fn z_internal_shm_client_storage_check( + this_: &z_owned_shm_client_storage_t, +) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/provider/alloc_layout.rs b/src/shm/provider/alloc_layout.rs index 8af9b32d1..d18a1c864 100644 --- a/src/shm/provider/alloc_layout.rs +++ b/src/shm/provider/alloc_layout.rs @@ -63,13 +63,13 @@ pub extern "C" fn z_alloc_layout_new( /// Constructs Alloc Layout in its gravestone value. #[no_mangle] -pub extern "C" fn z_alloc_layout_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_alloc_layout_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_alloc_layout_check(this_: &z_owned_alloc_layout_t) -> bool { +pub extern "C" fn z_internal_alloc_layout_check(this_: &z_owned_alloc_layout_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/provider/shm_provider.rs b/src/shm/provider/shm_provider.rs index 2ef046c49..d93ddae1a 100644 --- a/src/shm/provider/shm_provider.rs +++ b/src/shm/provider/shm_provider.rs @@ -92,13 +92,13 @@ pub extern "C" fn z_shm_provider_threadsafe_new( /// Constructs SHM Provider in its gravestone value. #[no_mangle] -pub extern "C" fn z_shm_provider_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_shm_provider_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_shm_provider_check(this_: &z_owned_shm_provider_t) -> bool { +pub extern "C" fn z_internal_shm_provider_check(this_: &z_owned_shm_provider_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index 8eedd5c23..ae0b63c4f 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -25,7 +25,7 @@ use zenoh::{ use super::chunk::z_allocated_chunk_t; use crate::{ result::{z_result_t, Z_EINVAL, Z_OK}, - shm::buffer::zshmmut::z_shm_mut_null, + shm::buffer::zshmmut::z_internal_shm_mut_null, transmute::{IntoCType, LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, z_loaned_chunk_alloc_result_t, z_loaned_memory_layout_t, z_moved_chunk_alloc_result_t, z_moved_memory_layout_t, z_owned_chunk_alloc_result_t, z_owned_memory_layout_t, @@ -145,13 +145,13 @@ fn create_memory_layout( /// Constructs Memory Layout in its gravestone value. #[no_mangle] -pub extern "C" fn z_memory_layout_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_memory_layout_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_memory_layout_check(this_: &z_owned_memory_layout_t) -> bool { +pub extern "C" fn z_internal_memory_layout_check(this_: &z_owned_memory_layout_t) -> bool { this_.as_rust_type_ref().is_some() } @@ -217,13 +217,17 @@ pub extern "C" fn z_chunk_alloc_result_new_error( /// Constructs Chunk Alloc Result in its gravestone value. #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_chunk_alloc_result_null( + this_: &mut MaybeUninit, +) { this_.as_rust_type_mut_uninit().write(None); } /// Returns ``true`` if `this` is valid. #[no_mangle] -pub extern "C" fn z_chunk_alloc_result_check(this_: &z_owned_chunk_alloc_result_t) -> bool { +pub extern "C" fn z_internal_chunk_alloc_result_check( + this_: &z_owned_chunk_alloc_result_t, +) -> bool { this_.as_rust_type_ref().is_some() } @@ -264,7 +268,7 @@ impl From for z_buf_alloc_result_t { } } Err(error) => { - z_shm_mut_null(&mut buf); + z_internal_shm_mut_null(&mut buf); Self { // SAFETY: this is safe because buf is gravestone-initialized above buf: unsafe { buf.assume_init() }, @@ -298,7 +302,7 @@ impl From for z_buf_layout_alloc_result_t { } } Err(error) => { - z_shm_mut_null(&mut buf); + z_internal_shm_mut_null(&mut buf); match error { zenoh::shm::ZLayoutAllocError::Alloc(alloc) => { Self { diff --git a/src/subscriber.rs b/src/subscriber.rs index 6bd43eb44..636424843 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -66,7 +66,7 @@ decl_c_type!( /// Constructs a subscriber in a gravestone state. #[no_mangle] -pub extern "C" fn z_subscriber_null(this_: &mut MaybeUninit) { +pub extern "C" fn z_internal_subscriber_null(this_: &mut MaybeUninit) { this_.as_rust_type_mut_uninit().write(None); } @@ -174,6 +174,6 @@ pub extern "C" fn z_subscriber_drop(this_: &mut z_moved_subscriber_t) { /// Returns ``true`` if subscriber is valid, ``false`` otherwise. #[no_mangle] -pub extern "C" fn z_subscriber_check(this_: &z_owned_subscriber_t) -> bool { +pub extern "C" fn z_internal_subscriber_check(this_: &z_owned_subscriber_t) -> bool { this_.as_rust_type_ref().is_some() } diff --git a/tests/z_api_alignment_test.c b/tests/z_api_alignment_test.c index c235a13ef..dee3aaac3 100644 --- a/tests/z_api_alignment_test.c +++ b/tests/z_api_alignment_test.c @@ -163,7 +163,7 @@ int main(int argc, char **argv) { z_owned_config_t _ret_config; z_config_default(&_ret_config); - assert(z_check(_ret_config)); + assert(z_internal_check(_ret_config)); z_drop(z_move(_ret_config)); #ifdef ZENOH_PICO _ret_int8 = zp_config_insert(z_loan(_ret_config), Z_CONFIG_PEER_KEY, z_string_make(argv[1])); @@ -176,7 +176,7 @@ int main(int argc, char **argv) { #ifdef ZENOH_PICO z_owned_scouting_config_t _ret_sconfig; z_scouting_config_default(&_ret_sconfig); - assert(z_check(_ret_sconfig)); + assert(z_internal_check(_ret_sconfig)); _ret_int8 = zp_scouting_config_insert(z_loan(_ret_sconfig), Z_CONFIG_SCOUTING_TIMEOUT_KEY, z_string_make(SCOUTING_TIMEOUT)); assert(_ret_int8 == 0); @@ -199,7 +199,7 @@ int main(int argc, char **argv) { z_owned_session_t s1; assert(0 == z_open(&s1, z_move(_ret_config))); - assert(z_check(s1)); + assert(z_internal_check(s1)); #ifdef UNSTABLE z_id_t _ret_zid = z_info_zid(z_loan(s1)); @@ -244,7 +244,7 @@ int main(int argc, char **argv) { z_owned_session_t s2; assert(0 == z_open(&s2, z_move(_ret_config))); - assert(z_check(s2)); + assert(z_internal_check(s2)); #ifdef UNSTABLE _ret_zid = z_info_zid(z_loan(s2)); @@ -272,7 +272,7 @@ int main(int argc, char **argv) { z_view_keyexpr_from_str(&ke, keyexpr_str); z_owned_subscriber_t _ret_sub; z_declare_subscriber(&_ret_sub, z_loan(s2), z_loan(ke), z_move(_ret_closure_sample), &_ret_sub_opt); - assert(z_check(_ret_sub)); + assert(z_internal_check(_ret_sub)); z_sleep_s(SLEEP); @@ -282,7 +282,7 @@ int main(int argc, char **argv) { z_view_keyexpr_from_str(&s1_key, s1_res); z_owned_keyexpr_t _ret_expr; z_declare_keyexpr(&_ret_expr, z_loan(s1), z_loan(s1_key)); - assert(z_check(_ret_expr)); + assert(z_internal_check(_ret_expr)); z_put_options_t _ret_put_opt; z_put_options_default(&_ret_put_opt); _ret_put_opt.congestion_control = Z_CONGESTION_CONTROL_BLOCK; @@ -306,7 +306,7 @@ int main(int argc, char **argv) { _ret_int8 = z_undeclare_keyexpr(z_move(_ret_expr), z_loan(s1)); assert(_ret_int8 == 0); - assert(!z_check(_ret_expr)); + assert(!z_internal_check(_ret_expr)); _ret_int8 = z_undeclare_subscriber(z_move(_ret_sub)); assert(_ret_int8 == 0); @@ -319,7 +319,7 @@ int main(int argc, char **argv) { z_queryable_options_default(&_ret_qle_opt); z_owned_queryable_t qle; z_declare_queryable(&qle, z_loan(s1), z_loan(s1_key), z_move(_ret_closure_query), &_ret_qle_opt); - assert(z_check(qle)); + assert(z_internal_check(qle)); z_sleep_s(SLEEP); diff --git a/tests/z_api_double_drop_test.c b/tests/z_api_double_drop_test.c index 089aff593..9fa82c40c 100644 --- a/tests/z_api_double_drop_test.c +++ b/tests/z_api_double_drop_test.c @@ -25,14 +25,14 @@ void test_session() { z_owned_config_t config; z_config_default(&config); - assert(z_check(config)); + assert(z_internal_check(config)); z_owned_session_t session; z_open(&session, z_move(config)); - assert(z_check(session)); + assert(z_internal_check(session)); z_close(z_move(session)); - assert(!z_check(session)); + assert(!z_internal_check(session)); z_close(z_move(session)); - assert(!z_check(session)); + assert(!z_internal_check(session)); } void test_publisher() { @@ -46,11 +46,11 @@ void test_publisher() { z_owned_publisher_t pub; z_declare_publisher(&pub, z_loan(s), z_loan(keyexpr), NULL); - assert(z_check(pub)); + assert(z_internal_check(pub)); z_undeclare_publisher(z_move(pub)); - assert(!z_check(pub)); + assert(!z_internal_check(pub)); z_undeclare_publisher(z_move(pub)); - assert(!z_check(pub)); + assert(!z_internal_check(pub)); z_close(z_move(s)); } @@ -58,21 +58,21 @@ void test_keyexpr() { z_owned_keyexpr_t keyexpr; z_keyexpr_from_str(&keyexpr, URL); - assert(z_check(keyexpr)); + assert(z_internal_check(keyexpr)); z_drop(z_move(keyexpr)); - assert(!z_check(keyexpr)); + assert(!z_internal_check(keyexpr)); z_drop(z_move(keyexpr)); - assert(!z_check(keyexpr)); + assert(!z_internal_check(keyexpr)); } void test_config() { z_owned_config_t config; z_config_default(&config); - assert(z_check(config)); + assert(z_internal_check(config)); z_drop(z_move(config)); - assert(!z_check(config)); + assert(!z_internal_check(config)); z_drop(z_move(config)); - assert(!z_check(config)); + assert(!z_internal_check(config)); } void data_handler(const z_loaned_sample_t *sample, void *arg) {} @@ -89,11 +89,11 @@ void test_subscriber() { z_view_keyexpr_from_str(&keyexpr, URL); z_owned_subscriber_t sub; z_declare_subscriber(&sub, z_loan(s), z_loan(keyexpr), z_move(callback), NULL); - assert(z_check(sub)); + assert(z_internal_check(sub)); z_undeclare_subscriber(z_move(sub)); - assert(!z_check(sub)); + assert(!z_internal_check(sub)); z_undeclare_subscriber(z_move(sub)); - assert(!z_check(sub)); + assert(!z_internal_check(sub)); z_close(z_move(s)); } @@ -111,11 +111,11 @@ void test_queryable() { z_view_keyexpr_from_str(&keyexpr, URL); z_owned_queryable_t queryable; z_declare_queryable(&queryable, z_loan(s), z_loan(keyexpr), z_move(callback), NULL); - assert(z_check(queryable)); + assert(z_internal_check(queryable)); z_undeclare_queryable(z_move(queryable)); - assert(!z_check(queryable)); + assert(!z_internal_check(queryable)); z_undeclare_queryable(z_move(queryable)); - assert(!z_check(queryable)); + assert(!z_internal_check(queryable)); z_close(z_move(s)); } diff --git a/tests/z_api_drop_options.c b/tests/z_api_drop_options.c index 845c79d45..b8ce3bd9d 100644 --- a/tests/z_api_drop_options.c +++ b/tests/z_api_drop_options.c @@ -40,8 +40,8 @@ void put() { opts.attachment = z_move(attachment); z_bytes_serialize_from_int32(&payload, 16); z_put(z_loan(s), z_loan(ke), z_move(payload), &opts); - assert(!z_check(payload)); - assert(!z_check(attachment)); + assert(!z_internal_check(payload)); + assert(!z_internal_check(attachment)); z_close(z_move(s)); } @@ -68,8 +68,8 @@ void get() { z_closure(&closure, cb, drop, NULL); z_get(z_loan(s), z_loan(ke), "", z_move(closure), &opts); - assert(!z_check(payload)); - assert(!z_check(attachment)); + assert(!z_internal_check(payload)); + assert(!z_internal_check(attachment)); z_close(z_move(s)); } diff --git a/tests/z_api_encoding_test.c b/tests/z_api_encoding_test.c index e2091f291..3630899b2 100644 --- a/tests/z_api_encoding_test.c +++ b/tests/z_api_encoding_test.c @@ -10,15 +10,15 @@ void test_null_encoding(void) { z_owned_encoding_t e; - z_encoding_null(&e); - assert(!z_encoding_check(&e)); + z_internal_encoding_null(&e); + assert(!z_internal_encoding_check(&e)); z_encoding_drop(z_move(e)); } void test_encoding_without_id(void) { z_owned_encoding_t e1; z_encoding_from_str(&e1, "my_encoding"); - assert(z_encoding_check(&e1)); + assert(z_internal_encoding_check(&e1)); z_owned_string_t s; z_encoding_to_string(z_encoding_loan(&e1), &s); assert(strncmp("zenoh/bytes;my_encoding", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -27,7 +27,7 @@ void test_encoding_without_id(void) { z_owned_encoding_t e2; z_encoding_from_substr(&e2, "my_encoding", 4); - assert(z_encoding_check(&e2)); + assert(z_internal_encoding_check(&e2)); z_encoding_to_string(z_encoding_loan(&e2), &s); assert(strncmp("zenoh/bytes;my_e", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -38,7 +38,7 @@ void test_encoding_without_id(void) { void test_encoding_with_id(void) { z_owned_encoding_t e1; z_encoding_from_str(&e1, "zenoh/string;utf8"); - assert(z_encoding_check(&e1)); + assert(z_internal_encoding_check(&e1)); z_owned_string_t s; z_encoding_to_string(z_encoding_loan(&e1), &s); assert(strncmp("zenoh/string;utf8", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -47,7 +47,7 @@ void test_encoding_with_id(void) { z_owned_encoding_t e2; z_encoding_from_substr(&e2, "zenoh/string;utf8", 15); - assert(z_encoding_check(&e2)); + assert(z_internal_encoding_check(&e2)); z_encoding_to_string(z_encoding_loan(&e2), &s); assert(strncmp("zenoh/string;utf8", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == 0); @@ -56,7 +56,7 @@ void test_encoding_with_id(void) { z_owned_encoding_t e3; z_encoding_from_str(&e3, "custom_id;custom_schema"); - assert(z_encoding_check(&e3)); + assert(z_internal_encoding_check(&e3)); z_encoding_to_string(z_encoding_loan(&e3), &s); assert(strncmp("zenoh/bytes;custom_id;custom_schema", z_string_data(z_string_loan(&s)), @@ -66,7 +66,7 @@ void test_encoding_with_id(void) { z_owned_encoding_t e4; z_encoding_from_substr(&e4, "custom_id;custom_schema", 16); - assert(z_encoding_check(&e4)); + assert(z_internal_encoding_check(&e4)); z_encoding_to_string(z_encoding_loan(&e4), &s); assert(strncmp("zenoh/bytes;custom_id;custom", z_string_data(z_string_loan(&s)), z_string_len(z_string_loan(&s))) == @@ -77,7 +77,7 @@ void test_encoding_with_id(void) { void test_with_schema(void) { z_owned_encoding_t e; - z_encoding_null(&e); + z_internal_encoding_null(&e); z_encoding_set_schema_from_str(z_encoding_loan_mut(&e), "my_schema"); z_owned_string_t s; diff --git a/tests/z_api_keyexpr_drop_test.c b/tests/z_api_keyexpr_drop_test.c index 1623ec110..a24eb68ee 100644 --- a/tests/z_api_keyexpr_drop_test.c +++ b/tests/z_api_keyexpr_drop_test.c @@ -25,7 +25,7 @@ void test_publisher() { z_config_default(&config); z_owned_session_t s; z_open(&s, z_move(config)); - assert(z_check(s)); + assert(z_internal_check(s)); char keyexpr[256]; strncpy(keyexpr, "foo/bar", 256); z_view_keyexpr_t ke; diff --git a/tests/z_api_keyexpr_test.c b/tests/z_api_keyexpr_test.c index bc47f0390..f6f61004e 100644 --- a/tests/z_api_keyexpr_test.c +++ b/tests/z_api_keyexpr_test.c @@ -92,9 +92,9 @@ void undeclare() { z_view_keyexpr_from_str(&view_ke, "test/thr"); z_owned_keyexpr_t ke; z_declare_keyexpr(&ke, z_loan(s), z_loan(view_ke)); - assert(z_keyexpr_check(&ke)); + assert(z_internal_keyexpr_check(&ke)); z_undeclare_keyexpr(z_move(ke), z_loan(s)); - assert(!z_keyexpr_check(&ke)); + assert(!z_internal_keyexpr_check(&ke)); } #if defined(UNSTABLE) diff --git a/tests/z_api_null_drop_test.c b/tests/z_api_null_drop_test.c index 0090c7a22..97cbe23eb 100644 --- a/tests/z_api_null_drop_test.c +++ b/tests/z_api_null_drop_test.c @@ -30,19 +30,19 @@ // set v1 to null // move v to v1 // make sure that v is null now -#define TEST(name) \ - { \ - z_owned_##name##_t v; \ - memset(&v, -1, sizeof(v)); \ - z_null(&v); \ - assert(!z_check(v)); \ - z_drop(z_move(v)); \ - z_drop(z_move(v)); \ - z_owned_##name##_t v1; \ - z_null(&v1); \ - memset(&v, -1, sizeof(v)); \ - z_take(&v1, z_move(v)); \ - assert(!z_check(v)); \ +#define TEST(name) \ + { \ + z_owned_##name##_t v; \ + memset(&v, -1, sizeof(v)); \ + z_internal_null(&v); \ + assert(!z_internal_check(v)); \ + z_drop(z_move(v)); \ + z_drop(z_move(v)); \ + z_owned_##name##_t v1; \ + z_internal_null(&v1); \ + memset(&v, -1, sizeof(v)); \ + z_take(&v1, z_move(v)); \ + assert(!z_internal_check(v)); \ } int main(void) { diff --git a/tests/z_api_unitinialized_check.c b/tests/z_api_unitinialized_check.c index c27b14078..8ffa75117 100644 --- a/tests/z_api_unitinialized_check.c +++ b/tests/z_api_unitinialized_check.c @@ -24,9 +24,9 @@ int main(int argc, char **argv) { z_owned_keyexpr_t owned_keyexpr; assert(z_keyexpr_from_str(&owned_keyexpr, NULL) == Z_EINVAL); - assert(!z_check(owned_keyexpr)); + assert(!z_internal_check(owned_keyexpr)); assert(z_keyexpr_from_str_autocanonize(&owned_keyexpr, NULL) == Z_EINVAL); - assert(!z_check(owned_keyexpr)); + assert(!z_internal_check(owned_keyexpr)); assert(z_keyexpr_canonize_null_terminated(NULL) == Z_EINVAL); From bd2e4b779e8620202f824f70f37df71cc4a809c4 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 21 Aug 2024 13:33:24 +0200 Subject: [PATCH 100/397] made reliability option unstable (#612) --- Cargo.lock | 96 +++++++++++++++++------------------------ include/zenoh_commons.h | 4 ++ src/subscriber.rs | 20 ++++++--- 3 files changed, 57 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 377680df1..3407e4c60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,9 +353,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "cache-padded" @@ -594,12 +594,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "digest" @@ -653,9 +650,9 @@ checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "either" -version = "1.13.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "equivalent" @@ -1533,12 +1530,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.46" @@ -1872,12 +1863,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "powerfmt" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2786,14 +2771,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ "deranged", "itoa", - "num-conv", - "powerfmt", "serde", "time-core", "time-macros", @@ -2801,17 +2784,16 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ - "num-conv", "time-core", ] @@ -3594,7 +3576,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "ahash", "async-trait", @@ -3652,7 +3634,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "zenoh-collections", ] @@ -3690,7 +3672,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "serde", "tracing", @@ -3703,12 +3685,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "flume", "json5", @@ -3730,7 +3712,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-global-executor", "lazy_static", @@ -3742,7 +3724,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "aes", "hmac", @@ -3755,7 +3737,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "bincode", "flume", @@ -3774,7 +3756,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3788,7 +3770,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "zenoh-config", @@ -3806,7 +3788,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "flume", @@ -3831,7 +3813,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "base64 0.22.1", @@ -3862,7 +3844,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3881,7 +3863,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "base64 0.22.1", @@ -3912,7 +3894,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3933,7 +3915,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "futures", @@ -3953,7 +3935,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "futures-util", @@ -3974,7 +3956,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "proc-macro2", "quote", @@ -3985,7 +3967,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "libloading", "serde", @@ -4000,7 +3982,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "const_format", "rand", @@ -4015,7 +3997,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "anyhow", ] @@ -4023,7 +4005,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "futures", "lazy_static", @@ -4038,7 +4020,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "bincode", @@ -4062,7 +4044,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "event-listener 5.3.1", "futures", @@ -4076,7 +4058,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "futures", "tokio", @@ -4089,7 +4071,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "flume", @@ -4122,7 +4104,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" dependencies = [ "async-trait", "const_format", diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 97283212a..2af99424f 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -165,6 +165,7 @@ typedef enum z_query_target_t { /** * The subscription reliability. */ +#if defined(UNSTABLE) typedef enum z_reliability_t { /** * Defines reliability as ``BEST_EFFORT`` @@ -175,6 +176,7 @@ typedef enum z_reliability_t { */ Z_RELIABILITY_RELIABLE, } z_reliability_t; +#endif typedef enum z_sample_kind_t { /** * The Sample was issued by a ``put`` operation. @@ -561,10 +563,12 @@ typedef struct z_queryable_options_t { * Options passed to the `z_declare_subscriber()` function. */ typedef struct z_subscriber_options_t { +#if defined(UNSTABLE) /** * The subscription reliability. */ enum z_reliability_t reliability; +#endif } z_subscriber_options_t; /** * Options passed to the `z_delete()` function. diff --git a/src/subscriber.rs b/src/subscriber.rs index 636424843..8fe8ab3d3 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -14,11 +14,9 @@ use std::mem::MaybeUninit; -use zenoh::{ - prelude::SessionDeclarations, - pubsub::{Reliability, Subscriber}, - Wait, -}; +#[cfg(feature = "unstable")] +use zenoh::pubsub::Reliability; +use zenoh::{prelude::SessionDeclarations, pubsub::Subscriber, Wait}; use crate::{ keyexpr::*, @@ -28,6 +26,7 @@ use crate::{ }; /// The subscription reliability. +#[cfg(feature = "unstable")] #[allow(non_camel_case_types, clippy::upper_case_acronyms)] #[repr(C)] #[derive(Clone, Copy)] @@ -38,6 +37,7 @@ pub enum z_reliability_t { RELIABLE, } +#[cfg(feature = "unstable")] impl From for z_reliability_t { #[inline] fn from(r: Reliability) -> Self { @@ -48,6 +48,7 @@ impl From for z_reliability_t { } } +#[cfg(feature = "unstable")] impl From for Reliability { #[inline] fn from(val: z_reliability_t) -> Self { @@ -86,6 +87,7 @@ pub unsafe extern "C" fn z_subscriber_loan(this_: &z_owned_subscriber_t) -> &z_l #[repr(C)] pub struct z_subscriber_options_t { /// The subscription reliability. + #[cfg(feature = "unstable")] pub reliability: z_reliability_t, } @@ -93,6 +95,7 @@ pub struct z_subscriber_options_t { #[no_mangle] pub extern "C" fn z_subscriber_options_default(this_: &mut MaybeUninit) { this_.write(z_subscriber_options_t { + #[cfg(feature = "unstable")] reliability: Reliability::DEFAULT.into(), }); } @@ -119,12 +122,17 @@ pub extern "C" fn z_declare_subscriber( let session = session.as_rust_type_ref(); let key_expr = key_expr.as_rust_type_ref(); let callback = callback.take_rust_type(); - let mut subscriber = session + let subscriber = session .declare_subscriber(key_expr) .callback(move |sample| { let sample = sample.as_loaned_c_type_ref(); z_closure_sample_call(z_closure_sample_loan(&callback), sample) }); + #[cfg(not(feature = "unstable"))] + let _ = options; + #[cfg(feature = "unstable")] + let mut subscriber = subscriber; + #[cfg(feature = "unstable")] if let Some(options) = options { subscriber = subscriber.reliability(options.reliability.into()); } From 6e67b83017522db74a61930df03dc147519223c1 Mon Sep 17 00:00:00 2001 From: yellowhatter <104833606+yellowhatter@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:58:33 +0300 Subject: [PATCH 101/397] Update api.rst (#613) --- docs/api.rst | 71 ---------------------------------------------------- 1 file changed, 71 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 6bd722e18..ab5cd1e07 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -29,10 +29,6 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_slice_null -.. doxygenfunction:: z_view_slice_null -.. doxygenfunction:: z_slice_check -.. doxygenfunction:: z_view_slice_check .. doxygenfunction:: z_slice_loan .. doxygenfunction:: z_view_slice_loan .. doxygenfunction:: z_slice_drop @@ -57,10 +53,6 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_string_check -.. doxygenfunction:: z_view_string_check -.. doxygenfunction:: z_string_null -.. doxygenfunction:: z_view_string_null .. doxygenfunction:: z_string_loan .. doxygenfunction:: z_view_string_loan .. doxygenfunction:: z_string_drop @@ -85,8 +77,6 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_string_array_check -.. doxygenfunction:: z_string_array_null .. doxygenfunction:: z_string_array_drop .. doxygenfunction:: z_string_array_loan .. doxygenfunction:: z_string_array_loan_mut @@ -154,8 +144,6 @@ Functions .. doxygenfunction:: z_bytes_clone .. doxygenfunction:: z_bytes_loan .. doxygenfunction:: z_bytes_loan_mut -.. doxygenfunction:: z_bytes_null -.. doxygenfunction:: z_bytes_check .. doxygenfunction:: z_bytes_drop .. doxygenfunction:: z_bytes_get_reader @@ -200,8 +188,6 @@ Functions .. doxygenfunction:: z_keyexpr_loan .. doxygenfunction:: z_view_keyexpr_loan -.. doxygenfunction:: z_keyexpr_check -.. doxygenfunction:: z_view_keyexpr_check .. doxygenfunction:: z_keyexpr_drop .. doxygenfunction:: z_keyexpr_as_view_string @@ -228,10 +214,8 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_encoding_null .. doxygenfunction:: z_encoding_loan .. doxygenfunction:: z_encoding_loan_mut -.. doxygenfunction:: z_encoding_check .. doxygenfunction:: z_encoding_drop .. doxygenfunction:: z_encoding_loan_default .. doxygenfunction:: z_encoding_from_str @@ -320,9 +304,7 @@ Functions .. doxygenfunction:: z_reply_err_payload .. doxygenfunction:: z_reply_err_encoding -.. doxygenfunction:: z_reply_err_null .. doxygenfunction:: z_reply_err_loan -.. doxygenfunction:: z_reply_err_check .. doxygenfunction:: z_reply_err_drop Sample @@ -336,8 +318,6 @@ Types Functions ^^^^^^^^^ .. doxygenfunction:: z_sample_loan -.. doxygenfunction:: z_sample_check -.. doxygenfunction:: z_sample_null .. doxygenfunction:: z_sample_drop .. doxygenfunction:: z_sample_timestamp @@ -412,8 +392,6 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_mutex_check -.. doxygenfunction:: z_mutex_null .. doxygenfunction:: z_mutex_loan_mut .. doxygenfunction:: z_mutex_drop @@ -432,8 +410,6 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_condvar_check -.. doxygenfunction:: z_condvar_null .. doxygenfunction:: z_condvar_loan .. doxygenfunction:: z_condvar_drop @@ -450,9 +426,6 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_task_check -.. doxygenfunction:: z_task_null - .. doxygenfunction:: z_task_join .. doxygenfunction:: z_task_detach @@ -468,10 +441,8 @@ Types Functions ^^^^^^^^^ -.. doxygenfunction:: z_config_null .. doxygenfunction:: z_config_loan .. doxygenfunction:: z_config_loan_mut -.. doxygenfunction:: z_config_check .. doxygenfunction:: z_config_drop .. doxygenfunction:: z_config_default @@ -501,8 +472,6 @@ Functions .. doxygenfunction:: z_close .. doxygenfunction:: z_session_loan -.. doxygenfunction:: z_session_check -.. doxygenfunction:: z_session_null .. doxygenfunction:: z_session_drop .. doxygenfunction:: z_session_clone @@ -511,8 +480,6 @@ Functions .. doxygenfunction:: z_info_routers_zid .. doxygenfunction:: z_info_peers_zid -.. doxygenfunction:: z_closure_zid_check -.. doxygenfunction:: z_closure_zid_null .. doxygenfunction:: z_closure_zid_drop .. doxygenfunction:: z_closure_zid_call @@ -553,9 +520,7 @@ Functions .. doxygenfunction:: z_publisher_keyexpr .. doxygenfunction:: z_publisher_id -.. doxygenfunction:: z_publisher_null .. doxygenfunction:: z_publisher_loan -.. doxygenfunction:: z_publisher_check .. doxygenfunction:: z_publisher_drop .. doxygenfunction:: z_put_options_default @@ -600,29 +565,21 @@ Functions .. doxygenfunction:: z_declare_subscriber .. doxygenfunction:: z_undeclare_subscriber -.. doxygenfunction:: z_subscriber_check -.. doxygenfunction:: z_subscriber_null .. doxygenfunction:: z_subscriber_drop .. doxygenfunction:: z_closure_sample_call .. doxygenfunction:: z_closure_sample_drop -.. doxygenfunction:: z_closure_sample_null -.. doxygenfunction:: z_closure_sample_check .. doxygenfunction:: z_subscriber_options_default .. doxygenfunction:: z_fifo_channel_sample_new .. doxygenfunction:: z_ring_channel_sample_new -.. doxygenfunction:: z_fifo_handler_sample_check -.. doxygenfunction:: z_fifo_handler_sample_null .. doxygenfunction:: z_fifo_handler_sample_drop .. doxygenfunction:: z_fifo_handler_sample_loan .. doxygenfunction:: z_fifo_handler_sample_recv .. doxygenfunction:: z_fifo_handler_sample_try_recv -.. doxygenfunction:: z_ring_handler_sample_check -.. doxygenfunction:: z_ring_handler_sample_null .. doxygenfunction:: z_ring_handler_sample_drop .. doxygenfunction:: z_ring_handler_sample_loan .. doxygenfunction:: z_ring_handler_sample_recv @@ -663,13 +620,9 @@ Functions .. doxygenfunction:: z_query_reply_options_default .. doxygenfunction:: z_query_reply_err_options_default -.. doxygenfunction:: z_queryable_null -.. doxygenfunction:: z_queryable_check .. doxygenfunction:: z_queryable_loan .. doxygenfunction:: z_queryable_drop -.. doxygenfunction:: z_query_null -.. doxygenfunction:: z_query_check .. doxygenfunction:: z_query_loan .. doxygenfunction:: z_query_drop .. doxygenfunction:: z_query_clone @@ -682,23 +635,17 @@ Functions .. doxygenfunction:: z_query_reply .. doxygenfunction:: z_query_reply_err -.. doxygenfunction:: z_closure_query_null -.. doxygenfunction:: z_closure_query_check .. doxygenfunction:: z_closure_query_call .. doxygenfunction:: z_closure_query_drop .. doxygenfunction:: z_fifo_channel_query_new .. doxygenfunction:: z_ring_channel_query_new -.. doxygenfunction:: z_fifo_handler_query_check -.. doxygenfunction:: z_fifo_handler_query_null .. doxygenfunction:: z_fifo_handler_query_drop .. doxygenfunction:: z_fifo_handler_query_loan .. doxygenfunction:: z_fifo_handler_query_recv .. doxygenfunction:: z_fifo_handler_query_try_recv -.. doxygenfunction:: z_ring_handler_query_check -.. doxygenfunction:: z_ring_handler_query_null .. doxygenfunction:: z_ring_handler_query_drop .. doxygenfunction:: z_ring_handler_query_loan .. doxygenfunction:: z_ring_handler_query_recv @@ -739,31 +686,23 @@ Functions .. doxygenfunction:: z_query_consolidation_latest .. doxygenfunction:: z_query_target_default -.. doxygenfunction:: z_reply_check .. doxygenfunction:: z_reply_drop .. doxygenfunction:: z_reply_clone .. doxygenfunction:: z_reply_is_ok .. doxygenfunction:: z_reply_ok .. doxygenfunction:: z_reply_err -.. doxygenfunction:: z_reply_null -.. doxygenfunction:: z_closure_reply_null -.. doxygenfunction:: z_closure_reply_check .. doxygenfunction:: z_closure_reply_call .. doxygenfunction:: z_closure_reply_drop .. doxygenfunction:: z_fifo_channel_reply_new .. doxygenfunction:: z_ring_channel_reply_new -.. doxygenfunction:: z_fifo_handler_reply_check -.. doxygenfunction:: z_fifo_handler_reply_null .. doxygenfunction:: z_fifo_handler_reply_drop .. doxygenfunction:: z_fifo_handler_reply_loan .. doxygenfunction:: z_fifo_handler_reply_recv .. doxygenfunction:: z_fifo_handler_reply_try_recv -.. doxygenfunction:: z_ring_handler_reply_check -.. doxygenfunction:: z_ring_handler_reply_null .. doxygenfunction:: z_ring_handler_reply_drop .. doxygenfunction:: z_ring_handler_reply_loan .. doxygenfunction:: z_ring_handler_reply_recv @@ -790,8 +729,6 @@ Functions .. doxygenfunction:: z_hello_zid .. doxygenfunction:: z_hello_loan .. doxygenfunction:: z_hello_drop -.. doxygenfunction:: z_hello_null -.. doxygenfunction:: z_hello_check .. doxygenfunction:: z_whatami_to_view_string @@ -799,8 +736,6 @@ Functions .. doxygenfunction:: z_closure_hello_call .. doxygenfunction:: z_closure_hello_drop -.. doxygenfunction:: z_closure_hello_null -.. doxygenfunction:: z_closure_hello_check Liveliness ========== @@ -821,8 +756,6 @@ Functions .. doxygenfunction:: zc_liveliness_declare_token .. doxygenfunction:: zc_liveliness_undeclare_token .. doxygenfunction:: zc_liveliness_token_loan -.. doxygenfunction:: zc_liveliness_token_null -.. doxygenfunction:: zc_liveliness_token_check .. doxygenfunction:: zc_liveliness_token_drop .. doxygenfunction:: zc_liveliness_subscriber_options_default @@ -846,8 +779,6 @@ Functions .. doxygenfunction:: ze_declare_publication_cache .. doxygenfunction:: ze_undeclare_publication_cache -.. doxygenfunction:: ze_publication_cache_check -.. doxygenfunction:: ze_publication_cache_null .. doxygenfunction:: ze_publication_cache_drop .. doxygenfunction:: ze_publication_cache_options_default @@ -871,8 +802,6 @@ Functions .. doxygenfunction:: ze_undeclare_querying_subscriber .. doxygenfunction:: ze_querying_subscriber_get -.. doxygenfunction:: ze_querying_subscriber_check -.. doxygenfunction:: ze_querying_subscriber_null .. doxygenfunction:: ze_querying_subscriber_drop .. doxygenfunction:: ze_querying_subscriber_options_default From 4def1957d3c2e7b3525b19b3ea29614bca19655d Mon Sep 17 00:00:00 2001 From: yellowhatter <104833606+yellowhatter@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:53:49 +0300 Subject: [PATCH 102/397] Adopt SHM for recent API changes (#615) --- examples/z_get_shm.c | 2 +- examples/z_ping_shm.c | 2 +- examples/z_pub_shm.c | 31 ++++++++++++++++----- examples/z_pub_shm_thr.c | 2 +- examples/z_queryable_shm.c | 2 +- include/zenoh_commons.h | 53 +++++++++++++++++++++++++++++++++++- splitguide.yaml | 2 ++ src/shm/provider/types.rs | 37 +++++++++++++++++++++---- tests/z_api_null_drop_test.c | 2 ++ tests/z_api_shm_test.c | 24 ++++++++-------- 10 files changed, 129 insertions(+), 28 deletions(-) diff --git a/examples/z_get_shm.c b/examples/z_get_shm.c index 48ee8587b..c0846f6a4 100644 --- a/examples/z_get_shm.c +++ b/examples/z_get_shm.c @@ -67,7 +67,7 @@ int main(int argc, char** argv) { // Allocate SHM Buffer z_buf_layout_alloc_result_t alloc; z_shm_provider_alloc(&alloc, z_loan(provider), value_len, alignment); - if (!z_check(alloc.buf)) { + if (alloc.status != ZC_BUF_LAYOUT_ALLOC_STATUS_OK) { printf("Unexpected failure during SHM buffer allocation..."); return -1; } diff --git a/examples/z_ping_shm.c b/examples/z_ping_shm.c index 085a617b0..5457def13 100644 --- a/examples/z_ping_shm.c +++ b/examples/z_ping_shm.c @@ -77,7 +77,7 @@ int main(int argc, char** argv) { // Allocate SHM Buffer z_buf_layout_alloc_result_t alloc; z_shm_provider_alloc(&alloc, z_loan(provider), args.size, alignment); - if (!z_check(alloc.buf)) { + if (alloc.status != ZC_BUF_LAYOUT_ALLOC_STATUS_OK) { printf("Unexpected failure during SHM buffer allocation..."); return -1; } diff --git a/examples/z_pub_shm.c b/examples/z_pub_shm.c index 461816aca..cd259cceb 100644 --- a/examples/z_pub_shm.c +++ b/examples/z_pub_shm.c @@ -22,11 +22,22 @@ #define DEFAULT_VALUE "Pub from C!" struct args_t { - char* keyexpr; // -k - char* value; // -v + char* keyexpr; // -k + char* value; // -v + bool add_matching_listener; // --add-matching-listener }; struct args_t parse_args(int argc, char** argv, z_owned_config_t* config); +#ifdef UNSTABLE +void matching_status_handler(const zc_matching_status_t* matching_status, void* arg) { + if (matching_status->matching) { + printf("Subscriber matched\n"); + } else { + printf("No Subscribers matched\n"); + } +} +#endif + int main(int argc, char** argv) { z_owned_config_t config; struct args_t args = parse_args(argc, argv, &config); @@ -48,7 +59,7 @@ int main(int argc, char** argv) { } #ifdef UNSTABLE zc_owned_matching_listener_t listener; - if (add_matching_listener) { + if (args.add_matching_listener) { zc_owned_closure_matching_status_t callback; z_closure(&callback, matching_status_handler, NULL, NULL); zc_publisher_matching_listener_declare(&listener, z_loan(pub), z_move(callback)); @@ -76,7 +87,7 @@ int main(int argc, char** argv) { z_buf_layout_alloc_result_t alloc; z_shm_provider_alloc_gc_defrag_blocking(&alloc, z_loan(provider), buf_ok_size, alignment); - if (z_check(alloc.buf)) { + if (alloc.status == ZC_BUF_LAYOUT_ALLOC_STATUS_OK) { { uint8_t* buf = z_shm_mut_data_mut(z_loan_mut(alloc.buf)); sprintf((char*)buf, "[%4d] %s", idx, args.value); @@ -97,7 +108,7 @@ int main(int argc, char** argv) { } #ifdef UNSTABLE - if (add_matching_listener) { + if (args.add_matching_listener) { zc_publisher_matching_listener_undeclare(z_move(listener)); } #endif @@ -138,8 +149,13 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { if (!value) { value = DEFAULT_VALUE; } + const char* arg = parse_opt(argc, argv, "add-matching-listener", false); + bool add_matching_listener = false; + if (arg) { + add_matching_listener = true; + } parse_zenoh_common_args(argc, argv, config); - const char* arg = check_unknown_opts(argc, argv); + arg = check_unknown_opts(argc, argv); if (arg) { printf("Unknown option %s\n", arg); exit(-1); @@ -151,5 +167,6 @@ struct args_t parse_args(int argc, char** argv, z_owned_config_t* config) { exit(-1); } free(pos_args); - return (struct args_t){.keyexpr = (char*)keyexpr, .value = (char*)value}; + return (struct args_t){ + .keyexpr = (char*)keyexpr, .value = (char*)value, .add_matching_listener = add_matching_listener}; } diff --git a/examples/z_pub_shm_thr.c b/examples/z_pub_shm_thr.c index cc6d413a8..d91a18e46 100644 --- a/examples/z_pub_shm_thr.c +++ b/examples/z_pub_shm_thr.c @@ -66,7 +66,7 @@ int main(int argc, char **argv) { printf("Allocating single SHM buffer\n"); z_buf_layout_alloc_result_t alloc; z_shm_provider_alloc(&alloc, z_loan(provider), len, alignment); - if (!z_check(alloc.buf)) { + if (alloc.status != ZC_BUF_LAYOUT_ALLOC_STATUS_OK) { printf("Unexpected failure during SHM buffer allocation...\n"); return -1; } diff --git a/examples/z_queryable_shm.c b/examples/z_queryable_shm.c index e59eca281..1e4fab53f 100644 --- a/examples/z_queryable_shm.c +++ b/examples/z_queryable_shm.c @@ -51,7 +51,7 @@ void query_handler(const z_loaned_query_t *query, void *context) { z_alloc_alignment_t alignment = {0}; z_buf_layout_alloc_result_t alloc; z_shm_provider_alloc_gc_defrag_blocking(&alloc, provider, value_len, alignment); - if (z_check(alloc.buf)) { + if (alloc.status == ZC_BUF_LAYOUT_ALLOC_STATUS_OK) { { uint8_t *buf = z_shm_mut_data_mut(z_loan_mut(alloc.buf)); memcpy(buf, value, value_len); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 2af99424f..6aa2620b8 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -201,6 +201,50 @@ typedef enum z_whatami_t { Z_WHATAMI_PEER = 2, Z_WHATAMI_CLIENT = 4, } z_whatami_t; +/** + * Status of SHM buffer allocation operation + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum zc_buf_alloc_status_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + /** + * Allocation ok + */ + ZC_BUF_ALLOC_STATUS_OK = 0, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + /** + * Allocation error + */ + ZC_BUF_ALLOC_STATUS_ALLOC_ERROR = 1, +#endif +} zc_buf_alloc_status_t; +#endif +/** + * Status of SHM buffer layouting + allocation operation + */ +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) +typedef enum zc_buf_layout_alloc_status_t { +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + /** + * Allocation ok + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_OK = 0, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + /** + * Allocation error + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_ALLOC_ERROR = 1, +#endif +#if (defined(SHARED_MEMORY) && defined(UNSTABLE)) + /** + * Layouting error + */ + ZC_BUF_LAYOUT_ALLOC_STATUS_LAYOUT_ERROR = 2, +#endif +} zc_buf_layout_alloc_status_t; +#endif /** * The locality of samples to be received by subscribers or targeted by publishers. */ @@ -268,8 +312,12 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif +/** + * A result of SHM buffer allocation operation + */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef struct z_buf_alloc_result_t { + enum zc_buf_alloc_status_t status; z_owned_shm_mut_t buf; enum z_alloc_error_t error; } z_buf_alloc_result_t; @@ -897,10 +945,13 @@ typedef struct zc_shm_client_callbacks_t { bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); } zc_shm_client_callbacks_t; #endif +/** + * A result of SHM buffer layouting + allocation operation + */ #if (defined(SHARED_MEMORY) && defined(UNSTABLE)) typedef struct z_buf_layout_alloc_result_t { + enum zc_buf_layout_alloc_status_t status; z_owned_shm_mut_t buf; - bool error_is_alloc; enum z_alloc_error_t alloc_error; enum z_layout_error_t layout_error; } z_buf_layout_alloc_result_t; diff --git a/splitguide.yaml b/splitguide.yaml index c8cbae9f8..22bd854e5 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -86,6 +86,7 @@ zenoh_opaque.h: - z_owned_alloc_layout_t!#shared-memory#unstable - z_loaned_alloc_layout_t!#shared-memory#unstable - z_buf_alloc_result_t!#shared-memory#unstable + - zc_buf_alloc_status_t!#shared-memory#unstable - z_alloc_alignment_t!#shared-memory#unstable - z_chunk_descriptor_t!#shared-memory#unstable - z_allocated_chunk_t!#shared-memory#unstable @@ -93,6 +94,7 @@ zenoh_opaque.h: - z_shm_segment_t!#shared-memory#unstable - zc_shm_client_callbacks_t!#shared-memory#unstable - z_buf_layout_alloc_result_t!#shared-memory#unstable + - zc_buf_layout_alloc_status_t!#shared-memory#unstable - zc_shm_provider_backend_callbacks_t!#shared-memory#unstable - z_layout_error_t!#shared-memory#unstable - z_alloc_error_t!#shared-memory#unstable diff --git a/src/shm/provider/types.rs b/src/shm/provider/types.rs index ae0b63c4f..a9c6cb9a5 100644 --- a/src/shm/provider/types.rs +++ b/src/shm/provider/types.rs @@ -249,8 +249,20 @@ pub extern "C" fn z_chunk_alloc_result_drop(this_: &mut z_moved_chunk_alloc_resu let _ = this_.take_rust_type(); } +/// Status of SHM buffer allocation operation +#[repr(C)] +#[derive(Clone, Copy, Debug)] +pub enum zc_buf_alloc_status_t { + /// Allocation ok + OK = 0, + /// Allocation error + ALLOC_ERROR = 1, +} + +/// A result of SHM buffer allocation operation #[repr(C)] pub struct z_buf_alloc_result_t { + status: zc_buf_alloc_status_t, buf: z_owned_shm_mut_t, error: z_alloc_error_t, } @@ -262,6 +274,7 @@ impl From for z_buf_alloc_result_t { Ok(val) => { buf.as_rust_type_mut_uninit().write(Some(val)); Self { + status: zc_buf_alloc_status_t::OK, // SAFETY: this is safe because buf is gravestone-initialized above buf: unsafe { buf.assume_init() }, error: z_alloc_error_t::OTHER, @@ -270,6 +283,7 @@ impl From for z_buf_alloc_result_t { Err(error) => { z_internal_shm_mut_null(&mut buf); Self { + status: zc_buf_alloc_status_t::ALLOC_ERROR, // SAFETY: this is safe because buf is gravestone-initialized above buf: unsafe { buf.assume_init() }, error: error.into(), @@ -279,10 +293,23 @@ impl From for z_buf_alloc_result_t { } } +/// Status of SHM buffer layouting + allocation operation +#[repr(C)] +#[derive(Clone, Copy, Debug)] +pub enum zc_buf_layout_alloc_status_t { + /// Allocation ok + OK = 0, + /// Allocation error + ALLOC_ERROR = 1, + /// Layouting error + LAYOUT_ERROR = 2, +} + +/// A result of SHM buffer layouting + allocation operation #[repr(C)] pub struct z_buf_layout_alloc_result_t { + status: zc_buf_layout_alloc_status_t, buf: z_owned_shm_mut_t, - error_is_alloc: bool, alloc_error: z_alloc_error_t, layout_error: z_layout_error_t, } @@ -294,9 +321,9 @@ impl From for z_buf_layout_alloc_result_t { Ok(val) => { buf.as_rust_type_mut_uninit().write(Some(val)); Self { - // SAFETY: this is safe because buf is gravestone-initialized above + status: zc_buf_layout_alloc_status_t::OK, + // SAFETY: this is safe because buf is initialized above buf: unsafe { buf.assume_init() }, - error_is_alloc: false, alloc_error: z_alloc_error_t::OTHER, layout_error: z_layout_error_t::PROVIDER_INCOMPATIBLE_LAYOUT, } @@ -306,18 +333,18 @@ impl From for z_buf_layout_alloc_result_t { match error { zenoh::shm::ZLayoutAllocError::Alloc(alloc) => { Self { + status: zc_buf_layout_alloc_status_t::ALLOC_ERROR, // SAFETY: this is safe because buf is gravestone-initialized above buf: unsafe { buf.assume_init() }, - error_is_alloc: true, alloc_error: alloc.into(), layout_error: z_layout_error_t::PROVIDER_INCOMPATIBLE_LAYOUT, } } zenoh::shm::ZLayoutAllocError::Layout(layout) => { Self { + status: zc_buf_layout_alloc_status_t::LAYOUT_ERROR, // SAFETY: this is safe because buf is gravestone-initialized above buf: unsafe { buf.assume_init() }, - error_is_alloc: false, alloc_error: z_alloc_error_t::OTHER, layout_error: layout.into(), } diff --git a/tests/z_api_null_drop_test.c b/tests/z_api_null_drop_test.c index 97cbe23eb..805f37f6b 100644 --- a/tests/z_api_null_drop_test.c +++ b/tests/z_api_null_drop_test.c @@ -54,7 +54,9 @@ int main(void) { TEST(closure_query) TEST(closure_reply) TEST(closure_hello) +#ifdef UNSTABLE TEST(closure_zid) +#endif TEST(string) TEST(string_array) TEST(sample) diff --git a/tests/z_api_shm_test.c b/tests/z_api_shm_test.c index 4f3267df9..d11b63eac 100644 --- a/tests/z_api_shm_test.c +++ b/tests/z_api_shm_test.c @@ -33,16 +33,16 @@ return -300; \ } -#define ASSERT_CHECK(var) \ - if (!z_check(var)) { \ - assert(false); \ - return -100; \ +#define ASSERT_CHECK(var) \ + if (!z_internal_check(var)) { \ + assert(false); \ + return -100; \ } -#define ASSERT_CHECK_ERR(var) \ - if (z_check(var)) { \ - assert(false); \ - return -200; \ +#define ASSERT_CHECK_ERR(var) \ + if (z_internal_check(var)) { \ + assert(false); \ + return -200; \ } int test_shm_buffer(z_moved_shm_mut_t* mbuf) { @@ -96,7 +96,8 @@ int test_layouted_allocation(const z_loaned_alloc_layout_t* alloc_layout) { z_alloc_error_t shm_error; z_alloc_layout_alloc_gc(&alloc, alloc_layout); - if (z_check(alloc.buf)) { + if (alloc.status == ZC_BUF_ALLOC_STATUS_OK) { + ASSERT_CHECK(alloc.buf); ASSERT_OK(test_shm_buffer(z_move(alloc.buf))); ASSERT_CHECK_ERR(alloc.buf); return Z_OK; @@ -111,7 +112,8 @@ int test_allocation(const z_loaned_shm_provider_t* provider, size_t size, z_allo z_alloc_error_t shm_error; z_shm_provider_alloc_gc(&alloc, provider, size, alignment); - if (z_check(alloc.buf)) { + if (alloc.status == ZC_BUF_LAYOUT_ALLOC_STATUS_OK) { + ASSERT_CHECK(alloc.buf); ASSERT_OK(test_shm_buffer(z_move(alloc.buf))); ASSERT_CHECK_ERR(alloc.buf); return Z_OK; @@ -244,7 +246,7 @@ void layout_for_fn(struct z_owned_memory_layout_t* layout, void* context) { assert(context); assert(layout); - assert(z_check(*layout)); + assert(z_internal_check(*layout)); // check size and alignment size_t size = 0; From d79b2b59b2fab9a4337f544a3895e119f05b1b77 Mon Sep 17 00:00:00 2001 From: Geoff Martin Date: Thu, 22 Aug 2024 15:58:47 +0100 Subject: [PATCH 103/397] Ensure build directory contains a copy of rust-toolchain.toml. When building using cargo's --manifest-path option the toolchain configuration file within the manifest directory is ignored. Ensuring a copy of the rust-toolchain.toml file is in the build directory ensures the toolchain settings are pciked up when building via cmake. --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e0e13dbed..9a5885c77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -149,6 +149,16 @@ else() configure_cargo_toml(${cargo_toml_dir_release} ${project_version} ${cargo_lib_name_release}) endif() +# +# Copy toolchain configuration to build directory to ensure it is used when cargo is invoked from a directory other +# than the directory containing the manifest file +# +if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/rust-toolchain.toml") + file(COPY + ${CMAKE_CURRENT_SOURCE_DIR}/rust-toolchain.toml + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +endif() + # # Configure result library names # From 387dac60c8771de53d736079cf41ab6fe718563b Mon Sep 17 00:00:00 2001 From: yellowhatter <104833606+yellowhatter@users.noreply.github.com> Date: Fri, 23 Aug 2024 10:59:56 +0300 Subject: [PATCH 104/397] Shm ci (#593) * fix tests and examples for SHM * Add feature tests in CI * Adopt SHM for recent API changes * Update ci.yml and CMakeLists.txt * fix build for windows --- .github/workflows/ci.yml | 11 +++++++---- include/zenoh_commons.h | 6 ++++++ src/subscriber.rs | 5 +++++ tests/CMakeLists.txt | 4 ++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fdf3d305..8fd9b0e15 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macOS-latest, windows-latest] + shm: [false, true] + unstable: [false, true] steps: - uses: actions/checkout@v4 @@ -50,7 +52,7 @@ jobs: shell: bash run: | mkdir -p build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target install --config Release - name: Install valgrind @@ -61,7 +63,7 @@ jobs: shell: bash run: | cd build - cmake .. -DZENOHC_LIB_STATIC=FALSE -DCMAKE_BUILD_TYPE=Release + cmake .. -DZENOHC_LIB_STATIC=FALSE -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target tests --config Release ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_static)" @@ -69,14 +71,14 @@ jobs: shell: bash run: | cd build - cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Debug -DZENOHC_BUILD_TESTS_WITH_CXX=TRUE + cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Debug -DZENOHC_BUILD_TESTS_WITH_CXX=TRUE -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target tests --config Debug - name: Run cmake tests with zenoh-c as static library shell: bash run: | cd build - cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Release + cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target tests --config Release ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_shared)" @@ -106,6 +108,7 @@ jobs: run: cargo test --verbose --release --features=logger-autoinit - name: Upload artifact + if: ${{ matrix.unstable == 'false' && matrix.shm == 'false' }} uses: actions/upload-artifact@v4 with: # Artifact name diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 6aa2620b8..972bef886 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -617,6 +617,12 @@ typedef struct z_subscriber_options_t { */ enum z_reliability_t reliability; #endif +#if !defined(UNSTABLE) + /** + * Dummy field to avoid having fieldless struct + */ + uint8_t _0; +#endif } z_subscriber_options_t; /** * Options passed to the `z_delete()` function. diff --git a/src/subscriber.rs b/src/subscriber.rs index 8fe8ab3d3..53d529267 100644 --- a/src/subscriber.rs +++ b/src/subscriber.rs @@ -89,6 +89,9 @@ pub struct z_subscriber_options_t { /// The subscription reliability. #[cfg(feature = "unstable")] pub reliability: z_reliability_t, + /// Dummy field to avoid having fieldless struct + #[cfg(not(feature = "unstable"))] + pub _0: u8, } /// Constructs the default value for `z_subscriber_options_t`. @@ -97,6 +100,8 @@ pub extern "C" fn z_subscriber_options_default(this_: &mut MaybeUninit Date: Fri, 23 Aug 2024 10:01:53 +0200 Subject: [PATCH 105/397] build in separate directory failure fix (#617) * test for build in separate directory * builds dir from ci variable * using CI_PROJECT_DIR variable * relarive build examples * updated "time" version, suppressed "unused trait" warnings --- .github/workflows/ci.yml | 10 +++++----- Cargo.lock | 34 ++++++++++++++++++++++++++-------- src/transmute.rs | 11 ++++++++++- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fd9b0e15..dd30f1a16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,13 +88,13 @@ jobs: cd build cmake --build . --target examples - - name: Build examples with zenoh-c as subbroject and static library and in debug mode + - name: Build examples with zenoh-c as subbroject and static library and in debug mode and in separate directory shell: bash run: | - mkdir -p build_examples && cd build_examples - cmake ../examples -DCMAKE_BUILD_TYPE=Debug -DZENOHC_LIB_STATIC=TRUE - cmake --build . --config Debug - cd .. && rm -rf build_examples + mkdir -p ../build_examples + cmake -S examples -B ../build_examples -DCMAKE_BUILD_TYPE=Debug -DZENOHC_LIB_STATIC=TRUE + cmake --build ../build_examples --config Debug + rm -rf ../build_examples - name: Build examples with zenoh-c as installed package shell: bash diff --git a/Cargo.lock b/Cargo.lock index 3407e4c60..ff340fa96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -594,9 +594,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "digest" @@ -1530,6 +1533,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" version = "0.1.46" @@ -1863,6 +1872,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2771,12 +2786,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -2784,16 +2801,17 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] diff --git a/src/transmute.rs b/src/transmute.rs index 6be940ab0..c37b512cc 100644 --- a/src/transmute.rs +++ b/src/transmute.rs @@ -14,48 +14,57 @@ use std::mem::MaybeUninit; +#[allow(dead_code)] pub(crate) trait CTypeRef: Sized { type CType; fn as_ctype_ref(&self) -> &Self::CType; fn as_ctype_mut(&mut self) -> &mut Self::CType; } +#[allow(dead_code)] pub(crate) trait OwnedCTypeRef: Sized { type OwnedCType; fn as_owned_c_type_ref(&self) -> &Self::OwnedCType; fn as_owned_c_type_mut(&mut self) -> &mut Self::OwnedCType; } +#[allow(dead_code)] pub(crate) trait LoanedCTypeRef: Sized { type LoanedCType; fn as_loaned_c_type_ref(&self) -> &Self::LoanedCType; fn as_loaned_c_type_mut(&mut self) -> &mut Self::LoanedCType; } +#[allow(dead_code)] pub(crate) trait ViewCTypeRef: Sized { type ViewCType; fn as_view_c_type_ref(&self) -> &Self::ViewCType; fn as_view_c_type_mut(&mut self) -> &mut Self::ViewCType; } +#[allow(dead_code)] pub(crate) trait RustTypeRef: Sized { type RustType; fn as_rust_type_ref(&self) -> &Self::RustType; fn as_rust_type_mut(&mut self) -> &mut Self::RustType; } +#[allow(dead_code)] pub(crate) trait RustTypeRefUninit: Sized { type RustType; fn as_rust_type_mut_uninit(&mut self) -> &mut MaybeUninit; } +#[allow(dead_code)] pub(crate) trait IntoRustType: Sized { type RustType; fn into_rust_type(self) -> Self::RustType; } +#[allow(dead_code)] pub(crate) trait IntoCType: Sized { type CType; fn into_c_type(self) -> Self::CType; } - +#[allow(dead_code)] pub(crate) trait TakeRustType: Sized { type RustType; fn take_rust_type(&mut self) -> Self::RustType; } +#[allow(dead_code)] pub(crate) trait TakeCType: Sized { type CType; fn take_c_type(&mut self) -> Self::CType; From 91400a1dbcb5b585cea23a79756c71a9f5d3e907 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Mon, 26 Aug 2024 08:28:25 +0200 Subject: [PATCH 106/397] build: Sync with eclipse-zenoh/zenoh@8b027e9 from 2024-08-22 (#619) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 62 ++++++++++++------------- build-resources/opaque-types/Cargo.lock | 54 ++++++++++----------- 2 files changed, 58 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff340fa96..246187b07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,9 +353,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.7.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cache-padded" @@ -653,9 +653,9 @@ checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "either" -version = "1.9.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "equivalent" @@ -3594,7 +3594,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "ahash", "async-trait", @@ -3652,7 +3652,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "zenoh-collections", ] @@ -3690,7 +3690,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "serde", "tracing", @@ -3703,12 +3703,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "flume", "json5", @@ -3730,7 +3730,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-global-executor", "lazy_static", @@ -3742,7 +3742,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "aes", "hmac", @@ -3755,7 +3755,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "bincode", "flume", @@ -3774,7 +3774,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3788,7 +3788,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "zenoh-config", @@ -3806,7 +3806,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "flume", @@ -3831,7 +3831,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "base64 0.22.1", @@ -3862,7 +3862,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3881,7 +3881,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "base64 0.22.1", @@ -3912,7 +3912,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3933,7 +3933,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "futures", @@ -3953,7 +3953,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "futures-util", @@ -3974,7 +3974,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "proc-macro2", "quote", @@ -3985,7 +3985,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "libloading", "serde", @@ -4000,7 +4000,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "const_format", "rand", @@ -4015,7 +4015,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "anyhow", ] @@ -4023,7 +4023,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "futures", "lazy_static", @@ -4038,7 +4038,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "bincode", @@ -4062,7 +4062,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "event-listener 5.3.1", "futures", @@ -4076,7 +4076,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "futures", "tokio", @@ -4089,7 +4089,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "flume", @@ -4122,7 +4122,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#1696e755198e1ffe01851f7ea5d5d0e8ebe5745c" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index 96ca8eb87..a0d203f4d 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -3286,7 +3286,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "ahash", "async-trait", @@ -3344,7 +3344,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "zenoh-collections", ] @@ -3352,7 +3352,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "serde", "tracing", @@ -3365,12 +3365,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "flume", "json5", @@ -3392,7 +3392,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-global-executor", "lazy_static", @@ -3404,7 +3404,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "aes", "hmac", @@ -3417,7 +3417,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "bincode", "flume", @@ -3436,7 +3436,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "hashbrown", "keyed-set", @@ -3450,7 +3450,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "zenoh-config", @@ -3468,7 +3468,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "flume", @@ -3493,7 +3493,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "base64 0.22.1", @@ -3524,7 +3524,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3543,7 +3543,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "base64 0.22.1", @@ -3574,7 +3574,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3595,7 +3595,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "futures", @@ -3615,7 +3615,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "futures-util", @@ -3636,7 +3636,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "proc-macro2", "quote", @@ -3647,7 +3647,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "libloading", "serde", @@ -3662,7 +3662,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "const_format", "rand", @@ -3677,7 +3677,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "anyhow", ] @@ -3685,7 +3685,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "futures", "lazy_static", @@ -3700,7 +3700,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "bincode", @@ -3724,7 +3724,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "event-listener 5.3.1", "futures", @@ -3738,7 +3738,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "futures", "tokio", @@ -3751,7 +3751,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "flume", @@ -3784,7 +3784,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#ae1d109968f60c2001e692ac928c60f307c62335" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" dependencies = [ "async-trait", "const_format", From eba6f37f86349887916ab4a37e491d80dc768aeb Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Tue, 27 Aug 2024 13:55:44 +0200 Subject: [PATCH 107/397] cargo.lock update --- Cargo.lock | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eff34b5e1..246187b07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2825,16 +2825,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" -dependencies = [ - "cfg-if", - "once_cell", -] - [[package]] name = "tinyvec" version = "1.6.0" From 134dbfa06ca212def5fb51dd8e816734dfd8dff6 Mon Sep 17 00:00:00 2001 From: Yuyuan Yuan Date: Tue, 27 Aug 2024 20:39:57 +0800 Subject: [PATCH 108/397] fix: add `accept_replies` to `z_get_options_t` and use it in `ze_querying_subscriber_get` (#620) --- include/zenoh_commons.h | 1 + src/get.rs | 6 ++++-- src/querying_subscriber.rs | 15 ++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index d24f08b24..0ba3aa15a 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -677,6 +677,7 @@ typedef struct z_get_options_t { struct z_value_t value; struct z_attachment_t attachment; uint64_t timeout_ms; + enum zcu_reply_keyexpr_t accept_replies; } z_get_options_t; /** * An borrowed array of borrowed, zenoh allocated, NULL terminated strings. diff --git a/src/get.rs b/src/get.rs index c3009bc81..7edcfd387 100644 --- a/src/get.rs +++ b/src/get.rs @@ -35,8 +35,8 @@ use crate::attachment::{ }; use crate::{ impl_guarded_transmute, z_bytes_t, z_closure_reply_call, z_encoding_default, z_encoding_t, - z_keyexpr_t, z_owned_closure_reply_t, z_sample_t, z_session_t, GuardedTransmute, - LOG_INVALID_SESSION, + z_keyexpr_t, z_owned_closure_reply_t, z_sample_t, z_session_t, zcu_reply_keyexpr_default, + zcu_reply_keyexpr_t, GuardedTransmute, LOG_INVALID_SESSION, }; type ReplyInner = Option; @@ -168,6 +168,7 @@ pub struct z_get_options_t { pub value: z_value_t, pub attachment: z_attachment_t, pub timeout_ms: u64, + pub accept_replies: zcu_reply_keyexpr_t, } #[no_mangle] pub extern "C" fn z_get_options_default() -> z_get_options_t { @@ -182,6 +183,7 @@ pub extern "C" fn z_get_options_default() -> z_get_options_t { } }, attachment: z_attachment_null(), + accept_replies: zcu_reply_keyexpr_default(), } } diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 118f9a4e6..a67310302 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -37,12 +37,12 @@ type FetchingSubscriber = Option>; /// An owned zenoh querying subscriber. Destroying the subscriber cancels the subscription. /// -/// Like most `ze_owned_X_t` types, you may obtain an instance of `z_X_t` by loaning it using `z_X_loan(&val)`. -/// The `z_loan(val)` macro, available if your compiler supports C11's `_Generic`, is equivalent to writing `z_X_loan(&val)`. +/// Like most `ze_owned_X_t` types, you may obtain an instance of `z_X_t` by loaning it using `z_X_loan(&val)`. +/// The `z_loan(val)` macro, available if your compiler supports C11's `_Generic`, is equivalent to writing `z_X_loan(&val)`. /// -/// Like all `ze_owned_X_t`, an instance will be destroyed by any function which takes a mutable pointer to said instance, as this implies the instance's inners were moved. -/// To make this fact more obvious when reading your code, consider using `z_move(val)` instead of `&val` as the argument. -/// After a move, `val` will still exist, but will no longer be valid. The destructors are double-drop-safe, but other functions will still trust that your `val` is valid. +/// Like all `ze_owned_X_t`, an instance will be destroyed by any function which takes a mutable pointer to said instance, as this implies the instance's inners were moved. +/// To make this fact more obvious when reading your code, consider using `z_move(val)` instead of `&val` as the argument. +/// After a move, `val` will still exist, but will no longer be valid. The destructors are double-drop-safe, but other functions will still trust that your `val` is valid. /// /// To check if `val` is still valid, you may use `z_X_check(&val)` or `z_check(val)` if your compiler supports `_Generic`, which will return `true` if `val` is valid. #[repr(C)] @@ -132,8 +132,8 @@ pub extern "C" fn ze_querying_subscriber_options_default() -> ze_querying_subscr /// To check if the subscription succeeded and if the querying subscriber is still valid, /// you may use `ze_querying_subscriber_check(&val)` or `z_check(val)` if your compiler supports `_Generic`, which will return `true` if `val` is valid. /// -/// Like all `ze_owned_X_t`, an instance will be destroyed by any function which takes a mutable pointer to said instance, as this implies the instance's inners were moved. -/// To make this fact more obvious when reading your code, consider using `z_move(val)` instead of `&val` as the argument. +/// Like all `ze_owned_X_t`, an instance will be destroyed by any function which takes a mutable pointer to said instance, as this implies the instance's inners were moved. +/// To make this fact more obvious when reading your code, consider using `z_move(val)` instead of `&val` as the argument. /// After a move, `val` will still exist, but will no longer be valid. The destructors are double-drop-safe, but other functions will still trust that your `val` is valid. /// /// Example: @@ -234,6 +234,7 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( .target(options.target.into()) .consolidation(options.consolidation) .timeout(std::time::Duration::from_millis(options.timeout_ms)) + .accept_replies(options.accept_replies.into()) .callback(cb) .res_sync(), None => s.get(selector).callback(cb).res_sync(), From b16dd9e3aa0f1daa1ecb4ec85ab6473261c82a4b Mon Sep 17 00:00:00 2001 From: Yuyuan Yuan Date: Tue, 27 Aug 2024 20:42:10 +0800 Subject: [PATCH 109/397] fix: properly apply `z_get_options_t` in `ze_querying_subscriber_get` (#621) --- src/querying_subscriber.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/querying_subscriber.rs b/src/querying_subscriber.rs index 2b76bd359..3eb0ed86f 100644 --- a/src/querying_subscriber.rs +++ b/src/querying_subscriber.rs @@ -16,7 +16,7 @@ use std::mem::MaybeUninit; use zenoh::{ bytes::EncodingBuilderTrait, prelude::SessionDeclarations, pubsub::Reliability, - sample::SampleBuilderTrait, session::Session, Wait, + qos::QoSBuilderTrait, sample::SampleBuilderTrait, session::Session, Wait, }; use zenoh_ext::*; @@ -170,7 +170,7 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( .0 .fetch({ move |cb| { - let mut get = session.get(selector).callback(cb); + let mut get = session.get(selector); if let Some(options) = options { if let Some(payload) = options.payload.take() { @@ -179,24 +179,33 @@ pub unsafe extern "C" fn ze_querying_subscriber_get( if let Some(encoding) = options.encoding.take() { get = get.encoding(encoding.take_rust_type()); } - #[cfg(feature = "unstable")] - if let Some(source_info) = options.source_info.take() { - get = get.source_info(source_info.take_rust_type()); - } if let Some(attachment) = options.attachment.take() { get = get.attachment(attachment.take_rust_type()); } get = get .consolidation(options.consolidation) - .target(options.target.into()); + .target(options.target.into()) + .congestion_control(options.congestion_control.into()) + .priority(options.priority.into()) + .express(options.is_express); + + #[cfg(feature = "unstable")] + { + if let Some(source_info) = options.source_info.take() { + get = get.source_info(source_info.take_rust_type()); + } + get = get + .allowed_destination(options.allowed_destination.into()) + .accept_replies(options.accept_replies.into()); + } if options.timeout_ms != 0 { get = get.timeout(std::time::Duration::from_millis(options.timeout_ms)); } } - get.wait() + get.callback(cb).wait() } }) .wait() From 9abddda1c3c612ca66005e235bb79551f55773c2 Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 28 Aug 2024 11:26:40 +0200 Subject: [PATCH 110/397] Revert "Merge dev1.0.0 into main" From a85b91b790e85ba6db02fefd78e7e26229c76a5a Mon Sep 17 00:00:00 2001 From: Michael Ilyin Date: Wed, 28 Aug 2024 11:54:12 +0200 Subject: [PATCH 111/397] merging error fix --- include/zenoh_commons.h | 1 - src/get.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index c3988e269..972bef886 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -724,7 +724,6 @@ typedef struct z_get_options_t { * The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration. */ uint64_t timeout_ms; - enum zcu_reply_keyexpr_t accept_replies; } z_get_options_t; typedef struct z_moved_hello_t { struct z_owned_hello_t _this; diff --git a/src/get.rs b/src/get.rs index e9b0bd844..140301b6c 100644 --- a/src/get.rs +++ b/src/get.rs @@ -210,7 +210,6 @@ pub struct z_get_options_t { pub attachment: Option<&'static mut z_moved_bytes_t>, /// The timeout for the query in milliseconds. 0 means default query timeout from zenoh configuration. pub timeout_ms: u64, - pub accept_replies: zcu_reply_keyexpr_t, } /// Constructs default `z_get_options_t` From a597a57e2b757548dbc8b4eec9c67ab87ea53145 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:19:31 +0200 Subject: [PATCH 112/397] build: Sync with eclipse-zenoh/zenoh@7f7d648 from 2024-08-28 (#628) Co-authored-by: eclipse-zenoh-bot --- Cargo.lock | 70 ++++++++++++------------- build-resources/opaque-types/Cargo.lock | 70 ++++++++++++------------- 2 files changed, 70 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 246187b07..7e6b37cc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2582,22 +2582,20 @@ dependencies = [ [[package]] name = "stabby" -version = "5.0.1" +version = "36.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7708f5b0e8bddba162d20fa10c8d17c31a2ec6bba369f7904bb18a8bde49ba2" +checksum = "311d6bcf0070c462ff626122ec2246f42bd2acd44b28908eedbfd07d500c7d99" dependencies = [ - "lazy_static", "rustversion", "stabby-abi", ] [[package]] name = "stabby-abi" -version = "5.0.1" +version = "36.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6e7a8b2ff2c116bfab6afcce0adec14509eb38fd3f231bb97826d01de4021e" +checksum = "e6daae1a0707399f56d27fce7f212e50e31d215112a447e1bbcd837ae1bf5f49" dependencies = [ - "libc", "rustversion", "sha2-const-stable", "stabby-macros", @@ -2605,9 +2603,9 @@ dependencies = [ [[package]] name = "stabby-macros" -version = "5.0.1" +version = "36.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97bd3101fab9929a08fa0138d30d46c7a80b9d32bc8a3a00706ba00358a275" +checksum = "43cf89a0cc9131279235baf8599b0e073fbcb096419204de0cc5d1a48ae73f74" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3594,7 +3592,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "ahash", "async-trait", @@ -3652,7 +3650,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "zenoh-collections", ] @@ -3690,7 +3688,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "serde", "tracing", @@ -3703,12 +3701,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "flume", "json5", @@ -3730,7 +3728,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-global-executor", "lazy_static", @@ -3742,7 +3740,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "aes", "hmac", @@ -3755,7 +3753,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "bincode", "flume", @@ -3774,7 +3772,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3788,7 +3786,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "zenoh-config", @@ -3806,7 +3804,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "flume", @@ -3831,7 +3829,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "base64 0.22.1", @@ -3862,7 +3860,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3881,7 +3879,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "base64 0.22.1", @@ -3912,7 +3910,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3933,7 +3931,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "futures", @@ -3953,7 +3951,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "futures-util", @@ -3974,7 +3972,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "proc-macro2", "quote", @@ -3985,7 +3983,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "libloading", "serde", @@ -4000,7 +3998,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "const_format", "rand", @@ -4015,7 +4013,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "anyhow", ] @@ -4023,7 +4021,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "futures", "lazy_static", @@ -4038,7 +4036,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "bincode", @@ -4062,7 +4060,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "event-listener 5.3.1", "futures", @@ -4076,7 +4074,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "futures", "tokio", @@ -4089,10 +4087,12 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", + "crossbeam-utils", "flume", + "lazy_static", "lz4_flex", "paste", "rand", @@ -4122,7 +4122,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index a0d203f4d..f577d8c69 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -2353,22 +2353,20 @@ dependencies = [ [[package]] name = "stabby" -version = "5.0.1" +version = "36.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7708f5b0e8bddba162d20fa10c8d17c31a2ec6bba369f7904bb18a8bde49ba2" +checksum = "311d6bcf0070c462ff626122ec2246f42bd2acd44b28908eedbfd07d500c7d99" dependencies = [ - "lazy_static", "rustversion", "stabby-abi", ] [[package]] name = "stabby-abi" -version = "5.0.1" +version = "36.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a6e7a8b2ff2c116bfab6afcce0adec14509eb38fd3f231bb97826d01de4021e" +checksum = "e6daae1a0707399f56d27fce7f212e50e31d215112a447e1bbcd837ae1bf5f49" dependencies = [ - "libc", "rustversion", "sha2-const-stable", "stabby-macros", @@ -2376,9 +2374,9 @@ dependencies = [ [[package]] name = "stabby-macros" -version = "5.0.1" +version = "36.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db97bd3101fab9929a08fa0138d30d46c7a80b9d32bc8a3a00706ba00358a275" +checksum = "43cf89a0cc9131279235baf8599b0e073fbcb096419204de0cc5d1a48ae73f74" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -3286,7 +3284,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "ahash", "async-trait", @@ -3344,7 +3342,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "zenoh-collections", ] @@ -3352,7 +3350,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "serde", "tracing", @@ -3365,12 +3363,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "flume", "json5", @@ -3392,7 +3390,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-global-executor", "lazy_static", @@ -3404,7 +3402,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "aes", "hmac", @@ -3417,7 +3415,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "bincode", "flume", @@ -3436,7 +3434,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "hashbrown", "keyed-set", @@ -3450,7 +3448,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "zenoh-config", @@ -3468,7 +3466,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "flume", @@ -3493,7 +3491,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "base64 0.22.1", @@ -3524,7 +3522,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3543,7 +3541,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "base64 0.22.1", @@ -3574,7 +3572,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3595,7 +3593,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "futures", @@ -3615,7 +3613,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "futures-util", @@ -3636,7 +3634,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "proc-macro2", "quote", @@ -3647,7 +3645,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "libloading", "serde", @@ -3662,7 +3660,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "const_format", "rand", @@ -3677,7 +3675,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "anyhow", ] @@ -3685,7 +3683,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "futures", "lazy_static", @@ -3700,7 +3698,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "bincode", @@ -3724,7 +3722,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "event-listener 5.3.1", "futures", @@ -3738,7 +3736,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "futures", "tokio", @@ -3751,10 +3749,12 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", + "crossbeam-utils", "flume", + "lazy_static", "lz4_flex", "paste", "rand", @@ -3784,7 +3784,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#8b027e90799ce693cc5e181a48e6b831f3f18b82" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "const_format", From 79b446883f46fa01ecc9cb4ffdb44bb69b1fb4c6 Mon Sep 17 00:00:00 2001 From: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Date: Thu, 29 Aug 2024 02:56:18 +0200 Subject: [PATCH 113/397] build: Sync with eclipse-zenoh/zenoh@357945b from 2024-08-28 (#627) * Add z_timestamp_new and tests * fix clippy warning * Add z_publisher_set_* methods * Add missing properties to z_query_reply_options_t * Add check, null, loan, drop for source info. * Move z_*_source_info_t, z_entity_global_id_t out from commons * renamed zc_liveliness_declare_subscriber_options_t -> zc_liveliness_subscriber_options_t; added zc_liveliness_token_loan function; added tests for liveliness; * fmt * test update * Add reply_del support * Add clang-format CI check * Update codebase with clang-format * Remove z_query_value * Fix default congestion_control for z_query_reply_options_t * Fix default congestion_control for z_query_reply_del_options_t * Exclude autogenerated files from clang-format * Add z_publisher_loan_mut * Add z_reply_err_t and methods * Add missing properties to z_get_options_t * Remove publisher set methods * Add z_reply_replier_id * chore: Sync Rust toolchain * Add publisher id getter (#448) * Add publisher id getter * Add z_publisher_id to docs/api.rst * Support recent zenoh (no shm renaming!) * SHM renaming support * remove unnecessary .clone() call (#437) * format tests * Fix INTERFACE includes (was incorrect when Cargo is generating to custom directory) * rename z_bytes_encode/decode into z_bytes_serialize/deserialize * format * cargo fmt * Remove unused variable * more build system fixes * Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * Enable releasing from any branch (#456) * Replace `-rc` with `-pre` and document versioning (#466) * Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * build: Sync with eclipse-zenoh/zenoh@65e5df7 from 2024-06-21 (#468) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@a6d117b from 2024-06-21 (#474) Co-authored-by: eclipse-zenoh-bot * Align Zenoh (#476) * build: Sync with eclipse-zenoh/zenoh@fc18f90 from 2024-06-26 (#477) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@1790d59 from 2024-06-26 (#483) Co-authored-by: eclipse-zenoh-bot * simplify transmute mod for easier understanding the code (#472) * from/into types * inplace2 for Config * z_config_default fix * separating CSlice - unfinished * slice/string rework unfinshed * collections unfinished * collections updated * clippy fix * cargo fmt * copy transmute, only a_c_type kept * clippy fix * sample converted * encoding converted * EntityGlobalId converted * sourceInfo updated * publisher updated * clippy fix * queryable updated * query updated * reply_error * querying_subscriber update * slice_map converted * string_array updated * reply updated * keyexpr updated * liveliness token updated * ZBytes updated * zbytes writer updated * zbyes reader updated * ZenohId updated * zbytesiterator updated * publication cache updated * scouting updated * session updated * subscriber updated * owned_matching_listener updated * closure hello updated * matching status closure update * cargo fmt, doc comments corrected * query channel * query_channel updated * query_closure updated * reply_closure updated * fifo_handler_reply updated * response_channel updated * sample channel updated * sample closure updated * sample channel updated * zenoh_id closure updated * zmutex updated * condvar covered * task covered * z_owned_shm_t updated * shm_mut updated * shm_client updated * owned_shm_client_list updated * shm_client_storage updated * alloc_layout, alloc_result converted * shm provider update * alloc alignment converted * memory layout updated * chunk alloc resut updated * rename transmute2 to transmute * lifetime corrected * tests fixed, uninit test updated * lib name restored * renamed "ctype" to "c_type", like "rust_type" * write empty on error * year updated * regenerated headers wihtout shm * String names normalization (#495) * fix string-related function names in docs (#496) * updated docs after pr #495 * updated docs * change order of arguments for ..._clone methods to that of zenoh-pico (#497) * fix_what_am_i_to_str name and docs (#503) * add encoding tests (#502) * add encoding tests * format * feat: bump zenoh version (#485) * chore: rebase onto dev/1.0.0 * fix: fix clippy lint * fix: comment entity_global_id... * fix: fix comment * fix: comment eid in the test * fix: fix test * fix: fix test * fix: fix test * fix: add comment * build: Sync with eclipse-zenoh/zenoh@cae8697 from 2024-07-05 (#505) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@6df74c7 from 2024-07-07 (#506) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@12b11ee from 2024-07-08 (#507) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@9e1c4a8 from 2024-07-08 (#509) Co-authored-by: eclipse-zenoh-bot * api fixes for compatibility with zenoh-pico (#510) * api fixes for compatibility with zenoh-pico * clippy fixes * remove unneeded enumerators from z_whatami_t * fix: Rename `bump.bash` to `bump-and-tag.bash` * feat: Add `version.txt` and infer version in `bump-and-tag.bash` * fix: Clone repository using actions/checkout * fix: Don't bump deps when pattern is undefined * fix: Specify git remote when pushing the tag * fix: Require `VERSION`in `bump-and-tag.bash` * fix: Override release tag if it already exists * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * align api with zenoh-pico (#519) * remove z_slice_map; make z_timestamp_new, use id of session and current wall clock time; * format * fix tests * format * removed z_owned_closure_owned_query_t * fix: typos of attachment (#478) * added default encoding for publisher (#520) * add default enum constants (#521) * chore: replace log by tracing (#514) * chore: replace log by tracing * fix: update Cargo.toml.in * fix: remove useless dependencies * fix: fix Cargo.toml.in * add get is_express option (#522) * chore: Sync Rust toolchain * chore: Sync Rust toolchain * support for enable/disable unstable features via #define * fmt * Encoding alignment with Zenoh-rust (#523) * add z_encoding_set_schema functions (corresponding to zenoh-rust Encoding::with_schema); add predefined encoding constants; * docs update * clippy * fmt * fmt * add zc_config_from_env function (#527) * readme update to explain how to enable optional features * move SourceInfo, liveliness, KeyExpr::relation_to and zenoh-ext functionality under unstable feature * fix: Add step to run cargo build for docs Some auto generated files (e.g. include/zenoh_opaque.h) are platform specific so they are git ignored. They contain documentation that should be published as well, so this step makes sure all the files are in the checkout before publishing them to readthedocs.io * propagate options to cmake find_package (#531) * propagate options to cmake find_package * output feature variables * Pre release SHM * Fix SHM config key and examples * Revert Cargo.toml change * Fix examples * - do not trigger error if SHARED_MEMORY enabled without UNSTABLE - fix clippy - review fixes * remove redundant compile definitions (#534) * Address review comments * Add SHM config to z_sub_thr * remove redundant compile definitions (#534) * align with recent zenoh * unstable is not default * Fix z_pub_shm_thr. Fix shm API. * Adopt keyexpr tests for new behavior * Add check in z_pub_shm_thr * Add z_bytes_serialize_from_shm check in examples * Rename z_error_t to z_result_t * Rename errors.rs to result.rs * no longer use cpp, awk and sed for cbindgen output processing * typo fix * Address review comments * refactor features usage * fix docs * add SHM examples * build: Sync with eclipse-zenoh/zenoh@4827f39 from 2024-07-24 (#540) Co-authored-by: eclipse-zenoh-bot * typo fix (how did that compile????) * Ensure that find_package(zenohc) can be called two times (#470) * Update CMakeLists.txt (#473) * Install zenohc.dll in /bin on Windows (#471) * Fix shm doc * fix cbindgen in ptr to const ptr case * Align SHM examples * don't need this * build: Sync with eclipse-zenoh/zenoh@0c43c08 from 2024-07-25 (#547) Co-authored-by: eclipse-zenoh-bot * Remove legacy slice methods * build: Sync with eclipse-zenoh/zenoh@32bdded from 2024-07-26 (#550) Co-authored-by: eclipse-zenoh-bot * simplify tests and examples with attachment * address review comments * build: Sync with eclipse-zenoh/zenoh@502d3be from 2024-07-30 (#558) Co-authored-by: eclipse-zenoh-bot * fix queryable examples to account for an empty payload * Update dependencies to have 1.80 build * Allow providing custom delete function when serializing from pointers (#554) * remove z_serialize_xxx_copy; z_serialize_from_slice now consumes z_owned_slice_t; z_serialize_from_str is renamed into z_serialize_from_string and is now consuming z_owned_string_t introduce z_serialize_from_buf/from_str allowing to consume raw pointers by taking custom delete function; * format * clippy * add support for creating string/slice with custom deleter; align serialization functions; * intorduce z_bytes_from_static_str and z_bytes_from_static_buf * rename slice/string constructors according to zenoh-pico review comments * build: Sync with eclipse-zenoh/zenoh@5d09cf7 from 2024-08-01 (#562) Co-authored-by: eclipse-zenoh-bot * build fix after cargo.lock update (#564) * - add z_byte_writer_write_all - z_byte_writer_write now has interface that intends that it can write not all * add doxygenfunction:: z_bytes_writer_write_all * change output parameter position * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * leave only z_bytes_writer_write_all * Kick CI * Kick CI * log error messages when failing to manipulate the config (#563) * generate panic messages only if explicitly asked (#569) * generate panic messages only if explicitly asked * doc comments restored * remove unnecessary build artifacts (#571) * build: Sync with eclipse-zenoh/zenoh@b1e4dba from 2024-08-05 (#573) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@b7d42ef from 2024-08-06 (#574) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@2d5ab7c from 2024-08-06 (#575) Co-authored-by: eclipse-zenoh-bot * z_recv/z_try_recv without the need of z_check (#570) * make z_recv/z_try_recv return z_result_t to allow differentiating between different cases without the need to call z_check on constructed object * format * Logging (#580) * renamed zc_init_logger -> zc_init_logging; added support for providing custom callbacks for logging messages; * format * clippy * add missing dependency * z_bytes_reader and z_bytes_writer update (#583) * made z_bytes_writer non-owned; added z_bytes_writer_append(...) and z_bytes_writer append_bounded(...) (aka writer.serialize()); added z_bytes_reader_read_bounded(...); * fix initializer * fix initializer * rename zc_publisher_matching_listener_callback -> zc_publisher_matching_listener_declare; (#581) added zc_publisher_get_matching_status; * docs: fix doxygen (#578) * chore: ignore docs/doxyxml * docs: update the README of doxygen * docs: fix the warnings * docs: remove the unnecessary step in macOS * chore: address the review comment * add valgrind memory leaks check (#584) * added pub sub test for memory leaks * added valgrind test * format * ci fix * ci fix * add queryable-get memory leaks test * do not copy memory leaks script * fixed memory leak in handlers * docs update * format * format * attempt to address ci no more space issue (#585) * attempt to address ci no more space issue * remove env settings * add CARGO_PROFILE_DEV_DEBUG=false * Move protection (#488) * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * build fixes * zc_ prefix for log function * zc_ prefix in example * regenerated files * cargo fmt * undeclare as drop * removed _undeclare parsing * missing drop/check funcs added. verification added to build.rs * cargo fmt * tests fix * test fix * cmake fix * null drop test same as in pico, take corrected --------- Co-authored-by: Mahmoud Mazouz Co-authored-by: Luca Cominardi * fix: use `z_move` in shm examples (#589) * fix tests and examples for SHM (#592) * SHM is now enabled by default in the Config, so no need to set it explicitly in examples * build: Sync with eclipse-zenoh/zenoh@0e2f78a from 2024-08-14 (#596) Co-authored-by: eclipse-zenoh-bot * update zenoh * fix clang * dropper autogeneration * dropper type * unfinished - into_rust_type approach failed * compiles * compile with all features * drop functions updated * "this" parameter name globally renamed to this_ to avoid using C++ keyword * compile fix * generic functions update * drop generic fix * clippy fix * cargo fmt * headers updated * cargo fmt fix * check in build.rs restored * fix: misuse the callback in z_info * chore: Bump version to `1.0.0.0` * chore: Bump libzenohc-dev version to `1.0.0~dev-1` * chore: Bump `/zenoh.*/` dependencies to `1.0.0-dev` * chore: Update Cargo.lock to `1.0.0-dev` * chore: Bump build-resources/opaque-types version to `1.0.0-dev` * merge main branch into dev/1.0.0 (after "moved_as_ptr" update) (#600) * fix: Rename `bump.bash` to `bump-and-tag.bash` * feat: Add `version.txt` and infer version in `bump-and-tag.bash` * fix: Clone repository using actions/checkout * fix: Add `CMakeFiles` to `.gitignore` * fix: Add `debug` and `release` to `.gitignore` * fix: Provide default release number for testing * fix: Don't bump deps when pattern is undefined * fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330) Co-authored-by: eclipse-zenoh-bot * fix: Specify git remote when pushing the tag * fix: Require `VERSION`in `bump-and-tag.bash` * fix: Override release tag if it already exists * feat(tracing): using tracing and zenoh-util init_log (#308) * feat(tracing): using tracing and zenoh-util init_log Signed-off-by: gabrik * chore: adding Cargo.lock Signed-off-by: gabrik * chore: updated Cargo.toml.in Signed-off-by: gabrik * feat(tracing): using zenoh main branch Signed-off-by: gabrik --------- Signed-off-by: gabrik * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337) Co-authored-by: eclipse-zenoh-bot * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * chore: using new try_init_log_from_env Signed-off-by: gabrik * Align examples and remove reading from stdin (#255) * Remove reading from stdin, align example implementations * Add argument parsing implementation for examples * Add argument parsing to examples, format files * Replace getchar with sleep in z_pong example * Fix typo in include * Use null-pointers instead of empty strings, remove unnecessary mallocs * Free returned pointer after parse_pos_args usage * Add common and positional args parsing to z_ping example * Add formatting for parsed config options * Add const to function parameters * Update mode option help * Fix pos_args memory leak * Refactor parse_args, remove possible strcpy buffer overflow * Change parse_args function returns to const where applicable * Fix const initialization warning * Remove redundant const for value parameters * Fix buf variable memory leak * Update insert json-list config error message * Add usage example for -e and -l arguments in help * Update example notation in help message Co-authored-by: Alexander * Update example notation in help message (2/2) * Fix parameter in error message Co-authored-by: Alexander --------- Co-authored-by: Alexander * Bugfix: Unable to build z_queryable_with_channels.c (#340) Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343) Co-authored-by: eclipse-zenoh-bot * Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360) Co-authored-by: eclipse-zenoh-bot * Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). * build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420) Co-authored-by: eclipse-zenoh-bot * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457) Co-authored-by: eclipse-zenoh-bot * Enable releasing from any branch (#456) * build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460) Co-authored-by: eclipse-zenoh-bot * Update to latest zenoh * Replace `-rc` with `-pre` and document versioning (#466) * build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467) Co-authored-by: eclipse-zenoh-bot * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494) Co-authored-by: eclipse-zenoh-bot * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500) Co-authored-by: eclipse-zenoh-bot * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508) Co-authored-by: eclipse-zenoh-bot * Ensure that find_package(zenohc) can be called two times (#470) * Update CMakeLists.txt (#473) * Install zenohc.dll in /bin on Windows (#471) * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552) Co-authored-by: eclipse-zenoh-bot * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556) Co-authored-by: eclipse-zenoh-bot * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * decl_c_type corrected * cargo check run * borrow error fix * compilation fix * parse arg fix * example compilation fix * examples compile fix * examples build fixes * removed duplicated z_config_default (it's called in parsing args later) * clang format * clang format * cargo.toml restore --------- Signed-off-by: gabrik Signed-off-by: ChenYing Kuo Co-authored-by: Mahmoud Mazouz Co-authored-by: Denis Biryukov Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: eclipse-zenoh-bot Co-authored-by: Mahmoud Mazouz Co-authored-by: Gabriele Baldoni Co-authored-by: gabrik Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: ChenYing Kuo (CY) Co-authored-by: Jochen Sprickerhof Co-authored-by: Diogo Matsubara Co-authored-by: OlivierHecart Co-authored-by: Silvio Traversaro Co-authored-by: Luca Cominardi * `z_check` and `z_null` made internal (#605) * fix: Rename `bump.bash` to `bump-and-tag.bash` * feat: Add `version.txt` and infer version in `bump-and-tag.bash` * fix: Clone repository using actions/checkout * fix: Add `CMakeFiles` to `.gitignore` * fix: Add `debug` and `release` to `.gitignore` * fix: Provide default release number for testing * fix: Don't bump deps when pattern is undefined * fix sizes of zcu_owned_matching_listener_t and z_owned_reply_t * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#330) Co-authored-by: eclipse-zenoh-bot * fix: Specify git remote when pushing the tag * fix: Require `VERSION`in `bump-and-tag.bash` * fix: Override release tag if it already exists * feat(tracing): using tracing and zenoh-util init_log (#308) * feat(tracing): using tracing and zenoh-util init_log Signed-off-by: gabrik * chore: adding Cargo.lock Signed-off-by: gabrik * chore: updated Cargo.toml.in Signed-off-by: gabrik * feat(tracing): using zenoh main branch Signed-off-by: gabrik --------- Signed-off-by: gabrik * build: Sync with eclipse-zenoh/zenoh@580f0b6 from 2024-04-11 (#335) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@23c5932 from 2024-04-16 (#337) Co-authored-by: eclipse-zenoh-bot * fix: Support jq 1.6 ubuntu-22.04 runners use jq 1.6 which doesn't recognize a dot for `[]` value iterator. See: jqlang/jq#1168. * chore: using new try_init_log_from_env Signed-off-by: gabrik * Align examples and remove reading from stdin (#255) * Remove reading from stdin, align example implementations * Add argument parsing implementation for examples * Add argument parsing to examples, format files * Replace getchar with sleep in z_pong example * Fix typo in include * Use null-pointers instead of empty strings, remove unnecessary mallocs * Free returned pointer after parse_pos_args usage * Add common and positional args parsing to z_ping example * Add formatting for parsed config options * Add const to function parameters * Update mode option help * Fix pos_args memory leak * Refactor parse_args, remove possible strcpy buffer overflow * Change parse_args function returns to const where applicable * Fix const initialization warning * Remove redundant const for value parameters * Fix buf variable memory leak * Update insert json-list config error message * Add usage example for -e and -l arguments in help * Update example notation in help message Co-authored-by: Alexander * Update example notation in help message (2/2) * Fix parameter in error message Co-authored-by: Alexander --------- Co-authored-by: Alexander * Bugfix: Unable to build z_queryable_with_channels.c (#340) Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@0283aaa from 2024-04-19 (#341) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e8916bf from 2024-04-26 (#343) Co-authored-by: eclipse-zenoh-bot * Update README and specify Rust version (#342) * Clean up the Markdown format. Signed-off-by: ChenYing Kuo * Specify Rust version in README. Signed-off-by: ChenYing Kuo --------- Signed-off-by: ChenYing Kuo * build: Sync with eclipse-zenoh/zenoh@ea604b6 from 2024-04-29 (#344) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@371ca6b from 2024-04-30 (#347) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7a47445 from 2024-05-03 (#348) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@f5195c0 from 2024-05-03 (#350) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e53364f from 2024-05-04 (#351) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@7e5d5e8 from 2024-05-07 (#355) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@b8dd01d from 2024-05-07 (#356) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@45e05f0 from 2024-05-13 (#360) Co-authored-by: eclipse-zenoh-bot * Fix build with CMAKE_BUILD_TYPE=None This is the default build type for debhelper (Debian). * build: Sync with eclipse-zenoh/zenoh@763a05f from 2024-05-14 (#363) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@75aa273 from 2024-05-15 (#364) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@25f06bd from 2024-05-21 (#369) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@3118d31 from 2024-05-28 (#399) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@009f666 from 2024-05-30 (#411) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d574654 from 2024-06-03 (#420) Co-authored-by: eclipse-zenoh-bot * chore: Update artifacts action to v4 (#421) artifacts actions v3 are deprecated * build: Sync with eclipse-zenoh/zenoh@c279982 from 2024-06-05 (#424) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@d8e66de from 2024-06-10 (#436) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@9d09742 from 2024-06-11 (#446) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@ed6c636 from 2024-06-12 (#450) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@8160b01 from 2024-06-13 (#457) Co-authored-by: eclipse-zenoh-bot * Enable releasing from any branch (#456) * build: Sync with eclipse-zenoh/zenoh@7adad94 from 2024-06-14 (#460) Co-authored-by: eclipse-zenoh-bot * Update to latest zenoh * Replace `-rc` with `-pre` and document versioning (#466) * build: Sync with eclipse-zenoh/zenoh@2500e5a from 2024-06-20 (#467) Co-authored-by: eclipse-zenoh-bot * macro generation * moved types added to decl * moved type drop * switched rust to z_moved * moved closures * build macros fixed * z_move name restored * into_rust_type for moved, payloads * tests updated * cargo fmt * moved structs in some drops/undeclares * moved as separate parameter * removed asref from moved * moved unfinished * build: Sync with eclipse-zenoh/zenoh@869ace6 from 2024-07-02 (#494) Co-authored-by: eclipse-zenoh-bot * moved type with into_rust_type trait, comiles without shm * build with shm passed * option added to some decl_c_type * clippy fix * build fix * moved types added * task moved used * build: Sync with eclipse-zenoh/zenoh@b93ca84 from 2024-07-03 (#500) Co-authored-by: eclipse-zenoh-bot * some examples fixes * macros corrected to use auto derive loaned type from owned feature * optional comma allowed in macros where forgotten * property moved get * put options move * publisher delete options made simpler * put options with moved * delete options timestamp simplified * more moved in options, timestamp simplified * examples,tests updated * tests compile fixes * fix for test failure due to calling z_moved_xxx_t destructor on unitialized memory * cargo fmt imports * build fixes * build: Sync with eclipse-zenoh/zenoh@b3e42ce from 2024-07-08 (#508) Co-authored-by: eclipse-zenoh-bot * Ensure that find_package(zenohc) can be called two times (#470) * Update CMakeLists.txt (#473) * Install zenohc.dll in /bin on Windows (#471) * build: Sync with eclipse-zenoh/zenoh@0a969cb from 2024-07-25 (#546) Co-authored-by: eclipse-zenoh-bot * build: Sync with eclipse-zenoh/zenoh@e587aa9 from 2024-07-26 (#552) Co-authored-by: eclipse-zenoh-bot * some xompile errors fixed * some build errors fixed * some build errors fixed * build fixes * cargo fmt * into_rust_type usage fixes * encoding drop fixed * restored headers * zcu renamed back to zc * zcu renamed back to zc * z_xxx_move is static inline, cpp fixes * build: Sync with eclipse-zenoh/zenoh@2d88c7b from 2024-07-29 (#556) Co-authored-by: eclipse-zenoh-bot * clang format from start * cargo fmt * macros contains funcions now, it needs types defined * removed zenoh_macros include * zenoh_macros include returned back to place * C++ build test added, fails for now * C++ enabling correction * C++ compilation for tests added * C++ build test * cargo lock update * retrun value if not void from template functions * cargo fmt * build fixes * build fix after cargo.lock update * moved types for buffer creation functions * clippy fix * clippy fix: c_char can be i8 or u8 depending on platform * headers restored * cargo fmt * -c c++ flag for clang only * c++ build fix - brackets removed * type specific take functions added, _ptr in moved * generic_take_cpp * z_take impls at the end * take funcs before generics * take moved after null * names fix * missing null functioj added * tests fixed for c++ * explicit null calls * fix generic parameter names c compilation * null call fix * misprint fixed * return removed * Rename `close` to `undeclare` for Publication Cache and Querying Subscriber * Temporarily use original pull request branch * Update to eclipse-zenoh/zenoh@ce4e9bf * Fix `z_ref_shm_client_storage_global` * Update Cargo.toml * decl_c_type corrected * cargo check run * borrow error fix * compilation fix * parse arg fix * example compilation fix * examples compile fix * examples build fixes * removed duplicated z_config_default (it's called in parsing args later) * clang format * clang format * cargo.toml restore * added underscore to _z_null and _z_check * missing functions updated * rename to z_internal_null/check * clang format fix * restored headers, corrected cargo.toml --------- Signed-off-by: gabrik Signed-off-by: ChenYing Kuo Co-authored-by: Mahmoud Mazouz Co-authored-by: Denis Biryukov Co-authored-by: eclipse-zenoh-bot <61247838+eclipse-zenoh-bot@users.noreply.github.com> Co-authored-by: eclipse-zenoh-bot Co-authored-by: Mahmoud Mazouz Co-authored-by: Gabriele Baldoni Co-authored-by: gabrik Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: ChenYing Kuo (CY) Co-authored-by: Jochen Sprickerhof Co-authored-by: Diogo Matsubara Co-authored-by: OlivierHecart Co-authored-by: Silvio Traversaro Co-authored-by: Luca Cominardi * made reliability option unstable (#612) * Update api.rst (#613) * Adopt SHM for recent API changes (#615) * Ensure build directory contains a copy of rust-toolchain.toml. When building using cargo's --manifest-path option the toolchain configuration file within the manifest directory is ignored. Ensuring a copy of the rust-toolchain.toml file is in the build directory ensures the toolchain settings are pciked up when building via cmake. * Shm ci (#593) * fix tests and examples for SHM * Add feature tests in CI * Adopt SHM for recent API changes * Update ci.yml and CMakeLists.txt * fix build for windows * build in separate directory failure fix (#617) * test for build in separate directory * builds dir from ci variable * using CI_PROJECT_DIR variable * relarive build examples * updated "time" version, suppressed "unused trait" warnings * build: Sync with eclipse-zenoh/zenoh@8b027e9 from 2024-08-22 (#619) Co-authored-by: eclipse-zenoh-bot * cargo.lock update * fix: properly apply `z_get_options_t` in `ze_querying_subscriber_get` (#621) * Revert "Merge dev1.0.0 into main" * merging error fix * build: Sync Cargo lockfile with Zenoh's --------- Signed-off-by: ChenYing Kuo Signed-off-by: gabrik Co-authored-by: Alexander Bushnev Co-authored-by: yellowhatter Co-authored-by: Michael Ilyin Co-authored-by: Denis Biryukov Co-authored-by: eclipse-zenoh-bot Co-authored-by: yellowhatter <104833606+yellowhatter@users.noreply.github.com> Co-authored-by: Jochen Sprickerhof Co-authored-by: Diogo Matsubara Co-authored-by: Mahmoud Mazouz Co-authored-by: ChenYing Kuo (CY) Co-authored-by: Luca Cominardi Co-authored-by: DenisBiryukov91 <155981813+DenisBiryukov91@users.noreply.github.com> Co-authored-by: Joseph Perez Co-authored-by: Mahmoud Mazouz Co-authored-by: Yuyuan Yuan Co-authored-by: Diogo Mendes Matsubara Co-authored-by: Silvio Traversaro Co-authored-by: Gabriele Baldoni Co-authored-by: gabrik Co-authored-by: oteffahi <70609372+oteffahi@users.noreply.github.com> Co-authored-by: Alexander Co-authored-by: OlivierHecart Co-authored-by: Geoff Martin --- .github/workflows/ci.yml | 50 +- .gitignore | 7 +- .pre-commit-config.yaml | 21 + .readthedocs.yaml | 8 + CMakeLists.txt | 31 +- Cargo.lock | 1141 +++- Cargo.toml | 36 +- Cargo.toml.in | 28 +- README.md | 9 +- build-resources/opaque-types/Cargo.lock | 3876 +++++++++++ build-resources/opaque-types/Cargo.toml | 19 + build-resources/opaque-types/src/lib.rs | 464 ++ build.rs | 1076 ++- cbindgen.toml | 4 + docs/.gitignore | 1 + docs/Doxyfile | 2854 ++++++++ docs/README.md | 22 +- docs/api.rst | 889 ++- docs/conf.py | 15 +- docs/examples.rst | 165 +- docs/requirements.txt | 3 +- examples/CMakeLists.txt | 23 + examples/parse_args.h | 13 +- examples/z_delete.c | 11 +- examples/z_get.c | 52 +- examples/z_get_liveliness.c | 33 +- examples/z_get_shm.c | 128 + examples/z_info.c | 12 +- examples/z_liveliness.c | 18 +- examples/z_non_blocking_get.c | 46 +- examples/z_ping.c | 49 +- examples/z_ping_shm.c | 183 + examples/z_pong.c | 38 +- examples/z_pub.c | 51 +- examples/z_pub_attachment.c | 63 +- examples/z_pub_cache.c | 28 +- examples/z_pub_shm.c | 128 +- examples/z_pub_shm_thr.c | 95 + examples/z_pub_thr.c | 19 +- examples/z_pull.c | 56 +- examples/z_put.c | 32 +- examples/z_query_sub.c | 37 +- examples/z_queryable.c | 86 +- examples/z_queryable_shm.c | 138 + examples/z_queryable_with_channels.c | 74 +- examples/z_scout.c | 49 +- examples/z_sub.c | 42 +- examples/z_sub_attachment.c | 61 +- examples/z_sub_liveliness.c | 32 +- examples/z_sub_shm.c | 116 + examples/z_sub_thr.c | 35 +- include/zenoh.h | 4 +- include/zenoh_commons.h | 5949 ++++++++++++----- include/zenoh_concrete.h | 113 +- include/zenoh_constants.h | 20 + include/zenoh_macros.h | 1082 ++- include/zenoh_memory.h | 4 +- install/PackageConfig.cmake.in | 2 + rust-toolchain.toml | 2 +- splitguide.yaml | 112 +- src/attachment.rs | 414 -- src/closures/hello_closure.rs | 102 +- src/closures/log_closure.rs | 187 + src/closures/matching_status_closure.rs | 124 +- src/closures/mod.rs | 10 + src/closures/query_channel.rs | 401 +- src/closures/query_closure.rs | 185 +- src/closures/reply_closure.rs | 115 +- src/closures/response_channel.rs | 397 +- src/closures/sample_channel.rs | 256 + src/closures/sample_closure.rs | 108 +- src/closures/zenohid_closure.rs | 98 +- src/collections.rs | 869 ++- src/commons.rs | 907 ++- src/config.rs | 377 +- src/context.rs | 119 + src/encoding.rs | 675 ++ src/get.rs | 552 +- src/info.rs | 76 +- src/keyexpr.rs | 875 ++- src/lib.rs | 168 +- src/liveliness.rs | 305 +- src/opaque_types/.gitkeep | 0 src/payload.rs | 951 +++ src/platform/clock.rs | 30 +- src/platform/random.rs | 5 + src/platform/sleep.rs | 3 + src/platform/synchronization.rs | 382 +- src/publication_cache.rs | 220 +- src/publisher.rs | 649 +- src/pull_subscriber.rs | 226 - src/put.rs | 371 +- src/queryable.rs | 617 +- src/querying_subscriber.rs | 401 +- src/result.rs | 32 + src/scouting.rs | 355 +- src/session.rs | 206 +- src/shm.rs | 226 - src/shm/buffer/mod.rs | 16 + src/shm/buffer/zshm.rs | 132 + src/shm/buffer/zshmmut.rs | 106 + src/shm/client/mod.rs | 16 + src/shm/client/shm_client.rs | 97 + src/shm/client/shm_segment.rs | 69 + src/shm/client_storage/mod.rs | 185 + src/shm/common/mod.rs | 15 + src/shm/common/types.rs | 27 + src/shm/mod.rs | 20 + src/shm/protocol_implementations/mod.rs | 15 + src/shm/protocol_implementations/posix/mod.rs | 17 + .../posix/posix_shm_client.rs | 26 + .../posix/posix_shm_provider.rs | 59 + .../posix/protocol_id.rs | 20 + src/shm/provider/alloc_layout.rs | 147 + src/shm/provider/alloc_layout_impl.rs | 152 + src/shm/provider/chunk.rs | 61 + src/shm/provider/mod.rs | 21 + src/shm/provider/shm_provider.rs | 218 + src/shm/provider/shm_provider_backend.rs | 102 + src/shm/provider/shm_provider_impl.rs | 203 + src/shm/provider/types.rs | 356 + src/subscriber.rs | 264 +- src/transmute.rs | 512 ++ tests/CMakeLists.txt | 38 +- tests/run_leak_check.sh | 19 + tests/z_api_alignment_test.c | 239 +- tests/z_api_attachment_test.c | 125 - tests/z_api_config_test.c | 20 +- tests/z_api_double_drop_test.c | 144 +- tests/z_api_drop_options.c | 80 + tests/z_api_encoding_test.c | 115 + tests/z_api_keyexpr_drop_test.c | 85 +- tests/z_api_keyexpr_test.c | 97 +- tests/z_api_liveliness.c | 148 + tests/z_api_null_drop_test.c | 224 +- tests/z_api_payload_test.c | 312 + tests/z_api_shm_test.c | 458 ++ tests/z_api_unitinialized_check.c | 18 +- tests/z_int_helpers.h | 13 +- tests/z_int_pub_cache_query_sub_test.c | 75 +- tests/z_int_pub_sub_attachment_test.c | 140 +- tests/z_int_pub_sub_test.c | 108 +- tests/z_int_queryable_attachment_test.c | 200 +- tests/z_int_queryable_test.c | 137 +- tests/z_leak_pub_sub_test.c | 98 + tests/z_leak_queryable_get_test.c | 131 + version.txt | 2 +- 147 files changed, 28605 insertions(+), 9026 deletions(-) create mode 100644 .pre-commit-config.yaml create mode 100644 build-resources/opaque-types/Cargo.lock create mode 100644 build-resources/opaque-types/Cargo.toml create mode 100644 build-resources/opaque-types/src/lib.rs create mode 100644 docs/Doxyfile create mode 100644 examples/z_get_shm.c create mode 100644 examples/z_ping_shm.c create mode 100644 examples/z_pub_shm_thr.c create mode 100644 examples/z_queryable_shm.c create mode 100644 examples/z_sub_shm.c create mode 100644 include/zenoh_constants.h delete mode 100644 src/attachment.rs create mode 100644 src/closures/log_closure.rs create mode 100644 src/closures/sample_channel.rs create mode 100644 src/context.rs create mode 100644 src/encoding.rs create mode 100644 src/opaque_types/.gitkeep create mode 100644 src/payload.rs delete mode 100644 src/pull_subscriber.rs create mode 100644 src/result.rs delete mode 100644 src/shm.rs create mode 100644 src/shm/buffer/mod.rs create mode 100644 src/shm/buffer/zshm.rs create mode 100644 src/shm/buffer/zshmmut.rs create mode 100644 src/shm/client/mod.rs create mode 100644 src/shm/client/shm_client.rs create mode 100644 src/shm/client/shm_segment.rs create mode 100644 src/shm/client_storage/mod.rs create mode 100644 src/shm/common/mod.rs create mode 100644 src/shm/common/types.rs create mode 100644 src/shm/mod.rs create mode 100644 src/shm/protocol_implementations/mod.rs create mode 100644 src/shm/protocol_implementations/posix/mod.rs create mode 100644 src/shm/protocol_implementations/posix/posix_shm_client.rs create mode 100644 src/shm/protocol_implementations/posix/posix_shm_provider.rs create mode 100644 src/shm/protocol_implementations/posix/protocol_id.rs create mode 100644 src/shm/provider/alloc_layout.rs create mode 100644 src/shm/provider/alloc_layout_impl.rs create mode 100644 src/shm/provider/chunk.rs create mode 100644 src/shm/provider/mod.rs create mode 100644 src/shm/provider/shm_provider.rs create mode 100644 src/shm/provider/shm_provider_backend.rs create mode 100644 src/shm/provider/shm_provider_impl.rs create mode 100644 src/shm/provider/types.rs create mode 100644 src/transmute.rs create mode 100755 tests/run_leak_check.sh delete mode 100644 tests/z_api_attachment_test.c create mode 100644 tests/z_api_drop_options.c create mode 100644 tests/z_api_encoding_test.c create mode 100644 tests/z_api_liveliness.c create mode 100644 tests/z_api_payload_test.c create mode 100644 tests/z_api_shm_test.c create mode 100644 tests/z_leak_pub_sub_test.c create mode 100644 tests/z_leak_queryable_get_test.c diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d0d841e9..dd30f1a16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,21 @@ on: schedule: - cron: "0 6 * * 1-5" +env: + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + CARGO_PROFILE_DEV_DEBUG: false + jobs: + check_format: + name: Check codebase format with clang-format + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Run clang-format dry-run + run: find include/ src/ tests/ examples/ -iname "*.h" -o -iname "*.c" | xargs clang-format -n -Werror + build: name: Build on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -16,6 +30,8 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macOS-latest, windows-latest] + shm: [false, true] + unstable: [false, true] steps: - uses: actions/checkout@v4 @@ -27,7 +43,7 @@ jobs: run: cargo clippy --all-targets --all-features -- --deny warnings - name: Run rustfmt - run: cargo fmt --check + run: cargo fmt --check -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" - name: Check for feature leaks run: cargo test --no-default-features @@ -36,22 +52,33 @@ jobs: shell: bash run: | mkdir -p build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local + cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target install --config Release + - name: Install valgrind + uses: taiki-e/install-action@valgrind + if: matrix.os == 'ubuntu-latest' + - name: Run cmake tests with zenoh-c as dynamic library shell: bash run: | cd build - cmake .. -DZENOHC_LIB_STATIC=FALSE -DCMAKE_BUILD_TYPE=Release + cmake .. -DZENOHC_LIB_STATIC=FALSE -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target tests --config Release ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_static)" + - name: Build cmake tests with C++ compiler to make sure that C API is C++ compatible + shell: bash + run: | + cd build + cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Debug -DZENOHC_BUILD_TESTS_WITH_CXX=TRUE -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} + cmake --build . --target tests --config Debug + - name: Run cmake tests with zenoh-c as static library shell: bash run: | cd build - cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Release + cmake .. -DZENOHC_LIB_STATIC=TRUE -DCMAKE_BUILD_TYPE=Release -DZENOHC_BUILD_WITH_SHARED_MEMORY=${{ matrix.shm }} -DZENOHC_BUILD_WITH_UNSTABLE_API=${{ matrix.unstable }} cmake --build . --target tests --config Release ctest -C Release --output-on-failure -E "(unit_z_api_alignment_test|build_z_build_shared)" @@ -61,24 +88,27 @@ jobs: cd build cmake --build . --target examples - - name: Build examples with zenoh-c as subbroject and static library and in debug mode + - name: Build examples with zenoh-c as subbroject and static library and in debug mode and in separate directory shell: bash run: | - mkdir -p build_examples_subproj && cd build_examples_subproj - cmake ../examples -DCMAKE_BUILD_TYPE=Debug -DZENOHC_LIB_STATIC=TRUE - cmake --build . --config Debug + mkdir -p ../build_examples + cmake -S examples -B ../build_examples -DCMAKE_BUILD_TYPE=Debug -DZENOHC_LIB_STATIC=TRUE + cmake --build ../build_examples --config Debug + rm -rf ../build_examples - name: Build examples with zenoh-c as installed package shell: bash run: | - mkdir -p build_examples_findproj && cd build_examples_findproj + mkdir -p build_examples && cd build_examples cmake ../examples -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~/local -DZENOHC_SOURCE=PACKAGE cmake --build . --config Release + cd .. && rm -rf build_examples - name: Run rust tests - run: cargo test --verbose --release --features=logger-autoinit --features=shared-memory + run: cargo test --verbose --release --features=logger-autoinit - name: Upload artifact + if: ${{ matrix.unstable == 'false' && matrix.shm == 'false' }} uses: actions/upload-artifact@v4 with: # Artifact name diff --git a/.gitignore b/.gitignore index 68a5929e8..f7b04b718 100644 --- a/.gitignore +++ b/.gitignore @@ -71,8 +71,13 @@ dkms.conf # Platform dependent generated files include/zenoh_configure.h +include/zenoh_opaque.h + +# Build resources +.build_resources* +src/opaque_types/mod.rs # CMake CMakeFiles/ debug/ -release/ \ No newline at end of file +release/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..86dc1703e --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,21 @@ +# +# Copyright (c) 2024 ZettaScale Technology +# +# This program and the accompanying materials are made available under the +# terms of the Eclipse Public License 2.0 which is available at +# http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 +# which is available at https://www.apache.org/licenses/LICENSE-2.0. +# +# SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 +# +# Contributors: +# ZettaScale Zenoh Team, +# +repos: + - repo: local + hooks: + - id: fmt + name: fmt + entry: cargo fmt -- --config "unstable_features=true,imports_granularity=Crate,group_imports=StdExternalCrate" + language: system + types: [rust] diff --git a/.readthedocs.yaml b/.readthedocs.yaml index bc2b3c653..83e88fbfa 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,6 +10,14 @@ build: os: ubuntu-22.04 tools: python: "3.11" + rust: "1.75" + apt_packages: + - cargo + jobs: + # Run cargo build to build git ignored files that are platform specific (e.g. include/zenoh_opaque.h) + pre_build: + - cargo build --release --manifest-path=./Cargo.toml --features=logger-autoinit --features=unstable --features=shared-memory + # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/CMakeLists.txt b/CMakeLists.txt index c8e4e542a..9a5885c77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,7 @@ project( VERSION ${version} DESCRIPTION "The C bindings for Zenoh" HOMEPAGE_URL "https://github.com/eclipse-zenoh/zenoh-c" - LANGUAGES C + LANGUAGES C CXX ) set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) @@ -28,7 +28,9 @@ enable_testing() # declare_cache_var_true_if_vscode(ZENOHC_BUILD_IN_SOURCE_TREE "Do build inside source tree") declare_cache_var(ZENOHC_BUILD_WITH_LOGGER_AUTOINIT TRUE BOOL "Enable logger-autoinit zenoh-c feature") -declare_cache_var(ZENOHC_BUILD_WITH_SHARED_MEMORY TRUE BOOL "Enable shared-memory zenoh-c feature") +declare_cache_var(ZENOHC_BUILD_WITH_SHARED_MEMORY FALSE BOOL "Enable shared-memory zenoh-c feature") +declare_cache_var(ZENOHC_BUILD_WITH_UNSTABLE_API TRUE BOOL "Enable unstable API feature") +declare_cache_var(ZENOHC_BUILD_TESTS_WITH_CXX FALSE BOOL "Use C++ compiler for building tests to check API's C++ compatibility") declare_cache_var(ZENOHC_CUSTOM_TARGET "" STRING "Rust target for cross compilation, 'aarch64-unknown-linux-gnu' for example") declare_cache_var(ZENOHC_CARGO_CHANNEL "" STRING "Cargo channel parameter. Should be '+stable', '+nightly' or empty value") declare_cache_var(ZENOHC_CARGO_FLAGS "" STRING "Additional cargo flags") @@ -115,6 +117,11 @@ function(configure_cargo_toml cargo_toml_dir CARGO_PROJECT_VERSION CARGO_LIB_NAM ${CMAKE_CURRENT_SOURCE_DIR}/Cargo.lock ${CMAKE_CURRENT_SOURCE_DIR}/rust-toolchain.toml DESTINATION ${cargo_toml_dir}) + file(COPY + ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh_memory.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/zenoh_constants.h + DESTINATION ${cargo_toml_dir}/include/) endif() configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Cargo.toml.in" "${cargo_toml_dir}/Cargo.toml" @ONLY) endfunction() @@ -142,6 +149,16 @@ else() configure_cargo_toml(${cargo_toml_dir_release} ${project_version} ${cargo_lib_name_release}) endif() +# +# Copy toolchain configuration to build directory to ensure it is used when cargo is invoked from a directory other +# than the directory containing the manifest file +# +if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/rust-toolchain.toml") + file(COPY + ${CMAKE_CURRENT_SOURCE_DIR}/rust-toolchain.toml + DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +endif() + # # Configure result library names # @@ -191,6 +208,11 @@ if(ZENOHC_BUILD_WITH_SHARED_MEMORY) set(cargo_flags ${cargo_flags} --features=shared-memory) endif() +if(ZENOHC_BUILD_WITH_UNSTABLE_API) + set(cargo_flags ${cargo_flags} --features=unstable) +endif() + + if(NOT(ZENOHC_CUSTOM_TARGET STREQUAL "")) set(cargo_flags ${cargo_flags} --target=${ZENOHC_CUSTOM_TARGET}) endif() @@ -270,12 +292,13 @@ endif() # Define include directories for library targets status_print(source_include_dir) status_print(cargo_generated_include_dir) -target_include_directories(zenohc_static INTERFACE ${source_include_dir}) -target_include_directories(zenohc_shared INTERFACE ${source_include_dir}) if(NOT(cargo_generated_include_dir STREQUAL ${source_include_dir})) target_include_directories(zenohc_static INTERFACE ${cargo_generated_include_dir}) target_include_directories(zenohc_shared INTERFACE ${cargo_generated_include_dir}) +else() + target_include_directories(zenohc_static INTERFACE ${source_include_dir}) + target_include_directories(zenohc_shared INTERFACE ${source_include_dir}) endif() set_target_properties(zenohc_shared zenohc_static PROPERTIES IMPORTED_GLOBAL TRUE) diff --git a/Cargo.lock b/Cargo.lock index 091f281ab..7e6b37cc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,6 +83,45 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" +[[package]] +name = "asn1-rs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "async-channel" version = "1.9.0" @@ -153,24 +192,6 @@ dependencies = [ "event-listener 2.5.3", ] -[[package]] -name = "async-process" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a9d28b1d97e08915212e2e45310d47854eafa69600756fc735fb788f75199c9" -dependencies = [ - "async-io", - "async-lock", - "autocfg", - "blocking", - "cfg-if", - "event-listener 2.5.3", - "futures-lite", - "rustix 0.37.25", - "signal-hook", - "windows-sys 0.48.0", -] - [[package]] name = "async-std" version = "1.12.0" @@ -181,7 +202,6 @@ dependencies = [ "async-global-executor", "async-io", "async-lock", - "async-process", "crossbeam-utils", "futures-channel", "futures-core", @@ -212,7 +232,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", ] [[package]] @@ -259,6 +279,12 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -327,9 +353,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "cache-padded" @@ -339,9 +365,9 @@ checksum = "981520c98f422fcc584dc1a95c334e6953900b9106bc47a9839b81790009eb21" [[package]] name = "cbindgen" -version = "0.24.5" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b922faaf31122819ec80c4047cc684c6979a087366c069611e33649bf98e18d" +checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" dependencies = [ "clap", "heck", @@ -377,6 +403,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" version = "0.4.38" @@ -437,9 +469,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62ec6771ecfa0762d24683ee5a32ad78487a3d3afdc0fb8cae19d2c5deb50b7c" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ "crossbeam-utils", ] @@ -452,18 +484,18 @@ checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "const_format" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990efc7a285731f9a4378d81aff2f0e85a2c8781a05ef0f8baa8dac54d0ff48" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e026b6ce194a874cb9cf32cd5772d1ef9767cc8fcb5765948d74f37a9d8b2bf6" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" dependencies = [ "proc-macro2", "quote", @@ -495,6 +527,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + [[package]] name = "crossbeam-utils" version = "0.8.16" @@ -531,6 +578,29 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + [[package]] name = "digest" version = "0.10.7" @@ -564,12 +634,29 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "dyn-clone" version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + [[package]] name = "equivalent" version = "1.0.1" @@ -586,6 +673,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "evalexpr" +version = "11.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b41cb9dd076076058a4523f009c900c582279536d0b2e45a29aa930e083cc5" + [[package]] name = "event-listener" version = "2.5.3" @@ -594,9 +687,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "4.0.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", @@ -644,9 +737,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -738,7 +831,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", ] [[package]] @@ -835,25 +928,22 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "half" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -944,14 +1034,134 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "idna" -version = "0.4.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -971,7 +1181,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.5", ] [[package]] @@ -1012,6 +1222,21 @@ dependencies = [ "serde", ] +[[package]] +name = "iter-read" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c397ca3ea05ad509c4ec451fea28b4771236a376ca1c69fd5143aae0cf8f93c4" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -1069,11 +1294,11 @@ dependencies = [ [[package]] name = "keyed-set" -version = "0.4.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79e110283e09081809ca488cf3a9709270c6d4d4c4a32674c39cc438366615a" +checksum = "0a3ec39d2dc17953a1540d63906a112088f79b2e46833b4ed65bc9de3904ae34" dependencies = [ - "hashbrown 0.13.2", + "hashbrown 0.14.5", ] [[package]] @@ -1096,9 +1321,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" @@ -1128,6 +1353,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.10" @@ -1138,6 +1369,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "lockfree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74ee94b5ad113c7cb98c5a040f783d0952ee4fe100993881d1673c2cb002dd23" +dependencies = [ + "owned-alloc", +] + [[package]] name = "log" version = "0.4.20" @@ -1167,9 +1407,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -1180,6 +1420,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.1" @@ -1239,6 +1485,16 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -1277,21 +1533,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -1300,9 +1561,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", "libm", @@ -1327,6 +1588,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "oid-registry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +dependencies = [ + "asn1-rs", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -1366,12 +1636,43 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "owned-alloc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" + [[package]] name = "parking" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + [[package]] name = "paste" version = "1.0.14" @@ -1389,9 +1690,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" @@ -1424,7 +1725,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", ] [[package]] @@ -1448,6 +1749,48 @@ dependencies = [ "indexmap 2.0.0", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -1483,18 +1826,18 @@ dependencies = [ [[package]] name = "pnet_base" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" +checksum = "ffc190d4067df16af3aba49b3b74c469e611cad6314676eaf1157f31aa0fb2f7" dependencies = [ "no-std-net", ] [[package]] name = "pnet_datalink" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad5854abf0067ebbd3967f7d45ebc8976ff577ff0c7bd101c4973ae3c70f98fe" +checksum = "e79e70ec0be163102a332e1d2d5586d362ad76b01cec86f830241f2b6452a7b7" dependencies = [ "ipnetwork", "libc", @@ -1505,9 +1848,9 @@ dependencies = [ [[package]] name = "pnet_sys" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "417c0becd1b573f6d544f73671070b039051e5ad819cc64aa96377b536128d00" +checksum = "7d4643d3d4db6b08741050c2f3afa9a892c4244c085a72fcda93c9c2c9a00f4b" dependencies = [ "libc", "winapi", @@ -1529,12 +1872,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-hack" version = "0.5.20+deprecated" @@ -1543,18 +1901,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "quinn" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904e3d3ba178131798c6d9375db2b13b34337d489b089fc5ba0825a2ff1bee73" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" dependencies = [ "bytes", "pin-project-lite", @@ -1569,9 +1927,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e974563a4b1c2206bbc61191ca4da9c22e4308b4c455e8906751cc7828393f08" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand", @@ -1587,9 +1945,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f0def2590301f4f667db5a77f9694fb004f82796dc1a8b1508fafa3d0e8b72" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" dependencies = [ "libc", "once_cell", @@ -1600,9 +1958,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1659,14 +2017,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -1680,13 +2038,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.4", ] [[package]] @@ -1697,9 +2055,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ring" @@ -1731,7 +2089,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ - "base64", + "base64 0.21.4", "bitflags 2.5.0", "serde", "serde_derive", @@ -1780,6 +2138,15 @@ dependencies = [ "semver", ] +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + [[package]] name = "rustix" version = "0.37.25" @@ -1809,9 +2176,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.9" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a218f0f6d05669de4eabfb24f31ce802035c952429d037507b4a4a39f0e60c5b" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ "log", "once_cell", @@ -1841,7 +2208,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" dependencies = [ - "base64", + "base64 0.21.4", "rustls-pki-types", ] @@ -1889,6 +2256,12 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" version = "1.0.15" @@ -1920,6 +2293,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" dependencies = [ "dyn-clone", + "either", "schemars_derive", "serde", "serde_json", @@ -1985,22 +2359,45 @@ checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-pickle" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762ad136a26407c6a80825813600ceeab5e613660d93d79a41f0ec877171e71" +dependencies = [ + "byteorder", + "iter-read", + "num-bigint", + "num-traits", + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", ] [[package]] @@ -2016,9 +2413,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -2060,6 +2457,12 @@ dependencies = [ "digest", ] +[[package]] +name = "sha2-const-stable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" + [[package]] name = "sha3" version = "0.10.8" @@ -2101,25 +2504,6 @@ dependencies = [ "dirs", ] -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - [[package]] name = "signature" version = "2.1.0" @@ -2130,6 +2514,12 @@ dependencies = [ "rand_core", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -2141,9 +2531,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -2190,12 +2580,80 @@ dependencies = [ "der", ] +[[package]] +name = "stabby" +version = "36.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311d6bcf0070c462ff626122ec2246f42bd2acd44b28908eedbfd07d500c7d99" +dependencies = [ + "rustversion", + "stabby-abi", +] + +[[package]] +name = "stabby-abi" +version = "36.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6daae1a0707399f56d27fce7f212e50e31d215112a447e1bbcd837ae1bf5f49" +dependencies = [ + "rustversion", + "sha2-const-stable", + "stabby-macros", +] + +[[package]] +name = "stabby-macros" +version = "36.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43cf89a0cc9131279235baf8599b0e073fbcb096419204de0cc5d1a48ae73f74" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "rand", + "syn 1.0.109", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "libc", + "parking_lot", + "parking_lot_core", + "static_init_macro", + "winapi", +] + +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "stop-token" version = "0.7.0" @@ -2233,15 +2691,26 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.33" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "tempfile" version = "3.10.1" @@ -2286,7 +2755,21 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", +] + +[[package]] +name = "thread-priority" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d3b04d33c9633b8662b167b847c7ab521f83d1ae20f2321b65b5b925e532e36" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "libc", + "log", + "rustversion", + "winapi", ] [[package]] @@ -2299,6 +2782,47 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2348,7 +2872,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", ] [[package]] @@ -2364,9 +2888,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", @@ -2384,7 +2908,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "hashbrown 0.14.0", + "hashbrown 0.14.5", "pin-project-lite", "tokio", ] @@ -2398,6 +2922,23 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap 2.0.0", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.37" @@ -2419,7 +2960,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", ] [[package]] @@ -2476,9 +3017,9 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", "bytes", @@ -2489,7 +3030,6 @@ dependencies = [ "rand", "sha1", "thiserror", - "url", "utf-8", ] @@ -2517,9 +3057,9 @@ checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" [[package]] name = "uhlc" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b6df3f3e948b40e20c38a6d1fd6d8f91b3573922fc164e068ad3331560487e" +checksum = "79ac3c37bd9506595768f0387bd39d644525728b4a1d783218acabfb56356db7" dependencies = [ "humantime", "lazy_static", @@ -2529,27 +3069,12 @@ dependencies = [ "spin 0.9.8", ] -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - [[package]] name = "unicode-ident" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-xid" version = "0.2.4" @@ -2568,6 +3093,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + [[package]] name = "unzip-n" version = "0.1.2" @@ -2581,9 +3112,9 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", "idna", @@ -2596,6 +3127,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "uuid" version = "1.4.1" @@ -2696,7 +3239,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -2730,7 +3273,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2984,35 +3527,104 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x509-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", +] + [[package]] name = "zenoh" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "ahash", "async-trait", - "base64", - "const_format", - "event-listener 4.0.0", + "base64 0.22.1", + "bytes", + "event-listener 5.3.1", "flume", "form_urlencoded", "futures", "git-version", + "itertools", "lazy_static", + "once_cell", "ordered-float", "paste", "petgraph", + "phf", "rand", "regex", "rustc_version", "serde", + "serde-pickle", + "serde_cbor", "serde_json", + "serde_yaml", "socket2 0.5.6", "stop-token", "tokio", "tokio-util", "tracing", "uhlc", + "unwrap-infallible", "uuid", "vec_map", "zenoh-buffers", @@ -3037,40 +3649,46 @@ dependencies = [ [[package]] name = "zenoh-buffers" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "zenoh-collections", ] [[package]] name = "zenoh-c" -version = "0.11.0-dev" +version = "1.0.0-dev" dependencies = [ "async-std", "async-trait", "cbindgen", "chrono", + "const_format", + "evalexpr", + "flume", "fs2", "fs_extra", "futures", "json5", "lazy_static", "libc", + "phf", "rand", + "regex", "serde_yaml", "spin 0.9.8", "tracing", + "unwrap-infallible", "zenoh", "zenoh-ext", - "zenoh-protocol", + "zenoh-runtime", "zenoh-util", ] [[package]] name = "zenoh-codec" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "serde", "tracing", @@ -3082,13 +3700,13 @@ dependencies = [ [[package]] name = "zenoh-collections" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" [[package]] name = "zenoh-config" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "flume", "json5", @@ -3098,8 +3716,10 @@ dependencies = [ "serde_json", "serde_yaml", "tracing", + "uhlc", "validated_struct", "zenoh-core", + "zenoh-macros", "zenoh-protocol", "zenoh-result", "zenoh-util", @@ -3107,8 +3727,8 @@ dependencies = [ [[package]] name = "zenoh-core" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-global-executor", "lazy_static", @@ -3119,8 +3739,8 @@ dependencies = [ [[package]] name = "zenoh-crypto" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "aes", "hmac", @@ -3132,31 +3752,29 @@ dependencies = [ [[package]] name = "zenoh-ext" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "bincode", "flume", "futures", + "phf", "serde", + "serde_cbor", + "serde_json", "tokio", "tracing", "zenoh", - "zenoh-core", "zenoh-macros", - "zenoh-result", - "zenoh-runtime", - "zenoh-sync", - "zenoh-task", "zenoh-util", ] [[package]] name = "zenoh-keyexpr" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ - "hashbrown 0.14.0", + "hashbrown 0.14.5", "keyed-set", "rand", "schemars", @@ -3167,8 +3785,8 @@ dependencies = [ [[package]] name = "zenoh-link" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "zenoh-config", @@ -3185,8 +3803,8 @@ dependencies = [ [[package]] name = "zenoh-link-commons" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "flume", @@ -3197,6 +3815,7 @@ dependencies = [ "tokio", "tokio-util", "tracing", + "webpki-roots", "zenoh-buffers", "zenoh-codec", "zenoh-config", @@ -3209,11 +3828,11 @@ dependencies = [ [[package]] name = "zenoh-link-quic" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", - "base64", + "base64 0.22.1", "futures", "quinn", "rustls", @@ -3226,6 +3845,8 @@ dependencies = [ "tokio-util", "tracing", "webpki-roots", + "x509-parser", + "zenoh-collections", "zenoh-config", "zenoh-core", "zenoh-link-commons", @@ -3238,10 +3859,11 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", + "socket2 0.5.6", "tokio", "tokio-util", "tracing", @@ -3256,22 +3878,25 @@ dependencies = [ [[package]] name = "zenoh-link-tls" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", - "base64", + "base64 0.22.1", "futures", "rustls", "rustls-pemfile", "rustls-pki-types", "rustls-webpki", "secrecy", + "socket2 0.5.6", "tokio", "tokio-rustls", "tokio-util", "tracing", "webpki-roots", + "x509-parser", + "zenoh-collections", "zenoh-config", "zenoh-core", "zenoh-link-commons", @@ -3284,8 +3909,8 @@ dependencies = [ [[package]] name = "zenoh-link-udp" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "socket2 0.5.6", @@ -3305,8 +3930,8 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "futures", @@ -3325,8 +3950,8 @@ dependencies = [ [[package]] name = "zenoh-link-ws" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", "futures-util", @@ -3346,21 +3971,20 @@ dependencies = [ [[package]] name = "zenoh-macros" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", "zenoh-keyexpr", ] [[package]] name = "zenoh-plugin-trait" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ - "const_format", "libloading", "serde", "serde_json", @@ -3373,30 +3997,31 @@ dependencies = [ [[package]] name = "zenoh-protocol" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "const_format", "rand", "serde", "uhlc", "zenoh-buffers", + "zenoh-collections", "zenoh-keyexpr", "zenoh-result", ] [[package]] name = "zenoh-result" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "anyhow", ] [[package]] name = "zenoh-runtime" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "futures", "lazy_static", @@ -3404,29 +4029,40 @@ dependencies = [ "ron", "serde", "tokio", - "zenoh-collections", "zenoh-macros", "zenoh-result", ] [[package]] name = "zenoh-shm" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ + "async-trait", + "bincode", + "crc", + "lockfree", + "num-traits", + "rand", "serde", "shared_memory", + "stabby", + "static_init", + "thread-priority", + "tokio", "tracing", "zenoh-buffers", + "zenoh-core", + "zenoh-macros", "zenoh-result", ] [[package]] name = "zenoh-sync" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ - "event-listener 4.0.0", + "event-listener 5.3.1", "futures", "tokio", "zenoh-buffers", @@ -3437,8 +4073,8 @@ dependencies = [ [[package]] name = "zenoh-task" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "futures", "tokio", @@ -3450,11 +4086,13 @@ dependencies = [ [[package]] name = "zenoh-transport" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ "async-trait", + "crossbeam-utils", "flume", + "lazy_static", "lz4_flex", "paste", "rand", @@ -3483,11 +4121,11 @@ dependencies = [ [[package]] name = "zenoh-util" -version = "0.11.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#e66745ebdf70f01bf01ba60f69bc902b917b2d24" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" dependencies = [ - "async-std", "async-trait", + "const_format", "flume", "home", "humantime", @@ -3495,6 +4133,8 @@ dependencies = [ "libc", "libloading", "pnet_datalink", + "serde", + "serde_json", "shellexpand", "tokio", "tracing", @@ -3521,7 +4161,28 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.52", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", ] [[package]] @@ -3529,3 +4190,25 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] diff --git a/Cargo.toml b/Cargo.toml index 9b8c2e457..865011179 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ # [package] name = "zenoh-c" -version = "0.11.0-dev" +version = "1.0.0-dev" repository = "https://github.com/eclipse-zenoh/zenoh-c" homepage = "http://zenoh.io" authors = [ @@ -32,7 +32,12 @@ build = "build.rs" [features] logger-autoinit = [] -shared-memory = ["zenoh/shared-memory"] +shared-memory = [ + "zenoh/shared-memory", + "dep:zenoh-ext", + "zenoh-ext/shared-memory", +] +unstable = ["zenoh/unstable", "zenoh-ext/unstable", "dep:zenoh-ext"] default = ["zenoh/default"] [badges] @@ -41,28 +46,35 @@ maintenance = { status = "actively-developed" } [dependencies] async-std = "=1.12.0" async-trait = "0.1.66" -chrono = "0.4.34" +chrono = "0.4.37" futures = "0.3.26" json5 = "0.4.1" lazy_static = "1.4.0" libc = "0.2.139" +tracing = "0.1" rand = "0.8.5" spin = "0.9.5" -# shared-memory enabled for zenoh even if zenoh-c "shared-memory" feature is disabled. This is to make "std::mem::transmute" work for `ZSLice` -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["shared-memory", "unstable"], default-features = false } -zenoh-protocol = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["shared-memory"] } -zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["unstable"] } -tracing = "0.1" +unwrap-infallible = "0.1.5" +const_format = "0.2.32" +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = [ + "internal", +] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +flume = "*" [build-dependencies] -cbindgen = "0.24.3" +cbindgen = "0.26.0" fs2 = "0.4.3" +regex = "1.7.1" serde_yaml = "0.9.19" fs_extra = "1.3.0" +evalexpr = "11.3.0" +phf = { version = "0.11.2", features = ["macros"] } [lib] -path="src/lib.rs" +path = "src/lib.rs" name = "zenohc" crate-type = ["cdylib", "staticlib"] doctest = false @@ -80,7 +92,7 @@ maintainer = "zenoh-dev@eclipse.org" copyright = "2017, 2022 ZettaScale Technology" section = "net" license-file = ["LICENSE", "0"] -depends = "libzenohc (=0.11.0-dev-1)" +depends = "libzenohc (=1.0.0~dev-1)" assets = [["include/*", "usr/include/", "755"]] [profile.dev] diff --git a/Cargo.toml.in b/Cargo.toml.in index 9d288115f..7ecac40d5 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -32,7 +32,8 @@ build = "@CARGO_PROJECT_DIR@build.rs" [features] logger-autoinit = [] -shared-memory = ["zenoh/shared-memory"] +shared-memory = ["zenoh/shared-memory", "dep:zenoh-ext", "zenoh-ext/shared-memory"] +unstable = ["zenoh/unstable", "zenoh-ext/unstable", "dep:zenoh-ext"] default = ["zenoh/default"] [badges] @@ -41,28 +42,33 @@ maintenance = { status = "actively-developed" } [dependencies] async-std = "=1.12.0" async-trait = "0.1.66" -chrono = "0.4.34" +chrono = "0.4.37" futures = "0.3.26" json5 = "0.4.1" lazy_static = "1.4.0" libc = "0.2.139" +tracing = "0.1" rand = "0.8.5" spin = "0.9.5" -# shared-memory enabled for zenoh even if zenoh-c "shared-memory" feature is disabled. This is to make "std::mem::transmute" work for `ZSLice` -zenoh = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["shared-memory", "unstable"], default-features = false } -zenoh-protocol = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["shared-memory"] } -zenoh-util = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-ext = { version = "0.11.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", features = ["unstable"] } -tracing = "0.1" +unwrap-infallible = "0.1.5" +const_format = "0.2.32" +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" , optional = true } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +flume = "*" [build-dependencies] -cbindgen = "0.24.3" +cbindgen = "0.26.0" fs2 = "0.4.3" +regex = "1.7.1" serde_yaml = "0.9.19" fs_extra = "1.3.0" +evalexpr = "11.3.0" +phf = { version = "0.11.2", features = ["macros"] } [lib] -path="@CARGO_PROJECT_DIR@src/lib.rs" +path = "@CARGO_PROJECT_DIR@src/lib.rs" name = "@CARGO_LIB_NAME@" crate-type = ["cdylib", "staticlib"] doctest = false @@ -80,7 +86,7 @@ maintainer = "zenoh-dev@eclipse.org" copyright = "2017, 2022 ZettaScale Technology" section = "net" license-file = ["LICENSE", "0"] -depends = "libzenohc (=0.11.0-dev-1)" +depends = "libzenohc (=1.0.0~dev-1)" assets = [["include/*", "usr/include/", "755"]] [profile.dev] diff --git a/README.md b/README.md index 3da32ebbc..5ff72b19a 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,13 @@ This repository provides a C binding based on the main [Zenoh implementation wri cmake --build . ``` + Unstable api and/or shared memory support can be enabled by setting repectively `ZENOHC_BUILD_WITH_UNSTABLE_API` and `ZENOHC_BUILD_WITH_SHARED_MEMORY` Cmake flags to `true` during configuration step. + + ```bash + cmake -DZENOHC_BUILD_WITH_UNSTABLE_API=true -DZENOHC_BUILD_WITH_SHARED_MEMORY=true ../zenoh-c + cmake --build . --config Release + ``` + [build-configurations]: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations [Visual Studio generators]: https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html#id14 [Ninja Multi-Config]: https://cmake.org/cmake/help/latest/generator/Ninja%20Multi-Config.html @@ -206,7 +213,7 @@ Finally, we strongly advise that you refrain from using structure field that sta ## Logging -By default, zenoh-c enables Zenoh's logging library upon using the `z_open` or `z_scout` functions. This behavior can be disabled by adding `-DDISABLE_LOGGER_AUTOINIT:bool=true` to the `cmake` configuration command. The logger may then be manually re-enabled with the `zc_init_logger` function. +By default, zenoh-c enables Zenoh's logging library upon using the `z_open` or `z_scout` functions. This behavior can be disabled by adding `-DDISABLE_LOGGER_AUTOINIT:bool=true` to the `cmake` configuration command. The logger may then be manually re-enabled with the `zc_init_logging` function. ## Cross-Compilation diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock new file mode 100644 index 000000000..f577d8c69 --- /dev/null +++ b/build-resources/opaque-types/Cargo.lock @@ -0,0 +1,3876 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "array-init" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" + +[[package]] +name = "asn1-rs" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22ad1373757efa0f70ec53939aabc7152e1591cb485208052993070ac8d2429d" +dependencies = [ + "asn1-rs-derive", + "asn1-rs-impl", + "displaydoc", + "nom", + "num-traits", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "asn1-rs-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7378575ff571966e99a744addeff0bff98b8ada0dedf1956d59e634db95eaac1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", +] + +[[package]] +name = "asn1-rs-impl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "async-channel" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" +dependencies = [ + "concurrent-queue", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-executor" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fa3dc5f2a8564f07759c008b9109dc0d39de92a88d5588b8a5036d286383afb" +dependencies = [ + "async-lock", + "async-task", + "concurrent-queue", + "fastrand", + "futures-lite", + "slab", +] + +[[package]] +name = "async-global-executor" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +dependencies = [ + "async-channel", + "async-executor", + "async-io", + "async-lock", + "blocking", + "futures-lite", + "once_cell", + "tokio", +] + +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", + "futures-lite", + "log", + "parking", + "polling", + "rustix", + "slab", + "socket2 0.4.9", + "waker-fn", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + +[[package]] +name = "async-task" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "atomic-waker" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +dependencies = [ + "serde", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "blocking" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77231a1c8f801696fc0123ec6150ce92cffb8e164a02afb9c8ddee0e9b65ad65" +dependencies = [ + "async-channel", + "async-lock", + "async-task", + "atomic-waker", + "fastrand", + "futures-lite", + "log", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" + +[[package]] +name = "cache-padded" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "981520c98f422fcc584dc1a95c334e6953900b9106bc47a9839b81790009eb21" + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "const_format" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "data-encoding" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "der-parser" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cd0a5c643689626bec213c4d8bd4d96acc8ffdb4ad4bb6bc16abf27d5f4b553" +dependencies = [ + "asn1-rs", + "displaydoc", + "nom", + "num-bigint", + "num-traits", + "rusticata-macros", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "dyn-clone" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "5.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "spin 0.9.8", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" + +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" + +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + +[[package]] +name = "futures-macro" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "futures-sink" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" + +[[package]] +name = "futures-task" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" + +[[package]] +name = "futures-util" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" + +[[package]] +name = "git-version" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899" +dependencies = [ + "git-version-macro", + "proc-macro-hack", +] + +[[package]] +name = "git-version-macro" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "idna" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +dependencies = [ + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "ipnetwork" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf466541e9d546596ee94f9f69590f89473455f88372423e0008fc1a7daf100e" +dependencies = [ + "serde", +] + +[[package]] +name = "iter-read" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c397ca3ea05ad509c4ec451fea28b4771236a376ca1c69fd5143aae0cf8f93c4" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "keyed-set" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a3ec39d2dc17953a1540d63906a112088f79b2e46833b4ed65bc9de3904ae34" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] + +[[package]] +name = "libc" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libloading" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "libm" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + +[[package]] +name = "lock_api" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "lockfree" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74ee94b5ad113c7cb98c5a040f783d0952ee4fe100993881d1673c2cb002dd23" +dependencies = [ + "owned-alloc", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "lz4_flex" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ea9b256699eda7b0387ffbc776dd625e28bde3918446381781245b7a50349d8" +dependencies = [ + "twox-hash", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom", +] + +[[package]] +name = "nix" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if", + "libc", + "memoffset", +] + +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "libc", +] + +[[package]] +name = "no-std-net" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", + "libm", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +dependencies = [ + "memchr", +] + +[[package]] +name = "oid-registry" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +dependencies = [ + "asn1-rs", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-types" +version = "0.1.0" +dependencies = [ + "const_format", + "flume", + "zenoh", + "zenoh-ext", + "zenoh-protocol", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "ordered-float" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "536900a8093134cf9ccf00a27deb3532421099e958d9dd431135d0c7543ca1e8" +dependencies = [ + "num-traits", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "owned-alloc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30fceb411f9a12ff9222c5f824026be368ff15dc2f13468d850c7d3f502205d6" + +[[package]] +name = "parking" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14f2252c834a40ed9bb5422029649578e63aa341ac401f74e719dd1afda8394e" + +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall", + "smallvec", + "winapi", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bee7be22ce7918f641a33f08e3f43388c7656772244e2bbb2477f44cc9021a" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1511785c5e98d79a05e8a6bc34b4ac2168a0e3e92161862030ad84daa223141" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "pest_meta" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42f0394d3123e33353ca5e1e89092e533d2cc490389f2bd6131c43c634ebc5f" +dependencies = [ + "once_cell", + "pest", + "sha2", +] + +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared", + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pnet_base" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc190d4067df16af3aba49b3b74c469e611cad6314676eaf1157f31aa0fb2f7" +dependencies = [ + "no-std-net", +] + +[[package]] +name = "pnet_datalink" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79e70ec0be163102a332e1d2d5586d362ad76b01cec86f830241f2b6452a7b7" +dependencies = [ + "ipnetwork", + "libc", + "pnet_base", + "pnet_sys", + "winapi", +] + +[[package]] +name = "pnet_sys" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d4643d3d4db6b08741050c2f3afa9a892c4244c085a72fcda93c9c2c9a00f4b" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg", + "bitflags 1.3.2", + "cfg-if", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro-hack" +version = "0.5.20+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls", + "rustls-platform-verifier", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2 0.5.6", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "ring" +version = "0.17.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "ringbuffer-spsc" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd1938faa63a2362ee1747afb2d10567d0fb1413b9cbd6198a8541485c4f773" +dependencies = [ + "array-init", + "cache-padded", +] + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.4", + "bitflags 2.5.0", + "serde", + "serde_derive", +] + +[[package]] +name = "rsa" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ab43bb47d23c1a631b4b680199a45255dce26fa9ab2fa902581f624ff13e6a8" +dependencies = [ + "byteorder", + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-iter", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rusticata-macros" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faf0c4a6ece9950b9abdb62b1cfcf2a68b3b67a10ba445b3bb85be2a293d0632" +dependencies = [ + "nom", +] + +[[package]] +name = "rustix" +version = "0.37.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4eb579851244c2c03e7c24f501c3432bed80b8f720af1d6e5b0e0f01555a035" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustls" +version = "0.23.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35e4980fa29e4c4b212ffb3db068a564cbf560e51d3944b7c88bd8bf5bec64f4" +dependencies = [ + "base64 0.21.4", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + +[[package]] +name = "rustls-platform-verifier" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5f0d26fa1ce3c790f9590868f0109289a044acb954525f933e2aa3b871c157d" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-roots", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" + +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "schemars" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763f8cd0d4c71ed8389c90cb8100cba87e763bd01a8e614d4f0af97bcd50a161" +dependencies = [ + "dyn-clone", + "either", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0f696e21e10fa546b7ffb1c9672c6de8fbc7a81acf59524386d8639bf12737" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "serde", + "zeroize", +] + +[[package]] +name = "security-framework" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "core-foundation-sys", + "libc", + "num-bigint", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-pickle" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762ad136a26407c6a80825813600ceeab5e613660d93d79a41f0ec877171e71" +dependencies = [ + "byteorder", + "iter-read", + "num-bigint", + "num-traits", + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2-const-stable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f179d4e11094a893b82fff208f74d448a7512f99f5a0acbd5c679b705f83ed9" + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shared_memory" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba8593196da75d9dc4f69349682bd4c2099f8cde114257d1ef7ef1b33d1aba54" +dependencies = [ + "cfg-if", + "libc", + "nix 0.23.2", + "rand", + "win-sys", +] + +[[package]] +name = "shellexpand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +dependencies = [ + "dirs", +] + +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "stabby" +version = "36.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311d6bcf0070c462ff626122ec2246f42bd2acd44b28908eedbfd07d500c7d99" +dependencies = [ + "rustversion", + "stabby-abi", +] + +[[package]] +name = "stabby-abi" +version = "36.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6daae1a0707399f56d27fce7f212e50e31d215112a447e1bbcd837ae1bf5f49" +dependencies = [ + "rustversion", + "sha2-const-stable", + "stabby-macros", +] + +[[package]] +name = "stabby-macros" +version = "36.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43cf89a0cc9131279235baf8599b0e073fbcb096419204de0cc5d1a48ae73f74" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "rand", + "syn 1.0.109", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "static_init" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a2a1c578e98c1c16fc3b8ec1328f7659a500737d7a0c6d625e73e830ff9c1f6" +dependencies = [ + "bitflags 1.3.2", + "cfg_aliases", + "libc", + "parking_lot", + "parking_lot_core", + "static_init_macro", + "winapi", +] + +[[package]] +name = "static_init_macro" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a2595fc3aa78f2d0e45dd425b22282dd863273761cc77780914b2cf3003acf" +dependencies = [ + "cfg_aliases", + "memchr", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "stop-token" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af91f480ee899ab2d9f8435bfdfc14d08a5754bd9d3fef1f1a1c23336aad6c8b" +dependencies = [ + "async-channel", + "cfg-if", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "thiserror" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "thread-priority" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d3b04d33c9633b8662b167b847c7ab521f83d1ae20f2321b65b5b925e532e36" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "libc", + "log", + "rustversion", + "winapi", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "token-cell" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a2b964fdb303b08a4eab04d7c1bad2bca33f8eee334ccd28802f1041c6eb87" +dependencies = [ + "paste", +] + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2 0.5.6", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.23.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "futures-util", + "hashbrown", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "serde", + "serde_json", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", + "tracing-serde", +] + +[[package]] +name = "tungstenite" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "utf-8", +] + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uhlc" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79ac3c37bd9506595768f0387bd39d644525728b4a1d783218acabfb56356db7" +dependencies = [ + "humantime", + "lazy_static", + "log", + "rand", + "serde", + "spin 0.9.8", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "unwrap-infallible" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "151ac09978d3c2862c4e39b557f4eceee2cc72150bc4cb4f16abf061b6e381fb" + +[[package]] +name = "unzip-n" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e7e85a0596447f0f2ac090e16bc4c516c6fe91771fb0c0ccf7fa3dae896b9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "url" +version = "2.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +dependencies = [ + "getrandom", +] + +[[package]] +name = "validated_struct" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feef04c049b4beae3037a2a31b8da40d8cebec0b97456f24c7de0ede4ed9efed" +dependencies = [ + "json5", + "serde", + "serde_json", + "validated_struct_macros", +] + +[[package]] +name = "validated_struct_macros" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d4444a980afa9ef0d29c2a3f4d952ec0495a7a996a9c78b52698b71bc21edb4" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unzip-n", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "waker-fn" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" + +[[package]] +name = "walkdir" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "webpki-roots" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "win-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b7b128a98c1cfa201b09eb49ba285887deb3cbe7466a98850eb1adabb452be5" +dependencies = [ + "windows", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45296b64204227616fdbf2614cefa4c236b98ee64dfaaaa435207ed99fe7829f" +dependencies = [ + "windows_aarch64_msvc 0.34.0", + "windows_i686_gnu 0.34.0", + "windows_i686_msvc 0.34.0", + "windows_x86_64_gnu 0.34.0", + "windows_x86_64_msvc 0.34.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "x509-parser" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcbc162f30700d6f3f82a24bf7cc62ffe7caea42c0b2cba8bf7f3ae50cf51f69" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", +] + +[[package]] +name = "zenoh" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "ahash", + "async-trait", + "base64 0.22.1", + "bytes", + "event-listener 5.3.1", + "flume", + "form_urlencoded", + "futures", + "git-version", + "itertools", + "lazy_static", + "once_cell", + "ordered-float", + "paste", + "petgraph", + "phf", + "rand", + "regex", + "rustc_version", + "serde", + "serde-pickle", + "serde_cbor", + "serde_json", + "serde_yaml", + "socket2 0.5.6", + "stop-token", + "tokio", + "tokio-util", + "tracing", + "uhlc", + "unwrap-infallible", + "uuid", + "vec_map", + "zenoh-buffers", + "zenoh-codec", + "zenoh-collections", + "zenoh-config", + "zenoh-core", + "zenoh-crypto", + "zenoh-keyexpr", + "zenoh-link", + "zenoh-macros", + "zenoh-plugin-trait", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-shm", + "zenoh-sync", + "zenoh-task", + "zenoh-transport", + "zenoh-util", +] + +[[package]] +name = "zenoh-buffers" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "zenoh-collections", +] + +[[package]] +name = "zenoh-codec" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "serde", + "tracing", + "uhlc", + "zenoh-buffers", + "zenoh-protocol", + "zenoh-shm", +] + +[[package]] +name = "zenoh-collections" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" + +[[package]] +name = "zenoh-config" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "flume", + "json5", + "num_cpus", + "secrecy", + "serde", + "serde_json", + "serde_yaml", + "tracing", + "uhlc", + "validated_struct", + "zenoh-core", + "zenoh-macros", + "zenoh-protocol", + "zenoh-result", + "zenoh-util", +] + +[[package]] +name = "zenoh-core" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-global-executor", + "lazy_static", + "tokio", + "zenoh-result", + "zenoh-runtime", +] + +[[package]] +name = "zenoh-crypto" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "aes", + "hmac", + "rand", + "rand_chacha", + "sha3", + "zenoh-result", +] + +[[package]] +name = "zenoh-ext" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "bincode", + "flume", + "futures", + "phf", + "serde", + "serde_cbor", + "serde_json", + "tokio", + "tracing", + "zenoh", + "zenoh-macros", + "zenoh-util", +] + +[[package]] +name = "zenoh-keyexpr" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "hashbrown", + "keyed-set", + "rand", + "schemars", + "serde", + "token-cell", + "zenoh-result", +] + +[[package]] +name = "zenoh-link" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "zenoh-config", + "zenoh-link-commons", + "zenoh-link-quic", + "zenoh-link-tcp", + "zenoh-link-tls", + "zenoh-link-udp", + "zenoh-link-unixsock_stream", + "zenoh-link-ws", + "zenoh-protocol", + "zenoh-result", +] + +[[package]] +name = "zenoh-link-commons" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "flume", + "futures", + "rustls", + "rustls-webpki", + "serde", + "tokio", + "tokio-util", + "tracing", + "webpki-roots", + "zenoh-buffers", + "zenoh-codec", + "zenoh-config", + "zenoh-core", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-util", +] + +[[package]] +name = "zenoh-link-quic" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "base64 0.22.1", + "futures", + "quinn", + "rustls", + "rustls-pemfile", + "rustls-pki-types", + "rustls-webpki", + "secrecy", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", + "x509-parser", + "zenoh-collections", + "zenoh-config", + "zenoh-core", + "zenoh-link-commons", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-sync", + "zenoh-util", +] + +[[package]] +name = "zenoh-link-tcp" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "socket2 0.5.6", + "tokio", + "tokio-util", + "tracing", + "zenoh-core", + "zenoh-link-commons", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-sync", + "zenoh-util", +] + +[[package]] +name = "zenoh-link-tls" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "base64 0.22.1", + "futures", + "rustls", + "rustls-pemfile", + "rustls-pki-types", + "rustls-webpki", + "secrecy", + "socket2 0.5.6", + "tokio", + "tokio-rustls", + "tokio-util", + "tracing", + "webpki-roots", + "x509-parser", + "zenoh-collections", + "zenoh-config", + "zenoh-core", + "zenoh-link-commons", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-sync", + "zenoh-util", +] + +[[package]] +name = "zenoh-link-udp" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "socket2 0.5.6", + "tokio", + "tokio-util", + "tracing", + "zenoh-buffers", + "zenoh-collections", + "zenoh-core", + "zenoh-link-commons", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-sync", + "zenoh-util", +] + +[[package]] +name = "zenoh-link-unixsock_stream" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "futures", + "nix 0.27.1", + "tokio", + "tokio-util", + "tracing", + "uuid", + "zenoh-core", + "zenoh-link-commons", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-sync", +] + +[[package]] +name = "zenoh-link-ws" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "futures-util", + "tokio", + "tokio-tungstenite", + "tokio-util", + "tracing", + "url", + "zenoh-core", + "zenoh-link-commons", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-sync", + "zenoh-util", +] + +[[package]] +name = "zenoh-macros" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "zenoh-keyexpr", +] + +[[package]] +name = "zenoh-plugin-trait" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "libloading", + "serde", + "serde_json", + "tracing", + "zenoh-keyexpr", + "zenoh-macros", + "zenoh-result", + "zenoh-util", +] + +[[package]] +name = "zenoh-protocol" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "const_format", + "rand", + "serde", + "uhlc", + "zenoh-buffers", + "zenoh-collections", + "zenoh-keyexpr", + "zenoh-result", +] + +[[package]] +name = "zenoh-result" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "anyhow", +] + +[[package]] +name = "zenoh-runtime" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "futures", + "lazy_static", + "libc", + "ron", + "serde", + "tokio", + "zenoh-macros", + "zenoh-result", +] + +[[package]] +name = "zenoh-shm" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "bincode", + "crc", + "lockfree", + "num-traits", + "rand", + "serde", + "shared_memory", + "stabby", + "static_init", + "thread-priority", + "tokio", + "tracing", + "zenoh-buffers", + "zenoh-core", + "zenoh-macros", + "zenoh-result", +] + +[[package]] +name = "zenoh-sync" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "event-listener 5.3.1", + "futures", + "tokio", + "zenoh-buffers", + "zenoh-collections", + "zenoh-core", + "zenoh-runtime", +] + +[[package]] +name = "zenoh-task" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "futures", + "tokio", + "tokio-util", + "tracing", + "zenoh-core", + "zenoh-runtime", +] + +[[package]] +name = "zenoh-transport" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "crossbeam-utils", + "flume", + "lazy_static", + "lz4_flex", + "paste", + "rand", + "ringbuffer-spsc", + "rsa", + "serde", + "sha3", + "tokio", + "tokio-util", + "tracing", + "zenoh-buffers", + "zenoh-codec", + "zenoh-collections", + "zenoh-config", + "zenoh-core", + "zenoh-crypto", + "zenoh-link", + "zenoh-protocol", + "zenoh-result", + "zenoh-runtime", + "zenoh-shm", + "zenoh-sync", + "zenoh-task", + "zenoh-util", +] + +[[package]] +name = "zenoh-util" +version = "1.0.0-dev" +source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=dev/1.0.0#7f7d648e76c46f0584d56405c5f162892278d610" +dependencies = [ + "async-trait", + "const_format", + "flume", + "home", + "humantime", + "lazy_static", + "libc", + "libloading", + "pnet_datalink", + "serde", + "serde_json", + "shellexpand", + "tokio", + "tracing", + "tracing-subscriber", + "winapi", + "zenoh-core", + "zenoh-result", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] diff --git a/build-resources/opaque-types/Cargo.toml b/build-resources/opaque-types/Cargo.toml new file mode 100644 index 000000000..bedb5107f --- /dev/null +++ b/build-resources/opaque-types/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "opaque-types" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[features] +shared-memory = ["zenoh/shared-memory", "dep:zenoh-ext", "zenoh-ext/shared-memory", "zenoh-protocol/shared-memory"] +unstable = ["zenoh/unstable", "zenoh-ext/unstable", "dep:zenoh-ext"] +panic = [] # The whole purpose of this project is to generate set of compilation panic messages with calculated structure sizes. To do it the "panic" feature should be set. By default we just want to check if build is successful. +default = ["zenoh/default"] + +[dependencies] +zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0", optional = true} +zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "dev/1.0.0" } +const_format = "0.2.32" +flume = "*" diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs new file mode 100644 index 000000000..c837ce488 --- /dev/null +++ b/build-resources/opaque-types/src/lib.rs @@ -0,0 +1,464 @@ +#![allow(unused_doc_comments)] +use core::ffi::c_void; +use std::{ + sync::{Arc, Condvar, Mutex, MutexGuard}, + thread::JoinHandle, +}; + +use zenoh::{ + bytes::{Encoding, ZBytes, ZBytesIterator, ZBytesReader, ZBytesWriter}, + config::Config, + handlers::RingChannelHandler, + key_expr::KeyExpr, + pubsub::{Publisher, Subscriber}, + query::{Query, Queryable, Reply, ReplyError}, + sample::Sample, + scouting::Hello, + session::Session, + time::Timestamp, +}; +#[cfg(feature = "unstable")] +use zenoh::{ + liveliness::LivelinessToken, + pubsub::MatchingListener, + sample::SourceInfo, + session::{EntityGlobalId, ZenohId}, +}; +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +use zenoh::{ + shm::zshm, shm::zshmmut, shm::AllocLayout, shm::BufAllocResult, shm::ChunkAllocResult, + shm::ChunkDescriptor, shm::DynamicProtocolID, shm::MemoryLayout, shm::PosixShmProviderBackend, + shm::ProtocolID, shm::ShmClient, shm::ShmClientStorage, shm::ShmProvider, + shm::ShmProviderBackend, shm::StaticProtocolID, shm::ZLayoutError, shm::ZShm, shm::ZShmMut, + shm::POSIX_PROTOCOL_ID, +}; + +#[macro_export] +macro_rules! get_opaque_type_data { + ($src_type:ty, $name:ident) => { + const _: () = { + use const_format::concatcp; + const DST_NAME: &str = stringify!($name); + const ALIGN: usize = std::mem::align_of::<$src_type>(); + const SIZE: usize = std::mem::size_of::<$src_type>(); + const INFO_MESSAGE: &str = + concatcp!("type: ", DST_NAME, ", align: ", ALIGN, ", size: ", SIZE); + #[cfg(feature = "panic")] + panic!("{}", INFO_MESSAGE); + }; + }; +} + +/// A serialized Zenoh data. +/// +/// To minimize copies and reallocations, Zenoh may provide data in several separate buffers. +get_opaque_type_data!(ZBytes, z_owned_bytes_t); +/// A loaned serialized Zenoh data. +get_opaque_type_data!(ZBytes, z_loaned_bytes_t); + +pub struct CSlice { + _data: *const u8, + _len: usize, + _drop: Option, + _context: *mut c_void, +} + +get_opaque_type_data!(CSlice, z_owned_slice_t); +/// A contiguous sequence of bytes owned by some other entity. +get_opaque_type_data!(CSlice, z_view_slice_t); +/// A loaned sequence of bytes. +get_opaque_type_data!(CSlice, z_loaned_slice_t); + +/// The wrapper type for strings allocated by Zenoh. +get_opaque_type_data!(CSlice, z_owned_string_t); +/// The view over a string. +get_opaque_type_data!(CSlice, z_view_string_t); +/// A loaned string. +get_opaque_type_data!(CSlice, z_loaned_string_t); + +/// An array of maybe-owned non-null terminated strings. +/// +get_opaque_type_data!(Option>, z_owned_string_array_t); +/// A loaned string array. +get_opaque_type_data!(Vec, z_loaned_string_array_t); + +/// An owned Zenoh sample. +/// +/// This is a read only type that can only be constructed by cloning a `z_loaned_sample_t`. +/// Like all owned types, it should be freed using z_drop or z_sample_drop. +get_opaque_type_data!(Option, z_owned_sample_t); +/// A loaned Zenoh sample. +get_opaque_type_data!(Sample, z_loaned_sample_t); + +/// A reader for serialized data. +get_opaque_type_data!(ZBytesReader<'static>, z_bytes_reader_t); + +/// A writer for serialized data. +get_opaque_type_data!(ZBytesWriter<'static>, z_bytes_writer_t); + +/// An iterator over multi-element serialized data +get_opaque_type_data!(ZBytesIterator<'static, ZBytes>, z_bytes_iterator_t); + +/// The encoding of Zenoh data. +get_opaque_type_data!(Encoding, z_owned_encoding_t); +/// A loaned Zenoh encoding. +get_opaque_type_data!(Encoding, z_loaned_encoding_t); + +/// An owned reply from a Queryable to a `z_get()`. +get_opaque_type_data!(Option, z_owned_reply_t); +/// A loaned reply. +get_opaque_type_data!(Reply, z_loaned_reply_t); + +/// A Zenoh reply error a compination of reply error payload and its encoding. +get_opaque_type_data!(ReplyError, z_owned_reply_err_t); +/// A loaned Zenoh reply error. +get_opaque_type_data!(ReplyError, z_loaned_reply_err_t); + +/// An owned Zenoh query received by a queryable. +/// +/// Queries are atomically reference-counted, letting you extract them from the callback that handed them to you by cloning. +get_opaque_type_data!(Option, z_owned_query_t); +/// A loaned Zenoh query. +get_opaque_type_data!(Query, z_loaned_query_t); + +/// An owned Zenoh queryable . +/// +/// Responds to queries sent via `z_get()` with intersecting key expression. +get_opaque_type_data!(Option>, z_owned_queryable_t); +/// A loaned Zenoh queryable. +get_opaque_type_data!(Queryable<'static, ()>, z_loaned_queryable_t); +#[cfg(feature = "unstable")] +/// An owned Zenoh querying subscriber. +/// +/// In addition to receiving the data it is subscribed to, +/// it also will fetch data from a Queryable at startup and peridodically (using `ze_querying_subscriber_get()`). +get_opaque_type_data!( + Option<(zenoh_ext::FetchingSubscriber<'static, ()>, &'static Session)>, + ze_owned_querying_subscriber_t +); +#[cfg(feature = "unstable")] +/// A loaned Zenoh querying subscriber. +get_opaque_type_data!( + (zenoh_ext::FetchingSubscriber<'static, ()>, &'static Session), + ze_loaned_querying_subscriber_t +); + +/// A Zenoh-allocated key expression . +/// +/// Key expressions can identify a single key or a set of keys. +/// +/// Examples : +/// - ``"key/expression"``. +/// - ``"key/ex*"``. +/// +/// Key expressions can be mapped to numerical ids through `z_declare_keyexpr` +/// for wire and computation efficiency. +/// +/// Internally key expressiobn can be either: +/// - A plain string expression. +/// - A pure numerical id. +/// - The combination of a numerical prefix and a string suffix. +get_opaque_type_data!(Option>, z_owned_keyexpr_t); +/// A user allocated string, viewed as a key expression. +get_opaque_type_data!(Option>, z_view_keyexpr_t); + +/// A loaned key expression. +/// +/// Key expressions can identify a single key or a set of keys. +/// +/// Examples : +/// - ``"key/expression"``. +/// - ``"key/ex*"``. +/// +/// Using `z_declare_keyexpr` allows Zenoh to optimize a key expression, +/// both for local processing and network-wise. +get_opaque_type_data!(KeyExpr<'static>, z_loaned_keyexpr_t); + +/// An owned Zenoh session. +get_opaque_type_data!(Option>, z_owned_session_t); +/// A loaned Zenoh session. +get_opaque_type_data!(Arc, z_loaned_session_t); + +/// An owned Zenoh configuration. +get_opaque_type_data!(Option, z_owned_config_t); +/// A loaned Zenoh configuration. +get_opaque_type_data!(Config, z_loaned_config_t); + +#[cfg(feature = "unstable")] +/// A Zenoh ID. +/// +/// In general, valid Zenoh IDs are LSB-first 128bit unsigned and non-zero integers. +get_opaque_type_data!(ZenohId, z_id_t); + +/// A Zenoh timestamp . +/// +/// It consists of a time generated by a Hybrid Logical Clock (HLC) in NPT64 format and a unique zenoh identifier. +get_opaque_type_data!(Timestamp, z_timestamp_t); + +/// An owned Zenoh publisher . +get_opaque_type_data!(Option>, z_owned_publisher_t); +/// A loaned Zenoh publisher. +get_opaque_type_data!(Publisher<'static>, z_loaned_publisher_t); + +#[cfg(feature = "unstable")] +/// An owned Zenoh matching listener. +/// +/// A listener that sends notifications when the [`MatchingStatus`] of a publisher changes. +/// Dropping the corresponding publisher, also drops matching listener. +get_opaque_type_data!( + Option>, + zc_owned_matching_listener_t +); + +/// An owned Zenoh subscriber . +/// +/// Receives data from publication on intersecting key expressions. +/// Destroying the subscriber cancels the subscription. +get_opaque_type_data!(Option>, z_owned_subscriber_t); +/// A loaned Zenoh subscriber. +get_opaque_type_data!(Subscriber<'static, ()>, z_loaned_subscriber_t); + +#[cfg(feature = "unstable")] +/// A liveliness token that can be used to provide the network with information about connectivity to its +/// declarer: when constructed, a PUT sample will be received by liveliness subscribers on intersecting key +/// expressions. +/// +/// A DELETE on the token's key expression will be received by subscribers if the token is destroyed, or if connectivity between the subscriber and the token's creator is lost. +get_opaque_type_data!( + Option>, + zc_owned_liveliness_token_t +); +#[cfg(feature = "unstable")] +get_opaque_type_data!(LivelinessToken<'static>, zc_loaned_liveliness_token_t); +#[cfg(feature = "unstable")] +/// An owned Zenoh publication cache. +/// +/// Used to store publications on intersecting key expressions. Can be queried later via `z_get()` to retrieve this data +/// (for example by `ze_owned_querying_subscriber_t`). +get_opaque_type_data!( + Option>, + ze_owned_publication_cache_t +); +#[cfg(feature = "unstable")] +/// A loaned Zenoh publication cache. +get_opaque_type_data!( + zenoh_ext::PublicationCache<'static>, + ze_loaned_publication_cache_t +); + +/// An owned mutex. +get_opaque_type_data!( + Option<(Mutex<()>, Option>)>, + z_owned_mutex_t +); +/// A loaned mutex. +get_opaque_type_data!( + (Mutex<()>, Option>), + z_loaned_mutex_t +); + +/// An owned conditional variable. +/// +/// Used in combination with `z_owned_mutex_t` to wake up thread when certain conditions are met. +get_opaque_type_data!(Option, z_owned_condvar_t); +/// A loaned conditional variable. +get_opaque_type_data!(Condvar, z_loaned_condvar_t); + +/// An owned Zenoh task. +get_opaque_type_data!(Option>, z_owned_task_t); + +/// An owned Zenoh-allocated hello message returned by a Zenoh entity to a scout message sent with `z_scout()`. +get_opaque_type_data!(Option, z_owned_hello_t); +/// A loaned hello message. +get_opaque_type_data!(Hello, z_loaned_hello_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned SHM Client +get_opaque_type_data!(Option>, z_owned_shm_client_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned list of SHM Clients +get_opaque_type_data!( + Option)>>, + zc_owned_shm_client_list_t +); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned list of SHM Clients +get_opaque_type_data!( + Vec<(ProtocolID, Arc)>, + zc_loaned_shm_client_list_t +); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned SHM Client Storage +get_opaque_type_data!(Option>, z_owned_shm_client_storage_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned SHM Client Storage +get_opaque_type_data!(Arc, z_loaned_shm_client_storage_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned MemoryLayout +get_opaque_type_data!(Option, z_owned_memory_layout_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned MemoryLayout +get_opaque_type_data!(MemoryLayout, z_loaned_memory_layout_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned ChunkAllocResult +get_opaque_type_data!(Option, z_owned_chunk_alloc_result_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned ChunkAllocResult +get_opaque_type_data!(ChunkAllocResult, z_loaned_chunk_alloc_result_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned ZShm slice +get_opaque_type_data!(Option, z_owned_shm_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned ZShm slice +get_opaque_type_data!(zshm, z_loaned_shm_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned ZShmMut slice +get_opaque_type_data!(Option, z_owned_shm_mut_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned ZShmMut slice +get_opaque_type_data!(zshmmut, z_loaned_shm_mut_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +#[derive(Debug)] +#[repr(C)] +struct DummyCallbacks { + alloc_fn: unsafe extern "C" fn(), + free_fn: unsafe extern "C" fn(), + defragment_fn: unsafe extern "C" fn() -> usize, + available_fn: unsafe extern "C" fn() -> usize, + layout_for_fn: unsafe extern "C" fn(), +} + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +#[derive(Debug)] +#[repr(C)] +struct DummyContext { + context: *mut c_void, + delete_fn: unsafe extern "C" fn(*mut c_void), +} + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +#[derive(Debug)] +struct DummySHMProviderBackend { + context: DummyContext, + callbacks: DummyCallbacks, +} + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +impl ShmProviderBackend for DummySHMProviderBackend { + fn alloc(&self, layout: &MemoryLayout) -> ChunkAllocResult { + todo!() + } + + fn free(&self, chunk: &ChunkDescriptor) { + todo!() + } + + fn defragment(&self) -> usize { + todo!() + } + + fn available(&self) -> usize { + todo!() + } + + fn layout_for(&self, layout: MemoryLayout) -> Result { + todo!() + } +} + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +type DummySHMProvider = ShmProvider; + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +type PosixSHMProvider = ShmProvider, PosixShmProviderBackend>; + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +enum CDummySHMProvider { + Posix(PosixSHMProvider), + Dynamic(DummySHMProvider), +} + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned ShmProvider +get_opaque_type_data!(Option, z_owned_shm_provider_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned ShmProvider +get_opaque_type_data!(CDummySHMProvider, z_loaned_shm_provider_t); + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +type PosixAllocLayout = + AllocLayout<'static, StaticProtocolID, PosixShmProviderBackend>; + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +type DummyDynamicAllocLayout = AllocLayout<'static, DynamicProtocolID, DummySHMProviderBackend>; + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +enum CSHMLayout { + Posix(PosixAllocLayout), + Dynamic(DummyDynamicAllocLayout), +} + +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// An owned ShmProvider's AllocLayout +get_opaque_type_data!(Option, z_owned_alloc_layout_t); +#[cfg(all(feature = "shared-memory", feature = "unstable"))] +/// A loaned ShmProvider's AllocLayout +get_opaque_type_data!(CSHMLayout, z_loaned_alloc_layout_t); + +/// An owned Zenoh fifo sample handler. +get_opaque_type_data!( + Option>, + z_owned_fifo_handler_sample_t +); +/// An loaned Zenoh fifo sample handler. +get_opaque_type_data!(flume::Receiver, z_loaned_fifo_handler_sample_t); + +/// An owned Zenoh ring sample handler. +get_opaque_type_data!( + Option>, + z_owned_ring_handler_sample_t +); +/// An loaned Zenoh ring sample handler. +get_opaque_type_data!(RingChannelHandler, z_loaned_ring_handler_sample_t); + +/// An owned Zenoh fifo query handler. +get_opaque_type_data!(Option>, z_owned_fifo_handler_query_t); +/// An loaned Zenoh fifo query handler. +get_opaque_type_data!(flume::Receiver, z_loaned_fifo_handler_query_t); + +/// An owned Zenoh ring query handler. +get_opaque_type_data!( + Option>, + z_owned_ring_handler_query_t +); +/// An loaned Zenoh ring query handler. +get_opaque_type_data!(RingChannelHandler, z_loaned_ring_handler_query_t); + +/// An owned Zenoh fifo reply handler. +get_opaque_type_data!(Option>, z_owned_fifo_handler_reply_t); +/// An loaned Zenoh fifo reply handler. +get_opaque_type_data!(flume::Receiver, z_loaned_fifo_handler_reply_t); + +/// An owned Zenoh ring reply handler. +get_opaque_type_data!( + Option>, + z_owned_ring_handler_reply_t +); +/// An loaned Zenoh ring reply handler. +get_opaque_type_data!(RingChannelHandler, z_loaned_ring_handler_reply_t); + +#[cfg(feature = "unstable")] +/// An owned Zenoh-allocated source info`. +get_opaque_type_data!(SourceInfo, z_owned_source_info_t); +#[cfg(feature = "unstable")] +/// A loaned source info. +get_opaque_type_data!(SourceInfo, z_loaned_source_info_t); +#[cfg(feature = "unstable")] +/// An entity gloabal id. +get_opaque_type_data!(EntityGlobalId, z_entity_global_id_t); diff --git a/build.rs b/build.rs index 66267e883..5aa58e2e7 100644 --- a/build.rs +++ b/build.rs @@ -1,17 +1,24 @@ -use fs2::FileExt; -use std::env; -use std::io::{Read, Write}; +use core::panic; use std::{ borrow::Cow, - collections::HashMap, - io::BufWriter, + collections::{HashMap, HashSet}, + env, + fs::File, + io::{BufRead, BufWriter, Read, Write}, path::{Path, PathBuf}, + process::{Command, Stdio}, }; +use fs2::FileExt; +use phf::phf_map; +use regex::Regex; + +const BUGGY_GENERATION_PATH: &str = "include/zenoh-gen-buggy.h"; const GENERATION_PATH: &str = "include/zenoh-gen.h"; +const PREPROCESS_PATH: &str = "include/zenoh-cpp.h"; const SPLITGUIDE_PATH: &str = "splitguide.yaml"; const HEADER: &str = r"// -// Copyright (c) 2022 ZettaScale Technology +// Copyright (c) 2024 ZettaScale Technology // // This program and the accompanying materials are made available under the // terms of the Eclipse Public License 2.0 which is available at @@ -23,16 +30,44 @@ const HEADER: &str = r"// // Contributors: // ZettaScale Zenoh Team, // +// clang-format off #ifdef DOCS #define ALIGN(n) #define ZENOHC_API #endif "; +static RUST_TO_C_FEATURES: phf::Map<&'static str, &'static str> = phf_map! { + "unstable" => "UNSTABLE", + "shared-memory" => "SHARED_MEMORY", +}; + +fn fix_cbindgen(input: &str, output: &str) { + let bindings = std::fs::read_to_string(input).expect("failed to open input file"); + let bindings = bindings.replace("\n#endif\n ;", ";\n#endif"); + + let mut out = File::create(output).expect("failed to open output file"); + out.write_all(bindings.as_bytes()).unwrap(); +} + +fn preprocess_header(input: &str, output: &str) { + let parsed = process_feature_defines(input).expect("failed to open input file"); + let mut out = File::create(output).expect("failed to open output file"); + out.write_all(parsed.as_bytes()).unwrap(); +} + fn main() { + generate_opaque_types(); cbindgen::generate(std::env::var("CARGO_MANIFEST_DIR").unwrap()) .expect("Unable to generate bindings") - .write_to_file(GENERATION_PATH); + .write_to_file(BUGGY_GENERATION_PATH); + + fix_cbindgen(BUGGY_GENERATION_PATH, GENERATION_PATH); + std::fs::remove_file(BUGGY_GENERATION_PATH).unwrap(); + + preprocess_header(GENERATION_PATH, PREPROCESS_PATH); + create_generics_header(PREPROCESS_PATH, "include/zenoh_macros.h"); + std::fs::remove_file(PREPROCESS_PATH).unwrap(); configure(); let split_guide = SplitGuide::from_yaml(SPLITGUIDE_PATH); @@ -50,9 +85,164 @@ fn main() { println!("cargo:rerun-if-changed=src"); println!("cargo:rerun-if-changed=splitguide.yaml"); println!("cargo:rerun-if-changed=cbindgen.toml"); + println!("cargo:rerun-if-changed=build-resources"); println!("cargo:rerun-if-changed=include"); } +fn get_build_rs_path() -> PathBuf { + let file_path = file!(); + let mut path_buf = PathBuf::new(); + path_buf.push(file_path); + path_buf.parent().unwrap().to_path_buf() +} + +fn produce_opaque_types_data() -> PathBuf { + let target = env::var("TARGET").unwrap(); + let current_folder = get_build_rs_path(); + let manifest_path = current_folder.join("./build-resources/opaque-types/Cargo.toml"); + let output_file_path = current_folder.join("./.build_resources_opaque_types.txt"); + let out_file = std::fs::File::create(output_file_path.clone()).unwrap(); + let stdio = Stdio::from(out_file); + + #[allow(unused_mut)] + let mut feature_args: Vec<&str> = vec!["-F", "panic"]; // enable output structure sizes in panic messages during build + for (rust_feature, _c_feature) in RUST_TO_C_FEATURES.entries() { + if test_feature(rust_feature) { + feature_args.push("-F"); + feature_args.push(rust_feature); + } + } + + let _ = Command::new("cargo") + .arg("build") + .args(feature_args) + .arg("--target") + .arg(target) + .arg("--manifest-path") + .arg(manifest_path) + .stderr(stdio) + .output() + .unwrap(); + + output_file_path +} + +fn split_type_name(type_name: &str) -> (&str, Option<&str>, &str, &str) { + let mut split = type_name.split('_'); + let prefix = split + .next() + .unwrap_or_else(|| panic!("Fist '_' not found in type name: {type_name}")); + let cat = split + .next() + .unwrap_or_else(|| panic!("Second '_' not found in type name: {type_name}")); + let category = if cat != "owned" && cat != "loaned" && cat != "moved" { + None + } else { + Some(cat) + }; + let postfix = split.next_back().expect("Type should end with '_t'"); + let prefix_cat_len = prefix.len() + 1 + category.map(|c| c.len() + 1).unwrap_or(0); + let semantic = &type_name[prefix_cat_len..type_name.len() - postfix.len() - 1]; + (prefix, category, semantic, postfix) +} + +fn generate_opaque_types() { + let type_to_inner_field_name = HashMap::from([("z_id_t", "pub id")]); + let current_folder = get_build_rs_path(); + let path_in = produce_opaque_types_data(); + let path_out = current_folder.join("./src/opaque_types/mod.rs"); + + let data_in = std::fs::read_to_string(path_in).unwrap(); + let mut data_out = String::new(); + let mut docs = get_opaque_type_docs(); + + let re = Regex::new(r"type: (\w+), align: (\d+), size: (\d+)").unwrap(); + for (_, [type_name, align, size]) in re.captures_iter(&data_in).map(|c| c.extract()) { + let inner_field_name = type_to_inner_field_name.get(type_name).unwrap_or(&"_0"); + let (prefix, category, semantic, postfix) = split_type_name(type_name); + let mut s = String::new(); + if category != Some("owned") { + s += "#[derive(Copy, Clone)]\n"; + }; + s += format!( + "#[repr(C, align({align}))] +pub struct {type_name} {{ + {inner_field_name}: [u8; {size}], +}} +" + ) + .as_str(); + if category == Some("owned") { + let moved_type_name = format!("{}_{}_{}_{}", prefix, "moved", semantic, postfix); + // Note: owned type {type_name} should implement "Default" trait, this is + // done by "decl_c_type!" macro in transmute module. + s += format!( + "#[repr(C)] +#[derive(Default)] +pub struct {moved_type_name} {{ + _this: {type_name}, +}} + +impl crate::transmute::TakeCType for {moved_type_name} {{ + type CType = {type_name}; + fn take_c_type(&mut self) -> Self::CType {{ + std::mem::take(&mut self._this) + }} +}} + +impl Drop for {type_name} {{ + fn drop(&mut self) {{ + use crate::transmute::RustTypeRef; + std::mem::take(self.as_rust_type_mut()); + }} +}} +" + ) + .as_str(); + } + + let doc = docs + .remove(type_name) + .unwrap_or_else(|| panic!("Failed to extract docs for opaque type: {type_name}")); + for d in doc { + data_out += &d; + data_out += "\r\n"; + } + data_out += &s; + } + // todo: in order to support rust features in opaque_types, we should respect features here. + // I will remove it for a while, maybe we'll implement this later + //for d in docs.keys() { + // panic!("Failed to find type information for opaque type: {d}"); + //} + std::fs::write(path_out, data_out).unwrap(); +} + +fn get_opaque_type_docs() -> HashMap> { + let current_folder = get_build_rs_path(); + let path_in = current_folder.join("./build-resources/opaque-types/src/lib.rs"); + let re = Regex::new(r"(?m)^get_opaque_type_data!\(\s*(.*)\s*,\s*(\w+)\s*(,)?\s*\);").unwrap(); + let mut comments = Vec::new(); + let mut opaque_lines = Vec::new(); + let mut res = HashMap::new(); + + for line in std::fs::read_to_string(path_in).unwrap().lines() { + if line.starts_with("///") { + comments.push(line.to_string()); + continue; + } + if line.starts_with("get_opaque_type_data!(") || !opaque_lines.is_empty() { + opaque_lines.push(line); + } + if !opaque_lines.is_empty() && line.ends_with(");") { + let joined_lines = std::mem::take(&mut opaque_lines).join(""); + let capture = re.captures(&joined_lines).expect("invalid opaque type"); + res.insert(capture[2].to_string(), std::mem::take(&mut comments)); + } + } + res +} + // See: https://github.com/rust-lang/cargo/issues/9661 // See: https://github.com/rust-lang/cargo/issues/545 fn cargo_target_dir() -> PathBuf { @@ -93,6 +283,12 @@ fn configure() { .unwrap(); file.lock_exclusive().unwrap(); file.write_all(content.as_bytes()).unwrap(); + for (rust_feature, c_feature) in RUST_TO_C_FEATURES.entries() { + if test_feature(rust_feature) { + file.write_all(format!("#define {}\n", c_feature).as_bytes()) + .unwrap(); + } + } file.unlock().unwrap(); } @@ -207,6 +403,16 @@ impl SplitGuide { name, rules .into_iter() + .filter_map(|s| { + let mut split = s.split('#'); + let val = split.next().unwrap(); + for feature in split { + if !test_feature(feature) { + return None; + } + } + Some(val.to_owned()) + }) .map(|mut s| match s.as_str() { ":functions" => SplitRule::Brand(RecordType::Function), ":typedefs" => SplitRule::Brand(RecordType::Typedef), @@ -642,3 +848,859 @@ impl<'a> Iterator for Tokenizer<'a> { } } } + +#[derive(Clone, Debug)] +pub struct Ctype { + typename: String, +} + +impl Ctype { + pub fn new(typename: &str) -> Self { + Ctype { + typename: typename.to_owned(), + } + } + + pub fn without_cv(self) -> Self { + Ctype { + typename: self.typename.replace("const ", ""), + } + } + + pub fn without_ptr(self) -> Self { + Ctype { + typename: self.typename.replace(['*', '&'], ""), + } + } + + pub fn with_ref(self) -> Self { + Ctype { + typename: self.typename.replace('*', "&"), + } + } + + pub fn decay(self) -> Self { + self.without_cv().without_ptr() + } +} + +#[derive(Clone, Debug)] +pub struct FuncArg { + typename: Ctype, + name: String, +} + +impl FuncArg { + pub fn new(typename: &str, name: &str) -> Self { + FuncArg { + typename: Ctype::new(typename), + name: name.to_owned(), + } + } +} +#[derive(Clone, Debug)] +pub struct FunctionSignature { + entity_name: String, // the signifcant part of name, e.g. `session` for `z_session_t` + return_type: Ctype, + func_name: String, + args: Vec, +} + +impl FunctionSignature { + pub fn new( + entity_name: &str, + return_type: &str, + func_name: String, + args: Vec, + ) -> Self { + FunctionSignature { + entity_name: entity_name.to_owned(), + return_type: Ctype::new(return_type), + func_name, + args, + } + } +} + +pub fn create_generics_header(path_in: &str, path_out: &str) { + let mut file_out = std::fs::File::options() + .read(false) + .write(true) + .truncate(true) + .append(false) + .create(true) + .open(path_out) + .unwrap(); + + file_out + .write_all( + "#pragma once +// clang-format off + +" + .as_bytes(), + ) + .unwrap(); + + // + // C part + // + file_out + .write_all( + " +#ifndef __cplusplus + +" + .as_bytes(), + ) + .unwrap(); + + // Collect all function signatures to be wrappeb by macros and verify that all necessary functions are present for each entity + let (move_funcs, take_funcs) = make_move_take_signatures(path_in); + let loan_funcs = find_loan_functions(path_in); + let loan_mut_funcs = find_loan_mut_functions(path_in); + let drop_funcs = find_drop_functions(path_in); + let null_funcs = find_null_functions(path_in); + let check_funcs = find_check_functions(path_in); + let call_funcs = find_call_functions(path_in); + let recv_funcs = find_recv_functions(path_in); + + let drops = drop_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let moves = move_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let takes = take_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let nulls = null_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + let checks = check_funcs + .iter() + .map(|f| &f.entity_name) + .collect::>(); + + let mut msgs = Vec::new(); + + // More checks can be added here + + if drops != nulls { + msgs.push(format!( + "the list of z_xxx_drop and z_internal_xxx_null functions are different:\n missing z_internal_xxx_null for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&nulls), + nulls.difference(&drops) + )); + } + + if drops != checks { + msgs.push(format!( + "the list of z_xxx_drop and z_internal_xxx_check functions are different:\n missing z_internal_xxx_check for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&checks), + checks.difference(&drops) + )); + } + + if drops != moves { + msgs.push(format!( + "the list of z_xxx_drop and z_xxx_move functions are different:\n missing z_xxx_move for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&moves), + moves.difference(&drops) + )); + } + + if drops != takes { + msgs.push(format!( + "the list of z_xxx_drop and z_xxx_take functions are different:\n missing z_xxx_take for {:?}\n missing z_xxx_drop for {:?}", + drops.difference(&takes), + takes.difference(&drops) + )); + } + + if !msgs.is_empty() { + panic!("Some functions are missing:\n{}", msgs.join("\n")); + } + + let out = generate_move_functions_c(&move_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_c(&loan_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_mut_c(&loan_mut_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_drop_c(&drop_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_move_c(&move_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_null_c(&null_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_take_functions(&take_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_take_c(&take_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_check_c(&check_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_call_c(&call_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_closure_c(&call_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_recv_c(&recv_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + + // + // C++ part + // + file_out + .write_all("\n#else // #ifndef __cplusplus\n".as_bytes()) + .unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_move_functions_cpp(&move_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_cpp(&loan_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_mut_cpp(&loan_mut_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_drop_cpp(&drop_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_move_cpp(&move_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_null_cpp(&null_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_take_functions(&take_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_take_cpp(&take_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_check_cpp(&check_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_call_cpp(&call_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_closure_cpp(&call_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_recv_cpp(&recv_funcs); + file_out.write_all(out.as_bytes()).unwrap(); + file_out.write_all("\n\n".as_bytes()).unwrap(); + + let out = generate_generic_loan_to_owned_type_cpp(&[loan_funcs, loan_mut_funcs].concat()); + file_out.write_all(out.as_bytes()).unwrap(); + + file_out + .write_all("\n#endif // #ifndef __cplusplus\n\n".as_bytes()) + .unwrap(); +} + +pub fn make_move_take_signatures( + path_in: &str, +) -> (Vec, Vec) { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"(\w+)_drop\(struct (\w+) \*(\w+)\);").unwrap(); + let mut move_funcs = Vec::::new(); + let mut take_funcs = Vec::::new(); + + for (_, [func_name_prefix, arg_type, arg_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + let (prefix, _, semantic, postfix) = split_type_name(arg_type); + let z_owned_type = format!("{}_{}_{}_{}*", prefix, "owned", semantic, postfix); + let z_moved_type = format!("{}_{}_{}_{}*", prefix, "moved", semantic, postfix); + let move_f = FunctionSignature::new( + semantic, + &z_moved_type, + func_name_prefix.to_string() + "_move", + vec![FuncArg::new(&z_owned_type, arg_name)], + ); + let take_f = FunctionSignature::new( + semantic, + "void", + func_name_prefix.to_string() + "_take", + vec![ + FuncArg::new(&z_owned_type, arg_name), + FuncArg::new(&z_moved_type, "x"), + ], + ); + move_funcs.push(move_f); + take_funcs.push(take_f); + } + (move_funcs, take_funcs) +} + +pub fn find_loan_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"const struct (\w+) \*(\w+)_loan\(const struct (\w+) \*(\w+)\);").unwrap(); + let mut res = Vec::::new(); + + for (_, [return_type, func_name, arg_type, arg_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + &("const ".to_string() + return_type + "*"), + func_name.to_string() + "_loan", + vec![FuncArg::new( + &("const ".to_string() + arg_type + "*"), + arg_name, + )], + ); + res.push(f); + } + res +} + +pub fn find_loan_mut_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"struct (\w+) \*(\w+)_loan_mut\(struct (\w+) \*(\w+)\);").unwrap(); + let mut res = Vec::::new(); + + for (_, [return_type, func_name, arg_type, arg_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + &(return_type.to_string() + "*"), + func_name.to_string() + "_loan_mut", + vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], + ); + res.push(f); + } + res +} + +pub fn find_drop_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"(.+?) +(\w+_drop)\(struct (\w+) \*(\w+)\);").unwrap(); + let mut res = Vec::::new(); + + for (_, [return_type, func_name, arg_type, arg_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + // if necessary, other prefixes like "extern", "static", etc. can be removed here + let return_type = return_type + .split(' ') + .filter(|x| *x != "ZENOHC_API") + .collect::>() + .join(" "); + let (_, _, semantic, _) = split_type_name(arg_type); + let arg_type = arg_type.to_string() + "*"; + let f = FunctionSignature::new( + semantic, + return_type.as_str(), + func_name.to_string(), + vec![FuncArg::new(&arg_type, arg_name)], + ); + res.push(f); + } + res +} + +pub fn find_null_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r" (z.?_internal_\w+_null)\(struct (\w+) \*(\w+)\);").unwrap(); + let mut res = Vec::::new(); + + for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + "void", + func_name.to_string(), + vec![FuncArg::new(&(arg_type.to_string() + "*"), arg_name)], + ); + res.push(f); + } + res +} + +pub fn find_check_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"bool (z.?_internal_\w+_check)\(const struct (\w+) \*(\w+)\);").unwrap(); + let mut res = Vec::::new(); + + for (_, [func_name, arg_type, arg_name]) in re.captures_iter(&bindings).map(|c| c.extract()) { + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + "bool", + func_name.to_string(), + vec![FuncArg::new( + &("const ".to_string() + arg_type + "*"), + arg_name, + )], + ); + res.push(f); + } + res +} + +pub fn find_call_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new( + r"(\w+) (\w+)_call\(const struct (\w+) \*(\w+),\s+(\w*)\s*struct (\w+) (\*?)(\w+)\);", + ) + .unwrap(); + let mut res = Vec::::new(); + + for ( + _, + [return_type, func_name, closure_type, closure_name, arg_cv, arg_type, arg_deref, arg_name], + ) in re.captures_iter(&bindings).map(|c| c.extract()) + { + let arg_cv: String = if arg_cv.is_empty() { + "".to_string() + } else { + "const ".to_string() + }; + let (_, _, semantic, _) = split_type_name(arg_type); + let f = FunctionSignature::new( + semantic, + return_type, + func_name.to_string() + "_call", + vec![ + FuncArg::new(&("const ".to_string() + closure_type + "*"), closure_name), + FuncArg::new(&(arg_cv + arg_type + arg_deref), arg_name), + ], + ); + res.push(f); + } + res +} + +pub fn find_recv_functions(path_in: &str) -> Vec { + let bindings = std::fs::read_to_string(path_in).unwrap(); + let re = Regex::new(r"(\w+)\s+z_(\w+)_handler_(\w+)_recv\(const\s+struct\s+(\w+)\s+\*(\w+),\s+struct\s+(\w+)\s+\*(\w+)\);").unwrap(); + let mut res = Vec::::new(); + + for (_, [return_type, handler_type, value_type, arg1_type, arg1_name, arg2_type, arg2_name]) in + re.captures_iter(&bindings).map(|c| c.extract()) + { + let (_, _, semantic, _) = split_type_name(arg1_type); + let f = FunctionSignature::new( + semantic, + return_type, + "z_".to_string() + handler_type + "_handler_" + value_type + "_recv", + vec![ + FuncArg::new(&("const ".to_string() + arg1_type + "*"), arg1_name), + FuncArg::new(&(arg2_type.to_string() + "*"), arg2_name), + ], + ); + res.push(f); + } + res +} + +pub fn generate_generic_c( + macro_func: &[FunctionSignature], + generic_name: &str, + decay: bool, +) -> String { + let va_args = macro_func + .iter() + .any(|f| f.args.len() != macro_func[0].args.len()); + let mut args = macro_func + .first() + .unwrap_or_else(|| panic!("no sigatures found for building generic {generic_name}")) + .args + .iter() + .map(|a| a.name.to_string()) + .collect::>(); + let mut out = if va_args { + format!( + "#define {generic_name}({}, ...) \\ + _Generic(({})", + args.join(", "), + args[0], + ) + } else { + format!( + "#define {generic_name}({}) \\ + _Generic(({})", + args.join(", "), + args[0], + ) + }; + if decay { + args[0] = format!("&{}", args[0]); + } + + for func in macro_func { + let owned_type = if decay { + func.args[0].typename.clone().decay().typename + } else { + func.args[0].typename.typename.clone() + }; + let func_name = &func.func_name; + out += ", \\\n"; + out += &format!(" {owned_type} : {func_name}"); + } + out += " \\\n"; + if va_args { + out += &format!(" )({}, __VA_ARGS__)", args.join(", ")); + } else { + out += &format!(" )({})", args.join(", ")); + } + out +} + +pub fn generate_generic_loan_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_loan", true) +} + +pub fn generate_generic_loan_mut_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_loan_mut", true) +} + +pub fn generate_generic_move_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_move", true) +} + +pub fn generate_generic_take_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_take", false) +} + +pub fn generate_generic_drop_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_drop", false) +} + +pub fn generate_take_functions(macro_func: &[FunctionSignature]) -> String { + let mut out = String::new(); + for sig in macro_func { + let (prefix, _, semantic, _) = split_type_name(&sig.args[0].typename.typename); + out += &format!( + "static inline void {}({} {}, {} {}) {{ *{} = {}->_this; {}_internal_{}_null(&{}->_this); }}\n", + sig.func_name, + sig.args[0].typename.typename, + sig.args[0].name, + sig.args[1].typename.typename, + sig.args[1].name, + sig.args[0].name, + sig.args[1].name, + prefix, + semantic, + sig.args[1].name, + ); + } + out +} + +pub fn generate_move_functions_c(macro_func: &[FunctionSignature]) -> String { + let mut out = String::new(); + for sig in macro_func { + out += &format!( + "static inline {} {}({} x) {{ return ({})(x); }}\n", + sig.return_type.typename, + sig.func_name, + sig.args[0].typename.typename, + sig.return_type.typename + ); + } + out +} + +pub fn generate_move_functions_cpp(macro_func: &[FunctionSignature]) -> String { + let mut out = String::new(); + for sig in macro_func { + out += &format!( + "static inline {} {}({} x) {{ return reinterpret_cast<{}>(x); }}\n", + sig.return_type.typename, + sig.func_name, + sig.args[0].typename.typename, + sig.return_type.typename + ); + } + out +} + +pub fn generate_generic_null_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_internal_null", false) +} + +pub fn generate_generic_check_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_internal_check", true) +} + +pub fn generate_generic_call_c(macro_func: &[FunctionSignature]) -> String { + generate_generic_c(macro_func, "z_call", false) +} + +pub fn generate_generic_recv_c(macro_func: &[FunctionSignature]) -> String { + let try_recv_funcs: Vec = macro_func + .iter() + .filter(|f| f.func_name.contains("try_recv")) + .cloned() + .collect(); + let recv_funcs: Vec = macro_func + .iter() + .filter(|f| !f.func_name.contains("try_recv")) + .cloned() + .collect(); + generate_generic_c(&try_recv_funcs, "z_try_recv", false) + + "\n\n" + + generate_generic_c(&recv_funcs, "z_recv", false).as_str() +} + +pub fn generate_generic_closure_c(_macro_func: &[FunctionSignature]) -> String { + "#define z_closure(x, callback, dropper, ctx) \\ + {{(x)->context = (void*)(ctx); (x)->call = (callback); (x)->drop = (dropper);}}" + .to_owned() +} + +pub fn generate_generic_cpp( + macro_func: &[FunctionSignature], + generic_name: &str, + decay: bool, +) -> String { + let mut out = "".to_owned(); + + let (body_start, body_end) = if macro_func.iter().any(|f| f.args.len() > 1) { + ("\n ", "\n") + } else { + (" ", " ") + }; + + for func in macro_func { + let func_name = &func.func_name; + let return_type = &func.return_type.typename; + let arg_name = &func.args[0].name; + let arg_type = if decay { + func.args[0].typename.clone().with_ref().typename + } else { + func.args[0].typename.typename.clone() + }; + let x = if decay { + "&".to_string() + arg_name + } else { + arg_name.to_owned() + }; + out += "\n"; + out += &format!("inline {return_type} {generic_name}({arg_type} {arg_name}"); + for i in 1..func.args.len() { + out += &format!(", {} {}", func.args[i].typename.typename, func.args[i].name); + } + out += &format!(") {{{body_start}"); + if return_type != "void" { + out += "return "; + } + out += &format!("{func_name}({x}"); + for i in 1..func.args.len() { + out += &format!(", {}", func.args[i].name); + } + out += &format!(");{body_end}}};"); + } + out +} + +pub fn generate_generic_loan_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_loan", true) +} + +pub fn generate_generic_loan_to_owned_type_cpp(macro_func: &[FunctionSignature]) -> String { + let mut processed_loaned_types = HashSet::::new(); + let mut out = "template struct z_loaned_to_owned_type_t {}; +template struct z_owned_to_loaned_type_t {};" + .to_owned(); + for f in macro_func { + let loaned = f.return_type.clone().without_cv().without_ptr().typename; + if processed_loaned_types.contains(&loaned) { + continue; + } else { + processed_loaned_types.insert(loaned.clone()); + } + let owned = f.args[0] + .typename + .clone() + .without_cv() + .without_ptr() + .typename; + if owned.contains("view") { + continue; + } + out += &format!( + " +template<> struct z_loaned_to_owned_type_t<{loaned}> {{ typedef {owned} type; }}; +template<> struct z_owned_to_loaned_type_t<{owned}> {{ typedef {loaned} type; }};" + ); + } + out +} + +pub fn generate_generic_loan_mut_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_loan_mut", true) +} + +pub fn generate_generic_drop_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_drop", false) +} + +pub fn generate_generic_move_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_move", true) +} + +pub fn generate_generic_take_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_take", false) +} + +pub fn generate_generic_null_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_internal_null", false) +} + +pub fn generate_generic_check_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_internal_check", true) +} + +pub fn generate_generic_call_cpp(macro_func: &[FunctionSignature]) -> String { + generate_generic_cpp(macro_func, "z_call", false) +} + +pub fn generate_generic_recv_cpp(macro_func: &[FunctionSignature]) -> String { + let try_recv_funcs: Vec = macro_func + .iter() + .filter(|f| f.func_name.contains("try_recv")) + .cloned() + .collect(); + let recv_funcs: Vec = macro_func + .iter() + .filter(|f| !f.func_name.contains("try_recv")) + .cloned() + .collect(); + generate_generic_cpp(&try_recv_funcs, "z_try_recv", false) + + "\n\n" + + generate_generic_cpp(&recv_funcs, "z_recv", false).as_str() +} + +pub fn generate_generic_closure_cpp(macro_func: &[FunctionSignature]) -> String { + let mut out = "".to_owned(); + + for func in macro_func { + let return_type = &func.return_type.typename; + let closure_name = &func.args[0].name; + let closure_type = func.args[0] + .typename + .clone() + .without_cv() + .typename + .replace("loaned", "owned"); + let arg_type = &func.args[1].typename.typename; + out += "\n"; + out += &format!( + "inline void z_closure( + {closure_type} {closure_name}, + {return_type} (*call)({arg_type}, void*), + void (*drop)(void*), + void *context) {{ + {closure_name}->context = context; + {closure_name}->drop = drop; + {closure_name}->call = call; +}};" + ); + } + out +} + +fn test_feature(feature: &str) -> bool { + match feature { + #[cfg(feature = "shared-memory")] + "shared-memory" => true, + #[cfg(feature = "unstable")] + "unstable" => true, + _ => false, + } +} + +/// Evaluates conditional feature macros in the form #if (logical expression of define(FEATURE_NAME)) +/// and removes the code under those that evaluate to false +/// Note: works only on single string conditional expressions +pub fn process_feature_defines(input_path: &str) -> Result> { + let file = std::fs::File::open(input_path)?; + let lines = std::io::BufReader::new(file).lines(); + let mut out = String::new(); + let mut skip = false; + let mut nest_level: usize = 0; + for line in lines.flatten() { + if line.starts_with("#ifdef") && skip { + nest_level += 1; + } else if line.starts_with("#endif") && skip { + nest_level -= 1; + skip = nest_level != 0; + continue; + } else if line.starts_with("#if ") { + skip = skip || evaluate_c_defines_line(&line); + if skip { + nest_level += 1; + } + } + if !skip { + out += &line; + out += "\n"; + } + } + + Ok(out) +} + +pub fn evaluate_c_defines_line(line: &str) -> bool { + let mut s = line.to_string(); + for (rust_feature, c_feature) in RUST_TO_C_FEATURES.entries() { + s = s.replace( + &format!("defined({})", c_feature), + match test_feature(rust_feature) { + true => "true", + false => "false", + }, + ); + } + + s = s.replace("#if", ""); + match evalexpr::eval(&s) { + Ok(v) => v == evalexpr::Value::from(false), + Err(_) => panic!("Failed to evaluate {}", &s), + } +} diff --git a/cbindgen.toml b/cbindgen.toml index f0704fe81..0bf296444 100644 --- a/cbindgen.toml +++ b/cbindgen.toml @@ -57,6 +57,10 @@ usize_is_size_t = true "target_arch = aarch64" = "TARGET_ARCH_AARCH64" "target_arch = x86_64" = "TARGET_ARCH_X86_64" "target_arch = arm" = "TARGET_ARCH_ARM" +"target_os = windows" = "_WIN32" +"target_os = linux" = "__unix__" +"feature = shared-memory" = "SHARED_MEMORY" +"feature = unstable" = "UNSTABLE" [export] include = [] diff --git a/docs/.gitignore b/docs/.gitignore index e35d8850c..772f2ec8f 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -1 +1,2 @@ _build +doxyxml diff --git a/docs/Doxyfile b/docs/Doxyfile new file mode 100644 index 000000000..2ff5010ac --- /dev/null +++ b/docs/Doxyfile @@ -0,0 +1,2854 @@ +# Doxyfile 1.10.0 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. +# +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). +# +# Note: +# +# Use doxygen to compare the used configuration file with the template +# configuration file: +# doxygen -x [configFile] +# Use doxygen to compare the used configuration file with the template +# configuration file without replacing the environment variables or CMake type +# replacement variables: +# doxygen -x_noenv [configFile] + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +PROJECT_NAME = "My Project" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = + +# With the PROJECT_ICON tag one can specify an icon that is included in the tabs +# when the HTML document is shown. Doxygen will copy the logo to the output +# directory. + +PROJECT_ICON = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = ./doxyxml + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 +# sub-directories (in 2 levels) under the output directory of each output format +# and will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. Adapt CREATE_SUBDIRS_LEVEL to +# control the number of sub-directories. +# The default value is: NO. + +CREATE_SUBDIRS = NO + +# Controls the number of sub-directories that will be created when +# CREATE_SUBDIRS tag is set to YES. Level 0 represents 16 directories, and every +# level increment doubles the number of directories, resulting in 4096 +# directories at level 8 which is the default and also the maximum value. The +# sub-directories are organized in 2 levels, the first level always has a fixed +# number of 16 directories. +# Minimum value: 0, maximum value: 8, default value: 8. +# This tag requires that the tag CREATE_SUBDIRS is set to YES. + +CREATE_SUBDIRS_LEVEL = 8 + +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Bulgarian, +# Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, Dutch, English +# (United States), Esperanto, Farsi (Persian), Finnish, French, German, Greek, +# Hindi, Hungarian, Indonesian, Italian, Japanese, Japanese-en (Japanese with +# English messages), Korean, Korean-en (Korean with English messages), Latvian, +# Lithuanian, Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, +# Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, +# Swedish, Turkish, Ukrainian and Vietnamese. +# The default value is: English. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. +# The default value is: YES. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# doxygen will generate a detailed section even if there is only a brief +# description. +# The default value is: NO. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. +# The default value is: NO. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. + +FULL_PATH_NAMES = YES + +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. + +JAVADOC_AUTOBRIEF = NO + +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. + +MULTILINE_CPP_IS_BRIEF = NO + +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:^^" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". Note that you cannot put \n's in the value part of an alias +# to insert newlines (in the resulting output). You can put ^^ in the value part +# of an alias to insert a newline as if a physical newline was in the original +# file. When you need a literal { or } or , in the value part of an alias you +# have to escape them by means of a backslash (\), this can lead to conflicts +# with the commands \{ and \} for these it is advised to use the version @{ and +# @} or use a double escape (\\{ and \\}) + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, Lex, D, PHP, md (Markdown), Objective-C, Python, Slice, +# VHDL, Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. When specifying no_extension you should add +# * to the FILE_PATTERNS. +# +# Note see also the list of default file extension mappings. + +EXTENSION_MAPPING = + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. + +MARKDOWN_SUPPORT = YES + +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# The MARKDOWN_ID_STYLE tag can be used to specify the algorithm used to +# generate identifiers for the Markdown headings. Note: Every identifier is +# unique. +# Possible values are: DOXYGEN use a fixed 'autotoc_md' string followed by a +# sequence number starting at 0 and GITHUB use the lower case version of title +# with any whitespace replaced by '-' and punctuation characters removed. +# The default value is: DOXYGEN. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +MARKDOWN_ID_STYLE = DOXYGEN + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. + +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. +# The default value is: NO. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. +# The default value is: NO. + +DISTRIBUTE_GROUP_DOC = NO + +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. + +TYPEDEF_HIDES_STRUCT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 0 + +# The NUM_PROC_THREADS specifies the number of threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which effectively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 1 + +# If the TIMESTAMP tag is set different from NO then each generated page will +# contain the date or date and time when the page was generated. Setting this to +# NO can help when comparing the output of multiple runs. +# Possible values are: YES, NO, DATETIME and DATE. +# The default value is: NO. + +TIMESTAMP = NO + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = NO + +# If this flag is set to YES, the name of an unnamed parameter in a declaration +# will be determined by the corresponding definition. By default unnamed +# parameters remain unnamed in the output. +# The default value is: YES. + +RESOLVE_UNNAMED_PARAMS = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# will also hide undocumented C++ concepts if enabled. This option has no effect +# if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the +# documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# With the correct setting of option CASE_SENSE_NAMES doxygen will better be +# able to match the capabilities of the underlying filesystem. In case the +# filesystem is case sensitive (i.e. it supports files in the same directory +# whose names only differ in casing), the option must be set to YES to properly +# deal with such files in case they appear in the input. For filesystems that +# are not case sensitive the option should be set to NO to properly deal with +# output files written for symbols that only differ in casing, such as for two +# classes, one named CLASS and the other named Class, and to also support +# references to files without having to specify the exact matching casing. On +# Windows (including Cygwin) and MacOS, users should typically set this option +# to NO, whereas on Linux or other Unix flavors it should typically be set to +# YES. +# Possible values are: SYSTEM, NO and YES. +# The default value is: SYSTEM. + +CASE_SENSE_NAMES = SYSTEM + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = NO + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_HEADERFILE tag is set to YES then the documentation for a class +# will show which file needs to be included to use the class. +# The default value is: YES. + +SHOW_HEADERFILE = YES + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = YES + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. See also section "Changing the +# layout of pages" for information. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as documenting some parameters in +# a documented function twice, or documenting parameters that don't exist or +# using markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# If WARN_IF_INCOMPLETE_DOC is set to YES, doxygen will warn about incomplete +# function parameter documentation. If set to NO, doxygen will accept that some +# parameters have no documentation without warning. +# The default value is: YES. + +WARN_IF_INCOMPLETE_DOC = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong parameter +# documentation, but not about the absence of documentation. If EXTRACT_ALL is +# set to YES then this flag will automatically be disabled. See also +# WARN_IF_INCOMPLETE_DOC +# The default value is: NO. + +WARN_NO_PARAMDOC = NO + +# If WARN_IF_UNDOC_ENUM_VAL option is set to YES, doxygen will warn about +# undocumented enumeration values. If set to NO, doxygen will accept +# undocumented enumeration values. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: NO. + +WARN_IF_UNDOC_ENUM_VAL = NO + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS +# then doxygen will continue running as if WARN_AS_ERROR tag is set to NO, but +# at the end of the doxygen process doxygen will return with a non-zero status. +# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS_PRINT then doxygen behaves +# like FAIL_ON_WARNINGS but in case no WARN_LOGFILE is defined doxygen will not +# write the warning messages in between other messages but write them at the end +# of a run, in case a WARN_LOGFILE is defined the warning messages will be +# besides being in the defined file also be shown at the end of a run, unless +# the WARN_LOGFILE is defined as - i.e. standard output (stdout) in that case +# the behavior will remain as with the setting FAIL_ON_WARNINGS. +# Possible values are: NO, YES, FAIL_ON_WARNINGS and FAIL_ON_WARNINGS_PRINT. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# See also: WARN_LINE_FORMAT +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# In the $text part of the WARN_FORMAT command it is possible that a reference +# to a more specific place is given. To make it easier to jump to this place +# (outside of doxygen) the user can define a custom "cut" / "paste" string. +# Example: +# WARN_LINE_FORMAT = "'vi $file +$line'" +# See also: WARN_FORMAT +# The default value is: at line $line of file $file. + +WARN_LINE_FORMAT = "at line $line of file $file" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). In case the file specified cannot be opened for writing the +# warning and error messages are written to standard error. When as file - is +# specified the warning and error messages are written to standard output +# (stdout). + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = ../include + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: +# https://www.gnu.org/software/libiconv/) for the list of possible encodings. +# See also: INPUT_FILE_ENCODING +# The default value is: UTF-8. + +INPUT_ENCODING = UTF-8 + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses The INPUT_FILE_ENCODING tag can be used to specify +# character encoding on a per file pattern basis. Doxygen will compare the file +# name with each pattern and apply the encoding instead of the default +# INPUT_ENCODING) if there is a match. The character encodings are a list of the +# form: pattern=encoding (like *.php=ISO-8859-1). See cfg_input_encoding +# "INPUT_ENCODING" for further information on supported encodings. + +INPUT_FILE_ENCODING = + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# Note the list of default checked file patterns might differ from the list of +# default file extension mappings. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cxxm, +# *.cpp, *.cppm, *.ccm, *.c++, *.c++m, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, +# *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp, *.h++, *.ixx, *.l, *.cs, *.d, +# *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown, *.md, *.mm, *.dox (to +# be provided as doxygen C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, +# *.f18, *.f, *.for, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cxxm \ + *.cpp \ + *.cppm \ + *.ccm \ + *.c++ \ + *.c++m \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.idl \ + *.ddl \ + *.odl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.ixx \ + *.l \ + *.cs \ + *.d \ + *.php \ + *.php4 \ + *.php5 \ + *.phtml \ + *.inc \ + *.m \ + *.markdown \ + *.md \ + *.mm \ + *.dox \ + *.py \ + *.pyw \ + *.f90 \ + *.f95 \ + *.f03 \ + *.f08 \ + *.f18 \ + *.f \ + *.for \ + *.vhd \ + *.vhdl \ + *.ucf \ + *.qsf \ + *.ice + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. + +RECURSIVE = NO + +# The EXCLUDE tag can be used to specify files and/or directories that should be +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# ANamespace::AClass, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that doxygen will use the data processed and written to standard output +# for further processing, therefore nothing else, like debug statements or used +# commands (so in case of a Windows batch file always use @echo OFF), should be +# written to standard output. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. + +FILTER_SOURCE_PATTERNS = + +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = + +# The Fortran standard specifies that for fixed formatted Fortran code all +# characters from position 72 are to be considered as comment. A common +# extension is to allow longer lines before the automatic comment starts. The +# setting FORTRAN_COMMENT_AFTER will also make it possible that longer lines can +# be processed before the automatic comment starts. +# Minimum value: 7, maximum value: 10000, default value: 72. + +FORTRAN_COMMENT_AFTER = 72 + +#--------------------------------------------------------------------------- +# Configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# multi-line macros, enums or list initialized variables directly into the +# documentation. +# The default value is: NO. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. + +REFERENCES_LINK_SOURCE = YES + +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. + +ALPHABETICAL_INDEX = YES + +# The IGNORE_PREFIX tag can be used to specify a prefix (or a list of prefixes) +# that should be ignored while generating the index headers. The IGNORE_PREFIX +# tag works for classes, function and member names. The entity will be placed in +# the alphabetical list under the first letter of the entity name that remains +# after removing the prefix. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = NO + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_STYLESHEET = + +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). +# Note: Since the styling of scrollbars can currently not be overruled in +# Webkit/Chromium, the styling will be left out of the default doxygen.css if +# one or more extra stylesheets have been specified. So if scrollbar +# customization is desired it has to be added explicitly. For an example see the +# documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE tag can be used to specify if the generated HTML output +# should be rendered with a dark or light theme. +# Possible values are: LIGHT always generate light mode output, DARK always +# generate dark mode output, AUTO_LIGHT automatically set the mode according to +# the user preference, use light mode if no preference is set (the default), +# AUTO_DARK automatically set the mode according to the user preference, use +# dark mode if no preference is set and TOGGLE allow to user to switch between +# light and dark mode via a button. +# The default value is: AUTO_LIGHT. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE = AUTO_LIGHT + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a color-wheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use gray-scales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_SECTIONS = NO + +# If the HTML_CODE_FOLDING tag is set to YES then classes and functions can be +# dynamically folded and expanded in the generated HTML source code. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_CODE_FOLDING = YES + +# If the HTML_COPY_CLIPBOARD tag is set to YES then doxygen will show an icon in +# the top right corner of code and text fragments that allows the user to copy +# its content to the clipboard. Note this only works if supported by the browser +# and the web page is served via a secure context (see: +# https://www.w3.org/TR/secure-contexts/), i.e. using the https: or file: +# protocol. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_COPY_CLIPBOARD = YES + +# Doxygen stores a couple of settings persistently in the browser (via e.g. +# cookies). By default these settings apply to all HTML pages generated by +# doxygen across all projects. The HTML_PROJECT_COOKIE tag can be used to store +# the settings under a project specific key, such that the user preferences will +# be stored separately. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_PROJECT_COOKIE = + +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: +# https://developer.apple.com/xcode/), introduced with OSX 10.5 (Leopard). To +# create a documentation set, doxygen will generate a Makefile in the HTML +# output directory. Running make will produce the docset in that directory and +# running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_DOCSET = NO + +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# This tag determines the URL of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_FEEDURL = + +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# on Windows. In the beginning of 2021 Microsoft took the original page, with +# a.o. the download links, offline the HTML help workshop was already many years +# in maintenance mode). You can download the HTML help workshop from the web +# archives at Installation executable (see: +# http://web.archive.org/web/20160201063255/http://download.microsoft.com/downlo +# ad/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe). +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_HTMLHELP = NO + +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be +# written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_FILE = + +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +HHC_LOCATION = + +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +GENERATE_CHI = NO + +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +CHM_INDEX_ENCODING = + +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. + +TOC_EXPAND = NO + +# The SITEMAP_URL tag is used to specify the full URL of the place where the +# generated documentation will be placed on the server by the user during the +# deployment of the documentation. The generated sitemap is called sitemap.xml +# and placed on the directory specified by HTML_OUTPUT. In case no SITEMAP_URL +# is specified no sitemap is generated. For information about the sitemap +# protocol see https://www.sitemaps.org +# This tag requires that the tag GENERATE_HTML is set to YES. + +SITEMAP_URL = + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_VIRTUAL_FOLDER = doc + +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-filters). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHP_SECT_FILTER_ATTRS = + +# The QHG_LOCATION tag can be used to specify the location (absolute path +# including file name) of Qt's qhelpgenerator. If non-empty doxygen will try to +# run qhelpgenerator on the generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +DISABLE_INDEX = NO + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine tune the look of the index (see "Fine-tuning the output"). As an +# example, the default style sheet generated by doxygen has an example that +# shows how to put an image at the root of the tree instead of the PROJECT_NAME. +# Since the tree basically has the same information as the tab index, you could +# consider setting DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +GENERATE_TREEVIEW = NO + +# When both GENERATE_TREEVIEW and DISABLE_INDEX are set to YES, then the +# FULL_SIDEBAR option determines if the side bar is limited to only the treeview +# area (value NO) or if it should extend to the full height of the window (value +# YES). Setting this to YES gives a layout similar to +# https://docs.readthedocs.io with more room for contents, but less room for the +# project logo, title, and description. If either GENERATE_TREEVIEW or +# DISABLE_INDEX is set to NO, this option has no effect. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FULL_SIDEBAR = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. + +TREEVIEW_WIDTH = 250 + +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +EXT_LINKS_IN_WINDOW = NO + +# If the OBFUSCATE_EMAILS tag is set to YES, doxygen will obfuscate email +# addresses. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +OBFUSCATE_EMAILS = YES + +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. + +FORMULA_FONTSIZE = 10 + +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. + +USE_MATHJAX = NO + +# With MATHJAX_VERSION it is possible to specify the MathJax version to be used. +# Note that the different versions of MathJax have different requirements with +# regards to the different settings, so it is possible that also other MathJax +# settings have to be changed when switching between the different MathJax +# versions. +# Possible values are: MathJax_2 and MathJax_3. +# The default value is: MathJax_2. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_VERSION = MathJax_2 + +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. For more details about the output format see MathJax +# version 2 (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) and MathJax version 3 +# (see: +# http://docs.mathjax.org/en/latest/web/components/output.html). +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility. This is the name for Mathjax version 2, for MathJax version 3 +# this will be translated into chtml), NativeMML (i.e. MathML. Only supported +# for NathJax 2. For MathJax version 3 chtml will be used instead.), chtml (This +# is the name for Mathjax version 3, for MathJax version 2 this will be +# translated into HTML-CSS) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. The default value is: +# - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2 +# - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3 +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_RELPATH = + +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# for MathJax version 2 (see +# https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions): +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# For example for MathJax version 3 (see +# http://docs.mathjax.org/en/latest/input/tex/extensions/index.html): +# MATHJAX_EXTENSIONS = ams +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: +# http://docs.mathjax.org/en/v2.7-latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /