From b88645475e8b39efed6bf931b568790630a5d169 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 27 Nov 2024 01:15:04 +0300 Subject: [PATCH 1/7] support close builder API --- Cargo.lock | 89 +++++++++++++------------ Cargo.toml | 9 +-- Cargo.toml.in | 9 +-- build-resources/opaque-types/Cargo.lock | 61 ++++++++--------- build-resources/opaque-types/Cargo.toml | 7 +- build-resources/opaque-types/src/lib.rs | 3 + include/zenoh_commons.h | 41 +++++++++++- include/zenoh_macros.h | 16 +++++ splitguide.yaml | 1 + src/close.rs | 64 ++++++++++++++++++ src/lib.rs | 2 + src/session.rs | 35 ++++++++-- tests/z_api_session_test.c | 89 +++++++++++++++++++++++++ 13 files changed, 333 insertions(+), 93 deletions(-) create mode 100644 src/close.rs create mode 100644 tests/z_api_session_test.c diff --git a/Cargo.lock b/Cargo.lock index 6033ba9e0..759a31fbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -164,7 +164,7 @@ dependencies = [ "async-task", "concurrent-queue", "fastrand 2.1.1", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "slab", ] @@ -176,10 +176,10 @@ checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ "async-channel 2.3.1", "async-executor", - "async-io 2.3.4", + "async-io 2.4.0", "async-lock 3.4.0", "blocking", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "once_cell", ] @@ -205,17 +205,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.4" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444b0228950ee6501b3568d3c93bf1176a1fdbc3b758dcd9475046d30f4dc7e8" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "parking", - "polling 3.7.3", + "polling 3.7.4", "rustix 0.38.37", "slab", "tracing", @@ -383,7 +383,7 @@ dependencies = [ "async-channel 2.3.1", "async-task", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.5.0", "piper", ] @@ -923,9 +923,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "fastrand 2.1.1", "futures-core", @@ -1957,9 +1957,9 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.3" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2790cd301dec6cd3b7a025e4815cf825724a51c98dccfe6a3e55f05ffb6511" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if", "concurrent-queue", @@ -3302,9 +3302,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "value-bag" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a84c137d37ab0142f0f2ddfe332651fdbf252e7b7dbb4e67b6c1f1b2e925101" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" [[package]] name = "vec_map" @@ -3718,7 +3718,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "ahash", "async-trait", @@ -3765,7 +3765,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "zenoh-collections", ] @@ -3790,6 +3790,7 @@ dependencies = [ "regex", "serde_yaml", "spin", + "tokio", "tracing", "unwrap-infallible", "zenoh", @@ -3801,7 +3802,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "tracing", "uhlc", @@ -3813,12 +3814,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "json5", "num_cpus", @@ -3839,7 +3840,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "lazy_static", "tokio", @@ -3850,7 +3851,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "aes", "hmac", @@ -3863,7 +3864,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "bincode", "flume", @@ -3880,7 +3881,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "hashbrown 0.14.5", "keyed-set", @@ -3894,7 +3895,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3914,7 +3915,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "flume", @@ -3938,7 +3939,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3964,7 +3965,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "tokio", @@ -3982,7 +3983,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "socket2 0.5.7", @@ -3999,7 +4000,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "base64 0.22.1", @@ -4028,7 +4029,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "socket2 0.5.7", @@ -4047,7 +4048,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "advisory-lock", "async-trait", @@ -4069,7 +4070,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "nix 0.29.0", @@ -4087,7 +4088,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "libc", @@ -4105,7 +4106,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "futures-util", @@ -4125,7 +4126,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "proc-macro2", "quote", @@ -4136,7 +4137,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "git-version", "libloading", @@ -4152,7 +4153,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "const_format", "rand", @@ -4166,7 +4167,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "anyhow", ] @@ -4174,7 +4175,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "lazy_static", "ron", @@ -4187,7 +4188,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "advisory-lock", "async-trait", @@ -4210,7 +4211,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "event-listener 5.3.1", "futures", @@ -4223,7 +4224,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "futures", "tokio", @@ -4236,7 +4237,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "crossbeam-utils", @@ -4270,7 +4271,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "const_format", diff --git a/Cargo.toml b/Cargo.toml index 11653c34a..ef77d50f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,12 +70,13 @@ libc = "0.2.139" tracing = "0.1" rand = "0.8.5" spin = "0.9.5" +tokio = "*" 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 = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", features=["internal"], branch = "close_builder" } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder" } flume = "*" [build-dependencies] diff --git a/Cargo.toml.in b/Cargo.toml.in index 66de70f82..844241865 100644 --- a/Cargo.toml.in +++ b/Cargo.toml.in @@ -70,12 +70,13 @@ libc = "0.2.139" tracing = "0.1" rand = "0.8.5" spin = "0.9.5" +tokio = "*" 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 = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } -zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } -zenoh-util = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", features=["internal"], branch = "close_builder" } +zenoh-runtime = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder" } +zenoh-util = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder" } flume = "*" [build-dependencies] diff --git a/build-resources/opaque-types/Cargo.lock b/build-resources/opaque-types/Cargo.lock index 6f44ab256..c5b5aff5e 100644 --- a/build-resources/opaque-types/Cargo.lock +++ b/build-resources/opaque-types/Cargo.lock @@ -1248,6 +1248,7 @@ version = "0.1.0" dependencies = [ "const_format", "flume", + "tokio", "zenoh", "zenoh-ext", "zenoh-protocol", @@ -3110,7 +3111,7 @@ dependencies = [ [[package]] name = "zenoh" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "ahash", "async-trait", @@ -3157,7 +3158,7 @@ dependencies = [ [[package]] name = "zenoh-buffers" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "zenoh-collections", ] @@ -3165,7 +3166,7 @@ dependencies = [ [[package]] name = "zenoh-codec" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "tracing", "uhlc", @@ -3177,12 +3178,12 @@ dependencies = [ [[package]] name = "zenoh-collections" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" [[package]] name = "zenoh-config" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "json5", "num_cpus", @@ -3203,7 +3204,7 @@ dependencies = [ [[package]] name = "zenoh-core" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "lazy_static", "tokio", @@ -3214,7 +3215,7 @@ dependencies = [ [[package]] name = "zenoh-crypto" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "aes", "hmac", @@ -3227,7 +3228,7 @@ dependencies = [ [[package]] name = "zenoh-ext" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "bincode", "flume", @@ -3244,7 +3245,7 @@ dependencies = [ [[package]] name = "zenoh-keyexpr" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "hashbrown", "keyed-set", @@ -3258,7 +3259,7 @@ dependencies = [ [[package]] name = "zenoh-link" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "zenoh-config", "zenoh-link-commons", @@ -3278,7 +3279,7 @@ dependencies = [ [[package]] name = "zenoh-link-commons" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "flume", @@ -3302,7 +3303,7 @@ dependencies = [ [[package]] name = "zenoh-link-quic" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3328,7 +3329,7 @@ dependencies = [ [[package]] name = "zenoh-link-serial" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "tokio", @@ -3346,7 +3347,7 @@ dependencies = [ [[package]] name = "zenoh-link-tcp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "socket2", @@ -3363,7 +3364,7 @@ dependencies = [ [[package]] name = "zenoh-link-tls" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "base64 0.22.1", @@ -3392,7 +3393,7 @@ dependencies = [ [[package]] name = "zenoh-link-udp" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "socket2", @@ -3411,7 +3412,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixpipe" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "advisory-lock", "async-trait", @@ -3433,7 +3434,7 @@ dependencies = [ [[package]] name = "zenoh-link-unixsock_stream" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "nix 0.29.0", @@ -3451,7 +3452,7 @@ dependencies = [ [[package]] name = "zenoh-link-vsock" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "libc", @@ -3469,7 +3470,7 @@ dependencies = [ [[package]] name = "zenoh-link-ws" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "futures-util", @@ -3489,7 +3490,7 @@ dependencies = [ [[package]] name = "zenoh-macros" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "proc-macro2", "quote", @@ -3500,7 +3501,7 @@ dependencies = [ [[package]] name = "zenoh-plugin-trait" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "git-version", "libloading", @@ -3516,7 +3517,7 @@ dependencies = [ [[package]] name = "zenoh-protocol" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "const_format", "rand", @@ -3530,7 +3531,7 @@ dependencies = [ [[package]] name = "zenoh-result" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "anyhow", ] @@ -3538,7 +3539,7 @@ dependencies = [ [[package]] name = "zenoh-runtime" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "lazy_static", "ron", @@ -3551,7 +3552,7 @@ dependencies = [ [[package]] name = "zenoh-shm" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "advisory-lock", "async-trait", @@ -3574,7 +3575,7 @@ dependencies = [ [[package]] name = "zenoh-sync" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "event-listener", "futures", @@ -3587,7 +3588,7 @@ dependencies = [ [[package]] name = "zenoh-task" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "futures", "tokio", @@ -3600,7 +3601,7 @@ dependencies = [ [[package]] name = "zenoh-transport" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "crossbeam-utils", @@ -3634,7 +3635,7 @@ dependencies = [ [[package]] name = "zenoh-util" version = "1.0.0-dev" -source = "git+https://github.com/eclipse-zenoh/zenoh.git?branch=main#9a84e6d875c866d05d7b497e9fc090ec672f6813" +source = "git+https://github.com/ZettaScaleLabs/zenoh.git?branch=close_builder#ffc487a7629511e8d8d2236557988a27e764f51f" dependencies = [ "async-trait", "const_format", diff --git a/build-resources/opaque-types/Cargo.toml b/build-resources/opaque-types/Cargo.toml index 57370d988..87c11ee7f 100644 --- a/build-resources/opaque-types/Cargo.toml +++ b/build-resources/opaque-types/Cargo.toml @@ -30,8 +30,9 @@ panic = [ default = ["zenoh/default"] [dependencies] -zenoh = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main", default-features = false, features = ["internal"] } -zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", features=["internal"], branch = "main" } -zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/eclipse-zenoh/zenoh.git", branch = "main" } +zenoh = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder", default-features = false, features = ["internal"] } +zenoh-ext = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", features=["internal"], branch = "close_builder" } +zenoh-protocol = { version = "1.0.0-dev", git = "https://github.com/ZettaScaleLabs/zenoh.git", branch = "close_builder" } const_format = "0.2.32" flume = "*" +tokio = "*" diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index 29c81353b..037efd8c9 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -185,6 +185,9 @@ get_opaque_type_data!(Option, z_owned_session_t); /// A loaned Zenoh session. get_opaque_type_data!(Session, z_loaned_session_t); +/// An owned Close handle +get_opaque_type_data!(Option>>, zc_owned_concurrent_close_handle_t); + /// An owned Zenoh configuration. get_opaque_type_data!(Option, z_owned_config_t); /// A loaned Zenoh configuration. diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 627d0a658..9a74294d8 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -275,11 +275,26 @@ typedef struct z_clock_t { uint64_t t; const void *t_base; } z_clock_t; +/** + * An owned Close handle + */ +typedef struct ALIGN(8) zc_owned_concurrent_close_handle_t { + uint8_t _0[8]; +} zc_owned_concurrent_close_handle_t; /** * Options passed to the `z_close()` function. */ typedef struct z_close_options_t { - uint8_t _dummy; + /** + * The timeout for close operation in milliseconds. 0 means default close timeout which is 10 seconds. + */ + uint32_t timeout_ms; + /** + * An optional uninitialized concurrent close handle. If set, the close operation will be executed + * concurrently in separate task, and this handle will be initialized to be used for controlling + * it's execution. + */ + struct zc_owned_concurrent_close_handle_t *out_concurrent; } z_close_options_t; /** * @brief A hello message-processing closure. @@ -892,6 +907,9 @@ typedef struct zc_moved_closure_matching_status_t { struct zc_owned_closure_matching_status_t _this; } zc_moved_closure_matching_status_t; #endif +typedef struct zc_moved_concurrent_close_handle_t { + struct zc_owned_concurrent_close_handle_t _this; +} zc_moved_concurrent_close_handle_t; typedef struct zc_moved_matching_listener_t { struct zc_owned_matching_listener_t _this; } zc_moved_matching_listener_t; @@ -1424,7 +1442,7 @@ ZENOHC_API struct z_clock_t z_clock_now(void); */ ZENOHC_API z_result_t z_close(struct z_loaned_session_t *session, - const struct z_close_options_t *_options); + struct z_close_options_t *options); /** * Constructs the default value for `z_close_options_t`. */ @@ -4632,6 +4650,15 @@ 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 +/** + * @brief Drops the close handle. The concurrent close task will not be interrupted. + */ +ZENOHC_API void zc_concurrent_close_handle_drop(struct zc_moved_concurrent_close_handle_t *this_); +/** + * @brief Blocking wait on close handle to complete. Returns `Z_EIO` if close finishes with error. + */ +ZENOHC_API +z_result_t zc_concurrent_close_handle_wait(struct zc_moved_concurrent_close_handle_t *handle); /** * Constructs a configuration by parsing a file path stored in ZENOH_CONFIG environmental variable. * @@ -4742,6 +4769,16 @@ bool zc_internal_closure_matching_status_check(const struct zc_owned_closure_mat ZENOHC_API void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_status_t *this_); #endif +/** + * @brief Returns ``true`` if concurrent close handle is valid, ``false`` if it is in gravestone state. + */ +ZENOHC_API +bool zc_internal_concurrent_close_handle_check(const struct zc_owned_concurrent_close_handle_t *this_); +/** + * @brief Constructs concurrent close handle in its gravestone state. + */ +ZENOHC_API +void zc_internal_concurrent_close_handle_null(struct zc_owned_concurrent_close_handle_t *this_); /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Checks the matching listener is for the gravestone state diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index eccc03a77..4a54de886 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -47,6 +47,7 @@ static inline z_moved_subscriber_t* z_subscriber_move(z_owned_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_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_concurrent_close_handle_t* x) { return (zc_moved_concurrent_close_handle_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); } @@ -170,6 +171,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_concurrent_close_handle_t* : zc_concurrent_close_handle_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, \ @@ -222,6 +224,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_concurrent_close_handle_t : zc_concurrent_close_handle_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, \ @@ -274,6 +277,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_task_t* : z_internal_task_null, \ zc_owned_closure_log_t* : zc_internal_closure_log_null, \ zc_owned_closure_matching_status_t* : zc_internal_closure_matching_status_null, \ + zc_owned_concurrent_close_handle_t* : zc_internal_concurrent_close_handle_null, \ zc_owned_matching_listener_t* : zc_internal_matching_listener_null, \ zc_owned_shm_client_list_t* : zc_internal_shm_client_list_null, \ ze_owned_publication_cache_t* : ze_internal_publication_cache_null, \ @@ -324,6 +328,7 @@ static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscr 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); } 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_internal_closure_matching_status_null(&x->_this); } +static inline void zc_concurrent_close_handle_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_concurrent_close_handle_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_internal_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_internal_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_internal_publication_cache_null(&x->_this); } @@ -376,6 +381,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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_concurrent_close_handle_t* : zc_concurrent_close_handle_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, \ @@ -428,6 +434,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_task_t : z_internal_task_check, \ zc_owned_closure_log_t : zc_internal_closure_log_check, \ zc_owned_closure_matching_status_t : zc_internal_closure_matching_status_check, \ + zc_owned_concurrent_close_handle_t : zc_internal_concurrent_close_handle_check, \ zc_owned_matching_listener_t : zc_internal_matching_listener_check, \ zc_owned_shm_client_list_t : zc_internal_shm_client_list_check, \ ze_owned_publication_cache_t : ze_internal_publication_cache_check, \ @@ -548,6 +555,7 @@ static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* 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_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_concurrent_close_handle_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); } @@ -666,6 +674,7 @@ 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_concurrent_close_handle_t* this_) { zc_concurrent_close_handle_drop(this_); }; inline void z_drop(zc_moved_matching_listener_t* this_) { 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_); }; @@ -716,6 +725,7 @@ inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subs 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_concurrent_close_handle_t* z_move(zc_owned_concurrent_close_handle_t& this_) { return zc_concurrent_close_handle_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_); }; @@ -766,6 +776,7 @@ inline void z_internal_null(z_owned_subscriber_t* this_) { z_internal_subscriber 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_); }; inline void z_internal_null(zc_owned_closure_matching_status_t* this_) { zc_internal_closure_matching_status_null(this_); }; +inline void z_internal_null(zc_owned_concurrent_close_handle_t* this_) { zc_internal_concurrent_close_handle_null(this_); }; inline void z_internal_null(zc_owned_matching_listener_t* this_) { zc_internal_matching_listener_null(this_); }; inline void z_internal_null(zc_owned_shm_client_list_t* this_) { zc_internal_shm_client_list_null(this_); }; inline void z_internal_null(ze_owned_publication_cache_t* this_) { ze_internal_publication_cache_null(this_); }; @@ -815,6 +826,7 @@ static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscr 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); } 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_internal_closure_matching_status_null(&x->_this); } +static inline void zc_concurrent_close_handle_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_concurrent_close_handle_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_internal_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_internal_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_internal_publication_cache_null(&x->_this); } @@ -952,6 +964,9 @@ inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* 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_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { + zc_concurrent_close_handle_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); }; @@ -1012,6 +1027,7 @@ inline bool z_internal_check(const z_owned_subscriber_t& this_) { return z_inter 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 bool z_internal_check(const zc_owned_closure_matching_status_t& this_) { return zc_internal_closure_matching_status_check(&this_); }; +inline bool z_internal_check(const zc_owned_concurrent_close_handle_t& this_) { return zc_internal_concurrent_close_handle_check(&this_); }; inline bool z_internal_check(const zc_owned_matching_listener_t& this_) { return zc_internal_matching_listener_check(&this_); }; inline bool z_internal_check(const zc_owned_shm_client_list_t& this_) { return zc_internal_shm_client_list_check(&this_); }; inline bool z_internal_check(const ze_owned_publication_cache_t& this_) { return ze_internal_publication_cache_check(&this_); }; diff --git a/splitguide.yaml b/splitguide.yaml index f8f2fe53a..331b199bd 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -117,4 +117,5 @@ zenoh_opaque.h: - z_loaned_fifo_handler_reply_t! - z_owned_ring_handler_reply_t! - z_loaned_ring_handler_reply_t! + - zc_owned_concurrent_close_handle_t diff --git a/src/close.rs b/src/close.rs new file mode 100644 index 000000000..45b7962df --- /dev/null +++ b/src/close.rs @@ -0,0 +1,64 @@ +// +// Copyright (c) 2017, 2022 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 zenoh_runtime::ZRuntime; + +use crate::{ + opaque_types::zc_owned_concurrent_close_handle_t, + result::{z_result_t, Z_EIO, Z_OK}, + transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, + zc_moved_concurrent_close_handle_t, +}; +decl_c_type!( + owned(zc_owned_concurrent_close_handle_t, option tokio::task::JoinHandle>), +); + +/// @brief Blocking wait on close handle to complete. Returns `Z_EIO` if close finishes with error. +#[no_mangle] +#[allow(clippy::missing_safety_doc)] +pub unsafe extern "C" fn zc_concurrent_close_handle_wait( + handle: &mut zc_moved_concurrent_close_handle_t, +) -> z_result_t { + match ZRuntime::Application.block_on(handle.take_rust_type().unwrap_unchecked()) { + Ok(_) => Z_OK, + Err(e) => { + tracing::error!("Close error: {}", e); + Z_EIO + } + } +} + +/// @brief Drops the close handle. The concurrent close task will not be interrupted. +#[no_mangle] +pub extern "C" fn zc_concurrent_close_handle_drop(this_: &mut zc_moved_concurrent_close_handle_t) { + let _ = this_.take_rust_type(); +} + +/// @brief Returns ``true`` if concurrent close handle is valid, ``false`` if it is in gravestone state. +#[no_mangle] +pub extern "C" fn zc_internal_concurrent_close_handle_check( + this_: &zc_owned_concurrent_close_handle_t, +) -> bool { + this_.as_rust_type_ref().is_some() +} + +/// @brief Constructs concurrent close handle in its gravestone state. +#[no_mangle] +pub extern "C" fn zc_internal_concurrent_close_handle_null( + this_: &mut MaybeUninit, +) { + this_.as_rust_type_mut_uninit().write(None); +} diff --git a/src/lib.rs b/src/lib.rs index 997e0c3cc..3608a5a53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,6 +29,8 @@ pub mod result; pub use crate::collections::*; mod config; pub use crate::config::*; +mod close; +pub use crate::close::*; pub mod encoding; pub use crate::encoding::*; mod commons; diff --git a/src/session.rs b/src/session.rs index eb0421d3f..b8f5640ae 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, TakeRustType}, - z_moved_config_t, z_moved_session_t, + z_moved_config_t, z_moved_session_t, zc_owned_concurrent_close_handle_t, }; decl_c_type!( owned(z_owned_session_t, option Session), @@ -145,13 +145,22 @@ pub extern "C" fn z_internal_session_check(this_: &z_owned_session_t) -> bool { /// Options passed to the `z_close()` function. #[repr(C)] pub struct z_close_options_t { - _dummy: u8, + /// The timeout for close operation in milliseconds. 0 means default close timeout which is 10 seconds. + timeout_ms: u32, + + /// An optional uninitialized concurrent close handle. If set, the close operation will be executed + /// concurrently in separate task, and this handle will be initialized to be used for controlling + /// it's execution. + out_concurrent: Option<&'static mut MaybeUninit>, } /// Constructs the default value for `z_close_options_t`. #[no_mangle] pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit) { - this_.write(z_close_options_t { _dummy: 0 }); + this_.write(z_close_options_t { + timeout_ms: 0, + out_concurrent: None, + }); } /// Closes zenoh session. This also drops all the closure callbacks remaining from dropped, but not undeclared subscribers. @@ -160,10 +169,24 @@ pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit, + options: Option<&mut z_close_options_t>, ) -> result::z_result_t { - let s = session.as_rust_type_mut(); - match s.close().wait() { + let mut close_builder = session.as_rust_type_mut().close(); + + if let Some(options) = options { + if options.timeout_ms != 0 { + close_builder = + close_builder.timeout(core::time::Duration::from_millis(options.timeout_ms as u64)) + } + + if let Some(close_handle) = &mut options.out_concurrent { + let handle = close_builder.concurrently(); + close_handle.as_rust_type_mut_uninit().write(Some(handle)); + return result::Z_OK; + } + } + + match close_builder.wait() { Err(e) => { tracing::error!("Error closing session: {}", e); result::Z_EGENERIC diff --git a/tests/z_api_session_test.c b/tests/z_api_session_test.c new file mode 100644 index 000000000..14f47ed0d --- /dev/null +++ b/tests/z_api_session_test.c @@ -0,0 +1,89 @@ +// +// 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 "zenoh.h" + +#undef NDEBUG +#include + +void close_drop() { + z_owned_config_t config; + z_config_default(&config); + + z_owned_session_t s; + if (z_open(&s, z_move(config), NULL) < 0) { + perror("Unable to open session!"); + exit(-1); + } + + z_drop(z_move(s)); +} + +void close_sync() { + z_owned_config_t config; + z_config_default(&config); + + z_owned_session_t s; + if (z_open(&s, z_move(config), NULL) < 0) { + perror("Unable to open session!"); + exit(-1); + } + + z_close_options_t options; + z_close_options_default(&options); + + if (z_close(z_loan_mut(s), &options) < 0) { + perror("Error closing session!"); + exit(-1); + } + + z_drop(z_move(s)); +} + +void close_concurrent() { + z_owned_config_t config; + z_config_default(&config); + + z_owned_session_t s; + if (z_open(&s, z_move(config), NULL) < 0) { + perror("Unable to open session!"); + exit(-1); + } + + zc_owned_concurrent_close_handle_t close_handle; + + z_close_options_t options; + z_close_options_default(&options); + options.out_concurrent = &close_handle; + + if (z_close(z_loan_mut(s), &options) < 0) { + perror("Error starting concurrent session close!"); + exit(-1); + } + + if (zc_concurrent_close_handle_wait(z_move(close_handle)) < 0) { + perror("Error closing session!"); + exit(-1); + } + + z_drop(z_move(s)); +} + +int main(int argc, char **argv) { + zc_try_init_log_from_env(); + close_drop(); + close_sync(); + close_concurrent(); +} From 7b987039ee169a37b13c99e8bb5add835b655903 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 27 Nov 2024 01:30:36 +0300 Subject: [PATCH 2/7] fix splitguide --- include/zenoh_commons.h | 6 ------ splitguide.yaml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 9a74294d8..b780c3f8b 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -275,12 +275,6 @@ typedef struct z_clock_t { uint64_t t; const void *t_base; } z_clock_t; -/** - * An owned Close handle - */ -typedef struct ALIGN(8) zc_owned_concurrent_close_handle_t { - uint8_t _0[8]; -} zc_owned_concurrent_close_handle_t; /** * Options passed to the `z_close()` function. */ diff --git a/splitguide.yaml b/splitguide.yaml index 331b199bd..8378cab73 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -117,5 +117,5 @@ zenoh_opaque.h: - z_loaned_fifo_handler_reply_t! - z_owned_ring_handler_reply_t! - z_loaned_ring_handler_reply_t! - - zc_owned_concurrent_close_handle_t + - zc_owned_concurrent_close_handle_t! From 9f772c1f6d155c6e1cab9800a38b2edee8a4ddcf Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 4 Dec 2024 12:20:26 +0300 Subject: [PATCH 3/7] - synchronize with recent close API - close API is unstable and internal --- build-resources/opaque-types/src/lib.rs | 3 +- include/zenoh_commons.h | 658 ++++++++---------------- include/zenoh_macros.h | 367 ++++++++++++- splitguide.yaml | 2 +- src/close.rs | 18 +- src/lib.rs | 2 + src/session.rs | 29 +- tests/z_api_session_test.c | 6 +- 8 files changed, 618 insertions(+), 467 deletions(-) diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index ebc2f351f..cec6121ee 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -193,8 +193,9 @@ get_opaque_type_data!(Option, z_owned_session_t); /// A loaned Zenoh session. get_opaque_type_data!(Session, z_loaned_session_t); +#[cfg(feature = "unstable")] /// An owned Close handle -get_opaque_type_data!(Option>>, zc_owned_concurrent_close_handle_t); +get_opaque_type_data!(Option>>, zc_owned_internal_concurrent_close_handle_t); /// An owned Zenoh configuration. get_opaque_type_data!(Option, z_owned_config_t); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index ca9ea2acb..922da42f2 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -16,32 +16,6 @@ #define ALIGN(n) #define ZENOHC_API #endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Allocation errors - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef enum z_alloc_error_t { -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Defragmentation needed. - */ - Z_ALLOC_ERROR_NEED_DEFRAGMENT, -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * The provider is out of memory. - */ - Z_ALLOC_ERROR_OUT_OF_MEMORY, -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Other error. - */ - Z_ALLOC_ERROR_OTHER, -#endif -} z_alloc_error_t; -#endif typedef enum z_congestion_control_t { /** * Messages are not dropped in case of congestion. @@ -103,26 +77,6 @@ typedef enum z_keyexpr_intersection_level_t { Z_KEYEXPR_INTERSECTION_LEVEL_EQUALS = 3, } z_keyexpr_intersection_level_t; #endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Layouting errors - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef enum z_layout_error_t { -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Layout arguments are incorrect. - */ - Z_LAYOUT_ERROR_INCORRECT_LAYOUT_ARGS, -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Layout incompatible with provider. - */ - Z_LAYOUT_ERROR_PROVIDER_INCOMPATIBLE_LAYOUT, -#endif -} z_layout_error_t; -#endif /** * The priority of zenoh messages. */ @@ -215,52 +169,6 @@ typedef enum z_whatami_t { Z_WHATAMI_PEER = 2, Z_WHATAMI_CLIENT = 4, } z_whatami_t; -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Status of SHM buffer allocation operation. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef enum zc_buf_alloc_status_t { -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Allocation ok - */ - ZC_BUF_ALLOC_STATUS_OK = 0, -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Allocation error - */ - ZC_BUF_ALLOC_STATUS_ALLOC_ERROR = 1, -#endif -} zc_buf_alloc_status_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Status of SHM buffer layouting + allocation operation. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef enum zc_buf_layout_alloc_status_t { -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Allocation ok - */ - ZC_BUF_LAYOUT_ALLOC_STATUS_OK = 0, -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * Allocation error - */ - ZC_BUF_LAYOUT_ALLOC_STATUS_ALLOC_ERROR = 1, -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) - /** - * 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. */ @@ -329,56 +237,19 @@ typedef enum zc_reply_keyexpr_t { ZC_REPLY_KEYEXPR_MATCHING_QUERY = 1, } zc_reply_keyexpr_t; #endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A result of SHM buffer allocation operation. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -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; -#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; -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief An AllocAlignment. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct z_alloc_alignment_t { - uint8_t pow; -} z_alloc_alignment_t; -#endif -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -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(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -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; +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_slice_t { struct z_owned_slice_t _this; } z_moved_slice_t; @@ -394,41 +265,9 @@ typedef struct ALIGN(8) z_bytes_slice_iterator_t { typedef struct z_moved_bytes_writer_t { struct z_owned_bytes_writer_t _this; } z_moved_bytes_writer_t; -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Unique segment identifier. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef uint32_t z_segment_id_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Chunk id within it's segment. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef uint32_t z_chunk_id_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A ChunkDescriptor. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct z_chunk_descriptor_t { - z_segment_id_t segment; - z_chunk_id_t chunk; - size_t len; -} z_chunk_descriptor_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief An AllocatedChunk. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct z_allocated_chunk_t { - struct z_chunk_descriptor_t descriptpr; - void *data; -} z_allocated_chunk_t; -#endif +typedef struct z_moved_chunk_alloc_result_t { + struct z_owned_chunk_alloc_result_t _this; +} z_moved_chunk_alloc_result_t; /** * Monotonic clock */ @@ -440,16 +279,20 @@ typedef struct z_clock_t { * Options passed to the `z_close()` function. */ typedef struct z_close_options_t { +#if defined(Z_FEATURE_UNSTABLE_API) /** * The timeout for close operation in milliseconds. 0 means default close timeout which is 10 seconds. */ - uint32_t timeout_ms; + uint32_t internal_timeout_ms; +#endif +#if defined(Z_FEATURE_UNSTABLE_API) /** * An optional uninitialized concurrent close handle. If set, the close operation will be executed * concurrently in separate task, and this handle will be initialized to be used for controlling * it's execution. */ - struct zc_owned_concurrent_close_handle_t *out_concurrent; + struct zc_owned_internal_concurrent_close_handle_t *internal_out_concurrent; +#endif } z_close_options_t; /** * @brief A hello message-processing closure. @@ -695,6 +538,9 @@ typedef struct z_moved_fifo_handler_reply_t { typedef struct z_moved_fifo_handler_sample_t { struct z_owned_fifo_handler_sample_t _this; } z_moved_fifo_handler_sample_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. */ @@ -749,7 +595,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. @@ -799,6 +645,12 @@ typedef struct z_liveliness_get_options_t { uint32_t timeout_ms; } z_liveliness_get_options_t; #endif +typedef struct z_moved_liveliness_token_t { + struct z_owned_liveliness_token_t _this; +} z_moved_liveliness_token_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; @@ -839,7 +691,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. @@ -892,13 +744,16 @@ 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. */ struct z_moved_bytes_t *attachment; } z_put_options_t; +typedef struct z_moved_querier_t { + struct z_owned_querier_t _this; +} z_moved_querier_t; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Options passed to the `z_querier_get()` function. @@ -919,7 +774,7 @@ typedef struct z_querier_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. @@ -961,7 +816,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. @@ -995,7 +850,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. @@ -1049,52 +904,15 @@ typedef struct z_scout_options_t { typedef struct z_moved_session_t { struct z_owned_session_t _this; } z_moved_session_t; -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Callbacks for ShmSegment. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct zc_shm_segment_callbacks_t { - /** - * Obtain the actual region of memory identified by it's id. - */ - uint8_t *(*map_fn)(z_chunk_id_t chunk_id, void *context); -} zc_shm_segment_callbacks_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief An ShmSegment. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct z_shm_segment_t { - struct zc_threadsafe_context_t context; - struct zc_shm_segment_callbacks_t callbacks; -} z_shm_segment_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Callback for ShmClient. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct zc_shm_client_callbacks_t { - /** - * Attach to particular shared memory segment - */ - bool (*attach_fn)(struct z_shm_segment_t *out_segment, z_segment_id_t segment_id, void *context); -} zc_shm_client_callbacks_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief A result of SHM buffer layouting + allocation operation. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct z_buf_layout_alloc_result_t { - enum zc_buf_layout_alloc_status_t status; - z_owned_shm_mut_t buf; - 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; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Unique protocol identifier. @@ -1104,47 +922,6 @@ typedef struct z_buf_layout_alloc_result_t { #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -typedef struct zc_context_t { - void *context; - void (*delete_fn)(void*); -} zc_context_t; -#endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Callbacks for ShmProviderBackend. - */ -#if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) -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; @@ -1204,15 +981,6 @@ typedef struct zc_owned_closure_matching_status_t { void (*_drop)(void *context); } zc_owned_closure_matching_status_t; #endif -/** - * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. - * @brief Loaned closure. - */ -#if defined(Z_FEATURE_UNSTABLE_API) -typedef struct zc_loaned_closure_matching_status_t { - size_t _0[3]; -} zc_loaned_closure_matching_status_t; -#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Moved closure. @@ -1222,9 +990,15 @@ typedef struct zc_moved_closure_matching_status_t { struct zc_owned_closure_matching_status_t _this; } zc_moved_closure_matching_status_t; #endif -typedef struct zc_moved_concurrent_close_handle_t { - struct zc_owned_concurrent_close_handle_t _this; -} zc_moved_concurrent_close_handle_t; +typedef struct zc_moved_internal_concurrent_close_handle_t { + struct zc_owned_internal_concurrent_close_handle_t _this; +} zc_moved_internal_concurrent_close_handle_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; /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Options passed to the `ze_declare_publication_cache()` function. @@ -1293,6 +1067,19 @@ 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; +/** + * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. + * @brief A loaned Zenoh publication cache. + */ +typedef struct ALIGN(8) ze_loaned_publication_cache_t { + uint8_t _0[96]; +} ze_loaned_publication_cache_t; +typedef struct ze_moved_querying_subscriber_t { + struct ze_owned_querying_subscriber_t _this; +} ze_moved_querying_subscriber_t; typedef struct ze_moved_serializer_t { struct ze_owned_serializer_t _this; } ze_moved_serializer_t; @@ -1319,7 +1106,7 @@ ZENOHC_API extern const unsigned int Z_SHM_POSIX_PROTOCOL_ID; #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1328,7 +1115,7 @@ void z_alloc_layout_alloc(struct z_buf_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1337,7 +1124,7 @@ void z_alloc_layout_alloc_gc(struct z_buf_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1346,7 +1133,7 @@ void z_alloc_layout_alloc_gc_defrag(struct z_buf_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1355,7 +1142,7 @@ void z_alloc_layout_alloc_gc_defrag_blocking(struct z_buf_alloc_result_t *out_re #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1363,7 +1150,7 @@ void z_alloc_layout_alloc_gc_defrag_dealloc(struct z_buf_alloc_result_t *out_res */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); +void z_alloc_layout_drop(struct z_moved_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1371,7 +1158,7 @@ void z_alloc_layout_drop(z_moved_alloc_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t *this_); +const struct z_loaned_alloc_layout_t *z_alloc_layout_loan(const struct z_owned_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1379,8 +1166,8 @@ const z_loaned_alloc_layout_t *z_alloc_layout_loan(const z_owned_alloc_layout_t */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -1392,7 +1179,7 @@ z_result_t z_alloc_layout_new(z_owned_alloc_layout_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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*)); @@ -1407,7 +1194,7 @@ z_result_t z_alloc_layout_threadsafe_alloc_gc_defrag_async(struct z_buf_alloc_re #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_as_loaned_shm(const struct z_loaned_bytes_t *this_, - const z_loaned_shm_t **dst); + const struct z_loaned_shm_t **dst); #endif /** * Constructs an owned shallow copy of data in provided uninitialized memory location. @@ -1474,7 +1261,7 @@ z_result_t z_bytes_from_buf(struct z_owned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_from_shm(struct z_owned_bytes_t *this_, - z_moved_shm_t *shm); + struct z_moved_shm_t *shm); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1483,7 +1270,7 @@ z_result_t z_bytes_from_shm(struct z_owned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_from_shm_mut(struct z_owned_bytes_t *this_, - z_moved_shm_mut_t *shm); + struct z_moved_shm_mut_t *shm); #endif /** * Converts a slice into `z_owned_bytes_t`. @@ -1610,7 +1397,7 @@ bool z_bytes_slice_iterator_next(struct z_bytes_slice_iterator_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_mut_loaned_shm(struct z_loaned_bytes_t *this_, - z_loaned_shm_t **dst); + struct z_loaned_shm_t **dst); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1622,7 +1409,7 @@ z_result_t z_bytes_to_mut_loaned_shm(struct z_loaned_bytes_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API z_result_t z_bytes_to_owned_shm(const struct z_loaned_bytes_t *this_, - z_owned_shm_t *dst); + struct z_owned_shm_t *dst); #endif /** * Converts data into an owned slice. @@ -1695,7 +1482,7 @@ z_result_t z_bytes_writer_write_all(struct z_loaned_bytes_writer_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); +void z_chunk_alloc_result_drop(struct z_moved_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -1703,7 +1490,7 @@ void z_chunk_alloc_result_drop(z_moved_chunk_alloc_result_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** @@ -1712,7 +1499,7 @@ void z_chunk_alloc_result_new_error(z_owned_chunk_alloc_result_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** @@ -2072,7 +1859,7 @@ z_result_t z_declare_publisher(const struct z_loaned_session_t *session, #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t z_declare_querier(const struct z_loaned_session_t *session, - z_owned_querier_t *querier, + struct z_owned_querier_t *querier, const struct z_loaned_keyexpr_t *key_expr, struct z_querier_options_t *options); #endif @@ -2530,7 +2317,7 @@ const struct z_loaned_encoding_t *z_encoding_zenoh_string(void); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); +uint32_t z_entity_global_id_eid(const struct z_entity_global_id_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2538,7 +2325,7 @@ uint32_t z_entity_global_id_eid(const z_entity_global_id_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -struct z_id_t z_entity_global_id_zid(const z_entity_global_id_t *this_); +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 @@ -2728,7 +2515,7 @@ ZENOHC_API struct z_id_t z_info_zid(const struct z_loaned_session_t *session); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_alloc_layout_check(const z_owned_alloc_layout_t *this_); +bool z_internal_alloc_layout_check(const struct z_owned_alloc_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2736,7 +2523,7 @@ bool z_internal_alloc_layout_check(const z_owned_alloc_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_alloc_layout_null(z_owned_alloc_layout_t *this_); +void z_internal_alloc_layout_null(struct z_owned_alloc_layout_t *this_); #endif /** * Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -2760,7 +2547,7 @@ ZENOHC_API void z_internal_bytes_writer_null(struct z_owned_bytes_writer_t *this */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *this_); +bool z_internal_chunk_alloc_result_check(const struct z_owned_chunk_alloc_result_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2768,7 +2555,7 @@ bool z_internal_chunk_alloc_result_check(const z_owned_chunk_alloc_result_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_chunk_alloc_result_null(z_owned_chunk_alloc_result_t *this_); +void z_internal_chunk_alloc_result_null(struct z_owned_chunk_alloc_result_t *this_); #endif /** * Returns ``true`` if closure is valid, ``false`` if it is in gravestone state. @@ -2883,7 +2670,7 @@ ZENOHC_API void z_internal_keyexpr_null(struct z_owned_keyexpr_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool z_internal_liveliness_token_check(const z_owned_liveliness_token_t *this_); +bool z_internal_liveliness_token_check(const struct z_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2891,7 +2678,7 @@ bool z_internal_liveliness_token_check(const z_owned_liveliness_token_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_internal_liveliness_token_null(z_owned_liveliness_token_t *this_); +void z_internal_liveliness_token_null(struct z_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2899,7 +2686,7 @@ void z_internal_liveliness_token_null(z_owned_liveliness_token_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_memory_layout_check(const z_owned_memory_layout_t *this_); +bool z_internal_memory_layout_check(const struct z_owned_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2907,7 +2694,7 @@ bool z_internal_memory_layout_check(const z_owned_memory_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_memory_layout_null(z_owned_memory_layout_t *this_); +void z_internal_memory_layout_null(struct z_owned_memory_layout_t *this_); #endif /** * Returns ``true`` if mutex is valid, ``false`` otherwise. @@ -2931,7 +2718,7 @@ ZENOHC_API void z_internal_publisher_null(struct z_owned_publisher_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool z_internal_querier_check(const z_owned_querier_t *this_); +bool z_internal_querier_check(const struct z_owned_querier_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -2939,7 +2726,7 @@ bool z_internal_querier_check(const z_owned_querier_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_internal_querier_null(z_owned_querier_t *this_); +void z_internal_querier_null(struct z_owned_querier_t *this_); #endif /** * Returns `false` if `this` is in a gravestone state, `true` otherwise. @@ -3022,7 +2809,7 @@ ZENOHC_API void z_internal_session_null(struct z_owned_session_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_check(const z_owned_shm_t *this_); +bool z_internal_shm_check(const struct z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3030,7 +2817,7 @@ bool z_internal_shm_check(const z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_client_check(const z_owned_shm_client_t *this_); +bool z_internal_shm_client_check(const struct z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3038,7 +2825,7 @@ bool z_internal_shm_client_check(const z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_client_null(z_owned_shm_client_t *this_); +void z_internal_shm_client_null(struct z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3046,7 +2833,7 @@ void z_internal_shm_client_null(z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_client_storage_check(const z_owned_shm_client_storage_t *this_); +bool z_internal_shm_client_storage_check(const struct z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3054,7 +2841,7 @@ bool z_internal_shm_client_storage_check(const z_owned_shm_client_storage_t *thi */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_client_storage_null(z_owned_shm_client_storage_t *this_); +void z_internal_shm_client_storage_null(struct z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3062,7 +2849,7 @@ void z_internal_shm_client_storage_null(z_owned_shm_client_storage_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_mut_check(const z_owned_shm_mut_t *this_); +bool z_internal_shm_mut_check(const struct z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3070,7 +2857,7 @@ bool z_internal_shm_mut_check(const z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_mut_null(z_owned_shm_mut_t *this_); +void z_internal_shm_mut_null(struct z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3078,7 +2865,7 @@ void z_internal_shm_mut_null(z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_null(z_owned_shm_t *this_); +void z_internal_shm_null(struct z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3086,7 +2873,7 @@ void z_internal_shm_null(z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool z_internal_shm_provider_check(const z_owned_shm_provider_t *this_); +bool z_internal_shm_provider_check(const struct z_owned_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3094,7 +2881,7 @@ bool z_internal_shm_provider_check(const z_owned_shm_provider_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_internal_shm_provider_null(z_owned_shm_provider_t *this_); +void z_internal_shm_provider_null(struct z_owned_shm_provider_t *this_); #endif /** * @return ``true`` if slice is not empty, ``false`` otherwise. @@ -3110,7 +2897,7 @@ ZENOHC_API void z_internal_slice_null(struct z_owned_slice_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool z_internal_source_info_check(const z_owned_source_info_t *this_); +bool z_internal_source_info_check(const struct z_owned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3118,7 +2905,7 @@ bool z_internal_source_info_check(const z_owned_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_internal_source_info_null(z_owned_source_info_t *this_); +void z_internal_source_info_null(struct z_owned_source_info_t *this_); #endif /** * @return ``true`` if the string array is valid, ``false`` if it is in a gravestone state. @@ -3324,7 +3111,7 @@ z_result_t z_liveliness_declare_subscriber(const struct z_loaned_session_t *sess #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t z_liveliness_declare_token(const struct z_loaned_session_t *session, - z_owned_liveliness_token_t *token, + struct z_owned_liveliness_token_t *token, const struct z_loaned_keyexpr_t *key_expr, const struct z_liveliness_token_options_t *_options); #endif @@ -3366,7 +3153,7 @@ void z_liveliness_subscriber_options_default(struct z_liveliness_subscriber_opti */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_liveliness_token_drop(z_moved_liveliness_token_t *this_); +void z_liveliness_token_drop(struct z_moved_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3374,7 +3161,7 @@ void z_liveliness_token_drop(z_moved_liveliness_token_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const z_loaned_liveliness_token_t *z_liveliness_token_loan(const z_owned_liveliness_token_t *this_); +const struct z_loaned_liveliness_token_t *z_liveliness_token_loan(const struct z_owned_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3390,7 +3177,7 @@ void z_liveliness_token_options_default(struct z_liveliness_token_options_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_liveliness_undeclare_token(z_moved_liveliness_token_t *this_); +z_result_t z_liveliness_undeclare_token(struct z_moved_liveliness_token_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3398,7 +3185,7 @@ z_result_t z_liveliness_undeclare_token(z_moved_liveliness_token_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_memory_layout_drop(z_moved_memory_layout_t *this_); +void z_memory_layout_drop(struct z_moved_memory_layout_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3406,7 +3193,7 @@ void z_memory_layout_drop(z_moved_memory_layout_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_memory_layout_get_data(const z_loaned_memory_layout_t *this_, +void z_memory_layout_get_data(const struct z_loaned_memory_layout_t *this_, size_t *out_size, struct z_alloc_alignment_t *out_alignment); #endif @@ -3416,7 +3203,7 @@ void z_memory_layout_get_data(const z_loaned_memory_layout_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3424,7 +3211,7 @@ const z_loaned_memory_layout_t *z_memory_layout_loan(const z_owned_memory_layout */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -3480,7 +3267,7 @@ ZENOHC_API void z_open_options_default(struct z_open_options_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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3488,7 +3275,7 @@ z_result_t z_open_with_custom_shm_clients(struct z_owned_session_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_posix_shm_client_new(z_owned_shm_client_t *this_); +void z_posix_shm_client_new(struct z_owned_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3496,8 +3283,8 @@ void z_posix_shm_client_new(z_owned_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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. @@ -3526,7 +3313,7 @@ ZENOHC_API void z_publisher_drop(struct z_moved_publisher_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); +struct z_entity_global_id_t z_publisher_id(const struct z_loaned_publisher_t *publisher); #endif /** * Returns the key expression of the publisher. @@ -3592,7 +3379,7 @@ ZENOHC_API void z_put_options_default(struct z_put_options_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_querier_drop(z_moved_querier_t *this_); +void z_querier_drop(struct z_moved_querier_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3608,7 +3395,7 @@ void z_querier_drop(z_moved_querier_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_querier_get(const z_loaned_querier_t *querier, +z_result_t z_querier_get(const struct z_loaned_querier_t *querier, const char *parameters, struct z_moved_closure_reply_t *callback, struct z_querier_get_options_t *options); @@ -3627,7 +3414,7 @@ void z_querier_get_options_default(struct z_querier_get_options_t *this_); */ #if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_entity_global_id_t z_querier_id(const z_loaned_querier_t *querier); +struct z_entity_global_id_t z_querier_id(const struct z_loaned_querier_t *querier); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3635,7 +3422,7 @@ z_entity_global_id_t z_querier_id(const z_loaned_querier_t *querier); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_keyexpr_t *z_querier_keyexpr(const z_loaned_querier_t *querier); +const struct z_loaned_keyexpr_t *z_querier_keyexpr(const struct z_loaned_querier_t *querier); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3643,7 +3430,7 @@ const struct z_loaned_keyexpr_t *z_querier_keyexpr(const z_loaned_querier_t *que */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const z_loaned_querier_t *z_querier_loan(const z_owned_querier_t *this_); +const struct z_loaned_querier_t *z_querier_loan(const struct z_owned_querier_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3651,7 +3438,7 @@ const z_loaned_querier_t *z_querier_loan(const z_owned_querier_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_loaned_querier_t *z_querier_loan_mut(z_owned_querier_t *this_); +struct z_loaned_querier_t *z_querier_loan_mut(struct z_owned_querier_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -3823,7 +3610,7 @@ ZENOHC_API void z_queryable_drop(struct z_moved_queryable_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_entity_global_id_t z_queryable_id(const struct z_loaned_queryable_t *queryable); +struct z_entity_global_id_t z_queryable_id(const struct z_loaned_queryable_t *queryable); #endif ZENOHC_API const struct z_loaned_queryable_t *z_queryable_loan(const struct z_owned_queryable_t *this_); @@ -3857,7 +3644,7 @@ ZENOHC_API uint8_t z_random_u8(void); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_ref_shm_client_storage_global(z_owned_shm_client_storage_t *this_); +void z_ref_shm_client_storage_global(struct z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4092,7 +3879,7 @@ enum z_reliability_t z_sample_reliability(const struct z_loaned_sample_t *this_) */ #if defined(Z_FEATURE_UNSTABLE_API) 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. @@ -4138,7 +3925,7 @@ ZENOHC_API struct z_loaned_session_t *z_session_loan_mut(struct z_owned_session_ */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_drop(z_moved_shm_client_t *this_); +void z_shm_client_drop(struct z_moved_shm_client_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4146,7 +3933,7 @@ void z_shm_client_drop(z_moved_shm_client_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4156,8 +3943,8 @@ void z_shm_client_new(z_owned_shm_client_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4165,7 +3952,7 @@ void z_shm_client_storage_clone(z_owned_shm_client_storage_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); +void z_shm_client_storage_drop(struct z_moved_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4173,7 +3960,7 @@ void z_shm_client_storage_drop(z_moved_shm_client_storage_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4181,8 +3968,8 @@ const z_loaned_shm_client_storage_t *z_shm_client_storage_loan(const z_owned_shm */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** @@ -4191,7 +3978,7 @@ z_result_t z_shm_client_storage_new(z_owned_shm_client_storage_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); +void z_shm_client_storage_new_default(struct z_owned_shm_client_storage_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4199,8 +3986,8 @@ void z_shm_client_storage_new_default(z_owned_shm_client_storage_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_clone(z_owned_shm_t *out, - const z_loaned_shm_t *this_); +void z_shm_clone(struct z_owned_shm_t *out, + const struct z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4208,7 +3995,7 @@ void z_shm_clone(z_owned_shm_t *out, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const unsigned char *z_shm_data(const z_loaned_shm_t *this_); +const unsigned char *z_shm_data(const struct z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4216,7 +4003,7 @@ const unsigned char *z_shm_data(const z_loaned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_drop(z_moved_shm_t *this_); +void z_shm_drop(struct z_moved_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4224,8 +4011,8 @@ void z_shm_drop(z_moved_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_from_mut(z_owned_shm_t *this_, - z_moved_shm_mut_t *that); +void z_shm_from_mut(struct z_owned_shm_t *this_, + struct z_moved_shm_mut_t *that); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4233,7 +4020,7 @@ void z_shm_from_mut(z_owned_shm_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_len(const z_loaned_shm_t *this_); +size_t z_shm_len(const struct z_loaned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4241,7 +4028,7 @@ size_t z_shm_len(const z_loaned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); +const struct z_loaned_shm_t *z_shm_loan(const struct z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4249,7 +4036,7 @@ const z_loaned_shm_t *z_shm_loan(const z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); +struct z_loaned_shm_t *z_shm_loan_mut(struct z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4257,7 +4044,7 @@ z_loaned_shm_t *z_shm_loan_mut(z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); +const unsigned char *z_shm_mut_data(const struct z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4265,7 +4052,7 @@ const unsigned char *z_shm_mut_data(const z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); +unsigned char *z_shm_mut_data_mut(struct z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4273,7 +4060,7 @@ unsigned char *z_shm_mut_data_mut(z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_mut_drop(z_moved_shm_mut_t *this_); +void z_shm_mut_drop(struct z_moved_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4281,7 +4068,7 @@ void z_shm_mut_drop(z_moved_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); +size_t z_shm_mut_len(const struct z_loaned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4289,7 +4076,7 @@ size_t z_shm_mut_len(const z_loaned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); +const struct z_loaned_shm_mut_t *z_shm_mut_loan(const struct z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4297,7 +4084,7 @@ const z_loaned_shm_mut_t *z_shm_mut_loan(const z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); +struct z_loaned_shm_mut_t *z_shm_mut_loan_mut(struct z_owned_shm_mut_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4311,9 +4098,9 @@ z_loaned_shm_mut_t *z_shm_mut_loan_mut(z_owned_shm_mut_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, - z_moved_shm_t *that, - z_owned_shm_t *immut); +z_result_t z_shm_mut_try_from_immut(struct z_owned_shm_mut_t *this_, + struct z_moved_shm_t *that, + struct z_owned_shm_t *immut); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4322,7 +4109,7 @@ z_result_t z_shm_mut_try_from_immut(z_owned_shm_mut_t *this_, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4333,7 +4120,7 @@ void z_shm_provider_alloc(struct z_buf_layout_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4344,7 +4131,7 @@ void z_shm_provider_alloc_gc(struct z_buf_layout_alloc_result_t *out_result, #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4356,7 +4143,7 @@ void z_shm_provider_alloc_gc_defrag(struct z_buf_layout_alloc_result_t *out_resu #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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, @@ -4370,7 +4157,7 @@ z_result_t z_shm_provider_alloc_gc_defrag_async(struct z_buf_layout_alloc_result #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4381,7 +4168,7 @@ void z_shm_provider_alloc_gc_defrag_blocking(struct z_buf_layout_alloc_result_t #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4391,7 +4178,7 @@ void z_shm_provider_alloc_gc_defrag_dealloc(struct z_buf_layout_alloc_result_t * */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); +size_t z_shm_provider_available(const struct z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4400,7 +4187,7 @@ size_t z_shm_provider_available(const z_loaned_shm_provider_t *provider); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); +size_t z_shm_provider_defragment(const struct z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4408,7 +4195,7 @@ size_t z_shm_provider_defragment(const z_loaned_shm_provider_t *provider); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void z_shm_provider_drop(z_moved_shm_provider_t *this_); +void z_shm_provider_drop(struct z_moved_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4416,7 +4203,7 @@ void z_shm_provider_drop(z_moved_shm_provider_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); +size_t z_shm_provider_garbage_collect(const struct z_loaned_shm_provider_t *provider); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4424,7 +4211,7 @@ size_t z_shm_provider_garbage_collect(const z_loaned_shm_provider_t *provider); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t *this_); +const struct z_loaned_shm_provider_t *z_shm_provider_loan(const struct z_owned_shm_provider_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4432,8 +4219,8 @@ const z_loaned_shm_provider_t *z_shm_provider_loan(const z_owned_shm_provider_t */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 @@ -4443,7 +4230,7 @@ z_result_t z_shm_provider_map(z_owned_shm_mut_t *out_result, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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); @@ -4454,7 +4241,7 @@ void z_shm_provider_new(z_owned_shm_provider_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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); @@ -4465,7 +4252,7 @@ void z_shm_provider_threadsafe_new(z_owned_shm_provider_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); +struct z_loaned_shm_mut_t *z_shm_try_mut(struct z_owned_shm_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4473,7 +4260,7 @@ z_loaned_shm_mut_t *z_shm_try_mut(z_owned_shm_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_loaned_shm_mut_t *z_shm_try_reloan_mut(z_loaned_shm_t *this_); +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. @@ -4546,7 +4333,7 @@ ZENOHC_API const struct z_loaned_slice_t *z_slice_loan(const struct z_owned_slic */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void z_source_info_drop(z_moved_source_info_t *this_); +void z_source_info_drop(struct z_moved_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4554,7 +4341,7 @@ void z_source_info_drop(z_moved_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); +struct z_entity_global_id_t z_source_info_id(const struct z_loaned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4562,7 +4349,7 @@ z_entity_global_id_t z_source_info_id(const z_loaned_source_info_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *this_); +const struct z_loaned_source_info_t *z_source_info_loan(const struct z_owned_source_info_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -4570,8 +4357,8 @@ const z_loaned_source_info_t *z_source_info_loan(const z_owned_source_info_t *th */ #if defined(Z_FEATURE_UNSTABLE_API) 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, uint32_t source_sn); #endif /** @@ -4580,7 +4367,7 @@ z_result_t z_source_info_new(z_owned_source_info_t *this_, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -uint32_t z_source_info_sn(const z_loaned_source_info_t *this_); +uint32_t z_source_info_sn(const struct z_loaned_source_info_t *this_); #endif /** * Constructs an owned copy of a string array. @@ -4803,7 +4590,7 @@ ZENOHC_API z_result_t z_undeclare_publisher(struct z_moved_publisher_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t z_undeclare_querier(z_moved_querier_t *this_); +z_result_t z_undeclare_querier(struct z_moved_querier_t *this_); #endif /** * Undeclares a `z_owned_queryable_t`. @@ -5071,12 +4858,17 @@ const struct zc_loaned_closure_matching_status_t *zc_closure_matching_status_loa /** * @brief Drops the close handle. The concurrent close task will not be interrupted. */ -ZENOHC_API void zc_concurrent_close_handle_drop(struct zc_moved_concurrent_close_handle_t *this_); +#if defined(Z_FEATURE_UNSTABLE_API) +ZENOHC_API +void zc_concurrent_close_handle_drop(struct zc_moved_internal_concurrent_close_handle_t *this_); +#endif /** * @brief Blocking wait on close handle to complete. Returns `Z_EIO` if close finishes with error. */ +#if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_concurrent_close_handle_wait(struct zc_moved_concurrent_close_handle_t *handle); +z_result_t zc_concurrent_close_handle_wait(struct zc_moved_internal_concurrent_close_handle_t *handle); +#endif /** * Constructs a configuration by parsing a file path stored in ZENOH_CONFIG environmental variable. * @@ -5190,20 +4982,24 @@ void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_s /** * @brief Returns ``true`` if concurrent close handle is valid, ``false`` if it is in gravestone state. */ +#if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool zc_internal_concurrent_close_handle_check(const struct zc_owned_concurrent_close_handle_t *this_); +bool zc_internal_concurrent_close_handle_check(const struct zc_owned_internal_concurrent_close_handle_t *this_); +#endif /** * @brief Constructs concurrent close handle in its gravestone state. */ +#if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_internal_concurrent_close_handle_null(struct zc_owned_concurrent_close_handle_t *this_); +void zc_internal_concurrent_close_handle_null(struct zc_owned_internal_concurrent_close_handle_t *this_); +#endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. * @brief Checks the matching listener is for the gravestone state */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool zc_internal_matching_listener_check(const zc_owned_matching_listener_t *this_); +bool zc_internal_matching_listener_check(const struct zc_owned_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5211,7 +5007,7 @@ bool zc_internal_matching_listener_check(const zc_owned_matching_listener_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_internal_matching_listener_null(zc_owned_matching_listener_t *this_); +void zc_internal_matching_listener_null(struct zc_owned_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5219,7 +5015,7 @@ void zc_internal_matching_listener_null(zc_owned_matching_listener_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -bool zc_internal_shm_client_list_check(const zc_owned_shm_client_list_t *this_); +bool zc_internal_shm_client_list_check(const struct zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5227,7 +5023,7 @@ bool zc_internal_shm_client_list_check(const zc_owned_shm_client_list_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_internal_shm_client_list_null(zc_owned_shm_client_list_t *this_); +void zc_internal_shm_client_list_null(struct zc_owned_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5261,7 +5057,7 @@ enum zc_locality_t zc_locality_default(void); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_matching_listener_drop(zc_moved_matching_listener_t *this_); +void zc_matching_listener_drop(struct zc_moved_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5291,7 +5087,7 @@ z_result_t zc_publisher_declare_background_matching_listener(const struct z_loan #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t zc_publisher_declare_matching_listener(const struct z_loaned_publisher_t *publisher, - zc_owned_matching_listener_t *matching_listener, + struct zc_owned_matching_listener_t *matching_listener, struct zc_moved_closure_matching_status_t *callback); #endif /** @@ -5317,7 +5113,7 @@ z_result_t zc_publisher_get_matching_status(const struct z_loaned_publisher_t *t */ #if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_querier_declare_background_matching_listener(const z_loaned_querier_t *querier, +z_result_t zc_querier_declare_background_matching_listener(const struct z_loaned_querier_t *querier, struct zc_moved_closure_matching_status_t *callback); #endif /** @@ -5332,8 +5128,8 @@ z_result_t zc_querier_declare_background_matching_listener(const z_loaned_querie */ #if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_querier_declare_matching_listener(const z_loaned_querier_t *querier, - zc_owned_matching_listener_t *matching_listener, +z_result_t zc_querier_declare_matching_listener(const struct z_loaned_querier_t *querier, + struct zc_owned_matching_listener_t *matching_listener, struct zc_moved_closure_matching_status_t *callback); #endif /** @@ -5344,7 +5140,7 @@ z_result_t zc_querier_declare_matching_listener(const z_loaned_querier_t *querie */ #if (defined(Z_FEATURE_UNSTABLE_API) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_querier_get_matching_status(const z_loaned_querier_t *this_, +z_result_t zc_querier_get_matching_status(const struct z_loaned_querier_t *this_, struct zc_matching_status_t *matching_status); #endif /** @@ -5361,9 +5157,9 @@ enum zc_reply_keyexpr_t zc_reply_keyexpr_default(void); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -z_result_t zc_shm_client_list_add_client(zc_loaned_shm_client_list_t *this_, +z_result_t zc_shm_client_list_add_client(struct zc_loaned_shm_client_list_t *this_, z_protocol_id_t id, - z_moved_shm_client_t *client); + struct z_moved_shm_client_t *client); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5371,7 +5167,7 @@ z_result_t zc_shm_client_list_add_client(zc_loaned_shm_client_list_t *this_, */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); +void zc_shm_client_list_drop(struct zc_moved_shm_client_list_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5379,7 +5175,7 @@ void zc_shm_client_list_drop(zc_moved_shm_client_list_t *this_); */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5387,7 +5183,7 @@ const zc_loaned_shm_client_list_t *zc_shm_client_list_loan(const zc_owned_shm_cl */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5395,7 +5191,7 @@ zc_loaned_shm_client_list_t *zc_shm_client_list_loan_mut(zc_owned_shm_client_lis */ #if (defined(Z_FEATURE_SHARED_MEMORY) && defined(Z_FEATURE_UNSTABLE_API)) ZENOHC_API -void zc_shm_client_list_new(zc_owned_shm_client_list_t *this_); +void zc_shm_client_list_new(struct zc_owned_shm_client_list_t *this_); #endif /** * Stops all Zenoh tasks and drops all related static variables. @@ -5421,7 +5217,7 @@ void zc_try_init_log_from_env(void); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_undeclare_matching_listener(zc_moved_matching_listener_t *this_); +z_result_t zc_undeclare_matching_listener(struct zc_moved_matching_listener_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5472,7 +5268,7 @@ z_result_t ze_declare_background_querying_subscriber(const struct z_loaned_sessi #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t ze_declare_publication_cache(const struct z_loaned_session_t *session, - ze_owned_publication_cache_t *pub_cache, + struct ze_owned_publication_cache_t *pub_cache, const struct z_loaned_keyexpr_t *key_expr, struct ze_publication_cache_options_t *options); #endif @@ -5491,7 +5287,7 @@ z_result_t ze_declare_publication_cache(const struct z_loaned_session_t *session #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API z_result_t ze_declare_querying_subscriber(const struct z_loaned_session_t *session, - ze_owned_querying_subscriber_t *querying_subscriber, + struct ze_owned_querying_subscriber_t *querying_subscriber, const struct z_loaned_keyexpr_t *key_expr, struct z_moved_closure_sample_t *callback, struct ze_querying_subscriber_options_t *options); @@ -5675,7 +5471,7 @@ ZENOHC_API bool ze_deserializer_is_done(const struct ze_deserializer_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool ze_internal_publication_cache_check(const ze_owned_publication_cache_t *this_); +bool ze_internal_publication_cache_check(const struct ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5683,7 +5479,7 @@ bool ze_internal_publication_cache_check(const ze_owned_publication_cache_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_internal_publication_cache_null(ze_owned_publication_cache_t *this_); +void ze_internal_publication_cache_null(struct ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5691,13 +5487,13 @@ void ze_internal_publication_cache_null(ze_owned_publication_cache_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool ze_internal_querying_subscriber_check(const ze_owned_querying_subscriber_t *this_); +bool ze_internal_querying_subscriber_check(const struct ze_owned_querying_subscriber_t *this_); #endif /** * Constructs a querying subscriber in a gravestone state. */ #if defined(Z_FEATURE_UNSTABLE_API) -ZENOHC_API void ze_internal_querying_subscriber_null(ze_owned_querying_subscriber_t *this_); +ZENOHC_API void ze_internal_querying_subscriber_null(struct ze_owned_querying_subscriber_t *this_); #endif /** * @brief Returns ``true`` if `this_` is in a valid state, ``false`` if it is in a gravestone state. @@ -5714,7 +5510,7 @@ ZENOHC_API void ze_internal_serializer_null(struct ze_owned_serializer_t *this_) */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); +void ze_publication_cache_drop(struct ze_moved_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5722,7 +5518,7 @@ void ze_publication_cache_drop(ze_moved_publication_cache_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const ze_loaned_publication_cache_t *this_); +const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const struct ze_loaned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5730,7 +5526,7 @@ const struct z_loaned_keyexpr_t *ze_publication_cache_keyexpr(const ze_loaned_pu */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -const ze_loaned_publication_cache_t *ze_publication_cache_loan(const ze_owned_publication_cache_t *this_); +const struct ze_loaned_publication_cache_t *ze_publication_cache_loan(const struct ze_owned_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5747,7 +5543,7 @@ void ze_publication_cache_options_default(struct ze_publication_cache_options_t */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); +void ze_querying_subscriber_drop(struct ze_moved_querying_subscriber_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -5757,7 +5553,7 @@ void ze_querying_subscriber_drop(ze_moved_querying_subscriber_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) 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 @@ -5767,7 +5563,7 @@ z_result_t ze_querying_subscriber_get(const ze_loaned_querying_subscriber_t *thi */ #if defined(Z_FEATURE_UNSTABLE_API) 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 /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -6012,7 +5808,7 @@ z_result_t ze_serializer_serialize_uint8(struct ze_loaned_serializer_t *this_, */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); +z_result_t ze_undeclare_publication_cache(struct ze_moved_publication_cache_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. @@ -6022,5 +5818,5 @@ z_result_t ze_undeclare_publication_cache(ze_moved_publication_cache_t *this_); */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t ze_undeclare_querying_subscriber(ze_moved_querying_subscriber_t *this_); +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 f1c6cb6ce..4f4e40fbc 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -4,8 +4,10 @@ #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_bytes_writer_t* z_bytes_writer_move(z_owned_bytes_writer_t* x) { return (z_moved_bytes_writer_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); } @@ -19,8 +21,11 @@ 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_liveliness_token_t* z_liveliness_token_move(z_owned_liveliness_token_t* x) { return (z_moved_liveliness_token_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_querier_t* z_querier_move(z_owned_querier_t* x) { return (z_moved_querier_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); } @@ -30,18 +35,30 @@ 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_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_concurrent_close_handle_t* x) { return (zc_moved_concurrent_close_handle_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_internal_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_internal_concurrent_close_handle_t* x) { return (zc_moved_internal_concurrent_close_handle_t*)(x); } +static inline zc_moved_matching_listener_t* zc_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); } static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x) { return (ze_moved_serializer_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_bytes_writer_t : z_bytes_writer_loan, \ z_owned_closure_hello_t : z_closure_hello_loan, \ @@ -57,7 +74,10 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_liveliness_token_t : z_liveliness_token_loan, \ + z_owned_memory_layout_t : z_memory_layout_loan, \ z_owned_publisher_t : z_publisher_loan, \ + z_owned_querier_t : z_querier_loan, \ z_owned_query_t : z_query_loan, \ z_owned_queryable_t : z_queryable_loan, \ z_owned_reply_err_t : z_reply_err_loan, \ @@ -67,7 +87,12 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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, \ @@ -75,6 +100,10 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_shm_client_list_t : zc_shm_client_list_loan, \ + ze_owned_publication_cache_t : ze_publication_cache_loan, \ + ze_owned_querying_subscriber_t : ze_querying_subscriber_loan, \ ze_owned_serializer_t : ze_serializer_loan \ )(&this_) @@ -91,15 +120,21 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_querier_t : z_querier_loan_mut, \ z_owned_session_t : z_session_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, \ ze_owned_serializer_t : ze_serializer_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_bytes_writer_t* : z_bytes_writer_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, \ @@ -113,8 +148,11 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_liveliness_token_t* : z_liveliness_token_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_querier_t* : z_querier_drop, \ z_moved_query_t* : z_query_drop, \ z_moved_queryable_t* : z_queryable_drop, \ z_moved_reply_t* : z_reply_drop, \ @@ -124,20 +162,33 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_concurrent_close_handle_t* : zc_concurrent_close_handle_drop, \ + zc_moved_closure_matching_status_t* : zc_closure_matching_status_drop, \ + zc_moved_internal_concurrent_close_handle_t* : zc_concurrent_close_handle_drop, \ + zc_moved_matching_listener_t* : zc_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, \ ze_moved_serializer_t* : ze_serializer_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_bytes_writer_t : z_bytes_writer_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, \ @@ -151,8 +202,11 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_liveliness_token_t : z_liveliness_token_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_querier_t : z_querier_move, \ z_owned_query_t : z_query_move, \ z_owned_queryable_t : z_queryable_move, \ z_owned_reply_t : z_reply_move, \ @@ -162,20 +216,33 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_concurrent_close_handle_t : zc_concurrent_close_handle_move, \ + zc_owned_closure_matching_status_t : zc_closure_matching_status_move, \ + zc_owned_internal_concurrent_close_handle_t : zc_concurrent_close_handle_move, \ + zc_owned_matching_listener_t : zc_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, \ ze_owned_serializer_t : ze_serializer_move \ )(&this_) #define z_internal_null(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t* : z_internal_alloc_layout_null, \ z_owned_bytes_t* : z_internal_bytes_null, \ z_owned_bytes_writer_t* : z_internal_bytes_writer_null, \ + z_owned_chunk_alloc_result_t* : z_internal_chunk_alloc_result_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, \ @@ -189,8 +256,11 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_liveliness_token_t* : z_internal_liveliness_token_null, \ + z_owned_memory_layout_t* : z_internal_memory_layout_null, \ z_owned_mutex_t* : z_internal_mutex_null, \ z_owned_publisher_t* : z_internal_publisher_null, \ + z_owned_querier_t* : z_internal_querier_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, \ @@ -200,18 +270,31 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_shm_client_t* : z_internal_shm_client_null, \ + z_owned_shm_client_storage_t* : z_internal_shm_client_storage_null, \ + z_owned_shm_mut_t* : z_internal_shm_mut_null, \ + z_owned_shm_t* : z_internal_shm_null, \ + z_owned_shm_provider_t* : z_internal_shm_provider_null, \ z_owned_slice_t* : z_internal_slice_null, \ + z_owned_source_info_t* : z_internal_source_info_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, \ - zc_owned_concurrent_close_handle_t* : zc_internal_concurrent_close_handle_null, \ + zc_owned_closure_matching_status_t* : zc_internal_closure_matching_status_null, \ + zc_owned_internal_concurrent_close_handle_t* : zc_internal_concurrent_close_handle_null, \ + zc_owned_matching_listener_t* : zc_internal_matching_listener_null, \ + zc_owned_shm_client_list_t* : zc_internal_shm_client_list_null, \ + ze_owned_publication_cache_t* : ze_internal_publication_cache_null, \ + ze_owned_querying_subscriber_t* : ze_internal_querying_subscriber_null, \ ze_owned_serializer_t* : ze_internal_serializer_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_internal_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_internal_bytes_null(&x->_this); } static inline void z_bytes_writer_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { *this_ = x->_this; z_internal_bytes_writer_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_internal_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_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); } @@ -225,8 +308,11 @@ 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_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_liveliness_token_take(z_owned_liveliness_token_t* this_, z_moved_liveliness_token_t* x) { *this_ = x->_this; z_internal_liveliness_token_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_internal_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_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_querier_take(z_owned_querier_t* this_, z_moved_querier_t* x) { *this_ = x->_this; z_internal_querier_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); } @@ -236,20 +322,33 @@ 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_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_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_internal_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_internal_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_internal_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_internal_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_internal_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_internal_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_internal_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_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); } -static inline void zc_concurrent_close_handle_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_concurrent_close_handle_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_internal_closure_matching_status_null(&x->_this); } +static inline void zc_concurrent_close_handle_take(zc_owned_internal_concurrent_close_handle_t* this_, zc_moved_internal_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_internal_concurrent_close_handle_null(&x->_this); } +static inline void zc_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_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_internal_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_internal_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_internal_querying_subscriber_null(&x->_this); } static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { *this_ = x->_this; ze_internal_serializer_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_bytes_writer_t* : z_bytes_writer_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, \ @@ -263,8 +362,11 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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_liveliness_token_t* : z_liveliness_token_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_querier_t* : z_querier_take, \ z_owned_query_t* : z_query_take, \ z_owned_queryable_t* : z_queryable_take, \ z_owned_reply_t* : z_reply_take, \ @@ -274,20 +376,33 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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_concurrent_close_handle_t* : zc_concurrent_close_handle_take, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status_take, \ + zc_owned_internal_concurrent_close_handle_t* : zc_concurrent_close_handle_take, \ + zc_owned_matching_listener_t* : zc_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, \ ze_owned_serializer_t* : ze_serializer_take \ )(this_, x) #define z_internal_check(this_) \ _Generic((this_), \ + z_owned_alloc_layout_t : z_internal_alloc_layout_check, \ z_owned_bytes_t : z_internal_bytes_check, \ z_owned_bytes_writer_t : z_internal_bytes_writer_check, \ + z_owned_chunk_alloc_result_t : z_internal_chunk_alloc_result_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, \ @@ -301,8 +416,11 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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_liveliness_token_t : z_internal_liveliness_token_check, \ + z_owned_memory_layout_t : z_internal_memory_layout_check, \ z_owned_mutex_t : z_internal_mutex_check, \ z_owned_publisher_t : z_internal_publisher_check, \ + z_owned_querier_t : z_internal_querier_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, \ @@ -312,13 +430,24 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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_shm_t : z_internal_shm_check, \ + z_owned_shm_client_t : z_internal_shm_client_check, \ + z_owned_shm_client_storage_t : z_internal_shm_client_storage_check, \ + z_owned_shm_mut_t : z_internal_shm_mut_check, \ + z_owned_shm_provider_t : z_internal_shm_provider_check, \ z_owned_slice_t : z_internal_slice_check, \ + z_owned_source_info_t : z_internal_source_info_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, \ - zc_owned_concurrent_close_handle_t : zc_internal_concurrent_close_handle_check, \ + zc_owned_closure_matching_status_t : zc_internal_closure_matching_status_check, \ + zc_owned_internal_concurrent_close_handle_t : zc_internal_concurrent_close_handle_check, \ + zc_owned_matching_listener_t : zc_internal_matching_listener_check, \ + zc_owned_shm_client_list_t : zc_internal_shm_client_list_check, \ + ze_owned_publication_cache_t : ze_internal_publication_cache_check, \ + ze_owned_querying_subscriber_t : ze_internal_querying_subscriber_check, \ ze_owned_serializer_t : ze_internal_serializer_check \ )(&this_) @@ -328,7 +457,8 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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 z_loaned_closure_zid_t* : z_closure_zid_call, \ + const zc_loaned_closure_matching_status_t* : zc_closure_matching_status_call \ )(closure, hello) typedef void(*z_closure_drop_callback_t)(void *context); @@ -338,6 +468,7 @@ typedef void(*z_closure_reply_callback_t)(z_loaned_reply_t *reply, void *context typedef void(*z_closure_sample_callback_t)(z_loaned_sample_t *sample, void *context); typedef void(*z_closure_zid_callback_t)(const z_id_t *z_id, void *context); typedef void(*zc_closure_log_callback_t)(zc_log_severity_t severity, const z_loaned_string_t *msg, void *context); +typedef void(*zc_closure_matching_status_callback_t)(const zc_matching_status_t *matching_status, void *context); #define z_closure(this_, call, drop, context) \ _Generic((this_), \ @@ -346,7 +477,8 @@ typedef void(*zc_closure_log_callback_t)(zc_log_severity_t severity, const z_loa z_owned_closure_reply_t* : z_closure_reply, \ z_owned_closure_sample_t* : z_closure_sample, \ z_owned_closure_zid_t* : z_closure_zid, \ - zc_owned_closure_log_t* : zc_closure_log \ + zc_owned_closure_log_t* : zc_closure_log, \ + zc_owned_closure_matching_status_t* : zc_closure_matching_status \ )(this_, call, drop, context) #define z_try_recv(this_, query) \ @@ -380,6 +512,8 @@ typedef void(*zc_closure_log_callback_t)(zc_log_severity_t severity, const z_loa z_owned_reply_t* : z_reply_clone, \ z_owned_reply_err_t* : z_reply_err_clone, \ z_owned_sample_t* : z_sample_clone, \ + z_owned_shm_client_storage_t* : z_shm_client_storage_clone, \ + z_owned_shm_t* : z_shm_clone, \ z_owned_slice_t* : z_slice_clone, \ z_owned_string_array_t* : z_string_array_clone, \ z_owned_string_t* : z_string_clone \ @@ -387,8 +521,10 @@ typedef void(*zc_closure_log_callback_t)(zc_log_severity_t severity, const z_loa #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_bytes_writer_t* z_bytes_writer_move(z_owned_bytes_writer_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); } @@ -402,8 +538,11 @@ 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_liveliness_token_t* z_liveliness_token_move(z_owned_liveliness_token_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_querier_t* z_querier_move(z_owned_querier_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); } @@ -413,17 +552,29 @@ 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_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_concurrent_close_handle_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_internal_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_internal_concurrent_close_handle_t* x) { return reinterpret_cast(x); } +static inline zc_moved_matching_listener_t* zc_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); } static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_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_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); }; @@ -439,7 +590,10 @@ 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_liveliness_token_t* z_loan(const z_owned_liveliness_token_t& this_) { return z_liveliness_token_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_querier_t* z_loan(const z_owned_querier_t& this_) { return z_querier_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_); }; inline const z_loaned_reply_err_t* z_loan(const z_owned_reply_err_t& this_) { return z_reply_err_loan(&this_); }; @@ -449,7 +603,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_); }; @@ -457,6 +616,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_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_publication_cache_t* z_loan(const ze_owned_publication_cache_t& this_) { return ze_publication_cache_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 const ze_loaned_serializer_t* z_loan(const ze_owned_serializer_t& this_) { return ze_serializer_loan(&this_); }; @@ -471,13 +634,19 @@ 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_querier_t* z_loan_mut(z_owned_querier_t& this_) { return z_querier_loan_mut(&this_); }; inline z_loaned_session_t* z_loan_mut(z_owned_session_t& this_) { return z_session_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 ze_loaned_serializer_t* z_loan_mut(ze_owned_serializer_t& this_) { return ze_serializer_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_bytes_writer_t* this_) { z_bytes_writer_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_); }; @@ -491,8 +660,11 @@ 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_liveliness_token_t* this_) { z_liveliness_token_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_querier_t* this_) { z_querier_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_); }; @@ -502,18 +674,31 @@ 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_concurrent_close_handle_t* this_) { zc_concurrent_close_handle_drop(this_); }; +inline void z_drop(zc_moved_closure_matching_status_t* closure_) { zc_closure_matching_status_drop(closure_); }; +inline void z_drop(zc_moved_internal_concurrent_close_handle_t* this_) { zc_concurrent_close_handle_drop(this_); }; +inline void z_drop(zc_moved_matching_listener_t* this_) { zc_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_serializer_t* this_) { ze_serializer_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_bytes_writer_t* z_move(z_owned_bytes_writer_t& this_) { return z_bytes_writer_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_); }; @@ -527,8 +712,11 @@ 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_liveliness_token_t* z_move(z_owned_liveliness_token_t& this_) { return z_liveliness_token_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_querier_t* z_move(z_owned_querier_t& this_) { return z_querier_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_); }; @@ -538,18 +726,31 @@ 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_concurrent_close_handle_t* z_move(zc_owned_concurrent_close_handle_t& this_) { return zc_concurrent_close_handle_move(&this_); }; +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_internal_concurrent_close_handle_t* z_move(zc_owned_internal_concurrent_close_handle_t& this_) { return zc_concurrent_close_handle_move(&this_); }; +inline zc_moved_matching_listener_t* z_move(zc_owned_matching_listener_t& this_) { return zc_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_serializer_t* z_move(ze_owned_serializer_t& this_) { return ze_serializer_move(&this_); }; +inline void z_internal_null(z_owned_alloc_layout_t* this_) { z_internal_alloc_layout_null(this_); }; inline void z_internal_null(z_owned_bytes_t* this_) { z_internal_bytes_null(this_); }; inline void z_internal_null(z_owned_bytes_writer_t* this_) { z_internal_bytes_writer_null(this_); }; +inline void z_internal_null(z_owned_chunk_alloc_result_t* this_) { z_internal_chunk_alloc_result_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_); }; @@ -563,8 +764,11 @@ inline void z_internal_null(z_owned_fifo_handler_reply_t* this_) { z_internal_fi 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_liveliness_token_t* this_) { z_internal_liveliness_token_null(this_); }; +inline void z_internal_null(z_owned_memory_layout_t* this_) { z_internal_memory_layout_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_querier_t* this_) { z_internal_querier_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_); }; @@ -574,17 +778,30 @@ inline void z_internal_null(z_owned_ring_handler_reply_t* this_) { z_internal_ri 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_shm_client_t* this_) { z_internal_shm_client_null(this_); }; +inline void z_internal_null(z_owned_shm_client_storage_t* this_) { z_internal_shm_client_storage_null(this_); }; +inline void z_internal_null(z_owned_shm_mut_t* this_) { z_internal_shm_mut_null(this_); }; +inline void z_internal_null(z_owned_shm_t* this_) { z_internal_shm_null(this_); }; +inline void z_internal_null(z_owned_shm_provider_t* this_) { z_internal_shm_provider_null(this_); }; inline void z_internal_null(z_owned_slice_t* this_) { z_internal_slice_null(this_); }; +inline void z_internal_null(z_owned_source_info_t* this_) { z_internal_source_info_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_); }; -inline void z_internal_null(zc_owned_concurrent_close_handle_t* this_) { zc_internal_concurrent_close_handle_null(this_); }; +inline void z_internal_null(zc_owned_closure_matching_status_t* this_) { zc_internal_closure_matching_status_null(this_); }; +inline void z_internal_null(zc_owned_internal_concurrent_close_handle_t* this_) { zc_internal_concurrent_close_handle_null(this_); }; +inline void z_internal_null(zc_owned_matching_listener_t* this_) { zc_internal_matching_listener_null(this_); }; +inline void z_internal_null(zc_owned_shm_client_list_t* this_) { zc_internal_shm_client_list_null(this_); }; +inline void z_internal_null(ze_owned_publication_cache_t* this_) { ze_internal_publication_cache_null(this_); }; +inline void z_internal_null(ze_owned_querying_subscriber_t* this_) { ze_internal_querying_subscriber_null(this_); }; inline void z_internal_null(ze_owned_serializer_t* this_) { ze_internal_serializer_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_internal_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_internal_bytes_null(&x->_this); } static inline void z_bytes_writer_take(z_owned_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { *this_ = x->_this; z_internal_bytes_writer_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_internal_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_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); } @@ -598,8 +815,11 @@ 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_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_liveliness_token_take(z_owned_liveliness_token_t* this_, z_moved_liveliness_token_t* x) { *this_ = x->_this; z_internal_liveliness_token_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_internal_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_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_querier_take(z_owned_querier_t* this_, z_moved_querier_t* x) { *this_ = x->_this; z_internal_querier_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); } @@ -609,23 +829,40 @@ 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_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_shm_client_take(z_owned_shm_client_t* this_, z_moved_shm_client_t* x) { *this_ = x->_this; z_internal_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_internal_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_internal_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_internal_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_internal_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_internal_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_internal_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_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); } -static inline void zc_concurrent_close_handle_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_concurrent_close_handle_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_internal_closure_matching_status_null(&x->_this); } +static inline void zc_concurrent_close_handle_take(zc_owned_internal_concurrent_close_handle_t* this_, zc_moved_internal_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_internal_concurrent_close_handle_null(&x->_this); } +static inline void zc_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_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_internal_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_internal_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_internal_querying_subscriber_null(&x->_this); } static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { *this_ = x->_this; ze_internal_serializer_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_bytes_writer_t* this_, z_moved_bytes_writer_t* x) { z_bytes_writer_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); }; @@ -665,12 +902,21 @@ 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_liveliness_token_t* this_, z_moved_liveliness_token_t* x) { + z_liveliness_token_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_querier_t* this_, z_moved_querier_t* x) { + z_querier_take(this_, x); +}; inline void z_take(z_owned_query_t* this_, z_moved_query_t* x) { z_query_take(this_, x); }; @@ -698,9 +944,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); }; @@ -716,16 +980,33 @@ 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_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* 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_internal_concurrent_close_handle_t* this_, zc_moved_internal_concurrent_close_handle_t* x) { zc_concurrent_close_handle_take(this_, x); }; +inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { + zc_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 void z_take(ze_owned_serializer_t* this_, ze_moved_serializer_t* x) { ze_serializer_take(this_, x); }; +inline bool z_internal_check(const z_owned_alloc_layout_t& this_) { return z_internal_alloc_layout_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_bytes_writer_t& this_) { return z_internal_bytes_writer_check(&this_); }; +inline bool z_internal_check(const z_owned_chunk_alloc_result_t& this_) { return z_internal_chunk_alloc_result_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_); }; @@ -739,8 +1020,11 @@ inline bool z_internal_check(const z_owned_fifo_handler_reply_t& this_) { return 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_liveliness_token_t& this_) { return z_internal_liveliness_token_check(&this_); }; +inline bool z_internal_check(const z_owned_memory_layout_t& this_) { return z_internal_memory_layout_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_querier_t& this_) { return z_internal_querier_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_); }; @@ -750,13 +1034,24 @@ inline bool z_internal_check(const z_owned_ring_handler_reply_t& this_) { return 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_shm_t& this_) { return z_internal_shm_check(&this_); }; +inline bool z_internal_check(const z_owned_shm_client_t& this_) { return z_internal_shm_client_check(&this_); }; +inline bool z_internal_check(const z_owned_shm_client_storage_t& this_) { return z_internal_shm_client_storage_check(&this_); }; +inline bool z_internal_check(const z_owned_shm_mut_t& this_) { return z_internal_shm_mut_check(&this_); }; +inline bool z_internal_check(const z_owned_shm_provider_t& this_) { return z_internal_shm_provider_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_source_info_t& this_) { return z_internal_source_info_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 bool z_internal_check(const zc_owned_concurrent_close_handle_t& this_) { return zc_internal_concurrent_close_handle_check(&this_); }; +inline bool z_internal_check(const zc_owned_closure_matching_status_t& this_) { return zc_internal_closure_matching_status_check(&this_); }; +inline bool z_internal_check(const zc_owned_internal_concurrent_close_handle_t& this_) { return zc_internal_concurrent_close_handle_check(&this_); }; +inline bool z_internal_check(const zc_owned_matching_listener_t& this_) { return zc_internal_matching_listener_check(&this_); }; +inline bool z_internal_check(const zc_owned_shm_client_list_t& this_) { return zc_internal_shm_client_list_check(&this_); }; +inline bool z_internal_check(const ze_owned_publication_cache_t& this_) { return ze_internal_publication_cache_check(&this_); }; +inline bool z_internal_check(const ze_owned_querying_subscriber_t& this_) { return ze_internal_querying_subscriber_check(&this_); }; inline bool z_internal_check(const ze_owned_serializer_t& this_) { return ze_internal_serializer_check(&this_); }; @@ -775,6 +1070,9 @@ inline void z_call(const z_loaned_closure_sample_t* closure, z_loaned_sample_t* 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); +}; extern "C" using z_closure_drop_callback_t = void(void* context); extern "C" using z_closure_hello_callback_t = void(z_loaned_hello_t *hello, void *context); @@ -783,6 +1081,7 @@ extern "C" using z_closure_reply_callback_t = void(z_loaned_reply_t *reply, void extern "C" using z_closure_sample_callback_t = void(z_loaned_sample_t *sample, void *context); extern "C" using z_closure_zid_callback_t = void(const z_id_t *z_id, void *context); extern "C" using zc_closure_log_callback_t = void(zc_log_severity_t severity, const z_loaned_string_t *msg, void *context); +extern "C" using zc_closure_matching_status_callback_t = void(const zc_matching_status_t *matching_status, void *context); inline void z_closure(z_owned_closure_hello_t* this_, z_closure_hello_callback_t* call, z_closure_drop_callback_t* drop, void* context) { @@ -808,6 +1107,10 @@ inline void z_closure(zc_owned_closure_log_t* this_, zc_closure_log_callback_t* z_closure_drop_callback_t* drop, void* context) { zc_closure_log(this_, call, drop, context); }; +inline void z_closure(zc_owned_closure_matching_status_t* this_, zc_closure_matching_status_callback_t* call, + z_closure_drop_callback_t* drop, void* context) { + zc_closure_matching_status(this_, call, drop, context); +}; inline z_result_t z_try_recv(const z_loaned_fifo_handler_query_t* this_, z_owned_query_t* query) { @@ -877,6 +1180,12 @@ inline void z_clone(z_owned_reply_err_t* dst, z_loaned_reply_err_t* this_) { inline void z_clone(z_owned_sample_t* dst, z_loaned_sample_t* this_) { z_sample_clone(dst, this_); }; +inline void z_clone(z_owned_shm_client_storage_t* this_, z_loaned_shm_client_storage_t* from) { + z_shm_client_storage_clone(this_, from); +}; +inline void z_clone(z_owned_shm_t* out, z_loaned_shm_t* this_) { + z_shm_clone(out, this_); +}; inline void z_clone(z_owned_slice_t* dst, z_loaned_slice_t* this_) { z_slice_clone(dst, this_); }; @@ -889,6 +1198,8 @@ inline void z_clone(z_owned_string_t* dst, z_loaned_string_t* this_) { 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_bytes_writer_t type; }; @@ -919,8 +1230,14 @@ 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_liveliness_token_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_liveliness_token_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_querier_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef z_loaned_querier_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_query_t type; }; template<> struct z_owned_to_loaned_type_t { typedef z_loaned_query_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_queryable_t type; }; @@ -939,8 +1256,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; }; @@ -949,6 +1276,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_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_publication_cache_t type; }; +template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_publication_cache_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 ze_owned_serializer_t type; }; template<> struct z_owned_to_loaned_type_t { typedef ze_loaned_serializer_t type; }; template<> struct z_loaned_to_owned_type_t { typedef z_owned_mutex_t type; }; diff --git a/splitguide.yaml b/splitguide.yaml index f31c6b7ac..cdfc89d2c 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -119,5 +119,5 @@ zenoh_opaque.h: - z_loaned_fifo_handler_reply_t! - z_owned_ring_handler_reply_t! - z_loaned_ring_handler_reply_t! - - zc_owned_concurrent_close_handle_t! + - zc_owned_internal_concurrent_close_handle_t!#unstable diff --git a/src/close.rs b/src/close.rs index 45b7962df..76a82d9a4 100644 --- a/src/close.rs +++ b/src/close.rs @@ -16,21 +16,25 @@ use std::mem::MaybeUninit; use zenoh_runtime::ZRuntime; +#[cfg(feature = "unstable")] +use crate::opaque_types::zc_owned_internal_concurrent_close_handle_t; + use crate::{ - opaque_types::zc_owned_concurrent_close_handle_t, result::{z_result_t, Z_EIO, Z_OK}, transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, - zc_moved_concurrent_close_handle_t, + zc_moved_internal_concurrent_close_handle_t, }; + +#[cfg(feature = "unstable")] decl_c_type!( - owned(zc_owned_concurrent_close_handle_t, option tokio::task::JoinHandle>), + owned(zc_owned_internal_concurrent_close_handle_t, option tokio::task::JoinHandle>), ); /// @brief Blocking wait on close handle to complete. Returns `Z_EIO` if close finishes with error. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn zc_concurrent_close_handle_wait( - handle: &mut zc_moved_concurrent_close_handle_t, + handle: &mut zc_moved_internal_concurrent_close_handle_t, ) -> z_result_t { match ZRuntime::Application.block_on(handle.take_rust_type().unwrap_unchecked()) { Ok(_) => Z_OK, @@ -43,14 +47,14 @@ pub unsafe extern "C" fn zc_concurrent_close_handle_wait( /// @brief Drops the close handle. The concurrent close task will not be interrupted. #[no_mangle] -pub extern "C" fn zc_concurrent_close_handle_drop(this_: &mut zc_moved_concurrent_close_handle_t) { +pub extern "C" fn zc_concurrent_close_handle_drop(this_: &mut zc_moved_internal_concurrent_close_handle_t) { let _ = this_.take_rust_type(); } /// @brief Returns ``true`` if concurrent close handle is valid, ``false`` if it is in gravestone state. #[no_mangle] pub extern "C" fn zc_internal_concurrent_close_handle_check( - this_: &zc_owned_concurrent_close_handle_t, + this_: &zc_owned_internal_concurrent_close_handle_t, ) -> bool { this_.as_rust_type_ref().is_some() } @@ -58,7 +62,7 @@ pub extern "C" fn zc_internal_concurrent_close_handle_check( /// @brief Constructs concurrent close handle in its gravestone state. #[no_mangle] pub extern "C" fn zc_internal_concurrent_close_handle_null( - this_: &mut MaybeUninit, + this_: &mut MaybeUninit, ) { this_.as_rust_type_mut_uninit().write(None); } diff --git a/src/lib.rs b/src/lib.rs index eaa57d570..e4a117bd2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -29,7 +29,9 @@ pub mod result; pub use crate::collections::*; mod config; pub use crate::config::*; +#[cfg(feature = "unstable")] mod close; +#[cfg(feature = "unstable")] pub use crate::close::*; pub mod encoding; pub use crate::encoding::*; diff --git a/src/session.rs b/src/session.rs index b8f5640ae..85b63a79f 100644 --- a/src/session.rs +++ b/src/session.rs @@ -18,11 +18,13 @@ use zenoh::{Session, Wait}; #[cfg(all(feature = "shared-memory", feature = "unstable"))] use crate::z_loaned_shm_client_storage_t; +#[cfg(feature = "unstable")] +use crate::zc_owned_internal_concurrent_close_handle_t; use crate::{ opaque_types::{z_loaned_session_t, z_owned_session_t}, result, transmute::{LoanedCTypeRef, RustTypeRef, RustTypeRefUninit, TakeRustType}, - z_moved_config_t, z_moved_session_t, zc_owned_concurrent_close_handle_t, + z_moved_config_t, z_moved_session_t, }; decl_c_type!( owned(z_owned_session_t, option Session), @@ -145,21 +147,27 @@ pub extern "C" fn z_internal_session_check(this_: &z_owned_session_t) -> bool { /// Options passed to the `z_close()` function. #[repr(C)] pub struct z_close_options_t { + #[cfg(feature = "unstable")] + #[doc(hidden)] /// The timeout for close operation in milliseconds. 0 means default close timeout which is 10 seconds. - timeout_ms: u32, + internal_timeout_ms: u32, + #[cfg(feature = "unstable")] + #[doc(hidden)] /// An optional uninitialized concurrent close handle. If set, the close operation will be executed /// concurrently in separate task, and this handle will be initialized to be used for controlling /// it's execution. - out_concurrent: Option<&'static mut MaybeUninit>, + internal_out_concurrent: Option<&'static mut MaybeUninit>, } /// Constructs the default value for `z_close_options_t`. #[no_mangle] +#[allow(unused)] pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit) { + #[cfg(feature = "unstable")] this_.write(z_close_options_t { - timeout_ms: 0, - out_concurrent: None, + internal_timeout_ms: 0, + internal_out_concurrent: None, }); } @@ -169,18 +177,21 @@ pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit, ) -> result::z_result_t { + #[allow(unused_mut)] let mut close_builder = session.as_rust_type_mut().close(); + #[cfg(feature = "unstable")] if let Some(options) = options { - if options.timeout_ms != 0 { + if options.internal_timeout_ms != 0 { close_builder = - close_builder.timeout(core::time::Duration::from_millis(options.timeout_ms as u64)) + close_builder.timeout(core::time::Duration::from_millis(options.internal_timeout_ms as u64)) } - if let Some(close_handle) = &mut options.out_concurrent { - let handle = close_builder.concurrently(); + if let Some(close_handle) = &mut options.internal_out_concurrent { + let handle = close_builder.in_background().wait(); close_handle.as_rust_type_mut_uninit().write(Some(handle)); return result::Z_OK; } diff --git a/tests/z_api_session_test.c b/tests/z_api_session_test.c index 14f47ed0d..926adbd97 100644 --- a/tests/z_api_session_test.c +++ b/tests/z_api_session_test.c @@ -53,6 +53,7 @@ void close_sync() { } void close_concurrent() { +#if defined(Z_FEATURE_UNSTABLE_API) z_owned_config_t config; z_config_default(&config); @@ -62,11 +63,11 @@ void close_concurrent() { exit(-1); } - zc_owned_concurrent_close_handle_t close_handle; + zc_owned_internal_concurrent_close_handle_t close_handle; z_close_options_t options; z_close_options_default(&options); - options.out_concurrent = &close_handle; + options.internal_out_concurrent = &close_handle; if (z_close(z_loan_mut(s), &options) < 0) { perror("Error starting concurrent session close!"); @@ -79,6 +80,7 @@ void close_concurrent() { } z_drop(z_move(s)); +#endif } int main(int argc, char **argv) { From 2a7ef772135a456c76d724d0677c1ce40656ee8a Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 4 Dec 2024 12:37:19 +0300 Subject: [PATCH 4/7] fix format --- src/close.rs | 5 +++-- src/session.rs | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/close.rs b/src/close.rs index 76a82d9a4..b3bdd180c 100644 --- a/src/close.rs +++ b/src/close.rs @@ -18,7 +18,6 @@ use zenoh_runtime::ZRuntime; #[cfg(feature = "unstable")] use crate::opaque_types::zc_owned_internal_concurrent_close_handle_t; - use crate::{ result::{z_result_t, Z_EIO, Z_OK}, transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, @@ -47,7 +46,9 @@ pub unsafe extern "C" fn zc_concurrent_close_handle_wait( /// @brief Drops the close handle. The concurrent close task will not be interrupted. #[no_mangle] -pub extern "C" fn zc_concurrent_close_handle_drop(this_: &mut zc_moved_internal_concurrent_close_handle_t) { +pub extern "C" fn zc_concurrent_close_handle_drop( + this_: &mut zc_moved_internal_concurrent_close_handle_t, +) { let _ = this_.take_rust_type(); } diff --git a/src/session.rs b/src/session.rs index 85b63a79f..b298615cf 100644 --- a/src/session.rs +++ b/src/session.rs @@ -157,7 +157,8 @@ pub struct z_close_options_t { /// An optional uninitialized concurrent close handle. If set, the close operation will be executed /// concurrently in separate task, and this handle will be initialized to be used for controlling /// it's execution. - internal_out_concurrent: Option<&'static mut MaybeUninit>, + internal_out_concurrent: + Option<&'static mut MaybeUninit>, } /// Constructs the default value for `z_close_options_t`. @@ -177,8 +178,7 @@ pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit, + #[allow(unused)] options: Option<&mut z_close_options_t>, ) -> result::z_result_t { #[allow(unused_mut)] let mut close_builder = session.as_rust_type_mut().close(); @@ -186,8 +186,9 @@ pub extern "C" fn z_close( #[cfg(feature = "unstable")] if let Some(options) = options { if options.internal_timeout_ms != 0 { - close_builder = - close_builder.timeout(core::time::Duration::from_millis(options.internal_timeout_ms as u64)) + close_builder = close_builder.timeout(core::time::Duration::from_millis( + options.internal_timeout_ms as u64, + )) } if let Some(close_handle) = &mut options.internal_out_concurrent { From 43bb850b6df90e6b0ac458fc434436d19992e6be Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 4 Dec 2024 13:42:11 +0300 Subject: [PATCH 5/7] fix some naming --- build-resources/opaque-types/src/lib.rs | 2 +- include/zenoh_commons.h | 17 +++++++-------- include/zenoh_macros.h | 28 ++++++++++++------------- splitguide.yaml | 2 +- src/close.rs | 14 ++++++------- src/session.rs | 4 ++-- tests/z_api_session_test.c | 2 +- 7 files changed, 34 insertions(+), 35 deletions(-) diff --git a/build-resources/opaque-types/src/lib.rs b/build-resources/opaque-types/src/lib.rs index cec6121ee..e5f958675 100644 --- a/build-resources/opaque-types/src/lib.rs +++ b/build-resources/opaque-types/src/lib.rs @@ -195,7 +195,7 @@ get_opaque_type_data!(Session, z_loaned_session_t); #[cfg(feature = "unstable")] /// An owned Close handle -get_opaque_type_data!(Option>>, zc_owned_internal_concurrent_close_handle_t); +get_opaque_type_data!(Option>>, zc_owned_concurrent_close_handle_t); /// An owned Zenoh configuration. get_opaque_type_data!(Option, z_owned_config_t); diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 922da42f2..5a2cd8cd4 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -291,7 +291,7 @@ typedef struct z_close_options_t { * concurrently in separate task, and this handle will be initialized to be used for controlling * it's execution. */ - struct zc_owned_internal_concurrent_close_handle_t *internal_out_concurrent; + struct zc_owned_concurrent_close_handle_t *internal_out_concurrent; #endif } z_close_options_t; /** @@ -990,9 +990,9 @@ typedef struct zc_moved_closure_matching_status_t { struct zc_owned_closure_matching_status_t _this; } zc_moved_closure_matching_status_t; #endif -typedef struct zc_moved_internal_concurrent_close_handle_t { - struct zc_owned_internal_concurrent_close_handle_t _this; -} zc_moved_internal_concurrent_close_handle_t; +typedef struct zc_moved_concurrent_close_handle_t { + struct zc_owned_concurrent_close_handle_t _this; +} zc_moved_concurrent_close_handle_t; typedef struct zc_moved_matching_listener_t { struct zc_owned_matching_listener_t _this; } zc_moved_matching_listener_t; @@ -4859,15 +4859,14 @@ const struct zc_loaned_closure_matching_status_t *zc_closure_matching_status_loa * @brief Drops the close handle. The concurrent close task will not be interrupted. */ #if defined(Z_FEATURE_UNSTABLE_API) -ZENOHC_API -void zc_concurrent_close_handle_drop(struct zc_moved_internal_concurrent_close_handle_t *this_); +ZENOHC_API void zc_concurrent_close_handle_drop(struct zc_moved_concurrent_close_handle_t *this_); #endif /** * @brief Blocking wait on close handle to complete. Returns `Z_EIO` if close finishes with error. */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -z_result_t zc_concurrent_close_handle_wait(struct zc_moved_internal_concurrent_close_handle_t *handle); +z_result_t zc_concurrent_close_handle_wait(struct zc_moved_concurrent_close_handle_t *handle); #endif /** * Constructs a configuration by parsing a file path stored in ZENOH_CONFIG environmental variable. @@ -4984,14 +4983,14 @@ void zc_internal_closure_matching_status_null(struct zc_owned_closure_matching_s */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -bool zc_internal_concurrent_close_handle_check(const struct zc_owned_internal_concurrent_close_handle_t *this_); +bool zc_internal_concurrent_close_handle_check(const struct zc_owned_concurrent_close_handle_t *this_); #endif /** * @brief Constructs concurrent close handle in its gravestone state. */ #if defined(Z_FEATURE_UNSTABLE_API) ZENOHC_API -void zc_internal_concurrent_close_handle_null(struct zc_owned_internal_concurrent_close_handle_t *this_); +void zc_internal_concurrent_close_handle_null(struct zc_owned_concurrent_close_handle_t *this_); #endif /** * @warning This API has been marked as unstable: it works as advertised, but it may be changed in a future release. diff --git a/include/zenoh_macros.h b/include/zenoh_macros.h index 4f4e40fbc..62b5462a0 100644 --- a/include/zenoh_macros.h +++ b/include/zenoh_macros.h @@ -48,7 +48,7 @@ static inline z_moved_subscriber_t* z_subscriber_move(z_owned_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_internal_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_internal_concurrent_close_handle_t* x) { return (zc_moved_internal_concurrent_close_handle_t*)(x); } +static inline zc_moved_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_concurrent_close_handle_t* x) { return (zc_moved_concurrent_close_handle_t*)(x); } static inline zc_moved_matching_listener_t* zc_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); } @@ -175,7 +175,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_internal_concurrent_close_handle_t* : zc_concurrent_close_handle_drop, \ + zc_moved_concurrent_close_handle_t* : zc_concurrent_close_handle_drop, \ zc_moved_matching_listener_t* : zc_matching_listener_drop, \ zc_moved_shm_client_list_t* : zc_shm_client_list_drop, \ ze_moved_publication_cache_t* : ze_publication_cache_drop, \ @@ -229,7 +229,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x 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_internal_concurrent_close_handle_t : zc_concurrent_close_handle_move, \ + zc_owned_concurrent_close_handle_t : zc_concurrent_close_handle_move, \ zc_owned_matching_listener_t : zc_matching_listener_move, \ zc_owned_shm_client_list_t : zc_shm_client_list_move, \ ze_owned_publication_cache_t : ze_publication_cache_move, \ @@ -283,7 +283,7 @@ static inline ze_moved_serializer_t* ze_serializer_move(ze_owned_serializer_t* x z_owned_task_t* : z_internal_task_null, \ zc_owned_closure_log_t* : zc_internal_closure_log_null, \ zc_owned_closure_matching_status_t* : zc_internal_closure_matching_status_null, \ - zc_owned_internal_concurrent_close_handle_t* : zc_internal_concurrent_close_handle_null, \ + zc_owned_concurrent_close_handle_t* : zc_internal_concurrent_close_handle_null, \ zc_owned_matching_listener_t* : zc_internal_matching_listener_null, \ zc_owned_shm_client_list_t* : zc_internal_shm_client_list_null, \ ze_owned_publication_cache_t* : ze_internal_publication_cache_null, \ @@ -335,7 +335,7 @@ static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscr 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); } 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_internal_closure_matching_status_null(&x->_this); } -static inline void zc_concurrent_close_handle_take(zc_owned_internal_concurrent_close_handle_t* this_, zc_moved_internal_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_internal_concurrent_close_handle_null(&x->_this); } +static inline void zc_concurrent_close_handle_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_concurrent_close_handle_null(&x->_this); } static inline void zc_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_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_internal_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_internal_publication_cache_null(&x->_this); } @@ -389,7 +389,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser 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_internal_concurrent_close_handle_t* : zc_concurrent_close_handle_take, \ + zc_owned_concurrent_close_handle_t* : zc_concurrent_close_handle_take, \ zc_owned_matching_listener_t* : zc_matching_listener_take, \ zc_owned_shm_client_list_t* : zc_shm_client_list_take, \ ze_owned_publication_cache_t* : ze_publication_cache_take, \ @@ -443,7 +443,7 @@ static inline void ze_serializer_take(ze_owned_serializer_t* this_, ze_moved_ser z_owned_task_t : z_internal_task_check, \ zc_owned_closure_log_t : zc_internal_closure_log_check, \ zc_owned_closure_matching_status_t : zc_internal_closure_matching_status_check, \ - zc_owned_internal_concurrent_close_handle_t : zc_internal_concurrent_close_handle_check, \ + zc_owned_concurrent_close_handle_t : zc_internal_concurrent_close_handle_check, \ zc_owned_matching_listener_t : zc_internal_matching_listener_check, \ zc_owned_shm_client_list_t : zc_internal_shm_client_list_check, \ ze_owned_publication_cache_t : ze_internal_publication_cache_check, \ @@ -565,7 +565,7 @@ static inline z_moved_subscriber_t* z_subscriber_move(z_owned_subscriber_t* 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_internal_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_internal_concurrent_close_handle_t* x) { return reinterpret_cast(x); } +static inline zc_moved_concurrent_close_handle_t* zc_concurrent_close_handle_move(zc_owned_concurrent_close_handle_t* x) { return reinterpret_cast(x); } static inline zc_moved_matching_listener_t* zc_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); } @@ -687,7 +687,7 @@ 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_internal_concurrent_close_handle_t* this_) { zc_concurrent_close_handle_drop(this_); }; +inline void z_drop(zc_moved_concurrent_close_handle_t* this_) { zc_concurrent_close_handle_drop(this_); }; inline void z_drop(zc_moved_matching_listener_t* this_) { zc_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_); }; @@ -739,7 +739,7 @@ inline z_moved_subscriber_t* z_move(z_owned_subscriber_t& this_) { return z_subs 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_internal_concurrent_close_handle_t* z_move(zc_owned_internal_concurrent_close_handle_t& this_) { return zc_concurrent_close_handle_move(&this_); }; +inline zc_moved_concurrent_close_handle_t* z_move(zc_owned_concurrent_close_handle_t& this_) { return zc_concurrent_close_handle_move(&this_); }; inline zc_moved_matching_listener_t* z_move(zc_owned_matching_listener_t& this_) { return zc_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_); }; @@ -791,7 +791,7 @@ inline void z_internal_null(z_owned_subscriber_t* this_) { z_internal_subscriber 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_); }; inline void z_internal_null(zc_owned_closure_matching_status_t* this_) { zc_internal_closure_matching_status_null(this_); }; -inline void z_internal_null(zc_owned_internal_concurrent_close_handle_t* this_) { zc_internal_concurrent_close_handle_null(this_); }; +inline void z_internal_null(zc_owned_concurrent_close_handle_t* this_) { zc_internal_concurrent_close_handle_null(this_); }; inline void z_internal_null(zc_owned_matching_listener_t* this_) { zc_internal_matching_listener_null(this_); }; inline void z_internal_null(zc_owned_shm_client_list_t* this_) { zc_internal_shm_client_list_null(this_); }; inline void z_internal_null(ze_owned_publication_cache_t* this_) { ze_internal_publication_cache_null(this_); }; @@ -842,7 +842,7 @@ static inline void z_subscriber_take(z_owned_subscriber_t* this_, z_moved_subscr 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); } 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_internal_closure_matching_status_null(&x->_this); } -static inline void zc_concurrent_close_handle_take(zc_owned_internal_concurrent_close_handle_t* this_, zc_moved_internal_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_internal_concurrent_close_handle_null(&x->_this); } +static inline void zc_concurrent_close_handle_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { *this_ = x->_this; zc_internal_concurrent_close_handle_null(&x->_this); } static inline void zc_matching_listener_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { *this_ = x->_this; zc_internal_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_internal_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_internal_publication_cache_null(&x->_this); } @@ -983,7 +983,7 @@ inline void z_take(zc_owned_closure_log_t* closure_, zc_moved_closure_log_t* 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_internal_concurrent_close_handle_t* this_, zc_moved_internal_concurrent_close_handle_t* x) { +inline void z_take(zc_owned_concurrent_close_handle_t* this_, zc_moved_concurrent_close_handle_t* x) { zc_concurrent_close_handle_take(this_, x); }; inline void z_take(zc_owned_matching_listener_t* this_, zc_moved_matching_listener_t* x) { @@ -1047,7 +1047,7 @@ inline bool z_internal_check(const z_owned_subscriber_t& this_) { return z_inter 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 bool z_internal_check(const zc_owned_closure_matching_status_t& this_) { return zc_internal_closure_matching_status_check(&this_); }; -inline bool z_internal_check(const zc_owned_internal_concurrent_close_handle_t& this_) { return zc_internal_concurrent_close_handle_check(&this_); }; +inline bool z_internal_check(const zc_owned_concurrent_close_handle_t& this_) { return zc_internal_concurrent_close_handle_check(&this_); }; inline bool z_internal_check(const zc_owned_matching_listener_t& this_) { return zc_internal_matching_listener_check(&this_); }; inline bool z_internal_check(const zc_owned_shm_client_list_t& this_) { return zc_internal_shm_client_list_check(&this_); }; inline bool z_internal_check(const ze_owned_publication_cache_t& this_) { return ze_internal_publication_cache_check(&this_); }; diff --git a/splitguide.yaml b/splitguide.yaml index cdfc89d2c..8ba0bf0d5 100644 --- a/splitguide.yaml +++ b/splitguide.yaml @@ -119,5 +119,5 @@ zenoh_opaque.h: - z_loaned_fifo_handler_reply_t! - z_owned_ring_handler_reply_t! - z_loaned_ring_handler_reply_t! - - zc_owned_internal_concurrent_close_handle_t!#unstable + - zc_owned_concurrent_close_handle_t!#unstable diff --git a/src/close.rs b/src/close.rs index b3bdd180c..de6a36b51 100644 --- a/src/close.rs +++ b/src/close.rs @@ -17,23 +17,23 @@ use std::mem::MaybeUninit; use zenoh_runtime::ZRuntime; #[cfg(feature = "unstable")] -use crate::opaque_types::zc_owned_internal_concurrent_close_handle_t; +use crate::opaque_types::zc_owned_concurrent_close_handle_t; use crate::{ result::{z_result_t, Z_EIO, Z_OK}, transmute::{RustTypeRef, RustTypeRefUninit, TakeRustType}, - zc_moved_internal_concurrent_close_handle_t, + zc_moved_concurrent_close_handle_t, }; #[cfg(feature = "unstable")] decl_c_type!( - owned(zc_owned_internal_concurrent_close_handle_t, option tokio::task::JoinHandle>), + owned(zc_owned_concurrent_close_handle_t, option tokio::task::JoinHandle>), ); /// @brief Blocking wait on close handle to complete. Returns `Z_EIO` if close finishes with error. #[no_mangle] #[allow(clippy::missing_safety_doc)] pub unsafe extern "C" fn zc_concurrent_close_handle_wait( - handle: &mut zc_moved_internal_concurrent_close_handle_t, + handle: &mut zc_moved_concurrent_close_handle_t, ) -> z_result_t { match ZRuntime::Application.block_on(handle.take_rust_type().unwrap_unchecked()) { Ok(_) => Z_OK, @@ -47,7 +47,7 @@ pub unsafe extern "C" fn zc_concurrent_close_handle_wait( /// @brief Drops the close handle. The concurrent close task will not be interrupted. #[no_mangle] pub extern "C" fn zc_concurrent_close_handle_drop( - this_: &mut zc_moved_internal_concurrent_close_handle_t, + this_: &mut zc_moved_concurrent_close_handle_t, ) { let _ = this_.take_rust_type(); } @@ -55,7 +55,7 @@ pub extern "C" fn zc_concurrent_close_handle_drop( /// @brief Returns ``true`` if concurrent close handle is valid, ``false`` if it is in gravestone state. #[no_mangle] pub extern "C" fn zc_internal_concurrent_close_handle_check( - this_: &zc_owned_internal_concurrent_close_handle_t, + this_: &zc_owned_concurrent_close_handle_t, ) -> bool { this_.as_rust_type_ref().is_some() } @@ -63,7 +63,7 @@ pub extern "C" fn zc_internal_concurrent_close_handle_check( /// @brief Constructs concurrent close handle in its gravestone state. #[no_mangle] pub extern "C" fn zc_internal_concurrent_close_handle_null( - this_: &mut MaybeUninit, + this_: &mut MaybeUninit, ) { this_.as_rust_type_mut_uninit().write(None); } diff --git a/src/session.rs b/src/session.rs index b298615cf..d656999c3 100644 --- a/src/session.rs +++ b/src/session.rs @@ -19,7 +19,7 @@ use zenoh::{Session, Wait}; #[cfg(all(feature = "shared-memory", feature = "unstable"))] use crate::z_loaned_shm_client_storage_t; #[cfg(feature = "unstable")] -use crate::zc_owned_internal_concurrent_close_handle_t; +use crate::zc_owned_concurrent_close_handle_t; use crate::{ opaque_types::{z_loaned_session_t, z_owned_session_t}, result, @@ -158,7 +158,7 @@ pub struct z_close_options_t { /// concurrently in separate task, and this handle will be initialized to be used for controlling /// it's execution. internal_out_concurrent: - Option<&'static mut MaybeUninit>, + Option<&'static mut MaybeUninit>, } /// Constructs the default value for `z_close_options_t`. diff --git a/tests/z_api_session_test.c b/tests/z_api_session_test.c index 926adbd97..64cacc046 100644 --- a/tests/z_api_session_test.c +++ b/tests/z_api_session_test.c @@ -63,7 +63,7 @@ void close_concurrent() { exit(-1); } - zc_owned_internal_concurrent_close_handle_t close_handle; + zc_owned_concurrent_close_handle_t close_handle; z_close_options_t options; z_close_options_default(&options); From ae0ea3572f27b5ff2a8fe43fba0cde390d946829 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 4 Dec 2024 13:46:12 +0300 Subject: [PATCH 6/7] fix format --- src/close.rs | 4 +--- src/session.rs | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/close.rs b/src/close.rs index de6a36b51..de12254ac 100644 --- a/src/close.rs +++ b/src/close.rs @@ -46,9 +46,7 @@ pub unsafe extern "C" fn zc_concurrent_close_handle_wait( /// @brief Drops the close handle. The concurrent close task will not be interrupted. #[no_mangle] -pub extern "C" fn zc_concurrent_close_handle_drop( - this_: &mut zc_moved_concurrent_close_handle_t, -) { +pub extern "C" fn zc_concurrent_close_handle_drop(this_: &mut zc_moved_concurrent_close_handle_t) { let _ = this_.take_rust_type(); } diff --git a/src/session.rs b/src/session.rs index d656999c3..7823b72f9 100644 --- a/src/session.rs +++ b/src/session.rs @@ -157,8 +157,7 @@ pub struct z_close_options_t { /// An optional uninitialized concurrent close handle. If set, the close operation will be executed /// concurrently in separate task, and this handle will be initialized to be used for controlling /// it's execution. - internal_out_concurrent: - Option<&'static mut MaybeUninit>, + internal_out_concurrent: Option<&'static mut MaybeUninit>, } /// Constructs the default value for `z_close_options_t`. From 024519fa901e1a7c25793cc8e1c10819c0b42699 Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Wed, 4 Dec 2024 14:20:28 +0300 Subject: [PATCH 7/7] fix windows build --- include/zenoh_commons.h | 3 +++ src/session.rs | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/zenoh_commons.h b/include/zenoh_commons.h index 5a2cd8cd4..e77821ef4 100644 --- a/include/zenoh_commons.h +++ b/include/zenoh_commons.h @@ -293,6 +293,9 @@ typedef struct z_close_options_t { */ struct zc_owned_concurrent_close_handle_t *internal_out_concurrent; #endif +#if !defined(Z_FEATURE_UNSTABLE_API) + uint8_t _dummy; +#endif } z_close_options_t; /** * @brief A hello message-processing closure. diff --git a/src/session.rs b/src/session.rs index 7823b72f9..879adc9b6 100644 --- a/src/session.rs +++ b/src/session.rs @@ -158,16 +158,22 @@ pub struct z_close_options_t { /// concurrently in separate task, and this handle will be initialized to be used for controlling /// it's execution. internal_out_concurrent: Option<&'static mut MaybeUninit>, + + #[cfg(not(feature = "unstable"))] + _dummy: u8, } /// Constructs the default value for `z_close_options_t`. #[no_mangle] #[allow(unused)] pub extern "C" fn z_close_options_default(this_: &mut MaybeUninit) { - #[cfg(feature = "unstable")] this_.write(z_close_options_t { + #[cfg(feature = "unstable")] internal_timeout_ms: 0, + #[cfg(feature = "unstable")] internal_out_concurrent: None, + #[cfg(not(feature = "unstable"))] + _dummy: 0, }); }